:root {
  --bg: #F1F4F7;
  --surface: #FFFFFF;
  --surface-2: #E8EDF2;
  --ink: #18202D;
  --ink-2: #4B5667;
  --ink-3: #7B8697;
  --line: #D4DBE3;
  --butt: #2F55A4;
  --butt-soft: #DFE7F6;
  --butt-ink: #1F3E80;
  --wai: #AE3657;
  --wai-soft: #F6DFE5;
  --wai-ink: #862440;
  --both: #A87814;
  --both-soft: #F4EACF;
  --both-ink: #6E4E08;
  --free: #2E7D5B;
  --free-soft: #DDF0E6;
  --warn: #B5611A;
  --warn-soft: #FBE7D3;
  --danger: #B3261E;
  --hinomaru: #C0392B;
  --shadow: 0 1px 2px rgba(20, 30, 50, .06), 0 6px 20px rgba(20, 30, 50, .07);
  --radius: 10px;
  --f-display: "Shippori Mincho B1", "Hiragino Mincho ProN", "Yu Mincho", Georgia, serif;
  --f-body: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", system-ui, -apple-system, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F141B;
    --surface: #171E28;
    --surface-2: #202935;
    --ink: #E6EBF1;
    --ink-2: #A3AEBC;
    --ink-3: #75808F;
    --line: #2C3645;
    --butt: #86A5EA;
    --butt-soft: #1C2A47;
    --butt-ink: #B9CCF5;
    --wai: #EA8AA4;
    --wai-soft: #3F1D29;
    --wai-ink: #F5BDCC;
    --both: #E2B657;
    --both-soft: #372B12;
    --both-ink: #F1D594;
    --free: #6CC89C;
    --free-soft: #16301F;
    --warn: #F0A15C;
    --warn-soft: #3A2512;
    --danger: #FF8A80;
    --hinomaru: #E0574A;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 var(--f-body);
  -webkit-font-smoothing: antialiased;
  padding: env(safe-area-inset-top, 0) 0 env(safe-area-inset-bottom, 0);
}
h1, h2, h3 { font-family: var(--f-display); font-weight: 700; line-height: 1.2; text-wrap: balance; margin: 0; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
a { color: var(--butt); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--butt); outline-offset: 2px; }
.mono, .t { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.small { font-size: .85rem; }
.eyebrow { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .4em;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 8px; padding: .45em .85em; cursor: pointer; font-weight: 500;
  text-decoration: none; white-space: nowrap; line-height: 1.3;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:hover { opacity: .9; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--danger); }
.btn.small { font-size: .82rem; padding: .3em .6em; }
.btn:disabled { opacity: .5; cursor: default; }
.iconbtn { border: 0; background: transparent; cursor: pointer; padding: .3em .5em; border-radius: 6px; color: var(--ink-2); font-size: 1.1rem; line-height: 1; }
.iconbtn:hover { background: var(--surface-2); color: var(--ink); }

.field { display: grid; gap: .3rem; }
.field > span { font-size: .78rem; font-weight: 700; color: var(--ink-2); letter-spacing: .02em; }
.input, .field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 8px;
  padding: .5em .65em; min-height: 2.4em;
}
.field textarea { min-height: 5em; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--butt); box-shadow: 0 0 0 3px var(--butt-soft); }
.row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
@media (max-width: 560px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

.seg { display: inline-flex; background: var(--surface-2); border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; border-radius: 7px; padding: .35em .8em; cursor: pointer; font-weight: 500; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.seg button[data-fam="butt"][aria-pressed="true"] { background: var(--butt); color: #fff; }
.seg button[data-fam="wai"][aria-pressed="true"] { background: var(--wai); color: #fff; }
.seg button[data-fam="both"][aria-pressed="true"], .seg button[data-fam="together"][aria-pressed="true"] { background: var(--both); color: #fff; }
@media (prefers-color-scheme: dark) {
  .seg button[data-fam][aria-pressed="true"] { color: #0F141B; }
}

/* ---------- family tags ---------- */
.tag { display: inline-flex; align-items: center; gap: .3em; font-size: .7rem; font-weight: 700; letter-spacing: .08em; padding: .15em .5em; border-radius: 4px; text-transform: uppercase; white-space: nowrap; }
.tag.butt { background: var(--butt-soft); color: var(--butt-ink); }
.tag.wai { background: var(--wai-soft); color: var(--wai-ink); }
.tag.both { background: var(--both-soft); color: var(--both-ink); }
.pill { font-size: .72rem; padding: .12em .55em; border-radius: 99px; border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.pill.booked { border-color: var(--free); color: var(--free); background: var(--free-soft); }
.pill.idea { border-style: dashed; }
.pill.warn { border-color: var(--warn); color: var(--warn); background: var(--warn-soft); }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 0 16px;
}
.topbar-row { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; gap: 1rem; padding-block: .6rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--ink); font-family: var(--f-display); font-weight: 800; font-size: 1.1rem; }
.hinomaru { width: 22px; height: 22px; border-radius: 50%; background: var(--hinomaru); box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px var(--line); flex: none; }
.famswitch { margin-left: auto; }
.topbar-right { display: flex; align-items: center; gap: .6rem; }
.presence { display: flex; align-items: center; }
.presence .dot {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-size: .72rem; font-weight: 700; color: #fff; margin-left: -6px; border: 2px solid var(--bg);
  background: var(--ink-3); position: relative;
}
.presence .dot.butt { background: var(--butt); }
.presence .dot.wai { background: var(--wai); }
.presence .dot.both { background: var(--both); }
.presence .live { font-size: .72rem; color: var(--free); font-weight: 700; margin-right: .6rem; display: flex; align-items: center; gap: .35em; }
.presence .live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--free); }
.me-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: .3em .8em; cursor: pointer; font-size: .85rem; }
.tabs { max-width: 1280px; margin: 0 auto; display: flex; gap: .15rem; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  padding: .5rem .8rem .6rem; text-decoration: none; color: var(--ink-2); font-weight: 500; white-space: nowrap;
  border-bottom: 2px solid transparent; font-size: .93rem;
}
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); font-weight: 700; }
.tabs a .k { font-family: var(--f-display); margin-right: .35em; color: var(--ink-3); }
@media (max-width: 720px) {
  .famswitch { order: 3; margin-left: 0; width: 100%; }
  .famswitch .seg { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); }
  .topbar-right { margin-left: auto; }
}

/* ---------- page ---------- */
.view { max-width: 1280px; margin: 0 auto; padding: 1.25rem 16px 4rem; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head p { margin: .3rem 0 0; color: var(--ink-2); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.stack { display: grid; gap: 1rem; }
.empty { border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 1.25rem; color: var(--ink-3); text-align: center; }

/* ---------- landing ---------- */
.landing { min-height: 100vh; display: grid; place-items: center; padding: 2rem 16px; }
.landing-inner { width: 100%; max-width: 820px; display: grid; gap: 1.75rem; }
.landing h1 { font-size: clamp(2rem, 6vw, 3.4rem); font-weight: 800; letter-spacing: -.01em; }
.landing .sub { color: var(--ink-2); margin: .4rem 0 0; font-size: 1.05rem; }
.landing .kanji { font-family: var(--f-display); font-size: 1rem; color: var(--hinomaru); letter-spacing: .3em; font-weight: 700; }
.fam-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 560px) { .fam-cards { grid-template-columns: 1fr; } }
.fam-card {
  text-align: left; border: 0; cursor: pointer; border-radius: 16px; padding: 1.4rem 1.4rem 1.2rem; color: #fff;
  display: grid; gap: .35rem; min-height: 170px; align-content: end; position: relative; overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease;
}
.fam-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.fam-card.butt { background: var(--butt); }
.fam-card.wai { background: var(--wai); }
@media (prefers-color-scheme: dark) { .fam-card { color: #0F141B; } }
.fam-card .fname { font-family: var(--f-display); font-size: 2.6rem; font-weight: 800; letter-spacing: .04em; line-height: 1; }
.fam-card .fsub { opacity: .88; font-size: .92rem; }
.fam-card .stat { font-size: .82rem; opacity: .85; font-family: var(--f-mono); }
.fam-card::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%;
  border: 22px solid rgba(255,255,255,.14);
}
.landing .together-link { justify-self: start; }
.landing .whoami { display: grid; gap: .4rem; max-width: 360px; }

/* ---------- itinerary ---------- */
.days { display: grid; gap: 1rem; }
.day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.day-head { display: flex; align-items: center; gap: .9rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.day-num { font-family: var(--f-mono); font-size: .75rem; color: var(--ink-3); min-width: 3.2em; }
.day-title { font-family: var(--f-display); font-weight: 700; font-size: 1.1rem; }
.day-title a { color: inherit; text-decoration: none; }
.day-title a:hover { text-decoration: underline; }
.day-head .spacer { flex: 1; }
.staychip { border: 0; font: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: .4em; font-size: .82rem; color: var(--ink-2); background: var(--surface-2); padding: .2em .6em; border-radius: 6px; max-width: 100%; }
.staychip .k { font-family: var(--f-display); font-weight: 700; }
.staychip.missing { background: var(--warn-soft); color: var(--warn); }
.staychip.butt { box-shadow: inset 3px 0 0 var(--butt); }
.staychip.wai { box-shadow: inset 3px 0 0 var(--wai); }
.staychip.both { box-shadow: inset 3px 0 0 var(--both); }
.day-body { padding: .35rem 0; }
.day-cols { display: grid; grid-template-columns: 1fr 1fr; }
.day-cols > div + div { border-left: 1px solid var(--line); }
.day-cols .colhead { padding: .5rem 1rem 0; }
@media (max-width: 760px) { .day-cols { grid-template-columns: 1fr; } .day-cols > div + div { border-left: 0; border-top: 1px solid var(--line); } }
.together-band { background: var(--both-soft); border-bottom: 1px solid var(--line); padding-block: .2rem; }
.together-band .colhead { padding: .45rem 1rem 0; color: var(--both-ink); }

.item {
  display: grid; grid-template-columns: 4.6rem 2rem 1fr auto; gap: .7rem; align-items: start;
  padding: .55rem 1rem; cursor: pointer; border: 0; background: transparent; width: 100%; text-align: left;
}
.item:hover { background: var(--surface-2); }
.item .when { font-family: var(--f-mono); font-size: .82rem; line-height: 1.35; padding-top: .15rem; font-variant-numeric: tabular-nums; }
.item .when .t2 { color: var(--ink-3); display: block; }
.item .when .any { color: var(--ink-3); font-size: .72rem; }
.kchip {
  width: 2rem; height: 2rem; border-radius: 7px; display: grid; place-items: center;
  font-family: var(--f-display); font-weight: 800; font-size: 1rem;
  background: var(--surface-2); color: var(--ink-2);
}
.kchip.butt { background: var(--butt-soft); color: var(--butt-ink); }
.kchip.wai { background: var(--wai-soft); color: var(--wai-ink); }
.kchip.both { background: var(--both-soft); color: var(--both-ink); }
.kchip.transport { border-radius: 50%; }
.item .title { font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.item .route { font-family: var(--f-mono); font-size: .82rem; color: var(--ink-2); }
.item .meta { font-size: .82rem; color: var(--ink-2); overflow-wrap: anywhere; }
.item .side { display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; }
.item .ccount { font-size: .75rem; color: var(--ink-3); }
@media (max-width: 480px) { .item { grid-template-columns: 3.6rem 1.8rem 1fr; } .item .side { grid-column: 3; flex-direction: row; align-items: center; justify-content: flex-start; } }

.quick { display: flex; gap: .5rem; padding: .4rem 1rem .8rem; }
.quick input { flex: 1; min-width: 0; border: 1px dashed var(--line); background: transparent; border-radius: 8px; padding: .45em .7em; font-size: .9rem; }
.quick input:focus { outline: none; border-style: solid; border-color: var(--butt); background: var(--surface); }
.day-notes { padding: 0 1rem .7rem; font-size: .88rem; color: var(--ink-2); white-space: pre-wrap; }

/* ---------- stacked timeline calendar ---------- */
.cal-toolbar { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.legend { display: flex; gap: .9rem; flex-wrap: wrap; font-size: .82rem; color: var(--ink-2); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: .35em; }
.scroll-x { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.tl { min-width: 980px; }
.tl-head, .tl-day { display: grid; grid-template-columns: 190px 1fr; }
.tl-head { position: sticky; top: 0; background: var(--surface); z-index: 2; border-bottom: 1px solid var(--line); }
.tl-hours { position: relative; height: 28px; }
.tl-hours span { position: absolute; top: 6px; transform: translateX(-50%); font-family: var(--f-mono); font-size: .72rem; color: var(--ink-3); }
.tl-day { border-bottom: 1px solid var(--line); }
.tl-day:last-child { border-bottom: 0; }
.tl-day.weekend .tl-label { background: var(--surface-2); }
.tl-label { padding: .5rem .75rem; border-right: 1px solid var(--line); display: grid; gap: .1rem; align-content: start; }
.tl-label .d { font-family: var(--f-display); font-weight: 700; }
.tl-label .d a { color: inherit; text-decoration: none; }
.tl-label .d a:hover { text-decoration: underline; }
.tl-label .n { font-family: var(--f-mono); font-size: .7rem; color: var(--ink-3); }
.tl-lanes { display: grid; }
.tl-lane { position: relative; border-top: 1px dashed var(--line); cursor: copy;
  background-image: repeating-linear-gradient(to right, transparent 0, transparent calc(100% / 18 - 1px), color-mix(in srgb, var(--line) 60%, transparent) calc(100% / 18 - 1px), color-mix(in srgb, var(--line) 60%, transparent) calc(100% / 18));
}
.tl-lane:first-child { border-top: 0; }
.tl-lane .lane-tag { position: absolute; left: 4px; top: 50%; transform: translateY(-50%); font-size: .6rem; font-weight: 700; letter-spacing: .08em; pointer-events: none; opacity: .7; }
.tl-lane.butt .lane-tag { color: var(--butt); }
.tl-lane.wai .lane-tag { color: var(--wai); }
.tl-label .stay { font-size: .72rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-label .stay.missing { color: var(--warn); }
.tl-label .stay b { font-family: var(--f-display); }
.tl-label .stay.butt b { color: var(--butt); }
.tl-label .stay.wai b { color: var(--wai); }
.blk {
  position: absolute; height: 22px; border-radius: 5px; padding: 0 6px; font-size: .74rem; line-height: 22px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; border: 0; text-align: left;
  font-weight: 500; min-width: 6px;
}
.blk.butt { background: var(--butt); color: #fff; }
.blk.wai { background: var(--wai); color: #fff; }
.blk.both { background: var(--both); color: #fff; }
@media (prefers-color-scheme: dark) { .blk.butt, .blk.wai, .blk.both { color: #0F141B; } }
.blk.idea { opacity: .6; background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.18) 0 4px, transparent 4px 8px); }
.blk.transport { border-radius: 11px; }
.blk:hover { filter: brightness(1.08); z-index: 3; }
.blk .k { font-family: var(--f-display); font-weight: 800; margin-right: .3em; }
.anytime { font-size: .68rem; color: var(--ink-3); }

/* month grid */
.month { min-width: 900px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.month .wd { padding: .4rem .6rem; font-size: .72rem; font-weight: 700; letter-spacing: .1em; color: var(--ink-3); text-transform: uppercase; border-bottom: 1px solid var(--line); }
.mcell { min-height: 150px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; grid-template-rows: auto 1fr auto 1fr; font-size: .75rem; cursor: pointer; }
.mcell:nth-child(7n) { border-right: 0; }
.mcell.out { background: var(--surface-2); cursor: default; opacity: .55; }
.mcell:not(.out):hover { background: color-mix(in srgb, var(--surface-2) 50%, transparent); }
.mcell .md { padding: .3rem .5rem; font-family: var(--f-mono); font-weight: 500; display: flex; justify-content: space-between; }
.mcell .half { padding: .15rem .4rem; display: grid; gap: 2px; align-content: start; }
.mcell .half.butt { border-left: 3px solid var(--butt); }
.mcell .half.wai { border-left: 3px solid var(--wai); }
.mcell .jband { padding: .1rem .4rem; background: var(--both-soft); color: var(--both-ink); display: grid; gap: 1px; }
.mcell .mi { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mcell .mi .t { color: var(--ink-3); margin-right: .25em; }
.mcell .more { color: var(--ink-3); }

/* ---------- day planner ---------- */
.datestrip { display: flex; gap: .35rem; overflow-x: auto; padding-bottom: .5rem; margin-bottom: 1rem; scrollbar-width: thin; }
.datestrip a {
  flex: none; text-decoration: none; color: var(--ink-2); border: 1px solid var(--line); background: var(--surface);
  border-radius: 8px; padding: .35rem .55rem; text-align: center; min-width: 3.4rem; display: grid; gap: .1rem;
}
.datestrip a .w { font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; }
.datestrip a .dd { font-family: var(--f-mono); font-weight: 500; color: var(--ink); }
.datestrip a .dots { display: flex; gap: 3px; justify-content: center; height: 6px; }
.datestrip a .dots i { width: 6px; height: 6px; border-radius: 50%; }
.datestrip a[aria-current="date"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.datestrip a[aria-current="date"] .dd { color: var(--bg); }
.dots i.butt { background: var(--butt); } .dots i.wai { background: var(--wai); } .dots i.both { background: var(--both); }

.dayplan-head { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .75rem; }
.dayplan-head h1 { font-size: 1.6rem; }
.freebar { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-bottom: 1rem; font-size: .85rem; }
.freebar .chip { background: var(--free-soft); color: var(--free); border-radius: 6px; padding: .15em .55em; font-family: var(--f-mono); font-weight: 500; cursor: pointer; border: 0; }
.dp-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1rem; align-items: start; }
@media (max-width: 980px) { .dp-wrap { grid-template-columns: 1fr; } }
.dp { display: grid; grid-template-columns: 3.2rem 1fr 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.dp-colhead { padding: .6rem .75rem; border-bottom: 1px solid var(--line); display: grid; gap: .25rem; }
.dp-colhead.butt { box-shadow: inset 0 3px 0 var(--butt); }
.dp-colhead.wai { box-shadow: inset 0 3px 0 var(--wai); border-left: 1px solid var(--line); }
.dp-colhead .fn { font-family: var(--f-display); font-weight: 800; letter-spacing: .05em; }
.dp-colhead.butt .fn { color: var(--butt); } .dp-colhead.wai .fn { color: var(--wai); }
.dp-anytime { padding: .3rem .5rem; border-bottom: 1px solid var(--line); display: grid; gap: .25rem; min-height: 2rem; }
.dp-anytime.wai { border-left: 1px solid var(--line); }
.dp-anytime .blk2 { position: static; }
.dp-gutter { position: relative; border-right: 1px solid var(--line); }
.dp-gutter span { position: absolute; right: 6px; transform: translateY(-50%); font-family: var(--f-mono); font-size: .7rem; color: var(--ink-3); }
.dp-col { position: relative; cursor: copy;
  background-image: repeating-linear-gradient(to bottom, color-mix(in srgb, var(--line) 70%, transparent) 0 1px, transparent 1px var(--hour));
}
.dp-col.wai { border-left: 1px solid var(--line); }
.dp-free { position: absolute; left: 0; right: 0; background: var(--free-soft); opacity: .7; pointer-events: none; }
.blk2 {
  position: absolute; border-radius: 7px; padding: .25rem .45rem; font-size: .78rem; line-height: 1.25; overflow: hidden;
  cursor: pointer; border: 0; text-align: left; display: block; box-shadow: 0 1px 0 rgba(0,0,0,.08);
}
.blk2.butt { background: var(--butt-soft); color: var(--butt-ink); border-left: 3px solid var(--butt); }
.blk2.wai { background: var(--wai-soft); color: var(--wai-ink); border-left: 3px solid var(--wai); }
.blk2.both { background: var(--both-soft); color: var(--both-ink); border-left: 3px solid var(--both); }
.blk2.idea { border-left-style: dashed; opacity: .8; }
.blk2 .bt { font-weight: 700; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blk2 .bm { font-family: var(--f-mono); font-size: .7rem; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.blk2:hover { filter: brightness(.97); z-index: 3; }
.nowline { position: absolute; left: 0; right: 0; height: 2px; background: var(--hinomaru); pointer-events: none; z-index: 4; }
.side-stack { display: grid; gap: 1rem; }
.side-stack textarea { width: 100%; min-height: 6em; border: 1px solid var(--line); border-radius: 8px; padding: .5em .65em; background: var(--surface); resize: vertical; }
.side-stack label .tag { margin-bottom: .3rem; }

/* ---------- stays ---------- */
.coverage { display: grid; gap: .6rem; }
.cov-row { display: grid; grid-template-columns: 70px 1fr; gap: .5rem; align-items: center; }
.cov-row .who { font-family: var(--f-display); font-weight: 800; font-size: .9rem; }
.cov-row .who.butt { color: var(--butt); } .cov-row .who.wai { color: var(--wai); }
.cov-nights { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; }
.cov-nights button {
  height: 34px; border: 0; border-radius: 4px; cursor: pointer; font-size: .64rem; color: #fff; padding: 0 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700;
}
.cov-nights button.gap { background: repeating-linear-gradient(45deg, var(--warn-soft) 0 5px, transparent 5px 10px); color: var(--warn); border: 1px solid var(--warn); }
.cov-nights button.clash { outline: 2px solid var(--danger); outline-offset: -2px; }
.cov-dates { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; font-family: var(--f-mono); font-size: .62rem; color: var(--ink-3); text-align: center; }
.cov-scroll { overflow-x: auto; }
.cov-inner { min-width: 620px; display: grid; gap: .5rem; }
.stay-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: .9rem; }
.stay-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; display: grid; gap: .45rem; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.stay-card:hover { border-color: var(--ink-3); }
.stay-card .nm { font-family: var(--f-display); font-weight: 700; font-size: 1.1rem; }
.stay-card .dates { font-family: var(--f-mono); font-size: .82rem; }
.stay-card .top { display: flex; justify-content: space-between; gap: .5rem; align-items: center; }

/* ---------- ideas ---------- */
.idea-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .9rem; }
.idea { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem; display: grid; gap: .5rem; align-content: start; }
.idea.keen-both { border-color: var(--both); box-shadow: 0 0 0 1px var(--both); }
.idea .top { display: flex; gap: .6rem; align-items: center; }
.idea .title { font-weight: 700; }
.keen { display: flex; gap: .4rem; flex-wrap: wrap; }
.keen button { border: 1px solid var(--line); background: transparent; border-radius: 99px; padding: .2em .7em; cursor: pointer; font-size: .78rem; font-weight: 700; color: var(--ink-3); }
.keen button.on.butt { background: var(--butt); border-color: var(--butt); color: #fff; }
.keen button.on.wai { background: var(--wai); border-color: var(--wai); color: #fff; }
@media (prefers-color-scheme: dark) { .keen button.on { color: #0F141B !important; } }

/* ---------- checklist ---------- */
.todo-group h3 { margin-bottom: .4rem; }
.todo { display: grid; grid-template-columns: auto 1fr auto; gap: .7rem; align-items: center; padding: .45rem .2rem; border-bottom: 1px solid var(--line); }
.todo:last-child { border-bottom: 0; }
.todo input[type="checkbox"] { width: 1.15rem; height: 1.15rem; accent-color: var(--free); }
.todo.done .tx { text-decoration: line-through; color: var(--ink-3); }
.todo .tx { overflow-wrap: anywhere; }
.todo .sub { font-size: .75rem; color: var(--ink-3); }
.todo .acts { display: flex; gap: .3rem; align-items: center; }
.progress { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--free); }

/* ---------- info ---------- */
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
@media (max-width: 860px) { .info-grid { grid-template-columns: 1fr; } }
table.budget { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.budget th, table.budget td { padding: .45rem .5rem; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
table.budget th:first-child, table.budget td:first-child { text-align: left; }
table.budget thead th { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
table.budget tfoot td { font-weight: 700; border-bottom: 0; }
table.budget .sub { display: block; font-size: .72rem; color: var(--ink-3); font-family: var(--f-mono); }
.copyrow { display: flex; gap: .4rem; align-items: center; }
.copyrow input { flex: 1; min-width: 0; font-family: var(--f-mono); font-size: .75rem; }
.facts { margin: 0; padding-left: 1.1rem; display: grid; gap: .45rem; font-size: .9rem; }
.feed { display: grid; gap: .5rem; font-size: .85rem; max-height: 420px; overflow: auto; }
.feed .when { font-family: var(--f-mono); font-size: .72rem; color: var(--ink-3); }
.phone { font-family: var(--f-mono); font-weight: 500; }

/* ---------- modal ---------- */
.modal { border: 0; padding: 0; border-radius: 14px; width: min(680px, calc(100vw - 24px)); max-height: calc(100vh - 32px); background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.modal::backdrop { background: rgba(10, 15, 25, .45); backdrop-filter: blur(2px); }
.modal form { display: grid; gap: .9rem; padding: 1.2rem 1.3rem 1.3rem; }
.modal .mhead { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.modal .mfoot { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: .9rem; }
.modal .mfoot .right { display: flex; gap: .5rem; margin-left: auto; flex-wrap: wrap; }
.typegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .35rem; }
.typegrid button { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: .35rem .45rem; cursor: pointer; display: flex; align-items: center; gap: .4rem; font-size: .8rem; text-align: left; }
.typegrid button .k { font-family: var(--f-display); font-weight: 800; width: 1.4rem; text-align: center; }
.typegrid button[aria-pressed="true"] { border-color: var(--ink); background: var(--surface-2); font-weight: 700; }
.transport-fields { display: grid; gap: .75rem; padding: .8rem; background: var(--surface-2); border-radius: 10px; }
.comments { display: grid; gap: .5rem; border-top: 1px solid var(--line); padding-top: .9rem; }
.comment { font-size: .88rem; display: grid; gap: .1rem; }
.comment .by { font-weight: 700; font-size: .78rem; }
.comment .by .when { font-weight: 400; color: var(--ink-3); font-family: var(--f-mono); margin-left: .4em; }
.confirm-inline { display: flex; gap: .4rem; align-items: center; font-size: .85rem; color: var(--danger); }
.hint { font-size: .78rem; color: var(--ink-3); }
.maplink { font-size: .8rem; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg); padding: .6rem 1rem; border-radius: 10px; font-size: .9rem; opacity: 0; pointer-events: none; transition: all .2s ease; z-index: 50; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.idea-add { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.idea-add input { flex: 3 1 260px; min-width: 0; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: .75em .9em; font-size: 1rem; }
.idea-add input + input { flex: 1 1 180px; font-size: .9rem; }
.idea-add input:focus { outline: none; border-color: var(--butt); box-shadow: 0 0 0 3px var(--butt-soft); }
.idea-add .btn { padding-inline: 1.3em; }

/* ---------- areas & meet-ups ---------- */
.idea-add .area-in { flex: 0 1 150px; font-weight: 700; }
.area-chips { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.area-chips button, .city-chip { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: .3em .85em; cursor: pointer; font-size: .85rem; }
.area-chips button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.area-chips button[aria-pressed="true"] .muted { color: inherit; opacity: .7; }
.city-chip { background: var(--free-soft); border-color: transparent; color: var(--free); font-family: var(--f-mono); font-size: .8rem; }
.city-chip b { font-family: var(--f-body); margin-right: .3em; }
.area-group { margin-bottom: 1.75rem; }
.area-head { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; margin-bottom: .7rem; font-size: 1.35rem; }
.area-when { font-family: var(--f-mono); font-size: .75rem; font-weight: 400; display: inline-flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.inv-note { font-size: .8rem; color: var(--both-ink); background: var(--both-soft); padding: .3em .6em; border-radius: 6px; text-decoration: none; }
.inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: .9rem; }
@media (max-width: 400px) { .inv-grid { grid-template-columns: 1fr; } }
.inv { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; display: grid; gap: .5rem; align-content: start; }
.inv.respond { border-color: var(--both); box-shadow: 0 0 0 1px var(--both); }
.inv.declined { opacity: .75; }
.inv-top { display: flex; gap: .6rem; align-items: center; }
.inv .title { font-weight: 700; }
.inv-when { font-family: var(--f-display); font-weight: 700; font-size: 1.15rem; }
.inv-ctx { color: var(--free); }
.inv-hist { margin: 0; padding: .5rem 0 0; list-style: none; border-top: 1px solid var(--line); display: grid; gap: .3rem; font-size: .8rem; color: var(--ink-2); }
.inv-acts { gap: .4rem; }
.badge { display: inline-grid; place-items: center; min-width: 1.25rem; height: 1.25rem; padding: 0 .3rem; margin-left: .35rem; border-radius: 99px; background: var(--hinomaru); color: #fff; font-size: .7rem; font-weight: 700; }
.alert-banner { display: block; margin-bottom: 1rem; padding: .7rem 1rem; border-radius: var(--radius); background: var(--both-soft); color: var(--both-ink); text-decoration: none; border: 1px solid var(--both); }
.alert-banner:hover { filter: brightness(1.03); }
