/* Yahad — стили. Светлая и тёмная тема по системе; зоны касания ≥ 44px. */

:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #efede7;
  --text: #1d1c1a;
  --muted: #6d6a62;
  --border: #e3e0d8;
  --accent: var(--accent-l, #0f6e64);
  --accent-text: #ffffff;
  --accent-soft: color-mix(in srgb, var(--accent) 15%, #ffffff);
  --warm: #985410;
  --ok: #1f7a4a;
  --warn: #8a5015;
  --danger: #b3261e;
  /* Пропущенный срок (михкар-2, как Will Be Done): по умолчанию — тихо, янтарём на мягкой плашке; html.late-red — как раньше. */
  --late: #855d00;
  --late-bg: #fbefc6;
  --shadow: 0 1px 2px rgb(0 0 0 / .06), 0 4px 16px rgb(0 0 0 / .06);
  --shadow-lift: 0 2px 6px rgb(0 0 0 / .1), 0 12px 32px rgb(0 0 0 / .14);

  /* Приоритеты: 3 — высокий, 2 — средний, 1 — низкий */
  --p3: #be3a30;
  --p2: #d9822b;
  --p1: #2962c2;
  --swipe-done: #1f8a52;
  --swipe-later: #2f6fdb;

  --radius: 14px;
  --tap: 44px;
  --header-h: 56px;
  --nav-h: 64px;
  --side-w: 272px;
  --detail-w: 420px;
  /* Системные панели телефона. В APK (Capacitor 8, edge-to-edge) WebView старше 140 не знает env(safe-area-inset-*),
     поэтому Capacitor кладёт отступы в --safe-area-inset-* на <html>; берём большее (окно «Полка» 12.11 уходило под кнопки). */
  --safe-top: max(env(safe-area-inset-top, 0px), var(--safe-area-inset-top, 0px));
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--safe-area-inset-bottom, 0px));

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Hebrew", Arial, sans-serif;
  color-scheme: light;
}

/* Тёмная тема: по системе (если в настройках не выбрана светлая) или вручную. */
:root[data-theme="dark"] {
  --late: #e7bf5a;
  --late-bg: #3a2f12;
  --bg: #151514;
  --surface: #1f1f1d;
  --surface-2: #2a2a27;
  --text: #edebe5;
  --muted: #a19e95;
  --border: #34332f;
  --accent: var(--accent-d, #3fb3a3);
  --accent-text: #0d1f1c;
  --accent-soft: color-mix(in srgb, var(--accent) 22%, #1f1f1d);
  --warm: #f2b56b;
  --ok: #5cc58d;
  --warn: #e5a75a;
  --danger: #f2827a;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 4px 16px rgb(0 0 0 / .25);
  --shadow-lift: 0 2px 8px rgb(0 0 0 / .4), 0 12px 32px rgb(0 0 0 / .45);
  --p3: #f0776c;
  --p2: #eda25a;
  --p1: #6f9cf0;
  --swipe-done: #2f9e63;
  --swipe-later: #3d74d6;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --late: #e7bf5a;
    --late-bg: #3a2f12;
    --bg: #151514;
    --surface: #1f1f1d;
    --surface-2: #2a2a27;
    --text: #edebe5;
    --muted: #a19e95;
    --border: #34332f;
    --accent: var(--accent-d, #3fb3a3);
    --accent-text: #0d1f1c;
    --accent-soft: color-mix(in srgb, var(--accent) 22%, #1f1f1d);
    --warm: #f2b56b;
    --ok: #5cc58d;
    --warn: #e5a75a;
    --danger: #f2827a;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 4px 16px rgb(0 0 0 / .25);
    --shadow-lift: 0 2px 8px rgb(0 0 0 / .4), 0 12px 32px rgb(0 0 0 / .45);
    --p3: #f0776c;
    --p2: #eda25a;
    --p1: #6f9cf0;
    --swipe-done: #2f9e63;
    --swipe-later: #3d74d6;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font: calc(16px * var(--fs, 1))/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
body.detail-open { overflow: hidden; }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; user-select: none; }

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
img { display: block; }
[hidden] { display: none !important; }
a { color: var(--accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

svg { flex: none; }

/* ---------- Заставка и центральные экраны ---------- */

.splash, .center-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: calc(24px + var(--safe-top)) 24px calc(24px + var(--safe-bottom));
}
.splash img { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; transform: scale(.96); } }
@media (prefers-reduced-motion: reduce) { .splash img { animation: none; } }

.login {
  width: min(380px, 100%);
  text-align: center;
  display: grid;
  gap: 20px;
  justify-items: center;
}
.login h1 { margin: 0; font-size: calc(34px * var(--fs, 1)); letter-spacing: -.02em; }
.login .he { color: var(--muted); font-size: calc(20px * var(--fs, 1)); margin-top: -14px; }
.login p { margin: 0; color: var(--muted); }
.login .error { color: var(--danger); }

/* ---------- Кнопки ---------- */

.btn {
  min-height: var(--tap);
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 550;
  white-space: nowrap;
  text-decoration: none;
  color: var(--text);
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--danger); }
.btn.big { min-height: 52px; padding: 0 24px; font-size: calc(17px * var(--fs, 1)); width: 100%; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: calc(14px * var(--fs, 1)); }
.btn:disabled { opacity: .6; }
.btn svg { width: 18px; height: 18px; }
.btn.big svg { width: 20px; height: 20px; }

.icon-btn {
  width: var(--tap); height: var(--tap);
  display: inline-grid; place-items: center;
  border: 0; background: transparent; border-radius: 999px;
  padding: 0; color: inherit; flex: none;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn.small { width: 36px; height: 36px; }
.icon-btn.small svg { width: 18px; height: 18px; }
.icon-btn.danger { color: var(--danger); }
.icon-btn.on { color: var(--warm); }
@media (pointer: coarse) { .icon-btn.small { width: 44px; height: 44px; } }

/* ---------- Оболочка ---------- */

.shell {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  position: sticky; top: 0; z-index: 10;
  height: calc(var(--header-h) + var(--safe-top));
  padding: var(--safe-top) 6px 0 8px;
  display: flex; align-items: center; gap: 4px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar h1 {
  margin: 0 4px 0 6px; font-size: calc(20px * var(--fs, 1)); font-weight: 650; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: start;
}
.top-actions { display: flex; align-items: center; }

.sync-pill {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 28px; padding: 0 10px; border-radius: 999px;
  font-size: calc(13px * var(--fs, 1)); color: var(--muted); background: var(--surface-2); white-space: nowrap;
}
.sync-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.sync-pill[data-state="synced"] { color: var(--ok); }
.sync-pill[data-state="pending"] { color: var(--warn); }
.sync-pill[data-state="offline"] { color: var(--muted); }
.sync-pill[data-state="error"] { color: var(--danger); }
/* На узком экране «синхронизировано» и «отправка» — только точкой (текст — в подсказке). */
@media (max-width: 520px) {
  .sync-pill[data-state="synced"], .sync-pill[data-state="pending"] { font-size: 0; gap: 0; padding: 0 10px; background: transparent; }
}
/* Шапка никогда не шире экрана: подпись сжимается с многоточием. */
.sync-pill { min-width: 0; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; }
.topbar { min-width: 0; max-width: 100%; }
.topbar > .icon-btn, .top-actions { flex: none; }
@media (max-width: 420px) { .members-btn .person-av:nth-child(n+3) { display: none; } }

.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  object-fit: cover; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-weight: 650; font-size: calc(15px * var(--fs, 1));
}

.main:focus { outline: none; }
.main {
  padding: 16px 16px calc(var(--nav-h) + var(--safe-bottom) + 24px);
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  min-width: 0;
}
.main.wide { max-width: none; padding: 0; }

/* Нижняя панель (телефон) */
.nav {
  position: fixed; inset: auto 0 0 0; z-index: 10;
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; height: var(--nav-h); }
.tabs a {
  display: grid; justify-items: center; align-content: center; gap: 2px;
  color: var(--muted); text-decoration: none; font-size: calc(11.5px * var(--fs, 1)); font-weight: 550;
  min-height: var(--tap); border-radius: 12px;
}
.tabs a svg { width: 24px; height: 24px; }
/* Шесть вкладок на 360 px с крупным текстом: подпись мельчает по ширине экрана, а не вылезает за край. */
.tabs a { min-width: 0; padding-inline: 1px; }
.tabs a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: calc(min(calc(11.5px * var(--fs, 1)), 2.85vw) * var(--tab-k, 1)); letter-spacing: -.01em; }
.tabs a[aria-current="page"] { color: var(--accent); }
.nav .brand, .nav-extra { display: none; }

/* Компьютер: навигация и списки слева */
@media (min-width: 900px) {
  .shell { grid-template-columns: var(--side-w) minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .topbar { grid-column: 2; padding-left: 20px; padding-right: 12px; }
  .main { grid-column: 2; padding: 24px 32px 48px; }
  .main.wide { padding: 0; }
  .drawer-btn { display: none; }
  .nav {
    position: sticky; top: 0; grid-row: 1 / span 2; grid-column: 1;
    height: 100dvh; padding: 10px 10px 16px;
    display: flex; flex-direction: column; gap: 4px;
    border-top: 0; border-right: 1px solid var(--border);
    background: var(--bg); overflow: hidden;
  }
  .nav .brand {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 10px 10px; font-weight: 700; font-size: calc(18px * var(--fs, 1)); color: var(--text);
  }
  .nav .brand img { width: 28px; height: 28px; }
  .tabs { height: auto; gap: 2px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
  .tabs { display: flex; justify-content: space-between; }
  .tabs a { flex: 1; padding: 0; }
  .tabs a span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .tabs a svg { width: 20px; height: 20px; }
  .tabs a:hover { background: var(--surface-2); }
  .tabs a[aria-current="page"] { background: var(--accent-soft); }
  .nav-extra { display: block; flex: 1; overflow-y: auto; margin: 0 -10px; padding: 6px 10px 0; scrollbar-width: thin; }
}

/* ---------- Выдвижная панель (телефон) ---------- */

.drawer { position: fixed; inset: 0; z-index: 35; }
.drawer-backdrop { position: absolute; inset: 0; background: rgb(0 0 0 / .4); opacity: 0; transition: opacity .2s; }
.drawer-sheet {
  position: absolute; inset: 0 auto 0 0; width: min(330px, 86vw);
  background: var(--bg); box-shadow: var(--shadow-lift);
  transform: translateX(-100%); transition: transform .2s ease;
  display: flex; flex-direction: column;
  padding-top: var(--safe-top); padding-bottom: var(--safe-bottom);
}
.drawer.open .drawer-backdrop { opacity: 1; }
.drawer.open .drawer-sheet { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 6px 4px 12px; }
.drawer-head .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: calc(18px * var(--fs, 1)); }
.drawer-head .brand img { width: 28px; height: 28px; }
.drawer-panel { flex: 1; overflow-y: auto; padding: 0 10px 16px; }
@media (prefers-reduced-motion: reduce) { .drawer-sheet, .drawer-backdrop { transition: none; } }

/* ---------- Боковое меню задач ---------- */

.sidebar { display: grid; gap: 10px; }
.side-group { display: grid; gap: 1px; }
.side-group + .side-group { padding-top: 8px; border-top: 1px solid var(--border); }
.side-pins { display: grid; grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); gap: 4px; padding: 6px 6px 2px; }
.side-pin {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-height: 64px; padding: 8px 4px 6px; border-radius: 12px; color: var(--text); text-decoration: none;
}
.side-pin:hover { background: var(--surface-2); }
.side-pin[aria-current='page'] { background: var(--accent-soft); }
.side-pin-icon {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px;
  background: color-mix(in srgb, var(--dot, var(--accent)) 18%, transparent); color: var(--dot, var(--accent));
  font-size: calc(17px * var(--fs, 1)); font-weight: 650;
}
.side-pin-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: calc(12px * var(--fs, 1)); }
.side-pin-count { position: absolute; top: 4px; right: 6px; color: var(--muted); font-size: calc(11px * var(--fs, 1)); }
.side-item {
  display: flex; align-items: center; gap: 12px;
  min-height: var(--tap); padding: 0 10px; border-radius: 10px;
  color: var(--text); text-decoration: none; font-size: calc(15px * var(--fs, 1));
}
@media (min-width: 900px) and (pointer: fine) { .side-item { min-height: 38px; } }
.side-item.side-sub { padding-inline-start: 34px; }
.side-item:hover { background: var(--surface-2); }
.side-item[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side-item svg { width: 20px; height: 20px; color: var(--muted); }
.side-item[aria-current="page"] svg { color: var(--accent); }
.side-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: start; }
.side-count { color: var(--muted); font-size: calc(13px * var(--fs, 1)); font-variant-numeric: tabular-nums; }
.side-emoji { width: 20px; text-align: center; font-size: calc(17px * var(--fs, 1)); line-height: 1; flex: none; }
.side-dot { width: 20px; height: 20px; display: grid; place-items: center; flex: none; }
.side-dot::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--dot, var(--muted)); }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 4px; min-height: 36px; }
.side-head-toggle, .side-folder-toggle {
  display: flex; align-items: center; gap: 6px; border: 0; background: transparent;
  min-height: 36px; padding: 0 6px; border-radius: 8px; color: var(--muted);
  font-size: calc(13px * var(--fs, 1)); font-weight: 650; text-transform: uppercase; letter-spacing: .04em;
}
.side-head-toggle:hover, .side-folder-toggle:hover { background: var(--surface-2); }
.side-tools { display: flex; }
.chev { display: inline-grid; transition: transform .15s; }
.chev svg { width: 16px; height: 16px; }
[aria-expanded="true"] > .chev { transform: rotate(90deg); }
.side-folder-head { display: flex; align-items: center; }
.side-folder-toggle {
  flex: 1; min-width: 0; text-transform: none; letter-spacing: 0; font-size: calc(15px * var(--fs, 1)); font-weight: 550;
  color: var(--text); min-height: var(--tap); padding: 0 10px; gap: 12px; border-radius: 10px;
}
.side-folder-toggle svg { width: 20px; height: 20px; color: var(--muted); }
.side-folder-body { padding-left: 14px; display: grid; gap: 1px; }
.side-empty { color: var(--muted); font-size: calc(13.5px * var(--fs, 1)); padding: 6px 10px; }

/* Колонка раздела на компьютере (сессия 33, views/side-nav.js): та же «одежда», что у меню задач. */
.side-desk { display: flex; flex-direction: column; min-height: 100%; gap: 10px; }
.side-desk-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; align-content: start; }
.side-desk .side-version { margin-top: auto; }
.side-desk .side-group { grid-template-columns: minmax(0, 1fr); }
/* В колонке разделов подпись не обрезается — переносится (правило Алексея: надписи не режем). */
.side-desk .side-label { white-space: normal; overflow-wrap: anywhere; line-height: 1.25; padding-block: 4px; }
.side-title { padding: 0 6px; color: var(--muted); font-size: calc(13px * var(--fs, 1)); font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
button.side-item { width: 100%; border: 0; background: transparent; font: inherit; cursor: pointer; text-align: start; }
.side-item .ico-tile, .side-item > svg { flex: none; }
.side-item.side-muted { color: var(--muted); }
.side-item.side-muted svg { color: var(--muted); }
.side-note { margin: 0; padding: 4px 10px 8px; color: var(--muted); font-size: calc(13px * var(--fs, 1)); line-height: 1.4; }
.side-date { padding: 4px 10px 2px; }
.side-date strong { display: block; font-size: calc(17px * var(--fs, 1)); }
.side-date small { color: var(--muted); font-size: calc(13px * var(--fs, 1)); }

/* ---------- Меню ---------- */

.menu {
  position: fixed; z-index: 71;
  top: calc(var(--header-h) + var(--safe-top) - 4px); right: 8px;
  min-width: 220px; max-width: min(340px, calc(100vw - 16px));
  max-height: calc(100dvh - 24px - var(--safe-top) - var(--safe-bottom)); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lift);
  padding: 6px;
}
.menu button {
  width: 100%; min-height: var(--tap); text-align: start;
  border: 0; background: transparent; border-radius: 8px; padding: 0 12px;
  display: flex; align-items: center; gap: 10px;
}
.menu button span { flex: 1; }
/* «Переместить в» (15.11): галочка и значок — узкие колонки, название забирает остальное и переносится словами. */
.menu button .menu-check, .menu button .menu-emoji { flex: 0 0 auto; }
.menu button .menu-emoji { min-width: 1.4em; text-align: center; line-height: 1; }
.menu button .menu-label { flex: 1 1 auto; min-width: 0; overflow-wrap: break-word; padding-block: 6px; }
.menu button small { color: var(--muted); font-size: calc(12.5px * var(--fs, 1)); }
.menu button svg { width: 18px; height: 18px; color: var(--muted); }
.menu button:hover, .menu button:focus-visible { background: var(--surface-2); }
.menu button.danger, .menu button.danger svg { color: var(--danger); }
.menu .menu-check { width: 18px; text-align: center; color: var(--accent); font-weight: 700; }
.menu .menu-header { padding: 6px 12px 2px; color: var(--muted); font-size: calc(13px * var(--fs, 1)); overflow-wrap: anywhere; }
.menu .menu-header:first-child { color: var(--text); font-weight: 650; font-size: calc(15px * var(--fs, 1)); }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
.menu .menu-search { width: 100%; min-height: 40px; margin: 0 0 6px; position: sticky; top: -6px; z-index: 1; }
.backdrop { position: fixed; inset: 0; z-index: 70; }

/* ---------- Диалоги ---------- */

.dlg {
  border: 0; padding: 0; background: transparent; color: var(--text);
  width: min(480px, calc(100vw - 32px)); max-width: none; max-height: none;
}
.dlg::backdrop { background: rgb(0 0 0 / .42); }
.dlg-box {
  background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lift);
  display: flex; flex-direction: column; max-height: calc(100dvh - 48px);
}
.dlg-head { display: flex; align-items: center; gap: 8px; padding: 8px 8px 0 20px; }
.dlg-head h2 { flex: 1; margin: 0; font-size: calc(18px * var(--fs, 1)); }
.dlg-body { padding: 8px 20px 16px; overflow-y: auto; min-height: 0; } /* без min-height: 0 высокое содержимое выталкивает кнопки за экран */
.dlg-text { margin: 4px 0 0; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px 16px; border-top: 1px solid var(--border); flex-wrap: wrap; }
@media (max-width: 599px) {
  .dlg { width: 100vw; margin: auto 0 0; }
  .dlg-box { border-radius: 18px 18px 0 0; max-height: 92dvh; padding-bottom: var(--safe-bottom); }
  .dlg-actions .btn { flex: 1; }
}

.list-editor { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; } /* не шире экрана на 360 ×1,35 (12.11) */
.emoji-own { gap: 10px; margin-top: 4px; }
.emoji-input { max-width: 90px; text-align: center; font-size: calc(20px * var(--fs, 1)); }
.date-picker { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
/* Крупный шрифт на 360 px: «Время [поле] Без времени» не помещается — кнопка уходит строкой ниже, окно не шире экрана (12.11). */
.date-picker .row.wrap .input { min-width: 8em; }
.date-preview { margin: 0; }
/* Месяц в окне даты (как «Когда выполнить» в TickTick): числа, под ними — еврейская дата */
.cal-head { display: flex; align-items: center; gap: 2px; }
.cal-title { flex: 1; min-width: 0; display: flex; flex-direction: column; font-weight: 650; }
.cal-title small { color: var(--muted); font-weight: 400; font-size: calc(12px * var(--fs, 1)); }
.cal-today { font-size: calc(15px * var(--fs, 1)); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.cal-wd { text-align: center; color: var(--muted); font-size: calc(12px * var(--fs, 1)); padding: 2px 0 4px; }
.cal-day {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 44px; border-radius: 10px; color: var(--text); font-size: calc(15px * var(--fs, 1)); line-height: 1.1;
  border: 0; background: none; padding: 0; font-family: inherit; cursor: pointer;
}
.cal-day small { color: var(--muted); font-size: calc(10px * var(--fs, 1)); white-space: nowrap; overflow: hidden; max-width: 100%; }
.cal-day:hover { background: var(--surface-2); }
.cal-day.out { opacity: .45; }
.cal-day.past:not(.on) span { color: var(--muted); }
.cal-day.today span { color: var(--accent); font-weight: 700; }
.cal-day.on { background: var(--accent); color: var(--accent-text); }
.cal-day.on span, .cal-day.on small { color: inherit; }

/* Чипы и образцы */
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); font-size: calc(14px * var(--fs, 1)); color: var(--text);
  max-width: 100%;
}
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip small { color: var(--muted); }
.chip svg { width: 16px; height: 16px; color: var(--muted); }
.chip:hover { background: var(--surface-2); }
.chip.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.chip.on svg { color: currentColor; }
.chip.prio-3 { color: var(--p3); border-color: var(--p3); background: color-mix(in srgb, var(--p3) 10%, var(--surface)); }
.chip.prio-2 { color: var(--p2); border-color: var(--p2); background: color-mix(in srgb, var(--p2) 10%, var(--surface)); }
.chip.prio-1 { color: var(--p1); border-color: var(--p1); background: color-mix(in srgb, var(--p1) 10%, var(--surface)); }
@media (pointer: coarse) { .chip { min-height: 40px; } }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  width: 36px; height: 36px; border-radius: 50%; padding: 0;
  border: 2px solid var(--surface); background: var(--sw, var(--surface-2));
  box-shadow: 0 0 0 1px var(--border);
}
.swatch[aria-checked="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.swatch.none { background: linear-gradient(135deg, transparent 46%, var(--muted) 46%, var(--muted) 54%, transparent 54%), var(--surface); }
.swatch.emoji { width: 40px; height: 40px; border-radius: 10px; font-size: calc(20px * var(--fs, 1)); line-height: 1; background: var(--surface-2); color: var(--muted); }
.swatch.bg-swatch { width: 52px; height: 36px; border-radius: 10px; }
@media (pointer: coarse) { .swatch { width: 40px; height: 40px; } .swatch.emoji { width: 44px; height: 44px; } }

/* Фоны списков */
.bg-mint { --bg-a: #3fb3a3; --bg-b: #a6e3b8; }
.bg-sky { --bg-a: #4a90e2; --bg-b: #9fd3f5; }
.bg-sunset { --bg-a: #f08a5d; --bg-b: #f6c36b; }
.bg-lavender { --bg-a: #9b7be0; --bg-b: #e3a6d8; }
.bg-sand { --bg-a: #d8b47a; --bg-b: #efe0b9; }
.bg-sea { --bg-a: #1f7a8c; --bg-b: #4fc1c9; }
.bg-night { --bg-a: #2b3a67; --bg-b: #6b5b95; }
.bg-swatch[class*="bg-"]:not(.none) { background: linear-gradient(135deg, var(--bg-a), var(--bg-b)); }
.task-pane[class*="bg-"] {
  background:
    linear-gradient(170deg,
      color-mix(in srgb, var(--bg-a) 32%, var(--bg)) 0,
      color-mix(in srgb, var(--bg-b) 16%, var(--bg)) 280px,
      var(--bg) 560px);
}

/* ---------- Карточки и поля ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}
.card h2 { margin: 0 0 4px; font-size: calc(18px * var(--fs, 1)); }
.card .sub { margin: 0 0 14px; color: var(--muted); font-size: calc(14px * var(--fs, 1)); }

.field { display: grid; gap: 6px; }
.field label { font-size: calc(14px * var(--fs, 1)); color: var(--muted); }
.input {
  width: 100%; min-height: var(--tap);
  padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg);
}
.input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
select.input { appearance: auto; }
.row { display: flex; gap: 8px; align-items: center; }
.row .input { flex: 1; min-width: 0; }
.hint { color: var(--muted); font-size: calc(13.5px * var(--fs, 1)); margin: 8px 0 0; }

.placeholder {
  text-align: center; padding: 48px 16px; color: var(--muted);
  display: grid; justify-items: center; gap: 10px;
}
.placeholder svg { width: 48px; height: 48px; color: var(--accent); opacity: .85; }
.placeholder h2 { margin: 0; color: var(--text); font-size: calc(22px * var(--fs, 1)); }
.placeholder p { margin: 0; max-width: 34ch; }
/* Раздел впереди по этапам (views/soon.js): что уже можно и что появится. */
.soon { padding-bottom: 32px; }
.soon h3 { margin: 18px 0 8px; color: var(--muted); font-size: calc(12.5px * var(--fs, 1)); font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.soon-now, .soon-next { width: min(520px, 100%); text-align: start; }
.soon-card { display: flex; align-items: center; gap: 14px; padding: 12px 14px; margin-bottom: 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; }
.soon-card:hover { border-color: var(--accent); }
.soon .soon-card svg { width: 24px; height: 24px; flex: none; opacity: 1; }
.soon-card strong { display: block; }
.soon-card small { display: block; color: var(--muted); font-size: calc(13px * var(--fs, 1)); line-height: 1.35; }
.soon-next ul { margin: 0; padding-inline-start: 20px; color: var(--muted); line-height: 1.6; }
.stage-badge {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-size: calc(13px * var(--fs, 1)); font-weight: 600;
}

/* ---------- Экран задач ---------- */

.tasks-view { display: grid; grid-template-columns: minmax(0, 1fr); min-height: calc(100dvh - var(--header-h) - var(--safe-top)); }
.task-pane {
  padding: 10px 10px calc(var(--nav-h) + var(--safe-bottom) + 96px);
  min-width: 0;
}
.task-pane > * { max-width: 840px; margin-left: auto; margin-right: auto; }
@media (min-width: 900px) {
  .tasks-view.has-detail { grid-template-columns: minmax(0, 1fr) var(--detail-w); }
  .task-pane { padding: 18px 28px 64px; }
}
@media (min-width: 1400px) { :root { --detail-w: 480px; } }

.pane-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 4px 4px 10px; }
.pane-sub { margin: 0; color: var(--muted); font-size: calc(15px * var(--fs, 1)); flex: 1; }
.search-input { flex: 1; font-size: calc(17px * var(--fs, 1)); background: var(--surface); }
.inline-add { margin-bottom: 14px; }

/* Группы */
.task-groups { position: relative; display: grid; gap: 14px; }
.task-group { min-width: 0; }
.group-head {
  display: flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 2px 2px 4px;
}
.group-toggle, .group-label {
  display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0;
  border: 0; background: transparent; padding: 0 4px; min-height: 40px; border-radius: 8px;
  font-weight: 650; font-size: calc(15px * var(--fs, 1)); text-align: start; color: var(--text);
}
.group-toggle:hover { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.group-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-count { color: var(--muted); font-weight: 500; font-size: calc(13.5px * var(--fs, 1)); }
.group-tools { display: flex; align-items: center; gap: 2px; }
.kind-overdue .group-title { color: var(--late); }
.kind-completed .group-title { color: var(--muted); }
.kind-day .group-head { min-height: 36px; }

.task-rows {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
}
.task-rows:empty { display: none; }
.kind-day .task-rows:empty { display: block; min-height: 0; border-style: dashed; background: transparent; }
.kind-day .task-rows:empty::after { content: "—"; display: block; color: var(--muted); padding: 8px 16px; font-size: calc(14px * var(--fs, 1)); }

/* Строка задачи */
.task-row {
  position: relative; outline-offset: -2px;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  touch-action: pan-y;
}
.task-row + .task-row { border-top: 1px solid var(--border); }
.task-row.striped .task-row-inner::before { content: ''; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: var(--lc); }
.task-row.striped.done .task-row-inner::before { opacity: .45; }
.task-row-inner {
  position: relative; z-index: 1;
  display: flex; align-items: flex-start; gap: 4px;
  min-height: 52px; padding: 4px 10px 4px calc(2px + var(--depth, 0) * 22px);
  background: var(--surface); cursor: default;
}
@media (hover: hover) { .task-row:hover .task-row-inner { background: color-mix(in srgb, var(--surface-2) 45%, var(--surface)); } }
.task-row.selected .task-row-inner { background: var(--accent-soft); }
.task-main { flex: 1; min-width: 0; padding: 10px 0 9px 2px; cursor: pointer; }
.task-title { overflow-wrap: anywhere; text-align: start; }
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 3px; font-size: calc(13px * var(--fs, 1)); color: var(--muted); }
.task-meta > span { display: inline-flex; align-items: center; gap: 3px; min-width: 0; }
.task-meta svg { width: 14px; height: 14px; }
.meta-deadline.late { color: var(--danger); font-weight: 550; }
.meta-due.late { color: var(--late); background: var(--late-bg); border-radius: 6px; padding: 0 5px; font-weight: 550; }
:root.late-red { --late: var(--danger); --late-bg: transparent; }
:root.late-red .meta-due.late { padding: 0; }
.meta-due.today { color: var(--accent); font-weight: 550; }
.meta-icon.myday { color: var(--warm); }
.meta-tag { color: var(--tag, var(--muted)); }
.meta-list::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--dot, var(--border)); margin-right: 2px; }
.meta-list, .meta-parent { max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block !important; }
.row-tools { display: flex; align-items: center; padding-top: 4px; }

.task-row.done .task-title { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }
.task-row.completing .task-title { color: var(--muted); text-decoration: line-through; transition: color .2s; }
.task-row.completing .check svg { background: var(--ok); border-color: var(--ok); color: #fff; }

/* Кружок «выполнено». Сама кнопка 44×44, видимый кружок — 22px. */
.check {
  --prio: color-mix(in srgb, var(--muted) 75%, transparent);
  width: var(--tap); height: var(--tap); padding: 0; border: 0; background: transparent;
  display: grid; place-items: center; flex: none; color: transparent; border-radius: 50%;
  margin-top: 4px;
}
.check svg {
  width: 22px; height: 22px; padding: 3px; border-radius: 50%;
  border: 2px solid var(--prio); stroke-width: 3; transition: background .15s, color .15s;
}
.check.prio-3 { --prio: var(--p3); }
.check.prio-2 { --prio: var(--p2); }
.check.prio-1 { --prio: var(--p1); }
.check.prio-3 svg, .check.prio-2 svg, .check.prio-1 svg { background: color-mix(in srgb, var(--prio) 10%, transparent); }
@media (hover: hover) { .check:hover svg { color: var(--prio); } }
.check.on svg { background: var(--prio); color: var(--surface); }
/* Прогресс (вручную или по чек-листу) — сектор внутри кружка, как в TickTick. */
.check.prog:not(.on) svg { background: conic-gradient(color-mix(in srgb, var(--prio) 55%, transparent) var(--p), transparent 0); }
.check:not([class*="prio-"]).on svg, .check.prio-0.on svg { background: var(--muted); border-color: var(--muted); }
.check.wontdo svg { background: var(--surface-2); color: var(--muted); border-style: dashed; }
.check.big { margin-top: 2px; }
.check.big svg { width: 26px; height: 26px; }
.check.small { margin-top: 0; }
.check.small svg { width: 20px; height: 20px; border-radius: 6px; }
.check:disabled { opacity: .5; }

.subtask-toggle, .subtask-toggle-space { width: 22px; flex: none; }
.subtask-toggle {
  height: var(--tap); margin-top: 4px; border: 0; background: transparent; padding: 0;
  display: grid; place-items: center; color: var(--muted); border-radius: 6px;
}
.subtask-toggle svg { width: 16px; height: 16px; transition: transform .15s; }
.subtask-toggle.open svg { transform: rotate(90deg); }
.task-row[data-depth="0"] .subtask-toggle-space { width: 4px; }

/* Свайпы */
.swipe-bg {
  position: absolute; inset: 0; display: none; align-items: center; gap: 10px;
  padding: 0 22px; color: #fff; background: var(--swipe, var(--muted)); font-size: .9em; font-weight: 600;
}
.swipe-bg svg { width: 24px; height: 24px; transition: transform .15s; }
.task-row.swiping .swipe-bg { display: flex; }
.task-row.swipe-left .swipe-bg { flex-direction: row-reverse; }
.task-row.swiping:not(.swipe-ready) .swipe-bg { opacity: .55; }
.task-row.swipe-ready .swipe-bg svg { transform: scale(1.25); }

/* Разделы */
.section-head { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: pan-y; }
.section-head .group-toggle { cursor: grab; }
.section-empty { padding: 6px 16px 10px 44px; font-size: calc(13px * var(--fs, 1)); }
.add-section {
  display: flex; align-items: center; gap: 8px; min-height: var(--tap); margin: 6px 4px 10px;
  padding: 0 12px; border: 1px dashed var(--border); border-radius: 10px; background: transparent;
  color: var(--muted); width: calc(100% - 8px); text-align: start;
}
.add-section:hover { color: var(--accent); border-color: var(--accent); }
.add-section svg { width: 18px; height: 18px; }
.task-group.dragging-section { position: relative; z-index: 6; background: var(--surface); box-shadow: var(--shadow-lift); border-radius: 10px; opacity: .95; }
.task-group.dragging-section > .task-rows { display: none; }
.section-marker { height: 3px; }

/* Перетаскивание */
.task-row.drop-into .task-row-inner { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); border-radius: 10px; }
.task-row.dragging { z-index: 5; }
.task-row.dragging .task-row-inner { box-shadow: var(--shadow-lift); border-radius: 10px; background: var(--surface); }
.drag-hidden { display: none; }
.drop-marker {
  position: absolute; top: 0; left: 0; right: 12px; height: 3px; border-radius: 2px;
  background: var(--accent); pointer-events: none; z-index: 6;
}
.drop-marker::before { content: ""; position: absolute; left: -4px; top: -3px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }

.empty-state { text-align: center; color: var(--muted); padding: 40px 16px 24px; }
.empty-state p { margin: 0 auto 14px; max-width: 36ch; }
.empty-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 44ch; margin: 0 auto; }
.empty-acts .btn { max-width: 100%; white-space: normal; }
.empty-acts .empty-hint { flex-basis: 100%; margin: 6px auto 0; font-size: calc(13px * var(--fs, 1)); }

.trash-list .side-emoji { margin: 14px 8px 0 4px; }

/* Подсказки «Моего дня» */
.suggestions {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 8px 8px 14px; margin-bottom: 14px; display: grid; gap: 10px;
}
.suggestions-head { display: grid; gap: 2px; }
.suggestions-head .hint { margin: 0; }
.sugg-group { display: grid; gap: 0; }
.sugg-title { font-size: calc(13px * var(--fs, 1)); font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding: 4px 0; }
.sugg-row { display: flex; align-items: center; gap: 4px; margin-left: -8px; }
.sugg-text {
  flex: 1; min-width: 0; display: grid; text-align: start; border: 0; background: transparent;
  padding: 6px 4px; border-radius: 8px; min-height: var(--tap);
}
.sugg-text:hover { background: var(--surface-2); }
.sugg-text small { color: var(--muted); font-size: calc(12.5px * var(--fs, 1)); }

/* ---------- Быстрый ввод ---------- */

.quick-add {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 4px 6px 8px 14px; box-shadow: var(--shadow);
}
.quick-add:focus-within { border-color: var(--accent); }
.qa-line { display: flex; align-items: center; gap: 6px; }
.qa-input {
  flex: 1; min-width: 0; border: 0; background: transparent; min-height: 48px; font-size: calc(16.5px * var(--fs, 1)); padding: 0;
}
.qa-input:focus { outline: none; }
.qa-send {
  width: 40px; height: 40px; flex: none; border-radius: 50%; border: 0;
  background: var(--accent); color: var(--accent-text); display: grid; place-items: center;
}
.qa-send svg { width: 22px; height: 22px; }
/* 🎤 голосом (сессия 29): рядом с «+», мигает, пока слушает. */
.qa-mic {
  position: relative; width: 44px; height: 44px; flex: none; border-radius: 50%; border: 0;
  background: transparent; color: var(--muted); display: grid; place-items: center; touch-action: manipulation;
}
.qa-mic[hidden] { display: none; }
.qa-mic svg { width: 22px; height: 22px; }
.qa-mic:hover { background: var(--surface-2); color: var(--text); }
.qa-mic.on { background: var(--accent); color: var(--accent-text); animation: qa-mic-pulse 1.1s ease-in-out infinite; }
/* Язык голоса (08.11): «РУ / עב / EN» перед 🎤, нажатие — следующий. Зона касания 44 × 44, видна плашка 26 px. */
.qa-lang {
  width: 44px; height: 44px; flex: none; border: 0; padding: 9px 2px; background: var(--surface-2); background-clip: content-box;
  border-radius: 13px / 50%; color: var(--text); font-size: 12.5px; font-weight: 700; line-height: 26px; letter-spacing: .02em;
  text-align: center; touch-action: manipulation; unicode-bidi: isolate;
}
.qa-lang[hidden] { display: none; }
.qa-lang:hover { color: var(--accent); }
.qa-lang[data-lang="he"], .qa-lang[data-lang="en"] { color: var(--accent); }
@keyframes qa-mic-pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 25%, transparent); } }
@media (prefers-reduced-motion: reduce) { .qa-mic.on { animation: none; } }
.qa-chips { padding-right: 6px; }
.qa-chips .chip[hidden] { display: none; }
/* «Поле ввода: Просто» — под строкой только то, что уже выбрано (срок из «*», приоритет из «!»…). */
.quick-add.simple .qa-chips .chip:not(.on) { display: none; }
.quick-add.simple .qa-chips:not(:has(.chip.on)) { display: none; }
.quick-add.simple { padding-bottom: 4px; }

.fab {
  position: fixed; right: 16px; bottom: calc(var(--nav-h) + var(--safe-bottom) + 16px); z-index: 12;
  width: 58px; height: 58px; border-radius: 18px; border: 0;
  background: var(--accent); color: var(--accent-text); box-shadow: var(--shadow-lift);
  display: grid; place-items: center;
}
.fab svg { width: 28px; height: 28px; }
@media (min-width: 900px) { .fab { display: none; } }

.sheet-backdrop, .qa-sheet { display: none; }
@media (max-width: 899px) {
  .sheet-backdrop { display: block; position: fixed; inset: 0; z-index: 44; background: rgb(0 0 0 / .35); opacity: 0; pointer-events: none; transition: opacity .18s; }
  .qa-sheet {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    padding: 10px 10px calc(10px + var(--safe-bottom));
    transform: translateY(110%); visibility: hidden; transition: transform .18s ease, visibility 0s .18s;
  }
  .qa-sheet .quick-add { box-shadow: var(--shadow-lift); }
  .sheet-open .sheet-backdrop { opacity: 1; pointer-events: auto; }
  .sheet-open .qa-sheet { transform: none; visibility: visible; transition: transform .18s ease; }
}

/* ---------- Карточка задачи ---------- */

.detail-wrap { display: none; min-width: 0; }
.has-detail .detail-wrap { display: block; }
@media (min-width: 900px) {
  .detail-wrap {
    position: sticky; top: calc(var(--header-h) + var(--safe-top));
    height: calc(100dvh - var(--header-h) - var(--safe-top)); overflow-y: auto;
    border-left: 1px solid var(--border); background: var(--surface);
  }
  .detail-head .icon-btn:first-child svg { transform: none; }
}
@media (max-width: 899px) {
  .has-detail .detail-wrap {
    position: fixed; inset: 0; z-index: 40; background: var(--surface); overflow-y: auto;
    overscroll-behavior: contain; animation: slide-in .18s ease;
  }
  @keyframes slide-in { from { transform: translateX(24px); opacity: .4; } }
}

.detail-head {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; gap: 2px;
  padding: calc(4px + var(--safe-top)) 6px 4px;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
@media (min-width: 900px) { .detail-head { padding-top: 4px; } }
.detail-head .spacer { flex: 1; }
.detail-crumb {
  border: 0; background: transparent; color: var(--muted); font-size: calc(14px * var(--fs, 1)); min-height: 36px;
  padding: 0 8px; border-radius: 8px; max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.detail-crumb:hover { background: var(--surface-2); color: var(--text); }
.detail-body { padding: 10px 16px calc(40px + var(--safe-bottom)); display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; } /* колонка не шире экрана: на 360 ×1,35 карточка уезжала вбок (12.11) */
@media (min-width: 900px) { .detail-body { padding: 14px 22px 48px; } }

.detail-title-row { display: flex; gap: 4px; align-items: flex-start; margin-left: -6px; }
.detail-title {
  flex: 1; min-width: 0; border: 0; background: transparent; resize: none; overflow: hidden;
  font-size: calc(21px * var(--fs, 1)); font-weight: 650; line-height: 1.35; padding: 10px 4px 6px; border-radius: 8px;
}
.detail-title:focus { outline: none; background: var(--bg); }
.is-done .detail-title { color: var(--muted); text-decoration: line-through; }

.props { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.prop {
  width: 100%; min-width: 0; display: grid; grid-template-columns: 20px minmax(0, 1fr); column-gap: 8px; align-items: center;
  text-align: start; min-height: 54px; padding: 6px 10px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
}
.prop svg { width: 18px; height: 18px; color: var(--muted); grid-row: span 2; }
.prop-label { font-size: calc(12px * var(--fs, 1)); color: var(--muted); min-width: 0; overflow-wrap: anywhere; }
.prop-value { font-size: calc(14.5px * var(--fs, 1)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prop:not(.set) .prop-value { color: var(--muted); }
.prop.set svg { color: var(--accent); }
.prop.late .prop-value, .prop.late svg { color: var(--danger); }
.prop.due-late .prop-value, .prop.due-late svg { color: var(--late); }
.prop.prio-3.set svg, .prop.prio-3.set .prop-value { color: var(--p3); }
.prop.prio-2.set svg, .prop.prio-2.set .prop-value { color: var(--p2); }
.prop.prio-1.set svg, .prop.prio-1.set .prop-value { color: var(--p1); }
.prop:hover:not(:disabled) { background: var(--surface-2); }
.prop:disabled { opacity: .7; }
.prop-wrap { position: relative; }
.prop-wrap .prop { padding-right: 34px; }
.prop-clear {
  position: absolute; top: 50%; right: 2px; transform: translateY(-50%);
  width: 36px; height: 44px; border: 0; background: transparent; color: var(--muted); border-radius: 8px;
  display: grid; place-items: center;
}
.prop-clear svg { width: 16px; height: 16px; }
.prop-clear:hover { color: var(--danger); }

.detail-section { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.detail-label { display: flex; align-items: center; gap: 6px; font-size: calc(13px * var(--fs, 1)); font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.detail-label svg { width: 16px; height: 16px; }
.detail-progress { margin-left: auto; font-weight: 500; text-transform: none; }

.detail-tags-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.detail-tags { display: contents; }
.tag-chip {
  display: inline-flex; align-items: center; gap: 2px; min-height: 32px; padding: 0 2px 0 10px;
  border-radius: 999px; font-size: calc(14px * var(--fs, 1));
  color: var(--tag, var(--text)); background: color-mix(in srgb, var(--tag, var(--muted)) 13%, var(--surface));
}
.tag-chip button { width: 30px; height: 30px; border: 0; background: transparent; border-radius: 50%; display: grid; place-items: center; color: inherit; padding: 0; }
.tag-chip button svg { width: 14px; height: 14px; }
.tag-input { border: 0; background: transparent; min-height: 36px; min-width: 120px; width: 0; flex: 1; padding: 0 6px; }
.tag-input:focus { outline: none; }
.tag-input::-webkit-calendar-picker-indicator { display: none !important; }

.notes-view {
  min-height: 48px; padding: 10px 12px; border-radius: 12px; background: var(--bg); cursor: text;
  overflow-wrap: anywhere;
}
.notes-view:hover { background: var(--surface-2); }
.readonly .notes-view { cursor: default; }
.placeholder-text { color: var(--muted); }
.notes-edit { min-height: 120px; resize: vertical; line-height: 1.5; }

.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 8px; }
.md ul, .md ol { margin: 0 0 8px; padding-inline-start: 22px; }
.md h3, .md h4, .md h5 { margin: 10px 0 6px; font-size: calc(16px * var(--fs, 1)); }
.md h3 { font-size: calc(18px * var(--fs, 1)); }
.md code { background: var(--surface-2); padding: 1px 5px; border-radius: 5px; font-size: .92em; }
.md .md-task { list-style: none; margin-inline-start: -18px; }
.md .md-box { color: var(--muted); }

.checklist { display: grid; }
.check-item { display: flex; align-items: center; gap: 2px; margin-left: -10px; }
.check-item .line-input { border-bottom-color: transparent; }
.check-item.done .line-input { color: var(--muted); text-decoration: line-through; }
.check-item .icon-btn { opacity: .6; }
.check-item .icon-btn:hover { opacity: 1; }
.line-input {
  flex: 1; min-width: 0; width: 100%; border: 0; border-bottom: 1px solid var(--border);
  background: transparent; min-height: var(--tap); padding: 0 6px;
}
.line-input:focus { outline: none; border-bottom-color: var(--accent); }
.line-input::placeholder { color: var(--muted); }

.subtasks { display: grid; }
.subtask { display: flex; align-items: center; gap: 2px; margin-left: -10px; border-bottom: 1px solid var(--border); }
.subtask-title {
  flex: 1; min-width: 0; text-align: start; border: 0; background: transparent;
  min-height: var(--tap); padding: 6px 4px; overflow-wrap: anywhere;
}
.subtask-title small { color: var(--muted); }
.subtask.done .subtask-title { color: var(--muted); text-decoration: line-through; }
.subtask .chev { color: var(--muted); padding-right: 4px; }

.detail-footer { color: var(--muted); font-size: calc(12.5px * var(--fs, 1)); padding-top: 6px; border-top: 1px solid var(--border); }
.trash-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--danger) 10%, var(--surface));
  color: var(--text); font-size: calc(14px * var(--fs, 1));
}
.trash-bar span { flex: 1; min-width: 160px; }

/* ---------- Фокус (пачка 5): полоса-таймер над нижними вкладками, пока идёт ---------- */
.focus-bar { position: fixed; z-index: 13; left: 12px; right: 84px; bottom: calc(var(--nav-h) + var(--safe-bottom) + 16px);
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 6px 8px; border-radius: 18px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow-lift); }
.focus-bar[hidden] { display: none; }
.focus-bar[data-mode="work"] { border-color: color-mix(in srgb, #e5484d 55%, var(--border)); }
.focus-bar[data-mode="break"] { border-color: color-mix(in srgb, #30a46c 55%, var(--border)); }
.fb-main { flex: 1 1 10em; display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 44px; padding: 2px 4px; border: 0; background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; }
.fb-ico { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; color: #fff; background: #e5484d; }
.focus-bar[data-mode="break"] .fb-ico { background: #30a46c; }
.fb-ico svg { width: 20px; height: 20px; }
.fb-text { display: flex; flex-direction: column; min-width: 0; }
.fb-text b { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.fb-clock bdi { font-size: 1.2em; }
.fb-mode { font-weight: 500; color: var(--muted); }
.fb-title { color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.fb-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-inline-start: auto; }
.fb-acts .btn { min-height: 44px; }
.fb-acts .fb-icon { width: 44px; padding: 0; justify-content: center; }
.fb-acts svg { width: 20px; height: 20px; }
/* Пока идёт фокус, последняя строка раздела не прячется под полосой: снизу — запас прокрутки. */
html.has-focus .main { padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 140px); }
@media (min-width: 900px) { .focus-bar { left: auto; right: 24px; bottom: 24px; width: min(460px, calc(100vw - 48px)); } }

/* ---------- Уведомления (toast) ---------- */

.toasts {
  position: fixed; z-index: 60; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 86px);
  display: grid; gap: 8px; width: min(440px, calc(100vw - 24px));
  pointer-events: none;
}
@media (min-width: 900px) { .toasts { bottom: 24px; } }
dialog > .toasts { bottom: calc(16px + var(--safe-bottom)); }
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 10px 10px 16px; min-height: 52px;
  background: var(--text); color: var(--bg);
  border-radius: 12px; box-shadow: var(--shadow);
}
.toast span { flex: 1; overflow-wrap: anywhere; }
.toast-apk { flex-wrap: wrap; }
.toast-apk span { flex-basis: 100%; }
.toast .btn { min-height: 36px; padding: 0 14px; background: transparent; color: inherit; border-color: color-mix(in srgb, var(--bg) 40%, transparent); }

/* ---------- Этап 3: люди, доступ, повторы, комментарии ---------- */
.person-av {
  width: var(--av-size, 24px); height: var(--av-size, 24px); flex: none;
  border-radius: 50%; object-fit: cover;
  display: inline-grid; place-items: center;
  font-size: calc(var(--av-size, 24px) * .46); font-weight: 650; line-height: 1;
  color: #fff; background: hsl(var(--av-hue, 170) 45% 42%);
  box-shadow: 0 0 0 2px var(--surface);
}
:root[data-theme="dark"] .person-av { background: hsl(var(--av-hue, 170) 40% 36%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .person-av { background: hsl(var(--av-hue, 170) 40% 36%); } }

.people { display: flex; flex-direction: column; gap: 12px; }
.dlg-people .dlg-box { max-width: 520px; }
.person-list { display: flex; flex-direction: column; gap: 2px; }
.person-row, .invite-row {
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 4px 0;
  border-bottom: 1px solid var(--border);
}
.person-row:last-child, .invite-row:last-child { border-bottom: 0; }
.person-main { flex: 1; min-width: 0; }
.person-main .hint { margin: 0; font-size: calc(12.5px * var(--fs, 1)); }
.person-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alias-input { width: 9.5em; flex: none; min-height: 36px; font-size: calc(14px * var(--fs, 1)); }
.household { display: flex; flex-direction: column; gap: 8px; }
.household + .household { border-top: 1px solid var(--border); padding-top: 12px; }
.household-head { display: flex; align-items: center; gap: 6px; }
.household-head h3 { margin: 0; font-size: calc(17px * var(--fs, 1)); }
.invite-list { background: var(--bg); border-radius: 12px; padding: 0 10px; }
.invite-row svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.invite-url { font-size: calc(13px * var(--fs, 1)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.wrap { flex-wrap: wrap; }

.side-shared { display: inline-flex; color: var(--muted); }
.side-shared svg { width: 15px; height: 15px; }

.row-assignees { display: flex; align-items: center; padding: 6px 4px 0 0; }
.row-assignees .person-av + .person-av { margin-inline-start: -8px; }
.group-label .person-av { margin-inline-end: 2px; }
.members-btn {
  display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 6px;
  border: 0; background: none; border-radius: 999px;
}
.members-btn .person-av + .person-av { margin-inline-start: -8px; }
.members-btn:hover { background: var(--surface-2); }
.row-tight { display: flex; align-items: center; gap: 2px; }
.prop-value .person-av { vertical-align: -5px; margin-inline-end: 4px; }

.mention-row { margin: 0 0 6px; }

/* Повтор и напоминания */
.repeat-picker { display: flex; flex-direction: column; gap: 10px; }
.menu-list { display: flex; flex-direction: column; }
.menu-item {
  display: flex; align-items: center; gap: 10px; min-height: var(--tap); padding: 0 10px;
  border: 0; border-radius: 10px; background: none; color: var(--text); font: inherit; text-align: start; cursor: pointer;
}
.menu-item:hover { background: var(--surface-2); }
.menu-item.on { color: var(--accent); font-weight: 600; }
.menu-item.on::after { content: '✓'; margin-inline-start: auto; }
.check-line input { width: 20px; height: 20px; accent-color: var(--accent); }
.num-input { max-width: 5.5em; flex: none !important; }
.repeat-picker input[type=time] { flex: none; min-width: 7.5em; }
.weekdays .chip { min-width: 44px; justify-content: center; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; align-self: flex-start; }
.seg-btn { min-height: 38px; padding: 0 14px; border: 0; background: var(--surface); color: var(--text); font: inherit; font-size: calc(14px * var(--fs, 1)); }
.seg-btn + .seg-btn { border-inline-start: 1px solid var(--border); }
.seg-btn.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* Комментарии */
.comments { display: flex; flex-direction: column; gap: 10px; }
.comment { display: flex; gap: 8px; align-items: flex-start; }
.comment-body { flex: 1; min-width: 0; background: var(--bg); border-radius: 12px; padding: 6px 10px; }
.comment.mine .comment-body { background: var(--accent-soft); }
.comment-head { display: flex; align-items: center; gap: 8px; font-size: calc(13px * var(--fs, 1)); }
.comment-head .hint { margin: 0; font-size: calc(12px * var(--fs, 1)); }
.comment-head .icon-btn { margin-inline-start: auto; width: 28px; height: 28px; }
.comment-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: calc(14.5px * var(--fs, 1)); }
.comment-add { display: flex; align-items: flex-end; gap: 6px; }
.comment-input { flex: 1; resize: none; min-height: 40px; max-height: 160px; }

/* Колокольчик и история уведомлений */
.bell-btn { position: relative; }
.bell-badge {
  position: absolute; top: 6px; inset-inline-end: 6px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 999px; background: var(--danger); color: #fff; font-size: calc(11px * var(--fs, 1)); font-weight: 700; line-height: 17px; text-align: center;
}
.notif-list { display: flex; flex-direction: column; }
.notif {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 6px; min-height: 56px;
  border: 0; border-bottom: 1px solid var(--border); background: none; color: var(--text); font: inherit; text-align: start; cursor: pointer;
}
.notif:last-child { border-bottom: 0; }
.notif:hover { background: var(--surface-2); }
.notif.unread .notif-title { font-weight: 650; }
.notif.unread::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 8px; flex: none; }
.notif-icon { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.notif-icon svg { width: 18px; height: 18px; }
.notif .hint { margin: 2px 0 0; font-size: calc(13px * var(--fs, 1)); }

/* Импорт */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
label.btn { cursor: pointer; align-self: flex-start; }
.import-steps { margin: 0; padding-inline-start: 20px; display: grid; gap: 6px; font-size: calc(14.5px * var(--fs, 1)); }
.import-stats { margin: 6px 0; padding-inline-start: 20px; font-size: calc(14.5px * var(--fs, 1)); }
.import-preview details { font-size: calc(14px * var(--fs, 1)); color: var(--muted); }

/* Настройки уведомлений */
.notif-status { background: var(--bg); border-radius: 14px; padding: 12px 14px; display: grid; gap: 8px; }
.notif-status .hint, .notif-status .error { margin: 0; }
.notif-status-head { display: flex; align-items: center; gap: 8px; }
.notif-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.notif-dot.on { background: var(--ok); }
.notif-type { display: flex; align-items: center; gap: 6px; }
.notif-type .menu-item { flex: 1; min-width: 0; }
.notif-type .btn.small svg { width: 16px; height: 16px; }
/* Иконка прямо в строке списка — всегда маленькая */
.person-row > svg { width: 20px; height: 20px; flex: none; color: var(--muted); }

/* Фото в задачах */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.photo-thumb {
  position: relative; aspect-ratio: 1; padding: 0; border: 0; border-radius: 10px; overflow: hidden;
  background: var(--surface-2); cursor: pointer;
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-thumb.uploading img { opacity: .55; }
.photo-progress {
  position: absolute; left: 8px; right: 8px; bottom: 8px; height: 4px; border-radius: 2px; background: rgb(255 255 255 / .6);
}
.photo-progress::after { content: ''; display: block; height: 100%; width: var(--p, 0%); border-radius: 2px; background: var(--accent); transition: width .2s; }
.photo-buttons { margin-top: 6px; }
.file-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.file-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.file-open { flex: 1 1 auto; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; min-width: 0; min-height: 44px;
  padding: 6px 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: inherit; font: inherit; text-align: start; cursor: pointer; }
.file-badge { display: grid; place-items: center; min-width: 40px; height: 32px; padding: 0 4px; border-radius: 8px; font-size: 11px; font-weight: 800;
  letter-spacing: .02em; color: #fff; background: #d0453a; }
.file-name { min-width: 0; overflow-wrap: anywhere; }
.file-size { color: var(--muted); white-space: nowrap; }
.file-row.uploading { opacity: .7; padding: 6px 10px; border: 1px dashed var(--border); border-radius: 12px; }
.photo-buttons .btn svg { width: 18px; height: 18px; }

/* Миниатюра в строке задачи */
.row-photo { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex: none; margin: 4px 4px 0 0; }

/* Просмотр фото */
.dlg-viewer { width: min(960px, calc(100vw - 16px)); }
.dlg-viewer .dlg-body { padding: 0 0 12px; }
.viewer { display: grid; gap: 8px; }
.viewer-stage { position: relative; background: #111; display: grid; place-items: center; min-height: 240px; touch-action: pan-y; }
.viewer-img { max-width: 100%; max-height: 72dvh; object-fit: contain; display: block; transition: filter .2s; }
.viewer-img.loading { filter: blur(2px); }
.viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgb(0 0 0 / .45); color: #fff; }
.viewer-nav.prev { left: 6px; }
.viewer-nav.next { right: 6px; }
.viewer-foot { display: flex; align-items: center; gap: 8px; padding: 0 16px; }
.viewer-caption { flex: 1; min-width: 0; font-size: calc(13.5px * var(--fs, 1)); color: var(--muted); }
@media (max-width: 599px) { .dlg-viewer { width: 100vw; } .viewer-img { max-height: 64dvh; } }
.done-sound .chip { min-height: 44px; }

/* Меню: ряды значков (дата, приоритет), вложенные меню */
.menu .menu-sub { padding: 6px 12px 2px; color: var(--muted); font-size: calc(12.5px * var(--fs, 1)); }
.menu .menu-icon-row { display: flex; gap: 2px; padding: 0 4px 2px; }
.menu .menu-icon-row .menu-icon { flex: 1; justify-content: center; padding: 0; min-width: var(--tap); }
.menu .menu-icon-row .menu-icon svg { width: 21px; height: 21px; color: var(--ic, var(--text)); }
.menu .menu-icon-row .menu-icon.on { background: var(--accent-soft); }
.menu .menu-more { flex: 0 0 auto !important; display: inline-flex; }
.menu .menu-more svg { width: 16px; height: 16px; }
.menu .menu-back { font-weight: 650; }
.menu button:disabled { opacity: .45; cursor: default; }

/* Действия с задачей: «⋯» при наведении (компьютер), долгое нажатие (телефон), перетаскивание в меню */
.row-more { flex: 0 0 auto; opacity: 0; transition: opacity .12s; }
.task-row:hover .row-more, .task-row:focus-within .row-more, .row-more[aria-expanded="true"] { opacity: 1; }
@media (pointer: coarse) { .row-more { display: none; } }
.task-row.held .task-row-inner { background: var(--surface-2); transform: scale(.985); transition: transform .12s, background .12s; }
.task-row.over-side .task-row-inner { opacity: .55; }
.side-item.drop-target { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.side-item.drop-target .side-label { color: var(--accent); font-weight: 650; }
.kind-pinned .group-title::before { content: "📌 "; }

/* Боковое меню: перетаскивание списков и папок */
.side-item, .side-folder-head { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.side-ghost { position: fixed; z-index: 90; pointer-events: none; background: var(--surface); box-shadow: var(--shadow-lift); border-radius: 10px; opacity: .95; }
.drag-src { opacity: .35; }
.side-item.drop-before, .side-folder-head.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.side-item.drop-after, .side-folder-head.drop-after { box-shadow: inset 0 -2px 0 var(--accent); }
.side-folder-head.drop-into { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); border-radius: 10px; }
.side-head.drop-top { box-shadow: inset 0 -2px 0 var(--accent); }

/* Окна-списки (полка, «Важное», плитки, разделы экрана): тело прокручивается, отступы как у обычного окна. Раньше они
   брали .dlg-settings (тело без отступов и без прокрутки) — нижние строки уходили под системные кнопки (Алексей 12.11). */
.dlg-list { width: min(560px, calc(100vw - 32px)); }
.dlg-list .dlg-body { padding-bottom: 20px; }

/* ---------- Настройки ---------- */
.dlg-settings { width: min(900px, calc(100vw - 32px)); }
/* На телефоне окно — шторка во всю ширину (своя ширина выше перебивала её: справа был просвет, скриншот 07.11). */
@media (max-width: 599px) { .dlg.dlg-settings, .dlg.dlg-widget, .dlg.dlg-viewer, .dlg.dlg-list { width: 100vw; } }
.dlg-settings .dlg-box { height: min(720px, calc(100dvh - 48px)); }
.dlg-settings .dlg-body { padding: 0; overflow: hidden; display: flex; flex: 1; min-height: 0; }
.settings { display: grid; grid-template-columns: 240px 1fr; flex: 1; min-height: 0; }
.set-nav { display: flex; flex-direction: column; gap: 2px; padding: 8px; border-inline-end: 1px solid var(--border); overflow-y: auto; }
.set-nav-item {
  display: flex; align-items: center; gap: 10px; min-height: var(--tap); padding: 6px 10px;
  border: 0; border-radius: 10px; background: none; color: var(--text); text-align: start;
}
.set-nav-item svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.set-nav-item:hover { background: var(--surface-2); }
.set-nav-item[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.set-nav-item[aria-current="page"] svg { color: var(--accent); }
.set-nav-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.set-nav-text small { color: var(--muted); font-size: calc(12.5px * var(--fs, 1)); font-weight: 400; }
.set-nav-item .chev svg { width: 16px; height: 16px; }
.set-page { padding: 4px 20px 20px; overflow-y: auto; min-width: 0; }
.set-title { margin: 12px 0 8px; font-size: calc(17px * var(--fs, 1)); }
.set-back { display: inline-flex; align-items: center; gap: 4px; min-height: var(--tap); margin: 2px 0 0 -8px; padding: 0 8px; border: 0; background: none; color: var(--accent); font-weight: 600; }
.set-back svg { width: 18px; height: 18px; }
.set-group { display: flex; flex-direction: column; padding: 4px 0 12px; }
.set-group + .set-group { border-top: 1px solid var(--border); padding-top: 12px; }
.set-group h4 { margin: 0 0 4px; font-size: calc(13px * var(--fs, 1)); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.set-group > .btn { align-self: flex-start; margin-top: 8px; }
.set-buttons { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 0; }
/* Кнопки в настройках переносят подпись, а не вылезают за край (крупный шрифт Android). */
.settings .btn { white-space: normal; max-width: 100%; text-align: start; padding-block: 6px; }
.set-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-height: 52px; padding: 6px 0; }
.set-row + .set-row { border-top: 1px solid var(--border); }
.set-row.stack { flex-direction: column; align-items: stretch; gap: 8px; }
.set-text { flex: 1 1 9em; min-width: 0; overflow-wrap: anywhere; }
/* Не хватает места рядом с названием — переключатель или выбор уходит строкой ниже, к правому краю. */
.set-row:not(.stack) > .set-text + * { margin-inline-start: auto; }
.set-label { font-weight: 500; }
.set-hint { color: var(--muted); font-size: calc(13px * var(--fs, 1)); margin: 0; }
.set-note { color: var(--muted); font-size: calc(13px * var(--fs, 1)); margin: 8px 0 0; }
.set-select { max-width: 100%; min-height: 44px; }
.set-row:not(.stack) .set-select { max-width: 52%; flex: none; }
.set-time { flex: none; width: 8.5em; min-height: 44px; }
/* Умный список: название и стрелки — первой строкой, выбор — второй, под названием (крупный шрифт Android:
   в одну строку название сжималось до «Сего,», «Завт|» — скриншот Алексея 07.11). */
.smart-row { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; grid-template-areas: "i l a" ". s s"; align-items: center; gap: 4px 12px; }
.smart-row > svg { grid-area: i; width: 20px; height: 20px; color: var(--muted); }
.smart-row > .set-text { grid-area: l; overflow-wrap: anywhere; }
.smart-row > .row-tight { grid-area: a; }
.smart-row > .set-select, .set-row.smart-row:not(.stack) .set-select { grid-area: s; justify-self: start; width: auto; max-width: 100%; margin-inline-start: 0; }
.rot-up, .rot-down { display: inline-flex; }
.rot-up svg { transform: rotate(-90deg); }
.rot-down svg { transform: rotate(90deg); }
.seg.wrap { flex-wrap: wrap; border-radius: 14px; align-self: stretch; }
.seg.wrap .seg-btn { flex: 1 1 auto; min-height: 44px; }
.seg.wrap .seg-btn + .seg-btn { border-inline-start: 1px solid var(--border); }

.switch {
  position: relative; flex: none; width: 52px; height: 32px; padding: 0; border: 0; border-radius: 999px;
  background: var(--border); transition: background .15s; margin: 6px 0;
}
.switch::before { content: ''; position: absolute; inset: -6px -2px; } /* зона касания 44px */
.switch-knob { position: absolute; top: 3px; inset-inline-start: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .25); transition: transform .15s; }
.switch.on { background: var(--accent); }
.switch.on .switch-knob { transform: translateX(20px); }
[dir="rtl"] .switch.on .switch-knob { transform: translateX(-20px); }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  width: 44px; height: 44px; border-radius: 50%; border: 0; padding: 0; display: grid; place-items: center; color: #fff;
  background: var(--sw-l);
}
:root[data-theme="dark"] .swatch { background: var(--sw-d); color: #111; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .swatch { background: var(--sw-d); color: #111; } }
.swatch.on { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--text); }
.swatch svg { width: 22px; height: 22px; stroke-width: 3; }

@media (max-width: 899px) {
  .dlg-settings .dlg-box { height: 92dvh; }
  .settings { grid-template-columns: 1fr; }
  .set-nav { border: 0; padding: 4px 8px 12px; }
  .set-nav-item { min-height: 56px; }
  .set-page { padding: 0 16px 16px; }
}

/* Компактные строки и «не зачёркивать» */
.compact .task-row-inner { min-height: 40px; padding-top: 0; padding-bottom: 0; }
.compact .task-main { padding: 6px 0 5px 2px; }
.compact .check { margin-top: 0; height: 40px; }
.compact .subtask-toggle { margin-top: 0; height: 40px; }
.compact .task-meta { margin-top: 1px; }
.no-strike .task-row.done .task-title { text-decoration: none; }

/* «Показывать детали» в строке задачи */
.task-details { margin-top: 2px; color: var(--muted); font-size: calc(13.5px * var(--fs, 1)); }
.task-notes { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.task-ci { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-ci.done { text-decoration: line-through; opacity: .75; }
.task-ci.more { font-size: calc(12.5px * var(--fs, 1)); }
.kind-group .group-title, .kind-assignee .group-title { font-weight: 600; }

/* ---------- Выбор нескольких задач ---------- */
.select-bar {
  position: fixed; left: 8px; right: 8px; bottom: calc(var(--nav-h) + var(--safe-bottom) + 8px); z-index: 13;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lift);
  padding: 6px 8px; display: grid; gap: 4px;
}
.select-bar[hidden] { display: none; }
.sel-top { display: flex; align-items: center; gap: 6px; }
.sel-count { flex: 1; min-width: 0; }
.sel-actions { display: grid; grid-template-columns: repeat(6, 1fr); }
.sel-btn { width: auto; height: auto; min-height: 52px; display: grid; justify-items: center; gap: 2px; padding: 4px 2px; border-radius: 10px; }
.sel-btn span { font-size: calc(11px * var(--fs, 1)); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.sel-btn.danger svg { color: var(--danger); }
.sel-btn .long { display: none; }
@media (min-width: 900px) { .sel-btn .long { display: inline; max-width: none; } .sel-btn .short { display: none; } }
.sel-btn:disabled { opacity: .4; }
.tasks-view.selecting .fab { display: none; }
.tasks-view.selecting .task-groups { padding-bottom: 120px; }
.tasks-view.selecting .task-row { cursor: default; }
.task-row.picked .task-row-inner { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.tasks-view.selecting .task-row .check svg { border-style: dashed; border-color: var(--muted); }
.tasks-view.selecting .task-row.picked .check { color: var(--accent-text); }
.tasks-view.selecting .task-row.picked .check svg { background: var(--accent); border: 2px solid var(--accent); }
@media (min-width: 900px) {
  .select-bar { position: sticky; top: 0; left: auto; right: auto; bottom: auto; margin-bottom: 10px; grid-template-columns: auto 1fr; align-items: center; }
  .sel-actions { grid-template-columns: repeat(6, auto); justify-content: end; gap: 2px; }
  .sel-btn { min-height: 40px; grid-auto-flow: column; padding: 0 10px; gap: 6px; }
  .sel-btn span { font-size: calc(13px * var(--fs, 1)); color: var(--text); }
  .tasks-view.selecting .task-groups { padding-bottom: 0; }
}

/* ---------- Покупки, количество, прогресс ---------- */
.task-qty { margin-inline-start: 8px; color: var(--muted); font-size: .88em; font-weight: 400; }
.task-row.done .task-qty { text-decoration: none; }
/* Михкар-7: «Напомнить о парковке» — строка в «Где машина». */
.wa-park-rem { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin: 4px 0 8px; font-weight: 600; hyphens: manual; }
.wa-park-rem > span { white-space: nowrap; }
.wa-park-rem > span + span { font-weight: 400; color: var(--muted); }
.wa-park-rem.over { color: var(--late); }
/* Михкар-7: значок товара в списке покупок (как Bring!) — в начале названия (::before — не в тексте строки); у иврита — справа сам (dir="auto"). */
.task-title.has-ico::before { content: attr(data-ico); display: inline-block; margin-inline-end: .35em; font-size: 1.05em; line-height: 1; text-decoration: none; vertical-align: -.05em; }
.task-row.done .task-title.has-ico::before { opacity: .55; filter: grayscale(.6); }
.meta-progress { position: relative; padding: 0 6px; border-radius: 999px; background: linear-gradient(90deg, var(--accent-soft) var(--p), transparent var(--p)); border: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.bought-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 4px 8px; }
.bought-chip { max-width: 100%; }
.bought-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bought-chip small { color: var(--muted); margin-inline-start: 4px; }
.qa-suggest .chip small { color: var(--muted); margin-inline-start: 4px; }

/* Чек-лист: ручка перетаскивания */
.ci-grip { display: grid; place-items: center; width: 24px; align-self: stretch; color: var(--muted); cursor: grab; touch-action: none; opacity: .55; }
.ci-grip svg { width: 16px; height: 16px; }
.check-item.dragging { position: relative; z-index: 3; background: var(--surface); box-shadow: var(--shadow-lift); border-radius: 8px; }
.check-item.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.check-item.drop-after { box-shadow: inset 0 -2px 0 var(--accent); }

/* Командная строка Ctrl+K */
.dlg-cmd { width: min(600px, calc(100vw - 32px)); align-self: start; margin-top: 12vh; }
.dlg-cmd .dlg-body { padding: 12px; }
.cmd-input { width: 100%; font-size: calc(17px * var(--fs, 1)); }
.cmd-list { max-height: min(420px, 55dvh); overflow-y: auto; margin-top: 8px; }
.cmd-kind { font-size: 12px; color: var(--muted); padding: 8px 10px 2px; }
.cmd-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; }
.cmd-item > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmd-item small { color: var(--muted); }
.cmd-item.on { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.cmd-emoji { width: 20px; }
.cmd-item > svg, .cmd-item > .icon { width: 20px; height: 20px; flex: none; }
.cmd-item small { flex: 0 1 auto; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmd-item > .cmd-emoji { flex: none; }
/* Компьютер: список слева, предпросмотр справа (сессия 35) */
.dlg-cmd.cmd-wide { width: min(860px, calc(100vw - 48px)); }
.cmd-body { display: grid; grid-template-columns: minmax(0, 1fr); }
.cmd-wide .cmd-body { grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: 12px; }
.cmd-preview { margin-top: 8px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2, color-mix(in srgb, var(--text) 5%, transparent)); max-height: min(420px, 55dvh); overflow-y: auto; }
.cmd-preview[hidden] { display: block; visibility: hidden; }
.cmd-pv-kind { font-size: 12px; color: var(--muted); }
.cmd-pv-title { font-weight: 600; font-size: calc(16px * var(--fs, 1)); margin: 2px 0 6px; overflow-wrap: anywhere; }
.cmd-pv-meta { color: var(--muted); font-size: calc(13.5px * var(--fs, 1)); margin-bottom: 6px; overflow-wrap: anywhere; }
.cmd-pv-text { margin: 6px 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: calc(14px * var(--fs, 1)); }
.cmd-pv-list { margin: 6px 0 0; padding-inline-start: 18px; font-size: calc(14px * var(--fs, 1)); }
.cmd-pv-list li { overflow-wrap: anywhere; }

/* Чек-лист в строке задачи (как в TickTick) */
.task-ci-preview { margin-top: 1px; color: var(--muted); font-size: calc(13.5px * var(--fs, 1)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-ci-preview::before { content: '— '; }
.row-checklist { display: flex; flex-direction: column; margin: 4px 0 2px; }
.row-ci { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 4px; margin-inline-start: -4px; border: 0; border-radius: 6px; background: none; color: inherit; font: inherit; font-size: calc(14.5px * var(--fs, 1)); text-align: start; cursor: pointer; }
.row-ci:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.row-ci:disabled { cursor: default; }
.row-ci-box { flex: none; width: 18px; height: 18px; border: 1.5px solid var(--muted); border-radius: 4px; display: grid; place-items: center; }
.row-ci-box svg { width: 14px; height: 14px; }
.row-ci.done .row-ci-box { background: var(--muted); border-color: var(--muted); color: var(--surface); }
.row-ci-text { flex: 0 1 auto; min-width: 0; overflow-wrap: anywhere; } /* иврит — у самой галочки, а не у правого края */
.row-ci.done .row-ci-text { text-decoration: line-through; color: var(--muted); }
@media (pointer: coarse) { .row-ci { min-height: 44px; } }

/* Версии */
.side-version { display: block; width: 100%; margin-top: 8px; padding: 10px 12px; min-height: 36px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 12px; text-align: start; cursor: pointer; }
.side-version:hover { opacity: 1; text-decoration: underline; }
.ver-cell { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; text-align: end; }
.ver-cell[data-state="old"] { color: var(--p3, #b3261e); font-weight: 600; }
.ver-cell[data-state="ok"] { color: var(--accent); }
.ver-cell a { color: var(--accent); }

/* ---------- Настройка виджета: предпросмотр как на главном экране (цвета — ListWidget.kt) ---------- */
.dlg-widget { width: min(860px, calc(100vw - 32px)); }
.dlg-widget .dlg-body { padding-top: 0; }
.wset-wrap { display: flex; flex-direction: column; }
.wp-stage {
  position: sticky; top: 0; z-index: 2; margin: 0 -20px 4px; padding: 14px 20px;
  background: linear-gradient(135deg, #6f9ec4 0%, #9b8fc9 45%, #d9a37f 100%);
}
.wp-stage.small { position: static; margin: 4px 0 8px; border-radius: var(--radius); }
.wp {
  --wp-bg: 255 255 255; --wp-text: #1d1c1a; --wp-muted: #6d6a62; --wp-accent: #0f6e64; --wp-on-accent: #fff;
  --wp-late: #b3261e; --wp-line: #e3e0d8; --wp-k: 1; --wp-alpha: 1;
  max-width: 380px; height: 236px; margin: 0 auto; padding: 4px 12px 8px; border-radius: 20px; overflow: hidden;
  background: rgb(var(--wp-bg) / var(--wp-alpha)); color: var(--wp-text); direction: ltr; text-align: left;
  display: flex; flex-direction: column; box-shadow: 0 6px 20px rgb(0 0 0 / .18);
}
.wp.dark { --wp-bg: 31 31 29; --wp-text: #edebe5; --wp-muted: #a19e95; --wp-accent: #3fb3a3; --wp-on-accent: #10201e; --wp-late: #f2827a; --wp-line: #34332f; }
.wp.accent { --wp-bg: 15 110 100; --wp-text: #fff; --wp-muted: rgb(255 255 255 / .78); --wp-accent: #fff; --wp-on-accent: #0f6e64; --wp-late: #ffd1cc; --wp-line: rgb(255 255 255 / .25); }
.wp-head { display: flex; align-items: center; gap: 4px; min-height: 44px; flex: none; border-bottom: 1px solid var(--wp-line); }
.wp-name { font-weight: 700; font-size: calc(17px * var(--wp-k)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.wp-count { color: var(--wp-muted); font-size: calc(14px * var(--wp-k)); margin-inline-start: 2px; }
.wp-chev svg { width: 16px; height: 16px; transform: rotate(90deg); color: var(--wp-muted); }
.wp-spacer { flex: 1; }
.wp-btn { display: inline-flex; width: 32px; justify-content: center; color: var(--wp-muted); }
.wp-btn svg { width: 20px; height: 20px; }
.wp-plus { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: var(--wp-accent); color: var(--wp-on-accent); }
.wp-plus svg { width: 20px; height: 20px; }
.wp-body { overflow: hidden; flex: 1; }
.wp-group { color: var(--wp-muted); font-size: calc(13px * var(--wp-k)); font-weight: 500; padding: 8px 4px 2px; }
.wp-row { display: flex; align-items: flex-start; gap: 10px; padding: 7px 2px; }
.wp.compact .wp-row { padding: 3px 2px; }
.wp-check {
  flex: none; width: calc(20px * var(--wp-k)); height: calc(20px * var(--wp-k)); margin-top: 1px; border-radius: 5px;
  border: 2px solid var(--wp-muted); display: inline-flex; align-items: center; justify-content: center;
}
.wp-check.p3 { border-color: #d64545; } .wp-check.p2 { border-color: #e8a33d; } .wp-check.p1 { border-color: #4a7bd0; }
.wp-check.done { background: var(--wp-muted); border-color: var(--wp-muted); color: rgb(var(--wp-bg)); }
.wp-check svg { width: 80%; height: 80%; }
.wp-main { flex: 1; min-width: 0; }
.wp-title { font-size: calc(16px * var(--wp-k)); line-height: 1.25; overflow-wrap: anywhere; }
.wp-sub { font-size: calc(14px * var(--wp-k)); color: var(--wp-muted); line-height: 1.25; }
.wp-meta { font-size: calc(13px * var(--wp-k)); color: var(--wp-muted); }
.wp-meta.late { color: var(--wp-late); }
.one { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wp-row.done .wp-title { text-decoration: line-through; color: var(--wp-muted); }
.wp-icon { color: var(--wp-muted); flex: none; }
.wp-icon svg { width: 18px; height: 18px; }
/* Значок чек-листа у задачи в виджете: раскрыть / свернуть пункты (= ListWidget.TaskRow). */
.wp-ci-toggle {
  flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  width: calc(48px * var(--wp-k)); height: calc(48px * var(--wp-k)); padding: 0; border: 0; border-radius: 12px;
  background: transparent; color: var(--wp-muted); font: inherit;
}
.wp-ci-toggle.on { background: var(--wp-line, rgb(127 127 127 / .18)); color: var(--wp-text); }
.wp-ci-toggle svg { width: calc(18px * var(--wp-k)); height: calc(18px * var(--wp-k)); }
.wp-ci-toggle small { font-size: calc(11px * var(--wp-k)); color: var(--wp-muted); white-space: nowrap; }
.wp-row .person-av { flex: none; }
.wp-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 6px 0; }
.wp-tile {
  min-height: calc(64px * var(--wp-k)); padding: 6px; border-radius: 12px; background: var(--wp-accent); color: var(--wp-on-accent);
  display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden;
}
.wp-tile.p3 { background: #c8463e; color: #fff; }
.wp-tile.done { background: var(--wp-line); color: var(--wp-muted); }
.wp-tile-title { font-weight: 600; font-size: calc(14px * var(--wp-k)); line-height: 1.2; overflow-wrap: anywhere; }
.wp-tile-sub { font-size: calc(11px * var(--wp-k)); opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wp-empty { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--wp-muted); font-size: calc(15px * var(--wp-k)); }
.wp-matrix { flex: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 6px; padding-top: 6px; min-height: 0; }
.wp-quad { min-width: 0; min-height: 0; overflow: hidden; border-radius: 12px; padding: 6px 6px 4px; background: color-mix(in srgb, var(--qc) 12%, transparent); border-top: 3px solid var(--qc); }
.wp-quad-head { display: flex; align-items: flex-start; gap: 6px; font-weight: 700; font-size: calc(13px * var(--wp-k)); line-height: 1.25; }
.wp-quad-head .kb-q { width: calc(18px * var(--wp-k)); height: calc(18px * var(--wp-k)); font-size: calc(11px * var(--wp-k)); }
.wp-quad-name { flex: 1 1 auto; min-width: 0; overflow-wrap: break-word; }
.wp-quad .wp-count { flex: none; }
.wp-qrow { gap: 6px; padding: 4px 0; }
.wp-qrow .wp-check { width: calc(16px * var(--wp-k)); height: calc(16px * var(--wp-k)); }
.wp-qrow .wp-title { font-size: calc(14px * var(--wp-k)); }
.wp-qrow[dir=rtl] .wp-title, .wp-row[dir=rtl] .wp-main { text-align: right; }
.wp.matrix { height: 340px; }
.wp-quad-empty, .wp-quad-more { color: var(--wp-muted); font-size: calc(12.5px * var(--wp-k)); padding: 4px 0; }
.wset-slider { display: flex; align-items: center; gap: 12px; }
.wset-range { flex: 1; min-height: 44px; accent-color: var(--accent); }
.wset-val { width: 3.5em; text-align: end; }
.wset-list { display: flex; flex-direction: column; gap: 2px; }
.wset-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 52px; text-align: start; }
.wset-btn-text { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.wset-btn-text small { color: var(--muted); font-weight: 500; font-size: calc(12px * var(--fs, 1)); }
.wset-btn.warn { border-color: var(--warn); }
.wset-status { padding: 2px 0 6px; color: var(--text); }
@media (min-width: 900px) {
  .wset-wrap { display: grid; grid-template-columns: 400px 1fr; gap: 20px; align-items: start; }
  .wp-stage { margin: 12px 0 0; border-radius: var(--radius); top: 12px; }
  .wp { height: 320px; }
}
@media (max-width: 600px) { .wp { height: 196px; } .wp-stage { padding: 10px 16px; } }
.detail-label .subtask-to-cl { margin-inline-start: auto; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--accent); min-height: 44px; }
.detail-label .subtask-to-cl[hidden] { display: none; }
.wp-ci { display: flex; align-items: center; gap: 8px; padding: 3px 2px 3px 32px; font-size: calc(14.5px * var(--wp-k)); }
.wp.compact .wp-ci { padding-block: 1px; }
.wp-ci-box { flex: none; width: calc(16px * var(--wp-k)); height: calc(16px * var(--wp-k)); border: 1.6px solid var(--wp-muted); border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; }
.wp-ci-box svg { width: 85%; height: 85%; }
.wp-ci.done { color: var(--wp-muted); }
.wp-ci.done .wp-ci-text { text-decoration: line-through; }
.wp-ci.done .wp-ci-box { background: var(--wp-muted); color: rgb(var(--wp-bg)); }
.wp-tile-head { font-weight: 600; font-size: calc(13px * var(--wp-k)); color: var(--wp-muted); padding: 6px 2px 0; }
.wp-tile.done .wp-tile-title { text-decoration: line-through; }
button.wp-group { display: flex; width: 100%; border: 0; background: none; color: var(--wp-muted); font: inherit; font-size: calc(13px * var(--wp-k)); font-weight: 600; text-align: left; cursor: pointer; min-height: 30px; align-items: center; }
.wp-group-chev { width: 1.2em; display: inline-block; }
.wp-group-count { font-weight: 400; margin-inline-start: 4px; }
.wp-group.closed { color: var(--wp-text); }

/* ---------- «?» — список клавиш ---------- */
.keys-list { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; align-items: baseline; }
.keys-list dt { margin: 0; }
.keys-list dd { margin: 0; color: var(--muted); }
.keys-list kbd {
  font: inherit; font-size: calc(13px * var(--fs, 1)); padding: 2px 6px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface-2); white-space: nowrap;
}

/* ---------- Календарь (сессия 9): месяц, неделя, 3 дня, день ---------- */
.cal-view {
  display: grid; grid-template-columns: minmax(0, 1fr);
  height: calc(100dvh - var(--header-h) - var(--safe-top) - var(--nav-h) - var(--safe-bottom));
}
@media (min-width: 900px) {
  .cal-view { height: calc(100dvh - var(--header-h) - var(--safe-top)); }
  .cal-view.planning { grid-template-columns: minmax(0, 1fr) 300px; }
  .cal-view.has-detail { grid-template-columns: minmax(0, 1fr) var(--detail-w); }
  .cal-view.planning.has-detail { grid-template-columns: minmax(0, 1fr) 300px var(--detail-w); }
}
.cal-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 6px 6px 0; }
@media (min-width: 900px) { .cal-pane { padding: 12px 18px 0; } }
.cal-bar { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; padding: 2px 2px 8px; }
.cal-nav { display: flex; align-items: center; gap: 2px; }
.cal-today-btn { min-height: 36px; }
.cal-v-title { flex: 1; min-width: 120px; display: flex; flex-direction: column; line-height: 1.2; }
.cal-v-title span { font-weight: 650; font-size: calc(17px * var(--fs, 1)); }
.cal-v-title small { color: var(--muted); font-size: calc(12.5px * var(--fs, 1)); }
.cal-modes .seg-btn { min-height: 36px; padding: 0 10px; }
@media (max-width: 899px) {
  .cal-modes { order: 3; width: 100%; }
  /* Михкар-4 (360 ×1,35): «Неделя» и «Месяц» упирались в рамку — шрифт не больше 4,2% ширины экрана. */
  .cal-modes .seg-btn { flex: 1; min-width: 0; padding: 0 2px; font-size: min(calc(13px * var(--fs, 1)), 4.2vw); }
  /* «Ноябрь 2026» — одной строкой: не влезает рядом со стрелками — своей строкой, а не «Ноябрь / 2026». */
  .cal-v-title { min-width: max-content; }
  .cal-v-title span { white-space: nowrap; font-size: min(calc(16px * var(--fs, 1)), 5vw); }
}
.cal-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.k-off { color: var(--danger); }
.k-memorial, .k-fast { color: var(--muted); }
.k-erev, .k-minor { color: var(--accent); }

/* Задача: полоса и блок */
.cal-chip, .cal-block, .ag-row, .plan-row { --c: var(--accent); }
.cal-chip {
  position: relative; z-index: 1; min-width: 0; height: 19px; margin: 1px 2px; padding: 0 4px;
  display: flex; align-items: center; gap: 3px; border-radius: 5px;
  background: color-mix(in srgb, var(--c) 18%, var(--surface)); border-inline-start: 3px solid var(--c);
  font-size: calc(11.5px * var(--fs, 1)); line-height: 19px; cursor: pointer; overflow: hidden; touch-action: manipulation;
}
.cal-chip.span { background: color-mix(in srgb, var(--c) 30%, var(--surface)); }
.cal-chip.cont { border-start-start-radius: 0; border-end-start-radius: 0; margin-inline-start: 0; border-inline-start-width: 0; }
.cal-chip.more { border-start-end-radius: 0; border-end-end-radius: 0; margin-inline-end: 0; }
.cal-chip.timed { background: transparent; border-inline-start: 0; padding-inline-start: 2px; }
.cal-chip.timed:not(:has(.cal-check))::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.cal-chip.deadline svg { width: 12px; height: 12px; flex: none; color: var(--c); }
.cal-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cal-time { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; font-size: .92em; }
.cal-chip.done .cal-title, .cal-block.done .cal-title, .ag-row.done .cal-title { text-decoration: line-through; color: var(--muted); }
.cal-chip.done, .cal-block.done { opacity: .6; }
.cal-chip.ghost, .cal-block.ghost, .ag-row.ghost { opacity: .5; }
.cal-block.ghost { border-style: dashed; }
.cal-chip:focus-visible, .cal-block:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.cal-check {
  flex: none; width: 15px; height: 15px; padding: 0; border-radius: 50%; border: 1.6px solid var(--c);
  background: transparent; color: var(--accent-text); display: grid; place-items: center; cursor: pointer; position: relative;
}
.cal-check::after { content: ""; position: absolute; inset: -15px; } /* зона касания ≥ 44 px (значок ~15 px) */
.cal-check svg { width: 11px; height: 11px; stroke-width: 3; }
.cal-check[aria-checked="true"] { background: var(--c); }
.cal-check:disabled { cursor: default; opacity: .6; }

/* Месяц */
.mc-grid { flex: 1; min-height: 0; display: grid; grid-template-rows: auto repeat(var(--weeks), minmax(0, 1fr)); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.mc-wd { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--border); }
.mc-wd div { text-align: center; color: var(--muted); font-size: calc(12px * var(--fs, 1)); padding: 4px 0; }
.mc-week {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  /* Последняя строка тянется до низа недели: иначе на большом экране дни кончаются раньше строки (полоса пустоты, михкар-4). */
  grid-template-rows: 34px repeat(var(--lanes), 21px) minmax(18px, 1fr); min-height: 0; position: relative;
  border-bottom: 1px solid var(--border);
}
.mc-week:last-child { border-bottom: 0; }
.mc-day { border-inline-start: 1px solid var(--border); padding: 2px 3px; min-width: 0; cursor: pointer; outline: none; }
.mc-day:first-child { border-inline-start: 0; }
.mc-day.out { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.mc-day.out .mc-num { color: var(--muted); }
.mc-day.sel { background: var(--accent-soft); }
.mc-day.drop-on { box-shadow: inset 0 0 0 2px var(--accent); }
.mc-head { display: flex; align-items: baseline; gap: 4px; }
.mc-num { font-size: calc(13px * var(--fs, 1)); font-weight: 600; min-width: 22px; height: 22px; display: inline-grid; place-items: center; border-radius: 50%; }
.mc-day.today .mc-num { background: var(--accent); color: var(--accent-text); }
.mc-day.holiday .mc-num { color: var(--danger); }
.mc-day.today.holiday .mc-num { color: var(--accent-text); }
.mc-heb { color: var(--muted); font-size: calc(10.5px * var(--fs, 1)); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mc-hol { font-size: calc(10px * var(--fs, 1)); line-height: 1.1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; margin-top: -2px; }
.mc-more-btn { z-index: 1; align-self: start; height: 18px; border: 0; background: none; color: var(--muted); font-size: calc(11px * var(--fs, 1)); text-align: start; padding: 0 5px; cursor: pointer; min-width: 0; }
@media (max-width: 899px) {
  .cal-view[data-mode="month"] .cal-body { flex: none; }
  .cal-view[data-mode="month"] .cal-pane { overflow-y: auto; overscroll-behavior: contain; }
  .cal-view[data-mode="month"] .cal-agenda { flex: none; overflow: visible; }
  .mc-grid { flex: none; grid-template-rows: auto; }
  .mc-week { grid-template-rows: 38px repeat(var(--lanes), 16px) 14px; }
  .mc-head { flex-direction: column; align-items: center; gap: 0; }
  .mc-num { font-size: calc(12.5px * var(--fs, 1)); min-width: 20px; height: 20px; }
  .mc-heb { font-size: calc(9.5px * var(--fs, 1)); line-height: 1; }
  .mc-hol { display: none; }
  .mc-day.holiday::after { content: ""; display: block; width: 4px; height: 4px; border-radius: 50%; background: var(--danger); margin: 1px auto 0; }
  .cal-chip { height: 14px; line-height: 14px; margin: 1px; padding: 0 2px; font-size: calc(9.5px * var(--fs, 1)); border-radius: 3px; border-inline-start-width: 2px; }
  .cal-chip .cal-time { display: none; }
  .mc-more-btn { font-size: calc(9.5px * var(--fs, 1)); padding: 0 2px; }
}

/* Список дня под месяцем (телефон) */
.cal-agenda { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 4px calc(90px + var(--safe-bottom)); }
.cal-agenda[hidden] { display: none; }
.ag-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px 6px; }
.ag-head div { display: flex; flex-direction: column; }
.ag-head small { color: var(--muted); }
.ag-hol { display: flex; flex-wrap: wrap; gap: 4px 10px; padding: 0 4px 6px; font-size: calc(13px * var(--fs, 1)); }
.ag-list { display: flex; flex-direction: column; gap: 4px; }
.ag-row {
  display: flex; align-items: center; gap: 10px; min-height: var(--tap); padding: 0 12px;
  background: var(--surface); border-radius: 10px; border-inline-start: 4px solid var(--c); cursor: pointer;
}
.ag-row .cal-check { width: 20px; height: 20px; }
.ag-row .cal-title { flex: 1; }
.ag-row small { color: var(--muted); flex: none; font-variant-numeric: tabular-nums; }
.ag-empty { padding: 8px 4px; }

/* День, 3 дня, неделя */
.tg { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
/* Колонка часов шире на крупном шрифте (13.11: на ×1,35 «весь день» в две строки наезжал на «07:00»). */
.tg-head, .tg-allday, .tg-grid { --tg-gut: calc(36px * var(--fs, 1) + 12px); }
.tg-head, .tg-allday { display: grid; grid-template-columns: var(--tg-gut) repeat(var(--n), minmax(0, 1fr)); }
.tg-head { border-bottom: 1px solid var(--border); }
.tg-day {
  border: 0; border-inline-start: 1px solid var(--border); background: none; color: var(--text); font: inherit;
  display: flex; flex-direction: column; align-items: center; padding: 4px 2px; min-width: 0; cursor: pointer;
}
.tg-wd { color: var(--muted); font-size: calc(11.5px * var(--fs, 1)); }
.tg-num { font-weight: 650; font-size: calc(17px * var(--fs, 1)); width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; }
.tg-day.today .tg-num { background: var(--accent); color: var(--accent-text); }
.tg-day.holiday .tg-num { color: var(--danger); }
.tg-day.today.holiday .tg-num { color: var(--accent-text); }
.tg-heb, .tg-hol { font-size: calc(10.5px * var(--fs, 1)); max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tg-heb { color: var(--muted); }
.tg-day.drop-on { box-shadow: inset 0 0 0 2px var(--accent); }
.tg-allday { grid-template-rows: repeat(var(--lanes), minmax(22px, auto)); padding: 2px 0; border-bottom: 1px solid var(--border); min-height: 26px; max-height: 40vh; overflow-y: auto; }
.tg-allday-label { grid-row: 1 / -1; display: grid; place-items: start center; padding-top: 3px; }
.tg-allday-label small { color: var(--muted); font-size: calc(9.5px * var(--fs, 1)); text-align: center; line-height: 1.1; padding-bottom: 2px; }
.tg-expand { border: 0; background: var(--surface-2); color: var(--text); border-radius: 6px; font-size: calc(11px * var(--fs, 1)); padding: 2px 6px; cursor: pointer; }
.tg-allday-cell { border-inline-start: 1px solid var(--border); cursor: pointer; }
.tg-allday-cell.drop-on { background: var(--accent-soft); }
.tg-allday .cal-chip { height: 20px; line-height: 20px; }
.tg-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.tg-grid { display: grid; grid-template-columns: var(--tg-gut) repeat(var(--n), minmax(0, 1fr)); position: relative; }
.tg-hours { position: relative; }
.tg-hour { height: calc(60 * var(--pm, 0.8667px)); position: relative; }
.tg-hour { font-size: calc(10.5px * var(--fs, 1)); color: var(--muted); text-align: end; padding-inline-end: 6px; transform: translateY(-7px); font-variant-numeric: tabular-nums; }
/* Михкар-4: на 360 ×1,35 «15:00» прилипало к левому краю экрана — на телефоне часы не крупнее 3,3% ширины. */
@media (max-width: 899px) { .tg-hour { font-size: min(calc(10.5px * var(--fs, 1)), 3.3vw); } }
.tg-col {
  position: relative; border-inline-start: 1px solid var(--border); cursor: cell;
  background-image: repeating-linear-gradient(to bottom, var(--border) 0 1px, transparent 1px calc(60 * var(--pm, 0.8667px)));
  touch-action: pan-y;
}
/* Щипок (михкар-8): во время жеста блоки не анимируются и не выделяются. */
.tg.pinching .cal-block { transition: none; }
.tg.pinching { user-select: none; -webkit-user-select: none; }
.tg-col.today { background-color: color-mix(in srgb, var(--accent) 4%, transparent); }
.tg-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 3; pointer-events: none; }
.tg-now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }

/* Вечер «Завтра» (13.11, APPS.tomorrow в views/today-apps.js) */
.wa-tm-u { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.wa-tm-u:last-child { border-bottom: 0; }
.wa-tm-title { min-height: 44px; padding: 4px 0; border: 0; background: none; color: var(--text); font: inherit; font-size: calc(15px * var(--fs, 1)); text-align: start; overflow-wrap: anywhere; cursor: pointer; }
.wa-tm-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.wa-tm-acts .chip { min-height: 44px; }
.wa-tm-w { margin: 0 0 6px; }
.wa-tm-take { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; padding: 6px 0; }
.wa-tm-tt { flex: 1 1 12em; min-width: 0; overflow-wrap: anywhere; }
.wa-tm-take .btn { min-height: 44px; }
.wa-tm-pl { display: block; color: var(--muted); font-size: calc(13px * var(--fs, 1)); }

/* «День лентой» (13.11, views/day-ribbon.js): спокойные карточки по порядку дня, окна «свободно», линия «сейчас». */
.rb-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 2px 96px; }
.rb { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; max-width: 760px; margin: 0 auto; }
.rb-allday { display: flex; flex-wrap: wrap; gap: 6px; }
.rb-ad { --c: var(--accent); min-height: 44px; max-width: 100%; padding: 6px 12px; border: 0; border-radius: 12px; font: inherit; font-size: calc(14px * var(--fs, 1));
  text-align: start; overflow-wrap: anywhere; color: var(--text); background: color-mix(in srgb, var(--c) 16%, var(--surface)); border-inline-start: 4px solid var(--c); cursor: pointer; }
.rb-undated { background: var(--surface); border: 1px dashed var(--border); border-radius: 12px; padding: 8px 10px; display: grid; gap: 6px; }
.rb-u-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: calc(14px * var(--fs, 1)); }
.rb-u-h small { color: var(--muted); font-size: calc(12.5px * var(--fs, 1)); }
.rb-u-list { display: flex; flex-wrap: wrap; gap: 6px; }
.rb-u { --c: var(--accent); min-height: 44px; max-width: 100%; display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 12px; background: var(--surface-2);
  border-inline-start: 4px solid var(--c); font-size: calc(14px * var(--fs, 1)); overflow-wrap: anywhere; cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: pan-y; }
.rb-u.hold { box-shadow: var(--shadow-lift); transform: scale(1.03); }
.rb-ghost { position: fixed; left: 0; top: 0; z-index: 1000; max-width: 70vw; padding: 8px 12px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-lift); pointer-events: none;
  font-size: calc(14px * var(--fs, 1)); overflow-wrap: anywhere; }
:root.rb-dragging, :root.rb-dragging * { cursor: grabbing !important; }
.rb-line { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; position: relative; }
.rb-b { --c: var(--accent); display: grid; grid-template-columns: 3.6em minmax(0, 1fr); gap: 8px; align-items: stretch; min-height: 48px; cursor: pointer; }
.rb-t { display: flex; flex-direction: column; align-items: flex-end; padding-top: 6px; font-variant-numeric: tabular-nums; font-size: calc(14px * var(--fs, 1)); font-weight: 600; }
.rb-t .rb-end { font-weight: 400; color: var(--muted); font-size: calc(12px * var(--fs, 1)); }
.rb-b[dir="rtl"] .rb-t { align-items: flex-start; }
.rb-card { display: grid; gap: 2px; align-content: start; padding: 8px 12px; border-radius: 12px; min-width: 0;
  background: color-mix(in srgb, var(--c) 14%, var(--surface)); border-inline-start: 4px solid var(--c); }
.rb-b.k-task .rb-card { background: var(--surface); border: 1px solid var(--border); border-inline-start: 4px solid var(--c); }
.rb-title { font-size: calc(15px * var(--fs, 1)); overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.rb-sub { color: var(--muted); font-size: calc(12.5px * var(--fs, 1)); overflow-wrap: anywhere; }
.rb-b.past { opacity: .62; }
.rb-b.done .rb-title { text-decoration: line-through; }
.rb-b.now .rb-card { box-shadow: 0 0 0 2px var(--danger); }
.rb-b.now .rb-sub { color: var(--danger); }
.rb-free { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 8px; margin-inline-start: calc(3.6em + 8px); padding: 6px 12px;
  border: 1px dashed var(--border); border-radius: 12px; background: transparent; color: var(--muted); font: inherit; font-size: calc(13.5px * var(--fs, 1)); text-align: start; cursor: pointer; }
.rb-free small { font-size: calc(12px * var(--fs, 1)); }
.rb-free:hover, .rb-free.over { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.rb-dragging .rb-free { border-style: solid; }
.rb-now { position: relative; height: 22px; display: flex; align-items: center; color: var(--danger); font-size: calc(12px * var(--fs, 1)); font-weight: 600; }
.rb-now bdi { width: 3.6em; text-align: end; padding-inline-end: 8px; flex: none; }
.rb-now::after { content: ""; flex: 1; height: 2px; background: var(--danger); border-radius: 2px; }
.rb-empty { color: var(--muted); text-align: center; padding: 16px; }
.cal-view[data-mode="ribbon"] .cal-agenda { display: none; }
.cal-block {
  position: absolute; z-index: 2; overflow: hidden; border-radius: 6px; padding: 2px 5px;
  background: color-mix(in srgb, var(--c) 22%, var(--surface)); border-inline-start: 3px solid var(--c);
  font-size: calc(12px * var(--fs, 1)); line-height: 1.25; cursor: pointer; display: flex; flex-direction: column; gap: 1px;
  touch-action: pan-y;
}
.cal-block-top { display: flex; align-items: center; gap: 4px; min-width: 0; }
.cal-block .cal-title { font-weight: 550; }
.cal-block.short { flex-direction: row; align-items: center; gap: 6px; padding-block: 0; }
.cal-block.short .cal-time { font-size: .85em; }
.cal-resize { position: absolute; left: 0; right: 0; bottom: 0; height: 9px; cursor: ns-resize; }
.cal-block:hover .cal-resize::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 18px; margin-left: -9px; height: 3px; border-radius: 2px; background: var(--c); }
.cal-block.resizing { z-index: 5; box-shadow: var(--shadow-lift); }
.cal-block.dragging, .cal-chip.dragging, .plan-row.dragging { opacity: .35; }
.cal-ghost { z-index: 100; pointer-events: none; opacity: .9; box-shadow: var(--shadow-lift); margin: 0; }
.tg-select, .tg-drop {
  position: absolute; left: 2px; right: 2px; z-index: 4; border-radius: 6px; pointer-events: none;
  border: 2px dashed var(--accent); background: var(--accent-soft); color: var(--accent);
  font-size: calc(11.5px * var(--fs, 1)); font-weight: 600; padding: 2px 5px; font-variant-numeric: tabular-nums;
}
@media (max-width: 899px) {
  .tg-head, .tg-allday, .tg-grid { grid-template-columns: 40px repeat(var(--n), minmax(0, 1fr)); }
  .cal-view[data-mode="week"] .cal-block { padding: 1px 2px; font-size: calc(10px * var(--fs, 1)); }
  .cal-view[data-mode="week"] .cal-block .cal-check { display: none; }
  .cal-view[data-mode="week"] .cal-block .cal-time { display: none; }
  .cal-view[data-mode="week"] .tg-num { font-size: calc(14px * var(--fs, 1)); width: 26px; height: 26px; }
  .cal-view[data-mode="week"] .tg-hol { display: none; }
  .tg { border-radius: 10px; margin-bottom: 4px; }
}

/* Распланировать */
.cal-plan { display: none; min-width: 0; flex-direction: column; gap: 8px; padding: 12px; background: var(--surface); border-inline-start: 1px solid var(--border); overflow: hidden; }
.planning .cal-plan { display: flex; }
.plan-head { display: flex; align-items: center; justify-content: space-between; }
.plan-head h2 { margin: 0; font-size: calc(16px * var(--fs, 1)); }
.cal-plan .hint { margin: 0; }
.plan-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.plan-row {
  /* flex: none — в прокручиваемом списке строка не сжимается ниже текста (крупный шрифт обрезал названия). */
  flex: none; display: flex; flex-direction: column; justify-content: center; min-height: var(--tap); padding: 6px 10px;
  border-radius: 8px; background: var(--bg); border-inline-start: 3px solid var(--c); cursor: grab; touch-action: pan-y;
}
.plan-row .cal-title { line-height: 1.3; }
/* Название в «Распланировать» — с переносом, до 3 строк (Алексей 08.11: в колонке слева резалось на полуслове);
   целиком — в подсказке при наведении и в задаче справа. */
.plan-row .cal-title { white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; }
.plan-row { -webkit-user-select: none; user-select: none; }
.plan-sec { margin: 6px 2px 2px; color: var(--muted); font-size: calc(12px * var(--fs, 1)); font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.plan-sec.warn { color: var(--danger, #c0392b); }
.plan-row.overdue small { color: var(--late); }

/* Календарь на компьютере (сессия 33): мини-месяц, календари и «Распланировать» — в колонке слева. */
.side-desk .cal-plan { display: flex; padding: 0; background: none; border: 0; overflow: visible; }
.side-desk .cal-plan .plan-head .icon-btn { display: none; }
.side-desk .cal-plan .plan-head h2 { padding: 0 6px; color: var(--muted); font-size: calc(13px * var(--fs, 1)); font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.side-desk .cal-plan .hint { padding: 0 6px; font-size: calc(12.5px * var(--fs, 1)); }
.side-desk .plan-list { overflow: visible; }
.mini-cal { display: grid; gap: 4px; padding: 0 2px; }
.mini-head { display: flex; align-items: center; gap: 2px; }
.mini-title { flex: 1; border: 0; background: none; font: inherit; font-weight: 650; color: var(--text); padding: 6px; border-radius: 8px; cursor: pointer; text-align: start; }
.mini-title:hover { background: var(--surface-2); }
.mini-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; text-align: center; }
.mini-wd { color: var(--muted); font-size: calc(11px * var(--fs, 1)); padding: 2px 0; }
.mini-grid > * { min-width: 0; }
.mini-day {
  position: relative; height: 30px; min-height: 0; min-width: 0; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer;
  color: var(--text); font: inherit; font-size: calc(12.5px * var(--fs, 1)); font-variant-numeric: tabular-nums;
}
.mini-day:hover { background: var(--surface-2); }
.mini-day[data-out] { color: var(--muted); }
.mini-day[data-in] { background: var(--accent-soft); border-radius: 8px; }
.mini-day[data-today] { color: var(--accent-text); background: var(--accent); border-radius: 50%; font-weight: 700; }
.mini-day[data-busy]::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: currentColor; opacity: .55; }
.mini-day.drop-on { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--accent-soft); }
@media (min-width: 900px) { .notes-top .notes-chips { display: none; } }
.side-cal .side-dot::before { box-shadow: inset 0 0 0 2px var(--ring, var(--muted)); }
.plan-row small { color: var(--muted); font-size: calc(11.5px * var(--fs, 1)); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
@media (max-width: 899px) {
  .planning .cal-plan {
    position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-bottom)); z-index: 30; height: 46vh;
    border-radius: 16px 16px 0 0; border: 1px solid var(--border); box-shadow: var(--shadow-lift);
  }
  .planning .fab { display: none; }
}

/* Быстрый ввод из календаря */
.cal-add { display: none; }
.cal-view.adding .cal-add { display: block; position: fixed; z-index: 45; }
.cal-view.adding .cal-add .quick-add { box-shadow: var(--shadow-lift); }
.cal-view.adding .cal-add-backdrop { display: block; position: fixed; inset: 0; z-index: 44; opacity: 1; pointer-events: auto; }
@media (min-width: 900px) {
  .cal-view.adding .cal-add-backdrop { background: transparent; }
  .cal-view.adding .cal-add:not([style*="left"]) { left: 50%; top: 80px; width: 460px; transform: translateX(-50%); }
}
@media (max-width: 899px) {
  .cal-view.adding .cal-add { left: 0; right: 0; bottom: 0; padding: 10px 10px calc(10px + var(--safe-bottom)); }
}
.qa-recog { padding: 4px 6px 0; gap: 4px; }
.qa-recog[hidden] { display: none; }
.recog-chip small { color: var(--muted); }

/* Окно даты: вкладки «Дата / Длительность» */
.date-tabs { justify-self: center; margin-bottom: 4px; }
.date-tabs .seg-btn { min-width: 120px; }
.dur-rows { display: flex; flex-direction: column; gap: 8px; }
.dur-rows[hidden], .date-picker .chip-row[hidden] { display: none; }
/* Телефон, месяц: нажатие на любую часть дня выбирает день (задачи — в списке под месяцем). */
@media (max-width: 899px) { .mc-week .cal-chip, .mc-more-btn { pointer-events: none; } }

/* ---------- Календари Google в календаре Yahad (события только для чтения) ---------- */
/* События — сплошной заливкой цвета календаря (как в Google), задачи — светлой с полосой слева. */
.cal-chip.event { background: var(--c); color: #fff; border-inline-start: 0; text-shadow: 0 0 2px rgb(0 0 0 / .35); }
.cal-chip.event .cal-time { color: inherit; opacity: .9; }
.cal-chip.event.timed { background: transparent; color: var(--text); text-shadow: none; }
.cal-chip.event.timed::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.cal-chip.event.timed .cal-time { color: var(--muted); }
.cal-ev-ic { flex: none; font-size: .95em; line-height: 1; }
.cal-block.event { background: color-mix(in srgb, var(--c) 88%, #000); color: #fff; border-color: transparent; text-shadow: 0 0 2px rgb(0 0 0 / .3); }
.cal-block.event .cal-time, .cal-block.event .cal-loc { color: inherit; opacity: .9; }
.cal-loc { display: block; font-size: .85em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--c); display: inline-block; }
.ag-row.event { border-inline-start-color: transparent; background: color-mix(in srgb, var(--c) 12%, var(--surface)); }

.cal-legend { flex: none; display: flex; gap: 6px; padding: 0 2px 8px; overflow-x: auto; scrollbar-width: none; }
.cal-legend[hidden] { display: none; }
.cal-legend::-webkit-scrollbar { display: none; }
.cal-leg {
  --c: var(--accent); flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px;
  border-radius: 16px; border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  font: inherit; font-size: calc(13px * var(--fs, 1)); cursor: pointer; max-width: 220px;
}
.cal-leg span[dir] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-leg .cal-dot { background: transparent; border: 2px solid var(--c); width: 12px; height: 12px; box-sizing: border-box; }
.cal-leg.on { color: var(--text); }
.cal-leg.on .cal-dot { background: var(--c); }
.cal-leg-err { color: var(--danger, #c62828); font-weight: 700; }
@media (pointer: coarse) { .cal-leg { min-height: 36px; } }

/* Карточка события */
.ev-card { display: flex; flex-direction: column; gap: 10px; }
.ev-cal { --c: var(--accent); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); }
.ev-src { flex: 1 1 0; font-size: .82em; min-width: 0; overflow-wrap: anywhere; }
.ev-also { flex-basis: 100%; font-size: .78em; color: var(--muted); overflow-wrap: anywhere; }
.ev-row { display: flex; align-items: center; gap: 10px; }
.ev-row > svg, .ev-row > span:first-child svg { flex: none; width: 18px; height: 18px; color: var(--muted); }
.ev-pin { flex: none; width: 18px; text-align: center; }
.ev-loc { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ev-desc { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.dlg-event .dlg-actions { flex-wrap: wrap; }
.dlg-event .dlg-actions .btn span[dir] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw; }

/* Настройки → Календари */
.cal-set-row { gap: 10px; }
.cal-set-row .set-text { flex: 1; min-width: 0; }
.cal-set-row .set-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: start; }
.cal-dot-btn { --c: var(--accent); flex: none; width: 44px; height: 44px; margin: -4px -8px; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; border-radius: 50%; }
.cal-dot-btn .cal-dot { width: 16px; height: 16px; }
.cal-swatches { padding: 4px 0 10px 36px; }
.cal-err { color: var(--danger, #c62828); }
.cal-add-area { width: 100%; box-sizing: border-box; resize: vertical; min-height: 84px; font-size: calc(13px * var(--fs, 1)); }
.cal-add-preview { display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }

/* ---------- Приложения (#/apps): витрина приложений Алексея ---------- */
.apps-screen { display: flex; flex-direction: column; gap: 14px; padding: 16px; max-width: 1320px; margin: 0 auto; box-sizing: border-box; width: 100%; }
.main.wide .apps-screen { padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 24px); }
.apps-lede { margin: 0; color: var(--muted); font-size: calc(15px * var(--fs, 1)); }
.apps-shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.apps-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0;
}
.apps-top { display: flex; gap: 12px; align-items: center; min-width: 0; }
.apps-icon {
  width: 48px; height: 48px; border-radius: 12px; flex: none; display: grid; place-items: center;
  background: var(--app, var(--muted)); color: #fff; font-weight: 700; font-size: calc(22px * var(--fs, 1));
}
.apps-name { min-width: 0; }
.apps-name h2 { margin: 0; font-size: calc(18px * var(--fs, 1)); line-height: 1.25; }
.apps-name p { margin: 2px 0 0; color: var(--muted); font-size: calc(14px * var(--fs, 1)); }
.apps-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.apps-tag {
  font-size: calc(12.5px * var(--fs, 1)); line-height: 1; padding: 6px 8px; border-radius: 6px;
  background: var(--accent-soft); color: var(--accent); font-variant-numeric: tabular-nums; max-width: 100%; overflow-wrap: anywhere;
}
.apps-tag.soft, .apps-tag.web { background: var(--surface-2); color: var(--muted); }
.apps-tag.apk { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.apps-news { font-size: calc(14.5px * var(--fs, 1)); }
.apps-news ul { margin: 4px 0 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 2px; }
.apps-how { margin: 0; color: var(--muted); font-size: calc(14px * var(--fs, 1)); }
.apps-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.apps-btns .btn { text-decoration: none; }
.apps-wa { background: #1c8d4e; border-color: #1c8d4e; color: #fff; }
.apps-wa:hover { background: #1c8d4e; filter: brightness(1.06); }
.apps-send { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.apps-lang { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.apps-lang-cap { color: var(--muted); font-size: calc(13.5px * var(--fs, 1)); margin-inline-end: 2px; }
.apps-lang-btn {
  min-height: 44px; min-width: 56px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font: inherit; font-weight: 600; font-size: calc(15px * var(--fs, 1));
}
.apps-lang-btn[aria-pressed="true"] { background: #1c8d4e; border-color: #1c8d4e; color: #fff; }
.apps-say {
  margin: 0; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); color: var(--text);
  font-size: calc(14px * var(--fs, 1)); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
}
.apps-wa-lang { margin-inline-start: 2px; padding: 0 6px; border-radius: 6px; background: rgb(255 255 255 / .2); font-size: .9em; }
.apps-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 40px 16px; color: var(--muted); text-align: center; grid-column: 1 / -1; }
.apps-empty svg { width: 40px; height: 40px; }
/* QR: на телефоне — кнопка «QR» и окно; на широком экране с мышью — код прямо в карточке (навести камеру телефона). */
.apps-qr { display: none; }
.apps-qr-btn { min-width: 56px; }
.qr { display: block; width: 100%; height: auto; border-radius: 6px; }
.apps-qr-dlg .dlg-body { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.qr.big { width: min(72vw, 320px); }
.apps-qr-url { margin: 0; font-size: calc(14px * var(--fs, 1)); overflow-wrap: anywhere; }
.apps-qr-hint { margin: 0; color: var(--muted); font-size: calc(13.5px * var(--fs, 1)); }
@media (min-width: 900px) and (hover: hover) {
  .apps-shelf { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }
  .apps-card { display: grid; grid-template-columns: minmax(0, 1fr) 112px; column-gap: 16px; align-content: start; }
  .apps-card > :not(.apps-qr) { grid-column: 1; }
  .apps-card > .apps-btns { grid-column: 1 / -1; } /* кнопки — в ряд под кодом, на всю ширину карточки */
  .apps-qr {
    display: flex; flex-direction: column; align-items: center; gap: 6px; grid-column: 2; grid-row: 1 / span 3; align-self: start;
    padding: 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: calc(12px * var(--fs, 1)); cursor: zoom-in; text-align: center;
  }
  .apps-qr .qr { width: 112px; border: 1px solid var(--border); }
  .apps-qr-btn { display: none; }
}

/* ---------- Страница /apps/ (отдельный значок «Приложения»): своя шапка вместо оболочки Yahad ---------- */
.apps-page { min-height: 100dvh; display: flex; flex-direction: column; }
.apps-bar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px;
  padding: calc(10px + var(--safe-top)) 16px 10px; background: var(--bg); border-bottom: 1px solid var(--border);
}
.apps-bar img { width: 32px; height: 32px; border-radius: 8px; flex: none; }
.apps-bar h1 { margin: 0; font-size: calc(20px * var(--fs, 1)); flex: 1; min-width: 0; }
.apps-bar .btn { text-decoration: none; }
.apps-page .apps-screen { padding-bottom: calc(24px + var(--safe-bottom)); }
.apps-page .apps-who { margin: 0; color: var(--muted); font-size: calc(13px * var(--fs, 1)); }
@media (max-width: 520px) { .apps-bar .apps-bar-label { display: none; } }
/* ---------- «Потянуть вниз» (js/pull-refresh.js) ---------- */
/* Список едет за пальцем (transform на области data-pull), в открывшемся месте — круг с дугой и надпись. */
.sync-pill { cursor: pointer; }
.pull-ind {
  --y: 64px; --op: 1;
  position: fixed; z-index: 9; left: 50%; top: 0; transform: translate(-50%, var(--y));
  display: flex; flex-direction: column; align-items: center; gap: 4px; max-width: calc(100vw - 32px);
  pointer-events: none; opacity: var(--op); transition: opacity .2s;
}
.pull-ind.leaving { opacity: 0; transition: opacity .25s, transform .28s; }
.pull-disc {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--surface); border: 1px solid var(--border); box-shadow: 0 3px 12px rgb(0 0 0 / .16);
  transition: transform .15s, background-color .15s;
}
.pull-svg { width: 26px; height: 26px; display: block; }
.pull-arc { stroke: var(--accent); transition: stroke-dashoffset .05s linear; }
.pull-mark { fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.pull-text {
  font-size: calc(13px * var(--fs, 1)); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
  padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, var(--bg) 85%, transparent);
}
.pull-ind[data-state="ready"] .pull-disc { transform: scale(1.1); }
.pull-ind[data-state="ready"] .pull-text { color: var(--accent); font-weight: 600; }
.pull-ind[data-state="busy"] .pull-arc { stroke-dasharray: 38 100 !important; stroke-dashoffset: 0; }
.pull-ind[data-state="busy"] .pull-svg { animation: pull-spin .8s linear infinite; }
.pull-ind[data-state="busy"] .pull-text { color: var(--text); }
.pull-ind[data-state="ok"] .pull-disc { background: var(--ok); border-color: var(--ok); }
.pull-ind[data-state="warn"] .pull-disc { background: var(--warn); border-color: var(--warn); }
.pull-ind[data-state="ok"] .pull-arc, .pull-ind[data-state="warn"] .pull-arc { stroke: transparent; }
.pull-ind[data-state="ok"] .pull-text { color: var(--ok); font-weight: 600; }
.pull-ind[data-state="warn"] .pull-text { color: var(--warn); font-weight: 600; white-space: normal; text-align: center; }
@keyframes pull-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pull-ind[data-state="busy"] .pull-svg { animation-duration: 2.4s; } }

/* Лента задач для Google Календаря (Настройки → Календари) */
.ics-box { display: flex; flex-direction: column; gap: 8px; margin: 6px 0; }
.ics-url { width: 100%; font-size: calc(13px * var(--fs, 1)); font-family: ui-monospace, monospace; text-overflow: ellipsis; }

/* ---------- Экран «Сегодня» (#/today) ---------- */
.today-view { display: grid; grid-template-columns: minmax(0, 1fr); min-height: calc(100dvh - var(--header-h) - var(--safe-top) - var(--nav-h) - var(--safe-bottom)); }
@media (min-width: 900px) {
  .today-view { min-height: calc(100dvh - var(--header-h) - var(--safe-top)); }
  .today-view.has-detail { grid-template-columns: minmax(0, 1fr) var(--detail-w); }
}
.td-pane { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 760px; margin: 0 auto; padding: 10px 12px calc(90px + var(--safe-bottom)); min-width: 0; }
@media (min-width: 900px) { .td-pane { padding: 20px 24px 48px; } }
.td-alert svg { width: 15px; height: 15px; flex: none; }
.td-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; min-width: 0; }
.td-card[hidden] { display: none; }
.td-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.td-head h2 { margin: 0; font-size: calc(15px * var(--fs, 1)); flex: 1; }
.td-count { color: var(--muted); font-variant-numeric: tabular-nums; }
.td-add { margin: 0 0 8px; }
.td-add .quick-add { box-shadow: none; }
/* Значки срока, списка и меток — когда строка в работе: на телефоне иначе они сдвигают дела вниз. */
.td-add .quick-add:not(:focus-within) .qa-chips { display: none; }
.td-add .quick-add:not(:focus-within) { padding-bottom: 4px; }
.td-group + .td-group { margin-top: 8px; }
.td-group h3 { margin: 4px 2px; font-size: calc(12.5px * var(--fs, 1)); font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.td-group.overdue h3 { color: var(--late); }
.td-list-rows { display: flex; flex-direction: column; gap: 2px; }
.td-row {
  --c: var(--accent);
  display: flex; align-items: center; gap: 10px; min-height: var(--tap); padding: 4px 10px; border-radius: 10px;
  border-inline-start: 4px solid var(--c); background: var(--bg); cursor: pointer; min-width: 0;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.td-row:hover { background: var(--surface-2); }
.td-row[aria-current="true"] { background: var(--accent-soft); }
.td-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.td-row .cal-check { width: 22px; height: 22px; }
.td-row .cal-check svg { width: 14px; height: 14px; }
.td-row.p3 .cal-check { border-color: var(--p3); }
.td-row.p2 .cal-check { border-color: var(--p2); }
.td-row.p1 .cal-check { border-color: var(--p1); }
.td-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-row small { color: var(--muted); flex: none; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.td-row.done .td-title { text-decoration: line-through; color: var(--muted); }
/* Время дела (13.11): колонка одной ширины перед названием (иврит — справа от названия), шрифт строки, зазор — gap ряда (10 px). */
.td-tm { flex: none; min-width: 3.2em; text-align: start; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--text); font-weight: 650; }
.td-tm.he { text-align: end; }
.td-row.done .td-tm, .td-row.late .td-tm { color: var(--muted); font-weight: 500; }
.td-row.ext { cursor: default; border-inline-start-style: dashed; border-inline-start-color: var(--muted); }
.td-row.ext:hover { background: var(--bg); }
.td-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; margin: 0 7px; }
.td-row.event .td-when { flex: none; min-width: 84px; color: var(--muted); font-size: calc(13px * var(--fs, 1)); font-variant-numeric: tabular-nums; }
.td-row.event.past { opacity: .55; }
.td-row.event.ext { border-inline-start-style: solid; }
.td-now { display: flex; align-items: center; gap: 8px; color: var(--danger); font-size: calc(12px * var(--fs, 1)); font-weight: 600; margin: 2px 0; }
.td-now::after { content: ""; flex: 1; height: 2px; background: var(--danger); border-radius: 1px; }
.td-done-head { display: flex; align-items: center; gap: 6px; min-height: 36px; border: 0; background: none; color: var(--muted); font: inherit; font-size: calc(13px * var(--fs, 1)); cursor: pointer; padding: 0 2px; }
.td-done-head svg { width: 16px; height: 16px; }
.td-empty { margin: 6px 2px; }
.td-list { margin: 0; padding-inline-start: 18px; display: flex; flex-direction: column; gap: 6px; }
.td-list li { overflow-wrap: anywhere; }
.td-list li span, .td-list li a { display: block; color: var(--muted); font-size: calc(13px * var(--fs, 1)); }
.td-list li a { color: var(--accent); }
.td-list li.alert b { color: var(--danger); }
.td-toggle { margin-top: 8px; }
.td-sub + .td-sub { margin-top: 10px; }
.td-sub h3 { margin: 0 0 4px; font-size: calc(13px * var(--fs, 1)); color: var(--muted); font-weight: 600; }
.td-facts { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: calc(13px * var(--fs, 1)); }

/* Кнопка чек-листа справа в строке задачи (как в виджете): значок, «1/8», ▾ */
.cl-toggle {
  flex: none; align-self: flex-start; display: inline-flex; align-items: center; gap: 3px;
  min-height: 36px; min-width: 44px; margin-top: 4px; padding: 0 6px; border: 0; border-radius: 10px;
  background: none; color: var(--muted); font: inherit; font-size: calc(12.5px * var(--fs, 1)); font-variant-numeric: tabular-nums; cursor: pointer;
}
.cl-toggle:hover { background: var(--surface-2); }
.cl-toggle svg { width: 16px; height: 16px; }
.cl-toggle .cl-caret svg { width: 13px; height: 13px; transform: rotate(90deg); transition: transform .15s; }
.cl-toggle.open { color: var(--accent); }
.cl-toggle.open .cl-caret svg { transform: rotate(-90deg); }
.task-row.done .cl-toggle { opacity: .7; }

/* Лента дня */
.td-alldays { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.td-allday {
  --c: var(--accent); display: inline-flex; align-items: center; min-height: 30px; padding: 0 10px; border-radius: 999px; border: 0;
  background: color-mix(in srgb, var(--c) 18%, var(--surface)); color: var(--text); font: inherit; font-size: calc(13px * var(--fs, 1)); cursor: pointer;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.td-allday:disabled { cursor: default; opacity: 1; }
.td-allday.hol { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); cursor: default; }
.td-lane .td-row .td-when { flex: none; min-width: 84px; color: var(--muted); font-size: calc(13px * var(--fs, 1)); font-variant-numeric: tabular-nums; }
.td-lane .td-row.task-timed .cal-check { order: 0; }
.td-row.past:not(.done) { opacity: .55; }
.td-row.late .td-when { color: var(--late); font-weight: 600; }
.td-gap {
  display: flex; align-items: center; min-height: calc(18px + var(--gap, 60) * .18px); margin: 0 0 0 10px; padding-inline-start: 84px;
  border-inline-start: 2px dotted color-mix(in srgb, var(--muted) 45%, transparent);
  color: var(--muted); font-size: calc(12px * var(--fs, 1));
}
.td-mark { display: flex; align-items: center; gap: 10px; min-height: 30px; padding: 0 12px; color: var(--muted); font-size: calc(13px * var(--fs, 1)); }
.td-mark.past { opacity: .55; }
.td-mark .td-when { flex: none; min-width: 84px; font-variant-numeric: tabular-nums; }

/* Unbounded — крупные цифры и заголовки главного экрана; свои файлы (без сети), лицензия OFL — docs/licenses/OFL-Unbounded.txt */
@font-face { font-family: "Unbounded"; font-weight: 700; font-display: swap; src: url("../fonts/unbounded-700-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Unbounded"; font-weight: 700; font-display: swap; src: url("../fonts/unbounded-700-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
/* ---------- «Сегодня»: конструктор виджетов (сессия 18) ---------- */
/* Сетка: 2 колонки на телефоне, 3 на планшете, 4 на компьютере; высота ряда растёт по содержимому — текст не режется. */
:root { --wg-teal: #dcece9; --wg-teal-t: #0a4a44; --wg-safe: #fff0e3; --wg-safe-t: #6b2f00; --wg-type-m: #ffe3cc; --wg-type-mt: #8a3a00; --wg-type-p: #dbe8ff; --wg-type-pt: #1d4f9e; }
:root[data-theme="dark"] { --wg-teal: #16332f; --wg-teal-t: #cfeae5; --wg-safe: #33231a; --wg-safe-t: #ffd9bf; --wg-type-m: #4a2a14; --wg-type-mt: #ffc9a3; --wg-type-p: #1d2d4a; --wg-type-pt: #b9d0ff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --wg-teal: #16332f; --wg-teal-t: #cfeae5; --wg-safe: #33231a; --wg-safe-t: #ffd9bf; --wg-type-m: #4a2a14; --wg-type-mt: #ffc9a3; --wg-type-p: #1d2d4a; --wg-type-pt: #b9d0ff; } }
.today-view, .wapp { --display: "Unbounded", system-ui, sans-serif; }
/* Длинные слова — с дефисом по слогам (ru), а не «Позвонит / ь». */
.wg, .wapp { -webkit-hyphens: auto; hyphens: auto; }
.wg-amount { white-space: nowrap; }
.wg-big.wg-amount { font-size: min(calc(26px * var(--fs, 1)), 14.5cqi); }
.wg-cur { margin-inline-start: .18em; font-family: system-ui, sans-serif; font-size: .62em; font-weight: 700; letter-spacing: 0; }
.wg-pane { max-width: 1040px; }
.wg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(calc(132px * var(--fs, 1)), auto); grid-auto-flow: row dense; gap: 12px; }
@media (min-width: 620px) { .wg-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* Компьютер: «Сегодня» во всю ширину (сессия 33) — сколько колонок помещается (не уже 200 px), до 1800 px. */
@media (min-width: 900px) {
  .wg-pane { max-width: 1800px; }
  .wg-grid { grid-template-columns: repeat(auto-fill, minmax(calc(200px * var(--fs, 1)), 1fr)); gap: 14px; }
}
.wg[data-size="w"], .wg[data-size="l"], .wg-ph[data-size="w"], .wg-ph[data-size="l"] { grid-column: span 2; }
.wg[data-size="t"], .wg[data-size="l"], .wg-ph[data-size="t"], .wg-ph[data-size="l"] { grid-row: span 2; }
.wg {
  position: relative; display: flex; min-width: 0; border-radius: 22px; overflow: hidden; isolation: isolate; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); box-shadow: var(--shadow);
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; transition: transform .15s;
}
/* Крупные цифры — по ширине самого виджета (cqi), чтобы на 360 px с крупным шрифтом «1 290 ₪» и «16:14» помещались. */
.wg { container-type: inline-size; }
.wg:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.wg:not(.editing):active { transform: scale(.985); }
.wg-in { position: relative; z-index: 1; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; padding: 14px; }
.wg.dark { background: var(--g, #2b2550); border-color: transparent; color: #fff; }
.wg.dark .wg-k, .wg.dark .wg-sub { color: rgb(255 255 255 / .86); }
.wg.teal { background: var(--wg-teal); border-color: transparent; color: var(--wg-teal-t); }
.wg.teal .wg-k, .wg.teal .wg-sub { color: color-mix(in srgb, var(--wg-teal-t) 80%, transparent); }
.wg.safe { background: var(--wg-safe); border-color: transparent; color: var(--wg-safe-t); }
.wg.safe .wg-k, .wg.safe .wg-sub { color: color-mix(in srgb, var(--wg-safe-t) 78%, transparent); }
.wg-bg { position: absolute; inset: 0; z-index: 0; }
.wg-bg svg { display: block; width: 100%; height: 100%; }
.wg.scene::after, .wa-scene::after { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; background: linear-gradient(180deg, rgb(0 0 0 / .16), rgb(0 0 0 / .42)); }
.wg.scene .wg-in, .wa-scene-in { text-shadow: 0 1px 3px rgb(0 0 0 / .45); }
.wg-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; min-width: 0; }
.wg-k { flex: 1 1 auto; min-width: 0; font-size: calc(12.5px * var(--fs, 1)); font-weight: 650; color: var(--muted); letter-spacing: .01em; overflow-wrap: anywhere; }
.wg-head .wg-sub { flex: 0 1 auto; }
.wg-big { font-family: var(--display); font-weight: 700; font-size: min(calc(26px * var(--fs, 1)), 18cqi); line-height: 1.08; letter-spacing: -.01em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; min-width: 0; }
.wg-big.xl { font-size: min(calc(34px * var(--fs, 1)), 22cqi); }
.wg-line { min-width: 0; font-size: calc(13.5px * var(--fs, 1)); line-height: 1.3; overflow-wrap: anywhere; }
.wg-line.strong { font-weight: 600; }
.wg-line.gold, .wg .gold { color: #ffd36b; font-weight: 600; }
.wg-sub { min-width: 0; font-size: calc(12.5px * var(--fs, 1)); line-height: 1.3; color: var(--muted); overflow-wrap: anywhere; }
.wg .alert { color: var(--danger); }
.wg .warn { color: var(--warn); }
.wg.dark .alert { color: #ffb3ab; }
.cl1, .cl2, .cl3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.cl1 { -webkit-line-clamp: 1; } .cl2 { -webkit-line-clamp: 2; } .cl3 { -webkit-line-clamp: 3; }
.wg-foot { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; padding-top: 2px; }
.wg-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.wg-col { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.wg-baseline { align-items: baseline; flex-wrap: wrap; }
.wg-chip { display: inline-flex; align-items: center; min-height: 24px; max-width: 100%; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); font-size: calc(11.5px * var(--fs, 1)); font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.wg.dark .wg-chip, .wg-chip.glass { background: rgb(255 255 255 / .2); color: #fff; }
.wg.teal .wg-chip { background: color-mix(in srgb, var(--wg-teal-t) 12%, transparent); }
.wg-chip.warm { background: #fff1d9; color: #7a4a06; }
.wg-chip.alert { background: color-mix(in srgb, var(--danger) 16%, var(--surface)); color: var(--danger); }
.wg-chip.gold { background: rgb(255 211 107 / .18); color: #ffd36b; }
.wg-pill { flex: 0 1 auto; min-width: 0; padding: 5px 10px; border-radius: 999px; background: rgb(255 255 255 / .2); font-size: calc(12px * var(--fs, 1)); font-weight: 700; overflow-wrap: anywhere; }
.wg-icon-btn { flex: none; margin-inline-start: auto; width: 40px; height: 40px; border-radius: 20px; border: 1px solid rgb(255 255 255 / .35); background: rgb(255 255 255 / .14); color: inherit; display: grid; place-items: center; cursor: pointer; }
.wg-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; max-width: 100%; padding: 4px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: calc(13.5px * var(--fs, 1)); font-weight: 600; line-height: 1.2;
  text-decoration: none; cursor: pointer; text-align: center; overflow-wrap: anywhere;
}
.wg-btn svg { width: 16px; height: 16px; flex: none; }
.wg-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.wg-btn.glass, .wg.dark .wg-btn { background: rgb(255 255 255 / .18); border-color: rgb(255 255 255 / .35); color: #fff; }
.wg.safe .wg-btn.primary { background: #c2410c; border-color: #c2410c; color: #fff; }
.wg-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.wg-more { font-size: calc(12.5px * var(--fs, 1)); font-weight: 600; color: var(--accent); }
.wg-stale { flex: none; padding: 2px 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: calc(11px * var(--fs, 1)); font-weight: 600; }
.wg-ring { flex: none; color: var(--accent); }
.wg-wicon { flex: none; }
/* День */
.wg-day .wg-in { padding: 16px; gap: 10px; }
.wg-day-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.wg-day-clock { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 150px; }
.wg-clock { font-family: var(--display); font-weight: 700; font-size: min(calc(46px * var(--fs, 1)), 17cqi); line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.wg-day-w { display: flex; align-items: center; gap: 6px; flex: none; }
.wg-day .wg-date { margin-top: -4px; }
.wg-day .wg-wline { margin-top: -6px; }
.wg-temp { font-family: var(--display); font-weight: 700; font-size: calc(28px * var(--fs, 1)); line-height: 1; }
.wg-glass { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 10px 12px; border-radius: 16px; background: rgb(255 255 255 / .16); border: 1px solid rgb(255 255 255 / .3); }
.wg-kicker { font-size: calc(12.5px * var(--fs, 1)); font-weight: 650; letter-spacing: .01em; opacity: .9; overflow-wrap: anywhere; }
.wg-kicker .wg-what { font-weight: 800; }
.wg-title { min-width: 0; font-size: calc(16.5px * var(--fs, 1)); font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.wg-headline { margin: 0; font-weight: 600; }
/* Строки главной карточки (утро, 18.11): значок · подпись · главное; каждая тема — своим рядом. */
.dl-rows { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.dl-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 9px; align-items: start; min-width: 0; }
.dl-ico { font-size: calc(17px * var(--fs, 1)); line-height: 1.35; }
.dl-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.dl-k { font-size: calc(12px * var(--fs, 1)); font-weight: 650; opacity: .88; overflow-wrap: anywhere; }
.dl-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; min-width: 0; font-size: calc(14.5px * var(--fs, 1)); font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.dl-meet .dl-main { font-size: calc(16px * var(--fs, 1)); font-weight: 700; }
.dl-main > .dl-t { flex: 1 1 8em; min-width: 0; }
.dl-time { flex: none; font-size: calc(21px * var(--fs, 1)); font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dl-place { font-size: calc(12.5px * var(--fs, 1)); line-height: 1.3; opacity: .78; overflow-wrap: anywhere; }
.dl-head { font-size: calc(14.5px * var(--fs, 1)); font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.dl-text { font-size: calc(13px * var(--fs, 1)); line-height: 1.35; opacity: .9; overflow-wrap: anywhere; }
.dl-more { align-self: flex-start; display: inline-flex; align-items: center; min-height: 44px; margin-bottom: -6px; padding: 0 14px 0 0; border: 0; background: none; color: inherit; font: inherit; font-size: calc(12.5px * var(--fs, 1)); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.dl-more[hidden] { display: none; }
/* Погода */
.wg-wrow { justify-content: space-between; align-items: flex-end; flex-wrap: wrap; flex: 1; }
.wg-phrase { font-family: var(--display); font-weight: 600; font-size: min(calc(16px * var(--fs, 1)), 8cqi); line-height: 1.25; overflow-wrap: break-word; min-width: 0; }
.wg-wrow > .wg-col:has(.wg-phrase) { flex: 1 1 14em; }
.wg-nums { font-variant-numeric: tabular-nums; }
/* Столбики — на тёмной подложке, иначе цифры часов теряются на домах Кармеля; подпись — что это. */
.wg-barbox { flex: none; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 5px 7px 4px; border-radius: 12px; background: rgb(0 0 0 / .28); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.wg-bars-cap { font-size: calc(10.5px * var(--fs, 1)); font-weight: 600; opacity: .95; white-space: nowrap; }
.wg-bars { flex: none; display: flex; align-items: flex-end; gap: 5px; height: 50px; }
.wg-bar { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.wg-bar i { width: 12px; border-radius: 4px; background: rgb(255 255 255 / .55); }
.wg-bar i.wet { background: #fff; }
.wg-bar small { font-size: calc(10px * var(--fs, 1)); opacity: .92; font-variant-numeric: tabular-nums; }
.wg-days { display: flex; flex-direction: column; gap: 4px; }
.wg-dayrow { display: grid; grid-template-columns: 2.2em minmax(0, 1fr) auto; gap: 8px; align-items: baseline; font-size: calc(13px * var(--fs, 1)); }
/* Дела: строки компактные, название переносится, а не режется */
.wg-rows { gap: 4px; }
.wg .td-row { min-height: 40px; padding: 4px 8px; border-inline-start-width: 3px; background: color-mix(in srgb, var(--bg) 70%, transparent); flex-wrap: wrap; row-gap: 0; }
/* Длинное название — до трёх строк с «…» (целиком — в мини-приложении «Дела»), иначе виджет растягивается на пол-экрана. */
.wg .td-row .td-title { white-space: normal; overflow-wrap: anywhere; font-size: calc(14px * var(--fs, 1)); line-height: 1.25; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.wg .td-row small { max-width: none; flex: 1 0 100%; padding-inline-start: 32px; white-space: normal; font-size: calc(11.5px * var(--fs, 1)); }
.wg .td-row.overdue small { color: var(--late); }
/* Деньги */
.wg-pays { display: flex; flex-direction: column; gap: 6px; }
.wg-pay { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "t n" "s s"; column-gap: 8px; align-items: baseline; }
.wg-pay-t { grid-area: t; min-width: 0; font-weight: 600; font-size: calc(13.5px * var(--fs, 1)); overflow-wrap: anywhere; }
.wg-pay .wg-num { grid-area: n; font-weight: 700; font-size: calc(13.5px * var(--fs, 1)); }
.wg-pay small { grid-area: s; }
/* Город, лента */
.wg-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.wg-list li { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.wg-tag { font-size: calc(10.5px * var(--fs, 1)); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.wg-lane { display: flex; flex-direction: column; gap: 5px; }
.wg-lrow { display: grid; grid-template-columns: 3.3em minmax(0, 1fr); gap: 8px; align-items: baseline; font-size: calc(13.5px * var(--fs, 1)); }
.wg-lrow.k-mark { color: var(--muted); }
/* Укрытия */
.wg-shel { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.wg-arrow { flex: none; width: 34px; height: 34px; border-radius: 17px; display: grid; place-items: center; background: #e8590c; color: #fff; font-weight: 800; font-size: 18px; line-height: 1; transform: rotate(var(--deg, 0deg)); }
.wg-arrow.big { width: 44px; height: 44px; border-radius: 22px; font-size: 22px; }
/* Иврит — справа (Алексей 07.11): строка на иврите выравнивается по своему языку, русская — по своему. */
.wg [lang="he"], .wa-sh [lang="he"] { text-align: start; }
/* Кольцо, приборка */
.wg-dial { position: relative; display: grid; place-items: center; flex: 1; }
.wg-dial-svg { width: 100%; max-width: 300px; height: auto; }
.wg-dial-now { position: absolute; font-family: var(--display); font-size: calc(24px * var(--fs, 1)); }
.wg-dial-svg .dl-track { stroke: var(--surface-2); }
.wg-dial-svg .dl-ev { stroke: #2f6fdb; }
.wg-dial-svg .dl-sun { stroke: #f5a524; opacity: .8; }
.wg-dial-svg .dl-tick { stroke: var(--muted); stroke-width: 1; }
.wg-dial-svg .dl-tick.big { stroke-width: 2; }
.wg-dial-svg .dl-hour { fill: var(--muted); font-size: 12px; }
.wg-dial-svg .dl-task { fill: var(--surface); stroke: #c45a6a; stroke-width: 3; }
.wg-dial-svg .dl-task.done { fill: var(--accent); }
.wg-dial-svg .dl-hand { stroke: var(--danger); }
.wg-dial-svg .dl-hand-dot { fill: var(--danger); }
.wg.dashw { background: radial-gradient(circle at 50% 0, #1b2830, #0d1114); }
.wg-gauges { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.wg-gauge { position: relative; display: grid; place-items: center; }
.wg-gauge svg { width: 100%; max-width: 120px; height: auto; }
.wg-gv { position: absolute; bottom: 10%; display: flex; flex-direction: column; align-items: center; }
.wg-gv b { font-family: var(--display); font-size: calc(15px * var(--fs, 1)); }
.wg-gv small { font-size: calc(10.5px * var(--fs, 1)); color: #9fb0bb; }
.wg-light { padding: 3px 8px; border-radius: 999px; background: rgb(255 255 255 / .08); color: rgb(255 255 255 / .7); font-size: calc(11.5px * var(--fs, 1)); }
.wg-light.on { background: rgb(245 184 61 / .2); color: #ffd36b; }
.wg-light.red { background: rgb(255 107 90 / .22); color: #ffb3ab; }
/* Тревоги сверху */
.wg-alerts { display: flex; flex-direction: column; gap: 6px; }
.wg-alert { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 14px; border: 0; border-radius: 16px; background: var(--danger); color: #fff; font: inherit; font-weight: 700; text-align: start; cursor: pointer; overflow-wrap: anywhere; }
.wg-alert svg { width: 20px; height: 20px; flex: none; }
.wg-alert span { min-width: 0; }
.wg-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.wg-empty { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px; border: 2px dashed var(--border); border-radius: 22px; color: var(--muted); text-align: center; }
.wg-empty p { margin: 0; }
/* «Изменить»: покачиваются, ✕ слева, размер справа, ↘ — следующий размер. Поля шире — кнопки не закрывают текст. */
.wg-editbar { position: sticky; top: calc(var(--header-h) + var(--safe-top) + 6px); z-index: 6; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lift); }
.wg-edit-t { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.wg-edit-t small { color: var(--muted); font-size: calc(12.5px * var(--fs, 1)); overflow-wrap: anywhere; }
.wg-edit-t small .nw { white-space: nowrap; }
.wg.editing { cursor: grab; animation: wg-wiggle .9s ease-in-out infinite alternate; box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 60%, transparent), var(--shadow); }
.wg.editing:nth-child(even) { animation-delay: -.45s; }
.wg.editing .wg-in { pointer-events: none; padding-top: 46px; padding-bottom: 50px; }
@keyframes wg-wiggle { from { transform: rotate(-.5deg); } to { transform: rotate(.5deg); } }
.wg-ctl { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.wg-ctl > * { pointer-events: auto; }
.wg-x, .wg-rs { position: absolute; display: grid; place-items: center; border-radius: 50%; border: 2px solid #fff; cursor: pointer; box-shadow: 0 2px 6px rgb(0 0 0 / .25); }
.wg-x::after, .wg-rs::after { content: ""; position: absolute; inset: -7px; }
.wg-x { top: 7px; inset-inline-start: 7px; width: 32px; height: 32px; background: var(--danger); color: #fff; }
.wg-x svg { width: 14px; height: 14px; stroke-width: 3; }
.wg-rs { bottom: 7px; inset-inline-end: 7px; width: 36px; height: 36px; background: var(--accent); color: var(--accent-text); }
.wg-size { position: absolute; top: 10px; inset-inline-end: 10px; max-width: calc(100% - 60px); padding: 3px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: calc(11.5px * var(--fs, 1)); font-weight: 700; }
.wg.wg-float { position: fixed !important; z-index: 60; margin: 0; pointer-events: none; animation: none; transform: scale(1.04) rotate(1.5deg); box-shadow: var(--shadow-lift); opacity: .95; }
.wg-ph { border-radius: 22px; border: 2px dashed var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); display: grid; place-items: center; color: var(--accent); font-size: calc(12px * var(--fs, 1)); font-weight: 600; min-width: 0; }
body.wg-dragging { cursor: grabbing; }
.wg-add { width: 100%; display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 24px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.wg-add-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 10px; }
.wg-add-head strong { font-family: var(--display); font-size: calc(18px * var(--fs, 1)); }
.wg-add-head small { color: var(--muted); }
.wg-add-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 10px; }
.wg-add-card { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 12px; border-radius: 18px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; text-align: start; cursor: pointer; overflow-wrap: anywhere; }
.wg-add-card .wg-k { flex: none; }
.wg-add-card strong { font-size: calc(13.5px * var(--fs, 1)); line-height: 1.3; }
.wg-add-card small { color: var(--muted); font-size: calc(11.5px * var(--fs, 1)); }
.wg-add-foot { flex-wrap: wrap; justify-content: center; }
/* Сцена Хайфы: облака плывут, дождь идёт, звёзды мерцают; при «уменьшить движение» — стоит */
.hs-anim.hs-cloud { animation: hs-drift linear infinite alternate; }
@keyframes hs-drift { from { transform: translateX(-26px); } to { transform: translateX(26px); } }
.hs-anim.hs-rain { animation: hs-rain .7s linear infinite; }
@keyframes hs-rain { from { transform: translate(14.5px, -40px); } to { transform: translate(0, 0); } }
.hs-anim.hs-twinkle { animation: hs-tw 3s ease-in-out infinite alternate; }
@keyframes hs-tw { to { opacity: .15; } }
.hs-anim.hs-blink { animation: hs-blink 1.6s steps(2, jump-none) infinite; }
@keyframes hs-blink { 50% { opacity: .15; } }
.hs-anim.hs-bolt { animation: hs-bolt 7s infinite; }
@keyframes hs-bolt { 0%, 89%, 93%, 100% { opacity: 0; } 90%, 92% { opacity: 1; } }
.hs-anim.hs-fog { animation: hs-fog 24s ease-in-out infinite alternate; }
@keyframes hs-fog { to { transform: translateX(-34px); } }
.hs-anim.hs-glint { animation: hs-glint 4s ease-in-out infinite alternate; }
@keyframes hs-glint { to { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .hs-anim { animation: none !important; } .wg.editing { animation: none; } }

/* ---------- Мини-приложения виджетов (окно на весь экран) ---------- */
.wapp { padding: 0; margin: 0; border: 0; width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; background: var(--bg); color: var(--text); overflow: hidden; }
.wapp::backdrop { background: rgb(0 0 0 / .45); }
@media (min-width: 900px) { .wapp { width: min(780px, calc(100vw - 48px)); height: min(calc(100dvh - 48px), 980px); margin: auto; border-radius: 24px; box-shadow: var(--shadow-lift); } }
.wa-box { display: flex; flex-direction: column; height: 100%; }
.wa-head { flex: none; display: flex; align-items: center; gap: 6px; padding: calc(var(--safe-top) + 6px) 10px 6px; border-bottom: 1px solid var(--border); background: var(--bg); }
.wa-titles { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.wa-titles h2 { margin: 0; font-size: calc(18px * var(--fs, 1)); line-height: 1.25; overflow-wrap: anywhere; }
.wa-subtitle { color: var(--muted); font-size: calc(12.5px * var(--fs, 1)); overflow-wrap: anywhere; }
.wa-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 12px; padding: 12px 14px calc(28px + var(--safe-bottom)); }
.wa-body > * { flex: none; min-width: 0; }
.wa-card { min-width: 0; padding: 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); }
.wa-week-line { margin: 0; font-weight: 650; overflow-wrap: anywhere; }
.wa-card.overdue .wa-ttl h3 { color: var(--late); }
.wa-ttl { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin-bottom: 8px; }
.wa-ttl h3 { margin: 0; flex: 1 1 auto; min-width: 0; font-size: calc(15px * var(--fs, 1)); overflow-wrap: anywhere; }
.wa-note { margin: 0; color: var(--muted); font-size: calc(13px * var(--fs, 1)); line-height: 1.4; overflow-wrap: anywhere; }
.wa-note.warn { color: var(--warn); font-weight: 600; }
.wa-muted { color: var(--muted); font-size: calc(13px * var(--fs, 1)); overflow-wrap: anywhere; }
.wa-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Вкладки мини-приложений: равные ячейки в один ряд (подпись переносится внутри ячейки), а не «3 + 2» разной ширины. */
.wa-seg { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, auto)); justify-content: stretch; gap: 1px; align-self: stretch; border-radius: 14px; background: var(--border); }
.wa-seg .seg-btn { min-width: 0; min-height: 44px; padding: 4px 6px; border: 0; line-height: 1.2; font-size: calc(13.5px * var(--fs, 1)); white-space: normal; overflow-wrap: break-word; -webkit-hyphens: manual; hyphens: manual; }
.wa-seg .seg-btn + .seg-btn { border: 0; }
.wa-modes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wa-modes > .seg-btn:first-child { grid-column: 1 / -1; }
.wa-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.wa-acts .btn { white-space: normal; height: auto; min-height: 40px; }
.wa-link { align-self: center; }
.wa-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.wa-chip { padding: 4px 10px; border-radius: 999px; background: var(--surface-2); font-size: calc(13px * var(--fs, 1)); overflow-wrap: anywhere; }
.wa-chip.alert { background: color-mix(in srgb, var(--danger) 15%, var(--surface)); color: var(--danger); font-weight: 600; }
.wa-chip.warn { background: color-mix(in srgb, var(--warn) 15%, var(--surface)); color: var(--warn); }
.wa-headline { margin: 0 0 8px; font-weight: 600; overflow-wrap: anywhere; }
.wa-hero { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 22px; background: var(--g); color: #fff; }
.wa-hero-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
.wa-hero-prog { font-size: calc(13px * var(--fs, 1)); opacity: .92; }
.wa-clock { font-family: var(--display); font-weight: 700; font-size: calc(56px * var(--fs, 1)); line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.wa-hero .wg-line { color: rgb(255 255 255 / .92); }
.wa-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
/* Два крупных времени рядом (свечи и исход): размер по ширине экрана, чтобы «16:14» и «17:12» не наезжали. */
.wa-two .wa-big { font-size: min(calc(40px * var(--fs, 1)), 10.5vw); }
.wa-two > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wa-big { font-family: var(--display); font-weight: 700; font-size: calc(40px * var(--fs, 1)); line-height: 1.05; font-variant-numeric: tabular-nums; }
.wa-scene { position: relative; isolation: isolate; display: flex; min-height: calc(230px * var(--fs, 1)); border-radius: 22px; overflow: hidden; color: #fff; }
.wa-scene-in { position: relative; z-index: 1; margin-top: auto; display: flex; flex-direction: column; gap: 4px; padding: 16px; min-width: 0; }
.wa-temp { font-family: var(--display); font-weight: 700; font-size: calc(72px * var(--fs, 1)); line-height: .95; letter-spacing: -.02em; }
.wa-banner { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 16px; background: #ffd36b; color: #3a2a00; font-weight: 600; overflow-wrap: anywhere; }
.wa-banner svg { width: 20px; height: 20px; flex: none; }
.wa-banner.alert { background: var(--danger); color: #fff; }
.wa-hgrid { display: flex; align-items: flex-end; gap: 6px; overflow-x: auto; padding-bottom: 4px; min-height: calc(134px * var(--fs, 1)); scrollbar-width: thin; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); padding-inline-end: 24px; }
.wa-h { flex: 0 0 calc(36px * var(--fs, 1)); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.wa-hv { font-size: calc(11.5px * var(--fs, 1)); font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.wa-h small:last-child { color: var(--muted); font-size: calc(11.5px * var(--fs, 1)); font-variant-numeric: tabular-nums; }
.wa-hbar { width: 16px; border-radius: 6px; background: color-mix(in srgb, var(--p1) 40%, transparent); }
.wa-hbar.t { background: #f5b83d; }
.wa-hbar.wet { background: var(--p1); }
.wa-drows { display: flex; flex-direction: column; gap: 8px; }
.wa-drow { display: grid; grid-template-columns: 2.4em 26px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.wa-dcond { color: var(--muted); overflow-wrap: anywhere; font-size: calc(14px * var(--fs, 1)); }
.wa-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr)); gap: 10px; }
.wa-tile { display: flex; flex-direction: column; gap: 4px; }
.wa-tile strong { font-family: var(--display); font-size: calc(26px * var(--fs, 1)); }
.wa-tile span:not(.wa-lbl) { font-size: calc(13px * var(--fs, 1)); overflow-wrap: anywhere; }
.wa-lbl { font-size: calc(11px * var(--fs, 1)); font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.wa-scale { position: relative; display: block; height: 6px; margin-top: 4px; border-radius: 3px; background: linear-gradient(90deg, #4cc488 0 40%, #f0b04a 40% 70%, #ff7a6e 70%); }
.wa-scale::after { content: ""; position: absolute; left: var(--v); top: -3px; width: 4px; height: 12px; margin-left: -2px; border-radius: 2px; background: var(--text); }
.wa-sun svg { color: var(--muted); display: block; }
.wa-sunrow { display: grid; grid-template-columns: auto auto; justify-content: space-between; grid-template-areas: "a c" "b b"; gap: 2px 10px; font-size: calc(13px * var(--fs, 1)); }
.wa-sunrow > :first-child { grid-area: a; } .wa-sunrow > :last-child { grid-area: c; }
.wa-sunmid { grid-area: b; text-align: center; color: var(--muted); }
.wa-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.wa-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; overflow-wrap: anywhere; min-width: 0; }
.wa-list li > * { min-width: 0; }
.wa-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.wa-item { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); overflow-wrap: anywhere; min-width: 0; }
.wa-card .wa-item { background: var(--bg); }
.wa-item.alert { border-color: var(--danger); }
.wa-item.alert b { color: var(--danger); }
.wa-item .wa-acts { margin-top: 4px; }
.wa-pay, .wa-list > li.wa-pay { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "m n" "b b"; gap: 6px 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.wa-card .wa-pay { background: var(--bg); }
.wa-pay-main { grid-area: m; display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.wa-pay > .wa-num { grid-area: n; font-weight: 700; }
.wa-pay > .btn { grid-area: b; justify-self: start; }
.wa-pay.paid { opacity: .65; }
.wa-pay.paid b { text-decoration: line-through; }
/* «Траты» (вкладка «Деньги»): подписки, сумма в месяц, столбики счетов за год. Сумма «5,99 $ ≈ 22 ₪» переносится
   по «≈», а не сжимает название подписки. */
.wa-spend { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.wa-sumline { margin: 0 0 4px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.wa-sumline .wa-big { font-size: min(calc(40px * var(--fs, 1)), 11vw); }
.wa-sub > .wa-num { display: flex; flex-direction: column; align-items: flex-end; text-align: end; }
.wa-sub > .wa-num > span { white-space: nowrap; }
.wa-sub > .wa-num > .wa-ils { font-weight: 500; color: var(--muted); font-size: .9em; }
.wa-sub.off { opacity: .6; }
.wa-bars { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 3px; align-items: end; margin: 2px 0 10px; }
.wa-bar { display: flex; flex-direction: column; align-items: stretch; gap: 4px; min-width: 0; min-height: 44px; padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer; }
.wa-bar-col { display: flex; align-items: flex-end; height: 84px; border-radius: 6px; background: var(--bg); overflow: hidden; }
.wa-bar-fill { display: block; width: 100%; border-radius: 6px 6px 0 0; background: color-mix(in srgb, var(--accent) 45%, transparent); }
.wa-bar.on .wa-bar-fill { background: var(--accent); }
.wa-bar small { font-size: min(calc(10.5px * var(--fs, 1)), 2.6vw); text-align: center; white-space: nowrap; }
.wa-bar.on small { color: var(--text); font-weight: 700; }
.wa-bills li { justify-content: space-between; }
.wa-bills .wa-bill-total { padding-top: 6px; border-top: 1px dashed var(--border); font-weight: 700; }
/* «Траты» по категориям (пачка 5): полоса долями, строки категорий (значок · название · сумма, под ними доля полоской),
   «Месяц к прошлому» — рост красным, снижение зелёным. Названия переносятся, суммы — в одну строку. */
.wa-catbar { display: flex; gap: 2px; height: 14px; margin: 4px 0 10px; border-radius: 7px; overflow: hidden; background: var(--bg); }
.wa-catbar-part { display: block; flex-basis: 0; min-width: 3px; background: var(--tone); }
.wa-cats-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.wa-cat { border-radius: 14px; background: var(--surface); border: 1px solid var(--border); min-width: 0; }
.wa-cat-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "i t n" "s s s"; align-items: center; gap: 6px 10px;
  width: 100%; min-height: 44px; padding: 10px 12px; border: 0; background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; }
.wa-cat-dot { grid-area: i; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; font-size: 18px;
  background: color-mix(in srgb, var(--tone) 18%, transparent); }
.wa-cat-t { grid-area: t; display: flex; flex-direction: column; gap: 1px; min-width: 0; overflow-wrap: anywhere; }
.wa-cat-head > .wa-num { grid-area: n; font-weight: 700; }
.wa-cat-share { grid-area: s; display: block; height: 5px; border-radius: 3px; background: var(--bg); overflow: hidden; }
.wa-cat-share > span { display: block; height: 100%; border-radius: 3px; background: var(--tone); }
.wa-cat-items { list-style: none; margin: 0; padding: 0 12px 10px; display: flex; flex-direction: column; gap: 6px; }
.wa-cat-items li { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "t n" "b b"; gap: 4px 10px; align-items: center;
  padding-top: 6px; border-top: 1px dashed var(--border); }
.wa-cat-item { grid-area: t; min-width: 0; overflow-wrap: anywhere; }
.wa-cat-items .wa-num { grid-area: n; }
.wa-cat-items .btn { grid-area: b; justify-self: start; }
/* Лимиты трат (михкар-4, как YNAB): «осталось N ₪ из M» под категорией, полоска — доля лимита; с 80% — янтарь, сверх — красный. */
.wa-cat-lim { font-weight: 600; color: var(--muted); }
.wa-cat.lim-warn .wa-cat-lim { color: var(--warn); }
/* Михкар-5: лимит без данных по карте — серым, без полоски. */
.wa-cat.lim-nodata .wa-cat-lim { color: var(--muted); font-weight: 400; font-style: italic; }
.wa-cat.lim-nodata .wa-cat-share > span { background: transparent; }
.wa-cat.lim-over .wa-cat-lim { color: var(--danger); }
.wa-cat.lim-warn .wa-cat-share > span { background: var(--warn); }
.wa-cat.lim-over .wa-cat-share > span { background: var(--danger); }
.wa-cat.lim-over { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.wa-cat-items li.wa-cat-limrow { display: block; }
.wa-lim-alerts { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.wa-lim-alerts li { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 12px; overflow-wrap: anywhere;
  background: color-mix(in srgb, var(--warn) 14%, transparent); }
.wa-lim-alerts li.lim-over { background: color-mix(in srgb, var(--danger) 14%, transparent); }
.wa-lim-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.wa-lim-row { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(5.5em, 7em) auto; gap: 8px; align-items: center; min-height: 44px; }
.wa-lim-row > .wa-cat-dot { grid-area: auto; }
.wa-lim-t { min-width: 0; overflow-wrap: anywhere; }
.wa-lim-in { text-align: end; min-width: 0; }
.wg-chip.lim-warn { color: var(--warn); font-weight: 600; }
.wg-chip.lim-over { color: var(--danger); font-weight: 600; }
.wa-trend-head { margin: 0 0 8px; font-weight: 600; overflow-wrap: anywhere; }
.wa-trend-head.up, .wa-changes li.up > strong { color: var(--danger); }
.wa-trend-head.down, .wa-changes li.down > strong { color: var(--ok); }
.wa-sub-h { margin: 6px 0; font-size: .95em; }
.wa-changes li { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "t d" "f f"; gap: 2px 10px; align-items: baseline; }
.wa-changes li > span:first-child { grid-area: t; min-width: 0; overflow-wrap: anywhere; }
.wa-changes li > .wa-muted { grid-area: f; }
.wa-changes li > strong { grid-area: d; }
/* Строки дел в мини-приложениях: название — во всю ширину, подпись (срок, чек-лист, список) — своей строкой под ним.
   Раньше подпись стояла справа и сжимала название в столбик по букве (скриншот Алексея 06.11, крупный шрифт). */
.wapp .td-row { flex-wrap: wrap; row-gap: 2px; padding-block: 6px; }
.wapp .td-row .td-title { flex: 1 1 0; min-width: min(9em, 55%); white-space: normal; overflow-wrap: break-word; }
.wapp .td-row small { flex: 1 0 100%; max-width: none; white-space: normal; overflow-wrap: break-word; padding-inline-start: 32px; }
.wapp .td-row:has(> .td-when) small { padding-inline-start: 94px; }
.wapp .td-row:has(> .td-when):has(> .cal-check) small { padding-inline-start: 126px; }
/* Чек-лист в строке дела: «☑ 3/8 ▾» справа от названия, пункты — под подписью, на всю ширину, с отступом под галочку. */
.td-row:has(> .td-cl) { flex-wrap: wrap; row-gap: 2px; }
.td-row > .td-cl { margin-block: -4px; margin-inline-end: -6px; align-self: flex-start; }
.td-row > .td-cl.all:not(.open) { color: var(--accent); }
/* Подпись задачи на иврите: справа под названием, отступ под галочку — слева */
.wg .td-row small[dir="rtl"], .wapp .td-row small[dir="rtl"] { padding-inline-start: 0; padding-inline-end: 32px; }
.td-row > .row-checklist { flex: 1 1 100%; margin: 2px 0 0; margin-inline-start: 32px; border-top: 1px dashed var(--border); padding-top: 4px; min-width: 0; }
.td-row > .row-checklist .row-ci { font-size: calc(14px * var(--fs, 1)); }
.wapp .td-row:has(> .td-when) > .row-checklist { margin-inline-start: 94px; }
.wapp .td-row:has(> .td-when):has(> .cal-check) > .row-checklist { margin-inline-start: 126px; }
.td-row.done > .row-checklist { opacity: .7; }
.wa-add .quick-add { box-shadow: none; }
.wa-tasks { display: flex; flex-direction: column; gap: 12px; }
/* Укрытия */
.wa-shtop, .wa-shlist { display: flex; flex-direction: column; gap: 10px; }
.wa-searchrow { display: flex; flex-wrap: wrap; gap: 8px; }
/* Одной рукой (михкар-6): на телефоне поиск, «Рядом со мной» и тип — внизу, под пальцем; список листается над ними. */
@media (max-width: 899px) {
  .wa-body:has(> .wa-shtop) { padding-bottom: 0; }
  .wa-body > .wa-shtop { order: 2; position: sticky; bottom: 0; z-index: 2; margin: auto -14px 0; padding: 10px 14px calc(10px + var(--safe-bottom));
    background: var(--bg); border-top: 1px solid var(--border); box-shadow: 0 -6px 16px rgb(0 0 0 / .08); }
  .wa-body > .wa-shtop { gap: 8px; }
  .wa-body > .wa-shtop .wa-searchrow { flex-wrap: nowrap; }
  .wa-body > .wa-shtop .wa-search { flex: 1 1 0; }
  .wa-body > .wa-shtop .wa-locate { flex: 0 1 auto; max-width: 48%; }
  .wa-body > .wa-shtop > .wa-geo { order: -1; }
  .wa-body > .wa-shtop > .wa-geo .wa-note { margin: 0; font-size: calc(13px * var(--fs, 1)); }
  .wa-body > .wa-shtop > .wa-geo:empty { display: none; }
}
.wa-search { flex: 1 1 200px; min-width: 0; min-height: 48px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: calc(16px * var(--fs, 1)); }
.wa-locate { flex: 0 0 auto; display: flex; }
.wa-locate .btn { min-height: 48px; white-space: normal; height: auto; }
.wa-locate .btn svg { width: 18px; height: 18px; }
.wa-shs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.wa-sh { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "m a" "b b"; gap: 8px 12px; padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.wa-sh.t-p { border-inline-start: 4px solid var(--wg-type-pt); }
.wa-sh-main { grid-area: m; display: flex; flex-direction: column; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
.wa-sh .wg-arrow { grid-area: a; }
.wa-sh .wa-acts { grid-area: b; }
.wa-sh-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.wa-sh-head b { font-size: calc(16px * var(--fs, 1)); }
.wa-type { padding: 2px 8px; border-radius: 999px; background: var(--wg-type-m); color: var(--wg-type-mt); font-size: calc(12px * var(--fs, 1)); font-weight: 700; }
.wa-type.t-p { background: var(--wg-type-p); color: var(--wg-type-pt); }
.wa-warn { color: var(--warn); font-size: calc(12.5px * var(--fs, 1)); font-weight: 600; }

/* «Деньги под рукой»: конвертер и скидка */
.money-tools { display: flex; flex-direction: column; gap: 10px; }
.mt-tabs { width: 100%; }
.mt-tabs .seg-btn { flex: 1; }
.mt-body { display: flex; flex-direction: column; gap: 8px; }
.mt-label { margin: 4px 0 0; color: var(--muted); font-size: calc(13px * var(--fs, 1)); display: flex; flex-direction: column; gap: 6px; }
.mt-field { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 0 14px; border-radius: 16px; background: var(--bg); border: 2px solid var(--accent); }
.mt-field b { font-size: calc(22px * var(--fs, 1)); color: var(--accent); }
.mt-amount { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; color: var(--text); font: inherit; font-size: calc(26px * var(--fs, 1)); font-weight: 700; font-variant-numeric: tabular-nums; }
.mt-code { color: var(--muted); font-weight: 700; }
.mt-rows { display: flex; flex-direction: column; }
.mt-row { display: flex; align-items: center; gap: 8px; min-height: 58px; border-bottom: 1px solid var(--border); }
.mt-pick { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 54px; padding: 0; border: 0; background: none; color: var(--text); font: inherit; text-align: start; cursor: pointer; }
.mt-pick:disabled { cursor: default; opacity: .6; }
.mt-sym { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; flex: none; font-size: 14px; }
.mt-val { display: flex; flex-direction: column; min-width: 0; }
.mt-val strong { font-size: calc(18px * var(--fs, 1)); font-variant-numeric: tabular-nums; }
.mt-val small { color: var(--muted); font-size: calc(12px * var(--fs, 1)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-add { display: flex; flex-wrap: wrap; gap: 6px; }
.mt-chip { min-height: 38px; padding: 0 12px; border-radius: 999px; border: 1px dashed var(--muted); background: transparent; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.mt-chip:disabled { opacity: .45; cursor: default; }
.mt-note { margin: 4px 0 0; color: var(--muted); font-size: calc(12px * var(--fs, 1)); }
.mt-pcts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.mt-pcts button { min-height: 46px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.mt-pcts button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.mt-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: var(--tap); }
.mt-grow { flex: 1; }
.mt-small { width: 96px; min-height: 44px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); color: var(--text); padding: 0 12px; font: inherit; font-size: calc(18px * var(--fs, 1)); font-weight: 600; box-sizing: border-box; }
.mt-small.wide { width: 100%; font-size: calc(22px * var(--fs, 1)); }
.mt-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mt-result { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; border-radius: 22px; background: var(--accent); color: var(--accent-text, #fff); margin-top: 6px; }
.mt-result small { opacity: .85; font-size: calc(13px * var(--fs, 1)); }
.mt-result strong { font-family: "Unbounded", system-ui, sans-serif; font-size: calc(32px * var(--fs, 1)); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.mt-result span { opacity: .9; }

/* ---------- Сейф (#/vault) ---------- */
.vault-screen { display: flex; flex-direction: column; gap: 14px; padding: 16px; max-width: 640px; margin: 0 auto; width: 100%; box-sizing: border-box; padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 24px); }
.vault-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 16px; display: flex; flex-direction: column; gap: 12px; text-align: center; align-items: stretch; }
.vault-card h2 { margin: 0; font-size: calc(20px * var(--fs, 1)); }
.vault-card p { margin: 0; }
.vault-badge { width: 56px; height: 56px; border-radius: 18px; margin: 0 auto; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.vault-badge svg { width: 30px; height: 30px; }
.vault-points { text-align: start; margin: 0; padding-inline-start: 20px; display: grid; gap: 8px; color: var(--text); }
.vault-muted { color: var(--muted); }
.vault-muted.small { font-size: calc(13px * var(--fs, 1)); }
.vault-err { min-height: 1.3em; color: var(--danger); font-size: calc(14px * var(--fs, 1)); }
.vault-row { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.vault-check { display: flex; align-items: center; gap: 10px; min-height: var(--tap); justify-content: center; cursor: pointer; }
.vault-check input { width: 22px; height: 22px; accent-color: var(--accent); }
.vault-recovery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 14px; border-radius: 12px; background: var(--surface-2); direction: ltr;
  font: 600 calc(17px * var(--fs, 1)) / 1.2 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .08em; user-select: all; }
.vault-recovery span { padding: 4px 0; }
.vault-code-in { text-align: center; direction: ltr; font: 600 calc(18px * var(--fs, 1)) ui-monospace, Menlo, Consolas, monospace; letter-spacing: .12em; text-transform: uppercase; max-width: 220px; margin: 0 auto; }
.vault-code-in.wide { max-width: none; width: 100%; resize: none; font-size: calc(16px * var(--fs, 1)); letter-spacing: .06em; }
.pin-pad { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.pin-pad.busy .pin-keys { opacity: .5; pointer-events: none; }
.pin-dots { display: flex; justify-content: center; gap: 12px; min-height: 18px; direction: ltr; }
.pin-dots span { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--muted); }
.pin-dots span.on { background: var(--accent); border-color: var(--accent); }
.pin-keys { display: grid; grid-template-columns: repeat(3, 72px); gap: 12px; justify-content: center; direction: ltr; }
.pin-key { width: 72px; height: 60px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: calc(24px * var(--fs, 1)); font-weight: 600; display: grid; place-items: center; cursor: pointer; }
.pin-key:active { filter: brightness(.92); }
.pin-key.ok { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.pin-key svg { width: 24px; height: 24px; }
.pin-pad.shake .pin-dots { animation: pin-shake .35s; }
@keyframes pin-shake { 25% { transform: translateX(-8px); } 50% { transform: translateX(8px); } 75% { transform: translateX(-4px); } }
@media (prefers-reduced-motion: reduce) { .pin-pad.shake .pin-dots { animation: none; } }
.vault-open { display: flex; flex-direction: column; gap: 12px; }
.vault-hint { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); font-size: calc(14px * var(--fs, 1)); }
.vault-hint[data-hint="bio"], .vault-hint[data-hint="remind"] { flex-wrap: wrap; }
.vault-hint .vault-row { justify-content: flex-end; }
.pin-pad .vault-stack { width: 100%; max-width: 320px; }
.vault-tools { display: flex; gap: 8px; }
.vault-people { display: flex; flex-wrap: wrap; gap: 6px; }
.vault-people .chip { min-height: 36px; padding: 0 12px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); color: inherit; font: inherit; font-size: calc(13.5px * var(--fs, 1)); cursor: pointer; }
.vault-people .chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
@media (pointer: coarse) { .vault-people .chip { min-height: 44px; } }
.vault-person { color: var(--muted); font-weight: 400; }
.vault-sum { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.vault-sum li { display: flex; align-items: center; gap: 10px; min-height: 32px; }
.vault-sum li span { flex: 1; min-width: 0; }
.vault-sum svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.vault-titles ul, .vault-errs ul { margin: 6px 0 0; padding-inline-start: 18px; max-height: 40vh; overflow: auto; font-size: calc(13.5px * var(--fs, 1)); }
.vault-titles summary, .vault-errs summary { cursor: pointer; min-height: 36px; display: flex; align-items: center; color: var(--muted); }
.vault-hint.small { font-size: calc(13px * var(--fs, 1)); justify-content: flex-start; }
.vault-hint.small svg { width: 16px; height: 16px; flex: none; }
.vault-hint.warn { background: color-mix(in srgb, var(--danger) 12%, transparent); display: block; }
.vault-tools .input { flex: 1; min-width: 0; }
.vault-list { display: flex; flex-direction: column; gap: 14px; }
.vault-group { display: flex; flex-direction: column; gap: 6px; }
.vault-group h3 { margin: 0; font-size: calc(13px * var(--fs, 1)); color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.vault-item { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-align: start; cursor: pointer; width: 100%; }
.vault-item.broken { opacity: .6; }
.vault-item > svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.vault-ico { width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; flex: none; color: var(--accent); }
.vault-ico svg { width: 20px; height: 20px; }
.vault-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.vault-txt b, .vault-txt small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vault-txt small { color: var(--muted); }
.exp-soon { color: var(--warn) !important; }
.exp-expired { color: var(--danger) !important; }
.vault-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 32px 16px; color: var(--muted); text-align: center; }
.vault-empty svg { width: 40px; height: 40px; }
.vault-foot { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: calc(13px * var(--fs, 1)); margin: 4px 0 0; text-align: center; }
.vault-foot svg { width: 16px; height: 16px; flex: none; }
.vault-actions { display: flex; gap: 2px; }
.vault-stack { display: flex; flex-direction: column; gap: 12px; }
.vault-stack p { margin: 0; }
.vault-type { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.vault-type svg { width: 18px; height: 18px; }
.vault-fields { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.vault-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "dt btns" "dd btns"; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); column-gap: 8px; }
.vault-field dt { grid-area: dt; color: var(--muted); font-size: calc(13px * var(--fs, 1)); }
.vault-field dd { grid-area: dd; margin: 0; overflow-wrap: anywhere; font-size: calc(16px * var(--fs, 1)); }
.vault-field dd.secret { font-family: ui-monospace, Menlo, Consolas, monospace; }
.vault-fbtns { grid-area: btns; display: flex; }
.vault-note { white-space: pre-wrap; overflow-wrap: anywhere; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.vault-inrow { display: flex; gap: 4px; align-items: center; }
.vault-inrow .input { flex: 1; min-width: 0; }
.vault-extra-list { display: flex; flex-direction: column; gap: 8px; }
.vault-field dd.secret { cursor: pointer; }
.vault-field dd.secret.shown { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: calc(18px * var(--fs, 1)); letter-spacing: .02em; }
.vault-big-ic { font-weight: 700; font-size: calc(13px * var(--fs, 1)); letter-spacing: -.02em; }
.vault-blocks { display: flex; flex-direction: column; gap: 8px; }
.vault-block { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.vault-block > summary { list-style: none; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 4px 12px; cursor: pointer; }
.vault-block > summary::-webkit-details-marker { display: none; }
.vault-block > summary > small { color: var(--muted); }
.vault-block > summary > svg { width: 20px; height: 20px; margin-inline-start: auto; color: var(--muted); transition: transform .15s; flex: none; }
.vault-block[open] > summary > svg { transform: rotate(90deg); }
.vault-block > summary[dir="rtl"] > svg { transform: scaleX(-1); }
.vault-block[open] > summary[dir="rtl"] > svg { transform: rotate(90deg); }
.vault-dlg .dlg-actions .btn { white-space: normal; text-align: center; line-height: 1.25; padding-block: 8px; }
.vault-block > .vault-fields { padding: 0 12px 6px; }
.vault-block-name { font-weight: 600; min-width: 0; flex: 0 1 auto; overflow-wrap: anywhere; }
.vault-av { width: 30px; height: 30px; flex: none; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--av) 16%, var(--surface)); color: var(--av); font-weight: 700; font-size: calc(14px * var(--fs, 1)); }
.vault-av.person { border-radius: 50%; background: var(--av); color: #ffffff; }
.vault-cells { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.vault-cell { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.vault-cell b { width: 52px; height: 64px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--surface-2); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: calc(36px * var(--fs, 1)); }
.vault-cell small { color: var(--muted); font-size: calc(12px * var(--fs, 1)); }
.vault-cell.digit b, .vault-legend .digit { color: var(--accent); }
.vault-cell.symbol b, .vault-legend .symbol { color: var(--warm); }
.vault-legend { text-align: center; color: var(--muted); margin: 0; }
.vault-legend span { font-weight: 700; font-family: ui-monospace, Menlo, Consolas, monospace; }
.vault-replace { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.vault-extra-list:empty { display: none; }
.vault-extra { display: flex; flex-direction: column; gap: 4px; padding: 8px; border: 1px solid var(--border); border-radius: 10px; }
.vault-extra-secret { display: flex; align-items: center; gap: 6px; min-height: 36px; color: var(--muted); font-size: calc(13.5px * var(--fs, 1)); }
.vault-extra-secret input { width: 20px; height: 20px; }
@media (pointer: coarse) { .vault-extra-secret { min-height: 44px; } }
.vault-gen { display: block; padding: 14px; border-radius: 12px; background: var(--surface-2); font: 600 calc(17px * var(--fs, 1)) ui-monospace, Menlo, Consolas, monospace; overflow-wrap: anywhere; direction: ltr; text-align: center; user-select: all; }
.vault-range { display: flex; align-items: center; gap: 10px; }
.vault-range input { flex: 1; accent-color: var(--accent); }
.vault-dlg .pin-pad { padding: 4px 0 8px; }
.pin-pad .btn { white-space: normal; height: auto; min-height: var(--tap); padding-block: 8px; line-height: 1.25; }
.wa-fold-btn { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0; border: 0; background: none; color: var(--text); font: inherit; text-align: start; cursor: pointer; }
.wa-fold-btn > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.wa-fold-btn small { color: var(--muted); overflow-wrap: anywhere; }
.wa-fold-btn svg { width: 18px; height: 18px; }
.wa-fold .td-list-rows { margin-top: 8px; }

/* ---------- «Перетаскиваемый +» (сессия 19) ---------- */
.fab { touch-action: none; }
.fab.dragging { opacity: .35; }
.fab-ghost {
  position: fixed; left: 0; top: 0; z-index: 60; width: 56px; height: 56px; border-radius: 18px;
  background: var(--accent); color: var(--accent-text); box-shadow: var(--shadow-lift);
  display: grid; place-items: center; pointer-events: none;
}
.fab-ghost svg { width: 26px; height: 26px; }
.fab-ghost::after {
  content: attr(data-label); position: absolute; right: 64px; top: 50%; transform: translateY(-50%);
  max-width: 60vw; padding: 4px 10px; border-radius: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: var(--text); color: var(--bg); font-size: .85rem;
}
.task-group.fab-target { outline: 2px dashed var(--accent); outline-offset: 2px; border-radius: var(--radius); background: var(--accent-soft); }

/* ---------- «Сегодня вечером» и дата пункта чек-листа ---------- */
.task-group.kind-evening .group-title::before { content: "☾ "; color: var(--muted); }
.check-item .ci-date { flex: none; min-height: 28px; padding: 2px 8px; font-size: .8rem; }
.check-item .ci-date.overdue { color: var(--late); border-color: var(--late); }
.check-item.done .ci-date { opacity: .55; }

/* ---------- «Спланируй день» ---------- */
.plan-dlg .dlg-box { width: min(480px, 100%); }
.plan-day { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.plan-progress { height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.plan-progress span { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.plan-count { margin: 0; color: var(--muted); font-size: .85rem; }
.plan-card {
  position: relative; display: flex; flex-direction: column; gap: 8px; min-width: 0;
  padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  box-shadow: var(--shadow); touch-action: pan-y; user-select: none; transition: transform .15s, background .15s;
}
.plan-card.overdue { border-color: color-mix(in srgb, var(--late) 45%, var(--border)); }
.plan-card.to-today { background: color-mix(in srgb, var(--swipe-done) 14%, var(--surface)); }
.plan-card.to-tomorrow { background: color-mix(in srgb, var(--swipe-later) 14%, var(--surface)); }
.plan-when { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .85rem; min-width: 0; }
.plan-card.overdue .plan-when { color: var(--late); }
.plan-when svg { width: 16px; height: 16px; flex: none; }
.plan-title {
  all: unset; cursor: pointer; font-size: 1.15rem; font-weight: 600; line-height: 1.3;
  overflow-wrap: anywhere; min-width: 0;
}
.plan-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-content: flex-start; text-align: start; color: var(--muted); font-size: .85rem; min-width: 0; }
.plan-meta > span { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.plan-meta svg { width: 14px; height: 14px; flex: none; }
.plan-meta .plan-list { display: block; flex: 0 1 auto; max-width: 100%; text-align: start; }
.plan-prio.p3 { color: var(--p3); } .plan-prio.p2 { color: var(--p2); } .plan-prio.p1 { color: var(--p1); }
.plan-note { margin: 0; color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.plan-swipe-hint { display: flex; justify-content: space-between; color: var(--muted); font-size: .75rem; opacity: .7; }
@media (hover: hover) and (pointer: fine) { .plan-swipe-hint { display: none; } }
.plan-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.plan-btn { justify-content: flex-start; gap: 8px; padding: 6px 12px; min-height: var(--tap); min-width: 0; white-space: normal; text-align: start; font-size: .95rem; }
.plan-btn svg { flex: none; }
.plan-done { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 8px 0; }
.plan-done-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.plan-done-icon svg { width: 28px; height: 28px; }
.plan-done h3 { margin: 0; }
.plan-sum { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; }
.plan-done .hint { margin: 0; }
/* «Настройки → Главный экран» (сессия 20): схема экрана и список виджетов с размером и порядком */
.hs-preview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; max-width: 260px; margin: 8px 0 12px; padding: 8px; border-radius: 16px; background: var(--surface-2); }
.hs-cell { display: flex; align-items: center; justify-content: center; min-width: 0; padding: 0 4px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); font-size: calc(11px * var(--fs, 1)); font-weight: 600; color: var(--muted); text-align: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hs-cell.w-day, .hs-cell.w-weather, .hs-cell.w-shabbat, .hs-cell.w-dash { background: #4b3a78; border-color: transparent; color: #fff; }
.hs-cell.w-shelters { background: var(--wg-safe); color: var(--wg-safe-t); border-color: transparent; }
.hs-cell.w-trips { background: var(--wg-teal); color: var(--wg-teal-t); border-color: transparent; }
.hs-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 8px 10px; padding: 10px 0; }
.hs-item + .hs-item { border-top: 1px solid var(--border); }
.hs-item-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hs-item-t small { color: var(--muted); font-size: calc(12.5px * var(--fs, 1)); overflow-wrap: anywhere; }
.hs-item > .seg, .hs-item > .hs-fixed { grid-column: 1 / -1; }
.hs-item .seg-btn { min-height: 36px; padding: 0 10px; font-size: calc(13px * var(--fs, 1)); }
.hs-fixed { font-size: calc(13px * var(--fs, 1)); color: var(--muted); padding: 0 4px; }
.hs-steps { display: flex; gap: 4px; }
.hs-step { min-width: 40px; min-height: 40px; padding: 0 8px; justify-content: center; font-size: calc(16px * var(--fs, 1)); }
.hs-step:disabled { opacity: .35; }

/* Лента дня в мини-приложении на телефоне: время — строкой над названием, иначе длинное название сжато в узкую колонку. */
@media (max-width: 520px) {
  .wapp .td-lane .td-row:is(.event, .task-timed) .td-when { flex: 1 0 100%; min-width: 0; font-weight: 600; }
  .wapp .td-lane .td-row:is(.event, .task-timed) small { padding-inline-start: 0; }
  .wapp .td-lane .td-row.task-timed small { padding-inline-start: 32px; }
}

/* ---------- «Заметки» как Google Keep (сессия 20) ---------- */
/* Цвет заметки: --nl (светлая тема) / --nd (тёмная) задаёт карточка и окно (notes-model.js NOTE_COLORS). */
.note-card, .ne-box { --nbg: var(--nl, var(--surface)); }
:root[data-theme="dark"] .note-card, :root[data-theme="dark"] .ne-box { --nbg: var(--nd, var(--surface)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .note-card, :root:not([data-theme="light"]) .ne-box { --nbg: var(--nd, var(--surface)); } }
.notes-view { display: flex; flex-direction: column; gap: 12px; padding: 12px 12px calc(var(--nav-h) + var(--safe-bottom) + 90px); max-width: 1280px; margin: 0 auto; width: 100%; box-sizing: border-box; min-height: 100%; }
@media (min-width: 900px) { .notes-view { padding-bottom: 32px; } }
.notes-top { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.notes-search { width: 100%; min-height: 46px; border-radius: 14px; font-size: calc(15px * var(--fs, 1)); }
/* Разделы переносятся рядами, а не уезжают вбок: «Архив» и «Корзина» всегда на виду. */
.notes-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.notes-chip { flex: none; min-height: 38px; }
.notes-chip.on { background: var(--accent-soft); color: var(--accent); border-color: transparent; font-weight: 600; }
.notes-chip svg { width: 16px; height: 16px; flex: none; }
.notes-composer { display: flex; align-items: center; gap: 6px; max-width: 640px; width: 100%; align-self: center; padding: 4px 6px 4px 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); box-sizing: border-box; }
.notes-composer[hidden] { display: none; }
/* На телефоне — полоса «Заметка…» внизу над вкладками, как в Keep (под большой палец). */
@media (max-width: 899px) {
  .notes-composer { position: fixed; left: 10px; right: 10px; bottom: calc(var(--nav-h) + var(--safe-bottom) + 10px); z-index: 11; width: auto; max-width: none; box-shadow: var(--shadow-lift); }
}
.notes-new { flex: 1; min-width: 0; min-height: 44px; padding: 0 12px; border: 0; background: none; color: var(--muted); font: inherit; font-size: calc(15px * var(--fs, 1)); text-align: start; cursor: text; }
.notes-sec { margin: 6px 4px 0; font-size: calc(12px * var(--fs, 1)); font-weight: 650; letter-spacing: .04em; color: var(--muted); }
.notes-grid { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: 10px; align-items: start; }
.notes-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.note-card { position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 12px 12px 10px; border-radius: 14px; background: var(--nbg); border: 1px solid var(--border); cursor: pointer; overflow-wrap: break-word; -webkit-hyphens: auto; hyphens: auto; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.note-card.colored { border-color: transparent; }
.note-card:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.note-pin { position: absolute; inset-inline-end: 8px; top: 8px; color: var(--muted); }
.note-pin svg { width: 16px; height: 16px; }
.note-card:has(.note-pin) .note-title { padding-inline-end: 18px; }
.note-title { margin: 0; font-size: calc(15.5px * var(--fs, 1)); font-weight: 650; line-height: 1.3; }
.note-body { margin: 0; font-size: calc(14px * var(--fs, 1)); line-height: 1.4; white-space: pre-wrap; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 12; overflow: hidden; }
.note-body.muted { color: var(--muted); }
.note-items { display: flex; flex-direction: column; gap: 2px; }
.note-item { display: flex; align-items: flex-start; gap: 6px; min-width: 0; font-size: calc(14px * var(--fs, 1)); line-height: 1.35; }
.note-item-t { flex: 1; min-width: 0; padding-top: 1px; }
.note-check { flex: none; width: 20px; height: 20px; margin: 0; padding: 0; border-radius: 4px; border: 2px solid color-mix(in srgb, var(--text) 55%, transparent); background: transparent; color: var(--text); display: grid; place-items: center; cursor: pointer; position: relative; }
.note-check::before { content: ""; position: absolute; inset: -12px; } /* зона касания 44 px */
.note-check svg { width: 14px; height: 14px; }
.note-more { color: var(--muted); font-size: calc(12.5px * var(--fs, 1)); padding-inline-start: 26px; }
.note-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 2px; }
.note-label { display: inline-block; max-width: 100%; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--text) 9%, transparent); font-size: calc(11.5px * var(--fs, 1)); font-weight: 600; overflow-wrap: anywhere; }
.note-people { display: inline-flex; margin-inline-start: auto; }
.note-people .person-av + .person-av { margin-inline-start: -6px; }
.notes-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 48px 16px; color: var(--muted); text-align: center; }
.notes-empty > svg { width: 56px; height: 56px; opacity: .5; }
.notes-empty p { margin: 0; font-size: calc(15px * var(--fs, 1)); }
.notes-hint { margin: 0 4px; color: var(--muted); font-size: calc(13px * var(--fs, 1)); }

/* Окно заметки: на телефоне — весь экран, на компьютере — карточка по центру. */
.note-dlg { padding: 0; margin: 0; border: 0; width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; background: transparent; color: var(--text); }
.note-dlg::backdrop { background: rgb(0 0 0 / .45); }
.ne-box { display: flex; flex-direction: column; height: 100%; background: var(--nbg); padding-top: var(--safe-top); box-sizing: border-box; }
@media (min-width: 720px) {
  .note-dlg { width: min(640px, 92vw); height: auto; max-height: 86dvh; margin: auto; border-radius: 16px; }
  .ne-box { height: auto; max-height: 86dvh; border-radius: 16px; padding-top: 0; }
}
.ne-head { display: flex; align-items: center; gap: 2px; padding: 6px 6px 0; }
.ne-spacer { flex: 1; }
.ne-head .icon-btn.on { color: var(--accent); }
.ne-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 6px; padding: 4px 16px 16px; }
/* Содержимое не сжимается, а прокручивается: иначе высокий блок «Чек» сплющивал заголовок до 12 px (сессия 24). */
.ne-scroll > * { flex-shrink: 0; }
.ne-title, .ne-text, .ne-item-t, .ne-add { width: 100%; box-sizing: border-box; border: 0; background: transparent; color: inherit; font: inherit; resize: none; outline: none; padding: 6px 0; overflow: hidden; overflow-wrap: break-word; }
.ne-title { font-size: calc(20px * var(--fs, 1)); font-weight: 650; line-height: 1.3; }
.ne-text { font-size: calc(16px * var(--fs, 1)); line-height: 1.45; min-height: 6em; }
.ne-text[hidden], .ne-items[hidden], .ne-add-row[hidden], .ne-done-head[hidden], .ne-labels[hidden], .ne-tools[hidden], .ne-trashbar[hidden] { display: none; }
.ne-items { display: flex; flex-direction: column; }
.ne-item { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; }
.ne-item .note-check { margin-top: 11px; }
.ne-item-t { flex: 1; min-width: 0; font-size: calc(16px * var(--fs, 1)); line-height: 1.4; padding: 9px 0; }
.ne-item.done .ne-item-t { text-decoration: line-through; color: var(--muted); }
.ne-item-x { flex: none; opacity: .55; }
@media (hover: hover) { .ne-item-x { opacity: 0; } .ne-item:hover .ne-item-x, .ne-item:focus-within .ne-item-x { opacity: .7; } }
.ne-add-row { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--muted); }
.ne-add-row svg { width: 20px; height: 20px; flex: none; }
.ne-add { font-size: calc(16px * var(--fs, 1)); }
.ne-done-head { align-self: flex-start; min-height: 40px; padding: 0 4px; border: 0; background: none; color: var(--muted); font: inherit; font-size: calc(14px * var(--fs, 1)); font-weight: 600; cursor: pointer; }
.ne-labels { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-top: 6px; }
.ne-palette { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 16px; border-top: 1px solid color-mix(in srgb, var(--text) 12%, transparent); }
.ne-palette[hidden] { display: none; }
.ne-swatch { width: 40px; height: 40px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--text) 18%, transparent); background: var(--nbg); color: var(--text); display: grid; place-items: center; cursor: pointer; }
.ne-swatch { --nbg: var(--nl, var(--surface)); }
:root[data-theme="dark"] .ne-swatch { --nbg: var(--nd, var(--surface)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ne-swatch { --nbg: var(--nd, var(--surface)); } }
.ne-swatch.none { background: var(--surface) linear-gradient(135deg, transparent 46%, var(--muted) 47%, var(--muted) 53%, transparent 54%); }
.ne-swatch.on { border-color: var(--accent); border-width: 3px; }
.ne-swatch svg { width: 18px; height: 18px; }
.ne-tools { display: flex; align-items: center; gap: 2px; padding: 4px 6px calc(6px + var(--safe-bottom)); border-top: 1px solid color-mix(in srgb, var(--text) 10%, transparent); }
.ne-edited { margin-inline-start: auto; padding: 0 8px; color: var(--muted); font-size: calc(12px * var(--fs, 1)); text-align: end; }
.ne-trashbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 16px; background: color-mix(in srgb, var(--danger) 10%, transparent); }
.ne-trashbar span { flex: 1 1 100%; font-weight: 600; }
/* Чеки и гарантии (сессия 24): фото сверху карточки, строка «магазин · сумма», гарантия плашкой. */
.notes-sec.warn { color: var(--warn); }
.note-photo { position: relative; margin: -12px -12px 2px; border-radius: 14px 14px 0 0; overflow: hidden; background: var(--surface-2); }
.note-photo img { display: block; width: 100%; max-height: 180px; object-fit: cover; }
.note-photo-n { position: absolute; inset-inline-end: 6px; bottom: 6px; padding: 1px 7px; border-radius: 999px; background: rgb(0 0 0 / .55); color: #fff; font-size: calc(11.5px * var(--fs, 1)); font-weight: 600; }
.note-card:has(.note-photo) .note-pin { z-index: 1; color: #fff; filter: drop-shadow(0 1px 2px rgb(0 0 0 / .6)); }
.note-receipt { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; font-size: calc(13.5px * var(--fs, 1)); }
/* Части строки — отдельные блоки ряда с переносом: магазин и сумма не наезжают друг на друга ни в RTL, ни на крупном шрифте. */
.nr-what { width: 100%; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; }
.nr-what svg { flex: none; width: 15px; height: 15px; color: var(--muted); }
.nr-part { min-width: 0; overflow-wrap: anywhere; }
.nr-dot { color: var(--muted); }
.nr-badge { max-width: 100%; padding: 2px 8px; border-radius: 999px; font-size: calc(11.5px * var(--fs, 1)); font-weight: 600; background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.nr-badge.soon { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.nr-badge.over { background: color-mix(in srgb, var(--text) 9%, transparent); color: var(--muted); }
.ne-receipt { display: flex; flex-direction: column; gap: 10px; padding: 10px 12px 12px; margin: 2px 0 6px; border-radius: 14px; background: color-mix(in srgb, var(--text) 5%, transparent); }
.ne-receipt[hidden], .ne-receipt [hidden] { display: none; }
.nr-head { display: flex; align-items: center; gap: 6px; font-weight: 650; font-size: calc(14px * var(--fs, 1)); }
.nr-head svg { width: 18px; height: 18px; color: var(--muted); }
.nr-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.nr-photo-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.nr-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5em), 1fr)); gap: 8px; }
.nr-f { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.nr-l { color: var(--muted); font-size: calc(12.5px * var(--fs, 1)); font-weight: 600; }
.nr-f .input, .nr-until { width: 100%; min-width: 0; min-height: 44px; box-sizing: border-box; }
.nr-amount { display: flex; gap: 6px; min-width: 0; }
.nr-amount .input:first-child { flex: 1 1 auto; min-width: 0; }
.nr-amount .nr-cur { flex: none; width: auto; min-width: 3.4em; }
.nr-w { display: flex; flex-direction: column; gap: 6px; }
.nr-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.nr-chips .chip { min-height: 40px; }
.nr-until { max-width: 14em; }
.nr-status { font-size: calc(14px * var(--fs, 1)); font-weight: 600; color: var(--ok); }
.nr-status.soon { color: var(--warn); }
.nr-status.over { color: var(--muted); }
.nr-remind { padding: 0; }
.keep-import { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.keep-steps { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 6px; }
.keep-stats { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 4px; }
.keep-out { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; width: 100%; }
.keep-err { color: var(--danger); margin: 0; }
.keep-opt { display: flex; align-items: center; gap: 6px; }

/* «Машина» (сессия 23) */
.wa-cars { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.wa-cars .wa-segbox, .wa-cars .seg { flex: 1 1 12em; min-width: 0; }
.wa-dl.alert { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.wa-dl.warn { border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); }
.wa-muted.alert { color: var(--danger); font-weight: 600; }
.wa-muted.warn { color: var(--warn); font-weight: 600; }
.wa-he { font-weight: 500; color: var(--muted); }
.wa-dl > .btn { grid-area: n; }
.wa-logrow { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "m n x"; }
.wa-logrow > .icon-btn { grid-area: x; }
.wa-kind { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 6px 2px; border-bottom: 1px solid var(--border); }
.wa-kind:last-child { border-bottom: 0; }
.wa-car-acts { margin-top: 4px; }
.car-form { display: grid; gap: 12px; }
.car-form .field { display: grid; gap: 4px; min-width: 0; }
.car-form .field > span { font-size: calc(13px * var(--fs, 1)); color: var(--muted); }
.car-form h3 { margin: 6px 0 0; font-size: calc(14px * var(--fs, 1)); }
.car-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(9em, 1fr)); gap: 12px; }
.car-fuel { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.car-fuel[hidden] { display: none; }
.car-fuel-stat { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.car-fuel-v { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; font-size: calc(18px * var(--fs, 1)); }
.car-fuel-km { color: var(--muted); font-weight: 600; }
.wa-house-debt { overflow-wrap: anywhere; }
.car-share { display: flex; gap: 10px; align-items: center; }
.car-share input { width: 22px; height: 22px; flex: none; }

/* ---------- Значки предметов (сессия 25): THINGS в js/ui.js, плашка — .ico-tile ---------- */
.ico-tile {
  --tone: var(--accent);
  flex: none; display: inline-grid; place-items: center;
  width: calc(30px * var(--fs, 1)); height: calc(30px * var(--fs, 1)); border-radius: calc(9px * var(--fs, 1));
  background: color-mix(in srgb, var(--tone) 15%, transparent); color: var(--tone);
}
.ico-tile svg { width: 62%; height: 62%; color: inherit; }
.tone-blue { --tone: #3b7ddd; } .tone-red { --tone: #e5484d; } .tone-amber { --tone: #d9930d; }
.tone-pink { --tone: #d6409f; } .tone-teal { --tone: #12a594; } .tone-slate { --tone: #6b7a8c; }
.tone-green { --tone: #30a46c; } .tone-indigo { --tone: #5b5bd6; } .tone-violet { --tone: #8e4ec6; }
.tone-sky { --tone: #0b98d6; } .tone-orange { --tone: #e5760b; }
:root[data-theme="dark"] .ico-tile { background: color-mix(in srgb, var(--tone) 24%, transparent); color: color-mix(in srgb, var(--tone) 70%, white); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ico-tile { background: color-mix(in srgb, var(--tone) 24%, transparent); color: color-mix(in srgb, var(--tone) 70%, white); } }
.set-nav-item .ico-tile svg, .set-nav-item[aria-current="page"] .ico-tile svg { width: 62%; height: 62%; color: inherit; }
.set-title { display: flex; align-items: center; gap: 10px; }
.wg-add-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.wa-head > .ico-tile { margin-inline-end: 4px; }

/* ---------- «Меню на неделю» (сессия 25): APPS.menu, mealForm ---------- */
.wa-menu-nav { justify-content: space-between; }
.wa-menu-day.today { border-color: var(--accent); }
.wa-meals { gap: 6px; }
.wa-meal { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 4px 10px; padding: 8px 10px; border-radius: 14px; background: var(--bg); border: 1px solid var(--border); }
.wa-meal-slot { flex: 0 0 auto; min-width: 5.2em; padding-top: 11px; color: var(--muted); font-size: calc(13px * var(--fs, 1)); font-weight: 600; }
.wa-meal-dishes { flex: 1 1 12em; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.wa-meal-dish { display: flex; flex-direction: column; gap: 1px; min-height: 44px; justify-content: center; width: 100%; padding: 4px 8px; border: 0; border-radius: 10px; background: var(--surface-2); color: var(--text); font: inherit; text-align: start; cursor: pointer; }
.wa-meal-name { font-weight: 600; overflow-wrap: anywhere; }
.wa-meal-add { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; min-width: 44px; padding: 0 10px; border: 1px dashed var(--border); border-radius: 10px; background: none; color: var(--muted); font: inherit; cursor: pointer; align-self: flex-start; }
.wa-meal-add svg { width: 18px; height: 18px; }
.wa-menu-slots { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
/* «Посмотреть / прочитать» (сессия 26) */
.wa-watch-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.wa-watch-top[hidden] { display: none; }
.wa-watch-q { flex: 1 1 12em; min-width: 0; }
.wa-watch-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.wa-watch-filter { margin-bottom: 10px; }
.wa-watch-list { gap: 6px; }
/* Сетка, а не флекс: на 360 ×1,35 значок и кнопки остаются в ряду, переносится только название. */
.wa-list > li.wa-watch-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 6px; padding: 4px 4px 4px 10px; border-radius: 14px; background: var(--bg); border: 1px solid var(--border); }
.wa-list > li.wa-watch-row[dir="rtl"] { padding: 4px 10px 4px 4px; }
.wa-watch-ico { font-size: calc(18px * var(--fs, 1)); line-height: 1; }
.wa-watch-main { min-width: 0; min-height: 44px; display: flex; flex-direction: column; justify-content: center; gap: 1px; padding: 4px 2px; border: 0; background: none; color: var(--text); font: inherit; text-align: start; cursor: pointer; }
.wa-watch-title { font-weight: 600; overflow-wrap: anywhere; }
.wa-watch-row.done .wa-watch-title { font-weight: 500; }
.wa-watch-meta { overflow-wrap: anywhere; }
.wa-watch-acts { display: flex; flex-direction: column; align-items: center; }
.wa-watch-acts:empty { display: none; }
.wa-watch-done svg { color: var(--accent); }
.wg-watch-types { letter-spacing: .02em; }
.wa-stars { display: flex; gap: 2px; }
.wa-star { min-width: 44px; min-height: 44px; border: 0; background: none; color: var(--muted); font-size: calc(26px * var(--fs, 1)); line-height: 1; cursor: pointer; border-radius: 10px; }
.wa-star.on { color: #e6a700; }
.wa-star:focus-visible { outline: 2px solid var(--accent); }
.wa-rate-row[hidden] { display: none; }
.wa-rate { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.wa-rate-title { margin: 0; font-weight: 600; font-size: calc(17px * var(--fs, 1)); overflow-wrap: anywhere; }
.wa-rate .wa-stars { justify-content: center; flex-wrap: wrap; }
.wa-share-other { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 6px; border-top: 1px solid var(--border); }
.dlg-meal textarea { resize: vertical; min-height: 6.5em; }

/* ---------- Сейф v2 (сессия 27): главный, разделы, карточки, люди, перенос ---------- */
.vault-hero { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 20px; background: #0f3d38; color: #ffffff; }
.vault-hero-ic { width: 48px; height: 48px; flex: none; border-radius: 15px; display: grid; place-items: center; background: #1b5a52; color: #9fe3d6; }
.vault-hero-ic svg { width: 26px; height: 26px; }
.vault-hero-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vault-hero-txt b { font-size: calc(24px * var(--fs, 1)); line-height: 1.15; }
.vault-hero-txt small { color: #c9e7e1; font-size: calc(14px * var(--fs, 1)); }
.vault-people .chip { display: inline-flex; align-items: center; gap: 6px; }
.vault-people .chip .vault-av.mini { width: 24px; height: 24px; border-radius: 50%; background: var(--av); color: #fff; font-size: calc(12px * var(--fs, 1)); margin-inline-start: -6px; }
.vault-body { display: flex; flex-direction: column; gap: 16px; }
.vault-sec { display: flex; flex-direction: column; gap: 8px; }
.vault-sec > h3 { margin: 0; font-size: calc(16px * var(--fs, 1)); }
.vault-pins { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.vault-pin { flex: 0 0 auto; width: max(132px, 9em); display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 12px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); color: inherit; font: inherit; text-align: start; cursor: pointer; }
.vault-pin b { overflow-wrap: anywhere; line-height: 1.25; }
.vault-pin small { color: var(--muted); }
.vault-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(max(104px, 6.6em), 1fr)); gap: 10px; }
.vault-tile { display: flex; flex-direction: column; align-items: stretch; gap: 10px; min-height: 96px; padding: 12px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); color: inherit; font: inherit; text-align: start; cursor: pointer; }
.vault-tile .ico-tile { width: 40px; height: 40px; border-radius: 12px; }
.vault-tile-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vault-tile-txt b { font-size: calc(14px * var(--fs, 1)); line-height: 1.2; overflow-wrap: anywhere; }
.vault-tile-txt small { color: var(--muted); }
.vault-audit { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; border: 1px solid color-mix(in srgb, var(--warn) 35%, var(--border)); background: color-mix(in srgb, var(--warn) 10%, var(--surface)); color: inherit; font: inherit; text-align: start; cursor: pointer; }
.vault-audit-ic { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--warn) 22%, var(--surface)); color: var(--warn); }
.vault-audit-ic svg { width: 20px; height: 20px; }
.vault-audit .vault-txt small { white-space: normal; }
.vault-audit > svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.vault-section { display: flex; flex-direction: column; gap: 12px; }
.vault-sec-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vault-sec-head h2 { margin: 0; flex: 1 1 8em; font-size: calc(18px * var(--fs, 1)); overflow-wrap: anywhere; }
.vault-pinned { display: inline-flex; color: var(--warm, #c98a1a); }
.vault-pinned svg { width: 16px; height: 16px; }
.vault-item, .vault-tile, .vault-pin { -webkit-touch-callout: none; user-select: none; }
.vault-item.armed, .vault-field.armed { background: var(--accent-soft); }
.vault-item.dragging, .vault-field.dragging { opacity: .45; }
.drop-on { outline: 2px solid var(--accent); outline-offset: 2px; background: var(--accent-soft) !important; }
.vault-ghost { position: fixed; left: 0; top: 0; z-index: 1000; pointer-events: none; max-width: 70vw; padding: 8px 12px; border-radius: 12px; background: var(--accent); color: var(--accent-text, #fff); font-weight: 600; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.vault-dragging, html.vault-dragging * { cursor: grabbing !important; user-select: none !important; }
/* Окно записи */
.vault-view-top { display: flex; align-items: center; gap: 4px; }
.vault-view-top .vault-type { flex: 1; min-width: 0; align-items: flex-start; }
.vault-view-top .vault-type > svg { margin-top: .15em; flex: none; }
.vault-star.on { color: var(--warm, #c98a1a); }
.vault-field dd.code.shown { font-size: calc(26px * var(--fs, 1)); letter-spacing: .12em; font-weight: 700; color: var(--accent); }
.vault-grip { color: var(--muted); cursor: grab; touch-action: none; }
.vault-cards-box { display: flex; flex-direction: column; gap: 10px; }
.vault-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(max(150px, 9.5em), 1fr)); gap: 10px; }
.vault-ctile { display: flex; flex-direction: column; align-items: stretch; gap: 8px; min-height: 120px; padding: 12px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); color: inherit; font: inherit; text-align: start; cursor: pointer; }
.vault-ctile-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.vault-ctile-head b { flex: 1; min-width: 0; font-size: calc(16px * var(--fs, 1)); overflow-wrap: anywhere; line-height: 1.2; }
.vault-ctile-addr { color: var(--muted); font-size: calc(13px * var(--fs, 1)); overflow-wrap: anywhere; }
.vault-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.vault-badge-s { display: inline-flex; align-items: center; gap: 5px; min-height: 28px; padding: 0 9px; border-radius: 14px; background: var(--surface-2); font-size: calc(12.5px * var(--fs, 1)); font-weight: 600; }
.vault-badge-s svg { width: 15px; height: 15px; flex: none; }
.vault-badge-s.ok { background: var(--accent-soft); color: var(--accent); }
.vault-badge-s.warn { background: color-mix(in srgb, var(--warn) 15%, var(--surface)); color: var(--warn); }
.vault-people-box { display: flex; flex-direction: column; gap: 10px; }
.vault-pswitch { display: flex; gap: 8px; overflow-x: auto; padding: 2px; scrollbar-width: none; }
.vault-pchip { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px 0 6px; border-radius: 22px; border: 1px solid var(--border); background: var(--surface); color: inherit; font: inherit; cursor: pointer; }
.vault-pchip .vault-av { border-radius: 50%; background: var(--av); color: #fff; }
.vault-pchip small { color: var(--muted); }
.vault-pchip.on { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.vault-ppanel { border: 1px solid var(--border); border-radius: 14px; padding: 4px 12px 8px; display: flex; flex-direction: column; gap: 6px; }
.vault-ppanel-head { display: flex; align-items: center; gap: 10px; min-height: 48px; }
.vault-ppanel-head b { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.vault-ppanel-head .vault-av { border-radius: 50%; background: var(--av); color: #fff; }
.vault-block-qr { margin: 0 12px 10px; }
.vault-sheet-body { touch-action: pan-y; }
.vault-qr-box { display: flex; justify-content: center; }
.vault-qr-svg { width: min(260px, 70vw); height: auto; border-radius: 12px; }
.vault-qr-ssid { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; font-size: calc(18px * var(--fs, 1)); }
.vault-pick { max-height: 50vh; overflow: auto; }

.vault-tools { flex-wrap: wrap; }
.vault-tools .input { flex: 1 1 11em; }
.vault-note > div { min-height: 1.3em; }

/* ---------- Посылки (сессия 28) ---------- */
.wg-parcels .wg-accent { color: var(--warn); font-weight: 600; }
.wa-parcel.wait { border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); }
.wa-parcel.alert { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.wa-parcel.got > b { color: var(--muted); }
.wa-pickup { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border-radius: 12px; background: color-mix(in srgb, var(--warn) 10%, transparent); }
.wa-pickup-place { font-weight: 600; overflow-wrap: anywhere; }
.wa-pickup-code { display: inline-flex; align-items: baseline; gap: 6px; }
.wa-pickup-code strong { font-size: calc(22px * var(--fs, 1)); letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.wa-track { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.wa-track code { font-size: calc(13px * var(--fs, 1)); overflow-wrap: anywhere; min-width: 0; }
.wa-track .icon-btn { width: 40px; height: 40px; }

/* ---------- Сейф: цвет и значок (07.11), плитки без разрыва слов ---------- */
.vault-tiles { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); } /* на телефоне — 2 в ряд при любом шрифте, слова целиком */
.vault-tile-txt b, .vault-ctile b, .vault-pin b { overflow-wrap: break-word; word-break: normal; hyphens: auto; }
.vault-tile.tinted, .vault-ctile.tinted, .vault-pin.tinted { background: color-mix(in srgb, var(--tone) 9%, var(--surface)); border-color: color-mix(in srgb, var(--tone) 32%, var(--border)); }
.look-emoji { font-size: 1.25em; line-height: 1; font-style: normal; }
.ico-tile .look-emoji { font-size: calc(19px * var(--fs, 1)); }
.vault-tile .ico-tile .look-emoji { font-size: calc(24px * var(--fs, 1)); }
.vault-ico-look { width: 36px; height: 36px; border-radius: 10px; flex: none; }
.vault-ctile-ic { width: 32px; height: 32px; border-radius: 10px; }
.vault-settings-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); color: inherit; font: inherit; text-align: start; cursor: pointer; }
.vault-settings-btn .vault-txt { flex: 1; min-width: 0; }
.look-preview { display: flex; align-items: center; gap: 12px; }
.look-preview .ico-tile { width: 52px; height: 52px; border-radius: 14px; }
.look-preview .ico-tile .look-emoji { font-size: calc(28px * var(--fs, 1)); }
.look-preview b { font-size: calc(16px * var(--fs, 1)); overflow-wrap: break-word; min-width: 0; }
.look-h { margin: 4px 0 0; font-size: calc(14px * var(--fs, 1)); }
.look-tones { display: flex; flex-wrap: wrap; gap: 8px; }
.look-tone { width: 44px; height: 44px; border-radius: 50%; border: 3px solid transparent; background: var(--tone); cursor: pointer; }
.look-tone[aria-checked="true"] { border-color: var(--text); box-shadow: inset 0 0 0 2px var(--surface); }
.look-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.look-ic { height: 44px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: inherit; cursor: pointer; }
.look-ic svg { width: 22px; height: 22px; }
.look-ic[aria-checked="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }
.look-own-row { display: flex; flex-direction: column; gap: 4px; }
.look-err:empty { display: none; }

/* ---------- Канбан и матрица (порция 4 «Виды», сессия 30) ---------- */
.task-pane > .board { max-width: none; }
.board {
  display: flex; gap: 12px; align-items: flex-start;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity;
  padding: 2px 2px 12px; margin-inline: -10px; padding-inline: 10px;
}
.kb-col {
  flex: 0 0 min(300px, 84vw); scroll-snap-align: start; min-width: 0;
  display: flex; flex-direction: column; gap: 8px;
  background: color-mix(in srgb, var(--surface-2) 55%, transparent); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px;
}
.kb-col.drop-here { border-color: var(--accent); background: var(--accent-soft); }
.kb-head { display: flex; align-items: center; gap: 4px; min-height: 36px; }
.kb-col-name {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px;
  font: inherit; font-weight: 650; font-size: calc(15px * var(--fs, 1)); color: var(--text);
  background: none; border: 0; padding: 0 4px; text-align: start;
}
button.kb-col-name { cursor: pointer; min-height: 40px; }
.kb-col-title { min-width: 3em; overflow-wrap: break-word; flex: 1 1 auto; }
.kb-title-who { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.kb-count { color: var(--muted); font-weight: 500; font-size: calc(13px * var(--fs, 1)); }
.kb-tools { display: flex; gap: 2px; flex: 0 0 auto; }
.kb-cards { display: flex; flex-direction: column; gap: 6px; min-height: 44px; }
.kb-empty { padding: 10px 8px; text-align: center; font-size: calc(13px * var(--fs, 1)); border: 1px dashed var(--border); border-radius: 10px; }
.kb-card {
  position: relative; display: flex; align-items: flex-start; gap: 2px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 2px 8px 2px 2px; min-height: 48px; cursor: pointer;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: pan-x pan-y;
  outline-offset: -2px;
}
.kb-card[dir="rtl"] { padding: 2px 2px 2px 8px; }
.kb-card.striped::before { content: ''; position: absolute; inset-inline-start: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--lc); }
.kb-card.done { opacity: .6; }
.kb-card.done .kb-title { text-decoration: line-through; }
.kb-card.drag-src { opacity: .35; }
@media (hover: hover) { .kb-card:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); } }
.kb-main { flex: 1; min-width: 0; padding: 10px 0 8px; }
.kb-title { overflow-wrap: anywhere; text-align: start; font-size: calc(15px * var(--fs, 1)); }
.kb-meta { margin-top: 2px; }
.kb-who { padding-top: 10px; }
.kb-ghost { position: fixed; z-index: 1000; pointer-events: none; box-shadow: var(--shadow-lg, 0 10px 30px rgba(0,0,0,.25)); }
.kb-marker { height: 3px; border-radius: 3px; background: var(--accent); margin: -2px 4px; }
.kb-add-col {
  flex: 0 0 auto; align-self: flex-start; display: inline-flex; align-items: center; gap: 6px;
  min-height: 48px; padding: 0 16px; border: 1px dashed var(--border); border-radius: var(--radius);
  background: transparent; color: var(--muted); font: inherit; cursor: pointer;
}
@media (min-width: 900px) { .board { margin-inline: 0; padding-inline: 2px; } .kb-col { flex-basis: 290px; } }

/* Матрица Эйзенхауэра: 2 × 2, каждый квадрант прокручивается сам */
.board.layout-matrix {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; overflow: visible;
  margin-inline: 0; padding-inline: 0; scroll-snap-type: none;
}
.layout-matrix .kb-col { flex: none; padding: 6px; height: max(240px, calc((100dvh - var(--header-h) - var(--nav-h) - var(--safe-top) - var(--safe-bottom) - 60px) / 2)); }
.layout-matrix .kb-cards { overflow-y: auto; flex: 1; min-height: 0; overscroll-behavior: contain; }
/* Карточки не сжимаются под высоту квадранта — квадрант прокручивается (телефон 08.11: текст резался посередине строки). */
.kb-cards > * { flex-shrink: 0; }
.layout-matrix .kb-card { min-height: 44px; padding-inline-end: 6px; }
.layout-matrix .kb-main { padding: 9px 0 7px; }
.layout-matrix .kb-title { font-size: calc(14px * var(--fs, 1)); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.layout-matrix .kb-col-name { font-size: calc(14px * var(--fs, 1)); align-items: center; }
.layout-matrix .kb-col-title { overflow-wrap: normal; }
.kb-q {
  flex: 0 0 auto; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px;
  font-size: calc(12.5px * var(--fs, 1)); font-weight: 700; color: #fff; background: var(--qc, var(--muted));
}
.kb-q1 { --qc: var(--p3); } .kb-q2 { --qc: var(--p2); } .kb-q3 { --qc: var(--p1); } .kb-q4 { --qc: var(--muted); }
.layout-matrix .kb-col { border-top: 3px solid var(--qc); }
@media (max-width: 899px) {
  .layout-matrix .kb-meta .meta-list { display: none !important; }
  /* Узкий квадрант: «+» и «⋯» — кнопкой внизу экрана и в «⋯» шапки, название не сжимается и не рвёт слова */
  .layout-matrix .kb-tools { display: none; }
  /* Последнюю карточку правого нижнего квадранта можно докрутить из-под кнопки «+» */
  .layout-matrix .kb-q4 .kb-cards { padding-bottom: 64px; }
}
@media (min-width: 900px) { .layout-matrix .kb-col { height: calc((100dvh - var(--header-h) - 110px) / 2); min-height: 260px; } }

/* Окно фильтра и квадрантов */
.dlg-filter { width: min(640px, calc(100vw - 24px)); }
.filter-form { display: grid; gap: 14px; }
.filter-name { display: flex; gap: 8px; }
.filter-name .input:not(.emoji-input) { flex: 1; min-width: 0; }
.rule-box { display: grid; gap: 12px; }
.rule-group { display: grid; gap: 6px; }
.rule-title { margin: 0; font-size: calc(14px * var(--fs, 1)); font-weight: 650; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.rule-title small { color: var(--muted); font-weight: 400; }
.rule-group .chip-row .chip { max-width: 100%; }
.rule-summary { margin: 0; }
.quad-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-radius: 14px; align-self: stretch; }
.quad-tabs .seg-btn { display: flex; align-items: center; gap: 6px; min-height: 44px; text-align: start; padding: 4px 10px; }
.quad-tabs .seg-btn:nth-child(n+3) { border-top: 1px solid var(--border); }
.quad-tabs .seg-btn:nth-child(3) { border-inline-start: 0; }
.quad-tab-name { min-width: 0; overflow-wrap: anywhere; }
.quad-body { display: grid; gap: 12px; }
@media (max-width: 899px) { .dlg-filter { width: 100vw; max-width: 100vw; } }

/* ---------- Временная шкала (Гант, порция 4 «Виды», сессия 31) ---------- */
.task-pane > .timeline { max-width: none; }
.timeline {
  --tl-name: clamp(128px, 40vw, 180px); --tl-row: 44px; --tl-line: color-mix(in srgb, var(--border) 70%, transparent);
  --tl-weekend: color-mix(in srgb, var(--surface-2) 70%, transparent);
  display: flex; flex-direction: column; gap: 8px; margin-inline: -10px;
}
@media (min-width: 900px) { .timeline { --tl-name: 220px; margin-inline: 0; } }
.tl-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-inline: 10px; }
.tl-scroll {
  overflow: auto; overscroll-behavior-x: contain; position: relative;
  max-height: calc(100dvh - var(--header-h) - var(--nav-h) - var(--safe-top) - var(--safe-bottom) - 80px);
  border-block: 1px solid var(--border); background: var(--surface);
}
@media (min-width: 900px) { .tl-scroll { border: 1px solid var(--border); border-radius: var(--radius); max-height: calc(100dvh - var(--header-h) - 120px); } }
.tl-body { position: relative; width: calc(var(--tl-name) + var(--days) * var(--px)); min-width: 100%; padding-bottom: 72px; }
.tl-head { display: flex; position: sticky; top: 0; z-index: 3; background: var(--surface); border-bottom: 1px solid var(--border); }
.tl-corner {
  flex: 0 0 var(--tl-name); position: sticky; left: 0; z-index: 2; background: var(--surface); box-sizing: border-box;
  display: flex; align-items: flex-end; padding: 0 10px 6px; color: var(--muted); font-size: calc(12.5px * var(--fs, 1));
  border-right: 1px solid var(--border);
}
.tl-scale { flex: 0 0 calc(var(--days) * var(--px)); position: relative; height: calc(48px * var(--fs, 1)); }
.tl-months, .tl-days { position: absolute; inset-inline: 0; }
.tl-months { top: 2px; height: 20px; }
.tl-days { top: 22px; bottom: 0; }
.tl-month {
  position: absolute; left: calc(var(--off) * var(--px)); padding-inline: 6px; white-space: nowrap;
  font-size: calc(12.5px * var(--fs, 1)); font-weight: 650; border-left: 1px solid var(--border);
}
.tl-day {
  position: absolute; left: calc(var(--off) * var(--px)); width: var(--px); top: 0; bottom: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1;
  font-size: calc(12px * var(--fs, 1)); color: var(--muted);
}
.tl-day b { font-weight: 600; color: var(--text); font-size: calc(13px * var(--fs, 1)); }
.tl-day small { font-size: calc(10.5px * var(--fs, 1)); }
.tl-day.today b { color: var(--accent-text); background: var(--accent); border-radius: 999px; min-width: 1.7em; text-align: center; }
.tl-tick {
  position: absolute; left: calc(var(--off) * var(--px)); bottom: 6px; padding-inline: 3px; white-space: nowrap;
  font-size: calc(11.5px * var(--fs, 1)); color: var(--muted); border-left: 1px solid var(--border);
}
.tl-tick.today { color: var(--accent); font-weight: 650; }
.tl-lane, .tl-undated-head {
  display: flex; align-items: center; gap: 6px; min-height: 34px; width: 100%;
  padding: 0; background: color-mix(in srgb, var(--surface-2) 50%, var(--surface)); border: 0; border-bottom: 1px solid var(--border);
  font: inherit; color: var(--text); text-align: start;
}
.tl-undated-label { position: sticky; left: 10px; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; max-width: calc(100vw - 40px); }
.tl-lane-name {
  position: sticky; left: 0; flex: 0 0 var(--tl-name); width: var(--tl-name); box-sizing: border-box; align-self: stretch;
  display: flex; align-items: center; gap: 6px; padding-inline: 10px; font-weight: 650; font-size: calc(14px * var(--fs, 1));
  overflow-wrap: anywhere; background: inherit; border-right: 1px solid var(--border);
}
.tl-undated-head { cursor: pointer; font-weight: 650; min-height: 44px; }
.tl-undated-head svg { width: 16px; height: 16px; flex: none; transition: transform .15s; }
.tl-undated-head[aria-expanded="true"] svg { transform: rotate(90deg); }
.tl-undated-head small { font-weight: 400; }
.tl-row { display: flex; min-height: var(--tl-row); border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
.tl-name {
  flex: 0 0 var(--tl-name); position: sticky; left: 0; z-index: 2; min-width: 0; box-sizing: border-box;
  display: flex; align-items: center; gap: 0; padding-inline-start: calc(var(--depth, 0) * 12px); padding-inline-end: 6px;
  background: var(--surface); border-right: 1px solid var(--border); cursor: pointer; outline-offset: -2px;
}
.tl-name .check { flex: none; width: 38px; min-width: 38px; }
.tl-title {
  flex: 1; min-width: 0; font-size: calc(14px * var(--fs, 1)); line-height: 1.2;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: break-word; hyphens: auto;
}
.tl-name.late .tl-title { color: var(--late); }
.tl-who { flex: none; display: inline-flex; }
@media (hover: hover) { .tl-name:hover { background: color-mix(in srgb, var(--accent) 6%, var(--surface)); } }
.tl-track { flex: 0 0 calc(var(--days) * var(--px)); position: relative; }
.tl-track.undated { cursor: copy; }
@media (hover: hover) { .tl-track.undated:hover { background-color: color-mix(in srgb, var(--accent) 6%, transparent); } }
.tl-item {
  position: absolute; top: 6px; bottom: 6px; left: calc(var(--left) * var(--px) + 2px); width: calc(var(--len) * var(--px) - 4px); min-width: 10px;
  display: flex; align-items: center; border-radius: 8px; overflow: hidden;
  background: color-mix(in srgb, var(--bc) 24%, var(--surface)); border: 1px solid color-mix(in srgb, var(--bc) 60%, transparent);
  color: var(--text); font-size: calc(12.5px * var(--fs, 1)); cursor: pointer; outline-offset: 1px;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: pan-x pan-y;
}
.tl-item::before { content: ''; position: absolute; inset-block: 0; inset-inline-start: 0; width: 3px; background: var(--bc); }
.tl-item.late { border-color: var(--late); }
.tl-item.clip-l { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left-style: dashed; }
.tl-item.clip-r { border-top-right-radius: 0; border-bottom-right-radius: 0; border-right-style: dashed; }
.tl-item.can-edit { cursor: grab; }
.tl-item.dragging { cursor: grabbing; z-index: 4; box-shadow: var(--shadow-lift); overflow: visible; }
.tl-item-text { flex: 1; min-width: 0; padding-inline: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-handle { position: absolute; top: 0; bottom: 0; width: 10px; cursor: ew-resize; z-index: 1; }
.tl-handle.start { left: 0; }
.tl-handle.end { right: 0; }
@media (pointer: coarse) { .tl-handle { width: 16px; } }
@media (hover: hover) { .tl-item.can-edit:hover .tl-handle::after { content: ''; position: absolute; top: 25%; bottom: 25%; left: 4px; width: 2px; border-radius: 2px; background: var(--bc); } }
.tl-tip {
  position: absolute; bottom: calc(100% + 6px); left: 0; white-space: nowrap; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 3px 8px; border-radius: 6px; font-size: calc(12px * var(--fs, 1)); font-weight: 600;
}
.tl-now {
  position: absolute; top: 0; bottom: 0; width: 2px; z-index: 1; pointer-events: none;
  left: calc(var(--tl-name) + var(--off) * var(--px) + var(--px) / 2 - 1px); background: color-mix(in srgb, var(--accent) 70%, transparent);
}
.tl-empty { padding: 18px 12px; position: sticky; left: 0; max-width: min(100%, 90vw); }

/* ---------- Сводка (сессия 31) ---------- */
.summary { display: grid; gap: 12px; max-width: 760px; }
.sum-controls { display: grid; gap: 10px; }
.sum-periods .seg-btn { min-height: 40px; }
@media (max-width: 899px) {
  /* Периоды — одной лентой с прокруткой вбок, чтобы отчёт был виден сразу */
  .sum-periods { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; border-radius: 999px; max-width: 100%; }
  .sum-periods .seg-btn { flex: none; white-space: nowrap; }
}
.sum-tools { flex-wrap: wrap; }
.sum-check { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; cursor: pointer; font-size: calc(14px * var(--fs, 1)); }
.sum-check input { width: 18px; height: 18px; accent-color: var(--accent); }
.sum-stack { display: grid; gap: 10px; }
.sum-report { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: grid; gap: 14px; }
.sum-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.sum-head h2 { margin: 0; font-size: calc(18px * var(--fs, 1)); }
.sum-section { display: grid; gap: 8px; }
.sum-section h3 { margin: 0; display: flex; align-items: center; gap: 6px; font-size: calc(16px * var(--fs, 1)); }
.sum-section h3 svg { width: 18px; height: 18px; }
.sum-done h3 { color: var(--ok); } .sum-open h3 { color: var(--accent); } .sum-wontdo h3 { color: var(--muted); }
.sum-group h4 { margin: 4px 0 2px; font-size: calc(13.5px * var(--fs, 1)); color: var(--muted); font-weight: 600; }
.sum-lines { list-style: none; margin: 0; padding: 0; display: grid; }
.sum-line {
  width: 100%; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-height: 40px; padding: 8px 6px;
  background: none; border: 0; border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  font: inherit; color: var(--text); text-align: start; cursor: pointer; border-radius: 6px;
}
@media (hover: hover) { .sum-line:hover { background: var(--surface-2); } }
.sum-title { flex: 1 1 12em; min-width: 0; overflow-wrap: anywhere; }
.sum-done .sum-title { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }
.sum-meta { flex: 0 1 auto; color: var(--muted); font-size: calc(13px * var(--fs, 1)); }
.sum-line.late .sum-meta { color: var(--late); }
.sum-notes { flex: 1 1 100%; color: var(--muted); font-size: calc(13px * var(--fs, 1)); }

/* ---------- Шаблоны списков (сессия 31) ---------- */
.dlg-templates { width: min(680px, calc(100vw - 24px)); }
@media (max-width: 899px) { .dlg-templates { width: 100vw; max-width: 100vw; } }
.tpl-body { display: grid; gap: 10px; }
.tpl-h { margin: 6px 0 0; font-size: calc(14px * var(--fs, 1)); color: var(--muted); font-weight: 650; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 8px; }
.tpl-card {
  display: flex; align-items: flex-start; gap: 2px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
  border-inline-start: 4px solid var(--tc, var(--border));
}
.tpl-open { flex: 1; min-width: 0; display: flex; gap: 10px; align-items: flex-start; padding: 10px; background: none; border: 0; font: inherit; color: var(--text); text-align: start; cursor: pointer; border-radius: 12px; }
@media (hover: hover) { .tpl-open:hover { background: var(--surface-2); } }
.tpl-ico { font-size: calc(24px * var(--fs, 1)); line-height: 1.1; flex: none; }
.tpl-text { flex: 1; min-width: 0; display: grid; gap: 2px; overflow-wrap: break-word; }
.tpl-text small { font-size: calc(12.5px * var(--fs, 1)); }
.tpl-card .icon-btn { margin: 6px 4px 0 0; flex: none; }
.tpl-from { justify-self: start; max-width: 100%; flex-wrap: wrap; height: auto; min-height: 40px; padding-block: 6px; text-align: start; white-space: normal; }
.tpl-from small { font-weight: 400; }
.tpl-back { justify-self: start; }
.tpl-preview { border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px; max-height: 46vh; overflow-y: auto; display: grid; gap: 4px; }
.tpl-sec { margin: 8px 0 2px; font-size: calc(14px * var(--fs, 1)); }
.tpl-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.tpl-item { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 4px 0; padding-inline-start: calc(var(--depth, 0) * 18px); }
.tpl-item small { display: inline-flex; align-items: center; gap: 3px; }
.tpl-item small svg { width: 13px; height: 13px; }
.tpl-item-title { flex: 1 1 10em; min-width: 0; overflow-wrap: break-word; }
.tpl-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--muted); flex: none; }
.tpl-dot.prio-3 { border-color: var(--p3); } .tpl-dot.prio-2 { border-color: var(--p2); } .tpl-dot.prio-1 { border-color: var(--p1); }
.tpl-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }

/* ---------- Восстановление из JSON (сессия 31) ---------- */
.dlg-restore { width: min(520px, calc(100vw - 24px)); }
@media (max-width: 899px) { .dlg-restore { width: 100vw; max-width: 100vw; } }
.restore-body { display: grid; gap: 10px; }
.restore-body p { margin: 0; overflow-wrap: anywhere; }
.restore-warn { display: flex; gap: 8px; align-items: flex-start; color: var(--warn); }
.restore-warn svg { flex: none; width: 18px; height: 18px; margin-top: 2px; }
.restore-stats { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.restore-stats li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; }
.restore-stats li.add { border-color: color-mix(in srgb, var(--ok) 50%, var(--border)); }
.restore-k { flex: 1 1 6em; }
.restore-stats small { flex: 1 1 100%; }

/* ---------- Журнал изменений задачи (сессия 31) ---------- */
.history-section { gap: 8px; }
.history-btn { justify-self: start; align-self: flex-start; }
.history-btn[aria-expanded="true"] { background: var(--accent-soft); color: var(--accent); }
.history-box { display: grid; gap: 6px; }
.history-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; border-inline-start: 2px solid var(--border); padding-inline-start: 12px; }
.history-item { display: grid; gap: 2px; }
.history-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: calc(13.5px * var(--fs, 1)); }
.history-line { font-size: calc(14px * var(--fs, 1)); overflow-wrap: anywhere; }
.history-from { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }
.history-to { font-weight: 600; }

/* «О виджете» и меню виджета (сессия 34). */
.wg-add-item { position: relative; display: flex; min-width: 0; }
.wg-add-item > .wg-add-card { flex: 1; }
.wg-add-item .wg-add-top { padding-inline-end: 34px; }
.wg-add-info { position: absolute; top: 6px; inset-inline-end: 6px; color: var(--muted); }
.wg-add-info:hover { color: var(--accent); background: var(--accent-soft); }
.dlg-about .dlg-box { width: min(520px, 100%); }
.wg-about { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.wg-about-top { display: flex; gap: 12px; align-items: flex-start; }
.wg-about-top p { margin: 0; font-size: calc(15px * var(--fs, 1)); line-height: 1.45; }
.wg-about-sec h3 { margin: 0 0 6px; color: var(--muted); font-size: calc(12.5px * var(--fs, 1)); font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.wg-about-sec ul { margin: 0; padding-inline-start: 20px; display: grid; gap: 4px; line-height: 1.4; }
.wg-about-ex { list-style: none; padding: 0 !important; }
.wg-about-ex li { padding: 8px 12px; border-radius: 12px; background: var(--surface-2); }
.wg-about .hint { margin: 0; }
.wg.wg-new { animation: wg-new 1.5s ease-out; }
@keyframes wg-new { 0%, 40% { box-shadow: 0 0 0 4px var(--accent), var(--shadow); } 100% { box-shadow: var(--shadow); } }
@media (prefers-reduced-motion: reduce) { .wg.wg-new { animation: none; outline: 3px solid var(--accent); } }

/* Белые виджеты «Сегодня» — в цвет предмета (сессия 34): фон тона, цветной заголовок, значок-водяной знак. */
.wg.tint {
  --tbg: color-mix(in srgb, var(--tone) 18%, var(--surface));
  background: linear-gradient(150deg, var(--tbg) 0%, color-mix(in srgb, var(--tone) 6%, var(--surface)) 75%);
  border-color: color-mix(in srgb, var(--tone) 22%, var(--border));
}
.wg.tint .wg-k { color: color-mix(in srgb, var(--tone) 82%, var(--text)); font-weight: 700; }
.wg.tint .wg-big:not(.alert):not(.warn) { color: color-mix(in srgb, var(--tone) 70%, var(--text)); }
.wg-mark { position: absolute; z-index: 0; inset: 0; overflow: hidden; pointer-events: none; border-radius: inherit; }
/* Значок обрезан рамкой .wg-mark (inset: 0) — за края виджета ничего не выходит и прокрутки не даёт. */
.wg-mark svg {
  position: absolute; inset-inline-end: 8px; bottom: 8px; width: 92px; height: 92px;
  color: var(--tone); opacity: .16; transform: rotate(-8deg);
}
.wg[data-size="s"] .wg-mark svg { width: 70px; height: 70px; }
.wg[data-size="l"] .wg-mark svg, .wg[data-size="t"] .wg-mark svg { width: 120px; height: 120px; }
:root[data-theme="dark"] .wg.tint { --tbg: color-mix(in srgb, var(--tone) 22%, var(--surface)); }
:root[data-theme="dark"] .wg.tint .wg-k, :root[data-theme="dark"] .wg.tint .wg-big:not(.alert):not(.warn) { color: color-mix(in srgb, var(--tone) 55%, white); }
:root[data-theme="dark"] .wg-mark svg { opacity: .2; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .wg.tint { --tbg: color-mix(in srgb, var(--tone) 22%, var(--surface)); }
  :root:not([data-theme="light"]) .wg.tint .wg-k, :root:not([data-theme="light"]) .wg.tint .wg-big:not(.alert):not(.warn) { color: color-mix(in srgb, var(--tone) 55%, white); }
  :root:not([data-theme="light"]) .wg-mark svg { opacity: .2; }
}

/* Мини-приложение «Сегодня» на компьютере — посередине, вместо сетки виджетов (сессия 34, порция Б). */
.today-view.app-open .wg-grid, .today-view.app-open .wg-footer, .today-view.app-open .wg-editbar { display: none; }
.wapp.wapp-inline {
  position: static; display: block; inset: auto; width: 100%; max-width: 1100px; height: auto; max-height: none; margin: 0 auto;
  border: 1px solid var(--border); border-radius: 24px; box-shadow: var(--shadow); background: var(--bg); overflow: visible;
}
.wapp-inline .wa-box { height: auto; }
.wapp-inline .wa-head { position: sticky; top: 0; z-index: 2; padding: 8px 12px; border-radius: 24px 24px 0 0; }
.wapp-inline .wa-body { overflow: visible; padding: 14px 18px 22px; }

/* Строка задачи: дата и приоритет при наведении мышью (сессия 34). На телефоне — нет (долгое нажатие — меню). */
/* В строке рядом с «⋯» (место занято всегда — при наведении ничего не прыгает и не закрывает «☑ N/M»). */
.row-quick { flex: 0 0 auto; display: flex; gap: 0; opacity: 0; transition: opacity .12s; }
.row-quick .icon-btn { color: var(--muted); }
.row-quick .icon-btn:hover { color: var(--accent); background: var(--accent-soft); }
.task-row:hover .row-quick, .task-row:focus-within .row-quick, .row-quick:has([aria-expanded="true"]) { opacity: 1; }
@media (pointer: coarse), (max-width: 899px) { .row-quick { display: none; } }

/* ---------- Движение (сессия 36, порция Г): js/motion.js ---------- */
/* «Анимации» выключены в настройках или системой («Уменьшить движение») — всё мгновенно (кроме значка загрузки). */
:root.no-motion *:not(.pull-svg), :root.no-motion *:not(.pull-svg)::before, :root.no-motion *:not(.pull-svg)::after {
  animation-duration: 1ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important;
  transition-duration: 1ms !important; transition-delay: 0s !important; scroll-behavior: auto !important;
}

/* Переходы между разделами (View Transitions): едет только середина, шапка и вкладки стоят. Имя — только на время
   перехода (data-vt): постоянное имя делает .main отдельным слоем, и окно задачи на телефоне уходит под шапку. */
:root[data-vt] .main { view-transition-name: yahad-main; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; }
::view-transition-group(yahad-main) { animation-duration: .26s; }
:root[data-vt="fwd"]::view-transition-old(yahad-main) { animation: vt-out-start .18s ease-in both; }
:root[data-vt="fwd"]::view-transition-new(yahad-main) { animation: vt-in-end .26s cubic-bezier(.2, .8, .2, 1) both; }
:root[data-vt="back"]::view-transition-old(yahad-main) { animation: vt-out-end .18s ease-in both; }
:root[data-vt="back"]::view-transition-new(yahad-main) { animation: vt-in-start .26s cubic-bezier(.2, .8, .2, 1) both; }
:root[data-vt="fade"]::view-transition-old(yahad-main) { animation: vt-fade-out .14s ease-in both; }
:root[data-vt="fade"]::view-transition-new(yahad-main) { animation: vt-rise .22s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes vt-out-start { to { opacity: 0; transform: translateX(-28px); } }
@keyframes vt-out-end { to { opacity: 0; transform: translateX(28px); } }
@keyframes vt-in-end { from { opacity: 0; transform: translateX(28px); } }
@keyframes vt-in-start { from { opacity: 0; transform: translateX(-28px); } }
@keyframes vt-fade-out { to { opacity: 0; } }
@keyframes vt-rise { from { opacity: 0; transform: translateY(8px); } }

/* Галочка рисуется: кружок «прыгает», линия проводится (список задач — .completing, «Сегодня» — .drawing). */
@keyframes check-draw { from { stroke-dashoffset: 24; } to { stroke-dashoffset: 0; } }
@keyframes check-pop { 0% { transform: scale(1); } 40% { transform: scale(.8); } 75% { transform: scale(1.14); } 100% { transform: scale(1); } }
.task-row.completing .check svg { animation: check-pop .32s ease-out; }
.task-row.completing .check svg path { stroke-dasharray: 24; animation: check-draw .24s ease-out .05s both; }
.cal-check.drawing { background: var(--c); border-color: var(--c); animation: check-pop .3s ease-out; }
.cal-check.drawing svg path { stroke-dasharray: 24; animation: check-draw .22s ease-out .04s both; }
.td-row:has(.cal-check.drawing) .td-title { color: var(--muted); text-decoration: line-through; transition: color .2s; }
.motion-ghost { background: var(--surface); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; }

/* Небо на «Сегодня»: фон по фазе солнца в Хайфе (data-sky от js/sky.js), в шаббат — тёплый свет свечей.
   Цвета — зарегистрированные свойства, поэтому смена фазы перетекает за 2,5 с. */
@property --sky-a { syntax: '<color>'; inherits: false; initial-value: transparent; }
@property --sky-b { syntax: '<color>'; inherits: false; initial-value: transparent; }
@property --sky-c { syntax: '<color>'; inherits: false; initial-value: transparent; }
:root {
  --sky-night-a: #c3cdee; --sky-night-b: #e1e5f4;
  --sky-dawn-a: #ffc4ad; --sky-dawn-b: #fbe4da;
  --sky-morning-a: #ffe39b; --sky-morning-b: #fcf1d5;
  --sky-day-a: #b8dcff; --sky-day-b: #e2eefa;
  --sky-sunset-a: #ffb489; --sky-sunset-b: #fbdfcd;
  --sky-dusk-a: #c8b8f0; --sky-dusk-b: #e7dff6;
  --sky-shabbat-a: #ffd37a; --sky-shabbat-b: #fbefd2; --sky-candle: #ffb04a;
}
:root[data-theme="dark"] {
  --sky-night-a: #1d2b57; --sky-night-b: #151a2a;
  --sky-dawn-a: #4c2a36; --sky-dawn-b: #251c22;
  --sky-morning-a: #4a3c16; --sky-morning-b: #26231a;
  --sky-day-a: #1a3b5f; --sky-day-b: #162231;
  --sky-sunset-a: #5c2e19; --sky-sunset-b: #2a1d17;
  --sky-dusk-a: #34295e; --sky-dusk-b: #1f1b2d;
  --sky-shabbat-a: #5c4412; --sky-shabbat-b: #2a2316; --sky-candle: #c77a1c;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sky-night-a: #1d2b57; --sky-night-b: #151a2a;
    --sky-dawn-a: #4c2a36; --sky-dawn-b: #251c22;
    --sky-morning-a: #4a3c16; --sky-morning-b: #26231a;
    --sky-day-a: #1a3b5f; --sky-day-b: #162231;
    --sky-sunset-a: #5c2e19; --sky-sunset-b: #2a1d17;
    --sky-dusk-a: #34295e; --sky-dusk-b: #1f1b2d;
    --sky-shabbat-a: #5c4412; --sky-shabbat-b: #2a2316; --sky-candle: #c77a1c;
  }
}
.today-view.sky-bg {
  --sky-a: var(--bg); --sky-b: var(--bg); --sky-c: transparent;
  background:
    radial-gradient(38% 22% at 88% 0%, var(--sky-c), transparent 72%),
    radial-gradient(130% 50% at 50% -6%, var(--sky-a), transparent 72%),
    linear-gradient(180deg, var(--sky-b), var(--bg) 70%);
  transition: --sky-a 2.5s ease, --sky-b 2.5s ease, --sky-c 2.5s ease;
}
.today-view.sky-bg[data-sky="night"] { --sky-a: var(--sky-night-a); --sky-b: var(--sky-night-b); }
.today-view.sky-bg[data-sky="dawn"] { --sky-a: var(--sky-dawn-a); --sky-b: var(--sky-dawn-b); }
.today-view.sky-bg[data-sky="morning"] { --sky-a: var(--sky-morning-a); --sky-b: var(--sky-morning-b); }
.today-view.sky-bg[data-sky="day"] { --sky-a: var(--sky-day-a); --sky-b: var(--sky-day-b); }
.today-view.sky-bg[data-sky="sunset"] { --sky-a: var(--sky-sunset-a); --sky-b: var(--sky-sunset-b); }
.today-view.sky-bg[data-sky="dusk"] { --sky-a: var(--sky-dusk-a); --sky-b: var(--sky-dusk-b); }
.today-view.sky-bg[data-shabbat] { --sky-a: var(--sky-shabbat-a); --sky-b: var(--sky-shabbat-b); --sky-c: color-mix(in srgb, var(--sky-candle) 55%, transparent); }

/* ---------- Главный экран заново: варианты A / B / C (11.11, views/home-variants.js) ---------- */
.hv-host[hidden] { display: none; }
.hv { display: flex; flex-direction: column; gap: 16px; }
.hv-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.hv-main, .hv-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
@media (min-width: 900px) {
  .hv-cols { grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); max-width: 1480px; width: 100%; margin: 0 auto; align-items: start; }
  .hv-side { position: sticky; top: 12px; }
}
.hv-now { min-height: calc(150px * var(--fs, 1)); }
.hv-sec { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 14px; border-radius: 22px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.hv-sec-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; min-width: 0; min-height: 32px; }
.hv-sec-head h2 { flex: 1 1 auto; min-width: 0; margin: 0; font-size: calc(17px * var(--fs, 1)); font-weight: 750; letter-spacing: -.01em; overflow-wrap: anywhere; }
.hv-more { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding: 0 4px; color: var(--accent); font-weight: 650; text-decoration: none; cursor: pointer; }
.hv-more svg { width: 16px; height: 16px; }
.hv-quiet { display: flex; align-items: center; gap: 10px; padding: 8px 2px; color: var(--muted); }
.hv-quiet svg { flex: none; width: 20px; height: 20px; color: var(--ok); }
.hv-hint { color: var(--muted); }

/* «Важное»: значок · что и до когда · сумма; кнопки — строкой ниже. Цвет полосы — только смысл: жёлтая — скоро, красная — тревога. */
.hv-imps { display: flex; flex-direction: column; gap: 8px; }
.hv-imp {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "i t v" "a a a"; align-items: center; gap: 4px 12px;
  padding: 10px 12px; border-radius: 16px; background: var(--bg); border: 1px solid var(--border); border-inline-start: 4px solid var(--border); cursor: pointer;
}
.hv-imp.lv-warn { border-inline-start-color: var(--warn); }
.hv-imp.lv-alert { border-inline-start-color: var(--danger); }
.hv-imp > .ico-tile { grid-area: i; width: 40px; height: 40px; }
.hv-imp-t { grid-area: t; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hv-imp-t strong { font-weight: 650; overflow-wrap: anywhere; }
.hv-imp-t small { color: var(--muted); overflow-wrap: anywhere; }
.hv-imp-t .hv-imp-k { color: var(--accent); font-size: calc(12px * var(--fs, 1)); font-weight: 650; letter-spacing: .02em; }
.hv-imp-v { grid-area: v; font-family: var(--display); font-weight: 700; font-size: calc(17px * var(--fs, 1)); white-space: nowrap; }
.hv-imp-act { grid-area: a; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.hv-imp-act .btn { min-height: 40px; }
.hv-imp:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
/* Пачка 3: день рождения сегодня — сверху экрана; окно «Поздравить». */
.hv-bday { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 22px; border: 1px solid color-mix(in srgb, #d6457a 35%, var(--border)); background: color-mix(in srgb, #d6457a 10%, var(--surface)); box-shadow: var(--shadow); }
.hv-bday-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; min-width: 0; }
.hv-bday-cake { font-size: calc(30px * var(--fs, 1)); line-height: 1; flex: none; }
.hv-bday-t { display: flex; flex-direction: column; gap: 2px; flex: 1 1 9em; min-width: 0; }
.hv-bday-t small { color: var(--muted); }
.hv-bday-t strong { font-size: calc(18px * var(--fs, 1)); font-weight: 700; overflow-wrap: anywhere; }
.hv-bday-row .btn { min-height: 44px; margin-inline-start: auto; }
.gr { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.gr-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.gr-who-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gr-who-t strong { font-size: calc(18px * var(--fs, 1)); overflow-wrap: anywhere; }
.gr-who-t small { color: var(--muted); }
.gr-text { width: 100%; box-sizing: border-box; min-height: 7.5em; padding: 10px 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2, var(--surface)); color: var(--text); font: inherit; line-height: 1.45; resize: vertical; }
.gr-hint { margin: 0; }
.dlg-greet .dlg-actions { flex-wrap: wrap; }
.dlg-greet .dlg-actions .btn { flex: 1 1 10em; justify-content: center; min-height: 44px; }
.hv-showall { align-self: flex-start; }

/* B: «Важное» стопкой — листать пальцем, карточка почти во всю ширину (видно край следующей). */
.hv-stack { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; padding-bottom: 2px; }
.hv-stack::-webkit-scrollbar { display: none; }
.hv-stack > .hv-imp { flex: 0 0 88%; scroll-snap-align: start; min-height: calc(92px * var(--fs, 1)); }
.hv-stack > .hv-imp:only-child { flex-basis: 100%; }

.hv-tasks .td-row { background: transparent; }
.hv-task-foot { justify-content: space-between; }
.hv-week { align-self: flex-start; min-height: 44px; }
.hv-week .ico-tile { width: 26px; height: 26px; }

/* A: полка мини-приложений — две колонки карточек «значок · название · что внутри». */
/* 13.11: полка — контейнер (hvshelf): название плитки не рвётся посреди слова («Посмотрет / ь» на 360 ×1,35) —
   узкая плитка ставит значок над названием, шрифт названия — по ширине полки (min(…, cqi)). */
.hv-shelf { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; container: hvshelf / inline-size; }
.hv-chip {
  display: flex; align-items: center; gap: 10px; min-width: 0; min-height: calc(64px * var(--fs, 1)); padding: 10px; border-radius: 16px;
  background: var(--bg); border: 1px solid var(--border); color: var(--text); text-align: start; font: inherit; cursor: pointer;
}
.hv-chip:hover { background: var(--surface-2); }
.hv-chip > .ico-tile { flex: none; width: 36px; height: 36px; }
.hv-chip-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hv-chip-t strong { font-weight: 650; overflow-wrap: normal; word-break: keep-all; hyphens: manual; }
.hv-chip-t small { color: var(--muted); overflow-wrap: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* Две колонки на узкой полке (телефон): значок над текстом — названию вся ширина плитки, шрифт не больше её. */
@container hvshelf (max-width: 440px) {
  .hv-chip { flex-direction: column; align-items: flex-start; gap: 6px; }
  .hv-chip > .ico-tile { width: 32px; height: 32px; }
  .hv-chip-t { align-self: stretch; }
  .hv-chip-t strong { font-size: min(calc(15px * var(--fs, 1)), calc(7.2cqi - 3px)); }
  .hv-chip-add > svg { margin-inline: 5px; }
}
/* Пустые плитки (13.11) — одной строкой под полкой: «Ещё: Посылки · Машина · Поездки». */
.hv-empty { display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; margin-top: 6px; padding: 0 4px; color: var(--muted); }
.hv-empty > small { margin-inline-end: 4px; font-size: calc(13.5px * var(--fs, 1)); }
.hv-empty-a {
  min-height: 44px; padding: 0 6px; border: 0; border-radius: 10px; background: transparent; color: var(--accent);
  font: inherit; font-size: calc(14.5px * var(--fs, 1)); font-weight: 600; cursor: pointer; overflow-wrap: normal; word-break: keep-all;
}
.hv-empty-a:hover, .hv-empty-a:focus-visible { background: var(--accent-soft); }
.hv-empty-dot { color: var(--muted); }
.hv-empty-i { display: inline-flex; align-items: center; gap: 4px; }
.hv-chip-add { border-style: dashed; justify-content: flex-start; }
.hv-chip-add > svg { flex: none; width: 22px; height: 22px; margin-inline: 7px; color: var(--accent); }

/* B: плитки — сетка 2 колонки, «+ Добавить» — пунктиром. */
.hv-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(calc(132px * var(--fs, 1)), auto); grid-auto-flow: row dense; gap: 10px; }
.hv-tile .wg-in { padding: 12px; }
.hv-tile-ctl { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.hv-tile-ctl > * { pointer-events: auto; }
.hv-add-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: calc(132px * var(--fs, 1));
  border-radius: 22px; border: 2px dashed var(--border); background: transparent; color: var(--accent); font: inherit; font-weight: 650; cursor: pointer;
}
.hv-add-tile svg { width: 26px; height: 26px; }
.hv-add-tile:disabled { color: var(--muted); cursor: default; }

/* Настройка галочками: строка во всю ширину, одно касание. */
.hv-pick { display: flex; flex-direction: column; gap: 6px; }
.hv-pick-row {
  display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: 12px; min-height: 56px; padding: 8px 12px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); text-align: start; font: inherit; cursor: pointer;
}
.hv-pick-row.on { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); background: var(--accent-soft); }
.hv-pick-row:disabled { opacity: .55; cursor: default; }
.hv-pick-row > .ico-tile { width: 34px; height: 34px; }
.hv-box { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--muted); color: var(--accent-text); }
.hv-pick-row.on .hv-box { background: var(--accent); border-color: var(--accent); }
.hv-box svg { width: 15px; height: 15px; stroke-width: 3; }
.hv-pick-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hv-pick-t small { color: var(--muted); overflow-wrap: anywhere; }
/* Полка (A, 12.11): строка + ручка ⠿ у края — перетащить; галочка — по строке. */
.hv-pick-item { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: stretch; gap: 4px; border-radius: 14px; }
.hv-pick-item.dragging { z-index: 2; background: var(--surface); box-shadow: 0 10px 28px rgb(0 0 0 / .28); }
.hv-pick-item.drop-before::before, .hv-pick-item.drop-after::after {
  content: ''; position: absolute; inset-inline: 0; height: 3px; border-radius: 2px; background: var(--accent); pointer-events: none;
}
.hv-pick-item.drop-before::before { top: -5px; }
.hv-pick-item.drop-after::after { bottom: -5px; }
.hv-grip {
  display: grid; place-items: center; min-width: 44px; min-height: 44px; border: 0; border-radius: 12px; background: transparent;
  color: var(--muted); cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none;
}
.hv-grip:hover, .hv-grip:focus-visible { background: var(--accent-soft); color: var(--text); }
.hv-grip:active { cursor: grabbing; }
.hv-grip svg { width: 22px; height: 22px; }

.hv .td-row .td-title { flex: 1 1 0; min-width: min(9em, 55%); white-space: normal; overflow-wrap: break-word; }
.hv-sec { container-type: inline-size; }
/* Узко (телефон с крупным шрифтом): сумма — под названием, а не третьей колонкой. */
@container (max-width: 320px) {
  .hv-imp { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "i t" "i v" "a a"; }
  .hv-imp-v { justify-self: start; }
  .hv-imp > .ico-tile { width: 34px; height: 34px; align-self: start; }
}
/* Широко (компьютер): кнопки «Письмо» / «Оплатил» — в той же строке, справа. */
@container (min-width: 620px) {
  .hv-imps > .hv-imp { grid-template-columns: auto minmax(0, 1fr) auto auto; grid-template-areas: "i t v a"; }
  .hv-imps > .hv-imp .hv-imp-act { flex-wrap: nowrap; }
}

/* «Ближайшие дни» (13.11): сегодня и дальше — день заголовком, строки «время · название».
   Сетка (13.11 вечер, снимок Алексея: иврит налез на «14:30», «весь день» в две строки, время разного кегля):
   одна колонка времени на весь список — subgrid от .ah-days (ширина — по самому широкому: «00:00» или плашка
   «весь день»; на телефоне с крупным системным шрифтом Android раздувает текст, а не em-ширины — колонка растёт вместе
   с ним, текст не наезжает). Колонок три: время слева · название · время справа. Строка на иврите (dir="rtl") —
   subgrid читает колонки зеркально, и то же правило ставит её время в правую колонку, а название — левее.
   Время — шрифтом строки (не Unbounded), на ступень крупнее названия; зазор 10 px в обе стороны; название — до 3 строк;
   «важно» — под названием.
   Проверка — tests/e2e/krasota.mjs (rowGrid, режим «текст раздут») и noJunk (timeCrowd). */
.ah-days {
  --ah-tw: calc(16px + 3em);
  display: grid; grid-template-columns: minmax(var(--ah-tw), max-content) minmax(0, 1fr) minmax(var(--ah-tw), max-content); column-gap: 10px; row-gap: 6px; min-width: 0;
  font-size: calc(15px * var(--fs, 1));
}
.ah-day, .ah-rows, .ah-row { grid-column: 1 / -1; display: grid; grid-template-columns: var(--ah-tw) minmax(0, 1fr); grid-template-columns: subgrid; min-width: 0; }
.ah-day { row-gap: 4px; }
.ah-day > * { grid-column: 1 / -1; }
.ah-day + .ah-day { padding-top: 4px; border-top: 1px solid var(--border); }
.ah-day-h { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; min-height: 36px; padding: 6px 2px 0; color: var(--text); text-decoration: none; }
.ah-day-h strong { font-size: calc(15.5px * var(--fs, 1)); font-weight: 750; }
.ah-day-h small { color: var(--muted); font-size: calc(13px * var(--fs, 1)); }
.ah-rows { row-gap: 4px; }
.ah-row {
  align-items: center; row-gap: 2px; min-height: 44px;
  padding: 6px 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border); border-inline-start: 4px solid var(--c, var(--border));
  font-size: calc(15px * var(--fs, 1)); line-height: 1.3; color: var(--text); text-decoration: none; cursor: pointer;
}
.ah-row:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.ah-time { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; line-height: 1.15; }
.ah-hm { font-size: 1.07em; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; letter-spacing: 0; }
.ah-ad { display: inline-block; padding: 1px 5px; border-radius: 6px; background: var(--surface-2, color-mix(in srgb, var(--text) 7%, transparent));
  color: var(--muted); font-size: .7em; font-weight: 600; line-height: 1.35; white-space: nowrap; }
.ah-t { grid-column: 2 / -1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ah-title { font-weight: 600; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.ah-sub { color: var(--muted); font-size: calc(13px * var(--fs, 1)); overflow-wrap: anywhere; }
.ah-sub > bdi, .rb-sub > bdi { display: inline-block; max-width: 100%; } /* «до 11:30» и место переносятся целиком */
/* Прошедшее — серым текстом, не прозрачностью (контраст ≥ 4,5: при 16 px время уже не «крупный текст»). */
.ah-row.past { color: var(--muted); }
.ah-row.past .ah-hm { font-weight: 500; }
.ah-row.past .ah-title { font-weight: 500; }
.ah-row.imp { border-inline-start-color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, var(--bg)); }
.ah-row.imp .ah-title { font-weight: 750; }
.ah-imp { grid-column: 2 / -1; justify-self: start; padding: 2px 8px; border-radius: 999px; background: var(--warn); color: var(--bg); font-size: calc(12px * var(--fs, 1)); font-weight: 700; white-space: nowrap; }
.ah-more { cursor: pointer; }
.ah-more .ah-title { font-weight: 500; color: var(--muted); }
.ah-free { padding: 2px 12px 6px; color: var(--muted); font-size: calc(14px * var(--fs, 1)); }
.ah-free.wait { font-style: italic; }
/* Пачка 3: свои строки дня («Неделя»: дни рождения, счета) и погода в заголовке дня. */
.ah-x-act { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.ah-x-act .btn { min-height: 40px; }
.ah-row.k-bday { border-inline-start-color: #d6457a; }
.ah-row.k-bill { border-inline-start-color: var(--ok, #2e7d32); }
.ah-day-h .ah-wx { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: calc(13px * var(--fs, 1)); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ah-day-h .ah-wx svg { width: 22px; height: 22px; flex: none; }
.hv-s-days { gap: 4px; }

/* ---------- «Привычки» (пачка 2): views/habits.js, ряд — и на «Сегодня» (APPS.habits, строка в A) ---------- */
.habits-view { --hb: #d6409f; display: flex; flex-direction: column; gap: 12px; padding: 12px 16px calc(24px + var(--safe-bottom)); max-width: 760px; margin: 0 auto; width: 100%; box-sizing: border-box; }
.hb-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hb-head h2 { margin: 0; font-size: calc(18px * var(--fs, 1)); }
.hb-sum { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.hb-sum strong { font-family: var(--display, inherit); font-size: calc(26px * var(--fs, 1)); }
.hb-sum span { color: var(--muted); }
.hb-list { display: flex; flex-direction: column; gap: 8px; }
.hb-row { --hb: #d6409f; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); min-width: 0; }
.hb-row.rest:not(.done) { opacity: .8; }
.hb-check { position: relative; width: 52px; height: 52px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--hb) 55%, var(--border)); background: var(--surface-2); display: grid; place-items: center; cursor: pointer; padding: 0; transition: transform .15s, background .2s; }
.hb-check:active { transform: scale(.94); }
.hb-check.on { background: color-mix(in srgb, var(--hb) 22%, var(--surface)); border-color: var(--hb); }
.hb-ico { font-size: 26px; line-height: 1; }
.hb-tick { position: absolute; right: -4px; bottom: -4px; width: 22px; height: 22px; border-radius: 50%; background: var(--hb); color: #fff; display: grid; place-items: center; }
.hb-tick svg { width: 14px; height: 14px; }
.hb-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hb-name { font-size: calc(16px * var(--fs, 1)); overflow-wrap: break-word; }
.hb-row.done .hb-name { color: var(--muted); }
.hb-line { color: var(--muted); font-size: calc(13px * var(--fs, 1)); overflow-wrap: break-word; }
.hb-week { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; max-width: 420px; }
.hb-row.compact { grid-template-columns: auto minmax(0, 1fr); }
@media (max-width: 599px) { .hb-add-t { display: none; } .hb-add { min-width: 44px; } }
.hb-dot { min-width: 0; height: 44px; border-radius: 12px; border: 1px solid var(--border); background: transparent; color: var(--muted); display: grid; place-items: center; padding: 0 2px; cursor: pointer; }
.hb-dot small { font-size: calc(12px * var(--fs, 1)); }
.hb-dot.on { background: var(--hb); border-color: var(--hb); color: #fff; }
.hb-dot.today { border-width: 2px; border-color: var(--hb); }
.hb-dot.off:not(.on) { border-style: dashed; opacity: .7; }
.hb-dot:disabled { opacity: .45; cursor: default; }
.hb-more { min-width: 44px; min-height: 44px; }
.hb-row.compact { padding: 6px 10px; }
.hb-row.compact .hb-check { width: 44px; height: 44px; }
.hb-row.compact .hb-ico { font-size: 22px; }
.hb-row.hb-joy { animation: hb-joy .9s ease; }
@keyframes hb-joy { 0% { transform: scale(1); } 30% { transform: scale(1.03); box-shadow: 0 0 0 6px color-mix(in srgb, var(--hb) 30%, transparent); } 100% { transform: scale(1); box-shadow: none; } }
.hb-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 24px 8px; }
.hb-empty-ico { font-size: 48px; }
.hb-empty h2 { margin: 0; }
.hb-empty p { margin: 0; color: var(--muted); max-width: 32em; }
.hb-suggest { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.hb-empty-note { color: var(--muted); }
.hb-arch-link { align-self: flex-start; }
.hb-remind { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hb-remind-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hb-remind-time { flex: 0 1 9em; min-width: 7em; }
.hb-remind small { overflow-wrap: anywhere; }
.hb-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.hb-ipick { min-height: 44px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); font-size: 22px; cursor: pointer; }
.hb-ipick.on { border: 2px solid #d6409f; background: color-mix(in srgb, #d6409f 14%, var(--surface)); }
.hb-freq-extra { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.hv-habits { display: flex; flex-direction: column; gap: 6px; }
.wa-habits { display: flex; flex-direction: column; gap: 8px; }
.wa-row-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.hv-habits-done { margin: 0; color: var(--muted); }
.wg-hbs { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.wg-hb { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; max-width: 100%; padding: 4px 12px 4px 6px; border-radius: 22px; border: 1px solid color-mix(in srgb, #d6409f 40%, var(--border)); background: var(--surface); color: var(--text); cursor: pointer; min-width: 0; }
.wg-hb.on { background: color-mix(in srgb, #d6409f 18%, var(--surface)); }
.wg-hb-i { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; background: var(--surface-2); flex: none; }
.wg-hb.on .wg-hb-i { background: #d6409f; color: #fff; font-weight: 700; }
.wg-hb-t { overflow-wrap: anywhere; text-align: start; min-width: 0; }

/* ---------- Рецепт по ссылке и «Готовлю» (пачка 2): views/recipe.js ---------- */
.rc-status { color: var(--muted); }
.rc-status:empty { display: none; }
.rc-status.ok { color: var(--ok); font-weight: 600; }
.rc-status.warn { color: var(--warn); font-weight: 600; }
.rc-preview { display: grid; gap: 10px; min-width: 0; }
.rc-preview:empty { display: none; }
.rc-items { display: grid; gap: 4px; }
.rc-list { margin: 0; padding-inline-start: 1.2em; display: grid; gap: 2px; }
.rc-list li { overflow-wrap: anywhere; }
.wa-cook-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0 4px; }
.wa-cook-row small { min-width: 0; overflow-wrap: anywhere; }
/* Во весь экран: окно без полей, шрифт крупнее. */
.dlg.dlg-cook { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; }
.dlg.dlg-cook .dlg-box { height: 100dvh; max-height: none; border-radius: 0; padding-top: var(--safe-top); padding-bottom: var(--safe-bottom); box-sizing: border-box; }
.dlg.dlg-cook .dlg-head h2 { font-size: calc(20px * var(--fs, 1)); overflow-wrap: anywhere; }
.dlg.dlg-cook .dlg-body { flex: 1; display: flex; flex-direction: column; }
.ck { display: flex; flex-direction: column; gap: 12px; flex: 1 0 auto; max-width: 760px; width: 100%; margin: 0 auto; }
.ck > * { flex-shrink: 0; } /* иначе высокий блок сплющивает соседей и текст наезжает */
.ck-meta { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; color: var(--muted); }
.ck-meta-t { min-width: 0; overflow-wrap: anywhere; }
.ck-awake { font-size: calc(13px * var(--fs, 1)); }
.ck-awake:empty { display: none; }
.ck-ingr { border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; background: var(--surface-2); }
.ck-ingr summary { cursor: pointer; font-weight: 600; min-height: 32px; display: flex; align-items: center; }
.ck-scale { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 8px 0 2px; flex-wrap: wrap; }
.ck-scale .icon-btn { min-width: 44px; min-height: 44px; font-size: calc(22px * var(--fs, 1)); border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.ck-scale-t { min-width: 0; text-align: center; font-weight: 600; color: var(--muted); }
.ck-scale-t.on { color: var(--accent); }
.ck-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.ck-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 4px 6px; border: 0; background: transparent; color: var(--text); text-align: start; font-size: calc(17px * var(--fs, 1)); cursor: pointer; border-radius: 10px; }
.ck-item.on .ck-item-t { text-decoration: line-through; color: var(--muted); }
.ck-box { flex: none; width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--border); display: grid; place-items: center; }
.ck-item.on .ck-box { background: var(--accent); border-color: var(--accent); color: #fff; }
.ck-box svg { width: 16px; height: 16px; }
.ck-item-t { min-width: 0; overflow-wrap: anywhere; }
.ck-step { flex: 1 0 auto; }
.ck-num { color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.ck-text { margin: 0; font-size: calc(24px * var(--fs, 1)); line-height: 1.4; overflow-wrap: break-word; }
.ck-all { margin: 0; padding: 0; list-style: none; display: grid; gap: 16px; }
.ck-all .ck-text { font-size: calc(18px * var(--fs, 1)); }
.ck-all li.cur { border-inline-start: 4px solid var(--accent); padding-inline-start: 10px; }
.ck-tbtns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.ck-tbtn { font-size: calc(18px * var(--fs, 1)); min-height: 48px; font-variant-numeric: tabular-nums; }
.ck-timers { display: flex; gap: 8px; flex-wrap: wrap; position: sticky; top: 0; z-index: 2; }
.ck-timer { display: flex; align-items: center; gap: 2px; border-radius: 14px; background: var(--accent-soft); padding-inline-end: 2px; }
.ck-timer.done { background: color-mix(in srgb, var(--warn) 25%, var(--surface)); animation: ck-ring 1s ease-in-out 3; }
.ck-timer-main { display: flex; align-items: baseline; gap: 8px; min-height: 44px; padding: 4px 12px; border: 0; background: transparent; color: var(--text); cursor: pointer; }
.ck-timer-main strong { font-size: calc(22px * var(--fs, 1)); font-variant-numeric: tabular-nums; }
.ck-timer-step { color: var(--muted); font-size: calc(13px * var(--fs, 1)); }
@keyframes ck-ring { 50% { transform: scale(1.04); } }
.ck-nav { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: center; width: 100%; max-width: 760px; margin: 0 auto; }
.dlg.dlg-cook .dlg-actions .ck-nav .btn { flex: none; min-width: 0; }
.dlg.dlg-cook .dlg-actions:has(.ck-nav:empty) { display: none; }
.ck-nav .ck-prev, .ck-nav .ck-next { min-height: 52px; font-size: calc(18px * var(--fs, 1)); justify-content: center; }
.ck-text[dir="rtl"] { text-align: right; }

/* Покупки по отделам (пачка 3): окно «Порядок отделов». */
.sc { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sc-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; align-items: center; gap: 4px 8px; min-height: 48px; padding: 2px 4px 2px 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); touch-action: pan-y; }
.sc-row.dragging { position: relative; z-index: 2; box-shadow: var(--shadow); background: var(--surface-2, var(--surface)); }
.sc-emoji { font-size: calc(20px * var(--fs, 1)); line-height: 1; }
.sc-title { font-weight: 600; overflow-wrap: anywhere; }
.sc-grip { touch-action: none; cursor: grab; color: var(--muted); }
.sc-row .icon-btn { min-width: 44px; min-height: 44px; }
.task-group.kind-shopcat > .group-head .group-title { font-weight: 700; }

/* ---------- «Поездки» v1 (13.11): views/trips.js ---------- */
.trips-view { display: flex; flex-direction: column; gap: 12px; padding: 12px 16px calc(24px + var(--safe-bottom)); max-width: 820px; margin: 0 auto; width: 100%; box-sizing: border-box; min-width: 0; }
.tr-cover { --tone: #12a594; flex: none; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 26px; line-height: 1; background: color-mix(in srgb, var(--tone) 18%, var(--surface)); border: 1px solid color-mix(in srgb, var(--tone) 35%, var(--border)); }
.tr-cover.big { width: 64px; height: 64px; font-size: 34px; border-radius: 18px; }
.tr-group { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tr-group h2, .tr-past-btn { margin: 4px 0 0; font-size: calc(15px * var(--fs, 1)); color: var(--muted); font-weight: 600; }
.tr-past-btn { align-self: flex-start; background: none; border: 0; padding: 0 4px; cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; font-family: inherit; }
.tr-past-btn svg { width: 18px; height: 18px; }
.tr-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
@media (min-width: 900px) { .tr-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tr-card { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 6px 12px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: inherit; text-decoration: none; min-width: 0; min-height: 44px; }
.tr-card.ph-past { opacity: .85; }
.tr-card-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tr-card-t strong { font-size: calc(16px * var(--fs, 1)); overflow-wrap: anywhere; }
.tr-card-t small { color: var(--muted); font-size: calc(13px * var(--fs, 1)); overflow-wrap: anywhere; }
.tr-count { grid-column: 2; justify-self: start; padding: 2px 10px; border-radius: 999px; font-size: calc(13px * var(--fs, 1)); font-weight: 600; background: var(--surface-2); color: var(--text); white-space: normal; }
.tr-count.ph-now { background: color-mix(in srgb, var(--accent) 20%, var(--surface)); color: var(--accent); }
.tr-count.ph-soon { background: color-mix(in srgb, #e5760b 16%, var(--surface)); color: color-mix(in srgb, #e5760b 75%, var(--text)); }
.tr-empty .tr-hint { justify-content: center; }
.tr-hint { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; margin: 0; color: var(--muted); font-size: calc(13px * var(--fs, 1)); }
.tr-hint svg { width: 16px; height: 16px; flex: none; }
.tr-hint a { color: var(--accent); min-height: 32px; display: inline-flex; align-items: center; }
.tr-muted { color: var(--muted); margin: 0; font-size: calc(13px * var(--fs, 1)); }
/* Корзина поездок (пачка 7): строка — обложка · название и срок · кнопки (на узком — кнопки строкой ниже). */
.tr-trash-list { display: flex; flex-direction: column; gap: 8px; }
.tr-trash-row { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px 12px; padding: 10px 12px; border: 1px dashed var(--border); border-radius: 14px; min-width: 0; }
.tr-trash-row .tr-card-t b { font-size: calc(15px * var(--fs, 1)); overflow-wrap: anywhere; }
.tr-trash-acts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.tr-back { align-self: flex-start; }
.tr-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; min-width: 0; }
.tr-head-t { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tr-head-t h2 { margin: 0; font-size: calc(22px * var(--fs, 1)); overflow-wrap: anywhere; }
.tr-head-sub { color: var(--muted); font-size: calc(14px * var(--fs, 1)); overflow-wrap: anywhere; }
.tr-head-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tr-head-chips .tr-count { grid-column: auto; }
.tr-shared { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: calc(13px * var(--fs, 1)); }
.tr-shared svg { width: 16px; height: 16px; }
.tr-note { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); white-space: pre-wrap; overflow-wrap: anywhere; }
/* Четыре вкладки — всегда в один ряд (михкар 16.11: на 412 «Вещи» уезжали второй строкой); подпись мельчает по ширине. */
.tr-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); container-type: inline-size; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); }
.tr-tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 48px; padding: 4px 2px; border-radius: 10px; color: var(--muted); text-decoration: none; font-size: min(calc(13px * var(--fs, 1)), 4.6cqi); text-align: center; min-width: 0; }
.tr-tab span { overflow-wrap: normal; word-break: keep-all; }
.tr-tab svg { width: 20px; height: 20px; }
.tr-tab.on { background: var(--surface); color: var(--accent); font-weight: 600; box-shadow: var(--shadow); }
.tr-pane { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.tr-day { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); min-width: 0; transition: background .15s, border-color .15s; }
.tr-day.today { border-color: var(--accent); }
.tr-day.drop-on { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border-color: var(--accent); border-style: dashed; }
.tr-day-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tr-day-head h3 { margin: 0; flex: 1 1 9em; min-width: 0; font-size: calc(15px * var(--fs, 1)); font-weight: 500; }
.tr-badge { padding: 1px 8px; border-radius: 999px; background: var(--accent); color: #fff; font-size: calc(12px * var(--fs, 1)); }
.tr-items { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tr-item { display: grid; grid-template-columns: max-content auto minmax(0, 1fr); align-items: start; gap: 4px 10px; padding: 8px; border-radius: 12px; background: var(--surface-2); cursor: pointer; min-height: 44px; min-width: 0; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.tr-item.armed { outline: 2px solid var(--accent); }
.tr-item.dragging { opacity: .45; }
.tr-time { font-variant-numeric: tabular-nums; font-weight: 600; font-size: calc(15px * var(--fs, 1)); min-width: 3.2em; padding-top: 1px; }
.tr-kind { font-size: 20px; line-height: 1.2; }
.tr-item-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tr-item-t strong { font-size: calc(15px * var(--fs, 1)); font-weight: 500; overflow-wrap: anywhere; }
.tr-item-t small { color: var(--muted); font-size: calc(13px * var(--fs, 1)); overflow-wrap: anywhere; }
.tr-links { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; padding-inline-start: calc(3.2em + 10px); }
.tr-links .btn { min-height: 36px; }
.tr-links svg, .tr-actions svg { width: 16px; height: 16px; }
.tr-empty-day { margin: 0; color: var(--muted); font-size: calc(13px * var(--fs, 1)); padding: 6px 2px; }
.tr-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tr-block { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tr-block h3 { margin: 0; font-size: calc(15px * var(--fs, 1)); }
.tr-codes, .tr-costs { display: flex; flex-direction: column; gap: 6px; }
.tr-code { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 4px 8px; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); min-width: 0; }
.tr-code-t { display: flex; flex-direction: column; min-width: 0; }
.tr-code-t small { color: var(--muted); font-size: calc(12px * var(--fs, 1)); overflow-wrap: anywhere; }
.tr-code-t b { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: calc(17px * var(--fs, 1)); letter-spacing: .04em; overflow-wrap: anywhere; text-align: left; }
@media (max-width: 420px) { .tr-code { grid-template-columns: minmax(0, 1fr) auto; } .tr-code > .btn { grid-column: 1; justify-self: start; } .tr-code > .icon-btn { grid-row: 1 / span 2; grid-column: 2; } }
.tr-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.tr-file { display: flex; flex-direction: column; gap: 4px; padding: 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: inherit; text-align: start; cursor: pointer; min-width: 0; font: inherit; }
.tr-file img, .tr-pdf { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: var(--surface-2); }
.tr-pdf { display: grid; place-items: center; font-weight: 700; color: #e5484d; letter-spacing: .06em; }
.tr-file small { font-size: calc(12px * var(--fs, 1)); overflow-wrap: anywhere; }
.tr-file .tr-fsize { color: var(--muted); }
.tr-file.uploading { opacity: .7; }
.tr-total { padding: 12px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.tr-sum { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
.tr-sum strong { font-family: var(--display, inherit); font-size: calc(26px * var(--fs, 1)); }
.tr-sum span { color: var(--muted); }
.tr-settle { display: flex; flex-direction: column; gap: 6px; }
.tr-move { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); }
.tr-move b { margin-inline-start: auto; font-variant-numeric: tabular-nums; }
.tr-arrow { color: var(--muted); }
.tr-cost { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: inherit; text-align: start; font: inherit; cursor: pointer; min-height: 44px; min-width: 0; }
.tr-cost-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tr-cost-t strong { font-weight: 500; overflow-wrap: anywhere; }
.tr-cost-t small { color: var(--muted); font-size: calc(13px * var(--fs, 1)); overflow-wrap: anywhere; }
.tr-cost-a { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tr-packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 8px; }
.tr-pack-pick { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: inherit; font: inherit; text-align: start; cursor: pointer; min-height: 56px; min-width: 0; }
.tr-pack-pick.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.tr-pack-pick > span:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tr-pack-pick small { color: var(--muted); font-size: calc(12px * var(--fs, 1)); overflow-wrap: anywhere; }
.tr-pack-ico { font-size: 24px; }
.tr-bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.tr-bar i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.tr-form .tr-dates { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5em), 1fr)); gap: 8px; }
.tr-form .tr-dates .input { min-width: 0; width: 100%; box-sizing: border-box; }
.tr-check-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tr-covers { display: flex; flex-wrap: wrap; gap: 6px; }
.tr-cpick { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); font-size: 22px; cursor: pointer; padding: 0; }
.tr-cpick.on { border: 2px solid var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.tr-tpick { --tone: #12a594; width: 44px; height: 44px; border-radius: 50%; border: 3px solid transparent; background: var(--tone); cursor: pointer; padding: 0; box-shadow: inset 0 0 0 3px var(--surface); }
.tr-tpick.on { border-color: var(--text); }
.tr-check { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 4px 0; cursor: pointer; }
.tr-check input { width: 22px; height: 22px; flex: none; margin-top: 2px; accent-color: var(--accent); }
.tr-check small { color: var(--muted); }
.tr-remind { border: 1px solid var(--border); border-radius: 12px; padding: 6px 12px; margin: 0; min-width: 0; }
.tr-remind legend { color: var(--muted); font-size: calc(13px * var(--fs, 1)); padding: 0 4px; }
.tr-kinds .chip { max-width: 100%; }
.tr-add svg { width: 18px; height: 18px; }
@media (max-width: 380px) { .tr-add-t { display: none; } }
/* «Сегодня» в дни поездки — над «Сейчас» */
.hv-trip { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 22px; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); box-shadow: var(--shadow); min-width: 0; }
.hv-trip-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-height: 44px; }
.hv-trip-head > svg { width: 18px; height: 18px; color: var(--muted); }
.hv-trip-head[dir="rtl"] > svg { transform: scaleX(-1); }
.hv-trip-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hv-trip-t small { color: var(--muted); font-size: calc(13px * var(--fs, 1)); }
.hv-trip-t strong { font-size: calc(17px * var(--fs, 1)); overflow-wrap: anywhere; }
.hv-trip .tr-item { background: var(--surface); }

/* Событие Google (пачка 4): форма правки — время «с … до» в две колонки, «Весь день» галочкой. */
.gev-form .gev-times { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.gev-form .gev-times[hidden] { display: none; }
.gev-form .check-row { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.gev-form .check-row input { width: 22px; height: 22px; margin: 0; }
.gev-form .input { min-width: 0; width: 100%; box-sizing: border-box; }
.qa-gcal small { max-width: 12em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gcal-name { overflow-wrap: anywhere; }

/* ---------- «Сколько осталось» (пачка 5): карточки дат — значок · название и дата · число дней крупно ---------- */
.wa-cds { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.wa-cd { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; min-height: 60px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: inherit; font: inherit; text-align: start; cursor: pointer; }
.wa-cd.soon { border-color: color-mix(in srgb, #e5760b 55%, var(--border)); }
.wa-cd.past { opacity: .7; }
.wa-cd-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; font-size: 22px; background: color-mix(in srgb, #e5760b 14%, transparent); }
.wa-cd-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.wa-cd-n { display: flex; flex-direction: column; align-items: center; min-width: 3.2em; text-align: center; }
.wa-cd-n strong { font-size: min(calc(30px * var(--fs, 1)), 9vw); line-height: 1.05; }
.wa-cd-n small { color: var(--muted); }
.wa-form { display: flex; flex-direction: column; gap: 12px; }
.wa-cd-icon-in { max-width: 8em; }
.wa-check { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.wa-check input { width: 22px; height: 22px; margin: 0; flex: none; }
.wg-cd-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.wg-cd-t { display: flex; flex-direction: column; min-width: 0; }
.wg-cd-num { font-variant-numeric: tabular-nums; }

/* ---------- Статистика в «Сводке» (пачка 5): цифры, столбики по дням, по спискам ---------- */
.sum-stats { display: flex; flex-direction: column; gap: 12px; margin: 4px 0 14px; padding: 12px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.sum-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(7em, 100%), 1fr)); gap: 8px; }
.sum-kpi { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 8px 10px; border-radius: 12px; background: var(--bg); }
.sum-kpi strong { font-size: min(calc(22px * var(--fs, 1)), 7vw); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sum-kpi small { color: var(--muted); }
.sum-kpi.k-streak strong { color: #e5760b; }
.sum-kpi.k-focus strong { color: #e5484d; }
.sum-bars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 3px; align-items: end; }
.sum-bars.many { gap: 1px; }
.sum-bar { display: flex; flex-direction: column; align-items: stretch; gap: 3px; min-width: 0; }
.sum-bar-n { min-height: 1.2em; font-size: min(calc(11px * var(--fs, 1)), 2.8vw); text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.sum-bars.many .sum-bar-n { visibility: hidden; }
.sum-bar-col { display: flex; align-items: flex-end; height: 90px; border-radius: 6px; background: var(--bg); overflow: hidden; }
.sum-bar-fill { display: block; width: 100%; border-radius: 6px 6px 0 0; background: color-mix(in srgb, var(--accent) 55%, transparent); }
.sum-bar.today .sum-bar-fill { background: var(--accent); }
.sum-bar.out { opacity: .5; }
.sum-bar small { font-size: min(calc(10.5px * var(--fs, 1)), 2.6vw); text-align: center; color: var(--muted); white-space: nowrap; }
.sum-bar.today small { color: var(--text); font-weight: 700; }
.sum-by-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sum-by-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "t n" "b b"; gap: 3px 10px; align-items: baseline; }
.sum-bl-t { grid-area: t; min-width: 0; overflow-wrap: anywhere; }
.sum-by-list strong { grid-area: n; font-variant-numeric: tabular-nums; }
.sum-bl-bar { grid-area: b; display: block; height: 6px; border-radius: 3px; background: var(--bg); overflow: hidden; }
.sum-bl-bar > span { display: block; height: 100%; border-radius: 3px; background: var(--accent); }

/* ---------- «Цены» (пачка 6): карточка товара — название и магазин · цена крупно, линия по дням, состояние, кнопки ---------- */
.pr-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.pr-card { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); min-width: 0; }
.pr-card.below { border-color: color-mix(in srgb, var(--ok) 60%, var(--border)); background: color-mix(in srgb, var(--ok) 6%, var(--surface)); }
.pr-card.fail { border-style: dashed; }
.pr-top { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 12px; min-width: 0; }
.pr-t { display: flex; flex-direction: column; gap: 2px; flex: 1 1 12em; min-width: 0; overflow-wrap: anywhere; }
.pr-now { display: flex; flex-direction: column; align-items: flex-end; flex: 0 0 auto; }
.pr-top[dir="rtl"] .pr-now { align-items: flex-start; }
.pr-now strong { font-size: min(calc(24px * var(--fs, 1)), 8vw); line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pr-spark { width: 100%; max-width: 480px; height: auto; aspect-ratio: 8 / 1; display: block; }
.pr-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.pr-dot { fill: var(--accent); }
.pr-th { stroke: var(--ok); stroke-width: 1.2; stroke-dasharray: 4 3; }
.pr-status { margin: 0; color: var(--muted); font-size: .92em; overflow-wrap: anywhere; }
.pr-status.good { color: var(--ok); font-weight: 600; }
.pr-url-line { margin: 0; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-size: .9em; overflow-wrap: anywhere; }
.wg-price-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-width: 0; }
.wg-price-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.wg-price-below .wg-price-num { color: var(--ok); }

/* ---------- «Фото → задача» (пачка 6): окно черновика — дата и время рядом, на узком — друг под другом ---------- */
.qa-cam svg { width: 18px; height: 18px; }
.pt-when { display: flex; flex-wrap: wrap; gap: 12px; }
.pt-when .field { flex: 1 1 9em; min-width: 0; }
.dlg-photo-task textarea { resize: vertical; min-height: 5em; }

/* «Где дешевле корзина» (пачка 6, часть 2) — views/basket.js */
.bk { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.bk h3 { margin: 0 0 6px; font-size: calc(15px * var(--fs, 1)); overflow-wrap: anywhere; }
.bk h3 small { color: var(--muted); font-weight: 500; }
.bk-head { margin: 0; color: var(--muted); font-size: calc(14px * var(--fs, 1)); overflow-wrap: anywhere; }
.bk-list { font-weight: 600; color: var(--text); }
.bk-busy { margin: 12px 0; color: var(--muted); }
.bk-here { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; color: var(--muted); font-size: calc(14px * var(--fs, 1)); }
.bk-here > span { flex: 1 1 10em; min-width: 0; }
.bk-here.ask { flex-direction: column; align-items: stretch; padding: 12px; border: 1px dashed var(--border); border-radius: 14px; }
.bk-here.ask p { margin: 0; overflow-wrap: anywhere; }
.bk-here .btn { gap: 6px; }
.bk-here svg { width: 20px; height: 20px; flex: none; }
.bk-city { color: var(--muted); }
.bk-circles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15em), 1fr)); gap: 10px; }
.bk-circle { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 12px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.bk-circle.empty { border-style: dashed; background: transparent; }
.bk-circle.empty p { margin: 0; }
.bk-best, .bk-rank li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-width: 0; }
.bk-name { display: flex; flex-direction: column; gap: 1px; flex: 1 1 9em; min-width: 0; overflow-wrap: anywhere; }
.bk-sub { color: var(--muted); font-size: calc(13px * var(--fs, 1)); }
.bk-total { margin-inline-start: auto; font-size: min(calc(22px * var(--fs, 1)), 7vw); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bk-rank .bk-total { font-size: calc(17px * var(--fs, 1)); }
.bk-store { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-width: 0; font-size: calc(13.5px * var(--fs, 1)); overflow-wrap: anywhere; }
.bk-store { flex-direction: column; align-items: stretch; }
.bk-sname { min-width: 0; }
.bk-km { color: var(--muted); white-space: nowrap; }
.bk-meta { margin: 0; color: var(--muted); font-size: calc(13px * var(--fs, 1)); overflow-wrap: anywhere; }
.bk-trip { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px; border-radius: 14px; border: 1px solid var(--border); min-width: 0; }
.bk-trip.yes { border-color: color-mix(in srgb, var(--ok) 60%, var(--border)); background: color-mix(in srgb, var(--ok) 7%, var(--surface)); }
.bk-trip p { margin: 0; font-size: calc(13.5px * var(--fs, 1)); overflow-wrap: anywhere; }
.bk-rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.bk-rank li { padding: 8px 0; border-top: 1px solid var(--border); }
.bk-items ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.bk-item { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 8px 0; border-top: 1px solid var(--border); min-width: 0; }
.bk-it-main { flex: 1 1 12em; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bk-it-t { font-weight: 600; overflow-wrap: anywhere; }
.bk-it-he { font-size: calc(13.5px * var(--fs, 1)); color: var(--muted); overflow-wrap: anywhere; }
.bk-it-note { font-size: calc(12.5px * var(--fs, 1)); color: var(--muted); }
.bk-item.miss .bk-it-t { color: var(--muted); }
.bk-total { display: flex; flex-direction: column; align-items: flex-end; }
.bk-deal { font-size: calc(12px * var(--fs, 1)); font-weight: 600; color: var(--ok); white-space: nowrap; }
.bk-club { margin: 0; font-size: calc(13px * var(--fs, 1)); color: var(--muted); flex-basis: 100%; overflow-wrap: anywhere; }
.bk-it-deal { font-size: calc(13px * var(--fs, 1)); color: var(--ok); overflow-wrap: anywhere; }
.bk-it-deal.club { color: var(--muted); }
.bk-it-deal, [data-deal="hint"] { display: flex; flex-direction: column; }
.bk-deal-he { overflow-wrap: anywhere; }
.bk-it-price { display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.bk-foot { margin-top: 4px; }
.bk-it-cheap { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; font-size: calc(13px * var(--fs, 1)); color: var(--ok); overflow-wrap: anywhere; }
.bk-it-cheap .bk-deal-he { align-self: stretch; color: var(--text); }
.qa-scan svg { width: 18px; height: 18px; }
.dlg-scan .bc { display: flex; flex-direction: column; gap: 10px; }
.bc-frame { position: relative; width: 100%; aspect-ratio: 4 / 3; max-height: 55vh; border-radius: 14px; overflow: hidden; background: #111; }
.bc-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.bc-aim { position: absolute; inset: 30% 12%; border: 2px solid rgb(255 255 255 / .85); border-radius: 10px; box-shadow: 0 0 0 999px rgb(0 0 0 / .25); }
.bc-status { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.bc-add { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.bc-add p { margin: 0; overflow-wrap: anywhere; }
.bc-code { color: var(--muted); font-size: calc(13px * var(--fs, 1)); }
.bc-code bdi { font-variant-numeric: tabular-nums; }
.bk-credit { margin-top: 0; font-size: calc(12px * var(--fs, 1)); }
.bk-fair { color: var(--ok); font-size: calc(12.5px * var(--fs, 1)); }
.bk-fair-note { margin: 0 0 4px; font-size: calc(13px * var(--fs, 1)); overflow-wrap: anywhere; }
.bk-split { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 14px; min-width: 0;
  border: 1px solid color-mix(in srgb, var(--ok) 60%, var(--border)); background: color-mix(in srgb, var(--ok) 7%, var(--surface)); }
.bk-split p { margin: 0; font-size: calc(13.5px * var(--fs, 1)); overflow-wrap: anywhere; }
.bk-split-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.bk-split-items li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; font-size: calc(13.5px * var(--fs, 1)); min-width: 0; }
.bk-split-items li > span:first-child { flex: 1 1 8em; min-width: 0; overflow-wrap: anywhere; }
.bk-split-p { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* «Поделились фото» (пачка 7): миниатюры, подпись, действия столбиком — на телефоне во всю ширину. */
.shi { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.shi-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.shi-thumb { aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--surface-2, var(--border)); }
.shi-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shi-acts { display: flex; flex-direction: column; gap: 8px; }
.shi-acts > .btn { justify-content: flex-start; gap: 8px; white-space: normal; text-align: start; }
.shi-ai-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.shi-ai-row .btn { flex: 1 1 auto; justify-content: flex-start; min-width: 0; max-width: 100%; white-space: normal; text-align: start; overflow-wrap: break-word; }
.shi-ai-hint { flex: 1 1 12em; min-width: 0; overflow-wrap: anywhere; }

/* Пачка 8: «Моё свободное время» (views/free-time.js) */
.ft { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ft-hint { margin: 0; font-size: calc(13px * var(--fs, 1)); overflow-wrap: anywhere; }
.ft-days { flex-wrap: wrap; gap: 6px; }
.ft-days .chip { min-height: 40px; }
.ft-sat:not(.on) { opacity: .7; }
.ft-opts { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ft-hours { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.ft-field { flex: 1 1 7em; min-width: 0; }
.ft-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.ft-label { flex: 0 0 auto; color: var(--muted); font-size: calc(14px * var(--fs, 1)); }
.ft-text { margin: 0; padding: 12px; border-radius: 12px; background: var(--surface-2, var(--surface)); border: 1px solid var(--border);
  white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: calc(15px * var(--fs, 1)); line-height: 1.5; }
.ft-text[dir="rtl"] { text-align: right; }

/* Пачка 8: «Итог дня» (home-variants.js, dayCloseBlock) */
.hv-close { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 18px; min-width: 0;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); }
.hv-close .hv-sec-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.hv-close .hv-sec-head h2 { margin: 0; }
.hv-close p { margin: 0; overflow-wrap: anywhere; }
.hv-close-task { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); min-width: 0; }
.hv-close-t { font-weight: 600; overflow-wrap: anywhere; }
.hv-close-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.hv-close-btns .btn { flex: 1 1 auto; }
.hv-close-habits { display: flex; flex-direction: column; gap: 4px; }
.hv-close-end { align-self: flex-start; }
.hv-close.done { flex-direction: row; flex-wrap: wrap; align-items: center; }
.hv-close-title { flex: 1 1 8em; font-size: calc(17px * var(--fs, 1)); }

/* Пачка 8: «Итоги месяца» (views/wrap.js) */
.hv-wrap { display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 0; border-radius: 18px; min-width: 0;
  background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 22%, var(--surface)), color-mix(in srgb, #a21caf 18%, var(--surface))); border: 1px solid var(--border); }
.hv-wrap-open { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: none; border: 0; color: inherit; text-align: start; cursor: pointer; font: inherit; min-height: 44px; }
.hv-wrap-emoji { font-size: calc(28px * var(--fs, 1)); flex: none; }
.hv-wrap-t { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.hv-wrap-t strong { font-size: calc(17px * var(--fs, 1)); overflow-wrap: anywhere; }
.hv-wrap-t small { color: var(--muted); overflow-wrap: anywhere; }
.hv-wrap-open svg { flex: none; width: 18px; height: 18px; }
.dlg-wrap .dlg-box { max-width: 520px; }
.wr { display: flex; flex-direction: column; gap: 10px; }
.wr-bars { display: flex; gap: 4px; }
.wr-bar { flex: 1 1 0; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--text) 18%, transparent); }
.wr-bar.on { background: var(--accent); }
.wr-stage { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 10px; text-align: center; padding: 28px 18px;
  min-height: min(52vh, 420px); border-radius: 22px; color: #fff; cursor: pointer; user-select: none;
  background: linear-gradient(160deg, var(--wr-a, #1e293b), var(--wr-b, #0f172a)); }
.wr-big { font-size: min(calc(76px * var(--fs, 1)), 22cqi, 20vw); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.wr-label { font-size: calc(22px * var(--fs, 1)); font-weight: 700; overflow-wrap: anywhere; }
.wr-sub { font-size: calc(15px * var(--fs, 1)); opacity: .88; overflow-wrap: anywhere; }
.wr-stage { container-type: inline-size; }
/* Пачка 8: «Надиктовать список» (views/voice-list.js) */
.vl { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.vl-hint { margin: 0; font-size: calc(13px * var(--fs, 1)); overflow-wrap: anywhere; }
.vl-text { min-height: 4.5em; resize: vertical; }
.vl-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.vl-btns .btn { gap: 6px; }
.vl-note { margin: 0; }
.vl-list { display: flex; flex-direction: column; gap: 8px; }
.vl-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; align-items: start; padding: 8px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.vl-row.off { opacity: .55; }
.vl-check { display: flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
.vl-check input { width: 22px; height: 22px; }
.vl-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.vl-meta { flex-wrap: wrap; gap: 6px; }
.vl-meta .chip svg { width: 16px; height: 16px; }
.qa-vlist svg { width: 18px; height: 18px; }

/* Пачка 8: «Иду в магазин» (views/shop-mode.js): крупно, отмеченные внизу своего отдела */
.shop-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 10px 12px; border-radius: 14px; min-width: 0; flex: 1 1 100%;
  background: color-mix(in srgb, var(--ok) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--ok) 45%, var(--border)); }
.shop-banner-t { flex: 1 1 12em; min-width: 0; display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.shop-banner-h { display: flex; align-items: center; gap: 6px; }
.shop-banner-t small { color: var(--muted); }
.shop-banner-t svg { width: 20px; height: 20px; color: var(--ok); }
.shop-mode .task-rows { display: flex; flex-direction: column; }
.shop-mode .task-rows:empty { display: none; }
.shop-mode .task-row.done { order: 1; }
.shop-mode .task-row .task-title { font-size: calc(19px * var(--fs, 1)); }
.shop-mode .task-row-inner { min-height: 56px; }
.bk-star.on { color: var(--warn, #b45309); border-color: color-mix(in srgb, var(--warn, #b45309) 50%, var(--border)); }

/* ---------- Зона большого пальца (15.11): панель действий списка внизу, лист «⋯ Ещё», левша ---------- */
.list-dock {
  position: fixed; z-index: 12; left: 12px; right: 86px; bottom: calc(var(--nav-h) + var(--safe-bottom) + 16px);
  display: flex; justify-content: flex-start; gap: 6px; pointer-events: none;
  container-type: inline-size;
}
.list-dock[hidden], .list-dock:empty { display: none; }
.list-dock .dock-btn {
  pointer-events: auto; flex: 0 1 auto; min-width: 58px; min-height: 58px; padding: 6px 12px; border-radius: 18px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lift);
  font: inherit; font-weight: 600; font-size: calc(15px * var(--fs, 1)); line-height: 1.15; cursor: pointer;
}
.list-dock .dock-btn svg { width: 22px; height: 22px; flex: none; color: var(--accent); }
.list-dock .dock-btn.on { background: var(--accent-soft); border-color: var(--accent); }
/* Покупки: три равные кнопки — значок над подписью, подпись переносится словами и мельчает по ширине панели. */
.list-dock.shop .dock-btn { flex: 1 1 0; min-width: 0; flex-direction: column; gap: 3px; padding: 6px 4px;
  font-size: min(calc(13.5px * var(--fs, 1)), 5cqi); text-align: center; overflow-wrap: normal; word-break: keep-all; hyphens: none; }
.list-dock .dock-label { min-width: 0; }
.tasks-view.selecting .list-dock, .sheet-open .list-dock, html.has-focus .list-dock { display: none; }
@media (min-width: 900px) { .list-dock { display: none; } }
/* Последние строки списка не прячутся под панелью: запас снизу — как у «+». */
.task-pane:has(~ .list-dock.shop:not([hidden])) { padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 112px); }

html.lefty .fab { right: auto; left: 16px; }
html.lefty .list-dock { left: 86px; right: 12px; justify-content: flex-end; }
html.lefty .focus-bar { left: 84px; right: 12px; }

/* Меню листом снизу: «⋯ Ещё» в нижней панели. */
.menu.menu-sheet {
  left: 0 !important; right: 0 !important; top: auto !important; bottom: 0; width: 100%; max-width: none; min-width: 0;
  border-radius: 20px 20px 0 0; border-bottom: 0; padding: 8px 10px calc(10px + var(--safe-bottom));
  max-height: min(78dvh, calc(100dvh - var(--safe-top) - 48px)); box-sizing: border-box;
}
.menu.menu-sheet::before { content: ''; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--border); margin: 0 auto 6px; }
.menu-sheet-wrap .backdrop { background: rgba(0, 0, 0, .28); }
.menu.menu-sheet button { min-height: 50px; }

/* «Знаете ли вы?» — карточка по месту. */
.tip-card {
  flex: 1 1 100%; min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; align-items: start;
  padding: 12px 14px; border-radius: 16px; background: color-mix(in srgb, #f5b301 12%, var(--surface));
  border: 1px solid color-mix(in srgb, #f5b301 40%, var(--border));
}
.tip-ico { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: #f5b301; color: #2a1d00; }
.tip-ico svg { width: 20px; height: 20px; }
.tip-text { min-width: 0; overflow-wrap: break-word; }
.tip-text b { display: block; font-size: calc(15px * var(--fs, 1)); }
.tip-text p { margin: 3px 0 4px; font-size: calc(14.5px * var(--fs, 1)); }
.tip-where { display: flex; align-items: flex-start; gap: 5px; color: var(--muted); font-size: calc(13px * var(--fs, 1)); }
.tip-where svg { width: 15px; height: 15px; flex: none; margin-top: 1px; }
.tip-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.tip-actions .btn { min-height: 40px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }

/* «Что умеет Yahad». */
.fx-body { display: flex; flex-direction: column; gap: 12px; }
.fx-lead { margin: 0; color: var(--muted); }
.fx-search { width: 100%; box-sizing: border-box; }
.fx-groups { display: flex; flex-direction: column; gap: 16px; }
.fx-group h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: calc(16px * var(--fs, 1)); }
.fx-group h3 svg { width: 20px; height: 20px; color: var(--accent); flex: none; }
.fx-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 12px; align-items: start;
  padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); margin-bottom: 8px;
}
.fx-ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.fx-ico svg { width: 21px; height: 21px; }
.fx-text { min-width: 0; overflow-wrap: break-word; }
.fx-text h4 { margin: 0 0 2px; font-size: calc(15.5px * var(--fs, 1)); }
.fx-text p { margin: 0 0 4px; font-size: calc(14.5px * var(--fs, 1)); }
.fx-where { color: var(--muted); font-size: calc(13px * var(--fs, 1)); }
.fx-card .btn { grid-column: 1 / -1; justify-self: end; min-height: 44px; }
.fx-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }

/* «Показать» — кнопка мигает рамкой. */
.feature-flash { animation: feature-flash 0.8s ease-in-out 3; outline: 3px solid #f5b301; outline-offset: 3px; border-radius: 14px; }
@keyframes feature-flash { 50% { outline-color: transparent; box-shadow: 0 0 0 8px color-mix(in srgb, #f5b301 35%, transparent); } }
.no-motion .feature-flash { animation: none; }
.td-tip:not([hidden]), .cal-tip:not([hidden]) { display: flex; margin: 0 0 12px; }
.cal-tip:not([hidden]) { margin: 6px 8px 10px; }
.notes-body > .tip-card { margin: 0 0 12px; }

/* ---------- «✨ Спросить Yahad» (16.11): окно, карточка «Сделать?» ---------- */
.ask-btn svg { color: var(--accent); }
.ask { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.ask-hint { margin: 0; }
.ask-text { width: 100%; resize: vertical; min-height: 64px; font-size: calc(16px * var(--fs, 1)); }
.ask-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.ask-row .btn { min-height: 44px; }
.ask-examples { flex-wrap: wrap; }
.ask-examples .chip { min-height: 40px; white-space: normal; text-align: start; }
.ask-out { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.ask-out:empty { display: none; }
.ask-card {
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border)); border-radius: 16px; padding: 12px 14px;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface)); display: grid; gap: 8px; min-width: 0;
}
.ask-say { display: flex; gap: 8px; align-items: flex-start; font-weight: 600; font-size: calc(16px * var(--fs, 1)); min-width: 0; overflow-wrap: anywhere; }
.ask-say svg { width: 20px; height: 20px; flex: none; color: var(--accent); margin-top: 1px; }
.ask-say > span { min-width: 0; }
.ask-lines { margin: 0; padding: 0 0 0 4px; list-style: none; display: grid; gap: 4px; color: var(--text); overflow-wrap: anywhere; }
.ask-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ask-q { margin: 0 auto 0 0; color: var(--muted); font-size: calc(14px * var(--fs, 1)); }
.ask-btns .btn { min-height: 44px; }
.ask-more { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ask-more > p { margin: 0; width: 100%; }
.ask-more .chip { min-height: 40px; white-space: normal; text-align: start; }
.ask-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.ask-note { font-size: calc(13px * var(--fs, 1)); }
.ask-wait { margin: 0; }
/* Телефон: в списках «Спросить» уже внизу у большого пальца — ✨ в шапке не дублируем (место названию списка). */
@media (max-width: 899px) { .shell:has(.list-dock:not([hidden]) [data-dock="ask"]) .topbar .ask-btn { display: none; } }
.topbar.ask-tight .ask-btn { display: none; }
.list-dock.shop .dock-btn.dock-ask { flex: 0 0 auto; min-width: 48px; width: 48px; padding: 6px 0; }

/* «Поездки» v2: карта поездки (trip-map.js), курс из сети, поездка на прежнем «Сегодня» */
.td-trip { margin: 0 0 12px; min-width: 0; }
.tr-plan-top { justify-content: flex-start; }
.tr-day-map { flex: none; }
.dlg.dlg-trip-map { width: min(860px, calc(100vw - 32px)); }
@media (max-width: 599px) { .dlg.dlg-trip-map { width: 100vw; } }
.tm-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.tm-days { flex-wrap: wrap; }
.tm-day i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--dc); margin-inline-end: 6px; vertical-align: middle; }
.tm-map { position: relative; width: 100%; height: min(52vh, 440px); min-height: 220px; border-radius: 16px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); }
.tm-map[hidden] { display: none; }
.tm-wait { display: grid; place-items: center; height: 100%; margin: 0; }
.tm-status:empty { display: none; }
.tm-pin { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; background: var(--dc); color: #fff; font: 700 14px/1 system-ui, sans-serif; display: grid; place-items: center; box-shadow: 0 1px 4px rgb(0 0 0 / .35); cursor: pointer; padding: 0; }
.tm-pin.on { transform: scale(1.25); z-index: 2; outline: 3px solid color-mix(in srgb, var(--dc) 40%, transparent); }
.tm-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tm-row { display: flex; flex-direction: column; gap: 4px; padding: 6px 8px; border-radius: 12px; background: var(--surface-2); min-width: 0; }
.tm-row.on { outline: 2px solid var(--accent); }
.tm-row-main { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; background: none; border: 0; padding: 2px 0; color: inherit; text-align: start; font: inherit; min-height: 44px; cursor: pointer; }
.tm-row-main:disabled { cursor: default; opacity: 1; }
.tm-row-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tm-row-t strong { font-weight: 500; overflow-wrap: anywhere; }
.tm-row-t small { color: var(--muted); font-size: calc(13px * var(--fs, 1)); overflow-wrap: anywhere; }
.tm-num { width: 28px; height: 28px; border-radius: 50%; background: var(--dc); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.tm-num.none { background: var(--border); color: var(--muted); }
.tm-row .tr-links { padding-inline-start: 38px; }
.tr-rate { display: flex; flex-direction: column; gap: 6px; }
.tr-rate > label { display: flex; flex-direction: column; gap: 4px; }
.tr-fx { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; color: var(--muted); font-size: calc(13px * var(--fs, 1)); }
.tr-fx:empty { display: none; }
.tr-cur-more { width: auto; min-height: 36px; padding-block: 4px; }
.tr-bk-list { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tr-bk { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 12px; align-items: start; padding: 12px; border-radius: var(--radius); border: 1px dashed color-mix(in srgb, var(--accent) 55%, var(--border)); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); min-width: 0; }
.tr-bk-ico { font-size: 24px; line-height: 1.2; }
.tr-bk-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tr-bk-t strong { font-size: calc(15px * var(--fs, 1)); overflow-wrap: anywhere; }
.tr-bk-t small { color: var(--muted); font-size: calc(13px * var(--fs, 1)); overflow-wrap: anywhere; }
.tr-bk-acts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.tr-bk-acts svg { width: 16px; height: 16px; }
.wa-item.wa-bk { padding: 0; background: none; border: 0; }
.tr-live { color: color-mix(in srgb, var(--accent) 80%, var(--text)) !important; font-weight: 600; }
.tr-live.bad { color: #c2410c !important; }
.tr-empty-day:has(button) { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.tr-near-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.tr-near { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tr-near-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; align-items: start; padding: 8px; border-radius: 12px; background: var(--surface-2); min-width: 0; }
.tr-near-row .tr-links { padding-inline-start: 0; grid-column: 1 / -1; }

/* ---------- Одной рукой (михкар 16.11): «+» внизу в Привычках и Поездках, «Сегодня» внизу календаря ---------- */
@media (max-width: 899px) {
  .habits-view:has(> .fab), .trips-view:has(> .fab) { padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 96px); }
  .cal-view:has(> .cal-dock:not([hidden])) .cal-agenda { padding-bottom: 88px; }
}
.list-dock.cal-dock { right: 86px; }
html.lefty .list-dock.cal-dock { left: 86px; right: 12px; }
.cal-view.adding .cal-dock { display: none; }
/* «Снова:» — купленное раньше одним касанием при пустой строке в покупках (михкар 16.11). */
.qa-again-t { align-self: center; color: var(--muted); font-size: calc(13px * var(--fs, 1)); padding-inline-end: 2px; }
/* «Обычные покупки» (михкар-4, как Favorites в AnyList): ★-чипы первой строкой, «Снова:» — со следующей; окно со списком. */
.qa-break { flex-basis: 100%; height: 0; }
.qa-usual svg, .us-in svg { color: var(--accent); }
.us-new { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin: 8px 0 12px; }
.us-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.us-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; min-height: 44px;
  padding: 4px 0 4px 4px; border-bottom: 1px solid var(--border); }
.us-t { min-width: 0; overflow-wrap: anywhere; }
.us-in { display: inline-flex; gap: 4px; align-items: center; font-size: .9em; white-space: nowrap; }
.us-in svg { width: 1.1em; height: 1.1em; flex: none; }
.us-all { width: 100%; }

/* ---------- «Экран-стена» (михкар-2, 16.11; как wall mode Yuvomi): «Сегодня» во весь экран, читается с двух метров ---------- */
.wall {
  --wl-bg: var(--bg); --wl-card: var(--surface); --wl-text: var(--text); --wl-muted: var(--muted); --wl-line: var(--border);
  --wl-fs: clamp(16px, 2.2vmin + .4vmax, 34px);
  position: fixed; inset: 0; z-index: 900; display: flex; flex-direction: column; gap: calc(var(--wl-fs) * .6);
  padding: calc(var(--safe-top) + var(--wl-fs) * .7) calc(var(--wl-fs) * .9) calc(var(--safe-bottom) + var(--wl-fs) * .6);
  background: var(--wl-bg); color: var(--wl-text); font-size: var(--wl-fs); line-height: 1.25; overflow: hidden; box-sizing: border-box;
  outline: none;
}
.wall[hidden] { display: none; }
:root.wall-on body { overflow: hidden; }
/* Ночь 22–06: тёмный приглушённый фон даже в светлой теме (планшет в коридоре не светит в 3 ночи). */
.wall[data-night] { --wl-bg: #0b0b0a; --wl-card: #141412; --wl-text: #b9b5ab; --wl-muted: #7d796f; --wl-line: #26251f; color-scheme: dark; }
.wl-head { display: flex; align-items: flex-start; gap: calc(var(--wl-fs) * .8); min-width: 0; }
.wl-time { display: flex; flex-direction: column; min-width: 0; }
.wl-clock { font-size: calc(var(--wl-fs) * 3.6); font-weight: 700; line-height: .95; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.wl-date { display: flex; flex-direction: column; margin-top: calc(var(--wl-fs) * .25); }
.wl-date strong { font-size: calc(var(--wl-fs) * 1.05); font-weight: 600; }
.wl-date small { color: var(--wl-muted); font-size: calc(var(--wl-fs) * .8); }
.wl-weather { flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: calc(var(--wl-fs) * .6); justify-content: flex-end; text-align: end; }
.wl-weather[hidden] { display: none; }
.wl-temp { font-size: calc(var(--wl-fs) * 2.6); font-weight: 700; line-height: 1; }
.wl-wtext { font-size: calc(var(--wl-fs) * .95); max-width: 22em; overflow-wrap: anywhere; }
.wl-wtext.tone-rain { color: var(--p1); }
.wl-wtext.tone-heat { color: var(--warm); }
.wl-exit {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--wl-line); background: transparent; color: var(--wl-muted); font: inherit; font-size: 15px; opacity: .35; transition: opacity .3s;
  margin-inline-start: auto;
}
.wl-exit svg, .wl-timer svg { width: 18px; height: 18px; flex: none; }
.wall.awake .wl-exit, .wl-exit:focus-visible { opacity: 1; }
.wl-alerts { display: flex; flex-direction: column; gap: 6px; }
.wl-alerts[hidden] { display: none; }
.wl-alert { display: flex; align-items: center; gap: 10px; padding: calc(var(--wl-fs) * .5) calc(var(--wl-fs) * .7); border-radius: var(--radius); background: var(--danger); color: #fff; font-weight: 700; font-size: calc(var(--wl-fs) * 1.1); }
.wl-grid { flex: 1 1 0; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, .85fr); gap: calc(var(--wl-fs) * .7); }
.wl-col { min-width: 0; min-height: 0; overflow: hidden; background: var(--wl-card); border: 1px solid var(--wl-line); border-radius: calc(var(--radius) + 4px); padding: calc(var(--wl-fs) * .7) calc(var(--wl-fs) * .8); }
.wl-col[hidden] { display: none; }
.wl-col h2 { margin: 0 0 calc(var(--wl-fs) * .4); font-size: calc(var(--wl-fs) * .8); text-transform: uppercase; letter-spacing: .06em; color: var(--wl-muted); font-weight: 700; }
.wl-col h2 small { font-size: inherit; font-weight: 600; }
.wl-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: calc(var(--wl-fs) * .35); }
.wl-row { display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: calc(var(--wl-fs) * .6); align-items: baseline; min-width: 0; }
.wl-hm { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 3.1em; }
.wl-hm small { font-weight: 500; color: var(--wl-muted); font-size: .7em; white-space: nowrap; }
.wl-t { display: flex; flex-direction: column; min-width: 0; }
.wl-title { overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wl-sub { color: var(--wl-muted); font-size: .72em; }
.wl-row.now .wl-hm { color: var(--accent); }
.wl-row.imp .wl-title { font-weight: 700; }
/* Will Be Done: пропущенное — тихо, без красного. */
.wl-row.late .wl-title { color: var(--wl-muted); }
.wl-row.wl-more { color: var(--wl-muted); font-size: .8em; }
.wl-free { margin: 0; color: var(--wl-muted); }
.wl-day + .wl-day { margin-top: calc(var(--wl-fs) * .55); padding-top: calc(var(--wl-fs) * .45); border-top: 1px solid var(--wl-line); }
.wl-day h3 { margin: 0 0 calc(var(--wl-fs) * .25); font-size: calc(var(--wl-fs) * .85); font-weight: 700; }
.wl-day h3 small { color: var(--wl-muted); font-weight: 500; font-size: inherit; }
.wl-day .wl-rows { font-size: .85em; gap: calc(var(--wl-fs) * .2); }
.wl-day .wl-title { -webkit-line-clamp: 1; }
.wl-buy .wl-row { grid-template-columns: max-content minmax(0, 1fr); align-items: center; }
.wl-dot { width: .55em; height: .55em; border-radius: 50%; border: 2px solid var(--wl-muted); }
.wl-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.wl-strip { flex: 1 1 auto; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; min-width: 0; }
.wl-chip { padding: 4px 12px; border-radius: 999px; background: var(--wl-card); border: 1px solid var(--wl-line); font-size: .8em; overflow-wrap: anywhere; }
.wl-upd { color: var(--wl-muted); font-size: 13px; }
.wl-timers { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.wl-timer {
  min-width: var(--tap); min-height: var(--tap); padding: 0 12px; border-radius: 999px; border: 1px solid var(--wl-line); background: var(--wl-card);
  color: var(--wl-muted); font: inherit; font-size: 16px; display: inline-flex; align-items: center; gap: 6px; opacity: .55; transition: opacity .3s;
}
.wall.awake .wl-timer, .wl-timer.on { opacity: 1; }
.wl-timer.on { color: var(--wl-text); font-weight: 700; font-variant-numeric: tabular-nums; font-size: calc(var(--wl-fs) * .9); }
.wl-timer.ring { background: var(--accent); color: var(--accent-text); border-color: transparent; animation: wl-ring 1s ease-in-out infinite alternate; }
@keyframes wl-ring { from { transform: scale(1); } to { transform: scale(1.06); } }
.no-motion .wl-timer.ring { animation: none; }
/* Совсем маленький экран (телефон 360×640 с крупным шрифтом): строк уже минимум — стена листается, колонки во всю высоту. */
.wall.wl-scroll { overflow-y: auto; }
.wall.wl-scroll .wl-grid { flex: none; grid-template-rows: none; }
.wall.wl-scroll .wl-col { overflow: visible; }
/* Портрет (планшет стоя, телефон): две колонки — «Сегодня» на всю ширину сверху. */
@media (orientation: portrait) {
  .wl-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1.3fr) minmax(0, 1fr); }
  .wl-today { grid-column: 1 / -1; }
  .wl-clock { font-size: calc(var(--wl-fs) * 3); }
}
@media (max-width: 520px) {
  .wl-head { flex-wrap: wrap; }
  .wl-weather { flex-basis: 100%; justify-content: flex-start; text-align: start; order: 3; }
  .wl-exit { margin-inline-start: auto; }
}
/* Телевизор и большой экран (михкар-3, 17.11): часы читаются через комнату — от высоты экрана, а не только от шрифта стены. */
@media (orientation: landscape) and (min-width: 1100px) and (min-height: 640px) {
  .wl-clock { font-size: clamp(calc(var(--wl-fs) * 3.6), 17vh, 240px); letter-spacing: -.03em; }
  .wl-date strong { font-size: max(calc(var(--wl-fs) * 1.05), 3.4vh); }
  .wl-date small { font-size: max(calc(var(--wl-fs) * .8), 2.4vh); }
  .wl-temp { font-size: clamp(calc(var(--wl-fs) * 2.6), 11vh, 150px); }
}
/* Свайп по периоду (михкар-3): пока сетка едет вбок, соседи её обрезают — страница не шире экрана (иначе телефон
   уменьшает масштаб). */
.swipe-clip { overflow-x: clip; }
.swipe-live { pointer-events: none; }
/* «Расписание с фото» (михкар-2): окно «Нашёл N» — галочка · день и время · название (иврит — зеркально). */
.pe { display: flex; flex-direction: column; gap: 10px; }
.pe-rows { display: flex; flex-direction: column; gap: 2px; }
.pe-row { display: grid; grid-template-columns: var(--tap) max-content minmax(0, 1fr); align-items: center; column-gap: 8px; min-height: var(--tap); padding: 4px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.pe-row input { width: 22px; height: 22px; justify-self: center; }
.pe-when { display: flex; flex-direction: column; font-variant-numeric: tabular-nums; font-size: calc(13px * var(--fs, 1)); color: var(--muted); }
.pe-when .pe-hm { color: var(--text); font-weight: 600; }
.pe-t { display: flex; flex-direction: column; min-width: 0; }
.pe-title { overflow-wrap: anywhere; }
.pe > .btn { align-self: flex-start; }
.pt-many, .pe > .btn { align-self: flex-start; white-space: normal; max-width: 100%; text-align: start; height: auto; min-height: var(--tap); }

/* Привычка «N раз в день» (михкар-2): кольцо прогресса вокруг значка и «3/8» под ним. */
.hb-check.goal:not(.on) { border-color: transparent; background:
  radial-gradient(closest-side, var(--surface-2) calc(100% - 4px), transparent calc(100% - 3px)),
  conic-gradient(var(--hb) calc(var(--hb-p, 0) * 360deg), color-mix(in srgb, var(--hb) 18%, var(--border)) 0); }
.hb-cnt { position: absolute; bottom: -6px; inset-inline: -8px; text-align: center; font-size: 11px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.hb-cnt bdi { background: var(--surface); border-radius: 999px; padding: 1px 5px; box-shadow: 0 0 0 1px var(--border); }

/* «Дом» (михкар-2): кладовка, дежурства, техника. Срок: скоро — тихий янтарь (как «пропущенное»), вышел — красный. */
.hs-add { align-self: flex-start; }
.hs-acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.hs-sub.tone-soon { color: var(--late); }
.hs-sub.tone-bad { color: var(--danger); }
.hs-item.low .hs-sub { font-weight: 600; }
.hs-who { overflow-wrap: anywhere; }
.hs-on { display: inline-flex; align-items: center; gap: 4px; color: var(--ok); font-size: calc(13px * var(--fs, 1)); }
.hs-on svg { width: 16px; height: 16px; }
.wa-house .wa-pay, .wa-house .wa-list > li.wa-pay { grid-template-columns: minmax(0, 1fr); grid-template-areas: none; }
.wa-house .wa-pay > * { grid-area: auto; }
.wa-house .hs-acts { justify-content: flex-start; }
@media (min-width: 600px) { .wa-house .wa-pay, .wa-house .wa-list > li.wa-pay { grid-template-columns: minmax(0, 1fr) auto; } .wa-house .hs-acts { justify-content: flex-end; } }
.wl-chip.duty { font-weight: 600; }
/* «Дом» — четыре вкладки (михкар-8): на узком экране с крупным шрифтом кнопки переносятся целиком, не по слогам. */
.wa-house .wa-seg { display: flex; flex-wrap: wrap; }
.wa-house .wa-seg .seg-btn { flex: 1 1 auto; white-space: nowrap; padding: 4px 10px; }
/* «Кто кому должен» дома (михкар-8): строка траты — «за что · когда, кто платил» | сумма; переводы и перенос — тише. */
.wa-house .wa-list > li.wa-pay.hs-cost { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.hs-cost-btn { background: none; border: 0; padding: 0; margin: 0; color: inherit; font: inherit; text-align: start; cursor: pointer; min-height: 44px; justify-content: center; }
.hs-cost-a { font-variant-numeric: tabular-nums; white-space: nowrap; }
.hs-cost.k-settle, .hs-cost.k-carry { background: transparent; border-style: dashed; }
.hs-cost.k-settle b, .hs-cost.k-carry b { font-weight: 500; color: var(--muted); }
.hs-settle .tr-settle { margin-bottom: 8px; }
.hs-month { display: block; margin-top: 8px; }
/* «Первым — вот это» (михкар-8): одна строка над «Сейчас». */
.hv-first { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 12px 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); border-inline-start: 4px solid var(--accent); }
.hv-first-k { font-size: calc(12.5px * var(--fs, 1)); color: var(--muted); font-weight: 600; }
.hv-first-t { background: none; border: 0; padding: 0; margin: 0; color: inherit; font: inherit; font-weight: 700; font-size: calc(17px * var(--fs, 1)); text-align: start; cursor: pointer; overflow-wrap: anywhere; min-height: 32px; }
.hv-first-t[dir="rtl"] { text-align: right; }
.hv-first-why { font-size: calc(13px * var(--fs, 1)); color: var(--muted); overflow-wrap: anywhere; }
.hv-first-why .why-late { color: var(--late); font-weight: 600; }
.hv-first-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.hv-first-plan { justify-self: start; max-width: 100%; white-space: normal; text-align: start; }
.hv-first-habit { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; padding-top: 6px; border-top: 1px dashed var(--border); }
.hv-first-only-habit .hv-first-habit { border-top: 0; padding-top: 0; }
/* Свайп по «Ближайшим дням» (михкар-8): кнопки «‹ Раньше / Дальше ›» рядом с «Вся неделя». */
.hv-ahead-nav { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.hv-ahead-nav .hv-week { margin-top: 0; }
.hv-ahead-host { touch-action: pan-y; }


/* ---------- Значок у названия (18.11): строка подсказок, сетка «ещё…», годовщина на «Сегодня» ---------- */
.td-title.has-ico::before, .cal-title.has-ico::before { content: attr(data-ico); display: inline-block; margin-inline-end: .3em; line-height: 1; text-decoration: none; }
.td-row.done .td-title.has-ico::before { opacity: .55; filter: grayscale(.6); }
.cal-block-top .cal-ev-ic { flex: none; margin-inline-end: 2px; }
.icon-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.icon-row .icr-label { color: var(--muted); font-size: calc(13px * var(--fs, 1)); margin-inline-end: 2px; }
.icon-row .icr-opt {
  min-width: 44px; min-height: 44px; padding: 0 4px; border-radius: 14px; border: 1px solid var(--border);
  background: var(--surface); font-size: calc(22px * var(--fs, 1)); line-height: 1; cursor: pointer;
}
.icon-row .icr-opt.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent-soft); }
.icon-row .icr-more {
  display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 12px; border-radius: 999px;
  border: 1px dashed var(--border); background: transparent; color: var(--muted); font-size: calc(14px * var(--fs, 1)); cursor: pointer;
}
.icon-row .icr-more svg { width: 16px; height: 16px; }
.detail-icon-row { margin: 2px 0 8px; padding-inline-start: 2px; }
.ev-card .icon-row, .gev-form .icon-row { margin-bottom: 8px; }
.qa-icons .qa-ic { font-size: calc(19px * var(--fs, 1)); padding: 0 10px; min-width: 44px; justify-content: center; }
.dlg-icons .ip-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ip-groups { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ip-gname { margin: 0 0 6px; font-size: calc(13px * var(--fs, 1)); font-weight: 600; color: var(--muted); }
.ip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 6px; }
.ip-ic {
  min-height: 48px; border-radius: 14px; border: 1px solid transparent; background: var(--surface-2, var(--surface));
  font-size: calc(26px * var(--fs, 1)); line-height: 1; cursor: pointer;
}
.ip-ic:hover { border-color: var(--border); }
.ip-ic.on { border-color: var(--accent); background: var(--accent-soft); }
.ip-own { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ip-own .ip-own-in { flex: 1 1 8em; min-width: 0; font-size: calc(20px * var(--fs, 1)); }
.ip-own .btn { min-height: 44px; }
.hv-anniv { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 22px; border: 1px solid color-mix(in srgb, #e0803a 40%, var(--border)); background: linear-gradient(135deg, color-mix(in srgb, #e0803a 14%, var(--surface)), color-mix(in srgb, #d6457a 10%, var(--surface))); box-shadow: var(--shadow); }
.hv-anniv-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; min-width: 0; cursor: pointer; }
.hv-anniv-ic { font-size: calc(32px * var(--fs, 1)); line-height: 1; flex: none; }
.hv-anniv-t { display: flex; flex-direction: column; gap: 2px; flex: 1 1 9em; min-width: 0; }
.hv-anniv-t small { color: var(--muted); }
.hv-anniv-t strong { font-size: calc(18px * var(--fs, 1)); font-weight: 700; overflow-wrap: anywhere; }
.hv-anniv-n { font-weight: 600; color: color-mix(in srgb, #c2410c 80%, var(--text)); }
.hv-anniv-row.k-memorial .hv-anniv-n { color: var(--muted); }
.hv-anniv-row .btn { min-height: 44px; margin-inline-start: auto; }

/* «Количество» у покупки (18.11, views/qty-dialog.js): крупно «− N +», единицы одним касанием. */
.prop.prop-qty.set .prop-value { font-size: calc(19px * var(--fs, 1)); font-weight: 700; white-space: normal; overflow-wrap: anywhere; line-height: 1.2; }
.prop.prop-qty:not(.set) .prop-value { color: var(--accent); }
.dlg-qty .qd { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.qd-what { margin: 0; font-weight: 600; font-size: calc(16px * var(--fs, 1)); overflow-wrap: anywhere; }
.qd-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; direction: ltr; }
.qd-step {
  width: 64px; height: 64px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface-2, var(--bg)); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.qd-step svg { width: 28px; height: 28px; }
.qd-step:active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.qd-num {
  width: 100%; min-width: 0; height: 64px; text-align: center; border-radius: 16px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: calc(34px * var(--fs, 1)); font-weight: 700; font-variant-numeric: tabular-nums;
}
.qd-num:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.qd-hint { margin: -4px 0 0; text-align: center; }
.qd-units { display: flex; flex-wrap: wrap; gap: 8px; }
.qd-unit { min-height: 44px; padding: 0 14px; font-size: calc(15px * var(--fs, 1)); }
.qd-preview { margin: 0; font-size: calc(15px * var(--fs, 1)); color: var(--muted); overflow-wrap: anywhere; }
.qd-preview bdi { color: var(--text); font-weight: 600; }

.qd-clear { color: var(--danger); }
.qa-qty .qa-qty-btn bdi { font-weight: 600; }
.qa-qty .qa-qty-x { min-width: 44px; justify-content: center; padding: 0 8px; }
.qd-more { display: flex; flex-wrap: wrap; gap: 8px; }
