:root {
  --bg: #0f1714;
  --panel: rgba(24, 37, 33, 0.82);
  --panel-strong: rgba(28, 44, 39, 0.94);
  --line: rgba(187, 213, 192, 0.12);
  --text: #edf4ef;
  --muted: #9fb0a6;
  --accent: #dbc17d;
  --accent-strong: #f1cf75;
  --warn: #e9a56f;
  --ok: #84c59d;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}

@font-face {
  font-family: "Cormorant Garamond";
  src: url("/assets/fonts/CormorantGaramond-SemiBold.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Cormorant Garamond";
  src: url("/assets/fonts/CormorantGaramond-Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "IBM Plex Sans", "Segoe UI Variable Text", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(219, 193, 125, 0.16), transparent 28%),
    radial-gradient(circle at 85% 0%, rgba(91, 133, 112, 0.22), transparent 30%),
    linear-gradient(180deg, #10211b 0%, #0f1714 48%, #111714 100%);
}

body.lightbox-opened {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  width: min(1500px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(46, 70, 61, 0.88), rgba(17, 28, 24, 0.9)),
    rgba(18, 28, 24, 0.88);
  box-shadow: var(--shadow);
}

.hero.compact {
  align-items: end;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-size: 12px;
}

.hero h1 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(42px, 6vw, 64px);
  line-height: 0.96;
  font-weight: 600;
}

.hero-copy {
  max-width: 760px;
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.hero-nav {
  display: flex;
  gap: 12px;
  align-items: start;
  flex-wrap: wrap;
}

.ghost-link,
.secondary-button,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.ghost-link:hover,
.secondary-button:hover,
.primary-button:hover {
  transform: translateY(-1px);
  border-color: rgba(219, 193, 125, 0.32);
}

.primary-button {
  border-color: rgba(219, 193, 125, 0.42);
  background: linear-gradient(135deg, rgba(219, 193, 125, 0.22), rgba(219, 193, 125, 0.1));
}

.layout-grid {
  display: grid;
  grid-template-columns: minmax(290px, 360px) minmax(0, 1fr) minmax(250px, 320px);
  gap: 18px;
}

.board-layout {
  margin-top: 10px;
}

.board-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.panel,
.board-column {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.panel {
  padding: 22px;
}

.board-column {
  padding: 18px;
}

.panel-head,
.column-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 18px;
}

.panel-head h2,
.column-head h2 {
  margin: 0;
  font-size: 18px;
}

.panel-head p,
.column-head span {
  margin: 4px 0 0;
  color: var(--muted);
}

.search-form,
.field-row {
  display: grid;
  gap: 14px;
}

.field-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: var(--muted);
  font-size: 13px;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.field textarea {
  resize: vertical;
  min-height: 120px;
}

.dropzone {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 180px;
  padding: 18px;
  border: 1px dashed rgba(219, 193, 125, 0.32);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(219, 193, 125, 0.07), transparent 55%),
    rgba(255, 255, 255, 0.02);
  text-align: center;
  cursor: pointer;
}

.dropzone input {
  display: none;
}

.dropzone span {
  font-size: 18px;
  font-weight: 600;
}

.dropzone small {
  color: var(--muted);
  line-height: 1.6;
}

.preview-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.preview-strip.empty,
.history-list.empty {
  display: block;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
}

.preview-card {
  overflow: hidden;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
}

.preview-card img,
.result-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.result-image {
  cursor: zoom-in;
}

.preview-card span {
  display: block;
  padding: 10px 12px 12px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.button-row {
  display: flex;
  gap: 10px;
}

.site-presets {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.site-preset {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.site-preset:hover {
  transform: translateY(-1px);
  border-color: rgba(219, 193, 125, 0.32);
  color: var(--text);
}

.site-preset.active {
  border-color: rgba(219, 193, 125, 0.42);
  background: linear-gradient(135deg, rgba(219, 193, 125, 0.18), rgba(219, 193, 125, 0.08));
  color: var(--accent-strong);
}

.results-head {
  align-items: center;
}

.status-pill {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.status-pill.busy {
  color: var(--accent-strong);
  background: rgba(219, 193, 125, 0.12);
}

.status-pill.ok {
  color: var(--ok);
  background: rgba(132, 197, 157, 0.12);
}

.status-pill.warn {
  color: var(--warn);
  background: rgba(233, 165, 111, 0.12);
}

.query-tags,
.warnings {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.query-tags[hidden] {
  display: none;
}

.query-chip,
.warning {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.query-chip strong {
  display: block;
  margin-bottom: 4px;
  color: var(--accent);
}

.query-chip span,
.warning {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.result-card,
.board-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel-strong);
}

.result-media {
  position: relative;
}

.empty-state {
  display: block;
}

.empty-card,
.board-empty {
  padding: 28px;
  border-radius: 20px;
  border: 1px dashed var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
}

.empty-card h3 {
  margin-top: 0;
}

.result-body {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.result-body h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.45;
}

.result-card .result-body h3 {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.source-line {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.result-topline,
.card-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.site-pill,
.score-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 12px;
}

.score-pill {
  color: var(--accent-strong);
}

.ranking-line {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.result-card .card-actions {
  justify-content: flex-start;
}

.favorite-button {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  padding: 8px 12px;
  border: 1px solid rgba(219, 193, 125, 0.32);
  border-radius: 999px;
  background: rgba(16, 26, 23, 0.82);
  color: var(--text);
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.favorite-button:hover {
  transform: translateY(-1px);
  border-color: rgba(219, 193, 125, 0.52);
}

.favorite-button.saved {
  border-color: rgba(132, 197, 157, 0.38);
  background: rgba(132, 197, 157, 0.14);
  color: var(--ok);
}

.favorite-button:disabled {
  cursor: wait;
  opacity: 0.88;
}

.history-list {
  display: grid;
  gap: 10px;
}

.history-item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.history-item span,
.history-item small {
  color: var(--muted);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 9, 8, 0.76);
  backdrop-filter: blur(12px);
}

.lightbox-dialog {
  position: relative;
  z-index: 1;
  width: min(1100px, 100%);
  max-height: calc(100vh - 48px);
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(219, 193, 125, 0.2);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(29, 43, 39, 0.96), rgba(15, 23, 20, 0.98)),
    rgba(15, 23, 20, 0.96);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.42);
}

.lightbox-head,
.lightbox-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.lightbox-title {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
}

.lightbox-note {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.lightbox-close {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
}

.lightbox-image {
  width: 100%;
  max-height: min(75vh, 900px);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  object-fit: contain;
}

body.search-page {
  color: #1c1917;
  font-family: "Segoe UI Variable Text", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.72), transparent 28%),
    radial-gradient(circle at 82% 10%, rgba(226, 218, 204, 0.52), transparent 24%),
    linear-gradient(180deg, #f8f6f1 0%, #f7f5f0 100%);
}

.search-page .minimal-shell {
  width: min(1600px, calc(100% - 64px));
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 0 28px;
}

.search-page .search-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 0 112px;
  transition: padding 280ms ease, transform 280ms ease;
}

.search-page.has-results .search-stage {
  align-items: flex-start;
  padding: 24px 0 24px;
}

.search-page .search-stage-inner {
  width: 100%;
  display: flex;
  justify-content: center;
  transition: transform 280ms ease, opacity 280ms ease;
}

.search-page .session-bar {
  width: 100%;
  padding-top: 32px;
}

.search-page .session-bar-inner {
  width: min(100%, 1152px);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  box-sizing: border-box;
}

.search-page .session-links {
  display: inline-flex;
  align-items: center;
  gap: 32px;
}

.search-page .session-link,
.search-page .search-utility-link {
  color: rgba(21, 26, 23, 0.58);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  transition: color 160ms ease, opacity 160ms ease;
}

.search-page .session-link:hover,
.search-page .search-utility-link:hover {
  color: #151a17;
}

.search-page .search-utility-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 28px;
}

.search-page .search-utility-link svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.search-page .user-status-bar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(21, 26, 23, 0.6);
  cursor: pointer;
  transition: color 160ms ease;
}

.search-page .user-status-bar:hover {
  color: #151a17;
}

.search-page .user-display-name {
  color: inherit;
  font-size: 14px;
  font-weight: 500;
}

.search-page .user-balance-display {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(21, 26, 23, 0.08);
  color: #a0845c;
  font-size: 11px;
  line-height: 1;
}

.search-page .mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(231, 229, 228, 0.56);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 4px 16px rgba(24, 20, 12, 0.04);
}

.search-page .mode-button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(21, 26, 23, 0.48);
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.search-page .mode-button:hover {
  transform: translateY(-1px);
}

.search-page .mode-button.active {
  background: #ffffff;
  color: #151a17;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.search-page.has-results .search-stage-inner {
  transform: translateY(0);
}

.search-page .subject-type-row {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

.search-page .subject-switch {
  gap: 2px;
  padding: 4px;
}

.search-page .subject-button {
  padding: 6px 18px;
  font-size: 13px;
}

.search-page .hero-stack {
  width: 100%;
  max-width: 820px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transform: translateY(-7vh);
}

.search-page.has-results .hero-stack {
  max-width: 1360px;
  transform: none;
}

.search-page .search-title {
  margin: 0;
  color: #151a17;
  font-family: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  font-size: clamp(56px, 6.5vw, 76px);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: 0.018em;
  margin-bottom: 20px;
  transition: font-size 280ms ease, transform 280ms ease, opacity 280ms ease;
}

.search-page.has-results .search-title {
  font-size: clamp(28px, 3vw, 38px);
  margin-bottom: 16px;
}

.search-page .project-indicator {
  display: none !important;
}

.search-page .minimal-form {
  width: 100%;
  max-width: 740px;
}

.search-page .search-composer {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid rgba(21, 26, 23, 0.05);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow:
    0 8px 30px rgba(0, 0, 0, 0.04),
    0 22px 44px rgba(64, 47, 18, 0.06);
  backdrop-filter: blur(18px);
}

.search-page .search-input {
  width: auto;
  min-width: 0;
  flex: 1;
  padding: 14px 8px 14px 24px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #151a17;
  font-size: 16px;
  line-height: 1.4;
  outline: none;
}

.search-page .search-input::placeholder {
  color: rgba(21, 26, 23, 0.42);
}

.search-page .upload-pill,
.search-page .search-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 46px;
  border-radius: 999px;
  color: #151a17;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.search-page .upload-pill:hover,
.search-page .search-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(21, 26, 23, 0.08);
}

.search-page .upload-pill input {
  display: none;
}

.search-page .upload-pill {
  width: 42px;
  min-width: 42px;
  padding: 0;
  border: 0;
  background: transparent;
}

.search-page .upload-pill:hover {
  background: #f5f5f4;
  box-shadow: none;
}

.search-page .upload-pill svg {
  width: 18px;
  height: 18px;
  color: rgba(21, 26, 23, 0.48);
}

.search-page .search-submit {
  padding: 0 24px;
  border-color: rgba(21, 26, 23, 0.12);
  background: #151a17;
  color: #f8f4ec;
  font-size: 14px;
  font-weight: 600;
}

.search-page .minimal-preview {
  display: flex;
  gap: 10px;
  width: 100%;
  justify-content: center;
  margin-top: -4px;
  padding: 0 4px;
}

.search-page .results-shell {
  width: 100%;
  flex: 1;
  max-width: 1600px;
  margin: 0 auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.search-page .preview-thumb {
  width: 64px;
  height: 64px;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(21, 26, 23, 0.08);
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 8px 24px rgba(21, 26, 23, 0.06);
}

.search-page .preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.search-page .status-line {
  margin: 12px 0 0;
  padding: 0 6px;
  color: rgba(21, 26, 23, 0.58);
  font-size: 14px;
  text-align: center;
}

.search-page .status-line[data-tone="busy"] {
  color: #8d6c28;
}

.search-page .status-line[data-tone="warn"] {
  color: #b05f32;
}

.search-page .minimal-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  padding-bottom: 24px;
}

.search-page .minimal-results.empty-state {
  display: block;
}

.search-page .results-groups {
  display: grid;
  gap: 22px;
  min-height: calc(100vh - 180px);
  align-content: start;
  padding-bottom: 24px;
}

.search-page .results-group {
  display: grid;
  gap: 10px;
}

.search-page .results-group-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 2px;
}

.search-page .results-group-head h2 {
  margin: 0;
  color: rgba(21, 26, 23, 0.72);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.search-page .minimal-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
}

.search-page .minimal-card {
  position: relative;
  width: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  opacity: 0;
  transform: translateY(16px) scale(0.992);
  animation: result-reveal 520ms cubic-bezier(0.2, 0.7, 0.18, 1) forwards;
  animation-delay: var(--card-delay, 0ms);
  will-change: transform, opacity;
}

.search-page .result-card-actions {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  display: flex;
  gap: 8px;
  align-items: center;
}

.search-page .minimal-card .result-image {
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  border-radius: 0;
  background: rgba(227, 220, 209, 0.65);
}

.search-page .favorite-button.icon-only {
  position: static;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(20, 24, 22, 0.78);
  color: #f6f0e5;
  font-size: 18px;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
}

.search-page .favorite-button.icon-only.saved {
  background: rgba(197, 144, 46, 0.92);
  color: #fff6df;
}

.search-page .favorite-button.icon-only:disabled {
  opacity: 0.84;
}

.search-page .project-save-button {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: rgba(20, 24, 22, 0.78);
  color: #f6f0e5;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
  transition: transform 160ms ease, background 160ms ease, opacity 160ms ease;
}

.search-page .project-save-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.search-page .project-save-button.saved {
  background: rgba(39, 111, 83, 0.92);
  color: #eefcf6;
}

.search-page .project-save-button:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.search-page .minimal-empty {
  padding: 54px 28px;
  border: 1px dashed rgba(21, 26, 23, 0.12);
  border-radius: 28px;
  background: rgba(255, 253, 248, 0.65);
  color: rgba(21, 26, 23, 0.52);
  text-align: center;
  box-shadow: none;
}

.search-page .minimal-empty p {
  margin: 0;
  font-size: 16px;
}

.project-picker-dialog {
  border: none;
  border-radius: 12px;
  padding: 0;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
  width: min(420px, 92vw);
  max-height: 80vh;
  overflow-y: auto;
}

.project-picker-dialog::backdrop {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
}

.project-picker-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #fbf8f2;
  color: #2d2a25;
}

.project-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.project-picker-eyebrow {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: #999;
  margin: 0;
}

.project-picker-close {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: #999;
  padding: 4px;
  line-height: 1;
}

.project-picker-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 300px;
  overflow-y: auto;
}

.project-picker-item {
  width: 100%;
  text-align: left;
  background: none;
  border: 1px solid #e8e4dc;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 14px;
  color: #333;
  transition: background 0.1s;
}

.project-picker-item:hover {
  background: #f5f2ec;
}

.project-picker-loading,
.project-picker-empty {
  color: #999;
  font-size: 13px;
  padding: 8px 0;
}

.project-picker-status {
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 6px;
}

.project-picker-status.warn {
  color: #c0392b;
  background: #fdf0ee;
}

.project-picker-new {
  border-top: 1px solid #ece9e1;
  padding-top: 12px;
}

.project-picker-create-form {
  display: flex;
  gap: 8px;
}

.project-picker-input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  outline: none;
}

.project-picker-input:focus {
  border-color: #a0845c;
}

.search-page .user-dialog {
  width: min(420px, calc(100% - 24px));
  padding: 0;
  border: 0;
  background: transparent;
}

.search-page .user-dialog::backdrop {
  background: rgba(21, 26, 23, 0.26);
  backdrop-filter: blur(6px);
}

.search-page .user-dialog-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid rgba(21, 26, 23, 0.08);
  border-radius: 24px;
  background: rgba(255, 253, 248, 0.98);
  color: #151a17;
  box-shadow: 0 24px 64px rgba(21, 26, 23, 0.14);
}

.search-page .user-dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.search-page .user-dialog-eyebrow {
  margin: 0 0 6px;
  color: rgba(21, 26, 23, 0.48);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.search-page .user-dialog-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
}

.search-page .user-dialog-close,
.search-page .user-dialog-submit,
.search-page .user-option {
  border: 1px solid rgba(21, 26, 23, 0.1);
  border-radius: 16px;
  background: #f3eee5;
  color: #151a17;
}

.search-page .user-dialog-close,
.search-page .user-dialog-submit {
  min-height: 42px;
  padding: 0 14px;
  cursor: pointer;
}

.search-page .user-list {
  display: grid;
  gap: 8px;
  max-height: 240px;
  overflow: auto;
}

.search-page .user-list-empty {
  margin: 0;
  padding: 14px 16px;
  border: 1px dashed rgba(21, 26, 23, 0.14);
  border-radius: 16px;
  color: rgba(21, 26, 23, 0.54);
  text-align: center;
}

.search-page .user-option {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.search-page .user-option:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(21, 26, 23, 0.06);
}

.search-page .user-option.active {
  border-color: rgba(26, 95, 180, 0.22);
  background: #d9ecff;
  color: #1a5fb4;
}

.search-page .user-option-meta {
  color: rgba(21, 26, 23, 0.48);
  font-size: 12px;
}

.search-page .user-dialog-create {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.search-page .user-dialog-create input {
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(21, 26, 23, 0.1);
  border-radius: 16px;
  background: #fff;
  color: #151a17;
}

.search-page .user-dialog-status {
  margin: 0;
  min-height: 20px;
  color: rgba(21, 26, 23, 0.56);
  font-size: 13px;
}

.search-page .user-dialog-status[data-tone="warn"] {
  color: #b05f32;
}

body.projects-page {
  color: var(--text);
}

.projects-shell {
  display: grid;
  gap: 18px;
}

.projects-hero {
  margin-bottom: 0;
}

.projects-status {
  justify-self: start;
}

.projects-root {
  display: grid;
  gap: 18px;
}

.projects-grid,
.workspace-grid {
  display: grid;
  gap: 18px;
}

.projects-grid {
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
}

.workspace-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-list-grid,
.workspace-assets-grid,
.workspace-jobs-list {
  display: grid;
  gap: 14px;
}

.project-list-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.workspace-assets-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.workspace-panel {
  align-content: start;
}

.workspace-grid .workspace-panel:last-child {
  grid-column: 1 / -1;
}

.project-card,
.job-card,
.workspace-asset-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel-strong);
  overflow: hidden;
}

.project-card,
.job-card {
  padding: 18px;
}

.project-card h3,
.job-card h3,
.workspace-asset-body h3 {
  margin: 0;
  font-size: 18px;
}

.project-card p,
.job-card p,
.workspace-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.project-card-top,
.job-card-top,
.workspace-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.project-card,
.job-card {
  display: grid;
  gap: 12px;
}

.workspace-asset-card {
  position: relative;
  cursor: zoom-in;
}

.workspace-asset-card.is-selected {
  border-color: rgba(219, 193, 125, 0.46);
  box-shadow: 0 0 0 1px rgba(219, 193, 125, 0.16);
}

.workspace-asset-media {
  position: relative;
}

.workspace-asset-kind {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 20, 0.8);
  color: #f5eedf;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.workspace-asset-body {
  display: grid;
  gap: 6px;
  padding: 14px 16px 16px;
}

.job-outputs {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.job-output-link {
  padding: 10px 14px;
}

.favorites-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0 12px;
  flex-wrap: wrap;
}

.favorites-selected-count {
  font-size: 12px;
  color: var(--muted);
  margin-right: 4px;
}

.favorite-select-wrap {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(15, 23, 20, 0.82);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

.favorite-checkbox {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

@keyframes result-reveal {
  0% {
    opacity: 0;
    transform: translateY(16px) scale(0.992);
  }

  65% {
    opacity: 1;
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .search-page .minimal-card {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .search-page .search-stage,
  .search-page .search-stage-inner,
  .search-page .search-title {
    transition: none;
  }
}

@media (max-width: 1180px) {
  .layout-grid {
    grid-template-columns: 1fr;
  }

  .projects-grid,
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .search-page .minimal-results {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }

  .search-page .minimal-results-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 20px, 100%);
    padding-top: 20px;
  }

  .hero {
    flex-direction: column;
    padding: 22px;
  }

  .field-row,
  .button-row {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .preview-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace-actions {
    align-items: stretch;
  }

  .lightbox {
    padding: 12px;
  }

  .lightbox-dialog {
    padding: 14px;
    border-radius: 22px;
  }

  .lightbox-head,
  .lightbox-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .search-page .minimal-shell {
    width: min(100% - 20px, 100%);
    padding-top: 0;
  }

  .search-page .search-stage {
    padding: 22px 0 72px;
  }

  .search-page .hero-stack {
    max-width: 100%;
    transform: translateY(-3vh);
  }

  .search-page .search-composer {
    flex-wrap: wrap;
    border-radius: 28px;
    padding: 12px;
  }

  .search-page .mode-switch {
    width: 100%;
    justify-content: center;
  }

  .search-page .session-bar-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 0 4px;
  }

  .search-page .session-links {
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .search-page .user-status-bar {
    justify-content: flex-start;
  }

  .search-page .search-input {
    width: 100%;
    flex-basis: 100%;
    padding: 10px 12px 4px 18px;
    font-size: 17px;
  }

  .search-page .upload-pill,
  .search-page .search-submit {
    width: auto;
  }

  .search-page .user-dialog-create {
    grid-template-columns: 1fr;
  }

  .search-page .minimal-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .search-page .results-groups {
    gap: 18px;
    min-height: calc(100vh - 180px);
  }

  .search-page .minimal-results-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .search-page .minimal-card {
    border-radius: 0;
  }

  .search-page .minimal-card .result-image {
    aspect-ratio: 16 / 9;
    border-radius: 0;
  }

  .projects-shell {
    gap: 14px;
  }

  .workspace-assets-grid,
  .project-list-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Pricing Page ===== */

.pricing-page {
  background: #faf9f6;
  min-height: 100vh;
  color: #1a1a1a;
}

.pricing-shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

.pricing-header {
  text-align: center;
  margin-bottom: 40px;
}

.pricing-back {
  display: inline-block;
  color: #999;
  text-decoration: none;
  font-size: 13px;
  margin-bottom: 20px;
}

.pricing-back:hover {
  color: #333;
}

.pricing-title {
  font-size: 32px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 8px;
}

.pricing-subtitle {
  color: #888;
  font-size: 15px;
  margin: 0;
}

.pricing-user-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid #e8e4dc;
  border-radius: 10px;
  padding: 12px 18px;
  margin-bottom: 32px;
  font-size: 14px;
}

.pricing-user-name {
  font-weight: 600;
  color: #333;
  flex: 1;
}

.pricing-balance-label {
  color: #999;
}

.pricing-balance {
  font-weight: 700;
  color: #a0845c;
}

.pricing-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 56px;
}

.pricing-plan {
  background: #fff;
  border: 1px solid #e8e4dc;
  border-radius: 16px;
  padding: 28px 24px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: box-shadow 0.15s;
}

.pricing-plan:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.pricing-plan.is-featured {
  border-color: #a0845c;
  box-shadow: 0 4px 24px rgba(160, 132, 92, 0.18);
}

.pricing-plan-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: #a0845c;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

.pricing-plan-head {
  text-align: center;
}

.pricing-plan-name {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  color: #999;
  margin: 0 0 8px;
  letter-spacing: 0.05em;
}

.pricing-plan-credits {
  font-size: 36px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 4px;
  line-height: 1;
}

.pricing-plan-credits span {
  font-size: 16px;
  font-weight: 400;
  color: #888;
}

.pricing-plan-price {
  font-size: 22px;
  font-weight: 700;
  color: #a0845c;
  margin: 8px 0 2px;
}

.pricing-plan-unit {
  font-size: 12px;
  color: #bbb;
  margin: 0;
}

.pricing-plan-perks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.pricing-plan-perks li {
  font-size: 13px;
  color: #555;
  padding-left: 18px;
  position: relative;
}

.pricing-plan-perks li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #a0845c;
  font-weight: 600;
}

.pricing-plan-btn {
  width: 100%;
  padding: 11px;
  border: 1px solid #d4c9b8;
  border-radius: 10px;
  background: #fff;
  color: #333;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s;
}

.pricing-plan-btn:hover {
  background: #f5f2ec;
  border-color: #c4b8a4;
}

.pricing-plan-btn.is-primary {
  background: #a0845c;
  color: #fff;
  border-color: #a0845c;
}

.pricing-plan-btn.is-primary:hover {
  background: #8f744e;
  border-color: #8f744e;
}

.pricing-table-section {
  margin-bottom: 48px;
}

.pricing-table-title {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 16px;
}

.pricing-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.pricing-table th {
  text-align: left;
  padding: 10px 14px;
  background: #f5f2ec;
  color: #666;
  font-weight: 600;
  border-bottom: 1px solid #e8e4dc;
}

.pricing-table th:not(:first-child),
.pricing-table td:not(:first-child) {
  text-align: right;
}

.pricing-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f0ede6;
  color: #333;
}

.pricing-table tr:last-child td {
  border-bottom: none;
}

.pricing-table-free td {
  color: #a0845c;
  font-weight: 500;
}

.pricing-faq {
  margin-bottom: 40px;
}

.pricing-faq-title {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 16px;
}

.pricing-faq-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pricing-faq-item {
  background: #fff;
  border: 1px solid #e8e4dc;
  border-radius: 10px;
  overflow: hidden;
}

.pricing-faq-item summary {
  padding: 14px 18px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.pricing-faq-item summary::-webkit-details-marker {
  display: none;
}

.pricing-faq-item summary::after {
  content: "+";
  font-size: 18px;
  color: #aaa;
}

.pricing-faq-item[open] summary::after {
  content: "−";
}

.pricing-faq-item p {
  padding: 0 18px 14px;
  margin: 0;
  font-size: 13px;
  color: #666;
  line-height: 1.6;
}

.pricing-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 9999;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.pricing-toast.warn {
  background: #c0392b;
}

@media (max-width: 600px) {
  .pricing-plans {
    grid-template-columns: 1fr;
  }

  .pricing-title {
    font-size: 24px;
  }
}
