/* ============================================================
   Psyche — self-contained design tokens + app styles
   Fresh modern direction: cool off-white surfaces, vibrant
   indigo accent (default), generous whitespace, soft motion.
   ============================================================ */


:root {
  /* ---------- Spacing (4px grid) ---------- */
  --sp-1: 4px;   --sp-2: 8px;   --sp-3: 12px;  --sp-4: 16px;
  --sp-5: 20px;  --sp-6: 24px;  --sp-7: 28px;  --sp-8: 32px;
  --sp-9: 36px;  --sp-10: 40px; --sp-11: 44px; --sp-12: 48px;
  --sp-13: 52px; --sp-14: 56px; --sp-15: 60px; --sp-16: 64px;

  /* ---------- Motion ---------- */
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --dur-fast: 150ms;
  --dur-base: 250ms;
  --dur-slow: 400ms;

  /* ---------- Elevation ---------- */
  --elev-1: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 1px rgba(15, 23, 42, 0.04);
  --elev-2: 0 4px 10px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
  --elev-4: 0 12px 28px rgba(15, 23, 42, 0.10), 0 4px 10px rgba(15, 23, 42, 0.05);
  --elev-8: 0 24px 48px rgba(15, 23, 42, 0.14), 0 8px 16px rgba(15, 23, 42, 0.06);

  /* ---------- Neutrals (palette-independent baseline) ---------- */
  --color-error: #DC2626;

  /* ---------- Psyche brand tokens — IRIS PALETTE (default).
       These are overwritten at runtime by the active palette object
       in app.jsx (see PALETTES). Keep names stable: --psy-*  ---------- */
  --psy-accent:        #5145CD;  /* electric indigo */
  --psy-accent-soft:   #ECECFB;
  --psy-accent-deep:   #3F35B5;
  --psy-leaf:          #0E9F6E;  /* trust / verified green */
  --psy-leaf-soft:     #DFFBEC;
  --psy-surface:       #FBFAF7;  /* warm off-white */
  --psy-surface-2:     #FFFFFF;  /* cards */
  --psy-ink:           #0F1525;  /* near-black, cool */
  --psy-rule:          #E6E7EF;

  /* Text helpers derived from ink */
  --fg1: var(--psy-ink);
  --fg2: color-mix(in oklab, var(--psy-ink) 62%, transparent);
  --fg3: color-mix(in oklab, var(--psy-ink) 38%, transparent);

  /* Page max */
  --max-page: 1280px;
}

/* ============================================================
   Type personalities — switched live via Tweaks
   ============================================================ */
body[data-type="clean"] {
  --font-display: "Inter", system-ui, sans-serif;
  --font-subhead: "Inter", system-ui, sans-serif;
  --font-sans:    "Inter", system-ui, sans-serif;
  --tight-tracking: -0.015em;
}
body[data-type="humanist"] {
  --font-display: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-subhead: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-sans:    "Plus Jakarta Sans", system-ui, sans-serif;
  --tight-tracking: -0.022em;
}
body[data-type="editorial"] {
  --font-display: "Instrument Serif", "Georgia", serif;
  --font-subhead: "Instrument Serif", "Georgia", serif;
  --font-sans:    "Inter", system-ui, sans-serif;
  --tight-tracking: -0.02em;
}

/* ============================================================
   Base
   ============================================================ */
html, body {
  margin: 0;
  padding: 0;
  background: var(--psy-surface);
  color: var(--psy-ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}
* { box-sizing: border-box; }
button { font: inherit; cursor: pointer; }

/* Display headlines pick up the type personality */
.display, h1.display, h2.display {
  font-family: var(--font-display);
  letter-spacing: var(--tight-tracking, -0.02em);
  font-weight: 500;
  color: var(--psy-ink);
  margin: 0;
}
body[data-type="humanist"] .display { font-weight: 600; }
body[data-type="editorial"] .display { font-weight: 400; }
.subhead {
  font-family: var(--font-subhead);
  letter-spacing: -0.005em;
}

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

.topnav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in oklab, var(--psy-surface) 80%, transparent);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--psy-rule);
}
.topnav-inner {
  max-width: var(--max-page);
  margin: 0 auto;
  padding: 14px var(--sp-8);
  display: flex;
  align-items: center;
  gap: var(--sp-8);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.025em;
  color: var(--psy-ink);
  text-decoration: none;
  cursor: pointer;
}
body[data-type="editorial"] .brand { font-weight: 400; font-size: 26px; letter-spacing: -0.03em; }
.brand .glyph {
  width: 32px; height: 32px;
  display: grid; place-items: center;
}
.nav-links {
  display: flex; align-items: center; gap: var(--sp-2);
  margin-left: var(--sp-4);
}
.nav-link {
  appearance: none; background: none; border: 0;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--psy-ink);
  letter-spacing: -0.005em;
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-standard), color var(--dur-fast);
}
.nav-link:hover { background: color-mix(in oklab, var(--psy-ink) 6%, transparent); }
.nav-link.active {
  background: var(--psy-ink);
  color: var(--psy-surface);
}
.nav-spacer { flex: 1; }
.nav-icon-btn {
  appearance: none;
  background: var(--psy-surface-2);
  border: 1px solid var(--psy-rule);
  width: 40px; height: 40px;
  border-radius: 999px;
  display: grid; place-items: center;
  position: relative;
  color: var(--psy-ink);
}
.nav-icon-btn:hover { background: var(--psy-surface); }
.nav-icon-btn .dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--psy-accent); border-radius: 50%;
  border: 2px solid var(--psy-surface);
}
.persona-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px 6px 6px;
  background: var(--psy-surface-2);
  border: 1px solid var(--psy-rule);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
}
.persona-pill .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, color-mix(in oklab, var(--psy-accent) 40%, white), var(--psy-accent));
  color: white; display: grid; place-items: center;
  font-weight: 600; font-size: 12px;
}

/* Page container */
.page {
  max-width: var(--max-page);
  margin: 0 auto;
  padding: var(--sp-8) var(--sp-8) var(--sp-16);
  width: 100%;
}
.page.wide   { max-width: 1440px; }
.page.narrow { max-width: 880px; }

/* Eyebrow / kicker */
.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--psy-accent);
}
.eyebrow.muted { color: var(--fg2); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease-standard),
              background var(--dur-fast),
              border-color var(--dur-fast),
              color var(--dur-fast);
}
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--psy-ink);
  color: var(--psy-surface);
}
.btn.primary:hover { background: color-mix(in oklab, var(--psy-ink) 86%, black); }
.btn.accent {
  background: var(--psy-accent);
  color: white;
}
.btn.accent:hover { background: var(--psy-accent-deep); }
.btn.ghost {
  background: var(--psy-surface-2);
  color: var(--psy-ink);
  border-color: var(--psy-rule);
}
.btn.ghost:hover { background: var(--psy-surface); border-color: color-mix(in oklab, var(--psy-ink) 18%, transparent); }
.btn.link {
  background: transparent;
  color: var(--psy-ink);
  height: auto; padding: 0;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--psy-rule);
}
.btn.link:hover { text-decoration-color: var(--psy-ink); }
.btn.sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn.lg { height: 52px; padding: 0 28px; font-size: 15px; }
.btn.block { width: 100%; }

/* ============================================================
   Cards & surfaces
   ============================================================ */
.card {
  background: var(--psy-surface-2);
  border: 1px solid var(--psy-rule);
  border-radius: 16px;
}
.card.flat { box-shadow: none; }
.card.raised { box-shadow: var(--elev-2); border-color: transparent; }
.card.hoverable { transition: transform var(--dur-base), box-shadow var(--dur-base); cursor: pointer; }
.card.hoverable:hover { transform: translateY(-2px); box-shadow: var(--elev-4); }

.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  background: var(--psy-surface);
  border: 1px solid var(--psy-rule);
  border-radius: 999px;
  font-size: 12px;
  color: var(--fg2);
}
.tag.accent {
  background: var(--psy-accent-soft);
  border-color: transparent;
  color: var(--psy-accent-deep);
  font-weight: 500;
}
.tag.leaf {
  background: var(--psy-leaf-soft);
  border-color: transparent;
  color: var(--psy-leaf);
  font-weight: 500;
}
.tag.ink {
  background: var(--psy-ink);
  border-color: transparent;
  color: var(--psy-surface);
  font-weight: 500;
}

/* Material Symbols base */
.icon {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  -webkit-font-feature-settings: 'liga';
}
.icon.lg { font-size: 24px; }
.icon.sm { font-size: 16px; }

/* Avatar */
.avatar-large {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg,
    color-mix(in oklab, var(--psy-accent) 40%, white),
    var(--psy-accent) 70%);
  color: white;
  display: grid; place-items: center;
  font-weight: 600;
  font-size: 28px;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  flex: none;
}
.avatar-large.b { background: linear-gradient(135deg, #B7DCD0, #0E9F6E); }
.avatar-large.c { background: linear-gradient(135deg, #C9D6FA, #4360E0); }
.avatar-large.d { background: linear-gradient(135deg, #F3C9DD, #C03A77); }
.avatar-large.e { background: linear-gradient(135deg, #EEDFB1, #B08A3D); }

.avatar-sm {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 600;
  font-size: 13px;
  color: white;
  flex: none;
  background: var(--psy-ink);
}

/* Stars */
.stars { display: inline-flex; gap: 2px; color: var(--psy-accent); align-items: center; }
.stars .icon { font-size: 16px; font-variation-settings: 'FILL' 1; }
.stars .icon.empty { color: var(--psy-rule); font-variation-settings: 'FILL' 0; }

/* ============================================================
   Form
   ============================================================ */
.field-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg2);
  margin-bottom: 6px;
}
.input, .textarea, .select {
  width: 100%;
  background: var(--psy-surface-2);
  border: 1px solid var(--psy-rule);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  font-size: 14px;
  color: var(--psy-ink);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--psy-accent);
  box-shadow: 0 0 0 4px var(--psy-accent-soft);
}
.textarea { min-height: 100px; resize: vertical; line-height: 1.5; }

/* Search input */
.search {
  display: flex; align-items: center;
  background: var(--psy-surface-2); border: 1px solid var(--psy-rule);
  border-radius: 999px;
  padding: 6px 8px 6px 16px;
  height: 48px;
}
.search input {
  flex: 1; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 14px; color: var(--psy-ink);
}
.search .icon { color: var(--fg2); margin-right: 10px; }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--sp-12);
  align-items: center;
  padding: var(--sp-8) 0 var(--sp-6);
}
.hero h1 {
  font-size: 68px;
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 500;
  color: var(--psy-ink);
  font-family: var(--font-display);
  text-wrap: balance;
  margin: 0;
}
body[data-type="humanist"] .hero h1 { font-weight: 600; letter-spacing: -0.028em; }
body[data-type="editorial"] .hero h1 { font-weight: 400; letter-spacing: -0.04em; }
.hero h1 em {
  font-style: normal;
  color: var(--psy-accent);
  font-family: inherit;
}
body[data-type="editorial"] .hero h1 em {
  font-style: italic;
  color: var(--psy-accent);
}
.hero p.lede {
  font-size: 18px;
  line-height: 1.55;
  color: var(--fg2);
  margin-top: 20px;
  max-width: 520px;
}
.hero-cta { display: flex; gap: 12px; margin-top: 32px; flex-wrap: wrap; }

/* Hero ornament */
.thread-art {
  aspect-ratio: 1 / 1;
  width: 100%;
  position: relative;
  display: grid;
  place-items: center;
}

/* Section heads */
.section-head {
  display: flex; align-items: end; justify-content: space-between;
  margin-bottom: var(--sp-6);
  gap: var(--sp-4);
}
.section-head h2 {
  font-family: var(--font-display);
  font-size: 36px;
  letter-spacing: -0.028em;
  font-weight: 500;
  color: var(--psy-ink);
  text-wrap: balance;
  margin: 0;
}
.section-head .sub {
  color: var(--fg2);
  font-size: 15px;
  max-width: 480px;
  margin-top: 6px;
}

/* Trust strip */
.trust-strip {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-6);
  padding: var(--sp-5) var(--sp-6);
  background: var(--psy-surface-2);
  border: 1px solid var(--psy-rule);
  border-radius: 20px;
  margin-top: var(--sp-4);
}
.trust-strip .item {
  display: flex; align-items: center; gap: 12px;
}
.trust-strip .item .icon { color: var(--psy-leaf); font-size: 22px; }
.trust-strip .item .label {
  font-size: 13px; color: var(--fg2);
}
.trust-strip .item .num {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--psy-ink);
  letter-spacing: -0.02em;
}

/* ============================================================
   Directory
   ============================================================ */
.directory {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: var(--sp-8);
}
.filter-card {
  background: var(--psy-surface-2);
  border: 1px solid var(--psy-rule);
  border-radius: 20px;
  padding: var(--sp-5);
  align-self: start;
  position: sticky;
  top: 88px;
}
.filter-card h4 {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--fg2);
  margin: 18px 0 10px;
}
.filter-card h4:first-child { margin-top: 0; }
.checks { display: flex; flex-direction: column; gap: 8px; }
.check {
  display: flex; align-items: center; gap: 10px;
  font-size: 13.5px;
  color: var(--psy-ink);
  cursor: pointer;
  padding: 4px 0;
}
.check input { accent-color: var(--psy-accent); width: 16px; height: 16px; }
.check .count { color: var(--fg3); font-size: 12px; margin-left: auto; }

.results-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--sp-5);
}
.results-toolbar .count {
  font-size: 14px; color: var(--fg2);
}
.results-toolbar .count strong { color: var(--psy-ink); font-weight: 600; }

.psy-list {
  display: grid;
  gap: var(--sp-4);
}
.psy-card {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: var(--sp-5);
  padding: var(--sp-5);
  background: var(--psy-surface-2);
  border: 1px solid var(--psy-rule);
  border-radius: 20px;
  transition: border-color var(--dur-fast), transform var(--dur-base), box-shadow var(--dur-base);
  cursor: pointer;
}
.psy-card:hover {
  border-color: color-mix(in oklab, var(--psy-ink) 22%, transparent);
  box-shadow: var(--elev-2);
}
.psy-card .info { min-width: 0; }
.psy-card .name-row {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
.psy-card .name {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  color: var(--psy-ink);
  letter-spacing: -0.018em;
}
.psy-card .creds {
  font-size: 13px; color: var(--fg2);
}
.psy-card .verified {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--psy-leaf);
  font-size: 12px;
  font-weight: 500;
}
.psy-card .verified .icon { font-size: 16px; }
.psy-card .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.psy-card .blurb {
  margin-top: 10px;
  font-size: 14px;
  color: var(--fg2);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.psy-card .meta {
  margin-top: 12px;
  display: flex; gap: 16px; align-items: center;
  font-size: 13px; color: var(--fg2);
  flex-wrap: wrap;
}
.psy-card .meta .icon { font-size: 16px; vertical-align: -3px; margin-right: 4px; }
.psy-card .side {
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
  justify-content: space-between;
}
.psy-card .save {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--psy-rule);
  background: var(--psy-surface-2);
  display: grid; place-items: center;
  color: var(--fg2);
}
.psy-card .save.saved { color: var(--psy-accent); border-color: var(--psy-accent); }

/* ============================================================
   Detail page
   ============================================================ */
.detail {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: var(--sp-8);
}
@media (max-width: 1100px) { .detail { grid-template-columns: 1fr; } }

.detail-hero {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: var(--sp-5);
  padding: var(--sp-6);
  background: var(--psy-surface-2);
  border: 1px solid var(--psy-rule);
  border-radius: 24px;
}
.detail-hero .name {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 500;
  letter-spacing: -0.028em;
  margin: 0;
}
.detail-hero .creds { color: var(--fg2); margin-top: 4px; font-size: 15px; }
.detail-hero .row-meta {
  display: flex; flex-wrap: wrap; gap: 16px; margin-top: 14px;
  font-size: 14px; color: var(--fg2);
}
.detail-hero .row-meta .item { display: inline-flex; align-items: center; gap: 6px; }
.detail-hero .row-meta .item .icon { color: var(--psy-ink); font-size: 18px; }

.tabs {
  display: flex; gap: 4px; margin: 24px 0 16px;
  border-bottom: 1px solid var(--psy-rule);
}
.tab {
  appearance: none; background: none; border: 0;
  padding: 10px 4px;
  margin-right: 24px;
  font-size: 14px;
  font-weight: 500;
  color: var(--fg2);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab.active {
  color: var(--psy-ink);
  border-bottom-color: var(--psy-ink);
}

/* Booking card */
.booking-card {
  position: sticky;
  top: 88px;
  background: var(--psy-surface-2);
  border: 1px solid var(--psy-rule);
  border-radius: 24px;
  padding: var(--sp-5);
}
.booking-card .price {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.025em;
}
.booking-card .price small { font-size: 14px; font-weight: 500; color: var(--fg2); }
.day-strip {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 12px;
}
.day-strip .day {
  background: var(--psy-surface);
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 8px 0;
  text-align: center;
  font-size: 12px; color: var(--fg2);
  cursor: pointer;
}
.day-strip .day .num {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--psy-ink);
  font-weight: 600;
  display: block;
  margin-top: 2px;
}
.day-strip .day.has { background: var(--psy-surface-2); border-color: var(--psy-rule); }
.day-strip .day.has:hover { border-color: var(--psy-ink); }
.day-strip .day.selected { background: var(--psy-ink); color: white; border-color: var(--psy-ink); }
.day-strip .day.selected .num { color: white; }
.day-strip .day.disabled { opacity: 0.35; cursor: default; }

.slot-grid {
  margin-top: 12px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.slot {
  appearance: none;
  background: var(--psy-surface-2);
  border: 1px solid var(--psy-rule);
  border-radius: 10px;
  padding: 10px 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--psy-ink);
}
.slot:hover { border-color: var(--psy-ink); }
.slot.selected { background: var(--psy-ink); color: white; border-color: var(--psy-ink); }
.slot:disabled { color: var(--fg3); cursor: not-allowed; }

/* Map placeholder — abstract grid using palette */
.map {
  height: 220px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 40% 50%, color-mix(in oklab, var(--psy-accent) 18%, transparent), transparent 35%),
    repeating-linear-gradient(45deg, var(--psy-rule) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(-45deg, color-mix(in oklab, var(--psy-rule) 60%, white) 0 1px, transparent 1px 28px),
    var(--psy-surface);
  position: relative;
  border: 1px solid var(--psy-rule);
  overflow: hidden;
}
.map .pin {
  position: absolute;
  left: 40%; top: 48%;
  transform: translate(-50%, -100%);
  background: var(--psy-accent);
  color: white;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 6px 16px color-mix(in oklab, var(--psy-accent) 50%, transparent);
}
.map .pin::after {
  content: ''; position: absolute;
  bottom: -6px; left: 50%; transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--psy-accent);
}

/* Reviews */
.review {
  padding: 18px 0;
  border-bottom: 1px solid var(--psy-rule);
}
.review:last-child { border-bottom: 0; }
.review-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px;
}
.review-author { font-size: 14px; font-weight: 600; }
.review-meta { font-size: 12px; color: var(--fg3); }
.review-body { font-size: 14px; line-height: 1.6; color: var(--psy-ink); }
.verified-badge {
  display: inline-flex; align-items: center; gap: 3px;
  background: var(--psy-leaf-soft);
  color: var(--psy-leaf);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
}
.verified-badge .icon { font-size: 13px; }

/* ============================================================
   Quiz
   ============================================================ */
.quiz-shell {
  max-width: 720px;
  margin: 0 auto;
  padding-top: var(--sp-12);
}
.quiz-progress {
  display: flex; gap: 4px; margin-bottom: var(--sp-10);
}
.quiz-progress .seg {
  flex: 1; height: 4px; border-radius: 999px;
  background: var(--psy-rule);
}
.quiz-progress .seg.done { background: var(--psy-ink); }
.quiz-progress .seg.now  { background: var(--psy-accent); }
.quiz-question {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.08;
  text-wrap: balance;
  margin: 0;
}
body[data-type="humanist"]  .quiz-question { font-weight: 600; }
body[data-type="editorial"] .quiz-question { font-weight: 400; }
.quiz-sub { color: var(--fg2); margin-top: 16px; font-size: 16px; line-height: 1.5; max-width: 560px; }
.quiz-options { display: grid; gap: 10px; margin-top: var(--sp-8); }
.quiz-options.quiz-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
@media (max-width: 600px) { .quiz-options.quiz-grid { grid-template-columns: 1fr 1fr; } }
.quiz-option.disabled { opacity: 0.35; cursor: not-allowed; }
.quiz-option {
  text-align: left;
  background: var(--psy-surface-2);
  border: 1.5px solid var(--psy-rule);
  border-radius: 16px;
  padding: 16px 20px;
  font-size: 15px;
  font-family: var(--font-sans);
  color: var(--psy-ink);
  display: flex; align-items: center; gap: 14px;
  cursor: pointer;
  box-shadow: var(--elev-1);
  transition: border-color var(--dur-fast), background var(--dur-fast), box-shadow var(--dur-fast), transform var(--dur-fast);
}
.quiz-option:hover {
  border-color: var(--psy-accent);
  box-shadow: 0 0 0 3px var(--psy-accent-soft), var(--elev-1);
}
.quiz-option:active { transform: scale(0.98); }
.quiz-option.selected {
  background: var(--psy-ink);
  color: white;
  border-color: var(--psy-ink);
  box-shadow: var(--elev-2);
}
.quiz-option .key {
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--psy-rule);
  color: var(--fg2);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
  flex: none;
  letter-spacing: 0;
}
.quiz-option.selected .key { background: rgba(255,255,255,0.18); color: white; }
.quiz-option:hover:not(.selected) .key { background: var(--psy-accent-soft); color: var(--psy-accent); }
.quiz-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: var(--sp-10);
}
.quiz-foot .skip {
  color: var(--fg2);
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 4px;
  background: none; border: 0;
  cursor: pointer;
}
.quiz-skip-top {
  font-size: 13px;
  font-family: var(--font-sans);
  color: var(--fg2);
  background: none;
  border: 1px solid var(--psy-rule);
  border-radius: 999px;
  padding: 6px 16px;
  cursor: pointer;
  transition: border-color var(--dur-fast), color var(--dur-fast);
}
.quiz-skip-top:hover { border-color: var(--psy-ink); color: var(--psy-ink); }

/* Recommend card */
.recommend-card {
  background: var(--psy-surface-2);
  border: 1px solid var(--psy-rule);
  border-radius: 28px;
  padding: var(--sp-8);
}
.recommend-card .badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--psy-leaf-soft);
  color: var(--psy-leaf);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.recommend-card h2 {
  font-family: var(--font-display);
  font-size: 48px;
  letter-spacing: -0.032em;
  font-weight: 500;
  margin-top: 18px;
  line-height: 1.06;
  margin: 18px 0 0;
}
body[data-type="humanist"]  .recommend-card h2 { font-weight: 600; }
body[data-type="editorial"] .recommend-card h2 { font-weight: 400; }
.recommend-card h2 em {
  color: var(--psy-accent);
  font-style: normal;
}
body[data-type="editorial"] .recommend-card h2 em { font-style: italic; }
.recommend-card .why { color: var(--fg2); margin-top: 18px; font-size: 16px; line-height: 1.55; }

/* ============================================================
   Chat
   ============================================================ */
.chat {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 0;
  height: calc(100vh - 200px);
  min-height: 600px;
  background: var(--psy-surface-2);
  border: 1px solid var(--psy-rule);
  border-radius: 24px;
  overflow: hidden;
}
.chat-list {
  border-right: 1px solid var(--psy-rule);
  display: flex; flex-direction: column;
}
.chat-list-head {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--psy-rule);
}
.chat-list-head h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
}
.chat-list-items { flex: 1; overflow: auto; }
.chat-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px 16px;
  cursor: pointer;
  border-left: 3px solid transparent;
}
.chat-item:hover { background: var(--psy-surface); }
.chat-item.active { background: var(--psy-surface); border-left-color: var(--psy-accent); }
.chat-item .who { font-size: 14px; font-weight: 600; }
.chat-item .preview {
  font-size: 12.5px; color: var(--fg2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat-item .time { font-size: 11px; color: var(--fg3); }
.chat-item .badge {
  background: var(--psy-accent); color: white;
  border-radius: 999px;
  font-size: 10px; font-weight: 700;
  padding: 2px 6px;
  margin-top: 4px;
}

.chat-main { display: flex; flex-direction: column; }
.chat-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--psy-rule);
}
.chat-head .who { font-size: 15px; font-weight: 600; }
.chat-head .status {
  font-size: 11px; color: var(--psy-leaf); font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px;
}
.chat-head .status::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--psy-leaf);
}

.chat-body {
  flex: 1; overflow: auto;
  padding: 20px;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--psy-surface);
}
.msg {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
}
.msg.me {
  align-self: flex-end;
  background: var(--psy-ink); color: white;
  border-bottom-right-radius: 4px;
}
.msg.them {
  align-self: flex-start;
  background: var(--psy-surface-2); border: 1px solid var(--psy-rule);
  border-bottom-left-radius: 4px;
}
.msg .when {
  font-size: 10px; opacity: 0.55;
  margin-top: 4px;
}
.msg.attachment {
  background: var(--psy-surface-2);
  border: 1px solid var(--psy-rule);
  align-self: flex-start;
  padding: 10px 12px;
  display: flex; align-items: center; gap: 10px;
}
.msg.attachment .icon { color: var(--psy-accent); }
.chat-day {
  align-self: center;
  font-size: 11px;
  color: var(--fg3);
  background: var(--psy-surface-2);
  border: 1px solid var(--psy-rule);
  padding: 2px 10px;
  border-radius: 999px;
  margin: 8px 0;
}

.chat-foot {
  padding: 12px 16px;
  border-top: 1px solid var(--psy-rule);
  background: var(--psy-surface-2);
  display: flex; gap: 8px; align-items: center;
}
.chat-foot .input { border-radius: 999px; height: 44px; padding: 0 18px; }
.chat-foot .send-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--psy-ink); color: white; border: 0;
  display: grid; place-items: center;
}

/* ============================================================
   Community
   ============================================================ */
.community-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--sp-8);
}
.post-card {
  background: var(--psy-surface-2);
  border: 1px solid var(--psy-rule);
  border-radius: 20px;
  padding: 22px;
  margin-bottom: 12px;
}
.post-card h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.22;
  text-wrap: balance;
  margin: 0;
}
body[data-type="editorial"] .post-card h3 { font-weight: 400; }
.post-card .meta {
  font-size: 12px;
  color: var(--fg3);
  margin-top: 6px;
}
.post-card .excerpt {
  margin-top: 10px;
  color: var(--fg2);
  font-size: 14px;
  line-height: 1.55;
}
.post-card .foot {
  display: flex; align-items: center; gap: 16px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--fg2);
}
.post-card .foot .icon { vertical-align: -3px; font-size: 16px; margin-right: 4px; }
.post-card.expert {
  border-color: transparent;
  background: linear-gradient(180deg, var(--psy-accent-soft), var(--psy-surface-2) 45%);
}
.post-card .answer-from-pro {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--psy-surface);
  border-radius: 14px;
  border-left: 3px solid var(--psy-accent);
}
.post-card .answer-from-pro .who {
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.post-card .answer-from-pro .who .verified-badge { font-size: 10px; padding: 1px 6px; }
.post-card .answer-from-pro p {
  font-size: 14px; line-height: 1.55; margin-top: 6px; color: var(--psy-ink);
}

/* ============================================================
   Mood journal
   ============================================================ */
.mood-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px;
}
.mood-btn {
  background: var(--psy-surface-2); border: 1px solid var(--psy-rule);
  border-radius: 16px;
  padding: 18px 8px;
  text-align: center;
  cursor: pointer;
}
.mood-btn .face {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid; place-items: center;
  margin: 0 auto 8px;
  background: var(--psy-surface);
}
.mood-btn .face svg { display: block; }
.mood-btn .label { font-size: 12px; color: var(--fg2); font-weight: 500; }
.mood-btn.selected { border-color: var(--psy-ink); background: var(--psy-surface); }
.mood-btn.selected .label { color: var(--psy-ink); }

.day-chart {
  display: flex; align-items: end; gap: 6px;
  height: 120px; padding-top: 8px;
  border-bottom: 1px solid var(--psy-rule);
}
.day-chart .bar {
  flex: 1;
  background: var(--psy-accent);
  border-radius: 6px 6px 0 0;
  position: relative;
}
.day-chart .bar.low { background: var(--psy-rule); }
.day-chart-labels {
  display: flex; gap: 6px;
  margin-top: 6px;
  font-size: 10px;
  color: var(--fg3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.day-chart-labels div { flex: 1; text-align: center; }

/* ============================================================
   Compare table
   ============================================================ */
.compare-table {
  background: var(--psy-surface-2);
  border: 1px solid var(--psy-rule);
  border-radius: 20px;
  overflow: hidden;
}
.compare-row {
  display: grid;
  grid-template-columns: 200px repeat(3, 1fr);
  border-bottom: 1px solid var(--psy-rule);
}
.compare-row:last-child { border-bottom: 0; }
.compare-row > div {
  padding: 14px 18px;
  font-size: 14px;
  border-right: 1px solid var(--psy-rule);
}
.compare-row > div:last-child { border-right: 0; }
.compare-row.head > div {
  background: var(--psy-surface);
  font-weight: 600;
}
.compare-row .label {
  background: var(--psy-surface);
  color: var(--fg2);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ============================================================
   Provider dashboard
   ============================================================ */
.dash {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--sp-5);
}
.dash .stat {
  background: var(--psy-surface-2); border: 1px solid var(--psy-rule);
  border-radius: 20px;
  padding: 22px;
}
.dash .stat .num {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 500;
  letter-spacing: -0.025em;
  display: block;
  line-height: 1;
}
body[data-type="humanist"]  .dash .stat .num { font-weight: 600; }
.dash .stat .label {
  color: var(--fg2);
  font-size: 13px;
  margin-top: 8px;
}
.dash .stat .delta { font-size: 12px; color: var(--psy-leaf); margin-top: 6px; font-weight: 600; }
.dash .stat .delta.neg { color: var(--color-error); }

/* Admin queue rows */
.queue-row {
  display: grid;
  grid-template-columns: 44px 1fr auto auto auto;
  gap: 14px;
  align-items: center;
  padding: 14px 20px;
  border-top: 1px solid var(--psy-rule);
}
.queue-row:first-child { border-top: 0; }
.queue-row .who { font-weight: 600; font-size: 14px; }
.queue-row .creds { color: var(--fg2); font-size: 12px; }
.queue-row .when { font-size: 12px; color: var(--fg3); }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--psy-ink);
  color: white;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--elev-4);
  z-index: 50;
  animation: toast-in 200ms var(--ease-standard);
}
@keyframes toast-in {
  from { transform: translate(-50%, 20px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

/* Crisis ribbon */
.crisis {
  background: var(--psy-ink);
  color: white;
  font-size: 12.5px;
  text-align: center;
  padding: 8px 16px;
}
.crisis a { color: color-mix(in oklab, var(--psy-accent) 65%, white); text-decoration: underline; text-underline-offset: 2px; }

/* Misc */
.row { display: flex; align-items: center; gap: var(--sp-4); }
.row.spread { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: var(--sp-3); }
.muted { color: var(--fg2); }
.divider { height: 1px; background: var(--psy-rule); margin: 16px 0; }
.bullet { color: var(--fg3); }
