/* ============================================================
   TrippoMe Travel — Design Handoff skin
   Editorial cream / deep ink / single teal accent.
   Day + night tokens. Loaded last; every rule is scoped away from
   .a11y-contrast so the black-and-white accessibility mode still wins.
   Existing element IDs, data-i18n hooks and JS logic stay untouched.
   ============================================================ */

:where(html:not(.a11y-contrast)):root {
  --paper: #F6F3EE;
  --paper-2: #FFFFFF;
  --surface: #FFFFFF;
  --soft: #F6F3EE;
  --ink: #1D2A33;
  --ink-soft: #4A5560;
  --muted: #5B6670;
  --line: #DDD6CA;
  --line-soft: #EFEAE1;
  --brand: #1F5C5A;
  --brand-2: #6CC5BD;
  --violet: #1F5C5A;
  --teal: #1F5C5A;
  --gold: #8A6A3B;
  --dg: #A54A28;
  --ondg: #FFFFFF;
  --onac: #FFFFFF;
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-xl: 28px;
  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: 0 18px 40px -30px rgba(29, 42, 51, .55);
}

:where(html[data-theme="night"]:not(.a11y-contrast)):root {
  --paper: #12181D;
  --paper-2: #1B242B;
  --surface: #1B242B;
  --soft: #232E36;
  --ink: #F3EFE7;
  --ink-soft: #C2CBD1;
  --muted: #A9B3BA;
  --line: #2E3A42;
  --line-soft: #232E36;
  --brand: #6CC5BD;
  --brand-2: #1F5C5A;
  --violet: #6CC5BD;
  --teal: #6CC5BD;
  --gold: #D8B27A;
  --dg: #E98F6B;
  --ondg: #1B0F09;
  --onac: #0F1A1E;
  --shadow-lg: 0 22px 48px -32px rgba(0, 0, 0, .8);
}

/* ---------- Typography ---------- */
:where(html:not(.a11y-contrast)) body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Hiragino Sans', 'Noto Sans JP', 'Microsoft YaHei', sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
:where(html:not(.a11y-contrast)) h1,
:where(html:not(.a11y-contrast)) h2,
:where(html:not(.a11y-contrast)) h3,
:where(html:not(.a11y-contrast)) .brand-text,
:where(html:not(.a11y-contrast)) .insp-title,
:where(html:not(.a11y-contrast)) .kicker {
  font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
  letter-spacing: -0.03em;
}
:where(html:not(.a11y-contrast)) h1 { font-size: clamp(40px, 5.6vw, 68px); font-weight: 500; line-height: 1; }
:where(html:not(.a11y-contrast)) h2 { font-size: clamp(30px, 3.6vw, 42px); font-weight: 500; line-height: 1.08; }
:where(html:not(.a11y-contrast)) h3 { font-size: 24px; font-weight: 500; line-height: 1.2; }

/* ---------- Header ---------- */
:where(html:not(.a11y-contrast)) .nav {
  background: rgba(246, 243, 238, .92);
  border-bottom-color: var(--line);
}
:where(html:not(.a11y-contrast)) body.on-inspire .nav {
  background: rgba(246, 243, 238, .9);
  border-bottom-color: var(--line);
}
:where(html:not(.a11y-contrast)) .nav-inner { max-width: 1280px; padding: 0 24px; gap: 26px; }
@media (min-width: 1281px) {
  :where(html:not(.a11y-contrast)) .nav-inner { padding: 0 56px; }
}
:where(html:not(.a11y-contrast)) .brand { gap: 10px; }
:where(html:not(.a11y-contrast)) .brand-mark {
  background: var(--brand); color: var(--onac);
  border-radius: 12px; box-shadow: none;
}
:where(html:not(.a11y-contrast)) .brand-text { font-size: 28px; font-weight: 600; letter-spacing: -.02em; line-height: .95; }
:where(html:not(.a11y-contrast)) .brand-text em {
  display: block; font-size: 10px; font-style: normal; font-weight: 700;
  letter-spacing: .28em; text-transform: uppercase; color: var(--brand); margin-top: 4px;
}
:where(html:not(.a11y-contrast)) .nav-links a { font-size: 15px; color: var(--ink-soft); }
:where(html:not(.a11y-contrast)) .nav-links a::after { background: var(--brand); }
:where(html:not(.a11y-contrast)) .lang-switch { border-radius: 999px; border-color: var(--ink); }
:where(html:not(.a11y-contrast)) .lang-btn { border-radius: 999px; font-size: 14px; font-weight: 600; }
:where(html:not(.a11y-contrast)) .lang-btn.active { background: var(--brand); color: var(--onac); }
:where(html:not(.a11y-contrast)) .icon-btn { border-radius: 999px; border-color: var(--line); color: var(--ink); }
:where(html:not(.a11y-contrast)) .sos-btn {
  background: var(--dg); color: var(--ondg); border: 0; border-radius: 999px; font-weight: 700;
}
:where(html:not(.a11y-contrast)) .badge { border-radius: 999px; border-color: var(--line); }
:where(html:not(.a11y-contrast)) .badge::before { background: var(--brand); box-shadow: 0 0 0 3px rgba(31, 92, 90, .14); }

html[data-theme="night"]:not(.a11y-contrast) .nav { background: rgba(18, 24, 29, .92); border-bottom-color: var(--line); }
html[data-theme="night"]:not(.a11y-contrast) .nav .brand-text,
html[data-theme="night"]:not(.a11y-contrast) .nav .nav-links a,
html[data-theme="night"]:not(.a11y-contrast) .nav .badge,
html[data-theme="night"]:not(.a11y-contrast) .nav .lang-btn,
html[data-theme="night"]:not(.a11y-contrast) .nav .icon-btn { color: var(--ink); }
html[data-theme="night"]:not(.a11y-contrast) .nav .brand-text em { color: var(--brand); }
html[data-theme="night"]:not(.a11y-contrast) .nav .lang-btn.active { background: var(--brand); color: var(--onac); }
html[data-theme="night"]:not(.a11y-contrast) body.on-inspire .nav { background: rgba(18, 24, 29, .92); }

/* ---------- Buttons, chips, inputs ---------- */
:where(html:not(.a11y-contrast)) .btn,
:where(html:not(.a11y-contrast)) .insp-btn,
:where(html:not(.a11y-contrast)) .chip,
:where(html:not(.a11y-contrast)) .sug,
:where(html:not(.a11y-contrast)) .cat-chip,
:where(html:not(.a11y-contrast)) .month-chip {
  border-radius: 14px; min-height: 44px;
}
:where(html:not(.a11y-contrast)) .btn.primary,
:where(html:not(.a11y-contrast)) .insp-btn.primary,
:where(html:not(.a11y-contrast)) .send-btn {
  background: var(--brand); color: var(--onac); border-color: var(--brand); box-shadow: none;
}
:where(html:not(.a11y-contrast)) .btn.primary:hover,
:where(html:not(.a11y-contrast)) .insp-btn.primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
:where(html:not(.a11y-contrast)) .btn.ghost,
:where(html:not(.a11y-contrast)) .insp-btn.ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
:where(html:not(.a11y-contrast)) .chip,
:where(html:not(.a11y-contrast)) .cat-chip,
:where(html:not(.a11y-contrast)) .month-chip { border-radius: 999px; border-color: var(--line); }
:where(html:not(.a11y-contrast)) .chip.active,
:where(html:not(.a11y-contrast)) .cat-chip.active,
:where(html:not(.a11y-contrast)) .cat-chip[aria-pressed="true"] { background: var(--brand); color: var(--onac); border-color: var(--brand); }
:where(html:not(.a11y-contrast)) input,
:where(html:not(.a11y-contrast)) textarea,
:where(html:not(.a11y-contrast)) select { border-radius: 12px; border-color: var(--line); }

/* ---------- Cards / shells: hairline instead of shadows ---------- */
:where(html:not(.a11y-contrast)) .card,
:where(html:not(.a11y-contrast)) .day-card,
:where(html:not(.a11y-contrast)) .feature,
:where(html:not(.a11y-contrast)) .featured-card,
:where(html:not(.a11y-contrast)) .dest-card,
:where(html:not(.a11y-contrast)) .bubble,
:where(html:not(.a11y-contrast)) .info-box,
:where(html:not(.a11y-contrast)) .explore-card,
:where(html:not(.a11y-contrast)) .ex-card,
:where(html:not(.a11y-contrast)) .facts-card,
:where(html:not(.a11y-contrast)) .housing-card,
:where(html:not(.a11y-contrast)) .mood-card,
:where(html:not(.a11y-contrast)) .medical-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: none;
}
:where(html:not(.a11y-contrast)) .dest-card { border-radius: var(--r-md); overflow: hidden; }
:where(html:not(.a11y-contrast)) .dest-card img,
:where(html:not(.a11y-contrast)) .featured-card img { border-radius: var(--r-md) var(--r-md) 0 0; }
:where(html:not(.a11y-contrast)) .bubble.user { background: var(--brand); color: var(--onac); border-color: var(--brand); }
:where(html:not(.a11y-contrast)) .bubble.bot { background: var(--soft); color: var(--ink); }

/* ---------- Trust strip ---------- */
:where(html:not(.a11y-contrast)) .trust-item b,
:where(html:not(.a11y-contrast)) .trust-grid b {
  font-family: 'Fraunces', Georgia, serif; font-size: 40px; font-weight: 500; color: var(--brand); letter-spacing: -.02em;
}

/* ---------- Concept hero (inspire.css owns the namespace; re-map to new tokens) ---------- */
:where(html[data-theme="day"]:not(.a11y-contrast)) .insp {
  --i-bg: #F6F3EE;
  --i-fg: #1D2A33;
  --i-dim: rgba(29, 42, 51, .72);
  --i-faint: rgba(29, 42, 51, .5);
  --i-line: rgba(29, 42, 51, .16);
  --i-accent: #1F5C5A;
  --i-paper: #F6F3EE;
}
:where(html[data-theme="day"]:not(.a11y-contrast)) body.on-inspire .nav { background: rgba(246, 243, 238, .92); }
:where(html[data-theme="day"]:not(.a11y-contrast)) .insp-veil {
  background:
    linear-gradient(90deg, rgba(246, 243, 238, .94) 0%, rgba(246, 243, 238, .8) 34%, rgba(246, 243, 238, .12) 76%),
    linear-gradient(0deg, rgba(246, 243, 238, .92) 0%, rgba(246, 243, 238, 0) 48%);
}
:where(html[data-theme="day"]:not(.a11y-contrast)) .insp-title { font-family: 'Fraunces', Georgia, serif; font-weight: 500; letter-spacing: -.03em; }
:where(html[data-theme="day"]:not(.a11y-contrast)) .insp-btn.primary { background: #1F5C5A; color: #fff; }
:where(html[data-theme="day"]:not(.a11y-contrast)) .insp-btn.ghost { border-color: rgba(29, 42, 51, .28); color: #1D2A33; }
:where(html[data-theme="day"]:not(.a11y-contrast)) .insp-card { background: #FFFFFF; border-radius: 20px; border: 1px solid #DDD6CA; box-shadow: none; }
:where(html[data-theme="day"]:not(.a11y-contrast)) .insp-card-no { color: #1F5C5A; }
:where(html[data-theme="day"]:not(.a11y-contrast)) .insp-filter.active { background: #1F5C5A; border-color: #1F5C5A; }
:where(html[data-theme="day"]:not(.a11y-contrast)) .insp-rail-wrap { background: #F6F3EE; }
:where(html[data-theme="day"]:not(.a11y-contrast)) .insp-chip { background: #fff; border-color: #DDD6CA; color: #1D2A33; }
:where(html[data-theme="night"]:not(.a11y-contrast)) .insp { --i-accent: #6CC5BD; --i-bg: #12181D; --i-fg: #F3EFE7; }
:where(html[data-theme="night"]:not(.a11y-contrast)) .insp-btn.primary { background: #6CC5BD; color: #0F1A1E; }

/* ---------- Layout rhythm ---------- */
:where(html:not(.a11y-contrast)) main,
:where(html:not(.a11y-contrast)) .wrap,
:where(html:not(.a11y-contrast)) .section { max-width: 1280px; margin-inline: auto; padding-inline: 56px; }

@media (max-width: 1250px) {
  :where(html:not(.a11y-contrast)) .nav-inner { gap: 16px; padding: 0 16px; }
  :where(html:not(.a11y-contrast)) .nav-right { gap: 8px; }
  :where(html:not(.a11y-contrast)) .lang-btn { padding: 5px 8px; font-size: 12px; }
  :where(html:not(.a11y-contrast)) .brand-text { font-size: 24px; }
}
@media (max-width: 760px) {
  :where(html:not(.a11y-contrast)) main,
  :where(html:not(.a11y-contrast)) .wrap,
  :where(html:not(.a11y-contrast)) .section { padding-inline: 16px; }
  :where(html:not(.a11y-contrast)) h2 { font-size: 30px; }
}
/* Keep the narrow-screen nav fixes from styles.css — the gutter above must not win here. */
@media (max-width: 520px) {
  :where(html:not(.a11y-contrast)) .nav-inner { padding: 0 10px; gap: 8px; }
  :where(html:not(.a11y-contrast)) .nav-right { gap: 5px; }
  :where(html:not(.a11y-contrast)) .lang-btn { padding: 5px 6px; font-size: 11px; }
}
@media (max-width: 400px) {
  :where(html:not(.a11y-contrast)) .nav-inner { padding: 0 8px; gap: 6px; }
  :where(html:not(.a11y-contrast)) .nav-right { gap: 3px; }
  :where(html:not(.a11y-contrast)) .lang-btn { padding: 3px 3px; font-size: 9.5px; }
  :where(html:not(.a11y-contrast)) .brand-text { font-size: 13.5px; }
  :where(html:not(.a11y-contrast)) .nav-right .sos-btn { padding: 6px 7px; font-size: 12px; }
}

/* ---------- Footer ---------- */
:where(html:not(.a11y-contrast)) footer,
:where(html:not(.a11y-contrast)) .footer {
  border-top: 1px solid var(--line); background: var(--paper); color: var(--muted);
}
:where(html:not(.a11y-contrast)) .foot-ver {
  margin: 8px 0 0; font-size: 12px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: var(--brand);
}
:where(html:not(.a11y-contrast)) .foot-copyright {
  margin: 6px 0 0; font-size: 11px; font-weight: 400;
  letter-spacing: 0; text-transform: none; color: var(--muted); opacity: .85;
}

/* ============================================================
   HANDOFF LAYOUT — editorial section-by-section re-layout.
   Same elements/IDs/JS; only visual layout is re-composed.
   ============================================================ */

/* ---------- Section rhythm: hairline separators, generous gaps ---------- */
:where(html:not(.a11y-contrast)) .section-head h2 { font-family: 'Fraunces', Georgia, serif; font-weight: 500; }
:where(html:not(.a11y-contrast)) .kicker {
  font-family: 'DM Sans', sans-serif; font-weight: 700;
  letter-spacing: .12em; color: var(--brand);
}

/* ---------- Features → 6 numbered editorial rows (01–06) ---------- */
:where(html:not(.a11y-contrast)) .feature-grid {
  counter-reset: tbfeat; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 40px;
}
:where(html:not(.a11y-contrast)) .feature {
  counter-increment: tbfeat;
  display: grid; grid-template-columns: 44px minmax(0, 1fr);
  grid-template-rows: auto auto; column-gap: 14px; row-gap: 4px; align-items: start;
  background: transparent; border: 0; border-top: 1px solid var(--line);
  border-radius: 0; padding: 22px 0; box-shadow: none;
}
:where(html:not(.a11y-contrast)) .feature:hover {
  transform: none; box-shadow: none; background: transparent; border-color: var(--line);
}
:where(html:not(.a11y-contrast)) .feature .f-ico {
  grid-column: 1; grid-row: 1 / span 2;
  width: 44px; height: auto; min-height: 0;
  background: transparent; border-radius: 0; font-size: 0; line-height: 1;
}
:where(html:not(.a11y-contrast)) .feature .f-ico::before {
  content: counter(tbfeat, decimal-leading-zero);
  font-family: 'Fraunces', Georgia, serif; font-size: 22px; font-weight: 500;
  color: var(--brand); letter-spacing: -.02em;
}
:where(html:not(.a11y-contrast)) .feature h3 {
  grid-column: 2; grid-row: 1;
  font-family: 'DM Sans', sans-serif; font-size: 17px; font-weight: 600; letter-spacing: 0;
}
:where(html:not(.a11y-contrast)) .feature p { grid-column: 2; grid-row: 2; font-size: 15px; }

/* ---------- Chat → split: intro left / chat card right ---------- */
@media (min-width: 901px) {
  :where(html:not(.a11y-contrast)) #chat {
    display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 40px; align-items: start;
  }
  :where(html:not(.a11y-contrast)) #chat .section-head { margin: 0; padding-top: 10px; max-width: none; }
}
@media (max-width: 760px) {
  :where(html:not(.a11y-contrast)) .feature-grid { grid-template-columns: 1fr; }
}

/* ---------- Concept hero → split card: text left / photo right ---------- */
@media (min-width: 901px) {
  :where(html:not(.a11y-contrast)) .insp { padding: 32px 56px 8px; background: var(--paper); }
  :where(html:not(.a11y-contrast)) .insp-stage {
    min-height: 600px; border-radius: 28px; overflow: hidden;
    border: 1px solid var(--line); background: var(--surface);
  }
  /* Photo occupies only the right half */
  :where(html:not(.a11y-contrast)) .insp-media { left: 50%; right: auto; width: 50%; }
  :where(html:not(.a11y-contrast)) .insp-veil {
    background: linear-gradient(90deg, var(--surface) 0%, rgba(246, 243, 238, 0) 22%);
  }
  html[data-theme="night"]:not(.a11y-contrast) .insp-veil {
    background: linear-gradient(90deg, var(--surface) 0%, rgba(18, 24, 29, 0) 22%);
  }
  :where(html:not(.a11y-contrast)) .insp-grain { display: none; }
  /* Left column holds the editorial copy */
  :where(html:not(.a11y-contrast)) .insp-inner {
    width: 50%; max-width: none; min-height: 600px; margin: 0;
    padding: 48px; justify-content: center; gap: 34px;
  }
  :where(html:not(.a11y-contrast)) .insp-copy { max-width: none; margin: 0; padding: 0; }
  :where(html:not(.a11y-contrast)) .insp-title {
    font-size: clamp(44px, 5vw, 66px); font-weight: 500; letter-spacing: -.03em;
    text-shadow: none; color: var(--ink);
  }
  :where(html:not(.a11y-contrast)) .insp-line { color: var(--muted); }
  :where(html:not(.a11y-contrast)) .insp-mark,
  :where(html:not(.a11y-contrast)) .insp-index { color: var(--brand); }
  :where(html:not(.a11y-contrast)) .insp-kicker { color: var(--brand); }
  :where(html:not(.a11y-contrast)) .insp-bottom { flex-direction: column; align-items: flex-start; gap: 12px; }
  :where(html:not(.a11y-contrast)) .insp-bottom-right { flex-wrap: wrap; }
  :where(html:not(.a11y-contrast)) .insp-dots { justify-content: flex-start; }
}

/* ---------- Large-text mode: keep the nav inside the viewport ---------- */
html.a11y-large:not(.a11y-contrast) .nav-inner { flex-wrap: wrap; row-gap: 6px; }
html.a11y-large:not(.a11y-contrast) .nav-right { gap: 6px; }
html.a11y-large:not(.a11y-contrast) .nav-links { gap: 14px; }
html.a11y-large:not(.a11y-contrast) .lang-btn { padding-inline: 6px; }

/* ---------- Departure Hub card (Blueprint Tranche 1) ---------- */
.dep-group{margin-top:16px}
.dep-group-title{font-weight:800;font-size:14px;margin-bottom:8px;color:var(--ink)}
.dep-stage{font-size:10px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);border-bottom:1px dashed var(--line);padding:8px 0 4px;margin-bottom:4px}
.dep-item{display:flex;align-items:center;gap:10px;padding:7px 10px;border:1px solid var(--line);border-radius:10px;margin-bottom:5px;background:var(--paper);font-size:13px}
.dep-item input{accent-color:var(--brand)}
.dep-item.done span{text-decoration:line-through;opacity:.5}
.dep-foot{margin-top:14px;padding-top:10px;border-top:1px solid var(--line);font-size:11px;color:var(--muted)}

/* ---------- Travel Memory Center card (Blueprint Tranche 2) ---------- */
.jr-tabs{display:flex;gap:6px;flex-wrap:wrap;margin:12px 0}
.jr-tab{font:inherit;font-size:11px;font-weight:700;padding:6px 12px;border:1px solid var(--line);border-radius:999px;background:var(--surface);cursor:pointer;color:var(--muted)}
.jr-tab.on{background:var(--ink);color:var(--paper);border-color:var(--ink)}
.jr-body{min-height:80px}
.jr-field{display:flex;flex-direction:column;gap:5px;font-size:12px;font-weight:700;color:var(--muted);margin-bottom:11px}
.jr-field input,.jr-field textarea,.jr-input{font:inherit;font-size:13px;padding:9px 11px;border:1px solid var(--line);border-radius:10px;background:var(--paper);color:var(--ink);width:100%;resize:vertical;box-sizing:border-box}
.jr-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.jr-moods{display:flex;gap:5px;flex-wrap:wrap;margin-top:5px}
.jr-mood{font:inherit;font-size:11px;padding:5px 10px;border:1px solid var(--line);border-radius:999px;background:var(--paper);cursor:pointer;color:var(--muted)}
.jr-mood.on{background:var(--brand);color:#fff;border-color:var(--brand)}
.jr-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}
.jr-statbar{display:flex;gap:16px;flex-wrap:wrap;padding:10px 13px;border:1px solid var(--line);border-radius:10px;background:var(--paper);margin-bottom:12px;font-size:12px;color:var(--muted)}
.jr-statbar b{font-family:Georgia,serif;font-size:18px;color:var(--brand);margin-right:3px}
.jr-timeline{margin-top:8px}
.jr-entry{border:1px solid var(--line);border-radius:12px;padding:11px 13px;margin-bottom:8px;background:var(--paper)}
.jr-entry-top{display:flex;gap:9px;align-items:center;font-size:10px;color:var(--muted);margin-bottom:4px;flex-wrap:wrap}
.jr-place{color:var(--brand);font-weight:700}.jr-mood-tag{background:var(--line-soft);border-radius:999px;padding:2px 8px}
.jr-entry-title{font-weight:800;font-size:13px;margin-bottom:3px}
.jr-entry-note{font-size:12px;color:var(--ink-soft);white-space:pre-wrap}
.jr-entry-actions{display:flex;gap:6px;margin-top:7px}
.jr-photo img{max-width:100%;max-height:220px;border-radius:9px;margin-top:7px;display:block}
.jr-empty{color:var(--muted);font-size:12px;padding:14px 0}
.jr-recap-title{font-weight:800;font-size:13px;margin-bottom:3px}
.jr-recap-hint{font-size:11px;color:var(--muted);margin:0 0 11px}
.jr-share{font:inherit;font-size:12px;padding:10px;border:1px solid var(--line);border-radius:10px;background:var(--paper);color:var(--ink);width:100%;margin:10px 0;resize:vertical;box-sizing:border-box}
.jr-hint{font-size:10px;color:var(--muted);margin-top:9px}
.jr-toast{font-size:11px;color:var(--brand);font-weight:700;margin-top:9px}
.jr-stars{display:flex;align-items:center;gap:3px;font-size:11px;color:var(--muted);margin:9px 0}
.jr-stars button{font-size:19px;line-height:1;border:0;background:none;cursor:pointer;color:var(--brand);padding:0 2px}
@media(max-width:520px){.jr-grid{grid-template-columns:1fr}}
