/* Sebastian Today on the web: the Web Notes palette (neutral greys), flat. */
:root {
  color-scheme: light;
  --bg: #ffffff; --sidebar: #f6f6f7; --card: #f2f2f5; --card-2: #e8e8ed; --hover: #eeeef1; --selected: #e4e9f2;
  --ink: #1d1f23; --muted: #6b7079; --faint: #9a9fa8; --line: #e3e4e8;
  --accent: #2f6fdb; --danger: #d33a2c; --warn: #b26a00; --now: #ff3b30;
  --shadow: 0 8px 28px rgba(0, 0, 0, .12);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, Roboto, Helvetica, Arial, sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1c1c1e; --sidebar: #232326; --card: #2a2a2e; --card-2: #34343a; --hover: #2c2c30; --selected: #34363d;
  --ink: #ececee; --muted: #a2a5ad; --faint: #75787f; --line: #323236;
  --accent: #5b95f5; --danger: #ff8a7d; --warn: #f0a33a; --now: #ff6961;
  --shadow: 0 8px 28px rgba(0, 0, 0, .5);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #1c1c1e; --sidebar: #232326; --card: #2a2a2e; --card-2: #34343a; --hover: #2c2c30; --selected: #34363d;
    --ink: #ececee; --muted: #a2a5ad; --faint: #75787f; --line: #323236;
    --accent: #5b95f5; --danger: #ff8a7d; --warn: #f0a33a; --now: #ff6961;
    --shadow: 0 8px 28px rgba(0, 0, 0, .5);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
body { font-size: 15px; line-height: 1.4; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* Welcome */
.welcome { min-height: 100%; display: grid; place-items: center; padding: 24px; background: var(--sidebar); }
.welcome-card { max-width: 440px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.welcome-card img { border-radius: 16px; }
.welcome-card h1 { margin: 4px 0 0; font-size: 30px; }
.lead { color: var(--muted); margin: 0; }
.plus-badge { padding: 5px 14px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); font-size: 13px; font-weight: 700; }
.plus-note { margin: 0; padding: 12px 16px; border-radius: 14px; background: var(--bg); color: var(--muted); font-size: 14px; border: 1px solid var(--line); }
.plus-note strong { color: var(--ink); }
.apple-signin { min-height: 32px; }
.text-button { color: var(--accent); padding: 6px 10px; border-radius: 8px; }
.text-button:hover { background: var(--hover); }
.fine { color: var(--faint); font-size: 12px; margin: 0; }
.error { color: var(--danger); font-size: 14px; margin: 0; }
.error:empty { display: none; }

/* Layout */
.app { display: grid; grid-template-columns: 300px 1fr; height: 100%; }
.sidebar { background: var(--sidebar); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 16px 12px; min-height: 0; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; padding: 4px 8px 16px; }
.brand img { border-radius: 7px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--ink); }
.nav-item:hover { background: var(--hover); }
.nav-item[aria-current="page"] { background: var(--selected); font-weight: 600; }
.nav-item span:first-child { width: 18px; text-align: center; color: var(--accent); }
.external { margin-left: auto; color: var(--faint); }
.filter { margin-top: 20px; }
.filter h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--faint); margin: 0 10px 6px; }
.filter label { display: flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.filter label:hover { background: var(--hover); }
.filter input { accent-color: var(--accent); }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.sidebar-foot { margin-top: auto; padding: 16px 8px 0; display: flex; flex-direction: column; gap: 6px; }
.foot-buttons { display: flex; gap: 4px; flex-wrap: wrap; margin-left: -10px; }
.main { overflow-y: auto; min-width: 0; padding: 28px 36px 60px; }
.main:focus { outline: none; }

/* Read-only notice */
.readonly { display: flex; gap: 12px; align-items: flex-start; padding: 10px 14px; margin-bottom: 20px; border-radius: 12px; border: 1px solid var(--line); background: var(--sidebar); font-size: 13px; }
.readonly strong { font-size: 13px; }
.ro-icon { font-size: 15px; line-height: 1.3; }
.ro-sub { color: var(--muted); margin-top: 1px; }
.late { color: var(--danger); font-weight: 600; }

/* Today */
.today-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.today-head h1 { font-size: 34px; margin: 0; }
.today-head .date { color: var(--muted); font-size: 16px; margin-top: 2px; }
.weather { display: flex; gap: 16px; align-items: center; padding: 14px 18px; border-radius: 16px; background: var(--card); min-width: 260px; }
.weather .temp { font-size: 34px; font-weight: 300; }
.weather .cond { font-weight: 600; }
.weather .sub { color: var(--muted); font-size: 13px; }
.forecast { display: flex; gap: 12px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.forecast div { text-align: center; }
.chips { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.chip { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--card); font-size: 14px; }
.chip strong { font-variant-numeric: tabular-nums; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: 24px; align-items: start; }
.section { margin-bottom: 26px; }
.section h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 0 0 10px; display: flex; gap: 8px; align-items: center; }
.section h2 .count { color: var(--faint); font-weight: 500; }
.section.overdue h2 { color: var(--danger); }
.card { background: var(--card); border-radius: 16px; overflow: hidden; }
.item { display: grid; grid-template-columns: 78px 4px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 16px; position: relative; }
.item + .item::before { content: ""; position: absolute; top: 0; left: 110px; right: 16px; border-top: 1px solid var(--line); }
.item .when { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.item .bar { width: 4px; align-self: stretch; border-radius: 2px; }
.item .title { font-weight: 600; overflow-wrap: anywhere; }
.item .meta { color: var(--muted); font-size: 13px; }
/* Finished today: still fully readable, just quieter and labelled. */
.item.past .title { color: var(--muted); }
.item.past .bar { opacity: .6; }
.item.bg .title { font-weight: 500; }
.item.bg .bar { width: 4px; opacity: .55; }
.badge.bgtag { background: transparent; border: 1px dashed var(--line); color: var(--faint); font-weight: 600; }
.badge.ended { background: transparent; border: 1px solid var(--line); color: var(--faint); }
.item.now .when, .item.next .when { color: var(--accent); font-weight: 700; }
.item.now { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.badge { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--card-2); color: var(--muted); }
.badge.now { background: var(--accent); color: #fff; }
.join { font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 999px; background: var(--accent); color: #fff; }
.join:hover { filter: brightness(1.1); }
.item.rem { grid-template-columns: 22px minmax(0, 1fr) auto; }
.item.rem + .item.rem::before, .item + .item.rem::before, .item.rem + .item::before { left: 50px; }
.rem .circle { width: 18px; height: 18px; border-radius: 50%; border: 2px solid; }
.empty { color: var(--muted); padding: 16px; }
.allday { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.allday span { padding: 5px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: #fff; }

/* Calendar */
.cal-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.cal-head h1 { font-size: 26px; margin: 0 auto 0 0; }
.seg { display: inline-flex; background: var(--card); border-radius: 10px; padding: 2px; }
.seg button { padding: 6px 14px; border-radius: 8px; font-size: 14px; }
.seg button[aria-pressed="true"] { background: var(--bg); box-shadow: 0 1px 3px rgba(0,0,0,.18); font-weight: 600; }
.nav-buttons { display: flex; gap: 6px; }
.nav-buttons button { padding: 6px 12px; border-radius: 8px; background: var(--card); }
.nav-buttons button:hover { background: var(--card-2); }
.list-toggle { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); cursor: pointer; }
.list-toggle input { accent-color: var(--accent); }
.agenda { max-width: 900px; }
.aday { margin-bottom: 18px; }
.aday-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; text-align: left; }
.aday-head:hover strong { text-decoration: underline; }
.aday-num { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--card); font-variant-numeric: tabular-nums; }
.aday.today .aday-num { background: var(--now); color: #fff; }
.aday.today strong { color: var(--now); }
.circle.small { width: 12px; height: 12px; border-radius: 50%; border: 2px solid; justify-self: center; }
.month { display: grid; grid-template-columns: repeat(7, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.month .dow { padding: 6px 8px; font-size: 12px; color: var(--muted); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--sidebar); }
.month .cell { min-height: 112px; padding: 4px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.month .cell:hover { background: var(--hover); }
.month .cell.other { color: var(--faint); background: color-mix(in srgb, var(--sidebar) 50%, transparent); }
.month .num { font-size: 13px; font-weight: 600; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.month .cell.today .num { background: var(--now); color: #fff; }
.pill { font-size: 11.5px; padding: 1px 6px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill.allday { color: #fff; font-weight: 600; }
.pill.timed { display: flex; gap: 4px; align-items: center; }
.pill.timed i { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.more { font-size: 11px; color: var(--muted); padding-left: 6px; }
.timegrid { display: grid; position: relative; border-top: 1px solid var(--line); max-height: calc(100vh - 150px); min-height: 360px; overflow-y: auto; }
.tg-head { display: grid; position: sticky; top: 0; background: var(--bg); z-index: 3; border-bottom: 1px solid var(--line); }
.tg-head div { padding: 6px; font-size: 13px; color: var(--muted); text-align: center; }
.tg-head .today { color: var(--now); font-weight: 700; }
.tg-allday { display: grid; position: sticky; top: 30px; background: var(--bg); z-index: 3; border-bottom: 1px solid var(--line); min-height: 26px; }
.tg-allday > div { padding: 2px; display: flex; flex-direction: column; gap: 2px; border-left: 1px solid var(--line); }
.tg-body { display: grid; position: relative; }
.hours { position: relative; }
.hours div { height: 48px; font-size: 11px; color: var(--faint); text-align: right; padding-right: 6px; transform: translateY(-7px); }
.col { position: relative; border-left: 1px solid var(--line); background: repeating-linear-gradient(to bottom, transparent 0, transparent 47px, var(--line) 47px, var(--line) 48px); }
.block { position: absolute; border-radius: 6px; padding: 3px 6px; font-size: 12px; overflow: hidden; color: var(--ink); border-left: 3px solid; cursor: default; }
.block b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.block span { color: var(--muted); font-size: 11px; }
.nowline { position: absolute; left: 0; right: 0; height: 2px; background: var(--now); z-index: 2; }
.nowline::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--now); }
.dayreminders { margin-top: 18px; }
.window-note { color: var(--faint); font-size: 12px; margin-top: 12px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--card-2); padding: 10px 18px; border-radius: 12px; box-shadow: var(--shadow); font-size: 14px; }

/* Clickable rows, details drawer, search */
.clickable { cursor: pointer; }
.item.clickable:hover, .block.clickable:hover { filter: brightness(1.04); background-color: var(--hover); }
.block.clickable:hover { background-color: unset; filter: brightness(1.08); }
.pill.clickable:hover { filter: brightness(1.1); }
.clickable:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 8px; }
dialog { color: var(--ink); background: var(--bg); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 0; }
dialog::backdrop { background: rgba(0, 0, 0, .35); }
.drawer { margin: 0 0 0 auto; height: 100%; max-height: 100%; max-width: 100%; width: min(440px, 100%); border-radius: 0; border-width: 0 0 0 1px; }
.drawer[open] { display: flex; flex-direction: column; }
.drawer-head { display: flex; justify-content: flex-end; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.drawer-body { padding: 18px 22px 40px; overflow-y: auto; }
.d-kind { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.d-kind .circle { width: 14px; height: 14px; border-radius: 50%; border: 2px solid; }
.d-title { font-size: 24px; margin: 8px 0 6px; overflow-wrap: anywhere; }
.d-when { font-size: 16px; margin: 0 0 4px; }
.d-when.late { color: var(--danger); font-weight: 600; }
.facts { margin: 16px 0; display: grid; gap: 10px; }
.fact { display: grid; grid-template-columns: 96px 1fr; gap: 10px; }
.fact dt { color: var(--muted); font-size: 13px; }
.fact dd { margin: 0; overflow-wrap: anywhere; }
.d-notes { white-space: pre-line; background: var(--card); border-radius: 12px; padding: 12px 14px; margin: 14px 0; font-size: 14px; overflow-wrap: anywhere; }
.d-subtasks h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); display: flex; gap: 8px; margin: 18px 0 8px; }
.d-subtasks ul { list-style: none; margin: 0; padding: 0; }
.d-subtasks li { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.d-subtasks li .check { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--faint); display: grid; place-items: center; font-size: 11px; flex: none; }
.d-subtasks li.done { color: var(--faint); text-decoration: line-through; }
.d-subtasks li.done .check { background: var(--faint); border-color: var(--faint); color: var(--bg); }
.d-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 14px; }
.join.big { padding: 8px 18px; font-size: 14px; }
.pill-button { padding: 8px 16px; border-radius: 999px; background: var(--card); font-size: 14px; font-weight: 600; color: var(--ink); }
.pill-button:hover { background: var(--card-2); }
.search-open { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; margin-bottom: 10px; border-radius: 9px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.search-open:hover { border-color: var(--faint); }
.search-open kbd { margin-left: auto; font: inherit; font-size: 11px; padding: 1px 6px; border-radius: 5px; background: var(--card); }
.palette { width: min(620px, calc(100% - 24px)); margin: 10vh auto auto; border-radius: 16px; max-height: 76vh; }
.palette[open] { display: flex; flex-direction: column; }
.palette input { font: inherit; font-size: 17px; padding: 16px 18px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); outline: none; }
.palette-results { overflow-y: auto; padding: 6px; }
.palette-results h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--faint); margin: 10px 10px 4px; }
.p-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border-radius: 10px; text-align: left; }
.p-item.active { background: var(--selected); }
.p-item .bar { width: 4px; height: 30px; border-radius: 2px; flex: none; }
.p-item .circle { width: 14px; height: 14px; border-radius: 50%; border: 2px solid; flex: none; margin: 0 -5px; }
.p-text { display: flex; flex-direction: column; min-width: 0; }
.p-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-meta { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-hint { color: var(--muted); padding: 14px 10px; margin: 0; }
.palette-keys { margin: 0; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 11px; color: var(--faint); }

/* Stale data */
.readonly.stale { border-color: color-mix(in srgb, #c28a0e 55%, transparent); background: color-mix(in srgb, #c28a0e 14%, var(--bg)); }
.readonly.stale .ro-icon { color: #c28a0e; }

/* Mini month */
.mini { margin-top: 18px; padding: 0 4px; }
.mini-head { display: flex; align-items: center; gap: 2px; padding: 0 4px 6px; font-size: 13px; }
.mini-head strong { margin-right: auto; }
.mini-head button { width: 24px; height: 24px; border-radius: 6px; color: var(--muted); }
.mini-head button:hover { background: var(--hover); }
.mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; gap: 1px; }
.mini-dow { font-size: 10px; color: var(--faint); padding-bottom: 2px; }
.mini-day { position: relative; font-size: 12px; height: 28px; border-radius: 50%; font-variant-numeric: tabular-nums; }
.mini-day:hover { background: var(--hover); }
.mini-day.other { color: var(--faint); }
.mini-day.selected { background: var(--selected); font-weight: 700; }
.mini-day.today { color: var(--now); font-weight: 700; }
.mini-day.today.selected { background: var(--now); color: #fff; }
.mini-day i { position: absolute; left: 50%; bottom: 2px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--faint); }

/* Up Next, Going on today, roles */
.upnext { background: var(--card); border-radius: 16px; padding: 6px; margin-bottom: 12px; }
.upnext-line { display: grid; grid-template-columns: 52px 4px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; }
.upnext-line .circle { width: 14px; height: 14px; border-radius: 50%; border: 2px solid; margin-left: -5px; }
.upnext-line .bar { width: 4px; align-self: stretch; border-radius: 2px; }
.upnext-line .title { font-weight: 700; font-size: 17px; overflow-wrap: anywhere; }
.upnext-label { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.upnext-line.is-now .upnext-label { color: var(--accent); }
.upnext-line + .upnext-line { border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; }
.upnext-later { padding: 0 12px 8px 76px; font-size: 13px; }
.upnext-earlier { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 4px 12px 10px; }
.upnext-earlier .going { background: var(--bg); }
.upnext.empty-next { display: flex; gap: 12px; align-items: center; padding: 14px 18px; color: var(--muted); }
.goingon { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 18px; }
.goingon-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-right: 2px; }
.going { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--card); font-size: 13px; max-width: 100%; }
.going strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.going.past strong { color: var(--muted); }
.going.past .dot { opacity: .6; }
.going:hover { background: var(--card-2); }
.during { font-size: 12px; color: var(--faint); margin-top: 2px; }
.ongoing-line { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 12px; align-items: start; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.ongoing-line .when { color: var(--muted); font-size: 12px; padding-top: 5px; }
.ongoing-items { display: flex; flex-wrap: wrap; gap: 6px; }
.band { position: absolute; width: 5px; border-radius: 3px; z-index: 1; }
.band:hover { opacity: 1 !important; width: 7px; }
.pill.ongoing { background: var(--card); color: var(--muted); }
.pill .progress { font-weight: 400; opacity: .85; }
.cal-row { display: flex; align-items: center; gap: 4px; }
.cal-row label { flex: 1; min-width: 0; }
.cal-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role { font: inherit; font-size: 11px; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 6px; padding: 1px 2px; max-width: 82px; }
.long-setting { display: flex !important; flex-direction: column; align-items: stretch !important; gap: 4px !important; margin-top: 10px; font-size: 12px !important; color: var(--muted); }
.long-setting select { font: inherit; font-size: 12px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 3px 4px; }
.role-help { padding: 4px 10px 0; line-height: 1.35; }

/* Polish: settings sheet, Who's who, refresh, month, sticky days, summary */
.settings-open { display: none; }
.sheet-title { margin-right: auto; align-self: center; }
.settings-sheet .drawer-body .mini, .settings-sheet .drawer-body .filter { display: block !important; margin: 0 0 18px; }
.settings-sheet .mini-day { height: 36px; font-size: 14px; }
.drawer-head { gap: 4px; align-items: center; }
/* The installed app draws under the status bar; keep Done and ‹ Today below it. */
.drawer-head { padding-top: max(10px, env(safe-area-inset-top)); }
.drawer-body { padding-bottom: max(40px, env(safe-area-inset-bottom)); }
.settings-sheet .sheet-title { margin: 0 auto; }
.drawer-spacer { flex: 1; }
#detail-prev, #detail-next { font-size: 20px; padding: 2px 12px; }
#detail-prev:disabled, #detail-next:disabled { opacity: .3; cursor: default; }
.whoswho { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin-bottom: 14px; display: grid; gap: 10px; }
.whoswho p { margin: 2px 0 0; }
.whoswho-cals { display: flex; flex-wrap: wrap; gap: 8px; }
.who { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px 6px 12px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); font-size: 14px; }
.who .who-role { font-size: 11px; font-weight: 700; color: var(--faint); padding-left: 4px; }
.who.mine { border-color: var(--accent); }
.who.mine .who-role { color: var(--accent); }
.whoswho-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.primary-pill { background: var(--accent); color: #fff; }
.primary-pill:hover { background: var(--accent); filter: brightness(1.08); }
#refresh.busy { opacity: .7; pointer-events: none; }
.ptr { position: fixed; top: 0; left: 50%; transform: translate(-50%, -50px); width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--card-2); box-shadow: var(--shadow); color: var(--muted); font-size: 18px; z-index: 20; pointer-events: none; }
.ptr.ready { color: var(--accent); }
.ptr.busy { transform: translate(-50%, 16px) !important; animation: spin 1s linear infinite; }
@keyframes spin { to { rotate: 360deg; } }
@media (prefers-reduced-motion: reduce) { .ptr.busy { animation: none; } }
.chip.summary { gap: 8px; }
.chip.summary .sep { color: var(--faint); }
.chip.summary .late { color: var(--danger); }
.aday-head { position: sticky; top: -28px; z-index: 2; width: 100%; padding: 8px 0; margin-bottom: 0; background: var(--bg); }
.month .cell.weekend:not(.other) { background: color-mix(in srgb, var(--sidebar) 70%, transparent); }
.pill.quiet { background: transparent !important; border: 1px solid var(--line); color: var(--muted); font-weight: 500; }
.pill.allday.quiet { border-color: currentColor; }
.month .more { text-align: left; color: var(--accent); font-weight: 600; }
.month .more:hover { text-decoration: underline; }

/* Reminders tools */
.rtools { display: flex; gap: 8px; margin: 10px 0 4px; flex-wrap: wrap; }
.rtools input, .rtools select { font: inherit; font-size: 14px; padding: 7px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.rtools input { flex: 1; min-width: 160px; }
.fold { display: flex; gap: 8px; align-items: baseline; font: inherit; font-weight: 700; }
.fold .chev { display: inline-block; transition: transform .15s; transform: rotate(90deg); color: var(--muted); }
.folded .fold .chev { transform: none; }
.chip.umbrella { color: var(--ink); }

/* Reminders */
.limits { margin-bottom: 18px; padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 10%, var(--bg)); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); font-size: 14px; }
.limits summary { cursor: pointer; list-style: none; }
.limits summary::-webkit-details-marker { display: none; }
.limits .more-link { color: var(--accent); font-weight: 600; white-space: nowrap; }
.limits ul { margin: 10px 0 2px; padding-left: 20px; color: var(--muted); }
.limits li { margin-bottom: 4px; }
.rlayout { display: grid; grid-template-columns: minmax(260px, 320px) minmax(0, 1fr); gap: 28px; align-items: start; }
.rtiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.rtile { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 6px 8px; align-items: center; padding: 12px; border-radius: 14px; background: var(--card); text-align: left; }
.rtile:hover { background: var(--card-2); }
.rtile.selected, .rlist.selected { outline: 2px solid var(--accent); outline-offset: -2px; }
.rtile .rcount { justify-self: end; font-size: 22px; font-weight: 700; }
.rtile .rname { grid-column: 1 / -1; font-weight: 600; color: var(--muted); font-size: 14px; }
.ricon { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 15px; flex: none; }
.ricon.small { width: 26px; height: 26px; font-size: 13px; }
.rhead { font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 0 0 8px; }
.rlists { display: flex; flex-direction: column; }
.rlist { display: flex; align-items: center; gap: 10px; padding: 9px 12px; text-align: left; }
.rlist + .rlist { border-top: 1px solid var(--line); }
.rlist:hover { background: var(--hover); }
.rlist .rname { flex: 1; min-width: 0; display: flex; gap: 8px; align-items: center; overflow-wrap: anywhere; }
.rlist .rcount { color: var(--muted); font-variant-numeric: tabular-nums; }
.rtitle { font-size: 30px; margin: 0 0 6px; display: flex; gap: 10px; align-items: baseline; }
.rtitle .count { font-size: 18px; color: var(--faint); font-weight: 600; }
.rsection { margin-top: 18px; }
.rsection h3 { font-size: 15px; margin: 0 0 8px; display: flex; gap: 8px; align-items: baseline; }
.rsection h3 .count { color: var(--faint); font-size: 13px; }
.rdetail { align-items: start; }
.rdetail .circle { margin-top: 2px; }
.rnotes { color: var(--muted); font-size: 13px; margin-top: 3px; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.subtasks { margin-top: 4px; font-size: 13px; }
.subtasks summary { cursor: pointer; color: var(--accent); }
.subtasks ul { list-style: none; margin: 6px 0 0; padding: 0; }
.subtasks li { padding: 2px 0; }
.subtasks li.done { color: var(--faint); text-decoration: line-through; }
.status { padding: 1px 6px; border-radius: 5px; background: var(--card-2); font-size: 12px; }
.badge.flag { color: #ff9500; }
.incart .title { color: var(--faint); text-decoration: line-through; }
.empty.small { padding: 8px 0; font-size: 13px; }

/* Weather charts */
.hscroll { overflow-x: auto; padding: 4px 6px 8px; scrollbar-width: thin; }
.hrow { display: flex; }
.hchart { display: block; }
.templine { fill: none; stroke: #ff9f0a; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.tempdot { fill: #ff9f0a; }
.templabel { font-size: 11px; font-weight: 700; fill: var(--muted); }
.rainbar { fill: var(--accent); opacity: .55; }
.baseline { stroke: var(--line); stroke-width: 1; }
.suntile .sunarc { width: 100%; max-width: 220px; display: block; margin: 8px auto 2px; }
.sunarc .arc { fill: none; stroke: var(--faint); stroke-width: 2; stroke-dasharray: 4 5; }
.sunarc .horizon { stroke: var(--line); stroke-width: 1.5; }
.sunarc .sun { fill: #ffcc00; }
.sun-times { display: flex; justify-content: space-between; font-weight: 600; font-size: 15px; }
.wx-note.umbrella { font-weight: 600; }

/* Loading */
.skeleton .sk { border-radius: 8px; background: var(--card); animation: sk 1.4s ease-in-out infinite; margin-bottom: 8px; }
.skeleton .sk-box { width: 260px; height: 92px; border-radius: 16px; }
.skeleton .chips .sk { border-radius: 999px; margin: 0; }
.sk-card { padding: 6px 0; }
.sk-row { display: flex; gap: 16px; padding: 10px 16px; }
.sk-row .sk { background: var(--card-2); margin: 0; }
@keyframes sk { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .skeleton .sk { animation: none; } .fold .chev { transition: none; } }

/* Weather */
a.weather { color: inherit; }
a.weather:hover { background: var(--card-2); }
.attribution { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.attribution img { height: 18px; width: auto; }
.attribution.small { margin-top: 6px; font-size: 11px; }
.attribution.small img { height: 12px; }
.attribution .legal { color: var(--muted); text-decoration: underline; }
.alerts { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.alert { --tone: #c28a0e; display: block; border-radius: 16px; background: var(--tone); color: #fff; }
.alert.minor { --tone: #6b7079; } .alert.severe { --tone: #d0632a; } .alert.extreme { --tone: #c8322a; }
a.alert, .alert summary { display: flex; align-items: center; gap: 14px; padding: 14px 18px; cursor: pointer; list-style: none; color: #fff; }
.alert summary::-webkit-details-marker { display: none; }
.alert-icon { font-size: 22px; }
.alert strong { font-size: 16px; }
.alert .level { margin-left: 10px; font-size: 11px; font-weight: 800; letter-spacing: 1px; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.22); }
.alert-sub { font-size: 13px; opacity: .85; }
a.alert > span:last-child, .alert .chev { margin-left: auto; font-size: 22px; transition: transform .15s; }
.alert[open] .chev { transform: rotate(90deg); }
.alert-body { padding: 0 18px 16px 54px; font-size: 14px; }
.alert-body p { margin: 0 0 10px; white-space: pre-line; }
.alert-body a { color: #fff; text-decoration: underline; }
.wx { max-width: 980px; }
.wx-hero { display: flex; gap: 20px; align-items: flex-start; padding: 22px; border-radius: 20px; background: var(--card); margin-bottom: 26px; }
.wx-glyph { font-size: 64px; line-height: 1; }
.wx-main { flex: 1; min-width: 0; }
.wx-main h1 { margin: 0; font-size: 28px; }
.wx-cond { font-size: 18px; color: var(--muted); }
.wx-sub { margin-top: 10px; color: var(--muted); }
.wx-note { margin-top: 6px; font-size: 14px; }
.wx-updated { margin-top: 10px; font-size: 12px; color: var(--faint); }
.wx-temp { font-size: 64px; font-weight: 300; line-height: 1; }
.hourly { padding: 0; }
.hour { flex: 0 0 64px; text-align: center; display: flex; flex-direction: column; gap: 4px; padding: 4px 0; }
.h-time { font-size: 12px; color: var(--muted); font-weight: 600; }
.h-glyph { font-size: 22px; }
.h-rain { font-size: 11px; color: var(--accent); font-weight: 600; }
.h-temp { font-weight: 600; }
.day { position: relative; }
.day + .day { border-top: 1px solid var(--line); }
.day summary { display: grid; grid-template-columns: 64px 64px 44px 1fr 44px; gap: 12px; align-items: center; padding: 11px 16px; cursor: pointer; list-style: none; }
.day summary::-webkit-details-marker { display: none; }
.day summary:hover { background: var(--hover); }
.d-name { font-weight: 600; }
.d-glyph { font-size: 20px; display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.d-glyph small { font-size: 10px; color: var(--accent); font-weight: 700; }
.d-low { color: var(--muted); text-align: right; }
.d-range { position: relative; height: 5px; border-radius: 3px; background: var(--card-2); }
.d-range i { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: #ff9f0a; }
.d-more { padding: 0 16px 14px 92px; font-size: 14px; }
.d-more p { margin: 0 0 8px; }
.d-facts { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: 13px; }
.d-facts b { color: var(--ink); font-weight: 600; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.tile { background: var(--card); border-radius: 16px; padding: 14px 16px; }
.tile-title { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); display: flex; gap: 6px; align-items: center; font-weight: 600; }
.tile-value { font-size: 22px; font-weight: 600; margin-top: 6px; }
.tile-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* Installed on a phone: clear the status bar and home indicator. */
.standalone .welcome { padding-top: max(24px, env(safe-area-inset-top)); }
.install-help { margin-top: 4px; line-height: 1.4; }

@media (max-width: 820px) {
  .standalone .sidebar { padding-top: max(8px, env(safe-area-inset-top)); }
  .standalone .main { padding-bottom: max(40px, env(safe-area-inset-bottom)); }
  .install-help { flex-basis: 100%; }
  .rlayout { grid-template-columns: 1fr; gap: 8px; }
  .upnext-line { grid-template-columns: 40px 4px minmax(0, 1fr) auto; gap: 10px; }
  .upnext-later { padding-left: 62px; }
  .ongoing-line { grid-template-columns: 1fr; gap: 6px; }
  .wx-hero { flex-wrap: wrap; padding: 16px; }
  .wx-glyph, .wx-temp { font-size: 48px; }
  .day summary { grid-template-columns: 48px 44px 36px 1fr 36px; gap: 8px; padding: 10px 12px; }
  .d-more { padding-left: 12px; }
  .alert-body { padding-left: 18px; }
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .sidebar { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 0 8px 0 0; }
  .nav { flex-direction: row; flex: 1 1 100%; order: 3; overflow-x: auto; scrollbar-width: none; }
  .nav-item { padding: 6px 10px; white-space: nowrap; }
  .sidebar .filter, #freshness, .sidebar .mini, .search-open kbd { display: none; }
  .settings-open { display: inline-flex; }
  .weather { padding: 10px 14px; gap: 12px; }
  .weather .temp { font-size: 26px; }
  .weather .forecast { display: none; }
  .today-head { margin-bottom: 12px; gap: 12px; }
  .today-head h1 { font-size: 26px; }
  .aday-head { top: -18px; }
  .search-open { width: auto; margin: 0; padding: 6px 10px; }
  .sidebar-foot { margin: 0 0 0 auto; padding: 0; }
  .main { padding: 18px 14px 40px; }
  .grid2 { grid-template-columns: 1fr; }
  .item { grid-template-columns: 60px 4px minmax(0, 1fr) auto; gap: 10px; padding: 10px 12px; }
  .item + .item::before { left: 86px; right: 12px; }
  .item.rem { grid-template-columns: 20px minmax(0, 1fr) auto; }
  .item.rem + .item.rem::before, .item + .item.rem::before, .item.rem + .item::before { left: 44px; }
  .weather { min-width: 0; width: 100%; }
  .month .cell { min-height: 70px; }
  .pill { font-size: 10px; }
}
.readonly-note { margin: 0; font-size: 13px; color: var(--muted); max-width: 400px; }
.readonly-note strong { color: var(--ink); }
.keep-signed-in { display: inline-flex; align-items: center; gap: 6px; margin: 4px 0 2px; font-size: 13px; color: var(--muted, #8e8e93); cursor: pointer; }
.keep-signed-in input { width: 16px; height: 16px; margin: 0; }

/* Linked note in an event's details */
.d-note { display: flex; flex-direction: column; gap: 3px; margin: 14px 0 6px; padding: 12px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); color: var(--ink); }
.d-note:hover { border-color: var(--accent); }
.d-note-label { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.d-note-preview { color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Briefing */
.brief-day { display: flex; flex-direction: column; gap: 10px; }
.brief-headline { margin: 0; font-size: 17px; font-weight: 700; }
.brief-headline.fits { color: var(--ok, #2e9d55); }
.brief-headline.warn { color: var(--danger); }
.seams { display: flex; flex-direction: column; gap: 8px; }
.seam { padding: 12px 14px; border-radius: 14px; background: var(--card); border-left: 4px solid var(--muted); }
.seam.collision { border-left-color: var(--danger); }
.seam.tight { border-left-color: #f0a020; }
.seam p { margin: 4px 0; color: var(--ink); }
.moments { list-style: none; margin: 0; padding: 4px 0; }
.moment { display: grid; grid-template-columns: 72px 22px minmax(0, 1fr); gap: 8px; align-items: baseline; padding: 8px 14px; }
.moment + .moment { border-top: 1px solid var(--line); }
.moment.past { opacity: .5; }
.moment.leaveBy .m-title { font-weight: 600; }
.m-time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 14px; }
.m-glyph { text-align: center; }

/* Done today */
.done-item s { color: var(--muted); text-decoration-thickness: 1px; }
.done-item .check { color: var(--ok, #2e9d55); font-weight: 700; }

/* Deadlines and shopping budgets */
.deadline.soon { color: var(--warn); font-weight: 600; }
.deadline.late { color: var(--danger); font-weight: 600; }
.budget { margin: 4px 0 14px; max-width: 520px; }
.budget-line { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.budget-left { color: var(--muted); }
.budget.over .budget-left { color: var(--danger); font-weight: 600; }
.budget-track { height: 6px; margin: 6px 0 4px; border-radius: 3px; background: var(--line); overflow: hidden; }
.budget-fill { height: 100%; border-radius: 3px; background: #34a853; }
.budget.over .budget-fill { background: var(--danger); }

/* Air quality and weather tiles */
.aqi-chip { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; vertical-align: middle;
  color: #1d1f23; background: var(--aqi, var(--card-2)); }
.wx-sub .aqi-chip { margin-left: 10px; }
.good { --aqi: #7ed37e; } .moderate { --aqi: #f3d65b; } .sensitive { --aqi: #f5a04a; }
.unhealthy { --aqi: #f07067; } .very-unhealthy { --aqi: #b98ad8; } .hazardous { --aqi: #b5566e; }
.unhealthy .aqi-chip, .very-unhealthy .aqi-chip, .hazardous .aqi-chip, .aqi-chip.unhealthy, .aqi-chip.very-unhealthy, .aqi-chip.hazardous { color: #fff; }
.aqi-scale { position: relative; height: 6px; margin: 12px 0 4px; border-radius: 3px;
  background: linear-gradient(90deg, #7ed37e 0 16.7%, #f3d65b 16.7% 33.3%, #f5a04a 33.3% 50%, #f07067 50% 66.7%, #b98ad8 66.7% 100%); }
.aqi-scale i { position: absolute; top: -3px; width: 4px; height: 12px; margin-left: -2px; border-radius: 2px; background: var(--ink); box-shadow: 0 0 0 2px var(--card); }
@media (max-width: 820px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile-value { font-size: 19px; overflow-wrap: anywhere; }
  .tiles > .suntile, .tiles > .aqi-tile { grid-column: 1 / -1; }
}

/* Phone fit: clear the status bar, home indicator and landscape notch; finger-sized targets */
.toast { bottom: max(24px, calc(env(safe-area-inset-bottom) + 12px)); }
.standalone .ptr { top: env(safe-area-inset-top); }
@media (max-width: 820px) {
  .sidebar { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .main { padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
  .drawer-body { padding-left: max(18px, env(safe-area-inset-left)); padding-right: max(18px, env(safe-area-inset-right)); }
  .nav-item { min-height: 40px; }
  .drawer-head .text-button { min-height: 40px; padding: 0 10px; }
  .mini-head button { width: 40px; height: 40px; font-size: 18px; }
  .settings-sheet .mini-day { height: 42px; }
}

/* Phone bar on one row: Refresh as ↻ (its text stays for screen readers), Sign Out in Settings */
.sheet-foot { display: none; }
@media (max-width: 820px) {
  .foot-buttons .text-button { padding: 6px 8px; }
  #refresh { font-size: 0; }
  #refresh::before { content: '↻'; display: inline-block; font-size: 20px; line-height: 1; }
  #refresh.busy::before { animation: spin .9s linear infinite; }
  #sign-out { display: none; }
  .sheet-foot { display: block; padding: 10px 18px max(14px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
  .sheet-foot .text-button { color: var(--danger); min-height: 40px; }
}
@media (prefers-reduced-motion: reduce) { #refresh.busy::before { animation: none; } }

/* Shopping: one store at a time */
.store-chips { display: flex; gap: 6px; margin: 2px 0 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.store-chip { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 4px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink); font-size: 14px; white-space: nowrap; }
.store-chip:hover { background: var(--hover); }
.store-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.store-meta { font-size: 12px; opacity: .7; font-variant-numeric: tabular-nums; }
@media (max-width: 820px) { .store-chip { min-height: 40px; } }

/* Which time zone the times are in, when the computer and the phone differ */
.ro-zone { margin-top: 6px; font-size: 13px; color: var(--muted); }
.link-button { border: 0; background: none; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
@media (pointer: coarse) { .ro-zone .link-button { padding: 8px 0; } }
#detail-collection-picker {max-width:580px;width:calc(100vw - 32px);max-height:85dvh;overflow:auto;box-sizing:border-box;padding:24px;}
#detail-collection-picker > p {font-size:13px;line-height:1.6;color:var(--muted);}
.detail-collection-choice {display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 0;border-bottom:1px solid var(--line);}
.detail-collection-choice label {display:flex;gap:10px;align-items:center;min-width:0;overflow-wrap:anywhere;}
.detail-collection-choice input {width:18px;height:18px;flex:none;}
.detail-collection-choice select {max-width:45%;min-width:0;}
#detail-new-collection-form,.detail-collection-actions {display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:20px;}
#detail-new-collection-name {min-width:100px;flex:1;}
#detail-collection-picker {border:1px solid var(--line);border-radius:14px;background:var(--bg);color:var(--ink);box-shadow:var(--shadow);}
#detail-collection-picker button {border:1px solid var(--line);border-radius:8px;background:var(--card);color:var(--ink);padding:8px 12px;min-height:36px;}
#detail-collection-save {background:var(--accent)!important;color:#fff!important;border-color:var(--accent)!important;}
#detail-new-collection-name,.detail-collection-choice select {border:1px solid var(--line);border-radius:6px;padding:7px;background:var(--bg);color:var(--ink);font:inherit;}
.detail-collection-choice select:disabled {opacity:.5;}
@media(pointer:coarse){#detail-collection-picker button {min-height:44px;}}

/* Reminder changes made here and applied by Sebastian. Flat: solid fills only. */
.check-button { padding: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; font-weight: 700; line-height: 1; }
.check-button:hover:not(:disabled) { box-shadow: inset 0 0 0 2px currentColor; }
.check-button:disabled { cursor: default; opacity: .55; }
.check-button.checked { opacity: 1; }
.item.pending-change .title { text-decoration: line-through; opacity: .7; }
.pending-note { color: var(--accent); }
.failed-note { color: var(--danger); }
.reopen-button { border: 0; background: none; font: inherit; color: inherit; cursor: pointer; padding: 6px 8px; border-radius: 6px; }
.reopen-button:hover:not(:disabled) { background: var(--hover, rgba(127,127,127,.12)); }
.new-reminder-button { flex: none; }
.actions-strip { margin: 0 0 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card, transparent); font-size: 14px; }
.actions-strip .fine, .actions-message { margin: 6px 0 0; }
.action-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 6px 0; }
.action-row + .action-row { border-top: 1px solid var(--line); }
.action-state { font-weight: 600; color: var(--accent); white-space: nowrap; }
.action-row.failed .action-state { color: var(--danger); }
.action-what { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.action-buttons { display: flex; gap: 12px; }
#new-reminder { max-width: min(460px, calc(100vw - 32px)); width: 100%; box-sizing: border-box; }
#new-reminder form { display: flex; flex-direction: column; gap: 6px; }
#new-reminder h2 { margin: 0 0 6px; }
#new-reminder input, #new-reminder select, #new-reminder textarea { font: inherit; padding: 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg, transparent); color: inherit; box-sizing: border-box; width: 100%; }
.new-reminder-when { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.new-reminder-when label { display: flex; flex-direction: column; gap: 4px; }
#new-reminder .dialog-buttons { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.primary-pill { font-weight: 600; }
@media (pointer: coarse) { .check-button { min-width: 28px; min-height: 28px; } .reopen-button { min-width: 44px; min-height: 40px; } }

/* Today, pass 2: the Now card, one to-do list, free time, a clear day. Flat fills only. */
.nowcard { padding: 20px 22px 14px; margin-bottom: 18px; border-radius: 18px; border: 1px solid var(--line); }
.nowcard .today-head { margin-bottom: 14px; }
.nowcard .today-head h1 { font-size: 28px; line-height: 1.2; }
.nowcard .weather { background: var(--card); }
.nowcard .upnext { margin: 0 0 10px; }
.nowcard .chips { margin: 4px 0 0; }
.now-summary { margin-top: 6px; font-size: 14px; color: var(--muted); }
.now-summary strong { color: var(--ink); }
.now-summary .late, .now-summary .late strong { color: var(--danger); }
.event-actions { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.event-action { padding: 5px 10px; border-radius: 999px; background: var(--card-2); color: var(--ink); font-size: 12px; font-weight: 600; white-space: nowrap; }
.event-action:hover { background: var(--selected); }
.pinned-collections { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 0 18px; padding: 2px 0; }
.pinned-collections::-webkit-scrollbar { display: none; }
.collection-chip { display: inline-flex; align-items: center; gap: 6px; flex: none; color: var(--ink); text-decoration: none; }
.collection-chip.all { color: var(--accent); }
.todo-card { padding-bottom: 6px; }
.todo-add { padding: 10px 12px 4px; }
.todo-heading { display: flex; align-items: center; gap: 8px; padding: 12px 14px 4px; font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }
.todo-heading.late { color: var(--danger); }
.todo-heading .count { font-weight: 600; }
.done-fold { border-top: 1px solid var(--line); margin-top: 6px; }
.done-fold > summary { cursor: pointer; padding: 12px 14px; font-size: 13px; font-weight: 600; color: var(--muted); list-style: none; }
.done-fold > summary::before { content: '›'; display: inline-block; margin-right: 8px; transition: transform .15s; }
.done-fold[open] > summary::before { transform: rotate(90deg); }
.done-fold > .card { background: transparent; box-shadow: none; }
.quick-add { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.quick-add:focus-within { border-color: var(--accent); }
.quick-add-icon { color: var(--accent); font-weight: 700; }
.quick-add input { flex: 1; min-width: 0; border: 0; background: none; color: var(--ink); font: inherit; font-size: 15px; padding: 6px 0; outline: none; }
.quick-add-hint { min-height: 16px; padding: 4px 12px 0; font-size: 12px; color: var(--accent); }
.clear-day { padding: 26px 24px; margin-bottom: 18px; border-radius: 18px; background: var(--card); display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.clear-day h2 { margin: 0; font-size: 22px; }
.clear-day p { margin: 0; color: var(--muted); line-height: 1.5; }
.clear-day > div { align-self: stretch; }
.free-time { padding: 8px 14px 8px 84px; font-size: 13px; color: var(--muted); border-left: 3px dashed var(--line); margin-left: 72px; }
.free-time strong { color: var(--ink); }
.now-line { display: flex; align-items: center; gap: 8px; padding: 2px 14px; color: var(--now); font-size: 12px; font-weight: 700; }
.now-line::after { content: ''; flex: 1; height: 2px; background: var(--now); border-radius: 1px; }
@media (max-width: 640px) {
  .nowcard { padding: 16px; }
  .nowcard .today-head h1 { font-size: 24px; }
  .nowcard .greet { display: none; }
  .nowcard .weather { min-width: 0; width: 100%; box-sizing: border-box; }
}
@media (pointer: coarse) { .event-action { padding: 9px 12px; font-size: 13px; } .quick-add input { font-size: 16px; } }
.quick-add-hint.example { color: var(--faint); }
.alerts + .nowcard { margin-top: 0; }
/* The navigation sidebar narrows a little on small laptops, before it moves to the top. */
@media (min-width: 821px) and (max-width: 1100px) { .app { grid-template-columns: 264px 1fr; } }

/* View and date controls remain reachable while browsing a long schedule. */
.cal-head { position:sticky; top:0; z-index:6; background:var(--bg); padding:10px 0; }
.calendar-date-control input { min-height:36px; max-width:155px; background:var(--card); color:var(--ink); border:1px solid var(--line); border-radius:8px; padding:5px; font:inherit; }
.next-alarm-card { display:flex; align-items:center; justify-content:space-between; gap:16px; margin:14px 0; padding:16px; }
.next-alarm-card h2 { margin:0 0 4px; font-size:13px; color:var(--muted); }
.next-alarm-time { font-size:24px; white-space:nowrap; }
@media(max-width:600px){.cal-head h1 { flex:1 0 100%;font-size:20px; }.cal-head .nav-buttons {flex-wrap:wrap;}.next-alarm-time{font-size:20px;}}
