/* ═══════════════════════════════════════════════════════════════════════
   Круг дня — оформление по макету «Орбита» (Figma Make).
   Светлая тема — вариант «01 · Светлый»: тёплый оливково-бежевый пластик,
   спокойные панели, моноширинные подписи. Тёмная — «02 · Графит»:
   графитовый корпус, кремовые «листы», оранжевый акцент.
   Шрифты: Golos Text (текст), IBM Plex Mono (подписи, время), Tektur (цифры в «Графите»).
   Тёмная тема включается классом .dark на <html> (ставится до отрисовки).
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  color-scheme: light;
  --font: "Golos Text", "Segoe UI Variable Text", "Segoe UI", Roboto, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --display: var(--font);

  --bg: #e7e8de;
  --rail: #e1e3d8;
  --rail-line: #ced0c4;
  --rail-ink: #68705e;
  --rail-on: #d0d4c6;
  --rail-on-ink: #303b2c;

  --ink: #30372d;
  --ink-strong: #35402f;
  --ink-2: #626b59;
  --ink-3: #78816b;
  --label: #747b68;
  --label-strong: #4c5841;

  --console: #eeeee4;
  --console-edge: #f7f8ef;
  --console-shadow: 0 3px 5px #555c4010, 0 18px 40px #50553e0c;
  --console-radius: 16px;
  --line: #d7d9cb;
  --line-soft: #dfe1d4;

  --sunken: #dfe1d4;
  --sunken-shadow: inset 0 1px 3px #7c816e18;
  --raised: #f4f4eb;
  --raised-ink: #353d30;
  --raised-shadow: 0 1px 3px #676b5433;

  --tabs-bg: #dce0d1;
  --tabs-line: #cdd3c0;
  --tab-on: #f2f2e8;
  --tab-on-ink: #303b2c;
  --tab-on-shadow: 0 2px 5px #53613c20;
  --rocker-on: #dce1cf;
  --rocker-on-ink: #353d30;
  --rocker-on-shadow: inset 0 1px 3px #67734c20;

  --panel: #e2e6d8;
  --panel-line: transparent;
  --card: #f3f3e9;
  --card-line: transparent;
  --chip: #e1e5d6;
  --chip-ink: var(--ink);
  --chip-on: #d7dfc8;
  --chip-on-ink: var(--ink);
  --chip-on-line: #73835f;

  --today-btn: #e3e5d8;
  --today-btn-ink: var(--ink);
  --today-btn-line: #d3d6c6;
  --accent: #d56b39;
  --accent-ink: #fff8f2;
  --accent-text: #b8532a;
  --needle: #c24d20;
  --olive: #6c795b;
  --olive-2: #788565;
  --slate: #95a9ad;
  --sage: #b6b99b;
  --primary: #394830;
  --primary-ink: #f4f5ec;
  --selected: #e1e5d5;
  --selected-line: #d2d8c3;
  --selected-bar: #6c795b;
  --now-bg: #d1d9be;
  --now-ink: #4d5d3b;
  --today-bg: #dde3cc;
  --today-line: #7c8b65;
  --cal-day: #e9ecdf;
  --cal-day-line: #d4d9c7;
  --cal-out: #e5e7dc;
  --cal-event: #f6f5ed;
  --input-bg: #f7f7ef;
  --input-line: #bec6b1;
  --input-radius: 6px;
  --check-line: #c4cab7;
  --check-on: #788565;
  --danger: #a84628;
  --balance: #dfe3d4;
  --balance-line: #cbd0bd;
  --balance-rest: #d3d7c8;
  --dashed: #b6bfaa;
  --sheet-bg: #eeeee4;
  --sheet-line: #f9faf1;
  --sheet-radius: 16px;
  --backdrop: #232d2166;
  --toast: #343e32;
  --toast-ink: #f0f0e5;
  --focus: #b74d24;
  --on-color-light: #fbfaf2;
  --on-color-dark: #2c3328;

  /* Циферблат */
  --dial-bezel: #e2e1d7;
  --dial-bezel-line: #c8c9bc;
  --face-1: #f5f3eb;
  --face-2: #eeede4;
  --face-3: #e0dfd5;
  --tick: #b8baad;
  --tick-major: #75796d;
  --hour: #6d7463;
  --hour-quad: #6d7463;
  --track: #deded3;
  --track-hover: #d6d7ca;
  --track-past: #d2d3c6;
  --hatch: #aaa99e;
  --dial-center: #efeee5;
  --dial-center-line: #d4d4c7;
  --dial-center-hi: #fdfcf5;
  --dial-cap: #69725c;
  --dial-time: #35402f;
  --dial-colon: #35402f;
  --dial-ev: #66705b;
  --dial-det: #7a826e;
  --bar-track: #d4d5c7;
  --bar: #d56b39;
}

html.dark {
  color-scheme: dark;
  --display: "Tektur", var(--font);

  --bg: #141518;
  --rail: #1b1d21;
  --rail-line: #2d3138;
  --rail-ink: #888f9a;
  --rail-on: #26292f;
  --rail-on-ink: #f0ece1;

  --ink: #f0ece1;
  --ink-strong: #f4efe3;
  --ink-2: #a6acb6;
  --ink-3: #7c828d;
  --label: #9ba1ab;
  --label-strong: #ebe5d6;

  --console: #15171a;
  --console-edge: #272b32;
  --console-shadow: inset 0 2px 10px #00000073, 0 24px 60px #00000040;
  --console-radius: 24px;
  --line: #292c33;
  --line-soft: #24282f;

  --sunken: #0e1012;
  --sunken-shadow: none;
  --raised: #ebe5d6;
  --raised-ink: #16181b;
  --raised-shadow: 0 2px 8px #00000059;

  --tabs-bg: #121417;
  --tabs-line: #292d34;
  --tab-on: #ebe5d6;
  --tab-on-ink: #16181b;
  --tab-on-shadow: 0 2px 8px #00000059;
  --rocker-on: #ff5a26;
  --rocker-on-ink: #fff8f4;
  --rocker-on-shadow: 0 2px 10px #ff5a2652;

  --panel: #1d2026;
  --panel-line: #2b2f37;
  --card: #23262c;
  --card-line: #30343c;
  --chip: #1f2228;
  --chip-ink: #dedad0;
  --chip-on: #ebe5d6;
  --chip-on-ink: #17191c;
  --chip-on-line: #ebe5d6;

  --today-btn: #ff5a26;
  --today-btn-ink: #fff8f4;
  --today-btn-line: transparent;
  --accent: #ff5a26;
  --accent-ink: #fff8f4;
  --accent-text: #ff794d;
  --needle: #ff5a26;
  --olive: #7bd4a0;
  --olive-2: #7bd4a0;
  --slate: #5890e3;
  --sage: #ebe5d6;
  --primary: #ff5a26;
  --primary-ink: #fff8f4;
  --selected: #ffffff;
  --selected-line: #1c1e22;
  --selected-bar: #ff5a26;
  --now-bg: #ff5a26;
  --now-ink: #fff8f4;
  --today-bg: #ffffff;
  --today-line: #ff5a26;
  --cal-day: #f6f2e8;
  --cal-day-line: #ddd6c5;
  --cal-out: #e3ddcd;
  --cal-event: #ebe5d6;
  --input-bg: #121417;
  --input-line: #31363f;
  --input-radius: 14px;
  --check-line: #5a606b;
  --check-on: #ff5a26;
  --danger: #ff7e57;
  --balance: #101215;
  --balance-line: #24282f;
  --balance-rest: #24282f;
  --dashed: #3a3f48;
  --sheet-bg: #1b1d21;
  --sheet-line: #323740;
  --sheet-radius: 24px;
  --backdrop: #08090bb8;
  --toast: #ebe5d6;
  --toast-ink: #16181b;
  --focus: #ff794d;
  --on-color-light: #fff8f4;
  --on-color-dark: #16181b;

  --tick: #3a3f47;
  --tick-major: #59606b;
  --hour: #6e747e;
  --hour-quad: #ebe5d6;
  --track: #181a1e;
  --track-hover: #1e2126;
  --track-past: #1d2024;
  --track-line: #282b31;
  --track-dash: #262a31;
  --well-1: #1d2024;
  --well-2: #131518;
  --well-3: #0d0e10;
  --well-line: #2c3037;
  --well-line-2: #1e2126;
  --oled-1: #202328;
  --oled-2: #101215;
  --oled-line: #333840;
  --ring-track: #22252b;
  --dial-cap: #8d949f;
  --dial-time: #f4efe3;
  --dial-colon: #ff5a26;
  --dial-ev: #d7d3c8;
  --dial-det: #8c939e;
}

/* «Кремовые листы» в Графите: расписание дня и календарь — светлые карточки на тёмном корпусе. */
html.dark .agenda,
html.dark .calendar-sheet {
  --ink: #181a1d;
  --ink-strong: #16181b;
  --ink-2: #5b5e63;
  --ink-3: #6d7076;
  --label: #5f6266;
  --label-strong: #1b1d21;
  --line: #d5cebe;
  --line-soft: #ddd6c5;
  --card: #f6f2e8;
  --card-line: #ddd6c5;
  --chip: #dcd5c4;
  --chip-ink: #1b1d21;
  --check-line: #b5afa0;
  --check-on: #1b1d21;
  --dashed: #bdb6a6;
  --input-bg: #f8f5ed;
  --input-line: #d5cebe;
  --on-color-dark: #16181b;
  color: var(--ink);
}

/* Списки-сетки не должны раздвигаться длинными названиями */
.event-list, .pm-list, .tc-list:not(.grid), .routines, .calendar-events, .expanded-list { grid-template-columns: minmax(0, 1fr); }

/* Цвета, почти сливающиеся с фоном, получают обводку */
.c-pale, .c-deep { --c-edge: color-mix(in srgb, var(--c) 55%, var(--ink-3)); }

/* ───────────── База ───────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 400 14px/1.5 var(--font);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
html.dark body {
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 90, 38, .07), transparent 42%),
    radial-gradient(circle at 86% 100%, rgba(88, 144, 227, .06), transparent 40%),
    radial-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px) 0 0 / 18px 18px,
    var(--bg);
  background-attachment: fixed;
}
body.no-scroll { overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; transition: background .18s, color .18s, transform .18s, box-shadow .18s; }
button:active { transform: translateY(1px); }
input, select, textarea { font: inherit; color: inherit; }
svg { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
i[data-icon] { display: contents; }
h2, h3 { margin: 0; font-weight: 500; }
kbd { font: 500 10px/1 var(--mono); }

/* ───────────── Каркас: узкая панель слева и шапка ───────────── */
.rail {
  position: fixed; inset: 0 auto 0 0; z-index: 5; width: 83px;
  display: flex; flex-direction: column; align-items: center; padding: 35px 0 25px;
  background: var(--rail); border-right: 1px solid var(--rail-line);
}
.brand-mark {
  position: relative; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid var(--ink); transform: rotate(-35deg); flex: none;
}
.brand-mark::before {
  content: ""; position: absolute; width: 48px; height: 19px; border: 2px solid var(--ink); border-radius: 50%; background: var(--rail);
}
.brand-mark span { width: 13px; height: 13px; border-radius: 50%; background: var(--ink); z-index: 1; }
.brand-mark:active { transform: rotate(-35deg) translateY(1px); }
html.dark .brand-mark { border-color: #ff5a26; }
html.dark .brand-mark::before { border-color: #ff5a26; }
html.dark .brand-mark span { background: #f4efe3; }
.rail-links { display: grid; gap: 15px; margin-top: 88px; }
.rail-button { width: 46px; height: 46px; border-radius: 10px; display: grid; place-items: center; color: var(--rail-ink); }
.rail-button:hover { color: var(--rail-on-ink); background: color-mix(in srgb, var(--rail-on) 55%, transparent); }
.rail-button.active { background: var(--rail-on); color: var(--rail-on-ink); box-shadow: inset 0 1px 3px #a8af9e55, 0 1px #f3f4e8; }
html.dark .rail-button.active { box-shadow: inset 0 1px 3px #00000066; }
.rail-new { background: var(--primary); color: var(--primary-ink); border-radius: 50%; }
.rail-new:hover { background: var(--primary); color: var(--primary-ink); filter: brightness(1.08); }
.rail-new .ic { width: 20px; height: 20px; stroke-width: 2; }
.rail-bottom { margin-top: auto; display: grid; gap: 18px; justify-items: center; }
.rail .avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--rail-on); color: var(--rail-ink); }
.rail .avatar .ic { width: 16px; height: 16px; }

.shell { max-width: 1530px; margin: 0 auto; padding: 32px 48px 40px 131px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 0 18px; }
.wordmark { display: flex; align-items: center; font-size: 32px; font-weight: 650; letter-spacing: -2px; line-height: 1.1; white-space: nowrap; }
.wordmark small {
  font: 400 9px/1.7 var(--mono); letter-spacing: 1px; text-transform: uppercase; color: var(--ink-2);
  margin-left: 24px; max-width: 150px; white-space: normal;
}
html.dark .wordmark { font: 600 22px/1.1 var(--display); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-strong); }
html.dark .wordmark small { color: #7c828d; letter-spacing: .12em; }
.topbar-right { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: flex-end; }
.style-switcher {
  display: inline-flex; align-items: center; gap: 3px; padding: 3px; border-radius: 999px;
  background: #d8dccd; border: 1px solid #c5cab8; box-shadow: inset 0 1px 2px #3c44341f;
}
.style-switcher button { min-height: 32px; padding: 0 13px; border-radius: 999px; font: 11px var(--mono); letter-spacing: .3px; color: #545e4a; white-space: nowrap; }
.style-switcher button.active { background: #f4f4eb; color: #2c3528; box-shadow: 0 1px 3px #30372d2e; }
html.dark .style-switcher { background: #121417; border-color: #2d3138; box-shadow: none; }
html.dark .style-switcher button { color: #888f9a; }
html.dark .style-switcher button.active { background: #ff5a26; color: #fff8f4; box-shadow: 0 2px 10px #ff5a2661; }
.system-status { display: flex; align-items: center; gap: 0; font: 10px var(--mono); letter-spacing: .8px; color: #5e6658; text-transform: uppercase; }
.system-status > span { display: inline-flex; align-items: center; white-space: nowrap; }
.system-status > span + span { padding-left: 16px; margin-left: 16px; border-left: 1px solid #bfc4b5; }
.system-status i { width: 6px; height: 6px; border-radius: 50%; background: #788565; margin-right: 7px; flex: none; }
.system-status .st-error i, .system-status .st-offline i { background: var(--danger); }
.system-status .st-off i, .system-status .st-signed-out i { background: #a7ad9b; }
.system-status .st-syncing i, .system-status .st-connecting i { animation: blink 1s steps(2) infinite; }
html.dark .system-status { color: #727883; }
html.dark .system-status > span + span { border-color: #2a2e35; }
html.dark .system-status i { background: #7bd4a0; box-shadow: 0 0 8px #7bd4a0bf; }
html.dark .system-status .st-off i, html.dark .system-status .st-signed-out i { background: #5a606b; box-shadow: none; }
@keyframes blink { 50% { opacity: .25; } }

.planner-tabs {
  display: flex; gap: 6px; width: fit-content; max-width: 100%; margin: 8px 0 20px; padding: 5px;
  background: var(--tabs-bg); border: 1px solid var(--tabs-line); border-radius: 30px;
}
.planner-tabs button { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 24px; border-radius: 24px; font-size: 14px; color: #4e5b43; white-space: nowrap; }
html.dark .planner-tabs button { color: #989fa9; font-weight: 500; }
.planner-tabs button:hover { color: var(--ink); }
.planner-tabs button.active, html.dark .planner-tabs button.active { background: var(--tab-on); color: var(--tab-on-ink); box-shadow: var(--tab-on-shadow); }
.nav-count { font: 500 10px/1 var(--mono); padding: 3px 6px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent-text); }
.planner-tabs button.active .nav-count { background: var(--accent); color: var(--accent-ink); }

.main { min-width: 0; }
.page-footer {
  display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 23px 0 22px;
  font: 8px var(--mono); letter-spacing: .8px; text-transform: uppercase; color: #737e67;
}
html.dark .page-footer { color: #727883; }

/* ───────────── Кнопки ───────────── */
.icon-button { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 8px; color: var(--ink-2); }
.icon-button:hover { background: var(--sunken); color: var(--ink); }
.icon-button.sm { width: 32px; height: 32px; border-radius: 50%; }
.icon-button.sm .ic { width: 16px; height: 16px; }
html.dark .icon-button { border-radius: 50%; }
.today-button {
  min-height: 34px; padding: 0 12px; margin-left: 10px; border-radius: 24px; font-size: 12px; white-space: nowrap;
  background: var(--today-btn); color: var(--today-btn-ink); border: 1px solid var(--today-btn-line);
}
.today-button.is-now { opacity: .62; }
.today-button:hover { filter: brightness(.97); }
html.dark .today-button { font-weight: 500; }
.submit-button {
  min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 20px;
  border-radius: 24px; background: var(--primary); color: var(--primary-ink); font-size: 14px; white-space: nowrap;
}
.submit-button:hover { filter: brightness(1.08); }
html.dark .submit-button { box-shadow: 0 6px 18px #ff5a2647; font-weight: 500; }
.pill-button {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: 24px; font-size: 12px; white-space: nowrap;
  background: var(--today-btn); color: var(--today-btn-ink); border: 1px solid var(--today-btn-line);
}
html.dark .pill-button { background: #23262c; color: #d8d4c8; border-color: #32363e; }
.pill-button .ic { width: 15px; height: 15px; }
.btn-mini {
  display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 11px; border-radius: 24px;
  font-size: 12px; background: var(--chip); color: var(--chip-ink); white-space: nowrap;
}
.btn-mini:hover { background: var(--chip-on); color: var(--chip-on-ink); }
.btn-mini .ic { width: 14px; height: 14px; }

/* ───────────── Консоль (главная панель экрана) ───────────── */
.console {
  position: relative; background: var(--console); border: 1px solid var(--console-edge);
  border-radius: var(--console-radius); box-shadow: var(--console-shadow);
}
.console-top {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 83px; margin: 0 25px; border-bottom: 1px solid var(--line);
}
.date-control { display: flex; align-items: center; gap: 11px; min-width: 0; }
.date-title { display: flex; flex-direction: column; align-items: flex-start; min-width: 115px; text-align: left; padding: 2px 4px; border-radius: 8px; }
.date-title:hover { background: var(--sunken); }
.date-title b { font-size: 18px; font-weight: 500; line-height: 1.4; white-space: nowrap; }
.date-title span { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.date-title span::first-letter { text-transform: uppercase; }
html.dark .date-title b { font: 600 22px/1.2 var(--display); letter-spacing: -.01em; color: var(--ink-strong); }
html.dark .date-title span { color: #ff794d; font-weight: 500; }
.console-tools { display: flex; align-items: center; gap: 8px; }
.view-switch { display: flex; padding: 4px; border-radius: 7px; background: var(--sunken); box-shadow: var(--sunken-shadow); margin-right: 12px; }
.view-switch button { min-height: 34px; padding: 0 13px; display: flex; align-items: center; gap: 8px; border-radius: 4px; color: #67705f; font-size: 12px; }
.view-switch button .ic { width: 15px; height: 15px; }
.view-switch button.chosen { background: var(--raised); color: var(--raised-ink); box-shadow: var(--raised-shadow); }
html.dark .view-switch { border-radius: 999px; border: 1px solid #262a30; padding: 3px; }
html.dark .view-switch button { border-radius: 999px; color: #848b96; }
html.dark .view-switch button.chosen { color: var(--raised-ink); }
.date-picker { position: absolute; left: 60px; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; }
.screw {
  position: absolute; right: -14px; top: 12px; width: 7px; height: 7px; border-radius: 50%;
  background: linear-gradient(135deg, #c3c7b8 42%, #89917d 43%, #89917d 55%, #e2e5d8 56%); box-shadow: 0 1px 1px #fff;
}
html.dark .screw { display: none; }

.console-body { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); }
.dial-panel { padding: 24px 29px 26px; border-right: 1px solid var(--line); min-width: 0; }
html.dark .dial-panel { border-right: 0; }
.instrument-label {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font: 9px var(--mono); letter-spacing: 1.2px; text-transform: uppercase; color: var(--label);
}
.instrument-label > span { display: inline-flex; align-items: center; white-space: nowrap; color: var(--label-strong); }
.instrument-label i, .console-footer i { width: 6px; height: 6px; border-radius: 50%; background: var(--olive-2); margin-right: 7px; display: inline-block; flex: none; }
html.dark .instrument-label { font-size: 10px; letter-spacing: .14em; }
html.dark .instrument-label > span { color: #9ba1ab; }
html.dark .instrument-label i, html.dark .console-footer i { box-shadow: 0 0 8px #7bd4a0bf; }
.period-switch { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.period-switch button { min-height: 44px; padding: 0 12px; border-radius: 24px; font: 12px var(--mono); letter-spacing: 0; text-transform: none; color: #59654d; }
.period-switch button.chosen { background: var(--rocker-on); color: var(--rocker-on-ink); box-shadow: var(--rocker-on-shadow); }
html.dark .period-switch { padding: 3px; border-radius: 999px; background: #0e1012; border: 1px solid #262a30; }
html.dark .period-switch button { min-height: 32px; padding: 0 13px; border-radius: 999px; font-size: 11px; color: #848b96; }
html.dark .period-switch button.chosen { color: var(--rocker-on-ink); }
.dial { max-width: 530px; margin: 10px auto 0; }
.dial-bottom-label {
  display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 4px;
  font: 9px var(--mono); letter-spacing: 1.2px; text-transform: uppercase; color: var(--label);
}
.dial-bottom-label .ic { width: 12px; height: 12px; }
.legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 23px; margin-top: 22px; }
.legend > span { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; min-height: 28px; }
.legend i { width: 7px; height: 7px; border-radius: 50%; }
.legend b { font: 400 10px var(--mono); color: var(--ink-3); margin-left: 3px; }
html.dark .legend { gap: 8px; }
html.dark .legend > span { min-height: 36px; padding: 0 14px; border-radius: 999px; background: #1f2228; border: 1px solid #2e333b; color: #dad6cb; font-size: 12px; }
html.dark .legend i { width: 8px; height: 8px; }
html.dark .legend b { color: #8f96a1; font-weight: 500; }

/* ───────────── Расписание дня ───────────── */
.agenda { padding: 19px 25px 22px; min-width: 0; position: relative; }
html.dark .agenda { background: #ebe5d6; margin: 14px; border-radius: 20px; padding: 20px 18px 18px; box-shadow: inset 0 1px #ffffffb3; }
.agenda-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.agenda-head h3 { font-size: 15px; font-weight: 500; display: flex; align-items: center; }
.agenda-head h3 span { font: 10px var(--mono); color: var(--ink-3); margin-left: 8px; background: var(--chip); padding: 4px 6px; border-radius: 3px; }
html.dark .agenda-head h3 { font: 500 16px var(--display); }
html.dark .agenda-head h3 span { border-radius: 999px; padding: 3px 8px; color: #1b1d21; }
.agenda-count { font: 10px var(--mono); letter-spacing: .8px; text-transform: uppercase; color: var(--ink-3); }
.event-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.event { position: relative; padding: 13px 15px 12px; border-bottom: 1px solid var(--line-soft); border-radius: 16px; }
html.dark .event { background: var(--card); border: 1px solid var(--card-line); border-radius: 18px; padding: 11px 14px; }
.event-main { display: block; width: 100%; padding: 0 34px 0 0; text-align: left; }
.event-time { display: block; font: 10px var(--mono); color: var(--label-strong); margin-bottom: 9px; }
.event-time span { color: var(--ink-3); }
.event-time b {
  float: right; margin-right: 4px; padding: 3px 5px; border-radius: 2px; font: 500 8px/1.2 var(--mono); letter-spacing: .7px; text-transform: uppercase;
  background: var(--now-bg); color: var(--now-ink);
}
html.dark .event-time b { border-radius: 999px; padding: 3px 7px; }
.event-title { display: flex; align-items: center; gap: 9px; }
.event-title strong { font-size: 13px; font-weight: 450; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html.dark .event-title strong { font-size: 14px; font-weight: 500; }
.event-icon { width: 23px; height: 23px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--c); color: var(--on-color-light); }
.on-light .event-icon { color: var(--on-color-dark); }
.c-pale .event-icon, .c-deep .event-icon { box-shadow: inset 0 0 0 1px var(--c-edge); }
.event-icon .ic { width: 14px; height: 14px; stroke-width: 1.8; }
.event-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 6px 0 0 32px; font-size: 10px; color: var(--ink-3); }
.event-meta .sep { opacity: .6; }
html.dark .event-meta { font-size: 11px; }
.event.completed .event-title strong { color: var(--ink-3); text-decoration: line-through; }
html.dark .event.completed { opacity: .65; }
.event.selected { background: var(--selected); box-shadow: inset 0 0 0 1px var(--selected-line); border-bottom-color: transparent; }
.event.selected::before { content: ""; position: absolute; left: 0; top: 18px; bottom: 17px; width: 3px; border-radius: 2px; background: var(--selected-bar); }
html.dark .event.selected { box-shadow: 0 6px 18px #181a1d1a; border-color: var(--selected-line); }
html.dark .event.selected::before { display: none; }
.event.ext .event-icon { outline: 1px dashed color-mix(in srgb, var(--c) 70%, var(--ink)); outline-offset: 1px; }
.check-button { position: absolute; right: 5px; top: 7px; width: 44px; height: 44px; display: grid; place-items: center; color: transparent; }
.check-button::before { content: ""; position: absolute; width: 15px; height: 15px; border-radius: 50%; border: 1px solid var(--check-line); transition: background .15s, border-color .15s; }
.check-button:hover::before { border-color: var(--olive-2); }
.check-button.done::before { background: var(--check-on); border-color: var(--check-on); }
.check-button .ic { position: relative; z-index: 1; width: 11px; height: 11px; stroke-width: 3; }
.check-button.done .ic { color: #f9fbf1; }
html.dark .check-button::before { width: 26px; height: 26px; border-width: 1.5px; }
html.dark .check-button .ic { width: 14px; height: 14px; }
.edit-event { position: absolute; right: 4px; bottom: 0; width: 44px; height: 31px; display: grid; place-items: center; color: var(--ink-3); opacity: 0; }
.edit-event .ic { width: 15px; height: 15px; }
.event:hover .edit-event, .event.selected .edit-event, .edit-event:focus-visible { opacity: 1; }
.edit-event:hover { color: var(--ink); }
@media (hover: none) { .edit-event { opacity: .7; } }
.empty-note { font-size: 14px; color: var(--ink-2); line-height: 1.7; padding: 22px 12px; margin: 0; }

.expanded-list { list-style: none; margin: 0; padding: 20px 0 0; min-height: 440px; display: grid; align-content: start; gap: 10px; }
.x-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 18px 15px; border-radius: 16px; text-align: left; font-size: 14px; background: var(--chip); }
.x-row:hover { background: var(--chip-on); }
.x-row i { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.x-time { font: 11px var(--mono); white-space: nowrap; color: var(--ink-2); }
.x-row strong { flex: 1; min-width: 0; font-weight: 450; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.x-row .ic { color: var(--ink-3); }
.expanded-list .done strong { text-decoration: line-through; color: var(--ink-3); }
html.dark .x-row { background: #1e2126; border: 1px solid #2e323a; color: #f0ece1; }
html.dark .x-row:hover { border-color: #ff5a26; }

/* Поле быстрого добавления — пунктирная «пилюля», как «Добавить блок» в макете */
.quick {
  display: flex; align-items: center; gap: 8px; min-height: 43px; margin-top: 17px; padding: 0 5px 0 14px;
  border: 1px dashed var(--dashed); border-radius: 41px; color: var(--ink-2); font-size: 12px; transition: border-color .15s, background .15s;
}
.quick:focus-within { border-style: solid; border-color: var(--olive-2); background: var(--input-bg); }
.quick-plus { display: grid; color: var(--ink-3); }
.quick-plus .ic { width: 16px; height: 16px; }
.quick input { flex: 1; min-width: 0; height: 41px; border: 0; outline: none; background: none; font-size: 13px; color: var(--ink); }
.quick input::placeholder { color: var(--ink-2); }
.quick-key { color: var(--ink-3); border: 1px solid var(--line); border-radius: 3px; padding: 2px 5px; margin-right: 6px; }
.quick:focus-within .quick-key { display: none; }
.quick-go { width: 32px; height: 32px; border-radius: 50%; display: none; place-items: center; background: var(--primary); color: var(--primary-ink); flex: none; }
.quick-go .ic { width: 16px; height: 16px; }
.quick:focus-within .quick-go { display: grid; }
html.dark .agenda .quick { border-style: solid; border: 0; background: #ff5a26; color: #fff8f4; min-height: 48px; box-shadow: 0 6px 18px #ff5a2647; }
html.dark .agenda .quick input, html.dark .agenda .quick input::placeholder, html.dark .agenda .quick-plus { color: #fff8f4; }
html.dark .agenda .quick input::placeholder { opacity: .85; }
html.dark .agenda .quick-key { border-color: #ffffff66; color: #fff8f4; }
html.dark .agenda .quick-go { background: #1b1d21; color: #fff8f4; }

.tails-banner {
  display: flex; align-items: center; gap: 10px; width: 100%; margin: 6px 0 8px; padding: 10px 12px; border-radius: 14px;
  text-align: left; font-size: 12.5px; color: var(--ink-2);
  background: color-mix(in srgb, var(--accent) 9%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
}
.tails-banner span { flex: 1; }
.tails-banner b { color: var(--ink); font-weight: 500; }
.tails-banner .ic { color: var(--accent); }

.day-list { position: relative; }
.drop-hint { display: none; }
body.dragging-park .day-list .drop-hint {
  display: block; margin-top: 12px; padding: 12px; border-radius: 16px; text-align: center; font-size: 12px;
  color: var(--accent-text); border: 1px dashed color-mix(in srgb, var(--accent) 50%, transparent);
}
.day-list.drop-over .drop-hint { background: color-mix(in srgb, var(--accent) 10%, transparent); border-color: var(--accent); }

.console-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 43px; margin: 0 25px;
  border-top: 1px solid var(--line); font: 8px var(--mono); letter-spacing: .7px; text-transform: uppercase; color: var(--label);
}
.console-footer > span { display: flex; align-items: center; gap: 5px; }
.console-footer b { font-weight: 500; color: var(--label-strong); margin-left: 5px; }
.footer-divider { width: 1px; height: 11px; background: var(--line); margin: 0 12px; }
html.dark .console-footer { font-size: 10px; letter-spacing: .1em; color: #727883; }
html.dark .console-footer b { color: #ebe5d6; }

.balance-panel { margin-top: 20px; padding: 22px 19px; border-radius: 12px; background: var(--balance); border: 1px solid var(--balance-line); }
.balance-bar { display: flex; gap: 3px; height: 11px; margin-bottom: 16px; border-radius: 3px; overflow: hidden; }
.balance-bar > div { min-width: 0; }
.balance-bar .rest { background: var(--balance-rest); }
.balance-panel p { display: flex; gap: 5px; margin: 0; font-size: 10px; color: var(--ink-3); }
.balance-panel b { font-weight: 500; color: var(--label-strong); }
.balance-panel p > span { margin-left: auto; }
html.dark .balance-panel { border-radius: 16px; padding: 14px 16px; }
html.dark .balance-bar { height: 8px; border-radius: 999px; }
html.dark .balance-bar > div { border-radius: 999px; }
html.dark .balance-panel p { font: 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: #808792; }
html.dark .balance-panel b { color: #ebe5d6; }

/* ───────────── Панели-колонки (как task-column в макете) ───────────── */
.bottom-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 20px; align-items: start; }
.bottom-grid.two { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.panel, .task-column { min-width: 0; padding: 16px; border-radius: 20px; background: var(--panel); border: 1px solid var(--panel-line); }
html.dark .panel, html.dark .task-column { border-radius: 22px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.panel h3, .task-column h3 { display: flex; align-items: center; gap: 9px; min-width: 0; font-size: 16px; font-weight: 450; margin: 0; }
html.dark .panel h3, html.dark .task-column h3 { font: 500 15px var(--display); color: #f0ece1; }
.panel h3 i, .task-column h3 i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.panel h3 span, .task-column h3 span { font: 12px var(--mono); color: var(--ink-3); }
html.dark .panel h3 span, html.dark .task-column h3 span { background: #131518; padding: 3px 9px; border-radius: 999px; color: #8f96a2; font-size: 11px; }
.panel-sub { margin: 4px 0 14px; font-size: 12px; color: var(--ink-3); }
.task-column > h3 { margin-bottom: 16px; }
.task-column > h3 span { margin-left: auto; }
.task-list { list-style: none; margin: 0; padding: 0; }
.task-card {
  display: flex; align-items: flex-start; gap: 5px; min-width: 0; margin-bottom: 10px; padding: 0 5px 0 0;
  border-radius: 16px; background: var(--card); border: 1px solid var(--card-line);
}
.task-toggle { position: relative; width: 44px; min-height: 44px; flex: none; display: grid; place-items: center; color: transparent; }
.task-toggle::before { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--c-edge, #899879); transition: background .15s; }
html.dark .task-toggle::before { border-color: #5a606b; }
.task-toggle:hover::before { background: color-mix(in srgb, var(--c) 18%, transparent); }
.task-toggle .ic { position: relative; width: 12px; height: 12px; stroke-width: 2.6; }
.is-done .task-toggle::before { background: #d9e0c9; border-color: #899879; }
.is-done .task-toggle { color: #4e5f3f; }
html.dark .is-done .task-toggle::before { background: #ff5a26; border-color: #ff5a26; }
html.dark .is-done .task-toggle { color: #fff8f4; }
.task-text { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; text-align: left; padding: 11px 0 10px; }
.task-title { font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.task-meta { font-size: 11.5px; color: var(--ink-3); }
.is-done .task-title { text-decoration: line-through; color: var(--ink-3); }
.task-remove { width: 30px; min-height: 44px; flex: none; display: grid; place-items: center; color: var(--ink-3); opacity: 0; }
.task-remove .ic { width: 15px; height: 15px; }
.task-card:hover .task-remove, .task-remove:focus-visible { opacity: 1; }
@media (hover: none) { .task-remove { opacity: .7; } }
.task-column .quick, .panel .quick { margin-top: 6px; }

/* Мысли без срока на экране «Круг дня» — их можно тащить на кольцо */
.pm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pm-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 8px; border-radius: 14px; cursor: grab;
  background: var(--card); border: 1px solid var(--card-line); transition: opacity .15s, box-shadow .15s;
}
.pm-item:hover { box-shadow: 0 2px 8px #3a42300f; }
.pm-item.dragging { opacity: .4; }
.pm-grip { color: var(--ink-3); opacity: .5; display: grid; }
.pm-grip .ic { width: 15px; height: 15px; }
.pm-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.pm-title { flex: 1; min-width: 0; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-dur { font: 11px var(--mono); color: var(--ink-3); flex: none; }
.pm-add { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-3); flex: none; }
.pm-add:hover { background: var(--chip); color: var(--ink); }
.pm-add .ic { width: 15px; height: 15px; }
.pm-more { margin: 8px 0 0 4px; font-size: 12px; color: var(--accent-text); }

/* Регулярные дела */
.routines { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.routine { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--card-line); }
.routine::before { content: ""; position: absolute; left: 7px; top: 12px; bottom: 12px; width: 3px; border-radius: 2px; background: var(--c); }
.routine-main { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; text-align: left; }
.r-title { font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-sched { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 11.5px; color: var(--ink-3); }
.r-sched .ic { width: 12px; height: 12px; }
.r-week { display: flex; gap: 3px; flex: none; }
.rc { width: 22px; display: flex; flex-direction: column; align-items: center; gap: 3px; font: 9.5px var(--mono); color: var(--ink-3); }
.rc i { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--c-edge, var(--c)); }
.rc.off i { width: 4px; height: 4px; margin: 4px 0; border: 0; background: var(--line); }
.rc.ok i { background: var(--c); }
.rc.missed i { border-style: dashed; border-color: color-mix(in srgb, var(--c) 45%, transparent); }
.rc.now { color: var(--ink); font-weight: 500; }
.r-count { width: 34px; flex: none; text-align: right; font: 12px var(--mono); color: var(--ink-2); }
.empty { padding: 16px 8px 8px; color: var(--ink-3); font-size: 13px; line-height: 1.6; }

/* ───────────── Часы ───────────── */
.clock { width: 100%; height: auto; overflow: visible; user-select: none; -webkit-user-select: none; touch-action: pan-y; }
.clock .bezel { fill: var(--dial-bezel); stroke: var(--dial-bezel-line); }
.clock .st-f1 { stop-color: var(--face-1); }
.clock .st-f2 { stop-color: var(--face-2); }
.clock .st-f3 { stop-color: var(--face-3); }
.clock .st-w1 { stop-color: var(--well-1); }
.clock .st-w2 { stop-color: var(--well-2); }
.clock .st-w3 { stop-color: var(--well-3); }
.clock .st-o1 { stop-color: var(--oled-1); }
.clock .st-o2 { stop-color: var(--oled-2); }
.clock .well { stroke: var(--well-line); stroke-width: 1.5; }
.clock .well-line { fill: none; stroke: var(--well-line-2); }
.clock .tick { stroke: var(--tick); stroke-width: .8; }
.clock .tick.major { stroke: var(--tick-major); stroke-width: 1.5; }
.clock.is-dark .tick { stroke-linecap: round; stroke-width: 1; }
.clock.is-dark .tick.major { stroke-width: 1.6; }
.clock.is-dark .tick.noon { stroke: var(--accent); stroke-width: 2.4; }
.clock .hour { font: 13px var(--mono); fill: var(--hour); text-anchor: middle; }
.clock.is-dark .hour { font: 500 14px var(--display); }
.clock.is-dark .hour.quad { font-size: 16px; font-weight: 600; fill: var(--hour-quad); }
.clock .track { fill: none; stroke: var(--track); cursor: crosshair; touch-action: none; transition: stroke .15s; }
.clock .track:hover { stroke: var(--track-hover); }
.clock .track-hatch { fill: none; pointer-events: none; }
.clock .hatch-line { stroke: var(--hatch); stroke-width: 1; opacity: .24; }
.clock .track-line { fill: none; stroke: var(--track-line); pointer-events: none; }
.clock .track-dash { fill: none; stroke: var(--track-dash); stroke-dasharray: 3 7; pointer-events: none; }
.clock .past { fill: none; stroke: var(--track-past); pointer-events: none; }
.clock:not(.is-dark) .past { opacity: .55; }
.clock .arc { cursor: grab; touch-action: none; transition: opacity .2s, filter .15s; }
.clock .arc.pill, .clock .hatch.pill, .clock .preview.pill { fill: none; stroke-linecap: round; }
.clock .arc:hover { filter: brightness(1.07); }
.clock .arc.done, .clock .hatch.done { opacity: .4; }
.clock .arc.moving, .clock .lbl.moving, .clock .hatch.moving { opacity: .18; }
.clock.dragging, .clock.dragging .arc { cursor: grabbing; }
.clock .arc.ext { cursor: pointer; }
.clock .hatch { pointer-events: none; }
.clock .lbl { font-family: var(--font); font-weight: 500; fill: var(--on-color-light); pointer-events: none; }
.clock .lbl.dark { fill: var(--on-color-dark); }
.clock .lbl.done { opacity: .7; }
.clock .preview { opacity: .55; pointer-events: none; }
.clock:not(.is-dark) .center-disc { fill: var(--dial-center); stroke: var(--dial-center-line); }
.clock.is-dark .center-disc { stroke: var(--oled-line); stroke-width: 1.5; }
.clock .center-disc { cursor: pointer; }
.clock .center-hi { fill: none; stroke: var(--dial-center-hi); pointer-events: none; }
.clock .center-ring { fill: none; stroke: var(--ring-track); stroke-width: 3.5; pointer-events: none; }
.clock .center-progress { fill: none; stroke: var(--accent); stroke-width: 3.5; stroke-linecap: round; pointer-events: none; }
.clock .c-bar-track { fill: var(--bar-track); pointer-events: none; }
.clock .c-bar { fill: var(--bar); pointer-events: none; }
.clock .g-texts text { text-anchor: middle; pointer-events: none; }
.clock .c-cap { font: 11px var(--mono); letter-spacing: 2px; fill: var(--dial-cap); }
.clock .c-big { font: 450 61px var(--font); letter-spacing: -3px; fill: var(--dial-time); }
.clock .c-big.long { font-size: 46px; letter-spacing: -2px; }
.clock .c-big .colon { fill: var(--dial-colon); }
.clock .c-ev { font: 13px var(--font); fill: var(--dial-ev); }
.clock .c-det { font: 10px var(--mono); letter-spacing: 1.2px; fill: var(--dial-det); }
.clock.is-dark .c-cap { font-size: 10px; letter-spacing: .18em; }
.clock.is-dark .c-big { font: 500 62px var(--display); letter-spacing: -.02em; }
.clock.is-dark .c-big.long { font-size: 46px; }
.clock.is-dark .c-ev { font-size: 14px; font-weight: 500; }
.clock.is-dark .c-det { font-size: 11px; letter-spacing: .06em; }
.clock .needle { stroke: var(--needle); stroke-width: 3; stroke-linecap: round; pointer-events: none; }
.clock .needle-dot { fill: var(--needle); pointer-events: none; }
.clock.is-dark .needle { stroke-width: 2.4; }
.clock.is-dark .needle-dot { stroke: #111214; stroke-width: 1.5; }
body.dragging-task .clock .track { stroke: color-mix(in srgb, var(--accent) 16%, var(--track)); }
.clock.drop-target .center-disc { opacity: .92; }

/* ───────────── Неделя и месяц ───────────── */
.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 28px; flex-wrap: wrap; }
.calendar-toolbar h2 { font-size: 26px; font-weight: 450; letter-spacing: -.7px; margin: 0; }
.calendar-toolbar p { margin: 7px 0 0; font-size: 14px; line-height: 1.6; color: var(--ink-2); }
html.dark .calendar-toolbar h2 { font: 500 26px var(--display); color: var(--ink-strong); letter-spacing: 0; }
html.dark .calendar-toolbar p { font-size: 13px; color: #8d939e; }
.calendar-navigation { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.calendar-navigation .today-button { min-height: 44px; margin: 0; padding: 0 16px; font-size: 14px; }
.calendar-sheet { padding: 0 22px 22px; }
html.dark .calendar-sheet { margin: 0 22px 22px; padding: 16px; border-radius: 20px; background: #ebe5d6; }
.weekday-labels, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; }
.weekday-labels { padding-bottom: 14px; font-size: 14px; color: var(--ink-2); text-align: center; }
html.dark .weekday-labels { font: 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; padding-bottom: 10px; }
.calendar-day {
  min-width: 0; min-height: 127px; display: flex; flex-direction: column; gap: 10px; padding: 12px 9px;
  border-radius: 16px; background: var(--cal-day); border: 1px solid var(--cal-day-line); color: var(--ink);
}
.calendar-day.is-today { background: var(--today-bg); border-color: var(--today-line); box-shadow: inset 0 0 0 1px var(--today-line); }
.calendar-day.is-sel:not(.is-today) { border-color: var(--olive-2); }
.calendar-day.outside-month { background: var(--cal-out); color: var(--ink-3); }
.calendar-day-heading { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; width: 100%; text-align: left; }
.calendar-day-heading span { font-size: 14px; }
.calendar-day-heading strong { font-size: 16px; font-weight: 500; line-height: 1.1; }
html.dark .calendar-day-heading span { font: 11px var(--mono); text-transform: uppercase; color: #6c6f75; }
html.dark .calendar-day-heading strong { font: 600 18px/1 var(--display); }
html.dark .is-today .calendar-day-heading strong { background: #ff5a26; color: #fff; padding: 4px 8px; border-radius: 10px; font-size: 15px; }
.calendar-day-heading small { font-size: 12px; color: var(--olive); }
html.dark .calendar-day-heading small { font: 9px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: #ff5a26; }
.calendar-day-heading .ic { margin-left: auto; width: 14px; height: 14px; color: var(--ink-3); }
.calendar-day-heading:hover .ic { color: var(--ink); }
.calendar-events { display: grid; gap: 7px; width: 100%; }
.calendar-event {
  display: block; min-width: 0; padding: 5px 5px 5px 7px; border-left: 3px solid var(--c); border-radius: 4px;
  text-align: left; overflow-wrap: anywhere; background: var(--cal-event);
}
html.dark .calendar-event { border-radius: 8px; }
.calendar-event:hover { filter: brightness(.98); }
.calendar-event > span { display: block; font: 11px var(--mono); color: var(--ink-2); }
.calendar-event b { display: block; margin-top: 3px; font-size: 13px; font-weight: 400; line-height: 1.35; }
html.dark .calendar-event b { font-weight: 500; font-size: 12px; }
.calendar-event.is-done b { text-decoration: line-through; color: var(--ink-3); }
.more-events { text-align: left; font-size: 12px; color: var(--ink-2); }
.more-events:hover { color: var(--ink); }
.free-day { padding-top: 26px; text-align: center; font-size: 13px; line-height: 1.6; color: var(--ink-3); }
.free-add { width: 36px; height: 36px; margin: 12px auto 0; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); }
.free-add:hover { background: var(--chip); color: var(--ink); }
.week-view .calendar-day { min-height: 440px; padding: 14px 9px; }
.calendar-hint { margin: 0; padding: 18px 28px; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.6; color: var(--ink-2); }
html.dark .calendar-hint { border-top: 0; padding-top: 0; font-size: 13px; color: #8d939e; }

/* ───────────── Без срока ───────────── */
.search {
  display: flex; align-items: center; gap: 6px; height: 44px; width: min(240px, 46vw); padding: 0 14px;
  border-radius: 24px; background: var(--chip); color: var(--ink-3); border: 1px solid transparent;
}
.search:focus-within { border-color: var(--olive-2); }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: none; color: var(--ink); }
.search .ic { width: 16px; height: 16px; }
.task-filters { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 28px 20px; }
.task-filters button {
  display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 24px;
  font-size: 14px; background: var(--chip); color: var(--chip-ink); border: 1px solid transparent;
}
.task-filters button.selected { background: var(--chip-on); color: var(--chip-on-ink); border-color: var(--chip-on-line); }
html.dark .task-filters button { border-color: #2f343c; font-size: 13px; min-height: 38px; }
html.dark .task-filters button.selected { border-color: var(--chip-on-line); }
.task-filters i { width: 9px; height: 9px; border-radius: 50%; }
.task-filters span { font: 12px var(--mono); color: var(--ink-3); }
.task-filters .selected span { color: inherit; opacity: .7; }
.quick-task { margin: 0 28px 24px; padding: 20px; border-radius: 20px; background: #e2e7d7; border: 1px solid #bac7a8; }
html.dark .quick-task { background: #1d2026; border-color: #323740; padding: 16px; }
.quick-task .quick { margin: 0; border-style: solid; border-color: var(--input-line); background: var(--input-bg); border-radius: 24px; min-height: 46px; }
.tails-panel { margin: 0 28px 24px; padding: 16px; border-radius: 20px; background: var(--panel); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--panel-line)); }
.orow { align-items: center; }
.orow-actions { display: flex; gap: 6px; flex: none; padding-right: 6px; }
.task-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; padding: 0 28px 28px; align-items: start; }
.task-board-empty { padding: 0 28px 28px; }
.tc-list { display: grid; gap: 10px; }
.tc-list.grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin-bottom: 12px; }
.pcard.task-card { margin: 0; }
.tc-body { flex: 1; min-width: 0; padding: 11px 6px 10px 0; display: flex; flex-direction: column; gap: 6px; }
.pcard-title { text-align: left; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.pcard.is-done .pcard-title { text-decoration: line-through; color: var(--ink-3); }
.pcard-notes { margin: 0; font-size: 12.5px; color: var(--ink-2); white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pcard-meta { display: flex; flex-wrap: wrap; gap: 2px 6px; font-size: 11.5px; color: var(--ink-3); }
.pcard-meta .sep { opacity: .6; }
.pcard-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.psteps { display: flex; flex-direction: column; gap: 5px; }
.psteps-bar { height: 5px; border-radius: 3px; overflow: hidden; background: color-mix(in srgb, var(--c) 18%, var(--line)); }
.psteps-bar i { display: block; height: 100%; border-radius: 3px; background: var(--c); transition: width .3s; }
.psteps-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.psteps-count { font: 500 11px var(--mono); color: var(--ink-2); flex: none; }
.psteps-next { flex: 1; min-width: 0; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.psteps-do { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--c-edge, var(--c)); color: var(--c-edge, var(--c)); }
.psteps-do:hover { background: var(--c); color: var(--on-color-light); }
.on-light .psteps-do:hover { color: var(--on-color-dark); }
.psteps-do .ic { width: 13px; height: 13px; stroke-width: 2.6; }
.task-add { display: flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 5px; margin-top: 4px; font-size: 14px; color: var(--olive); }
html.dark .task-add { color: #dedad0; }
.task-add .ic { width: 16px; height: 16px; }
.park-empty { padding: 4px 28px 32px; max-width: 720px; }
.park-empty h2 { font-size: 20px; font-weight: 500; margin-bottom: 8px; }
.park-empty p { margin: 0 0 8px; color: var(--ink-2); line-height: 1.65; }
.park-empty .small { color: var(--ink-3); font-size: 12.5px; }
.pdone { margin: 0 28px 28px; }
.pdone summary { cursor: pointer; padding: 10px 0; font-size: 14px; font-weight: 500; color: var(--ink-2); }

/* ───────────── Шаблоны цепочек ───────────── */
.tpl-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tpl-chip {
  display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 0 12px; border-radius: 24px;
  font-size: 12px; background: var(--chip); color: var(--chip-ink); max-width: 100%;
}
.tpl-chip:hover { background: var(--chip-on); color: var(--chip-on-ink); }
.tpl-chip i { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.tpl-chip span { font: 10px var(--mono); color: var(--ink-3); }
.tpl-chip.more { padding: 0 10px; color: var(--ink-2); }
.tpl-chip .ic { width: 15px; height: 15px; }

.tpl-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 16px; }
.tpl-tabs button { min-height: 34px; padding: 0 14px; border-radius: 24px; font-size: 13px; background: var(--chip); color: var(--chip-ink); }
.tpl-tabs button.on { background: var(--primary); color: var(--primary-ink); }
.tpl-tabs .tpl-new { display: inline-flex; align-items: center; gap: 6px; background: none; border: 1px dashed var(--dashed); color: var(--ink-2); }
.tpl-tabs .tpl-new .ic { width: 15px; height: 15px; }
.tpl-name { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.tpl-name h3 { display: flex; align-items: center; gap: 9px; font-size: 21px; font-weight: 500; letter-spacing: -.5px; }
html.dark .tpl-name h3 { font-family: var(--display); letter-spacing: 0; }
.tpl-name h3 i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.tpl-plan { margin-top: 14px; }
.tpl-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; grid-template-columns: minmax(0, 1fr); }
.tpl-step { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 4px 6px 4px 4px; border-radius: 14px; background: var(--card); border: 1px solid var(--card-line); }
.tpl-step.off { opacity: .5; }
.tpl-step.off .tpl-title { text-decoration: line-through; }
.tpl-on { position: relative; width: 36px; height: 36px; flex: none; display: grid; place-items: center; color: transparent; }
.tpl-on::before { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--check-line); }
.tpl-on[aria-pressed="true"]::before { background: var(--check-on); border-color: var(--check-on); }
.tpl-on[aria-pressed="true"] { color: #fff; }
.tpl-on .ic { position: relative; width: 11px; height: 11px; stroke-width: 3; }
.tpl-time { width: 94px; flex: none; font: 11px var(--mono); color: var(--ink-2); }
.tpl-title { flex: 1; min-width: 0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dur-ctl { display: flex; align-items: center; gap: 2px; flex: none; }
.dur-ctl b { min-width: 64px; text-align: center; font: 500 11px var(--mono); color: var(--ink-2); }
.dur-ctl button { width: 30px; height: 30px; border-radius: 50%; font-size: 16px; line-height: 1; color: var(--ink-2); background: var(--chip); }
.dur-ctl button:hover { background: var(--chip-on); color: var(--chip-on-ink); }
.tpl-sum { margin: 10px 2px 0; font: 11px var(--mono); letter-spacing: .3px; color: var(--ink-2); }
.tpl-warn { margin: 6px 2px 0; font-size: 12.5px; color: var(--danger); }
.tpl-text { font-family: var(--mono); font-size: 13px; line-height: 1.6; }
.tpl-parsed:empty { display: none; }
.chain-box {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin-top: 16px; padding: 10px 10px 10px 14px; border-radius: 14px; background: var(--chip); font-size: 13px; color: var(--ink-2);
}
.chain-box b { font-weight: 500; color: var(--ink); }
@media (max-width: 520px) {
  .tpl-time { width: 78px; font-size: 10px; }
  .dur-ctl b { min-width: 50px; font-size: 10px; }
  .dur-ctl button { width: 28px; height: 28px; }
  .tpl-step { gap: 6px; }
}

/* ───────────── Листы и редактор (диалог) ───────────── */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center;
  background: var(--backdrop); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); animation: fade .18s ease;
}
.sheet-backdrop.closing { animation: fade .18s ease reverse forwards; }
.sheet-backdrop.closing .sheet { animation: up .18s ease reverse forwards; }
.sheet {
  width: 100%; max-width: 560px; max-height: 94dvh; overflow: auto; overscroll-behavior: contain;
  padding: 6px 22px calc(20px + env(safe-area-inset-bottom));
  background: var(--sheet-bg); color: var(--ink); border: 1px solid var(--sheet-line); border-radius: 20px 20px 0 0;
  box-shadow: 0 30px 100px #17211550; animation: up .26s cubic-bezier(.2, .9, .3, 1);
}
html.dark .sheet { box-shadow: 0 32px 90px #000000b3; }
.sheet-handle { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 4px auto 6px; }
@media (min-width: 700px) {
  .sheet-backdrop { align-items: center; padding: 24px; }
  .sheet { border-radius: var(--sheet-radius); padding: 24px 27px 26px; max-height: 90dvh; }
  .sheet-handle { display: none; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }

.ed-head { display: flex; align-items: center; justify-content: space-between; margin: 0 -8px 4px 0; }
.ed-kicker { font: 10px var(--mono); letter-spacing: 1.4px; text-transform: uppercase; color: var(--label); }
.ed-kicker.big { font: 500 23px var(--font); letter-spacing: -.7px; text-transform: none; color: var(--ink); }
html.dark .ed-kicker.big { font-family: var(--display); letter-spacing: 0; }
.title-input { width: 100%; border: 0; outline: none; background: none; padding: 4px 0 12px; font-size: 23px; font-weight: 500; letter-spacing: -.7px; color: var(--ink); }
.title-input::placeholder { color: var(--ink-3); }
.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }

.icon-btn { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 50%; color: var(--ink-2); }
.icon-btn:hover { background: var(--sunken); color: var(--ink); }
html.dark .icon-btn { background: #25282f; color: #d7d2c6; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 20px;
  border-radius: 24px; font-size: 14px; font-weight: 500; white-space: nowrap;
}
.btn:disabled { opacity: .5; pointer-events: none; }
.btn .ic { width: 17px; height: 17px; }
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--chip); color: var(--chip-ink); }
.btn-ghost:hover { background: var(--chip-on); color: var(--chip-on-ink); }
.btn-danger { color: var(--danger); padding: 0 12px; }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); }
.btn-danger-fill { background: var(--danger); color: #fff8f4; }
.btn-google { width: 100%; background: var(--input-bg); border: 1px solid var(--input-line); color: var(--ink); }
.btn-google .ic { width: 20px; height: 20px; }
.pill { height: 34px; padding: 0 14px; border-radius: 999px; font-size: 13px; background: var(--chip); }

.input {
  width: 100%; height: 46px; padding: 10px 12px; outline: none; font-size: 15px;
  border: 1px solid var(--input-line); border-radius: var(--input-radius); background: var(--input-bg); color: var(--ink);
  transition: border-color .15s;
}
.input:focus { border-color: var(--olive-2); }
html.dark .input:focus { border-color: #ff5a26; }
.textarea { height: auto; min-height: 84px; resize: vertical; line-height: 1.45; }
select.input { appearance: none; padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 20px) 20px, calc(100% - 15px) 20px; background-size: 5px 5px; background-repeat: no-repeat; }

.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.two { gap: 12px; align-items: flex-start; }
.row.two .field { flex: 1; }
.spacer { flex: 1; }
.muted { color: var(--ink-2); margin: 0 0 4px; }
.small { font-size: 12.5px; color: var(--ink-3); }
.error { color: var(--danger); font-size: 13.5px; margin: 0 0 10px; }
.hint { font-size: 12.5px; color: var(--ink-3); margin: 6px 0 0; }
.note { font-size: 13px; color: var(--ink-3); margin: 2px 4px; }
.warn { color: var(--danger); }

.seg { display: flex; gap: 2px; padding: 4px; border-radius: 8px; background: var(--sunken); box-shadow: var(--sunken-shadow); }
.seg button { flex: 1; height: 36px; border-radius: 5px; font-size: 13px; color: var(--ink-2); }
.seg button.on { background: var(--raised); color: var(--raised-ink); box-shadow: var(--raised-shadow); }
html.dark .seg { border-radius: 999px; padding: 3px; border: 1px solid #262a30; }
html.dark .seg button { border-radius: 999px; }
html.dark .seg button.on { background: #ff5a26; color: #fff8f4; box-shadow: 0 2px 10px #ff5a2652; }

.field { display: flex; flex-direction: column; gap: 7px; margin: 16px 0 0; min-width: 0; }
.field > span { font-size: 13px; color: var(--ink-2); }
.time-row { display: flex; align-items: flex-end; gap: 10px; }
.time-row .field { flex: 1; }
.dash { padding-bottom: 12px; color: var(--ink-3); }
.dur-hint { font-size: 12.5px; color: var(--ink-3); margin-top: 8px; }
.dur-hint .warn { color: var(--danger); }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; cursor: pointer; }
.switch-row small { display: block; font-size: 12.5px; color: var(--ink-3); }
.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--sunken); box-shadow: var(--sunken-shadow); transition: background .2s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fbfbf5; box-shadow: 0 1px 3px #0003; transition: transform .2s; }
.switch input:checked + i { background: var(--olive-2); }
html.dark .switch i { border: 1px solid #262a30; }
html.dark .switch input:checked + i { background: #ff5a26; }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { outline: 2px solid var(--focus); outline-offset: 2px; }
.switch input:disabled + i { opacity: .5; }

.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(28px, 1fr)); gap: 6px; padding: 4px; }
.sw { aspect-ratio: 1; min-height: 28px; border-radius: 8px; background: var(--c); display: grid; place-items: center; color: transparent; box-shadow: inset 0 0 0 1px #0000001a; transition: transform .12s, box-shadow .12s; }
.sw:hover { transform: scale(1.12); position: relative; z-index: 1; }
.sw.on { color: var(--on-color-light); box-shadow: 0 0 0 2px var(--sheet-bg), 0 0 0 4px var(--ink); }
.sw.on.on-light { color: var(--on-color-dark); }
.sw .ic { width: 16px; height: 16px; stroke-width: 3; }

.day-chips { display: flex; gap: 5px; flex-wrap: nowrap; }
.day-chip { flex: 1; min-width: 0; height: 40px; border-radius: 24px; font-size: 13px; background: var(--chip); color: var(--chip-ink); }
.day-chip.we { color: var(--danger); }
.day-chip[aria-pressed="true"] { background: var(--primary); color: var(--primary-ink); }
.days-hint { font-size: 12.5px; color: var(--ink-3); }
.days-hint .warn { color: var(--danger); }

.steps-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.steps-list:empty { display: none; }
.step { display: flex; align-items: center; gap: 8px; padding: 2px 4px 2px 8px; border-radius: 12px; background: var(--chip); }
.step-check { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--ink-3); color: transparent; }
.step.done .step-check { background: var(--olive-2); border-color: var(--olive-2); color: #fff; }
.step-check .ic { width: 13px; height: 13px; stroke-width: 3; }
.step-text { flex: 1; min-width: 0; height: 38px; border: 0; outline: none; background: none; color: var(--ink); }
.step.done .step-text { text-decoration: line-through; color: var(--ink-3); }
.step-del { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 50%; color: var(--ink-3); }
.step-del:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.step-del .ic { width: 15px; height: 15px; }
.step-new { margin-top: 4px; }
.park-hint { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; padding: 10px 12px; border-radius: 12px; background: var(--chip); color: var(--ink-2); font-size: 13px; }
.park-hint .ic { color: var(--accent); margin-top: 1px; }

.ed-confirm { margin-top: 16px; padding: 14px; border-radius: 14px; background: color-mix(in srgb, var(--danger) 9%, var(--chip)); }
.ed-confirm p { margin: 0 0 10px; font-weight: 500; }
.ed-confirm .row .btn { flex: 1; }
.sheet-actions { display: flex; align-items: center; gap: 8px; margin-top: 24px; }
@media (max-width: 420px) { .sheet-actions .btn-danger span { display: none; } }

/* Настройки */
.set-sec { padding: 16px 0; border-bottom: 1px solid var(--line); }
.set-sec:last-of-type { border-bottom: 0; }
.set-sec h3 { margin-bottom: 10px; font: 10px var(--mono); letter-spacing: 1.4px; text-transform: uppercase; color: var(--label); }
.set-sec .switch-row { margin-top: 0; }
.email-form { display: flex; flex-direction: column; gap: 8px; }
.email-form .row .btn { flex: 1; }
.or { display: flex; align-items: center; gap: 10px; margin: 14px 0 10px; font-size: 12.5px; color: var(--ink-3); }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.account { display: flex; align-items: center; gap: 12px; }
.account .avatar { width: 42px; height: 42px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--chip); color: var(--ink); font-weight: 600; font-size: 18px; }
.acc-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.acc-text span { font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; }
.sync-line { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; font-size: 14px; color: var(--ink-2); }
.sync-line.st-synced .ic { color: var(--olive-2); }
.sync-line.st-error .ic { color: var(--danger); }
.sync-ic { display: grid; place-items: center; }
.sync-ic.st-synced { color: var(--olive-2); }
.sync-ic.st-error { color: var(--danger); }
.sync-ic.st-syncing .ic, .sync-ic.st-connecting .ic { animation: spin 1.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.gcal-list { list-style: none; margin: 10px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.gcal-row { display: flex; align-items: center; gap: 12px; padding: 8px 6px 8px 12px; border-radius: 14px; background: var(--chip); }
.gcal-row.off .gcal-text { opacity: .55; }
.cal-color { width: 22px; height: 22px; flex: none; border-radius: 7px; background: var(--c); }
.gcal-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.gcal-text b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gcal-text > span { font-size: 12.5px; color: var(--ink-3); }
.error-inline { color: var(--danger); }
.gcal-form { display: flex; gap: 8px; margin-top: 10px; }
.gcal-form .input { flex: 1; min-width: 0; font-size: 13.5px; }
.howto { margin-top: 10px; font-size: 13.5px; color: var(--ink-2); }
.howto summary { cursor: pointer; padding: 4px 0; font-weight: 500; color: var(--accent-text); }
.howto ol { margin: 6px 0; padding-left: 20px; line-height: 1.6; }
.howto .small { margin: 4px 0 0; }
.refresh-btn { margin-top: 10px; }
.about { margin: 10px 0 0; text-align: center; font: 10px var(--mono); letter-spacing: .8px; text-transform: uppercase; color: var(--ink-3); }

/* Карточка события Google */
.src-kicker { display: inline-flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font: 13px var(--font); }
.cal-dot { width: 12px; height: 12px; border-radius: 4px; background: var(--c); display: inline-block; }
.ev-title { margin: 6px 0 12px; font-size: 22px; font-weight: 500; letter-spacing: -.5px; line-height: 1.25; }
.ev-title.done { text-decoration: line-through; color: var(--ink-3); }
.ev-row { display: flex; align-items: flex-start; gap: 10px; margin: 8px 0; color: var(--ink-2); }
.ev-row .ic { margin-top: 1px; color: var(--ink-3); }
.ev-desc { margin: 12px 0; padding: 12px 14px; border-radius: 14px; background: var(--chip); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; max-height: 260px; overflow: auto; }
.ev-desc a { color: var(--accent-text); }
.ev-note { margin: 14px 0 0; font-size: 12.5px; color: var(--ink-3); }

/* Всплывающие сообщения */
#toasts {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60;
  display: flex; flex-direction: column; align-items: center; gap: 8px; width: max-content; max-width: calc(100vw - 32px); pointer-events: none;
}
@media (min-width: 521px) { #toasts { left: calc(50% + 41px); } }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 14px; padding: 9px 10px 9px 18px; border-radius: 999px;
  font-size: 13px; background: var(--toast); color: var(--toast-ink); box-shadow: 0 12px 30px #1a201640; animation: up .2s ease;
}
.toast button { padding: 6px 10px; border-radius: 999px; font: 500 11px var(--mono); letter-spacing: .5px; text-transform: uppercase; color: var(--toast-ink); background: color-mix(in srgb, var(--toast-ink) 12%, transparent); }
.toast.out { animation: fade .2s ease reverse forwards; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ───────────── Адаптивность (по точкам макета) ───────────── */
@media (min-width: 1450px) {
  .shell { padding-top: 40px; }
  .dial { max-width: 555px; }
  .event { padding-top: 15px; padding-bottom: 15px; }
  .console-top { min-height: 90px; }
}
@media (max-width: 1150px) {
  .shell { padding-left: 108px; padding-right: 25px; }
  .rail { width: 75px; }
  .wordmark small { display: none; }
  .console-body { grid-template-columns: minmax(0, 1.25fr) minmax(290px, 1fr); }
  .dial-panel { padding: 24px 18px; }
  .agenda { padding: 19px 16px; }
  .legend { gap: 8px 12px; }
  .bottom-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bottom-grid.two { grid-template-columns: minmax(0, 1fr); }
  .task-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .week-view .calendar-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .week-view .calendar-day { min-height: 250px; }
  .calendar-day-heading .ic { display: none; }
  .calendar-day { min-height: 110px; }
  .month-view .calendar-event b { display: none; }
}
@media (max-width: 850px) {
  .shell { padding: 24px 20px 32px 88px; }
  .rail { width: 65px; }
  .system-status { font-size: 8px; }
  .console-body { grid-template-columns: minmax(0, 1fr); }
  .dial-panel { border-right: 0; border-bottom: 1px solid var(--line); padding-bottom: 22px; }
  .dial { max-width: 490px; }
  .legend { margin-top: 18px; gap: 8px 25px; }
  .agenda { padding: 14px 22px 22px; }
  .console-top { margin: 0 15px; gap: 5px; }
  .date-control { gap: 0; }
  .date-title b { font-size: 16px; }
  .date-title { min-width: 105px; }
  .today-button { margin-left: 0; font-size: 11px; padding: 0 9px; }
  .view-switch { margin-right: 0; }
  .view-switch button span { display: none; }
  .view-switch button { padding: 0 11px; }
  .bottom-grid { grid-template-columns: minmax(0, 1fr); }
  .console-footer > span:first-child { display: none; }
  .console-footer { justify-content: center; font-size: 9px; }
  .screw { display: none; }
}
@media (max-width: 650px) {
  .topbar { flex-wrap: wrap; gap: 10px; }
  .topbar-right { width: 100%; justify-content: space-between; }
  .planner-tabs { width: 100%; gap: 2px; }
  .planner-tabs button { flex: 1; justify-content: center; padding: 0 8px; font-size: 13px; }
  .planner-tabs .nav-count { display: none; }
  .calendar-toolbar { padding: 22px 16px; }
  .calendar-toolbar h2 { font-size: 23px; }
  .calendar-sheet { padding: 0 8px 16px; }
  html.dark .calendar-sheet { margin: 0 8px 12px; padding: 10px 6px; }
  .calendar-grid, .weekday-labels { gap: 4px; }
  .calendar-day { padding: 9px 4px; min-height: 85px; border-radius: 12px; gap: 6px; }
  .calendar-day-heading strong { font-size: 14px; }
  .calendar-day-heading small { display: none; }
  .month-view .calendar-event { height: 5px; padding: 0; border: 0; border-radius: 4px; background: var(--c); }
  .month-view .calendar-event > span { display: none; }
  .month-view .calendar-events { gap: 4px; }
  .month-view .more-events { font-size: 11px; }
  .week-view .calendar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .week-view .calendar-day { min-height: 200px; padding: 14px; }
  .task-board { grid-template-columns: minmax(0, 1fr); padding: 0 16px 20px; }
  .task-filters { padding: 0 16px 20px; }
  .quick-task, .tails-panel { margin: 0 16px 20px; padding: 14px; }
  .pdone, .task-board-empty { margin-left: 16px; margin-right: 16px; padding-left: 0; padding-right: 0; }
  .park-empty { padding: 4px 16px 24px; }
  .calendar-hint { padding: 16px; }
  .search { width: 100%; flex: 1; }
  .calendar-navigation { width: 100%; }
  .tasks-view .calendar-navigation .submit-button { flex: none; }
}
@media (max-width: 520px) {
  .shell { padding: 18px 13px 28px; }
  .rail {
    position: static; width: auto; height: 64px; flex-direction: row; justify-content: space-between;
    padding: 0 18px; border-right: 0; border-bottom: 1px solid var(--rail-line);
  }
  .brand-mark { width: 29px; height: 29px; }
  .brand-mark::before { width: 38px; height: 14px; }
  .brand-mark span { width: 10px; height: 10px; }
  .rail-links { margin: 0; display: flex; gap: 8px; }
  .rail-bottom { margin: 0; display: flex; align-items: center; gap: 8px; }
  .rail-button { width: 42px; height: 42px; }
  .wordmark { font-size: 28px; }
  html.dark .wordmark { font-size: 20px; }
  .system-status { font-size: 7px; letter-spacing: .2px; }
  .system-status > span + span { padding-left: 8px; margin-left: 8px; }
  .style-switcher button { padding: 0 9px; font-size: 10px; }
  .console { border-radius: 12px; }
  html.dark .console { border-radius: 18px; }
  .console-top { min-height: 72px; margin: 0 8px; }
  .date-title b { font-size: 15px; }
  .date-title span { font-size: 10px; }
  .date-control > .icon-button { width: 30px; }
  html.dark .date-title b { font-size: 17px; }
  .today-button { font-size: 10px; min-height: 30px; padding: 0 7px; }
  .view-switch button { padding: 0 8px; min-height: 30px; }
  .dial-panel { padding: 18px 8px; }
  .instrument-label { padding: 0 5px; font-size: 8px; letter-spacing: .8px; flex-wrap: wrap; }
  .period-switch button { padding: 0 9px; font-size: 11px; min-height: 36px; }
  .legend { gap: 6px 16px; }
  .dial-bottom-label { font-size: 7px; }
  .agenda { padding: 12px 10px 16px; }
  html.dark .agenda { margin: 8px; padding: 14px 10px; }
  .event { padding: 12px; }
  .event-title strong { font-size: 14px; }
  .event-meta, .event-time { font-size: 11px; }
  .event-icon { width: 26px; height: 26px; }
  .event-meta { margin-left: 35px; }
  .page-footer { padding: 20px 3px; font-size: 7px; flex-direction: column; align-items: flex-start; gap: 6px; }
  .balance-panel p { font-size: 12px; flex-wrap: wrap; }
  .expanded-list { min-height: 300px; }
  .x-row { padding: 15px 10px; font-size: 13px; gap: 8px; }
  .x-time { font-size: 10px; }
  .orow { flex-wrap: wrap; }
  .orow-actions { width: 100%; padding: 0 0 10px 44px; }
  .routine { flex-wrap: wrap; }
  .routine-main { flex-basis: 100%; }
  #toasts { left: 50%; }
}

/* Шаблоны: перетаскивание и подписи */
.tpl-chip[draggable="true"] { cursor: grab; }
.tpl-chip.dragging, .event.dragging { opacity: .45; }
.event.draggable { cursor: grab; }
.event.draggable .event-main { cursor: inherit; }
.tpl-chip.more .lbl { font: inherit; color: inherit; }
.tpl-from-day { margin-top: 8px; }
.chain-actions { display: flex; gap: 6px; flex-wrap: wrap; }
