/* ==========================================================================
   Plans — жидкое стекло, обои, темы, анимации
   ========================================================================== */

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", Inter, "Segoe UI", Roboto, system-ui, sans-serif;
  --r-xl: 28px;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --spring: cubic-bezier(.34, 1.45, .64, 1);
  --rail-w: 72px;
  --top-inset: 0px;
  --gap: 16px;

  /* Статусы — фиксированные, всегда с иконкой и подписью */
  --good: #0ca30c;
  --warn: #fab219;
  --serious: #ec835a;
  --crit: #d03b3b;

  --ring-tasks: #ff3b6b;
  --ring-focus: #2fd36b;
  --ring-steps: #36c5f0;
  --ring-food: #a78bfa;
}

/* ---------- Тёмная тема */
:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1c1d21;
  --solid: #26272c;
  --solid-2: #2e2f35;
  --glass-bg: rgba(40, 41, 47, .5);
  --glass-strong: rgba(36, 37, 42, .82);
  --glass-blur: 26px;
  --edge-hi: rgba(255, 255, 255, .26);
  --edge-lo: rgba(255, 255, 255, .05);
  --glass-shadow: 0 24px 48px -26px rgba(0, 0, 0, .7), 0 2px 8px rgba(0, 0, 0, .16);
  --inset-hi: inset 0 1px 0 rgba(255, 255, 255, .07);
  --fill-1: rgba(255, 255, 255, .045);
  --fill-2: rgba(255, 255, 255, .075);
  --fill-3: rgba(255, 255, 255, .12);
  --card-2: rgba(255, 255, 255, .05);
  --line: rgba(255, 255, 255, .075);
  --line-2: rgba(255, 255, 255, .14);
  --text: #f4f4f6;
  --text-2: rgba(235, 235, 245, .62);
  --text-3: rgba(235, 235, 245, .38);
  --track: rgba(255, 255, 255, .07);
  --blob-o: 1;
  --scrim: rgba(0, 0, 0, .42);
  --tip-bg: rgba(14, 14, 16, .92);

  --c0: #3987e5; --c1: #d95926; --c2: #199e70; --c3: #c98500;
  --c4: #d55181; --c5: #2f9a2f; --c6: #9085e9; --c7: #e66767;
}

/* ---------- Светлая тема */
[data-theme="light"] {
  color-scheme: light;
  --bg: #e9eaee;
  --solid: #f7f7f9;
  --solid-2: #ffffff;
  --glass-bg: rgba(255, 255, 255, .56);
  --glass-strong: rgba(250, 250, 252, .9);
  --edge-hi: rgba(255, 255, 255, .95);
  --edge-lo: rgba(0, 0, 0, .06);
  --glass-shadow: 0 22px 44px -28px rgba(30, 32, 60, .32), 0 1px 3px rgba(0, 0, 0, .06);
  --inset-hi: inset 0 1px 0 rgba(255, 255, 255, .8);
  --fill-1: rgba(0, 0, 0, .035);
  --fill-2: rgba(0, 0, 0, .055);
  --fill-3: rgba(0, 0, 0, .085);
  --card-2: rgba(255, 255, 255, .62);
  --line: rgba(0, 0, 0, .07);
  --line-2: rgba(0, 0, 0, .13);
  --text: #141418;
  --text-2: rgba(60, 60, 67, .7);
  --text-3: rgba(60, 60, 67, .44);
  --track: rgba(0, 0, 0, .06);
  --blob-o: .5;
  --scrim: rgba(20, 20, 30, .25);
  --tip-bg: rgba(20, 20, 24, .9);

  --c0: #2a78d6; --c1: #eb6834; --c2: #1baf7a; --c3: #e09a00;
  --c4: #e0628f; --c5: #1f8a1f; --c6: #6250d6; --c7: #e34948;
}

[data-glass="clear"] { --glass-bg: rgba(40, 41, 47, .26); --glass-blur: 16px; }
[data-theme="light"][data-glass="clear"] { --glass-bg: rgba(255, 255, 255, .34); }

/* ---------- Акценты */
[data-accent="blue"]     { --accent: #3b82f6; --accent-hi: #63a0ff; --accent-rgb: 59, 130, 246; }
[data-accent="purple"]   { --accent: #8b5cf6; --accent-hi: #a98bff; --accent-rgb: 139, 92, 246; }
[data-accent="pink"]     { --accent: #e5457b; --accent-hi: #ff6f9f; --accent-rgb: 229, 69, 123; }
[data-accent="orange"]   { --accent: #f2711c; --accent-hi: #ff9447; --accent-rgb: 242, 113, 28; }
[data-accent="green"]    { --accent: #22a75a; --accent-hi: #3fcf7c; --accent-rgb: 34, 167, 90; }
[data-accent="graphite"] { --accent: #7c7c84; --accent-hi: #a1a1aa; --accent-rgb: 124, 124, 132; }

/* ---------- Обои: база + три мягких пятна */
[data-wall] { --wb: var(--wb-d); }
[data-theme="light"] [data-wall], [data-theme="light"][data-wall] { --wb: var(--wb-l); }
[data-wall="ash"]    { --wb-d: #222327; --wb-l: #e9eaee; --b1: transparent; --b2: transparent; --b3: rgba(255,255,255,.035); }
[data-wall="sand"]   { --wb-d: #25211c; --wb-l: #f0e9df; --b1: rgba(201,146,84,.42); --b2: rgba(120,80,45,.5); --b3: rgba(230,190,120,.22); }
[data-wall="sage"]   { --wb-d: #1d231f; --wb-l: #e6ece5; --b1: rgba(108,150,112,.4); --b2: rgba(54,88,66,.5); --b3: rgba(160,190,140,.2); }
[data-wall="aurora"] { --wb-d: #121527; --wb-l: #e5e7f5; --b1: rgba(52,72,190,.7); --b2: rgba(118,48,170,.6); --b3: rgba(20,110,150,.55); }
[data-wall="smoke"]  { --wb-d: #17171a; --wb-l: #ebebee; --b1: rgba(255,255,255,.1); --b2: rgba(150,150,165,.16); --b3: rgba(90,90,100,.3); }
[data-wall="tide"]   { --wb-d: #0e1a2c; --wb-l: #e2ecf7; --b1: rgba(24,110,220,.7); --b2: rgba(0,180,200,.55); --b3: rgba(100,60,200,.55); }
[data-wall="bloom"]  { --wb-d: #1c1330; --wb-l: #f2e7f2; --b1: rgba(130,50,240,.6); --b2: rgba(245,40,140,.5); --b3: rgba(255,140,70,.45); }
[data-wall="ember"]  { --wb-d: #21120e; --wb-l: #f5e8e2; --b1: rgba(230,57,70,.55); --b2: rgba(247,127,0,.5); --b3: rgba(120,10,20,.6); }
[data-wall="grove"]  { --wb-d: #0e1e16; --wb-l: #e4efe7; --b1: rgba(45,140,90,.6); --b2: rgba(82,183,136,.42); --b3: rgba(210,225,90,.3); }
[data-wall="dusk"]   { --wb-d: #191625; --wb-l: #eae6f1; --b1: rgba(85,70,140,.6); --b2: rgba(140,80,120,.45); --b3: rgba(50,62,110,.55); }

/* ==========================================================================
   База
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--wb, var(--bg)); }
body {
  margin: 0;
  min-height: 100dvh;
  font: 14px/1.4 var(--font);
  color: var(--text);
  background: transparent;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  overscroll-behavior-y: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; }
p { margin: 0; }
svg.ic { flex: none; display: block; }
::selection { background: rgba(var(--accent-rgb), .35); }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
html.has-sheet, html.has-sheet body { overflow: hidden; }
html.dragging, html.dragging * { cursor: grabbing !important; user-select: none !important; -webkit-user-select: none !important; }

/* Обои */
.wall { position: fixed; inset: 0; z-index: -1; background: var(--wb); overflow: hidden; transition: background .6s var(--ease); }
.wall i {
  position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%;
  opacity: var(--blob-o); transition: background .8s var(--ease), opacity .6s;
  will-change: transform;
}
.wall i:nth-child(1) { left: -18vmax; top: -24vmax; background: radial-gradient(closest-side, var(--b1), transparent); animation: drift1 38s ease-in-out infinite alternate; }
.wall i:nth-child(2) { right: -22vmax; top: 10vmax; background: radial-gradient(closest-side, var(--b2), transparent); animation: drift2 44s ease-in-out infinite alternate; }
.wall i:nth-child(3) { left: 10vmax; bottom: -34vmax; background: radial-gradient(closest-side, var(--b3), transparent); animation: drift3 52s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(14vmax, 10vmax) scale(1.12); } }
@keyframes drift2 { to { transform: translate(-12vmax, 14vmax) scale(.9); } }
@keyframes drift3 { to { transform: translate(16vmax, -10vmax) scale(1.15); } }

/* ==========================================================================
   Стекло
   ========================================================================== */
.glass {
  position: relative;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(170%);
  backdrop-filter: blur(var(--glass-blur)) saturate(170%);
  border-radius: var(--r-xl);
  box-shadow: var(--glass-shadow), var(--inset-hi);
  isolation: isolate;
}
.glass::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; z-index: 2;
  background: linear-gradient(165deg, var(--edge-hi), var(--edge-lo) 28%, transparent 55%, var(--edge-lo) 80%, rgba(255,255,255,.1));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}
.glass::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 1;
  background: radial-gradient(calc(200px + 240px * var(--glint-k, .5)) circle at var(--mx, 50%) var(--my, -200px), rgba(255,255,255, calc(.16 * var(--glint-k, .5))), transparent 62%);
  opacity: 0; transition: opacity .35s var(--ease);
}
[data-theme="light"] .glass::after { background: radial-gradient(calc(200px + 240px * var(--glint-k, .5)) circle at var(--mx, 50%) var(--my, -200px), rgba(255,255,255, calc(1.1 * var(--glint-k, .5))), transparent 62%); }
.glass.glint::after { opacity: 1; }
.glass-strong { background: var(--glass-strong); }

[data-rt="1"] .glass, [data-rt="1"] .glass-strong {
  -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--solid);
}
[data-rt="1"] .sheet-backdrop { -webkit-backdrop-filter: none; backdrop-filter: none; }

/* Волны: идут по фону под стеклом — стекло само их размывает */
:root { --wave-rgb: 255, 255, 255; }
[data-theme="light"] { --wave-rgb: var(--accent-rgb); }
.waves { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.app { position: relative; z-index: 1; }
/* Круг от точки касания */
.drop { position: absolute; width: 0; height: 0; }
.drop i {
  position: absolute; left: 0; top: 0; width: var(--d); height: var(--d);
  margin: calc(var(--d) / -2) 0 0 calc(var(--d) / -2); border-radius: 50%;
  background: radial-gradient(closest-side, transparent 40%, rgba(var(--wave-rgb), calc(.10 + .45 * var(--wave-k, .6))) 74%, transparent 100%);
  filter: blur(calc(3px + 5px * var(--wave-k, .6)));
  opacity: 0; transform: scale(.06); will-change: transform, opacity;
  animation: waveOut 1.7s cubic-bezier(.12, .6, .3, 1) both;
}
@keyframes waveOut { 0% { opacity: 0; transform: scale(.06); } 12% { opacity: 1; } 100% { opacity: 0; transform: scale(1); } }
/* Контур блока, расходящийся наружу */
.wshape { position: absolute; }
.wshape i {
  position: absolute; inset: 0; border-radius: var(--r);
  box-shadow: 0 0 0 3px rgba(var(--wave-rgb), calc(.10 + .36 * var(--wave-k, .6))), 0 0 56px 24px rgba(var(--wave-rgb), calc(.07 + .26 * var(--wave-k, .6))), inset 0 0 36px 12px rgba(var(--wave-rgb), calc(.05 + .2 * var(--wave-k, .6)));
  filter: blur(calc(2px + 4px * var(--wave-k, .6)));
  opacity: 0;
  animation: shapeOut 1.9s cubic-bezier(.12, .6, .3, 1) both;
}
@keyframes shapeOut {
  0% { inset: 0; border-radius: var(--r); opacity: 0; }
  10% { opacity: 1; }
  100% { inset: calc(var(--s) * -1); border-radius: calc(var(--r) + var(--s)); opacity: 0; }
}

/* Рябь при нажатии */
.btn, .press { position: relative; overflow: hidden; }
.ripple {
  position: absolute; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255,255,255,.35), rgba(255,255,255,0) 70%);
  transform: scale(0); animation: ripple .6s var(--ease-out) forwards;
}
@keyframes ripple { to { transform: scale(1); opacity: 0; } }

/* ==========================================================================
   Каркас
   ========================================================================== */
.app {
  display: flex; gap: 20px; max-width: 1560px; margin: 0 auto;
  padding: calc(16px + var(--top-inset)) 22px 16px 16px;
}
.main { flex: 1; min-width: 0; padding: 4px 0 64px; }
.view { min-height: 60vh; }

/* Боковая панель */
.rail {
  position: sticky; top: calc(16px + var(--top-inset)); align-self: flex-start;
  width: var(--rail-w); flex: none; height: calc(100dvh - 32px - var(--top-inset));
  padding: 12px 10px; display: flex; flex-direction: column; gap: 6px; z-index: 20;
  transition: width .4s var(--ease);
}
.brand { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 6px; margin-bottom: 8px; font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.logo {
  width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: none; color: #fff;
  background: linear-gradient(160deg, var(--accent-hi), var(--accent));
  box-shadow: 0 6px 18px -6px rgba(var(--accent-rgb), .8), inset 0 1px 0 rgba(255,255,255,.35);
}
.nav { position: relative; display: flex; flex-direction: column; gap: 2px; }
.nav-i {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px;
  border-radius: 14px; color: var(--text-2); font-weight: 500; transition: color .2s;
}
.nav-i:hover { color: var(--text); }
.nav-i.on { color: var(--text); }
.nav-n { margin-left: auto; font-size: 11.5px; color: var(--text-2); background: var(--fill-2); min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.glider {
  position: absolute; left: 0; right: 0; top: 0; height: 42px; border-radius: 14px; z-index: 0;
  background: var(--fill-3);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 6px 16px -8px rgba(0,0,0,.4);
  transition: transform .5s var(--spring), opacity .3s;
}
[data-theme="light"] .glider { background: rgba(255,255,255,.85); box-shadow: 0 4px 14px -6px rgba(0,0,0,.18); }
.rail-sec { margin: 18px 10px 6px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.rail-projects { display: flex; flex-direction: column; gap: 1px; overflow-y: auto; min-height: 0; flex: 0 1 auto; }
.rail-p { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 12px; border-radius: 12px; color: var(--text-2); font-size: 13px; }
.rail-p:hover { background: var(--fill-1); color: var(--text); }
.rail-p.on { background: var(--fill-2); color: var(--text); }
.rail-p span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-p .pin-ic { width: 15px; display: grid; place-items: center; color: var(--text-3); flex: none; }
.rail-p .pin-ic .ic { width: 15px; height: 15px; }
.rail-p.on .pin-ic { color: var(--accent-hi); }
.rail-n { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; flex: none; }
.rail-sec-row { display: flex; align-items: center; justify-content: space-between; margin-right: 4px; }
.rail-sec-row .icon-btn { width: 24px; height: 24px; opacity: 0; transition: opacity .2s; }
.rail:hover .rail-sec-row .icon-btn, .rail-sec-row .icon-btn:focus-visible { opacity: 1; }
.rail-empty { width: 100%; color: var(--text-3); }
.pin-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 16px; }
.pin-row { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 4px 0 10px; border-radius: 12px; background: var(--fill-1); font-size: 13.5px; }
.pin-row small { display: block; font-size: 11.5px; color: var(--text-3); }
.pin-row .icon-btn { width: 30px; height: 30px; }
.pin-row .icon-btn[disabled] { opacity: .25; }
.pin-row .pin-ic, .pin-chip .pin-ic { display: grid; place-items: center; color: var(--text-2); }
.pin-g + .pin-g { margin-top: 12px; }
.pin-add { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pin-chip { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 10px 0 11px; border-radius: 16px; background: var(--fill-1); border: 1px solid var(--line); font-size: 12.5px; color: var(--text-2); transition: background .2s, color .2s; }
.pin-chip:hover { background: var(--fill-2); color: var(--text); }
.pin-chip > .ic:last-child { width: 13px; height: 13px; opacity: .6; }
.btn.on-pin { color: var(--accent-hi); }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }
.me { display: flex; align-items: center; gap: 10px; padding: 8px 6px 4px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-weight: 700; font-size: 13px; color: #fff;
  background: linear-gradient(140deg, var(--c6), var(--c4));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3);
}
.me small { display: block; color: var(--text-3); font-size: 11.5px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--accent)); flex: none; }

/* Узкая панель — только иконки */
@media (max-width: 1239px) {
  .rail .nav-t, .rail .nav-n, .rail .brand b, .rail-sec, .rail-projects, .me > div { display: none; }
  .rail .nav-i { justify-content: center; padding: 0; }
  .brand { justify-content: center; padding: 0; }
  .me { justify-content: center; padding: 8px 0 2px; }
}
@media (min-width: 1240px) { :root { --rail-w: 232px; } }

/* Нижняя панель (телефон) */
.tabbar {
  position: fixed; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom) + 10px); z-index: 40;
  height: 64px; border-radius: 26px; padding: 6px; display: none; gap: 2px;
}
.tab { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 10.5px; font-weight: 500; color: var(--text-2); border-radius: 20px; transition: color .2s; }
.tab.on { color: var(--text); }
.tabbar .glider { height: auto; bottom: 6px; top: 6px; left: 0; right: auto; border-radius: 20px; }
.fab {
  position: fixed; right: 16px; bottom: calc(env(safe-area-inset-bottom) + 86px); z-index: 41;
  width: 56px; height: 56px; border-radius: 20px; display: none; place-items: center; color: #fff;
  background: linear-gradient(160deg, var(--accent-hi), var(--accent));
  box-shadow: 0 14px 30px -10px rgba(var(--accent-rgb), .9), inset 0 1px 0 rgba(255,255,255,.35);
  transition: transform .35s var(--spring);
}
.fab:active { transform: scale(.92); }

/* ==========================================================================
   Остров (dynamic island)
   ========================================================================== */
.island {
  position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 14px + var(--top-inset)); z-index: 70;
  width: 120px; height: 36px; transform: translateX(-50%); border-radius: 22px;
  background: #050506; color: #fff; overflow: hidden; cursor: default;
  box-shadow: 0 16px 40px -12px rgba(0,0,0,.7), inset 0 0 0 1px rgba(255,255,255,.08);
  transition: width .55s var(--spring), height .55s var(--spring), border-radius .5s var(--ease), opacity .3s, transform .5s var(--spring);
}
.island[data-mode="idle"] { opacity: 0; transform: translateX(-50%) translateY(-14px) scale(.6); pointer-events: none; }
.island[data-mode="focus"], .island[data-mode="focus-xl"] { cursor: pointer; }
.island[data-mode="focus-xl"] { border-radius: 30px; }
.isl { position: absolute; left: 0; top: 0; width: max-content; display: flex; align-items: center; gap: 10px; white-space: nowrap; animation: islIn .45s .1s var(--ease) both; }
@keyframes islIn { from { opacity: 0; filter: blur(6px); transform: scale(.94); } }
.isl-toast { padding: 7px 8px 7px 8px; min-height: 44px; }
.isl-toast .isl-ic { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #30d158; color: #04120a; flex: none; }
.isl-toast .isl-ic.info { background: var(--accent); color: #fff; }
.isl-toast .isl-ic.warn { background: #ff9f0a; color: #1d1200; }
.isl-text { font-size: 13px; font-weight: 600; max-width: 300px; overflow: hidden; text-overflow: ellipsis; padding-right: 6px; }
.isl-text small { display: block; font-weight: 500; color: rgba(255,255,255,.6); font-size: 11.5px; }
.isl-btn { height: 30px; padding: 0 13px; border-radius: 15px; background: rgba(255,255,255,.14); font-size: 12.5px; font-weight: 600; margin-right: 2px; }
.isl-btn:hover { background: rgba(255,255,255,.22); }
.isl-focus { padding: 6px 14px 6px 8px; height: 40px; font-size: 13px; font-weight: 600; }
.isl-focus .mini-ring { width: 26px; height: 26px; }
.isl-clock { color: #ff9f0a; font-variant-numeric: tabular-nums; font-weight: 650; margin-left: 6px; }
.isl-focus.brk .isl-clock { color: #30d158; }
.isl-xl { padding: 16px 16px 16px 18px; gap: 16px; align-items: center; }
.isl-xl .mini-ring { width: 44px; height: 44px; }
.isl-xl .t1 { font-size: 12px; color: rgba(255,255,255,.6); font-weight: 500; }
.isl-xl .t2 { font-size: 15px; font-weight: 650; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.isl-xl .big { font-size: 40px; font-weight: 600; color: #ff9f0a; font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1; }
.isl-xl.brk .big { color: #30d158; }
.isl-xl .ctl { display: flex; gap: 8px; margin-top: 10px; justify-content: flex-end; }
.isl-round { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.14); }
.isl-round:hover { background: rgba(255,255,255,.22); }
.isl-round.y { background: #ff9f0a; color: #1d1200; }
.isl-round.r { background: #ff453a; color: #fff; }
.isl-pill { height: 40px; padding: 0 16px; border-radius: 20px; background: rgba(255,255,255,.14); font-weight: 600; font-size: 13px; }
.mini-ring circle { transition: stroke-dashoffset 1s linear; }

/* ==========================================================================
   Заголовок страницы и панель инструментов
   ========================================================================== */
.ph { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 16px; align-items: end; margin-bottom: 18px; }
.ph-text { min-width: 0; align-self: start; }
.ph h1 { font-size: 30px; line-height: 1.12; letter-spacing: -.025em; font-weight: 720; }
.ph-sub { margin-top: 5px; color: var(--text-2); font-size: 13px; }
.ph-back { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); font-size: 13px; margin-bottom: 6px; }
.ph-back:hover { color: var(--text); }
.toolbar { display: flex; align-items: center; gap: 2px; height: 50px; padding: 0 7px; border-radius: 25px; align-self: start; justify-self: end; }
.tb-search { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px 0 12px; border-radius: 18px; color: var(--text-3); min-width: 220px; background: var(--fill-1); margin-right: 4px; transition: background .2s; }
.tb-search:hover { background: var(--fill-2); }
.tb-search kbd { margin-left: auto; font: 600 10.5px var(--font); color: var(--text-3); background: var(--fill-2); padding: 3px 6px; border-radius: 6px; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); transition: background .2s, color .2s, transform .2s var(--spring); flex: none; }
.icon-btn:hover { background: var(--fill-2); color: var(--text); }
.icon-btn:active { transform: scale(.9); }
.ph-stats { display: flex; gap: 8px; flex-wrap: wrap; min-width: 0; }
.ph-nav { grid-column: 1 / -1; display: flex; min-width: 0; margin-top: -2px; }
.ph-actions { display: flex; gap: 8px; align-items: center; justify-self: end; flex-wrap: wrap; justify-content: flex-end; }

.stat {
  padding: 9px 14px 10px; border-radius: 16px; min-width: 92px;
  background: var(--fill-1); border: 1px solid var(--line); box-shadow: var(--inset-hi);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.stat span { display: block; font-size: 11.5px; color: var(--text-2); white-space: nowrap; }
.stat b { display: block; font-size: 20px; font-weight: 650; letter-spacing: -.01em; margin-top: 1px; white-space: nowrap; }
.stat b small { font-size: 12px; font-weight: 500; color: var(--text-2); margin-left: 1px; }
.stat.warn b { color: var(--serious); }

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: 19px;
  background: var(--fill-2); border: 1px solid var(--line); box-shadow: var(--inset-hi);
  font-weight: 600; font-size: 13px; white-space: nowrap; color: var(--text);
  transition: background .2s, transform .25s var(--spring), box-shadow .2s;
}
.btn:hover { background: var(--fill-3); }
.btn:active { transform: scale(.96); }
.btn.accent {
  color: #fff; border-color: transparent;
  background: linear-gradient(180deg, var(--accent-hi), var(--accent));
  box-shadow: 0 10px 26px -10px rgba(var(--accent-rgb), .85), inset 0 1px 0 rgba(255,255,255,.3);
}
.btn.accent:hover { filter: brightness(1.06); }
.btn.danger { color: #ff6b6b; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--fill-2); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 15px; }
.btn.lg { height: 46px; padding: 0 22px; border-radius: 23px; font-size: 14px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.link { color: var(--accent-hi); font-weight: 600; font-size: 12.5px; display: inline-flex; align-items: center; gap: 3px; }
[data-theme="light"] .link { color: var(--accent); }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Сегменты */
.seg { position: relative; display: inline-flex; padding: 3px; border-radius: 19px; background: var(--fill-1); border: 1px solid var(--line); gap: 2px; }
.seg button, .seg a { position: relative; z-index: 1; height: 30px; padding: 0 12px; border-radius: 15px; font-size: 12.5px; font-weight: 600; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; transition: color .2s; white-space: nowrap; }
.seg button.on, .seg a.on { color: var(--text); }
.seg .glider { height: auto; top: 3px; bottom: 3px; left: 0; right: auto; border-radius: 15px; }
.seg.sm button { height: 26px; padding: 0 10px; font-size: 12px; }
.seg-n { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* ==========================================================================
   Карточки и сетка
   ========================================================================== */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.s3 { grid-column: span 3; } .s4 { grid-column: span 4; } .s5 { grid-column: span 5; } .s6 { grid-column: span 6; }
.s7 { grid-column: span 7; } .s8 { grid-column: span 8; } .s12 { grid-column: 1 / -1; }
.cols { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--gap); align-items: start; }
.col { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.stretch { align-self: stretch; }

.card { padding: 18px; min-width: 0; }
.card-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-h h3 { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.card-h p { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.card-h .right { display: flex; align-items: center; gap: 6px; flex: none; }
.card-sub { font-size: 12px; color: var(--text-2); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; margin: 16px 0 8px; display: flex; align-items: center; justify-content: space-between; }
.card-sub:first-child { margin-top: 0; }
.card-sub .legend { text-transform: none; letter-spacing: 0; font-weight: 500; }
.hero { font-size: 34px; font-weight: 680; letter-spacing: -.03em; line-height: 1.05; }
.hero small { font-size: 14px; font-weight: 500; color: var(--text-2); letter-spacing: 0; margin-left: 4px; }
.delta { font-size: 12px; font-weight: 600; }
.delta.up { color: #34c759; } .delta.down { color: #ff6b6b; }
[data-theme="light"] .delta.up { color: #1a8f3a; } [data-theme="light"] .delta.down { color: #d03b3b; }
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 26px 10px; color: var(--text-3); text-align: center; font-size: 13px; }
.empty .ic { width: 28px; height: 28px; opacity: .7; }
.divider { height: 1px; background: var(--line); margin: 12px 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Въезд экрана: карточки по очереди */
@keyframes cardIn { from { opacity: 0; transform: translateY(16px) scale(.985); } }
.view.entering .anim { animation: cardIn .7s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 55ms); }
@keyframes rowIn { from { opacity: 0; transform: translateY(6px); } }
@keyframes fadeIn { from { opacity: 0; } }

/* Чипы и метки */
.tag {
  display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px 0 7px; border-radius: 7px; font-size: 11.5px; font-weight: 550;
  background: color-mix(in srgb, var(--c, var(--accent)) 18%, transparent); color: var(--text); white-space: nowrap; max-width: 180px;
}
.tag i { width: 6px; height: 6px; border-radius: 50%; background: var(--c, var(--accent)); flex: none; }
.tag span { overflow: hidden; text-overflow: ellipsis; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 15px; background: var(--fill-2); border: 1px solid var(--line); font-size: 12.5px; font-weight: 550; color: var(--text); white-space: nowrap; transition: background .2s, transform .2s var(--spring); }
.chip:hover { background: var(--fill-3); }
.chip.on { background: rgba(var(--accent-rgb), .2); border-color: rgba(var(--accent-rgb), .45); }
.chip:active { transform: scale(.95); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.prio { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 7px; font-size: 11px; font-weight: 650; flex: none; }
.prio.p1 { color: #ff7b72; background: rgba(208, 59, 59, .18); }
.prio.p2 { color: #ffa25c; background: rgba(236, 131, 90, .18); }
.prio.p3 { color: var(--accent-hi); background: rgba(var(--accent-rgb), .16); }
[data-theme="light"] .prio.p1 { color: #c22d2d; } [data-theme="light"] .prio.p2 { color: #c55a1c; } [data-theme="light"] .prio.p3 { color: var(--accent); }
.status-pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 11px; font-size: 11.5px; font-weight: 600; background: var(--fill-2); color: var(--text-2); white-space: nowrap; }
.status-pill.active { background: rgba(var(--accent-rgb), .18); color: var(--text); }
.status-pill.idea { background: rgba(250, 178, 25, .16); color: var(--text); }
.status-pill.paused { background: var(--fill-2); color: var(--text-2); }
.status-pill.done { background: rgba(12, 163, 12, .18); color: var(--text); }
.status-pill .ic { width: 11px; height: 11px; }
.health { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; }
.health.ok { color: #34c759; } .health.risk { color: var(--serious); } .health.late { color: #ff6b6b; } .health.empty, .health.done { color: var(--text-3); }
[data-theme="light"] .health.ok { color: #1a8f3a; }

/* Прогресс */
.bar { height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.bar > i { display: block; height: 100%; width: var(--w, 0%); border-radius: inherit; background: var(--c, var(--accent)); transition: width .8s var(--ease); animation: barGrow 1s var(--ease-out) both; }
@keyframes barGrow { from { width: 0; } }
.bar.lg { height: 10px; border-radius: 5px; }
.bar > i.warn { background: var(--warn); } .bar > i.crit { background: var(--crit); }
.bar.lap { position: relative; }
.bar.lap > i.lap { position: absolute; left: 0; top: 0; box-shadow: 3px 0 6px rgba(0, 0, 0, .8); }

/* ==========================================================================
   Задачи
   ========================================================================== */
.tasks { display: flex; flex-direction: column; }
.task {
  position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line);
  cursor: pointer; animation: rowIn .38s var(--ease) both; animation-delay: calc(var(--j, 0) * 22ms);
  touch-action: pan-y; transition: border-color .3s var(--ease);
}
/* Черта под последней строкой прозрачная, а не нулевая: когда строки плавно уходят и приходят (dom.js), она гаснет
   и проявляется вместе с ними, а не выскакивает */
.task:last-child { border-bottom-color: transparent; }
.task:has(+ [data-ghost]:last-child) { border-bottom-color: transparent; }
[data-ghost] { pointer-events: none; }
.task-in { display: flex; align-items: flex-start; gap: 12px; flex: 1; min-width: 0; transform: translateX(var(--sx, 0)); transition: transform .35s var(--ease); }
.task.swiping .task-in { transition: none; }
.task-body { flex: 1; min-width: 0; }
.task-title { font-size: 14px; font-weight: 550; line-height: 1.35; word-break: break-word; }
.task-title span { background: linear-gradient(currentColor, currentColor) 0 58% / 0 1.5px no-repeat; transition: background-size .35s var(--ease), color .3s; }
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 5px; font-size: 12px; color: var(--text-2); }
.task-meta .m { display: inline-flex; align-items: center; gap: 4px; }
.task-meta .m .ic { width: 13px; height: 13px; }
.task-meta .od { color: #ff7b72; }
.task-meta .tdy { color: #34c759; }
[data-theme="light"] .task-meta .tdy { color: #1a8f3a; }
[data-theme="light"] .task-meta .od { color: #c22d2d; }
.task-notes { font-size: 12px; color: var(--text-3); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task.done .task-title { color: var(--text-3); }
.task.done .task-title span { background-size: 100% 1.5px; }
.task.completing .task-title span { background-size: 100% 1.5px; color: var(--text-3); }
.task:hover .task-act { opacity: 1; }
.task-act { opacity: 0; transition: opacity .2s; display: flex; gap: 2px; margin: -4px -2px 0 0; }
.task-act .icon-btn { width: 30px; height: 30px; }
.swipe-bg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; border-radius: 12px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.task.swiping .swipe-bg { opacity: 1; }
.swipe-bg .l, .swipe-bg .r { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; opacity: .5; transition: opacity .2s, transform .25s var(--spring); }
.task.arm-r .swipe-bg { background: rgba(48, 209, 88, .16); } .task.arm-r .swipe-bg .l { opacity: 1; transform: scale(1.1); color: #34c759; }
.task.arm-l .swipe-bg { background: rgba(var(--accent-rgb), .16); } .task.arm-l .swipe-bg .r { opacity: 1; transform: scale(1.1); color: var(--accent-hi); }

/* Чекбокс */
.check {
  --pc: var(--text-3);
  position: relative; width: 21px; height: 21px; margin-top: 0; border-radius: 50%; flex: none; display: grid; place-items: center;
  border: 1.7px solid var(--pc); background: color-mix(in srgb, var(--pc) 8%, transparent);
  transition: background .25s, border-color .25s, transform .3s var(--spring);
}
.check.p1 { --pc: #ff5f57; } .check.p2 { --pc: #ff9f40; } .check.p3 { --pc: var(--accent-hi); }
.check svg { width: 12px; height: 12px; stroke: var(--pc); stroke-width: 3.2; stroke-dasharray: 22; stroke-dashoffset: 22; transition: stroke-dashoffset .35s .05s var(--ease); }
.check:hover svg { stroke-dashoffset: 11; }
.check:active { transform: scale(.86); }
.check.on, .completing .check { background: var(--accent); border-color: var(--accent); transform: scale(1.06); }
.check.on svg, .completing .check svg { stroke-dashoffset: 0; stroke: #fff; }
.completing .check::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; animation: pulse .6s var(--ease-out); }
@keyframes pulse { from { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), .6); } to { box-shadow: 0 0 0 12px rgba(var(--accent-rgb), 0); } }
.check.sq { border-radius: 7px; width: 19px; height: 19px; }
.check.on.skipped { background: var(--fill-3); border-color: var(--fill-3); transform: none; }
.check.on.skipped svg { stroke: var(--text-2); stroke-width: 2.2; stroke-dasharray: none; }
/* «Пропустить» у приёма лекарств и замера: на компьютере — при наведении, на телефоне — всегда */
.ht-skip { flex: none; align-self: center; display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 11px; border-radius: 14px; font-size: 12px; font-weight: 550; color: var(--text-2); background: var(--fill-1); border: 1px solid var(--line); opacity: 0; transition: opacity .2s, background .2s, color .2s; }
.ht-skip .ic { width: 12px; height: 12px; }
.task:hover .ht-skip, .ht-skip:focus-visible { opacity: 1; }
.ht-skip:hover { background: var(--fill-3); color: var(--text); }
@media (hover: none) { .ht-skip { opacity: 1; } }

.group { margin-bottom: 6px; }
.group-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 4px 6px; font-size: 13px; font-weight: 650; }
.group-h:first-child { padding-top: 2px; }
.group-h .n { color: var(--text-3); font-weight: 500; margin-left: 6px; }
.group-h.od { color: #ff7b72; }
[data-theme="light"] .group-h.od { color: #c22d2d; }
.add-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; color: var(--text-3); font-size: 13.5px; font-weight: 500; width: 100%; border-radius: 10px; transition: color .2s; }
.add-row:hover { color: var(--accent-hi); }
.add-row .plus { width: 21px; height: 21px; border-radius: 50%; display: grid; place-items: center; }
.add-row:hover .plus { background: var(--accent); color: #fff; }

.filters { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.select, .input {
  height: 36px; border-radius: 18px; padding: 0 14px; background: var(--fill-1); border: 1px solid var(--line); color: var(--text);
  font-size: 13px; outline: none; transition: border-color .2s, background .2s; min-width: 0;
}
.select { appearance: none; -webkit-appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; cursor: pointer; }
.input:focus, .select:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: rgba(var(--accent-rgb), .6); background: var(--fill-2); }
.input::placeholder, textarea::placeholder { color: var(--text-3); }
.search-in { flex: 1; min-width: 160px; max-width: 320px; padding-left: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='m20 20-4.2-4.2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 13px center; }
option { background: var(--solid); color: var(--text); }

/* Канбан */
.board { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: 14px; overflow-x: auto; padding: 2px 2px 12px; margin: 0 -2px; scrollbar-width: thin; }
.kcol { padding: 12px 10px 10px; border-radius: 24px; min-height: 260px; display: flex; flex-direction: column; }
.kcol-h { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 6px 8px; font-size: 13px; font-weight: 650; }
.kcol-h .n { font-size: 11.5px; color: var(--text-3); background: var(--fill-2); padding: 1px 7px; border-radius: 9px; font-weight: 600; }
.kcol-h .icon-btn { margin-left: auto; width: 28px; height: 28px; }
.kdrop { display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 80px; border-radius: 16px; transition: background .2s; }
.kdrop.over { background: rgba(var(--accent-rgb), .06); }
.kcard {
  padding: 11px 12px 10px; border-radius: 16px; background: var(--card-2); border: 1px solid var(--line); box-shadow: var(--inset-hi), 0 4px 12px -8px rgba(0,0,0,.4);
  cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; animation: rowIn .35s var(--ease) both;
  transition: box-shadow .2s, background .2s, opacity .2s;
}
.kcard:hover { background: var(--fill-2); }
.kc-top { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; flex-wrap: wrap; }
.kc-title { font-size: 13.5px; font-weight: 580; line-height: 1.35; }
.kcard.done .kc-title { color: var(--text-3); text-decoration: line-through; }
.kc-prog { display: flex; align-items: center; gap: 8px; margin-top: 9px; font-size: 11px; color: var(--text-3); }
.kc-prog .bar { flex: 1; height: 4px; }
.kc-foot { display: flex; align-items: center; gap: 10px; margin-top: 9px; font-size: 11.5px; color: var(--text-2); }
.kc-foot .m { display: inline-flex; align-items: center; gap: 4px; }
.kc-foot .m .ic { width: 12px; height: 12px; }
.kc-foot .od { color: #ff7b72; }

/* Задачи: неделя по дням */
.cal-sw span { min-width: 150px; }
.cal-today[disabled] { opacity: .35; pointer-events: none; }
.wv { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; align-items: stretch; }
.wv-col { padding: 10px 8px 8px; border-radius: 22px; min-height: 340px; display: flex; flex-direction: column; min-width: 0; }
.wv-col.past { opacity: .78; }
.wv-h { display: flex; align-items: baseline; gap: 6px; padding: 2px 6px 10px; }
.wv-wd { font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); }
.wv-n { font-size: 20px; font-weight: 650; line-height: 1; font-variant-numeric: tabular-nums; }
.wv-col.now .wv-wd { color: var(--accent-hi); }
.wv-col.now .wv-n { color: #fff; background: var(--accent); min-width: 30px; height: 30px; border-radius: 15px; display: inline-grid; place-items: center; font-size: 16px; padding: 0 6px; align-self: center; }
.wv-col.now { box-shadow: inset 0 0 0 1.5px rgba(var(--accent-rgb), .45), var(--inset-hi); }
.wv-h .n { margin-left: auto; font-size: 11px; color: var(--text-3); background: var(--fill-2); padding: 1px 7px; border-radius: 9px; font-weight: 600; align-self: center; }
.wv-drop { gap: 6px; min-height: 60px; }
.wv-t {
  position: relative; display: flex; gap: 7px; align-items: flex-start; padding: 8px 8px 8px 10px; border-radius: 13px; background: var(--card-2); border: 1px solid var(--line);
  cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; animation: rowIn .35s var(--ease) both; transition: background .2s, opacity .2s; overflow: hidden;
}
.wv-t::before { content: ''; position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--c); }
.wv-t:hover { background: var(--fill-2); }
.wv-t .check { width: 17px; height: 17px; margin-top: 1px; }
.wv-t .check svg { width: 10px; height: 10px; }
.wv-b { min-width: 0; flex: 1; }
.wv-tt { font-size: 12.5px; font-weight: 560; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.wv-m { display: flex; flex-wrap: wrap; gap: 3px 8px; margin-top: 4px; font-size: 11px; color: var(--text-3); }
.wv-m > span { display: inline-flex; align-items: center; gap: 3px; min-width: 0; }
.wv-m .ic { width: 11px; height: 11px; }
.wv-p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; display: block !important; }
.wv-t.od .wv-m > span:first-child, .wv-t.od .wv-tt { color: #ff7b72; }
.wv-t.rep { opacity: .5; cursor: pointer; border-style: dashed; background: transparent; }
.wv-t.rep:hover { opacity: .8; }
.wv-t.done { cursor: default; background: transparent; border-color: transparent; padding-top: 5px; padding-bottom: 5px; }
.wv-t.done .wv-tt { color: var(--text-3); text-decoration: line-through; -webkit-line-clamp: 2; }
.wv-t.done::before { opacity: .35; }
.wv-add { display: flex; align-items: center; justify-content: center; gap: 5px; height: 30px; margin-top: 6px; border-radius: 11px; color: var(--text-3); font-size: 12px; opacity: 0; transition: opacity .2s, background .2s, color .2s; }
.wv-col:hover .wv-add, .wv-add:focus-visible { opacity: 1; }
.wv-add:hover { background: var(--fill-1); color: var(--text); }
@media (max-width: 1100px) {
  .wv { grid-template-columns: repeat(7, minmax(180px, 1fr)); overflow-x: auto; padding-bottom: 10px; scroll-snap-type: x proximity; scrollbar-width: thin; }
  .wv-col { scroll-snap-align: start; }
}
@media (hover: none) { .wv-add { opacity: 1; } }

/* Задачи: календарь на месяц */
.cal { padding: 10px; }
.cal-g { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-wd { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); padding: 2px 8px 6px; }
.cal-d { min-height: 112px; padding: 6px 5px 5px; border-radius: 14px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; min-width: 0; transition: background .2s, box-shadow .2s; }
.cal-d:hover { background: var(--fill-1); }
.cal-d.sel { background: rgba(var(--accent-rgb), .09); box-shadow: inset 0 0 0 1.5px rgba(var(--accent-rgb), .4); }
.cal-d.out { opacity: .4; }
.cal-n { font-size: 12.5px; font-weight: 600; padding: 0 4px; height: 22px; display: inline-flex; align-items: center; align-self: flex-start; border-radius: 11px; font-variant-numeric: tabular-nums; color: var(--text-2); }
.cal-d.now .cal-n { background: var(--accent); color: #fff; padding: 0 7px; }
.cal-d.past:not(.now) .cal-n { color: var(--text-3); }
.cal-drop { gap: 2px; min-height: 0; flex: 1; }
.cal-t { display: flex; align-items: center; gap: 5px; padding: 2px 5px; border-radius: 7px; font-size: 11.5px; line-height: 1.35; min-width: 0; cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.cal-t:hover { background: var(--fill-2); }
.cal-t i { width: 6px; height: 6px; border-radius: 3px; background: var(--c); flex: none; }
.cal-t span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cal-t b { font-weight: 650; color: var(--text-2); }
.cal-t.od span { color: #ff7b72; }
.cal-t.rep { opacity: .5; cursor: pointer; }
.cal-t.done { cursor: pointer; }
.cal-t.done span { color: var(--text-3); text-decoration: line-through; }
.cal-more { font-size: 11px; color: var(--text-3); padding: 0 5px; }
.task.rep { opacity: .55; }
.task.rep .check { border-style: dashed; }
@media (max-width: 760px) {
  .cal { padding: 6px; }
  .cal-g { gap: 2px; }
  .cal-wd { padding: 2px 0 4px; text-align: center; }
  .cal-d { min-height: 58px; padding: 4px 2px; align-items: center; border-radius: 11px; }
  .cal-n { align-self: center; }
  .cal-drop { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 3px; }
  .cal-t { padding: 0; }
  .cal-t span { display: none; }
  .cal-more { display: none; }
}
.drag-src { opacity: .3; box-shadow: none !important; outline: 1.5px dashed var(--line-2); outline-offset: -1.5px; }
.drag-ghost { position: fixed !important; z-index: 120; pointer-events: none; margin: 0 !important; animation: none !important; box-shadow: 0 30px 60px -14px rgba(0,0,0,.6), var(--inset-hi) !important; background: var(--solid-2) !important; transition: transform .06s linear; }

/* Строка задачи в руке и плитки-цели снизу */
.task[data-drag] { -webkit-touch-callout: none; }
.task.drag-src { border-radius: 12px; }
.drag-ghost.row-ghost { border-radius: 16px; border: 0 !important; padding: 11px 14px; outline: 1px solid var(--line-2); outline-offset: -1px; }
.row-ghost .swipe-bg, .row-ghost .task-act, .row-ghost .task-notes { display: none; }
.row-ghost .task-in { transform: none; }

.dock {
  position: fixed; z-index: 110; left: var(--dock-x, 50%); bottom: calc(env(safe-area-inset-bottom) + 26px);
  transform: translateX(-50%); display: flex; gap: 12px; pointer-events: none;
}
.dock-t {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; min-width: 196px;
  padding: 13px 20px 13px 13px; border-radius: 22px;
  opacity: 0; transform: translateY(30px) scale(.94);
  transition: transform .5s var(--spring), opacity .25s, box-shadow .25s, background .25s;
  transition-delay: calc(var(--i, 0) * 50ms);
}
.dock.on .dock-t { opacity: 1; transform: none; }
.dock.off .dock-t { opacity: 0; transform: translateY(22px) scale(.95); transition-duration: .24s; transition-delay: 0s; }
.dock-ic {
  flex: none; width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center;
  color: var(--tc); background: color-mix(in srgb, var(--tc) 18%, transparent);
  transition: transform .4s var(--spring), background .25s, color .25s;
}
.dock-tx { display: flex; flex-direction: column; gap: 3px; line-height: 1.2; min-width: 0; }
.dock-tx b { font-size: 14px; font-weight: 650; white-space: nowrap; }
.dock-tx small { font-size: 12px; color: var(--text-2); white-space: nowrap; }
.dock.on .dock-t.over {
  transform: translateY(-8px) scale(1.06); transition-delay: 0s;
  background: color-mix(in srgb, var(--tc) 16%, var(--glass-strong));
  box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--tc) 75%, transparent), 0 22px 48px -14px color-mix(in srgb, var(--tc) 65%, transparent), var(--inset-hi);
}
.dock-t.over .dock-ic { background: var(--tc); color: #fff; transform: scale(1.1) rotate(-8deg); }
.dock.on .dock-t.took { transform: scale(.96); transition-delay: 0s; background: color-mix(in srgb, var(--tc) 22%, var(--glass-strong)); }
.dock-t.took .dock-ic { background: var(--tc); color: #fff; transform: scale(1.18); }
.tabbar { transition: transform .35s var(--ease), opacity .25s; }
html.docking .tabbar, html.docking .fab { transform: translateY(140%); opacity: 0; pointer-events: none; }

/* ==========================================================================
   Обзор
   ========================================================================== */
.rings-wrap { display: flex; align-items: center; gap: 26px; justify-content: center; padding: 6px 0 4px; }
.rings { flex: none; overflow: visible; }
.ring-arc { transition: stroke-dashoffset 1s var(--ease); animation: ringIn 1.3s var(--ease-out) both; filter: drop-shadow(0 0 6px color-mix(in srgb, currentColor 0%, transparent)); }
/* Тень от конца следующего круга на кольцо под ним — поворачивается вместе с концом дуги */
.ring-shadow { opacity: .85; transition: transform 1s var(--ease); }
@keyframes lapSpin { from { transform: rotate(0deg); opacity: 0; } 6% { opacity: .85; } }
@keyframes ringIn { from { stroke-dashoffset: var(--c); } }
.legend-v { display: flex; flex-direction: column; gap: 12px; }
.lv { padding-left: 11px; border-left: 3px solid var(--c); }
.lv span { display: block; font-size: 11.5px; color: var(--text-2); }
.lv b { font-size: 19px; font-weight: 650; letter-spacing: -.01em; }
.lv b small { font-size: 12px; color: var(--text-2); font-weight: 500; }
.rings-wrap.rich { justify-content: flex-start; gap: 28px; padding: 4px 4px 2px; }
.rings-wrap.rich svg.rings { flex: none; }
.legend-r { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.lr-t { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.lr-t span { font-size: 12.5px; color: var(--text-2); font-weight: 560; }
.lr-t b { font-size: 18px; font-weight: 650; letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lr-t b small { font-size: 12px; color: var(--text-2); font-weight: 500; }
.lr .bar { height: 6px; }
.lr > small { display: block; font-size: 11.5px; color: var(--text-3); margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@container w (max-width: 420px) { .rings-wrap.rich { gap: 16px; } .rings-wrap.rich svg.rings { width: 120px; height: 120px; } }

.focus-w { display: flex; align-items: center; gap: 18px; }
.dial { position: relative; width: 112px; height: 112px; flex: none; display: grid; place-items: center; }
.dial svg { position: absolute; inset: 0; }
.dial .t { font-size: 24px; font-weight: 640; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.dial .s { font-size: 11px; color: var(--text-2); margin-top: -2px; }
.dial-c { text-align: center; position: relative; }
.dial circle.arc { transition: stroke-dashoffset 1s linear; }
.focus-side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.focus-today { margin-top: 14px; padding: 11px 13px; border-radius: 16px; background: var(--fill-1); border: 1px solid var(--line); }
.focus-today .row { font-size: 12.5px; margin-bottom: 7px; }

.next-hero { padding: 14px 15px; border-radius: 18px; background: linear-gradient(160deg, rgba(var(--accent-rgb), .3), rgba(var(--accent-rgb), .1)); border: 1px solid rgba(var(--accent-rgb), .3); margin-bottom: 10px; box-shadow: var(--inset-hi); }
.next-hero .in { font-size: 12px; color: var(--text-2); }
.next-hero .in b { color: var(--text); }
.next-hero h4 { font-size: 16px; margin: 3px 0 2px; }
.next-hero .when { font-size: 12.5px; color: var(--text-2); }
.timeline { display: flex; flex-direction: column; gap: 2px; }
.tl { display: flex; align-items: center; gap: 10px; padding: 8px 2px 8px 0; font-size: 13.5px; font-weight: 550; cursor: pointer; }
.tl::before { content: ""; width: 3px; height: 18px; border-radius: 2px; background: var(--c, var(--accent)); flex: none; }
.tl .time { margin-left: auto; color: var(--text-2); font-size: 12.5px; font-weight: 500; font-variant-numeric: tabular-nums; }
.tl .d { color: var(--text-3); font-size: 11.5px; font-weight: 500; }

/* Столбики */
.bars { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 6px; align-items: end; height: var(--bh, 150px); }
.bcol { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; min-width: 0; cursor: default; }
.btrack { position: relative; flex: 1; width: 100%; max-width: 46px; border-radius: 12px; background: var(--track); display: flex; align-items: flex-end; justify-content: center; overflow: hidden; transition: background .2s; }
.bcol:hover .btrack { background: var(--fill-2); }
.bfill { width: 100%; height: var(--h); min-height: 3px; border-radius: 10px 10px 4px 4px; background: linear-gradient(180deg, color-mix(in srgb, var(--bc, var(--accent)) 82%, white), var(--bc, var(--accent))); transition: height .8s var(--ease); transform-origin: bottom; animation: barIn .9s var(--ease-out) both; animation-delay: calc(var(--i) * 45ms); opacity: .9; }
.bcol.hl .bfill { opacity: 1; box-shadow: 0 0 18px -2px color-mix(in srgb, var(--bc, var(--accent)) 70%, transparent); }
.bcol.zero .bfill { opacity: .35; }
.bcol.fut .bfill { display: none; }
@keyframes barIn { from { transform: scaleY(0); } }
.bcol > span { font-size: 11px; color: var(--text-3); font-weight: 500; white-space: nowrap; }
.bcol.hl > span { color: var(--text); font-weight: 650; }
.goal-line { position: absolute; left: 0; right: 0; height: 1px; background: var(--line-2); }

/* Пара столбиков (доходы/расходы) */
.pbars { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 10px; height: 170px; align-items: end; }
.pcol { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.pcol .pp { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.pcol .pf { width: min(18px, 40%); height: var(--h); min-height: 2px; border-radius: 4px 4px 0 0; background: var(--bc); transform-origin: bottom; animation: barIn .9s var(--ease-out) both; animation-delay: calc(var(--i) * 50ms); transition: height .8s var(--ease), filter .2s; }
.pcol .pf:hover { filter: brightness(1.2); }
.pcol > span { font-size: 11px; color: var(--text-3); }
.pcol.hl > span { color: var(--text); font-weight: 650; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.legend .k { display: inline-flex; align-items: center; gap: 6px; }
.legend .k i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }

/* Донат */
.donut-wrap { display: flex; align-items: center; gap: 22px; }
.donut { position: relative; flex: none; }
.donut svg { display: block; overflow: visible; }
.donut .seg-arc { transition: stroke-dasharray .8s var(--ease), stroke-dashoffset .8s var(--ease), opacity .2s; animation: donutIn 1.1s var(--ease-out) both; }
.donut .seg-arc:hover { opacity: .8; }
@keyframes donutIn { from { stroke-dasharray: 0 999; } }
.donut-c { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; pointer-events: none; }
.donut-c b { display: block; font-size: 22px; font-weight: 680; letter-spacing: -.02em; }
.donut-c span { font-size: 11.5px; color: var(--text-2); }
.legend-l { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.ll { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.ll i { width: 9px; height: 9px; border-radius: 3px; background: var(--c); flex: none; }
.ll .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ll .v { font-variant-numeric: tabular-nums; font-weight: 600; }
.ll .p { width: 40px; text-align: right; color: var(--text-3); font-variant-numeric: tabular-nums; font-size: 12px; }

/* Линия/область */
.linechart { width: 100%; height: auto; display: block; overflow: visible; }
.linechart .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; animation: draw 1.4s var(--ease-out) both; }
.linechart .ar { animation: fadeIn 1s .3s both; }
.linechart .hit { fill: transparent; }
.linechart .hit:hover { fill: var(--fill-1); }
.linechart .gl { stroke: var(--line); stroke-width: 1; }
.linechart text { fill: var(--text-3); font-size: 10px; font-family: var(--font); }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

/* Полоса долей и слоёные столбики */
.sbar { display: flex; gap: 2px; border-radius: 7px; overflow: hidden; background: var(--track); }
.sbar i { display: block; min-width: 3px; background: var(--c); transition: flex-grow .7s var(--ease); animation: fadeIn .6s both; }
.scols { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 4px; align-items: stretch; }
.scol { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.sst { flex: 1; width: 100%; max-width: 24px; display: flex; flex-direction: column-reverse; gap: 2px; border-radius: 6px 6px 3px 3px; background: var(--track); overflow: hidden; transform-origin: bottom; animation: barIn .9s var(--ease-out) both; animation-delay: calc(var(--i) * 25ms); }
.sst i { display: block; width: 100%; background: var(--c); transition: height .7s var(--ease); flex: none; }
.scol > span { font-size: 10.5px; color: var(--text-3); white-space: nowrap; }
.scol.hl > span { color: var(--text); font-weight: 650; }
.scol:hover .sst { background: var(--fill-2); }
.app-row { display: flex; align-items: center; gap: 11px; padding: 8px 0; border-bottom: 1px solid var(--line); animation: rowIn .35s var(--ease) both; animation-delay: calc(var(--j, 0) * 18ms); }
.app-row:last-child { border-bottom: 0; }
.app-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--fill-2); color: var(--text-2); font-weight: 700; font-size: 13px; }
.app-row .nm { font-size: 13.5px; font-weight: 580; }
.app-row .bar { margin-top: 5px; height: 4px; }
.app-row .tm { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cat-chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px 0 7px; border-radius: 11px; font-size: 11.5px; font-weight: 600; color: var(--text); background: color-mix(in srgb, var(--c) 20%, transparent); white-space: nowrap; cursor: pointer; transition: background .2s; }
.cat-chip:hover { background: color-mix(in srgb, var(--c) 32%, transparent); }
.cat-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.privacy { display: flex; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--fill-1); border: 1px solid var(--line); font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.privacy .ic { color: var(--good); margin-top: 1px; }
.privacy.warn { margin: 4px 0 8px; border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); background: color-mix(in srgb, var(--warn) 10%, var(--fill-1)); }
.privacy.warn .ic { color: var(--warn); }
.privacy a { color: var(--accent); }
.privacy button.link { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; cursor: pointer; }

/* Резервные копии */
.bk-list { display: flex; flex-direction: column; max-height: 52vh; overflow: auto; margin: 0 -4px; padding: 0 4px; }
.bk-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.bk-row:last-child { border-bottom: 0; }
.bk-row .set-t { flex: 1; min-width: 0; }
.bk-row .set-t b, .bk-row .set-t span { display: block; }

/* Экран «данные не прочитались» */
.recovering .rail, .recovering .tabbar, .recovering .fab { display: none; }
.recovering .main { padding: 4px 16px 64px; }
.recovery { max-width: 620px; margin: 8vh auto 0; padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.recovery h1 { font-size: 22px; margin: 0; }
.recovery p { margin: 0; color: var(--text-2); line-height: 1.5; }
.recovery .rc-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.recovery .rc-actions { gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.recovery .rc-err { font-size: 12px; color: var(--text-3); }
.recovery .rc-err code { display: block; margin-top: 6px; white-space: pre-wrap; word-break: break-all; }

/* Тепловая карта */
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 3px; overflow-x: auto; padding-bottom: 2px; }
.heat i { width: 13px; height: 13px; border-radius: 4px; background: var(--track); animation: fadeIn .5s both; animation-delay: calc(var(--i) * 4ms); }
.heat i[data-l="1"] { background: rgba(var(--accent-rgb), .25); }
.heat i[data-l="2"] { background: rgba(var(--accent-rgb), .45); }
.heat i[data-l="3"] { background: rgba(var(--accent-rgb), .7); }
.heat i[data-l="4"] { background: var(--accent); }
.heat i.fut { background: transparent; }
.heat-leg { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-3); margin-top: 8px; justify-content: flex-end; }
.heat-leg i { width: 10px; height: 10px; border-radius: 3px; }

/* Мини-строки (проекты, цели, привычки на обзоре) */
.mini { display: flex; flex-direction: column; gap: 12px; }
.mini-i { display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.mini-i .row { font-size: 13px; font-weight: 550; }
.mini-i .row .r { margin-left: auto; color: var(--text-2); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.habit-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.hpill { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 13px 0 10px; border-radius: 18px; background: var(--fill-1); border: 1px solid var(--line); font-size: 13px; font-weight: 550; transition: background .25s, border-color .25s, transform .3s var(--spring); }
.hpill:active { transform: scale(.94); }
.hpill.on { background: color-mix(in srgb, var(--c) 22%, transparent); border-color: color-mix(in srgb, var(--c) 50%, transparent); }
.hpill .e { font-size: 16px; }
.hpill .st { font-size: 11px; color: var(--text-3); font-weight: 600; }
.hpill.on .st { color: var(--text-2); }

/* ==========================================================================
   Проекты
   ========================================================================== */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--gap); }
.pcard { padding: 18px; cursor: pointer; transition: transform .35s var(--spring); display: flex; flex-direction: column; gap: 14px; }
.pcard:hover { transform: translateY(-2px); }
.pcard:active { transform: scale(.985); }
.cat-block + .cat-block { margin-top: 26px; }
.cat-h { display: flex; align-items: center; gap: 8px; margin: 0 2px 12px; min-height: 36px; }
.cat-name { display: inline-flex; align-items: center; gap: 10px; min-width: 0; color: var(--text); }
.cat-name h2 { font-size: 19px; font-weight: 700; letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-name .dot { width: 10px; height: 10px; }
.cat-name .n { font-size: 12px; color: var(--text-3); background: var(--fill-2); padding: 1px 8px; border-radius: 10px; font-weight: 600; }
a.cat-name:hover h2 { color: var(--accent-hi); }
.pcard.padd { align-items: center; justify-content: center; gap: 10px; min-height: 150px; color: var(--text-3); font-size: 13px; background: transparent; border: 1.5px dashed var(--line-2); border-radius: var(--r-card, 24px); text-align: center; }
.pcard.padd:hover { color: var(--text); background: var(--fill-1); }
.tag em { font-style: normal; opacity: .62; }
.inbox-strip { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 20px; margin-bottom: 22px; color: var(--text); }
.inbox-strip:hover { background: var(--fill-2); }
.inbox-strip .ib-ic { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: rgba(var(--accent-rgb), .16); color: var(--accent-hi); flex: none; }
.inbox-strip b { display: block; font-size: 14.5px; }
.inbox-strip small { display: block; font-size: 12.5px; color: var(--text-2); margin-top: 1px; }
.inbox-strip .ib-n { font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; }
.inbox-strip > .ic:last-child { color: var(--text-3); }
.inbox-strip.due .ib-ic { background: rgba(255, 159, 64, .18); color: #ffb35c; }
.inbox-strip.due small { color: #ffb35c; }
.inbox-hint { margin-bottom: 14px; }
.pc-head { display: flex; align-items: center; gap: 10px; }
.pc-head .nm { font-size: 15px; font-weight: 650; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-body { display: flex; align-items: center; gap: 16px; }
.pc-ring { position: relative; width: 74px; height: 74px; flex: none; }
.pc-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 16px; font-weight: 680; }
.pc-stats { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--text-2); min-width: 0; }
.pc-stats b { color: var(--text); font-weight: 600; }
.stack { display: flex; height: 6px; border-radius: 3px; overflow: hidden; gap: 2px; background: var(--track); }
.stack i { height: 100%; background: var(--c); transition: flex-grow .6s var(--ease); }
.pc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--text-2); }
.pboard { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 10px; }
.pk { padding: 12px 13px; border-radius: 16px; background: var(--card-2); border: 1px solid var(--line); cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; animation: rowIn .35s var(--ease) both; box-shadow: var(--inset-hi); }
.pk .row { font-weight: 600; font-size: 13.5px; }
.pk .bar { margin-top: 10px; height: 4px; }
.pk .sub { margin-top: 7px; font-size: 11.5px; color: var(--text-2); display: flex; justify-content: space-between; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.sw { width: 30px; height: 30px; border-radius: 50%; background: var(--c); display: grid; place-items: center; color: #fff; transition: transform .3s var(--spring), box-shadow .2s; box-shadow: 0 4px 12px -4px var(--c); }
.sw:hover { transform: scale(1.1); }
.sw.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--c); }
.sw .ic { opacity: 0; transform: scale(.5); transition: all .25s var(--spring); }
.sw.on .ic { opacity: 1; transform: none; }

/* ==========================================================================
   Финансы
   ========================================================================== */
.accounts { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); gap: 12px; overflow-x: auto; padding: 2px 2px 6px; margin: 0 -2px; scrollbar-width: none; }
.accounts::-webkit-scrollbar { display: none; }
.acc {
  position: relative; padding: 14px 15px; border-radius: 20px; min-height: 112px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; cursor: pointer;
  background: linear-gradient(150deg, color-mix(in srgb, var(--c) 55%, #000 0%), color-mix(in srgb, var(--c) 70%, #000 30%));
  color: #fff; box-shadow: 0 14px 30px -18px var(--c), inset 0 1px 0 rgba(255,255,255,.25); transition: transform .35s var(--spring);
}
.acc::after { content: ""; position: absolute; right: -30px; top: -40px; width: 130px; height: 130px; border-radius: 50%; background: rgba(255,255,255,.12); }
.acc:hover { transform: translateY(-2px) rotate(-.4deg); }
.acc .nm { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; opacity: .92; }
.acc .bal { font-size: 21px; font-weight: 680; letter-spacing: -.02em; }
.acc .tp { font-size: 11px; opacity: .7; }
.acc.add { background: var(--fill-1); color: var(--text-2); border: 1.5px dashed var(--line-2); box-shadow: none; align-items: center; justify-content: center; gap: 6px; font-weight: 600; }
.acc.add::after { display: none; }
.budget-row { display: flex; flex-direction: column; gap: 6px; padding: 9px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.budget-row:last-child { border-bottom: 0; }
.budget-row .row { font-size: 13px; font-weight: 550; }
.budget-row .r { margin-left: auto; font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.budget-row .r b { color: var(--text); }
.budget-row .left { font-size: 11.5px; color: var(--text-3); display: inline-flex; align-items: center; gap: 4px; }
.budget-row .left.over { color: #ff7b72; }
.cat-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; color: #fff; background: var(--c); box-shadow: inset 0 1px 0 rgba(255,255,255,.25); }
.cat-ic .ic { width: 17px; height: 17px; }
.cat-ic.sm { width: 26px; height: 26px; border-radius: 8px; }
.cat-ic.sm .ic { width: 14px; height: 14px; }
.tx-day { font-size: 12px; font-weight: 600; color: var(--text-2); padding: 14px 2px 6px; display: flex; justify-content: space-between; }
.tx-day:first-child { padding-top: 0; }
.tx { display: flex; align-items: center; gap: 12px; padding: 8px 2px; cursor: pointer; border-radius: 12px; animation: rowIn .35s var(--ease) both; animation-delay: calc(var(--j, 0) * 15ms); }
.tx:hover { background: var(--fill-1); }
.tx .nm { font-size: 13.5px; font-weight: 550; }
.tx .sb { font-size: 11.5px; color: var(--text-3); }
.tx .amt { margin-left: auto; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tx .amt.in { color: #34c759; }
[data-theme="light"] .tx .amt.in { color: #1a8f3a; }
.tx .amt.tr { color: var(--text-2); }
.goal { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.goal:last-child { border-bottom: 0; }
.goal .gr { position: relative; width: 58px; height: 58px; flex: none; display: grid; place-items: center; }
.goal .gr svg { position: absolute; inset: 0; }
.goal .gr .ic { width: 20px; height: 20px; }
.goal .gi { flex: 1; min-width: 0; cursor: pointer; }
.goal .gi b { font-size: 14px; font-weight: 620; }
.goal .gi .s { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.goal .gi .s2 { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.month-sw { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 19px; background: var(--fill-1); border: 1px solid var(--line); }
.month-sw span { min-width: 120px; text-align: center; font-weight: 600; font-size: 13px; }
.month-sw .icon-btn { width: 30px; height: 30px; }
.amount-in { width: 100%; border: 0; background: transparent; outline: none; font-size: 40px; font-weight: 680; letter-spacing: -.03em; text-align: center; padding: 8px 0; color: var(--text); }
.amount-in::placeholder { color: var(--text-3); }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.cat-opt { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border-radius: 16px; font-size: 11.5px; font-weight: 550; color: var(--text-2); border: 1px solid transparent; transition: background .2s, border-color .2s, transform .25s var(--spring); text-align: center; line-height: 1.2; }
.cat-opt:hover { background: var(--fill-1); }
.cat-opt.on { background: color-mix(in srgb, var(--c) 16%, transparent); border-color: color-mix(in srgb, var(--c) 45%, transparent); color: var(--text); }
.cat-opt:active { transform: scale(.94); }

/* Долги и стратегия */
.plan-in { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.plan-in .field { flex: 1; min-width: 220px; }
.plan-in .input { height: 40px; font-size: 15px; font-weight: 600; border-radius: 13px; }
.cmp { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.cmp-r { position: relative; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: center; padding: 12px 14px; border-radius: 16px; background: var(--fill-1); border: 1px solid var(--line); animation: rowIn .4s var(--ease) both; }
.cmp-r.best { background: rgba(var(--accent-rgb), .13); border-color: rgba(var(--accent-rgb), .45); }
.cmp-r b { display: block; font-size: 14px; font-weight: 650; }
.cmp-r span { display: block; font-size: 11.5px; color: var(--text-2); margin-top: 1px; }
.cmp-v { text-align: right; font-variant-numeric: tabular-nums; }
.cmp-r span.cmp-note { color: var(--accent-hi); margin-top: 3px; font-weight: 550; }
.cmp-badge { position: absolute; top: -9px; right: 12px; display: inline-flex !important; align-items: center; gap: 4px; height: 19px; padding: 0 8px; border-radius: 10px; background: var(--accent); color: #fff !important; font-size: 10.5px !important; font-weight: 700; margin: 0 !important; }
.advice { display: flex; gap: 12px; margin-top: 14px; padding: 13px 15px; border-radius: 16px; background: linear-gradient(160deg, rgba(var(--accent-rgb), .16), rgba(var(--accent-rgb), .05)); border: 1px solid rgba(var(--accent-rgb), .25); font-size: 13.5px; line-height: 1.5; }
.advice .ic { color: var(--accent-hi); flex: none; margin-top: 1px; }
[data-theme="light"] .advice .ic { color: var(--accent); }
.advice b { font-weight: 700; }
.todo-plan { display: flex; flex-direction: column; gap: 2px; }
.tp { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 13.5px; border-bottom: 1px solid var(--line); }
.tp:last-child { border-bottom: 0; }
.tp-ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--c); color: #fff; flex: none; }
.tp-x { color: var(--accent-hi); font-size: 12px; font-weight: 600; }
[data-theme="light"] .tp-x { color: var(--accent); }
.ords { display: flex; flex-direction: column; gap: 6px; }
.ord { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.ord-n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--fill-2); font-size: 11.5px; font-weight: 700; flex: none; }
.debt { padding: 12px 0; border-bottom: 1px solid var(--line); }
.debt:last-of-type { border-bottom: 0; }
.debt b { font-size: 14px; font-weight: 620; }
.debt-warn { color: #ff7b72; display: inline-flex; align-items: center; gap: 4px; }
.plan-seg { max-width: 100%; }
@media (max-width: 760px) { .plan-seg { display: flex; } .plan-seg button { flex: 1; justify-content: center; padding: 0 8px; min-width: 0; } .plan-seg button .ic { display: none; } .cmp-r { grid-template-columns: 1fr 1fr; } .cmp-n { grid-column: 1 / -1; } .cmp-v { text-align: left; } }

/* ==========================================================================
   Активность
   ========================================================================== */
.steps-big { display: flex; align-items: center; gap: 22px; }
.ring-c { position: relative; flex: none; display: grid; place-items: center; }
.ring-c svg { position: absolute; inset: 0; }
.ring-c .in { text-align: center; position: relative; }
.ring-c .in b { display: block; font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.ring-c .in span { font-size: 11.5px; color: var(--text-2); }
.quick-add { display: flex; flex-wrap: wrap; gap: 6px; }
.habit { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.habit:last-child { border-bottom: 0; }
.habit .e { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; background: color-mix(in srgb, var(--c) 18%, transparent); flex: none; cursor: pointer; }
.habit .nm { font-size: 13.5px; font-weight: 580; }
.habit .st { font-size: 11.5px; color: var(--text-3); display: flex; align-items: center; gap: 3px; }
.habit .st .ic { width: 12px; height: 12px; color: var(--serious); }
.hdays { display: flex; gap: 5px; margin-left: auto; }
.hd { width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; font-size: 10px; font-weight: 600; color: var(--text-3); background: var(--fill-1); border: 1px solid var(--line); transition: background .25s, transform .3s var(--spring), color .2s; }
.hd:active { transform: scale(.85); }
.hd.on { background: var(--c); color: #fff; border-color: transparent; box-shadow: 0 4px 12px -5px var(--c); }
.hd.td { outline: 1.5px solid var(--line-2); outline-offset: 1px; }
.stepper { display: inline-flex; align-items: center; gap: 4px; }
.stepper .v { min-width: 66px; text-align: center; font-size: 22px; font-weight: 680; letter-spacing: -.02em; }
.stepper .v small { font-size: 12px; font-weight: 500; color: var(--text-2); margin-left: 2px; }
.stepper .icon-btn { background: var(--fill-2); width: 38px; height: 38px; }
.water { display: flex; gap: 5px; flex-wrap: wrap; }
.glassw { width: 22px; height: 30px; border-radius: 5px 5px 8px 8px; border: 1.5px solid var(--line-2); position: relative; overflow: hidden; transition: transform .3s var(--spring); }
.glassw::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: linear-gradient(180deg, #6fd3ff, #2a8cff); transition: height .45s var(--spring); }
.glassw.on::after { height: 78%; }
.glassw:active { transform: scale(.9); }
.wk { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.wk:last-child { border-bottom: 0; }
.wk .wi { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: rgba(var(--accent-rgb), .16); color: var(--accent-hi); flex: none; }
[data-theme="light"] .wk .wi { color: var(--accent); }

/* ==========================================================================
   Настройки
   ========================================================================== */
/* Настройки по категориям: список слева, как в «Системных настройках» macOS */
.set-split { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: var(--gap); align-items: start; }
.set-nav { position: sticky; top: 16px; padding: 8px; border-radius: 22px; display: flex; flex-direction: column; gap: 1px; }
.set-nav-i { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px 0 7px; border-radius: 11px; font-size: 13.5px; color: var(--text); transition: background .15s; }
.set-nav-i:hover { background: var(--fill-1); }
.set-nav-i.on { background: rgba(var(--accent-rgb), .9); color: #fff; }
.set-nav-i .sq { width: 26px; height: 26px; border-radius: 7.5px; display: grid; place-items: center; background: var(--c); color: #fff; flex: none; box-shadow: inset 0 1px 0 rgba(255,255,255,.22); }
.set-nav-i .sq .ic { width: 15px; height: 15px; }
.set-nav-i > .ic:last-child { width: 13px; height: 13px; opacity: 0; color: var(--text-3); }
.set-nav-i .set-alert { width: 8px; height: 8px; border-radius: 4px; background: #ff5f57; flex: none; }
.set-nav-i.on .set-alert { background: #fff; }
.set-nav-sep { height: 1px; background: var(--line); margin: 6px 10px; }
.set-pane { min-width: 0; display: flex; flex-direction: column; gap: var(--gap); max-width: 820px; }
.set-back { display: none; }
@media (max-width: 760px) {
  .set-split { grid-template-columns: 1fr; }
  .set-split.picked .set-nav, .set-split:not(.picked) .set-pane { display: none; }
  .set-nav { position: static; padding: 6px; }
  .set-nav-i { height: 48px; font-size: 15px; }
  .set-nav-i .sq { width: 30px; height: 30px; border-radius: 8.5px; }
  .set-nav-i .sq .ic { width: 17px; height: 17px; }
  .set-nav-i.on { background: transparent; color: var(--text); }
  .set-nav-i.on .set-alert { background: #ff5f57; }
  .set-nav-i > .ic:last-child { opacity: 1; }
  .set-nav-sep { margin: 4px 10px 4px 50px; }
  .set-back { display: inline-flex; align-items: center; gap: 4px; color: var(--accent-hi); font-size: 15px; margin: -4px 0 -4px; }
}
.set-row { display: flex; align-items: center; gap: 13px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-row.flush { border-bottom: 0; padding-bottom: 6px; }
.set-row.child { padding-left: 26px; }
.set-row.child .set-ic { width: 28px; height: 28px; border-radius: 9px; }
.set-row.child .set-ic .ic { width: 15px; height: 15px; }
.set-row.dim { opacity: .45; }
.set-row.dim .switch { pointer-events: none; }
.hc-grid { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 0 4px; }
.hc { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 8px 0 11px; border-radius: 17px; font-size: 12.5px; font-weight: 600; color: var(--text-2); background: var(--fill-1); border: 1px solid var(--line); transition: background .2s, color .2s, border-color .2s, transform .25s var(--spring); }
.hc:active { transform: scale(.95); }
.hc.on { color: var(--text); background: rgba(var(--accent-rgb), .16); border-color: rgba(var(--accent-rgb), .4); }
.hc.blocked { opacity: .45; border-style: dashed; }
.hc-dot { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--fill-2); color: var(--text-3); }
.hc.on .hc-dot { background: var(--accent); color: #fff; }
.set-under { padding: 10px 0 18px 45px; border-bottom: 1px solid var(--line); }
.set-sub { display: flex; align-items: center; gap: 14px; padding: 4px 0 14px 45px; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--text-2); }
.set-sub .range { flex: 1; }
.set-sub b { min-width: 40px; text-align: right; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.range { -webkit-appearance: none; appearance: none; height: 28px; margin: 0; background: transparent; cursor: pointer; min-width: 0; }
.range:focus { outline: none; }
.range::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--accent) 0 var(--p, 50%), var(--fill-3) var(--p, 50%) 100%); }
.range::-moz-range-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--accent) 0 var(--p, 50%), var(--fill-3) var(--p, 50%) 100%); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35); transition: transform .25s var(--spring), box-shadow .2s; }
.range::-moz-range-thumb { width: 22px; height: 22px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.range:active::-webkit-slider-thumb, .range:focus-visible::-webkit-slider-thumb { transform: scale(1.12); box-shadow: 0 2px 8px rgba(0,0,0,.35), 0 0 0 6px rgba(var(--accent-rgb), .22); }
.set-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: #fff; flex: none; background: var(--c); box-shadow: inset 0 1px 0 rgba(255,255,255,.25); }
.set-ic .ic { width: 17px; height: 17px; }
.set-t { flex: 1; min-width: 0; }
.set-t b { display: block; font-size: 14px; font-weight: 600; }
.set-t span { display: block; font-size: 12px; color: var(--text-2); margin-top: 1px; }
.set-row .input { max-width: 220px; }
/* Здоровье: показатели */
.htabs a span { white-space: nowrap; }
.vpill { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 10px; font-size: 11px; font-weight: 640; color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent); white-space: nowrap; flex: none; }
.vrange { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 4px; font-size: 13px; color: var(--text-2); }
.vrange > span { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.vc-empty .link { font: inherit; }
.vcard.wide { grid-column: 1 / -1; }
.vc-chips { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.vc-chips .chip { height: 24px; font-size: 12px; padding: 0 9px; cursor: default; }
.vc-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 16px; margin-top: 4px; }
.vc-cap { font-size: 11.5px; color: var(--text-3); margin-bottom: 2px; }
.vd-filter { margin: 2px 0 8px; }
@media (max-width: 760px) { .vc-two { grid-template-columns: 1fr; } }
.vcard { padding: 16px 16px 12px; border-radius: var(--r-xl); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.vc-h { display: flex; align-items: center; gap: 10px; }
.vc-h .grow { min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.vc-h b { font-size: 14px; font-weight: 640; }
.vc-h span { font-size: 11.5px; color: var(--text-3); }
.vc-h .icon-btn { width: 30px; height: 30px; flex: none; }
.vc-ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: none; color: var(--c); background: color-mix(in srgb, var(--c) 17%, transparent); }
.icon-btn.accent-ic { color: var(--accent-hi); background: rgba(var(--accent-rgb), .14); }
.vc-v { display: flex; align-items: center; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.vc-v .hero { font-size: 30px; font-weight: 680; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.vc-when { font-size: 12px; color: var(--text-2); min-height: 16px; }
.vchart { margin-top: 4px; }
.vband { fill: var(--good); opacity: .08; }
.vc-empty { font-size: 12.5px; color: var(--text-3); padding: 22px 0 18px; text-align: center; }
.vc-foot { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-3); border-top: 1px solid var(--line); padding-top: 10px; margin-top: 2px; }
.vc-foot .ic { width: 12px; height: 12px; flex: none; }
.vplan { display: flex; flex-direction: column; }
.vp { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.vp:last-child { border-bottom: 0; }
.vp-t { width: 44px; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-2); flex: none; }
.vp-ic { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; flex: none; color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent); }
.vp .grow { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.vp .grow b { font-size: 13.5px; font-weight: 600; }
.vp .grow span { font-size: 11.5px; color: var(--text-3); }
.vp.done .vp-ic { color: #fff; background: var(--good); }
.vp.skipped .vp-ic { color: var(--text-2); background: var(--fill-2); }
.vp.skipped b { color: var(--text-2); }
.vp.late .grow span { color: var(--warn); }
.vp.now .vp-t { color: var(--accent-hi); }
.vp-val { font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; }
.vplan-empty { display: flex; gap: 12px; align-items: flex-start; font-size: 13px; color: var(--text-2); line-height: 1.45; }
.vplan-empty > .ic { flex: none; color: var(--text-3); margin-top: 2px; }
.vdiary { display: flex; flex-direction: column; gap: 4px; max-height: 760px; overflow-y: auto; margin: 0 -6px; padding: 0 6px; scrollbar-width: thin; }
.vd-day { display: flex; flex-direction: column; }
.vd-h { font-size: 11.5px; font-weight: 640; color: var(--text-2); padding: 12px 0 4px; }
.vd-day:first-child .vd-h { padding-top: 2px; }
.vd { display: flex; align-items: center; gap: 10px; padding: 8px 6px; margin: 0 -6px; border-radius: 10px; text-align: left; width: calc(100% + 12px); color: inherit; }
button.vd:hover { background: var(--fill-1); }
.vd-t { width: 40px; flex: none; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.vd-ic { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; flex: none; color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent); }
.vd-n { flex: 1; min-width: 0; font-size: 13px; font-weight: 560; display: flex; flex-direction: column; line-height: 1.25; }
.vd-n small, .vd-v small { font-size: 11px; font-weight: 450; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vd-v { display: flex; flex-direction: column; align-items: flex-end; font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.2; }
.vd-src { color: var(--text-3); display: grid; place-items: center; }
.vd-src .ic { width: 12px; height: 12px; }
.vnote { display: flex; align-items: flex-start; gap: 8px; margin: 18px 4px 0; font-size: 12px; color: var(--text-3); line-height: 1.45; }
.vnote .ic { flex: none; margin-top: 1px; }
.vtypes { margin: 2px 0 10px; }
.vtypes .chip .ic, .vctx .chip .ic { width: 13px; height: 13px; }
.vbp { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.vbp input { font-size: 22px !important; font-weight: 650; text-align: center; font-variant-numeric: tabular-nums; }
.vnum { padding-bottom: 0; }
.vunit { text-align: center; font-size: 13px; color: var(--text-3); margin-top: -2px; }
.vctx { justify-content: center; margin-top: 12px; }
.vfreq { margin-bottom: 4px; }
.vtimes { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.vtime { display: inline-flex; align-items: center; gap: 2px; padding: 3px 3px 3px 10px; border-radius: 12px; background: var(--fill-1); border: 1px solid var(--line); }
.vtime input { border: 0; background: transparent; color: var(--text); font: inherit; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; outline: none; width: 74px; }
.vtime input::-webkit-calendar-picker-indicator { display: none; }
.vtime .icon-btn { width: 26px; height: 26px; }
.vsetup .set-row .btn { flex: none; }
.vcustom { gap: 8px; flex-wrap: wrap; }
.vcustom .input:first-child { flex: 1; min-width: 160px; }

.hv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.hv { display: flex; flex-direction: column; gap: 4px; padding: 11px 12px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--line); box-shadow: var(--inset-hi); color: inherit; min-width: 0; }
.hv:hover { background: var(--fill-2); }
.hv-h { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.hv-h .ic { color: var(--c); }
.hv b { font-size: 22px; font-weight: 680; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hv b small { font-size: 11px; font-weight: 500; color: var(--text-3); margin-left: 4px; letter-spacing: 0; }
.hv .vpill { align-self: flex-start; }
.hv-when { font-size: 11.5px; color: var(--text-3); }

/* Здоровье: лекарства */
.mslots { display: flex; flex-direction: column; }
.ms { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ms:last-child { border-bottom: 0; }
.ms-t { width: 44px; flex: none; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-2); }
.ms-ic { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; flex: none; color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); }
.ms .grow { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.ms .grow b { font-size: 14px; font-weight: 600; }
.ms .grow span { font-size: 11.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms .grow em { font-style: normal; color: var(--warn); }
.ms.now .ms-t, .ms.late .ms-t { color: var(--accent-hi); }
.ms.taken .ms-ic { color: #fff; background: var(--good); }
.ms.skipped { opacity: .6; }
.ms-r { display: flex; align-items: center; gap: 4px; flex: none; }
.mstate { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 10px; font-size: 12px; font-weight: 600; color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); }
.mstate.skipped { color: var(--text-2); background: var(--fill-1); }
.mstate .ic { width: 12px; height: 12px; }
.mring { font-size: 15px; font-weight: 680; color: var(--good); font-variant-numeric: tabular-nums; }
.meds { display: flex; flex-direction: column; gap: 10px; }
.med { padding: 12px 14px; border-radius: 16px; background: var(--card-2); border: 1px solid var(--line); box-shadow: var(--inset-hi); display: flex; flex-direction: column; gap: 10px; }
.med.off { opacity: .55; }
.med-main { display: flex; align-items: center; gap: 12px; text-align: left; color: inherit; }
.med-ic { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; flex: none; color: var(--c); background: color-mix(in srgb, var(--c) 17%, transparent); }
.med-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.med-t b { font-size: 14px; font-weight: 640; }
.med-t b small { font-weight: 500; color: var(--text-2); font-size: 12.5px; margin-left: 4px; }
.med-t > span { font-size: 12px; color: var(--text-2); display: inline-flex; align-items: center; gap: 4px; }
.med-t > span .ic { width: 11px; height: 11px; color: var(--text-3); }
.med-course { font-size: 11.5px; color: var(--text-2); display: flex; flex-direction: column; gap: 6px; }
.med-course .bar { height: 5px; }
.med-foot { display: flex; align-items: center; gap: 8px; font-size: 12px; min-height: 22px; }
.med-stock { display: inline-flex; align-items: center; gap: 5px; color: var(--text-2); }
.med-stock .ic { width: 12px; height: 12px; }
.med-stock.low { color: var(--warn); font-weight: 600; }
.madh { display: grid; grid-template-columns: repeat(var(--n, 14), minmax(0, 1fr)); gap: 5px; margin-bottom: 8px; }
.madh-d { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 10px; color: var(--text-3); }
.madh-d i { width: 100%; height: 34px; border-radius: 7px; background: linear-gradient(to top, var(--good) var(--p), var(--fill-1) var(--p)); }
.madh-d.miss i { background: color-mix(in srgb, var(--warn) 30%, transparent); }
.madh-d.none i { background: var(--fill-1); opacity: .5; }
.madh-d.today i { outline: 1.5px solid rgba(var(--accent-rgb), .7); outline-offset: 1px; }
.mlog.skipped .vd-ic { color: var(--text-3); background: var(--fill-1); }
.mlog.taken .vd-ic { color: #fff; background: var(--good); }
.mlow { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; margin-bottom: var(--gap); border-radius: 16px; font-size: 13px; line-height: 1.45; color: var(--text); background: color-mix(in srgb, var(--warn) 14%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); }
.mlow > .ic { color: var(--warn); flex: none; margin-top: 1px; }
.mlow-r { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.mlow-r > span { min-width: 0; color: var(--text-2); }
.mlow.sm { margin: 10px 0 0; padding: 10px 12px; font-size: 12.5px; border-radius: 14px; }
.mlow.sm .mlow-r { margin-top: 6px; }
.rs-count { justify-content: flex-start; gap: 6px; }
.rs-count .v { min-width: 34px; text-align: center; font-size: 19px; }

/* Экранное время: Mac + iPhone */
.dev-split { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.dev-s { position: relative; display: flex; align-items: center; gap: 7px; height: 28px; padding: 0 10px; border-radius: 9px; font-size: 12.5px; color: var(--text-2); background: var(--fill-1); overflow: hidden; isolation: isolate; }
.dev-s i { position: absolute; inset: 0 auto 0 0; width: var(--w); background: rgba(var(--accent-rgb), .16); z-index: -1; border-radius: inherit; }
.dev-s b { margin-left: auto; color: var(--text); font-weight: 620; font-variant-numeric: tabular-nums; }
.dev-ic { display: inline-flex; gap: 3px; color: var(--text-3); flex: none; }
.dev-ic .ic { width: 12px; height: 12px; }

/* Apple Здоровье */
.hs-st { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; margin: 4px 0 6px; border-radius: 12px; font-size: 12.5px; line-height: 1.45; background: var(--fill-1); color: var(--text-2); }
.hs-st > .ic { flex: none; margin-top: 2px; color: var(--good); }
.hs-st.warn > .ic { color: var(--warn); }
.hs-guide { display: flex; flex-direction: column; gap: 14px; }
.hs-types { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 4px; }
.hs-link { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 11px 12px 11px 14px; border-radius: 14px; background: rgba(var(--accent-rgb), .1); border: 1px solid rgba(var(--accent-rgb), .25); }
.hs-link > .ic { color: var(--accent-hi); flex: none; }
.hs-link.wait { background: var(--fill-1); border-color: var(--line); }
.hs-link.wait > .ic { color: var(--text-2); }
.hs-link .grow { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.hs-link b { font-size: 13.5px; }
.hs-link span { font-size: 12px; color: var(--text-2); }
.hs-link .btn { flex: none; }
.hs-step { display: flex; gap: 12px; align-items: flex-start; }
.hs-n { width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; flex: none; font-size: 13px; font-weight: 700; color: var(--accent-hi); background: rgba(var(--accent-rgb), .14); }
.hs-step b { font-size: 14px; }
.hs-step p { margin: 3px 0 0; font-size: 13px; line-height: 1.5; color: var(--text-2); }
/* QR-код команды: белая подложка и в тёмной теме — так его читает камера */
.hs-qr { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin: -4px 0 2px 38px; }
.hs-qr-img { width: 148px; height: 148px; flex: none; display: grid; place-items: center; padding: 8px; border-radius: 16px; background: #fff; color: #6b6b70; font-size: 12px; line-height: 1.35; text-align: center; box-shadow: 0 0 0 1px var(--line); }
.hs-qr-img img { width: 100%; height: 100%; image-rendering: pixelated; }
.hs-qr-t { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; flex: 1 1 160px; font-size: 12.5px; line-height: 1.45; color: var(--text-2); }
.hs-qr-wait { flex-basis: 100%; font-size: 12px; color: var(--warn); }

/* Уведомления */
.set-sec { margin: 18px 0 2px; }
.notif-ctl { display: flex; align-items: center; gap: 10px; flex: none; }
.notif-ctl.off .input.time { opacity: .45; }
.input.time { width: 108px; padding: 0 8px 0 10px; font-variant-numeric: tabular-nums; }
.input.time::-webkit-calendar-picker-indicator { filter: invert(.6); cursor: pointer; }
[data-theme="light"] .input.time::-webkit-calendar-picker-indicator { filter: none; }
.notif-quiet { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); }
.lg-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.lg-bar .chip .n { font-size: 11px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.lg-list { display: flex; flex-direction: column; max-height: 62vh; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.lg-row { display: grid; grid-template-columns: 66px 104px minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; line-height: 1.45; }
.lg-t { color: var(--text-2); font-variant-numeric: tabular-nums; font-size: 12px; }
.lg-t small { display: block; font-size: 10.5px; color: var(--text-3); }
.lg-c { justify-self: start; padding: 1px 8px; border-radius: 8px; font-size: 11px; font-weight: 600; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); white-space: nowrap; }
.lg-m { color: var(--text); word-break: break-word; }
.lg-m em { margin-left: 6px; font-style: normal; font-size: 10.5px; color: var(--text-3); }
@media (max-width: 600px) { .lg-row { grid-template-columns: 56px minmax(0, 1fr); } .lg-c { grid-column: 2; grid-row: 1; } .lg-m { grid-column: 1 / -1; } }
.nx-list { display: flex; flex-direction: column; }
.nx { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.nx:last-child { border-bottom: 0; }
.nx-ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--fill-1); color: var(--text-2); }
.nx-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nx-t { flex: none; color: var(--text-2); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.nx-empty { font-size: 13px; color: var(--text-3); padding: 6px 0; }
.hab-rem { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hab-rem input[type="time"] { width: 112px; flex: none; }
.field-hint { display: block; margin-top: 6px; font-size: 12px; color: var(--text-3); line-height: 1.35; }
.hb-rem { display: inline-flex; align-items: center; gap: 3px; margin-left: 8px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.habit .st .hb-rem .ic { width: 11px; height: 11px; color: inherit; }
.switch { position: relative; width: 50px; height: 30px; border-radius: 15px; background: var(--fill-3); flex: none; transition: background .3s; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3); transition: transform .4s var(--spring); }
.switch.on { background: #30d158; }
.switch.on::after { transform: translateX(20px); }
.walls { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; padding: 4px 0 6px; }
.wall-o { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 550; color: var(--text-2); }
.wall-o.on { color: var(--text); }
.wthumb {
  position: relative; width: 100%; aspect-ratio: 1.35; border-radius: 14px; overflow: hidden;
  background: radial-gradient(60% 70% at 15% 10%, var(--b1), transparent), radial-gradient(60% 70% at 95% 40%, var(--b2), transparent), radial-gradient(70% 60% at 40% 110%, var(--b3), transparent), var(--wb);
  border: 1px solid var(--line); transition: transform .35s var(--spring), box-shadow .25s;
}
.wall-o:hover .wthumb { transform: scale(1.04); }
.wall-o.on .wthumb { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.wthumb i { position: absolute; border-radius: 5px; border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.06); }
[data-theme="light"] .wthumb i { border-color: rgba(0,0,0,.18); background: rgba(255,255,255,.4); }
.wthumb i:nth-child(1) { left: 9%; top: 14%; width: 14%; bottom: 14%; }
.wthumb i:nth-child(2) { left: 30%; top: 14%; right: 9%; height: 36%; }
.wthumb i:nth-child(3) { left: 30%; top: 58%; width: 32%; height: 14%; }
.wthumb .ok { position: absolute; right: 6px; bottom: 6px; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; color: #fff; transform: scale(0); transition: transform .35s var(--spring); }
.wall-o.on .wthumb .ok { transform: scale(1); }
.wthumb .ok .ic { width: 12px; height: 12px; }
.accents { display: flex; gap: 12px; flex-wrap: wrap; }
.acc-o { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--c); box-shadow: 0 6px 16px -6px var(--c); transition: transform .3s var(--spring), box-shadow .2s; }
.acc-o:hover { transform: scale(1.1); }
.acc-o.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--c); }
.acc-o .ic { opacity: 0; transform: scale(.4); transition: all .3s var(--spring); }
.acc-o.on .ic { opacity: 1; transform: none; }
.kbd-list { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: 13px; align-items: center; }
kbd { font: 600 11.5px var(--font); padding: 3px 7px; border-radius: 7px; background: var(--fill-2); border: 1px solid var(--line); color: var(--text-2); justify-self: start; white-space: nowrap; }

/* ==========================================================================
   Шторки / модальные окна
   ========================================================================== */
.sheet-wrap { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 24px; }
.sheet-wrap.top { align-items: flex-start; padding-top: max(10vh, 60px); }
.sheet-backdrop { position: absolute; inset: 0; background: var(--scrim); opacity: 0; transition: opacity .3s; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); touch-action: none; }
.sheet {
  position: relative; width: min(560px, 100%); max-height: min(88dvh, 860px); overflow-y: auto; overscroll-behavior: contain;
  padding: 20px; border-radius: 28px; background: var(--glass-strong);
  transform: translateY(18px) scale(.965); opacity: 0; transition: transform .5s var(--spring), opacity .25s;
  scrollbar-width: none;
}
.sheet::-webkit-scrollbar { display: none; }
.sheet-wrap.wide .sheet { width: min(720px, 100%); }
.sheet-wrap.sm .sheet { width: min(400px, 100%); }
.sheet-wrap.open .sheet { transform: none; opacity: 1; }
.sheet-wrap.open .sheet-backdrop { opacity: 1; }
.sheet-wrap.closing .sheet { transform: translateY(12px) scale(.97); opacity: 0; transition: transform .25s var(--ease), opacity .2s; }
.sheet-grip { display: none; width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); margin: -8px auto 12px; }
.sheet-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.sheet-h h3 { font-size: 18px; font-weight: 680; letter-spacing: -.01em; }
.sheet-foot { display: flex; align-items: center; gap: 8px; margin-top: 18px; }
.sheet-foot .grow { flex: 1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 12px; color: var(--text-2); font-weight: 550; }
.field input, .field select, .field textarea {
  height: 40px; border-radius: 13px; padding: 0 12px; background: var(--fill-1); border: 1px solid var(--line); outline: none; font-size: 14px; color: var(--text); width: 100%; transition: border-color .2s, background .2s; min-width: 0;
}
.field select { appearance: none; -webkit-appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.field textarea { height: auto; min-height: 80px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fields .full { grid-column: 1 / -1; }
input[type="date"], input[type="time"] { -webkit-appearance: none; appearance: none; }
input[type="date"]::-webkit-calendar-picker-indicator, input[type="time"]::-webkit-calendar-picker-indicator { opacity: .5; cursor: pointer; }
[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator, [data-theme="dark"] input[type="time"]::-webkit-calendar-picker-indicator { filter: invert(1); }
/* Пустое поле времени — словами («Без времени»), а не серым «12:30», как рисует WebKit (timeIn в ui/parts.js) */
.time-in { position: relative; display: flex; min-width: 0; }
.field > .time-in, .field > .date-in { font-size: inherit; font-weight: inherit; color: inherit; }
.time-in > input { flex: 1; }
.time-in > i { display: none; position: absolute; inset: 0; align-items: center; padding: 0 13px; font-style: normal; font-size: 14px; color: var(--text-3); pointer-events: none; white-space: nowrap; overflow: hidden; }
.time-in > input[data-empty]:not(:focus)::-webkit-datetime-edit { opacity: 0; }
.time-in > input[data-empty]:not(:focus) + i { display: flex; }
.ts-hours .time-in { flex: 1; }

/* Поле даты со своим календарём (dateIn в ui/parts.js, ui/datepick.js) */
.date-in { position: relative; display: flex; min-width: 0; }
.date-in > .date-show { flex: 1; cursor: pointer; padding-right: 36px; caret-color: transparent; text-overflow: ellipsis; -webkit-user-select: none; user-select: none; }
.date-in > .ic { position: absolute; right: 13px; top: 50%; translate: 0 -50%; color: var(--text-3); pointer-events: none; transition: color .2s; }
.date-in.open > .date-show { border-color: rgba(var(--accent-rgb), .6); background: var(--fill-2); }
.date-in.open > .ic, .date-in:hover > .ic { color: var(--text-2); }
.qa-row .date-in > .date-show { width: 140px; }

.dp { position: fixed; z-index: 140; display: flex; padding: 12px; border-radius: var(--r-lg); -webkit-user-select: none; user-select: none; opacity: 0; transform: translateY(-6px) scale(.98); transform-origin: 20% top; transition: opacity .16s, transform .24s var(--ease-out); }
.dp.up { transform: translateY(6px) scale(.98); transform-origin: 20% bottom; }
.dp.in { opacity: 1; transform: none; }
.dp > * { position: relative; z-index: 3; }
.dp-list { display: flex; flex-direction: column; gap: 2px; width: 198px; flex: none; padding-right: 10px; margin-right: 10px; border-right: 1px solid var(--line); }
.dp-p { display: flex; align-items: center; gap: 9px; height: 34px; padding: 0 10px; border-radius: 11px; font-size: 13px; font-weight: 550; text-align: left; white-space: nowrap; transition: background .15s; }
.dp-p .ic { color: var(--text-2); }
.dp-p em { margin-left: auto; padding-left: 8px; font-style: normal; font-size: 11.5px; font-weight: 500; color: var(--text-3); font-variant-numeric: tabular-nums; }
.dp-p:hover { background: var(--fill-2); }
.dp-p.on { background: rgba(var(--accent-rgb), .18); }
.dp-p.on .ic { color: var(--accent-hi); }
.dp-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 1px 0 8px 6px; }
.dp-h b { font-size: 14.5px; font-weight: 650; }
.dp-nav { display: flex; gap: 4px; }
.dp-nav button { width: 28px; height: 28px; border-radius: 14px; background: var(--fill-2); color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; transition: background .15s, color .15s; }
.dp-nav button:hover { background: var(--fill-3); color: var(--text); }
.dp-nav .dot { width: 6px; height: 6px; border-radius: 3px; background: currentColor; }
.dp-g { display: grid; grid-template-columns: repeat(7, 34px); gap: 2px; }
.dp-wd { font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); text-align: center; padding: 2px 0 5px; }
.dp-d { height: 34px; border-radius: 17px; font-size: 13px; font-weight: 550; font-variant-numeric: tabular-nums; transition: background .15s, color .15s; }
.dp-d:hover { background: var(--fill-2); }
.dp-d.past { color: var(--text-3); }
.dp-d.out { color: var(--text-3); opacity: .5; }
.dp-d.now { color: var(--accent-hi); box-shadow: inset 0 0 0 1.5px rgba(var(--accent-rgb), .55); }
[data-theme="light"] .dp-d.now { color: var(--accent); }
.dp-d.on { background: var(--accent); color: #fff; box-shadow: none; opacity: 1; }
.dp-d:disabled { opacity: .22; pointer-events: none; }
.dp button:focus-visible { outline: 2px solid rgba(var(--accent-rgb), .7); outline-offset: 1px; }
@media (max-width: 560px) {
  .dp { flex-direction: column; width: calc(100vw - 24px); }
  .dp-list { width: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 0 10px; margin: 0 0 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .dp-p em { display: none; }
  .dp-g { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}

/* Варианты (радио/флажки) */
.opt { display: flex; align-items: flex-start; gap: 12px; padding: 11px 12px; border-radius: 14px; cursor: pointer; transition: background .2s; }
.opt:hover { background: var(--fill-1); }
.opt input { margin: 3px 0 0; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.opt b { display: block; font-size: 14px; font-weight: 600; }
.opt small { display: block; font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* Быстрое добавление */
.qa-in { width: 100%; height: 52px; border: 0; outline: none; background: transparent; font-size: 18px; font-weight: 550; color: var(--text); padding: 0 2px; }
.qa-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 30px; margin: 4px 0 12px; }
.qa-chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 13px; font-size: 12px; font-weight: 600; background: rgba(var(--accent-rgb), .18); color: var(--text); animation: chipIn .35s var(--spring) both; }
.qa-chip .ic { width: 13px; height: 13px; }
.qa-chip.p1 { background: rgba(208, 59, 59, .22); } .qa-chip.p2 { background: rgba(236, 131, 90, .22); }
@keyframes chipIn { from { opacity: 0; transform: scale(.6); } }
.qa-hint { font-size: 11.5px; color: var(--text-3); line-height: 1.5; }
.qa-hint code { font: 600 11px var(--font); background: var(--fill-2); padding: 1px 5px; border-radius: 5px; color: var(--text-2); }
.qa-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding-top: 12px; border-top: 1px solid var(--line); }
.qa-row .select, .qa-row .input { height: 34px; font-size: 12.5px; }

/* Поиск */
.pal-in { width: 100%; height: 50px; border: 0; outline: none; background: transparent; font-size: 17px; color: var(--text); padding: 0 4px 0 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='m20 20-4.2-4.2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 4px center; }
.pal-list { max-height: 52vh; overflow-y: auto; margin: 6px -8px -8px; padding: 4px; border-top: 1px solid var(--line); }
.pal-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); font-weight: 600; padding: 10px 10px 4px; }
.pal-i { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 12px; cursor: pointer; font-size: 13.5px; }
.pal-i .ic { color: var(--text-2); }
.pal-i .sub { margin-left: auto; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.pal-i.sel { background: rgba(var(--accent-rgb), .18); }

/* Подсказка */
.tip { position: fixed; z-index: 150; pointer-events: none; padding: 7px 10px; border-radius: 10px; background: var(--tip-bg); color: #fff; font-size: 12px; font-weight: 500; white-space: nowrap; transform: translate(-50%, -100%) translateY(-8px); opacity: 0; transition: opacity .15s; box-shadow: 0 8px 24px -8px rgba(0,0,0,.5); }
.tip.on { opacity: 1; }
.tip b { font-weight: 700; }

/* Деталь задачи */
.ts-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.ts-head .check { margin-top: 9px; width: 24px; height: 24px; }
.ts-title { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: 20px; font-weight: 650; letter-spacing: -.01em; color: var(--text); padding: 4px 0; resize: none; line-height: 1.3; font-family: inherit; }
.ts-notes { width: 100%; min-height: 64px; border: 0; outline: none; resize: vertical; background: var(--fill-1); border-radius: 14px; padding: 11px 13px; font-size: 13.5px; line-height: 1.5; color: var(--text); margin-bottom: 14px; font-family: inherit; }
.prio-pick { display: flex; gap: 6px; }
.prio-pick button { flex: 1; height: 40px; border-radius: 13px; background: var(--fill-1); border: 1px solid var(--line); display: grid; place-items: center; transition: background .2s, transform .25s var(--spring); }
.prio-pick button:active { transform: scale(.92); }
.prio-pick button.on { background: var(--fill-3); border-color: var(--line-2); }
.prio-pick .p1 { color: #ff5f57; } .prio-pick .p2 { color: #ff9f40; } .prio-pick .p3 { color: var(--accent-hi); } .prio-pick .p4 { color: var(--text-3); }
.subs { margin-top: 16px; }
.sub-i { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); animation: rowIn .3s var(--ease) both; }
.sub-i .t { flex: 1; font-size: 13.5px; }
.sub-i.done .t { color: var(--text-3); text-decoration: line-through; }
.sub-i .icon-btn { width: 28px; height: 28px; opacity: .5; }
.sub-i:hover .icon-btn { opacity: 1; }
.sub-add { width: 100%; border: 0; outline: none; background: transparent; padding: 10px 0 4px 31px; font-size: 13.5px; color: var(--text); }
.ts-meta { font-size: 11.5px; color: var(--text-3); }
.ts-hours { display: flex; align-items: center; gap: 8px; }
.ts-hours select { flex: 1.4; min-width: 0; }
.ts-hours input { flex: 1; min-width: 0; }
.ts-hours > span { font-size: 13px; color: var(--text-2); flex: none; }

/* ==========================================================================
   Адаптив
   ========================================================================== */
@media (max-width: 1240px) {
  .tb-search { min-width: 0; width: 36px; padding: 0; justify-content: center; background: transparent; margin: 0; }
  .tb-search span, .tb-search kbd { display: none; }
  .tb-search:hover { background: var(--fill-2); }
}
@media (max-width: 1100px) {
  .s3, .s4 { grid-column: span 6; }
  .s5, .s6, .s7, .s8 { grid-column: 1 / -1; }
  .cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .walls { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .cols { display: flex; flex-direction: column; align-items: stretch; }
  .cols .col { display: contents; }
  .cols .col > * { order: var(--o, 0); }
}
@media (max-width: 760px) {
  :root { --gap: 12px; }
  body { font-size: 15px; }
  .app { padding: calc(env(safe-area-inset-top) + 10px) 14px calc(env(safe-area-inset-bottom) + 104px); }
  .rail { display: none; }
  .tabbar { display: flex; }
  .fab { display: grid; }
  .island { top: calc(env(safe-area-inset-top) + 8px); }
  .grid > * { grid-column: 1 / -1 !important; }
  .ph { grid-template-columns: minmax(0, 1fr) auto; margin-bottom: 14px; gap: 12px; }
  .ph h1 { font-size: 26px; }
  .ph-stats { grid-column: 1 / -1; flex-wrap: nowrap; overflow-x: auto; margin: 0 -14px; padding: 0 14px 2px; scrollbar-width: none; }
  .ph-stats::-webkit-scrollbar { display: none; }
  .ph-actions { grid-column: 1 / -1; justify-self: stretch; justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; margin: 0 -14px; padding: 0 14px 2px; scrollbar-width: none; }
  .ph-nav { overflow-x: auto; margin: 0 -14px; padding: 0 14px 2px; scrollbar-width: none; }
  .ph-nav::-webkit-scrollbar { display: none; }
  .ph-nav > * { flex: none; }
  .ph-actions::-webkit-scrollbar { display: none; }
  .ph-actions > *, .filters > * { flex: none; }
  .toolbar { height: 44px; padding: 0 4px; }
  .toolbar .hide-m { display: none; }
  .stat { min-width: 0; flex: none; }
  .card { padding: 16px; border-radius: 24px; }
  .glass { border-radius: 24px; }
  .task { padding: 11px 2px; }
  .htabs a span { display: none; }
  .htabs a.on span { display: inline; }
  .vbp input { font-size: 19px !important; }
  .madh { gap: 3px; }
  .set-under:has(.seg) { padding-left: 0; overflow-x: auto; scrollbar-width: none; }
  .set-under > .seg { display: flex; width: 100%; }
  .set-under > .seg button { flex: 1 1 auto; padding-left: 6px; padding-right: 6px; }
  .notif-ctl { gap: 8px; }
  .dock { left: 12px; right: 12px; transform: none; bottom: calc(env(safe-area-inset-bottom) + 10px); gap: 8px; }
  .dock-t { flex: 1; min-width: 0; flex-direction: column; text-align: center; gap: 8px; padding: 13px 6px 12px; border-radius: 24px; }
  .dock-tx { align-items: center; }
  .dock-tx b { font-size: 13.5px; }
  .dock-tx small { font-size: 11px; }
  .task-title { font-size: 15px; }
  .check { width: 23px; height: 23px; }
  .task-act { display: none; }
  .board, .pboard { grid-template-columns: repeat(4, 84vw); scroll-snap-type: x mandatory; margin: 0 -14px; padding: 2px 14px 12px; scroll-padding: 14px; }
  .kcol, .pboard > * { scroll-snap-align: start; }
  .filters { flex-wrap: nowrap; overflow-x: auto; margin: 0 -14px 12px; padding: 0 14px 2px; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .filters .search-in { min-width: 180px; }
  .select, .input { font-size: 16px; height: 38px; }
  .field input, .field select, .field textarea { font-size: 16px; height: 44px; }
  .field .time-in > i { font-size: 16px; }
  .field textarea { height: auto; }
  .qa-in { font-size: 18px; }
  .sheet-wrap, .sheet-wrap.top { align-items: flex-end; padding: 0; top: var(--vv-top, 0px); bottom: auto; height: var(--vv-h, 100%); }
  .sheet { width: 100% !important; border-radius: 28px 28px 0 0; max-height: min(92dvh, calc(var(--vv-h, 100dvh) - 8px)); padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); transform: translateY(100%); }
  .sheet-wrap.closing .sheet { transform: translateY(100%); transition: transform .3s var(--ease); }
  .sheet-grip { display: block; }
  .fields { grid-template-columns: 1fr 1fr; }
  .walls { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rings-wrap { gap: 18px; }
  .rings-wrap svg.rings { width: 132px; height: 132px; }
  .focus-w { gap: 14px; }
  .dial { width: 100px; height: 100px; }
  .hero { font-size: 30px; }
  .donut-wrap { flex-direction: column; align-items: stretch; }
  .donut { align-self: center; }
  .hdays { gap: 4px; }
  .hd { width: 24px; height: 24px; }
  .steps-big { flex-direction: column; align-items: stretch; }
  .steps-big .ring-c { align-self: center; }
  .pgrid { grid-template-columns: 1fr; }
  .isl-text { max-width: 200px; }
  .isl-xl .big { font-size: 34px; }
}
@media (max-width: 380px) {
  .hdays .hd:nth-child(-n+2) { display: none; }
}

/* Десктоп: остров живёт слева от панели инструментов и не закрывает заголовок */
@media (min-width: 761px) {
  .island { left: auto; right: var(--isl-r, 380px); top: calc(23px + var(--top-inset)); transform: none; transform-origin: 100% 50%; }
  .island[data-mode="idle"] { transform: translateY(-12px) scale(.6); }
}

/* macOS-приложение: место под светофор и перетаскивание окна */
html.macapp { --top-inset: 22px; }

/* Установленное PWA */
@media (display-mode: standalone) {
  body { -webkit-user-select: none; user-select: none; }
  input, textarea, [contenteditable] { -webkit-user-select: text; user-select: text; }
}

/* Меньше движения */
[data-motion="reduce"] *, [data-motion="reduce"] *::before, [data-motion="reduce"] *::after {
  animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important;
  transition-duration: .01ms !important; transition-delay: 0s !important; scroll-behavior: auto !important;
}
/* Бесконечные анимации с нулевой длительностью мерцают — обои просто стоят на месте */
[data-motion="reduce"] .wall i { animation: none !important; }
[data-glint="0"] .glass::after { display: none; }
@media (prefers-reduced-motion: reduce) {
  .wall i { animation: none; }
  .view.entering .anim { animation-duration: .2s; animation-delay: 0s; }
}

/* Статус обмена с «Здоровьем» через iCloud */
.hs-bar { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px; margin: 0 0 12px; border-radius: 14px; background: var(--fill-1); border: 1px solid var(--line); font-size: 12.5px; line-height: 1.35; }
.hs-bar .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hs-bar b { font-weight: 600; color: var(--text); }
.hs-bar span { color: var(--text-2); }
.hs-bar em { display: block; font-style: normal; color: var(--text-3); margin-top: 2px; }
.hs-bar .btn { flex: none; }
.hs-bar-ic { flex: none; width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.hs-bar.wait .hs-bar-ic { background: var(--fill-2); color: var(--text-2); }
.hs-bar.warn { border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.hs-bar.warn .hs-bar-ic { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.vd-src.ok { color: var(--good); }
.vd-src.wait { color: var(--warn); }
.hs-bar .icon-btn { flex: none; align-self: flex-start; }

/* ---------- Виджеты разделов (ui/widgets.js): сетка 4/2 колонки, размеры S/M/L, режим правки как на iOS */
.wgrid { position: relative; column-gap: var(--gap); min-height: 40px; }
.wgrid > .w { position: absolute; top: 0; left: 0; transition: transform .5s var(--spring), width .35s var(--ease), height .35s var(--ease); container: w / inline-size; }
.wgrid > .w > .card, .wgrid > .w > .vcard { margin: 0; }
.wgrid > .w[data-size="s"] > :first-child { height: 100%; overflow: hidden; }
.w-sizes { display: none; }
.view.w-edit .wgrid > .w { cursor: grab; touch-action: none; animation: wiggle .5s ease-in-out infinite alternate; }
.view.w-edit .wgrid > .w:nth-child(2n) { animation-delay: -.25s; animation-direction: alternate-reverse; }
.view.w-edit .wgrid > .w > :not(.w-sizes) { pointer-events: none; user-select: none; -webkit-user-select: none; }
@keyframes wiggle { from { rotate: -.12deg; } to { rotate: .12deg; } }
[data-motion="reduce"] .view.w-edit .wgrid > .w { animation: none; }
.wgrid > .w.w-lift { scale: 1.02; transition: transform .5s var(--spring), scale .25s var(--spring); }
.view.w-edit .w-sizes {
  display: flex; gap: 2px; position: absolute; top: -11px; right: 12px; z-index: 3; padding: 3px; border-radius: 12px;
  background: var(--solid-2); border: 1px solid var(--line-2); box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
}
.w-sizes button { width: 26px; height: 20px; border-radius: 8px; display: grid; place-items: center; color: var(--text-3); transition: background .2s, color .2s; }
.w-sizes button:hover { color: var(--text); }
.w-sizes button.on { background: var(--accent); color: #fff; }
.w-sizes i { display: block; border: 1.6px solid currentColor; border-radius: 2.5px; }
.w-sizes .sz-s { width: 8px; height: 8px; } .w-sizes .sz-m { width: 15px; height: 8px; } .w-sizes .sz-l { width: 15px; height: 12px; }
.wgrid > .w.w-drag { z-index: 6; cursor: grabbing; transition: width .35s var(--ease), height .35s var(--ease); animation: none; scale: 1.03; }
.wgrid > .w.w-drag > :first-child { box-shadow: 0 24px 60px rgba(0, 0, 0, .4); }
.w-done { position: fixed; top: 16px; left: 50%; translate: -50% 0; z-index: 70; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); animation: wdone .35s var(--spring); }
@keyframes wdone { from { opacity: 0; translate: -50% -14px; } }
.ph-actions .vrange-seg { margin-right: 2px; }

/* Маленький виджет-квадрат (parts.js → smallCard) */
.swg { display: flex; flex-direction: column; gap: 8px; color: inherit; text-decoration: none; padding: 16px; transition: transform .3s var(--spring); }
a.swg:active { transform: scale(.97); }
.swg-h { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 620; color: var(--text-2); min-width: 0; }
.swg-h span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.swg-h .ic { width: 14px; height: 14px; color: var(--c); flex: none; }
.swg-viz { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.swg-viz > svg, .swg-viz .rings { max-width: 100%; max-height: 100%; width: auto; height: 100%; }
.swg-viz > svg.linechart { width: 100% !important; height: 100%; max-height: 100%; }
.swg-viz .bars { width: 100%; height: 100% !important; gap: 4px; }
.swg-viz .btrack { border-radius: 7px; }
.swg-viz .bfill { border-radius: 6px 6px 3px 3px; }
.swg-viz .bcol { gap: 4px; }
.swg-viz .bcol > span { font-size: 10px; }
.swg-viz .sbar, .swg-viz .bar { width: 100%; }
.swg-viz.bottom { align-items: flex-end; }
.swg-b + .swg-viz.bottom { margin-top: auto; flex: none; }
.swg.noviz .swg-b { flex: none; }
.swg-v { font-size: 30px; font-weight: 680; letter-spacing: -.03em; line-height: 1.05; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.swg-v small { font-size: 13px; color: var(--text-2); font-weight: 500; margin-left: 4px; letter-spacing: 0; }
.swg-s { font-size: 12px; color: var(--text-2); line-height: 1.35; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.swg-list { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; flex: 1; min-height: 0; overflow: hidden; }
.swg.haslist .swg-b { flex: none; }
.swg.haslist .swg-viz { flex: none; }
.swg.haslist .swg-b + .swg-viz.bottom { margin-top: 2px; }
.swg-viz.bottom + .swg-foot { margin-top: 10px; }
.swg-ha { color: inherit; display: block; margin: -4px -6px 0; padding: 4px 6px; border-radius: 9px; }
.swg-ha:hover { background: var(--fill-1); }
.swg-ha .swg-h > .ic:last-child { width: 12px; height: 12px; color: var(--text-3); margin-left: auto; }
.swg-foot { display: flex; gap: 6px; margin-top: auto; flex: none; }
.swg-foot .btn { flex: 1; justify-content: center; height: 32px; font-size: 12.5px; padding: 0 10px; min-width: 0; }
.swg-foot .btn.sq { flex: none; width: 32px; padding: 0; }
.swg-list + .swg-foot { margin-top: 6px; }
.swg-li.row-a { cursor: pointer; border-radius: 8px; margin: 0 -4px; padding: 3px 4px; }
.swg-li.row-a:hover { background: var(--fill-1); }
.swg-li .check { width: 17px; height: 17px; flex: none; }
.swg-li .check svg { width: 10px; height: 10px; }
.swg-debt { display: flex; flex-direction: column; gap: 4px; flex: none; }
.swg-debt .bar { height: 4px; }
.swg-debt.row-a { cursor: pointer; border-radius: 8px; margin: 0 -4px; padding: 3px 4px; }
.swg-debt.row-a:hover { background: var(--fill-1); }
.ord-n.sm { width: 17px; height: 17px; font-size: 10px; flex: none; }
.swg-li { display: flex; align-items: center; gap: 7px; font-size: 12.5px; min-width: 0; min-height: 22px; flex: none; }
.swg-li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.swg-li .dot { flex: none; }
.swg-li b { font-weight: 600; color: var(--text-2); font-size: 11.5px; font-variant-numeric: tabular-nums; flex: none; }
.swg-li.muted { opacity: .6; }
.swg-li b { max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.swg-ins { display: flex; gap: 8px; flex: none; font-size: 12px; line-height: 1.35; }
.swg-ins > i { flex: none; width: 7px; height: 7px; border-radius: 50%; margin-top: 5px; }
.swg-ins b { display: block; font-weight: 600; color: var(--text); font-size: 12.5px; }
.swg-ins span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; color: var(--text-2); }
.swg-sep { flex: none; margin-top: 4px; font-size: 10.5px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.swg-li .swg-ic { flex: none; color: var(--c, var(--text-3)); display: grid; place-items: center; width: 17px; }
.swg-li .swg-ic .ic { width: 12px; height: 12px; }
.swg-li .switch { flex: none; transform: scale(.72); transform-origin: right center; margin: -4px -2px -4px 0; }
.swg-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 4px 6px; }
.swg-empty > span { width: clamp(44px, 22cqi, 64px); height: clamp(44px, 22cqi, 64px); border-radius: 50%; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); }
.swg-empty p { margin: 0; font-size: 12.5px; line-height: 1.4; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.swg-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.swg-chips .chip { font-size: 12px; }
.swg-empty { max-height: 100%; overflow: hidden; justify-content: safe center; }
.swg-chips-n { display: none; }
.swg-chips-n button { opacity: .85; }
/* Узкий квадрат (телефон): без крупного значка, текст короче, готовые привычки — кружками; лишняя подпись прячется */
@container w (max-width: 210px) {
  .swg-empty { gap: 8px; padding: 0; }
  .swg-empty > span { display: none; }
  .swg-empty p { font-size: 11.5px; -webkit-line-clamp: 3; }
  .swg-chips { display: none; }
  .swg-chips-n { display: flex; }
  .swg-s { -webkit-line-clamp: 1; }
  .swg-viz.bottom .swg-s { display: none; }
}
.swg-ring { position: relative; height: 100%; width: auto; max-width: 100%; aspect-ratio: 1; display: grid; place-items: center; }
.swg-ring > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.swg-ring-c { position: relative; text-align: center; font-size: clamp(15px, 8.5cqi, 30px); font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.swg-ring-c small { display: block; font-size: clamp(10.5px, 3.8cqi, 13px); color: var(--text-2); font-weight: 500; letter-spacing: 0; }
.swg-dots { display: flex; flex-wrap: wrap; gap: clamp(6px, 3cqi, 10px); justify-content: center; align-content: center; }
.swg-dots span, .swg-dots button { width: clamp(30px, 18cqi, 58px); height: clamp(30px, 18cqi, 58px); border-radius: 50%; display: grid; place-items: center; font-size: clamp(15px, 8.5cqi, 27px); background: var(--fill-1); border: 1px solid var(--line); opacity: .55; transition: transform .2s var(--spring), opacity .2s, background .2s; }
.swg-dots button:hover { opacity: .85; transform: scale(1.06); }
.swg-dots button.on { background: color-mix(in srgb, var(--c) 28%, transparent); border-color: color-mix(in srgb, var(--c) 55%, transparent); opacity: 1; }
.swg-dots span.on { background: color-mix(in srgb, var(--c) 28%, transparent); border-color: color-mix(in srgb, var(--c) 55%, transparent); opacity: 1; }
@container w (max-width: 210px) {
  .swg { padding: 12px; gap: 6px; }
  .swg-v { font-size: 23px; }
  .swg-v small { font-size: 11.5px; }
  .swg-s { font-size: 11px; }
  .swg-dots span { width: 28px; height: 28px; font-size: 14px; }
}

/* Большие виджеты: две панели рядом, списки в две колонки — на узком экране складываются обратно */
.w2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.tw-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--text-2); margin-bottom: 10px; }
.tw-h b { color: var(--text); font-weight: 600; text-align: right; }
.today-wide { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 34px; align-items: center; }
.tw-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.tw-day { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 7px 0 5px; border-radius: 12px; font-size: 11px; color: var(--text-3); }
.tw-day.on { background: var(--fill-1); color: var(--text); }
.tw-day .rings { width: 100%; max-width: 46px; height: auto; }
.tw-det { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.tw-det > div { padding: 9px 12px; border-radius: 14px; background: var(--fill-1); border: 1px solid var(--line); border-left: 3px solid var(--c); font-size: 12px; color: var(--text-2); }
.tw-det b { display: block; font-size: 13px; color: var(--text); margin-bottom: 1px; }
.hrows { display: flex; flex-direction: column; gap: 9px; }
.hrow2 { display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr); gap: 16px; align-items: center; }
.hrow2 .hpill { justify-content: flex-start; min-width: 0; overflow: hidden; white-space: nowrap; }
.hdots { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 5px; }
.hdots i { aspect-ratio: 1; max-height: 26px; border-radius: 7px; background: var(--fill-2); border: 1px solid var(--line); }
.hdots i.on { background: var(--c); border-color: transparent; }
.hdots i.td { outline: 2px solid color-mix(in srgb, var(--c) 60%, transparent); outline-offset: 1px; }
.hv-spark { display: block; margin-top: 4px; }
.hv-spark svg { width: 100% !important; height: 30px; }
@container w (min-width: 760px) {
  .tasks.two, .mini.two, .mslots.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; row-gap: 0; }
  .mini.two { row-gap: 12px; }
  .hv-grid.wide { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@container w (max-width: 700px) {
  .w2, .today-wide { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .hrow2 { grid-template-columns: minmax(0, 1fr); gap: 6px; }
}
.heat.fill { grid-auto-columns: minmax(0, 1fr); grid-template-rows: repeat(7, minmax(0, 1fr)); height: 100%; width: auto; max-width: 100%; aspect-ratio: 6 / 7; overflow: hidden; padding: 0; }
.heat.fill i { width: 100%; height: 100%; border-radius: 22%; }
@container w (min-width: 760px) { .wk-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; } }
@container w (min-width: 760px) {
  .vplan.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
  .vdiary.two { display: block; column-count: 2; column-gap: 26px; }
  .vdiary.two > *, .txs.two > * { break-inside: avoid; }
}
@container w (max-width: 760px) { .vc-two { grid-template-columns: minmax(0, 1fr); } }
@container w (min-width: 760px) { .meds.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.swg-viz .madh { width: 100%; height: 100%; margin: 0; }
.swg-viz .madh-d i { height: auto; flex: 1; min-height: 20px; }
@container w (min-width: 760px) {
  .brows.two, .goals-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; align-items: start; }
  .txs.two { column-count: 2; column-gap: 28px; }
  .legend-l.wide { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
}
@container w (max-width: 420px) { .donut-wrap { flex-direction: column; } }
.swg-viz .donut, .swg-viz .donut-c { max-width: 100%; max-height: 100%; }
/* Бублик в квадрате — на всю высоту, подпись в центре растёт вместе с ним */
.swg-viz .donut { width: auto !important; height: 100% !important; aspect-ratio: 1; }
.swg-viz .donut svg { width: 100%; height: 100%; }
.swg-viz .donut-c b { font-size: clamp(13px, 7cqi, 24px) !important; }
.swg-viz .donut-c span { font-size: clamp(10.5px, 3.6cqi, 13px); }
.swg-viz .pbars { width: 100%; height: 100%; gap: 4px; }
.legend-l.wide .ll .p.num { margin-left: auto; color: var(--text); }
@container w (min-width: 760px) { .apps-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 26px; } }
.swg-viz .scols { width: 100%; height: 100% !important; }

/* ---------- Питание */
.ph-nav .fd-daynav { margin-left: auto; }
.fd-daynav { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 19px; background: var(--fill-1); border: 1px solid var(--line); }
.fd-daynav .icon-btn { width: 30px; height: 30px; }
.fd-daynav .icon-btn[disabled] { opacity: .3; pointer-events: none; }
.fd-dn-l { min-width: 96px; height: 30px; padding: 0 10px; border-radius: 15px; font-size: 12.5px; font-weight: 650; color: var(--text); text-align: center; }
.fd-dn-l:not([disabled]):hover { background: var(--fill-2); }
.fd-dn-l[disabled] { cursor: default; }

.fd-banner { display: flex; align-items: center; gap: 14px; padding: 16px 18px; margin-bottom: var(--gap); }
.fd-banner .grow { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fd-banner b { font-size: 14.5px; }
.fd-banner span { font-size: 12.5px; color: var(--text-2); line-height: 1.4; }
.fd-banner-ic { width: 42px; height: 42px; flex: none; border-radius: 13px; display: grid; place-items: center; color: var(--c1); background: color-mix(in srgb, var(--c1) 16%, transparent); }

.fd-sum { display: flex; align-items: center; gap: 22px; }
.fd-macros { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.fd-mac-t { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 12.5px; margin-bottom: 5px; }
.fd-mac-t span { color: var(--text-2); font-weight: 550; display: inline-flex; align-items: center; gap: 6px; }
.fd-mac-t span::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.fd-mac-t b { font-size: 15px; font-weight: 680; font-variant-numeric: tabular-nums; }
.fd-mac-t b small { font-size: 11.5px; color: var(--text-3); font-weight: 500; }
.fd-mac > small { display: block; margin-top: 4px; font-size: 11.5px; color: var(--text-3); }
.fd-sum-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12.5px; flex-wrap: wrap; }
.fd-sum-foot .btn.sq { width: 30px; padding: 0; justify-content: center; }
.fd-split { margin-top: 16px; }

.fd-meals { display: flex; flex-direction: column; gap: 4px; }
.fd-meals.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 22px; }
.fd-meal + .fd-meal { border-top: 1px solid var(--line); padding-top: 6px; }
.fd-meals.two .fd-meal:nth-child(2) { border-top: 0; padding-top: 0; }
.fd-meal-h { display: flex; align-items: center; gap: 8px; height: 38px; }
.fd-meal-h b { font-size: 13.5px; font-weight: 650; }
.fd-meal-h .icon-btn { width: 30px; height: 30px; }
.fd-mi { width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; background: var(--fill-2); color: var(--text-2); flex: none; }
.fd-mk { margin-left: auto; font-size: 12.5px; color: var(--text-2); font-weight: 600; margin-right: 2px; }
.fd-e { display: flex; align-items: center; gap: 10px; padding: 7px 8px 7px 34px; margin: 0 -8px; border-radius: 11px; cursor: pointer; transition: background .15s; }
.fd-e:hover { background: var(--fill-1); }
.fd-e .grow { min-width: 0; }
.fd-en { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 560; min-width: 0; }
.fd-src { color: var(--text-3); display: inline-flex; flex: none; }
.fd-em { font-size: 11.5px; color: var(--text-3); margin-top: 2px; font-variant-numeric: tabular-nums; }
.fd-e > b { font-size: 13.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.fd-empty { display: flex; align-items: center; gap: 10px; padding: 2px 0 8px 34px; font-size: 12.5px; color: var(--text-3); }
.fd-empty .chip { height: 26px; font-size: 12px; padding: 0 10px; }

.fd-ins-list { display: flex; flex-direction: column; gap: 8px; }
.fd-ins-list.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fd-ins { --tc: var(--accent); display: flex; gap: 11px; padding: 11px 12px; border-radius: 15px; background: var(--fill-1); border: 1px solid var(--line); }
.fd-ins.good { --tc: var(--good); }
.fd-ins.warn { --tc: var(--warn); }
.fd-ins.info { --tc: var(--c0); }
.fd-ins-ic { width: 30px; height: 30px; flex: none; border-radius: 10px; display: grid; place-items: center; color: var(--tc); background: color-mix(in srgb, var(--tc) 15%, transparent); }
.fd-ins .grow { display: flex; flex-direction: column; gap: 3px; min-width: 0; align-items: flex-start; }
.fd-ins b { font-size: 13.5px; font-weight: 650; line-height: 1.3; }
.fd-ins span { font-size: 12.5px; color: var(--text-2); line-height: 1.45; }
.fd-ins-s { --tc: var(--c0); }
.fd-ins-s.good { --tc: var(--good); }
.fd-ins-s.warn { --tc: var(--warn); }
.fd-ins-s i { width: 7px; height: 7px; border-radius: 50%; background: var(--tc); flex: none; }

.fd-week-h { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.fd-week-h span { display: block; font-size: 11.5px; color: var(--text-2); margin-bottom: 2px; }
.fd-week-h b { font-size: 19px; font-weight: 680; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.fd-week-h b small { font-size: 11.5px; color: var(--text-3); font-weight: 500; letter-spacing: 0; }

.fd-quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.fd-q { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 34px 10px 12px; border-radius: 14px; background: var(--fill-1); border: 1px solid var(--line); text-align: left; min-width: 0; transition: background .15s, transform .2s var(--spring); }
.fd-q:hover { background: var(--fill-2); }
.fd-q:active { transform: scale(.97); }
.fd-q > span { font-size: 13px; font-weight: 600; max-width: 100%; }
.fd-q small { font-size: 11.5px; color: var(--text-3); }
.fd-q i { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--c1) 18%, transparent); color: var(--c1); }

.fd-macro { display: flex; align-items: center; gap: 22px; }
.fd-ms { display: flex; align-items: center; gap: 9px; padding: 8px 0; font-size: 13px; }
.fd-ms + .fd-ms { border-top: 1px solid var(--line); }
.fd-ms > i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }
.fd-ms b { font-variant-numeric: tabular-nums; font-weight: 650; }
.fd-ms-p { min-width: 92px; text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.fd-ms-p small { color: var(--text-3); font-weight: 500; }
.fd-ms-list { margin-top: 10px; }

.fd-note { display: flex; gap: 9px; margin-top: 12px; padding: 10px 12px; border-radius: 13px; background: var(--fill-1); font-size: 12.5px; color: var(--text-2); line-height: 1.45; }
.fd-note > .ic { flex: none; margin-top: 2px; color: var(--accent-hi); }
.fd-note b { color: var(--text); }

.fd-top2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.fd-top { padding: 6px 0; font-size: 13px; }
.fd-top .row { gap: 10px; margin-bottom: 5px; }
.fd-top .ellipsis { min-width: 0; }
.fd-top b { font-size: 12.5px; color: var(--text-2); }

/* Цель */
.fd-unit { position: relative; }
.fd-unit input { width: 100%; padding-right: 34px !important; }
.fd-unit i { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 12.5px; color: var(--text-3); pointer-events: none; }
.fd-w { display: flex; align-items: center; gap: 10px; min-height: 40px; flex-wrap: wrap; }
.fd-w b { font-size: 17px; font-weight: 680; }
.fd-w small { font-size: 11.5px; color: var(--text-3); flex: 1; min-width: 90px; }
.fd-seg-mode { display: flex; width: 100%; }
.fd-seg-mode button { flex: 1; justify-content: center; }
.fd-acts { display: flex; flex-direction: column; gap: 6px; }
.fd-act { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--fill-1); border: 1px solid var(--line); text-align: left; transition: background .15s, border-color .15s; }
.fd-act:hover { background: var(--fill-2); }
.fd-act.on { background: rgba(var(--accent-rgb), .13); border-color: rgba(var(--accent-rgb), .45); }
.fd-act .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fd-act b { font-size: 13.5px; font-weight: 620; }
.fd-act b em { font-style: normal; font-size: 11px; font-weight: 650; color: var(--good); background: color-mix(in srgb, var(--good) 15%, transparent); padding: 2px 7px; border-radius: 8px; margin-left: 6px; }
.fd-act small { font-size: 12px; color: var(--text-3); }
.fd-act-r { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; transition: border .15s; }
.fd-act.on .fd-act-r { border: 5.5px solid var(--accent); }
.fd-act-k { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }

.fd-norm { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 14px; }
.fd-norm-k b { display: block; font-size: 44px; font-weight: 740; letter-spacing: -.035em; line-height: 1; color: var(--c1); font-variant-numeric: tabular-nums; }
.fd-norm-k span { font-size: 12.5px; color: var(--text-2); }
.fd-norm-m { display: flex; gap: 8px; flex: 1; min-width: 240px; }
.fd-norm-m > div { flex: 1; padding: 10px 12px; border-radius: 14px; background: color-mix(in srgb, var(--c) 11%, var(--fill-1)); border: 1px solid color-mix(in srgb, var(--c) 25%, var(--line)); display: flex; flex-direction: column; gap: 1px; }
.fd-norm-m b { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.fd-norm-m b small { font-size: 12px; color: var(--text-2); font-weight: 500; }
.fd-norm-m span { font-size: 12px; color: var(--text-2); }
.fd-norm-m > div > small { font-size: 11px; color: var(--text-3); }
.fd-risk { display: flex; align-items: center; gap: 9px; margin-top: 10px; color: var(--text); font-weight: 500; cursor: pointer; user-select: none; -webkit-user-select: none; }
.fd-risk input { margin: 0; width: 17px; height: 17px; accent-color: var(--warn); flex: none; cursor: pointer; }
.privacy.warn.fd-risky { border-color: color-mix(in srgb, var(--c7) 45%, var(--line)); background: color-mix(in srgb, var(--c7) 9%, var(--fill-1)); }
.privacy.warn.fd-risky .ic { color: var(--c7); }
.fd-eta { display: flex; align-items: center; gap: 9px; padding: 10px 12px; margin-bottom: 12px; border-radius: 13px; background: color-mix(in srgb, var(--c0) 11%, var(--fill-1)); font-size: 13px; line-height: 1.4; }
.fd-eta > .ic { color: var(--c0); flex: none; }
.fd-eta.good { background: color-mix(in srgb, var(--good) 12%, var(--fill-1)); }
.fd-eta.good > .ic { color: var(--good); }
.fd-calc { display: flex; flex-direction: column; border-radius: 14px; border: 1px solid var(--line); overflow: hidden; margin-bottom: 10px; }
.fd-calc > div { display: grid; grid-template-columns: 1fr auto; gap: 1px 10px; padding: 9px 12px; font-size: 13px; }
.fd-calc > div + div { border-top: 1px solid var(--line); }
.fd-calc span { color: var(--text-2); }
.fd-calc b { font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; }
.fd-calc small { grid-column: 1 / -1; font-size: 11.5px; color: var(--text-3); }
.fd-calc .link { font-size: 11.5px; padding: 0; }
.fd-custom { width: 100%; }
.fields.four { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }

.fd-steps { list-style: none; display: flex; flex-direction: column; gap: 8px; margin: 2px 0 12px; padding: 0; }
.fd-steps li { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; line-height: 1.45; }
.fd-steps li > span { width: 21px; height: 21px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; background: rgba(var(--accent-rgb), .18); color: var(--accent-hi); }
.fd-steps a { color: var(--accent-hi); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.fd-key { display: flex; gap: 8px; }
.fd-key input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--fill-1); color: var(--text); font: inherit; font-size: 13.5px; outline: none; }
.fd-key input:focus { border-color: rgba(var(--accent-rgb), .6); }

/* Шторка «Добавить еду» */
.fd-ai-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.fd-ai-b { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 15px; text-align: left; background: linear-gradient(135deg, color-mix(in srgb, var(--c1) 16%, var(--fill-1)), color-mix(in srgb, var(--c4) 12%, var(--fill-1))); border: 1px solid color-mix(in srgb, var(--c1) 28%, var(--line)); transition: transform .2s var(--spring), filter .15s; }
.fd-ai-b:hover { filter: brightness(1.08); }
.fd-ai-b:active { transform: scale(.97); }
.fd-ai-b > .ic { color: var(--c1); flex: none; }
.fd-ai-b span { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.fd-ai-b b { font-size: 13.5px; font-weight: 650; }
.fd-ai-b small { font-size: 11.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fd-sugg { display: flex; flex-direction: column; gap: 2px; margin: 6px 0 2px; padding: 4px; border-radius: 14px; background: var(--fill-1); border: 1px solid var(--line); max-height: 220px; overflow: auto; }
.fd-sg { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; text-align: left; font-size: 13px; font-weight: 560; min-width: 0; }
.fd-sg:hover { background: var(--fill-2); }
.fd-sg small { font-size: 11.5px; color: var(--text-3); font-weight: 500; flex: none; }
.fd-gw { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; margin-top: 12px; align-items: end; }
.fd-total { display: flex; align-items: baseline; gap: 10px; margin-top: 12px; padding: 10px 12px; border-radius: 13px; background: color-mix(in srgb, var(--c1) 10%, var(--fill-1)); font-size: 12.5px; flex-wrap: wrap; }
.fd-total b { font-size: 17px; font-weight: 700; color: var(--c1); font-variant-numeric: tabular-nums; }
.fd-total span { color: var(--text-2); font-variant-numeric: tabular-nums; }
.fd-total em { margin-left: auto; font-style: normal; color: var(--warn); font-weight: 600; }
.fd-meal-seg { display: flex; width: 100%; }
.fd-meal-seg button { flex: 1; justify-content: center; padding: 0 6px; }

/* Шторка «По фото» */
.fd-drop { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 30px 16px; border-radius: 20px; border: 1.5px dashed var(--line-2); background: var(--fill-1); transition: background .15s, border-color .15s; }
.fd-drop:hover { background: var(--fill-2); border-color: rgba(var(--accent-rgb), .5); }
.fd-drop b { font-size: 15px; font-weight: 650; margin-top: 4px; }
.fd-drop small { font-size: 12px; color: var(--text-3); }
.fd-drop-ic { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--c1), var(--c4)); box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--c1) 70%, transparent); }
.fd-pic { position: relative; border-radius: 18px; overflow: hidden; background: var(--fill-1); }
.fd-pic img { display: block; width: 100%; max-height: 300px; object-fit: cover; }
.fd-pic-x { position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 15px; font-size: 12.5px; font-weight: 600; color: #fff; background: rgba(0, 0, 0, .5); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.fd-pic.scan::after { content: ''; position: absolute; left: 0; right: 0; height: 38%; background: linear-gradient(180deg, transparent, rgba(var(--accent-rgb), .35), transparent); animation: fd-scan 1.6s ease-in-out infinite; }
@keyframes fd-scan { 0% { top: -40%; } 100% { top: 100%; } }
.fd-busy { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 0 8px; }
.fd-busy b { font-size: 15px; font-weight: 650; }
.fd-busy small { font-size: 12px; color: var(--text-3); text-align: center; }
.fd-via { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--text-3); }
.fd-backup { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.fd-backup-h { display: flex; gap: 9px; margin-bottom: 10px; font-size: 12.5px; line-height: 1.45; color: var(--text-2); }
.fd-backup-h > .ic { flex: none; margin-top: 2px; color: var(--accent-hi); }
.fd-backup-h b { display: block; color: var(--text); font-weight: 600; }
.fd-backup-add { margin: 16px 0 0; }
.fd-spin { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--fill-3); border-top-color: var(--accent); animation: fd-spin .8s linear infinite; margin-bottom: 4px; }
@keyframes fd-spin { to { transform: rotate(360deg); } }
.fd-res-h { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.fd-res-h img { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; flex: none; }
.fd-res-h .grow { display: flex; flex-direction: column; gap: 4px; }
.fd-res-h b { font-size: 26px; font-weight: 720; letter-spacing: -.02em; color: var(--c1); font-variant-numeric: tabular-nums; }
.fd-res-h span { display: flex; gap: 6px; flex-wrap: wrap; }
.fd-res-h em { font-style: normal; font-size: 12px; font-weight: 650; padding: 3px 8px; border-radius: 9px; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.fd-ri-list { display: flex; flex-direction: column; border-radius: 15px; border: 1px solid var(--line); overflow: hidden; }
.fd-ri { display: grid; grid-template-columns: minmax(0, 1fr) 78px 104px 30px; gap: 8px; align-items: center; padding: 7px 6px 7px 10px; }
.fd-ri + .fd-ri { border-top: 1px solid var(--line); }
.fd-ri input { height: 34px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--text); font: inherit; font-size: 13.5px; padding: 0 8px; outline: none; min-width: 0; width: 100%; }
.fd-ri input:hover { background: var(--fill-1); }
.fd-ri input:focus { border-color: rgba(var(--accent-rgb), .6); background: var(--fill-2); }
.fd-ri-n { font-weight: 580; margin-left: -8px; }
.fd-ri-g { position: relative; }
.fd-ri-g input { background: var(--fill-1); padding-right: 22px; text-align: right; font-variant-numeric: tabular-nums; }
.fd-ri-g i { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 12px; color: var(--text-3); pointer-events: none; }
.fd-ri-v { display: flex; flex-direction: column; align-items: flex-end; }
.fd-ri-v b { font-size: 14px; font-weight: 680; font-variant-numeric: tabular-nums; }
.fd-ri-v small { font-size: 10.5px; color: var(--text-3); white-space: nowrap; }
.fd-ri .icon-btn { width: 30px; height: 30px; }
.fd-refine { display: flex; gap: 8px; margin-top: 12px; }
.fd-refine input { flex: 1; min-width: 0; height: 34px; padding: 0 12px; border-radius: 17px; border: 1px solid var(--line); background: var(--fill-1); color: var(--text); font: inherit; font-size: 12.5px; outline: none; }
.fd-refine input:focus { border-color: rgba(var(--accent-rgb), .6); }
.fd-err { display: flex; align-items: flex-start; gap: 8px; margin-top: 12px; padding: 10px 12px; border-radius: 13px; font-size: 12.5px; line-height: 1.45; color: var(--text); background: color-mix(in srgb, var(--crit) 12%, var(--fill-1)); border: 1px solid color-mix(in srgb, var(--crit) 30%, var(--line)); }
.fd-err > .ic { color: var(--crit); flex: none; margin-top: 1px; }

/* Мои продукты */
.fd-foods { display: flex; flex-direction: column; margin-top: 10px; max-height: 50vh; overflow: auto; }
.fd-fd { display: flex; align-items: center; gap: 6px; padding: 8px 0; }
.fd-fd + .fd-fd { border-top: 1px solid var(--line); }
.fd-fd .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fd-fd b { font-size: 13.5px; font-weight: 600; }
.fd-fd small { font-size: 11.5px; color: var(--text-3); }
.fd-fd .icon-btn { width: 30px; height: 30px; }

/* Обзор: большой блок */
.fd-home-l { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 12px; margin-top: 14px; align-items: start; }
.fd-hm { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.fd-hm-i { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 9px 11px; border-radius: 13px; background: var(--fill-1); border: 1px solid var(--line); text-align: left; }
.fd-hm-i:hover { background: var(--fill-2); }
.fd-hm-i span { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-2); }
.fd-hm-i b { font-size: 15px; font-weight: 680; font-variant-numeric: tabular-nums; }

@media (max-width: 760px) {
  .ph-nav .fd-daynav { margin-left: 8px; }
  .fd-sum { flex-direction: column; align-items: stretch; gap: 16px; }
  .fd-sum .ring-c { align-self: center; }
  .fd-macro { flex-direction: column; align-items: stretch; }
  .fd-macro > .donut, .fd-macro > svg, .fd-macro > div:first-child { align-self: center; }
  .fd-meals.two, .fd-ins-list.two, .fd-top2, .fd-home-l { grid-template-columns: 1fr; }
  .fd-meals.two .fd-meal:nth-child(2) { border-top: 1px solid var(--line); padding-top: 6px; }
  .fields.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fd-ai-row { grid-template-columns: 1fr 1fr; }
  .fd-ai-b small { display: none; }
  .fd-ri { grid-template-columns: minmax(0, 1fr) 70px 30px; }
  .fd-ri-v { grid-column: 1 / 3; grid-row: 2; flex-direction: row; gap: 8px; align-items: baseline; justify-content: flex-start; padding-left: 2px; }
  .fd-ri .icon-btn { grid-row: 1; grid-column: 3; }
  .fd-week-h b { font-size: 16px; }
}
button.swg-li { width: 100%; text-align: left; color: inherit; }
.fd-unit.wide input { padding-right: 52px !important; }
.fd-ai-in { width: 100%; display: flex; align-items: center; gap: 11px; margin-top: 8px; padding: 10px 12px; border-radius: 14px; text-align: left; background: linear-gradient(135deg, color-mix(in srgb, var(--c6) 16%, var(--fill-1)), color-mix(in srgb, var(--c0) 12%, var(--fill-1))); border: 1px solid color-mix(in srgb, var(--c6) 30%, var(--line)); transition: filter .15s, transform .2s var(--spring); }
button.fd-ai-in:hover { filter: brightness(1.08); }
button.fd-ai-in:active { transform: scale(.98); }
.fd-ai-in > .ic { color: var(--c6); flex: none; }
.fd-ai-in > span { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.fd-ai-in b { font-size: 13.5px; font-weight: 650; }
.fd-ai-in small { font-size: 11.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fd-ai-in kbd { flex: none; font: inherit; font-size: 11px; color: var(--text-3); padding: 2px 7px; border-radius: 7px; border: 1px solid var(--line-2); }
.fd-ai-in.busy { cursor: default; }
.fd-spin.sm { width: 18px; height: 18px; border-width: 2.5px; margin: 0; flex: none; }
.fd-ai-in + .fd-gw, .fd-note + .fd-gw, .fd-err + .fd-gw { margin-top: 12px; }
.fd-ri-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 2px 0; font-size: 12px; color: var(--text-3); line-height: 1.4; }
.fd-ri-foot span { min-width: 0; }
.fd-ri-foot .chip { flex: none; height: 28px; font-size: 12px; }
.fd-dish + .fd-dish { border-top: 1px solid var(--line); }
.fd-parts { margin: -2px 6px 8px 10px; padding: 6px 0 2px 12px; border-left: 2px solid var(--line-2); }
.fd-parts-h { font-size: 11px; font-weight: 650; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
.fd-part { display: grid; grid-template-columns: minmax(0, 1fr) 70px 48px 26px; gap: 8px; align-items: center; min-height: 32px; font-size: 12.5px; color: var(--text-2); }
.fd-part b { font-size: 12.5px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); }
.fd-part .icon-btn { width: 26px; height: 26px; }
.fd-ri-g.sm input { height: 28px; font-size: 12.5px; }
.fd-comp { display: flex; align-items: flex-start; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--text-2); line-height: 1.45; }
.fd-comp > .ic { flex: none; margin-top: 2px; color: var(--text-3); }
.fd-comp + .fd-note { margin-top: 8px; }
.fd-part input { width: 100%; min-width: 0; height: 28px; padding: 0 20px 0 6px; border-radius: 9px; border: 1px solid transparent; background: var(--fill-1); color: var(--text); font: inherit; font-size: 12.5px; text-align: right; font-variant-numeric: tabular-nums; outline: none; }
.fd-part input:focus { border-color: rgba(var(--accent-rgb), .6); background: var(--fill-2); }

/* ---------- Аккаунт: экран входа на сайте (как в iOS) и форма в настройках (views/account.js) */
.signin .app, .signin .main { padding: 0; }
.acc-screen { display: flex; flex-direction: column; box-sizing: border-box; max-width: 400px; min-height: 100vh; min-height: 100dvh; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 56px) 20px calc(env(safe-area-inset-bottom) + 20px); }
.acc-top { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 28px; }
.acc-logo { width: 76px; height: 76px; border-radius: 17px; box-shadow: 0 14px 32px -14px rgba(var(--accent-rgb), .75); }
.acc-top h1 { margin: 14px 0 5px; font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.acc-top p { margin: 0; max-width: 280px; color: var(--text-2); font-size: 15px; line-height: 1.4; }
.acc-seg { display: flex; width: 100%; box-sizing: border-box; margin-bottom: 14px; }
.acc-seg button { flex: 1; justify-content: center; height: 34px; font-size: 13.5px; }
.acc-form { display: flex; flex: 1; flex-direction: column; }
.acc-group { overflow: hidden; border-radius: 16px; background: var(--fill-1); border: 1px solid var(--line); }
.acc-f { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; border-bottom: 1px solid var(--line); cursor: text; transition: background .2s; }
.acc-f:last-child { border-bottom: 0; }
.acc-f:focus-within { background: var(--fill-1); }
.acc-f span { flex: none; width: 64px; font-size: 15px; }
.acc-f input { flex: 1; min-width: 0; height: 46px; padding: 0; border: 0; outline: none; background: none; color: var(--text); font: inherit; font-size: 16px; }
.acc-f input::placeholder { color: var(--text-3); }
.acc-err { display: flex; align-items: flex-start; gap: 7px; margin: 10px 2px 0; color: #ff6b6b; font-size: 13.5px; line-height: 1.4; }
.acc-err .ic { flex: none; margin-top: 2px; }
.acc-grow { flex: 1; min-height: 24px; }
.acc-go { margin-top: 8px; }
.acc-foot { margin: 14px 0 0; text-align: center; color: var(--text-3); font-size: 12.5px; line-height: 1.45; }
.acc-intro { margin: 2px 0 14px; color: var(--text-2); font-size: 13.5px; line-height: 1.5; }
.acc-inline { max-width: 420px; }
.acc-inline .acc-grow { display: none; }
.acc-inline .acc-go { margin-top: 14px; }
@media (min-width: 761px) {
  .acc-screen { min-height: 0; padding-top: 12vh; }
  .acc-screen .acc-grow { display: none; }
  .acc-screen .acc-go { margin-top: 18px; }
}
