.planning-panel {display:grid;gap:1rem}
.planning-panel small,.planning-row small {color:var(--muted)}
.planning-lead {margin:0 0 .9rem;font-size:1.18rem;line-height:1.4;overflow-wrap:anywhere}
.planning-group {border:0}
.planning-group summary {cursor:pointer;padding:.65rem 0;min-height:44px;font-weight:550}
.planning-group summary span {float:right;color:var(--muted);font-variant-numeric:tabular-nums}
.planning-panel #planning-facts>button {margin-top:.75rem}
.planning-row {padding:.6rem 0;display:grid;gap:.22rem}
.planning-title {justify-self:start;text-align:start;background:transparent;color:var(--ink);border:none;padding:.15rem 0;overflow-wrap:anywhere;font:inherit;font-weight:600}
.planning-title:hover {color:var(--accent);text-decoration:underline}
.planning-actions,.planning-search {display:flex;align-items:center;gap:.45rem;flex-wrap:wrap}
.planning-actions {margin-top:.35rem}
.planning-search input {flex:1 1 10rem;min-width:0}
#planning-match {margin-top:.5rem;display:grid;gap:.45rem}
#planning-status:empty,#planning-results:empty {display:none}
#planning-status {color:var(--accent)}
@font-face {
  font-family:"Atkinson Hyperlegible Next";
  src:url("fonts/Atkinson.ttf") format("truetype");
  font-weight:200 800;
  font-display:swap;
}
@font-face {
  font-family:"Noto Serif";
  src:url("fonts/NotoSerif.ttf") format("truetype");
  font-weight:100 900;
  font-display:swap;
}
:root[data-font=atkinson] { --font-ui:"Atkinson Hyperlegible Next",sans-serif; }
:root[data-font=noto] { --font-ui:"Noto Serif",serif; }
@font-face {
  font-family:"Ubuntu Sans";
  src:url("fonts/UbuntuSans.ttf") format("truetype");
  font-weight:100 800;
  font-display:swap;
}
:root {
  --font-ui:"Ubuntu Sans",sans-serif;
  font-size:var(--ios-body-size,100%);
  --ink:#192c40;
  --on-accent:#fff;
  --muted:#536579;
  --line:#dae2eb;
  --stroke:#738195;
  --danger:#9c303a;
  --danger-bg:#ffebed;
  --shadow:0 16px 54px #22252b27;
  --row:58px;
  --page-width:812px;
  --page-gutter:clamp(20px,5vw,64px);
  --check-track:44px;
  --row-control:44px;
  --nav-icon:26px;
  --nav-gap:8px;
  --gold:#82550b;
  --list-royal:#2348b5;
  --list-ochre:var(--gold);
  --list-ocean:#346c98;
  --list-plum:#8b5081;
  --list-brick:#a44b36;
  --list-slate:#61657b;
  color-scheme:light;
  font-family:var(--font-ui);
}
:root, :root[data-palette=royal], .palette-choice[data-palette=royal] {
  --bg:#fafbff;
  --rail:#eef2fb;
  --surface:#f3f6fc;
  --hover:#e9eefb;
  --accent:#2348b5;
  --accent-hover:#19388e;
  --selected:#e3ebff;
}
:root[data-palette=indigo],.palette-choice[data-palette=indigo] {
  --bg:#ffffff;
  --rail:#f3f7fb;
  --surface:#f4f7fa;
  --hover:#eaf2fa;
  --accent:#005fb8;
  --accent-hover:#004b91;
  --selected:#dfedfc;
}
:root[data-palette=clay],.palette-choice[data-palette=clay] {
  --bg:#fffaf5;
  --rail:#f6ede4;
  --surface:#faf0e8;
  --hover:#f7ece2;
  --accent:#97432e;
  --accent-hover:#793323;
  --selected:#f8e5d9;
}
:root[data-palette=plum],.palette-choice[data-palette=plum] {
  --bg:#fdfafd;
  --rail:#f2ecf3;
  --surface:#f7f1f7;
  --hover:#f2ebf3;
  --accent:#783e75;
  --accent-hover:#622e60;
  --selected:#efe3f0;
}
:root[data-palette=graphite],.palette-choice[data-palette=graphite] {
  --bg:#fafaf8;
  --rail:#eeeef0;
  --surface:#f3f3f4;
  --hover:#ededf0;
  --accent:#414d54;
  --accent-hover:#313a42;
  --selected:#e1e6e7;
}
:root[data-theme=dark] {
  --ink:#f1f5f9;
  --muted:#bac8d7;
  --line:#354354;
  --stroke:#8899ac;
  --danger:#ffb2b9;
  --danger-bg:#472931;
  --shadow:0 16px 54px #0008;
  --gold:#f3ca76;
  --list-blue:#78baff;
  --list-royal:#abbcff;
  --list-ocean:#9cc5e8;
  --list-plum:#dca8d7;
  --list-brick:#f2a48d;
  --list-slate:#b4b9ce;
  color-scheme:dark;
}
:root[data-theme=dark],:root[data-theme=dark][data-palette=royal],:root[data-theme=dark] .palette-choice[data-palette=royal] {
  --bg:#181f32;
  --rail:#131a2b;
  --surface:#222c45;
  --hover:#2b3755;
  --accent:#abbcff;
  --accent-hover:#c7d3ff;
  --on-accent:#15264f;
  --selected:#2c3d70;
}
:root[data-theme=dark][data-palette=indigo],:root[data-theme=dark] .palette-choice[data-palette=indigo] {
  --bg:#161e28;
  --rail:#121923;
  --surface:#202b38;
  --hover:#283748;
  --accent:#78baff;
  --accent-hover:#a4d3ff;
  --on-accent:#102840;
  --selected:#203e5b;
}
:root[data-theme=dark][data-palette=clay],:root[data-theme=dark] .palette-choice[data-palette=clay] {
  --bg:#2a211d;
  --rail:#211917;
  --surface:#392c25;
  --hover:#403129;
  --accent:#ffc0a5;
  --accent-hover:#ffd1bc;
  --on-accent:#41271b;
  --selected:#50372d;
}
:root[data-theme=dark][data-palette=plum],:root[data-theme=dark] .palette-choice[data-palette=plum] {
  --bg:#25202a;
  --rail:#201a24;
  --surface:#342a3a;
  --hover:#392f41;
  --accent:#ebbae9;
  --accent-hover:#f4ccf3;
  --on-accent:#412342;
  --selected:#4c3650;
}
:root[data-theme=dark][data-palette=graphite],:root[data-theme=dark] .palette-choice[data-palette=graphite] {
  --bg:#222227;
  --rail:#19191c;
  --surface:#2b2b30;
  --hover:#343439;
  --accent:#cbdadd;
  --accent-hover:#dfebed;
  --on-accent:#252d30;
  --selected:#3b4648;
}
:root[data-density=compact] { --row:46px; }

* { box-sizing:border-box; }
[hidden] { display:none !important; }
body { margin:0; background:var(--bg); color:var(--ink); font-size:var(--ios-body-size,15px); line-height:1.5; }
button,input,select,textarea { color:inherit; font:inherit; }
button { cursor:pointer; border:0; border-radius:8px; background:none; }
button:disabled { cursor:default; opacity:.6; }
:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
h1,h2,h3,p { margin:0; }
h1,h2,h3 { line-height:1.2; }
h1 { font-size:clamp(2.4rem,4.6vw,3.6rem); font-weight:560; line-height:1.08; letter-spacing:-.035em; overflow-wrap:anywhere; }
h2 { font-size:1.2rem; font-weight:650; }
h3 { font-size:.88rem; font-weight:650; }
input[type=checkbox] { width:18px; height:18px; flex:none; margin:0; accent-color:var(--accent); }

.primary,.quiet,.outline,.icon {
  min-height:40px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  white-space:nowrap;
  font-weight:600;
}
.primary { background:var(--accent); color:var(--on-accent); padding:0 14px; }
.primary:hover { background:var(--accent-hover); }
.quiet { padding:0 9px; color:var(--muted); }
.outline { border:1px solid var(--line); padding:0 12px; }
.icon { width:40px; flex:0 0 auto; color:var(--muted); font-size:1.25rem; }
.outline:hover,.quiet:hover,.icon:hover { background:var(--hover); color:var(--ink); }
.danger { color:var(--danger); }
kbd { font-family:inherit; font-size:.72rem; font-weight:500; padding:2px 5px; border:1px solid var(--line); border-radius:4px; white-space:nowrap; }

.ui-icon {
  display:inline-block; flex:none; width:18px; height:18px; vertical-align:middle; pointer-events:none;
  fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round;
}
.scope>.ui-icon,.scope-mark>.ui-icon,.nav-item>.ui-icon,.settings-entry>.ui-icon { width:20px; height:20px; }

.shell { min-height:100dvh; display:grid; grid-template-columns:232px minmax(0,1fr); }
.rail {
  position:sticky; top:0; height:100dvh; background:var(--rail);
  display:flex; flex-direction:column; padding:22px 14px 12px; z-index:5; border-inline-end:1px solid var(--line);
}
.brand,.mobile-brand { display:flex; align-items:center; gap:10px; padding:4px 8px; color:var(--ink); font-weight:700; font-size:1.13rem; letter-spacing:-.02em; }
.brand-mark { display:inline-block; width:27px; height:27px; background:url("kritado-mark.svg") center / contain no-repeat; flex:none; }
.rail-add { min-height:44px; width:100%; }
.rail-add kbd { margin-left:auto; border-color:currentColor; opacity:.8; }
#rail-contents { display:flex; flex-direction:column; flex:1; min-height:0; }
#rail-primary { display:flex; flex-direction:column; }
#rail-collections { overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; margin:12px -3px 0; padding:8px 3px 4px; }
.rail-label { color:var(--muted); font-size:.82rem; font-weight:650; }
.rail-list-header { display:flex; align-items:center; justify-content:space-between; }
.rail-secondary { margin-top:8px; }
.rail .drawer-header { display:none; }
.mini-icon { width:34px; height:34px; display:grid; place-items:center; color:var(--muted); }
.mini-icon:hover { background:var(--hover); color:var(--accent); }
.scope {
  width:100%; min-height:40px; display:grid; grid-template-columns:20px minmax(0,1fr) auto;
  align-items:center; gap:9px; padding:0 9px; text-align:left; margin-bottom:2px;
  color:var(--muted); font-weight:560; font-size:.91rem;
}
.scope>span:nth-child(2) { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.scope:hover { background:var(--hover); }
.scope.active { position:relative; background:var(--selected); color:var(--accent); font-weight:670; }
.scope.active::after { content:""; position:absolute; inset-inline-start:0; inset-block:29%; width:3px; border-radius:2px; background:currentColor; }
.scope small { font-size:.75rem; font-variant-numeric:tabular-nums; }
.indigo { --list-color:var(--list-blue,#005fb8); }
.royal { --list-color:var(--list-royal); }
.ochre { --list-color:var(--list-ochre); }
.ocean { --list-color:var(--list-ocean); }
.plum { --list-color:var(--list-plum); }
.brick { --list-color:var(--list-brick); }
.slate { --list-color:var(--list-slate); }
.list-dot { display:inline-block; flex:none; width:8px; height:8px; border-radius:50%; background:var(--list-color,var(--accent)); vertical-align:middle; }
.scope-mark.list-glyph { display:inline-flex; color:var(--list-color,var(--accent)); }
.heading-main .list-dot { width:11px; height:11px; vertical-align:middle; margin-inline-start:.3em; }
.rail-footer { margin-top:auto; flex:none; padding-top:10px; }
.settings-entry { width:100%; justify-content:flex-start; }
.scrim,.mobile-brand,.mobile-settings,.mobile-nav { display:none; }

#workspace { min-width:0; }
.topbar { height:59px; width:100%; max-width:calc(var(--page-width) + 2 * var(--page-gutter)); margin-inline:auto; padding:0 var(--page-gutter); display:flex; align-items:center; border-bottom:1px solid var(--line); }
.top-actions { margin-left:auto; display:flex; align-items:center; gap:4px; }
.search-open { justify-content:flex-start; font-weight:500; }
.search-open kbd { margin-left:12px; }
.workspace-inner { max-width:calc(var(--page-width) + 2 * var(--page-gutter)); width:100%; margin:0 auto; padding:36px var(--page-gutter) 72px; }
.calendar-heading { margin:0 0 24px; display:flex; align-items:flex-start; justify-content:space-between; gap:18px; }
.heading-date { color:var(--muted); font-size:.94rem; margin-top:9px; }
.calendar-tools,.date-controls { display:flex; align-items:center; gap:3px; }
.heading-main { min-width:0; }
.calendar-tools { flex:0 0 auto; max-width:100%; flex-wrap:wrap; margin-top:3px; }
.date-controls .icon { width:32px; min-height:35px; }
.date-controls .icon[aria-pressed=true] { background:var(--selected); color:var(--accent); }
.today-btn { font-size:.81rem; min-height:35px; }
.segmented { display:inline-flex; gap:2px; padding:3px; border-radius:9px; background:var(--surface); }
.segmented button { min-height:30px; padding:0 12px; border-radius:6px; color:var(--muted); font-size:.83rem; font-weight:600; }
.segmented button:hover { background:var(--hover); color:var(--ink); }
.segmented button[aria-pressed=true] { background:var(--bg); color:var(--accent); box-shadow:0 1px 3px #1622381a; }
.stage { min-width:0; display:grid; gap:18px; }

.calendar-grid { display:grid; }
.month-grid,.month-weekdays { grid-template-columns:repeat(7,minmax(0,1fr)); column-gap:2px; }
.month-grid { row-gap:4px; }
.date-cell {
  min-width:0; display:flex; flex-direction:column; align-items:center; justify-content:flex-start;
  gap:4px; min-height:62px; text-align:center; padding:6px 3px; position:relative;
}
.date-cell:hover { background:var(--hover); }
.date-cell:focus-visible { outline-offset:-2px; z-index:1; }
.week-strip .date-cell {
  display:grid; grid-template-columns:2rem 3.25em minmax(0,1fr) auto; grid-template-areas:"number weekday preview markers";
  align-items:center; justify-content:stretch; text-align:start; gap:clamp(5px,1vw,14px); min-height:var(--row);
}
.week-label { grid-area:weekday; color:var(--muted); font-size:.86rem; font-weight:550; }
.date-number { grid-area:number; display:grid; place-items:center; border-radius:50%; width:2rem; height:2rem; font-variant-numeric:tabular-nums; font-size:.96rem; font-weight:600; line-height:1; }
.date-cell.chosen .date-number { background:var(--accent); color:var(--on-accent); }
.date-cell.current:not(.chosen) .date-number { box-shadow:inset 0 0 0 1px var(--accent); color:var(--accent); }
.date-markers { grid-area:markers; display:flex; gap:3px; align-items:center; justify-content:center; flex-wrap:wrap; min-height:6px; }
.marker { display:inline-block; width:6px; height:6px; flex:none; border-radius:50%; background:var(--list-color,var(--accent)); }
.marker.due { width:5px; height:5px; background:var(--danger); border-radius:1px; transform:rotate(45deg); }
.marker.done { border:1px solid var(--muted); background:none; }
.calendar-legend { display:flex; justify-content:center; flex-wrap:wrap; gap:5px 16px; list-style:none; margin:18px 0 0; padding:0; color:var(--muted); font-size:.75rem; }
.calendar-legend li { display:flex; align-items:center; gap:6px; }
.month-weekdays { display:grid; padding-block:5px 9px; color:var(--muted); font-size:.8rem; text-align:center; font-weight:550; }
.month-cell { min-height:64px; }
.month-cell.outside .date-number { color:var(--muted); font-weight:400; }
.cell-preview {
  grid-area:preview; min-width:0; max-width:100%;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.76rem; color:var(--muted);
}
.week-strip .cell-preview { text-align:start; font-size:.94rem; color:var(--ink); }

#agenda { min-width:0; }
#today-attention { display:flex; flex-wrap:wrap; align-items:center; gap:0 1.75rem; margin:0 0 .7rem; }
.today-counts,.today-choices { display:flex; align-items:center; flex-wrap:wrap; gap:0 1.1rem; }
.today-counts button { display:grid; justify-items:start; min-height:44px; min-width:44px; gap:.08rem; padding:.2rem 0; text-align:start; line-height:1.25; }
.today-counts strong { font-size:1.3rem; font-weight:650; font-variant-numeric:tabular-nums; }
.today-counts span { color:var(--muted); font-size:.82rem; }
.today-counts button:hover span,.today-counts [aria-pressed=true] span { color:var(--accent); text-decoration:underline; text-underline-offset:.26em; }
.today-counts [aria-pressed=true] strong { color:var(--accent); }
.today-choices { margin-inline-start:auto; gap:0 .8rem; }
.today-choices .quiet { color:var(--accent); min-height:44px; padding-inline:0; font-size:.85rem; }
.inline-form {
  display:grid; grid-template-columns:var(--check-track) minmax(0,1fr) auto; gap:0; align-items:center;
  padding:3px 4px 3px 0; border-radius:8px;
}
.inline-form:focus-within { background:var(--surface); }
.inline-form:has(#inline-title:focus-visible) { outline:2px solid var(--accent); outline-offset:2px; }
.inline-form .icon-plus { color:var(--accent); justify-self:center; }
.inline-form #inline-title { padding:8px 0; background:none; border:0; outline:0; }
.inline-form .inline-submit { min-height:34px; padding-inline:12px; font-size:.86rem; }
.agenda-header { min-height:46px; display:flex; gap:8px; justify-content:space-between; align-items:center; }
.agenda-tools { margin-left:auto; display:flex; flex-wrap:wrap; justify-content:flex-end; align-items:center; gap:2px; }
.agenda-tools .quiet { font-size:.79rem; }
.agenda-group { margin-top:5px; }
.agenda-group+.agenda-group { margin-top:21px; }
.group-head { display:flex; align-items:baseline; gap:7px; padding-bottom:9px; }
.group-count { font-size:.75rem; color:var(--muted); font-variant-numeric:tabular-nums; }
.group-count.urgent { color:var(--danger); }
.group-empty,.loading { color:var(--muted); padding:14px 0; font-size:.89rem; }
.loading,.load-error { padding:16px 0; }
.load-error p { margin:12px 0; }
.task-row {
  min-height:var(--row); display:grid; grid-template-columns:var(--check-track) minmax(0,1fr);
  grid-auto-flow:column; grid-auto-columns:max-content; align-items:start;
}
.task-row:hover { background:var(--hover); }
.task-row:focus-within { background:var(--hover); }
.task-row .icon { width:38px; }
.check { width:42px; min-height:44px; display:grid; place-items:center; padding:0; }
.check span {
  width:20px; height:20px; border:1.5px solid var(--stroke); border-radius:50%;
  display:grid; place-items:center; color:var(--accent); line-height:1; font-weight:700;
}
.check:hover span { border-color:var(--accent); background:var(--selected); }
.task-row.completed .check span { border-color:var(--accent); background:var(--accent); color:var(--on-accent); font-size:.72rem; }
.task-body { text-align:left; padding:6px 0; min-height:44px; min-width:0; display:flex; flex-direction:column; justify-content:center; align-items:flex-start; }
.task-title { font-weight:530; overflow-wrap:anywhere; }
.task-row.completed .task-title { color:var(--muted); text-decoration:line-through; text-decoration-thickness:1px; }
.task-meta { color:var(--muted); font-size:.77rem; display:flex; flex-wrap:wrap; gap:2px 9px; }
.task-meta .late { color:var(--danger); font-weight:650; }
.task-list { display:inline-flex; align-items:center; gap:5px; }
.task-list .list-dot { width:6px; height:6px; }
.star { color:var(--muted); font-size:1.2rem; font-weight:400; }
.icon.starred { color:var(--gold); }
.starred .icon-star { fill:currentColor; }
.agenda-step-mark .ui-icon,.journal-status .ui-icon { width:1em; height:1em; }
.check .ui-icon { width:14px; height:14px; stroke-width:2.4; }
.capture-chip .ui-icon { width:1em; height:1em; }
.more { margin-top:6px; }

dialog {
  color:var(--ink); background:var(--bg); border:0; border-radius:15px;
  max-width:610px; width:calc(100% - 32px); max-height:calc(100dvh - 32px); padding:0; box-shadow:var(--shadow);
}
dialog::backdrop { background:#161d2c65; }
dialog.task-editor {
  inset:0 0 0 auto; margin:0; border-radius:12px 0 0 12px;
  height:100dvh; max-height:100dvh; max-width:490px; border-block:0;
}
dialog.task-editor::backdrop { background:#161d2c3d; }
.sheet-body { padding:19px clamp(16px,4vw,26px) 21px; }
.sheet-header { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin-bottom:16px; }
.sheet-header h2 { margin-top:4px; font-size:1.48rem; font-weight:660; letter-spacing:-.02em; }
.sheet-header h2:focus,#journal-heading:focus { outline:0; }
.eyebrow { color:var(--muted); font-size:.71rem; font-weight:620; letter-spacing:.05em; }
.sheet-header .icon { font-size:1.4rem; }

dialog.welcome-sheet { max-width:530px; }
.welcome-sheet .sheet-header { align-items:center; margin-bottom:12px; }
.welcome-sheet .sheet-header h2 { font-size:clamp(1.45rem,6vw,2rem); }
.welcome-instructions { color:var(--muted); max-width:46ch; }
.welcome-example {
  display:grid; gap:10px; margin:24px 0;
}
.welcome-example-label { display:flex; align-items:center; gap:8px; color:var(--muted); font-size:.85rem; }
.welcome-example-label .ui-icon { color:var(--accent); }
#welcome-result { display:grid; min-width:0; gap:8px; }
.welcome-typed,.welcome-result,.welcome-entry {
  display:grid; gap:5px; min-width:0; padding:3px 0; overflow-wrap:anywhere;
}
.welcome-typed,.welcome-example-title,.welcome-entry strong { font-size:1.13rem; }
.welcome-result { margin-top:6px; color:var(--accent); }
.welcome-plan { color:var(--accent); font-weight:650; }
.welcome-result .welcome-plan,.welcome-entry p { font-size:.88rem; }
.welcome-entry mark {
  justify-self:start; border-radius:4px; padding:1px 4px; color:var(--ink); background:var(--selected);
}
.welcome-dates {
  display:grid; grid-template-columns:repeat(auto-fit,minmax(min(7.5rem,100%),1fr));
  gap:6px 10px; margin:0;
}
.welcome-dates > div { min-width:0; }
.welcome-dates dt { color:var(--muted); font-size:.8rem; }
.welcome-dates dd { margin:0; overflow-wrap:anywhere; }
#welcome-try { justify-self:start; }
.welcome-start { display:flex; flex-wrap:wrap; align-items:center; gap:6px 12px; margin:20px 0; }
.welcome-start button { min-height:48px; max-width:100%; white-space:normal; }
.welcome-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; align-items:center; gap:6px; }
.welcome-actions .welcome-skip { margin-inline-end:auto; }
#welcome-try,.welcome-actions button { min-height:48px; white-space:normal; }
form { display:flex; flex-direction:column; gap:12px; }
label,.label,.field-heading { display:flex; flex-direction:column; gap:5px; font-size:.86rem; font-weight:620; }
input:not([type=checkbox],[type=radio]),select,textarea {
  display:block; padding:8px 9px; min-height:44px; border:0; border-radius:6px;
  width:100%; min-width:0; color:var(--ink); background:var(--surface); font-weight:440; font-size:1rem;
}
input:is([type=date],[type=time],[type=datetime-local]) {
  appearance:none; min-inline-size:0; max-inline-size:100%;
}
input::-webkit-date-and-time-value { min-width:0; text-align:start; }
input::placeholder,textarea::placeholder { color:var(--muted); }
textarea { resize:vertical; min-height:60px; }
#capture-title { font-size:1.08rem; }
.form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.form-grid > label { min-width:0; }
.form-grid input:not([type=checkbox]):not([type=radio]),.form-grid select { min-width:0; max-width:100%; }
.form-grid.three { grid-template-columns:repeat(auto-fit,minmax(124px,1fr)); }
.check-label { flex-direction:row; align-items:center; min-height:34px; gap:9px; font-weight:520; }
.hint { color:var(--muted); font-size:.81rem; }
.preview,.restore-notice { background:var(--selected); border-radius:7px; padding:9px 11px; font-size:.86rem; color:var(--accent); }
.restore-notice,.sheet-body>p { margin-bottom:9px; }
.form-actions { display:flex; justify-content:flex-end; align-items:center; gap:8px; flex-wrap:wrap; padding-top:12px; margin-top:3px; }
.sheet-body .outline { border:0; color:var(--accent); white-space:normal; }
.sheet-body .outline.danger { color:var(--danger); }
.sheet-body .outline:hover { text-decoration:underline; }
.sheet-body :where(.settings-controls,.form-actions) > button { min-height:44px; }
.sheet-body :where(.settings-controls) > .outline:first-child { padding-inline-start:0; }
.sheet-body :is(#search-field,#journal-query) { font-size:1.08rem; }
.search-scopes { display:flex; flex-wrap:wrap; gap:12px; margin-bottom:8px; }
.search-scopes button { min-height:48px; padding-inline:6px; color:var(--muted); font-weight:550; }
.search-scopes button[aria-pressed=true] { color:var(--accent); text-decoration:underline; text-underline-offset:.4em; }
.search-filter-fields { display:grid; gap:12px; padding-block:4px 12px; }
.search-filter-fields .form-actions { padding:0; margin:0; }
#search-filters summary,.focus-review summary { min-height:44px; color:var(--muted); font-weight:550; }
#search-filter-count { font-weight:400; }
.focus-review { margin-top:20px; }
.focus-review h3 { margin:10px 0 4px; }
#focus-clock { margin-bottom:12px; }
#onedrive-panel { display:grid; gap:12px; }
#onedrive-status { font-weight:600; color:var(--ink); }
.form-error { color:var(--danger); background:var(--danger-bg); border-radius:7px; padding:9px 11px; }
.task-secondary,.settings-controls { display:flex; flex-wrap:wrap; gap:5px; }
.suggestion { align-self:flex-start; }
.field-heading { flex-direction:row; justify-content:space-between; align-items:center; }
.step-row { display:grid; grid-template-columns:24px 1fr 40px; gap:7px; align-items:center; margin-top:5px; }
.file-row { display:flex; justify-content:space-between; gap:10px; }
.file-row button:first-child { overflow:hidden; text-overflow:ellipsis; white-space:normal; text-align:left; }
.attachment-preview { display:block; max-width:100%; max-height:55vh; margin:0 auto 15px; object-fit:contain; }
summary { cursor:pointer; padding:9px 0; color:var(--accent); font-weight:620; }
details { border:0; }
details .hint { padding:7px 0 10px; }
.search-results { margin-top:10px; }
.share-preview { margin-block:8px; padding:2px 0; max-height:290px; overflow:auto; }
.share-preview h3 { margin-bottom:7px; font-size:1.15rem; }
.share-preview div { padding:4px 0; overflow-wrap:anywhere; }
.bulk-items { max-height:43vh; overflow:auto; }
#calendar-import-options small { display:block; color:var(--muted); }
.bulk-option { min-height:44px; padding:6px 0; overflow-wrap:anywhere; cursor:pointer; }
.bulk-option:hover { color:var(--accent); }
.toast {
  z-index:10; position:fixed; right:20px; bottom:20px; display:flex; gap:14px; align-items:center;
  min-height:46px; max-width:min(440px,calc(100% - 32px)); padding:8px 12px;
  background:var(--ink); color:var(--bg); border-radius:9px; box-shadow:var(--shadow);
}
.toast button { color:inherit; text-decoration:underline; padding:7px; min-height:36px; }

@media(min-width:1120px) {
  .stage:has(#calendar:not([hidden]) .month-grid) { align-items:start; }
  .month-cell { min-height:74px; }
}
@media(max-width:900px) {
  .shell { grid-template-columns:196px minmax(0,1fr); }
  .calendar-heading { flex-wrap:wrap; gap:10px; }
  :root { --page-gutter:24px; }
}
@media(max-width:690px) {
  .shell { display:block; }
  .rail { display:none; position:fixed; inset:0 auto 0 0; width:min(310px,calc(100vw - 44px)); height:100dvh; }
  .rail.open { display:flex; box-shadow:var(--shadow); }
  .scope { min-height:48px; }
  .mini-icon { width:48px; height:48px; }
  .scrim { display:block; position:fixed; inset:0; background:#131c2d70; z-index:4; width:100%; height:100%; border-radius:0; }
  .topbar { height:53px; padding-inline:var(--page-gutter); }
  .mobile-brand { display:flex; padding:0; }
  .mobile-brand .brand-mark { width:24px; height:24px; }
  .mobile-settings { display:inline-flex; width:44px; height:46px; }
  .search-open { width:44px; height:46px; padding:0; justify-content:center; }
  .search-open>span:nth-child(2),.search-open kbd { display:none; }
  :root { --page-gutter:16px; --row-control:48px; }
  .workspace-inner { padding:17px var(--page-gutter) 96px; }
  .calendar-heading { gap:11px; margin-bottom:12px; }
  h1 { font-size:2rem; }
  .rail kbd { display:none; }
  .heading-date { margin-top:3px; }
  .calendar-tools { width:100%; justify-content:space-between; }
  .segmented button { min-height:36px; }
  .date-controls .icon { min-height:42px; width:39px; }
  .calendar-tools:not(:has(.today-btn:not([hidden]))) { justify-content:flex-start; }
  .calendar-tools:not(:has(.today-btn:not([hidden]))) .date-controls { margin-left:auto; }
  .stage { gap:11px; }

  .inline-form .inline-submit { min-height:40px; }
  .agenda-header { min-height:41px; }
  .agenda-tools .quiet,.agenda-tools>.icon { min-height:42px; }
  .agenda-tools .quiet { padding-inline:7px; }
  .task-row .icon,.check { width:44px; min-height:48px; }
  .task-title { font-size:1rem; }
  .month-cell .cell-preview { display:none; }
  .date-cell { min-height:54px; }
  .mobile-nav {
    display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:3px; z-index:3;
    position:fixed; inset:auto 0 0; background:var(--bg); border-top:1px solid var(--line);
    padding:5px 7px calc(5px + env(safe-area-inset-bottom,0px));
  }
  .nav-item {
    display:flex; flex-direction:column; justify-content:center; align-items:center; gap:2px; min-height:47px;
    color:var(--muted); font-size:.7rem; font-weight:620;
  }
  .nav-item:is([aria-pressed=true],[aria-expanded=true]) { color:var(--accent); background:var(--selected); }
  .nav-add { color:var(--accent); }
  .nav-add .ui-icon { border-radius:6px; width:23px; height:22px; padding:2px; background:var(--accent); color:var(--on-accent); }
  dialog,dialog.task-editor {
    inset:auto 0 0; width:100%; max-width:100%; height:auto; max-height:calc(100dvh - 14px);
    padding-bottom:env(safe-area-inset-bottom,0px); border-radius:15px 15px 0 0; margin:0;
  }
  .sheet-body { padding:14px 15px 16px; }
  .toast { right:12px; bottom:calc(65px + env(safe-area-inset-bottom,0px)); }
}
@media(max-width:360px) {
  .segmented button { padding-inline:8px; }
  .date-controls .icon { width:33px; }
  .today-btn { padding-inline:3px; }
  .agenda-tools .share-action>span:last-child { display:none; }
}
@media(forced-colors:active) {
  .primary,.scope.active,.date-cell.chosen .date-number,.segmented button[aria-pressed=true],.nav-item[aria-pressed=true] { border:1px solid ButtonText; }
}

.detail-extra-fields { display:flex; flex-direction:column; gap:10px; padding:0 0 10px; }
#task-form .form-actions { position:sticky; bottom:0; z-index:1; padding-bottom:7px; background:var(--bg); }
@media(max-width:690px) {
  .task-dates { grid-template-columns:repeat(2,minmax(0,1fr)) !important; }
  .task-dates label:last-child { grid-column:1/-1; }
}

.task-row .order { color: var(--muted); }
.pinned-lists:not(:last-child) { margin-bottom:10px; }
.detail-list { list-style: none; padding: 0; margin: .4rem 0 .9rem; }
.detail-list li { padding: .55rem 0; display: flex; align-items: center; justify-content: space-between; gap: .7rem; overflow-wrap: anywhere; }
.custom-field { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: .45rem; align-items: center; margin: .4rem 0; }
.repeat-days { display:flex; flex-wrap:wrap; gap:0 1rem; border:0; padding:0; margin:0; min-inline-size:0; }
.repeat-days legend { padding:0; color:var(--muted); font-size:.86rem; font-weight:620; }
.focus-clock { font-size:clamp(2.5rem,10vw,4.5rem); line-height:1.15; letter-spacing:-.035em; font-weight:700; font-variant-numeric:tabular-nums; }
:root[data-contrast="high"] { --line: currentColor; --muted: var(--ink); }
:root[data-contrast=high] :is(input:not([type=checkbox],[type=radio],[type=hidden]),select,textarea) { box-shadow:inset 0 -1px var(--ink); }
:root[data-text="large"] { font-size:calc(var(--ios-body-size,100%) * 1.125); }
.capture-media { display: block; max-width: 100%; max-height: 55vh; border-radius: 10px; margin: .6rem auto; }
@media (max-width: 680px) {
  .task-row.manual .icon { width: 36px; }
}
:root[data-text="large"] body { font-size: 1rem; }
.note-links button { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; text-align: left; }

.drafts-trigger{min-width:0; white-space:nowrap}
.inline-options{display:none; flex-wrap:wrap; align-items:center; gap:8px 14px; padding:7px 1px 0}
.inline-capture[data-active=true] .inline-options{display:flex}
.inline-options label{align-items:flex-start; gap:0; color:var(--muted); font-size:.82rem; min-width:0}
.inline-options input:not([type=checkbox]),.inline-options select{border:0; min-height:44px; padding:4px 0; max-width:168px; font-size:.9rem; color:var(--ink); background:var(--bg)}
.inline-options input:hover,.inline-options select:hover{background:var(--hover)}
.inline-date-preview{display:flex; gap:8px; align-items:center; justify-content:space-between; margin-top:6px; color:var(--muted); font-size:.88rem}
.inline-date-preview span{min-width:0;overflow-wrap:anywhere}
.inline-date-preview button{white-space:nowrap}
@media(max-width:400px){.inline-options{gap:6px 8px}.inline-options input,.inline-options select{max-width:125px}.drafts-trigger{font-size:.8rem}}

.history-entry { align-items:flex-start!important; flex-wrap:wrap; }
.history-entry span { min-width:0; }

.capture-chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}
.capture-chips:empty{display:none}
.capture-chip{border:0;background:transparent;color:var(--accent);min-height:44px;padding:4px;font-size:.86rem}
.capture-chip:hover{background:var(--hover)}
.capture-chip[aria-pressed=false]{background:transparent;color:var(--muted);text-decoration:line-through}
.capture-chip span{margin-inline-start:4px;color:var(--accent)}
.marker.repeat-marker{width:9px;height:5px;background:transparent;border:1px dashed var(--muted);border-radius:2px}
.cell-preview.projected{font-style:italic;color:var(--muted)}
.projection-row{min-height:44px;width:100%;text-align:left;display:flex;align-items:center;flex-wrap:wrap;justify-content:space-between;gap:3px 12px}
.projection-row small{color:var(--muted)}

.missed-reminders{margin:12px 0 1px}
.missed-reminders summary{cursor:pointer;min-height:36px;padding-block:6px;color:var(--muted);font-size:.87rem}
.missed-reminders summary small{margin-inline-start:6px;color:var(--ink)}
.missed-row{display:flex;justify-content:space-between;gap:8px;align-items:center}
.missed-row .task-body{min-width:0}

.capture-file { margin:4px 0; }
.capture-file .file-row { border:0;gap:10px }
.capture-file span { min-width:0;overflow-wrap:anywhere }

#print-document { display:none }
@media print {
  @page { margin: 17mm }
  html, body { height:auto!important; min-height:0!important; width:auto!important; overflow:visible!important; color:#141414!important; background:#fff!important }
  body > :not(#print-document), #sheet::backdrop { display:none!important }
  #print-document { display:block!important; font:12pt/1.4 var(--font-ui) }
  #print-document h1 { color:#141414; font:700 20pt/1.2 var(--font-ui); margin:0 0 14pt; break-after:avoid }
  #print-document ul { margin:0; padding:0; list-style:none }
  #print-document li { display:flex; gap:9pt; align-items:baseline; padding:5pt 0; overflow-wrap:anywhere; break-inside:avoid; border-bottom:1pt solid #ddd }
  #print-document .print-mark {
    flex:0 0 11pt; height:11pt; margin-top:2pt; align-self:flex-start;
    border:1pt solid #141414; border-radius:2pt; position:relative;
  }
  #print-document .print-mark.done::after {
    content:""; position:absolute; left:2pt; top:2pt; width:5pt; height:3pt;
    border:solid #141414; border-width:0 0 1pt 1pt; transform:rotate(-45deg);
  }
}

.agenda-summary {
  display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:5px 14px;
  padding:8px 0 11px; color:var(--muted); font-size:.83rem;
}
.agenda-completion { display:flex; align-items:center; gap:9px; font-variant-numeric:tabular-nums; }
.agenda-completion span { white-space:nowrap; }
.agenda-completion progress { width:clamp(46px,11vw,94px); height:5px; border:0; appearance:none; accent-color:var(--accent); }
.agenda-completion progress::-webkit-progress-bar { background:var(--selected); border-radius:6px; }
.agenda-completion progress::-webkit-progress-value { background:var(--accent); border-radius:6px; }
.agenda-estimate { font-size:inherit; }
.task-row .step-toggle { padding-inline: 6px; min-width: 34px; white-space: nowrap; }
.task-row .plan-handle { opacity: .72; }
.task-row .plan-handle[draggable] { cursor: grab; }
.task-row .plan-handle:hover, .task-row .plan-handle:focus-visible { opacity: 1; }
.agenda-steps { display: grid; margin: 0 0 10px clamp(24px, 7vw, 53px); }
.agenda-step { display: flex; gap: 8px; align-items: baseline; justify-content: flex-start; text-align: left; white-space: normal; overflow-wrap: anywhere; }
.agenda-step[aria-pressed=true] { text-decoration: line-through; }
.agenda-step-mark { min-width: 1em; text-align: center; }
.task-row.drop-target, .date-cell.drop-target { outline: 2px solid currentColor; outline-offset: -2px; }
.plan-title { font-weight: 600; overflow-wrap: anywhere; }

#day-actions [data-action=group-today][aria-pressed=true] { color:var(--accent); background:var(--selected); }
.backup-reminder { display:flex; flex-wrap:wrap; align-items:center; gap:0 4px; margin:10px 0; font-size:.85rem; }
.backup-reminder>span { margin-right:auto; }
@media (max-width: 480px) {
  .agenda-header { flex-wrap: wrap; }
  .task-row .plan-handle { width: 38px; }
}

.color-field { border:0; padding:0; margin:0; min-inline-size:0; }
.color-field legend { padding:0; margin-bottom:7px; font-size:.9rem; font-weight:700; }
.color-choice { position:relative; align-items:center; cursor:pointer; min-width:0; color:var(--muted); }
.color-choice:hover,.color-choice:has(input:checked) { color:var(--ink); }
.color-choice:has(input:checked)::after {
  content:""; flex:none; width:7px; height:4px;
  border:solid currentColor; border-width:0 0 2px 2px; transform:translateY(-2px) rotate(-45deg);
}
.color-choice:has(input:focus-visible) { outline:2px solid var(--accent); outline-offset:2px; }
.palette-choice input[type=radio],.color-choice input[type=radio] {
  position:absolute; inline-size:1px; block-size:1px; min-height:0; margin:0; padding:0; opacity:0;
}
.list-colors { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(7.5rem,100%),1fr)); gap:0 10px; }
.color-choice { min-height:44px; flex-direction:row; gap:7px; font-weight:500; }
.color-choice .list-dot { width:12px; height:12px; }

/* The settings index and its pages share one reading surface. */
dialog:has(#settings-path) {
  position:fixed; inset:0; margin:auto; width:min(480px,calc(100% - 24px)); max-width:none;
  height:fit-content; max-height:calc(100dvh - 32px); padding:0; border:0; border-radius:15px;
}
.sheet-body:has(#settings-path) { padding:18px clamp(20px,4vw,32px) 20px; }
.sheet-body:has(#settings-path) .sheet-header { align-items:center; margin-bottom:14px; }
.sheet-body:has(#settings-path) .sheet-header h2 { margin:0; font-size:1.65rem; font-weight:600; }
#settings-path { display:flex; flex-wrap:wrap; align-items:center; margin:0 0 2px; }
#settings-path[hidden] { display:none; }
#settings-path button { min-height:44px; padding:0 5px; color:var(--accent); font-size:.86rem; font-weight:500; }
#settings-path button:first-child { padding-inline-start:0; }
#settings-path .ui-icon { width:15px; height:15px; }
#settings-form { gap:0; }
#settings-form[data-panel] > :is(.settings-home,.settings-route,.settings-section:not([open])),
#settings-form[data-panel] > .settings-section[open]>summary,
#settings-form[data-detail] .settings-detail-path>:not(.settings-detail-path,.settings-detail-current),
#settings-form[data-detail] .settings-detail-current>summary { display:none; }
#settings-form:not([data-panel]):not([data-edited])>.form-actions { display:none; }
.settings-home { margin-bottom:12px; }
.settings-choice-trigger {
  display:flex; align-items:center; justify-content:space-between; width:100%; gap:12px; min-height:46px;
  padding:6px 0; font-size:.94rem; font-weight:500; text-align:start;
}
.settings-choice-trigger span { min-width:0; overflow-wrap:anywhere; }
.preference-value { display:flex; align-items:center; gap:9px; max-width:56%; color:var(--muted); text-align:end; font-weight:400; }
.preference-value::after { content:""; width:6px; height:6px; flex:none; margin-inline-end:5px; border:solid currentColor; border-width:0 1.5px 1.5px 0; transform:rotate(-45deg); }
.settings-choice-trigger:hover .preference-value { color:var(--accent); }
#settings-choices { display:grid; gap:2px; max-height:55dvh; overflow-y:auto; padding:3px; margin-inline:-3px; }
#settings-choices button {
  display:grid; grid-template-columns:minmax(0,1fr) 18px; align-items:center; gap:12px; text-align:start;
  overflow-wrap:anywhere; min-height:46px; padding:9px 12px; color:var(--ink);
}
#settings-choices button:hover { background:var(--hover); }
#settings-choices button[aria-pressed=true] { background:var(--selected); color:var(--accent); font-weight:600; }
#settings-choices button[aria-pressed=true]::after {
  content:""; width:10px; height:5px; justify-self:center; border:solid currentColor; border-width:0 0 2px 2px; transform:rotate(-45deg);
}
#settings-choices button:focus-visible { outline-offset:-2px; }
.settings-section,.settings-reference,#settings-form .notes-export { border:0; }
.settings-section>summary,.settings-route,#settings-form summary[data-action=settings-detail] {
  width:100%; min-height:44px; padding:6px 0; display:flex; align-items:center; gap:12px;
  list-style:none; cursor:pointer; text-align:start; border:0; color:var(--ink); font-size:.96rem; font-weight:500;
}
.settings-section>summary::-webkit-details-marker,#settings-form summary[data-action=settings-detail]::-webkit-details-marker { display:none; }
.settings-section>summary::after,.settings-route::after,#settings-form summary[data-action=settings-detail]::after {
  content:""; margin-inline-start:auto; margin-inline-end:5px; width:6px; height:6px; flex:none;
  border:solid var(--muted); border-width:1.5px 1.5px 0 0; transform:rotate(45deg);
}
.settings-section>summary>small {
  margin-inline-start:auto; min-width:0; max-width:58%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  color:var(--muted); font-size:.85rem; font-weight:400;
}
.settings-section>summary:has(small)::after { margin-inline-start:0; }
.settings-section>summary:hover,.settings-route:hover { color:var(--accent); }
.settings-fields { display:flex; flex-direction:column; gap:4px; }
.settings-fields .hint,.settings-fields small { color:var(--muted); font-size:.84rem; font-weight:400; }
.settings-fields p:empty { display:none; }
.settings-fields label:not(:has(>select)):not(.check-label) { margin-block:4px; }
#settings-form .color-field { margin:2px 0 8px; }
#settings-form .color-field legend { width:100%; margin:0; font-size:.94rem; font-weight:500; }
#settings-palette-name { float:inline-end; color:var(--muted); font-size:.9rem; font-weight:400; }
.palettes { display:flex; flex-wrap:wrap; margin:4px 0 0 -6px; }
.palette-choice { position:relative; width:44px; height:44px; justify-content:center; align-items:center; cursor:pointer; }
.palette-swatch { width:26px; height:26px; position:relative; border-radius:50%; background:var(--accent); }
.palette-choice[data-palette=royal] .palette-swatch { background:linear-gradient(130deg,var(--accent) 65%,var(--gold) 65%); }
.palette-choice input:checked+.palette-swatch::after {
  content:""; position:absolute; top:8px; left:7px; width:10px; height:5px;
  border:solid var(--on-accent); border-width:0 0 2px 2px; transform:rotate(-45deg);
}
.palette-choice input:focus-visible+.palette-swatch { outline:2px solid var(--ink); outline-offset:3px; }
.settings-toggles { display:grid; margin-top:10px; }
#settings-form .check-label { flex-direction:row-reverse; justify-content:space-between; gap:16px; min-height:44px; font-size:.94rem; font-weight:500; }
#settings-form input[type=checkbox] { margin-inline:3px; }
#settings-form .settings-controls { display:flex; flex-direction:column; align-items:stretch; gap:0; }
#settings-form .outline { min-height:44px; border:0; background:transparent; color:var(--accent); justify-content:flex-start; align-self:stretch; text-align:start; white-space:normal; padding:6px 0; font-size:.94rem; font-weight:500; }
#settings-form .outline:hover { text-decoration:underline; }
#settings-form .form-actions { position:sticky; bottom:0; z-index:1; margin-top:14px; padding:10px 0 0; background:var(--bg); border:0; }
#settings-form .form-actions .outline { padding-inline:12px; color:var(--muted); }
#settings-form .form-actions .primary { min-height:44px; }
.setting-explanation { max-width:65ch; margin:0 0 .65rem; color:var(--muted); font-size:.88rem; line-height:1.45; overflow-wrap:anywhere; }
.setting-explanation [data-choice-detail] { display:none; }
#settings-choices .setting-explanation [data-choice-detail] { display:block; margin-top:.4rem; }
#settings-choices .setting-explanation { margin:.35rem 0 .65rem; }
#settings-form[data-panel]>.setting-explanation,#settings-form [hidden]+.setting-explanation { display:none; }
#settings-form .form-grid { grid-template-columns:repeat(auto-fit,minmax(min(100%,10rem),1fr)); }
.template-navigation { display:flex; gap:14px; margin-bottom:16px; }
.template-navigation button { min-height:44px; padding-inline:0; }
.template-navigation button[aria-pressed=true] { color:var(--accent); text-decoration:underline; text-underline-offset:5px; }
@media(forced-colors:active) {
  dialog,dialog:has(#settings-path),.palette-swatch { border:1px solid CanvasText; }
  .sheet-body :is(input:not([hidden]),select,textarea):focus-visible,#settings-choices button:focus-visible { outline:2px solid Highlight; }
  .sheet-body :is(input:not([type=checkbox],[type=radio],[hidden]),textarea,select:not([hidden])) { outline:1px solid ButtonText; outline-offset:-1px; }
  .palette-swatch { forced-color-adjust:none; }
  .palette-choice input:focus-visible+.palette-swatch { outline-color:Highlight; }
}
@media(max-width:690px) {
  .sheet-body:has(#settings-path) { padding:14px 20px 16px; }
}
@media(max-width:400px) {
  .settings-choice-trigger { gap:6px; }
  .settings-choice-trigger .preference-value { max-width:60%; }
}
@media(max-width:370px) {
  .date-markers { gap:2px; }
  .date-markers .marker { width:5px; height:5px; }
  .date-markers .repeat-marker { width:7px; }
}

.today-pick { color:var(--accent); font-weight:700; }
#task-form [data-action=toggle-today][aria-pressed=true] { color:var(--accent); background:var(--selected); }
.privacy-link { align-self:flex-start; }
.privacy-policy { display:grid; gap:1rem; }
.privacy-policy header { padding-bottom:.5rem; }
.privacy-policy h2 { font-size:1.12rem; margin-bottom:.4rem; }
.privacy-policy p+p { margin-top:.55rem; }
.privacy-policy .date { color:var(--muted); font-size:.88rem; margin-bottom:.45rem; }
.privacy-policy ul { margin:.4rem 0 0; padding-inline-start:1.35rem; }
.privacy-policy .folder { overflow-wrap:anywhere; }

.task-row.inline-subtask { min-height:44px; padding-right:6px; }
.task-depth.depth-1 { margin-inline-start:1rem; }
.task-depth.depth-2 { margin-inline-start:2rem; }
.task-depth.depth-3 { margin-inline-start:3rem; }

.notes-export .settings-controls { align-items:end; margin-bottom:10px; }

.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0; }
.date-markers .journal-marker,.calendar-legend .journal-marker {
  width:9px; height:2px; border-radius:0; background:var(--ink);
}
.journal-linked { padding-block:8px; }
.journal-linked-label { font-size:.85rem; color:var(--muted); }
.journal-link-row { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.journal-link-row button { min-height:44px; }
.journal-link-title { min-width:0; padding-inline-start:0; text-align:start; white-space:normal; overflow-wrap:anywhere; }
.journal-link-row .icon { flex:none; }
.task-journal { margin:4px 0 10px; }
.task-journal .detail-list button { min-height:44px; text-align:start; white-space:normal; }
.journal-results { display:grid; gap:2px; }
.journal-result {
  display:grid; align-content:center; gap:3px; padding:9px 0; min-height:48px; text-align:start;
  overflow-wrap:anywhere;
}
.journal-result:hover { background:var(--hover); }
.journal-result small { color:var(--muted); }
.journal-history { margin-top:12px; overflow-wrap:anywhere; }
.journal-history h3 { margin:1.25rem 0 .3rem; font-size:1rem; }
.journal-history summary { min-height:44px; color:var(--ink); }
.journal-history summary::marker { color:var(--muted); }
.journal-history summary :is(time,span) { display:block; margin-inline-start:1.2em; color:var(--muted); font-size:.88rem; font-weight:400; }
.journal-history summary span { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.journal-history-body { margin-inline-start:1.2rem; }
.journal-history-body h4 { margin:.5rem 0; }
.journal-history details > button { min-height:44px; margin-inline-start:1.2rem; padding-inline:0; }
.journal-review { margin:0 0 28px; }
.journal-review-head { display:flex; justify-content:space-between; align-items:start; flex-wrap:wrap; gap:8px; }
.journal-review h2,.journal-review h3 { margin:0; }
.journal-review h2 { font-size:clamp(1.7rem,3.3vw,2.2rem); font-weight:600; letter-spacing:-.025em; }
#journal-review-title:focus { outline:0; }
.journal-review h3 { font-size:1rem; }
.journal-review-content { display:grid; grid-template-columns:minmax(0,1fr); gap:24px; margin:20px 0; }
.journal-review-row + .journal-review-row { margin-top:12px; }
.journal-review-task { width:100%; min-height:44px; padding-inline:0; justify-content:flex-start; text-align:start; white-space:normal; overflow-wrap:anywhere; }
.journal-review .journal-actions .quiet:first-child,.journal-review>[data-action=journal-close-review] { padding-inline-start:0; }
#journal-pane:not(.editing-entry) #journal-review:not([hidden]) + .journal-layout { display:none; }
#journal-pane:not(.editing-entry,.browsing-library):has(#journal-review:not([hidden])) > :is(.journal-toolbar,#journal-back),
#workspace:has(#journal-pane:not([hidden],.editing-entry,.browsing-library) #journal-review:not([hidden])) #calendar-heading { display:none; }
.journal-review>.calendar-back { margin-bottom:12px; }
@container (min-width:690px) {
  .journal-review-content { grid-template-columns:minmax(0,.7fr) minmax(0,1fr); }
}

.journal-preview { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; white-space:pre-line; overflow-wrap:anywhere; color:var(--muted); font-size:.87rem; }
.journal-layout { display:grid; gap:20px; align-items:start; }
.journal-writing { min-width:0; }
.journal-card { display:grid; grid-template-columns:minmax(0,1fr); margin:0 0 14px; }
.journal-label { font-weight:650; }
.journal-text { width:100%; field-sizing:content; color:var(--ink); }
.journal-actions,.journal-rollover { display:flex; align-items:center; flex-wrap:wrap; gap:5px 10px; }
.journal-actions button,.journal-date-tools button,.journal-context-row .task-body,.journal-context-row .check { min-height:48px; }
.journal-date-label { min-width:0; }
.journal-date-label input { max-width:100%; min-height:44px; }
@media (max-width:690px) {
  .journal-date-tools .date-controls { width:100%; gap:4px; }
  .journal-date-tools .date-controls .icon { width:44px; padding-inline:0; }
  .journal-date-label { flex:1 1 auto; }
}
.journal-status { margin:0; }
.journal-rollover { padding-block:8px; margin-bottom:12px; }
#journal-context { min-width:0; padding-block:12px; }
#journal-context h2 { font-size:1.1rem; margin:0 0 10px; }
#journal-context h3 { font-size:.9rem; margin-top:8px; }
.journal-context-row { display:flex; align-items:center; gap:4px; }
.journal-context-row .task-body { flex:1; }
.journal-reopen span { border-color:var(--accent); color:var(--accent); }
.journal-focus { margin-top:12px; }
.journal-trash-row { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:6px; margin-block:8px; }
#journal-pane { container-type:inline-size; }


.journal-toolbar {
  display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:10px 16px;
  margin:0 0 24px;
}
.journal-views,.journal-period { display:inline-flex; align-items:center; gap:14px; }
.journal-views button,.journal-period button { min-height:44px; color:var(--muted); padding:0 2px; font-weight:530; }
.journal-views button:hover,.journal-period button:hover { color:var(--ink); background:var(--hover); }
:is(.journal-views,.journal-period) button[aria-pressed=true] { color:var(--accent); font-weight:680; text-decoration:underline; text-underline-offset:.4em; }
.journal-write-action { color:var(--accent); font-weight:620; min-height:44px; }
.journal-library-tools button { min-height:44px; }
.journal-toolbar .quiet { padding-inline:7px; }
.journal-views,.journal-tools { max-width:100%; }
@media (max-width:480px) {
  .journal-toolbar { gap:6px; }

  .journal-tools button { white-space:normal; font-size:.84rem; line-height:1.2; }
  .journal-tools .icon-search { display:none; }
}
.journal-entry-heading { display:grid; grid-template-columns:minmax(0,1fr); gap:8px; padding-block:14px 0; }
.journal-save-bar { display:flex; align-items:center; flex-wrap:wrap; gap:4px 12px; background:var(--bg); padding-block:4px; }
.journal-save-actions { display:contents; }
.journal-save-actions :is([data-action=journal-save],[data-action=journal-edit]) { order:2; }
.writing-entry .journal-save-bar { position:sticky; top:var(--journal-visible-top,0px); z-index:2; }
.journal-save-bar .journal-status { order:1; flex:1 1 6em; min-width:0; color:var(--muted); font-size:.88rem; }
.journal-save-bar .journal-status[data-state=saved] { color:var(--accent); }
.writing-entry .journal-status { text-align:center; }
.journal-save-bar .journal-status:is([data-state=failed],[data-state=conflict]) { color:var(--danger); }
.journal-status .ui-icon { margin-inline-end:.4em; }
.journal-save-bar button { min-height:48px; min-width:48px; white-space:normal; }
.journal-save-bar button:disabled { opacity:.55; }
@container (max-width:16em) {
  .writing-entry .journal-save-bar { display:contents; }
  .writing-entry .journal-save-actions {
    display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:4px;
    position:sticky; top:var(--journal-visible-top,0px); z-index:2; padding-block:4px; background:var(--bg);
  }
  .writing-entry .journal-save-actions button { min-width:min-content; font-size:.9em; line-height:1.15; padding:.1em 4px; }
  .writing-entry .journal-save-bar .journal-status { order:0; text-align:start; }
}
#journal-leave { max-width:30rem; }
#journal-leave h2 { margin:0 0 8px; }
#journal-leave-error:empty { display:none; }
.journal-card .journal-label { color:var(--muted); font-size:.82rem; font-weight:600; overflow-wrap:anywhere; }
.journal-label time { display:inline-block; max-width:100%; }
.journal-entry-heading .journal-title-field,.journal-read-title {
  width:100%; min-height:44px; padding:4px 0; border:none; border-radius:0; background:transparent; box-shadow:none;
  color:var(--ink); font:620 clamp(1.65rem,4vw,2.35rem)/1.18 var(--font-ui); letter-spacing:-.027em;
}
.journal-read-title { display:none; overflow-wrap:anywhere; }
.journal-card:has(.journal-reading:not([hidden])) .journal-read-title:not(:empty) { display:block; }
.journal-card:has(.journal-reading:not([hidden])) :is(.journal-title-field,.journal-editor-tools details),
.journal-writing:has(.journal-reading:not([hidden])) #journal-writing-actions { display:none; }
.journal-title-field::placeholder { color:var(--muted); opacity:1; }
.journal-editor-tools { display:flex; flex-wrap:wrap; align-items:center; gap:12px; margin-top:4px; }
.journal-editor-tools button { min-height:44px; min-width:42px; padding-inline:5px; }
.journal-editor-tools .journal-format-bold { font-weight:800; }
.journal-editor-tools .journal-format-italic { font-style:italic; }
.journal-card .journal-text { border-radius:0; background:transparent; }
.journal-card .journal-text:focus-visible,.journal-title-field:focus-visible { outline:2px solid transparent; outline-offset:2px; background:linear-gradient(var(--accent),var(--accent)) left bottom / 2.5rem 2px no-repeat; }
.journal-card:has(:is(.journal-text,.journal-title-field):focus-visible) .journal-label { color:var(--accent); }
@media (forced-colors:active) {
  .journal-card .journal-text:focus-visible,.journal-title-field:focus-visible { outline-color:Highlight; }
}
.journal-reading { padding-block:12px; min-height:9rem; overflow-wrap:anywhere; }
.journal-rich { line-height:1.65; }
.journal-rich h2,.journal-rich h3,.journal-rich h4 { margin:1em 0 .3em; }
.journal-rich h2 { font-size:1.32rem; }
.journal-rich p { margin:.45em 0 .85em; }
.journal-rich p.journal-literal { margin:0; }
.journal-rich ul,.journal-rich ol { padding-inline-start:1.4rem; }
.journal-rich blockquote { margin:1em 0; padding:0 .8em; border-inline-start:3px solid var(--line); color:var(--muted); }
.journal-literal { white-space:pre-wrap; }
.journal-card-footer { gap:4px 12px; padding:2px 0; }
.journal-card-footer button { min-height:46px; padding-inline:7px; }
.journal-card .journal-linked { margin:0 0 9px; }
.journal-card .journal-limit { margin:6px 0; }
.journal-entry-metadata,.journal-entry-media { padding:8px 0; }
.journal-entry-metadata { display:flex; flex-wrap:wrap; gap:4px 14px; }
.journal-entry-metadata span {
  max-width:100%; color:var(--muted); font-size:.82rem; overflow-wrap:anywhere;
}
.journal-entry-media,.journal-gallery { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(7.5rem,100%),1fr)); gap:8px; }
.journal-gallery { grid-template-columns:repeat(auto-fill,minmax(min(10rem,100%),1fr)); gap:20px 14px; }
.journal-gallery-tile { display:grid; align-content:start; min-width:0; }
.journal-gallery-tile > .quiet { min-height:44px; padding-inline:0; justify-content:flex-start; text-align:start; white-space:normal; overflow-wrap:anywhere; }
.journal-file-tile { display:grid; align-content:start; width:100%; min-width:0; padding:0; text-align:start; }
.journal-file-tile:hover .journal-file-name,.journal-gallery-tile > .quiet:hover { color:var(--accent); text-decoration:underline; }
.journal-file-name { display:block; padding-top:7px; color:var(--ink); white-space:normal; overflow-wrap:anywhere; font-size:.91rem; font-weight:580; }
.journal-photo,.journal-file-type { display:grid; place-items:center; color:var(--muted); background:var(--hover); font-size:.85rem; }
.journal-photo { position:relative; aspect-ratio:1.5; border-radius:5px; overflow:hidden; }
.journal-photo img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.journal-file-type { min-height:3.25rem; padding:10px; }
.journal-library-tools { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; margin:0 0 16px; }
.journal-tag-filter { min-width:8rem; max-width:100%; margin:0; }
.journal-tag-filter select { max-width:100%; min-height:42px; }
.journal-month-heading { font:640 1.25rem/1.3 var(--font-ui); margin:1.75rem 0 .55rem; }
.journal-month-heading:first-child { margin-top:0; }
.journal-timeline { max-width:62rem; margin:0 0 12px; }
.journal-timeline-row { display:grid; grid-template-columns:5.25rem minmax(0,1fr); column-gap:.75rem; align-items:baseline; margin-bottom:5px; }
.journal-timeline-row time { padding:0; font-variant-numeric:tabular-nums; font-size:.83rem; color:var(--muted); }
.journal-timeline-row time small { display:block; font-size:inherit; }
.record-stamp { overflow-wrap:anywhere; }
.journal-timeline-entry { display:flex; flex-direction:column; justify-content:center; align-items:stretch; gap:4px; min-height:54px; padding:10px 0; text-align:start; overflow-wrap:anywhere; }
.journal-timeline-entry:hover { background:var(--hover); }
.journal-timeline-meta { font-size:.8rem; color:var(--muted); }
.journal-template-row { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; }
.journal-template-row.template-row { gap:6px 16px; padding-block:10px; }
.template-row strong,.template-row p { overflow-wrap:anywhere; }
.template-row p { margin:2px 0 0; }
.template-actions { display:flex; flex-wrap:wrap; gap:4px 16px; }
.template-actions button { min-height:44px; padding-inline:0; }
.template-actions button:first-child { color:var(--accent); }
@media(max-width:600px) {
  .journal-template-row.template-row { grid-template-columns:1fr; gap:0; }
}
.journal-template-row.template-row { gap:6px 16px; padding-block:10px; }
.template-row strong,.template-row p { overflow-wrap:anywhere; }
.template-row p { margin:2px 0 0; }
.template-actions { display:flex; flex-wrap:wrap; gap:4px 16px; }
.template-actions button { min-height:44px; padding-inline:0; }
.template-actions button:first-child { color:var(--accent); }
@media(max-width:600px) {
  .journal-template-row.template-row { grid-template-columns:1fr; gap:0; }
}
#sheet form[id^=journal-] :is(input:not([type=checkbox],[type=radio]),select,textarea) {
  border:0; border-radius:4px; min-height:44px; background:var(--surface);
}
#journal-date-form .journal-actions,#journal-file-controls .journal-actions { gap:4px 16px; }
#journal-date-form .journal-actions button,#journal-file-controls .journal-actions button { padding-inline:0; }
:root[data-contrast=high] #sheet form[id^=journal-] :is(input:not([type=checkbox],[type=radio]),select,textarea) {
  box-shadow:inset 0 -1px currentColor;
}
@media (max-width:420px) {
  .journal-timeline-row { grid-template-columns:4.5rem minmax(0,1fr); column-gap:.625rem; }
}
@media print {
  #print-document.journal-print { overflow-wrap:anywhere; }
  #print-document.journal-print .journal-meta { color:#555; }
  #print-document.journal-print ul { list-style:disc; padding-inline-start:1.5em; }
  #print-document.journal-print li { display:list-item; padding:0; border:0; }
}

.journal-write { display:none; }
.journal-surface .journal-write { display:block; }
.journal-surface:has(#journal-pane:not([hidden])) .journal-write { display:none; }
.journal-surface .rail-add { display:none; }
.journal-home :is(.rail-add,#journal-context,[data-action=journal-insert],[data-action=journal-review],[data-action=journal-create-task]) { display:none; }
.journal-home .journal-layout { grid-template-columns:minmax(0,1fr); }
html[data-home=tasks] #rail-primary [data-id=journal],
html[data-home=journal] #rail-primary :is([data-action=workspace-today],[data-id=inbox]),
html[data-home=journal] #rail-collections { display:none; }
html[data-home=journal] #rail-primary [data-id=journal] { order:-1; }

#sync-auth .sync-code {
  margin: .5rem 0 1rem;
  color: var(--accent);
  font-size: 1.6rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: .08em;
  user-select: all;
}

.rail-library summary,.action-disclosure summary,.journal-day-tasks summary {
  cursor:pointer; color:var(--muted); font-size:.88rem; font-weight:550;
  min-height:44px; align-content:center; padding:6px 10px; border-radius:8px;
}
.rail-library summary:hover,.action-disclosure summary:hover,.journal-day-tasks summary:hover {
  background:var(--hover); color:var(--ink);
}
.action-disclosure { position:relative; }
.action-items,.date-picker .calendar-tools {
  position:absolute; z-index:3; inset-inline-end:0; top:100%; display:grid;
  padding:5px; width:max-content; max-width:min(16rem,80vw);
  background:var(--bg); border:0; border-radius:10px; box-shadow:var(--shadow);
}
.action-items button,.journal-toolbar .action-items button {
  min-height:44px; padding:8px 12px; text-align:start; justify-content:flex-start; font-size:.9rem;
}
.action-items button:hover,.action-items button:focus-visible { background:var(--hover); }
.agenda-header:has(.agenda-tools:empty):not(:has(h2)) { display:none; }
.journal-day-tasks { border:0; margin-block:8px; }
.journal-day-tasks>summary { padding-inline-start:0; }
.journal-home .journal-day-tasks { display:none; }
#journal-pane.editing-entry { width:100%; max-width:68ch; margin-inline:auto; }
.journal-card .journal-reading,.journal-card .journal-text,.journal-writing-field::after {
  margin:0; padding:1rem 0; font-family:inherit; font-size:clamp(1rem,.97rem + .23vw,1.125rem);
  line-height:1.7; tab-size:4; overflow-wrap:anywhere;
}
.journal-writing-field { display:grid; }
.journal-card .journal-text,.journal-writing-field::after {
  min-height:8rem; border:0; resize:none; white-space:pre-wrap;
}
.journal-card .journal-text { display:block; overflow:hidden; }
.journal-writing-field:has(>textarea[hidden]) { display:none; }
@supports not (field-sizing:content) {
  .journal-writing-field>textarea,.journal-writing-field::after { grid-area:1/1; }
  .journal-writing-field::after { content:attr(data-text) " "; visibility:hidden; pointer-events:none; }
}
.task-row .icon:not(.starred) { color:var(--muted); }
@media (hover:hover) and (pointer:fine) {
  .task-row:not(:hover):not(:focus-within) :is(.star:not(.starred),.plan-handle) { opacity:0; }
}
@media (min-width:691px) {
  .workspace-inner { padding-top:clamp(32px,5vh,66px); }
  .topbar { border-bottom:0; }
  .calendar-heading { margin-bottom:28px; }
  .rail { padding-top:28px; }
}

.date-picker .calendar-tools { width:max-content; margin:0; justify-items:center; }
.date-picker .date-controls { margin:0; justify-content:center; }
.date-picker { margin-inline-start:auto; }
.date-picker .calendar-tools .date-controls { margin:0; }
@media (max-width:690px) {
  .calendar-heading:has(.date-picker) { flex-direction:row; align-items:flex-start; }
  .date-picker summary { white-space:nowrap; }
}

html[data-home=journal] .mobile-nav .nav-add,
html[data-home=tasks] .mobile-nav .nav-journal { display:none; }

.calendar-heading:has(.calendar-paging) { align-items:center; flex-wrap:wrap; gap:6px 16px; }
.calendar-heading:has(.calendar-paging) .heading-main { flex:1 1 auto; }
.calendar-heading>.calendar-back { flex:0 0 100%; justify-content:flex-start; }
.calendar-paging { margin-inline-start:auto; }
.calendar-paging :is(.icon,.today-btn) { min-width:44px; min-height:44px; }
.calendar-switch { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:0 14px; margin:0 0 16px; }
.calendar-switch>div { display:flex; align-items:center; gap:4px; }
.calendar-switch>div button { min-height:44px; padding:6px 8px; color:var(--muted); font-size:.88rem; }
.calendar-switch button:hover { color:var(--ink); background:var(--hover); }
.calendar-switch>div button[aria-pressed=true] { color:var(--accent); font-weight:650; text-decoration:underline; text-decoration-thickness:2px; text-underline-offset:.4em; }
#day-actions .action-items { max-height:55dvh; overflow-y:auto; }
.calendar-switch #calendar-range button[aria-pressed=true] { text-decoration-thickness:1px; }
.calendar-switch #calendar-add { display:inline-flex; gap:5px; align-items:center; padding-inline-start:0; color:var(--accent); font-weight:650; }
@media(max-width:690px) {
  #calendar-task-actions button { min-height:48px; }
  html[data-home=tasks] #calendar-add { display:none; } /* Capture is in the bottom bar. */
}
@media(forced-colors:active) {
  .date-cell.current:not(.chosen) .date-number { outline:1px dotted CanvasText; }
  .calendar-switch button[aria-pressed=true] { color:Highlight; }
  .date-markers .marker,.calendar-legend .marker { border:1px solid CanvasText; }
}
.calendar-journal-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px; }
.calendar-back { padding-inline:0; color:var(--accent); }
#calendar-journal { min-width:0; }

.agenda-header { flex-wrap:wrap; }
.rail-library,.action-disclosure,.editor-disclosure { border:0; }
.editor-disclosure summary {
  min-height:44px; padding:8px; color:var(--muted); cursor:pointer; font-size:.88rem; font-weight:550;
}
:is(.action-disclosure,.editor-disclosure,.rail-library)>summary {
  display:flex; align-items:center; gap:8px; list-style:none;
}
:is(.action-disclosure,.editor-disclosure,.rail-library)>summary::-webkit-details-marker { display:none; }
:is(.action-disclosure,.editor-disclosure)>summary::after {
  content:""; width:6px; height:6px; border:solid currentColor; border-width:0 1.5px 1.5px 0; transform:translateY(-2px) rotate(45deg);
}
:is(.action-disclosure,.editor-disclosure)[open]>summary::after { transform:translateY(2px) rotate(225deg); }
.editor-disclosure[open] { flex:1 1 100%; }
.editor-disclosure>div { display:flex; gap:4px; flex-wrap:wrap; }
.date-picker .journal-date-tools .date-controls { flex-wrap:wrap; }
dialog.task-editor {
  inset:0; margin:0; width:100%; max-width:100%; height:100dvh; max-height:100dvh; border:0; border-radius:0;
}
dialog.task-editor::backdrop { background:var(--bg); }
.task-editor .sheet-body { max-width:704px; margin:auto; padding-block:clamp(18px,4vh,44px); }
.task-editor .sheet-header { align-items:center; margin-bottom:6px; }
.task-editor .sheet-header h2 { margin:0; font-size:.94rem; font-weight:550; letter-spacing:normal; color:var(--muted); }
.task-fields :is(input:not([type=checkbox],[type=radio],[type=hidden]),select,textarea) {
  min-height:44px; border:0; border-radius:4px; padding-inline-start:0; background:var(--bg);
}
.task-fields :is(input:not([type=checkbox],[type=radio],[type=hidden]),select,textarea):hover { background:var(--hover); }
.task-fields [data-action=cancel] { color:var(--muted); }
.task-editor #task-form { gap:8px; }
.task-editor #task-title {
  font-size:clamp(1.55rem,3.5vw,2.15rem); line-height:1.22; letter-spacing:-.025em; font-weight:600;
  min-height:52px; margin-bottom:8px;
}
#task-form textarea[name=notes] { field-sizing:content; line-height:1.55; min-height:3.8em; max-height:42dvh; }
#capture-title { line-height:1.5; }
.task-fields label:not(.check-label,.color-choice) { gap:2px; }
#task-form .form-grid,#capture-form .form-grid { gap:10px 20px; }
#task-form .task-alerts { grid-template-columns:repeat(auto-fit,minmax(min(14rem,100%),1fr)); }
#task-form .detail-extra-fields details > :is(label,.form-grid,.repeat-days) { margin-block-end:12px; }
#task-form .step-row { grid-template-columns:44px minmax(0,1fr) 44px; gap:0; margin:0; }
#task-form .step-check { min-height:44px; justify-content:center; align-items:flex-start; cursor:pointer; }
#task-form .step-row .icon { width:44px; min-height:44px; }
#task-form .step-row:has(input:checked) input[type=text] { color:var(--muted); text-decoration:line-through; }
#task-form .detail-list li { border:0; }
#task-form .detail-list:empty,#task-form #note-preview:empty { display:none; }
#task-form #note-preview { padding-inline:0; min-height:0; }
#task-form [type=button]:is(.quiet,.outline):not([data-action=cancel]) { white-space:normal; }
#task-form .detail-extra-fields .settings-controls,.task-secondary { gap:4px 14px; }
#task-form :is(.task-secondary,.settings-controls,.task-disclosure) :is(.quiet,.outline) {
  padding-inline:0; justify-content:flex-start; text-align:start; min-height:44px;
}
#task-form input::-webkit-datetime-edit,#capture-form input::-webkit-datetime-edit { padding-inline-start:0; }
#task-form summary,#capture-form summary {
  display:flex; align-items:baseline; gap:.65rem; min-height:46px; padding:11px 0;
  list-style:none; overflow-wrap:anywhere;
}
#task-form summary::-webkit-details-marker,#capture-form summary::-webkit-details-marker { display:none; }
#task-form summary::after,#capture-form summary::after {
  content:""; align-self:center; margin-inline-start:auto; margin-inline-end:3px; flex:none;
  width:7px; height:7px; border:solid currentColor; border-width:0 1.5px 1.5px 0;
  transform:rotate(45deg); color:var(--muted);
}
#task-form details[open]>summary::after,#capture-form details[open]>summary::after { transform:rotate(225deg); }
.task-disclosure>summary { color:var(--ink); font-weight:600; }
.task-disclosure>summary:hover,#task-form details details>summary:hover { color:var(--accent); }
.task-disclosure>summary small { min-width:0; font-size:.82rem; font-weight:450; color:var(--muted); }
.task-disclosure .detail-extra-fields { padding-block:8px 20px; gap:12px; }
#task-form details details>summary,#task-form #task-note-format>summary { color:var(--muted); font-size:.9rem; font-weight:530; }
#task-form #task-note-format>summary { width:fit-content; padding-block:8px; align-items:center; }
#task-form>#task-note-format { margin-bottom:10px; }
#task-form>.task-disclosure+.task-disclosure { margin-top:-6px; }
#capture-form .capture-chips { margin:0; }

:root[data-contrast=high] :is(.task-fields,.inline-options) :is(input:not([type=checkbox],[type=radio],[type=hidden]),select,textarea) { box-shadow:inset 0 -1px currentColor; }
@media(forced-colors:active) {
  :is(.task-fields,.inline-options) :is(input:not([type=checkbox],[type=radio],[type=hidden]),select,textarea) { border-bottom:1px solid FieldText; }
}

.marker.reminder-marker { border:1px solid var(--accent); background:transparent; border-radius:1px; }
.cell-preview[draggable] { cursor:grab; }

#journal-pane.editing-entry .journal-toolbar,
#journal-pane.editing-entry .journal-day-tasks,
#journal-pane.editing-entry #journal-review,
#workspace:has(#journal-pane.editing-entry:not([hidden])) #calendar-heading .date-picker { display:none; }
#workspace:has(#journal-pane.editing-entry:not([hidden])) #calendar-heading {
  position:absolute; width:1px; height:1px; margin:0; overflow:hidden; clip-path:inset(50%);
}
#journal-back:not([hidden]) { margin-bottom:10px; }

@media(max-width:690px), (pointer:coarse) and (max-height:520px) {
  .shell:has(#journal-pane.writing-entry:not([hidden])) { display:block; }
  .shell:has(#journal-pane.writing-entry:not([hidden])) :is(.rail,.topbar,.mobile-nav) { display:none; }
  #workspace:has(#journal-pane.writing-entry:not([hidden])) .workspace-inner { padding-block:0 max(12px,env(safe-area-inset-bottom)); }
  #journal-pane.writing-entry { width:100%; margin-inline:auto; }
  .writing-entry .journal-save-bar { margin-inline:calc(0px - var(--page-gutter)); padding-inline:var(--page-gutter); gap:4px 8px; }
  .writing-entry .journal-entry-heading { padding-top:8px; }
  .writing-entry .journal-editor-tools button,.writing-entry .journal-card-footer button { min-width:48px; min-height:48px; }
  #journal-leave .form-actions { display:grid; grid-template-columns:minmax(0,1fr); }
  #journal-leave .form-actions button { width:100%; min-height:48px; white-space:normal; }
}

@media(max-width:690px) {
  html[data-home=both] .mobile-nav { grid-template-columns:repeat(5,minmax(0,1fr)); }
  html[data-home=journal] .mobile-nav { grid-template-columns:repeat(2,minmax(0,1fr)); }
  html[data-home=journal] .mobile-nav :is([data-action=workspace-today],[data-action=toggle-rail]) { display:none; }
}

#workspace:has(#journal-pane.browsing-library:not([hidden])) #calendar-heading :is(.date-picker,.heading-date),
#journal-pane:not(.browsing-library) .journal-write-now { display:none; }
.journal-write-now { margin-inline-start:auto; }

.journal-tools>summary { justify-content:center; min-width:44px; padding-inline:4px; }
.journal-tools>summary::after { display:none; }
.journal-toolbar { gap:4px; }
@container (max-width:23rem) {
  .journal-toolbar { column-gap:5px; }
  .journal-toolbar .journal-views { flex-wrap:wrap; gap:0 8px; }
  .journal-toolbar .journal-write-now { padding-inline:0; white-space:normal; }
}
.journal-tools .action-items { max-height:min(55dvh,27rem); overflow:auto; }
#journal-filters .journal-library-tools { display:grid; gap:4px; margin:0 0 4px; }
#journal-filters .segmented { display:flex; flex-wrap:wrap; gap:0; background:transparent; padding:0; }
#journal-filters .segmented button { box-shadow:none; }
#journal-filters .segmented button[aria-pressed=true] { background:transparent; text-decoration:underline; text-underline-offset:.25em; }
#journal-active-filters:not([hidden]) { display:flex; align-items:center; gap:8px; color:var(--muted); font-size:.88rem; }

.journal-editor-tools>.editor-disclosure>summary { padding-inline-start:0; }
#journal-writing-actions button,.journal-card-footer button { max-width:100%; white-space:normal; overflow-wrap:anywhere; }

/* Each navigation item uses the brand's icon and label tracks. */
.rail .brand,.rail .scope,.rail-footer>button {
  grid-template-columns:var(--nav-icon) minmax(0,1fr) auto; column-gap:var(--nav-gap);
  padding-inline:8px; text-align:start; align-items:center;
}
.rail .brand,.rail .scope,.rail .settings-entry,html:not(.journal-surface) .rail .rail-add,
.journal-surface:not(:has(#journal-pane:not([hidden]))) .rail .journal-write { display:grid; }
.rail .brand>:first-child,.rail .scope>:first-child,.rail-footer .ui-icon { justify-self:center; }
.rail .brand { margin-bottom:20px; }
.rail-label,.rail-library>summary {
  padding-inline-start:calc(8px + var(--nav-icon) + var(--nav-gap));
}
.rail-footer .settings-entry { margin-top:4px; }
.rail-footer .journal-write { width:100%; }
.rail-library>summary { justify-content:space-between; }
.rail-library>summary>.ui-icon { width:15px; height:15px; margin-inline-end:3px; }
.rail-library[open]>summary>.ui-icon { transform:rotate(180deg); }
.list-group>summary span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.list-group>.scope { padding-inline-start:16px; }
@media(max-width:690px) {
  html:has(.rail.open) { overflow:hidden; }
  .rail { padding:12px 14px max(12px,env(safe-area-inset-bottom)); }
  .rail .brand,.rail .settings-entry,#rail-primary>.scope:not([data-id=inbox]) { display:none; }
  .rail .drawer-header { display:flex; flex:none; align-items:center; justify-content:space-between; padding-inline-start:8px; margin-bottom:8px; }
  .drawer-header h2 { font-size:1.25rem; }
  .rail .drawer-close { width:44px; height:44px; }
  .rail.open .rail-footer .rail-add { display:grid; }
  .rail.open .rail-footer .journal-write { display:none; }
}
@media(max-height:450px) {
  #rail-contents { overflow-y:auto; }
  #rail-collections { overflow:visible; flex-shrink:0; }
  .rail .brand { margin-bottom:6px; }
}

/* Controls occupy a fixed leading track. Text starts on the next track. */
.task-row>.check { width:var(--check-track); }
.task-row>:is(.icon,.check,.step-toggle) { min-height:var(--row-control); }
.task-row>.task-body {
  justify-content:flex-start; padding-block:calc((var(--row-control) - 1.5em) / 2) 8px;
}
.task-row>.task-body .task-title { line-height:1.5; }
@media(max-width:360px) {
  .agenda-completion progress { display:none; }
}

.calendar-content-filter select { min-height:44px; max-width:100%; padding:4px 22px 4px 0; border:0; background-color:transparent; color:var(--accent); font-weight:600; }
.stream-actions { display:flex; flex-wrap:wrap; gap:1.5rem; }
.stream-actions button,.stream-link { min-height:44px; padding-inline:0; color:var(--accent); text-align:start; }
.stream-group { margin-block:1rem 1.6rem; }
.stream-group h3 { font-size:.9rem; color:var(--muted); margin-block-end:.4rem; }
.stream-row { display:grid; grid-template-columns:5.5rem minmax(0,1fr) var(--row-control); grid-template-areas:"clock meta ." "clock detail check"; column-gap:.65rem; padding-block:.55rem; align-items:start; }
.stream-meta { display:contents; }
.stream-time,.stream-kind { color:var(--muted); font-size:.83rem; }
.stream-time { grid-area:clock; font-variant-numeric:tabular-nums; }
.stream-kind { grid-area:meta; overflow-wrap:anywhere; }
.stream-item { grid-area:detail; min-width:0; display:grid; justify-items:start; }
.stream-title,.activity-record { display:block; min-height:44px; padding:5px 0; text-align:start; overflow-wrap:anywhere; color:var(--ink); font:inherit; font-weight:600; }
.stream-row>.check { grid-area:check; justify-self:end; }
.stream-row:not(:has(>.check)) .stream-item { grid-column-end:-1; }
@media(max-width:600px) {
  .stream-row { grid-template-columns:minmax(0,1fr) var(--row-control); grid-template-areas:"meta ." "detail check"; }
  .stream-meta { grid-area:meta; grid-column-end:-1; display:flex; flex-wrap:wrap; align-items:baseline; column-gap:.65rem; }
}
.stream-link { font-size:.85rem; font-weight:500; }

/* The entry scrolls between the save controls and a stable footer. On very
   short viewports, let the whole page scroll so the keyboard cannot trap it. */
@media(min-height:280px){
  #workspace:has(#journal-pane.editing-entry:not([hidden])) { height:100dvh; min-height:0; display:flex; flex-direction:column; }
  #workspace:has(#journal-pane.editing-entry:not([hidden]))>.topbar { flex:none; }
  #workspace:has(#journal-pane.writing-entry:not([hidden])) { height:min(100dvh,var(--journal-visible-height,100dvh)); }
  #workspace:has(#journal-pane.editing-entry:not([hidden])) .workspace-inner { padding-block:1rem; }
  #workspace:has(#journal-pane.editing-entry:not([hidden])) :is(.workspace-inner,.stage,#journal-pane,#journal-day,.journal-layout,.journal-writing,#journal-entries,.journal-card) {
    min-height:0; display:flex; flex-flow:column nowrap; align-items:stretch; flex:1 1 0;
  }
  #journal-pane.editing-entry { width:100%; }
  #journal-pane.editing-entry .journal-card { margin:0; }
  #journal-pane.editing-entry .journal-page-scroll {
    flex:1 1 0; min-height:0; overflow:auto; overscroll-behavior:contain;
    display:flex; flex-direction:column; scrollbar-gutter:stable; scroll-padding-block:1lh;
  }
  .journal-page-scroll>* { flex:none; }
  .journal-page-scroll>.journal-writing-field,.journal-page-scroll>.journal-reading { flex:1 0 auto; }
  #journal-pane.editing-entry .journal-save-bar,#journal-pane.editing-entry .journal-card-footer { flex:none; }
  #journal-pane.editing-entry #journal-back { align-self:flex-start; flex:none; }
}
@media(max-width:690px) and (min-height:280px){
  #workspace:has(#journal-pane.editing-entry:not(.writing-entry,[hidden])) .workspace-inner { padding-block:.5rem calc(66px + env(safe-area-inset-bottom,0px)); }
  #workspace:has(#journal-pane.writing-entry:not([hidden])) .workspace-inner { padding-block:.25rem max(.5rem,env(safe-area-inset-bottom)); }
}
.journal-card .journal-card-footer { justify-content:space-between; padding-top:5px; align-items:start; }
.journal-writing-tools>summary { color:var(--accent); padding-inline-start:0; min-height:46px; }
.journal-tool-palette {
  position:absolute; z-index:3; inset-inline-start:0; bottom:100%; width:max-content;
  max-width:min(25rem,calc(100vw - 2 * var(--page-gutter))); max-height:min(42dvh,19rem);
  overflow:auto; overscroll-behavior:contain; padding:8px 16px; color:var(--ink);
  background:var(--bg); box-shadow:var(--shadow); border-radius:10px;
}
.journal-tool-palette .journal-editor-tools { margin:0; }
@media (max-height:279px) {
  .writing-entry .journal-card-footer { position:sticky; bottom:0; background:var(--bg); }
}
@media (forced-colors:active) {
  .journal-tool-palette { border:1px solid CanvasText; }
}
.journal-card .journal-card-footer>.quiet { padding-inline-start:0; }
.journal-compose-tools { gap:4px 16px; }
.journal-compose-tools .quiet { padding-inline:0; }
.journal-entry-tags { display:flex; flex-wrap:wrap; align-items:center; gap:0 12px; }
.journal-entry-tags button { color:var(--accent); font-size:.85rem; min-height:44px; padding-inline:0; }


#journal-books { max-width:44rem; margin-inline:auto; width:100%; }
.books-heading,.books-contents-toolbar,.books-actions {
  display:flex; align-items:baseline; justify-content:space-between; gap:.25rem 1rem; flex-wrap:wrap;
}
.books-heading h1 { margin:0; min-width:0; overflow-wrap:anywhere; font-size:clamp(1.65rem,4vw,2.2rem); line-height:1.22; }
.books-heading { margin-bottom:1.25rem; }
.books-heading .quiet,.books-actions .quiet,.book-back { padding-inline:0; min-height:44px; white-space:normal; }
.book-action,.book-back { color:var(--accent); }
.books-contents-toolbar h2 { margin:0; font-size:1rem; font-weight:600; }
.books-actions { align-items:center; justify-content:start; gap:.25rem 1rem; }
.book-back { margin-block-end:.35rem; }
.book-shelf,.book-chapters { list-style:none; padding:0; margin:0; }
.book-shelf-row,.book-chapter {
  width:100%; min-height:48px; display:grid; align-items:center; gap:.75rem; text-align:start;
  padding:.6rem 0; background:transparent; color:var(--ink); line-height:1.5; overflow-wrap:anywhere;
}
.book-shelf-row { grid-template-columns:minmax(0,1fr) auto 18px; }
.book-shelf-row .book-title,.book-chapter { font-weight:550; }
.book-count,.chapter-number,.book-shelf-row .ui-icon { color:var(--muted); }
.book-count,.chapter-number { font-variant-numeric:tabular-nums; font-size:.85rem; font-weight:400; }
.book-chapters li { display:flex; align-items:center; }
.book-chapter { grid-template-columns:2.4ch minmax(0,1fr); flex:1; min-width:0; }
.book-chapter time { display:block; color:var(--muted); font-size:.85rem; font-weight:400; }
.book-arrange { min-height:44px; }
.long-book .book-chapter { grid-template-columns:4.5ch minmax(0,1fr); }
.chapter-number { text-align:end; align-self:start; line-height:1.75; }
.book-chapter:hover,.book-shelf-row:hover { color:var(--accent); }
.book-moves { display:flex; flex:none; align-items:center; }
.book-move { min-height:44px; width:44px; }
.book-title { display:flex; align-items:center; gap:.55rem; min-width:0; }
.book-move:disabled { color:var(--muted); opacity:.35; }
.books-empty { margin:.7rem 0; color:var(--muted); max-width:38ch; }
.book-remove { min-height:44px; font-size:.85rem; white-space:normal; }
#book-entry-picker { display:grid; gap:.65rem; }
.book-entry-results { max-height:48vh; max-height:48dvh; overflow:auto; overscroll-behavior:contain; }
#book-entry-picker .book-entry-option { display:grid; grid-template-columns:auto minmax(0,1fr); align-items:start; gap:.65rem; padding:.6rem 0; cursor:pointer; }
.book-entry-option input { margin-top:.24rem; }
.book-entry-option strong,.book-entry-option small { display:block; overflow-wrap:anywhere; }
.book-entry-option strong { font-weight:550; }
.book-entry-option small { color:var(--muted); font-weight:400; }
#book-entry-more { justify-self:start; }
#book-selected-count { margin-inline-end:auto; color:var(--muted); }
@media(max-width:600px){
  .book-chapters li:has(.book-moves) { flex-direction:column; align-items:stretch; }
  .book-moves { padding-inline-start:calc(2.4ch + .75rem); }
}


#feature-guide .guide-row {
  width:100%; display:flex; align-items:center; justify-content:space-between; gap:1rem;
  min-height:44px; padding:.55rem 0; background:transparent; border:0; color:var(--ink); text-align:start;
}
#feature-guide .guide-row:hover { color:var(--accent); }
#feature-guide .guide-row .ui-icon { flex:none; color:var(--muted); width:1rem; height:1rem; }
#guide-back { min-height:44px; padding-inline:0; color:var(--accent); }
#guide-back .ui-icon { width:1em; height:1em; }
#feature-guide-title { overflow-wrap:anywhere; }
#guide-results { margin-block-start:1rem; }
#guide-results h3 { margin-block:1.25rem .25rem; font-size:.9rem; color:var(--muted); }
.guide-steps { margin:0; padding-inline-start:1.6rem; }
.guide-steps li { padding-inline-start:.3rem; margin-block:.8rem; line-height:1.55; overflow-wrap:anywhere; }
.guide-steps li::marker { color:var(--muted); font-variant-numeric:tabular-nums; }

#activity-report,#activity-details { display:grid; gap:1.4rem; }
#activity-report h3,#activity-details h3 { font-size:1rem; margin-bottom:.45rem; }
.activity-legend { display:flex; gap:1.1rem; color:var(--muted); font-size:.85rem; }
.activity-legend span::before { content:""; display:inline-block; margin-inline-end:.4em; width:.7em; height:.35em; background:var(--muted); }
.activity-legend span+span::before { background:var(--accent); }
.activity-week { display:grid; grid-template-columns:minmax(6rem,1fr) minmax(5rem,1.5fr); width:100%; gap:1rem; align-items:center; min-height:50px; text-align:start; padding:4px 0; color:var(--ink); }
.activity-bars,.activity-bars>span { display:grid; gap:2px; }
.activity-bars>span { align-items:center; grid-template-columns:minmax(0,1fr) 2em; }
.activity-bars b { text-align:end; font-size:.78rem; font-variant-numeric:tabular-nums; }
.activity-bars meter { display:block; appearance:none; background:var(--hover); border:none; border-radius:3px; width:100%; height:5px; }
.activity-bars meter::-webkit-meter-bar { background:var(--hover); height:5px; border:0; }
.activity-bars meter::-webkit-meter-optimum-value { background:var(--muted); }
.activity-bars meter.completed::-webkit-meter-optimum-value { background:var(--accent); }
.activity-bars meter::-moz-meter-bar { background:var(--muted); }
.activity-bars meter.completed::-moz-meter-bar { background:var(--accent); }
.activity-days { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:2px; margin-top:.6rem; }
.activity-days>span { text-align:center; color:var(--muted); font-size:.76rem; }
.activity-days button { min-height:44px; padding:0; color:var(--muted); font-size:.85rem; }
.activity-days .has-entries { color:var(--accent); background:var(--selected); font-weight:650; text-decoration:underline; }
.activity-linked { text-align:start; padding-inline:0; color:var(--accent); }
.activity-record { width:100%; }
.activity-record span { display:block; font-size:.83rem; color:var(--muted); font-weight:450; }

.icon-definitions { position:absolute; width:0; height:0; overflow:hidden; }
