:root {
  --bg: #f5f6fa; --surface: #ffffff; --surface-2: #f0f2f7; --surface-3: #e4e7ef;
  --text: #14161f; --muted: #5f6679; --faint: #8a90a2; --line: #e2e5ed;
  --accent: #5856d6; --accent-weak: #ecebfd; --on-accent: #fff;
  --danger: #d93a41; --ok: #1f9d63; --warn: #c97f06;
  --shadow: 0 1px 2px rgba(20,22,40,.04), 0 6px 24px rgba(20,22,40,.05);
  --radius: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Inter, Roboto, system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1016; --surface: #171a22; --surface-2: #20242e; --surface-3: #2b303c;
    --text: #e9ebf1; --muted: #a0a7b8; --faint: #747b8c; --line: #272b36;
    --accent: #8d8cf9; --accent-weak: #26264a; --on-accent: #0e1016;
    --danger: #f26b70; --ok: #3cc88a; --warn: #f2b13d;
    --shadow: 0 1px 2px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1016; --surface: #171a22; --surface-2: #20242e; --surface-3: #2b303c;
  --text: #e9ebf1; --muted: #a0a7b8; --faint: #747b8c; --line: #272b36;
  --accent: #8d8cf9; --accent-weak: #26264a; --on-accent: #0e1016;
  --danger: #f26b70; --ok: #3cc88a; --warn: #f2b13d;
  --shadow: 0 1px 2px rgba(0,0,0,.3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
svg { display: block; }

#app { display: grid; grid-template-columns: 224px minmax(0, 1fr); height: 100vh; height: 100dvh; }

/* ---------- Navigation ---------- */
.sidebar { display: flex; flex-direction: column; gap: 2px; padding: 20px 14px; background: var(--surface); border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 700; font-size: 16px; }
.brand img { width: 30px; height: 30px; }
.nav-btn { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 0; background: none; border-radius: 10px; color: var(--muted); cursor: pointer; text-align: left; font-weight: 550; position: relative; }
.nav-btn svg { width: 20px; height: 20px; flex: none; }
.nav-btn:hover { background: var(--surface-2); color: var(--text); }
.nav-btn.active { background: var(--accent-weak); color: var(--accent); }
.nav-badge { margin-left: auto; font-size: 12px; font-variant-numeric: tabular-nums; background: var(--accent); color: var(--on-accent); padding: 1px 7px; border-radius: 999px; }
.nav-spacer { flex: 1; }

/* ---------- Layout ---------- */
main { overflow-y: auto; padding: 28px 32px 48px; min-width: 0; }
main > * { max-width: 1200px; margin-left: auto; margin-right: auto; }
main[data-view="notes"] { display: flex; flex-direction: column; overflow: hidden; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; width: 100%; }
h1 { font-size: 28px; margin: 0; letter-spacing: -.02em; line-height: 1.15; }
h2 { font-size: 16px; margin: 0; }
h3 { font-size: 12px; margin: 22px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 650; }
.eyebrow { margin: 0 0 4px; color: var(--muted); font-size: 14px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.grow { flex: 1; }
.hint { margin: -10px 0 12px; font-size: 13px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.empty { color: var(--muted); text-align: center; padding: 26px 12px; font-size: 14px; }

/* ---------- Controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; white-space: nowrap; }
.btn svg { width: 16px; height: 16px; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.danger { background: var(--danger); color: #fff; border-color: transparent; }
.btn.danger-text { color: var(--danger); }
.btn.sm { padding: 6px 12px; font-size: 14px; }
.btn.big { padding: 14px 34px; font-size: 17px; border-radius: 14px; min-width: 150px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.link { background: none; border: 0; color: var(--accent); cursor: pointer; font-weight: 600; padding: 4px; }
.icon-btn { width: 34px; height: 34px; display: inline-grid; place-items: center; border: 0; background: none; border-radius: 9px; color: var(--muted); cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.on { color: var(--accent); }

input:not([type=checkbox]):not([type=radio]):not([type=color]), select, textarea { background: var(--surface-2); border: 1px solid transparent; border-radius: 10px; padding: 9px 12px; outline: none; min-width: 0; }
input:focus, select:focus, textarea:focus { border-color: var(--accent) !important; box-shadow: 0 0 0 3px var(--accent-weak); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.field.inline { flex-direction: row; align-items: center; gap: 10px; margin: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: color-mix(in srgb, var(--c, #94a3b8) 16%, transparent); color: color-mix(in srgb, var(--c, #94a3b8) 70%, var(--text)); white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; display: inline-block; }

.seg { display: inline-flex; background: var(--surface-2); border-radius: 11px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 6px 14px; border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--muted); font-size: 14px; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

.check { position: relative; width: 22px; height: 22px; flex: none; cursor: pointer; }
.check input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.check span { position: absolute; inset: 0; border: 2px solid var(--faint); border-radius: 7px; transition: .15s; }
.check input:checked + span { background: var(--ok); border-color: var(--ok); }
.check input:checked + span::after { content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.check input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { opacity: 0; position: absolute; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: var(--surface-3); border-radius: 99px; transition: .2s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: .2s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Dashboard ---------- */
.dash { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.focus-card { display: flex; align-items: center; gap: 22px; }
.focus-card p { margin: 4px 0 14px; }
.ring-wrap { position: relative; display: grid; place-items: center; flex: none; }
.ring-center { position: absolute; text-align: center; }
.ring-bg { fill: none; stroke: var(--surface-3); }
.ring-fg { fill: none; stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .4s ease, stroke .3s; }
.big-num { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }

.list { display: flex; flex-direction: column; gap: 2px; }
.li { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; border: 0; background: none; text-align: left; width: 100%; cursor: pointer; }
.li:hover { background: var(--surface-2); }
.li .bar-c { width: 4px; align-self: stretch; border-radius: 4px; background: var(--c); flex: none; }
.li-main { flex: 1; min-width: 0; }
.li-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li.past { opacity: .5; }
.badge-now { font-size: 11px; font-weight: 700; color: #fff; background: var(--ok); padding: 2px 8px; border-radius: 999px; }

/* ---------- Timetable ---------- */
.tt-scroll { overflow: auto; padding: 0; max-height: calc(100dvh - 190px); }
.tt-grid { display: grid; grid-template-columns: 58px repeat(7, minmax(112px, 1fr)); min-width: 860px; }
.tt-dayhead { padding: 12px 8px; font-weight: 650; font-size: 14px; border-bottom: 1px solid var(--line); text-align: center; position: sticky; top: 0; background: var(--surface); z-index: 3; }
.tt-dayhead.today { color: var(--accent); }
.tt-times { position: relative; height: calc(var(--rows) * var(--hour)); }
.tt-times span { position: absolute; right: 8px; margin-top: 3px; font-size: 11.5px; color: var(--faint); white-space: nowrap; }
.tt-col { position: relative; height: calc(var(--rows) * var(--hour)); border-left: 1px solid var(--line); background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px); background-size: 100% var(--hour); cursor: copy; }
.tt-col.today { background-color: color-mix(in srgb, var(--accent) 5%, transparent); }
.tt-block { position: absolute; border: 0; border-radius: 9px; padding: 5px 8px; text-align: left; overflow: hidden; cursor: pointer; background: color-mix(in srgb, var(--c) 20%, var(--surface)); border-left: 4px solid var(--c); color: var(--text); font-size: 12px; line-height: 1.3; display: flex; flex-direction: column; gap: 1px; z-index: 1; }
.tt-block:hover { background: color-mix(in srgb, var(--c) 30%, var(--surface)); }
.tt-block b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-block span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 2; pointer-events: none; }
.tt-now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }

.day-tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; scrollbar-width: none; }
.day-tab { flex: 1; min-width: 44px; padding: 8px 0; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 650; display: flex; flex-direction: column; align-items: center; font-size: 13px; }
.day-tab small { font-size: 11px; color: var(--muted); font-weight: 500; }
.day-tab.on { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.day-tab.on small { color: inherit; opacity: .8; }
.day-tab.today:not(.on) { border-color: var(--accent); color: var(--accent); }

/* ---------- Tasks ---------- */
.task-add { display: grid; grid-template-columns: minmax(0, 1fr) 160px 150px 120px auto; gap: 8px; padding: 10px; margin-bottom: 16px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.task { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 6px; }
.dash .task { border: 0; padding-left: 8px; margin: 0; }
.task-main { flex: 1; min-width: 0; border: 0; background: none; text-align: left; padding: 7px 0; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.task-title { font-weight: 600; overflow-wrap: anywhere; }
.task.done .task-title { text-decoration: line-through; color: var(--faint); }
.task-meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); align-items: center; }
.due.over { color: var(--danger); font-weight: 650; }
.due.today { color: var(--warn); font-weight: 650; }
.prio { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.prio.high { color: var(--danger); }

/* ---------- Timer ---------- */
.timer-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.timer-card .seg { flex-wrap: nowrap; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.timer-card .seg button { padding: 6px 11px; white-space: nowrap; }
.timer-card { display: flex; flex-direction: column; align-items: center; gap: 20px; padding: 24px 18px; }
.timer-ring { position: relative; display: grid; place-items: center; width: min(280px, 72vw); aspect-ratio: 1; }
.timer-ring svg { width: 100%; height: 100%; }
.timer-center { position: absolute; text-align: center; }
.tm-time { font-size: clamp(44px, 12vw, 64px); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.03em; line-height: 1.1; }
.tm-label { color: var(--muted); font-weight: 600; }
.mode-short .ring-fg, .mode-long .ring-fg { stroke: var(--ok); }
.mode-stopwatch .ring-fg { stroke: var(--warn); }
.timer-controls { display: flex; gap: 10px; align-items: center; }
.cycle { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); }
.cycle i { width: 9px; height: 9px; border-radius: 50%; background: var(--surface-3); }
.cycle i.on { background: var(--accent); }
.stat-big { display: flex; align-items: baseline; gap: 8px; margin: 6px 0 10px; }
.hbar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.hbar i { display: block; height: 100%; background: var(--c, var(--accent)); border-radius: 99px; }
.bars { display: flex; align-items: stretch; gap: 8px; height: 130px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bar-track { flex: 1; width: 100%; display: flex; align-items: flex-end; background: var(--surface-2); border-radius: 7px; overflow: hidden; }
.bar { width: 100%; background: color-mix(in srgb, var(--accent) 55%, transparent); border-radius: 7px 7px 0 0; }
.bar-col.today .bar { background: var(--accent); }
.bar-col span { font-size: 11.5px; color: var(--muted); }
.subj-stat { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; margin-bottom: 10px; font-size: 14px; }
.subj-stat .hbar { grid-column: 1 / -1; }
.sess { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 14px; border-bottom: 1px solid var(--line); }
.sess:last-child { border-bottom: 0; }

/* ---------- Notes ---------- */
.notes { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; flex: 1; min-height: 0; width: 100%; }
.notes-list { display: flex; flex-direction: column; gap: 10px; padding: 12px; min-height: 0; }
.notes-tools { display: flex; gap: 8px; }
.notes-tools input { flex: 1; }
.nl { overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 2px; margin: 0 -6px; padding: 0 6px; }
.ni { border: 0; background: none; text-align: left; padding: 10px 12px; border-radius: 10px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; width: 100%; }
.ni:hover { background: var(--surface-2); }
.ni.on { background: var(--accent-weak); }
.ni-title { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px; }
.ni-title svg { width: 13px; height: 13px; color: var(--accent); flex: none; }
.ni-snip { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ni-meta { font-size: 12px; color: var(--faint); display: flex; gap: 8px; align-items: center; }
.note-editor { display: flex; flex-direction: column; min-height: 0; padding: 0; overflow: hidden; }
.note-empty { flex: 1; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 24px; }
.ne-head { display: flex; align-items: center; gap: 4px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.ne-head select { max-width: 200px; padding: 6px 10px; font-size: 14px; }
.only-narrow { display: none; }
input.ne-title { font-size: 24px; font-weight: 700; background: none !important; border: 0 !important; box-shadow: none !important; padding: 18px 22px 6px !important; width: 100%; }
textarea.ne-body { flex: 1; resize: none; background: none !important; border: 0 !important; box-shadow: none !important; padding: 8px 22px 22px !important; line-height: 1.65; font-size: 15.5px; width: 100%; }
.md { flex: 1; overflow: auto; padding: 4px 22px 22px; line-height: 1.65; overflow-wrap: anywhere; }
.md h2 { font-size: 22px; margin: 16px 0 6px; } .md h3 { font-size: 18px; margin: 14px 0 6px; text-transform: none; letter-spacing: 0; color: var(--text); } .md h4 { font-size: 16px; margin: 12px 0 4px; }
.md p { margin: 6px 0; } .md ul, .md ol { margin: 6px 0; padding-left: 24px; }
.md li.todo { list-style: none; margin-left: -22px; } .md li.todo input { margin-right: 6px; vertical-align: -1px; }
.md li.todo.checked { color: var(--faint); text-decoration: line-through; }
.md code { background: var(--surface-2); padding: 1px 5px; border-radius: 5px; font-size: .9em; }
.md pre { background: var(--surface-2); padding: 12px; border-radius: 10px; overflow: auto; }
.md pre code { background: none; padding: 0; }
.md mark { background: color-mix(in srgb, #facc15 45%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; }
.md blockquote { margin: 8px 0; padding-left: 12px; border-left: 3px solid var(--line); color: var(--muted); }
.ne-foot { padding: 8px 16px; font-size: 12px; color: var(--faint); border-top: 1px solid var(--line); }

/* ---------- Settings ---------- */
.settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.settings .card > h2 { margin-bottom: 6px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-row input[type=number] { width: 80px; text-align: right; }
.num-wrap { display: flex; align-items: center; gap: 8px; }
.subj-row { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.subj-row input:not([type=color]) { flex: 1; }
.subj-row input[type=color] { width: 30px; height: 30px; border: 0; padding: 0; background: none; cursor: pointer; flex: none; }
.subj-add { display: flex; gap: 8px; margin-top: 10px; }
.subj-add input { flex: 1; }

/* ---------- Modal & toast ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(10,12,20,.45); display: grid; place-items: center; padding: 16px; z-index: 50; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 20px; width: min(500px, 100%); max-height: calc(100dvh - 32px); overflow: auto; box-shadow: 0 24px 64px rgba(0,0,0,.3); animation: pop .18s ease; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 6px 20px; }
.modal-head h2 { font-size: 18px; }
.modal-body { padding: 8px 20px 20px; }
.modal-body > p { margin: 0 0 12px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }
.modal-foot .left { margin-right: auto; }
.days-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.days-pick label { position: relative; cursor: pointer; }
.days-pick input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.days-pick span { display: block; padding: 6px 11px; border-radius: 9px; background: var(--surface-2); font-weight: 600; font-size: 14px; color: var(--muted); border: 1px solid transparent; }
.days-pick input:checked + span { background: var(--accent); color: var(--on-accent); }
.days-pick input:focus-visible + span { border-color: var(--accent); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: #1d2030; color: #fff; padding: 10px 14px 10px 16px; border-radius: 12px; display: flex; gap: 14px; align-items: center; z-index: 60; transition: .2s; box-shadow: 0 10px 30px rgba(0,0,0,.25); max-width: calc(100vw - 32px); font-size: 14px; }
:root[data-theme="dark"] #toast { background: #2c3042; border: 1px solid #3b4058; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) #toast { background: #2c3042; border: 1px solid #3b4058; } }
#toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#toast button { background: none; border: 0; color: #a5b4fc; font-weight: 700; cursor: pointer; padding: 0; }

/* ---------- Phone (iPhone) ---------- */
@media (max-width: 760px) {
  #app { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .sidebar { grid-row: 2; flex-direction: row; padding: 4px 2px calc(4px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); gap: 0; }
  .brand, .nav-spacer { display: none; }
  .nav-btn { flex: 1; flex-direction: column; gap: 2px; font-size: 10.5px; padding: 6px 0; align-items: center; font-weight: 600; min-width: 0; }
  .nav-btn:hover { background: none; }
  .nav-btn.active { background: none; }
  .nav-badge { position: absolute; top: 0; left: 52%; margin: 0; font-size: 9.5px; padding: 0 5px; }
  main { padding: calc(14px + env(safe-area-inset-top)) 16px 24px; }
  main[data-view="notes"] { padding-bottom: 12px; }
  h1 { font-size: 24px; }
  .view-head { margin-bottom: 14px; }
  input:not([type=checkbox]):not([type=radio]):not([type=color]), select, textarea { font-size: 16px; }
  .dash, .timer-layout, .settings { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .focus-card { gap: 16px; }
  .task-add { grid-template-columns: 1fr 1fr; }
  .task-add input[name=title] { grid-column: 1 / -1; }
  .notes { grid-template-columns: minmax(0, 1fr); }
  .notes.editing .notes-list { display: none; }
  .notes:not(.editing) .note-editor { display: none; }
  .only-narrow { display: inline-grid; }
  input.ne-title { font-size: 22px; padding: 14px 16px 4px !important; }
  textarea.ne-body, .md { padding-left: 16px !important; padding-right: 16px !important; }
  .modal-backdrop { place-items: end center; padding: 0; }
  .modal { border-radius: 20px 20px 0 0; width: 100%; padding-bottom: env(safe-area-inset-bottom); max-height: 92dvh; }
  #toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
}
