:root {
  --bg: #f5f7fa;
  --bg-2: #e8edf3;
  --paper: #ffffff;
  --ink: #14181f;
  --muted: #5e6a78;
  --line: #e3e8ef;
  --accent: #1c4ed8;
  --accent-ink: #ffffff;
  --green: #0e7a56;
  --shadow: 0 18px 50px rgba(16, 24, 40, 0.06);
  --radius: 18px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Segoe UI", system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom);
  --kb: 0px;
  --tab: calc(78px + var(--safe-b));
  color-scheme: light;
}

:root[data-palette="brick"] {
  --bg: #f3efe6;
  --bg-2: #e7e0d2;
  --paper: #fffcf6;
  --ink: #1c1915;
  --muted: #6f675c;
  --line: #e4d9c8;
  --accent: #b8431f;
  --accent-ink: #fff8f4;
  --green: #1f6a4e;
  --shadow: 0 18px 50px rgba(48, 32, 16, 0.08);
}

:root[data-palette="forest"] {
  --bg: #f3f7f4;
  --bg-2: #e3eee7;
  --paper: #ffffff;
  --ink: #13241c;
  --muted: #5d7268;
  --line: #d7e6de;
  --accent: #0c7a58;
  --accent-ink: #ffffff;
  --green: #0c7a58;
  --shadow: 0 18px 50px rgba(12, 40, 28, 0.06);
}

:root[data-palette="sea"] {
  --bg: #f2f7fb;
  --bg-2: #e3eef6;
  --paper: #ffffff;
  --ink: #10202c;
  --muted: #5c7284;
  --line: #d5e4ef;
  --accent: #0b6f99;
  --accent-ink: #ffffff;
  --green: #0e7a56;
  --shadow: 0 18px 50px rgba(12, 32, 48, 0.06);
}

:root[data-palette="plum"] {
  --bg: #f6f4fa;
  --bg-2: #ebe6f4;
  --paper: #ffffff;
  --ink: #1a1524;
  --muted: #6d647c;
  --line: #e4dced;
  --accent: #6d3cc4;
  --accent-ink: #ffffff;
  --green: #0e7a56;
  --shadow: 0 18px 50px rgba(32, 16, 48, 0.06);
}

:root[data-theme="dark"] {
  --bg: #0c1016;
  --bg-2: #161c26;
  --paper: #161c26;
  --ink: #f4f7fb;
  --muted: #a3b0c0;
  --line: #2a3342;
  --accent: #8eb0ff;
  --accent-ink: #0c1424;
  --green: #8ee0c0;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

:root[data-palette="brick"][data-theme="dark"] {
  --bg: #141311;
  --bg-2: #221f1b;
  --paper: #221f1b;
  --ink: #f6f1e8;
  --muted: #b7ad9f;
  --line: #3a342c;
  --accent: #ef7a45;
  --accent-ink: #1c100c;
  --green: #8fd0b0;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

:root[data-palette="forest"][data-theme="dark"] {
  --bg: #0c1411;
  --bg-2: #15211c;
  --paper: #15211c;
  --ink: #eef6f2;
  --muted: #a8c0b4;
  --line: #2a3d34;
  --accent: #6ddec0;
  --accent-ink: #082018;
  --green: #6ddec0;
}

:root[data-palette="sea"][data-theme="dark"] {
  --bg: #0c141b;
  --bg-2: #15202a;
  --paper: #15202a;
  --ink: #eef5fb;
  --muted: #a5b8c8;
  --line: #2a3c4c;
  --accent: #79c7ee;
  --accent-ink: #08202c;
  --green: #8ee0c0;
}

:root[data-palette="plum"][data-theme="dark"] {
  --bg: #120f18;
  --bg-2: #1c1726;
  --paper: #1c1726;
  --ink: #f6f2fb;
  --muted: #b7adc6;
  --line: #342c44;
  --accent: #c4b0ff;
  --accent-ink: #160f24;
  --green: #8ee0c0;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
}
html:not([data-palette="brick"]) body {
  background:
    radial-gradient(1000px 480px at 8% -20%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    var(--bg);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--serif); font-weight: 560; letter-spacing: -0.03em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.btn, .iconbtn, .chip {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 999px;
  min-height: 44px;
  padding: 0 16px;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.linkish { background: none; border: 0; color: var(--accent); min-height: 36px; padding: 0; justify-self: start; }
.auth-title { margin: 4px 0 0; font-size: 28px; }
.btn.danger { color: var(--accent); }
.iconbtn { width: 44px; padding: 0; }
.chip { min-height: 36px; padding: 0 12px; }
.chip.on, .nav button.active, .tabbar button.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.site-nav, .site-foot {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.site-nav { min-height: 76px; }
.site-nav nav, .actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.site-nav a { text-decoration: none; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-family: var(--serif); font-size: 28px; text-decoration: none; }
.mark {
  width: 28px; height: 28px; border-radius: 9px; background: var(--accent); position: relative; display: inline-block;
}
.mark:before { content: ""; position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--accent-ink); left: 9px; top: 6px; }
.mark:after { content: ""; position: absolute; left: 6px; right: 6px; height: 2px; background: var(--accent-ink); bottom: 7px; }

.marketing { width: min(1120px, calc(100% - 32px)); margin: 0 auto 64px; }
.hero { display: grid; grid-template-columns: 1.2fr .8fr; gap: 32px; align-items: center; padding: 18px 0 28px; }
.kicker { text-transform: uppercase; letter-spacing: .14em; font-size: 12px; color: var(--muted); margin: 0 0 8px; }
.hero h1 { font-size: clamp(42px, 6vw, 76px); line-height: .95; margin: 0 0 16px; }
.lead { font-size: 19px; max-width: 62ch; }
.marketing h2 { font-size: 36px; margin: 28px 0 14px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid.two { grid-template-columns: 1fr 1fr; }
.card, .band {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 6px; font-size: 24px; }
.card p, .band p { margin: 0; color: var(--muted); }
.feature-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.feature-list li { display: grid; gap: 2px; padding: 12px 0; border-top: 1px solid var(--line); }
.feature-list span { color: var(--muted); }
.band { margin-top: 28px; }
.site-foot { min-height: 72px; color: var(--muted); }
.prose { width: min(760px, calc(100% - 32px)); margin: 18px auto 64px; }
.prose h1 { font-size: 48px; }
.phone {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 32px;
  padding: 16px;
  box-shadow: var(--shadow);
  min-height: 420px;
}
.phone-top, .phone-row { display: flex; justify-content: space-between; gap: 12px; }
.phone-top { color: var(--muted); margin-bottom: 18px; }
.phone-cap { font-family: var(--serif); font-size: 42px; margin-bottom: 16px; }
.phone-row { border-left: 4px solid var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--paper)); border-radius: 14px; padding: 12px; margin-top: 8px; }
.phone-row.c2 { border-color: #1f4e79; }
.phone-row.c3 { border-color: var(--green); }
.phone-row small { color: var(--muted); }

.book { width: min(560px, calc(100% - 28px)); margin: 24px auto 48px; display: grid; gap: 12px; }
.book-form, .stack { display: grid; gap: 12px; }
label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
input, select, textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 44px;
  padding: 10px 12px;
}
input[type="checkbox"], input[type="radio"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  accent-color: var(--accent);
}
input[type="color"] { width: 64px; min-height: 44px; padding: 4px; }
label.checks, .side-cals label, label.chip {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  width: auto;
}
textarea { min-height: 90px; resize: vertical; }
.slots { display: flex; flex-wrap: wrap; gap: 8px; }
.hp { position: absolute; left: -9999px; }
.muted, .hint { color: var(--muted); }
.booting { padding: 48px 20px; font-family: var(--serif); font-size: 42px; }

.shell { min-height: 100dvh; display: grid; grid-template-columns: 232px 1fr; }
.side {
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: color-mix(in srgb, var(--bg-2) 55%, var(--bg));
}
.nav, .tabbar { display: grid; gap: 6px; }
.nav button, .tabbar button {
  text-align: left;
  border: 0;
  background: transparent;
  min-height: 44px;
  border-radius: 12px;
  padding: 0 12px;
  color: var(--ink);
}
.side-cals { display: grid; gap: 6px; }
.side-cals label { color: var(--ink); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.sync { margin-top: auto; color: var(--muted); font-size: 13px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); padding: max(10px, env(safe-area-inset-top)) 16px 10px; border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; gap: 8px; }
.crumb-wrap { flex: 1; min-width: 0; display: grid; justify-items: start; }
.top-row.centered { position: relative; }
.top-row.centered .crumb-wrap { position: absolute; left: 0; right: 0; top: 0; bottom: 0; justify-items: center; align-content: center; pointer-events: none; }
.top-row.centered #crumb { pointer-events: auto; }
.top-row.no-search > [data-action="search"] { display: none; }
#crumb { border: 0; background: transparent; min-height: 0; padding: 0; font-family: var(--serif); font-size: 28px; text-transform: capitalize; color: var(--ink); }
.crumb-sub { margin: 0; color: var(--muted); font-size: 14px; text-transform: capitalize; }
.quick, .find { display: flex; gap: 8px; margin-top: 10px; }
.quick input, .find input { border-radius: 999px; background: var(--paper); }
.find { display: grid; }
.find-list { display: grid; gap: 6px; }
.find-list:empty { display: none; }
#jump-date { width: auto; min-height: 44px; border-radius: 999px; background: var(--paper); }
#view { padding: 16px 16px calc(var(--tab) + 16px + var(--kb)); flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.turn { display: grid; }
.turn > div { grid-area: 1 / 1; background: var(--bg); }
.turn-over { z-index: 2; box-shadow: -18px 0 28px rgba(16, 24, 40, .16); }
.turn-under { z-index: 1; }
.turn-future .turn-over { animation: turn-over .34s cubic-bezier(.2, .7, .2, 1) both; }
.turn-past .turn-over { animation: turn-away .34s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes turn-over { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes turn-away { from { transform: translateX(0); } to { transform: translateX(100%); } }
.week-band { display: grid; gap: 4px; margin-bottom: 8px; }
.week-band-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.week-band-row.mid { background: color-mix(in srgb, var(--accent) 10%, var(--paper)); border-radius: 16px; padding: 3px; }
.band-day { border: 0; background: transparent; min-height: 0; padding: 2px 0; display: grid; justify-items: center; color: var(--ink); }
.band-day small { color: var(--muted); font-size: 10px; line-height: 1; }
.band-day.dim { opacity: .5; }
.band-day.on { background: var(--ink); color: var(--bg); border-radius: 12px; }
.band-day.on small { color: var(--bg); }
.band-day.today:not(.on) b { color: var(--accent); }
.back-week { justify-self: center; margin-bottom: 10px; }
.year-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(4, minmax(0, 1fr)); gap: 4px; }
.year-month { min-height: 0; height: 100%; border-radius: 10px; background: var(--paper); border: 1px solid var(--line); padding: 2px 1px 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr); color: var(--ink); overflow: hidden; }
.year-month > b { font-size: 10px; line-height: 1; text-align: center; text-transform: capitalize; }
.year-month.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.mini-heads, .mini-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); min-height: 0; }
.mini-days { grid-template-rows: repeat(6, minmax(0, 1fr)); align-items: center; height: 100%; }
.mini-heads b { color: var(--muted); font-size: 6px; font-weight: 600; text-align: center; line-height: 1.1; }
.year-month i { font-style: normal; text-align: center; font-size: 7px; line-height: 1; }
.year-month i.out { visibility: hidden; }
.year-month i.today { background: var(--ink); color: var(--bg); border-radius: 99px; }
.more-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.more-tabs button { flex: 1; text-align: center; min-height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); }
.more-tabs button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tick { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 2px 0; border: 0; background: transparent; color: var(--ink); text-align: left; }
.tick .box { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--tick, var(--accent)); display: grid; place-items: center; color: var(--tick, var(--accent)); font-size: 13px; font-weight: 700; line-height: 1; flex: 0 0 auto; }
.tick[data-on="1"] .box { background: var(--tick, var(--accent)); color: #fff; }
.tick[data-on="1"] .box::before { content: "✓"; }
.tick[data-on="0"] .box::before { content: "✕"; }
.tick[data-on="0"] .name { color: var(--muted); text-decoration: line-through; }
.cal-row { display: flex; align-items: center; gap: 8px; }
.cal-row .tick, .cal-row .name { flex: 1; min-width: 0; }
.secret { position: relative; display: block; }
.secret input { width: 100%; padding-right: 84px; }
.secret button { position: absolute; right: 6px; top: 6px; min-height: 32px; border: 0; background: transparent; color: var(--accent); }
.accept { display: flex; gap: 10px; align-items: flex-start; }
.accept input { width: 20px; height: 20px; margin-top: 2px; flex: 0 0 auto; }
.plan { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.plan label { display: grid; gap: 4px; color: var(--muted); font-size: 13px; }
.dialog-back { position: fixed; inset: 0; z-index: 36; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(6, 8, 14, .88); }
.dialog { width: min(440px, 100%); max-height: min(80dvh, 640px); overflow: auto; background: var(--paper); color: var(--ink); border-radius: 22px; padding: 16px; display: grid; gap: 10px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 32px; height: 32px; border-radius: 16px; border: 2px solid transparent; padding: 0; }
.swatch.on { border-color: var(--ink); box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink); }
.day-list { display: grid; gap: 8px; }
.item.source { grid-template-columns: 6px 1fr; }
.item .bar { width: 6px; align-self: stretch; border-radius: 6px; display: block; }
#search-layer { position: fixed; inset: 0; z-index: 40; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; box-sizing: border-box; }
#search-layer[hidden] { display: none !important; }
.search-scrim { position: absolute; inset: 0; border: 0; background: rgba(6, 8, 14, .88); }
.search-panel { position: relative; z-index: 1; width: min(440px, 100%); max-width: 100%; margin: 0; display: grid; gap: 10px; }
.search-panel input { color: #fff; background: transparent; border-color: rgba(255,255,255,.75); }
.search-panel input::placeholder { color: rgba(255,255,255,.72); }
.search-panel .item { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.search-panel .meta, .search-panel small { color: rgba(255,255,255,.75); }
.back-link { align-self: flex-start; border: 0; background: transparent; color: var(--accent); font-weight: 700; min-height: 36px; padding: 0 2px; }
.back-link[hidden] { display: none !important; }
.view-bar { display: flex; gap: 8px; margin-top: 8px; }
.view-bar:empty { display: none; }
.view-bar .btn { flex: 1; text-align: center; }
.top.day-open .quick { display: none; }
.add-event { width: 100%; margin-bottom: 12px; }
.one-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; }
.day-card { border: 1px solid var(--line); background: var(--paper); border-radius: 16px; min-height: 68px; padding: 8px 0; display: grid; justify-items: center; align-content: center; gap: 3px; color: var(--ink); }
.day-card small { color: var(--muted); font-size: 11px; line-height: 1; }
.day-card b { font-size: 18px; line-height: 1.1; }
.day-card b.today { color: var(--accent); }
.day-card i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.day-card i.off { opacity: 0; }
.day-card.on { background: var(--ink); border-color: var(--ink); }
.day-card.on small, .day-card.on b, .day-card.on b.today { color: var(--bg); }
.day-card.on i { background: var(--bg); }
.tabbar {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: var(--kb);
  grid-template-columns: repeat(4, 1fr);
  background: var(--paper);
  border-top: 1px solid var(--line);
  padding-top: 8px;
  padding-bottom: calc(var(--safe-b) + 10px);
  z-index: 6;
}
.tabbar button { text-align: center; font-size: 12px; padding: 8px 2px 4px; }
.tabbar button.icon-tab { display: grid; place-items: center; }

.cap, .notice, .deadline, .block, .month, .agenda-day, .panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.cap { padding: 16px; display: flex; justify-content: space-between; gap: 12px; align-items: end; margin-bottom: 12px; }
.cap b { font-family: var(--serif); font-size: 34px; display: block; line-height: 1; }
.notice { padding: 12px 14px; margin-bottom: 12px; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.banner { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 12px; color: var(--muted); }
.allday { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.pill { border: 0; border-radius: 999px; min-height: 36px; padding: 0 12px; background: var(--bg-2); color: var(--ink); }
.timeline { position: relative; margin-left: 52px; }
.hour { height: 56px; border-top: 1px solid var(--line); position: relative; }
.hour span { position: absolute; left: -52px; top: -8px; width: 44px; text-align: right; color: var(--muted); font-size: 12px; }
.block {
  position: absolute;
  left: 6px; right: 8px;
  padding: 6px 8px;
  overflow: hidden;
  text-align: left;
  border-left: 4px solid var(--c, var(--accent));
  background: color-mix(in srgb, var(--c, var(--accent)) 16%, var(--paper));
  border-radius: 12px;
}
.block small, .meta { color: var(--muted); display: block; }
.block.done { opacity: .55; text-decoration: line-through; }
.now { position: absolute; left: 0; right: 0; height: 2px; background: var(--accent); z-index: 3; box-shadow: 0 0 0 1px var(--accent); }
.now:before { content: ""; position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); top: -4px; left: -2px; }
.list { display: grid; gap: 8px; }
.item {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  text-align: left;
  width: 100%;
}
.week-grid { display: none; }
.week-cols { display: grid; grid-template-columns: 52px repeat(7, 1fr); }
.week-head, .week-col { min-width: 0; }
.week-head-row { position: sticky; top: 118px; z-index: 4; background: var(--bg); padding-bottom: 4px; }
.week-head { text-align: center; font-size: 13px; padding-bottom: 6px; }
.week-head.on { color: var(--accent); font-weight: 700; }
.week-col { position: relative; border-left: 1px solid var(--line); background-image: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 48px); }
.month { display: grid; grid-template-columns: repeat(7, 1fr); grid-template-rows: auto repeat(var(--weeks, 6), minmax(0, 1fr)); overflow: hidden; }
.month.with-weeks { grid-template-columns: 28px repeat(7, 1fr); }
.month b, .cell, .week-no { min-height: 0; height: 100%; padding: 6px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.month b { height: auto; text-align: center; color: var(--muted); font-weight: 560; font-family: var(--sans); background: var(--paper); }
.week-no { display: flex; align-items: center; justify-content: center; padding: 0; font-size: 12px; font-weight: 700; color: var(--muted); background: color-mix(in srgb, var(--muted) 8%, var(--paper)); }
button.week-no { border: 0; color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--paper)); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.cell { background: transparent; text-align: left; border-right: 0; border-bottom: 0; }
.cell.off { color: var(--muted); }
.today-num { display: inline-flex; align-items: center; justify-content: center; min-width: 1.75em; height: 1.75em; padding: 0 0.3em; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 700; line-height: 1; }
.top-row > [data-action="jump-today"][hidden] { display: none !important; }
.cell.shift { background: color-mix(in srgb, var(--shift) 46%, var(--paper)); }
.cell.shift.off { background: color-mix(in srgb, var(--shift) 20%, var(--paper)); }
.cell.shift .meta { color: var(--ink); }
.shift-strip { display: grid; gap: 8px; }
.dots { display: flex; gap: 3px; margin-top: 6px; }
.agenda-day { padding: 12px; margin-bottom: 10px; }
.agenda-day h3 { margin: 0 0 8px; font-size: 20px; }
.panel { padding: 16px; margin-bottom: 12px; display: grid; gap: 10px; }
.panel h2 { margin: 0; font-size: 26px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tab) + 8px);
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  border-radius: 999px;
  padding: 10px 14px;
  z-index: 20;
  display: flex;
  gap: 10px;
  align-items: center;
}
.sheet-back { position: fixed; inset: 0; background: rgba(6, 8, 14, .88); z-index: 30; display: flex; align-items: center; justify-content: center; padding: 16px 16px calc(16px + var(--kb)); }
.sheet { width: min(80vw, 720px); height: min(80dvh, calc(100dvh - var(--kb) - 32px)); max-height: min(80dvh, calc(100dvh - var(--kb) - 32px)); overflow: auto; background: var(--paper); border-radius: 22px; padding: 16px; display: grid; gap: 10px; align-content: start; }
.sheet h2 { margin: 0; }
.day-head { position: relative; display: block; color: var(--ink); font-family: var(--serif); font-size: 28px; line-height: 1.2; text-transform: capitalize; cursor: pointer; }
.day-head input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; min-height: 0; cursor: pointer; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.repeat { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); }
.repeat p { margin: 0; }
.sheet [hidden] { display: none !important; }
.unit-row { display: flex; align-items: end; gap: 8px; }
.unit-row input[type="number"] { width: 96px; }
.shift { border-top: 1px solid var(--line); padding-top: 8px; }
.shift summary { cursor: pointer; font-weight: 650; }
.stack { display: grid; gap: 8px; margin-top: 8px; }

@media (min-width: 900px) {
  .week-grid { display: block; }
  .week-agenda { display: none; }
  #view { padding-bottom: 28px; }
  .sheet-back { align-items: center; }
  .sheet { border-radius: 22px; width: min(80vw, 720px); height: min(80dvh, 860px); max-height: min(80dvh, 860px); }
}
@media (max-width: 899px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .tabbar { display: grid; }
  .top-row { flex-wrap: wrap; }
  .top-row > [data-dir="-1"] { order: 1; }
  .top-row .crumb-wrap { order: 2; flex: 1 1 calc(100% - 112px); max-width: calc(100% - 112px); justify-items: center; min-width: 0; }
  .top-row > [data-dir="1"] { order: 3; }
  .top-row > [data-action="search"] { display: none; }
  .top-row > [data-action="jump-today"] { order: 5; }
  .top-row > [data-action="jump-today"][hidden] { display: none !important; }
  .top-row > #jump-date { order: 6; flex: 1; min-width: 0; }
  .top-row.centered .crumb-wrap { position: static; left: auto; right: auto; top: auto; bottom: auto; pointer-events: auto; }
  #crumb { font-size: 20px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .hero, .grid, .grid.two, .split { grid-template-columns: 1fr; }
  .site-nav { width: min(1120px, calc(100% - 20px)); }
  .hero h1 { font-size: 46px; }
  .top-row h1 { font-size: 22px; }
  .quick { flex-direction: column; }
}
