/* Korea Trip Planner — calm, paper-like neutrals with one accent (celadon jade,
   after Goryeo celadon). Inspired by Korean restraint rather than decoration:
   generous whitespace, fine rules, quiet colour. One stylesheet, one set of
   components, used everywhere. */

:root {
  --bg: #f6f5f1;            /* hanji paper */
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --sunken: #efede7;
  --ink: #1c1d1f;
  --ink-2: #44474d;
  --muted: #74787f;
  --faint: #a3a6ab;
  --line: #e6e3dc;
  --line-strong: #d6d2c8;
  --accent: #1f6b63;        /* celadon jade */
  --accent-hover: #185a53;
  --accent-ink: #ffffff;
  --accent-soft: #e3efec;
  --accent-text: #1a5f58;
  --danger: #b42318;
  --danger-soft: #fbeae8;
  --warn: #9a5b0b;
  --warn-soft: #fbf1e1;
  --info: #2f5aa8;
  --info-soft: #e9eff9;
  --ok: #2b7a4b;
  --ok-soft: #e6f3eb;
  --deadline: #8a4a00;
  --shadow-sm: 0 1px 2px rgba(28, 29, 31, .05);
  --shadow: 0 1px 2px rgba(28, 29, 31, .05), 0 4px 16px rgba(28, 29, 31, .05);
  --shadow-lg: 0 12px 40px rgba(28, 29, 31, .16);
  --r: 10px;
  --r-sm: 7px;
  --r-lg: 14px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Pretendard", "Apple SD Gothic Neo", "Inter",
          "Segoe UI", "Malgun Gothic", Roboto, "Noto Sans KR", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sidebar: 252px;
  --tabbar-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121314; --surface: #1a1b1d; --surface-2: #1e1f22; --sunken: #232427;
    --ink: #ecebe7; --ink-2: #c8c7c2; --muted: #9a9ca1; --faint: #6f7277;
    --line: #2b2c30; --line-strong: #3a3b40;
    --accent: #5fb3a6; --accent-hover: #74c2b6; --accent-ink: #0d1514; --accent-soft: #1b2e2b; --accent-text: #7fcbbf;
    --danger: #f0786b; --danger-soft: #3a1e1b; --warn: #e4a54f; --warn-soft: #34281a;
    --info: #86a9e8; --info-soft: #1d2638; --ok: #6cc28f; --ok-soft: #1a2e22; --deadline: #e9a75b;
    --shadow-sm: none; --shadow: 0 1px 0 rgba(255,255,255,.03); --shadow-lg: 0 16px 48px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121314; --surface: #1a1b1d; --surface-2: #1e1f22; --sunken: #232427;
  --ink: #ecebe7; --ink-2: #c8c7c2; --muted: #9a9ca1; --faint: #6f7277;
  --line: #2b2c30; --line-strong: #3a3b40;
  --accent: #5fb3a6; --accent-hover: #74c2b6; --accent-ink: #0d1514; --accent-soft: #1b2e2b; --accent-text: #7fcbbf;
  --danger: #f0786b; --danger-soft: #3a1e1b; --warn: #e4a54f; --warn-soft: #34281a;
  --info: #86a9e8; --info-soft: #1d2638; --ok: #6cc28f; --ok-soft: #1a2e22; --deadline: #e9a75b;
  --shadow-sm: none; --shadow: 0 1px 0 rgba(255,255,255,.03); --shadow-lg: 0 16px 48px rgba(0,0,0,.5);
  color-scheme: dark;
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 0;
  min-height: 100vh; overflow-x: hidden;
}
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; line-height: 1.25; }
h1 { font-size: 1.6rem; letter-spacing: -.02em; }
h2 { font-size: 1.12rem; }
h3 { font-size: .98rem; }
p { margin: 0 0 .6em; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
img { max-width: 100%; display: block; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent-soft); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 100; border-radius: 6px; }
.skip:focus { left: 8px; }
.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.i.sm { width: 15px; height: 15px; vertical-align: -2px; }
.i.lg { width: 22px; height: 22px; }
.i.fill { fill: currentColor; stroke: none; }

/* ------------------------------------------------------------------ layout */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: var(--surface-2);
  border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 20;
  padding: 16px 12px calc(12px + var(--safe-b));
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; flex: none; }
.brand-name { font-weight: 650; line-height: 1.15; font-size: .95rem; }
.brand-sub { color: var(--muted); font-size: .78rem; display: block; font-weight: 450; }
.trip-switch { margin: 0 4px 10px; }
.nav { overflow-y: auto; flex: 1; padding: 2px; margin: 0 -2px; scrollbar-width: thin; }
.nav-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 14px 10px 4px; font-weight: 600; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--ink-2);
  font-size: .9rem; position: relative;
}
.nav a:hover { background: var(--sunken); text-decoration: none; color: var(--ink); }
.nav a.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.nav a .count { margin-left: auto; font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.nav a .count.alert { color: var(--danger); font-weight: 650; }
.side-foot { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 8px; display: flex; gap: 6px; align-items: center; }
.side-foot .who { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; color: var(--ink-2); font-size: .85rem; padding: 6px 8px; border-radius: 8px; }
.side-foot .who:hover { background: var(--sunken); text-decoration: none; }

.main { margin-left: var(--sidebar); min-height: 100vh; }
.container { max-width: 1160px; margin: 0 auto; padding: 28px 32px 64px; }
.container.narrow { max-width: 760px; }
.topbar { display: none; }
.tabbar { display: none; }
.solo .main { margin-left: 0; }

@media (max-width: 900px) {
  body { font-size: 16px; }
  .sidebar { display: none; }
  .main { margin-left: 0; padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 8px); }
  .solo .main { padding-bottom: 0; }
  .container { padding: 14px 16px 32px; }
  .topbar {
    display: flex; position: sticky; top: 0; z-index: 30; align-items: center; gap: 6px;
    padding: calc(8px + var(--safe-t)) 8px 8px 12px; background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
    border-bottom: 1px solid transparent; transition: border-color .2s;
  }
  .topbar.scrolled { border-bottom-color: var(--line); }
  .topbar .t-title { flex: 1; min-width: 0; }
  .topbar .t-trip { font-size: .72rem; color: var(--muted); display: block; line-height: 1.1; }
  .topbar .t-page { font-weight: 650; font-size: 1.02rem; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px);
    border-top: 1px solid var(--line);
  }
  .tab {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted);
    font-size: .68rem; font-weight: 550; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: none !important;
  }
  .tab .i { width: 23px; height: 23px; }
  .tab.active { color: var(--accent-text); }
  .tab-add span.plus {
    width: 46px; height: 34px; border-radius: 12px; background: var(--accent); color: var(--accent-ink);
    display: grid; place-items: center; box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 40%, transparent);
  }
  .tab-add span.plus .i { width: 22px; height: 22px; stroke-width: 2.2; }
  .hide-mobile { display: none !important; }
  h1 { font-size: 1.38rem; }
}
@media (min-width: 901px) { .hide-desktop { display: none !important; } }

/* ------------------------------------------------------------------ page structure */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; font-size: .92rem; }
.page-head .eyebrow { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; margin-bottom: 4px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 900px) {
  .page-head { margin-bottom: 16px; align-items: flex-start; }
  .page-head.m-compact h1 { display: none; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 0 1 auto; }
  .page-head .sub { font-size: .86rem; }
  .view-switch { flex-wrap: nowrap; }
  .view-switch a { padding: 7px 4px; font-size: .8rem; gap: 4px; min-width: 0; }
  .view-switch a .i { display: none; }
}
.section { margin-top: 28px; }
.section:first-child { margin-top: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.section-head h2 { font-size: 1rem; }
.section-head .more { font-size: .85rem; }
.stack > * + * { margin-top: 12px; }
.stack-sm > * + * { margin-top: 6px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.top { align-items: flex-start; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid.tight { gap: 10px; }
.grid-2 { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.layout-detail { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.layout-detail.wide-aside { grid-template-columns: minmax(0, 1fr) 360px; }
@media (max-width: 1100px) { .layout-detail, .layout-detail.wide-aside { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2.m-1, .grid-3.m-1 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) { .grid-2:not(.keep) { grid-template-columns: minmax(0, 1fr); } }

/* ------------------------------------------------------------------ cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); min-width: 0; }
.card.pad, .card > .pad { padding: 16px 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px 0; }
.card-head h2, .card-head h3 { font-size: .95rem; display: flex; align-items: center; gap: 8px; }
.card-head .more { font-size: .82rem; white-space: nowrap; }
.card-body { padding: 12px 18px 16px; }
.card-foot { border-top: 1px solid var(--line); padding: 10px 18px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card.flat { box-shadow: none; }
.card.sunken { background: var(--surface-2); }
.card.accent { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.card.link-card { display: block; color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; }
.card.link-card:hover { text-decoration: none; border-color: var(--line-strong); box-shadow: var(--shadow); }
@media (max-width: 900px) { .card.pad, .card > .pad { padding: 14px; } .card-head { padding: 12px 14px 0; } .card-body { padding: 10px 14px 14px; } .card-foot { padding: 10px 14px; } }

.tile { padding: 14px 16px; }
.stat-num { font-size: 1.55rem; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat-label { color: var(--muted); font-size: .8rem; margin-top: 2px; }
.stat-sub { font-size: .8rem; color: var(--ink-2); margin-top: 6px; }

/* ------------------------------------------------------------------ lists */
.list > li, .list > .li { border-top: 1px solid var(--line); }
.list > li:first-child, .list > .li:first-child { border-top: 0; }
.li { display: flex; align-items: center; gap: 12px; padding: 11px 18px; position: relative; min-height: 52px; }
.list.compact .li { padding: 8px 18px; min-height: 42px; }
.li .lead { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--sunken); color: var(--ink-2); flex: none; }
.li .lead.thumb { background-size: cover; background-position: center; }
.li .lead.accent { background: var(--accent-soft); color: var(--accent-text); }
.li .body { flex: 1; min-width: 0; }
.li-title { font-weight: 560; color: var(--ink); display: block; overflow-wrap: anywhere; }
a.li-title:hover { text-decoration: none; }
.li-sub { color: var(--muted); font-size: .84rem; display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: center; margin-top: 1px; }
.li-sub > * { display: inline-flex; align-items: center; gap: 4px; }
.li-meta { margin-left: auto; display: flex; gap: 6px; align-items: center; flex: none; color: var(--muted); font-size: .84rem; }
.li .stretch::after { content: ""; position: absolute; inset: 0; }
.li .li-meta form, .li .li-meta a, .li .li-meta button, .li .over { position: relative; z-index: 1; }
.li:has(.stretch):hover { background: var(--surface-2); }
.list.in-card .li:first-child { border-top-left-radius: var(--r-lg); border-top-right-radius: var(--r-lg); }
.list.in-card .li:last-child { border-bottom-left-radius: var(--r-lg); border-bottom-right-radius: var(--r-lg); }
.li.is-done .li-title { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }
.li.is-muted { opacity: .62; }
@media (max-width: 900px) { .li { padding: 11px 14px; } .list.compact .li { padding: 8px 14px; } }

.group-label { font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 650;
  padding: 14px 18px 6px; display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.group-label .n { color: var(--faint); font-weight: 600; }
@media (max-width: 900px) { .group-label { padding: 14px 14px 6px; } }

/* ------------------------------------------------------------------ badges, chips, tags */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: .74rem;
  font-weight: 600; background: var(--sunken); color: var(--ink-2); white-space: nowrap; line-height: 1.6;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.s-idea, .s-candidate, .s-todo, .s-planned-exp { background: var(--sunken); color: var(--ink-2); }
.s-to_plan, .s-favorite, .s-waiting, .s-to_book, .s-due, .s-deposit, .s-on_site, .s-unpaid { background: var(--warn-soft); color: var(--warn); }
.s-planned, .s-doing, .s-reserved, .s-prepaid { background: var(--info-soft); color: var(--info); }
.s-booked, .s-paid, .s-stayed { background: var(--accent-soft); color: var(--accent-text); }
.s-done { background: var(--ok-soft); color: var(--ok); }
.s-cancelled, .s-refunded { background: var(--danger-soft); color: var(--danger); text-decoration: line-through; }
.lv-conflict { background: var(--danger-soft); color: var(--danger); }
.lv-deadline { background: var(--warn-soft); color: var(--deadline); }
.lv-warning { background: var(--warn-soft); color: var(--warn); }
.lv-info { background: var(--info-soft); color: var(--info); }
.lv-required { background: var(--danger-soft); color: var(--danger); }
.lv-recommended { background: var(--info-soft); color: var(--info); }
.lv-optional { background: var(--sunken); color: var(--muted); }
.p-high { color: var(--danger); }
.p-low { color: var(--faint); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2); font-size: .84rem; cursor: pointer; white-space: nowrap; line-height: 1.35;
}
.chip:hover { border-color: var(--line-strong); text-decoration: none; color: var(--ink); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip .n { font-size: .74rem; opacity: .7; font-variant-numeric: tabular-nums; }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; color: var(--ink-2); white-space: nowrap; }
.tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--faint)); }
.tags { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; background: var(--c); flex: none; }
.avatar {
  width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-size: .68rem;
  font-weight: 700; background: var(--c, var(--muted)); flex: none; letter-spacing: .02em;
}
.avatar.sm { width: 20px; height: 20px; font-size: .58rem; }
.avatar.shared { background: var(--sunken); color: var(--ink-2); border: 1px dashed var(--line-strong); }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border-radius: 9px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-size: .9rem; font-weight: 560;
  cursor: pointer; white-space: nowrap; line-height: 1.3; transition: background .12s, border-color .12s, transform .06s;
  min-height: 38px; text-decoration: none !important;
}
.btn:hover { background: var(--surface-2); border-color: var(--faint); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--sunken); color: var(--ink); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn.danger.solid { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.sm { padding: 5px 10px; font-size: .82rem; min-height: 32px; border-radius: 8px; }
.btn.icon { padding: 0; width: 38px; }
.btn.icon.sm { width: 32px; }
.btn.block { width: 100%; }
.btn[disabled], .btn.busy { opacity: .55; pointer-events: none; }
.btn.busy::after { content: ""; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-group { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 9px; overflow: hidden; background: var(--surface); }
.btn-group > * { border: 0; border-radius: 0; border-left: 1px solid var(--line); min-height: 34px; padding: 6px 12px; background: none; color: var(--ink-2); font-size: .86rem; font-weight: 560; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; text-decoration: none !important; }
.btn-group > *:first-child { border-left: 0; }
.btn-group > .on { background: var(--sunken); color: var(--ink); }
.btn-group > *:hover { background: var(--surface-2); color: var(--ink); }
@media (max-width: 900px) { .btn { min-height: 42px; } .btn.sm { min-height: 36px; } .btn.icon { width: 42px; } .btn.icon.sm { width: 36px; } }
.segmented { display: flex; gap: 4px; padding: 3px; background: var(--sunken); border-radius: 10px; flex-wrap: wrap; }
.segmented a, .segmented button { flex: 1; text-align: center; padding: 6px 10px; border-radius: 8px; font-size: .86rem; font-weight: 560; color: var(--ink-2); border: 0; background: none; cursor: pointer; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; justify-content: center; }
.segmented a:hover { text-decoration: none; color: var(--ink); }
.segmented .on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ------------------------------------------------------------------ forms */
.form-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px 14px; }
.field { grid-column: span 6; min-width: 0; }
.field.w-half { grid-column: span 3; }
.field.w-third { grid-column: span 2; }
@media (max-width: 560px) { .field.w-half { grid-column: span 6; } .field.w-third { grid-column: span 3; } .field.w-third:last-child:nth-child(3n) { grid-column: span 6; } }
.field > label:not(.switch), .label { display: block; font-size: .84rem; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.field .req { color: var(--danger); margin-left: 2px; }
.help { font-size: .8rem; color: var(--muted); margin-top: 5px; }
.err { font-size: .82rem; color: var(--danger); margin-top: 5px; font-weight: 550; }
input[type=text], input[type=search], input[type=email], input[type=password], input[type=url], input[type=tel], input[type=number],
input[type=date], input[type=time], input[type=datetime-local], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface);
  color: var(--ink); font: inherit; font-size: .95rem; line-height: 1.35; min-height: 40px; transition: border-color .12s, box-shadow .12s;
  appearance: none; -webkit-appearance: none;
}
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2374787f' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; padding-right: 32px; }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.field.has-err input, .field.has-err select, .field.has-err textarea { border-color: var(--danger); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input[type=date], input[type=time] { min-width: 0; }
input[type=date]::-webkit-date-and-time-value, input[type=time]::-webkit-date-and-time-value { text-align: left; }
@media (max-width: 900px) { input, select, textarea { font-size: 16px !important; min-height: 44px; } }
.fieldset { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); padding: 16px 18px 18px; margin: 0 0 14px; }
.fieldset > legend, .fieldset > .legend { font-weight: 650; font-size: .92rem; padding: 0; margin-bottom: 12px; display: flex; gap: 8px; align-items: center; }
details.fieldset > summary { cursor: pointer; list-style: none; font-weight: 650; font-size: .92rem; display: flex; align-items: center; gap: 8px; }
details.fieldset > summary::-webkit-details-marker { display: none; }
details.fieldset > summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; }
details.fieldset[open] > summary { margin-bottom: 14px; }
details.fieldset[open] > summary::after { transform: rotate(-135deg); }
@media (max-width: 900px) { .fieldset { padding: 14px; } }
.form-actions { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.form-actions .left { margin-right: auto; }
@media (max-width: 900px) {
  .form-actions.sticky { position: sticky; bottom: calc(var(--tabbar-h) + var(--safe-b)); background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding: 10px 0; margin: 10px -16px 0; padding-left: 16px; padding-right: 16px; border-top: 1px solid var(--line); }
  .form-actions .btn { flex: 1; }
}
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: .93rem; line-height: 1.4; padding: 4px 0; }
.check input { margin: 0; }
input[type=checkbox], input[type=radio] { width: 19px; height: 19px; accent-color: var(--accent); flex: none; margin-top: 1px; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: .93rem; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { display: inline-block; width: 38px; height: 22px; border-radius: 999px; background: var(--line-strong); position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.stars { display: inline-flex; gap: 2px; color: #c08a1e; }
.stars .i { width: 15px; height: 15px; }
.star-input { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.star-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-input label { cursor: pointer; color: var(--line-strong); padding: 2px; margin: 0; }
.star-input label .i { width: 26px; height: 26px; fill: currentColor; stroke: none; }
.star-input input:checked ~ label, .star-input label:hover, .star-input label:hover ~ label { color: #c08a1e; }
.star-input input:focus-visible + label { outline: 2px solid var(--accent); border-radius: 4px; }
.tag-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-picker label { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px 5px 9px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-size: .85rem; background: var(--surface); }
.tag-picker input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tag-picker label::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.tag-picker label:has(input:checked) { border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, var(--surface)); font-weight: 600; }
.tag-picker label:has(input:focus-visible) { outline: 2px solid var(--accent); }
.input-group { display: flex; gap: 8px; }
.input-group > input, .input-group > select { flex: 1; min-width: 0; }
.color-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.color-picker label { cursor: pointer; }
.color-picker input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.color-picker span { width: 28px; height: 28px; border-radius: 8px; display: block; background: var(--c); border: 2px solid transparent; box-shadow: inset 0 0 0 2px var(--surface); }
.color-picker input:checked + span { border-color: var(--ink); }
.loc-picker .map { height: 220px; border-radius: 10px; margin-top: 8px; }
.geo-results { margin-top: 6px; }
.geo-results button { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: var(--surface-2); border-radius: 8px; margin-top: 4px; cursor: pointer; font-size: .86rem; }
.geo-results button:hover { background: var(--accent-soft); }
.link-rows .link-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; gap: 8px; margin-bottom: 8px; }
@media (max-width: 560px) { .link-rows .link-row { grid-template-columns: minmax(0, 1fr) auto; } .link-rows .link-row .lt { grid-column: 1; } }

/* ------------------------------------------------------------------ alerts, flashes, empty */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 10px; font-size: .9rem; border: 1px solid transparent; }
.alert .i { margin-top: 2px; }
.alert.error { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert.info { background: var(--info-soft); color: var(--info); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.neutral { background: var(--surface-2); color: var(--ink-2); border-color: var(--line); }
.alert .grow > strong { display: block; }
.flashes { margin-bottom: 16px; display: grid; gap: 8px; }
.empty { text-align: center; padding: 34px 20px; color: var(--muted); }
.empty .ico { width: 46px; height: 46px; border-radius: 14px; background: var(--sunken); display: grid; place-items: center; margin: 0 auto 12px; color: var(--ink-2); }
.empty h3 { color: var(--ink); margin-bottom: 4px; font-size: 1rem; }
.empty p { max-width: 420px; margin: 0 auto 14px; font-size: .9rem; }
.empty.sm { padding: 18px; }
.empty.sm .ico { display: none; }

/* ------------------------------------------------------------------ text helpers */
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: .84rem; }
.xs { font-size: .76rem; }
.mono { font-family: var(--mono); font-size: .88em; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strong { font-weight: 650; }
.right { text-align: right; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.prose { overflow-wrap: anywhere; }
.prose p:last-child { margin-bottom: 0; }
.danger-text { color: var(--danger); }
.ok-text { color: var(--ok); }
.warn-text { color: var(--warn); }
.kv { display: grid; grid-template-columns: minmax(110px, max-content) minmax(0, 1fr); gap: 7px 16px; font-size: .92rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 420px) { .kv { grid-template-columns: minmax(0, 1fr); gap: 1px; } .kv dd { margin-bottom: 8px; } }
.copyable { cursor: pointer; border-bottom: 1px dashed var(--line-strong); }
.code-box { font-family: var(--mono); font-size: .82rem; background: var(--sunken); border-radius: 8px; padding: 9px 11px; overflow-wrap: anywhere; user-select: all; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.ref { font-family: var(--mono); font-size: .86rem; letter-spacing: .02em; background: var(--sunken); padding: 1px 6px; border-radius: 5px; }

/* ------------------------------------------------------------------ progress */
.bar { height: 7px; background: var(--sunken); border-radius: 999px; overflow: hidden; position: relative; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .4s ease; }
.bar.thin { height: 5px; }
.bar.warn > span { background: var(--warn); }
.bar.danger > span { background: var(--danger); }
.bar.stack { display: flex; }
.bar.stack > span { border-radius: 0; }
.ring { width: 64px; height: 64px; flex: none; }
.ring circle { fill: none; stroke-width: 7; }
.ring .track { stroke: var(--sunken); }
.ring .fill { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .5s ease; transform: rotate(-90deg); transform-origin: 50% 50%; }
.ring text { font-size: 15px; font-weight: 700; fill: var(--ink); text-anchor: middle; dominant-baseline: central; font-family: var(--font); }
.prog-rows { display: grid; gap: 10px; }
.prog-row .spread { font-size: .86rem; margin-bottom: 4px; }

/* ------------------------------------------------------------------ dashboard */
.dash { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.dash > .w { grid-column: span 6; min-width: 0; }
.dash > .w.full { grid-column: span 12; }
.dash > .w.third { grid-column: span 4; }
.dash > .w.two-thirds { grid-column: span 8; }
@media (max-width: 1100px) { .dash > .w.third { grid-column: span 6; } .dash > .w.two-thirds { grid-column: span 12; } }
@media (max-width: 900px) { .dash { gap: 12px; } .dash > .w, .dash > .w.third, .dash > .w.two-thirds { grid-column: span 12; } }
.hero { padding: 22px 24px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center; position: relative; overflow: hidden; }
.hero h1 { font-size: 1.75rem; }
.hero .meta { color: var(--muted); margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .92rem; }
.hero .meta span { display: inline-flex; align-items: center; gap: 6px; }
.countdown { display: flex; gap: 10px; }
.countdown .unit { text-align: center; min-width: 58px; padding: 8px 6px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.countdown .n { font-size: 1.6rem; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1.1; display: block; }
.countdown .u { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.hero .rule { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; display: flex; }
.hero .rule span { flex: 1; }
@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); padding: 18px; gap: 14px; }
  .hero h1 { font-size: 1.42rem; }
  .countdown .unit { flex: 1; min-width: 0; }
}
.quick-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.qa { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: .88rem; font-weight: 560; }
.qa:hover { border-color: var(--line-strong); background: var(--surface-2); text-decoration: none; }
.qa .i { color: var(--accent-text); }
@media (max-width: 900px) { .quick-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mini-route { display: flex; align-items: stretch; gap: 0; overflow: hidden; border-radius: 9px; border: 1px solid var(--line); }
.mini-route > a { flex: var(--n) 1 0; min-width: 96px; padding: 9px 10px; background: color-mix(in srgb, var(--c) 10%, var(--surface)); border-left: 3px solid var(--c); color: var(--ink); font-size: .84rem; }
.mini-route > a:hover { text-decoration: none; background: color-mix(in srgb, var(--c) 18%, var(--surface)); }
.mini-route .n { color: var(--muted); font-size: .75rem; display: block; }
@media (max-width: 600px) { .mini-route { flex-direction: column; } .mini-route > a { border-left-width: 4px; } }

/* ------------------------------------------------------------------ itinerary */
.day-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.day-strip { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; scroll-snap-type: x proximity; margin-bottom: 10px; }
.day-strip::-webkit-scrollbar { display: none; }
.day-pill { flex: none; scroll-snap-align: center; display: flex; flex-direction: column; align-items: center; min-width: 50px; padding: 6px 4px 7px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: .72rem; line-height: 1.2; position: relative; }
.day-pill b { font-size: 1.05rem; color: var(--ink); font-weight: 650; }
.day-pill .band { position: absolute; left: 8px; right: 8px; bottom: 3px; height: 2px; border-radius: 2px; background: var(--c, transparent); }
.day-pill:hover { text-decoration: none; border-color: var(--line-strong); }
.day-pill.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.day-pill.on b { color: var(--bg); }
.day-pill.today { box-shadow: inset 0 0 0 2px var(--accent); }
.day-pill.drop-hover { border-color: var(--accent); background: var(--accent-soft); }
.view-switch { margin-bottom: 14px; }
.day-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 14px; }
.day-head h1 { font-size: 1.45rem; }
.city-line { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; color: var(--ink-2); }
.city-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); display: inline-block; flex: none; }

.timeline { position: relative; padding-left: 0; }
.tl-item { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 12px; position: relative; padding-bottom: 12px; }
.tl-item::before { content: ""; position: absolute; left: 70px; top: 26px; bottom: -2px; width: 1px; background: var(--line); }
.tl-item:last-child::before { display: none; }
.tl-time { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; font-size: .9rem; padding-top: 12px; color: var(--ink); }
.tl-time .end { display: block; font-weight: 450; color: var(--muted); font-size: .78rem; }
.tl-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; position: relative; margin-left: 12px; min-width: 0; }
.tl-card::before { content: ""; position: absolute; left: -17px; top: 16px; width: 9px; height: 9px; border-radius: 50%; background: var(--surface); border: 2px solid var(--k, var(--accent)); }
.tl-card.k-stay { --k: #1f6b63; background: var(--surface-2); }
.tl-card.k-transport { --k: #5b6470; }
.tl-card.k-food { --k: #b4533f; }
.tl-card.k-shop { --k: #9c4f7a; }
.tl-card.k-activity, .tl-card.k-sight, .tl-card.k-event, .tl-card.k-daytrip, .tl-card.k-other { --k: #3d6ea5; }
.tl-card .t { font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tl-card .t a { color: var(--ink); }
.tl-card .s { color: var(--muted); font-size: .84rem; margin-top: 2px; display: flex; gap: 4px 12px; flex-wrap: wrap; }
.tl-card .s > span { display: inline-flex; gap: 4px; align-items: center; }
.tl-card.is-cancelled { opacity: .55; }
.tl-card.is-cancelled .t a { text-decoration: line-through; }
@media (max-width: 520px) {
  .tl-item { grid-template-columns: 44px minmax(0, 1fr); gap: 8px; }
  .tl-item::before { left: 56px; }
  .tl-time { font-size: .82rem; }
  .tl-card { padding: 10px 12px; margin-left: 10px; }
  .tl-card::before { left: -15px; }
}
.drag-list { min-height: 44px; border-radius: 12px; }
.drag-list.drop-hover { background: var(--accent-soft); outline: 2px dashed var(--accent); outline-offset: 2px; }
.draggable { cursor: grab; }
.draggable.dragging { opacity: .45; }
.grip { color: var(--faint); cursor: grab; display: inline-flex; touch-action: none; }
.untimed .li { padding-left: 14px; }

.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-h { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); text-align: center; padding-bottom: 2px; font-weight: 600; }
.cal-day { min-height: 112px; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 7px 8px; display: flex; flex-direction: column; gap: 3px; position: relative; color: var(--ink); overflow: hidden; }
.cal-day:hover { text-decoration: none; border-color: var(--line-strong); }
.cal-day.out { background: transparent; border-style: dashed; opacity: .45; min-height: 0; }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-day .d { display: flex; justify-content: space-between; align-items: baseline; font-size: .78rem; color: var(--muted); }
.cal-day .d b { font-size: 1rem; color: var(--ink); font-weight: 650; }
.cal-day .band { height: 3px; border-radius: 2px; background: var(--c, var(--line)); margin: 1px 0 3px; }
.cal-day .ev { font-size: .74rem; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.cal-day .ev .i { width: 12px; height: 12px; vertical-align: -2px; }
.cal-day .ev.more { color: var(--muted); }
.cal-day.drop-hover { border-color: var(--accent); background: var(--accent-soft); }
@media (max-width: 900px) {
  .cal { gap: 3px; }
  .cal-day { min-height: 64px; padding: 4px 5px; border-radius: 8px; }
  .cal-day .ev { display: none; }
  .cal-day .dots { display: flex; gap: 3px; flex-wrap: wrap; margin-top: auto; }
  .cal-day .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--c, var(--accent)); display: block; }
  .cal-day .d span { display: none; }
}
@media (min-width: 901px) { .cal-day .dots { display: none; } }

.hours { display: grid; grid-template-columns: 46px repeat(var(--cols), minmax(0, 1fr)); position: relative; }
.hours .hcol-head { position: sticky; top: 0; background: var(--bg); padding: 6px 4px 8px; font-weight: 650; font-size: .85rem; text-align: center; z-index: 2; border-bottom: 1px solid var(--line); }
.hours .hlabel { font-size: .72rem; color: var(--muted); text-align: right; padding-right: 8px; transform: translateY(-7px); font-variant-numeric: tabular-nums; }
.hours .hcol { position: relative; border-left: 1px solid var(--line); background-image: repeating-linear-gradient(to bottom, var(--line) 0, var(--line) 1px, transparent 1px, transparent var(--hh)); }
.hours .block { position: absolute; left: 4px; right: 4px; border-radius: 8px; padding: 4px 7px; font-size: .76rem; line-height: 1.25; overflow: hidden; background: color-mix(in srgb, var(--k) 14%, var(--surface)); border-left: 3px solid var(--k); color: var(--ink); }
.hours .block:hover { text-decoration: none; z-index: 3; box-shadow: var(--shadow); }
.hours .block b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hours .block span { color: var(--muted); }
.hours .block.k-stay { --k: #1f6b63; } .hours .block.k-transport { --k: #5b6470; } .hours .block.k-food { --k: #b4533f; }
.hours .block.k-item { --k: #3d6ea5; } .hours .block.k-shop { --k: #9c4f7a; }
.hours .now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 4; }

/* ------------------------------------------------------------------ route */
.route { display: flex; flex-direction: column; gap: 0; }
.route-city { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; }
.route-city .rail { display: flex; flex-direction: column; align-items: center; }
.route-city .node { width: 16px; height: 16px; border-radius: 50%; background: var(--c); border: 3px solid var(--surface); box-shadow: 0 0 0 2px var(--c); margin-top: 16px; flex: none; }
.route-city .line { flex: 1; width: 2px; background: var(--line-strong); margin-top: 4px; }
.route-city:last-child .line { display: none; }
.route-leg { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; }
.route-leg .rail { display: flex; justify-content: center; }
.route-leg .rail::before { content: ""; width: 2px; background: repeating-linear-gradient(to bottom, var(--line-strong) 0 4px, transparent 4px 8px); }
.route-leg .leg { display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin: 6px 0; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--line-strong); font-size: .86rem; color: var(--ink-2); }
.route-leg .leg:hover { text-decoration: none; border-color: var(--faint); }
.segbar { position: relative; height: 46px; background: var(--sunken); border-radius: 10px; overflow: hidden; }
.segbar .seg { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--c) 22%, var(--surface)); border-left: 3px solid var(--c); padding: 5px 8px; font-size: .78rem; overflow: hidden; color: var(--ink); white-space: nowrap; }
.segbar .seg:hover { text-decoration: none; background: color-mix(in srgb, var(--c) 32%, var(--surface)); }
.segbar .seg b { display: block; font-size: .84rem; overflow: hidden; text-overflow: ellipsis; }
.seg-scale { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); margin-top: 4px; }

/* ------------------------------------------------------------------ links + documents */
.links { display: grid; gap: 6px; }
.link {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); min-width: 0; position: relative;
}
.link:hover { border-color: var(--line-strong); }
.link .lk { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--sunken); color: var(--ink-2); }
.link .lk.k-maps { background: #e8f0e6; color: #3c6b34; } .link .lk.k-youtube { background: #fbe9e7; color: #b42318; }
.link .lk.k-tiktok { background: #ebeaf6; color: #3b3a6b; } .link .lk.k-instagram { background: #f8e8f1; color: #9c3f74; }
.link .lk.k-booking, .link .lk.k-ticket { background: var(--info-soft); color: var(--info); }
.link .lk.k-document { background: var(--warn-soft); color: var(--warn); }
:root[data-theme="dark"] .link .lk[class*="k-"] { background: var(--sunken); color: var(--ink-2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .link .lk[class*="k-"] { background: var(--sunken); color: var(--ink-2); } }
.link .lt { flex: 1; min-width: 0; }
.link .lt a { color: var(--ink); font-weight: 560; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link .lt a::after { content: ""; position: absolute; inset: 0; }
.link .lt .d { font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link .la { display: flex; gap: 2px; position: relative; z-index: 1; }
.link .imp { color: #c08a1e; }
.link-add > summary { list-style: none; cursor: pointer; }
.link-add > summary::-webkit-details-marker { display: none; }
.link-add[open] > summary { margin-bottom: 10px; }
.docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.doc { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); position: relative; display: flex; flex-direction: column; min-width: 0; }
.doc .preview { aspect-ratio: 4/3; background: var(--sunken) center/cover no-repeat; display: grid; place-items: center; color: var(--muted); }
.doc .meta { padding: 6px 8px; font-size: .78rem; }
.doc .meta a { color: var(--ink); font-weight: 560; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc .meta a::after { content: ""; position: absolute; inset: 0; }
.doc .lock { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,.55); color: #fff; border-radius: 6px; padding: 2px 5px; font-size: .7rem; display: flex; gap: 3px; align-items: center; z-index: 1; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.photos a { display: block; aspect-ratio: 1; border-radius: 10px; background: var(--sunken) center/cover no-repeat; }
.upload { border: 1.5px dashed var(--line-strong); border-radius: 12px; padding: 14px; text-align: center; color: var(--muted); font-size: .88rem; transition: border-color .15s, background .15s; }
.upload.drag { border-color: var(--accent); background: var(--accent-soft); }
.upload input[type=file] { font-size: .86rem; max-width: 100%; }

/* ------------------------------------------------------------------ item cards (library) */
.icard { display: flex; flex-direction: column; overflow: hidden; }
.icard .cover { aspect-ratio: 16/9; background: var(--sunken) center/cover no-repeat; display: grid; place-items: center; color: var(--faint); position: relative; }
.icard .cover.k-food { background-color: color-mix(in srgb, #b4533f 9%, var(--sunken)); }
.icard .cover.k-shop { background-color: color-mix(in srgb, #9c4f7a 9%, var(--sunken)); }
.icard .cover.k-sight, .icard .cover.k-activity, .icard .cover.k-event, .icard .cover.k-daytrip { background-color: color-mix(in srgb, #3d6ea5 8%, var(--sunken)); }
.icard .cover .platform { position: absolute; left: 8px; bottom: 8px; background: rgba(20,20,22,.7); color: #fff; padding: 2px 8px; border-radius: 6px; font-size: .72rem; display: flex; gap: 4px; align-items: center; }
.icard .cover .fav { position: absolute; right: 8px; top: 8px; }
.icard .ib { padding: 11px 13px 12px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.icard .ib .ttl { font-weight: 600; color: var(--ink); line-height: 1.3; }
.icard .ib .ttl::after { content: ""; position: absolute; inset: 0; }
.icard { position: relative; }
.icard .acts { display: flex; gap: 6px; margin-top: auto; padding-top: 6px; position: relative; z-index: 1; flex-wrap: wrap; }
.fav-btn { border: 0; background: none; cursor: pointer; color: var(--faint); padding: 4px; border-radius: 6px; display: inline-flex; position: relative; z-index: 1; }
.fav-btn.on { color: #c08a1e; }
.fav-btn.on .i { fill: currentColor; }
.cover .fav-btn { background: rgba(255,255,255,.88); color: #8b8f96; }
.cover .fav-btn.on { color: #c08a1e; }

/* ------------------------------------------------------------------ checklists */
.checklist .crow { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); min-height: 56px; position: relative; }
.checklist .crow:first-child { border-top: 0; }
.checklist .crow .tick { width: 28px; height: 28px; border-radius: 8px; border: 2px solid var(--line-strong); display: grid; place-items: center; flex: none; background: var(--surface); cursor: pointer; transition: background .15s, border-color .15s; color: transparent; padding: 0; }
.checklist .crow .tick .i { width: 18px; height: 18px; stroke-width: 2.6; }
.checklist .crow.done .tick { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.checklist .crow.done .ct { color: var(--muted); }
.checklist .crow.done .ct .nm { text-decoration: line-through; text-decoration-color: var(--faint); }
.checklist .crow .ct { flex: 1; min-width: 0; font-size: .96rem; overflow-wrap: anywhere; }
.checklist .crow .ct .sub { display: block; font-size: .8rem; color: var(--muted); text-decoration: none; margin-top: 1px; }
.checklist .crow > form { position: static; margin: 0; }
.checklist .crow .tap { position: absolute; inset: 0; z-index: 0; border: 0; background: none; cursor: pointer; pointer-events: auto; border-radius: 0; }
.checklist .crow .tap:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.checklist .crow > .ct, .checklist .crow > .tick { position: relative; z-index: 1; pointer-events: none; }
.checklist .crow > .cmeta { position: relative; z-index: 2; pointer-events: auto; }
.checklist .crow .cmeta { display: flex; gap: 6px; align-items: center; }
.checklist .crow.pop .tick { animation: pop .28s ease; }
@keyframes pop { 50% { transform: scale(1.18); } }
@media (max-width: 900px) { .checklist .crow { padding: 12px 14px; min-height: 60px; } .checklist .crow .tick { width: 30px; height: 30px; } }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 9px; overflow: hidden; }
.qty button { border: 0; background: var(--surface); width: 32px; height: 32px; cursor: pointer; display: grid; place-items: center; color: var(--ink-2); }
.qty button:hover { background: var(--sunken); }
.qty span { min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; font-size: .86rem; font-weight: 600; }
@media (max-width: 900px) { .qty button { width: 38px; height: 38px; } }
.quick-add { display: flex; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); flex-wrap: wrap; }
.quick-add input[type=text] { flex: 2 1 180px; }
.quick-add select { flex: 1 1 120px; width: auto; }
@media (max-width: 900px) { .quick-add { padding: 12px 14px; } }

/* ------------------------------------------------------------------ charts */
.hbars { display: grid; gap: 12px; }
.hbar .lbl { display: flex; justify-content: space-between; gap: 10px; font-size: .86rem; margin-bottom: 5px; }
.hbar .lbl .v { font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; }
.hbar .track { position: relative; height: 12px; background: var(--sunken); border-radius: 4px; overflow: hidden; display: flex; }
.hbar .track span { height: 100%; }
.hbar .track .budget-mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); border-radius: 1px; }
.c-spent { background: var(--accent); } .c-due { background: #d08b2a; } .c-planned { background: #8fb7d9; } .c-reserved { background: color-mix(in srgb, var(--accent) 45%, var(--surface)); }
.c-estimate { background: repeating-linear-gradient(45deg, var(--line-strong) 0 3px, transparent 3px 6px); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .78rem; color: var(--muted); }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.vbars { display: flex; align-items: flex-end; gap: 3px; height: 150px; padding-top: 8px; border-bottom: 1px solid var(--line); }
.vbars .col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; position: relative; }
.vbars .col span { display: block; width: 100%; border-radius: 3px 3px 0 0; }
.vbars .col .est { position: absolute; left: 0; right: 0; bottom: 0; border: 1px dashed var(--faint); border-bottom: 0; border-radius: 3px 3px 0 0; }
.vbars .col:hover { background: var(--surface-2); }
.vbars-x { display: flex; gap: 3px; font-size: .64rem; color: var(--muted); margin-top: 4px; }
.vbars-x span { flex: 1; text-align: center; min-width: 0; overflow: hidden; }
.money-big { font-size: 1.9rem; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ map */
.map { height: 560px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--sunken); z-index: 0; }
.map.short { height: 340px; }
.map .leaflet-tile-pane { filter: saturate(.55) contrast(.96); }
:root[data-theme="dark"] .map .leaflet-tile-pane { filter: invert(.9) hue-rotate(180deg) saturate(.4) brightness(.9); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .map .leaflet-tile-pane { filter: invert(.9) hue-rotate(180deg) saturate(.4) brightness(.9); } }
@media (max-width: 900px) { .map { height: 58vh; } .map.short { height: 260px; } }
.map-fallback { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: .9rem; text-align: center; padding: 20px; }
.kt-marker { width: 26px; height: 26px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--c); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3); display: grid; place-items: center; }
.kt-marker span { transform: rotate(45deg); color: #fff; font-size: 11px; font-weight: 700; font-family: var(--font); }
.kt-marker.hollow { background: #fff; border-color: var(--c); border-width: 3px; }
.kt-marker.hollow span { color: var(--c); }
.leaflet-popup-content-wrapper { border-radius: 12px !important; font-family: var(--font) !important; }
.leaflet-popup-content { margin: 12px 14px !important; font-size: .88rem; line-height: 1.4; }
.pop-title { font-weight: 650; font-size: .95rem; color: #1c1d1f; }
.pop-sub { color: #74787f; font-size: .8rem; margin: 2px 0 6px; }
.pop-links a { display: block; font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 230px; }
.map-panel { position: absolute; }

/* ------------------------------------------------------------------ dialogs, sheets, toasts */
dialog { border: 0; padding: 0; background: var(--surface); color: var(--ink); border-radius: 16px; box-shadow: var(--shadow-lg); max-width: min(520px, calc(100vw - 24px)); width: 100%; }
dialog::backdrop { background: rgba(18, 19, 20, .42); backdrop-filter: blur(2px); }
dialog[open] { animation: dlg-in .18s ease; }
@keyframes dlg-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.dlg-body { padding: 20px 20px 8px; }
.dlg-body h2 { margin-bottom: 6px; }
.dlg-actions { padding: 12px 20px 18px; display: flex; gap: 8px; justify-content: flex-end; }
@media (max-width: 900px) {
  dialog.sheet { margin: auto 0 0; max-width: 100vw; width: 100vw; border-radius: 18px 18px 0 0; padding-bottom: var(--safe-b); max-height: 88vh; overflow-y: auto; }
  dialog.sheet[open] { animation: sheet-in .22s cubic-bezier(.2,.8,.3,1); }
  @keyframes sheet-in { from { transform: translateY(100%); } }
  .dlg-actions .btn { flex: 1; }
}
.sheet-handle { width: 38px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 8px auto 0; }
@media (min-width: 901px) { .sheet-handle { display: none; } }
.sheet-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 12px 16px 18px; }
.sheet-grid a, .sheet-grid button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); font-size: .8rem; font-weight: 560; text-align: center; line-height: 1.2; overflow-wrap: break-word; min-width: 0; }
.sheet-grid button { cursor: pointer; font: inherit; font-size: .8rem; font-weight: 560; width: 100%; }
.sheet-grid a:hover, .sheet-grid button:hover { text-decoration: none; border-color: var(--line-strong); }
.sheet-grid button .i, .sheet-grid a .i { width: 22px; height: 22px; color: var(--accent-text); }
.sheet-title { padding: 14px 18px 0; font-weight: 650; display: flex; justify-content: space-between; align-items: center; }
.sheet-sub { padding: 2px 18px 0; color: var(--muted); font-size: .84rem; }
#toasts { position: fixed; z-index: 90; left: 50%; transform: translateX(-50%); bottom: 24px; display: grid; gap: 8px; width: min(440px, calc(100vw - 24px)); pointer-events: none; }
@media (max-width: 900px) { #toasts { bottom: calc(var(--tabbar-h) + var(--safe-b) + 10px); } }
.toast { background: var(--ink); color: var(--bg); padding: 11px 14px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: .9rem; display: flex; gap: 10px; align-items: center; animation: toast-in .2s ease; pointer-events: auto; }
.toast.error { background: var(--danger); color: #fff; }
.toast .i { flex: none; }
.toast.out { opacity: 0; transform: translateY(6px); transition: all .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.netbar { position: fixed; top: 0; left: 0; right: 0; z-index: 95; display: none; justify-content: center; padding: calc(4px + var(--safe-t)) 10px 4px; font-size: .78rem; font-weight: 600; }
.netbar.show { display: flex; }
.netbar.offline { background: #3a3b40; color: #fff; }
.netbar.pending { background: var(--warn-soft); color: var(--warn); }
.netbar.conflict { background: var(--danger); color: #fff; }
.netbar a { color: inherit; text-decoration: underline; margin-left: 6px; }
.change-banner { position: fixed; z-index: 80; top: 14px; right: 14px; max-width: 360px; }
@media (max-width: 900px) { .change-banner { top: auto; right: 12px; left: 12px; bottom: calc(var(--tabbar-h) + var(--safe-b) + 10px); max-width: none; } }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); display: inline-block; }
.sync-dot.off { background: var(--faint); }
.sync-dot.pending { background: var(--warn); }

/* ------------------------------------------------------------------ auth pages */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .card { padding: 26px 24px; }
.auth-brand { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 18px; }
.auth-brand img { width: 44px; height: 44px; border-radius: 12px; }

/* ------------------------------------------------------------------ misc */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters select, .filters input[type=search] { width: auto; min-height: 36px; padding-top: 6px; padding-bottom: 6px; font-size: .88rem; }
.filters input[type=search] { min-width: 200px; flex: 1 1 200px; }
@media (max-width: 900px) { .filters select { flex: 1 1 140px; min-height: 42px; } .filters input[type=search] { min-height: 42px; } }
details.filter-more > summary { list-style: none; cursor: pointer; }
details.filter-more > summary::-webkit-details-marker { display: none; }
.kbd { font-family: var(--mono); font-size: .75rem; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; color: var(--muted); }
.search-box { position: relative; }
.search-box .i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-box input { padding-left: 36px; }
mark { background: color-mix(in srgb, #e9b949 40%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; }
.pill-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.compare { display: grid; grid-template-columns: 170px repeat(var(--n), minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.compare > div { padding: 10px 12px; border-top: 1px solid var(--line); font-size: .88rem; min-width: 0; overflow-wrap: anywhere; }
.compare > .rh { color: var(--muted); font-weight: 600; font-size: .8rem; background: var(--surface-2); }
.compare > .ch { border-top: 0; font-weight: 650; }
.compare > .best { background: var(--accent-soft); }
.compare-cards { display: none; }
@media (max-width: 900px) { .compare { display: none; } .compare-cards { display: grid; gap: 12px; } }
.weather-alt { border-left: 3px solid var(--info); padding: 8px 12px; background: var(--info-soft); border-radius: 0 8px 8px 0; font-size: .88rem; }
.print-only { display: none; }
.welcome-steps { counter-reset: s; display: grid; gap: 8px; }
.welcome-steps li { counter-increment: s; display: grid; grid-template-columns: 24px 1fr; gap: 12px; align-items: center; }
.welcome-steps li::before { content: counter(s); width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; font-size: .8rem; font-weight: 700; flex: none; }
.source { font-size: .76rem; color: var(--muted); display: inline-flex; gap: 4px; align-items: center; }
.source.auto { color: var(--info); }
.fade-in { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* review polish */
.filters .check { align-items: center; white-space: nowrap; padding: 0 4px; min-height: 40px; }
.icard .cover:not([style]) { aspect-ratio: auto; height: 72px; }
@media (min-width: 901px) { .icard .cover:not([style]) { height: 96px; } }
.dash-cats { display: grid; gap: 10px; }
.dash-cat .spread { margin-bottom: 4px; }
.dash-cats .eyebrow { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
@media (max-width: 400px) { .sheet-grid a, .sheet-grid button { padding: 14px 4px; font-size: .78rem; } }

/* ------------------------------------------------------------------ ideas board */
.avatar.xs { width: 18px; height: 18px; font-size: .52rem; }
select.compact { width: auto; min-height: 36px; padding-top: 6px; padding-bottom: 6px; font-size: .88rem; }
.idea-add { display: grid; gap: 10px; margin-bottom: 16px; }
.idea-add-row { display: grid; grid-template-columns: 1.3fr 1fr; gap: 8px; }
.idea-add-row.two { grid-template-columns: 1fr auto; align-items: center; }
.idea-add input[name=title] { font-size: 1rem; }
@media (max-width: 700px) {
  .idea-add-row, .idea-add-row.two { grid-template-columns: 1fr; }
  .idea-add-row.two .row { justify-content: space-between; }
  .idea-add-row.two .row select { flex: 1; min-width: 0; }
}
.chip-radio { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-radio label, .chip-check { position: relative; cursor: pointer; }
.chip-radio input, .chip-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip-radio span, .chip-check span {
  display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2); font-size: .84rem; white-space: nowrap; line-height: 1.3; min-height: 34px;
}
.chip-radio .i, .chip-check .i { width: 15px; height: 15px; }
.chip-radio input:checked + span, .chip-check input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip-radio input:focus-visible + span, .chip-check input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.idea-tabs { margin-bottom: 12px; }
.idea-tabs .n { font-size: .74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.idea-filters { flex-direction: column; align-items: stretch; gap: 10px; }
.idea-group { margin-bottom: 20px; }
.group-title { font-size: .95rem; font-weight: 650; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.idea-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
@media (max-width: 760px) { .idea-grid { grid-template-columns: 1fr; } }
.idea { display: flex; gap: 12px; padding: 12px; align-items: flex-start; transition: opacity .2s, transform .2s, border-color .2s; }
.idea.leaving { opacity: 0; transform: scale(.98); }
.idea.match { border-color: color-mix(in srgb, #c2413b 35%, var(--line)); }
.idea-thumb { width: 64px; height: 64px; border-radius: 10px; flex: none; background: var(--sunken) center/cover no-repeat; display: grid; place-items: center; color: var(--muted); }
.idea-thumb.k-food { background-color: color-mix(in srgb, #b4533f 12%, var(--sunken)); color: #b4533f; }
.idea-thumb.k-shop { background-color: color-mix(in srgb, #9c4f7a 12%, var(--sunken)); color: #9c4f7a; }
.idea-thumb.k-sight, .idea-thumb.k-activity, .idea-thumb.k-event, .idea-thumb.k-daytrip { background-color: color-mix(in srgb, #3d6ea5 10%, var(--sunken)); color: #3d6ea5; }
.idea-thumb .i { width: 22px; height: 22px; }
.idea-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.idea-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: .76rem; color: var(--muted); align-items: center; }
.idea-meta .i { width: 13px; height: 13px; vertical-align: -2px; }
.match-badge { display: none; color: #c2413b; font-weight: 650; }
.idea.match .match-badge { display: inline-flex; align-items: center; gap: 3px; }
.idea .ttl { font-weight: 620; color: var(--ink); line-height: 1.3; overflow-wrap: anywhere; }
.idea-note { margin: 0; font-size: .84rem; color: var(--ink-2); overflow-wrap: anywhere; }
.idea-link { display: inline-flex; align-items: center; gap: 5px; font-size: .8rem; color: var(--accent-text); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; align-self: flex-start; }
.idea-link .i { width: 13px; height: 13px; }
.idea-foot { display: flex; align-items: center; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.idea-foot form { display: inline-flex; margin: 0; }
.idea-foot .grow { flex: 1; }
.vote-btn { display: inline-grid; place-items: center; width: 40px; height: 36px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; transition: transform .15s, color .15s, border-color .15s; }
.vote-btn .i { width: 19px; height: 19px; }
.vote-btn[aria-pressed=true] { color: #c2413b; border-color: color-mix(in srgb, #c2413b 40%, var(--line)); background: color-mix(in srgb, #c2413b 8%, var(--surface)); }
.vote-btn.pop { transform: scale(1.15); }
.voters { display: inline-flex; gap: 2px; }
.btn.choose { color: var(--accent-text); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.idea-foot select.compact { max-width: 170px; min-height: 34px; }
:root[data-theme="dark"] .vote-btn[aria-pressed=true], :root[data-theme="dark"] .match-badge { color: #f08a84; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .vote-btn[aria-pressed=true], :root:not([data-theme="light"]) .match-badge { color: #f08a84; } }

.match-link { color: #c2413b; display: inline-flex; align-items: center; gap: 3px; }
.match-link .i { width: 13px; height: 13px; }

/* ------------------------------------------------------------------ flight planner */
.legs { display: grid; gap: 0; }
.leg-card { padding: 14px 16px 10px; }
.leg-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.leg-head h2 { font-size: 1rem; margin: 0; display: flex; align-items: center; gap: 8px; }
.leg-head .leg-dur { margin-left: auto; }
.input-pair { display: grid; grid-template-columns: 1.25fr 1fr; gap: 6px; }
.tz-pick { margin-top: 6px; }
.leg-more summary { cursor: pointer; font-size: .84rem; color: var(--muted); padding: 6px 0; }
.layover { display: flex; align-items: center; gap: 10px; padding: 6px 0 6px 26px; position: relative; min-height: 42px; }
.layover-line { position: absolute; left: 34px; top: 0; bottom: 0; border-left: 2px dashed var(--line-strong); }
.layover-text { margin-left: 26px; font-size: .84rem; color: var(--ink-2); background: var(--bg); padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); }
.layover.warn .layover-text { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); background: var(--warn-soft); }
.layover.bad .layover-text { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); background: var(--danger-soft); }
.flight-summary { text-align: center; color: var(--ink-2); margin: 0 0 16px; min-height: 1.2em; }
/* flight journey (detail + lists) */
.journey { display: grid; gap: 0; }
.jleg { display: grid; grid-template-columns: 58px 22px 1fr; gap: 0 10px; }
.jleg .t { font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; padding-top: 1px; }
.jleg .t small { display: block; font-weight: 450; color: var(--muted); font-size: .72rem; }
.jleg .rail { position: relative; display: flex; justify-content: center; }
.jleg .rail::before { content: ""; position: absolute; top: 8px; bottom: -8px; border-left: 2px solid var(--accent); }
.jleg.end .rail::before { display: none; }
.jleg .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); margin-top: 4px; z-index: 1; }
.jleg .what { padding-bottom: 14px; min-width: 0; }
.jleg .what .ap { font-weight: 600; }
.jleg .what .meta { font-size: .82rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.jstop { display: grid; grid-template-columns: 58px 22px 1fr; gap: 0 10px; }
.jstop .rail { position: relative; }
.jstop .rail::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; border-left: 2px dashed var(--line-strong); }
.jstop .box { margin: 2px 0 14px; padding: 8px 12px; border-radius: 10px; background: var(--sunken); font-size: .86rem; }
.jstop.warn .box { background: var(--warn-soft); color: var(--warn); }
.jstop.bad .box { background: var(--danger-soft); color: var(--danger); }
.jflight { font-size: .82rem; color: var(--ink-2); margin: 2px 0 6px; padding: 6px 10px; border-left: 2px solid var(--accent-soft); }
/* review 1.1 polish */
@media (min-width: 901px) and (max-height: 960px) {
  .nav a { padding-top: 6px; padding-bottom: 6px; }
  .nav-label { padding-top: 10px; }
}
.idea-add > *, .idea-add-row > * { min-width: 0; }
.idea-add-row.two .row { min-width: 0; }
.layover-text, .jstop .box { overflow-wrap: normal; }
.nowrap { white-space: nowrap; }
@media (max-width: 700px) {
  .idea-filters .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .idea-filters .chips::-webkit-scrollbar { display: none; }
  .idea-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .idea-tabs::-webkit-scrollbar { display: none; }
  .idea-tabs a { padding: 6px 8px; font-size: .84rem; flex: 1 0 auto; }
  .idea-foot select.compact { max-width: 132px; }
  .idea-help { display: none; }
}
@media (max-width: 600px) {
  .leg-card .w-half.leg-ap { grid-column: span 1; }
  .leg-card .form-grid { grid-template-columns: 1fr 1fr; }
  .leg-card .w-half:not(.leg-ap), .leg-card .w-third { grid-column: 1 / -1; }
  .leg-card .leg-more .w-third { grid-column: span 1; }
  .leg-card .leg-more .form-grid { grid-template-columns: 1fr 1fr; }
  .leg-card .leg-more .w-third:last-child { grid-column: 1 / -1; }
}
.idea-filters > * { min-width: 0; max-width: 100%; }
@media (max-width: 700px) { .idea-filters > .chips { max-width: calc(100% + 32px); } }
.idea-filters .row { align-items: center; }
.idea-filters .row select.compact { flex: 1 1 140px; min-width: 0; }

.more-details > summary { font-weight: 600; }
.sub-legend { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; margin: 16px 0 8px; }
.more-details .form-grid + .sub-legend { margin-top: 18px; }
