:root {
  --bg: #f4f1ea;
  --surface: #fffdf8;
  --surface-2: #ebe5da;
  --ink: #171717;
  --muted: #6f6a61;
  --line: #d8d0c4;
  --red: #b33c31;
  --blue: #274f67;
  --gold: #b98b3d;
  --green: #456758;
  --shadow: 0 18px 55px rgba(36, 28, 18, .08);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

[data-theme="dark"] {
  --bg: #111315;
  --surface: #191c1e;
  --surface-2: #22272a;
  --ink: #f7f1e7;
  --muted: #aaa79f;
  --line: #343a3e;
  --red: #e17164;
  --blue: #83b8d3;
  --gold: #d7aa5b;
  --green: #7fb497;
  --shadow: 0 18px 55px rgba(0, 0, 0, .25);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "DM Sans", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  transition: background .25s ease, color .25s ease;
}
button, textarea { font: inherit; }
button { cursor: pointer; }

.page-shell { max-width: 1320px; margin: 0 auto; padding: 22px; }
.hero {
  position: relative;
  overflow: hidden;
  min-height: 620px;
  border-radius: var(--radius-xl);
  color: #fff;
  background:
    radial-gradient(circle at 82% 22%, rgba(255,255,255,.16), transparent 22%),
    radial-gradient(circle at 70% 74%, rgba(255,210,157,.14), transparent 26%),
    linear-gradient(128deg, #15232a 0%, #233e49 46%, #7c342d 100%);
  box-shadow: var(--shadow);
  padding: 28px 34px 34px;
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto -80px -170px auto;
  width: 500px;
  height: 500px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 50%;
  box-shadow: 0 0 0 55px rgba(255,255,255,.035), 0 0 0 110px rgba(255,255,255,.025);
}
.topbar { display:flex; align-items:center; justify-content:space-between; position:relative; z-index:2; }
.brand { font-size: .88rem; letter-spacing: .2em; font-weight: 700; }
.brand span { color: #f7c38d; padding: 0 6px; }
.top-actions { display:flex; gap:10px; }
.icon-btn,.btn {
  border: 1px solid rgba(255,255,255,.23);
  background: rgba(255,255,255,.08);
  color: inherit;
  border-radius: 999px;
  padding: 11px 18px;
  transition: .2s ease;
}
.icon-btn { width:42px; height:42px; padding:0; }
.btn:hover,.icon-btn:hover { transform: translateY(-1px); background: rgba(255,255,255,.14); }
.btn-primary { background:#fff; color:#13232a; border-color:#fff; font-weight:700; }
.btn-primary:hover { background:#f7eee4; }
.btn-ghost { font-weight:600; }

.hero-grid { display:grid; grid-template-columns: 1.25fr .75fr; gap:50px; align-items:end; min-height:425px; position:relative; z-index:1; }
.eyebrow { margin:0 0 12px; font-size:.74rem; letter-spacing:.17em; font-weight:700; color: var(--gold); }
.hero .eyebrow { color:#f0c48f; }
h1,h2,h3 { margin-top:0; }
h1 { font-family:"Playfair Display", serif; font-size:clamp(3rem,6vw,6.2rem); line-height:.95; letter-spacing:-.045em; margin-bottom:24px; }
h1 em { color:#f0c48f; font-style:italic; }
.hero-copy { max-width:710px; color:rgba(255,255,255,.8); font-size:1.06rem; line-height:1.7; }
.hero-actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:25px; }
.countdown-card { background:rgba(10,18,22,.28); border:1px solid rgba(255,255,255,.18); backdrop-filter:blur(12px); border-radius:26px; padding:28px; }
.countdown-label { text-transform:uppercase; letter-spacing:.16em; font-size:.72rem; color:rgba(255,255,255,.68); }
.countdown { font-family:"Playfair Display", serif; font-size:2.8rem; margin:7px 0 5px; }
.countdown-sub { color:rgba(255,255,255,.68); font-size:.9rem; }
.stats-row { position:relative; z-index:1; display:grid; grid-template-columns:repeat(4,1fr); gap:1px; background:rgba(255,255,255,.17); margin-top:30px; border-radius:20px; overflow:hidden; }
.stats-row div { background:rgba(7,15,18,.18); padding:19px 20px; display:flex; align-items:baseline; gap:9px; }
.stats-row strong { font-family:"Playfair Display",serif; font-size:1.85rem; }
.stats-row span { color:rgba(255,255,255,.7); font-size:.85rem; }

main { padding:26px 4px 0; }
.notice { display:flex; gap:15px; align-items:flex-start; background:var(--surface); border:1px solid var(--line); border-radius:var(--radius-lg); padding:20px 22px; box-shadow:var(--shadow); }
.notice-icon { width:28px;height:28px;border-radius:50%; background:var(--surface-2); display:grid;place-items:center;font-weight:700;color:var(--blue); flex:0 0 auto; }
.notice p { margin:5px 0 0; color:var(--muted); line-height:1.55; }

.controls { position:sticky; top:10px; z-index:10; margin:24px 0 18px; padding:12px; background:color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter:blur(14px); border-radius:24px; border:1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.day-tabs { display:grid; grid-template-columns:repeat(6,1fr); gap:8px; }
.day-tab { border:0; background:var(--surface); color:var(--muted); border-radius:16px; padding:12px 8px; text-align:center; transition:.2s ease; border:1px solid var(--line); }
.day-tab strong { display:block; color:var(--ink); font-size:.92rem; }
.day-tab span { font-size:.74rem; }
.day-tab.active { background:var(--ink); color:var(--bg); border-color:var(--ink); transform:translateY(-1px); }
.day-tab.active strong { color:var(--bg); }
.filters { display:flex; flex-wrap:wrap; gap:7px; margin-top:10px; }
.filter { border:1px solid var(--line); background:transparent; color:var(--muted); border-radius:999px; padding:7px 11px; font-size:.78rem; }
.filter.active { background:var(--surface-2); color:var(--ink); font-weight:700; }

.day-summary { display:grid; grid-template-columns:1fr auto; gap:20px; align-items:end; padding:26px 4px 18px; }
.day-summary h2 { font-family:"Playfair Display",serif; font-size:clamp(2rem,4vw,3.5rem); margin:0 0 8px; }
.day-summary p { margin:0; color:var(--muted); max-width:760px; line-height:1.6; }
.day-meta { display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end; }
.pill { padding:8px 12px; background:var(--surface); border:1px solid var(--line); border-radius:999px; font-size:.8rem; color:var(--muted); }

.timeline { position:relative; margin:0 0 28px; }
.timeline::before { content:""; position:absolute; left:104px; top:14px; bottom:14px; width:1px; background:var(--line); }
.event { display:grid; grid-template-columns:88px 1fr; gap:28px; position:relative; margin:0 0 12px; }
.event-time { text-align:right; padding-top:22px; font-weight:700; font-size:.87rem; color:var(--muted); }
.event-card { position:relative; background:var(--surface); border:1px solid var(--line); border-radius:var(--radius-lg); padding:18px 18px 18px 20px; box-shadow:0 8px 25px rgba(25,20,14,.035); transition:.2s ease; }
.event-card:hover { transform:translateY(-1px); box-shadow:var(--shadow); }
.event-card::before { content:""; position:absolute; left:-35px; top:29px; width:10px; height:10px; border-radius:50%; background:var(--surface); border:3px solid var(--blue); box-shadow:0 0 0 5px var(--bg); }
.event-card.food::before { border-color:var(--red); }
.event-card.culture::before { border-color:var(--gold); }
.event-card.shopping::before { border-color:var(--green); }
.event-card.travel::before { border-color:#7b6ca8; }
.event-top { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.event-title { display:flex; gap:12px; align-items:flex-start; }
.event-icon { width:38px; height:38px; display:grid; place-items:center; border-radius:12px; background:var(--surface-2); flex:0 0 auto; font-size:1.1rem; }
.event h3 { margin:0 0 5px; font-size:1.06rem; }
.event-sub { margin:0; color:var(--muted); font-size:.86rem; line-height:1.45; }
.event-actions { display:flex; gap:7px; align-items:center; }
.small-btn { border:1px solid var(--line); background:transparent; color:var(--muted); border-radius:10px; padding:7px 9px; font-size:.77rem; white-space:nowrap; }
.small-btn:hover { color:var(--ink); background:var(--surface-2); }
.check-btn { width:34px; height:34px; border-radius:11px; border:1px solid var(--line); background:transparent; color:var(--muted); font-size:1rem; }
.event.done .event-card { opacity:.62; }
.event.done .event-card h3 { text-decoration:line-through; text-decoration-thickness:1.5px; }
.event.done .check-btn { background:var(--green); color:#fff; border-color:var(--green); }
.tag-row { display:flex; gap:7px; flex-wrap:wrap; margin-top:12px; }
.tag { padding:5px 8px; border-radius:999px; background:var(--surface-2); font-size:.7rem; color:var(--muted); }
.tag.must { color:var(--red); font-weight:700; }
.favorite { color:var(--gold); }
.event.hidden { display:none; }

.notes-panel { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius-xl); padding:24px; box-shadow:var(--shadow); margin-top:34px; }
.notes-heading { display:flex; justify-content:space-between; gap:20px; align-items:flex-start; }
.notes-heading h2 { font-family:"Playfair Display",serif; margin-bottom:12px; }
.saved { color:var(--muted); font-size:.78rem; }
textarea { width:100%; min-height:150px; resize:vertical; border:1px solid var(--line); border-radius:16px; padding:15px; background:var(--bg); color:var(--ink); outline:none; line-height:1.55; }
textarea:focus { border-color:var(--blue); }

.trip-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; margin:18px 0 32px; }
.trip-card { min-height:230px; background:var(--surface); border:1px solid var(--line); border-radius:var(--radius-lg); padding:24px; }
.trip-card h3 { font-family:"Playfair Display",serif; font-size:1.55rem; }
.trip-card p,.trip-card li { color:var(--muted); line-height:1.6; }
.trip-card ul { padding-left:20px; margin-bottom:0; }
.accent-london { border-top:5px solid var(--blue); }
.accent-paris { border-top:5px solid var(--red); }
.accent-flex { border-top:5px solid var(--gold); }

footer { display:flex; justify-content:space-between; gap:20px; color:var(--muted); font-size:.78rem; padding:14px 5px 30px; }

@media (max-width: 860px) {
  .page-shell { padding:10px; }
  .hero { padding:22px 20px; min-height:auto; }
  .hero-grid { grid-template-columns:1fr; min-height:auto; padding:70px 0 15px; gap:28px; }
  .countdown-card { max-width:480px; }
  .stats-row { grid-template-columns:repeat(2,1fr); }
  .day-tabs { grid-template-columns:repeat(3,1fr); }
  .day-summary { grid-template-columns:1fr; }
  .day-meta { justify-content:flex-start; }
  .trip-grid { grid-template-columns:1fr; }
}

@media (max-width: 600px) {
  h1 { font-size:3.15rem; }
  .brand { font-size:.72rem; }
  .top-actions .btn { display:none; }
  .controls { top:6px; padding:9px; border-radius:18px; }
  .day-tabs { grid-template-columns:repeat(3,1fr); gap:6px; }
  .day-tab { padding:9px 4px; border-radius:12px; }
  .filters { overflow-x:auto; flex-wrap:nowrap; padding-bottom:2px; }
  .filter { flex:0 0 auto; }
  .timeline::before { left:10px; }
  .event { grid-template-columns:1fr; gap:4px; padding-left:28px; }
  .event-time { text-align:left; padding:6px 0 0; font-size:.76rem; }
  .event-card::before { left:-24px; top:24px; }
  .event-card { padding:15px; }
  .event-top { flex-direction:column; }
  .event-actions { align-self:stretch; justify-content:flex-end; }
  .stats-row div { padding:14px; }
  .stats-row strong { font-size:1.55rem; }
  footer { flex-direction:column; }
}

@media print {
  body { background:#fff; }
  .page-shell { max-width:none; padding:0; }
  .hero { min-height:auto; border-radius:0; box-shadow:none; }
  .top-actions,.hero-actions,.controls,.notes-panel,.trip-grid,footer { display:none !important; }
  .day-summary { page-break-before:always; }
  .event.hidden { display:grid; }
  .event-card { box-shadow:none; }
  .timeline::before { background:#bbb; }
}

/* Weather + wardrobe */
.weather-wardrobe {
  display:grid;
  grid-template-columns:minmax(0,.9fr) minmax(0,1.4fr);
  gap:14px;
  margin:0 0 24px;
}
.weather-card,
.wardrobe-card {
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radius-lg);
  padding:20px 22px;
  box-shadow:0 8px 25px rgba(25,20,14,.035);
}
.weather-top,
.wardrobe-top {
  display:flex;
  justify-content:space-between;
  gap:14px;
  align-items:flex-start;
}
.weather-main {
  display:flex;
  gap:14px;
  align-items:center;
  margin-top:8px;
}
.weather-icon { font-size:2.15rem; line-height:1; }
.weather-temp { font-family:"Playfair Display",serif; font-size:2rem; line-height:1; }
.weather-condition { color:var(--muted); margin-top:4px; font-size:.86rem; }
.weather-stats { display:flex; gap:8px; flex-wrap:wrap; margin-top:14px; }
.weather-stat { background:var(--surface-2); color:var(--muted); border-radius:999px; padding:6px 9px; font-size:.72rem; }
.forecast-confidence { font-size:.68rem; letter-spacing:.09em; text-transform:uppercase; color:var(--muted); white-space:nowrap; }
.forecast-note { margin:12px 0 0; color:var(--muted); font-size:.8rem; line-height:1.5; }
.wardrobe-card h3,
.weather-card h3 { margin:0; font-family:"Playfair Display",serif; font-size:1.35rem; }
.outfit-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:14px; }
.outfit-block { background:var(--surface-2); border-radius:15px; padding:13px 14px; }
.outfit-block strong { display:block; margin-bottom:5px; font-size:.82rem; }
.outfit-block p { margin:0; color:var(--muted); font-size:.82rem; line-height:1.5; }
.outfit-block.no-change { grid-column:1 / -1; }
.wardrobe-tip { margin:11px 0 0; color:var(--muted); font-size:.78rem; line-height:1.5; }
.weather-source { margin-top:10px; font-size:.7rem; color:var(--muted); }
.weather-source a { color:inherit; }

@media (max-width: 760px) {
  .weather-wardrobe { grid-template-columns:1fr; }
  .outfit-grid { grid-template-columns:1fr; }
  .outfit-block.no-change { grid-column:auto; }
  .forecast-confidence { white-space:normal; text-align:right; }
}

@media print {
  .weather-wardrobe { break-inside:avoid; }
}

/* Auto-refresh weather controls */
.weather-update {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0 10px;
  margin-top: 12px;
  border-top: 1px solid var(--line);
}
.weather-status {
  min-width: 0;
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.45;
}
.weather-status.weather-error { color: var(--red); }
.refresh-weather {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  font-size: .76rem;
  font-weight: 700;
  border-radius: 12px;
  padding: 9px 11px;
  white-space: nowrap;
}
.refresh-weather:hover:not(:disabled) { border-color: var(--blue); }
.refresh-weather:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.refresh-weather:disabled { opacity: .58; cursor: progress; }
.wardrobe-basis {
  color: var(--muted);
  font-size: .73rem;
  margin: 12px 0 0;
  line-height: 1.5;
}
@media (max-width: 390px) {
  .weather-update { flex-direction: column; align-items: stretch; }
  .refresh-weather { align-self: flex-start; }
}
@media print {
  .refresh-weather { display: none !important; }
}


/* Floating one-tap Coach detour — easy to spot on every itinerary day. */
body { padding-bottom: 104px; }
.coach-dock {
  position: fixed;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 65;
  width: min(405px, calc(100vw - 40px));
  filter: drop-shadow(0 12px 18px rgba(51, 10, 35, .26));
}
.coach-button {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  min-height: 83px;
  padding: 13px 18px;
  border: 2px solid rgba(255, 255, 255, .54);
  border-radius: 22px;
  color: #fff;
  text-align: left;
  background: linear-gradient(113deg, #a20e4b 0%, #c12666 55%, #eb6693 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.32);
  transition: transform .2s ease, box-shadow .2s ease;
}
.coach-button::before {
  content: '✦';
  color: rgba(255,255,255,.45);
  font-size: 2rem;
  position: absolute;
  right: 55px;
  top: -12px;
  pointer-events: none;
}
.coach-button:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 17px 32px rgba(113, 16, 60, .26);
}
.coach-button:focus-visible { outline: 4px solid #ffccdc; outline-offset: 3px; }
.coach-button:disabled { opacity: .80; cursor: progress; }
.coach-bag {
  display: grid;
  place-items: center;
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  border-radius: 15px;
  background: rgba(255,255,255,.20);
  font-size: 1.65rem;
}
.coach-button-copy { display:flex; flex-direction:column; flex:1; min-width:0; gap:4px; }
.coach-button-copy strong { font-size: 1.05rem; letter-spacing: .055em; font-weight: 800; }
.coach-button-copy small { line-height:1.4; font-size:.76rem; color:rgba(255,255,255,.9); }
.coach-button-arrow { font-size: 1.55rem; font-weight: 700; }
.coach-message {
  margin-bottom: 10px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size:.87rem;
  line-height: 1.55;
}
.coach-message[hidden] { display: none !important; }
.coach-message a {
  display: inline-flex;
  margin-top: 8px;
  padding: 7px 11px;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
}
.coach-message a:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.coach-message .coach-note { display:block; margin-top:4px; color:var(--muted); font-size:.75rem; }
@media (max-width: 600px) {
  body { padding-bottom: calc(115px + env(safe-area-inset-bottom)); }
  .coach-dock {
    right: 12px;
    left: 12px;
    bottom: max(10px, env(safe-area-inset-bottom));
    width: auto;
  }
  .coach-button { min-height: 81px; border-radius: 20px; padding: 12px 14px; }
  .coach-button-copy strong { font-size: .99rem; }
  .coach-button-copy small { font-size:.71rem; }
  .coach-bag { flex-basis:45px; height:45px; width:45px; font-size:1.48rem; }
}
@media (prefers-reduced-motion: reduce) {
  .coach-button { transition: none; }
}
@media print {
  body { padding-bottom:0; }
  .coach-dock { display:none !important; }
}
