:root {
  --canvas: #F4F6F9;
  --surface: #FFFFFF;
  --surface-subtle: #F8FAFC;
  --navy: #0F1D33;
  --navy-deep: #091324;
  --ink: #0F172A;
  --slate: #334155;
  --muted: #64748B;
  --border: #DCE3EC;
  --border-strong: #CBD5E1;
  --royal: #1D4ED8;
  --royal-hover: #1E40AF;
  --royal-soft: #EFF6FF;
  --royal-border: #BFDBFE;
  --emerald: #065F46;
  --emerald-soft: #ECFDF5;
  --emerald-border: #A7F3D0;
  --amber-ink: #78350F;
  --amber-soft: #FFFBEB;
  --amber-border: #FDE68A;
  --danger-ink: #991B1B;
  --danger-soft: #FEF2F2;
  --danger-border: #FECACA;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI",
    "PingFang HK", "Noto Sans TC", "Hiragino Sans CNS", "Microsoft JhengHei", sans-serif;
  --font-mono: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --shadow-sm: 0 1px 3px rgba(15, 29, 51, 0.05);
  --shadow-md: 0 8px 24px rgba(15, 29, 51, 0.07);
  --shadow-lg: 0 16px 40px rgba(15, 29, 51, 0.12);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

button {
  cursor: pointer;
  touch-action: manipulation;
}

button:focus-visible,
textarea:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--royal);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.mono {
  font-family: var(--font-mono);
}

/* ==================== TOP NAVIGATION ==================== */
.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.top-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: calc(env(safe-area-inset-top)) 24px 0;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  border: 0;
  background: transparent;
  padding: 4px 0;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--navy);
  line-height: 1;
}

.brand-logo span {
  color: var(--royal);
}

.engine-pill {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--royal-soft);
  border: 1px solid var(--royal-border);
  color: var(--royal);
  white-space: nowrap;
}

.nav-tabs {
  display: flex;
  align-items: stretch;
  gap: 24px;
  height: 54px;
}

.nav-tab {
  border: 0;
  border-bottom: 2.5px solid transparent;
  background: transparent;
  padding: 0 4px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 150ms ease, border-color 150ms ease;
}

.nav-tab:hover {
  color: var(--navy);
}

.nav-tab.is-active {
  color: var(--navy);
  border-bottom-color: var(--royal);
}

.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--navy);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ghost-btn {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--slate);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 7px;
  transition: border-color 150ms ease, color 150ms ease;
}

.ghost-btn:hover {
  border-color: var(--royal);
  color: var(--royal);
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px 6px;
}

.lang-sep {
  color: #CBD5E1;
  font-size: 11px;
  user-select: none;
}

.lang-btn {
  border: 0;
  background: transparent;
  padding: 3px 7px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  transition: all 140ms ease;
}

.lang-btn:hover {
  color: var(--navy);
}

.lang-btn.is-active {
  background: var(--navy);
  color: #FFFFFF;
}

/* ==================== WORKSPACE & HOME VIEW ==================== */
.workspace {
  flex: 1;
  width: 100%;
}

.view-home {
  max-width: 880px;
  margin: 0 auto;
  padding: 28px 20px 56px;
}

.ready-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 6px;
}

.ready-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--slate);
}

.ready-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--royal);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.18);
}

.resume-pill {
  border: 1px solid var(--royal-border);
  background: var(--royal-soft);
  color: var(--royal);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 999px;
}

.resume-pill:hover {
  background: #DBEAFE;
}

.hero-h1 {
  margin: 0 0 16px;
  font-size: clamp(23px, 3vw, 29px);
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--navy);
  line-height: 1.25;
}

/* COMPOSER CARD */
.composer-card {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-top: 3px solid var(--navy);
  border-radius: 15px;
  padding: 15px 18px 13px;
  box-shadow: var(--shadow-md);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.composer-card:focus-within {
  border-color: #93C5FD;
  border-top-color: var(--royal);
  box-shadow: 0 12px 28px rgba(29, 78, 216, 0.09);
}

.composer-textarea {
  width: 100%;
  border: 0;
  outline: none;
  resize: none;
  background: transparent;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  min-height: 52px;
  max-height: 150px;
}

.composer-textarea::placeholder {
  color: #94A3B8;
}

.composer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #F1F5F9;
}

.tool-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.tool-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--slate);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 7px;
  transition: all 140ms ease;
}

.tool-chip svg {
  width: 13.5px;
  height: 13.5px;
  color: var(--muted);
}

.tool-chip:hover {
  border-color: var(--royal-border);
  background: var(--royal-soft);
  color: var(--royal);
}

.tool-chip:hover svg {
  color: var(--royal);
}

.composer-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.mode-seg {
  display: inline-flex;
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  border-radius: 999px;
  padding: 2.5px;
}

.mode-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  transition: all 140ms ease;
}

.mode-btn.is-active {
  background: var(--surface);
  color: var(--navy);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1);
}

.go-circle {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 0;
  background: var(--navy);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms ease, transform 120ms ease;
}

.go-circle:hover:not(:disabled) {
  background: var(--royal);
}

.go-circle:disabled {
  opacity: 0.45;
  cursor: default;
}

/* TRY EXAMPLES & DISCLAIMER */
.try-row {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  font-size: 12.5px;
  color: var(--muted);
}

.try-link {
  border: 0;
  background: transparent;
  padding: 2px 0;
  color: var(--navy);
  font-weight: 600;
  font-size: 12.5px;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: #94A3B8;
}

.try-link:hover {
  color: var(--royal);
  text-decoration-color: var(--royal);
}

.pilot-disclaimer {
  margin: 8px 0 24px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

/* ==================== SCENARIO PHOTO BENTO & GALLERY ==================== */
.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.sec-title {
  margin: 0;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--navy);
}

.sec-subtabs {
  display: inline-flex;
  gap: 14px;
}

.subtab-btn {
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  padding: 2px 2px 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

.subtab-btn.is-active {
  color: var(--navy);
  border-bottom-color: var(--royal);
}

.bento-hero {
  position: relative;
  display: block;
  width: 100%;
  height: 230px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #1E293B;
  background: var(--navy-deep);
  padding: 0;
  text-align: left;
  margin-bottom: 12px;
  box-shadow: var(--shadow-md);
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.bento-card {
  position: relative;
  display: block;
  width: 100%;
  height: 162px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #1E293B;
  background: var(--navy-deep);
  padding: 0;
  text-align: left;
  box-shadow: var(--shadow-sm);
}

.bento-hero img,
.bento-card img,
.gallery-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 320ms ease;
}

.bento-hero:hover img,
.bento-card:hover img,
.gallery-card:hover .gallery-card-media img {
  transform: scale(1.035);
}

.photo-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(9, 19, 36, 0.08) 0%,
    rgba(9, 19, 36, 0.35) 52%,
    rgba(9, 19, 36, 0.88) 100%
  );
}

.photo-caption {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 13px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  color: #FFFFFF;
}

.photo-caption-text strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.bento-hero .photo-caption-text strong {
  font-size: 17.5px;
}

.photo-caption-text small {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: #CBD5E1;
}

.photo-badge {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(15, 29, 51, 0.84);
  border: 1px solid rgba(147, 197, 253, 0.42);
  color: #DBEAFE;
  backdrop-filter: blur(4px);
}

/* ALL 10 SPACES GALLERY GRID */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.gallery-card {
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 0;
  border-radius: 13px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.gallery-card:hover {
  border-color: var(--royal);
  box-shadow: var(--shadow-md);
}

.gallery-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--navy-deep);
}

.gallery-card-media .photo-badge {
  position: absolute;
  top: 10px;
  right: 10px;
}

.gallery-card-body {
  padding: 12px 14px 13px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.gallery-card-body strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
}

.gallery-card-body p {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
}

.gallery-card-cta {
  margin-top: auto;
  padding-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--royal);
}

/* DISTRICT BAR */
.district-section {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.district-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.district-pill {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--slate);
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: 999px;
  transition: all 140ms ease;
}

.district-pill:hover {
  border-color: var(--royal);
  color: var(--royal);
  background: var(--royal-soft);
}

/* ==================== VIEW 2: SPLIT SHORTLIST + DOSSIER ==================== */
.view-results {
  max-width: 1220px;
  margin: 0 auto;
  padding: 20px 20px 44px;
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
  gap: 20px;
  align-items: start;
}

.shortlist-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.results-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.results-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--royal);
}

.results-meta-right {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}

.link-back {
  border: 0;
  background: transparent;
  padding: 2px 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--slate);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-back:hover {
  color: var(--royal);
}

/* MANDATE TRAIL & ASSISTANT BRIEF */
.mandate-trail {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mandate-bubble {
  align-self: flex-end;
  max-width: 92%;
  background: var(--navy);
  color: #F8FAFC;
  font-size: 13.5px;
  line-height: 1.5;
  padding: 10px 14px;
  border-radius: 12px 12px 3px 12px;
  box-shadow: var(--shadow-sm);
}

.mandate-bubble.is-prior {
  background: #334155;
  font-size: 12px;
  opacity: 0.85;
  padding: 6px 11px;
}

.summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}

.assistant-reply {
  margin: 0;
  font-size: 14px;
  color: var(--ink);
  line-height: 1.55;
  font-weight: 500;
}

.callout {
  margin: 10px 0 0;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 12.5px;
  line-height: 1.5;
}

.callout-info {
  background: var(--royal-soft);
  border: 1px solid var(--royal-border);
  color: #1E3A8A;
}

.callout-warn {
  background: var(--danger-soft);
  border: 1px solid var(--danger-border);
  color: var(--danger-ink);
}

.callout-amber {
  background: var(--amber-soft);
  border: 1px solid var(--amber-border);
  color: var(--amber-ink);
}

.intent-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.intent-chip {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
  background: #F1F5F9;
  color: var(--slate);
  border: 1px solid #E2E8F0;
}

.intent-chip.is-primary {
  background: var(--royal-soft);
  color: var(--royal);
  border-color: var(--royal-border);
}

/* SHORTLIST CARDS WITH THUMBNAILS */
.shortlist-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.venue-card {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 13px;
  width: 100%;
  text-align: left;
  padding: 10px;
  border-radius: 11px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-left: 4px solid #64748B;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.venue-card:hover {
  border-color: #60A5FA;
  box-shadow: var(--shadow-sm);
}

.venue-card.is-selected {
  border: 1.5px solid var(--royal);
  border-left: 4.5px solid var(--royal);
  background: #FBFDFF;
  box-shadow: 0 6px 18px rgba(29, 78, 216, 0.09);
}

.venue-thumb {
  position: relative;
  width: 118px;
  height: 82px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--navy-deep);
  flex-shrink: 0;
}

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

.rank-pill {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(15, 29, 51, 0.86);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

.venue-card-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.venue-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.venue-card-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.3;
}

.venue-card-price {
  text-align: right;
  flex-shrink: 0;
}

.venue-card-price strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--navy);
}

.venue-card-price span {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.venue-card-sub {
  margin: 3px 0 6px;
  font-size: 12.5px;
  color: var(--slate);
  line-height: 1.35;
}

.venue-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.v-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 1.5px 7px;
  border-radius: 4px;
  background: #F1F5F9;
  color: var(--slate);
}

.v-tag.is-grade {
  background: var(--emerald-soft);
  color: var(--emerald);
}

.v-tag.is-terrace {
  background: var(--royal-soft);
  color: var(--royal);
}

/* FOLLOWUPS & INLINE REFINE BAR */
.followup-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.followup-pill {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--navy);
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  transition: all 140ms ease;
}

.followup-pill:hover {
  border-color: var(--royal);
  color: var(--royal);
  background: var(--royal-soft);
}

.refine-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 8px 10px 8px 14px;
  box-shadow: var(--shadow-sm);
}

.refine-input {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 13.5px;
  min-width: 0;
}

/* ==================== RIGHT COLUMN: DOSSIER ==================== */
.dossier-col {
  position: sticky;
  top: 72px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-top: 3px solid var(--navy);
  border-radius: 14px;
  padding: 16px 18px 18px;
  box-shadow: var(--shadow-md);
}

.dossier-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.dossier-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--royal);
}

.verified-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 5px;
  background: var(--emerald-soft);
  border: 1px solid var(--emerald-border);
  color: var(--emerald);
}

.dossier-title {
  margin: 0;
  font-size: 20px;
  font-weight: 750;
  color: var(--navy);
  line-height: 1.25;
}

.dossier-subtitle {
  margin: 3px 0 12px;
  font-size: 12.5px;
  color: var(--muted);
}

/* MULTI-PHOTO DOSSIER GALLERY */
.dossier-gallery {
  margin-bottom: 14px;
}

.dossier-hero-photo {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #1E293B;
  background: var(--navy-deep);
}

.dossier-hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dossier-photo-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 20px 12px 9px;
  background: linear-gradient(180deg, rgba(9, 19, 36, 0) 0%, rgba(9, 19, 36, 0.86) 100%);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
}

.dossier-thumbs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-top: 7px;
}

.thumb-btn {
  position: relative;
  padding: 0;
  border-radius: 7px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border: 2px solid transparent;
  background: var(--navy-deep);
  opacity: 0.76;
  transition: opacity 140ms ease, border-color 140ms ease;
}

.thumb-btn:hover {
  opacity: 0.95;
}

.thumb-btn.is-active {
  border-color: var(--royal);
  opacity: 1;
}

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

.thumb-btn span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2px 4px;
  background: rgba(9, 19, 36, 0.78);
  color: #F8FAFC;
  font-size: 9.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* VIP ROUTING DIAGRAM */
.routing-box {
  background: var(--surface-subtle);
  border: 1px solid #E2E8F0;
  border-radius: 9px;
  padding: 9px 10px;
  margin-bottom: 12px;
}

.routing-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 6px;
}

.routing-svg {
  width: 100%;
  height: auto;
  display: block;
}

/* SPEC MATRIX */
.spec-table {
  display: flex;
  flex-direction: column;
  font-size: 12.5px;
  margin-bottom: 12px;
}

.spec-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  padding: 6.5px 0;
  border-bottom: 1px dashed #E2E8F0;
}

.spec-row:last-child {
  border-bottom: 0;
}

.spec-row span {
  color: var(--muted);
  flex-shrink: 0;
}

.spec-row strong {
  color: var(--ink);
  font-weight: 600;
  text-align: right;
}

/* SPACES IN VENUE */
.spaces-sec {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #E2E8F0;
}

.spaces-sec-title {
  margin: 0 0 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--slate);
}

.space-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.space-item {
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  transition: border-color 140ms ease, background 140ms ease;
}

.space-item:hover {
  border-color: #93C5FD;
}

.space-item.is-active {
  border-color: var(--royal);
  background: var(--royal-soft);
}

.space-item-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
}

.space-item-top strong {
  color: var(--navy);
}

.space-item-top span {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
}

.space-item small {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--muted);
}

/* DOSSIER ACTIONS */
.dossier-actions {
  display: flex;
  gap: 9px;
  margin-top: 14px;
}

.btn-secondary {
  border: 1px solid var(--border-strong);
  background: var(--surface-subtle);
  color: var(--navy);
  font-size: 12.5px;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 9px;
  white-space: nowrap;
}

.btn-secondary:hover {
  border-color: var(--navy);
  background: #F1F5F9;
}

.btn-primary {
  flex: 1;
  border: 0;
  background: var(--navy);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 9px;
  transition: background 150ms ease;
}

.btn-primary:hover {
  background: var(--royal);
}

/* SLOT CHECK FORM & RECEIPT */
.slot-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.field-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--slate);
}

.field-label input,
.field-label select,
.field-label textarea {
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  padding: 8px 10px;
  font-size: 13.5px;
  color: var(--ink);
}

.check-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  padding: 4px 0;
}

.quote-box {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 12.5px;
}

.quote-line {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  color: var(--slate);
}

.quote-line.is-total {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
  font-weight: 700;
  color: var(--navy);
  font-size: 13.5px;
}

.receipt-box {
  background: var(--emerald-soft);
  border: 1px solid var(--emerald-border);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 10px 0 12px;
}

.receipt-box strong {
  display: block;
  font-size: 14px;
  color: var(--emerald);
}

.receipt-no {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
  color: var(--navy);
  margin: 4px 0;
}

/* ==================== VIEW 3: SLOT REQUESTS LEDGER ==================== */
.view-requests {
  max-width: 880px;
  margin: 0 auto;
  padding: 28px 20px 56px;
}

.ledger-empty {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 36px 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.ledger-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.ledger-card {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--royal);
  border-radius: 12px;
  padding: 12px 16px 12px 12px;
  box-shadow: var(--shadow-sm);
}

.ledger-card img {
  width: 150px;
  height: 94px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

/* ==================== RESPONSIVE & PRINT ==================== */
@media (max-width: 960px) {
  .view-results {
    grid-template-columns: 1fr;
  }

  .dossier-col {
    position: static;
  }
}

@media (max-width: 680px) {
  .top-nav {
    padding: calc(env(safe-area-inset-top) + 6px) 12px 0;
    gap: 6px 8px;
    flex-wrap: wrap;
    min-height: 50px;
  }

  .engine-pill {
    display: none;
  }

  .nav-tabs {
    order: 3;
    width: 100%;
    gap: 18px;
    height: 40px;
    border-top: 1px solid #F1F5F9;
  }

  .bento-hero {
    height: 188px;
  }

  .bento-grid,
  .gallery-grid,
  .form-grid-2 {
    grid-template-columns: 1fr;
  }

  .venue-card {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .venue-thumb {
    width: 92px;
    height: 74px;
  }

  .ledger-card {
    grid-template-columns: 1fr;
  }

  .ledger-card img {
    width: 100%;
    height: 150px;
  }
}

@media print {
  .top-nav,
  .shortlist-col,
  .dossier-actions,
  .dossier-thumbs {
    display: none !important;
  }

  body,
  .view-results {
    background: #FFFFFF;
    display: block;
    padding: 0;
  }

  .dossier-col {
    position: static !important;
    top: auto !important;
    width: 100% !important;
    border: 1px solid #CBD5E1;
    box-shadow: none;
  }
}
