/* ==========================================================================
   youyou et yasminou — full styles
   ========================================================================== */

:root {
  --bg: #faf6ef;
  --bg-veil: #f3ecdf;
  --surface: #ffffff;
  --surface-warm: #fdfaf4;
  --ink: #2a1f1a;
  --ink-soft: #524339;
  --muted: #9a8a7c;
  --line: #ece3d4;
  --line-strong: #d9cdb9;

  --accent: #8b3a4a;
  --accent-deep: #6e2d3a;
  --accent-soft: #f3e0e1;

  --sage: #5a7a64;
  --sage-soft: #e1ebe0;

  --gold: #b48a3c;

  --danger: #b13a3a;

  --shadow-sm: 0 1px 2px rgba(76, 50, 30, 0.06);
  --shadow-md: 0 1px 2px rgba(76, 50, 30, 0.05), 0 12px 28px rgba(76, 50, 30, 0.08);
  --shadow-lg: 0 2px 4px rgba(76, 50, 30, 0.06), 0 22px 50px rgba(76, 50, 30, 0.10);

  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 100px;

  --max: 1080px;
  --max-narrow: 760px;

  --serif: "Fraunces", "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(1200px 600px at 80% -10%, #f6e9d9 0%, transparent 60%),
    radial-gradient(900px 500px at -10% 110%, #f0e3e3 0%, transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.hidden { display: none !important; }

/* ==========================================================================
   AUTH SCREEN
   ========================================================================== */

.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 48px 40px 32px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  width: 100%;
  max-width: 420px;
}

.auth-card .brand-mark.large {
  width: 64px;
  height: 64px;
  font-size: 1.6rem;
  margin: 0 auto 18px;
}

.auth-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.55rem;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.auth-title em {
  font-style: italic;
  color: var(--accent);
  font-weight: 400;
  margin: 0 1px;
}
.auth-title::after { display: none; }

.auth-sub {
  margin: 0 0 28px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-form input[type="password"] {
  font: inherit;
  font-family: var(--sans);
  padding: 12px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-warm);
  color: var(--ink);
  font-size: 0.97rem;
  text-align: center;
  letter-spacing: 0.05em;
  transition: border-color 0.15s ease;
}

.auth-form input[type="password"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 58, 74, 0.08);
}

.auth-form .btn { padding: 13px 22px; }

.auth-error {
  color: var(--danger);
  font-size: 0.88rem;
  margin: 14px 0 0;
  min-height: 1.2em;
}

.auth-config-warn {
  margin: 12px 0 0;
}

.auth-lang {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.auth-lang button {
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 6px;
}

.auth-lang button.active { color: var(--accent); }
.auth-lang button:hover { color: var(--ink); }

/* ==========================================================================
   HEADER / BRAND
   Mobile: top bar with horizontal scrolling nav.
   Desktop (>= 900px): fixed left sidebar.
   ========================================================================== */

.app-root {
  min-height: 100vh;
}

.site-header {
  background: rgba(250, 246, 239, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px 12px;
  max-width: var(--max);
  margin: 0 auto;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent);
  color: #fdf3f0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 1.05rem;
  letter-spacing: -0.04em;
  box-shadow: 0 4px 14px rgba(139, 58, 74, 0.28), inset 0 0 0 1px rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.brand-mark .amp {
  font-size: 0.72rem;
  margin: 0 1px;
  opacity: 0.8;
}

.brand-name-line {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.12rem;
  letter-spacing: -0.015em;
}
.brand-name-line em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
  margin: 0 1px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-switch {
  display: flex;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 3px;
  box-shadow: var(--shadow-sm);
}

.lang-switch button {
  font: inherit;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 6px 11px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.18s ease;
}
.lang-switch button:hover { color: var(--ink); }
.lang-switch button.active { background: var(--ink); color: var(--bg); }

.btn-icon {
  border: 1px solid var(--line);
  background: var(--surface);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink-soft);
  transition: all 0.15s ease;
}
.btn-icon:hover { color: var(--accent); border-color: var(--line-strong); }

/* Nav */

.site-nav {
  display: flex;
  gap: 4px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.site-nav::-webkit-scrollbar { display: none; }

.site-nav a {
  font-family: var(--sans);
  font-weight: 550;
  font-size: 0.92rem;
  text-decoration: none;
  color: var(--ink-soft);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.site-nav a:hover {
  color: var(--ink);
  background: var(--surface-warm);
}

.site-nav a.active {
  color: var(--accent);
  background: var(--accent-soft);
}

@media (max-width: 600px) {
  .header-row { padding: 14px 18px 10px; }
  .site-nav { padding: 0 18px 10px; }
  .brand-name-line { font-size: 1rem; }
  .brand-mark { width: 38px; height: 38px; font-size: 0.95rem; }
}

/* ==========================================================================
   APP / SCREENS
   ========================================================================== */

.app {
  max-width: var(--max);
  margin: 0 auto;
  padding: 32px 24px 80px;
}

@media (max-width: 600px) { .app { padding: 24px 18px 64px; } }

/* ==========================================================================
   DESKTOP SIDEBAR (>= 900px)
   ========================================================================== */

@media (min-width: 900px) {
  :root { --sidebar-w: 240px; }

  .app-root { display: block; }

  .site-header {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--surface-warm);
    border-right: 1px solid var(--line);
    border-bottom: 0;
    overflow-y: auto;
    padding: 32px 22px;
    display: flex;
    flex-direction: column;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .header-row {
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    margin: 0;
    gap: 22px;
    max-width: none;
  }

  .brand {
    align-items: center;
    gap: 12px;
  }

  .header-actions {
    order: 99;
    margin-top: auto;
    padding-top: 22px;
    border-top: 1px solid var(--line);
    justify-content: space-between;
  }

  .site-nav {
    flex-direction: column;
    gap: 2px;
    padding: 0;
    margin: 8px 0 0;
    max-width: none;
    overflow: visible;
  }

  .site-nav a {
    padding: 10px 14px;
    font-size: 0.94rem;
    border-radius: var(--radius-sm);
    position: relative;
  }

  .site-nav a.active {
    background: var(--accent-soft);
    color: var(--accent);
  }

  .site-nav a.active::before {
    content: "";
    position: absolute;
    left: -22px;
    top: 8px;
    bottom: 8px;
    width: 3px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
  }

  .app {
    margin-left: var(--sidebar-w);
    max-width: none;
    padding: 56px 56px 96px;
  }

  /* The narrow-content screens still cap themselves nicely */
  #intro, #quiz, #results, #browse {
    max-width: var(--max-narrow);
    margin: 0;
  }
}

@media (min-width: 1300px) {
  .app {
    padding-left: 80px;
    padding-right: 80px;
  }
}

.screen { display: none; }
.screen.active { display: block; animation: fade 0.3s ease; }

@keyframes fade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* The quiz screens want a narrower max width for readability */
#intro, #quiz, #results, #browse {
  max-width: var(--max-narrow);
  margin: 0 auto;
}

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */

h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2rem, 5vw, 2.8rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0.15em 0 0.5em;
}
h1::after {
  content: "";
  display: block;
  width: 56px;
  height: 1px;
  background: var(--gold);
  margin-top: 18px;
  opacity: 0.6;
}

h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  margin: 0 0 0.6em;
}
h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.05rem;
  margin: 0 0 0.3em;
}

.kicker {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.7rem;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 0.4em;
}

.lead {
  font-size: 1.05rem;
  color: var(--ink-soft);
  margin: 0 0 1em;
  max-width: 60ch;
}

.muted { color: var(--muted); }
.tiny  { font-size: 0.82rem; }

.empty {
  font-family: var(--serif);
  font-style: italic;
  color: var(--muted);
  text-align: center;
  padding: 48px 16px;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

.loading-line {
  text-align: center;
  padding: 32px;
  font-family: var(--serif);
  font-style: italic;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 1.5em;
}

.btn {
  font: inherit;
  font-family: var(--sans);
  font-weight: 550;
  padding: 13px 24px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
  font-size: 0.95rem;
  letter-spacing: 0.005em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(139, 58, 74, 0.22);
}
.btn.primary:hover:not(:disabled) {
  background: var(--accent-deep);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(139, 58, 74, 0.28);
}
.btn.primary:disabled {
  background: var(--line-strong);
  color: var(--muted);
  cursor: not-allowed;
  box-shadow: none;
}

.btn.ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn.ghost:hover {
  background: var(--surface-warm);
  border-color: var(--ink-soft);
}

.btn.danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid transparent;
}
.btn.danger:hover {
  background: rgba(177, 58, 58, 0.06);
}

.btn-text {
  font: inherit;
  font-family: var(--sans);
  font-size: 0.85rem;
  background: none;
  border: 0;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
  margin-top: 8px;
  letter-spacing: 0.005em;
  font-weight: 550;
}
.btn-text:hover { color: var(--accent-deep); text-decoration: underline; }

.add-btn .plus { font-size: 1.1rem; line-height: 1; margin-right: 1px; }

/* ==========================================================================
   HOME
   ========================================================================== */

.home-section {
  max-width: var(--max);
}

.home-hero {
  text-align: left;
  padding: 24px 0 36px;
}

.home-title {
  font-size: clamp(2.2rem, 6vw, 3.4rem);
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.home-card-wide { grid-column: 1 / -1; }

@media (max-width: 600px) {
  .home-grid { grid-template-columns: 1fr; }
  .home-card-wide { grid-column: auto; }
}

.home-card {
  display: block;
  text-decoration: none;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 30px;
  box-shadow: var(--shadow-sm);
  transition: all 0.18s ease;
  position: relative;
  overflow: hidden;
}

.home-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--accent), var(--gold));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.home-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
}
.home-card:hover::before { opacity: 1; }

.home-card-tag {
  display: inline-block;
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.66rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 10px;
}

.home-card h2 {
  font-size: 1.4rem;
  margin-bottom: 6px;
}

.home-card p {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin: 0;
  line-height: 1.55;
}

/* ==========================================================================
   QUIZ (existing, polished)
   ========================================================================== */

.quiz-header { margin-bottom: 28px; }

.progress {
  height: 3px;
  background: var(--line);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  width: 0%;
  transition: width 0.5s ease;
}

.progress-label {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 10px 0 0;
  font-family: var(--serif);
  font-style: italic;
}

.question-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px;
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
}

@media (max-width: 600px) { .question-card { padding: 26px 22px; } }

.question-card .qtext {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 500;
  margin: 0 0 8px;
  letter-spacing: -0.012em;
  line-height: 1.25;
}

.question-card .qhint {
  color: var(--muted);
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
  margin: 0 0 22px;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  text-align: left;
  width: 100%;
  font: inherit;
  font-family: var(--sans);
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.16s ease;
  background: var(--surface);
  font-size: 0.97rem;
  line-height: 1.45;
  color: var(--ink);
}

.option-text { flex: 1; min-width: 0; }

.option-check {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  border: 1.5px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  position: relative;
  transition: all 0.16s ease;
}
.option:hover .option-check { border-color: var(--ink-soft); }
.option.selected .option-check {
  background: var(--accent);
  border-color: var(--accent);
}
.option.selected .option-check::after {
  content: "";
  position: absolute;
  left: 5px; top: 1px;
  width: 5px; height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.qmulti {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.82rem;
  color: var(--muted);
  margin: -8px 0 18px;
}

.option:hover {
  border-color: var(--ink-soft);
  background: var(--surface-warm);
  transform: translateY(-1px);
}

.option.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(139, 58, 74, 0.08);
}

.option .label { font-weight: 550; display: block; }
.option .sub {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
  margin-top: 4px;
  font-family: var(--serif);
  font-style: italic;
}
.option.selected .sub { color: var(--accent-deep); }

.quiz-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

/* Quiz results */

.results-list {
  display: flex; flex-direction: column; gap: 18px; margin: 32px 0;
}
.result-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 30px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.result-card.top {
  background: linear-gradient(180deg, #fff 0%, var(--surface-warm) 100%);
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
}
.result-card.top::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
}
.result-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
}
.result-rank {
  font-family: var(--serif); font-style: italic;
  font-size: 0.82rem; color: var(--accent); font-weight: 500;
}
.result-name {
  font-family: var(--serif); font-size: 1.55rem; font-weight: 500;
  margin: 0; letter-spacing: -0.015em; line-height: 1.15;
}
.match-bar-wrap { margin: 10px 0 18px; }
.match-bar {
  height: 5px; background: var(--line); border-radius: 4px; overflow: hidden;
}
.match-bar > div {
  height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold));
  transition: width 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.match-pct {
  font-family: var(--serif); font-style: italic;
  font-size: 0.85rem; color: var(--muted); margin-top: 6px;
}
.result-body p { margin: 0 0 14px; color: var(--ink-soft); font-size: 0.97rem; }
.pros-cons {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
  margin-top: 14px; padding-top: 18px;
  border-top: 1px dashed var(--line-strong);
}
.pros-cons h4 {
  font-family: var(--serif); font-style: italic; font-weight: 500;
  font-size: 0.82rem; margin: 0 0 8px;
}
.pros-cons > div:first-child h4 { color: var(--sage); }
.pros-cons > div:last-child  h4 { color: var(--accent); }
.pros-cons ul { margin: 0; padding-left: 18px; font-size: 0.88rem; color: var(--ink-soft); line-height: 1.55; }
.pros-cons li { margin-bottom: 4px; }
@media (max-width: 540px) { .pros-cons { grid-template-columns: 1fr; gap: 14px; } }

.all-results {
  margin: 28px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 16px 22px;
  box-shadow: var(--shadow-sm);
}
.all-results summary { cursor: pointer; font-weight: 550; font-size: 0.93rem; }
.all-results summary:hover { color: var(--accent); }
.full-ranking { margin-top: 16px; padding-left: 24px; font-size: 0.92rem; color: var(--ink-soft); font-family: var(--serif); }
.full-ranking li { padding: 5px 0; }
.full-ranking .pct { color: var(--muted); font-family: var(--sans); margin-left: 8px; font-size: 0.83rem; font-style: normal; }

.reflection {
  background: linear-gradient(180deg, var(--surface), var(--surface-warm));
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 28px 30px;
  margin-top: 36px;
  box-shadow: var(--shadow-sm);
}
.reflection ul { margin: 0; padding-left: 20px; font-size: 0.95rem; color: var(--ink-soft); }
.reflection li { margin-bottom: 12px; }
.reflection strong { color: var(--ink); font-weight: 600; }

.browse-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin: 28px 0;
}
.browse-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 22px 22px 18px;
  box-shadow: var(--shadow-sm);
  transition: all 0.18s ease;
}
.browse-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.browse-card h3 { margin: 0 0 8px; font-size: 1.1rem; }
.browse-card p { margin: 0; font-size: 0.88rem; color: var(--ink-soft); line-height: 1.5; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tag {
  font-family: var(--sans);
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--sage-soft);
  color: var(--sage);
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ==========================================================================
   SECTION HEADERS
   ========================================================================== */

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.section-header h1 { margin-bottom: 0.3em; }
.section-header h1::after { display: none; }
.section-header .lead { margin: 0; }
.section-header .add-btn { flex-shrink: 0; margin-bottom: 4px; }

@media (max-width: 600px) {
  .section-header { align-items: flex-start; }
  .section-header .add-btn { width: 100%; justify-content: center; }
}

/* ==========================================================================
   FILTERS (chips)
   ========================================================================== */

.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.chip {
  font: inherit;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 550;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s ease;
}
.chip:hover { border-color: var(--ink-soft); color: var(--ink); }
.chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ==========================================================================
   PLACES
   ========================================================================== */

.places-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.place-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}
.place-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.place-photo {
  height: 200px;
  background-color: var(--bg-veil);
  background-size: cover;
  background-position: center;
}

.place-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.place-body h3 {
  font-size: 1.2rem;
  margin: 0 0 4px;
}

.place-meta {
  font-family: var(--serif);
  font-style: italic;
  color: var(--muted);
  font-size: 0.86rem;
  margin: 0 0 10px;
}

.place-notes {
  color: var(--ink-soft);
  font-size: 0.91rem;
  margin: 0;
  line-height: 1.55;
  flex: 1;
}

/* ==========================================================================
   MEDIA CARDS (Watch / Read)
   ========================================================================== */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.media-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.18s ease;
  display: flex;
  flex-direction: column;
}
.media-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.media-poster {
  height: 200px;
  background-color: var(--bg-veil);
  background-size: cover;
  background-position: center;
  position: relative;
}
.media-poster.cover { height: 240px; }

.media-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.status-chip {
  align-self: flex-start;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 8px;
}

.status-chip.status-watched, .status-chip.status-read, .status-chip.status-done {
  background: var(--sage-soft); color: var(--sage);
}
.status-chip.status-watching, .status-chip.status-reading, .status-chip.status-planning, .status-chip.status-booked {
  background: #f4ead4; color: var(--gold);
}

.media-card h3 {
  font-size: 1.1rem;
  margin: 0 0 4px;
  line-height: 1.25;
}

.media-meta {
  font-family: var(--serif);
  font-style: italic;
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 8px;
}

.rating {
  margin: 0 0 6px;
  color: var(--gold);
  letter-spacing: 0.1em;
  font-size: 0.95rem;
}
.rating-empty { color: var(--line-strong); }

.media-notes {
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 4px 0 0;
}

.rec-by {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 8px 0 0;
}

/* ==========================================================================
   TRAVEL
   ========================================================================== */

.travel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.travel-card {
  display: block;
  text-decoration: none;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}
.travel-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.travel-hero {
  height: 180px;
  background-color: var(--bg-veil);
  background-size: cover;
  background-position: center;
  position: relative;
}
.travel-hero.detail-hero { height: 280px; border-radius: var(--radius) var(--radius) 0 0; }

.travel-status {
  position: absolute;
  top: 12px; left: 12px;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  backdrop-filter: blur(6px);
}

.travel-body {
  padding: 18px 22px 20px;
}

.travel-card h3 {
  font-size: 1.25rem;
  margin: 0 0 4px;
}

.travel-meta {
  font-family: var(--serif);
  font-style: italic;
  color: var(--muted);
  font-size: 0.86rem;
  margin: 0 0 8px;
}

.travel-summary {
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
}

/* Travel detail */

.travel-detail-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 32px;
}

.travel-detail-body {
  padding: 28px 32px 32px;
}

.travel-detail-body h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin: 0 0 6px;
}
.travel-detail-body h1::after { display: none; }

.travel-detail-actions {
  margin-top: 16px;
}

.back-link {
  margin-bottom: 18px;
  padding: 8px 14px;
  font-size: 0.88rem;
}

.itinerary-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 18px;
}

.itinerary-header h2 {
  font-size: 1.45rem;
  margin: 0;
}

.itinerary-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}

.itinerary-list::before {
  content: "";
  position: absolute;
  left: 38px;
  top: 16px;
  bottom: 16px;
  width: 1px;
  background: var(--line);
}

.day-card {
  display: flex;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px 18px;
  box-shadow: var(--shadow-sm);
  position: relative;
  z-index: 1;
}

.day-num {
  flex-shrink: 0;
  width: 60px;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 500;
  padding-top: 4px;
  border-right: 1px solid var(--line);
}

.day-body { flex: 1; }
.day-body h3 { font-size: 1.05rem; margin: 0 0 6px; }
.day-body ul { margin: 0; padding-left: 18px; font-size: 0.92rem; color: var(--ink-soft); line-height: 1.55; }
.day-body li { margin-bottom: 3px; }
.day-notes { font-size: 0.86rem; color: var(--muted); margin: 8px 0 0; font-family: var(--serif); font-style: italic; }

@media (max-width: 600px) {
  .itinerary-list::before { display: none; }
  .day-card { flex-direction: column; gap: 8px; }
  .day-num { text-align: left; border-right: 0; padding-top: 0; width: auto; }
  .travel-detail-body { padding: 22px 20px 24px; }
}

/* ==========================================================================
   MODAL / FORM
   ========================================================================== */

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(42, 31, 26, 0.42);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px 16px;
  animation: fade 0.2s ease;
  overflow-y: auto;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 540px;
  padding: 32px 36px 28px;
  position: relative;
  margin: auto;
  animation: modalIn 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 32px; height: 32px;
  border: 0;
  background: transparent;
  font-size: 1.5rem;
  color: var(--muted);
  cursor: pointer;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.modal-close:hover { color: var(--ink); background: var(--surface-warm); }

.modal-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.45rem;
  margin: 0 0 22px;
  letter-spacing: -0.01em;
}

.modal-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 16px;
}

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

.field.full { grid-column: 1 / -1; }

.field label {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.field .req { color: var(--accent); }

.field input[type="text"],
.field input[type="number"],
.field input[type="date"],
.field input[type="password"],
.field textarea,
.field select {
  font: inherit;
  font-family: var(--sans);
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-warm);
  color: var(--ink);
  font-size: 0.94rem;
  transition: border-color 0.15s ease;
}

.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(139, 58, 74, 0.08);
}

.field textarea { resize: vertical; min-height: 70px; font-family: var(--sans); }

.field input[type="file"] {
  font: inherit;
  font-family: var(--sans);
  font-size: 0.88rem;
  padding: 8px 0;
}

.field-photo-preview {
  margin-top: 8px;
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

.modal-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.modal-actions .spacer { flex: 1; }

@media (max-width: 540px) {
  .modal { padding: 26px 22px 22px; }
  .modal-form { grid-template-columns: 1fr; }
}

/* ==========================================================================
   TOAST
   ========================================================================== */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: var(--bg);
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 200;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.error { background: var(--danger); }
