/* ===== Темы =====
   light/dark — тёплая палитра в духе claude.ai, nord — Nord Polar Night + Frost,
   forest — тёмная лесная (Everforest). auto следует настройке системы. */
:root,
[data-theme="light"] {
  color-scheme: light;
  --bg: #faf9f5;
  --surface: #ffffff;
  --surface-2: #f2f0e8;
  --fg: #1f1e1d;
  --muted: #7a776f;
  --line: #e6e3d9;
  --accent: #c96442;
  --accent-fg: #ffffff;
  --accent-soft: #f6e7e0;
  --danger: #c4352b;
  --ok: #3f7d4e;
  --shadow: 0 1px 2px rgba(31, 30, 29, .04), 0 4px 16px rgba(31, 30, 29, .05);
  --header: rgba(250, 249, 245, .78);
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #262624;
  --surface: #30302e;
  --surface-2: #3a3936;
  --fg: #f4f2ec;
  --muted: #a6a39a;
  --line: #43423e;
  --accent: #d97757;
  --accent-fg: #ffffff;
  --accent-soft: rgba(217, 119, 87, .16);
  --danger: #ef7266;
  --ok: #7cc48e;
  --shadow: 0 1px 2px rgba(0, 0, 0, .2), 0 6px 20px rgba(0, 0, 0, .18);
  --header: rgba(38, 38, 36, .78);
}
@media (prefers-color-scheme: dark) {
  [data-theme="auto"] {
    color-scheme: dark;
    --bg: #262624;
    --surface: #30302e;
    --surface-2: #3a3936;
    --fg: #f4f2ec;
    --muted: #a6a39a;
    --line: #43423e;
    --accent: #d97757;
    --accent-fg: #ffffff;
    --accent-soft: rgba(217, 119, 87, .16);
    --danger: #ef7266;
    --ok: #7cc48e;
    --shadow: 0 1px 2px rgba(0, 0, 0, .2), 0 6px 20px rgba(0, 0, 0, .18);
    --header: rgba(38, 38, 36, .78);
  }
}
[data-theme="nord"] {
  color-scheme: dark;
  --bg: #2e3440;
  --surface: #3b4252;
  --surface-2: #434c5e;
  --fg: #eceff4;
  --muted: #a5afc2;
  --line: #4c566a;
  --accent: #88c0d0;
  --accent-fg: #2e3440;
  --accent-soft: rgba(136, 192, 208, .16);
  --danger: #bf616a;
  --ok: #a3be8c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .18), 0 6px 20px rgba(0, 0, 0, .16);
  --header: rgba(46, 52, 64, .8);
}
[data-theme="forest"] {
  color-scheme: dark;
  --bg: #232a2e;
  --surface: #2d353b;
  --surface-2: #343f44;
  --fg: #d3c6aa;
  --muted: #9da9a0;
  --line: #3f4b50;
  --accent: #a7c080;
  --accent-fg: #232a2e;
  --accent-soft: rgba(167, 192, 128, .16);
  --danger: #e67e80;
  --ok: #a7c080;
  --shadow: 0 1px 2px rgba(0, 0, 0, .2), 0 6px 20px rgba(0, 0, 0, .18);
  --header: rgba(35, 42, 46, .8);
}

:root {
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: ui-serif, "New York", "Iowan Old Style", Charter, "Source Serif Pro", Georgia, serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 14px;
  --radius-sm: 10px;
}

/* ===== База ===== */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  background: var(--bg); color: var(--fg);
  font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg .fill { fill: currentColor; stroke: none; }
h1, h2 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-family: var(--serif); font-size: 1.9rem; line-height: 1.15; font-weight: 500; display: flex; align-items: center; gap: .55rem; }
code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); border-radius: 6px; padding: .1rem .35rem; word-break: break-all; }
hr { border: 0; border-top: 1px solid var(--line); margin: .4rem 0; }
.hint { color: var(--muted); font-size: .9rem; margin: .25rem 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input, select, textarea, button { font: inherit; color: inherit; }

/* ===== Шапка ===== */
.top {
  position: sticky; top: 0; z-index: 10;
  background: var(--header);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--line);
}
.top-inner { max-width: 72rem; margin: 0 auto; padding: .55rem 1rem; display: flex; align-items: center; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .45rem; color: var(--fg); font-weight: 600; text-decoration: none !important; }
.brand-mark { width: 28px; height: 28px; padding: 5px; border-radius: 9px; background: var(--accent); color: var(--accent-fg); stroke-width: 2.6; }
.top-tools { margin-left: auto; display: flex; gap: .35rem; align-items: center; }
.icon-button {
  display: grid; place-items: center; width: 34px; height: 34px;
  border-radius: 50%; color: var(--muted); cursor: pointer; background: none; border: 0;
}
.icon-button:hover { background: var(--surface-2); color: var(--fg); }
.icon-button svg { width: 20px; height: 20px; }
.user-chip { background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: .9rem; }

.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + .4rem); min-width: 13rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow), 0 12px 32px rgba(0, 0, 0, .12);
  padding: .35rem; z-index: 20;
}
.menu-panel.wide { min-width: 18rem; padding: .6rem; }
.menu-title { margin: .3rem .6rem .35rem; font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.menu-item {
  display: flex; align-items: center; gap: .55rem; width: 100%;
  padding: .45rem .6rem; border-radius: 8px; border: 0; background: none;
  color: var(--fg); text-align: left; cursor: pointer; font-size: .94rem; text-decoration: none !important;
}
.menu-item:hover { background: var(--surface-2); }
.menu-item[aria-current] { font-weight: 600; }
.swatch { width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--line); }
.swatch-auto { background: linear-gradient(135deg, #faf9f5 50%, #262624 50%); }
.swatch-light { background: #faf9f5; }
.swatch-dark { background: #262624; }
.swatch-nord { background: #2e3440; }
.swatch-forest { background: #2d353b; }

/* ===== Раскладка ===== */
.page { max-width: 44rem; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
.layout { max-width: 72rem; margin: 0 auto; display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); gap: 2rem; padding: 0 1rem; }
.content { min-width: 0; max-width: 46rem; padding: 1.6rem 0 5rem; }
.sidebar { position: sticky; top: 3.4rem; align-self: start; max-height: calc(100vh - 3.4rem); overflow-y: auto; padding: 1.4rem 0 2rem; }
.side-nav { display: flex; flex-direction: column; gap: .1rem; }
.side-link {
  display: flex; align-items: center; gap: .6rem; padding: .42rem .65rem; border-radius: 10px;
  color: var(--fg); text-decoration: none !important; cursor: pointer; font-size: .95rem; list-style: none;
}
.side-link::-webkit-details-marker { display: none; }
.side-link:hover { background: var(--surface-2); }
.side-link[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side-link svg { width: 19px; height: 19px; flex: none; color: var(--muted); }
.side-link[aria-current="page"] svg { color: var(--accent); }
.side-link.muted { color: var(--muted); }
.side-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-section + .side-section { margin-top: 1.3rem; }
.side-title-link { float: right; color: var(--muted); }
.side-title-link svg { width: 15px; height: 15px; }
.side-title-link:hover { color: var(--accent); }
.side-order { display: none; }
.order-mark { width: 2rem; display: grid; place-items: center; }
.order-buttons { display: flex; gap: .2rem; }
.order-buttons form { margin: 0; }
.icon-button:disabled { opacity: .3; cursor: default; background: none; }
.order-list > li:target { background: var(--accent-soft); }
.side-title { margin: 0 .65rem .3rem; font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.side-link .dot { margin: 0 4px; }
.count { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 500; }
.count.alert { color: #fff; background: var(--danger); border-radius: 999px; padding: 0 .45rem; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.big { width: 14px; height: 14px; }
.picon { display: inline-grid; place-items: center; width: 18px; font-size: 15px; line-height: 1; flex: none; }
.picon.big { width: auto; font-size: 1.6rem; }
.side-link .picon { margin: 0 1px; }
.project-chip .picon { width: auto; font-size: .85rem; }

@media (max-width: 760px) {
  .layout { display: block; padding: 0; }
  /* две строки: сверху разделы по времени, ниже — проекты; каждая прокручивается сама */
  .sidebar {
    position: sticky; top: 3.1rem; z-index: 5; max-height: none; padding: .35rem 0;
    display: flex; flex-direction: column; gap: .15rem; overflow: visible;
    background: var(--header); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--line);
  }
  .side-nav, .side-section {
    display: flex; flex-direction: row; align-items: center; gap: .2rem;
    overflow-x: auto; scrollbar-width: none; padding: 0 .75rem; margin: 0;
  }
  .side-nav::-webkit-scrollbar, .side-section::-webkit-scrollbar { display: none; }
  .side-section .side-nav { padding: 0; overflow: visible; }
  .side-section + .side-section { margin-top: 0; border-top: 1px solid var(--line); padding-top: .3rem; }
  .side-title { display: none; }
  .side-link { white-space: nowrap; padding: .3rem .6rem; font-size: .9rem; flex: none; }
  .side-label { overflow: visible; }
  /* «Новый проект» — просто «+» в конце строки проектов */
  .side-new .side-label { display: none; }
  .side-order { display: flex; }
  .side-new { padding: .3rem .45rem; }
  .content { padding: 1.2rem 1rem 5rem; }
  h1 { font-size: 1.6rem; }
}

/* ===== Заголовок страницы ===== */
.page-head { display: flex; align-items: baseline; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.subtitle { color: var(--muted); font-size: .95rem; }
.h1-project { display: inline-flex; align-items: center; gap: .4rem; font-size: .7em; color: var(--muted); }
.h1-project::before { content: "·"; margin-right: .1rem; }
.default-check { align-items: flex-start; margin-top: .4rem; }
.default-check input { margin-top: .3rem; }
.head-menu { margin-left: auto; align-self: center; }
.crumbs { margin: 0 0 .8rem; font-size: .92rem; }
.section-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 1.8rem 0 .6rem; font-weight: 600; }

/* ===== Быстрый ввод ===== */
.quick-add {
  display: flex; align-items: center; gap: .55rem; padding: .2rem .9rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 1.4rem;
}
.quick-add:focus-within { border-color: var(--accent); }
.quick-add svg { width: 20px; height: 20px; color: var(--accent); flex: none; }
.quick-add input { flex: 1; min-width: 0; border: 0; background: none; padding: .75rem 0; outline: none; font-size: 1rem; }

/* ===== Группы и задачи ===== */
.group { margin-bottom: 1.4rem; }
.group-title { font-size: .95rem; font-weight: 600; margin: 0 0 .35rem; display: flex; align-items: center; gap: .45rem; cursor: default; }
details > summary.group-title { cursor: pointer; list-style: none; color: var(--muted); }
details > summary.group-title::before { content: "▸"; font-size: .8em; }
details[open] > summary.group-title::before { content: "▾"; }
.group-overdue > .group-title { color: var(--danger); }
.group.is-empty .group-title { color: var(--muted); font-weight: 500; }
.group.is-empty { margin-bottom: .6rem; padding-bottom: .5rem; border-bottom: 1px dashed var(--line); }
.tasks { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.task { display: flex; gap: .65rem; align-items: flex-start; padding: .6rem .1rem; border-bottom: 1px solid var(--line); }
.task-check { margin: 0; padding-top: .08rem; }
.check-button {
  display: grid; place-items: center; width: 22px; height: 22px; padding: 0;
  border-radius: 50%; border: 1.8px solid var(--muted); background: none; cursor: pointer; color: transparent;
}
.check-button svg { width: 16px; height: 16px; stroke-width: 2.4; }
.check-button:hover { color: var(--muted); border-color: var(--fg); }
.prio-high .check-button { border-color: var(--danger); }
.prio-mid .check-button { border-color: #d39a2d; }
.prio-low .check-button { border-color: #4f8fbf; }
.is-done .check-button { background: var(--muted); border-color: var(--muted); color: var(--surface); }
.is-done .task-title { color: var(--muted); text-decoration: line-through; }
.task-body { flex: 1; min-width: 0; }
.task-title { color: var(--fg); display: block; overflow-wrap: anywhere; }
.task-meta { display: flex; flex-wrap: wrap; gap: .25rem .75rem; font-size: .82rem; color: var(--muted); }
.task-meta:empty { display: none; }
.due.overdue { color: var(--danger); font-weight: 600; }
.due.today { color: var(--ok); font-weight: 600; }
.tag { color: var(--muted); font-style: normal; font-size: .85em; }
.project-chip { display: inline-flex; align-items: center; gap: .3rem; color: var(--muted); }
.project-chip .dot { width: 8px; height: 8px; }

.triage { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; align-items: center; }
.triage select, .chip {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: .22rem .7rem; font-size: .84rem; cursor: pointer; color: var(--fg);
}
.chip:hover, .triage select:hover { border-color: var(--accent); color: var(--accent); }

.empty-state { text-align: center; padding: 3rem 1rem; }
.empty-state p { margin: .2rem 0; }

/* ===== Формы, карточки ===== */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; margin-bottom: 1rem; }
.stack { display: flex; flex-direction: column; gap: .6rem; }
.stack input:not([type=checkbox]):not([type=radio]), .stack select, .stack textarea, .inline-form input, .fields input, .fields select, .auth input {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg);
  padding: .55rem .7rem;
}
.stack input:focus, .stack textarea:focus, .stack select:focus, .inline-form input:focus, .auth input:focus { border-color: var(--accent); outline: none; }
textarea { resize: vertical; }
.title-input { font-size: 1.15rem !important; font-weight: 600; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: .6rem; }
.fields label { display: flex; flex-direction: column; gap: .25rem; font-size: .85rem; color: var(--muted); }
.fields label > * { color: var(--fg); font-size: 1rem; }
.check { display: flex; align-items: center; gap: .5rem; cursor: pointer; }
.form-foot { display: flex; gap: .6rem; }
.inline-form { display: flex; gap: .6rem; }
.task-actions { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: 1rem 0; }
.colors { display: flex; gap: .4rem; flex-wrap: wrap; }
.color-pick input { position: absolute; opacity: 0; }
.color-pick .dot { cursor: pointer; width: 22px; height: 22px; border: 2px solid transparent; }
.color-pick input:checked + .dot { border-color: var(--fg); }
.color-pick input:focus-visible + .dot { outline: 2px solid var(--accent); outline-offset: 2px; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-fg);
  border-radius: 999px; padding: .5rem 1.1rem; cursor: pointer; font-weight: 550; text-decoration: none !important;
}
.button:hover { filter: brightness(1.06); }
.button.ghost { background: none; color: var(--accent); }
.button.small { padding: .3rem .8rem; font-size: .88rem; }
.button.wide { width: 100%; }
.text-button { border: 0; background: none; color: var(--accent); cursor: pointer; padding: .2rem 0; }
.text-button.small { font-size: .85rem; }
.danger-text { color: var(--danger) !important; }

.flash { padding: .6rem .9rem; border-radius: var(--radius-sm); margin: 0 0 1rem; font-size: .94rem; }
.flash.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.flash.error { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }

.card-list { list-style: none; margin: 0 0 1rem; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-list > li { padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
.card-list > li:last-child { border-bottom: 0; }
.card-list .empty { color: var(--muted); }
.user-row { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 600; flex: none; }
.avatar svg { width: 20px; height: 20px; }
.who { flex: 1; min-width: 10rem; display: flex; flex-direction: column; }
.who em { font-style: normal; color: var(--muted); font-size: .85rem; }
.row-more > summary { list-style: none; }
.row-more > summary::-webkit-details-marker { display: none; }
.row-more[open] { flex-basis: 100%; }
.row-more-body { padding-top: .6rem; display: flex; flex-direction: column; gap: .8rem; }
.row-actions { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.steps { margin: .4rem 0; padding-left: 1.2rem; }
.steps li { margin: .3rem 0; }
.steps.plain { list-style: none; padding: 0; }
.secret-card { border-color: var(--accent); }
.secret-row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.secret { font-size: 1.05rem; padding: .35rem .6rem; }

/* ===== Вход ===== */
.auth { max-width: 24rem; margin: 3rem auto; text-align: center; }
.auth-mark { width: 44px; height: 44px; padding: 9px; border-radius: 13px; background: var(--accent); color: var(--accent-fg); }
.auth h1 { justify-content: center; margin: .8rem 0 .2rem; }
.auth-host { color: var(--muted); font-family: var(--mono); font-size: .85rem; }
.auth-form { display: flex; flex-direction: column; gap: .8rem; margin-top: 1.2rem; text-align: left; }
.auth .inputs { display: flex; flex-direction: column; gap: .5rem; margin: 0; }
.auth-alt { margin-top: 1rem; }

.toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%);
  background: var(--fg); color: var(--bg); padding: .5rem 1rem; border-radius: 999px; font-size: .9rem; z-index: 50;
}

/* ===== Форма проекта ===== */
.field-label { margin: .4rem 0 0; font-size: .85rem; color: var(--muted); font-weight: 500; }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(2.6rem, 1fr)); gap: .35rem; }
.icon-pick input, .color-pick input { position: absolute; opacity: 0; pointer-events: none; }
.icon-pick > span {
  display: grid; place-items: center; height: 2.6rem; font-size: 1.35rem; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--bg);
}
.icon-pick > span:hover { border-color: var(--muted); }
.icon-pick input:checked + span { border-color: var(--accent); background: var(--accent-soft); }
.icon-pick input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.color-pick { position: relative; }

/* ===== Заметка: Markdown ===== */
.note { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); overflow: hidden; }
.note:focus-within { border-color: var(--accent); }
.note-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; padding: .3rem .4rem; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.note-tabs { display: flex; gap: .15rem; }
.note-tab { border: 0; background: none; border-radius: 7px; padding: .2rem .6rem; font-size: .85rem; color: var(--muted); cursor: pointer; }
.note-tab[aria-selected="true"] { background: var(--surface); color: var(--fg); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.md-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .1rem; }
.md-btn {
  display: grid; place-items: center; min-width: 30px; height: 30px; padding: 0 .3rem;
  border: 0; border-radius: 7px; background: none; color: var(--fg); cursor: pointer; font-size: .95rem;
}
.md-btn:hover { background: var(--surface); }
.md-btn svg { width: 18px; height: 18px; }
.md-sep { width: 1px; height: 18px; background: var(--line); margin: 0 .2rem; }
.stack .note textarea { border: 0 !important; border-radius: 0 !important; background: none !important; min-height: 9rem; font-family: var(--mono); font-size: .92rem; line-height: 1.55; }
.note-view { padding: .6rem .8rem; min-height: 4rem; cursor: text; }

.md-view { overflow-wrap: anywhere; }
.md-view > :first-child { margin-top: 0; }
.md-view > :last-child { margin-bottom: 0; }
.md-view p, .md-view ul, .md-view ol, .md-view blockquote, .md-view pre, .md-view table { margin: .5rem 0; }
.md-view h1, .md-view h2, .md-view h3, .md-view h4 { font-family: var(--sans); font-size: 1.08rem; font-weight: 650; margin: .9rem 0 .4rem; display: block; }
.md-view h1 { font-size: 1.25rem; }
.md-view ul, .md-view ol { padding-left: 1.4rem; }
.md-view li + li { margin-top: .15rem; }
.md-view .contains-task-list { list-style: none; padding-left: .2rem; }
.md-view .task-list-item input { margin: 0 .45rem 0 0; vertical-align: -1px; accent-color: var(--accent); }
.md-view blockquote { border-left: 3px solid var(--line); padding-left: .8rem; color: var(--muted); }
.md-view pre { background: var(--surface-2); padding: .6rem .8rem; border-radius: 8px; overflow-x: auto; }
.md-view pre code { background: none; padding: 0; word-break: normal; }
.md-view table { border-collapse: collapse; }
.md-view th, .md-view td { border: 1px solid var(--line); padding: .25rem .55rem; }
.md-view hr { margin: .8rem 0; }

/* ===== Повтор ===== */
.repeat { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .5rem .8rem .7rem; margin: 0; display: flex; flex-direction: column; gap: .55rem; }
.repeat legend { font-size: .85rem; color: var(--muted); padding: 0 .3rem; }
.repeat-presets { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip.is-active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.repeat-row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.stack .repeat-row select { width: auto; }
.repeat-every { display: flex; align-items: center; gap: .4rem; font-size: .92rem; color: var(--muted); }
.stack .repeat-every input { width: 4.5rem !important; }
.repeat-days { display: flex; flex-wrap: wrap; gap: .3rem; }
.day-pick input { position: absolute; opacity: 0; pointer-events: none; }
.day-pick span { display: grid; place-items: center; width: 2.4rem; height: 2rem; border: 1px solid var(--line); border-radius: 999px; font-size: .85rem; cursor: pointer; background: var(--surface); }
.day-pick input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.day-pick input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.repeat-hint { margin: 0; }
.repeat-mark { color: var(--muted); }
