:root {
  color-scheme: light;
  --canvas: #f5f7f4; --surface: #fff; --ink: #17251e; --muted: #54655a;
  --line: #e2e9e3; --hover: #eff4ef; --accent: #245b40; --tint: #e8f3ea;
  --red: #a93432; --red-tint: #fbedeB; --on-accent: #fff;
  --p0: #32684b; --p1: #355891; --p2: #684d9a; --p3: #79560c;
  --p4: #236b63; --p5: #87486c; --p6: #576823; --p7: #4b6471;
  --w0: #e8f3ea; --w1: #eaf0fc; --w2: #f1ebfa; --w3: #f9f1da;
  --w4: #e4f3f0; --w5: #f7eaf2; --w6: #eff3db; --w7: #eaf0f3;
  --radius: 12px;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 100%;
  background: var(--canvas);
  color: var(--ink);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #171c19; --surface: #202622; --ink: #edf3ed; --muted: #a5b5ab;
  --line: #36423b; --hover: #303c34; --accent: #a7d8b5; --tint: #2c4234;
  --red: #ff9d99; --red-tint: #4b302f; --on-accent: #15241b;
  --p0: #a6d4b1; --p1: #aec7f2; --p2: #c8b8f2; --p3: #e3c480;
  --p4: #89d0c5; --p5: #e5b4d0; --p6: #becf8c; --p7: #bbc9d1;
  --w0: #2d4937; --w1: #2e3f56; --w2: #443753; --w3: #4b402b;
  --w4: #294941; --w5: #50374a; --w6: #41492d; --w7: #37464c;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    color-scheme: dark;
    --canvas: #171c19; --surface: #202622; --ink: #edf3ed; --muted: #a5b5ab;
    --line: #36423b; --hover: #303c34; --accent: #a7d8b5; --tint: #2c4234;
    --red: #ff9d99; --red-tint: #4b302f; --on-accent: #15241b;
    --p0: #a6d4b1; --p1: #aec7f2; --p2: #c8b8f2; --p3: #e3c480;
    --p4: #89d0c5; --p5: #e5b4d0; --p6: #becf8c; --p7: #bbc9d1;
    --w0: #2d4937; --w1: #2e3f56; --w2: #443753; --w3: #4b402b;
    --w4: #294941; --w5: #50374a; --w6: #41492d; --w7: #37464c;
  }
}
.c0 { --project: var(--p0); --wash: var(--w0); } .c1 { --project: var(--p1); --wash: var(--w1); }
.c2 { --project: var(--p2); --wash: var(--w2); } .c3 { --project: var(--p3); --wash: var(--w3); }
.c4 { --project: var(--p4); --wash: var(--w4); } .c5 { --project: var(--p5); --wash: var(--w5); }
.c6 { --project: var(--p6); --wash: var(--w6); } .c7 { --project: var(--p7); --wash: var(--w7); }
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; line-height: 1.45; min-height: 100dvh; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { line-height: 1.2; }
h1 { font-size: 1.55rem; letter-spacing: -.03em; font-weight: 660; }
h2 { font-size: 1.15rem; letter-spacing: -.015em; font-weight: 650; }
strong { font-weight: 650; }
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:disabled { opacity: .45; cursor: default; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg { flex: none; vertical-align: middle; }
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
small { font-size: .78rem; }
input:not([type=checkbox]), textarea, select {
  min-block-size: 42px; min-inline-size: 0; max-inline-size: 100%;
  background: var(--canvas); color: var(--ink); border: 1px solid var(--line);
  border-radius: 7px; padding: 7px 10px;
}
textarea { resize: vertical; }
input[type=date] { min-width: 0; }
.muted { color: var(--muted); } .accent { color: var(--accent); } .red { color: var(--red) !important; }
.compact { font-size: .85rem; } .done { color: var(--muted); text-decoration: line-through; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; min-width: 0;
  border: 1px solid transparent; border-radius: 8px; padding: 5px 11px; color: var(--ink);
  background: transparent; font-size: .87rem; font-weight: 620; cursor: pointer; text-align: center;
  transition: background-color .14s ease, border-color .14s ease, opacity .14s ease;
}
@media (hover: hover) { .button:not(:disabled):hover { background-color: var(--hover); } }
.button:active:not(:disabled) { opacity: .76; }
.icon-button { padding: 0; inline-size: 36px; min-block-size: 36px; color: var(--muted); flex: none; }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
@media (hover: hover) { .button.primary:hover:not(:disabled) { background: var(--accent); opacity: .9; } }
.tinted, .button.tinted { background: var(--tint); color: var(--accent); }
.outlined { border-color: var(--line); }
.danger { color: var(--red); background: var(--red-tint); }
.subtle { color: var(--accent); }
.tile { display: inline-grid; place-items: center; inline-size: 35px; block-size: 35px; border-radius: 9px; background: var(--tint); color: var(--accent); }
.tile.alert { background: var(--red-tint); color: var(--red); }
.eyebrow, .section-label { color: var(--muted); font-size: .76rem; font-weight: 650; }
.eyebrow.accent { color: var(--accent); }
.section-label { text-transform: uppercase; margin-block-end: 9px; letter-spacing: .025em; }
.shell { min-block-size: 100dvh; }
.app-header { background: var(--surface); border-block-end: 1px solid var(--line); }
.header-inner {
  min-height: 65px; padding: 10px max(24px, env(safe-area-inset-right)) 10px max(24px, env(safe-area-inset-left));
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 1.35rem; font-weight: 670; letter-spacing: -.035em; }
.brand-mark {
  display: grid; place-items: center; inline-size: 36px; block-size: 36px; border-radius: 9px;
  color: var(--on-accent); background: var(--accent);
}
.header-actions, .date-nav, .view-row, .period-row, .planner-toolbar { display: flex; align-items: center; }
.header-actions { gap: 6px; }
.header-sync { font-size: .76rem; max-inline-size: 26ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-inline-end: 6px; }
.desktop-main { display: grid; grid-template-rows: auto minmax(0, 1fr) 35px; height: calc(100dvh - 66px); min-height: 500px; padding: 0 24px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 18px 0 16px; }
.button.metric {
  display: flex; min-height: 83px; align-items: start; justify-content: space-between; padding: 13px 15px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-align: left;
}
.metric-text { min-width: 0; display: grid; gap: 1px; }
.metric-text strong { font-size: 1.82rem; font-variant-numeric: tabular-nums; line-height: 1.17; }
.metric-label { color: var(--muted); font-size: .82rem; }
.metric .tile { flex: none; }
.workspace { display: grid; grid-template-columns: minmax(154px, 1fr) minmax(0, 4.15fr) minmax(186px, 1.42fr); gap: 14px; min-height: 0; }
.workspace.no-projects { grid-template-columns: minmax(0, 4.15fr) minmax(186px, 1.42fr); }
.workspace.no-details { grid-template-columns: minmax(154px, 1fr) minmax(0, 4.15fr); }
.workspace.no-projects.no-details { grid-template-columns: minmax(0, 1fr); }
.pane {
  min-width: 0; min-height: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.projects-pane, .day-pane, .calendar-pane { display: flex; flex-direction: column; overflow: hidden; }
.projects-pane > h2 { padding: 17px 14px 12px; }
.pane-body { padding: 0 13px 13px; overflow-y: auto; scrollbar-width: thin; min-height: 0; }
.quiet { padding: 10px; display: grid; justify-items: start; gap: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--canvas); color: var(--muted); font-size: .83rem; }
.quiet .tile { width: 30px; height: 30px; }
.button.project-card {
  display: grid; gap: 5px; width: 100%; margin-bottom: 7px; padding: 10px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--canvas); text-align: start; justify-content: stretch;
  font-size: .76rem; color: var(--muted);
}
.project-title { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: .86rem; color: var(--ink); }
.project-title i, .pill-title i { display: block; width: 7px; height: 7px; background: var(--project); border-radius: 50%; flex: none; }
.project-title strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progress { display: block; height: 4px; border-radius: 4px; background: var(--line); margin-top: 3px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--project); border-radius: inherit; transition: width .2s ease; }
.progress-caption { display: flex; justify-content: space-between; gap: 6px; font-variant-numeric: tabular-nums; }
.button.deadline-row { display: flex; justify-content: flex-start; width: 100%; text-align: left; gap: 10px; padding-inline: 3px; }
.deadline-row > span { color: var(--red); font-size: .78rem; min-width: 45px; flex: none; }
.deadline-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .85rem; }
.calendar-header { padding: 12px 14px; }
.period-row, .view-row, .planner-toolbar { justify-content: space-between; gap: 6px; }
.period-row .eyebrow { display: block; margin-bottom: 2px; }
.period-row h1 { font-size: 1.47rem; }
.view-row { padding-top: 10px; }
.segmented { display: inline-flex; gap: 2px; align-items: center; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--canvas); }
.button.segment { min-height: 32px; border-radius: 6px; color: var(--muted); }
.button.segment[aria-pressed="true"] { background: var(--tint); color: var(--accent); }
.weekday-head { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); text-align: center; padding: 7px 0;
  font-size: .76rem; color: var(--muted); background: var(--canvas); border-block: 1px solid var(--line); }
.calendar-grid {
  flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: repeat(var(--weeks), minmax(82px, 1fr)); align-content: stretch;
}
.calendar-grid.week-grid { grid-template-rows: minmax(min-content, 1fr); }
.button.calendar-cell {
  align-self: stretch; min-height: 0; align-items: stretch; justify-content: flex-start; justify-self: stretch;
  flex-direction: column; border: 0; border-inline-end: 1px solid var(--line); border-block-end: 1px solid var(--line);
  border-radius: 0; gap: 2px; padding: 4px; text-align: start; font-size: .79rem; overflow: hidden;
}
.button.calendar-cell:nth-child(7n) { border-inline-end: 0; }
.calendar-cell.outside { background: var(--canvas); color: var(--muted); }
.button.calendar-cell.selected { background: var(--tint); }
.celltop { display: flex; min-height: 23px; justify-content: space-between; align-items: center; margin: 0 2px 2px; }
.celltop > span:first-child { display: grid; place-items: center; inline-size: 23px; block-size: 23px; }
.today-chip { background: var(--accent); color: var(--on-accent); border-radius: 5px; }
.cell-deadlines { font-size: .69rem; }
.calendar-pill { min-width: 0; display: grid; gap: 2px; padding: 2px 4px; border-radius: 4px; background: var(--wash); color: var(--project); line-height: 1.15; }
.calendar-pill.flagged { background: var(--red-tint); color: var(--red); }
.pill-title { overflow: hidden; display: block; text-overflow: ellipsis; white-space: nowrap; font-size: .69rem; font-weight: 650; }
.pill-title svg, .pill-title i { display: inline-block; margin-inline-end: 4px; }
.pill-title i { inline-size: 3px; block-size: 7px; border-radius: 2px; }
.calendar-pill small { font-size: .68rem; line-height: 1.3; overflow-wrap: anywhere; }
.week-grid .calendar-pill { margin-block: 2px; padding: 4px; }
.more-items { font-size: .67rem; padding-inline-start: 3px; color: var(--muted); }
.day-agenda { padding: 15px; overflow-y: auto; border-block-start: 1px solid var(--line); }
.button.agenda-line {
  width: 100%; display: grid; grid-template-columns: minmax(118px, 31%) 1fr; text-align: start;
  justify-content: start; margin: 0 0 7px; min-height: 43px; background: var(--wash);
}
.agenda-line span { color: var(--project); font-size: .78rem; }
.agenda-line strong { overflow-wrap: anywhere; }
.day-heading { padding: 13px 14px 10px; }
.day-heading h2 { font-size: 1.42rem; }
.button.flag {
  width: 100%; justify-content: start; background: var(--red-tint); color: var(--red); margin-block-end: 5px;
  text-align: start; min-height: 35px;
}
.flag span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.late-list { background: var(--red-tint); padding: 10px; border-radius: 8px; margin-block-end: 14px; }
.late-list .section-label { color: var(--red); }
.day-body > .compact { margin-block-end: 12px; }
.checklist { background: var(--canvas); border: 1px solid var(--line); border-radius: 8px; padding: 8px; margin-block-end: 8px; min-width: 0; }
.checklist-heading { display: flex; justify-content: space-between; align-items: center; gap: 5px; }
.checklist-heading h3 { font-size: .9rem; color: var(--project); overflow-wrap: anywhere; }
.checklist-heading .button { width: 30px; min-height: 31px; }
.button.hours-link { text-align: start; background: var(--wash); color: var(--project); min-height: 29px; font-size: .76rem; padding: 3px 6px; margin-bottom: 3px; }
.description { color: var(--muted); font-size: .84rem; white-space: pre-wrap; overflow-wrap: anywhere; margin: 5px 0; }
.task-row { display: flex; gap: 3px; align-items: flex-start; min-width: 0; }
.task-label { display: flex; align-items: flex-start; min-width: 0; flex: 1; gap: 7px; min-height: 37px; padding-block: 7px; cursor: pointer; }
.task-label input { appearance: none; flex: none; margin: 2px 0 0; width: 17px; height: 17px; border: 1px solid var(--muted); background: var(--surface); border-radius: 4px; cursor: pointer; }
.task-label input:checked { background: var(--accent); border-color: var(--accent); }
.task-label input:checked::after { content: ''; display: block; inline-size: 9px; block-size: 5px; margin: 4px 3px; transform: rotate(-45deg); border: solid var(--on-accent); border-width: 0 0 2px 2px; }
.red .task-label input { border-color: var(--red); }
.task-copy { display: grid; min-width: 0; font-size: .85rem; overflow-wrap: anywhere; }
.task-row .button { width: 29px; min-height: 35px; }
.task-copy small { color: inherit; font-size: .75rem; margin-top: 2px; }
.desktop-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .76rem; }
.mobile-main, .bottom-nav { display: none; }

.gate { min-height: 100dvh; display: grid; place-items: center; padding: 20px max(20px, env(safe-area-inset-right)) 20px max(20px, env(safe-area-inset-left)); }
.gate-card { max-width: 400px; width: 100%; display: grid; gap: 13px; padding: 24px; }
.gate-card h1 { margin: 6px 0 1px; }
.gate-card form { display: grid; gap: 10px; }
.gate-card > .button { justify-self: start; }
.settings-main { max-width: 740px; margin: 0 auto; display: grid; gap: 13px; padding: 20px 24px; }
.settings-title { display: flex; align-items: center; gap: 6px; }
.settings-card { padding: 16px; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.settings-card h2, .settings-card p, .settings-card > .button-row { width: 100%; overflow-wrap: anywhere; }
.settings-card h2 { margin-bottom: 4px; }
.settings-card p { font-size: .88rem; }
.button-row { display: flex; flex-wrap: wrap; gap: 6px; }
.dialog {
  color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  inline-size: min(450px, calc(100% - 25px)); max-height: min(780px, calc(100dvh - 34px)); overflow: hidden; padding: 0;
}
.dialog[open] { display: flex; flex-direction: column; animation: appear .15s ease-out; }
.dialog-wide { inline-size: min(840px, calc(100% - 25px)); max-height: calc(100dvh - 26px); }
@keyframes appear { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.dialog::backdrop { background: rgb(16 31 23 / .38); }
.dialog-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 17px 5px; }
.dialog-header h2 { font-size: 1.32rem; overflow-wrap: anywhere; }
.dialog-body { overflow-y: auto; scrollbar-width: thin; padding: 7px 17px; min-width: 0; }
.dialog-body > p + p { margin-top: 7px; }
.dialog-actions { display: flex; gap: 7px; padding: 10px 17px 15px; justify-content: flex-end; flex-wrap: wrap; }
.dialog-actions:empty { padding: 0 0 10px; }
.form-error { font-size: .86rem; color: var(--red); overflow-wrap: anywhere; }
.dialog > .form-error { padding: 3px 17px; }
.choice { display: flex; width: 100%; justify-content: start; text-align: start; min-height: 43px; margin-block-end: 6px; border: 1px solid var(--line); }
.field { display: grid; gap: 4px; margin-block-end: 12px; min-width: 0; color: var(--muted); font-size: .84rem; font-weight: 600; }
.field input, .field select, .field textarea { font-size: 1rem; font-weight: 400; color: var(--ink); width: 100%; }
.two-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
fieldset { min-width: 0; padding: 0; border: 0; margin: 0 0 12px; }
legend { padding: 0 0 4px; color: var(--muted); font-size: .84rem; font-weight: 620; }
.weekday-picker { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.weekday-toggle { display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 34px; font-size: .75rem; }
.weekday-toggle input { accent-color: var(--accent); margin: 0; }
.color-picker { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; }
.button.color-swatch { min-height: 36px; padding: 1px; }
.color-swatch i { inline-size: 27px; block-size: 23px; background: var(--wash); border-radius: 5px; border: 1px solid transparent; }
.color-swatch[aria-pressed="true"] i { border: 2px solid var(--project); }
.project-form-hours { margin: 6px 0 12px; }
.project-dates { font-weight: 650; }
.project-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 15px 0 8px; padding-block-start: 13px; border-top: 1px solid var(--line); }
.project-metrics div { display: grid; }
.project-metrics small { color: var(--muted); }
.project-metrics strong { font-size: 1.27rem; }
.notice {
  position: fixed; z-index: 5; left: 50%; transform: translateX(-50%);
  bottom: calc(20px + env(safe-area-inset-bottom)); padding: 9px 14px; max-width: min(430px, 92vw);
  color: var(--on-accent); background: var(--accent); border-radius: 8px; font-size: .86rem; text-align: center;
}
.planner-project { font-weight: 650; margin-bottom: 8px; }
.planner-hint { margin: 8px 0; font-size: .84rem; }
.planner-toolbar input { min-height: 36px; font-size: .88rem; }
.planner-content { display: grid; grid-template-columns: minmax(0, 2.55fr) minmax(0, 1fr); gap: 12px; }
.planner-frame { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; min-width: 0; }
.timeline, .timeline-head { display: grid; grid-template-columns: 66px minmax(0, 1fr) minmax(0, 1fr); }
.time-viewport { height: min(51dvh, 465px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.timeline { height: 1128px; position: relative; }
.timeline-head { background: var(--canvas); border-bottom: 1px solid var(--line); color: var(--muted); font-size: .78rem; font-weight: 650; }
.timeline-head span { padding: 7px 4px; }
.timeline-head span:nth-child(2) { color: var(--accent); }
.ticks { background: var(--canvas); position: relative; border-inline-end: 1px solid var(--line); }
.ticks span { position: absolute; inset-inline: 5px 3px; font-size: .71rem; color: var(--muted); padding-block-start: 3px; }
.my-time, .busy-time {
  position: relative; border-inline-end: 1px solid var(--line);
  background-image: repeating-linear-gradient(to bottom, var(--line) 0px, var(--line) 1px, transparent 1px, transparent 11.75px);
}
.my-time { touch-action: none; cursor: crosshair; user-select: none; }
.busy-time { background-color: var(--canvas); touch-action: pan-y; }
.blocked { pointer-events: none; position: absolute; inset-inline: 0; background: var(--hover); opacity: .8; }
.time-block {
  position: absolute; border: 1px solid var(--project); background: var(--wash); color: var(--project);
  border-radius: 5px; overflow: hidden; padding: 1px 5px; inset-inline-start: 0; max-width: 100%;
  font-size: .72rem; font-variant-numeric: tabular-nums;
}
.time-block strong, .time-block span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.time-block.editable { cursor: pointer; }
.time-block.chosen { outline: 1px solid var(--project); outline-offset: -2px; }
.time-block.ghost { opacity: .65; pointer-events: none; border-style: dashed; }
.planner-tasks {
  border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: var(--canvas);
  overflow-y: auto; max-height: calc(min(51dvh, 465px) + 35px); font-size: .84rem;
}
.planner-tasks h3 { font-size: .88rem; margin-bottom: 8px; }
.planner-tasks h4 { font-size: .8rem; color: var(--project, var(--muted)); margin-top: 9px; }
.planner-tasks p { margin-top: 5px; overflow-wrap: anywhere; }
.planner-tasks small { display: block; }
.planner-controls { display: flex; justify-content: space-between; gap: 6px; margin-top: 7px; }

@media (max-width: 1050px) {
  .desktop-main { padding-inline: 14px; }
  .workspace { gap: 9px; }
  .metric .tile { display: none; }
}
@media (max-width: 760px) {
  .desktop-main, .desktop-action { display: none !important; }
  .mobile-main { display: grid; gap: 12px; padding: 13px max(13px, env(safe-area-inset-right)) calc(82px + env(safe-area-inset-bottom)) max(13px, env(safe-area-inset-left)); }
  .app-header { position: sticky; top: 0; z-index: 2; padding-top: env(safe-area-inset-top); }
  .header-inner { min-height: 58px; padding-inline: max(15px, env(safe-area-inset-right)) max(15px, env(safe-area-inset-left)); }
  .brand-mark { width: 33px; height: 33px; }
  .brand { font-size: 1.27rem; }
  .header-sync { max-inline-size: 16ch; font-size: .72rem; }
  .new-button span { display: none; }
  .button.new-button { min-width: 44px; height: 44px; }
  .button, .icon-button { min-height: 44px; }
  .icon-button { width: 44px; }
  .mobile-title { padding: 4px 3px 0; }
  .mobile-title h1, .settings-title h1 { font-size: 1.8rem; }
  .mobile-title .eyebrow { margin-bottom: 4px; display: block; }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: fixed; inset: auto 0 0; z-index: 3;
    padding: 4px max(8px, env(safe-area-inset-right)) max(4px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    background: var(--surface); border-top: 1px solid var(--line);
  }
  .tab { display: grid; gap: 3px; justify-items: center; align-content: center; padding: 3px; min-height: 52px; font-size: .73rem; color: var(--muted); }
  .tab[aria-current="page"] { color: var(--accent); background: var(--tint); }
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin: 0; }
  .metrics .metric:last-child { display: none; }
  .button.metric { min-height: 68px; padding: 9px 8px; }
  .metric-label { font-size: .76rem; }
  .metric-text strong { font-size: 1.56rem; }
  .next-deadline { border: 1px solid var(--line); border-radius: var(--radius); padding: 9px 11px; background: var(--surface); }
  .next-deadline .section-label { margin-bottom: 1px; }
  .next-deadline .deadline-row { min-height: 44px; }
  .mobile-main .projects-pane > h2 { display: none; }
  .projects-body, .day-body { padding: 11px; }
  .day-heading + .day-body { padding-top: 1px; }
  .standalone-day { border: 0; background: none; }
  .standalone-day .day-body { padding: 0 1px; }
  .checklist { background: var(--surface); padding: 8px 10px; }
  .checklist-heading h3 { font-size: .98rem; }
  .checklist-heading .button { width: 44px; min-height: 44px; }
  .task-label { align-items: center; min-height: 44px; gap: 10px; }
  .task-label input { width: 20px; height: 20px; margin-top: 0; }
  .task-label input:checked::after { margin: 5px 4px; }
  .task-copy { font-size: .93rem; }
  .task-row .button { width: 44px; min-height: 44px; }
  .button.hours-link { min-height: 44px; font-size: .82rem; }
  .button.inline-add { display: none; }
  .calendar-header { padding: 8px 9px; }
  .period-row h1 { font-size: 1.22rem; }
  .period-row .eyebrow { display: none; }
  .calendar-grid { overflow: visible; grid-template-rows: repeat(var(--weeks), minmax(70px, auto)); }
  .button.calendar-cell { padding: 3px 1px; }
  .celltop { margin-inline: 2px; }
  .celltop > span:first-child { inline-size: 20px; block-size: 21px; }
  .calendar-pill { padding: 2px; }
  .pill-title { font-size: .6rem; white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .button.segment { min-height: 44px; }
  .pill-title svg { width: 8px; margin-inline-end: 1px; }
  .pill-title i { margin-inline-end: 2px; width: 2px; }
  .more-items { font-size: .58rem; padding-inline-start: 1px; }
  .week-grid { min-height: 145px; }
  .week-grid .calendar-pill { padding: 2px; overflow: hidden; }
  .week-grid .calendar-pill small { font-size: .59rem; }
  .settings-main { padding: 15px 13px calc(86px + env(safe-area-inset-bottom)); }
  .notice { bottom: calc(62px + env(safe-area-inset-bottom)); }
  .dialog { max-height: calc(100dvh - max(12px, env(safe-area-inset-top))); width: 100%; max-width: 100%; border-radius: 15px 15px 0 0; margin: auto 0 0; border-inline: 0; border-bottom: 0; }
  .dialog-header, .dialog-body, .dialog-actions { padding-inline-start: max(13px, env(safe-area-inset-left)); padding-inline-end: max(13px, env(safe-area-inset-right)); }
  .dialog-actions { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .weekday-toggle { display: grid; align-content: center; justify-items: center; gap: 2px; min-height: 44px; }
  .button.color-swatch { min-height: 44px; }
  .planner-toolbar { align-items: flex-start; flex-wrap: wrap; }
  .planner-toolbar input { font-size: 1rem; min-height: 44px; }
  .planner-content { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .planner-tasks { max-height: 145px; }
  .time-viewport { height: min(42dvh, 345px); min-height: 180px; }
  .planner-toolbar .date-nav .button { width: 38px; }
  .planner-controls .button { font-size: .8rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
