:root {
  --bg: #f7f5f2; --surface: #ffffff; --text: #16131d; --muted: #5f5a68; --line: #e7e2dc;
  --ink: #16131d; --ink-text: #ffffff;
  --action: #e8452c; --action-text: #ffffff;
  --mix-bg: #def5ee; --mix-text: #0b5b4a;
  --chip-bg: #f1ede8; --chip-text: #3d3846;
  --hero-from: #1a0f2e; --hero-mid: #4a1d4f; --hero-to: #e8452c;
  --shadow: 0 1px 2px rgba(22, 19, 29, .06), 0 4px 16px rgba(22, 19, 29, .06);
  --radius: 18px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #110d18; --surface: #1c1725; --text: #f3f0f7; --muted: #aaa3b5; --line: #2c2537;
    --ink: #f3f0f7; --ink-text: #16131d;
    --action: #ff7a5c; --action-text: #1a0f2e;
    --mix-bg: #133b33; --mix-text: #9fe6d2;
    --chip-bg: #2a2333; --chip-text: #d9d3e2;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { height: 100%; }
/* The document never scrolls; .scroller does. A pull past the top or the bottom then moves
   nothing, so no gap opens above the header or below the footer. */
body { margin: 0; overflow: hidden; background: var(--bg); color: var(--text); font: 16px/1.45 Manrope, system-ui, -apple-system, "Segoe UI", sans-serif; }
.scroller { height: 100%; overflow-y: auto; overscroll-behavior: none; -webkit-overflow-scrolling: touch; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--action); outline-offset: 2px; }

/* Hero */
.hero { background: radial-gradient(120% 140% at 85% 0%, var(--hero-to) 0%, var(--hero-mid) 45%, var(--hero-from) 80%); color: #fff; }
.hero-inner { max-width: 640px; margin: 0 auto; padding: 22px 16px 26px; }
.brand { font-weight: 800; letter-spacing: -.02em; font-size: 15px; opacity: .9; }
.brand span { color: #ffd2c7; }
.hero h1 { margin: 18px 0 4px; font-size: 38px; line-height: 1.05; letter-spacing: -.03em; font-weight: 800; }
.subtitle { margin: 0; font-size: 15px; color: rgba(255, 255, 255, .82); }

/* Sticky filters */
.bar { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.bar-inner { max-width: 640px; margin: 0 auto; padding: 10px 16px 12px; }
.tabs { display: flex; gap: 4px; background: var(--chip-bg); border-radius: 12px; padding: 4px; }
.tabs button { flex: 1; min-height: 40px; border: 0; border-radius: 9px; background: none; color: var(--muted); font-weight: 700; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.pills { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.pills::-webkit-scrollbar { display: none; }
.pills button { flex: none; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--text); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; }
.pills button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--ink-text); }

/* Timeline */
.list { max-width: 640px; margin: 0 auto; padding: 8px 16px 40px; }
.slot { position: relative; padding-left: 22px; margin-top: 22px; }
.slot::before { content: ""; position: absolute; left: 5px; top: 10px; bottom: -6px; border-left: 2px dashed var(--line); }
.slot h2 { position: relative; margin: 0 0 10px; font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.slot h2::before { content: ""; position: absolute; left: -22px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--action); box-shadow: 0 0 0 4px var(--bg); }
.slot h2 small { color: var(--muted); font-weight: 600; margin-left: 6px; }

.card { display: flex; gap: 14px; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; cursor: pointer; box-shadow: var(--shadow); transition: transform .12s ease; }
.card:active { transform: scale(.99); }
.card .body { flex: 1; min-width: 0; }
.time { font-weight: 800; font-size: 15px; color: var(--action); }
.time span { color: var(--muted); font-weight: 600; font-size: 13px; margin-left: 4px; }
.title { margin: 2px 0 4px; font-weight: 800; font-size: 17px; line-height: 1.25; letter-spacing: -.01em; overflow-wrap: anywhere; }
.place { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.place svg { flex: none; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { font-size: 12.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--chip-bg); color: var(--chip-text); }
.tag.mix { background: var(--mix-bg); color: var(--mix-text); }
.tag.price { background: none; padding-left: 0; color: var(--text); }
.tag.price.unknown { color: var(--muted); font-weight: 600; }
.thumb { flex: none; width: 88px; height: 88px; border-radius: 14px; overflow: hidden; background: var(--chip-bg); display: grid; place-items: center; font-size: 34px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.more { width: 100%; min-height: 44px; margin: -2px 0 12px; border: 1.5px dashed var(--line); border-radius: 14px; background: none; color: var(--text); font-weight: 700; cursor: pointer; }
.empty { color: var(--muted); padding: 40px 0; text-align: center; }
.foot { max-width: 640px; margin: 0 auto; padding: 0 16px 40px; color: var(--muted); font-size: 13px; }

/* Detail sheet */
dialog { width: 100%; max-width: 560px; max-height: 92vh; margin: auto auto 0; padding: 0; border: 0; border-radius: 24px 24px 0 0; background: var(--surface); color: var(--text); overflow: auto; }
dialog::backdrop { background: rgba(10, 6, 18, .55); }
.sheet-img { width: 100%; height: 220px; object-fit: cover; display: block; background: var(--chip-bg); }
.sheet-body { padding: 18px 18px 26px; }
.sheet-body h3 { margin: 4px 0 8px; font-size: 24px; line-height: 1.15; letter-spacing: -.02em; font-weight: 800; }
.sheet-body p { margin: 10px 0; }
.how { background: var(--chip-bg); border-radius: 14px; padding: 12px 14px; }
.source { color: var(--muted); font-size: 13px; }
.actions { display: grid; gap: 8px; margin-top: 16px; }
.actions a { display: flex; align-items: center; justify-content: center; min-height: 50px; border-radius: 14px; font-weight: 800; text-decoration: none; }
.primary { background: var(--action); color: var(--action-text); }
.secondary { border: 1.5px solid var(--line); color: var(--text); }
.close { position: absolute; right: 12px; top: 12px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(10, 6, 18, .55); color: #fff; font-size: 24px; line-height: 1; cursor: pointer; }
