/* ── 搜尋：沉浸式無外框命令面板 ── */
.search-panel {
  width: min(100%, 680px);
  max-height: min(88vh, 660px);
}

.search-panel .focus-kicker {
  color: var(--stamp-approved-text);
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 17px;
  border: 1px solid rgba(255, 255, 255, .65);
  border-radius: 17px;
  background: rgba(248, 248, 246, .94);
  box-shadow: var(--shadow-sm);
}

.search-input-icon {
  flex: 0 0 auto;
  color: var(--muted);
  opacity: .78;
}

#searchInput {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  font: inherit;
  font-size: 16px;
}

#searchInput::placeholder {
  color: rgba(58, 58, 61, .5);
}

.search-results {
  min-height: 144px;
  margin-top: 12px;
  padding: 7px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 19px;
  background: rgba(248, 248, 246, .72);
  box-shadow: var(--shadow-xs);
}

.search-section-title {
  padding: 11px 14px 5px;
  color: rgba(58, 58, 61, .48);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.search-result {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 10px 14px;
  border-radius: 13px;
  cursor: pointer;
  transition: background-color 160ms ease, transform 160ms ease;
}

.search-result:hover,
.search-result.is-active {
  background: rgba(255, 255, 255, .72);
}

.search-result.is-active {
  transform: translateX(2px);
}

.search-result-dot {
  width: 9px;
  height: 9px;
  justify-self: center;
  border-radius: 50%;
  background: var(--pastel-mint);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5);
  transition: transform var(--tr);
}

.search-result[data-section="studio"] .search-result-dot { background: var(--pastel-sky); }
.search-result[data-section="flow"] .search-result-dot { background: var(--pastel-mint); }
.search-result[data-section="comment"] .search-result-dot { background: var(--pastel-blush); }
.search-result[data-section="attachment"] .search-result-dot { background: var(--pastel-butter); }
.search-result.is-active .search-result-dot { transform: scale(1.35); }

.search-result-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.search-result-title {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-sub {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-chip {
  flex: 0 0 auto;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--pastel-butter);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}

.search-result[data-section="comment"] .search-result-chip { background: var(--pastel-blush); }
.search-result[data-section="attachment"] .search-result-chip { background: var(--pastel-sky); }

mark {
  border-radius: 3px;
  background: var(--pastel-butter);
  color: var(--text);
  padding: 0 2px;
  font-weight: 700;
}

.search-result[data-section="comment"] mark {
  background: var(--pastel-blush);
}

.search-empty {
  min-height: 128px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
  padding: 30px;
  text-align: center;
}

.search-empty-icon {
  color: rgba(58, 58, 61, .42);
}

.search-empty-text {
  font-size: 13px;
  line-height: 1.7;
}

.search-empty-text kbd,
.search-footer kbd {
  min-width: 22px;
  height: 21px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 2px;
  padding: 0 5px;
  border: 1px solid rgba(58, 58, 61, .14);
  border-radius: 6px;
  background: rgba(248, 248, 246, .86);
  color: var(--text);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px;
  font-weight: 700;
}

.search-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 11px 4px 0;
  color: rgba(58, 58, 61, .62);
  font-size: 11px;
}

.search-panel .focus-dialog-actions {
  margin-top: 16px;
}

@media (max-width: 540px) {
  .search-panel {
    max-height: none;
  }

  .search-results {
    max-height: 48vh;
  }

  .search-result {
    grid-template-columns: 14px minmax(0, 1fr);
  }

  .search-result-chip {
    display: none;
  }

  .search-footer {
    display: none;
  }
}
