/* Шрифты лежат на своём сервере, без запросов к Google */
@font-face { font-family: "Onest"; font-style: normal; font-display: swap; font-weight: 400; src: url(/fonts/onest-cyrillic-400-normal.woff2) format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "Onest"; font-style: normal; font-display: swap; font-weight: 400; src: url(/fonts/onest-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Onest"; font-style: normal; font-display: swap; font-weight: 500; src: url(/fonts/onest-cyrillic-500-normal.woff2) format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "Onest"; font-style: normal; font-display: swap; font-weight: 500; src: url(/fonts/onest-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Onest"; font-style: normal; font-display: swap; font-weight: 600; src: url(/fonts/onest-cyrillic-600-normal.woff2) format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "Onest"; font-style: normal; font-display: swap; font-weight: 600; src: url(/fonts/onest-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Onest"; font-style: normal; font-display: swap; font-weight: 700; src: url(/fonts/onest-cyrillic-700-normal.woff2) format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "Onest"; font-style: normal; font-display: swap; font-weight: 700; src: url(/fonts/onest-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-display: swap; font-weight: 500; src: url(/fonts/jetbrains-mono-cyrillic-500-normal.woff2) format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-display: swap; font-weight: 500; src: url(/fonts/jetbrains-mono-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

html { -webkit-text-size-adjust: 100%; }
html { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); scroll-padding-top: env(safe-area-inset-top, 0px); }
body { margin: 0; }
img { max-width: 100%; }
/* Layout: one calm column, date + progress on top, quick-add bar, task list, done list folded below */
:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --fg: #16181d;
  --muted: #6b7180;
  --faint: #e6e8ee;
  --line: #eceef3;
  --accent: #2d5be3;
  --accent-soft: #e8eefc;
  --high: #d9480f;
  --low: #9aa0ad;
  --c-home: #2f9e44;
  --c-work: #2d5be3;
  --c-free: #ae3ec9;
  --c-group: #e67700;
  --c-me: #0c8599;
  --c-geese: #d6336c;
  --c-olive: #5c940d;
  --c-slate: #5f6b7a;
  --font: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111318; --surface: #191c23; --fg: #e9ebf0; --muted: #8b91a0; --faint: #2a2e38; --line: #23272f;
    --accent: #7c9cff; --accent-soft: #1f2840; --high: #ff8a4c; --low: #6b7180;
    --c-home: #69db7c; --c-work: #7c9cff; --c-free: #da77f2; --c-group: #ffa94d; --c-me: #3bc9db; --c-geese: #f783ac; --c-olive: #a9e34b; --c-slate: #a5b0bd;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111318; --surface: #191c23; --fg: #e9ebf0; --muted: #8b91a0; --faint: #2a2e38; --line: #23272f;
  --accent: #7c9cff; --accent-soft: #1f2840; --high: #ff8a4c; --low: #6b7180;
  --c-home: #69db7c; --c-work: #7c9cff; --c-free: #da77f2; --c-group: #ffa94d; --c-me: #3bc9db; --c-geese: #f783ac; --c-olive: #a9e34b; --c-slate: #a5b0bd;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 15px; line-height: 1.45;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 28px 64px;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.wrap { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }

/* Header */
header { display: flex; flex-direction: column; gap: 14px; }
.eyebrow { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.headline { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
h1 { margin: 0; font-size: clamp(26px, 6vw, 34px); font-weight: 700; letter-spacing: -.02em; text-wrap: balance; }
.score { font-family: var(--mono); font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.score b { color: var(--fg); font-weight: 500; }
.bar { height: 6px; background: var(--faint); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .4s ease; }
.bar.full > i { background: var(--c-home); }

/* Add bar */
.add { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 6px 6px 6px 14px; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 1px 2px rgb(0 0 0 / .03); }
.add:focus-within { border-color: var(--accent); }
.add-row { display: flex; align-items: center; gap: 8px; }
#newTitle { flex: 1; min-width: 0; border: 0; background: none; padding: 10px 0; font-size: 16px; outline: none; }
#newTitle::placeholder { color: var(--muted); }
.add-btn { background: var(--accent); color: #fff; width: 40px; height: 40px; border-radius: 10px; font-size: 22px; line-height: 1; display: grid; place-items: center; flex: none; }
.add-btn:disabled { opacity: .35; cursor: default; }
.add-opts { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 0 6px; align-items: center; }
.hint { font-size: 12px; color: var(--muted); margin-left: auto; padding-right: 6px; }

/* Chips */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 99px; font-size: 13px; color: var(--muted); border: 1px solid var(--line); background: var(--surface); white-space: nowrap; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dot, var(--muted)); }
.chip[aria-pressed="true"] { color: var(--fg); border-color: var(--fg); }
.chip.prio[aria-pressed="true"] { color: var(--high); border-color: var(--high); }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-inline: -2px; padding: 2px; }
.filters::-webkit-scrollbar { display: none; }
.filters .count { font-family: var(--mono); font-size: 11px; opacity: .7; }

/* List */
.list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.list:empty { display: none; }
.task { border-top: 1px solid var(--line); scroll-margin-top: calc(12px + env(safe-area-inset-top, 0px)); }
@media (pointer: coarse) { body.editing .wrap { padding-bottom: 70vh; } }
.task:first-child { border-top: 0; }
.row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; }
.check { flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; border: 1.5px solid var(--low); display: grid; place-items: center; transition: background .15s, border-color .15s; }
.check:hover { border-color: var(--accent); }
.task.high .check { border-color: var(--high); }
.task.done .check { background: var(--accent); border-color: var(--accent); }
.check svg { width: 12px; height: 12px; opacity: 0; }
.task.done .check svg { opacity: 1; }
.body { flex: 1; min-width: 0; text-align: left; display: flex; flex-direction: column; gap: 3px; }
.title { overflow-wrap: anywhere; }
.task.done .title { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--low); }
.meta { display: flex; gap: 10px; align-items: center; font-size: 12px; color: var(--muted); }
.meta .cat { display: inline-flex; align-items: center; gap: 5px; }
.meta .cat .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--dot); }
.flag { color: var(--high); font-weight: 600; }
.flag.low { color: var(--low); font-weight: 500; }

/* Inline editor */
.editor { padding: 0 14px 14px 48px; display: flex; flex-direction: column; gap: 10px; }
.editor input { width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 9px 11px; font-size: 15px; }
.editor input:focus { outline: none; border-color: var(--accent); }
.ed-group { display: flex; gap: 6px; flex-wrap: wrap; }
.ed-actions { display: flex; gap: 8px; justify-content: space-between; align-items: center; }
.btn { padding: 7px 14px; border-radius: 10px; font-size: 14px; font-weight: 500; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.ghost { color: var(--muted); }
.btn.danger { color: var(--high); }

/* Time */
.meta .time { font-family: var(--mono); font-size: 12px; color: var(--fg); font-variant-numeric: tabular-nums; }
.task.done .meta .time { color: var(--muted); }
.ed-time { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.editor .ed-time input { width: auto; padding: 6px 10px; font-family: var(--mono); font-size: 14px; }
.chip.timechip { padding: 2px 4px 2px 10px; cursor: pointer; }
.chip.timechip input { border: 0; background: none; font: 13px var(--mono); color: inherit; padding: 2px; width: 6.2em; min-width: 0; }
.chip.timechip input:focus { outline: none; }

/* Days: navigation, week strip, history */
.headline-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.nav { display: flex; gap: 2px; }
.nav button { width: 32px; height: 32px; border-radius: 8px; color: var(--muted); display: grid; place-items: center; }
.nav button:hover { background: var(--accent-soft); color: var(--fg); }
.nav svg { width: 16px; height: 16px; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.day { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 7px 0 9px; border-radius: 10px; border: 1px solid transparent; }
.day .wd { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.day .dn { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.day .mini { width: 56%; height: 3px; border-radius: 99px; background: var(--faint); overflow: hidden; }
.day .mini i { display: block; height: 100%; background: var(--accent); }
.day .mini.full i { background: var(--c-home); }
.day .mini.none { background: transparent; }
.day.today .dn { color: var(--accent); }
.day[aria-current="date"] { background: var(--surface); border-color: var(--line); }
@media (hover: hover) { .day:hover { background: var(--surface); } }
.week-foot { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); gap: 10px; flex-wrap: wrap; min-height: 18px; }
.today-link { color: var(--accent); font-weight: 500; font-size: 13px; }
.carry { color: var(--muted); }
.missed { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); padding: 2px; }
.missed b { font-weight: 500; font-size: 13px; }
.missed ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 2px; }

/* Drag to reorder (desktop) */
.task[draggable="true"] .row { cursor: grab; }
.task.dragging { opacity: .4; }
.task.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.task.drop-after { box-shadow: inset 0 -2px 0 var(--accent); }

/* Footer: backup + keyboard hints */
.foot { display: flex; flex-direction: column; gap: 10px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.backup { display: flex; justify-content: space-between; align-items: center; gap: 8px 14px; flex-wrap: wrap; }
.backup.stale #backupInfo { color: var(--high); }
.backup-actions { display: flex; gap: 6px 14px; flex-wrap: wrap; }
a.link { text-decoration: none; }
.link { color: var(--accent); font-weight: 500; cursor: pointer; }
.restore { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; color: var(--fg); font-size: 14px; }
.restore .ed-actions { justify-content: flex-end; }
.keys { display: none; gap: 14px; flex-wrap: wrap; }
.keys kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--faint); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; margin-right: 4px; color: var(--fg); }
@media (hover: hover) and (pointer: fine) { .keys { display: flex; } }

/* Notes & subtasks */
.note-preview { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.meta .subcount { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.meta .subcount svg { width: 12px; height: 12px; }
.meta .subcount.all { color: var(--c-home); }
.editor textarea { width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 9px 11px; font: 14px/1.45 var(--font); color: var(--fg); resize: vertical; min-height: 60px; }
.editor textarea:focus { outline: none; border-color: var(--accent); }
.subs { display: flex; flex-direction: column; gap: 2px; }
.sub { display: flex; align-items: center; gap: 10px; padding: 3px 0; }
.sub .check { width: 18px; height: 18px; margin: 0; }
.sub .check svg { width: 10px; height: 10px; }
.sub.done .check { background: var(--accent); border-color: var(--accent); }
.sub.done .check svg { opacity: 1; }
.sub span { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.sub.done span { color: var(--muted); text-decoration: line-through; }
.sub .vx { width: 28px; height: 28px; }
.editor .sub-add { border-style: dashed; background: transparent; font-size: 14px; padding: 7px 10px; }
.vx { border-radius: 8px; color: var(--muted); font-size: 18px; flex: none; }
.vx:hover { color: var(--high); }

/* Stats */
.top-row { display: flex; justify-content: space-between; align-items: center; gap: 6px 10px; flex-wrap: wrap; }
.stats { display: flex; flex-direction: column; gap: 22px; }
.stats h1 { font-size: clamp(24px, 5vw, 30px); }
.stats h2 { margin: 0; font-size: 15px; font-weight: 600; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.legend { display: flex; gap: 12px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 560px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tile { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.tile b { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.tile span { font-size: 12px; color: var(--muted); }
.cols { position: relative; margin-top: 14px; display: flex; align-items: flex-end; gap: 2px; height: 140px; border-bottom: 1px solid var(--faint); }
.cols .gl { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line); font-size: 10px; color: var(--muted); pointer-events: none; }
.cols .gl span { position: absolute; right: 0; top: -14px; font-family: var(--mono); }
.col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; position: relative; cursor: default; }
.col .seg { border-radius: 4px 4px 0 0; min-height: 0; }
.col .seg + .seg { border-radius: 0; }
.col .seg.done { background: var(--accent); }
.col .seg.miss, .legend i.miss { background: color-mix(in srgb, var(--muted) 38%, var(--surface)); }
.col:hover .seg, .col:focus-visible .seg { filter: brightness(1.12); }
.col.today::after { content: ""; position: absolute; left: 50%; bottom: -7px; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); transform: translateX(-50%); }
.xlabels { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); font-family: var(--mono); margin-top: 6px; }
.hbars { display: flex; flex-direction: column; gap: 8px; }
.hbar { display: grid; grid-template-columns: 8.5em minmax(0, 1fr) 2.5em; align-items: center; gap: 10px; font-size: 13px; }
.hbar .name { display: inline-flex; align-items: center; gap: 6px; color: var(--fg); white-space: nowrap; overflow: hidden; }
.hbar .name .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--dot); flex: none; }
.hbar .track { height: 10px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.hbar .track i { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }
.hbar .v { font-family: var(--mono); font-size: 12px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.wk { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; align-items: end; height: 120px; }
.wk .c { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; font-size: 11px; color: var(--muted); }
.wk .c i { width: 60%; max-width: 34px; background: var(--accent); border-radius: 4px 4px 0 0; }
.wk .c .pv { font-family: var(--mono); color: var(--fg); }
.carried-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.carried-list li { display: flex; justify-content: space-between; gap: 10px; }
.carried-list .n { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.tip { position: fixed; z-index: 30; pointer-events: none; background: var(--fg); color: var(--bg); font-size: 12px; padding: 6px 9px; border-radius: 8px; white-space: nowrap; box-shadow: 0 4px 14px rgb(0 0 0 / .18); }
.muted-note { font-size: 13px; color: var(--muted); }
details.table summary { font-size: 12px; color: var(--muted); cursor: pointer; }
details.table table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 8px; font-variant-numeric: tabular-nums; }
details.table td, details.table th { text-align: left; padding: 3px 6px; border-bottom: 1px solid var(--line); }
.tablewrap { overflow-x: auto; max-height: 240px; }

/* Recurring & theme */
.meta .rep { display: inline-flex; align-items: center; gap: 4px; }
.meta .rep svg, .theme-btn svg { width: 12px; height: 12px; }
.ed-label { font-size: 12px; color: var(--muted); }
.ed-group .chip.day { min-width: 2.6em; justify-content: center; padding-inline: 8px; }
.rules { display: flex; flex-direction: column; gap: 6px; }
.rules li { display: flex; align-items: center; gap: 10px; color: var(--fg); font-size: 14px; }
.rules ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.rules .when { color: var(--muted); font-size: 12px; margin-left: auto; white-space: nowrap; }
.top-links { display: flex; align-items: center; gap: 14px; }
.theme-btn { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); }
.theme-btn svg { width: 14px; height: 14px; }
.theme-btn:hover { color: var(--fg); }

/* Time awareness */
.meta .time.late { color: var(--high); }
.meta .soon { color: var(--accent); font-weight: 500; }

/* Someday, search, categories */
.top-links { flex-wrap: wrap; }
.top-links a { font-size: 13px; text-decoration: none; }
.view { display: flex; flex-direction: column; gap: 18px; }
.view h1 { font-size: clamp(24px, 5vw, 30px); }
.sd-row { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-top: 1px solid var(--line); }
.sd-row:first-child { border-top: 0; }
.sd-row .body { flex: 1; min-width: 0; }
.sd-actions { display: flex; gap: 6px; flex: none; }
.sd-actions .chip { padding: 4px 10px; font-size: 12px; }
.search-input { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 12px 14px; font-size: 16px; }
.search-input:focus { outline: none; border-color: var(--accent); }
.res { display: flex; gap: 12px; align-items: baseline; padding: 11px 14px; border-top: 1px solid var(--line); width: 100%; text-align: left; }
.res:first-child { border-top: 0; }
.res .d { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; min-width: 6.5em; }
.res .t { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.res .t small { display: block; color: var(--muted); font-size: 12px; }
.res.done .t > span { text-decoration: line-through; color: var(--muted); }
@media (hover: hover) { .res:hover { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); } }
mark { background: color-mix(in srgb, var(--accent) 22%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.cats-box { display: flex; flex-direction: column; gap: 8px; }
.cat-row { display: flex; align-items: center; gap: 8px; }
.cat-row input { flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 6px 9px; font-size: 14px; }
.cat-row input:focus { outline: none; border-color: var(--accent); }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; flex: none; }
.swatch i { width: 12px; height: 12px; border-radius: 50%; background: var(--dot); }

/* Done section */
.done-toggle { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 500; padding: 4px 2px; }
.done-toggle svg { width: 12px; height: 12px; transition: transform .2s; }
.done-toggle[aria-expanded="true"] svg { transform: rotate(90deg); }

/* States */
.empty { text-align: center; padding: 36px 16px; color: var(--muted); border: 1px dashed var(--faint); border-radius: 14px; display: flex; flex-direction: column; gap: 6px; }
.empty strong { color: var(--fg); font-weight: 600; font-size: 16px; }
.empty code { font-family: var(--mono); font-size: 12px; background: var(--accent-soft); color: var(--accent); padding: 1px 5px; border-radius: 5px; }
.notice { font-size: 13px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); background: var(--fg); color: var(--bg); padding: 10px 14px; border-radius: 12px; font-size: 14px; display: flex; gap: 14px; align-items: center; box-shadow: 0 6px 24px rgb(0 0 0 / .18); z-index: 20; max-width: calc(100% - 32px); }
.toast button { color: var(--accent); font-weight: 600; filter: brightness(1.4); }

@media (hover: hover) { .row:hover { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); } }
@media (max-width: 480px) { .hint { display: none; } body { padding-block: 18px 48px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Вход и аккаунт */
.login { min-height: 70vh; display: grid; place-items: center; }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 28px 24px; display: flex; flex-direction: column; gap: 14px; text-align: center; }
.login-card h1 { font-size: 30px; }
.login-card p { margin: 0; color: var(--muted); font-size: 14px; }
.login-btn { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); font-weight: 500; font-size: 15px; color: var(--fg); text-decoration: none; }
.login-btn:hover { border-color: var(--fg); }
.login-btn svg { width: 20px; height: 20px; flex: none; }
.login-err { font-size: 13px; color: var(--high); }
.account { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.account img { width: 22px; height: 22px; border-radius: 50%; }
.account .who { color: var(--fg); }

/* Юридические страницы */
.legal { max-width: 680px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; line-height: 1.6; }
.legal h1 { font-size: clamp(26px, 6vw, 34px); margin: 8px 0 0; }
.legal h2 { font-size: 18px; margin: 14px 0 0; }
.legal p, .legal ul { margin: 0; }
.legal ul { padding-left: 22px; display: flex; flex-direction: column; gap: 4px; }
.legal a { color: var(--accent); }
.legal .updated { color: var(--muted); font-size: 13px; }
.legal .back { font-size: 13px; text-decoration: none; }
.legal hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0 0; width: 100%; }
.legal-links { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; font-size: 13px; }
.legal-links a { text-decoration: none; }
.login-card p a { color: var(--accent); }
.danger-link { color: var(--high); }
.btn.danger-solid { background: var(--high); color: #fff; }
.btn.danger-solid:disabled { opacity: .4; cursor: default; }
.del-confirm { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.del-confirm input { margin-top: 3px; accent-color: var(--high); }
.login-info { font-size: 13px; color: var(--c-home); }
#deleteBox .ed-actions { justify-content: space-between; flex-wrap: wrap; gap: 8px; }
