/* Aima client. Calm white surfaces, hairlines and warm-grey fills; colour carries meaning:
   cobalt = actions and time you placed · periwinkle = soft/shared time · tangerine = a confirmed plan.
   One type scale, one spacing rhythm, no pure-black surfaces. Layout: bottom tabs on phones, a
   left rail from 960 px. Motion only on navigation and on opening a dialog, never on re-render. */

:root {
  --bg: #FFFFFF; --bg-2: #F5F5F3; --bg-3: #ECECE8; --canvas: #F8F8F6;
  --ink: #22252E; --text: #2A2D36; --muted: #626672; --faint: #9A9DA6;
  --line: #E8E8E4; --line-2: #D5D5D0;
  --cobalt: #2342F0; --cobalt-deep: #1A33C4; --cobalt-ink: #1B2A96; --cobalt-tint: #EEF0FE; --cobalt-soft: rgba(35, 66, 240, 0.07);
  --periwinkle: #7C8CFF; --peri-tint: #F2F3FF;
  --tangerine: #FF8A1F; --tangerine-tint: #FFF2E6; --tangerine-line: #FFD3AB; --tangerine-ink: #873A00;
  --danger: #C2281B; --danger-tint: #FCEDEB;
  --night: #1E2442;
  --font: "Yu Gothic", "YuGothic", "游ゴシック体", "游ゴシック", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, system-ui, sans-serif;
  --t-xs: 11px; --t-s: 12.5px; --t-m: 14px; --t-b: 15px; --t-l: 17px; --t-xl: 20px; --t-2xl: 24px;
  --r-s: 8px; --r-m: 12px; --r-l: 18px;
  --gutter: 16px;
  --hour: 20px; /* week calendar: pixels per hour (keep in sync with features.js) */
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --shadow-pop: 0 24px 56px -24px rgba(24, 28, 52, 0.42);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); font-size: var(--t-m); line-height: 1.6; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; font-feature-settings: "palt"; letter-spacing: 0.035em;
}
button, input, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
svg { display: block; }
hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }

/* ---------- shell ---------- */
.stage { min-height: calc(100% - var(--dev-bar, 0px)); }
.phone { height: calc(100dvh - var(--dev-bar, 0px)); background: var(--bg); }
.app {
  position: relative; height: 100%; overflow: hidden; background: var(--bg);
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "top" "main" "nav";
}
.topbar { grid-area: top; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 52px; padding: max(6px, env(safe-area-inset-top)) 12px 2px; }
.screen { grid-area: main; position: relative; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scroll-padding-bottom: 96px; }
.tabbar { grid-area: nav; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); background: var(--bg); padding-bottom: env(safe-area-inset-bottom); }
.tabbar[hidden] { display: none; }

.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: var(--t-b); letter-spacing: 0.04em; padding-left: 4px; color: var(--ink); }
.brand svg, .rail-brand svg { width: 26px; height: 16px; }
.top-name { display: inline-flex; align-items: center; gap: 7px; min-width: 0; max-width: 55%; font-size: var(--t-s); color: var(--muted); }
.top-name span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.back-btn { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding: 0 12px 0 4px; border: 0; background: none; border-radius: 10px; color: var(--cobalt); font-weight: 600; }
.back-btn svg { width: 20px; height: 20px; }
.back-btn:hover { background: var(--cobalt-tint); }

.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 56px; border: 0; background: none; color: var(--muted); font-size: var(--t-xs); font-weight: 600; line-height: 1.2; letter-spacing: 0.04em; }
.tab svg { width: 22px; height: 22px; }
.tab.is-on { color: var(--cobalt); }
.tab:hover:not(.is-on) { color: var(--ink); }
.tab-icon { position: relative; }
.tab-dot { position: absolute; top: -2px; right: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--tangerine); box-shadow: 0 0 0 2px var(--bg); }
.rail-brand { display: none; }

/* Screen content: a readable centred column; wide screens override per view. */
.screen-inner { --content-w: 640px; display: flex; flex-direction: column; gap: 20px; width: 100%; max-width: var(--content-w); min-height: 100%; margin: 0 auto; padding: 8px var(--gutter) 28px; }
.screen.is-entering .screen-inner { animation: enter .22s var(--ease-out) both; }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (min-width: 960px) {
  .app { grid-template-columns: 236px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "nav top" "nav main"; }
  .topbar { min-height: 60px; padding: 8px 28px 0; }
  .topbar .brand { display: none; }
  .top-name { margin-left: auto; }
  /* Detail screens: the back button lines up with the centred content column below it. */
  .app.is-detail .topbar { justify-self: center; width: 100%; max-width: 640px; }
  .app[data-view="chat"] .topbar { max-width: 720px; }
  .tabbar { display: flex; flex-direction: column; gap: 2px; padding: 20px 14px; border-top: 0; border-right: 1px solid var(--line); background: var(--canvas); }
  .rail-brand { display: flex; align-items: center; gap: 9px; padding: 4px 12px 22px; font-weight: 700; font-size: var(--t-l); letter-spacing: 0.04em; color: var(--ink); }
  .tab { flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 10px; font-size: var(--t-m); letter-spacing: 0.02em; }
  .tab svg { width: 20px; height: 20px; }
  .tab.is-on { background: var(--bg); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
  .tab.is-on svg { color: var(--cobalt); }
  .screen-inner { --gutter: 28px; padding-top: 4px; }
}

/* ---------- type ---------- */
.h-title { font-size: var(--t-xl); line-height: 1.35; font-weight: 700; color: var(--ink); letter-spacing: 0.03em; }
.h-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.h-section { display: flex; align-items: baseline; gap: 6px; font-size: var(--t-s); font-weight: 700; color: var(--muted); letter-spacing: 0.06em; }
.h-section .n { font-weight: 600; color: var(--faint); font-variant-numeric: tabular-nums; }
.section { display: flex; flex-direction: column; gap: 8px; }
.hint { font-size: var(--t-s); color: var(--muted); line-height: 1.6; }
.empty-line { font-size: var(--t-m); color: var(--muted); padding: 6px 0; }
.privacy-line { display: flex; align-items: center; gap: 7px; font-size: var(--t-s); color: var(--muted); }
.privacy-line svg { width: 14px; height: 14px; flex: none; color: var(--faint); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 48px; padding: 0 18px; border-radius: var(--r-m); border: 1px solid transparent; font-weight: 700; font-size: var(--t-b); line-height: 1.3; text-align: center; text-decoration: none; transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .12s ease; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:active:not(:disabled) { transform: scale(0.985); }
.btn:disabled { opacity: 0.42; cursor: not-allowed; }
.btn.primary { background: var(--cobalt); color: #fff; box-shadow: 0 6px 16px -10px rgba(35, 66, 240, .8); }
.btn.primary:hover:not(:disabled) { background: var(--cobalt-deep); }
.btn.primary:disabled { background: var(--bg-3); color: var(--muted); box-shadow: none; opacity: 1; }
.btn.secondary { background: var(--bg); color: var(--ink); border-color: var(--line-2); }
.btn.secondary:hover:not(:disabled) { border-color: var(--ink); }
.btn.quiet { background: transparent; color: var(--muted); }
.btn.quiet:hover { color: var(--ink); background: var(--bg-2); }
.btn.quiet-danger { background: transparent; color: var(--danger); min-height: 44px; font-size: var(--t-m); }
.btn.quiet-danger:hover { background: var(--danger-tint); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger:hover:not(:disabled) { background: #A82217; }
.btn-inline { display: inline-flex; align-items: center; justify-content: center; gap: 5px; flex: none; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--bg); color: var(--ink); font-weight: 600; font-size: var(--t-s); white-space: nowrap; transition: border-color .15s ease, background-color .15s ease; }
.btn-inline svg { width: 15px; height: 15px; }
.btn-inline:hover:not(:disabled) { border-color: var(--ink); }
.btn-inline:disabled { opacity: 0.42; cursor: not-allowed; }
.btn-inline.is-quiet { border-color: transparent; background: none; color: var(--cobalt); padding: 0 8px; border-radius: 8px; }
.btn-inline.is-quiet:hover:not(:disabled) { background: var(--cobalt-tint); }
.btn-inline.is-accent { border-color: transparent; background: var(--cobalt-tint); color: var(--cobalt-ink); }
.btn-inline.is-accent:hover:not(:disabled) { border-color: var(--cobalt); }
.btn-inline.is-danger { color: var(--danger); }
.btn-inline.is-danger:hover:not(:disabled) { border-color: var(--danger); }
.btn-inline.is-muted { border-color: transparent; background: none; color: var(--muted); }
.btn-inline.is-muted:hover:not(:disabled) { color: var(--ink); background: var(--bg-2); }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 10px; background: none; color: var(--muted); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover:not(:disabled) { background: var(--bg-2); color: var(--ink); }
.icon-btn:disabled { opacity: .35; }
.stack-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Docked action bar at the bottom of a scrolling screen. Solid, so it never tints content, and
   the screen's scroll padding lets every item scroll fully above it. */
.sticky-cta, .modes { position: sticky; bottom: 0; z-index: 3; display: grid; gap: 8px; margin: auto calc(var(--gutter) * -1) -28px; padding: 12px var(--gutter) max(14px, env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); }
.app:not(.is-detail) .sticky-cta, .app:not(.is-detail) .modes { padding-bottom: 12px; }
.sticky-cta.stack-2 { grid-template-columns: 1fr 1fr; }
.sticky-cta .hint { text-align: center; }

/* ---------- gates (login, register) ---------- */
.gate { display: grid; gap: 14px; align-content: center; justify-items: start; width: 100%; max-width: 420px; min-height: 100%; margin: 0 auto; padding: 32px 24px 48px; }
.gate-mark svg { width: 52px; height: 32px; margin-bottom: 6px; }
.gate p { color: var(--muted); font-size: var(--t-m); }
.gate .field, .gate .btn { width: 100%; }
.gate .btn { margin-top: 4px; }

/* ---------- Home ---------- */
.screen-inner.is-home { gap: 18px; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; min-width: 0; }
@media (min-width: 1100px) {
  .screen-inner.is-home { --content-w: 1160px; }
  .home-grid { grid-template-columns: minmax(0, 1.45fr) minmax(300px, 1fr); align-items: start; gap: 28px; }
}
/* Flex row: a shrinkable text column and a fixed icon, so the title always keeps the full width
   (a grid with auto-placed spans once squeezed it into a one-character vertical column). */
.reveal-card { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 14px 14px 16px; text-align: left; border: 0; border-radius: var(--r-m); background: var(--night); color: #fff; }
.reveal-card-mark { flex: none; width: 34px; height: 22px; }
.reveal-card-text { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.reveal-card > svg:last-child { flex: none; width: 18px; height: 18px; color: rgba(255,255,255,.7); }
.reveal-card-title { font-weight: 700; font-size: var(--t-m); line-height: 1.5; }
.reveal-card-sub { font-size: var(--t-s); color: #FFC894; overflow-wrap: anywhere; }
.reveal-card:hover { background: #262D52; }
.saved-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-m); background: var(--cobalt-tint); color: var(--cobalt-ink); animation: enter .3s var(--ease-out) both; }
.saved-note svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.saved-note div { display: grid; }
.saved-note strong { font-size: var(--t-m); }
.saved-note span { font-size: var(--t-s); opacity: .85; }
.older-row { display: flex; justify-content: center; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.days-list { display: grid; }
.day-row { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.day-row:last-child { border-bottom: 1px solid var(--line); }
.day-row-date { display: grid; align-content: start; line-height: 1.25; font-variant-numeric: tabular-nums; padding-top: 2px; }
.day-row-date strong { font-size: var(--t-b); font-weight: 700; color: var(--ink); }
.day-row-date span { font-size: var(--t-s); color: var(--muted); }
.day-row-date.is-weekend span { color: var(--cobalt); font-weight: 600; }
.day-row-body { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; max-width: 100%; padding: 4px 12px 4px 10px; border-radius: var(--r-s); font-size: var(--t-s); font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.35; border: 0; text-align: left; }
.chip > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-tag { flex: none; font-size: var(--t-xs); font-weight: 700; letter-spacing: .04em; }
.chip.is-wait { background: var(--cobalt-soft); box-shadow: inset 3px 0 0 var(--cobalt); color: var(--cobalt-ink); }
.chip.is-wait:hover { background: var(--cobalt-tint); }
.chip.is-draft { background: var(--bg); box-shadow: inset 0 0 0 1px var(--cobalt); color: var(--cobalt-ink); padding: 0 2px 0 0; background-image: repeating-linear-gradient(135deg, transparent 0 6px, var(--cobalt-soft) 6px 7px); }
.chip.is-draft .chip-tag { color: var(--cobalt); }
.chip.is-paused { background: var(--bg-2); color: var(--muted); }
.chip.is-paused:hover { background: var(--bg-3); }
.chip.is-plan { background: var(--tangerine-tint); box-shadow: inset 3px 0 0 var(--tangerine); color: var(--tangerine-ink); }
.chip.is-plan:hover { background: #FFE8D2; }
.chip-label { display: inline-flex; align-items: center; gap: 8px; min-width: 0; min-height: 34px; padding: 4px 4px 4px 10px; border: 0; background: none; color: inherit; font: inherit; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.chip-x { position: relative; display: grid; place-items: center; flex: none; width: 30px; height: 30px; border: 0; border-radius: 6px; background: none; color: inherit; }
.chip-x svg { width: 13px; height: 13px; }
.chip-x:hover { background: var(--cobalt-tint); }
.free-line { font-size: var(--t-s); font-weight: 600; color: var(--cobalt-ink); font-variant-numeric: tabular-nums; padding-left: 2px; }
.free-line.is-none { color: var(--muted); font-weight: 500; }
.modes { grid-template-columns: minmax(0, 1fr); }
.modes.has-draft { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
.modes .btn { padding: 0 12px; white-space: nowrap; }
.mode { justify-content: flex-start; text-align: left; }
.mode-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mode-count { flex: none; display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: rgba(255,255,255,.2); font-size: var(--t-s); font-variant-numeric: tabular-nums; }
.mode > svg { margin-left: auto; opacity: .75; }
@media (min-width: 1100px) { .modes, .modes.has-draft { grid-template-columns: repeat(auto-fit, minmax(0, 260px)); justify-content: end; } }

/* ---------- calendar (Home) ---------- */
.calendar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; min-width: 0; }
.calendar-top { display: flex; align-items: center; gap: 2px; }
.calendar-top h2 { flex: 1; min-width: 0; padding: 0 4px; font-size: var(--t-b); font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.calendar-top .icon-btn { width: 36px; height: 36px; }
.calendar-toggle { display: flex; padding: 3px; margin-left: 6px; background: var(--bg-2); border-radius: 10px; }
.calendar-toggle button { min-width: 40px; min-height: 30px; background: none; border: 0; padding: 0 10px; border-radius: 7px; font-size: var(--t-s); font-weight: 600; color: var(--muted); }
.calendar-toggle [aria-pressed="true"] { background: var(--bg); color: var(--ink); box-shadow: 0 1px 3px rgba(34, 37, 46, .1); }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.month-weekday { text-align: center; font-size: var(--t-xs); color: var(--muted); padding: 2px 0; }
.month-day { display: grid; align-content: center; justify-items: center; gap: 4px; min-width: 0; min-height: 50px; padding: 6px 1px; border: 0; border-radius: 10px; background: var(--bg-2); font-size: var(--t-m); font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); transition: background-color .15s ease; }
.month-day:hover:not(:disabled) { background: var(--bg-3); }
.month-day.is-today > span:first-child { display: inline-grid; place-items: center; min-width: 26px; height: 26px; margin: -3px 0; border-radius: 999px; background: var(--cobalt); color: #fff; }
.month-day.outside { background: none; color: var(--faint); font-weight: 500; }
.month-day:disabled { cursor: default; color: var(--faint); }
.calendar-dots { display: flex; gap: 3px; min-height: 6px; }
.calendar-dots i, .calendar-legend i { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.dot-busy { background: #A1A4AF; } .dot-soft { background: var(--periwinkle); } .dot-want, .dot-draft { background: var(--cobalt); } .dot-plan { background: var(--tangerine); } .dot-paused { background: #BCC1CB; }
.calendar-legend { display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; font-size: var(--t-xs); color: var(--muted); }
.calendar-legend span { display: inline-flex; align-items: center; gap: 5px; }
.calendar-legend .btn-inline { margin-left: auto; min-height: 32px; }
.calendar-connection { font-size: var(--t-xs); color: var(--muted); margin-top: -4px; }
.week-scroll { max-width: 100%; }
.week-grid { display: grid; grid-template-columns: 28px repeat(7, minmax(0, 1fr)); }
.calendar-hours { position: relative; font-size: 10px; color: var(--faint); font-variant-numeric: tabular-nums; }
.calendar-hours > span { position: absolute; left: 0; transform: translateY(-50%); }
.calendar-hours .week-head { visibility: hidden; }
.week-day { min-width: 0; padding: 0 1px; }
.week-head { display: grid; justify-items: center; align-content: center; gap: 0; width: 100%; height: 44px; border: 0; border-radius: 8px; background: none; line-height: 1.15; font-variant-numeric: tabular-nums; }
.week-head span { font-size: var(--t-xs); color: var(--muted); }
.week-head b { font-size: var(--t-m); color: var(--ink); }
.week-head:hover:not(:disabled) { background: var(--bg-2); }
.week-head.is-today b { display: inline-grid; place-items: center; min-width: 24px; height: 24px; border-radius: 999px; background: var(--cobalt); color: #fff; }
.week-head.is-today span { color: var(--cobalt); font-weight: 700; }
.week-head:disabled { cursor: default; }
.week-head:disabled b, .week-head:disabled span { color: var(--faint); }
.week-track { height: calc(var(--hour) * 17); position: relative; border-radius: 6px; background: repeating-linear-gradient(to bottom, var(--bg-2) 0, var(--bg-2) calc(var(--hour) * 2 - 1px), var(--line) calc(var(--hour) * 2 - 1px), var(--line) calc(var(--hour) * 2)); }
.calendar-event { position: absolute; left: 1px; right: 1px; width: calc(100% - 2px); border: 0; border-radius: 5px; padding: 2px 4px; text-align: left; overflow: hidden; line-height: 1.25; font-size: 10px; font-weight: 600; z-index: 1; transition: filter .15s ease; }
.calendar-event:hover:not(:disabled) { filter: brightness(.96); }
.calendar-event:disabled { cursor: default; }
.calendar-event span { display: block; overflow: hidden; text-overflow: clip; white-space: nowrap; }
.calendar-event small { display: block; font-size: 9.5px; font-weight: 500; white-space: nowrap; overflow: hidden; font-variant-numeric: tabular-nums; }
.calendar-event.is-short small { display: none; }
.ev-busy { background: #E3E4E9; color: #555966; }
.ev-soft { background: var(--cobalt-tint); color: var(--cobalt-ink); }
.ev-want { background: var(--cobalt); color: #fff; }
.ev-draft { background: var(--bg); color: var(--cobalt-ink); box-shadow: inset 0 0 0 1.5px var(--cobalt); }
.ev-paused { background: #EEF0F3; color: #676C78; }
.ev-plan { background: #FFE2C6; color: var(--tangerine-ink); box-shadow: inset 3px 0 0 var(--tangerine); z-index: 2; }
.calendar-add { position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%); z-index: 3; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--bg); color: var(--muted); font-size: 16px; line-height: 1; }
.calendar-add:hover { color: var(--cobalt); border-color: var(--cobalt); }
.calendar-add:disabled { display: none; }
@media (min-width: 600px) { :root { --hour: 24px; } .calendar-event { font-size: 11px; padding: 3px 6px; } .week-grid { grid-template-columns: 36px repeat(7, minmax(0, 1fr)); } .calendar-hours { font-size: var(--t-xs); } }

/* ---------- dialogs: bottom sheet on phones, centred card from 600 px ---------- */
.layer { position: absolute; inset: 0; z-index: 7; }
.layer:empty { display: none; }
.layer-editor { position: absolute; inset: 0; display: grid; align-items: end; justify-items: center; padding: 12px 0 0; }
.scrim { position: absolute; inset: 0; background: rgba(24, 28, 52, 0.36); animation: fade-in .2s ease both; }
.dialog { position: relative; width: 100%; max-width: 520px; max-height: 100%; overflow-y: auto; overscroll-behavior: contain; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 8px 18px max(16px, env(safe-area-inset-bottom)); border-radius: var(--r-l) var(--r-l) 0 0; background: var(--bg); box-shadow: var(--shadow-pop); animation: sheet-in .28s var(--ease-out) both; }
.dialog::before { content: ""; justify-self: center; width: 36px; height: 4px; border-radius: 999px; background: var(--line-2); }
.layer.is-static .dialog, .layer.is-static .scrim, .layer.is-static .layer-done { animation: none; }
@media (min-width: 600px) {
  .layer-editor { align-items: center; padding: 24px; }
  .dialog { max-width: 440px; padding: 18px 20px 18px; border-radius: var(--r-l); animation: pop-in .24s var(--ease-out) both; }
  .dialog::before { display: none; }
}
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.dialog-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-right: -8px; }
.dialog-top h2 { font-size: var(--t-l); line-height: 1.4; font-weight: 700; color: var(--ink); }
.dialog-lede { font-size: var(--t-m); color: var(--muted); line-height: 1.7; }
.install-steps { display: grid; gap: 6px; margin: 0; padding-left: 1.4em; font-size: var(--t-m); color: var(--ink); line-height: 1.6; }
.weather-row { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--bg-2); font-size: var(--t-m); color: var(--ink); line-height: 1.5; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.weather-row small { font-size: var(--t-xs); color: var(--muted); }
.dialog-actions { display: grid; grid-template-columns: minmax(96px, .55fr) 1fr; gap: 10px; padding-top: 2px; }
.dialog-actions .btn { padding: 0 12px; white-space: nowrap; }
.date-strip { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 6px; margin: 0 -2px; scrollbar-width: none; }
.date-strip::-webkit-scrollbar { display: none; }
.date-strip li { flex: 0 0 46px; }
.date-btn { width: 46px; min-height: 56px; display: grid; place-items: center; align-content: center; gap: 1px; border: 0; border-radius: 12px; background: var(--bg-2); color: var(--muted); line-height: 1.2; font-variant-numeric: tabular-nums; transition: background-color .15s ease; }
.date-btn span { font-size: var(--t-xs); }
.date-btn strong { font-size: var(--t-b); color: var(--ink); }
.date-btn:hover:not(:disabled) { background: var(--bg-3); }
.date-btn.is-on { background: var(--cobalt); color: rgba(255,255,255,.85); }
.date-btn.is-on strong { color: #fff; }
.date-btn:disabled { cursor: default; opacity: .45; }
.date-btn.is-on:disabled { opacity: 1; }
.he-allday { justify-self: start; margin: -6px 0 0 -8px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field-label { font-size: var(--t-s); font-weight: 700; color: var(--muted); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-inline { display: flex; align-items: flex-end; gap: 10px; }
.field-inline .field { flex: 1; }
.field-inline .btn { min-height: 46px; }
.select, .text-input { width: 100%; min-height: 46px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--bg); font-size: 16px; }
.select { appearance: none; -webkit-appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23626672' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; font-variant-numeric: tabular-nums; }
.select:disabled { background-color: var(--bg-2); color: var(--faint); }
.text-input:focus-visible, .select:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 0; border-color: var(--cobalt); }
.text-input::placeholder { color: var(--faint); }
.form-error { padding: 10px 12px; border-radius: 10px; background: var(--danger-tint); font-size: var(--t-s); font-weight: 600; color: var(--danger); line-height: 1.6; }
.form-error[hidden], .form-error:empty { display: none; }
.st-picker { display: grid; gap: 8px; padding: 12px; border-radius: var(--r-m); background: var(--bg-2); }
.st-chosen { display: flex; flex-wrap: wrap; gap: 6px; }
.st-chosen:empty { display: none; }
.st-chip { display: inline-flex; align-items: center; gap: 0; padding-left: 12px; border-radius: 999px; background: var(--cobalt); color: #fff; font-size: var(--t-s); font-weight: 700; }
.st-chip .chip-x, .st-chip .btn-inline { width: 32px; min-height: 32px; height: 32px; padding: 0; border: 0; background: none; color: #fff; border-radius: 999px; }
.st-chip .chip-x:hover, .st-chip .btn-inline:hover { background: rgba(255,255,255,.18); }
.st-list { display: grid; gap: 2px; }
.st-list:empty { display: none; }
.st-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 10px; border: 0; border-radius: 9px; background: none; text-align: left; }
.st-row:hover { background: var(--bg); }
.st-name { font-weight: 600; font-size: var(--t-m); }
.st-pref { margin-left: auto; font-size: var(--t-xs); color: var(--muted); }
.search { display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 10px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line-2); }
.search:focus-within { box-shadow: inset 0 0 0 2px var(--cobalt); }
.search svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.search-input { flex: 1; min-width: 0; min-height: 44px; border: 0; background: none; font-size: 16px; outline: none; }
.range { width: 100%; margin: 0; min-height: 32px; accent-color: var(--cobalt); }
.st-radius strong { color: var(--ink); font-variant-numeric: tabular-nums; margin: 0 2px; }
.copy-row { display: flex; gap: 8px; }
.copy-row .text-input { font-size: var(--t-s); color: var(--muted); }
.copy-row .btn-inline { min-height: 46px; border-radius: 10px; }

.layer-done { position: absolute; inset: 0; display: grid; grid-template-rows: 1fr auto; justify-items: center; padding: 24px 24px max(24px, env(safe-area-inset-bottom)); background: var(--bg); text-align: center; animation: fade-in .35s ease both; }
.done-body { align-self: center; display: grid; justify-items: center; gap: 8px; max-width: 320px; }
.done-mark { display: flex; align-items: flex-end; gap: 7px; height: 30px; margin-bottom: 20px; }
.done-mark i { display: block; width: 12px; height: 26px; border-radius: 3px; background: var(--cobalt); animation: done-place .7s var(--ease-out) calc(.2s + var(--i, 0) * .11s) both, done-rest .9s ease 1.4s both; }
@keyframes done-place { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
@keyframes done-rest { to { background: var(--cobalt-soft); box-shadow: inset 3px 0 0 var(--cobalt); } }
.done-title { font-size: var(--t-xl); font-weight: 700; line-height: 1.55; color: var(--ink); }
.done-n { font-size: 1.25em; color: var(--cobalt); }
.done-sub { font-size: var(--t-m); color: var(--muted); }
.done-close { min-width: 200px; }

/* ---------- People board ---------- */
.screen-inner.is-board { gap: 14px; }
.scope-bar { display: flex; align-items: center; gap: 8px; min-width: 0; }
.scope { flex: 1; min-width: 0; display: flex; gap: 6px; overflow-x: auto; padding: 2px; margin: -2px; scrollbar-width: none; }
.scope::-webkit-scrollbar { display: none; }
.scope-btn { flex: none; position: relative; min-height: 36px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--bg); font-weight: 600; font-size: var(--t-s); font-variant-numeric: tabular-nums; white-space: nowrap; }
.scope-btn:hover { border-color: var(--ink); }
.scope-btn[aria-pressed="true"] { background: var(--cobalt-tint); border-color: var(--cobalt); color: var(--cobalt-ink); }
.scope-btn.has-override::after { content: ""; position: absolute; top: 5px; right: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--cobalt); }
.scope-btn.is-multi[aria-pressed="true"] { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }
.scope-multi { flex: none; min-height: 36px; padding: 0 12px; border: 1px dashed var(--line-2); border-radius: 10px; background: var(--bg); font-weight: 600; font-size: var(--t-s); color: var(--muted); white-space: nowrap; }
.scope-multi[aria-pressed="true"] { border-style: solid; border-color: var(--cobalt); background: var(--cobalt-tint); color: var(--cobalt-ink); }
.scope-multi:disabled { opacity: .45; cursor: not-allowed; }
.day-note { font-size: var(--t-s); color: var(--muted); margin-top: -6px; }
.board { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; align-content: start; }
.board.is-idle { opacity: .5; pointer-events: none; }
@media (min-width: 1100px) {
  .screen-inner.is-board { --content-w: 1160px; }
  .board { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); align-items: stretch; }
  .board-list { min-height: 180px; }
}
.board-list { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 10px 10px 12px; border-radius: var(--r-m); background: var(--bg-2); box-shadow: inset 0 0 0 1px transparent; transition: background-color .15s ease, box-shadow .15s ease; }
.board-list.is-over { background: var(--cobalt-tint); box-shadow: inset 0 0 0 2px var(--cobalt); }
.board-list.is-want { background: var(--cobalt-soft); }
.board-list.is-hide { background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); }
.board-list.is-unclassified { background: var(--bg); box-shadow: inset 0 0 0 1px var(--line-2); border: 1px dashed var(--line-2); box-shadow: none; }
.board-head { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 0 8px; min-width: 0; padding: 0 4px; }
.board-label { font-size: var(--t-m); font-weight: 700; color: var(--ink); white-space: nowrap; }
.board-count { font-size: var(--t-s); font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.list-def { grid-column: 1 / -1; min-width: 0; font-size: var(--t-s); color: var(--muted); line-height: 1.5; }
.board-cards { display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; padding: 1px; }
.board-empty { font-size: var(--t-s); color: var(--muted); padding: 2px 4px; }
.board-cards:empty { display: none; }
.b-card { display: flex; align-items: center; gap: 2px; min-width: 0; max-width: 100%; padding-right: 4px; border-radius: 10px; background: var(--bg); box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(24, 28, 52, .05); transition: box-shadow .15s ease, opacity .15s ease; }
.b-card.is-changed { box-shadow: 0 0 0 2px var(--cobalt); }
.b-card.is-lifted { opacity: .3; }
.b-handle { position: relative; flex: none; display: grid; place-items: center; width: 22px; height: 40px; cursor: grab; touch-action: none; user-select: none; color: var(--line-2); }
.b-handle::before { content: ""; position: absolute; inset: -2px -2px -2px -4px; }
.b-handle span { width: 7px; height: 13px; background-image: radial-gradient(circle, currentColor 1.3px, transparent 1.5px); background-size: 3.5px 4.3px; }
.b-card:hover .b-handle { color: var(--muted); }
.person-icon { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--bg-3); color: var(--ink); font-size: var(--t-s); font-weight: 700; }
.person-icon:hover { background: var(--cobalt-tint); color: var(--cobalt-ink); }
.p-main { flex: 1; min-width: 0; display: flex; align-items: center; min-height: 40px; padding: 0 8px 0 6px; border: 0; background: none; border-radius: 8px; text-align: left; }
.p-main:hover { background: var(--bg-2); }
.p-name { font-weight: 600; font-size: var(--t-m); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-ghost { position: fixed; z-index: 1000; margin: 0; pointer-events: none; box-shadow: 0 0 0 2px var(--cobalt), 0 16px 32px -12px rgba(24, 28, 52, .45); }
.is-dragging { cursor: grabbing; }
.people-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.move-options { display: grid; gap: 8px; }
.move-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 56px; padding: 10px 14px; text-align: left; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--bg); transition: border-color .15s ease, background-color .15s ease; }
.move-opt strong { font-size: var(--t-b); color: var(--ink); }
.move-opt span { font-size: var(--t-s); color: var(--muted); }
.move-opt[aria-pressed="true"] { border-color: var(--cobalt); background: var(--cobalt-tint); }
.move-opt:hover { border-color: var(--ink); }

/* ---------- Plans ---------- */
.notice-list { display: grid; }
.notice { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; width: 100%; min-height: 48px; padding: 10px 2px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; font-size: var(--t-m); color: var(--text); }
.notice-list li:last-child .notice { border-bottom: 1px solid var(--line); }
.notice:hover { background: var(--bg-2); }
.notice.is-unread > span::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--tangerine); vertical-align: 2px; }
.notice time { color: var(--muted); font-size: var(--t-s); font-variant-numeric: tabular-nums; flex: none; }
.notice-context { display: block; color: var(--muted); font-size: var(--t-s); margin-top: 2px; }
.plan-list { display: grid; gap: 8px; }
.plan-card { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 72px; padding: 12px 14px 12px 12px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--bg); text-align: left; transition: border-color .15s ease, background-color .15s ease; }
.plan-card:hover { border-color: var(--line-2); background: var(--canvas); }
.plan-date { flex: none; display: grid; justify-items: center; align-content: center; width: 50px; height: 50px; border-radius: 10px; background: var(--tangerine-tint); color: var(--tangerine-ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.plan-date b { font-size: var(--t-xl); }
.plan-date small { font-size: var(--t-xs); font-weight: 600; }
.plan-card.is-untimed .plan-date { background: var(--cobalt-tint); color: var(--cobalt-ink); }
.plan-card.is-closed .plan-date { background: var(--bg-2); color: var(--muted); }
.plan-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.plan-what { font-size: var(--t-b); font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.plan-when { font-size: var(--t-s); font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.plan-card.is-closed .plan-what { color: var(--muted); }
.status-pill { flex: none; align-self: flex-start; padding: 3px 9px; border-radius: 999px; font-size: var(--t-xs); font-weight: 700; white-space: nowrap; background: var(--tangerine-tint); color: var(--tangerine-ink); }
.status-pill.is-untimed { background: var(--cobalt-tint); color: var(--cobalt-ink); }
.status-pill.is-closed { background: var(--bg-2); color: var(--muted); }

/* ---------- Plan detail ---------- */
.screen-inner.is-plan { gap: 22px; }
.plan-hero { display: grid; gap: 6px; }
.plan-hero-who { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.plan-hero-kicker { justify-self: start; padding: 3px 10px; border-radius: 999px; font-size: var(--t-s); font-weight: 700; background: var(--tangerine-tint); color: var(--tangerine-ink); }
.plan-hero-kicker.is-muted { background: var(--cobalt-tint); color: var(--cobalt-ink); }
.plan-hero-kicker.is-closed { background: var(--bg-2); color: var(--muted); }
.plan-hero-title { font-size: var(--t-2xl); line-height: 1.35; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.plan-hero-title.is-match { font-size: 22px; letter-spacing: 0.075em; }
.plan-hero-time { font-size: var(--t-l); font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.plan-hero-time.is-open { color: var(--muted); font-weight: 600; font-size: var(--t-b); }
.nowrap { white-space: nowrap; }
.plan-hero-sub { font-size: var(--t-s); color: var(--muted); margin-top: -4px; }
.plan-windows { display: grid; gap: 10px; padding: 14px; border-radius: var(--r-m); background: var(--bg-2); }
.plan-window { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; font-size: var(--t-m); font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.plan-window.is-current { color: var(--cobalt-ink); }
.plan-window-tag { font-size: var(--t-s); font-weight: 700; color: var(--muted); white-space: nowrap; min-width: 7em; }
.plan-window.is-current .plan-window-tag { color: var(--cobalt); }
.day-bar { position: relative; height: 34px; margin-top: 2px; }
.day-bar-track { position: absolute; left: 0; right: 0; top: 4px; height: 12px; border-radius: 999px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); }
.day-bar-seg { position: absolute; top: 4px; height: 12px; border-radius: 999px; }
.day-bar-seg.is-window { background: var(--peri-tint); box-shadow: inset 0 0 0 1.5px var(--periwinkle); }
.day-bar-seg.is-plan { top: 2px; height: 16px; background: var(--tangerine); }
.day-bar-ticks { position: absolute; left: 0; right: 0; bottom: 0; height: 14px; font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.day-bar-ticks span { position: absolute; transform: translateX(-50%); }
.day-bar-ticks span:first-child { transform: none; }
.day-bar-ticks span:last-child { transform: translateX(-100%); }
.day-bar-key { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: var(--t-xs); color: var(--muted); }
.day-bar-key i { display: inline-block; width: 14px; height: 8px; margin-right: 5px; border-radius: 999px; vertical-align: 0; }
.day-bar-key .k-window { background: var(--peri-tint); box-shadow: inset 0 0 0 1.5px var(--periwinkle); }
.day-bar-key .k-plan { background: var(--tangerine); }
.plan-facts { display: grid; }
.plan-facts > div { display: grid; grid-template-columns: 72px 1fr; align-items: center; gap: 12px; min-height: 52px; padding: 8px 0; border-top: 1px solid var(--line); }
.plan-facts > div:last-child { border-bottom: 1px solid var(--line); }
.plan-facts dt { font-size: var(--t-s); font-weight: 700; color: var(--muted); }
.plan-facts dd { font-weight: 600; font-size: var(--t-b); min-width: 0; overflow-wrap: anywhere; }
.plan-facts dd.is-empty { color: var(--muted); font-weight: 500; }
.plan-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: -8px; }
.closed-note { padding: 12px 14px; border-radius: var(--r-m); background: var(--bg-2); font-size: var(--t-s); color: var(--muted); line-height: 1.7; }
.plan-cancel { justify-self: center; align-self: center; }
.win-choice { min-height: 1.5em; font-size: var(--t-m); font-weight: 700; color: var(--tangerine-ink); font-variant-numeric: tabular-nums; }
.win-choice:empty { min-height: 0; }
.cand-day { display: grid; gap: 6px; padding: 12px 0; border-top: 1px solid var(--line); }
.cand-day:first-child { border-top: 0; padding-top: 0; }
.cand-date { font-weight: 700; font-size: var(--t-m); color: var(--ink); }
.cand-win { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.cand-time { font-weight: 700; color: var(--cobalt-ink); font-variant-numeric: tabular-nums; }
.cand-actions { display: flex; gap: 6px; }

/* ---------- chat ---------- */
.screen-inner.is-chat { --content-w: 720px; gap: 10px; padding-bottom: 0; padding-top: 0; }
.chat-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px; margin: 0 calc(var(--gutter) * -1); padding: 6px var(--gutter) 12px; background: var(--bg); border-bottom: 1px solid var(--line); }
.avatar { display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; color: var(--cobalt-ink); font-weight: 700; font-size: var(--t-b); background: var(--cobalt-tint); }
.avatar.is-l { width: 56px; height: 56px; font-size: var(--t-xl); }
.avatar.is-s { width: 28px; height: 28px; font-size: var(--t-xs); }
.chat-head-text { min-width: 0; flex: 1; }
.chat-name { font-size: var(--t-b); font-weight: 700; line-height: 1.35; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-sub { font-size: var(--t-s); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-log { display: grid; gap: 10px; align-content: start; flex: 1; padding: 8px 0 12px; }
.msg { display: flex; align-items: flex-end; gap: 8px; max-width: 100%; }
.msg.is-me { justify-content: flex-end; }
.msg-bubble { max-width: min(78%, 420px); padding: 9px 14px; border-radius: 18px; background: var(--bg-2); font-size: var(--t-m); line-height: 1.6; overflow-wrap: anywhere; white-space: pre-wrap; }
.msg.is-me .msg-bubble { background: var(--cobalt); color: #fff; border-bottom-right-radius: 6px; }
.msg.is-them .msg-bubble { border-bottom-left-radius: 6px; }
.msg.is-card .msg-bubble { display: grid; gap: 6px; min-width: 220px; white-space: normal; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--text); border-radius: 16px; }
.msg-kind { font-size: var(--t-xs); font-weight: 700; color: var(--cobalt); letter-spacing: .06em; }
.msg-card-title { font-size: var(--t-b); font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.msg-state { font-size: var(--t-s); color: var(--muted); }
.msg-card-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.msg.is-log { justify-content: center; }
.log { width: min(100%, 320px); padding: 10px 14px; border-radius: var(--r-m); background: var(--canvas); box-shadow: inset 0 0 0 1px var(--line); font-size: var(--t-s); line-height: 1.6; overflow-wrap: anywhere; }
.log-title { font-weight: 700; color: var(--ink); text-align: center; }
.log-rows { display: grid; gap: 2px; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.log-rows > div { display: grid; grid-template-columns: 48px 1fr; gap: 8px; }
.log-rows dt { color: var(--muted); }
.log-rows dd { font-weight: 600; font-variant-numeric: tabular-nums; }
.chat-compose { position: sticky; bottom: 0; z-index: 2; display: grid; gap: 10px; margin: 0 calc(var(--gutter) * -1); padding: 10px var(--gutter) max(12px, env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); }
/* Wraps rather than scrolls sideways, so cancel/exit are never hidden off-screen at 390 px. */
.chat-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-tools .is-muted { margin-left: auto; }
.chat-form { display: flex; gap: 8px; }
.chat-form .text-input { border-radius: 999px; padding: 0 16px; background: var(--bg-2); border-color: transparent; }
.chat-form .text-input:focus-visible { background: var(--bg); }
.chat-form .btn { flex: none; padding: 0 18px; min-height: 46px; border-radius: 999px; }
.menu { display: grid; gap: 4px; }

/* ---------- settings, profile, onboarding ---------- */
.settings-section { display: grid; gap: 8px; }
.row-list { display: grid; border-top: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 8px 4px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; font-size: var(--t-b); color: var(--ink); }
button.row:hover { background: var(--canvas); }
.row-label { flex: 1; min-width: 0; font-weight: 600; }
.row-value { min-width: 0; max-width: 55%; font-size: var(--t-s); color: var(--muted); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row > svg { flex: none; width: 18px; height: 18px; color: var(--faint); }
.row.is-danger .row-label { color: var(--danger); }
.rule-row { display: flex; align-items: center; gap: 10px; min-height: 54px; border-bottom: 1px solid var(--line); }
.rule-summary { flex: 1; min-width: 0; min-height: 44px; border: 0; border-radius: 8px; padding: 0 4px; background: none; font-size: var(--t-b); font-weight: 600; text-align: left; font-variant-numeric: tabular-nums; }
.rule-summary:hover { color: var(--cobalt); }
.rule-row [data-action="rule-toggle"] { min-width: 64px; }
.rule-row [data-action="rule-toggle"][aria-pressed="true"] { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }
.connection-list { display: grid; border-top: 1px solid var(--line); }
.connection-list > div { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 48px; border-bottom: 1px solid var(--line); font-size: var(--t-m); }
.connection-list dd { font-size: var(--t-s); color: var(--muted); }
.profile-hero { display: flex; gap: 14px; align-items: center; padding: 8px 0 4px; }
.profile-hero .hint { margin-top: 2px; }
.interest-list { display: flex; flex-wrap: wrap; gap: 8px; }
.interest-chip { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border-radius: 999px; background: var(--bg-2); font-size: var(--t-s); font-weight: 600; overflow-wrap: anywhere; }
.share-check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: var(--t-m); color: var(--text); }
.share-check input { width: 20px; height: 20px; accent-color: var(--cobalt); }
.hidden-list { display: grid; border-top: 1px solid var(--line); }
.hidden-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 56px; border-bottom: 1px solid var(--line); padding: 6px 0; font-weight: 600; }
.hidden-list li.hint { font-weight: 400; }
.weekday-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.weekday-pick .btn-inline { min-width: 40px; min-height: 40px; padding: 0; border-radius: 50%; }
.weekday-pick [aria-pressed="true"] { background: var(--cobalt); color: #fff; border-color: var(--cobalt); }
.onboarding { gap: 24px; }
.onboard-head { display: grid; gap: 10px; padding-top: 12px; }
.onboard-head svg { width: 56px; height: 34px; }
.onboard-steps { display: grid; gap: 0; border-top: 1px solid var(--line); }
.onboard-steps > li { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.step-n { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--bg-2); color: var(--muted); font-size: var(--t-s); font-weight: 700; }
.step-n svg { width: 16px; height: 16px; }
.is-done .step-n { background: var(--cobalt); color: #fff; }
.onboard-steps h2 { font-size: var(--t-b); font-weight: 700; color: var(--ink); line-height: 32px; }
.step-body { display: grid; gap: 8px; min-width: 0; }
.step-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sample-plan { display: grid; gap: 10px; font-size: var(--t-m); }
.sample-plan li { display: flex; gap: 12px; }
.sample-plan time { flex: none; color: var(--muted); font-variant-numeric: tabular-nums; }
.ai-ideas { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.ai-ideas li { display: grid; gap: 6px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.ai-ideas li:last-child { padding-bottom: 0; border-bottom: 0; }
.ai-idea-text { display: grid; gap: 2px; font-size: var(--t-m); line-height: 1.5; overflow-wrap: anywhere; }
.ai-idea-text span { color: var(--ink); }
.ai-idea-text small { font-size: var(--t-xs); color: var(--muted); }
.ai-idea-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.privacy-details { font-size: var(--t-s); color: var(--muted); }
.privacy-details summary { cursor: pointer; }
.privacy-details p { padding-top: 8px; }

/* ---------- Match reveal ---------- */
/* Original prototype reveal: circles move, the fixed-position lens only fades in. */
.layer-reveal { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 32px 20px max(20px, env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; background: var(--night); color: #fff; text-align: center; }
.layer-reveal .bloom { width: min(220px, 58vw); height: auto; flex: none; overflow: visible; margin-top: auto; }
.bloom-you { fill: none; stroke: var(--periwinkle); stroke-width: 1.5; transform-box: fill-box; animation: bloom-left .9s var(--ease-out) both; }
.bloom-them { fill: none; stroke: rgba(255,255,255,.55); stroke-width: 1.5; transform-box: fill-box; animation: bloom-right .9s var(--ease-out) both; }
.bloom-lens { fill: var(--tangerine); animation: bloom-opacity .9s ease .72s both; }
.bloom-glow { animation: bloom-opacity 1.2s ease .72s both; }
@keyframes bloom-left { from { transform: translateX(-34px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes bloom-right { from { transform: translateX(34px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes bloom-opacity { from { opacity: 0; } to { opacity: 1; } }
.layer-reveal h2 { font-size: 18.5px; line-height: 1.6; letter-spacing: 0.075em; font-weight: 700; margin: 0; }
.reveal-sub { font-size: var(--t-m); color: rgba(255,255,255,.7); }
.reveal-list { width: 100%; max-width: 380px; display: grid; gap: 10px; margin-top: 6px; text-align: left; }
.reveal-list li { display: grid; gap: 4px; border-radius: var(--r-m); padding: 14px; background: rgba(255,255,255,.07); }
.reveal-list strong { font-size: var(--t-b); font-weight: 700; }
.reveal-list span { font-size: var(--t-s); color: #FFC894; font-variant-numeric: tabular-nums; }
.reveal-list .reveal-action { margin-top: 6px; }
.reveal-action { min-height: 44px; font-size: var(--t-m); background: transparent; border-color: rgba(255,255,255,.28); color: #fff; }
.reveal-action:hover { background: rgba(255,255,255,.08); }
.reveal-action.is-main { background: #fff; border-color: #fff; color: var(--night); }
.reveal-action.is-main:hover { background: #E8EAFB; }
.reveal-footer { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; max-width: 380px; margin-top: auto; padding-top: 12px; }

/* ---------- toast ---------- */
/* Top, under the header: a bottom toast would cover docked CTAs and the chat composer. */
.toast { position: absolute; left: 50%; top: 56px; z-index: 9; transform: translate(-50%, -8px); width: max-content; max-width: calc(100% - 32px); background: #2B3150; color: #fff; font-size: var(--t-m); font-weight: 600; padding: 10px 16px; border-radius: 12px; box-shadow: 0 12px 32px -12px rgba(24, 28, 52, .55); opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s var(--ease-out); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast:empty { display: none; }
@media (min-width: 960px) { .toast { left: calc(50% + 118px); top: 64px; } }

/* ---------- narrow phones ---------- */
@media (max-width: 360px) {
  :root { --gutter: 12px; }
  .day-row { grid-template-columns: 46px minmax(0, 1fr); gap: 8px; }
  .plan-card { gap: 10px; padding-left: 10px; }
  .modes.has-draft { grid-template-columns: auto minmax(0, 1fr); }
  .modes.has-draft .btn.secondary .btn-text { display: none; }
  .calendar-legend { gap: 4px 10px; }
  .reveal-card-mark { display: none; }
}
@media (pointer: coarse) {
  .btn-inline { min-height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .bloom-you, .bloom-them, .bloom-lens, .bloom-glow { animation: none; transform: none; opacity: 1; }
}

/* ---------- contest demo: pools, free segments, range slider ---------- */
.board-list.is-want { background: var(--cobalt-tint); }
.board-list.is-want .board-label { color: var(--cobalt); font-size: var(--t-l); }
.board-list.is-open .board-label { font-size: var(--t-l); }
.board-list.is-unclassified .board-label { color: var(--muted); }
.p-tag { margin-left: 6px; font-size: var(--t-xs); font-weight: 600; color: var(--muted); white-space: nowrap; }

.ev-free { background: var(--peri-tint); color: var(--cobalt); border: 1.5px dashed var(--cobalt); z-index: 0; }
.ev-free span { font-weight: 700; }
.dot-free { background: var(--peri-tint); box-shadow: inset 0 0 0 1px var(--cobalt); }

.dialog-top .slot-date { display: block; font-size: var(--t-s); color: var(--cobalt); letter-spacing: .02em; }
.slot-pick { display: grid; gap: 4px; }
.slot-label { font-size: var(--t-s); font-weight: 600; color: var(--muted); }
.slot-time { font-size: 30px; line-height: 1.2; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.slot-areas { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.slot-areas .field-label { flex-basis: 100%; }
.slot-areas-value { font-weight: 600; color: var(--ink); }
.seg-pick { display: flex; flex-wrap: wrap; gap: 6px; }

/* Two native range inputs over one rail. Only the thumbs take pointer input, so either handle can
   be dragged; both remain ordinary focusable sliders for keyboard and assistive technology. */
.rs { --thumb: 28px; position: relative; height: 64px; }
.rs-rail { position: absolute; left: calc(var(--thumb) / 2); right: calc(var(--thumb) / 2); top: 14px; height: 8px; border-radius: 999px; background: var(--cobalt-tint); }
.rs-fill { position: absolute; top: 0; bottom: 0; left: var(--lo); right: calc(100% - var(--hi)); border-radius: inherit; background: var(--cobalt); }
.rs-input { position: absolute; left: 0; right: 0; top: 0; width: 100%; height: 36px; margin: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; }
.rs-input::-webkit-slider-runnable-track { height: 36px; background: transparent; }
.rs-input::-moz-range-track { height: 36px; background: transparent; }
.rs-input::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; pointer-events: auto; width: var(--thumb); height: var(--thumb); margin-top: 4px; border-radius: 50%; background: var(--bg); border: 3px solid var(--cobalt); box-shadow: 0 2px 6px rgba(24, 28, 52, .25); cursor: grab; }
.rs-input::-moz-range-thumb { pointer-events: auto; width: calc(var(--thumb) - 6px); height: calc(var(--thumb) - 6px); border-radius: 50%; background: var(--bg); border: 3px solid var(--cobalt); box-shadow: 0 2px 6px rgba(24, 28, 52, .25); cursor: grab; }
.rs-input.is-end::-webkit-slider-thumb { background: var(--ink); border-color: var(--bg); box-shadow: 0 0 0 1.5px var(--ink), 0 2px 6px rgba(24, 28, 52, .25); }
.rs-input.is-end::-moz-range-thumb { background: var(--ink); border-color: var(--bg); }
.rs-input:focus { outline: none; }
.rs-input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--cobalt); }
.rs-input:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--cobalt); }
.rs-ticks { position: absolute; left: calc(var(--thumb) / 2); right: calc(var(--thumb) / 2); top: 40px; height: 18px; font-size: var(--t-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.rs-ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }

.btn.is-pill { min-height: 56px; border-radius: 999px; background: var(--ink); box-shadow: 0 10px 24px -14px rgba(24, 28, 52, .9); }
.btn.is-pill:hover:not(:disabled) { background: #000; }

.plan-done { display: grid; justify-items: center; gap: 6px; padding: 8px 0 4px; text-align: center; }
.plan-done-mark svg { width: 64px; height: 40px; }
.plan-done-time { font-size: var(--t-b); color: var(--text); }
.plan-done-time strong { color: var(--cobalt); font-variant-numeric: tabular-nums; }
.plan-done-who { color: var(--muted); }

.presenter { display: grid; gap: 7px; justify-items: start; padding: 10px 12px; border-radius: var(--r-m); background: var(--canvas); }
.presenter-caption { font-size: var(--t-xs); color: var(--muted); }
.presenter-actions { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.demo-line { font-size: var(--t-s); line-height: 1.65; color: var(--ink); }
.demo-details { width: 100%; font-size: var(--t-xs); color: var(--muted); }
.demo-details summary { cursor: pointer; width: fit-content; }
.demo-details[open] summary { margin-bottom: 5px; }
.demo-checks, .demo-notes { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; font-size: var(--t-s); line-height: 1.6; }
.demo-checks li::before { content: '・'; }
.demo-checks .is-ok { color: var(--muted); }
.demo-checks .is-warn { color: var(--ink); font-weight: 600; }
.demo-notes { color: var(--muted); }
.demo-notes li::before { content: '・'; }
.weather-row.is-fallback { color: var(--muted); }

/* Nearby places. Tiles are loaded only after the user opens this dialog. */
.osm-map { position: relative; height: 240px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--bg-2); isolation: isolate; }
.osm-tiles { position: absolute; inset: 0; overflow: hidden; }
.osm-tile { position: absolute; max-width: none; user-select: none; transform: translate(-50%, -50%); }
.osm-tile.is-broken { display: none; }
.osm-radius { position: absolute; left: 50%; top: 50%; z-index: 2; border: 1px solid rgba(42, 77, 238, .55); border-radius: 50%; background: rgba(42, 77, 238, .08); transform: translate(-50%, -50%); pointer-events: none; }
.osm-pin { position: absolute; z-index: 3; display: grid; place-items: center; width: 24px; height: 24px; border: 2px solid #fff; border-radius: 50%; background: var(--cobalt); color: #fff; font-size: 11px; font-weight: 700; transform: translate(-50%, -100%); box-shadow: 0 2px 8px rgba(25, 31, 55, .22); }
.osm-pin.is-center { width: 12px; height: 12px; border-width: 3px; transform: translate(-50%, -50%); }
.osm-zoom { position: absolute; right: 8px; top: 8px; z-index: 4; display: grid; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); box-shadow: var(--shadow-1); }
.osm-zoom-btn { width: 34px; height: 32px; border: 0; background: transparent; color: var(--ink); font-size: 18px; }
.osm-zoom-btn + .osm-zoom-btn { border-top: 1px solid var(--line); }
.osm-zoom-btn:disabled { color: var(--faint); }
.osm-attribution { position: absolute; right: 6px; bottom: 5px; z-index: 4; padding: 2px 5px; border-radius: 4px; background: rgba(255, 255, 255, .9); color: var(--muted); font-size: 10px; text-decoration: none; }
.osm-failed { display: none; position: absolute; inset: 0; z-index: 1; place-items: center; margin: 0; padding: 24px; color: var(--muted); text-align: center; }
.osm-map.is-failed .osm-failed { display: grid; }
.place-list { display: grid; gap: 0; margin: 10px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.place-item { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 8px; align-items: center; min-height: 54px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.place-num { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--cobalt); color: #fff; font-size: 11px; font-weight: 700; }
.place-text { display: grid; min-width: 0; gap: 2px; }
.place-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--t-b); }
.place-text small { color: var(--muted); font-size: var(--t-s); }
.places-fallback { display: grid; gap: 8px; padding: 14px; border-radius: var(--r-m); background: var(--bg-2); }
.places-fallback p { margin: 0; }
.places-privacy, .places-attribution { margin: 8px 0 0; }
