/* =====================================================================
   Korea trip: "Seoul poster" design.
   Hanji paper, black ink, obangsaek colour blocks, hard shadows,
   condensed display type and oversized hangul.
   ===================================================================== */

@font-face { font-family: "Bricolage"; src: url(../fonts/bricolage.woff2) format("woff2"); font-weight: 200 800; font-stretch: 75% 100%; font-display: swap; }
@font-face { font-family: "Inter"; src: url(../fonts/inter.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "JB Mono"; src: url(../fonts/jbmono.woff2) format("woff2"); font-weight: 400 800; font-display: swap; }
@font-face { font-family: "Black Han Sans"; src: url(../fonts/blackhansans-subset.woff2) format("woff2"); font-display: swap; }

:root {
  --paper: #f3ecdd;
  --paper-2: #e8dfcb;
  --card: #fffcf5;
  --ink: #16130f;
  --text: #16130f;
  --muted: #776f61;
  --edge: #16130f;
  --hair: #d9cfba;
  --shadow: #16130f;

  --red: #e8412c;
  --blue: #2349c4;
  --yellow: #ffc21a;
  --jade: #0e9e7b;
  --pink: #ff8fb1;
  --tangerine: #ff7f1f;
  --sky: #7cc4ff;

  --seoul: var(--red);
  --jeju: var(--jade);
  --home: var(--blue);
  --busan: var(--tangerine);

  --ok: #12a05a;
  --bad: #e8412c;
  --warn: #e98b00;

  --display: "Bricolage", "Arial Narrow", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JB Mono", ui-monospace, "SF Mono", Consolas, monospace;
  --hangul: "Black Han Sans", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  --ko: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;

  --r: 18px;
  --r-sm: 12px;
  --bw: 2px;
  --sh: 4px 4px 0 var(--shadow);
  --sh-sm: 2px 2px 0 var(--shadow);
  --dock-h: 68px;
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .09 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  color-scheme: light;
}

/* Night market: dark theme */
:root[data-theme="dark"] {
  --paper: #121016;
  --paper-2: #1b1821;
  --card: #1f1c26;
  --ink: #f6efe2;
  --text: #f6efe2;
  --muted: #a39cab;
  --edge: #f6efe2;
  --hair: #36313f;
  --shadow: #000;
  --red: #ff5a45;
  --blue: #5b7cff;
  --jade: #19c79b;
  --grain: none;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121016;
    --paper-2: #1b1821;
    --card: #1f1c26;
    --ink: #f6efe2;
    --text: #f6efe2;
    --muted: #a39cab;
    --edge: #f6efe2;
    --hair: #36313f;
    --shadow: #000;
    --red: #ff5a45;
    --blue: #5b7cff;
    --jade: #19c79b;
    --grain: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  font: 16px/1.45 var(--body);
  color: var(--text);
  background: var(--paper) var(--grain);
  padding-bottom: calc(var(--dock-h) + env(safe-area-inset-bottom) + 28px);
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
::selection { background: var(--yellow); color: #16130f; }

.i { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.mono { font-family: var(--mono); }
.ko { font-family: var(--ko); }
.grow { flex: 1; min-width: 0; }
.spacer { flex: 1; }
.row { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
.row > input { flex: 1; }
.row-tight { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.overdue { color: var(--bad) !important; }
.empty { text-align: center; color: var(--muted); padding: 34px 12px; font-weight: 600; }

/* ---------------------------------------------------------------------
   Top bar & dock
   --------------------------------------------------------------------- */

header.top {
  position: sticky; top: 0; z-index: 500;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: baseline; gap: 8px; text-decoration: none; white-space: nowrap; }
.brand b { font-family: var(--hangul); font-size: 1.5rem; font-weight: 400; color: var(--red); line-height: 1; }
.brand span { font-family: var(--display); font-weight: 800; font-stretch: 75%; letter-spacing: .02em; font-size: 1.05rem; text-transform: uppercase; }

.clocks { display: flex; flex-direction: column; gap: 2px; margin-left: auto; font: 600 .7rem/1.15 var(--mono); }
.clocks span { display: flex; align-items: center; gap: 5px; justify-content: flex-end; }
.clocks b { font-weight: 800; color: var(--red); font-size: .62rem; letter-spacing: .05em; }
.clocks span:last-child b { color: var(--blue); }
.clocks .night { color: var(--muted); }
.clocks .i { width: 11px; height: 11px; }
@media (min-width: 560px) { .clocks { flex-direction: row; gap: 14px; font-size: .8rem; } }
.sync {
  display: inline-flex; align-items: center; gap: 7px;
  font: 700 .72rem/1 var(--mono); text-transform: uppercase; letter-spacing: .04em;
  padding: 7px 11px; border-radius: 99px; text-decoration: none; white-space: nowrap;
  border: var(--bw) solid var(--edge); background: var(--card);
}
.sync i { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.sync.ok i { background: var(--ok); }
.sync.warn i, .sync.busy i { background: var(--warn); }
.sync.busy i { animation: pulse 1s infinite; }
.sync.bad { background: var(--red); color: #fff; border-color: var(--red); }
.sync.bad i { background: #fff; }
.sync.off i { background: var(--muted); box-shadow: 0 0 0 2px var(--card), 0 0 0 3px var(--muted); }
@keyframes pulse { 50% { opacity: .3; } }

nav.dock {
  position: fixed; z-index: 600;
  left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom));
  height: var(--dock-h);
  display: flex; justify-content: space-around; align-items: center;
  padding: 0 6px;
  background: #16130f; color: #f6efe2;
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .28);
}
:root[data-theme="dark"] nav.dock { background: #000; box-shadow: 0 0 0 1px #2e2a35, 0 10px 30px rgba(0,0,0,.6); }
nav.dock a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  text-decoration: none; font: 700 .62rem/1 var(--mono); text-transform: uppercase; letter-spacing: .05em;
  color: #a39d92; padding: 6px 0;
}
nav.dock a .ic { display: grid; place-items: center; width: 44px; height: 32px; border-radius: 12px; transition: background .2s, transform .2s; }
nav.dock a .i { width: 22px; height: 22px; }
nav.dock a.active { color: #fff; }
nav.dock a.active .ic { background: var(--yellow); color: #16130f; transform: translateY(-2px) rotate(-4deg); }
nav.dock a.wide, nav.dock .side-brand { display: none; }

main { max-width: 760px; margin: 0 auto; padding: 4px 14px 0; }

/* Desktop: ink sidebar */
@media (min-width: 980px) {
  body { padding-bottom: 40px; padding-left: 248px; }
  header.top { padding-left: 28px; }
  header.top .brand { visibility: hidden; }
  nav.dock {
    left: 0; top: 0; bottom: 0; right: auto; width: 248px; height: auto;
    flex-direction: column; justify-content: flex-start; align-items: stretch; gap: 2px;
    border-radius: 0; padding: 26px 16px; box-shadow: none; overflow-y: auto;
  }
  nav.dock .side-brand { display: block; padding: 0 10px 22px; text-decoration: none; color: #f6efe2; }
  .side-brand b { display: block; font-family: var(--hangul); font-weight: 400; font-size: 3.4rem; line-height: .95; color: var(--red); }
  .side-brand span { font-family: var(--display); font-weight: 800; font-stretch: 75%; font-size: 1.5rem; text-transform: uppercase; letter-spacing: .02em; }
  nav.dock a { flex: none; flex-direction: row; gap: 12px; padding: 7px 8px; font: 600 .95rem/1 var(--body); text-transform: none; letter-spacing: 0; border-radius: 14px; color: #c9c2b5; }
  nav.dock a .ic { width: 36px; height: 34px; }
  nav.dock a .i { width: 20px; height: 20px; }
  nav.dock a:hover { background: #26221d; color: #fff; }
  nav.dock a.active { background: #26221d; }
  nav.dock a.active .ic { transform: rotate(-4deg); }
  nav.dock a.wide { display: flex; }
  nav.dock a.narrow { display: none; }
  nav.dock .nav-sep { height: 1px; background: #2e2a25; margin: 10px 8px; }
  main { max-width: 1180px; padding: 4px 32px 0; }
}
nav.dock .nav-sep { display: none; }
@media (min-width: 980px) { nav.dock .nav-sep { display: block; } }

/* ---------------------------------------------------------------------
   Page heads
   --------------------------------------------------------------------- */

.page-head { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 8px 2px 18px; }
.page-head .eyebrow { font-family: var(--hangul); color: var(--red); font-size: 1.05rem; line-height: 1; margin-bottom: 2px; }
.page-head h1 {
  margin: 0; font-family: var(--display); font-weight: 800; font-stretch: 75%;
  font-size: clamp(2.6rem, 11vw, 4.4rem); line-height: .86; letter-spacing: -.01em; text-transform: uppercase;
}
.page-head .lede { margin: 8px 0 0; color: var(--muted); max-width: 52ch; font-size: .92rem; }

h2.group {
  display: flex; align-items: center; gap: 10px;
  font: 800 1.3rem/1 var(--display); font-stretch: 75%; text-transform: uppercase; letter-spacing: .01em;
  margin: 28px 2px 12px;
}
h2.group::after { content: ""; flex: 1; height: var(--bw); background: var(--edge); }
h2.group .i { width: 22px; height: 22px; }

/* ---------------------------------------------------------------------
   Cards
   --------------------------------------------------------------------- */

.card {
  position: relative;
  background: var(--card);
  border: var(--bw) solid var(--edge);
  border-radius: var(--r);
  box-shadow: var(--sh);
  padding: 16px 18px;
  margin-bottom: 16px;
}
.card.flat { box-shadow: none; }
.card.ink { background: #16130f; color: #f6efe2; border-color: #16130f; }
:root[data-theme="dark"] .card.ink { background: #000; border-color: var(--edge); }
.card.yellow { background: var(--yellow); color: #16130f; }
.card.cancelled { opacity: .5; }
.card.highlight { outline: 4px solid var(--yellow); outline-offset: 3px; }
.card h3 { margin: 0; font: 800 1.35rem/1.05 var(--display); font-stretch: 75%; text-transform: uppercase; letter-spacing: .01em; }
.card h3 a { text-decoration: none; }
.card h3 a:hover { text-decoration: underline; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.sec-head .count { font: 700 .8rem var(--mono); color: var(--muted); }
.note { background: color-mix(in srgb, var(--yellow) 22%, var(--card)); border-left: 4px solid var(--yellow); border-radius: 6px; padding: 8px 12px; margin: 8px 0; font-size: .92rem; }
.card details { margin-top: 6px; }
.card details summary { cursor: pointer; font-weight: 600; }

/* Two-column flow on wide screens */
.masonry { columns: 1; column-gap: 20px; }
.masonry > * { break-inside: avoid; }
@media (min-width: 980px) { .masonry { columns: 2; } }
@media (min-width: 1500px) { .masonry.three { columns: 3; } }

/* staggered entrance */
@media (prefers-reduced-motion: no-preference) {
  main.enter > *, main.enter .masonry > * { animation: rise .45s cubic-bezier(.2, .8, .2, 1) both; }
  main.enter > *:nth-child(2) { animation-delay: .04s; }
  main.enter > *:nth-child(3) { animation-delay: .08s; }
  main.enter > *:nth-child(4) { animation-delay: .12s; }
  main.enter > *:nth-child(5) { animation-delay: .16s; }
  main.enter > *:nth-child(n+6) { animation-delay: .2s; }
  main.enter .hero .ghost, main.enter .seg .ghost { animation: drift 1s cubic-bezier(.2, .8, .2, 1) both; }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* ---------------------------------------------------------------------
   Buttons, chips, tags
   --------------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: 700 .9rem/1 var(--body); padding: 11px 16px; border-radius: 14px; cursor: pointer;
  background: var(--card); color: var(--text); text-decoration: none;
  border: var(--bw) solid var(--edge); box-shadow: var(--sh-sm);
  transition: transform .08s, box-shadow .08s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--shadow); }
.btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--shadow); }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.hot { background: var(--yellow); color: #16130f; border-color: #16130f; }
.btn.red { background: var(--red); color: #fff; }
.btn.danger { color: var(--bad); }
.btn.small { padding: 8px 12px; font-size: .82rem; border-radius: 11px; }
.btn.round { width: 44px; height: 44px; padding: 0; border-radius: 50%; }
.btn.lg { padding: 15px 22px; font-size: 1.05rem; border-radius: 16px; }

.icon {
  display: inline-grid; place-items: center; flex: none;
  width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent;
  color: var(--muted); cursor: pointer;
}
.icon:hover { background: var(--paper-2); color: var(--text); }
.link { background: none; border: 0; padding: 0; cursor: pointer; font-weight: 600; font-size: .85rem; text-decoration: underline; }
.link.danger { color: var(--bad); }

.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font: 600 .83rem/1 var(--body); padding: 8px 12px; border-radius: 99px; cursor: pointer;
  background: var(--card); color: var(--text); text-decoration: none;
  border: 1.5px solid var(--edge);
}
.chip .i { width: 15px; height: 15px; }
.chip:hover { background: var(--paper-2); }
.chip.strong { background: var(--yellow); color: #16130f; border-color: #16130f; }
.chip.ink { background: var(--ink); color: var(--paper); }
.chip.danger { background: var(--red); color: #fff; border-color: var(--red); }
.chip.done { text-decoration: line-through; opacity: .6; }
.chip.file { max-width: 100%; }
.chip.file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip .dot { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--edge); }
.card.ink .chip { background: transparent; color: #f6efe2; border-color: #5a544b; }
.card.ink .chip.strong { background: var(--yellow); color: #16130f; border-color: var(--yellow); }

.tag {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  font: 700 .7rem/1 var(--mono); text-transform: uppercase; letter-spacing: .05em;
  padding: 5px 8px; border-radius: 7px; background: var(--paper-2); color: var(--text);
}
.tag.warn { background: var(--yellow); color: #16130f; }
.tag.ok { background: var(--jade); color: #fff; }
.tag.red { background: var(--red); color: #fff; }
.tag.ink { background: var(--ink); color: var(--paper); }

/* ---------------------------------------------------------------------
   Lists & checkboxes
   --------------------------------------------------------------------- */

ul.list { list-style: none; margin: 0; padding: 0; }
li.item { display: flex; align-items: flex-start; gap: 12px; padding: 11px 0; border-top: 1.5px dashed var(--hair); }
li.item:first-child { border-top: 0; padding-top: 2px; }
li.item:last-child { padding-bottom: 2px; }
li.item .title { font-weight: 600; text-decoration: none; }
li.item a.title:hover { text-decoration: underline; }
li.item.done .title, li.item.done label { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 2px; }
li.item > .icon { margin: -6px -6px 0 0; flex: none; }
li.item .time { width: 48px; flex: none; font: 700 .85rem/1.6 var(--mono); }
li.item .sub { font-size: .84rem; color: var(--muted); margin-top: 2px; }
li.item .typeic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--paper-2); flex: none; margin-top: -3px; }
li.item .typeic .i { width: 17px; height: 17px; }

input.cbx {
  appearance: none; -webkit-appearance: none; flex: none; margin: 0; cursor: pointer;
  width: 26px; height: 26px; padding: 0; border-radius: 8px;
  border: var(--bw) solid var(--edge); background: var(--card);
  display: grid; place-items: center; transition: background .15s, transform .15s;
}
input.cbx::after {
  content: ""; width: 7px; height: 13px; margin-top: -3px;
  border: solid #16130f; border-width: 0 3px 3px 0; transform: rotate(45deg) scale(0); transition: transform .15s;
}
input.cbx:checked { background: var(--yellow); border-color: #16130f; transform: rotate(-6deg); }
input.cbx:checked::after { transform: rotate(45deg) scale(1); }
input.cbx.round { border-radius: 50%; }
label.check { display: flex; gap: 12px; align-items: center; cursor: pointer; }

.progress { height: 16px; border-radius: 99px; border: var(--bw) solid var(--edge); background: var(--paper-2); overflow: hidden; }
.progress div { height: 100%; background: repeating-linear-gradient(-45deg, var(--jade) 0 10px, color-mix(in srgb, var(--jade) 80%, #fff) 10px 20px); border-right: var(--bw) solid var(--edge); transition: width .5s; }
.progress div[style="width:0%"] { border: 0; }

/* ---------------------------------------------------------------------
   Hero blocks
   --------------------------------------------------------------------- */

.hero {
  position: relative; overflow: hidden; isolation: isolate;
  border: var(--bw) solid var(--edge); border-radius: 26px; box-shadow: var(--sh);
  padding: 22px 22px 24px; margin: 6px 0 20px;
  background: var(--c, var(--red)); color: #fff;
}
.hero .ghost {
  position: absolute; z-index: -1; right: -.12em; bottom: -.22em;
  font: 400 clamp(8rem, 42vw, 15rem)/1 var(--hangul); color: rgba(255, 255, 255, .16);
  white-space: nowrap; pointer-events: none;
}
.hero .kicker { font: 700 .78rem/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; opacity: .9; }
.hero .mega {
  font: 800 clamp(6rem, 33vw, 10rem)/.8 var(--display); font-stretch: 75%; letter-spacing: -.03em;
  margin: 12px 0 6px; display: flex; align-items: flex-end; gap: 10px;
}
.hero .mega small { font-size: .28em; letter-spacing: 0; opacity: .75; padding-bottom: .2em; }
.hero .city { font: 800 clamp(2rem, 9vw, 3.2rem)/.95 var(--display); font-stretch: 75%; text-transform: uppercase; }
.hero .line { margin-top: 8px; font-weight: 600; max-width: 34ch; }
.hero.before { --c: var(--blue); }
.hero.after { --c: var(--jade); }
.hero .sticker {
  position: absolute; top: 16px; right: 16px; transform: rotate(8deg);
  background: var(--yellow); color: #16130f; border: var(--bw) solid #16130f; border-radius: 10px;
  font: 800 .8rem/1 var(--mono); padding: 7px 9px; text-transform: uppercase; box-shadow: var(--sh-sm);
}

.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.hero-stats div { background: rgba(0,0,0,.18); border-radius: 14px; padding: 10px 12px; }
.hero-stats b { display: block; font: 800 1.6rem/1 var(--display); font-stretch: 75%; }
.hero-stats span { font: 700 .66rem/1.2 var(--mono); text-transform: uppercase; opacity: .85; }

/* ---------------------------------------------------------------------
   Boarding pass (flights, trains, buses, ferries)
   --------------------------------------------------------------------- */

.pass {
  position: relative; display: grid; grid-template-columns: 1fr auto;
  background: var(--card); border: var(--bw) solid var(--edge); border-radius: var(--r); box-shadow: var(--sh);
  margin-bottom: 16px; overflow: hidden;
}
.pass .band {
  grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 9px 16px; background: var(--c, var(--blue)); color: #fff;
  font: 700 .74rem/1 var(--mono); text-transform: uppercase; letter-spacing: .08em;
  border-bottom: var(--bw) solid var(--edge);
}
.pass .band .i { width: 16px; height: 16px; }
.pass .band .tag { background: rgba(255,255,255,.95); color: #16130f; }
.pass .main { padding: 14px 16px 16px; min-width: 0; }
.pass .route { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; }
.pass .code { font: 800 clamp(2.4rem, 12vw, 3.4rem)/.9 var(--display); font-stretch: 75%; letter-spacing: -.01em; }
.pass .code.r { text-align: right; }
.pass .path { position: relative; height: 2px; background: repeating-linear-gradient(90deg, var(--edge) 0 6px, transparent 6px 11px); }
.pass .path .i { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(45deg); background: var(--card); padding: 0 4px; width: 30px; height: 22px; color: var(--c, var(--blue)); }
.pass .path .i.flat { transform: translate(-50%, -50%); }
.pass .places { display: flex; justify-content: space-between; gap: 10px; font-size: .78rem; color: var(--muted); margin-top: 4px; }
.pass .places span:last-child { text-align: right; }
.pass .times { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; }
.pass .times b { display: block; font: 800 1.35rem/1 var(--mono); }
.pass .times span { font: 600 .74rem var(--mono); color: var(--muted); text-transform: uppercase; }
.pass .times div:last-child { text-align: right; }
.pass .title { font-weight: 700; margin-bottom: 8px; display: flex; justify-content: space-between; gap: 8px; }
.pass .title a { text-decoration: none; }
.pass .stub {
  position: relative; width: 116px; padding: 14px 14px 16px;
  border-left: var(--bw) dashed var(--edge); background: var(--paper-2);
  display: flex; flex-direction: column; gap: 10px;
}
.pass .stub::before, .pass .stub::after {
  content: ""; position: absolute; left: -12px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--paper); border: var(--bw) solid var(--edge);
}
.pass .stub::before { top: -12px; }
.pass .stub::after { bottom: -12px; }
.pass .stub label { display: block; font: 700 .62rem/1 var(--mono); text-transform: uppercase; color: var(--muted); letter-spacing: .06em; }
.pass .stub b { display: block; font: 800 1rem/1.15 var(--mono); overflow-wrap: anywhere; margin-top: 3px; }
.pass .extra { grid-column: 1 / -1; padding: 0 16px 16px; }
.pass .extra .chips { margin-top: 6px; }
@media (max-width: 420px) {
  .pass { grid-template-columns: 1fr; }
  .pass .stub { width: auto; flex-direction: row; flex-wrap: wrap; gap: 14px 22px; border-left: 0; border-top: var(--bw) dashed var(--edge); }
  .pass .stub::before, .pass .stub::after { top: -12px; bottom: auto; }
  .pass .stub::before { left: -12px; }
  .pass .stub::after { left: auto; right: -12px; }
}

.pass .rules { grid-column: 1 / -1; padding: 10px 16px; border-top: var(--bw) dashed var(--edge); display: grid; gap: 8px; font-size: .86rem; }
.pass .rules + .extra { padding-top: 10px; }
.pass .rule-line, .pass .battery summary { display: flex; align-items: center; gap: 8px; }
.pass .rules .i { width: 18px; height: 18px; flex: none; color: var(--c, var(--blue)); }
.pass .rules b { font: 700 .7rem var(--mono); text-transform: uppercase; letter-spacing: .06em; margin-right: 4px; }
.pass .battery summary { cursor: pointer; list-style: none; }
.pass .battery summary::-webkit-details-marker { display: none; }
.pass .battery summary::after { content: "+"; margin-left: auto; font: 800 1.1rem/1 var(--mono); }
.pass .battery[open] summary::after { content: "–"; }
.pass .battery ul { margin: 10px 0 8px; padding-left: 18px; display: grid; gap: 6px; }
.pass .battery li b, .pass .airline-rule b { font: inherit; font-weight: 700; text-transform: none; letter-spacing: 0; margin-right: 0; }
.pass .airline-rule { margin-top: 10px; padding: 8px 10px; border-radius: 10px; background: var(--paper-2); border: var(--bw) solid var(--edge); }
.tag .i { width: 12px; height: 12px; vertical-align: -2px; }

/* Hotel key card */
.keycard { --c: var(--red); padding: 0; overflow: hidden; }
.keycard .kc-top { position: relative; padding: 16px 18px 14px; background: var(--c); color: #fff; border-bottom: var(--bw) solid var(--edge); overflow: hidden; }
.keycard .kc-top .ghost { position: absolute; right: -4px; bottom: -22px; font: 400 5.6rem/1 var(--hangul); color: rgba(255,255,255,.18); pointer-events: none; }
.keycard .kc-label { font: 700 .72rem/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; opacity: .9; display: flex; justify-content: space-between; gap: 8px; }
.keycard .kc-name { position: relative; font: 800 1.75rem/1 var(--display); font-stretch: 75%; text-transform: uppercase; margin-top: 8px; }
.keycard .kc-name a { text-decoration: none; }
.keycard .kc-body { padding: 14px 18px 16px; }
.keycard .kc-ko { font: 700 1.2rem/1.35 var(--ko); }
.keycard .kc-nights { display: flex; gap: 18px; margin: 10px 0 2px; }
.keycard .kc-nights div b { display: block; font: 800 1.1rem/1.1 var(--mono); }
.keycard .kc-nights div span { font: 600 .68rem var(--mono); text-transform: uppercase; color: var(--muted); }
.taxi-btn { width: 100%; margin-top: 14px; }

dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 10px 0 0; font-size: .92rem; }
dl.kv dt { font: 700 .7rem/1.9 var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }
.copy { cursor: copy; font-family: var(--mono); font-weight: 800; background: var(--yellow); color: #16130f; padding: 1px 6px; border-radius: 5px; }

/* ---------------------------------------------------------------------
   Plan timeline
   --------------------------------------------------------------------- */

.seg {
  position: relative; overflow: hidden; display: flex; justify-content: space-between; align-items: flex-end; gap: 12px;
  margin: 26px 0 14px; padding: 16px 18px; border-radius: 20px;
  background: var(--c); color: #fff; border: var(--bw) solid var(--edge); box-shadow: var(--sh);
}
.seg:first-of-type { margin-top: 6px; }
.seg h2 { margin: 0; font: 800 clamp(2.2rem, 10vw, 3.4rem)/.85 var(--display); font-stretch: 75%; text-transform: uppercase; position: relative; }
.seg .meta { font: 700 .74rem/1.3 var(--mono); text-transform: uppercase; text-align: right; position: relative; }
.seg .ghost { position: absolute; right: 10px; top: -18px; font: 400 6rem/1 var(--hangul); color: rgba(255,255,255,.17); pointer-events: none; }

.tl-day .card { margin-bottom: 14px; padding: 14px 16px; }
.tl-day .card h3 { font-size: 1.25rem; }
.tl-day .card .date { font: 700 .72rem/1 var(--mono); text-transform: uppercase; color: var(--muted); margin-bottom: 5px; letter-spacing: .04em; }
.tl-day.past { opacity: .62; }
.tl-day.past:hover { opacity: 1; }
.tl-day.today .card { border-width: 3px; box-shadow: 6px 6px 0 var(--c); }
.tl-day.today .tl-num { box-shadow: 0 0 0 3px var(--yellow); }
.today-sticker { position: absolute; top: -10px; right: 14px; transform: rotate(5deg); background: var(--yellow); color: #16130f; border: var(--bw) solid #16130f; font: 800 .7rem/1 var(--mono); padding: 5px 8px; border-radius: 8px; text-transform: uppercase; }
.tl-day .hotel-line { display: flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--muted); margin-top: 10px; }
a.hotel-line { text-decoration: none; width: fit-content; }
a.hotel-line:hover { color: var(--text); text-decoration: underline; }
.tl-day .actions { display: flex; gap: 2px; }

/* ---------------------------------------------------------------------
   Tiles, stats, money
   --------------------------------------------------------------------- */

.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (min-width: 700px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between;
  min-height: 132px; padding: 14px; border-radius: var(--r); text-decoration: none;
  background: var(--c, var(--card)); color: #fff; border: var(--bw) solid var(--edge); box-shadow: var(--sh);
  transition: transform .12s;
}
.tile:hover { transform: translate(-2px, -2px) rotate(-1deg); }
.tile .i { width: 28px; height: 28px; }
.tile b { font: 800 1.45rem/1 var(--display); font-stretch: 75%; text-transform: uppercase; position: relative; }
.tile .ghost { position: absolute; right: -6px; bottom: -14px; font: 400 4.6rem/1 var(--hangul); color: rgba(255,255,255,.2); }
.tile.light { color: #16130f; }
.tile.light .ghost { color: rgba(0,0,0,.1); }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
@media (min-width: 700px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { border: var(--bw) solid var(--edge); border-radius: var(--r); padding: 14px; background: var(--c, var(--card)); box-shadow: var(--sh-sm); color: var(--fg, var(--text)); }
.stat b { display: block; font: 800 1.7rem/1 var(--display); font-stretch: 75%; }
.stat span { font: 700 .68rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: .04em; opacity: .8; }

.calc { background: #16130f; color: #f6efe2; border-color: #16130f; }
:root[data-theme="dark"] .calc { background: #000; border-color: var(--edge); }
.calc .conv-row { display: flex; align-items: center; gap: 12px; border-bottom: 1.5px dashed #4b453c; padding: 6px 0; }
.calc .conv-row:last-of-type { border-bottom: 0; }
.calc input {
  flex: 1; min-width: 0; background: transparent; border: 0; color: #fff; padding: 4px 0;
  font: 800 clamp(2rem, 10vw, 2.8rem)/1.1 var(--display); font-stretch: 75%;
}
.calc input:focus { outline: none; color: var(--yellow); }
.calc input::placeholder { color: #5a544b; }
.calc .cur { font: 800 .9rem var(--mono); padding: 6px 10px; border-radius: 9px; background: var(--yellow); color: #16130f; }
.calc .cur.nok { background: var(--red); color: #fff; }
.calc .rate { font: 600 .74rem/1.5 var(--mono); color: #a39d92; margin-top: 10px; }
.calc .rate a { color: var(--yellow); }

.bar-row { display: grid; grid-template-columns: 92px 1fr 84px; gap: 12px; align-items: center; margin: 10px 0; font-weight: 600; font-size: .9rem; }
.bar-row span:last-child { text-align: right; font: 700 .85rem var(--mono); }
.bar { height: 18px; border-radius: 6px; border: var(--bw) solid var(--edge); background: var(--paper-2); overflow: hidden; }
.bar div { height: 100%; background: var(--c, var(--blue)); }
.amount { font: 800 .95rem var(--mono); white-space: nowrap; }

/* ---------------------------------------------------------------------
   Info: emergency + phrase cards, notes, documents
   --------------------------------------------------------------------- */

.sos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.sos a {
  display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 16px; text-decoration: none;
  background: var(--red); color: #fff; border: var(--bw) solid var(--edge); box-shadow: var(--sh-sm);
}
.sos a:nth-child(2) { background: var(--tangerine); }
.sos a:nth-child(3) { background: var(--blue); }
.sos b { font: 800 2rem/1 var(--display); font-stretch: 75%; }
.sos span { font: 700 .66rem/1.2 var(--mono); text-transform: uppercase; }

.phrases { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.phrase {
  position: relative; text-align: left; cursor: pointer; min-height: 116px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 8px;
  padding: 12px 13px; border-radius: 16px; background: var(--card); border: var(--bw) solid var(--edge); box-shadow: var(--sh-sm);
}
.phrase:nth-child(4n+1) { background: color-mix(in srgb, var(--yellow) 35%, var(--card)); }
.phrase:nth-child(4n+3) { background: color-mix(in srgb, var(--pink) 30%, var(--card)); }
.phrase .ko { font: 700 1.3rem/1.2 var(--ko); padding-right: 24px; }
.phrase .en { font-weight: 700; font-size: .84rem; }
.phrase .ro { font: 500 .72rem var(--mono); color: var(--muted); }
.phrase .icon { position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; }
.phrase .icon.speak { top: auto; bottom: 6px; right: 6px; width: 38px; height: 38px; background: var(--ink); color: var(--paper); }
.phrase .icon.speak:hover { background: var(--red); color: #fff; }
.phrase .ro, .phrase .en { padding-right: 40px; }
.field > label.btn { display: inline-flex; width: auto; margin: 10px 0 0; font: 700 .82rem/1 var(--body); text-transform: none; letter-spacing: 0; color: var(--text); }

.sticky-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.sticky {
  padding: 16px 16px 18px; border-radius: 4px 4px 22px 4px; color: #16130f; min-height: 150px;
  background: var(--c, var(--yellow)); border: var(--bw) solid #16130f; box-shadow: var(--sh);
  transform: rotate(var(--rot, -1deg));
}
.sticky:nth-child(3n+2) { --c: var(--pink); --rot: 1.2deg; }
.sticky:nth-child(3n) { --c: var(--sky); --rot: -.6deg; }
.sticky h3 { font: 800 1.25rem/1.05 var(--display); font-stretch: 75%; text-transform: uppercase; margin: 0 0 8px; display: flex; justify-content: space-between; gap: 6px; }
.sticky .icon { color: #16130f; }
.sticky .body { font-size: .92rem; }

.stamp-card { overflow: hidden; }
.stamp {
  position: absolute; top: 14px; right: 14px; transform: rotate(-9deg);
  border: 3px double var(--red); color: var(--red); border-radius: 10px; padding: 6px 10px;
  font: 800 .78rem/1.1 var(--mono); text-transform: uppercase; text-align: center; opacity: .9;
}
.form-sheet { margin-top: 12px; display: grid; gap: 0; }
.form-sheet .fl { display: grid; grid-template-columns: 140px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1.5px dotted var(--hair); }
.form-sheet .fl:last-child { border-bottom: 0; }
.form-sheet .fl > span { font: 700 .7rem/1.7 var(--mono); text-transform: uppercase; color: var(--muted); }
.form-sheet .fl > div { font-weight: 600; overflow-wrap: anywhere; }
.form-sheet .missing { color: var(--red); font-weight: 600; }
@media (max-width: 420px) { .form-sheet .fl { grid-template-columns: 1fr; gap: 2px; } }

/* ---------------------------------------------------------------------
   Forms
   --------------------------------------------------------------------- */

input, select, textarea {
  font: inherit; font-size: 16px; width: 100%; color: var(--text);
  padding: 11px 13px; border-radius: 12px;
  border: var(--bw) solid var(--edge); background: var(--card);
}
input[type=checkbox]:not(.cbx) { width: auto; }
textarea { resize: vertical; min-height: 80px; }
input:focus, select:focus, textarea:focus { outline: none; box-shadow: 3px 3px 0 var(--yellow); }
input.time24.invalid { border-color: var(--bad); }

.quick-add { display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch; }
.quick-add input { flex: 3 1 170px; }
.quick-add select { flex: 1 1 130px; width: auto; }
.form-inline { display: grid; gap: 14px; }
@media (min-width: 700px) { .form-inline.cols { grid-template-columns: 1fr 1fr; } .form-inline.cols > .full { grid-column: 1 / -1; } }
.form-inline label { display: grid; gap: 6px; font: 700 .72rem var(--mono); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.form-inline label.check { display: flex; gap: 12px; font: 600 1rem var(--body); text-transform: none; letter-spacing: 0; color: var(--text); }
.form-inline h3 { margin: 0; }
.seg-ctl { display: inline-flex; border: var(--bw) solid var(--edge); border-radius: 14px; overflow: hidden; }
.seg-ctl button { border: 0; background: var(--card); padding: 10px 14px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg-ctl button + button { border-left: var(--bw) solid var(--edge); }
.seg-ctl button.on { background: var(--ink); color: var(--paper); }

/* Dialog = bottom sheet on phones, centred card on desktop */
dialog#modal {
  width: min(680px, 100vw); max-width: 100vw; max-height: 92vh; padding: 0; overflow: hidden;
  border: var(--bw) solid var(--edge); border-radius: 22px; box-shadow: 8px 8px 0 var(--shadow);
  background: var(--card); color: var(--text);
}
dialog#modal::backdrop { background: rgba(22, 19, 15, .55); backdrop-filter: blur(3px); }
dialog#modal[open] { animation: pop .22s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes pop { from { transform: translateY(20px) scale(.97); opacity: 0; } }
@media (max-width: 640px) {
  dialog#modal { margin: auto 0 0; width: 100vw; max-height: 94vh; border-radius: 24px 24px 0 0; border-bottom: 0; box-shadow: none; }
  dialog#modal[open] { animation: sheet .25s cubic-bezier(.2, .9, .3, 1); }
}
@keyframes sheet { from { transform: translateY(40%); } }
.form { display: flex; flex-direction: column; max-height: 92vh; }
.form header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px; background: var(--ink); color: var(--paper); }
.form header h2 { margin: 0; font: 800 1.6rem/1 var(--display); font-stretch: 75%; text-transform: uppercase; }
.form header .icon { color: var(--paper); }
.form header .icon:hover { background: rgba(255,255,255,.12); }
.form-body { overflow-y: auto; padding: 6px 18px 20px; display: grid; gap: 0 16px; }
@media (min-width: 700px) {
  .form-body { grid-template-columns: 1fr 1fr; }
  .form-body .field.full, .form-body .field:has(.place-new:not([hidden])) { grid-column: 1 / -1; }
}
.form footer { display: flex; align-items: center; gap: 10px; padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); border-top: var(--bw) solid var(--edge); background: var(--paper); }
.field { margin-top: 14px; min-width: 0; }
.field > label { display: block; font: 700 .7rem var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 6px; }
.field > label.check { font: 600 1rem var(--body); text-transform: none; letter-spacing: 0; color: var(--text); margin: 10px 0 0; }
.hint { font-size: .76rem; color: var(--muted); margin-top: 5px; }
.coord-map { margin-top: 8px; }
.coord-map-box { height: 280px; border: 2.5px solid var(--edge); border-radius: 12px; cursor: crosshair; }
.place-row > select { flex: 1; min-width: 0; }
.place-new { margin-top: 8px; padding: 4px 12px 12px; border: 1.5px dashed var(--edge); border-radius: 12px; }
.coord-results .result { display: block; width: 100%; text-align: left; font-size: .85rem; padding: 9px 11px; margin-top: 6px; border: 1.5px solid var(--edge); border-radius: 10px; background: var(--paper); cursor: pointer; }
.coord-results .result:hover { background: var(--yellow); color: #16130f; }
.files-field .file-row { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; font-size: .9rem; border-bottom: 1.5px dashed var(--hair); }
.file-btn { margin-top: 10px; }

/* ---------------------------------------------------------------------
   Full-screen "show this" overlay
   --------------------------------------------------------------------- */

.big {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: calc(40px + env(safe-area-inset-top)) 22px 40px; gap: 18px; overflow-y: auto;
  background: var(--yellow) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40'><path d='M0 0h20v20H0zM20 20h20v20H20z' fill='%2316130f' fill-opacity='.06'/></svg>");
  color: #16130f;
}
.big.phrase-mode { background: #fffcf5; }
.big[hidden] { display: none; }
.big-close { position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 14px; width: 52px; height: 52px; border-radius: 50%; border: 3px solid #16130f; background: #fff; cursor: pointer; display: grid; place-items: center; }
.big-close .i { width: 26px; height: 26px; }
.big-label { font: 800 .9rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; background: #16130f; color: var(--yellow); padding: 8px 14px; border-radius: 99px; display: inline-flex; align-items: center; gap: 8px; }
.big-title { font: 800 1.6rem/1.05 var(--display); font-stretch: 75%; text-transform: uppercase; }
.big-ko { font: 800 clamp(2.3rem, 11vw, 5rem)/1.22 var(--ko); white-space: pre-line; word-break: keep-all; letter-spacing: -.01em; }
.big.phrase-mode .big-ko { color: var(--red); }
.big-sub { font: 600 1.05rem var(--mono); color: #4a453c; }
.big-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.big-btn { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font: 800 1.05rem var(--body); color: #16130f; background: #fff; border: 3px solid #16130f; border-radius: 16px; padding: 12px 18px; box-shadow: 3px 3px 0 #16130f; }
.big-btn:active { transform: translate(3px, 3px); box-shadow: none; }
.big-btn .i { width: 22px; height: 22px; }
.big.phrase-mode .big-btn:first-child { background: var(--red); color: #fff; }
.big-phone { font: 800 1.4rem var(--mono); color: #16130f; border: 3px solid #16130f; border-radius: 16px; padding: 10px 18px; background: #fff; text-decoration: none; display: inline-flex; gap: 10px; align-items: center; }

/* ---------------------------------------------------------------------
   Map
   --------------------------------------------------------------------- */

.map-wrap { position: relative; margin: 0 -14px 16px; }
#map { height: 62vh; min-height: 340px; border-top: var(--bw) solid var(--edge); border-bottom: var(--bw) solid var(--edge); z-index: 1; background: var(--paper-2); }
.map-filters { display: flex; gap: 7px; overflow-x: auto; padding: 0 14px 12px; margin: 0 -14px; scrollbar-width: none; }
.map-filters::-webkit-scrollbar { display: none; }
.map-filters .chip { flex: none; }
.map-fab { position: absolute; z-index: 500; right: 12px; bottom: 16px; display: flex; flex-direction: column; gap: 10px; }
@media (min-width: 980px) {
  .map-layout { display: grid; grid-template-columns: 1fr 380px; gap: 20px; align-items: start; }
  .map-wrap { margin: 0; }
  #map { height: calc(100vh - 230px); border: var(--bw) solid var(--edge); border-radius: var(--r); box-shadow: var(--sh); }
  .map-layout .side { max-height: calc(100vh - 230px); overflow-y: auto; padding-right: 6px; }
  .map-filters { margin: 0; padding: 0 0 14px; flex-wrap: wrap; }
}
.pin {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg);
  background: var(--c); border: 2.5px solid #16130f; box-shadow: 2px 2px 0 #16130f;
}
.pin span { transform: rotate(45deg); font: 800 .78rem/1 var(--mono); color: #fff; }
.pin.idea { --c: #fffcf5; }
.pin.idea span { color: #16130f; }
.pin.visited { opacity: .55; }
.pin.hotel { border-radius: 8px; transform: none; --c: #16130f; }
.pin.hotel span { transform: none; }
.pin.hotel .i { width: 16px; height: 16px; color: var(--yellow); transform: none; }
.pin.loc { --c: #fffcf5; }
.pin.loc .i { width: 15px; height: 15px; color: #16130f; transform: rotate(45deg); }
.loc-mark { display: grid; place-items: center; width: 26px; flex: none; color: var(--muted); }
.loc-mark .i { width: 18px; height: 18px; }
.pin.me { --c: #1a73e8; width: 20px; height: 20px; border-radius: 50%; transform: none; border-color: #fff; box-shadow: 0 0 0 6px rgba(26,115,232,.25); }
.leaflet-popup-content-wrapper { border-radius: 16px; border: var(--bw) solid #16130f; box-shadow: 4px 4px 0 #16130f; background: #fffcf5; color: #16130f; }
.leaflet-popup-tip { background: #fffcf5; border: var(--bw) solid #16130f; }
.leaflet-popup-content { margin: 14px 16px; font: 15px/1.4 var(--body); }
.popup { min-width: 220px; }
.popup h4 { margin: 0; font: 800 1.3rem/1 var(--display); font-stretch: 75%; text-transform: uppercase; }
.popup .ko { font-weight: 700; margin-top: 2px; }
.popup .chip { background: #fffcf5; color: #16130f; border-color: #16130f; }
.popup .chip.strong { background: var(--yellow); }
.leaflet-container a.leaflet-popup-close-button { color: #16130f; }
.leaflet-bar a { border-radius: 10px !important; }
.leaflet-bar { border: var(--bw) solid #16130f !important; border-radius: 12px !important; box-shadow: 2px 2px 0 #16130f !important; overflow: hidden; }
:root[data-theme="dark"] .leaflet-tile-pane { filter: brightness(.75) contrast(1.1) saturate(.8); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .leaflet-tile-pane { filter: brightness(.75) contrast(1.1) saturate(.8); } }

/* ---------------------------------------------------------------------
   Login, toast, misc
   --------------------------------------------------------------------- */

.login-screen {
  position: fixed; inset: 0; z-index: 900; display: flex; flex-direction: column; justify-content: space-between;
  padding: calc(28px + env(safe-area-inset-top)) 24px calc(28px + env(safe-area-inset-bottom));
  background: var(--red); color: #fff; overflow: hidden;
}
.login-screen .ghost { position: absolute; left: -10px; top: 40px; font: 400 clamp(9rem, 48vw, 22rem)/.95 var(--hangul); color: rgba(255,255,255,.14); pointer-events: none; }
.login-screen h1 { position: relative; margin: 0; font: 800 clamp(4rem, 22vw, 9rem)/.82 var(--display); font-stretch: 75%; text-transform: uppercase; }
.login-screen h1 span { color: var(--yellow); }
.login-screen form { position: relative; display: grid; gap: 12px; max-width: 420px; width: 100%; }
.login-screen input { border-color: #16130f; font-size: 1.1rem; padding: 15px 16px; }
.login-screen .btn { border-color: #16130f; }

.banner { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--yellow); color: #16130f; border: var(--bw) solid #16130f; border-radius: 14px; padding: 10px 14px; margin: 4px 0 14px; font-weight: 600; font-size: .9rem; }
.banner a, .banner button { font-weight: 800; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--dock-h) + 30px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px) rotate(-2deg);
  background: var(--yellow); color: #16130f; border: var(--bw) solid #16130f; box-shadow: var(--sh-sm);
  padding: 11px 16px; border-radius: 14px; z-index: 3000; font-weight: 700; font-size: .9rem;
  opacity: 0; transition: all .25s cubic-bezier(.2, .9, .3, 1.3); max-width: 90vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0) rotate(-2deg); }
.toast.error { background: var(--red); color: #fff; }
@media (min-width: 980px) { .toast { bottom: 30px; left: calc(50% + 124px); } }

.loading-dots { display: inline-flex; gap: 6px; }
.loading-dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--red); animation: pulse .9s infinite; }
.loading-dots i:nth-child(2) { background: var(--blue); animation-delay: .15s; }
.loading-dots i:nth-child(3) { background: var(--yellow); animation-delay: .3s; }

@keyframes drift { from { opacity: 0; transform: translateX(30px); } }
.highlight-wrap .card { outline: 4px solid var(--yellow); outline-offset: 3px; }
main.enter > .login-screen { animation: none; }

/* ---------------------------------------------------------------------
   Live location + spectator page
   --------------------------------------------------------------------- */

.live-dot { position: relative; display: block; flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--red); border: 3px solid #fff; box-shadow: 0 0 0 2px #16130f; }
.live-dot.fresh::before { content: ""; position: absolute; inset: -3px; border-radius: 50%; background: rgba(232, 65, 44, .5); animation: ping 1.6s ease-out infinite; z-index: -1; }
@keyframes ping { to { transform: scale(2.8); opacity: 0; } }
.leaflet-tooltip.live-tip { background: #16130f; color: var(--yellow); border: 0; border-radius: 9px; font: 700 .74rem/1 var(--mono); padding: 7px 9px; box-shadow: 2px 2px 0 rgba(0,0,0,.25); }
.leaflet-tooltip.live-tip::before { border-top-color: #16130f; }
.sync.live { background: var(--red); color: #fff; border-color: var(--red); }
.sync.live i { background: #fff; animation: pulse 1.2s infinite; }

.live-card { display: flex; align-items: center; gap: 16px; width: 100%; text-align: left; cursor: pointer; font: inherit; color: var(--text); }
.live-card b { font: 800 1.2rem var(--display); font-stretch: 75%; text-transform: uppercase; }
.live-card .i { width: 22px; height: 22px; }
.live-card.fresh { background: color-mix(in srgb, var(--red) 10%, var(--card)); }

body.follow { padding-bottom: 30px; }
@media (min-width: 980px) {
  body.follow { padding-left: 0; }
  body.follow header.top { padding-left: 32px; }
  body.follow header.top .brand { visibility: visible; }
  body.follow main { max-width: 980px; }
  body.follow #map { height: 62vh; }
}

/* ---------------------------------------------------------------------
   Weather
   --------------------------------------------------------------------- */

.wx { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 6px; font: 600 .82rem/1 var(--mono); }
.wx .i { width: 18px; height: 18px; }
.wx b { font-weight: 800; }
.wx span { color: var(--muted); }
.wx em { display: inline-flex; align-items: center; gap: 3px; font-style: normal; color: var(--blue); }
.wx em .i { width: 14px; height: 14px; }
.wx.light { margin-top: 12px; background: rgba(0, 0, 0, .18); color: #fff; padding: 7px 11px; border-radius: 99px; font-size: .88rem; }
.wx.light span, .wx.light em { color: rgba(255, 255, 255, .85); }
.wx.walk .i { color: var(--jade); }
.wx.walk.light .i { color: #fff; }
.wx-now { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin: -4px 0 20px; }
.wx-now > div { position: relative; overflow: hidden; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 0 8px; padding: 12px 14px; border-radius: var(--r); background: var(--card); border: var(--bw) solid var(--edge); box-shadow: var(--sh-sm); }
.wx-now .ko { position: absolute; right: -4px; bottom: -14px; font: 400 3.4rem/1 var(--hangul); color: var(--paper-2); pointer-events: none; }
.wx-now b { position: relative; font: 800 2rem/1 var(--display); font-stretch: 75%; }
.wx-now .i { position: relative; width: 26px; height: 26px; }
.wx-now small { position: relative; grid-column: 1 / -1; font: 700 .66rem/1.6 var(--mono); text-transform: uppercase; color: var(--muted); }

/* ---------------------------------------------------------------------
   Photos
   --------------------------------------------------------------------- */

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-top: 12px; }
.ph { position: relative; aspect-ratio: 1; padding: 0; overflow: hidden; cursor: zoom-in; border-radius: 12px; border: var(--bw) solid var(--edge); background: var(--paper-2); box-shadow: var(--sh-sm); }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.ph:hover img { transform: scale(1.05); }
.ph-lock { position: absolute; top: 5px; right: 5px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #16130f; color: var(--yellow); }
.ph-lock .i { width: 13px; height: 13px; }
.ph-more { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(22, 19, 15, .6); color: #fff; font: 800 1.6rem var(--display); font-stretch: 75%; }
.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

.lightbox { position: fixed; inset: 0; z-index: 2100; display: flex; flex-direction: column; background: rgba(12, 10, 8, .96); color: #f6efe2; }
.lightbox[hidden] { display: none; }
.lb-top { display: flex; justify-content: space-between; align-items: center; padding: calc(10px + env(safe-area-inset-top)) 14px 10px 18px; }
.lb-btn { width: 46px; height: 46px; border-radius: 50%; border: 2px solid #f6efe2; background: transparent; color: #f6efe2; cursor: pointer; display: grid; place-items: center; }
.lb-img { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 8px; }
.lb-img img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer; display: grid; place-items: center; }
.lb-nav.prev { left: 10px; }
.lb-nav.next { right: 10px; }
.lb-bar { display: grid; gap: 10px; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); background: #16130f; }
.lb-caption { background: transparent; color: #fff; border-color: #5a544b; }
.lb-text { font-size: 1rem; }
.lightbox .btn:not(.hot):not(.danger) { background: transparent; color: #f6efe2; border-color: #5a544b; }
.lightbox .btn.danger { background: transparent; border-color: #5a544b; }

/* ---------------------------------------------------------------------
   Take me home
   --------------------------------------------------------------------- */

.home-cta {
  display: flex; align-items: center; gap: 14px; width: 100%; margin: -4px 0 18px; padding: 14px 16px; cursor: pointer; text-align: left;
  background: #16130f; color: #f6efe2; border: var(--bw) solid #16130f; border-radius: var(--r); box-shadow: 4px 4px 0 var(--yellow);
  transition: transform .08s, box-shadow .08s;
}
.home-cta:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--yellow); }
.home-cta .ic { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--yellow); color: #16130f; flex: none; }
.home-cta .ic .i { width: 24px; height: 24px; }
.home-cta b { display: block; font: 800 1.5rem/1 var(--display); font-stretch: 75%; text-transform: uppercase; }
.home-cta span span, .home-cta .grow > span { font-size: .85rem; color: #c9c2b5; }
.home-cta > .i { width: 24px; height: 24px; }
:root[data-theme="dark"] .home-cta { background: #000; border-color: var(--edge); }

.big.home-mode { background: var(--blue); color: #fff; }
.big.home-mode .big-title { font-size: 2.2rem; }
.big.home-mode .big-close { border-color: #16130f; color: #16130f; }
.home-ko { font: 700 clamp(1.4rem, 6vw, 2rem)/1.3 var(--ko); word-break: keep-all; }
.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: min(460px, 100%); margin-top: 6px; }
.home-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 96px; padding: 14px 10px; cursor: pointer;
  background: #fff; color: #16130f; border: 3px solid #16130f; border-radius: 18px; box-shadow: 4px 4px 0 #16130f;
  font: 800 1rem/1.15 var(--body); text-decoration: none; text-align: center;
}
.home-btn .i { width: 28px; height: 28px; }
.home-btn.kakao { background: #fee500; grid-column: 1 / -1; min-height: 110px; font-size: 1.15rem; }
.home-btn.taxi { background: var(--yellow); }
.home-btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 #16130f; }

/* ---------------------------------------------------------------------
   Recap
   --------------------------------------------------------------------- */

.recap-hero {
  position: relative; overflow: hidden; isolation: isolate; margin: 6px 0 18px; padding: 26px 22px 28px;
  background: #16130f; color: #f6efe2; border: var(--bw) solid #16130f; border-radius: 26px; box-shadow: 6px 6px 0 var(--red);
}
.recap-hero .ghost { position: absolute; z-index: -1; right: -.1em; bottom: -.25em; font: 400 clamp(9rem, 45vw, 17rem)/1 var(--hangul); color: rgba(232, 65, 44, .35); }
.recap-hero .kicker { font: 700 .78rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--yellow); }
.recap-hero h1 { margin: 12px 0 6px; font: 800 clamp(3.4rem, 17vw, 7rem)/.82 var(--display); font-stretch: 75%; text-transform: uppercase; }
.recap-sub { font-weight: 700; color: #c9c2b5; }
.recap-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 18px; }
@media (min-width: 700px) { .recap-stats { grid-template-columns: repeat(4, 1fr); } }
.rstat { display: flex; flex-direction: column; justify-content: space-between; min-height: 112px; padding: 14px; border-radius: var(--r); background: var(--c); color: #fff; border: var(--bw) solid var(--edge); box-shadow: var(--sh-sm); }
.rstat.light { color: #16130f; }
.rstat b { font: 800 clamp(1.9rem, 8vw, 2.6rem)/1 var(--display); font-stretch: 75%; }
.rstat b small { font-size: .5em; opacity: .7; }
.rstat span { font: 700 .68rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: .04em; opacity: .85; }
.recap-map { height: 380px; border: var(--bw) solid var(--edge); border-radius: var(--r); box-shadow: var(--sh); margin-bottom: 8px; z-index: 1; }
.recap-cities { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.rcity { position: relative; overflow: hidden; padding: 16px; border-radius: var(--r); background: var(--c); color: #fff; border: var(--bw) solid var(--edge); box-shadow: var(--sh-sm); }
.rcity .ghost { position: absolute; right: -6px; bottom: -16px; font: 400 4.4rem/1 var(--hangul); color: rgba(255,255,255,.2); }
.rcity b { position: relative; display: block; font: 800 1.8rem/1 var(--display); font-stretch: 75%; text-transform: uppercase; }
.rcity span { position: relative; font: 700 .72rem var(--mono); text-transform: uppercase; }
.recap-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.recap-photos figure { margin: 0; background: var(--card); border: var(--bw) solid var(--edge); border-radius: 14px; overflow: hidden; box-shadow: var(--sh-sm); }
.recap-photos img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.recap-photos figcaption { padding: 7px 10px; font: 600 .74rem/1.3 var(--mono); color: var(--muted); }
.recap-days { list-style: none; margin: 0; padding: 0; columns: 1; column-gap: 24px; }
@media (min-width: 980px) { .recap-days { columns: 2; } }
.recap-days li { break-inside: avoid; display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1.5px dashed var(--hair); }
.recap-days .n { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--c); color: #fff; font: 800 1.2rem var(--display); font-stretch: 75%; border: var(--bw) solid var(--edge); }
.recap-days b { display: block; font-weight: 700; }
.recap-days small { font: 600 .72rem var(--mono); color: var(--muted); text-transform: uppercase; }
.recap-days .km { font: 800 .9rem var(--mono); white-space: nowrap; }
.recap { margin-bottom: 30px; }

@media print {
  @page { margin: 12mm; }
  body { padding: 0 !important; background: #fff !important; }
  header.top, nav.dock, .no-print, .toast { display: none !important; }
  main { max-width: none !important; padding: 0 !important; }
  .recap * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rstat, .rcity, .recap-photos figure, .recap-map, .recap-hero { box-shadow: none !important; break-inside: avoid; }
  .recap-stats { grid-template-columns: repeat(4, 1fr); }
  main.enter > *, main.enter .masonry > * { animation: none !important; }
}

/* Dawarich test */
.dw-controls { margin: 12px 0; }
.dw-controls input { flex: 1 1 160px; }
#dw-map { height: 300px; margin-top: 12px; border: var(--bw) solid var(--edge); border-radius: 14px; overflow: hidden; }
.ok-note { display: flex; align-items: center; gap: 8px; margin: 8px 0; padding: 8px 12px; border-radius: 10px; background: var(--jade); color: #fff; font-weight: 700; font-size: .88rem; overflow-wrap: anywhere; }
.dw-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 8px; margin: 10px 0 6px; }
.dw-stats div { background: var(--paper-2); border-radius: 12px; padding: 8px 10px; }
.dw-stats b { display: block; font: 800 1.15rem/1.1 var(--mono); }
.dw-stats span { font: 700 .62rem var(--mono); text-transform: uppercase; color: var(--muted); letter-spacing: .05em; }
.dw-live { margin-top: 16px; padding-top: 12px; border-top: 1.5px dashed var(--hair); }
.dw-latest { display: flex; gap: 12px; align-items: flex-start; margin-top: 10px; }
.dw-latest .live-dot { position: relative; flex: none; margin-top: 4px; }
.dw-log { margin-top: 6px; }
.dw-log .time { width: 44px; }

/* Activities */
.anytime { margin-top: 10px; }
.anytime-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0 2px; border-top: 1.5px dashed var(--hair); }
.anytime-head span { font: 700 .7rem var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.anytime-head .chip { margin: 0; }
.anytime li.item .time { display: none; }
.act-filters { margin: 0 0 14px; }
.act-day { border-top: 8px solid var(--c, var(--edge)); }
.act-group .tag.cat { display: none; }
.planned-as { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 0; padding: 8px 12px; border: 1.5px dashed var(--edge); border-radius: 12px; font-size: .85rem; }
.planned-as .i { margin-top: 2px; }
.pass .planned-as { grid-column: 1 / -1; margin: 0 16px 12px; }
.act-day h3 a.plain { color: inherit; text-decoration: none; }
.act-day .tag.city { background: var(--c); color: #fff; }
.item.act .title { margin-right: 4px; }
.act-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 6px; }
.day-pick { width: auto; max-width: 100%; padding: 4px 28px 4px 10px; font: 600 .78rem var(--mono); border-radius: 99px; min-height: 0; }

/* Budget */
.budget { margin-top: 12px; }
.budget-bar { height: 14px; border-radius: 99px; border: var(--bw) solid var(--edge); background: var(--paper-2); overflow: hidden; }
.budget-bar div { height: 100%; background: var(--jade); transition: width .4s; }
.budget.close .budget-bar div { background: var(--yellow); }
.budget.over .budget-bar div { background: var(--red); }
.budget-text { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 6px; font: 600 .78rem var(--mono); }
.budget-text span { color: var(--muted); }
.budget.over .budget-text b { color: var(--red); }

/* Closed-day warnings */
.warn-note { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0; padding: 8px 12px; border-radius: 10px; background: var(--red); color: #fff; font-weight: 700; font-size: .88rem; }
.warn-note a { color: #fff; }
.warn-note .i { width: 16px; height: 16px; }
.weekdays { display: flex; flex-wrap: wrap; gap: 6px; }
.weekdays label { cursor: pointer; }
.weekdays input { position: absolute; opacity: 0; pointer-events: none; }
.weekdays span { display: inline-block; padding: 8px 11px; border: 1.5px solid var(--edge); border-radius: 10px; font: 700 .8rem var(--mono); text-transform: uppercase; }
.weekdays input:checked + span { background: var(--red); color: #fff; border-color: var(--red); }
.weekdays input:focus-visible + span { outline: 2px solid var(--yellow); }

/* Row-ordered two-column grid (keeps chronological order left to right) */
.grid2 { display: grid; gap: 0 20px; align-items: start; }
@media (min-width: 980px) { .grid2 { grid-template-columns: 1fr 1fr; } }
@media (prefers-reduced-motion: no-preference) { main.enter .grid2 > * { animation: rise .45s cubic-bezier(.2, .8, .2, 1) both; } }

#share-info .row { flex-wrap: wrap; }
#share-info .row input { flex: 1 1 100%; font: 600 .85rem var(--mono); }
.chip[hidden] { display: none; }

/* Sidebar group labels (wide screens only) */
nav.dock .nav-group { display: none; }
@media (min-width: 980px) {
  nav.dock .nav-group { display: block; padding: 14px 10px 4px; font: 700 .66rem var(--mono); text-transform: uppercase; letter-spacing: .1em; color: #8a8276; }
  nav.dock .side-brand + .nav-group { padding-top: 0; }
}

/* Forms: looked-up address, raw JSON */
.auto-val { padding: 10px 13px; border: 1.5px dashed var(--edge); border-radius: 12px; font-size: .9rem; }
.auto-val .ko { font-weight: 700; }
.raw-json pre { max-height: 320px; overflow: auto; margin: 0 0 8px; padding: 10px 12px; border: 1.5px solid var(--edge); border-radius: 12px; background: var(--paper-2); font: .78rem/1.45 var(--mono); white-space: pre-wrap; word-break: break-word; }

/* Map popup: what links to a location */
.popup-uses { margin: 8px 0 0; padding-left: 18px; font-size: .85rem; }
.popup-uses li { margin: 2px 0; }
.popup-uses .muted { font-size: .78rem; }

/* Day plan: getting between the hotel and the airport or station */
li.item.transfer { border: 1.5px dashed var(--edge); border-radius: 12px; margin: 4px 0; padding-left: 8px; padding-right: 8px; }
li.item.transfer .title { font-weight: 700; }
li.item.transfer .chips { margin-top: 6px; }

/* Map: the grouped location list */
.loc-list .small-seg { margin-bottom: 8px; }
.loc-list .small-seg button { padding: 7px 12px; font-size: .85rem; }
.loc-list .sec-head h3 { display: flex; align-items: center; gap: 8px; }
.loc-group { border-top: var(--bw) solid var(--edge); margin-top: 4px; }
.loc-group > summary { display: flex; align-items: center; gap: 10px; padding: 12px 2px 6px; cursor: pointer; list-style: none;
  font: 800 1.25rem/1.1 var(--display); font-stretch: 75%; text-transform: uppercase; letter-spacing: .01em; }
.loc-group > summary::-webkit-details-marker { display: none; }
.loc-group > summary > span:first-of-type { flex: 1; }
.loc-group > summary .i { width: 20px; height: 20px; }
.loc-group > summary .dot { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--edge); flex: none; }
.loc-group > summary .tag { font-family: var(--mono); font-stretch: 100%; }
.loc-group:not([open]) > summary { color: var(--muted); }
.loc-group > .list { padding-left: 30px; margin-bottom: 8px; }
.loc-group .loc-mark { width: 20px; }

/* Map: near me */
.map-filters.near { align-items: center; }
.map-filters.near .near-label { flex: none; display: inline-flex; align-items: center; gap: 5px; font: 700 .72rem var(--mono); text-transform: uppercase; letter-spacing: .06em; color: #1a73e8; }
.page-head.compact { margin-bottom: 8px; }

/* Plan: the day header opens the day */
a.day-link.plain { color: inherit; text-decoration: none; display: block; }
.tl-head a.tl-num.plain { color: #fff; text-decoration: none; }

/* One day */
.day-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 12px; }
.day-nav .btn span { margin-left: 4px; }
.day-nav > a.small { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; }
.day-head { position: relative; overflow: hidden; padding: 16px 18px; margin-bottom: 14px; border: var(--bw) solid var(--edge); border-radius: var(--r);
  border-top: 10px solid var(--c, var(--edge)); background: var(--card); box-shadow: var(--sh); }
.day-head .ghost { position: absolute; right: -6px; top: -10px; font: 400 5rem/1 var(--hangul); color: var(--c); opacity: .12; pointer-events: none; }
.day-head .kicker { font: 700 .74rem/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.day-head h1 { margin: 6px 0 2px; font: 800 clamp(1.8rem, 8vw, 2.6rem)/.95 var(--display); font-stretch: 75%; text-transform: uppercase; }
.day-head .city { font-weight: 700; color: var(--muted); }
.day-head .row-tight { margin-top: 8px; }
.day-head .actions { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 4px; }
.day-list .list .item { padding-top: 10px; padding-bottom: 10px; }
@media (max-width: 600px) { .day-nav .btn span { display: none; } .day-head .actions { position: static; margin-top: 8px; } }

/* Lists with times on phones: the time goes under the icon so the text gets the width,
   and route chips are small enough to sit side by side. */
li.item .chips { margin-top: 6px; gap: 5px; }
li.item .chip { padding: 5px 9px; font-size: .78rem; gap: 4px; }
li.item .chip .i { width: 13px; height: 13px; }
@media (max-width: 600px) {
  li.item:has(> .time) {
    display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; grid-template-rows: auto 1fr; column-gap: 10px; row-gap: 4px;
    grid-template-areas: "ic body act" "tm body act";
  }
  li.item:has(> .time) > :first-child { grid-area: ic; justify-self: center; }
  li.item:has(> .time) > .time { grid-area: tm; align-self: start; width: auto; text-align: center; font-size: .72rem; line-height: 1.3; }
  li.item:has(> .time) > .grow { grid-area: body; min-width: 0; }
  li.item:has(> .time) > .icon, li.item:has(> .time) > .btn { grid-area: act; }
  li.item:has(> .time) > .time:empty { display: none; }
  li.item.transfer { padding-left: 4px; padding-right: 4px; }
}

/* Plan: each day has a header bar that sticks under the top bar while the day is on screen.
   Sticky works inside .tl-day, so the next day's bar takes over when its day arrives. */
.tl-day { position: relative; margin-bottom: 14px; }
.tl-head {
  position: sticky; top: var(--top-h, 56px); z-index: 20;
  display: flex; align-items: center; gap: 10px; padding: 6px 4px 6px 0; margin-bottom: 6px;
  background: var(--paper); border-bottom: 3px solid var(--c);
}
.tl-num { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none;
  width: 44px; height: 44px; border-radius: 12px; background: var(--c); color: #fff; }
.tl-num b { font: 800 1.45rem/.9 var(--display); font-stretch: 75%; }
.tl-num span { font: 700 .58rem/1 var(--mono); text-transform: uppercase; margin-top: 2px; }
.tl-head .day-link { flex: 1; min-width: 0; }
.tl-head .date { display: flex; align-items: center; gap: 6px; font: 700 .7rem/1 var(--mono); text-transform: uppercase; color: var(--muted); letter-spacing: .04em; }
.tl-head .day-title { display: block; margin-top: 3px; font: 800 1.2rem/1.05 var(--display); font-stretch: 75%; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-head .day-title .i { width: 16px; height: 16px; vertical-align: -2px; color: var(--muted); }
.tl-head .actions { display: flex; gap: 2px; flex: none; }
.tl-head .today-tag { background: var(--yellow); color: #16130f; font-size: .62rem; padding: 2px 6px; }
.tl-day .card { margin-bottom: 0; }
.tl-day .card > .row-tight:first-child { margin-bottom: 4px; }
@media (max-width: 600px) { .tl-day .card { padding: 12px; } }
a.day-link:hover .day-title { text-decoration: underline; }
