  /* Unbounded — self-hosted (fonts/, OFL), used for UI chrome (buttons,
     headers, tab/card titles); reading content (note bodies, transcript text)
     uses the system font (SF Pro on iPhone, Inter elsewhere). Two cuts only: Regular for normal weights and
     SemiBold for everything bold — so the old 700/800 "black" headings render
     as Unbounded SemiBold instead of an extra-wide heavy weight. */
/* Inter и Space Mono — свои копии (раньше с Google Fonts: лишний запрос, который задерживал первую отрисовку) */
@font-face{font-family:'Inter'; src:url('fonts/inter-400-800-cyrillic.woff2') format('woff2'); font-weight:400 800; font-style:normal; font-display:swap; unicode-range:U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;}
@font-face{font-family:'Inter'; src:url('fonts/inter-400-800-latin.woff2') format('woff2'); font-weight:400 800; font-style:normal; font-display:swap; unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}
@font-face{font-family:'Space Mono'; src:url('fonts/space-mono-400-latin.woff2') format('woff2'); font-weight:400; font-style:normal; font-display:swap; unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}
@font-face{font-family:'Space Mono'; src:url('fonts/space-mono-700-latin.woff2') format('woff2'); font-weight:700; font-style:normal; font-display:swap; unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}
  @font-face{font-family:'Unbounded'; src:url('fonts/unbounded-400-cyrillic.woff2') format('woff2'); font-weight:100 500; font-display:swap;
    unicode-range:U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;}
  @font-face{font-family:'Unbounded'; src:url('fonts/unbounded-400-latin.woff2') format('woff2'); font-weight:100 500; font-display:swap;
    unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}
  @font-face{font-family:'Unbounded'; src:url('fonts/unbounded-600-cyrillic.woff2') format('woff2'); font-weight:501 1000; font-display:swap;
    unicode-range:U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;}
  @font-face{font-family:'Unbounded'; src:url('fonts/unbounded-600-latin.woff2') format('woff2'); font-weight:501 1000; font-display:swap;
    unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}
  :root{--font-text:-apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'Inter', 'Segoe UI', Roboto, system-ui, sans-serif;}
  :root{
    --bg:#000000; --bg-2:#0d0d0f;
    --panel-bg:#161618; --panel-bg-strong:#212124;
    --pill-bg:#18181b;
    --panel-border:rgba(255,255,255,0.1); --panel-border-strong:rgba(255,255,255,0.19);
    --text:#f4f5f7; --text-dim:#9b9ba3; --text-faint:#6e6e75;
    --accent:#ff9d4d; --accent-2:#3ec2ff; --accent-2-dark:#2ba3dd; --accent-3:#a06bff;
    --accent-pink:#ff5fa2; --accent-yellow:#ffd23f; --danger:#ff5c5c;
    --ai:#6f6bff;
    --cat-1:#3ec2ff; --cat-2:#ff9d4d; --cat-3:#a06bff; --cat-4:#2fd4a0; --cat-5:#ff5fa2; --cat-6:#ffd23f;
    --ev-green:#52e6a0; --ev-cyan:#37c9ff; --ev-pink:#ff5fc9; --ev-purple:#9d6bff; --ev-blue:#2f5fdb;
    --shadow:0 14px 32px -18px rgba(0,0,0,0.5);
    --btn-text:#0a0a10;
    --grid-line:rgba(72,92,114,0.26);
    color-scheme:dark;
  }
  @media (prefers-color-scheme: light){
    :root:not([data-theme="dark"]){
      --bg:#ffffff; --bg-2:#f7f7f8;
      --panel-bg:#f2f2f4; --panel-bg-strong:#e7e7ea;
      --pill-bg:#e6e6ea;
      --panel-border:rgba(0,0,0,0.08); --panel-border-strong:rgba(0,0,0,0.15);
      --text:#0e0e10; --text-dim:#68686f; --text-faint:#9a9aa1;
      /* accent palette is deliberately identical to the dark theme's (not
         re-tuned per theme) — a color like "голубой" should stay the same
         color when switching themes, not shift toward a different hue just
         because the background changed. --btn-text follows suit: it only
         ever sits on top of these accent colors (never the plain bg), so it
         stays fixed at the dark value that contrasts correctly against them. */
      --accent:#ff9d4d; --accent-2:#3ec2ff; --accent-2-dark:#2ba3dd; --accent-3:#a06bff;
      --accent-pink:#ff5fa2; --accent-yellow:#ffd23f; --danger:#ff5c5c;
      --ai:#6f6bff;
      --cat-1:#3ec2ff; --cat-2:#ff9d4d; --cat-3:#a06bff; --cat-4:#2fd4a0; --cat-5:#ff5fa2; --cat-6:#ffd23f;
      --ev-green:#52e6a0; --ev-cyan:#37c9ff; --ev-pink:#ff5fc9; --ev-purple:#9d6bff; --ev-blue:#2f5fdb;
      --shadow:0 10px 26px -16px rgba(0,0,0,0.14);
      --btn-text:#0a0a10;
      --grid-line:rgba(72,104,140,0.24);
      color-scheme:light;
    }
  }
  :root[data-theme="light"]{
    --bg:#ffffff; --bg-2:#f7f7f8;
    --panel-bg:#f2f2f4; --panel-bg-strong:#e7e7ea;
    --pill-bg:#e6e6ea;
    --panel-border:rgba(0,0,0,0.08); --panel-border-strong:rgba(0,0,0,0.15);
    --text:#0e0e10; --text-dim:#68686f; --text-faint:#9a9aa1;
    --accent:#dd7f28; --accent-2:#0a84ff; --accent-2-dark:#0a75e0; --accent-3:#7a4fe0;
    --accent-pink:#e0397e; --accent-yellow:#c99400; --danger:#e0453c;
    --ai:#5b56f0;
    --cat-1:#0a84ff; --cat-2:#dd7f28; --cat-3:#7a4fe0; --cat-4:#199468; --cat-5:#e0397e; --cat-6:#c99400;
    --ev-green:#52e6a0; --ev-cyan:#37c9ff; --ev-pink:#ff5fc9; --ev-purple:#9d6bff; --ev-blue:#2f5fdb;
    --shadow:0 10px 26px -16px rgba(0,0,0,0.14);
    --btn-text:#ffffff;
    --grid-line:rgba(72,104,140,0.24);
    color-scheme:light;
  }
  :root[data-theme="dark"]{
    --bg:#000000; --bg-2:#0d0d0f;
    --panel-bg:#161618; --panel-bg-strong:#212124;
    --pill-bg:#18181b;
    --panel-border:rgba(255,255,255,0.1); --panel-border-strong:rgba(255,255,255,0.19);
    --text:#f4f5f7; --text-dim:#9b9ba3; --text-faint:#6e6e75;
    --accent:#ff9d4d; --accent-2:#3ec2ff; --accent-2-dark:#2ba3dd; --accent-3:#a06bff;
    --accent-pink:#ff5fa2; --accent-yellow:#ffd23f; --danger:#ff5c5c;
    --ai:#6f6bff;
    --cat-1:#3ec2ff; --cat-2:#ff9d4d; --cat-3:#a06bff; --cat-4:#2fd4a0; --cat-5:#ff5fa2; --cat-6:#ffd23f;
    --ev-green:#52e6a0; --ev-cyan:#37c9ff; --ev-pink:#ff5fc9; --ev-purple:#9d6bff; --ev-blue:#2f5fdb;
    --shadow:0 14px 32px -18px rgba(0,0,0,0.5);
    --btn-text:#0a0a10;
    --grid-line:rgba(72,92,114,0.26);
    color-scheme:dark;
  }
  *{box-sizing:border-box;}
  html{overscroll-behavior:none;}
  /* Panels toggle display:none on a large sibling every switch (the outgoing
     one, ~220ms into the transition) — the browser's scroll anchoring tries
     to compensate for that size change by nudging scroll position to keep
     whatever it thinks was "anchored" in view, which is exactly what read
     as content opening mid-screen and then jumping up to where it actually
     belongs a beat later. We already drive scroll/visibility ourselves
     (switchTab resets it up front, the reveal is its own rAF-timed
     transition), so that automatic compensation only fights it. */
  html, body{overflow-anchor:none;}
  body{margin:0; background:var(--bg); color:var(--text); font-family:var(--font-text); padding-bottom:calc(96px + env(safe-area-inset-bottom)); overflow-x:hidden; overscroll-behavior:none; touch-action:pan-y;}
  h1,h2,h3{font-family:'Unbounded',system-ui,sans-serif; margin:0; font-weight:700;}
  .mono{font-family:var(--font-text); font-weight:700; font-variant-numeric:tabular-nums;}
  p{margin:0;}

  :root{--tg-safe-top:0px;}
  .wrap{position:relative; z-index:1; max-width:640px; margin:0 auto; padding:calc(var(--tg-safe-top) - 18px) 16px 8px; transform:translateX(var(--drawer-shift, 0px)); transition:transform .3s cubic-bezier(.2,.8,.2,1);}
  header{
    position:sticky; top:calc(var(--tg-safe-top, 0px) - 18px); z-index:10; background:none;
    display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; min-height:38px; padding-bottom:2px;
  }
  header h1{font-size:1.15rem; margin:0;}
  .header-title{
    position:absolute; left:50%; top:50%; transform:translate(-50%, calc(-50% - 22px)); z-index:1;
    display:flex; align-items:center; gap:6px; pointer-events:none; transition:transform .2s ease;
    background:var(--pill-bg); border:1px solid var(--panel-border); border-radius:999px;
    padding:4px 14px 4px 6px; backdrop-filter:blur(20px) saturate(1.6); -webkit-backdrop-filter:blur(20px) saturate(1.6);
    box-shadow:0 8px 20px -10px rgba(0,0,0,0.5);
  }  .header-title > *{position:relative;}
  .header-logo{width:30px; height:30px; object-fit:contain; display:block; flex:none;}
  :root[data-theme="light"] .header-logo{filter:brightness(0);}
  .header-right{display:flex; align-items:center; gap:8px;}
  header.agent-mode #menu-btn, header.agent-mode .header-right{transform:translateY(24px); transition:transform .2s ease;}
  .status{font-family:'Unbounded'; font-weight:700; font-size:0.68rem; color:var(--text-faint);}

  /* The floating nav is two separate glass pieces now — the 3-tab capsule
     (#tabbar) and the standalone search button (.tabbar-search) — held
     together by this dock, which owns everything about the control's
     position/visibility as ONE unit (fixed placement + centering, the
     scroll shrink, hiding for the keyboard/agent-mode/inline-edit, and the
     swipe-away collapse into the corner capsule). Neither child carries any
     of that itself — #tabbar is just a plain flex item now, so its own
     jelly-pulse bump (further down) only ever needs a bare scale(), no
     position math to preserve. */
  /* Width now matches the content column above it (.wrap: max-width:640px
     minus its own 16px+16px side padding = 608px) instead of hugging its
     own content — so the dock's outer edges line up with a card/the
     calendar behind it, same as the reference. .tabbar and its 3 tabs
     below flex-grow to fill that width evenly (see .tabbar/.tab). */
  .tabbar-dock{
    position:fixed; left:50%; bottom:calc(14px + env(safe-area-inset-bottom)); transform:translateX(calc(-50% + var(--drawer-shift, 0px))) translateY(0) scale(1);
    z-index:50; width:calc(100vw - 32px); max-width:608px;
    display:flex; align-items:center; gap:10px;
    transition:transform .32s cubic-bezier(.4,0,.2,1), opacity .22s ease;
  }
  .tabbar-dock.scrolled{transform:translateX(calc(-50% + var(--drawer-shift, 0px))) translateY(10px) scale(0.82);}
  /* out of the way while editing a transcript line in place — the on-screen
     keyboard is already covering most of the bottom of the screen then. */
  .tabbar-dock.hidden-for-edit{opacity:0; pointer-events:none; transform:translateX(calc(-50% + var(--drawer-shift, 0px))) translateY(40px) scale(.82);}
  .tabbar-dock.kb-hidden, .tabbar-dock.agent-mode, .tabbar-dock.note-mode{transform:translateX(calc(-50% + var(--drawer-shift, 0px))) translateY(140%); opacity:0; pointer-events:none;}
  .tabbar-dock.swipe-collapsed{transition:transform .42s cubic-bezier(.4,0,.2,1), opacity .38s ease; transform-origin:right center; transform:translateX(calc(-50% + var(--drawer-shift, 0px) + 220px)) translateY(0) scale(0.15); opacity:0; pointer-events:none;}
  .tabbar-dock.swipe-collapsed-left{transition:transform .42s cubic-bezier(.4,0,.2,1), opacity .38s ease; transform-origin:left center; transform:translateX(calc(-50% + var(--drawer-shift, 0px) - 220px)) translateY(0) scale(0.15); opacity:0; pointer-events:none;}
  .tabbar{
    position:relative; flex:1; min-width:0; display:flex; align-items:center; gap:2px; padding:4px; border-radius:999px;
    background-color:color-mix(in srgb, var(--pill-bg) 28%, transparent);
    border:1px solid var(--panel-border-strong);
    backdrop-filter:blur(34px) saturate(2); -webkit-backdrop-filter:blur(34px) saturate(2);
    box-shadow:0 22px 50px -16px rgba(0,0,0,0.6);
    touch-action:none;
    transition:transform .3s cubic-bezier(.22,1,.36,1), background-color .3s ease;
  }
  /* Holding the indicator down — capsule grows to the exact same size its
     own quick-switch bounce peaks at (tabbarLiquidPulse's scale(1.028)) and
     brightens a touch, both smoothly, as long as the press lasts. */
  .tabbar.held{
    transform:scale(1.028);
    background-color:color-mix(in srgb, var(--pill-bg) 56%, transparent);
  }
  /* Exact circle, same height as the 3-tab capsule — sized in JS
     (syncSearchButtonSize()) by measuring #tabbar's real rendered height,
     rather than via aspect-ratio deriving width from a flex-stretched
     cross-size, which isn't reliable in every WebView this app runs in.
     54px is just the pre-JS fallback so nothing flashes unsized. */
  .tabbar-search{
    position:relative; flex:none; width:54px; height:54px; box-sizing:border-box; border-radius:50%;
    display:flex; align-items:center; justify-content:center; cursor:pointer; padding:0;
    color:var(--text-dim); background:color-mix(in srgb, var(--pill-bg) 28%, transparent);
    border:1px solid var(--panel-border-strong);
    backdrop-filter:blur(34px) saturate(2); -webkit-backdrop-filter:blur(34px) saturate(2);
    box-shadow:0 22px 50px -16px rgba(0,0,0,0.6);
  }
  .tabbar-search:active{color:var(--text);}
  .tabbar-search svg{width:27px; height:27px; stroke:currentColor; fill:none; stroke-width:2.1; stroke-linecap:round; stroke-linejoin:round; display:block;}
  @supports not (hanging-punctuation:first){
    .tabbar, .tabbar-search, .tabbar-collapse-add, .tabbar-collapse-btn{
      backdrop-filter:url(#tabbarLiquidGlass) blur(18px) saturate(2);
      -webkit-backdrop-filter:blur(18px) saturate(2);
    }
  }
  /* Swipe-collapsed tabbar leaves behind this two-button stack instead of a
     single button: "+" on top (add event, no need to expand the tabbar
     first) and the hamburger below it (expand / double-tap for the AI
     shortcut, as before) — now two separate glass pills with a gap between
     them, matching the two-separate-capsules look the main dock itself
     uses, instead of one pill cut in half by a hairline divider. */
  .tabbar-collapse-cluster{
    position:fixed; right:calc(14px + env(safe-area-inset-right, 0px)); bottom:calc(14px + env(safe-area-inset-bottom)); z-index:50;
    display:flex; flex-direction:column; gap:8px; width:56px; touch-action:none;
    opacity:0; transform:scale(0.3); pointer-events:none;
    transition:opacity .38s ease .1s, transform .42s cubic-bezier(.34,1.56,.64,1) .1s;
  }
  .tabbar-collapse-cluster.left-side{right:auto; left:calc(14px + env(safe-area-inset-left, 0px));}
  .tabbar-collapse-cluster.visible{opacity:1; transform:scale(1); pointer-events:auto;}
  .tabbar-collapse-cluster.dragging .tabbar-collapse-add, .tabbar-collapse-cluster.dragging .tabbar-collapse-btn{
    box-shadow:0 22px 50px -14px rgba(0,0,0,0.65);
  }
  .tabbar-collapse-cluster.dragging{transform:scale(1.06);}
  .tabbar-collapse-add, .tabbar-collapse-btn{
    position:relative; width:56px; height:56px; box-sizing:border-box; cursor:pointer; border-radius:999px;
    background:color-mix(in srgb, var(--pill-bg) 55%, transparent); border:1px solid var(--panel-border-strong);
    backdrop-filter:blur(24px) saturate(2); -webkit-backdrop-filter:blur(24px) saturate(2);
    box-shadow:0 14px 32px -14px rgba(0,0,0,0.5);
    display:flex; align-items:center; justify-content:center; transition:background .15s ease;
  }
  .tabbar-collapse-add:active, .tabbar-collapse-btn:active{background:rgba(255,255,255,0.1);}
  .tabbar-collapse-add svg, .tabbar-collapse-btn svg{position:relative; z-index:1; width:22px; height:22px; stroke:var(--text); fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round;}
  /* while recording in Диктофон, this same "+" slot doubles as the важно flag —
     mirrors how it's the quick-add button everywhere else, just context-aware. */
  .tabbar-collapse-add.flag-mode svg{stroke:#fff; fill:none;}
  .hold-glow-ring{
    position:absolute; inset:0; z-index:3; border-radius:inherit; padding:2px; box-sizing:border-box;
    background:conic-gradient(from var(--beam-angle), transparent 0deg, transparent 250deg, #52e6a0 275deg, #37c9ff 300deg, #ff5fc9 325deg, #9d6bff 350deg, transparent 360deg);
    -webkit-mask:linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask:linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite:xor; mask-composite:exclude;
    pointer-events:none; filter:drop-shadow(0 0 5px rgba(130,120,255,0.5));
    opacity:0; transition:opacity .15s ease;
  }
  .charging .hold-glow-ring{opacity:1; animation:beamRotate .6s linear infinite;}
  .tab-indicator{
    position:absolute; top:4px; bottom:4px; border-radius:999px;
    background:color-mix(in srgb, var(--text) 20%, transparent);
    transition:left .5s cubic-bezier(.22,1,.36,1), width .5s cubic-bezier(.22,1,.36,1), opacity .2s ease, transform .3s cubic-bezier(.22,1,.36,1); z-index:0;
  }
  /* Holding the indicator down — it grows to the exact same size its own
     quick-switch bounce peaks at (indicatorLiquidPulse's scale(1.2)),
     smoothly, as long as the press lasts. */
  .tab-indicator.held{transform:scale(1.2);}
  /* iOS-style "liquid glass" tap bounce, fired once per tab switch — a single
     continuous keyframe animation (not two transitions handed off via JS,
     which left an audible "seam"/velocity jump where they met), using the
     plain `ease-in-out` timing keyword for the whole thing — deliberately
     the least clever option: fully symmetric acceleration in, deceleration
     out, no front-loaded snap on either the grow or the shrink half. Uniform
     `scale()` only (never scaleX/scaleY) so icons/text never get stretched,
     and transform-origin is pinned to the element's own center — now purely
     cosmetic (#tabbar no longer carries the dock's position transform, so
     there's nothing left to preserve), kept in case jellyBounce() is ever
     pointed at the dock itself. jellyBounce() also clears any inline
     transform-origin override defensively before playing either way.

     Bar and tab grow together and peak together (29% into their shared
     0.42s pulse, i.e. 0.12s — quicker than the 0.15s this replaced) then
     shrink straight back down, at the *same* 0.3s pace as before, done by
     0.42s. The pill grows and peaks at that same 0.12s mark too (its own
     pulse runs 0.56s, so 0.12s lands at 0.12/0.56 = 21%) — but then
     *holds* at the peak size through a flat plateau until 75% of its own
     timeline (0.75 × 0.56s = 0.42s — matching when the bar's pulse
     finishes), only beginning its own visible shrink once the bar has
     fully come to rest, so the two shrinks never overlap; that shrink is
     itself quicker too now (0.14s, down from 0.18s). No color change —
     scale only. The search button (a separate glass piece now) gets the
     same bare-scale .tab bump on its own tap, reusing tabLiquidPulse
     directly. */
  .tabbar, .tab, .tab-indicator, .tabbar-search{transform-origin:center center;}
  @keyframes indicatorLiquidPulse{
    0%{transform:scale(1);}
    21%{transform:scale(1.2);}
    75%{transform:scale(1.2);}
    100%{transform:scale(1);}
  }
  .tab-indicator.jelly-pulse{animation:indicatorLiquidPulse .56s ease-in-out;}
  @keyframes tabbarLiquidPulse{
    0%{transform:scale(1);}
    29%{transform:scale(1.028);}
    100%{transform:scale(1);}
  }
  /* Same brighten-then-settle the press-and-hold .held state uses, just
     replayed as a one-shot pulse in sync with the switch bounce above. */
  @keyframes tabbarLightenPulse{
    0%{background-color:color-mix(in srgb, var(--pill-bg) 28%, transparent);}
    29%{background-color:color-mix(in srgb, var(--pill-bg) 56%, transparent);}
    100%{background-color:color-mix(in srgb, var(--pill-bg) 28%, transparent);}
  }
  .tabbar.jelly-pulse{animation:tabbarLiquidPulse .42s ease-in-out, tabbarLightenPulse .42s ease-in-out;}
  .tabbar-search.jelly-pulse{animation:tabbarLiquidPulse .42s ease-in-out;}
  /* Equal-width (not content-based) — Главная/Агент/Дедлайны are different
     label lengths, so auto-width tabs threw the middle (Агент) button off
     visual-center within the 3-tab capsule. flex:1 on all three keeps them
     identical AND lets them stretch together to fill the now much wider
     capsule (it spans the content column, not just its own content), since
     the middle one of three equal cells always lands on the capsule's own
     center either way. */
  .tab{
    position:relative; z-index:1; flex:1; min-width:0; display:flex; flex-direction:column; align-items:center; justify-content:center;
    gap:1px; padding:5px 5px; border-radius:999px; cursor:pointer; color:var(--text-dim); transition:color .2s;
  }
  @keyframes tabLiquidPulse{
    0%{transform:scale(1);}
    29%{transform:scale(1.065);}
    100%{transform:scale(1);}
  }
  .tab.jelly-pulse{animation:tabLiquidPulse .42s ease-in-out;}
  .tab svg{width:27px; height:27px; stroke:currentColor; fill:none; stroke-width:2.1; stroke-linecap:round; stroke-linejoin:round; display:block;}
  .tab span{font-family:'Unbounded'; font-size:0.6rem; font-weight:700; white-space:nowrap;}
  /* Color used to come from here (.active/.drag-preview → bright), which
     fought with the granular .tab-color-overlay reveal below — a tab kept
     its own permanent bright color whenever it was "active", regardless of
     where the indicator pill had actually been dragged to, and a mid-drag
     "best overlap" match got colored solid instead of partially. Color now
     comes ONLY from the overlay's clip-path, so it always exactly matches
     the indicator's real position, including mid-letter and mid-drag. */
  /* Per-tab "color reveal" overlay — a live clone of each tab (see
     setupTabColorReveal()/updateColorReveal() in JS), stacked exactly on
     top of the original and always in the bright/active color, but clipped
     via clip-path to only whatever sliver of that tab the indicator pill
     currently physically covers (updated continuously, including mid-drag).
     So a tab under just the left third of the indicator shows only its
     left third — down to splitting a single letter — in the bright color;
     the rest stays dim. Reuses the plain .tab/.tab svg/.tab span rules for
     identical layout (same class), so it can't drift out of alignment with
     the original; only inert (no clicks) and colored differently. Kept
     scoped to "#tabbar > .tab" rather than bare ".tab" in the handful of
     JS selectors that must only ever match the 3 real, interactive tabs
     (click wiring, active-state toggling, drag overlap/preview) — this
     overlay is a *nested* clone, so it never matches a direct-child
     selector, but would silently match a bare ".tab" query alongside the
     real tabs. */
  .tab-color-overlay{position:absolute; inset:0; z-index:2; pointer-events:none; clip-path:inset(0 100% 0 0);}
  .tab.tab-color-overlay{color:var(--text);}

  /* Дедлайны tab morphs into a "+" once you're already on that tab, so it doubles
     as the add-event button instead of a separate floating one. */
  .tab-icon-slot{position:relative; width:27px; height:27px; display:block;}
  .tab-icon-slot svg{position:absolute; inset:0; transition:opacity .3s ease, transform .4s cubic-bezier(.34,1.56,.64,1);}
  .tab-icon-add{opacity:0; transform:scale(.35) rotate(-135deg);}
  #tab-deadlines.show-add .tab-icon-main{opacity:0; transform:scale(.35) rotate(135deg);}
  #tab-deadlines.show-add .tab-icon-add{opacity:1; transform:scale(1) rotate(0deg);}

  /* Same 24px slot as every other tab icon — keeps the identical
     icon→gap→label rhythm as the rest of the bar regardless of size. */
  .tab-agent-btn{position:relative; display:flex; align-items:center; justify-content:center; height:27px;}
  /* an iridescent glow sitting behind the star — sized to match the icon itself
     (not the flex row's own box). No pulsing (fixed size/opacity) — just the
     colors themselves gently drifting through hue via hue-rotate, and kept
     to a narrow ±22deg swing around cyan/pink/purple so it never drifts far
     enough to pass through green. */
  .tab-agent-glow{
    position:absolute; top:50%; left:50%; width:25px; height:25px;
    transform:translate(-50%,-50%);
    z-index:0; border-radius:50%; pointer-events:none; opacity:.4;
    background:radial-gradient(circle, #37c9ff 0%, #9d6bff 55%, #ff5fc9 100%);
    filter:blur(8px);
    animation:tabAgentGlowShift 6s ease-in-out infinite;
  }
  @keyframes tabAgentGlowShift{
    0%,100%{filter:blur(8px) hue-rotate(-22deg);}
    50%{filter:blur(8px) hue-rotate(22deg);}
  }
  .tab-agent-btn svg{
    position:relative; z-index:1;
    width:27px; height:27px; flex:none; stroke:#fff; stroke-width:0.75; stroke-linejoin:round; stroke-linecap:round; fill:url(#agentIconGradient);
    filter:drop-shadow(0 0 4px rgba(130,120,255,0.55)) drop-shadow(0 0 9px rgba(80,220,170,0.3));
    transition:transform .25s cubic-bezier(.4,0,.2,1);
    animation:agentIconGlow 4.5s ease-in-out infinite;
  }
  @keyframes agentIconGlow{
    0%,100%{filter:drop-shadow(0 0 4px rgba(130,120,255,0.55)) drop-shadow(0 0 9px rgba(80,220,170,0.3));}
    50%{filter:drop-shadow(0 0 6px rgba(255,95,201,0.6)) drop-shadow(0 0 11px rgba(55,201,255,0.35));}
  }
  .tab-agent.active .tab-agent-btn svg{transform:scale(1.12);}

  /* Трекер tab: fired once on switching in (not a static active state) — tells
     the feature's own story in miniature instead of one flat icon-wide bounce:
     the waveform bars bounce like live audio being picked up, the page pops in
     right after, then the two text lines "type" themselves onto it, as if the
     recording had just turned into a transcript. */
  .tab[data-tab="notes"] svg{transition:transform .2s ease;}
  .tab[data-tab="notes"] svg *{transform-box:fill-box; transform-origin:center;}
  .tab[data-tab="notes"].mic-pulse svg .wf-bar1{animation:trackerWave .48s ease-in-out;}
  .tab[data-tab="notes"].mic-pulse svg .wf-bar2{animation:trackerWave .48s ease-in-out .08s;}
  .tab[data-tab="notes"].mic-pulse svg .doc-body,
  .tab[data-tab="notes"].mic-pulse svg .doc-flap{animation:trackerDocPop .42s cubic-bezier(.34,1.56,.64,1) .14s;}
  .tab[data-tab="notes"].mic-pulse svg .doc-line{animation:trackerLineDraw .2s ease-out .3s both;}
  .tab[data-tab="notes"].mic-pulse svg .doc-line1{stroke-dasharray:5;}
  .tab[data-tab="notes"].mic-pulse svg .doc-line2{stroke-dasharray:5; animation-delay:.42s;}
  @keyframes trackerWave{
    0%,100%{transform:scaleY(1);}
    35%{transform:scaleY(1.85);}
    65%{transform:scaleY(0.6);}
  }
  @keyframes trackerDocPop{
    0%{opacity:.35; transform:scale(.82);}
    70%{opacity:1; transform:scale(1.08);}
    100%{opacity:1; transform:scale(1);}
  }
  @keyframes trackerLineDraw{
    from{stroke-dashoffset:5;}
    to{stroke-dashoffset:0;}
  }

  /* Главная tab: one-shot-on-switch, like the other tabs — but drawn like a
     pen tracing the outline rather than dropping/popping into place. The
     roofline strokes itself in first, then the walls follow right after —
     both via stroke-dasharray/dashoffset on these outline-only icons
     (fill:none already, so the stroke IS the whole icon). Smooth
     deceleration only (no elastic overshoot) to match the rest of this
     bar's "liquid glass" language. Dasharray values are a safe
     overestimate of each path's actual length — offset:0 always ends up
     fully drawn regardless of the small margin. */
  .tab[data-tab="home"] svg .home-roof{stroke-dasharray:24;}
  .tab[data-tab="home"] svg .home-body{stroke-dasharray:44;}
  .tab[data-tab="home"].home-pulse svg .home-roof{animation:homeRoofDraw .48s cubic-bezier(.22,1,.36,1);}
  .tab[data-tab="home"].home-pulse svg .home-body{animation:homeBodyDraw .5s cubic-bezier(.22,1,.36,1) .1s backwards;}
  @keyframes homeRoofDraw{
    0%{stroke-dashoffset:24; opacity:0;}
    18%{opacity:1;}
    100%{stroke-dashoffset:0; opacity:1;}
  }
  @keyframes homeBodyDraw{
    0%{stroke-dashoffset:44; opacity:0;}
    18%{opacity:1;}
    100%{stroke-dashoffset:0; opacity:1;}
  }

  /* was -24px, tuned back when the header just scrolled away with everything
     else. Now that the header is permanently sticky (pinned on top, higher
     z-index), that big a pull tucked every panel's first row ~10px under it,
     permanently — not just for a scroll instant. -10px keeps the same tucked-in
     feel with a small positive clearance instead. */
  .panel{display:none; opacity:0; transform:translateY(8px); transition:opacity .22s ease, transform .22s cubic-bezier(.2,.8,.2,1); margin-top:-10px;}
  #panel-agent{margin-top:0;}
  #panel-home, #panel-notes, #panel-notes-all, #panel-note-detail, #panel-deadlines, #panel-templates{margin-top:-28px;}
  .panel.active{display:block;}
  .panel.active.show{opacity:1; transform:translateY(0);}
  .panel.push-enter{transform:translateX(28px); opacity:0;}
  .panel.push-exit{transform:translateX(-28px); opacity:0;}
  .panel.pop-enter{transform:translateX(-28px); opacity:0;}
  .panel.pop-exit{transform:translateX(28px); opacity:0;}

  .glass{
    position:relative; overflow:hidden;
    background:var(--pill-bg); border:1px solid var(--panel-border); border-radius:20px;
    backdrop-filter:blur(20px) saturate(1.6); -webkit-backdrop-filter:blur(20px) saturate(1.6);
    box-shadow:0 16px 36px -20px rgba(0,0,0,0.55);
  }  .glass > *{position:relative;}
  .card{padding:14px 16px; margin-bottom:10px;}
  .eyebrow{font-family:'Unbounded'; font-weight:700; font-size:0.68rem; color:var(--text-faint); text-transform:uppercase; letter-spacing:.05em;}
  .card h3{font-size:1rem; margin-top:4px;}
  .meta{font-family:var(--font-text); font-weight:600; font-size:0.74rem; color:var(--text-faint); margin-top:6px;}
  .empty{color:var(--text-faint); text-align:center; padding:26px 10px; font-size:0.88rem;}

  .toast-stack{position:fixed; left:50%; top:50%; transform:translate(-50%,-50%); z-index:60; display:flex; flex-direction:column; gap:10px; align-items:center; pointer-events:none;}
  .toast{display:flex; align-items:center; gap:10px; background:var(--panel-bg-strong); border:1px solid var(--panel-border-strong); border-radius:20px; padding:16px 26px; font-size:0.94rem; font-weight:700; color:var(--text); box-shadow:var(--shadow); opacity:0; transform:translateY(10px) scale(.94); filter:blur(4px); transition:opacity .3s ease, transform .3s cubic-bezier(.2,.8,.2,1), filter .3s ease;}
  .toast.show{opacity:1; transform:translateY(0) scale(1); filter:blur(0);}
  .toast svg{width:19px; height:19px; stroke:var(--accent-2); fill:none; stroke-width:2.4; stroke-linecap:round; stroke-linejoin:round; flex:none;}
  .toast svg path{stroke-dasharray:24; stroke-dashoffset:24; animation:checkDraw .35s ease-out .18s forwards;}
  @keyframes checkDraw{ to{stroke-dashoffset:0;} }

  .shake{animation:shakeX .4s cubic-bezier(.36,.07,.19,.97);}
  @keyframes shakeX{ 10%,90%{transform:translateX(-1px);} 20%,80%{transform:translateX(2px);} 30%,50%,70%{transform:translateX(-4px);} 40%,60%{transform:translateX(4px);} }

  :root{--drawer-shift:0px; --drawer-width:min(82vw, 320px);}
  .drawer-overlay{
    position:fixed; top:0; bottom:0; right:0; left:var(--drawer-width);
    background:rgba(140,140,148,0.4); z-index:70; opacity:0; pointer-events:none; transition:opacity .3s ease;
  }
  .drawer-overlay.open{opacity:1; pointer-events:auto;}
  .drawer{
    position:fixed; top:0; bottom:0; left:0; width:var(--drawer-width); z-index:71;
    background:var(--bg);
    padding:var(--tg-safe-top) 14px 14px; display:flex; flex-direction:column;
    transform:translateX(-100%); transition:transform .3s cubic-bezier(.2,.8,.2,1);
  }
  .drawer.open{transform:translateX(0);}
  .drawer-header{display:flex; align-items:center; justify-content:space-between; margin-bottom:14px;}
  .drawer-header h3{font-size:1.05rem;}
  .drawer-search-row{margin-bottom:12px;}
  .drawer-search-row .field{margin-top:0;}
  .drawer-nav{display:flex; flex-direction:column; gap:2px; margin-bottom:12px; padding-bottom:12px; border-bottom:1px solid var(--panel-border);}
  .drawer-item{display:flex; align-items:center; gap:13px; padding:11px 8px; border-radius:12px; cursor:pointer; color:var(--text); font-size:0.92rem; font-weight:600;}
  .drawer-item:active{background:var(--pill-bg);}
  .drawer-item svg{width:20px; height:20px; stroke:currentColor; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; flex:none;}
  .drawer-item-danger{color:var(--danger);}
  .drawer-new-chat{
    position:relative; overflow:hidden;
    display:inline-flex; align-items:center; gap:8px; padding:10px 16px; border-radius:20px; margin-bottom:14px;
    cursor:pointer; background:var(--accent-2-dark); color:var(--btn-text); font-size:0.86rem; font-weight:700;
    box-shadow:0 10px 24px -10px color-mix(in srgb, var(--accent-2-dark) 55%, transparent);
  }  .drawer-new-chat svg, .drawer-new-chat span{position:relative;}
  .drawer-new-chat svg{width:16px; height:16px; stroke:var(--btn-text); fill:none; stroke-width:2.2; stroke-linecap:round; flex:none;}
  .drawer-section-title{font-family:'Unbounded'; font-weight:700; font-size:0.66rem; text-transform:uppercase; letter-spacing:.05em; color:var(--text-faint); margin-bottom:8px;}
  .drawer-conversations{display:flex; flex-direction:column; gap:2px; flex:1; overflow-y:auto; min-height:0;}
  .drawer-conv-item{padding:10px 8px; border-radius:12px; cursor:pointer; color:var(--text-dim); font-size:0.88rem; font-weight:500; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
  .drawer-conv-item:active{background:var(--pill-bg);}
  .drawer-conv-item.active{background:var(--pill-bg); color:var(--text); font-weight:600;}
  .drawer-conv-item.hidden{display:none;}

  .agent-suggestions{display:flex; flex-direction:column; gap:2px; margin-bottom:8px;}
  .agent-suggestion{display:flex; align-items:center; gap:14px; padding:13px 8px; border-radius:12px; color:var(--text); font-size:0.95rem; font-weight:500;}
  .agent-suggestion svg{width:21px; height:21px; stroke:currentColor; fill:none; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; flex:none;}
  .agent-suggestion span{cursor:pointer;}
  .agent-suggestion span:active{text-decoration:underline;}

  .card-head{display:flex; align-items:center; gap:12px;}
  .card-head .card-body{flex:1; min-width:0;}
  .card-icon, .card-icon-sm{
    position:relative; overflow:hidden; flex:none;
    border-radius:50%; display:flex; align-items:center; justify-content:center;
    background:var(--panel-bg-strong); border:1px solid var(--panel-border);
    box-shadow:0 6px 14px -8px rgba(0,0,0,0.5);
  }  .card-icon{width:34px; height:34px;}
  .card-icon svg{position:relative; width:17px; height:17px; stroke:var(--text); fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round;}

  .card-eyebrow-row{display:flex; align-items:center; gap:8px; margin-bottom:12px;}
  .card-eyebrow-row .eyebrow{margin:0;}
  .card-icon-sm{width:24px; height:24px;}
  .card-icon-sm svg{position:relative; width:13px; height:13px; stroke:var(--text); fill:none; stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round;}


  /* outline:none — the browser's own default contentEditable focus ring
     (a blue rectangle) otherwise boxes the whole conspect the moment you
     tap into it to edit; caret-color matches the canvas's own so the two
     editing surfaces feel like the same page. */
  .note-body{font-size:0.92rem; line-height:1.55; white-space:pre-wrap; outline:none; caret-color:var(--accent-2);}
  .note-body b{color:var(--text);}
  .note-body code, .note-body pre, .agent-msg code, .agent-msg pre{font-family:'Space Mono',ui-monospace,monospace;}
  /* a plain-illustration photo the AI chose to embed (via [[PHOTO:N]]) rather
     than transcribe as text — fades in once actually loaded. */
  .note-photo-embed{display:block; margin:10px 0; border-radius:14px; overflow:hidden; background:var(--panel-bg-strong); min-height:40px;}
  .note-photo-embed.loading{min-height:120px; position:relative;}
  .note-photo-embed.loading::after{
    content:''; position:absolute; inset:0; margin:auto; width:26px; height:26px; border-radius:50%;
    border:3px solid var(--panel-border); border-top-color:var(--accent-2-dark); animation:recSpin .8s linear infinite;
  }
  .note-photo-embed-img{display:block; width:100%; max-height:340px; object-fit:cover; cursor:pointer; opacity:0; transition:opacity .3s ease;}
  .note-photo-embed.show .note-photo-embed-img{opacity:1;}
  /* drawings the AI redraws from photos (SVG in currentColor — follows the theme) */
  .note-drawing{margin:12px 0; padding:12px; border-radius:14px; background:var(--panel-bg-strong); color:var(--text);}
  .note-drawing svg{display:block; width:100%; height:auto; max-height:460px; overflow:visible;}
  .note-drawing figcaption{margin-top:8px; font-size:.8rem; color:var(--text-dim); text-align:center;}
  .note-body .katex-display{margin:12px 0; overflow-x:auto; overflow-y:hidden;}
  .note-body .katex{font-size:1.05em;}
  /* Real <table>/<pre class="mermaid"> from structure_note() (see
     templates.COMMON_SYSTEM) — new alongside the existing HTML tags/LaTeX.
     Tables get wrapped in .table-scroll by wrapTablesForScroll() (a plain
     <table> can't safely take overflow-x itself without breaking its own
     layout mode) so a wide table scrolls sideways inside its own lane
     instead of blowing out the card. */
  .table-scroll{overflow-x:auto; margin:12px 0;}
  .note-body table{white-space:normal; border-collapse:collapse; width:100%; font-size:0.86rem; margin:0;}
  .note-body th, .note-body td{padding:7px 10px; border:1px solid var(--panel-border); text-align:left; vertical-align:top;}
  .note-body th{background:var(--panel-bg-strong); font-weight:700; color:var(--text); white-space:nowrap;}
  .note-body tr:nth-child(even) td{background:color-mix(in srgb, var(--panel-bg-strong) 45%, transparent);}
  .note-body pre.mermaid{
    white-space:normal; background:var(--panel-bg); border:1px solid var(--panel-border); border-radius:16px;
    padding:16px 10px; margin:14px 0; overflow-x:auto; display:flex; justify-content:center; font-family:inherit;
  }
  .note-body pre.mermaid svg{max-width:100%; height:auto;}
  .note-body pre.mermaid.loading{min-height:60px; align-items:center; color:var(--text-faint); font-size:0.82rem;}
  /* AI-applied colored highlight — a rare, deliberate accent (see
     templates.COMMON_SYSTEM's "ВЫДЕЛЕНИЕ ЦВЕТОМ"), styled like a marker
     stroke behind the text rather than a solid highlighter block. Also
     applies inside .note-thumb-inner (the shrunk note-card previews) since
     those reuse the same .note-body markup. */
  .note-body mark, .note-thumb-inner mark{background:none; color:inherit; padding:0.04em 0.22em; border-radius:5px; box-decoration-break:clone; -webkit-box-decoration-break:clone;}
  .note-body mark.hl-y, .note-thumb-inner mark.hl-y{background:color-mix(in srgb, var(--accent-yellow) 38%, transparent);}
  .note-body mark.hl-g, .note-thumb-inner mark.hl-g{background:color-mix(in srgb, var(--ev-green) 34%, transparent);}
  .note-body mark.hl-b, .note-thumb-inner mark.hl-b{background:color-mix(in srgb, var(--ev-cyan) 32%, transparent);}
  .note-body mark.hl-p, .note-thumb-inner mark.hl-p{background:color-mix(in srgb, var(--ev-pink) 30%, transparent);}
  /* Per-note "hide highlights" flag (note.marks_hidden) — keeps the marked
     text, just drops the colored background, rather than stripping the
     <mark> tags themselves (so turning it back on needs no re-generation).
     No UI toggle for this right now (used to live in the removed edit
     form) — the field/class still work, just nothing sets them yet. */
  .note-body.marks-off mark{background:none !important;}

  .photo-lightbox{
    position:fixed; inset:0; z-index:90; background:rgba(0,0,0,0.88); display:flex; align-items:center; justify-content:center;
    opacity:0; pointer-events:none; transition:opacity .25s ease; padding:24px;
  }
  .photo-lightbox.open{opacity:1; pointer-events:auto;}
  .photo-lightbox img{max-width:100%; max-height:100%; border-radius:16px; box-shadow:0 30px 70px -20px rgba(0,0,0,0.7); transform:scale(.92); transition:transform .25s cubic-bezier(.22,1.1,.36,1);}
  .photo-lightbox.open img{transform:scale(1);}
  .row{display:flex; gap:8px; margin-top:10px;}
  .btn{
    flex:1; text-align:center; padding:11px; border-radius:20px; border:1px solid var(--panel-border);
    background:var(--panel-bg-strong);
    color:var(--text); font-family:'Unbounded'; font-size:0.85rem; font-weight:700; cursor:pointer;
    backdrop-filter:blur(20px) saturate(1.6); -webkit-backdrop-filter:blur(20px) saturate(1.6);
    box-shadow:0 6px 16px -8px rgba(0,0,0,0.5);
    transition:transform .15s ease;
  }
  .btn:active{transform:scale(.97);}
  .btn.danger{color:var(--danger);}
  .btn.primary{
    background:var(--accent-2-dark);
    color:var(--btn-text); border:none;
    box-shadow:0 10px 24px -10px color-mix(in srgb, var(--accent-2-dark) 55%, transparent);
  }
  .field{width:100%; max-width:100%; min-width:0; box-sizing:border-box; display:block; background:var(--pill-bg); border:1px solid var(--panel-border); border-radius:14px; color:var(--text); font-family:inherit; font-size:16px; padding:11px 13px; margin-top:8px; -webkit-appearance:none; appearance:none;}
  textarea.field{min-height:70px; resize:vertical;}
  input[type="date"].field{font-family:inherit;}
  input[type="time"].field{font-family:inherit; height:44px; padding:0 13px; display:flex; align-items:center; -webkit-appearance:none; appearance:none;}
  .back{font-family:'Unbounded'; font-weight:700; font-size:0.82rem; color:var(--accent-2); cursor:pointer; margin-bottom:10px; display:inline-block;}
  /* only ever used for the note-detail "К трекеру" back link — a bit bigger
     than the shared .back default, with a real chevron icon instead of a bare
     unicode arrow character. */
  #back-to-notes, #back-to-notes-all, #back-from-note-folder, #ai-note-close{font-size:0.95rem; display:inline-flex; align-items:center; gap:5px;}
  #back-to-notes svg, #back-to-notes-all svg, #back-from-note-folder svg, #ai-note-close svg{width:17px; height:17px; stroke:currentColor; fill:none; stroke-width:2.4; stroke-linecap:round; stroke-linejoin:round; flex:none;}
  .tpl-item{display:flex; align-items:center; justify-content:space-between; padding:12px 14px; border-radius:14px; cursor:pointer;}
  .tpl-item:active{background:var(--panel-bg-strong);}
  .tpl-dot{width:8px; height:8px; border-radius:50%; background:var(--panel-border); flex:none;}
  .tpl-dot.active{background:var(--accent);}

  .week-nav{display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:10px;}
  .cal-day-nav-left{display:flex; align-items:center; gap:6px; flex:none;}
  #cal-day-card .cal-day-label{flex:1; text-align:center;}
  #cal-3day-card .week-range, #cal-week-card .week-range{flex:1; text-align:center;}
  .week-arrow{width:28px; height:28px; display:flex; align-items:center; justify-content:center; border-radius:50%; background:var(--panel-bg-strong); border:1px solid var(--panel-border); cursor:pointer; font-size:1rem; color:var(--text); user-select:none; transition:transform .15s ease;}
  .week-arrow:active{transform:scale(.9);}
  .week-range{font-size:1rem; color:var(--text);}
  /* ---------- Главная (redesigned) ---------- */
  .home-top-row{display:flex; align-items:center; justify-content:space-between; margin-bottom:18px;}
  .home-notif-btn{position:relative;}
  .home-notif-dot{
    position:absolute; top:9px; right:9px; width:9px; height:9px; border-radius:50%;
    background:var(--danger); border:2px solid var(--bg);
    opacity:0; transform:scale(.4); transition:opacity .25s ease, transform .3s cubic-bezier(.34,1.56,.64,1);
  }
  .home-notif-dot.show{opacity:1; transform:scale(1);}

  .home-hero{padding:10px 6px 26px; text-align:center;}
  .home-tagline{
    font-family:'Unbounded'; font-weight:700; font-size:1.36rem; line-height:1.32;
    color:var(--text); max-width:420px; margin:0 auto;
  }
  /* Retriggered from JS (remove class, force reflow, re-add — same pattern
     as .home-pulse/.mic-pulse elsewhere) every time Главная is entered and
     a new random line is picked, not baked into the base rule (which would
     only ever play once, on the element's first paint). */
  .home-tagline.pulse-in{animation:homeTaglineIn .62s cubic-bezier(.22,1,.36,1);}
  @keyframes homeTaglineIn{
    0%{opacity:0; transform:translateY(14px) scale(.94); filter:blur(6px);}
    100%{opacity:1; transform:translateY(0) scale(1); filter:blur(0);}
  }

  /* Full 4-color gradient ring (same stops as the logo's sparkle/the Агент
     tab icon), fixed in place (not spinning) — only the glow's intensity
     breathes. Built like the real AI chat's ring (mask a gradient down to
     just the outer padding-box edge via content-box + exclude).
     overflow:visible (overriding .glass's own overflow:hidden) so that
     glow isn't clipped. */
  .home-agent-quick{
    position:relative; z-index:1; overflow:visible; --beam-angle:0deg;
    display:flex; align-items:center; gap:8px;
    padding:6px 6px 6px 18px; margin-bottom:16px;
    box-shadow:0 16px 36px -20px rgba(0,0,0,0.55);
    -webkit-tap-highlight-color:transparent;
    /* A fixed radius, not 999px — at one line's height (~50px) this still
       clamps to a full pill (30px is already past the half-height needed
       for that), the exact same way .agent-pill's own fixed 30px does. Once
       the field grows past one line the box gets taller while this number
       stays put, so it gradually reads as a rounded rectangle purely as a
       side effect of the height changing — no separate class/transition
       needed, and no border-radius:999px→26px snap (animating a transition
       away from 999px barely moves for most of its duration, since the
       rendered radius stays clamped until the interpolated number finally
       drops near the box's own half-height — that dead time then a sudden
       catch-up right at the end was the "not smooth" jump). */
    border-radius:30px;
  }
  .home-agent-quick::after{
    content:''; position:absolute; inset:0; z-index:2; border-radius:inherit; padding:2px;
    background:linear-gradient(120deg, var(--ev-green), var(--ev-cyan), var(--ev-pink), var(--ev-purple));
    -webkit-mask:linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask:linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite:xor; mask-composite:exclude;
    pointer-events:none;
    animation:homeAgentGlowBreathe 4s ease-in-out infinite;
    opacity:1; transition:opacity .45s ease;
  }
  @keyframes homeAgentGlowBreathe{
    0%,100%{filter:drop-shadow(0 0 5px rgba(82,230,160,.4));}
    50%{filter:drop-shadow(0 0 9px rgba(157,107,255,.45));}
  }
  /* Tapping into the field: the calm full ring crossfades into the same
     traveling colored beam the real agent composer's own field uses
     (.agent-pill::after, reusing its beamRotate keyframe). A separate
     layer (::before is already .glass's own sheen overlay, so this is a
     real child span) rather than swapping ::after's background directly —
     a linear-gradient can't be transitioned into a conic-gradient, so
     cross-fading two always-present layers by opacity is what makes the
     switch itself look smooth instead of snapping. It keeps rotating at
     opacity:0 while idle, so fading it in never shows a jump-start either. */
  .home-agent-beam{
    position:absolute; inset:0; z-index:2; border-radius:inherit; padding:2px;
    background:conic-gradient(from var(--beam-angle), transparent 0deg, transparent 250deg, var(--ev-green) 275deg, var(--ev-cyan) 300deg, var(--ev-pink) 325deg, var(--ev-purple) 350deg, transparent 360deg);
    -webkit-mask:linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask:linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite:xor; mask-composite:exclude;
    pointer-events:none; filter:drop-shadow(0 0 7px rgba(130,120,255,0.5));
    animation:beamRotate 4.5s linear infinite;
    opacity:0; transition:opacity .45s ease;
  }
  .home-agent-quick:focus-within::after{opacity:0;}
  .home-agent-quick:focus-within .home-agent-beam{opacity:1;}
  .home-agent-input{
    flex:1; min-width:0; background:none; border:none; outline:none; color:var(--text);
    font-family:inherit; font-size:0.95rem; font-weight:600; padding:10px 0;
    -webkit-tap-highlight-color:transparent;
    line-height:1.35; resize:none; overflow-y:hidden; display:block;
    transition:height .22s cubic-bezier(.22,1,.36,1);
  }
  .home-agent-input:focus, .home-agent-input:focus-visible{outline:none;}
  .home-agent-input::placeholder{color:var(--text-faint); font-weight:600;}
  .home-agent-expand, .home-agent-send{
    flex:none; width:38px; height:38px; border-radius:50%; display:flex; align-items:center; justify-content:center;
    cursor:pointer; transition:transform .15s ease, background .15s ease, color .15s ease;
  }
  .home-agent-expand{color:var(--text-dim);}
  .home-agent-expand svg{width:17px; height:17px; stroke:currentColor; fill:none; stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round;}
  .home-agent-expand:active{transform:scale(.9); background:var(--panel-bg-strong);}
  /* Colorless until there's actually something to send — same idea as the
     real composer's own #agent-send (.mic-mode ⇄ .primary toggle via
     updateSendButtonMode()): an empty send button has nothing to *do* yet,
     so it stays quiet; typing something gives it the exact same solid
     --accent-2-dark treatment #agent-send gets once it has content.
     .has-text is toggled from JS on the input's "input" event. */
  .home-agent-send{
    background:transparent; box-shadow:none; color:var(--text-dim);
    border:1.5px solid var(--panel-border-strong);
    transition:background .2s ease, box-shadow .2s ease, color .2s ease, border-color .2s ease, transform .15s ease;
  }
  .home-agent-send.has-text{
    background:var(--accent-2-dark);
    box-shadow:0 8px 18px -8px color-mix(in srgb, var(--accent-2-dark) 60%, transparent);
    border-color:transparent;
    color:var(--btn-text);
  }
  .home-agent-send svg{width:17px; height:17px; stroke:currentColor; fill:none; stroke-width:2.4; stroke-linecap:round; stroke-linejoin:round;}
  .home-agent-send:active{transform:scale(.9);}

  .home-actions-row{display:flex; gap:12px; margin-top:14px;}
  .home-action-card{
    flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px;
    padding:24px 10px; border-radius:22px; cursor:pointer; text-align:center;
    transition:transform .15s cubic-bezier(.34,1.56,.64,1), box-shadow .2s ease;
  }
  .home-action-card:active{transform:scale(.96);}
  .home-action-icon{width:44px; height:44px; border-radius:50%; display:flex; align-items:center; justify-content:center; flex:none;}
  .home-action-icon svg{width:21px; height:21px; stroke:currentColor; fill:none; stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round;}
  .home-action-label{font-family:'Unbounded'; font-weight:700; font-size:0.85rem; line-height:1.3; color:var(--text);}
  /* Import picks its file and uploads right from Главная now (no more
     bouncing over to Трекер first to do that) — while it's working, the
     icon swaps for a spinner and the card stops responding to taps, so
     there's still visible feedback during the upload+transcribe wait even
     though the busy state (showProcessingUI) technically lives on the
     now off-screen Трекер panel. */
  .home-action-spinner{
    display:none; width:20px; height:20px; border-radius:50%;
    border:2.5px solid color-mix(in srgb, currentColor 25%, transparent); border-top-color:currentColor;
    animation:recSpin .8s linear infinite;
  }
  .home-action-card.loading{pointer-events:none;}
  .home-action-card.loading .home-action-icon svg{display:none;}
  .home-action-card.loading .home-action-spinner{display:block;}
  /* Blue (record) + pink (import) — both also show up in the AI pill's own
     gradient above, so they echo it instead of reading as unrelated app
     colors. */
  .home-action-record{
    background:color-mix(in srgb, var(--accent-2) 22%, var(--panel-bg));
    border-color:color-mix(in srgb, var(--accent-2) 42%, var(--panel-border));
  }
  .home-action-record .home-action-icon{background:color-mix(in srgb, var(--accent-2) 38%, transparent); color:var(--accent-2);}
  .home-action-import{
    background:color-mix(in srgb, var(--accent-pink) 22%, var(--panel-bg));
    border-color:color-mix(in srgb, var(--accent-pink) 42%, var(--panel-border));
  }
  .home-action-import .home-action-icon{background:color-mix(in srgb, var(--accent-pink) 38%, transparent); color:var(--accent-pink);}

  .notifications-empty{display:flex; flex-direction:column; align-items:center; text-align:center; padding:18px 8px 6px;}
  .notifications-empty-logo{
    width:104px; height:104px; object-fit:contain; margin-bottom:18px;
    filter:drop-shadow(0 0 22px color-mix(in srgb, var(--accent-3) 45%, transparent));
    animation:notifEmptyFloat 5s ease-in-out infinite;
  }
  /* brightness(0) first (blackens the line art), *then* the colored glow —
     the other way round, brightness(0) would also blacken the glow itself
     since it darkens everything already rendered by that point in the
     filter chain. */
  :root[data-theme="light"] .notifications-empty-logo{filter:brightness(0) drop-shadow(0 0 22px color-mix(in srgb, var(--accent-3) 30%, transparent));}
  @keyframes notifEmptyFloat{
    0%,100%{transform:translateY(0);}
    50%{transform:translateY(-7px);}
  }
  .notifications-empty h3{font-size:1.05rem; margin-bottom:6px;}
  .notifications-empty .meta{max-width:280px;}
  .notification-row{display:flex; align-items:flex-start; gap:12px; padding:13px 4px; border-bottom:1px solid var(--panel-border);}
  .notification-row:last-child{border-bottom:none;}
  .notification-row-icon{
    flex:none; width:36px; height:36px; border-radius:50%; display:flex; align-items:center; justify-content:center;
    background:color-mix(in srgb, var(--accent-3) 22%, var(--panel-bg)); color:var(--accent-3);
  }
  .notification-row-icon svg{width:17px; height:17px; stroke:currentColor; fill:none; stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round;}
  .notification-row-body{flex:1; min-width:0;}
  .notification-row-body h3{font-size:0.88rem; margin-bottom:2px;}
  .notification-row.unread .notification-row-body h3::after{content:''; display:inline-block; width:6px; height:6px; border-radius:50%; background:var(--danger); margin-left:7px; vertical-align:middle;}

  .agent-log{display:flex; flex-direction:column; gap:14px; margin-bottom:14px;}
  .agent-msg{font-size:0.86rem; line-height:1.5; animation:msgIn .3s cubic-bezier(.2,.8,.2,1);}
  .agent-msg.user{align-self:flex-end; max-width:85%; padding:9px 13px; border-radius:14px; background:var(--accent-2); color:var(--btn-text); font-weight:600; border-bottom-right-radius:4px;}
  .agent-msg.reply{align-self:stretch; width:100%; color:var(--text);}
  @keyframes msgIn{ from{opacity:0; transform:translateY(8px) scale(.97);} to{opacity:1; transform:translateY(0) scale(1);} }

  .typing-dots{display:inline-flex; gap:3px; align-items:center; padding:3px 0;}
  .typing-dots span{width:6px; height:6px; border-radius:50%; background:currentColor; opacity:.35; animation:typingBounce 1.1s ease-in-out infinite;}
  .typing-dots span:nth-child(2){animation-delay:.15s;}
  .typing-dots span:nth-child(3){animation-delay:.3s;}
  @keyframes typingBounce{ 0%,60%,100%{transform:translateY(0); opacity:.35;} 30%{transform:translateY(-4px); opacity:1;} }

  .agent-attach-preview{display:flex; align-items:center; gap:8px; padding:8px 10px; border-radius:12px; background:var(--panel-bg); border:1px solid var(--panel-border); margin-bottom:8px; animation:msgIn .25s ease;}
  .agent-attach-preview span{flex:1; font-size:0.78rem; color:var(--text-dim); overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
  .agent-attach-remove{color:var(--text-faint); cursor:pointer; font-size:1rem; flex:none; line-height:1;}

  .agent-composer{
    display:none;
    position:fixed; left:50%; transform:translateX(calc(-50% + var(--drawer-shift, 0px))) translateY(18px) scale(.96);
    bottom:calc(14px + env(safe-area-inset-bottom));
    width:100%; max-width:608px; padding:0 16px; z-index:45;
    opacity:0;
    transition:bottom .25s ease, transform .32s cubic-bezier(.2,.8,.2,1), opacity .26s ease;
  }
  .agent-composer.visible{display:block;}
  /* Entrance/exit — synced with #panel-agent's own .show (see switchTab):
     the tabbar hands off to this growing in from just below its own resting
     spot as the tab bar itself slides away, instead of the composer just
     popping into existence the instant display switched to block. */
  .agent-composer.visible.show{
    transform:translateX(calc(-50% + var(--drawer-shift, 0px))) translateY(0) scale(1);
    opacity:1;
  }
  #panel-agent{padding-bottom:92px; padding-top:18px;}

  .tempchat-banner{display:none; align-items:center; gap:8px; padding:8px 12px; border-radius:12px; background:var(--panel-bg); border:1px solid var(--panel-border); color:var(--text-dim); font-size:0.78rem; font-weight:600; margin-bottom:14px;}
  .tempchat-banner.visible{display:flex;}
  .tempchat-banner svg{width:17px; height:17px; stroke:currentColor; fill:none; stroke-width:2.1; stroke-linecap:round; stroke-linejoin:round; flex:none;}

  .tempchat-overlay{position:fixed; inset:0; z-index:90; background:rgba(0,0,0,0.55); display:flex; align-items:flex-end; opacity:0; pointer-events:none; transition:opacity .25s ease;}
  .tempchat-overlay.open{opacity:1; pointer-events:auto;}
  .tempchat-sheet{width:100%; background:var(--bg); border-radius:26px 26px 0 0; padding:24px 20px calc(22px + env(safe-area-inset-bottom)); transform:translateY(100%); transition:transform .3s cubic-bezier(.2,.8,.2,1);}
  .tempchat-overlay.open .tempchat-sheet{transform:translateY(0);}
  .tempchat-sheet-icon{
    position:relative; overflow:hidden;
    width:48px; height:48px; border-radius:50%; background:var(--pill-bg); border:1px solid var(--panel-border);
    display:flex; align-items:center; justify-content:center; margin-bottom:16px;
    box-shadow:0 6px 16px -8px rgba(0,0,0,0.55);
  }  .tempchat-sheet-icon svg{position:relative; width:24px; height:24px; stroke:var(--text); fill:none; stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round;}
  .tempchat-sheet h3{font-size:1.2rem; margin-bottom:18px;}
  .tempchat-row{display:flex; align-items:flex-start; gap:13px; margin-bottom:18px;}
  .tempchat-row svg{width:19px; height:19px; stroke:var(--text-dim); fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; flex:none; margin-top:2px;}
  .tempchat-row b{display:block; font-size:0.9rem; margin-bottom:2px;}
  .tempchat-row span{font-size:0.8rem; color:var(--text-dim); line-height:1.45;}
  .tempchat-cta{
    position:relative; overflow:hidden;
    display:flex; align-items:center; justify-content:center; width:100%; padding:13px; border-radius:24px;
    cursor:pointer; background:var(--accent-2-dark); color:var(--btn-text); font-size:0.92rem; font-weight:700; border:none;
    box-shadow:0 10px 24px -10px color-mix(in srgb, var(--accent-2-dark) 55%, transparent);
  }  .tempchat-cta span{position:relative;}

  .event-sheet{max-height:82vh; overflow-y:auto; touch-action:pan-y;}
  .event-sheet-head{display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:14px;}
  .event-sheet-head h3{margin-bottom:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
  .ev-details-head-left{display:flex; align-items:center; gap:10px; min-width:0;}
  .event-sheet-close{flex:none; width:32px; height:32px; border-radius:50%; display:flex; align-items:center; justify-content:center; background:var(--panel-bg-strong); border:1px solid var(--panel-border); cursor:pointer; transition:transform .15s ease;}
  .event-sheet-close:active{transform:scale(.9);}
  .event-sheet-close svg{width:15px; height:15px; stroke:var(--text-dim); fill:none; stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round;}
  .ev-details-dot{display:inline-block; width:11px; height:11px; border-radius:50%; margin-right:9px; vertical-align:middle; flex:none;}
  .ev-type-icon{width:9px; height:9px; flex:none; margin-right:4px; vertical-align:-1px;}
  .ev-type-icon.type-task, .ev-type-icon.type-reminder{stroke:currentColor; fill:none; stroke-width:2.6; stroke-linecap:round; stroke-linejoin:round;}
  .ev-type-icon.type-event{fill:currentColor; stroke:none;}
  .ev-type-icon.done{width:11px; height:11px;}
  .ev-type-icon.overdue{width:11px; height:11px;}
  .pill-dropdown-item.ev-type-item .ev-type-icon{width:13px; height:13px; margin-right:7px; vertical-align:-2px;}
  #ev-details-body .tempchat-row .ev-type-icon{width:19px; height:19px; margin-right:0; margin-top:2px; vertical-align:baseline;}
  .ev-details-done-btn{margin-top:8px;}
  .ev-details-done-btn.done{background:#2fae6f;}
  .ev-details-important{display:flex; align-items:center; gap:6px; font-size:0.74rem; font-weight:700; color:#ff2d2d; margin:-6px 0 16px;}

  #cal-search-sheet{max-height:82vh; overflow-y:auto;}
  #cal-search-results{margin-top:14px; display:flex; flex-direction:column; gap:8px;}
  .cal-search-row{display:flex; align-items:stretch; gap:10px; cursor:pointer;}
  .cal-search-date{
    flex:none; width:42px; display:flex; flex-direction:column; align-items:center; justify-content:center;
    font-family:var(--font-text); color:var(--text-dim); text-align:center;
  }
  .cal-search-date b{font-family:'Unbounded'; font-weight:700; font-size:1.15rem; color:var(--text); line-height:1.1;}
  .cal-search-date span{font-size:0.62rem; font-weight:700; text-transform:uppercase; letter-spacing:.03em;}
  .cal-search-bar{
    flex:1; min-width:0; display:flex; align-items:center; gap:9px; border-radius:14px; padding:10px 12px;
    color:var(--btn-text); transition:filter .15s ease;
  }
  .cal-search-bar:active{filter:brightness(0.92);}
  .cal-search-bar .ev-type-icon{width:14px; height:14px; margin-right:0; flex:none;}
  .cal-search-bar-text{flex:1; min-width:0;}
  .cal-search-title{font-size:0.84rem; font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
  .cal-search-desc{font-size:0.72rem; font-weight:500; opacity:0.85; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin-top:1px;}
  .cal-search-locate-btn{
    flex:none; width:26px; height:26px; border-radius:50%; display:flex; align-items:center; justify-content:center;
    background:rgba(0,0,0,0.16); cursor:pointer; transition:transform .15s ease;
  }
  .cal-search-locate-btn:active{transform:scale(.88);}
  .cal-search-locate-btn svg{width:15px; height:15px; stroke:currentColor; fill:none; stroke-width:2.1; stroke-linecap:round; stroke-linejoin:round;}
  #ev-details-body .tempchat-row b{white-space:pre-wrap; font-weight:600;}
  .event-sheet .pill-dropdown-wrap{display:block; margin-top:14px;}
  .event-sheet .pill-dropdown-btn{width:100%; justify-content:space-between;}
  .event-sheet .ev-date-row{margin-top:14px;}
  .event-sheet #ev-location{margin-top:14px;}
  .ev-date-row{display:flex; gap:8px; margin-top:8px;}
  .ev-date-field{flex:1; min-width:0;}
  .ev-date-field label{font-family:var(--font-text); font-weight:700; font-size:0.62rem; color:var(--text-faint); text-transform:uppercase; letter-spacing:.03em; display:block; margin-bottom:3px;}
  .ev-toggle{display:flex; align-items:center; gap:8px; margin-top:12px; font-size:0.86rem; font-weight:600; cursor:pointer; color:var(--text);}
  .ev-toggle input{width:18px; height:18px; accent-color:var(--accent-2-dark);}
  .ev-color-row{display:flex; gap:12px; margin-top:8px;}
  .ev-color-dot{width:30px; height:30px; border-radius:50%; cursor:pointer; border:2px solid transparent; transition:transform .15s ease, border-color .15s ease; flex:none;}
  .ev-color-dot.selected{border-color:var(--text); transform:scale(1.08);}
  .ev-color-dot[data-color="green"]{background:var(--ev-green);}
  .ev-color-dot[data-color="cyan"]{background:var(--ev-cyan);}
  .ev-color-dot[data-color="pink"]{background:var(--ev-pink);}
  .ev-color-dot[data-color="purple"]{background:var(--ev-purple);}
  .ev-color-dot[data-color="blue"]{background:var(--ev-blue);}

  .cal-drawer-overlay{position:fixed; inset:0; z-index:75; background:rgba(0,0,0,0.55); opacity:0; pointer-events:none; transition:opacity .3s ease;}
  .cal-drawer-overlay.open{opacity:1; pointer-events:auto;}
  .cal-drawer{
    position:fixed; top:0; bottom:0; left:0; width:min(86vw, 340px); z-index:76;
    background:var(--bg); padding:var(--tg-safe-top) 16px 18px; display:flex; flex-direction:column;
    transform:translateX(-100%); transition:transform .3s cubic-bezier(.2,.8,.2,1); overflow-y:auto;
    touch-action:pan-y;
  }
  .cal-drawer.open{transform:translateX(0);}
  .cal-list-item{display:flex; align-items:center; gap:12px; padding:11px 8px; border-radius:12px; cursor:pointer; color:var(--text); font-size:0.9rem; font-weight:600;}
  .cal-list-item:active, .cal-list-item.active{background:var(--pill-bg);}
  .cal-dot-badge{width:11px; height:11px; border-radius:50%; flex:none;}
  .cal-list-name{flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
  .cal-list-count{font-size:0.7rem; color:var(--text-faint); font-weight:600; flex:none;}
  .cal-member-row{display:flex; align-items:center; gap:10px; padding:9px 8px;}
  .cal-member-name{flex:1; min-width:0; font-size:0.86rem; font-weight:600; color:var(--text); overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
  .cal-member-role{font-size:0.68rem; color:var(--text-faint); font-weight:600; flex:none;}
  .cal-member-remove{color:var(--danger); cursor:pointer; font-size:0.78rem; font-weight:700; flex:none; margin-left:4px;}

  #cal-drawer-btn svg{transform:translateY(1.5px);}

  .cal-scroll{display:flex; align-items:flex-start; overflow-x:auto; scroll-snap-type:x mandatory; scroll-behavior:smooth; -webkit-overflow-scrolling:touch; touch-action:pan-x pan-y;}
  .cal-scroll::-webkit-scrollbar{display:none;}
  .cal-scroll-slide{flex:0 0 100%; min-width:100%; box-sizing:border-box; scroll-snap-align:start; scroll-snap-stop:always;}

  .cal-agenda-chip{padding:7px 11px; border-radius:9px; font-size:0.8rem; font-weight:700; color:var(--btn-text); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; cursor:pointer;}

  .cal-day-label{text-transform:capitalize;}

  .cal-tg-wrap{display:flex; flex-direction:column;}
  .cal-tg-axis-spacer{flex:0 0 38px;}
  .cal-tg-header{display:flex; position:relative;}
  .cal-tg-head-cols{display:flex; flex:1; min-width:0;}
  .cal-tg-daycol-head{flex:1; min-width:0; display:flex; flex-direction:column; align-items:center; gap:1px; cursor:pointer; padding-bottom:6px;}
  .cal-tg-dow{font-family:'Unbounded'; font-weight:700; font-size:0.6rem; color:var(--text-faint); text-transform:uppercase;}
  .cal-tg-num-row{display:flex; align-items:center; gap:3px;}
  .cal-tg-num{font-family:'Unbounded'; font-weight:700; font-size:0.98rem; color:var(--text);}
  .cal-tg-daycol-head.today .cal-tg-num{color:var(--accent-2-dark);}
  .cal-tg-allday{display:flex; position:absolute; top:100%; left:0; right:0; z-index:3; background:var(--pill-bg); border-bottom:1px solid var(--panel-border); padding-bottom:6px; margin-bottom:2px;}
  .cal-tg-allday-track{position:relative; flex:1; min-width:0;}
  .cal-tg-allday-bar{
    position:absolute; box-sizing:border-box; border-radius:6px; padding:3px 6px; overflow:hidden; cursor:pointer;
    display:flex; align-items:center; font-size:0.62rem; font-weight:700; color:var(--btn-text);
    white-space:normal; word-break:break-word; overflow-wrap:break-word; hyphens:auto; line-height:1.15;
  }
  .cal-tg-allday-bar.continues::after{content:''; position:absolute; right:0; top:0; bottom:0; width:8px; background:linear-gradient(90deg, transparent, rgba(0,0,0,0.25));}
  .cal-tg-body{display:flex; overflow-y:auto; max-height:520px; position:relative;}
  .cal-tg-axis{flex:0 0 38px; position:relative;}
  .cal-tg-hour-label{position:absolute; left:0; right:4px; text-align:right; font-family:var(--font-text); font-weight:700; font-size:0.6rem; color:var(--text-faint); transform:translateY(-50%); pointer-events:none;}
  .cal-tg-grid{flex:1; min-width:0; display:flex; position:relative;}
  .cal-tg-col{flex:1; min-width:0; position:relative; border-left:1px solid var(--panel-border); cursor:pointer;}
  .cal-tg-event{
    position:absolute; box-sizing:border-box; border-radius:8px; padding:3px 6px; overflow:hidden; cursor:pointer;
    display:flex; flex-direction:column; color:var(--btn-text); border:1px solid rgba(255,255,255,0.18); transition:filter .15s ease;
  }
  .cal-tg-event:active{filter:brightness(0.92);}
  .cal-tg-event-title{font-size:0.68rem; font-weight:700; overflow:hidden; white-space:normal; word-break:break-word; overflow-wrap:break-word; hyphens:auto; line-height:1.18;}
  .cal-tg-event-time{font-size:0.58rem; font-weight:600; opacity:0.9; order:-1;}
  .cal-tg-event-desc{font-size:0.58rem; font-weight:500; opacity:0.85; overflow:hidden; white-space:normal; word-break:break-word; overflow-wrap:break-word; line-height:1.2; margin-top:1px;}
  .cal-tg-now{position:absolute; left:0; right:0; height:2px; background:var(--ev-pink); z-index:5; pointer-events:none;}
  .cal-tg-now::before{content:''; position:absolute; left:-4px; top:-4px; width:9px; height:9px; border-radius:50%; background:var(--ev-pink);}

  .cal-grid-row{display:flex; align-items:flex-start; min-width:0;}
  .cal-grid-axis-col{flex:0 0 38px; height:520px; overflow:hidden; position:relative;}
  .cal-grid-axis-inner{position:relative;}
  .cal-grid-row .cal-scroll{flex:1; min-width:0;}


  @property --beam-angle{ syntax:'<angle>'; inherits:false; initial-value:0deg; }
  .agent-pill{
    position:relative; --beam-angle:0deg;
    display:flex; flex-direction:column; gap:6px; background:var(--pill-bg); border:1px solid var(--panel-border); border-radius:30px; padding:10px 10px 8px;
    backdrop-filter:blur(26px) saturate(1.6); -webkit-backdrop-filter:blur(26px) saturate(1.6);
    box-shadow:0 20px 44px -18px rgba(0,0,0,0.6);
    z-index:1;
  }  .agent-pill::after{
    content:''; position:absolute; inset:0; z-index:2; border-radius:inherit; padding:2px;
    background:conic-gradient(from var(--beam-angle), transparent 0deg, transparent 250deg, #52e6a0 275deg, #37c9ff 300deg, #ff5fc9 325deg, #9d6bff 350deg, transparent 360deg);
    -webkit-mask:linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask:linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite:xor; mask-composite:exclude;
    pointer-events:none; filter:drop-shadow(0 0 5px rgba(130,120,255,0.4));
    animation:beamRotate 5.5s linear infinite;
  }
  @keyframes beamRotate{ from{ --beam-angle:0deg; } to{ --beam-angle:360deg; } }
  .agent-pill-top{display:flex; align-items:flex-end; gap:6px;}
  .agent-pill-field{
    position:relative; flex:1; min-width:0; border:none; background:transparent; box-shadow:none; padding:10px 6px; margin:0; font-size:16px;
    font-family:inherit; line-height:1.35; resize:none; overflow-y:hidden; display:block;
    transition:height .22s cubic-bezier(.22,1,.36,1);
  }
  /* #agent-input also carries .field — textarea.field's own min-height/resize
     (for the multi-line note-edit box elsewhere) has higher specificity
     (element+class beats a single class) and would otherwise win over the
     two rules above, undoing the "start at one line, no drag handle" that
     the messenger-style auto-grow needs. */
  #agent-input.field{min-height:0; resize:none;}
  .agent-pill-field:focus, .agent-pill-field:focus-visible{outline:none;}
  .agent-pill-bottom{display:flex; align-items:center; gap:6px;}
  .agent-pill-send{margin-left:auto;}

  .agent-round-btn{
    position:relative; overflow:hidden;
    width:42px; height:42px; border-radius:50%; display:flex; align-items:center; justify-content:center; flex:none;
    background:var(--pill-bg); border:1px solid var(--panel-border); color:var(--text); cursor:pointer;
    backdrop-filter:blur(20px) saturate(1.6); -webkit-backdrop-filter:blur(20px) saturate(1.6);
    box-shadow:0 6px 16px -8px rgba(0,0,0,0.55);
    transition:background .2s, transform .15s ease, color .2s; touch-action:none;
  }  .agent-round-btn:active{transform:scale(.92);}
  .agent-round-btn svg{position:relative; width:21px; height:21px; stroke:currentColor; fill:none; stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round;}
  #temp-chat-btn .tc-icon-active{display:none;}
  #temp-chat-btn.active{color:var(--accent-2);}
  #temp-chat-btn.active .tc-icon-default{display:none;}
  #temp-chat-btn.active .tc-icon-active{display:block;}
  .agent-round-btn.primary{background:var(--accent-2-dark); border:none; color:var(--btn-text);}
  .agent-round-btn.primary svg{fill:none; stroke:var(--btn-text); stroke-width:2.4;}
  .agent-pill .agent-round-btn{background:transparent; border:none; backdrop-filter:none; -webkit-backdrop-filter:none; box-shadow:none;}
  .agent-pill .agent-round-btn::before{content:none;}
  .agent-pill .agent-round-btn.primary{
    background:var(--accent-2-dark);
    backdrop-filter:blur(20px) saturate(1.6); -webkit-backdrop-filter:blur(20px) saturate(1.6);
    box-shadow:0 6px 16px -8px color-mix(in srgb, var(--accent-2-dark) 60%, transparent);
  }
  .pill-dropdown-wrap{position:relative;}
  .pill-dropdown-btn{
    display:inline-flex; align-items:center; gap:5px; padding:9px 13px; border-radius:18px;
    background:var(--panel-bg-strong); border:1px solid var(--panel-border); color:var(--text);
    font-size:0.82rem; font-weight:600; cursor:pointer; user-select:none;
  }
  .pill-dropdown-btn svg{width:13px; height:13px; stroke:var(--text-dim); fill:none; stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round; transition:transform .25s ease; flex:none;}
  .pill-dropdown-wrap.open .pill-dropdown-btn svg{transform:rotate(180deg);}
  .pill-dropdown-menu{
    position:absolute; left:0; bottom:calc(100% + 10px); min-width:150px; z-index:10;
    background:var(--panel-bg-strong); border:1px solid var(--panel-border); border-radius:16px; padding:5px;
    box-shadow:0 20px 44px -16px rgba(0,0,0,0.55);
    opacity:0; pointer-events:none; transform:translateY(6px) scale(.96); transform-origin:bottom left;
    transition:opacity .18s ease, transform .2s cubic-bezier(.2,.8,.2,1);
  }
  .pill-dropdown-wrap.open .pill-dropdown-menu{opacity:1; pointer-events:auto; transform:translateY(0) scale(1);}
  .pill-dropdown-item{padding:9px 12px; border-radius:10px; font-size:0.86rem; font-weight:600; color:var(--text); cursor:pointer; white-space:nowrap;}
  .pill-dropdown-item:active, .pill-dropdown-item.drag-hover{background:var(--panel-bg);}
  .pill-dropdown-item.selected{color:var(--accent-2-dark);}


  .upload-choice-row{display:flex; align-items:center; gap:14px; padding:13px 4px; cursor:pointer; border-top:1px solid var(--panel-border);}
  .upload-choice-row:first-of-type{border-top:none;}
  .upload-choice-row:active{background:var(--panel-bg);}
  .upload-choice-row svg{width:24px; height:24px; flex:none; stroke:var(--accent-2-dark); fill:none; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round;}
  .upload-choice-title{font-weight:700; font-size:0.94rem; color:var(--text);}
  .upload-choice-sub{font-size:0.78rem; color:var(--text-dim); margin-top:1px;}

  .agent-record-bar{display:flex; align-items:center; gap:10px; height:38px;}
  /* The pulse itself animates transform+box-shadow, not opacity — opacity
     is left free for .paused (below, and #rec-float-bar.paused/
     .note-toolbar-timer.paused) to fade smoothly on its own. Animating
     opacity in both the keyframes AND a plain paused-state transition was
     fighting itself: animation-play-state:paused only freezes the
     animation at whatever opacity it happened to be mid-pulse, and a still
     -active (if frozen) animation keeps overriding any transition trying
     to move that same property — so the "fade to translucent on pause"
     transition never actually got to play. */
  /* color (not just background) so the keyframes' own currentColor-based
     glow always matches the dot's actual fill, in whichever context it's
     used. */
  .rec-dot{width:10px; height:10px; border-radius:50%; background:var(--danger); color:var(--danger); flex:none; opacity:1; transition:opacity .25s ease; animation:recPulse 1.1s ease-in-out infinite;}
  @keyframes recPulse{
    0%, 100%{transform:scale(1); box-shadow:0 0 0 0 color-mix(in srgb, currentColor 50%, transparent);}
    50%{transform:scale(1.2); box-shadow:0 0 5px 1px color-mix(in srgb, currentColor 35%, transparent);}
  }
  .rec-timer{font-size:0.85rem; color:var(--text); flex:none;}
  .rec-hint{font-size:0.74rem; color:var(--text-faint); flex:1; transition:color .2s;}
  .rec-hint.locked{color:var(--accent-2);}

  .cal-card{touch-action:pan-y;}

  :is(#panel-deadlines, #dl-window) .week-arrow{width:42px; height:42px; border-radius:50%; font-size:1.15rem;}
  :is(#panel-deadlines, #dl-window) .week-arrow.cal-day-back{background:var(--accent-2-dark); border:none; color:var(--btn-text);}
  :is(#panel-deadlines, #dl-window) .week-arrow svg{width:22px; height:22px; stroke:currentColor; fill:none; stroke-width:2.4; stroke-linecap:round; stroke-linejoin:round; display:block; flex:none;}

  /* Match the calendar-picker button's color to the paging arrows sitting next to it
     (agent-round-btn's own --pill-bg reads slightly differently). */
  #cal-drawer-btn{background:var(--panel-bg-strong);}
  #cal-drawer-btn:active{transform:scale(.92);}
  /* The filter button's icon rotates 180° when its dropdown opens (it's a
     .pill-dropdown-btn); the calendar-picker icon is on a plain .agent-round-btn
     so it never got that same rule — add it explicitly here. */
  #cal-drawer-btn svg{transition:transform .25s ease;}
  #cal-drawer-wrap.open #cal-drawer-btn svg{transform:rotate(180deg);}
  /* Calendar-picker popup — same pill-dropdown-menu the view-switcher uses, just
     opening from the left edge (drawer button sits on the left of the nav row). */
  #cal-drawer-wrap{flex:none;}
  #cal-drawer-wrap .pill-dropdown-menu{left:0; right:auto; bottom:auto; top:calc(100% + 10px); transform-origin:top left; transform:translateY(-6px) scale(.96); min-width:170px;}
  #cal-drawer-wrap.open .pill-dropdown-menu{transform:translateY(0) scale(1);}

  /* View-switcher (Month/Week/3-day/Day) becomes an icon-only round button once it's
     relocated into a nav row, matching the paging arrows next to it. */
  #cal-view-wrap{flex:none;}
  #cal-view-wrap #cal-view-btn{
    width:42px; height:42px; border-radius:50%; padding:0; justify-content:center; touch-action:none;
  }
  #cal-view-wrap #cal-view-btn svg{width:19px; height:19px; stroke:currentColor; fill:none; stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round; flex:none;}
  #cal-view-label{display:none;}
  #cal-view-wrap .pill-dropdown-menu{left:auto; right:0; bottom:auto; top:calc(100% + 10px); transform-origin:top right; transform:translateY(-6px) scale(.96);}
  #cal-view-wrap.open .pill-dropdown-menu{transform:translateY(0) scale(1);}
  /* Month and Day already use smaller (34px) paging arrows — match that size when
     the drawer/view-switcher buttons land there too. */
  #cal-month-card #cal-drawer-btn, #cal-day-card #cal-drawer-btn,
  #cal-month-card #cal-view-wrap #cal-view-btn, #cal-day-card #cal-view-wrap #cal-view-btn{
    width:34px; height:34px;
  }
  #cal-month-card #cal-drawer-btn svg, #cal-day-card #cal-drawer-btn svg{width:18px; height:18px;}
  #cal-month-card #cal-view-wrap #cal-view-btn svg, #cal-day-card #cal-view-wrap #cal-view-btn svg{width:16px; height:16px;}

  #cal-month-card, #cal-week-card, #cal-3day-card, #cal-day-card{padding:14px 10px 18px;}
  .cal-month-nav{display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:10px;}
  .cal-month-label{font-family:'Unbounded'; font-weight:700; font-size:1rem; text-transform:capitalize;}
  .cal-month-label, .cal-day-label, .week-range{
    display:inline-flex; align-items:center; justify-content:center; padding:8px 15px; border-radius:16px;
    background:var(--panel-bg-strong); border:1px solid var(--panel-border); cursor:pointer; user-select:none;
  }
  /* Month and Day get a more compact nav row (smaller arrows + tighter label
     padding) to match how the Week/3-day calendars already look. */
  #cal-month-card .week-arrow, #cal-day-card .week-arrow{width:34px; height:34px;}
  #cal-month-card .week-arrow svg, #cal-day-card .week-arrow svg{width:18px; height:18px;}
  #cal-month-card .cal-month-label, #cal-day-card .cal-day-label{padding:7px 13px; font-size:1rem;}

  .cal-month-dow-row{display:grid; grid-template-columns:repeat(7, minmax(0, 1fr)); gap:1px; margin-bottom:8px;}
  .cal-month-dow-row span{text-align:center; font-size:0.66rem; font-weight:700; color:var(--text); text-transform:uppercase; letter-spacing:.03em;}
  .cal-month-grid{display:flex; flex-direction:column; gap:1px; background:var(--panel-border); border-radius:10px; overflow:hidden;}
  .cal-month-row{position:relative; display:grid; grid-template-columns:repeat(7, minmax(0, 1fr)); gap:1px; background:var(--panel-border);}
  .cal-cell{position:relative; background:var(--panel-bg-strong); min-height:102px; min-width:0; padding:6px 5px 4px; box-sizing:border-box; cursor:pointer; user-select:none;}
  .cal-cell.today{background:color-mix(in srgb, var(--accent-2-dark) 8%, var(--panel-bg-strong));}
  /* Pulses twice, then eases out to nothing on its own — the JS clears the
     highlight state right as this finishes, so there's no abrupt cut like there
     was pulsing forever at full opacity until the moment it got removed. */
  .cal-cell.highlight{border-radius:8px; animation:calHighlightPulse 2.6s ease-in-out forwards;}
  @keyframes calHighlightPulse{
    0%{box-shadow:inset 0 0 0 2px var(--accent-2-dark);}
    19%{box-shadow:inset 0 0 0 2px transparent;}
    38%{box-shadow:inset 0 0 0 2px var(--accent-2-dark);}
    57%{box-shadow:inset 0 0 0 2px transparent;}
    76%{box-shadow:inset 0 0 0 2px var(--accent-2-dark);}
    100%{box-shadow:inset 0 0 0 2px transparent;}
  }
  .cal-cell-num-row{display:flex; align-items:center; justify-content:center; gap:4px;}
  .cal-cell-num{display:block; width:fit-content; font-family:var(--font-text); font-weight:700; font-size:0.78rem; color:var(--text); line-height:20px; text-align:center; border-radius:8px;}
  .cal-cell.dim .cal-cell-num{color:var(--text-faint);}
  .cal-cell.today .cal-cell-num{color:var(--text); background:color-mix(in srgb, var(--accent-2-dark) 35%, transparent); padding:0 4px;}
  .cal-cell-more{position:absolute; left:5px; bottom:4px; font-size:0.6rem; font-weight:700; color:var(--text-faint);}
  .cal-cell-important{flex:none; min-width:14px; height:14px; padding:0 3px; border-radius:8px; background:#ff2d2d; color:#fff; font-size:0.58rem; font-weight:800; box-sizing:border-box; display:flex; align-items:center; justify-content:center; line-height:1;}
  .cal-month-row .cal-bar{position:absolute; height:17px; border-radius:5px; display:flex; align-items:center; z-index:2; cursor:pointer; overflow:hidden; transition:transform .15s;}
  .cal-month-row .cal-bar:active{transform:scale(0.96);}
  .cal-month-row .cal-bar.continues::after{content:''; position:absolute; right:0; top:0; bottom:0; width:8px; background:linear-gradient(90deg, transparent, rgba(0,0,0,0.25));}
  .cal-month-row .cal-bar span{font-size:0.58rem; font-weight:700; color:var(--btn-text); padding:0 5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}


  .cal-mini-sheet{padding-bottom:calc(20px + env(safe-area-inset-bottom));}
  .cal-mini-nav{display:flex; align-items:center; justify-content:space-between; margin-bottom:12px;}
  .cal-mini-nav .week-arrow svg{width:22px; height:22px; stroke:currentColor; fill:none; stroke-width:2.4; stroke-linecap:round; stroke-linejoin:round; display:block; flex:none;}
  .cal-mini-label{font-family:'Unbounded'; font-weight:700; font-size:1rem; text-transform:capitalize;}
  .cal-mini-dow-row{display:grid; grid-template-columns:repeat(7, 1fr); gap:1px; margin-bottom:6px;}
  .cal-mini-dow-row span{text-align:center; font-size:0.6rem; font-weight:700; color:var(--text-faint); text-transform:uppercase; letter-spacing:.03em;}
  .cal-mini-grid{display:flex; flex-direction:column; gap:1px; background:var(--panel-border); border-radius:10px; overflow:hidden;}
  .cal-mini-row{position:relative; display:grid; grid-template-columns:repeat(7, 1fr); gap:1px; background:var(--panel-border);}
  .cal-mini-cell{position:relative; background:var(--panel-bg-strong); min-height:38px; padding:4px 2px 6px; box-sizing:border-box; cursor:pointer; display:flex; flex-direction:column; align-items:center; user-select:none;}
  .cal-mini-cell.today{background:color-mix(in srgb, var(--accent-2-dark) 8%, var(--panel-bg-strong));}
  .cal-mini-cell.active-period{box-shadow:inset 0 0 0 2px var(--accent-2-dark); border-radius:8px;}
  .cal-mini-range-outline{position:absolute; top:0; bottom:0; box-shadow:inset 0 0 0 2px var(--accent-2-dark); border-radius:8px; pointer-events:none; z-index:1;}
  .cal-mini-num-row{display:flex; align-items:center; gap:3px;}
  .cal-mini-num{font-family:var(--font-text); font-weight:700; font-size:0.7rem; color:var(--text); line-height:18px; width:18px; text-align:center; border-radius:7px;}
  .cal-mini-cell.dim .cal-mini-num{color:var(--text-faint);}
  .cal-mini-cell.today .cal-mini-num{background:color-mix(in srgb, var(--accent-2-dark) 35%, transparent);}
  .cal-mini-important-dot{width:5px; height:5px; border-radius:50%; background:#ff2d2d; flex:none;}
  .cal-mini-row .cal-mini-bar{position:absolute; height:3px; border-radius:2px; z-index:2; pointer-events:none;}
  .cal-mini-month-pills{display:flex; gap:6px; overflow-x:auto; margin-top:14px; padding-bottom:2px; scrollbar-width:none;}
  .cal-mini-month-pills::-webkit-scrollbar{display:none;}
  .cal-mini-month-pill{flex:none; padding:7px 14px; border-radius:999px; background:var(--panel-bg-strong); border:1px solid var(--panel-border); font-size:0.76rem; font-weight:700; color:var(--text-dim); cursor:pointer; user-select:none; transition:background .15s, color .15s;}
  .cal-mini-month-pill.active{background:var(--accent-2-dark); color:var(--btn-text); border-color:transparent;}

  .dl-section-title{font-family:'Unbounded'; font-weight:700; font-size:0.7rem; text-transform:uppercase; letter-spacing:.05em; color:var(--text-faint); margin:18px 2px 8px;}
  .dl-section-title:first-child{margin-top:0;}
  .dl-card{display:flex; align-items:flex-start; gap:12px; padding:14px 16px; margin-bottom:8px; cursor:pointer;}
  /* Overdue tasks are swipe-to-clear: the card itself slides left, and a trash icon
     underneath (spanning the same rounded box) fades/pops in on the right as it's
     revealed, so it's clear the swipe means delete. */
  .dl-swipe-wrap{position:relative; margin-bottom:8px; border-radius:20px; overflow:hidden;}
  .dl-swipe-wrap .dl-card{margin-bottom:0;}
  .dl-swipe-trash{
    position:absolute; inset:0; display:flex; align-items:center; justify-content:flex-end; padding-right:24px;
    background:var(--danger); border-radius:20px;
  }
  .dl-swipe-trash svg{
    width:22px; height:22px; stroke:#fff; fill:none; stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round;
    opacity:0; transform:scale(.5); transition:opacity .18s ease, transform .28s cubic-bezier(.34,1.56,.64,1);
  }
  .dl-swipe-trash.visible svg{opacity:1; transform:scale(1);}
  .dl-swipe-trash.armed svg{transform:scale(1.2);}
  .dl-dot{width:10px; height:10px; border-radius:50%; margin-top:6px; flex:none;}
  .dl-info{flex:1; min-width:0;}
  .dl-info h3{font-size:0.92rem;}
  .dl-badge{font-family:var(--font-text); font-weight:600; font-size:0.74rem; color:var(--text-faint); margin-top:3px; display:block;}
  .dl-desc{font-size:0.78rem; color:var(--text-dim); margin-top:4px; display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
  .dl-cal-badge{display:inline-flex; align-items:center; font-family:var(--font-text); font-weight:700; font-size:0.64rem; color:var(--text-dim); background:var(--panel-bg-strong); padding:2px 8px; border-radius:999px; margin-top:6px;}
  .dl-cal-badge.shared{color:var(--accent-2-dark);}
  .dl-cal-badge svg{width:11px; height:11px; margin-right:4px; fill:none; stroke:currentColor; stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round;}
  .pill-dropdown-item.disabled{color:var(--text-dim); opacity:.6;}
  .pill-dropdown-item small{display:block; font-weight:500; font-size:.72rem; color:var(--text-dim); white-space:normal;}
  .ev-people{margin:-2px 0 10px;}
  .ev-people-list{display:flex; flex-wrap:wrap; gap:6px;}
  .ev-person{padding:7px 12px; border-radius:999px; font-size:.8rem; font-weight:700; color:var(--text-dim); background:var(--pill-bg); border:1px solid var(--panel-border); cursor:pointer; transition:background .15s, color .15s;}
  .ev-person.selected{background:var(--accent-2-dark); border-color:var(--accent-2-dark); color:#fff;}
  .ev-people-empty{font-size:.8rem; color:var(--text-dim); line-height:1.4;}
  .ev-people-hint{font-size:.76rem; color:var(--text-dim); line-height:1.4; margin:8px 0 0;}
  .ev-people-hint b{font-family:'Space Mono', monospace; letter-spacing:.12em; color:var(--text);}
  .dl-code-input{font-family:'Space Mono', monospace; font-size:1.3rem; letter-spacing:.3em; text-align:center; text-transform:uppercase; margin:14px 0;}
  .ev-share-code{margin:12px 0 4px; padding:14px; border-radius:16px; background:var(--pill-bg); border:1px solid var(--panel-border); text-align:center;}
  .ev-share-code-label{font-size:.74rem; font-weight:600; color:var(--text-dim);}
  .ev-share-code-value{font-family:'Space Mono', monospace; font-size:1.6rem; font-weight:700; letter-spacing:.28em; margin:6px 0 10px; color:var(--text);}
  .ev-share-code-actions{display:flex; gap:8px;}
  .ev-share-code-actions .btn{flex:1; justify-content:center;}
  .dl-edit-btn{flex:none; width:32px; height:32px; border-radius:50%; display:flex; align-items:center; justify-content:center; background:var(--panel-bg-strong); border:1px solid var(--panel-border); margin-top:2px; transition:transform .15s ease;}
  .dl-edit-btn:active{transform:scale(.9);}
  .dl-edit-btn svg{width:15px; height:15px; stroke:var(--text-dim); fill:none; stroke-width:2.1; stroke-linecap:round; stroke-linejoin:round;}
  .dl-locate-btn{flex:none; width:32px; height:32px; border-radius:50%; display:flex; align-items:center; justify-content:center; background:var(--panel-bg-strong); border:1px solid var(--panel-border); margin-top:2px; transition:transform .15s ease;}
  .dl-locate-btn:active{transform:scale(.9);}
  .dl-locate-btn svg{width:15px; height:15px; stroke:var(--text-dim); fill:none; stroke-width:2.1; stroke-linecap:round; stroke-linejoin:round;}
  .dl-check-btn{flex:none; width:32px; height:32px; border-radius:50%; display:flex; align-items:center; justify-content:center; background:var(--panel-bg-strong); border:1px solid var(--panel-border); margin-top:2px; transition:transform .15s ease, background .15s ease;}
  .dl-check-btn:active{transform:scale(.9);}
  .dl-check-btn svg{width:15px; height:15px; stroke:var(--text-dim); fill:none; stroke-width:2.3; stroke-linecap:round; stroke-linejoin:round;}
  .dl-check-btn.done{background:#3ddc84; border-color:transparent;}
  .dl-check-btn.done svg{stroke:#0b3d22;}
  .dl-card-swipeable{touch-action:pan-y;}

  /* ---------- Диктофон: recorder hero, note cards, transcript ---------- */

  /* --rp (0 or 1, never in between) flips on a deliberate swipe gesture (see
     the touch handlers below) rather than tracking real scroll — every
     shrinking property on the card interpolates off that same number, so it
     all animates in lockstep between the two fixed states. */
  /* pinned right under the (also sticky) header — deliberately its bottom edge
     plus a small gap, never less, so the two stacked sticky elements can never
     compete for the same strip of screen and hide each other. */
  /* persistent mini recorder bar — floats above every other tab while a
     recording is running/paused, so leaving Трекер doesn't hide it or lose
     control of it. Freely draggable up/down the whole screen (see JS). */
  /* left/top are always plain pixel values set from JS (see ensureRecFloatBarPosition
     and the drag handlers) rather than left:50%+transform centering — free 2D
     drag needs a real x/y to move from, and mixing that with a centering
     transform would fight over the same `transform` property. */
  .rec-float-bar{
    position:fixed; left:0; top:calc(var(--tg-safe-top, 0px) + 10px); z-index:45;
    display:flex; align-items:center; gap:9px;
    padding:8px 8px 8px 14px; border-radius:999px; max-width:min(94vw, 380px); box-sizing:border-box;
    background:color-mix(in srgb, var(--pill-bg) 86%, transparent);
    border:1px solid var(--panel-border-strong);
    backdrop-filter:blur(28px) saturate(1.8); -webkit-backdrop-filter:blur(28px) saturate(1.8);
    box-shadow:0 18px 40px -16px rgba(0,0,0,0.55);
    touch-action:none; cursor:grab;
    transition:box-shadow .25s ease;
  }
  /* the show/hide (top+opacity+scale) transition is only active while NOT
     actively being dragged — during a drag, top/left are set every touch
     frame and must snap 1:1 with the finger, not lag behind a transition. */
  .rec-float-bar:not(.dragging){transition:box-shadow .25s ease, top .42s cubic-bezier(.22,1.15,.36,1), left .42s cubic-bezier(.22,1.15,.36,1), opacity .3s ease, transform .32s cubic-bezier(.22,1.15,.36,1);}
  @keyframes recFloatIconPop{ 0%{transform:scale(.5);} 60%{transform:scale(1.18);} 100%{transform:scale(1);} }
  .rec-float-btn.icon-pop svg{animation:recFloatIconPop .32s cubic-bezier(.34,1.56,.64,1);}
  .rec-float-bar:active{cursor:grabbing;}
  .rec-float-bar.dragging{box-shadow:0 26px 54px -14px rgba(0,0,0,0.7);}
  /* pink+pulsing while actually recording (the default/non-.paused look,
     matching the note panel's own mic button), solid still blue on pause —
     no fade-to-translucent-red anymore, a flat color+animation swap instead
     so it reads as the same two states as the mic button, not its own
     third thing. */
  .rec-float-bar .rec-dot{flex:none; background:var(--accent-pink); color:var(--accent-pink); transition:background .25s ease, color .25s ease;}
  .rec-float-bar.paused .rec-dot{background:var(--accent-2-dark); color:var(--accent-2-dark); opacity:1; animation:none; box-shadow:none;}
  .rec-float-timer{font-size:0.86rem; font-weight:800; color:var(--text); flex:none;}
  .rec-float-btn{
    flex:none; width:32px; height:32px; border-radius:50%; display:flex; align-items:center; justify-content:center;
    background:var(--panel-bg-strong); border:1px solid var(--panel-border); color:var(--text); cursor:pointer;
    transition:transform .15s cubic-bezier(.34,1.56,.64,1);
  }
  .rec-float-btn:active{transform:scale(.86);}
  .rec-float-btn svg{position:relative; width:15px; height:15px; stroke:currentColor; fill:none; stroke-width:2.3; stroke-linecap:round; stroke-linejoin:round;}
  /* Same idle-blue/recording-pink-liquid language as the note panel's own
     mic button (.note-toolbar-btn.main) instead of this button's own flat
     neutral gray — while actually recording it goes transparent with a pink
     border and the same volume-driven .rec-mic-fill liquid rising inside it
     (fed from the exact same startWaveform() tick as the note panel's two
     buttons, just a third target); on pause it drops back to plain solid
     blue, matching the "paused reads as idle" rule used everywhere else. */
  .rec-float-pause{
    position:relative; overflow:hidden;
    background:var(--accent-2-dark); border:1.5px solid transparent; color:var(--btn-text);
    transition:transform .15s cubic-bezier(.34,1.56,.64,1), background .28s cubic-bezier(.4,0,.2,1), border-color .28s cubic-bezier(.4,0,.2,1);
  }
  .rec-float-bar:not(.paused) .rec-float-pause{background:transparent; border-color:var(--accent-pink);}
  .rec-float-bar:not(.paused) .rec-float-pause .rec-mic-fill{opacity:1;}

  /* overflow:visible (overriding .glass's default hidden) so the accent glow
     behind the record button can softly bleed past the card's own edge. */
  .rec-card{
    padding:calc(30px - var(--rp) * 20px) 16px calc(26px - var(--rp) * 18px); text-align:center; --beam-angle:0deg; overflow:visible;
    border-radius:calc(20px + var(--rp) * 16px); transform:translateY(0); overflow-anchor:none;
    transition:padding .3s cubic-bezier(.22,.8,.32,1), border-radius .3s cubic-bezier(.22,.8,.32,1), transform .3s cubic-bezier(.22,.8,.32,1), background-color .3s ease, border-color .3s ease;
  }
  /* Full visual match with Главная's own Записать лекцию card while idle —
     not just the icon inside it, the whole card gets that same blue tint
     (identical color-mix % as .home-action-record). Only while idle: once
     .recording is added the card goes back to the plain .glass background
     so it doesn't fight the waveform/beam-ring going on at that point. */
  .rec-card:not(.recording){
    background:color-mix(in srgb, var(--accent-2) 22%, var(--panel-bg));
    border-color:color-mix(in srgb, var(--accent-2) 42%, var(--panel-border));
  }
  /* Idle state is deliberately flat now, to match Главная's own calmer card
     language — no more rotating sweep around the border before anything's
     even happening. The one liquid-glass "moment" left on this card is the
     rotating beam ring above, which only appears once actually recording —
     it's earned then (a real "something is live" signal), not just idle
     chrome. */
  .rec-idle-row{display:flex; flex-direction:row; align-items:center; gap:16px; position:relative; z-index:1; text-align:left; padding:2px 6px; cursor:pointer; transition:transform .15s ease;}
  .rec-idle-row:active{transform:scale(0.98);}
  .rec-main-btn{
    position:relative; overflow:hidden; width:72px; height:72px; border-radius:50%; flex:none;
    display:flex; align-items:center; justify-content:center; cursor:pointer;
    background:var(--accent-2-dark); color:var(--btn-text); border:none;
    box-shadow:0 16px 34px -12px color-mix(in srgb, var(--accent-2-dark) 60%, transparent);
    transition:transform .18s cubic-bezier(.34,1.56,.64,1), box-shadow .2s;
  }  .rec-main-btn svg{position:relative; width:28px; height:28px; stroke:var(--btn-text); fill:none; stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round;}
  .rec-main-btn:active{transform:scale(.93);}
  /* The idle "tap to start" button specifically (not #rec-stop-btn, which
     shares .rec-main-btn's base rule above and keeps that bigger solid
     treatment while actually recording) — restyled to match Главная's own
     record-action icon exactly: the same 44px translucent accent-2 circle,
     no glow, no shine overlay. Same idea as the idle ring's removal: this
     card should look like it belongs on Главная, not like a separate,
     more elaborate hero. */
  /* Same font/weight/color as Главная's own card labels (.home-action-label)
     — was .text-faint at weight 600, which read as a dim caption instead of
     matching how Главная actually sets its type. */
  .rec-idle-hint{font-family:'Unbounded'; max-width:none; display:flex; flex-direction:column; gap:2px;}
  /* Reads as a heading — same weight/scale family as a card title — so the
     row unmistakably reads as a button label, not a caption. */
  .rec-idle-title{font-weight:800; font-size:1.18rem; line-height:1.2; color:var(--text);}
  .rec-idle-sub{font-weight:600; font-size:0.86rem; line-height:1.3; color:var(--text-dim);}

  .rec-spinner{width:34px; height:34px; border-radius:50%; border:3px solid var(--panel-border); border-top-color:var(--accent-2-dark); animation:recSpin .8s linear infinite;}
  @keyframes recSpin{ to{transform:rotate(360deg);} }
  /* Small floating status card shown while waiting on POST /api/notes/record
     (see showProcessingUI/cycleProcessingStages) — replaces the old
     #rec-processing card that lived embedded inside the now-removed
     recording card. Plain monotone border from the start, no glass sheen
     (matches the rest of this session's pass removing that effect
     everywhere). */
  .note-processing-indicator{
    position:fixed; left:50%; top:50%; z-index:46; transform:translate(-50%, -50%);
    display:flex; flex-direction:column; align-items:center; gap:12px; padding:22px 28px;
    background:var(--pill-bg); border:1px solid var(--panel-border-strong); border-radius:20px;
    box-shadow:0 18px 40px -16px rgba(0,0,0,0.55);
  }
  .note-processing-indicator p{font-size:0.86rem; font-weight:600; color:var(--text-dim); text-align:center; max-width:220px;}

  .note-chip{flex:none; display:inline-flex; align-items:center; gap:3px; font-family:var(--font-text); font-weight:700; font-size:0.62rem; color:var(--text-faint); background:var(--panel-bg-strong); padding:2px 7px; border-radius:999px;}
  .note-chip svg{width:10px; height:10px; stroke:currentColor; fill:none; stroke-width:2.4; stroke-linecap:round; stroke-linejoin:round;}

  /* ---------- notes list: horizontally-scrolling "recent" carousel on the
     Трекер panel + a dedicated "Все заметки" screen with filter tabs. Each
     card/row carries a real, non-interactive miniature of the note's own
     rendered body (scaled way down via transform + clipped), rather than a
     plain text snippet, so it visually reads like a shrunk note page. ---------- */
  .notes-recent-header{display:flex; align-items:center; justify-content:space-between; margin:18px 2px 8px;}
  .notes-recent-header .dl-section-title{margin:0;}
  .notes-see-all{display:inline-flex; align-items:center; gap:1px; font-family:'Unbounded'; font-weight:700; font-size:0.78rem; color:var(--accent-2); cursor:pointer; padding:4px 2px;}
  .notes-see-all svg{width:15px; height:15px; stroke:currentColor; fill:none; stroke-width:2.6; stroke-linecap:round; stroke-linejoin:round;}

  .notes-recent-scroll{display:flex; gap:12px; overflow-x:auto; overflow-y:hidden; padding:2px 2px 6px; margin:0 -2px; -webkit-overflow-scrolling:touch; scrollbar-width:none;}
  .notes-recent-scroll::-webkit-scrollbar{display:none;}

  .note-carousel-card{
    flex:none; width:162px; cursor:pointer; display:flex; flex-direction:column; padding:0;
    border-radius:20px; overflow:hidden; border:1px solid var(--panel-border);
    transition:transform .15s ease, border-color .15s ease;
  }
  .note-carousel-card:active{transform:scale(0.96);}
  /* Faint graph-paper grid instead of a flat gray fill — reads more like an
     actual notebook page behind the shrunk note preview. */
  .note-thumb{position:relative; overflow:hidden; height:126px; --paper-size:14px;}
  .note-thumb::after{content:''; position:absolute; left:0; right:0; bottom:0; height:38%; background:linear-gradient(180deg, transparent, color-mix(in srgb, var(--bg) 92%, transparent)); pointer-events:none;}
  .note-thumb-inner{position:absolute; top:0; left:0; width:360%; transform:scale(0.2778); transform-origin:top left; padding:12px 14px; pointer-events:none; user-select:none;}
  .note-thumb-empty{display:flex; align-items:center; justify-content:center; height:100%; color:var(--text-faint);}
  .note-thumb-empty svg{width:28px; height:28px; stroke:currentColor; fill:none; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; opacity:.5;}

  /* ---------- unified recording/note-editor screen: grid-paper canvas, sticky
     title, floating bottom toolbar (redesign merging record + conspect) ---------- */
  /* Back / "..." stay put on screen (unlike the title, which deliberately
     scrolls away with the grid) — truly position:fixed and physically
     outside .wrap (see the comment above its markup): position:sticky here
     was still anchored to the panel's own (negative-margined) flow position,
     which read as a small jump/rise on the first bit of scroll instead of
     being fixed from the very start. */
  #note-detail-topbar{
    position:fixed; left:16px; right:16px; max-width:608px; margin:0 auto;
    top:calc(var(--tg-safe-top, 0px) - 32px + var(--header-h, 52px));
    z-index:41; display:flex; align-items:center; justify-content:space-between; gap:8px;
    opacity:0; visibility:hidden; pointer-events:none; transform:translateY(-14px) translateZ(0);
    will-change:transform, opacity;
    transition:opacity .28s cubic-bezier(.4,0,.2,1), transform .28s cubic-bezier(.4,0,.2,1);
  }
  #note-detail-topbar.show{opacity:1; visibility:visible; transform:translateY(0) translateZ(0);}
  #note-detail-topbar.show > *{pointer-events:auto;}
  /* One shared pill instead of three separate floating round buttons — same
     "glass on the wrapper, transparent on the buttons themselves" trick as
     .agent-pill .agent-round-btn elsewhere in this file. */
  .note-detail-actions{
    display:flex; align-items:center; gap:2px; padding:4px; border-radius:999px;
    background:var(--pill-bg); border:1px solid var(--panel-border);
    backdrop-filter:blur(20px) saturate(1.6); -webkit-backdrop-filter:blur(20px) saturate(1.6);
    box-shadow:0 6px 16px -8px rgba(0,0,0,0.55);
  }
  .note-detail-actions .agent-round-btn{
    width:34px; height:34px; background:none; border:none;
    backdrop-filter:none; -webkit-backdrop-filter:none; box-shadow:none;
  }
  /* Undo/redo: collapsed to width:0 (not display:none) until each
     individually has something to do (see setupNoteUndo) -- a width change
     is a real value the browser can animate on its own, so toggling one
     .show class is enough to get a genuinely smooth grow/shrink; a
     display:none <-> flex flip has no in-between state to transition
     through at all (an earlier version tried forcing it anyway with a
     reflow + nested requestAnimationFrame calls and it still landed as a
     hard snap often enough to notice). overflow:hidden keeps the icon
     clipped out of view while collapsed instead of just squashed, and
     flex:none (inherited from .agent-round-btn) keeps the row's other
     buttons from fighting this one's width as it grows. export/study/
     console visibly shift right as this one grows in, since it's a real
     layout width change, not just an opacity fade sitting in
     already-reserved space. */
  .note-detail-actions .note-history-btn{
    width:0; overflow:hidden; opacity:0; pointer-events:none;
    transform:scale(.7) translateZ(0);
    transition:width .3s cubic-bezier(.4,0,.2,1), opacity .2s ease,
      transform .26s cubic-bezier(.34,1.56,.64,1);
  }
  .note-detail-actions .note-history-btn.show{
    width:34px; opacity:1; pointer-events:auto; transform:scale(1) translateZ(0);
  }
  /* .agent-round-btn::before paints a per-button gradient sheen on top of
     its own circular background -- with the flat background above already
     removed, that sheen was the only thing left still reading as "each
     button has its own highlight", the same reason .agent-pill kills it
     too. */
  .note-detail-actions .agent-round-btn::before{content:none;}

  /* Plain in-flow title, directly above the grid — scrolls away together
     with the workspace beneath it like normal page content, rather than
     staying pinned on screen (an earlier pass made it position:sticky with a
     shrink-on-scroll effect; that read as the title "staying put" instead of
     "rising with the grid" and was reverted). */
  /* padding-top clears the now-fixed #note-detail-topbar, which no longer
     takes up any space in normal flow. (Extra bottom clearance was tried
     here to rule out an iOS screen-edge-clipping theory for the line-1
     caret bug — confirmed NOT the cause, reverted.) */
  #note-title-bar{padding:50px 2px 14px; cursor:pointer;}
  #note-title-bar #detail-title{margin:0; text-align:left;}
  /* Centered only while the title fits on one line — see
     updateTitleAlignment(), which toggles this by actually measuring
     wrapped line count rather than guessing off character length. */
  #note-title-bar #detail-title.title-centered{text-align:center;}
  /* Lives right inside .note-detail-actions now — the SAME pill undo/redo/
     export/study/console already share, not a pill of its own next to it.
     That's the actual point: the whole shared pill visibly grows wider to
     make room for it, exactly the way it already does for undo/redo (see
     .note-history-btn just below), instead of a second, separate pill
     appearing alongside it — one consistent "things grow into this pill,
     they don't just pop" language for every optional piece of chrome here,
     not a special case with its own container. Bare (no background/border
     of its own), matching how .note-detail-actions .agent-round-btn is
     also bare inside this same wrapper. Expands in via max-width (not
     width — the digit count varies, "0:00" vs "12:34", so a single fixed
     target doesn't fit both) for the same reason .note-history-btn expands
     via width: a real value the browser can transition on its own. .rec-dot
     is the same pulsing dot #rec-float-bar already uses elsewhere, reused
     as-is for visual consistency between the two "recording is running"
     indicators. */
  .note-toolbar-timer{
    flex:none; display:flex; align-items:center; gap:6px; height:34px; box-sizing:border-box;
    max-width:0; padding:0; overflow:hidden; opacity:0; white-space:nowrap; pointer-events:none;
    transition:max-width .3s cubic-bezier(.4,0,.2,1), padding .3s cubic-bezier(.4,0,.2,1), opacity .2s ease;
  }
  .note-toolbar-timer.show{max-width:100px; padding:0 5px 0 8px; opacity:1;}
  .note-toolbar-timer .mono{font-size:0.82rem; font-weight:800; color:var(--text);}
  /* Pink here specifically (not the shared .rec-dot default red) — matches
     the recording accent used everywhere else on this screen (mic button
     border/liquid fill); #rec-float-bar's own dot and the chat voice-note
     recorder's are separate contexts, left at their existing red. */
  .note-toolbar-timer .rec-dot{background:var(--accent-pink); color:var(--accent-pink);}
  .note-toolbar-timer.paused .rec-dot{animation-play-state:paused; opacity:.4;}

  /* Grid-paper canvas: same faint graph-paper recipe as .note-thumb, but a
     full open workspace filling the screen under the title — not a boxed
     "window" card (no .glass/.card here: no border, no background panel of
     its own, no rounded corners, no shadow). Paginated like a real document
     rather than one endless scroll: --page-h (JS-computed from the element's
     own width so each page keeps A4's 210:297 proportions, matching what the
     PDF export actually prints) and --num-pages (starts at 2, grows one page
     at a time as content reaches the last one — see growNotePagesForCanvas/
     setNotePagesForBody) together size the box to whole pages, seamlessly
     joined — the only visible seam is the thicker divider line the first
     background layer draws at each page boundary; the grid lines themselves
     (layers 2/3) tile straight through it. The text field is one single
     contenteditable regardless of how many pages that spans — pagination is
     purely a background/sizing effect, never a separate field per page.
     padding-bottom clears the floating toolbar. */
  #note-summary-view{
    /* the grid itself comes from .paper (see «Бумага заметок»); here only the
       thin line at each A4 page boundary, as the extra first layer */
    --paper-extra:repeating-linear-gradient(to bottom,
        transparent 0, transparent calc(var(--page-h, 400px) - 1px),
        color-mix(in srgb, var(--text) 16%, transparent) calc(var(--page-h, 400px) - 1px),
        color-mix(in srgb, var(--text) 16%, transparent) var(--page-h, 400px));
    min-height:calc(var(--page-h, 400px) * var(--num-pages, 2));
    /* Clearance for the floating toolbar is a MARGIN, not padding — padding
       is still inside this box's background-painted area, so a bottom
       padding here was showing a stray partial extra "page" of grid lines
       tiling into that space below the true last page. Margin doesn't get
       background painted into it at all. */
    padding:0 2px 0;
    margin:0 -16px 90px;
    padding-left:calc(2px + 16px);
    padding-right:calc(2px + 16px);
  }
  /* Spans every page's full height, not just however tall its own typed
     content happens to be — otherwise a tap on a later, still-blank page (or
     just the empty lower half of the current one) misses the editable
     element entirely and lands on whatever's behind it instead. */
  #note-canvas-editable{
    display:none; min-height:calc(var(--page-h, 400px) * var(--num-pages, 2));
    outline:none; white-space:pre-wrap; word-wrap:break-word;
    font-size:15px; line-height:28px; padding-top:4px; color:var(--text); caret-color:var(--accent-2);
  }
  /* The browser's default vertical-align:super/sub for these tags changes
     how tall the line box needs to be to fit them, which — on a field whose
     every line is locked to the grid's 28px pitch — pushed the rest of that
     line (and the grid alignment under it) out of place. position:relative
     + a manual offset gets the same raised/lowered, smaller look without
     touching the line's own height; line-height:0 on the tag itself keeps
     its own (already-shrunk) font-size from independently inflating that
     height either. */
  #note-canvas-editable sup, #note-canvas-editable sub{
    font-size:0.7em; line-height:0; position:relative; vertical-align:baseline;
  }
  #note-canvas-editable sup{top:-0.7em;}
  #note-canvas-editable sub{top:0.28em;}

  /* ---------- floating bottom toolbar (outside .wrap — see the containing-
     block comment further down for why any fixed sheet/toolbar must live
     there) ---------- */
  .note-toolbar-float{
    position:fixed; left:50%; bottom:calc(14px + env(safe-area-inset-bottom)); z-index:40;
    display:flex; align-items:center; gap:6px; padding:7px; border-radius:999px;
    background:color-mix(in srgb, var(--pill-bg) 88%, transparent);
    border:1px solid var(--panel-border-strong);
    backdrop-filter:blur(28px) saturate(1.8); -webkit-backdrop-filter:blur(28px) saturate(1.8);
    box-shadow:0 18px 40px -16px rgba(0,0,0,0.55);
    /* Same morph feel as .tabbar-dock's own show/hide — the two cross-fade
       and slide past each other (tabbar down, this one up) via switchTab
       toggling .tabbar-dock's note-mode class opposite this one's .show. */
    opacity:0; pointer-events:none; transform:translateX(-50%) translateY(40%) scale(.85) translateZ(0);
    will-change:transform, opacity;
    transition:opacity .32s cubic-bezier(.4,0,.2,1), transform .32s cubic-bezier(.4,0,.2,1);
  }
  .note-toolbar-float.show{opacity:1; pointer-events:auto; transform:translateX(-50%) translateY(0) scale(1) translateZ(0);}
  .note-toolbar-btn{
    flex:none; width:46px; height:46px; border-radius:50%; display:flex; align-items:center; justify-content:center;
    background:var(--panel-bg-strong); border:1px solid var(--panel-border); color:var(--text); cursor:pointer;
    transition:transform .15s cubic-bezier(.34,1.56,.64,1), opacity .15s ease;
  }
  .note-toolbar-btn:active{transform:scale(.9);}
  .note-toolbar-btn svg{position:relative; width:20px; height:20px; stroke:currentColor; fill:none; stroke-width:2.1; stroke-linecap:round; stroke-linejoin:round;}
  /* Флаг/плеер: appear/disappear by animating width (0 -> 46px), same
     technique as .note-history-btn in the top panel (see its own comment)
     — a real value the browser can transition on its own, so the rest of
     the toolbar visibly slides over to make/reclaim room as one smooth
     motion, instead of the button (and everything after it) just popping
     in/out via the "hidden" attribute the way it did before. overflow:
     hidden clips the icon out of view while collapsed rather than
     squashing it, and flex:none (inherited from .note-toolbar-btn) keeps
     neighboring buttons from fighting this one's width as it grows.
     margin-right:-6px while collapsed cancels out the row's own flex `gap`
     on this item's trailing side — gap is added unconditionally between
     every pair of items regardless of their width, so a width:0 button
     would otherwise still leave TWO full gaps (its own on each side, 12px
     total) sitting between its neighbors instead of one normal 6px, which
     is exactly what made the play/tools gap read as bigger than every
     other pair whenever play was collapsed. */
  .note-toolbar-btn.expandable{
    width:0; overflow:hidden; opacity:0; pointer-events:none; margin-right:-6px;
    transition:width .3s cubic-bezier(.4,0,.2,1), opacity .2s ease, margin-right .3s cubic-bezier(.4,0,.2,1);
  }
  .note-toolbar-btn.expandable.show{width:46px; opacity:1; pointer-events:auto; margin-right:0;}
  /* Mic <-> stop-square <-> play-triangle icon swaps (see swapMicIcon()) are
     an innerHTML replacement, not a single shape morphing into another —
     nothing to transition between mid-swap on its own. .icon-swap is
     toggled just before/after that replacement so the OLD icon shrinks/
     fades away, the swap happens while it's invisible, and the NEW one
     grows/fades back in — paired with the button's own background/border
     transition above so the whole thing reads as one continuous morph
     (idle blue circle -> transparent pink-bordered "recording" square)
     instead of the color changing smoothly while the icon just pops. */
  .note-toolbar-btn.main svg, .note-format-btn.main svg{
    /* position:relative (not just DOM order) is what actually keeps this
       above .rec-mic-fill as the liquid rises — an absolutely positioned
       sibling paints above plain in-flow content regardless of markup
       order; giving the icon a position (any position) puts it in the
       same positioned stacking bucket, where DOM order (icon after the
       fill) finally decides it, on top. */
    position:relative;
    transition:transform .16s cubic-bezier(.4,0,.2,1), opacity .16s ease;
  }
  .note-toolbar-btn.main.icon-swap svg, .note-format-btn.main.icon-swap svg{
    transform:scale(.4) rotate(-20deg); opacity:0;
  }
  .note-toolbar-btn.main{
    /* Same 46px as every other button on this bar now (was 52px) — one
       consistent size across the row instead of the mic standing out as
       larger. */
    position:relative; overflow:hidden;
    background:var(--accent-2-dark); border:1.5px solid transparent; color:var(--btn-text);
    transition:transform .15s cubic-bezier(.34,1.56,.64,1), opacity .15s ease,
      background .28s cubic-bezier(.4,0,.2,1), border-color .28s cubic-bezier(.4,0,.2,1);
  }
  /* The "actively recording" square specifically — filled solid pink always
     (not theme-dependent, it's the same accent everywhere), with a stroke
     that follows --text so it reads as a crisp white outline in dark theme
     and a dark one in light theme, instead of just an unfilled outline in
     whatever the button's current text color happens to be. */
  .rec-stop-icon{fill:var(--accent-pink); stroke:var(--text); stroke-width:1.5;}
  /* Actively recording (not paused): the flat blue fill empties out to just
     a pink outline — the button itself carries no color of its own here,
     .rec-mic-fill underneath is the ONLY source of pink, so its live
     rise-and-fall with volume is what actually reads as "recording right
     now" instead of a static color swap. Paused intentionally falls back
     to the plain .main default above (solid blue, no override here) —
     same look as idle, since nothing's actually being captured. */
  .note-toolbar-btn.main.recording:not(.paused){background:transparent; border-color:var(--accent-pink);}
  .note-toolbar-btn.disabled{opacity:.4; pointer-events:none;}
  .note-toolbar-btn[hidden]{display:none;}
  .note-toolbar-flag-badge{
    position:absolute; top:-2px; right:-2px; min-width:16px; height:16px; padding:0 3px; border-radius:999px;
    background:var(--accent-2); color:#fff; font-size:0.62rem; font-weight:800; display:none; align-items:center; justify-content:center;
  }
  .note-toolbar-flag-badge.show{display:flex;}
  .note-toolbar-btn{position:relative;}

  /* Liquid volume fill for the mic button while recording — replaces the
     old #rec-waveform bar array entirely (see startWaveform/stopWaveform):
     one aggregate volume value drives --fill (0..1, written every animation
     frame) instead of per-bar scaleY(), rising and falling from the bottom
     like a liquid filling the button. The height transition is eased and
     slightly slower than the ~16ms frame rate it's fed at, so the level
     genuinely glides/settles toward each new reading (real liquid has
     inertia) instead of jittering to match every frame exactly; a very
     slow, subtle vertical bob on top keeps the surface gently alive even
     while the volume itself briefly holds still, instead of looking frozen
     between updates. */
  /* bottom:-3px + the matching "+ 3px" in height makes the fill bleed 3px
     past the button's own bottom edge (clipped away by the button's own
     overflow:hidden) rather than exactly matching it — the water LEVEL
     (the top edge, which is all that actually matters visually) lands in
     exactly the same place either way, but a rectangular fill's flat
     bottom edge meeting a circular clip boundary at their single tangent
     point is exactly the kind of sub-pixel seam that shows up as a hairline
     of the transparent button background peeking through right at the
     bottom — overshooting past the clip boundary entirely removes that
     seam instead of trying to land exactly on it. */
  .rec-mic-fill{
    position:absolute; left:0; right:0; bottom:-3px; height:calc(var(--fill, 0) * 100% + 3px);
    background:var(--accent-pink); pointer-events:none; opacity:0;
    transition:height .22s cubic-bezier(.3,.9,.4,1), opacity .2s ease;
    animation:recMicBob 2.9s ease-in-out infinite;
  }
  @keyframes recMicBob{ 0%, 100%{transform:translateY(0);} 50%{transform:translateY(-1px);} }
  /* Only visible while actually recording — same :not(.paused) gate as the
     border above, so a paused (or idle) button never shows a leftover
     puddle of pink sitting under the icon on top of its own plain blue
     fill; it just isn't there until the button goes transparent again. */
  .note-toolbar-btn.main.recording:not(.paused) .rec-mic-fill,
  .note-format-btn.main.recording:not(.paused) .rec-mic-fill{opacity:1;}
  /* Three real wave crests (an SVG sine tile used as a mask, not a
     scrolling dot pattern), not just two — three independent, non-lockstep
     durations/directions/phases (3.4s/2.5s/4.2s) never quite line back up
     with each other on any short cycle, which is what actually reads as an
     organic, "произвольная" liquid surface rather than a mechanically
     repeating pattern; two alone still had an obvious, short common cycle.
     The tile itself is wide and shallow-curved (one full up-down sweep
     every 48px, not a tight ripple) so it reads as a real winding swell
     even at this small a size, and --amp's own baseline (see startWaveform)
     never drops low enough to flatten out completely — the surface should
     always look alive, even in near-silence, with real volume just adding
     extra height/choppiness on top rather than being the only thing
     keeping it moving at all. Their shared transform:scaleY(var(--amp)) is
     written every animation frame from startWaveform's tick() alongside
     --fill, using the SAME instantaneous volume reading — a loud moment
     visibly agitates the surface further, instead of the waves just
     scrolling past at a constant, volume-blind rate the way a single
     decorative texture would. */
  .rec-mic-fill::before, .rec-mic-fill::after, .rec-mic-wave3{
    content:''; position:absolute; left:-50%; right:-50%; top:-9px; height:18px;
    background:var(--accent-pink);
    -webkit-mask-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0OCAyMCI+PHBhdGggZD0iTTAgMTAgUTEyIDAgMjQgMTAgUTM2IDIwIDQ4IDEwIFYyMCBIMCBaIiBmaWxsPSJ3aGl0ZSIvPjwvc3ZnPg==);
    mask-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0OCAyMCI+PHBhdGggZD0iTTAgMTAgUTEyIDAgMjQgMTAgUTM2IDIwIDQ4IDEwIFYyMCBIMCBaIiBmaWxsPSJ3aGl0ZSIvPjwvc3ZnPg==);
    -webkit-mask-size:48px 18px; mask-size:48px 18px;
    -webkit-mask-repeat:repeat-x; mask-repeat:repeat-x;
    transform-origin:center bottom;
    transform:scaleY(var(--amp, .85));
    transition:transform .18s ease-out;
  }
  .rec-mic-wave3{display:block;}
  .rec-mic-fill::before{animation:recMicMaskScrollA 3.4s linear infinite; opacity:.3;}
  .rec-mic-fill::after{animation:recMicMaskScrollB 2.5s linear infinite; opacity:.55; top:-7px; height:15px;}
  .rec-mic-wave3{animation:recMicMaskScrollC 4.2s linear .5s infinite; opacity:.9; top:-5px; height:12px;}
  /* Each layer's own loop still travels exactly one tile width (48px) so it
     keeps repeating seamlessly with no snap-back at the loop point — the
     "never quite realigns" organic feel comes purely from the three
     DURATIONS (no common short cycle) and a starting offset on the third,
     not from mismatched travel distances, which would just make each
     individual layer stutter. */
  @keyframes recMicMaskScrollA{
    from{-webkit-mask-position:0 0; mask-position:0 0;}
    to{-webkit-mask-position:-48px 0; mask-position:-48px 0;}
  }
  @keyframes recMicMaskScrollB{
    from{-webkit-mask-position:0 0; mask-position:0 0;}
    to{-webkit-mask-position:48px 0; mask-position:48px 0;}
  }
  @keyframes recMicMaskScrollC{
    from{-webkit-mask-position:0 0; mask-position:0 0;}
    to{-webkit-mask-position:-48px 0; mask-position:-48px 0;}
  }

  /* ---------- formatting toolbar: shown instead of note-toolbar-float while
     the grid canvas has keyboard focus, pinned to the keyboard's top edge
     (position:fixed, but `bottom` is recomputed in JS from
     window.visualViewport rather than a fixed CSS value — see
     updateFormatToolbarPosition). Same glass-pill language as
     .note-toolbar-float, just a row of smaller flat buttons instead of a
     ring of separate round ones. ---------- */
  .note-format-toolbar{
    position:fixed; left:16px; right:16px; max-width:608px; margin:0 auto; bottom:0; z-index:42;
    display:flex; align-items:center; gap:2px; padding:6px; border-radius:18px;
    background:color-mix(in srgb, var(--pill-bg) 94%, transparent);
    border:1px solid var(--panel-border-strong);
    backdrop-filter:blur(28px) saturate(1.8); -webkit-backdrop-filter:blur(28px) saturate(1.8);
    box-shadow:0 -8px 24px -12px rgba(0,0,0,0.5);
    opacity:0; visibility:hidden; pointer-events:none; transform:translateY(10px) scale(.96) translateZ(0);
    /* visibility transitions with a delay when hiding (so the fade-out
       actually gets to play instead of the element vanishing the instant
       .show is removed) but instantly when showing. */
    transition:opacity .16s ease, transform .2s cubic-bezier(.34,1.56,.64,1),
      bottom .26s cubic-bezier(.22,.8,.32,1), visibility 0s linear .16s;
  }
  .note-format-toolbar.show{
    opacity:1; visibility:visible; pointer-events:auto; transform:translateY(0) scale(1) translateZ(0);
    transition:opacity .16s ease, transform .2s cubic-bezier(.34,1.56,.64,1),
      bottom .26s cubic-bezier(.22,.8,.32,1), visibility 0s linear 0s;
  }
  .note-format-sep{width:1px; align-self:stretch; margin:4px 2px; background:var(--panel-border);}
  .note-format-btn{
    flex:1 1 0; min-width:0; height:40px; border-radius:12px; display:flex; align-items:center; justify-content:center;
    background:transparent; color:var(--text); cursor:pointer; font-size:1.4rem; font-weight:700;
    transition:background .22s cubic-bezier(.4,0,.2,1), color .22s cubic-bezier(.4,0,.2,1), transform .15s cubic-bezier(.34,1.56,.64,1);
  }
  .note-format-btn:active{transform:scale(.9);}
  .note-format-btn svg{position:relative; width:23px; height:23px; stroke:currentColor; fill:none; stroke-width:2.1; stroke-linecap:round; stroke-linejoin:round;}
  /* Round like #note-toolbar-mic in the regular floating toolbar, not the
     rounded-rect every other button in this row (B/I/U etc.) uses — a
     fixed 40x40 circle (matching this row's own height) instead of the
     flexible width the rest share, since a circle can't stretch without
     stopping being one. */
  .note-format-btn.main{
    position:relative; overflow:hidden; flex:none; width:40px; border-radius:50%;
    border:1.5px solid transparent;
    background:var(--accent-2-dark); color:var(--btn-text);
    transition:background .22s cubic-bezier(.4,0,.2,1), color .22s cubic-bezier(.4,0,.2,1),
      transform .15s cubic-bezier(.34,1.56,.64,1), border-color .28s cubic-bezier(.4,0,.2,1);
  }
  /* Same "goes transparent, pink comes only from the live liquid fill"
     treatment as .note-toolbar-btn.main — see its own comment. */
  .note-format-btn.main.recording:not(.paused){background:transparent; border-color:var(--accent-pink);}
  /* The colored "on" state — smooth and consistent across every toggle
     (B/I/U in the main row, S/superscript/subscript in the expand panel). */
  .note-format-btn.active{background:color-mix(in srgb, var(--accent-2) 24%, transparent); color:var(--accent-2);}
  .note-format-btn#note-format-expand-toggle svg{transition:transform .22s cubic-bezier(.4,0,.2,1);}
  .note-format-btn#note-format-expand-toggle.open svg{transform:rotate(180deg);}

  /* Narrower than the main toolbar and right-anchored — sized and placed to
     sit neatly above the U / chevron / hide-keyboard cluster at the right
     end of it, not spanning the whole width for just 3 buttons. */
  .note-format-expand-panel{
    position:fixed; right:16px; left:auto; width:184px; bottom:0; z-index:41;
    display:flex; align-items:center; gap:2px; padding:6px; border-radius:18px;
    background:color-mix(in srgb, var(--pill-bg) 94%, transparent);
    border:1px solid var(--panel-border-strong);
    backdrop-filter:blur(28px) saturate(1.8); -webkit-backdrop-filter:blur(28px) saturate(1.8);
    box-shadow:0 -8px 24px -12px rgba(0,0,0,0.5);
    opacity:0; visibility:hidden; pointer-events:none; transform:translateY(8px) scale(.96) translateZ(0);
    /* visibility gets its own zero-length transition with a delay equal to
       the opacity duration when hiding — otherwise it snaps to hidden the
       instant .show is removed and the fade-out never gets to actually
       play. Going the other way (showing) it flips instantly, so the
       fade-in starts from a visible element right away. */
    transition:opacity .14s ease, transform .18s cubic-bezier(.34,1.56,.64,1),
      bottom .26s cubic-bezier(.22,.8,.32,1), visibility 0s linear .14s;
  }
  .note-format-expand-panel.show{
    opacity:1; visibility:visible; pointer-events:auto; transform:translateY(0) scale(1) translateZ(0);
    transition:opacity .14s ease, transform .18s cubic-bezier(.34,1.56,.64,1),
      bottom .26s cubic-bezier(.22,.8,.32,1), visibility 0s linear 0s;
  }
  .note-format-expand-panel .note-format-btn{font-size:1.2rem;}

  /* "+" quick-add popover: a small floating card above whichever toolbar is
     currently on screen, instead of the usual full-screen tempchat-overlay
     sheet -- that one requires blurring the canvas to make room, which
     closed the on-screen keyboard every time "+" was tapped mid-edit. This
     one is positioned in JS (see positionNotePlusSheet) and never touches
     focus itself, so opening/closing it leaves the keyboard exactly as it
     was. Same glass-pill language and show/hide mechanics (opacity +
     transform + a delayed visibility flip) as .note-format-expand-panel. */
  .note-plus-overlay{position:fixed; inset:0; z-index:44; pointer-events:none;}
  .note-plus-overlay.open{pointer-events:auto;}
  .note-plus-sheet-card{
    position:fixed; left:50%; bottom:0; z-index:45; width:min(90vw, 320px);
    background:color-mix(in srgb, var(--pill-bg) 94%, transparent);
    border:1px solid var(--panel-border-strong); border-radius:20px;
    backdrop-filter:blur(28px) saturate(1.8); -webkit-backdrop-filter:blur(28px) saturate(1.8);
    box-shadow:0 18px 40px -16px rgba(0,0,0,0.55);
    padding:8px 10px calc(6px + env(safe-area-inset-bottom));
    opacity:0; visibility:hidden; pointer-events:none;
    transform:translateX(-50%) translateY(10px) scale(.96) translateZ(0);
    transition:opacity .18s ease, transform .22s cubic-bezier(.34,1.56,.64,1),
      bottom .26s cubic-bezier(.22,.8,.32,1), visibility 0s linear .18s;
  }
  .note-plus-overlay.open .note-plus-sheet-card{
    opacity:1; visibility:visible; pointer-events:auto;
    transform:translateX(-50%) translateY(0) scale(1) translateZ(0);
    transition:opacity .18s ease, transform .22s cubic-bezier(.34,1.56,.64,1),
      bottom .26s cubic-bezier(.22,.8,.32,1), visibility 0s linear 0s;
  }
  .note-plus-sheet-card .event-sheet-head{padding:2px 6px 2px; margin-bottom:6px;}
  .note-plus-sheet-card .note-plus-row{padding:10px 6px; border-radius:12px; transition:background .15s ease;}
  .note-plus-sheet-card .note-plus-row:active{background:var(--panel-bg-strong);}
  /* Same tighter row treatment for "Параметры заметки" — a plain
     .tempchat-sheet, not a .note-plus-sheet-card, so it doesn't inherit the
     rule above; repeated here rather than adding that class, which would
     also pull in that card's own fixed/floating positioning (this sheet
     uses .tempchat-sheet's own centered-bottom-sheet positioning instead). */
  #note-params-sheet .note-plus-row{padding:10px 6px; border-radius:12px; transition:background .15s ease;}
  #note-params-sheet .note-plus-row:active{background:var(--panel-bg-strong);}

  /* ---------- "ИИ заметка" — a real full screen, not a small bottom sheet,
     covering the whole viewport rather than dimming a backdrop behind a
     card (there's no "behind" left to show once it's full-screen) —
     closing is only ever the explicit back link (see closeAiNoteSheet),
     same reasoning #note-audio-close is the only way to close the audio
     overlay. Slides/scales up from just below rest rather than a flat
     fade, matching the springy "something opens" language used everywhere
     else in this file. */
  .ai-note-overlay{
    position:fixed; inset:0; z-index:60; background:var(--bg);
    opacity:0; visibility:hidden; pointer-events:none;
    transform:translateY(22px) scale(.98); transform-origin:center bottom;
    transition:opacity .26s ease, transform .3s cubic-bezier(.4,0,.2,1), visibility 0s linear .26s;
    display:flex; flex-direction:column; overflow-y:auto;
    padding:calc(var(--tg-safe-top, 0px) + 14px) 16px calc(22px + env(safe-area-inset-bottom));
  }
  .ai-note-overlay.open{
    opacity:1; visibility:visible; pointer-events:auto;
    transform:translateY(0) scale(1);
    transition:opacity .3s ease, transform .36s cubic-bezier(.34,1.3,.64,1), visibility 0s linear 0s;
  }
  .ai-note-header{margin-bottom:16px;}
  .ai-note-header h2{font-size:1.32rem; font-weight:800; color:var(--text); margin:6px 0 0;}
  .ai-note-body{display:flex; flex-direction:column; gap:10px;}

  /* One consistent "feature card" language for every row — a colored icon
     badge (four different accents, one per feature, so the screen doesn't
     read as one flat list) + title/subtitle + chevron, instead of the thin
     icon-and-label rows the small sheets elsewhere use — this screen is the
     one place in the app explicitly asked to look richer than that. */
  .ai-note-card{
    display:flex; align-items:center; gap:14px; padding:14px; border-radius:18px; cursor:pointer;
    background:var(--panel-bg); border:1px solid var(--panel-border);
    transition:background .15s ease, transform .15s cubic-bezier(.34,1.56,.64,1);
    box-sizing:border-box; min-height:72px;
  }
  .ai-note-card:active{transform:scale(.98); background:var(--panel-bg-strong);}
  .ai-note-card-icon{
    flex:none; width:44px; height:44px; border-radius:14px; display:flex; align-items:center; justify-content:center;
  }
  .ai-note-card-icon svg{width:22px; height:22px; stroke:currentColor; fill:none; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round;}
  .ai-note-card-text{flex:1; min-width:0;}
  .ai-note-card-title{font-size:0.96rem; font-weight:700; color:var(--text);}
  .ai-note-card-sub{font-size:0.78rem; color:var(--text-faint); margin-top:2px;}
  .ai-note-card-chevron{flex:none; width:18px; height:18px; stroke:var(--text-faint); fill:none; stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round;}
  /* Same recipe (38% mix into transparent, not panel-bg) as the Главная
     action cards' own icon badges (.home-action-record/.home-action-import)
     — noticeably more saturated than the soft 20% .note-tag-* dots
     elsewhere, which is what "brighter, like other menus" meant here. */
  .ai-note-card-yellow .ai-note-card-icon{background:color-mix(in srgb, var(--accent-yellow) 38%, transparent); color:var(--accent-yellow);}
  .ai-note-card-purple .ai-note-card-icon{background:color-mix(in srgb, var(--accent-3) 38%, transparent); color:var(--accent-3);}
  .ai-note-card-pink .ai-note-card-icon{background:color-mix(in srgb, var(--accent-pink) 38%, transparent); color:var(--accent-pink);}
  .ai-note-card-blue .ai-note-card-icon{background:color-mix(in srgb, var(--accent-2-dark) 38%, transparent); color:var(--accent-2-dark);}

  /* ---------- Расшифровка — same card language, but expands in place ---------- */
  .ai-note-transcript{background:var(--panel-bg); border:1px solid var(--panel-border); border-radius:18px; overflow:hidden;}
  .ai-note-transcript-head{
    display:flex; align-items:center; gap:14px; padding:14px; cursor:pointer; transition:background .15s ease;
    box-sizing:border-box; min-height:72px;
  }
  .ai-note-transcript-head:active{background:var(--panel-bg-strong);}
  .ai-note-transcript-title-wrap{flex:1; min-width:0;}
  /* Single line (not two) — keeps this header's height in line with the
     other three cards' own icon-driven ~72px, "+-" the same size the way
     the whole screen was asked to read, instead of the preview text
     routinely making this one noticeably taller. */
  .ai-note-transcript-preview{
    font-size:0.8rem; color:var(--text-dim); margin-top:2px; line-height:1.4;
    display:-webkit-box; -webkit-line-clamp:1; -webkit-box-orient:vertical; overflow:hidden;
  }
  .ai-note-transcript.expanded .ai-note-transcript-preview{display:none;}
  .ai-note-transcript-head .agent-round-btn{width:32px; height:32px; background:var(--panel-bg-strong); border:none; backdrop-filter:none; -webkit-backdrop-filter:none; box-shadow:none;}
  .ai-note-transcript-head .agent-round-btn svg{width:15px; height:15px;}
  .ai-note-chevron{width:18px; height:18px; flex:none; stroke:var(--text-faint); fill:none; stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round; transition:transform .28s cubic-bezier(.4,0,.2,1);}
  .ai-note-transcript.expanded .ai-note-chevron{transform:rotate(180deg);}
  /* max-height (not grid-template-rows/fr, which some WebKit builds don't
     reliably animate or fully reveal) — a real, universally-supported
     transition target. 50vh comfortably fits most transcripts in full;
     anything longer scrolls inside instead of pushing the screen — that's
     what "Открыть полную расшифровку" is for. */
  .ai-note-transcript-body{max-height:0; overflow:hidden; transition:max-height .34s cubic-bezier(.4,0,.2,1);}
  .ai-note-transcript.expanded .ai-note-transcript-body{max-height:50vh; overflow-y:auto;}
  .ai-note-transcript-full{font-size:0.86rem; line-height:1.55; color:var(--text); white-space:pre-wrap; padding:0 14px 14px;}
  .ai-note-transcript-open-full{
    display:block; padding:0 14px 14px; font-size:0.8rem; font-weight:700; color:var(--accent-2); cursor:pointer;
  }

  .note-plus-row{display:flex; align-items:center; gap:12px; padding:12px 4px;}
  .note-plus-row svg{width:22px; height:22px; stroke:var(--text-dim); fill:none; stroke-width:1.8; flex:none;}
  .note-plus-row-title{font-size:0.92rem; font-weight:700; color:var(--text);}
  .note-plus-row.danger .note-plus-row-title{color:var(--danger);}
  .note-plus-row.danger svg{stroke:var(--danger);}

  .merge-choice-row{
    display:flex; flex-direction:column; align-items:flex-start; gap:2px; padding:12px 14px; border-radius:14px;
    background:var(--panel-bg-strong); border:1px solid var(--panel-border); margin-bottom:8px; cursor:pointer;
  }
  .merge-choice-row .merge-choice-title{font-size:0.92rem; font-weight:700; color:var(--text);}
  .merge-choice-row .merge-choice-sub{font-size:0.76rem; color:var(--text-faint);}
  .note-carousel-foot{padding:9px 11px 11px;}
  .note-carousel-title{font-family:'Unbounded'; font-size:0.86rem; font-weight:700; color:var(--text); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin:0 0 1px;}
  .note-carousel-meta{display:flex; align-items:center; justify-content:space-between; gap:6px;}
  .note-carousel-date{display:inline-flex; align-items:center; gap:4px; font-size:0.68rem; color:var(--text-faint); font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0;}
  .note-carousel-date svg{width:11px; height:11px; stroke:currentColor; fill:none; stroke-width:2.2; flex:none;}

  .note-tag{flex:none; font-family:'Unbounded'; font-weight:700; font-size:0.58rem; padding:1px 6px; border-radius:999px; white-space:nowrap; border:1px solid color-mix(in srgb, currentColor 45%, transparent);}
  .note-tag-cyan{color:var(--ev-cyan); background:color-mix(in srgb, var(--ev-cyan) 20%, transparent);}
  .note-tag-green{color:var(--ev-green); background:color-mix(in srgb, var(--ev-green) 20%, transparent);}
  .note-tag-orange{color:var(--accent); background:color-mix(in srgb, var(--accent) 22%, transparent);}
  .note-tag-purple{color:var(--ev-purple); background:color-mix(in srgb, var(--ev-purple) 20%, transparent);}
  .note-tag-pink{color:var(--ev-pink); background:color-mix(in srgb, var(--ev-pink) 20%, transparent);}
  .note-tag-gray{color:var(--text-faint); background:var(--panel-bg-strong);}

  .notes-all-heading{font-family:'Unbounded'; font-weight:800; font-size:1.5rem; margin:2px 0 14px;}
  .notes-tabs{position:relative; display:flex; gap:18px; margin-bottom:16px; border-bottom:1px solid var(--panel-border); overflow-x:auto; -webkit-overflow-scrolling:touch; scrollbar-width:none;}
  .notes-tabs::-webkit-scrollbar{display:none;}
  .notes-tab{flex:none; padding:2px 1px 12px; font-family:'Unbounded'; font-weight:700; font-size:0.86rem; color:var(--text-faint); cursor:pointer; transition:color .2s ease; white-space:nowrap;}
  .notes-tab.active{color:var(--accent-2);}
  .notes-tabs-indicator{position:absolute; bottom:-1px; left:0; height:2px; background:var(--accent-2); border-radius:2px; transition:transform .28s cubic-bezier(.2,.8,.2,1), width .28s cubic-bezier(.2,.8,.2,1);}

  .notes-all-group-title{font-family:'Unbounded'; font-weight:700; font-size:0.72rem; text-transform:uppercase; letter-spacing:.05em; color:var(--text-faint); margin:16px 2px 8px;}
  .notes-all-group-title:first-child{margin-top:0;}

  .note-list-row{display:flex; align-items:center; gap:12px; padding:9px 6px; cursor:pointer; border-radius:16px; transition:background .15s ease, transform .15s ease;}
  .note-list-row:active{transform:scale(0.98); background:var(--panel-bg-strong);}
  .note-list-thumb{flex:none; width:60px; height:76px; border-radius:12px; position:relative; overflow:hidden; background:var(--panel-bg-strong); border:1px solid var(--panel-border);}
  .note-list-thumb .note-thumb-inner{width:420%; transform:scale(0.238);}
  .note-list-thumb.note-thumb-empty-wrap .note-thumb-empty svg{width:22px; height:22px;}

  /* ---------- папки: конспекты с одинаковым названием, под «Недавними».
     Карточка — папка с ушком (::before/::after), из неё веером выглядывают
     миниатюры до трёх последних конспектов, спереди клапан с названием.
     Цвет папки --fc задаёт JS (по названию, как у тегов). ---------- */
  .notes-folders-hint{font-size:0.72rem; color:var(--text-faint);}
  .notes-folder-grid{display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:14px 12px; padding-top:4px;}
  .note-folder-card{position:relative; height:172px; cursor:pointer; -webkit-tap-highlight-color:transparent; transition:transform .15s ease;}
  .note-folder-card:active{transform:scale(0.96);}
  .note-folder-card::before{content:''; position:absolute; inset:16px 0 0 0; border-radius:20px; background:color-mix(in srgb, var(--fc) 34%, var(--panel-bg-strong));}
  .note-folder-card::after{content:''; position:absolute; top:6px; left:0; width:48%; height:24px; border-radius:14px 14px 0 0; background:color-mix(in srgb, var(--fc) 34%, var(--panel-bg-strong));}
  .note-folder-papers{position:absolute; left:14px; right:14px; top:26px; height:98px; z-index:1;}
  .note-folder-paper.note-thumb{
    position:absolute; inset:0; height:auto; border-radius:10px; border:1px solid var(--panel-border);
    box-shadow:0 2px 10px rgba(0,0,0,.18);
    transform:translateY(calc(8px - var(--i, 0) * 7px)) rotate(var(--rot, 0deg)); transform-origin:50% 100%;
    transition:transform .25s cubic-bezier(.22,1,.36,1);
  }
  .note-folder-paper .note-thumb-inner{width:400%; transform:scale(0.25);}
  .note-folder-paper.note-thumb-empty-wrap .note-thumb-empty svg{width:20px; height:20px;}
  .note-folder-card:hover .note-folder-paper{transform:translateY(calc(2px - var(--i, 0) * 9px)) rotate(calc(var(--rot, 0deg) * 1.4));}
  .note-folder-front{
    position:absolute; left:0; right:0; bottom:0; height:76px; z-index:2; box-sizing:border-box;
    display:flex; flex-direction:column; justify-content:flex-end; padding:12px 14px;
    border-radius:18px; border:1px solid color-mix(in srgb, var(--fc) 45%, transparent);
    background:color-mix(in srgb, var(--fc) 20%, var(--panel-bg));
    box-shadow:0 -8px 18px rgba(0,0,0,.14);
  }
  .note-folder-title{margin:0; font-family:'Unbounded'; font-weight:600; font-size:0.84rem; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .note-folder-meta{margin:3px 0 0; font-size:0.72rem; color:var(--text-faint); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .note-folder-count{
    position:absolute; top:-12px; right:12px; min-width:24px; height:24px; padding:0 7px; box-sizing:border-box;
    display:flex; align-items:center; justify-content:center; border-radius:999px;
    background:var(--fc); color:#141414; font-family:'Unbounded'; font-weight:600; font-size:0.72rem;
    box-shadow:0 2px 8px rgba(0,0,0,.25);
  }

  /* экран открытой папки */
  .note-folder-head{display:flex; align-items:center; gap:12px; margin:2px 0 14px;}
  .note-folder-head-text{min-width:0;}
  .note-folder-head .notes-all-heading{margin:0; font-size:1.3rem; overflow-wrap:anywhere;}
  .note-folder-head-icon{flex:none; width:48px; height:48px; border-radius:16px; display:flex; align-items:center; justify-content:center; background:color-mix(in srgb, var(--fc) 26%, transparent); color:var(--fc);}
  .note-folder-head-icon svg{width:26px; height:26px; stroke:currentColor; fill:none; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round;}
  .note-folder-sub{margin:3px 0 0; font-size:0.8rem; color:var(--text-faint);}
  .note-list-info{flex:1; min-width:0;}
  .note-list-title{font-family:'Unbounded'; font-size:0.92rem; font-weight:700; color:var(--text); margin:0 0 4px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
  .note-list-date{display:flex; align-items:center; gap:4px; font-size:0.74rem; color:var(--text-faint); font-weight:600; margin:0 0 6px;}
  .note-list-date svg{width:11px; height:11px; stroke:currentColor; fill:none; stroke-width:2.2; flex:none;}

  /* long-press action sheet — same open/close mechanic as .tempchat-overlay
     (its backdrop), but the sheet itself is independently position:fixed to
     the viewport bottom rather than relying on the backdrop's flex
     align-items:flex-end — on this WebView that flex alignment was
     resolving against the wrong box (rendered pinned near the top of the
     screen instead of the bottom). Anchoring the sheet to the viewport
     itself sidesteps that regardless of what the parent's layout is doing. */
  .note-action-sheet{
    position:fixed; left:0; right:0; bottom:0; z-index:91;
    width:100%; max-width:440px; margin:0 auto; padding:0 14px calc(14px + env(safe-area-inset-bottom));
    transform:translateY(100%); transition:transform .3s cubic-bezier(.2,.8,.2,1);
    pointer-events:none;
  }
  .tempchat-overlay.open .note-action-sheet{transform:translateY(0); pointer-events:auto;}
  .note-action-sheet-group{background:var(--pill-bg); backdrop-filter:blur(20px) saturate(1.6); -webkit-backdrop-filter:blur(20px) saturate(1.6); border:1px solid var(--panel-border); border-radius:18px; overflow:hidden; margin-bottom:10px;}
  .note-action-sheet-title{padding:14px 16px 10px; text-align:center; font-size:0.78rem; font-weight:700; color:var(--text-faint); overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
  .note-action-item{display:flex; align-items:center; gap:12px; padding:14px 16px; font-size:0.96rem; font-weight:600; color:var(--text); cursor:pointer; border-top:1px solid var(--panel-border);}
  .note-action-item:active{background:rgba(255,255,255,0.06);}
  .note-action-item svg{width:20px; height:20px; stroke:currentColor; fill:none; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; flex:none;}
  .note-action-item.danger{color:var(--danger);}
  .note-action-item.is-fav svg{fill:var(--accent-yellow); stroke:var(--accent-yellow);}
  .note-action-cancel{display:block; text-align:center; padding:14px; font-size:0.98rem; font-weight:700; color:var(--accent-2); background:var(--pill-bg); backdrop-filter:blur(20px) saturate(1.6); -webkit-backdrop-filter:blur(20px) saturate(1.6); border:1px solid var(--panel-border); border-radius:18px; cursor:pointer;}
  .note-action-cancel:active{background:var(--panel-bg-strong);}
  .note-rename-sheet .field{margin-bottom:14px;}

  .notes-search-row{display:flex; align-items:stretch; gap:10px; cursor:pointer; padding:10px 4px;}
  .note-search-date{flex:none; width:44px; display:flex; flex-direction:column; align-items:center; justify-content:center; font-family:var(--font-text); color:var(--text-faint);}
  .note-search-date b{font-family:'Unbounded'; font-weight:700; font-size:1.1rem; color:var(--text); line-height:1.1;}
  .note-search-date span{font-size:0.6rem; font-weight:700; text-transform:uppercase;}
  .note-search-body{flex:1; min-width:0; background:var(--panel-bg-strong); border-radius:14px; padding:9px 12px;}
  .note-search-title{font-size:0.84rem; font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
  .note-search-snippet{font-size:0.72rem; color:var(--text-dim); margin-top:2px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
  .note-search-snippet mark{background:color-mix(in srgb, var(--accent-2-dark) 35%, transparent); color:var(--text); border-radius:3px; padding:0 1px;}

  /* No longer a visible tab on the note screen itself — the full
     interactive transcript (search/speaker-rename/importance-marking) is
     still fully wired and reachable, just from the new "ИИ заметка" sheet's
     Расшифровка row instead of an always-on toggle (see openAiNoteSheet).
     Kept as a real, just-hidden element (not deleted) since setNoteView
     still reads/writes its dataset for bookkeeping. */
  .note-toggle{display:none; position:relative; background:var(--panel-bg-strong); border-radius:999px; padding:3px; margin-bottom:14px; gap:2px;}
  /* a separate sliding pill underneath the labels — same trick as the bottom
     tabbar's own #tab-indicator — instead of the active label just flipping
     its own background instantly. Pure CSS (percentage width + transform),
     not JS-measured, so it's already correct the first frame the panel
     becomes visible, no post-hoc re-measuring needed. */
  .note-toggle-indicator{
    position:absolute; top:3px; bottom:3px; left:3px; width:calc(50% - 4px); border-radius:999px;
    background:var(--accent-2-dark); z-index:0;
    transition:transform .32s cubic-bezier(.4,0,.2,1);
  }
  .note-toggle[data-view="transcript"] .note-toggle-indicator{transform:translateX(calc(100% + 2px));}
  .note-toggle span{position:relative; z-index:1; flex:1; text-align:center; padding:9px 0; border-radius:999px; font-size:0.84rem; font-weight:700; color:var(--text-faint); cursor:pointer; transition:color .2s;}
  .note-toggle span.active{color:var(--btn-text);}
  /* Конспект/Расшифровка used to swap with a hard display:none/block cut —
     now a quick fade+slide instead (see setNoteView). */
  #note-summary-view, #note-transcript-view{transition:opacity .2s ease, transform .2s ease;}
  #note-summary-view.note-view-fading, #note-transcript-view.note-view-fading{opacity:0; transform:translateY(6px);}

  /* custom player — the native <audio controls> UI just showed a bare
     "Error" and refused to do anything on iOS Safari/WebKit (Telegram's iOS
     Mini App), independent of any content-type fix. This drives its own
     play/pause + scrubber off the same <audio> element's events, hidden. */
  .note-audio-player{
    position:relative; display:flex; align-items:center; gap:12px; margin-bottom:14px;
    padding:8px 16px 8px 8px; border-radius:999px;
    background:var(--pill-bg); border:1px solid var(--panel-border);
    backdrop-filter:blur(20px) saturate(1.6); -webkit-backdrop-filter:blur(20px) saturate(1.6);
    box-shadow:0 16px 36px -20px rgba(0,0,0,0.55);
  }
  .note-audio-play{
    position:relative; flex:none; width:40px; height:40px; border-radius:50%; display:flex; align-items:center; justify-content:center;
    background:var(--accent-2-dark); color:var(--btn-text); cursor:pointer; border:none;
    transition:transform .15s cubic-bezier(.34,1.56,.64,1);
  }
  .note-audio-play:active{transform:scale(.9);}
  .note-audio-play svg{width:18px; height:18px; flex:none; transition:opacity .12s ease;}
  .note-audio-play.loading svg{opacity:0;}
  .note-audio-spinner{
    position:absolute; width:18px; height:18px; border-radius:50%; border:2px solid color-mix(in srgb, var(--btn-text) 35%, transparent);
    border-top-color:var(--btn-text); opacity:0; animation:recSpin .8s linear infinite; pointer-events:none;
  }
  .note-audio-play.loading .note-audio-spinner{opacity:1;}
  .note-audio-body{flex:1; min-width:0; display:flex; flex-direction:column; gap:7px;}
  /* height itself stays a slim line, but the actual touch/pointer target is
     taller (see ::before) — a 5px line is hard to reliably grab with a
     finger, and events on that padding still bubble up to this element. */
  .note-audio-scrub{position:relative; height:5px; border-radius:999px; background:var(--panel-bg-strong); cursor:pointer; touch-action:none; transition:height .15s cubic-bezier(.34,1.56,.64,1);}
  .note-audio-scrub::before{content:''; position:absolute; top:-14px; bottom:-14px; left:0; right:0;}
  .note-audio-scrub.dragging{height:7px;}
  /* no width/left transition here on purpose — while playing, a
     requestAnimationFrame loop (see JS) repaints this every frame for
     genuinely continuous motion; a CSS transition on top of per-frame
     updates would just add lag, which is what read as "jerky" before
     (timeupdate alone only fires every ~250ms, so with a short transition it
     visibly hitched between updates instead of gliding). */
  .note-audio-scrub-fill{position:absolute; top:0; left:0; bottom:0; width:0%; border-radius:999px; background:var(--accent-2-dark);}
  .note-audio-scrub-knob{
    position:absolute; top:50%; left:0%; width:13px; height:13px; border-radius:50%; background:var(--accent-2-dark);
    box-shadow:0 2px 6px rgba(0,0,0,0.4); transform:translate(-50%,-50%) scale(0);
    transition:transform .15s cubic-bezier(.34,1.56,.64,1);
  }
  .note-audio-scrub.dragging .note-audio-scrub-knob{width:16px; height:16px;}
  .note-audio-scrub:hover .note-audio-scrub-knob, .note-audio-scrub.dragging .note-audio-scrub-knob{transform:translate(-50%,-50%) scale(1);}
  .note-audio-times{display:flex; justify-content:space-between; font-size:0.68rem; font-weight:700; color:var(--text-faint);}
  .note-audio-speed{
    flex:none; min-width:38px; text-align:center; padding:7px 9px; border-radius:999px; font-size:0.72rem; font-weight:800; cursor:pointer;
    background:var(--panel-bg-strong); border:1px solid var(--panel-border); color:var(--text);
    transition:transform .15s cubic-bezier(.34,1.56,.64,1), background .2s ease, color .2s ease;
  }
  .note-audio-speed:active{transform:scale(.9);}
  .note-audio-speed.on{background:var(--accent-2-dark); color:var(--btn-text); border-color:transparent;}
  .note-audio-close{
    flex:none; width:32px; height:32px; border-radius:50%; display:flex; align-items:center; justify-content:center;
    background:var(--panel-bg-strong); border:1px solid var(--panel-border); color:var(--text-dim); cursor:pointer;
    transition:transform .15s cubic-bezier(.34,1.56,.64,1), color .2s ease;
  }
  .note-audio-close:active{transform:scale(.88); color:var(--danger);}
  .note-audio-close svg{width:15px; height:15px; stroke:currentColor; fill:none; stroke-width:2.3; stroke-linecap:round; stroke-linejoin:round;}

  /* Opened via the toolbar's play button — either previewing a just-
     recorded, still-unfinished take while paused, or a finished note's own
     saved audio (see loadNoteAudio, which only ever prepares that audio in
     the background now, never shows this player by itself). Floats fixed,
     pinned right under #note-detail-topbar (JS sets `top` from that bar's
     own measured bottom edge — see openNoteAudioOverlay), instead of
     sitting in flow between the title and the grid canvas, so it reads as
     a dropdown from the top controls rather than squeezed into the layout.
     No dimming backdrop: it doesn't need to demand full-screen modal
     attention, just to sit clearly above the canvas under the buttons it
     came from. Slides down slightly + scales
     in with a springy overshoot (the same curve used for a lot of this
     file's "something appears" moments) rather than a flat fade, so
     opening it has a bit of its own character instead of feeling like a
     generic popup. mounted/show are two separate classes (not one) for the
     same reason .note-history-btn needed the same split: going from
     display:none straight to its final opacity/transform in one
     synchronous tick left no frame in between for the browser to actually
     paint a "from" state, so nothing visibly transitioned — see
     openNoteAudioOverlay's own comment for the double-rAF that fixes it. */
  .note-audio-player.overlay-mode{
    display:none; position:fixed; left:16px; right:16px; max-width:420px; margin:0 auto;
    z-index:47;
    opacity:0; transform:translateY(-10px) scale(.94);
    transition:opacity .26s ease, transform .3s cubic-bezier(.34,1.3,.64,1);
  }
  .note-audio-player.overlay-mode.mounted{display:flex;}
  .note-audio-player.overlay-mode.show{opacity:1; transform:translateY(0) scale(1);}

  /* ---------- transcript toolbar: search, speaker filter, important-moment
     navigation — all in the same round-glass-button language as the rest of
     the app. ---------- */
  .transcript-toolbar{display:flex; align-items:center; gap:6px; margin-bottom:14px;}
  .transcript-tool-sep{flex:1;}
  .transcript-tool-btn{
    flex:none; width:36px; height:36px; border-radius:50%; display:flex; align-items:center; justify-content:center;
    background:var(--pill-bg); border:1px solid var(--panel-border); color:var(--text); cursor:pointer;
    backdrop-filter:blur(20px) saturate(1.6); -webkit-backdrop-filter:blur(20px) saturate(1.6);
    box-shadow:0 6px 16px -8px rgba(0,0,0,0.5);
    transition:transform .15s cubic-bezier(.34,1.56,.64,1), background .2s ease, color .2s ease;
  }
  .transcript-tool-btn:active{transform:scale(.88);}
  .transcript-tool-btn svg{width:16px; height:16px; stroke:currentColor; fill:none; stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round;}
  .transcript-tool-btn.active{background:var(--accent-2-dark); color:var(--btn-text);}
  .transcript-tool-flag{color:#ff2d2d;}
  .transcript-tool-flag svg{fill:none;}

  .transcript-search-row{
    display:flex; align-items:center; gap:8px; margin-bottom:14px; padding:4px 6px 4px 14px; border-radius:999px;
    background:var(--pill-bg); border:1px solid var(--panel-border);
    animation:transcriptToolPop .22s cubic-bezier(.34,1.56,.64,1);
  }
  .transcript-search-row input{flex:1; min-width:0; border:none; background:transparent; box-shadow:none; padding:8px 0; margin:0; font-size:0.88rem;}
  .transcript-search-count{flex:none; font-size:0.72rem; font-weight:700; color:var(--text-faint); white-space:nowrap;}
  .transcript-search-nav, .transcript-search-close{
    flex:none; width:30px; height:30px; border-radius:50%; display:flex; align-items:center; justify-content:center; cursor:pointer;
    color:var(--text-dim); transition:background .15s ease, color .15s ease, opacity .2s ease;
  }
  .transcript-search-nav:active, .transcript-search-close:active{background:var(--panel-bg-strong);}
  .transcript-search-nav svg, .transcript-search-close svg{width:16px; height:16px; stroke:currentColor; fill:none; stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round;}
  .transcript-search-nav.disabled{opacity:.35; pointer-events:none;}
  @keyframes transcriptToolPop{ from{opacity:0; transform:scaleY(.7); transform-origin:top;} to{opacity:1; transform:scaleY(1);} }

  .transcript-speaker-chips{
    display:flex; flex-wrap:wrap; gap:8px; margin-bottom:14px;
    animation:transcriptToolPop .22s cubic-bezier(.34,1.56,.64,1);
  }
  .transcript-speaker-chip{
    padding:8px 15px; border-radius:999px; font-size:0.78rem; font-weight:700; cursor:pointer;
    background:var(--panel-bg-strong); border:1px solid var(--panel-border); color:var(--text-faint);
    transition:background .2s ease, color .2s ease, opacity .2s ease;
  }
  .transcript-speaker-chip.on{background:var(--accent-2-dark); color:var(--btn-text); border-color:transparent;}

  /* a hidden (filtered out) transcript row collapses smoothly rather than
     just vanishing — used by both the search filter and the speaker filter. */
  /* a plain instant hide, deliberately not height-animated — a fixed
     max-height cap risks clipping a genuinely long line, and CSS max-height
     transitions look janky anyway when the real content height is far
     smaller than the cap. Standard, expected behavior for search/filter
     results everywhere. */
  .transcript-seg.tr-hidden, .transcript-photo-card.tr-hidden, .transcript-note-card.tr-hidden{
    display:none;
  }
  /* briefly flashes an item scrolled-to from search results, the important
     digest, or the prev/next important-moment buttons, so it's obvious which
     one you landed on. */
  @keyframes transcriptFlash{
    0%, 100%{box-shadow:0 0 0 0 transparent;}
    30%{box-shadow:0 0 0 3px color-mix(in srgb, var(--accent-2-dark) 55%, transparent);}
  }
  .transcript-flash{animation:transcriptFlash 1s ease;}
  mark.transcript-search-hit{background:color-mix(in srgb, var(--accent-2-dark) 45%, transparent); color:var(--text); border-radius:3px; padding:0 1px;}

  /* photo/text-note cards interleaved into the transcript by timestamp,
     alongside the regular speaker lines — same visual weight as a segment,
     colored distinctly so it still reads as "not spoken text". */
  .transcript-photo-card, .transcript-note-card{display:flex; flex-direction:column; gap:8px;}
  .transcript-attach-head{display:flex; align-items:center; gap:8px;}
  .transcript-attach-head svg{width:15px; height:15px; stroke:var(--text-faint); fill:none; stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round; flex:none;}
  .transcript-attach-label{font-size:0.78rem; font-weight:700; color:var(--text-faint);}
  .transcript-photo-card img{
    display:block; width:100%; max-height:260px; object-fit:cover; border-radius:14px; cursor:pointer;
    background:var(--panel-bg-strong); min-height:80px; opacity:0; transition:opacity .3s ease;
  }
  .transcript-photo-card img.show{opacity:1;}
  .transcript-note-card-text{
    font-family:var(--font-text); font-size:0.94rem; line-height:1.5; color:var(--text);
    background:color-mix(in srgb, var(--accent-2-dark) 10%, transparent); border-radius:12px; padding:10px 12px;
  }

  /* ---------- important-moments digest sheet ---------- */
  .digest-item{display:flex; flex-direction:column; gap:4px; padding:12px 10px; border-radius:14px; cursor:pointer; transition:background .15s ease;}
  .digest-item:active{background:var(--panel-bg-strong);}
  .digest-item-head{display:flex; align-items:center; gap:8px;}
  .digest-item-speaker{font-size:0.8rem; font-weight:800; color:var(--accent-2-dark);}
  .digest-item-time{font-family:'Space Mono',monospace; font-size:0.7rem; color:var(--text-faint); margin-left:auto;}
  .digest-item-snippet{font-size:0.86rem; line-height:1.4; color:var(--text);}
  .digest-item-snippet mark{background:color-mix(in srgb, #ff2d2d 26%, transparent); color:var(--text); border-radius:3px; padding:0 1px;}

  .note-photos-row{display:flex; gap:8px; overflow-x:auto; margin-top:10px; padding-bottom:2px;}
  .note-photo-thumb{flex:none; width:72px; height:72px; border-radius:14px; overflow:hidden; position:relative; background:var(--panel-bg-strong); cursor:pointer;}
  .note-photo-thumb img{width:100%; height:100%; object-fit:cover; display:block;}
  .note-photo-thumb span{position:absolute; left:4px; bottom:3px; font-family:'Space Mono',monospace; font-size:0.58rem; font-weight:700; color:#fff; text-shadow:0 1px 3px rgba(0,0,0,0.7);}
  .note-text-notes-list{display:flex; flex-direction:column; gap:8px; margin-top:10px;}
  .note-text-note-item{background:var(--panel-bg-strong); border-radius:14px; padding:9px 12px;}
  .note-text-note-item .mono{font-size:0.66rem; color:var(--text-faint); display:block; margin-bottom:2px;}
  .note-text-note-item p{font-size:0.85rem; line-height:1.4;}


  /* no more boxed "window" around the whole transcript — segments just sit on
     the page's own background now; only the per-segment action button keeps
     the app's usual glass-round-button treatment for contrast/legibility. */
  .transcript-list{display:flex; flex-direction:column; gap:16px;}
  .transcript-seg{padding:0; border-radius:14px;}
  /* legacy: a whole segment marked important the old way, before per-fragment
     selection existed — still shown for any note that already has one, just
     no longer something the UI lets you create; new marks are always
     fragment-level (see .transcript-important-frag below). */
  .transcript-seg.important{background:color-mix(in srgb, #ff2d2d 14%, transparent); padding:10px 8px; margin:0 -8px;}
  .transcript-seg-head{display:flex; align-items:center; gap:10px; margin-bottom:6px;}
  .transcript-speaker{font-family:var(--font-text); font-size:0.94rem; font-weight:800; color:var(--accent-2-dark); cursor:pointer;}
  .transcript-time{font-family:'Space Mono', ui-monospace, monospace; font-size:0.78rem; font-weight:700; color:var(--text-faint); cursor:pointer; flex:none;}
  .transcript-time:active{color:var(--accent-2-dark);}
  .transcript-seg-actions{margin-left:auto; display:flex; align-items:center; gap:8px;}
  .transcript-ask-btn{
    position:relative; overflow:hidden;
    width:34px; height:34px; border-radius:50%; display:flex; align-items:center; justify-content:center; flex:none;
    background:var(--pill-bg); border:1px solid var(--panel-border); color:var(--text); cursor:pointer;
    backdrop-filter:blur(20px) saturate(1.6); -webkit-backdrop-filter:blur(20px) saturate(1.6);
    box-shadow:0 6px 16px -8px rgba(0,0,0,0.5);
    transition:transform .15s cubic-bezier(.34,1.56,.64,1), color .2s;
  }
  .transcript-ask-btn svg{width:16px; height:16px; stroke:currentColor; fill:none; stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round;}
  .transcript-ask-btn:active{transform:scale(.88);}
  /* !important + touch-action/-webkit-touch-callout explicitly re-opened —
     body's own touch-action:pan-y (for swipe/scroll elsewhere in the app) can
     otherwise suppress iOS's long-press-to-select gesture entirely for
     anything under it, and long-press text selection needs the callout not
     to be disabled either. */
  .transcript-seg-text{
    font-family:var(--font-text); font-size:1rem; line-height:1.6; font-weight:500; color:var(--text);
    user-select:text !important; -webkit-user-select:text !important;
    -webkit-touch-callout:default; touch-action:manipulation;
    border-radius:10px; padding:2px 0; margin:-2px 0; outline:none; white-space:pre-wrap;
    transition:background .2s ease, box-shadow .2s ease, padding .2s ease, margin .2s ease;
  }
  /* double-tap a spot in the line to edit right there — no separate editor. */
  /* no frame or fill around the line being edited — the text just gets a
     caret, the line stays where it was (the blue box read as a selection) */
  .transcript-seg-text.editing{caret-color:var(--accent-2);}
  .transcript-seg-text:focus, .transcript-seg-text:focus-visible,
  #detail-body:focus, #detail-body:focus-visible,
  #note-canvas-editable:focus, #note-canvas-editable:focus-visible,
  [contenteditable="true"]:focus-visible{outline:none;}
  /* a marked fragment inside the text — tapping it offers to remove the mark
     (see the click handler in JS); the box-decoration-break keeps the
     highlight's rounded corners looking right even if the fragment wraps
     across more than one line. */
  .transcript-important-frag{
    background:color-mix(in srgb, #ff2d2d 26%, transparent); color:var(--text); border-radius:4px;
    padding:1px 2px; margin:0 -2px; cursor:pointer; box-decoration-break:clone; -webkit-box-decoration-break:clone;
    transition:background .15s ease;
  }
  .transcript-important-frag:active{background:color-mix(in srgb, #ff2d2d 40%, transparent);}

  /* floating "Важно" confirm button that appears over an active text
     selection (see updateTranscriptSelectionUI) — the selection/handles
     themselves are the browser's own native long-press selection UI. */
  .transcript-select-popup{position:fixed; z-index:55; transform:translate(-50%, -100%); pointer-events:none;}
  .transcript-select-btn{
    pointer-events:auto; display:flex; align-items:center; gap:6px; padding:9px 16px; border-radius:999px;
    background:var(--pill-bg); border:1px solid var(--panel-border-strong); color:#ff2d2d; font-weight:800; font-size:0.84rem;
    backdrop-filter:blur(20px) saturate(1.6); -webkit-backdrop-filter:blur(20px) saturate(1.6);
    box-shadow:0 12px 28px -14px rgba(0,0,0,0.55);
    cursor:pointer; white-space:nowrap;
    animation:transcriptSelectPop .18s cubic-bezier(.34,1.56,.64,1);
  }
  .transcript-select-btn:active{transform:scale(.92);}
  .transcript-select-btn svg{width:15px; height:15px; stroke:currentColor; fill:none; stroke-width:2.3; stroke-linecap:round; stroke-linejoin:round; flex:none;}
  @keyframes transcriptSelectPop{ from{opacity:0; transform:scale(.7);} to{opacity:1; transform:scale(1);} }

  /* replaces the tabbar's spot while editing a transcript line — an explicit
     "done" action since Enter no longer submits (it just breaks the line). */
  .transcript-edit-bar{
    position:fixed; right:calc(14px + env(safe-area-inset-right, 0px)); bottom:calc(14px + env(safe-area-inset-bottom)); z-index:50;
    transform:scale(.6) translateY(10px); opacity:0; pointer-events:none;
    transition:opacity .22s ease, transform .3s cubic-bezier(.34,1.56,.64,1);
  }
  .transcript-edit-bar.visible{opacity:1; pointer-events:auto; transform:scale(1) translateY(0);}
  .transcript-edit-done{
    display:block; padding:11px 22px; border-radius:999px; font-weight:800; font-size:0.82rem; cursor:pointer;
    background:var(--accent-2-dark); color:var(--btn-text);
    box-shadow:0 18px 40px -16px color-mix(in srgb, var(--accent-2-dark) 60%, transparent);
    transition:transform .15s cubic-bezier(.34,1.56,.64,1);
  }
  .transcript-edit-done:active{transform:scale(.9);}

  /* toast with an inline undo action — the toast stack itself is
     pointer-events:none (so plain toasts don't block taps), this one opts
     back in just for its own button. */
  .toast.has-action{pointer-events:auto; padding-right:10px;}
  .toast-undo{font-weight:800; color:var(--accent-2-dark); cursor:pointer; flex:none; padding:5px 10px; border-radius:12px; transition:background .15s ease;}
  .toast-undo:active{background:var(--panel-bg-strong);}

  .speaker-rename-row{display:flex; align-items:center; gap:10px; padding:10px 4px; cursor:pointer;}
  .speaker-rename-row span{flex:1; font-size:0.9rem; font-weight:600;}
  .speaker-rename-dot{width:9px; height:9px; border-radius:50%; background:var(--accent-2-dark); flex:none;}

  /* plays back the exact transcript line the user tapped into to rename this
     voice — a quick way to confirm who's actually speaking before naming
     them. Reuses the note's own <audio> element (see initNoteAudioPlayer). */
  .speaker-sample-btn{
    display:inline-flex; align-items:center; gap:8px; padding:10px 16px; margin-bottom:14px; border-radius:999px; width:fit-content;
    background:var(--pill-bg); border:1px solid var(--panel-border); color:var(--text); font-weight:700; font-size:0.84rem; cursor:pointer;
    backdrop-filter:blur(20px) saturate(1.6); -webkit-backdrop-filter:blur(20px) saturate(1.6);
    box-shadow:0 6px 16px -8px rgba(0,0,0,0.5);
    transition:transform .15s cubic-bezier(.34,1.56,.64,1), background .25s ease;
  }
  .speaker-sample-btn:active{transform:scale(.95);}
  .speaker-sample-btn svg{width:17px; height:17px; stroke:currentColor; fill:none; flex:none;}
  .speaker-sample-btn.playing{background:color-mix(in srgb, var(--accent-2-dark) 24%, var(--pill-bg));}
  .speaker-sample-wave{display:flex; align-items:center; gap:2px; height:14px; width:0; overflow:hidden; transition:width .2s ease;}
  .speaker-sample-btn.playing .speaker-sample-wave{width:20px;}
  .speaker-sample-wave span{width:2.5px; height:100%; border-radius:2px; background:var(--accent-2-dark); flex:none; transform:scaleY(.3); animation:speakerSampleWave .9s ease-in-out infinite;}
  .speaker-sample-wave span:nth-child(2){animation-delay:.15s;}
  .speaker-sample-wave span:nth-child(3){animation-delay:.3s;}
  .speaker-sample-wave span:nth-child(4){animation-delay:.45s;}
  @keyframes speakerSampleWave{ 0%,100%{transform:scaleY(.3);} 50%{transform:scaleY(1);} }

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

  /* ---------- Расписание пар (opened from the calendar drawer) ----------
     Full-screen layer above the tabbar (z 50) and the calendar drawer (76),
     below sheets/overlays (90) so the lesson-details sheet can open on top. */
  .cal-schedule-section{margin:14px 0 4px 8px;}
  .cal-schedule-entry{margin-bottom:10px;}
  .cal-schedule-icon{
    width:30px; height:30px; border-radius:10px; flex:none; display:flex; align-items:center; justify-content:center;
    background:color-mix(in srgb, var(--accent-2) 16%, transparent); color:var(--accent-2-dark);
  }
  .cal-schedule-icon svg{width:18px; height:18px; stroke:currentColor; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round;}
  .cal-schedule-chevron{width:18px; height:18px; stroke:var(--text-faint); fill:none; stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round; flex:none;}

  .schedule-screen{
    position:fixed; inset:0; z-index:80; overflow-y:auto; overscroll-behavior:contain;
    --sch-bg:var(--bg); --sch-card:var(--panel-bg); --sch-card-border:var(--panel-border); --sch-shadow:var(--shadow);
    background:
      radial-gradient(120% 60% at 50% 0%, color-mix(in srgb, var(--accent-2) 9%, transparent), transparent 70%),
      var(--sch-bg);
    padding:calc(var(--tg-safe-top, 0px) + 8px) 16px calc(28px + env(safe-area-inset-bottom));
    transform:translateX(100%); opacity:.6; pointer-events:none; visibility:hidden;
    transition:transform .34s cubic-bezier(.22,1,.36,1), opacity .3s ease, visibility 0s linear .34s;
  }
  :root[data-theme="light"] .schedule-screen{
    --sch-bg:#eef2f8; --sch-card:#ffffff; --sch-card-border:rgba(20,40,90,0.05);
    --sch-shadow:0 10px 26px -16px rgba(30,55,110,0.28);
  }
  .schedule-screen.open{transform:translateX(0); opacity:1; pointer-events:auto; visibility:visible; transition-delay:0s;}
  .schedule-top{display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:16px;}
  .schedule-top h3{margin:0; font-family:'Unbounded'; font-weight:800; font-size:1.12rem; letter-spacing:.01em;}

  .schedule-nav{display:flex; align-items:center; gap:8px; margin-bottom:18px;}
  .schedule-arrow{
    width:52px; height:52px; border-radius:50%; flex:none; display:flex; align-items:center; justify-content:center; cursor:pointer;
    background:var(--sch-card); border:1px solid var(--sch-card-border); color:var(--text); box-shadow:var(--sch-shadow);
    transition:transform .15s ease, background .2s;
  }
  .schedule-arrow:active{transform:scale(.9);}
  .schedule-arrow svg{width:22px; height:22px; stroke:currentColor; fill:none; stroke-width:2.4; stroke-linecap:round; stroke-linejoin:round;}
  .schedule-daypill{
    flex:none; min-width:58px; padding:9px 10px; border-radius:18px; text-align:center; line-height:1.05;
    background:var(--sch-card); border:1px solid var(--sch-card-border); box-shadow:var(--sch-shadow);
  }
  .schedule-daypill b{display:block; font-size:1.1rem; font-weight:800;}
  .schedule-daypill span{display:block; margin-top:3px; font-size:0.72rem; font-weight:700; color:var(--accent-2-dark);}
  .schedule-strip{flex:1; min-width:0; display:flex; align-items:center; justify-content:center; gap:2px;}
  .schedule-date{
    display:flex; flex-direction:column; align-items:center; justify-content:center; cursor:pointer; line-height:1;
    border-radius:18px; transition:transform .2s ease, opacity .2s ease; color:var(--text-dim);
  }
  .schedule-date b{font-weight:800;}
  .schedule-date span{margin-top:3px; font-weight:600;}
  .schedule-date.d2{opacity:.35; padding:6px 1px;} .schedule-date.d2 b{font-size:.72rem;} .schedule-date.d2 span{font-size:.5rem;}
  .schedule-date.d1{opacity:.7; padding:6px 4px;} .schedule-date.d1 b{font-size:1.02rem;} .schedule-date.d1 span{font-size:.7rem;}
  .schedule-date.d0{
    padding:10px 14px; color:var(--text);
    background:var(--sch-card); border:1px solid var(--sch-card-border); box-shadow:var(--sch-shadow);
  }
  .schedule-date.d0 b{font-size:1.6rem;}
  .schedule-date.d0 span{font-size:.86rem; color:var(--accent-2-dark); font-weight:700;}
  .schedule-date.today:not(.d0) b{color:var(--accent-2-dark);}
  .schedule-date:active{transform:scale(.92);}

  .schedule-list{display:flex; flex-direction:column; gap:12px;}
  .schedule-card{
    position:relative; display:flex; align-items:center; gap:14px; padding:15px 14px 15px 16px; cursor:pointer;
    background:var(--sch-card); border:1px solid var(--sch-card-border); border-radius:24px; box-shadow:var(--sch-shadow);
    transition:transform .15s ease;
  }
  .schedule-card:active{transform:scale(.985);}
  .schedule-time{flex:none; width:60px; display:flex; flex-direction:column; gap:4px; font-size:.92rem; font-weight:700; color:var(--text-dim); font-variant-numeric:tabular-nums;}

  /* ---------- оценки предметов: средняя оценка всех студентов звёздами под
     временем пары + выбор 1–5 в шторках «Предмет» / «Преподаватель» ---------- */
  .schedule-stars, .sched-rate-small{display:flex; gap:1px; margin-top:2px;}
  .schedule-stars svg, .sched-rate-small svg{width:11px; height:11px; fill:color-mix(in srgb, var(--text-faint) 45%, transparent); stroke:none;}
  .schedule-stars svg.on, .sched-rate-small svg.on{fill:var(--star, #f5a623);}
  .sched-rate-small{margin:0 0 3px;}
  .sched-rate-small svg{width:14px; height:14px;}

  .sched-rate{margin:4px 0 20px; padding:16px; border-radius:20px; background:var(--panel-bg); border:1px solid var(--panel-border);}
  .sched-rate-summary{display:flex; align-items:center; gap:12px;}
  .sched-rate-avg{font-family:'Unbounded'; font-weight:600; font-size:1.9rem; line-height:1; color:var(--text); min-width:52px;}
  .sched-rate-count{font-size:0.78rem; color:var(--text-faint);}
  .sched-rate-label{margin:14px 0 8px; font-size:0.8rem; font-weight:700; color:var(--text-dim);}
  .sched-rate-pick{display:flex; gap:6px;}
  .sched-rate-pick button{
    flex:1; max-width:56px; aspect-ratio:1; display:flex; align-items:center; justify-content:center; padding:0; cursor:pointer;
    border-radius:14px; border:1px solid var(--panel-border); background:var(--bg); -webkit-tap-highlight-color:transparent;
    transition:transform .18s cubic-bezier(.34,1.56,.64,1), background .15s ease, border-color .15s ease;
  }
  .sched-rate-pick button:active{transform:scale(.88);}
  .sched-rate-pick svg{width:26px; height:26px; fill:none; stroke:var(--text-faint); stroke-width:1.8; stroke-linejoin:round; transition:fill .15s ease, stroke .15s ease;}
  .sched-rate-pick button.on{background:color-mix(in srgb, var(--star, #f5a623) 16%, var(--bg)); border-color:color-mix(in srgb, var(--star, #f5a623) 45%, transparent);}
  .sched-rate-pick button.on svg{fill:var(--star, #f5a623); stroke:var(--star, #f5a623);}

  .sched-open-sheet{padding-top:12px;}
  .sched-sheet-grab{display:block; width:40px; height:5px; border-radius:3px; margin:0 auto 14px; background:color-mix(in srgb, var(--text-faint) 40%, transparent);}
  .sched-open-eyebrow{margin:0 2px 10px;}
  .sched-open-sheet .ai-note-card + .ai-note-card{margin-top:10px;}
  .sched-teacher-eyebrow{margin:0 2px 12px;}
  .schedule-bar{flex:none; width:4px; align-self:stretch; min-height:52px; border-radius:4px;}
  .schedule-info{flex:1; min-width:0;}
  .schedule-title{font-size:1rem; font-weight:800; line-height:1.25; color:var(--text);}
  .schedule-meta{margin-top:5px; font-size:.84rem; font-weight:600; color:var(--text-dim); overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
  .schedule-chevron{flex:none; width:18px; height:18px; stroke:var(--text-faint); fill:none; stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round;}
  .schedule-card.now{border-color:color-mix(in srgb, var(--accent-2) 55%, transparent); box-shadow:0 0 0 3px color-mix(in srgb, var(--accent-2) 16%, transparent), var(--shadow);}
  .schedule-card.past{opacity:.55;}
  .schedule-now-badge{
    display:inline-flex; align-items:center; gap:5px; margin-bottom:5px; padding:2px 8px; border-radius:999px;
    font-size:.66rem; font-weight:800; text-transform:uppercase; letter-spacing:.04em;
    background:color-mix(in srgb, var(--accent-2) 18%, transparent); color:var(--accent-2-dark);
  }
  .schedule-now-badge::before{content:""; width:6px; height:6px; border-radius:50%; background:currentColor; animation:schedulePulse 1.4s ease-in-out infinite;}
  @keyframes schedulePulse{0%,100%{opacity:1;} 50%{opacity:.3;}}
  .schedule-break{align-self:center; font-size:.72rem; font-weight:600; color:var(--text-faint); margin:-4px 0;}
  .schedule-empty{
    padding:34px 20px; text-align:center; font-size:.95rem; font-weight:500; color:var(--text-dim);
    background:var(--sch-card); border:1px solid var(--sch-card-border); border-radius:24px; box-shadow:var(--sch-shadow);
  }
  .schedule-empty .schedule-empty-emoji{display:block; font-size:1.8rem; margin-bottom:8px;}
  .schedule-demo-note{margin-top:14px; text-align:center; font-size:.72rem; color:var(--text-faint);}
  .schedule-top .agent-round-btn{background:var(--sch-card); border-color:var(--sch-card-border); box-shadow:var(--sch-shadow);}

  /* ---------- Расписание: загрузка своего расписания + редактор пары ---------- */
  /* Toasts must show above the full-screen schedule layer (z 80) and its sheets (90). */
  .toast-stack{z-index:95;}
  /* room at the bottom for «Предметы»/«Изменить» and the main tab bar under them */
  .schedule-screen{padding-bottom:calc(152px + env(safe-area-inset-bottom));}
  /* the main tab bar stays over Расписание (the screen is z 80; its sheets are 90) */
  body.schedule-open .tabbar-dock, body.schedule-open .tabbar-collapse-cluster{z-index:85;}
  /* «Предметы» + «Изменить» — две плавающие таблетки внизу экрана */
  .schedule-fab-bar{
    /* just above the main tab bar (≈62px tall, 14px off the bottom) */
    position:fixed; left:50%; bottom:calc(88px + env(safe-area-inset-bottom)); transform:translateX(-50%);
    display:flex; gap:10px; z-index:2;
  }
  .schedule-subjects-btn{
    display:inline-flex; align-items:center; gap:8px; padding:11px 14px 11px 16px; border-radius:999px; cursor:pointer;
    background:var(--sch-card); border:1px solid var(--sch-card-border); box-shadow:var(--sch-shadow), 0 8px 22px -12px rgba(0,0,0,0.35);
    color:var(--accent-3); font-weight:800; font-size:.9rem; white-space:nowrap; -webkit-tap-highlight-color:transparent;
    transition:transform .15s ease;
  }
  .schedule-subjects-btn:active{transform:scale(.94);}
  .schedule-subjects-btn svg{width:18px; height:18px; stroke:currentColor; fill:none; stroke-width:2.1; stroke-linecap:round; stroke-linejoin:round;}
  .schedule-subjects-btn b{
    min-width:20px; height:20px; padding:0 6px; box-sizing:border-box; border-radius:999px; display:inline-flex; align-items:center; justify-content:center;
    background:color-mix(in srgb, var(--accent-3) 16%, transparent); font-size:.72rem; font-weight:800;
  }
  .schedule-upload-btn{
    display:inline-flex; align-items:center; gap:8px; padding:11px 18px; border-radius:999px; cursor:pointer;
    background:var(--sch-card); border:1px solid var(--sch-card-border); box-shadow:var(--sch-shadow), 0 8px 22px -12px rgba(0,0,0,0.35);
    color:var(--accent-2-dark); font-weight:800; font-size:.9rem; white-space:nowrap;
    transition:transform .15s ease;
  }
  .schedule-upload-btn:active{transform:scale(.94);}

  /* шторка «Предметы» */
  .sched-subjects-sheet{max-height:86vh;}
  .sched-subjects-sub{margin:3px 0 0; font-size:.8rem; color:var(--text-faint);}
  .sched-subjects-sort{display:flex; gap:6px; margin:0 0 14px; overflow-x:auto; scrollbar-width:none;}
  .sched-subjects-sort::-webkit-scrollbar{display:none;}
  .sched-subjects-sort span{
    flex:none; padding:7px 13px; border-radius:999px; cursor:pointer; font-size:.8rem; font-weight:700;
    color:var(--text-dim); background:var(--panel-bg); border:1px solid var(--panel-border);
    transition:background .15s ease, color .15s ease, border-color .15s ease;
  }
  .sched-subjects-sort span.active{color:var(--accent-3); background:color-mix(in srgb, var(--accent-3) 14%, var(--bg)); border-color:color-mix(in srgb, var(--accent-3) 40%, transparent);}
  .sched-subjects-list{display:flex; flex-direction:column; gap:10px;}
  .sched-subj-card{
    display:flex; align-items:center; gap:12px; padding:12px 12px 12px 12px; border-radius:18px; cursor:pointer;
    background:var(--panel-bg); border:1px solid var(--panel-border); -webkit-tap-highlight-color:transparent;
    transition:transform .15s cubic-bezier(.34,1.56,.64,1), background .15s ease;
    animation:schedSubjIn .32s cubic-bezier(.22,1,.36,1) both; animation-delay:calc(var(--n, 0) * 28ms);
  }
  .sched-subj-card:active{transform:scale(.97); background:var(--panel-bg-strong);}
  @keyframes schedSubjIn{from{opacity:0; transform:translateY(8px);} to{opacity:1; transform:none;}}
  .sched-subj-letter{
    flex:none; width:46px; height:46px; border-radius:14px; display:flex; align-items:center; justify-content:center;
    font-family:'Unbounded'; font-weight:600; font-size:1.1rem; color:var(--c);
    background:color-mix(in srgb, var(--c) 18%, transparent);
  }
  .sched-subj-text{flex:1; min-width:0;}
  .sched-subj-title{font-size:.95rem; font-weight:800; line-height:1.25; color:var(--text);}
  .sched-subj-teacher{margin-top:2px; font-size:.78rem; color:var(--text-dim); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .sched-subj-kinds{display:flex; flex-wrap:wrap; gap:4px; margin-top:6px;}
  .sched-subj-kinds span{padding:1px 7px; border-radius:999px; font-size:.66rem; font-weight:700; color:var(--c); background:color-mix(in srgb, var(--c) 14%, transparent);}
  .sched-subj-side{flex:none; display:flex; flex-direction:column; align-items:flex-end; gap:4px; text-align:right;}
  .sched-subj-side .schedule-stars{margin:0;}
  .sched-subj-avg{font-size:.72rem; font-weight:700; color:var(--text-dim);}
  .sched-subj-freq{font-size:.7rem; color:var(--text-faint); white-space:nowrap;}
  .schedule-upload-btn svg{width:18px; height:18px; stroke:currentColor; fill:none; stroke-width:2.3; stroke-linecap:round; stroke-linejoin:round;}
  .schedule-import-hint{margin:0 0 10px; font-size:.8rem; line-height:1.45; color:var(--text-dim);}
  .schedule-import-danger svg{stroke:var(--danger);}
  .schedule-import-danger .upload-choice-title{color:var(--danger);}
  .schedule-textarea{min-height:160px; resize:vertical; margin-bottom:14px; line-height:1.45;}

  .schedule-empty-cta{
    display:inline-flex; align-items:center; gap:8px; margin-top:16px; padding:11px 20px; border-radius:999px; cursor:pointer;
    background:var(--accent-2-dark); color:var(--btn-text); font-weight:800; font-size:.9rem;
  }
  .schedule-empty-title{display:block; font-size:1.05rem; font-weight:800; color:var(--text); margin-bottom:6px;}
  .schedule-loading{padding:40px 0; text-align:center; color:var(--text-dim); font-size:.9rem;}
  .schedule-spinner{
    width:30px; height:30px; margin:0 auto 12px; border-radius:50%;
    border:3px solid var(--panel-border); border-top-color:var(--accent-2-dark); animation:recSpin .8s linear infinite;
  }

  .schedule-preview-day{margin:14px 0 6px; font-size:.72rem; font-weight:800; text-transform:uppercase; letter-spacing:.05em; color:var(--text-faint);}
  .schedule-preview-row{display:flex; gap:12px; align-items:flex-start; padding:9px 0; border-top:1px solid var(--panel-border);}
  .schedule-preview-row .schedule-bar{min-height:34px;}
  .schedule-preview-time{flex:none; width:44px; font-size:.8rem; font-weight:700; color:var(--text-dim); font-variant-numeric:tabular-nums; line-height:1.35;}
  .schedule-preview-title{font-size:.9rem; font-weight:700; color:var(--text); line-height:1.3;}
  .schedule-preview-meta{font-size:.76rem; color:var(--text-dim); margin-top:2px;}
  .schedule-week-tag{display:inline-block; margin-left:6px; padding:1px 7px; border-radius:999px; font-size:.64rem; font-weight:800; vertical-align:middle;
    background:color-mix(in srgb, var(--accent-2) 16%, transparent); color:var(--accent-2-dark);}
  .schedule-preview-actions{margin-top:16px;}
  .schedule-preview-actions .schedule-import-hint{margin-top:10px; text-align:center;}

  .schedule-field-label{display:block; margin:14px 0 6px; font-size:.72rem; font-weight:700; color:var(--text-faint); text-transform:uppercase; letter-spacing:.04em;}
  .schedule-seg{display:flex; gap:4px; padding:4px; border-radius:14px; background:var(--pill-bg); border:1px solid var(--panel-border);}
  .schedule-seg span{flex:1; text-align:center; padding:8px 2px; border-radius:10px; font-size:.82rem; font-weight:700; color:var(--text-dim); cursor:pointer; transition:background .15s, color .15s;}
  .schedule-seg span.selected{background:var(--bg); color:var(--text); box-shadow:0 2px 8px -4px rgba(0,0,0,0.3);}
  .schedule-time-row{display:flex; gap:10px; margin-top:10px;}
  .schedule-time-row > *{flex:1; min-width:0;}
  .schedule-time-row label .schedule-field-label{margin-top:4px;}
  #schedule-edit-teacher{margin-top:10px;}
  .schedule-color-row{display:flex; gap:12px;}
  .schedule-color-dot{width:30px; height:30px; border-radius:50%; cursor:pointer; border:2px solid transparent; transition:transform .15s ease, border-color .15s ease;}
  .schedule-color-dot.selected{border-color:var(--text); transform:scale(1.08);}
  #schedule-edit-save{margin-top:20px;}
  .schedule-edit-delete{display:block; margin-top:10px; text-align:center;}
  .schedule-daypill{cursor:pointer;}
  .schedule-empty-icon{display:flex; width:56px; height:56px; margin:0 auto 12px; border-radius:18px; align-items:center; justify-content:center;
    background:color-mix(in srgb, var(--accent-2) 16%, transparent); color:var(--accent-2-dark);}
  .schedule-empty-icon svg{width:28px; height:28px; stroke:currentColor; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round;}
  .schedule-import-primary{background:color-mix(in srgb, var(--accent-2) 9%, transparent); border-radius:14px; padding-left:10px; padding-right:10px; border-top:none;}
  .schedule-import-primary + .upload-choice-row{border-top:none;}
  .schedule-optional{text-transform:none; letter-spacing:0; font-weight:600;}
  .schedule-uni-badge{margin:8px 2px 0; font-size:.78rem; line-height:1.4; color:var(--text-dim); min-height:1em;}
  .schedule-uni-badge.exact{color:var(--accent-2-dark); font-weight:700;}
  .schedule-group-suggest{display:flex; flex-wrap:wrap; gap:6px; margin:8px 0 0;}
  .schedule-group-suggest:empty{display:none;}
  .schedule-group-chip{padding:7px 12px; border-radius:999px; cursor:pointer; font-size:.82rem; font-weight:700;
    background:var(--pill-bg); border:1px solid var(--panel-border); color:var(--text);}
  .schedule-group-chip small{font-weight:600; color:var(--text-faint); margin-left:4px;}
  .schedule-group-chip.selected{background:var(--accent-2-dark); border-color:transparent; color:var(--btn-text);}
  .schedule-group-chip.selected small{color:inherit; opacity:.75;}
  .schedule-group-note{width:100%; font-size:.78rem; color:var(--text-dim); margin:0 2px 2px;}
  #schedule-uni-submit{margin-top:20px;}
  .schedule-preview-source{margin:-6px 0 4px; font-size:.78rem; color:var(--text-dim); word-break:break-all;}
  .schedule-preview-source:empty{display:none;}
  .schedule-preview-fallback{display:flex; flex-direction:column; gap:8px; margin-top:14px;}
  .schedule-preview-fallback .btn{text-align:center;}

  /* ---------- Расписание: общее расписание группы ---------- */
  .schedule-shared-chip{
    display:flex; align-items:center; justify-content:center; gap:6px; margin:-6px auto 14px; padding:7px 14px; width:max-content; max-width:100%;
    border-radius:999px; cursor:pointer; font-size:.78rem; font-weight:700; color:var(--accent-2-dark);
    background:color-mix(in srgb, var(--accent-2) 13%, transparent); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  }
  .schedule-shared-chip svg{width:15px; height:15px; flex:none; stroke:currentColor; fill:none; stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round;}
  .schedule-shared-box{margin:0 0 12px; padding:12px 14px; border-radius:16px; background:color-mix(in srgb, var(--accent-2) 10%, transparent);}
  .schedule-shared-box-title{font-weight:800; font-size:.92rem; color:var(--text);}
  .schedule-shared-box-sub{font-size:.78rem; color:var(--text-dim); margin-top:3px; line-height:1.4;}
  .schedule-shared-box-actions{display:flex; gap:8px; margin-top:10px; flex-wrap:wrap;}
  .schedule-shared-box-actions .btn{flex:1; text-align:center; font-size:.8rem; padding:9px 10px; white-space:nowrap;}
  .schedule-share{margin:4px 0 14px;}
  .schedule-share-toggle{display:flex; gap:10px; align-items:flex-start; font-size:.84rem; line-height:1.4; color:var(--text); cursor:pointer;}
  .schedule-share-toggle input{width:20px; height:20px; flex:none; margin:1px 0 0; accent-color:var(--accent-2-dark);}
  .schedule-share-fields{display:grid; gap:8px; margin-top:10px;}
  .schedule-share-fields.hidden{display:none;}
  .schedule-community-info{margin:0 0 12px; padding:10px 12px; border-radius:14px; font-size:.82rem; line-height:1.45;
    background:color-mix(in srgb, var(--accent-2) 10%, transparent); color:var(--text);}
  .schedule-community-info:empty{display:none;}
  .schedule-preview-official{display:block; margin-top:10px; text-align:center;}

  /* ---------- Расписание: несколько фото ---------- */
  .schedule-photos-grid{display:grid; grid-template-columns:repeat(3, 1fr); gap:8px; margin-bottom:12px;}
  .schedule-photo-tile{position:relative; aspect-ratio:3/4; border-radius:14px; overflow:hidden; background:var(--pill-bg); border:1px solid var(--panel-border);}
  .schedule-photo-tile img{width:100%; height:100%; object-fit:cover; display:block;}
  .schedule-photo-tile.loading::after{content:""; position:absolute; inset:0; margin:auto; width:22px; height:22px; border-radius:50%;
    border:3px solid var(--panel-border); border-top-color:var(--accent-2-dark); animation:recSpin .8s linear infinite;}
  .schedule-photo-num{position:absolute; left:6px; top:6px; min-width:20px; height:20px; padding:0 6px; border-radius:999px; box-sizing:border-box;
    display:flex; align-items:center; justify-content:center; font-size:.7rem; font-weight:800; color:#fff; background:rgba(0,0,0,.55);}
  .schedule-photo-remove{position:absolute; right:5px; top:5px; width:24px; height:24px; border-radius:50%; cursor:pointer;
    display:flex; align-items:center; justify-content:center; background:rgba(0,0,0,.6);}
  .schedule-photo-remove svg{width:13px; height:13px; stroke:#fff; fill:none; stroke-width:2.6; stroke-linecap:round;}
  .schedule-photos-add{display:flex; gap:8px; margin-bottom:14px;}
  .schedule-photos-add .btn{flex:1; display:flex; align-items:center; justify-content:center; gap:7px; font-size:.84rem;}
  .schedule-photos-add .btn svg{width:17px; height:17px; stroke:currentColor; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round;}
  .schedule-photos-add .btn.disabled{opacity:.4; pointer-events:none;}
  /* opened from a sheet (e.g. a schedule photo thumbnail) — must sit above sheets (90) */
  .photo-lightbox{z-index:96;}

  /* ---------- Расписание: правка распознанного перед сохранением ---------- */
  .schedule-preview-edit-hint{margin:2px 0 4px; font-size:.78rem; color:var(--accent-2-dark); font-weight:600;}
  .schedule-preview-row.editable{cursor:pointer; transition:background .15s;}
  .schedule-preview-row.editable:active{background:var(--pill-bg);}
  .schedule-preview-info{flex:1; min-width:0;}
  .schedule-preview-pencil{flex:none; width:17px; height:17px; margin-top:2px; stroke:var(--text-faint); fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round;}
  .schedule-preview-add{display:block; margin-top:10px; text-align:center; color:var(--accent-2-dark);}

  /* ---------- Расписание: как повторяются недели ---------- */
  .schedule-mode-box{margin:0 0 14px;}
  .schedule-mode-box .schedule-field-label{margin-top:0;}
  .schedule-mode-seg span{font-size:.78rem; line-height:1.25; padding:9px 6px;}
  .schedule-daypill.weekly{padding-top:13px; padding-bottom:13px;}

  /* ---------- Расписание: вузы, где расписание — файлы (МГСУ) ---------- */
  .schedule-steps{margin:0 0 14px; padding-left:20px; font-size:.86rem; line-height:1.5; color:var(--text);}
  .schedule-steps li{margin-bottom:4px;}
  .schedule-file-uni-open{display:block; text-align:center; color:var(--accent-2-dark); margin-bottom:6px;}
  .schedule-file-uni-after{margin-top:12px; text-align:center;}
  .schedule-file-uni-ways{margin-top:12px;}
  .schedule-file-uni-ways-row{display:flex; gap:8px; margin-top:8px;}
  .schedule-file-uni-ways-row .btn{flex:1; text-align:center;}

  /* ---------- Календарь в стиле «Расписания» ----------
     Only looks: the same soft card surface, round shadowed arrows, pill
     labels and blue "today" accent as the schedule screen. Nothing here
     changes how events/deadlines behave. */
  #panel-deadlines, #dl-window{
    --sch-card:var(--panel-bg); --sch-card-2:color-mix(in srgb, var(--panel-bg-strong) 70%, var(--panel-bg));
    --sch-card-border:var(--panel-border); --sch-shadow:var(--shadow);
  }
  :root[data-theme="light"] #panel-deadlines, :root[data-theme="light"] #dl-window{
    --sch-card:#ffffff; --sch-card-2:#f2f5fa; --sch-card-border:rgba(20,40,90,0.06);
    --sch-shadow:0 10px 26px -16px rgba(30,55,110,0.28);
  }

  /* shortcut card into Расписание */
  .cal-sched-card{
    position:relative; display:flex; align-items:center; gap:14px; margin:0 0 14px; padding:14px 14px 14px 14px; cursor:pointer;
    border-radius:24px; overflow:hidden; user-select:none; -webkit-tap-highlight-color:transparent;
    background:
      radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--accent-2) 16%, transparent), transparent 60%),
      var(--sch-card);
    border:1px solid color-mix(in srgb, var(--accent-2) 22%, var(--sch-card-border));
    box-shadow:var(--sch-shadow);
    transition:transform .15s ease;
  }
  .cal-sched-card:active{transform:scale(.985);}
  .cal-sched-icon{
    flex:none; width:46px; height:46px; border-radius:16px; display:flex; align-items:center; justify-content:center;
    background:color-mix(in srgb, var(--accent-2) 18%, transparent); color:var(--accent-2-dark);
  }
  .cal-sched-icon svg{width:24px; height:24px; stroke:currentColor; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round;}
  .cal-sched-info{flex:1; min-width:0; display:flex; flex-direction:column;}
  .cal-sched-eyebrow{font-size:.7rem; font-weight:800; text-transform:uppercase; letter-spacing:.04em; color:var(--accent-2-dark);
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .cal-sched-card[data-state="now"] .cal-sched-eyebrow::before{
    content:""; display:inline-block; width:6px; height:6px; margin-right:6px; vertical-align:middle; border-radius:50%;
    background:currentColor; animation:schedulePulse 1.4s ease-in-out infinite;
  }
  .cal-sched-title{margin-top:3px; font-size:1rem; font-weight:800; line-height:1.25; color:var(--text);
    display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;}
  .cal-sched-meta{margin-top:3px; font-size:.8rem; font-weight:600; color:var(--text-dim); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .cal-sched-dots{display:flex; gap:4px; margin-top:8px;}
  .cal-sched-dots:empty{display:none;}
  .cal-sched-dots span{width:16px; height:4px; border-radius:4px; background:color-mix(in srgb, var(--accent-2) 30%, transparent);}
  .cal-sched-dots span.done{background:var(--text-faint); opacity:.45;}
  .cal-sched-dots span.now{width:26px; background:var(--accent-2);}
  .cal-sched-open{
    flex:none; align-self:center; width:40px; height:40px; border-radius:50%; display:flex; align-items:center; justify-content:center;
    color:var(--btn-text); background:var(--accent-2-dark); box-shadow:0 8px 18px -10px color-mix(in srgb, var(--accent-2) 80%, transparent);
  }
  .cal-sched-open svg{width:20px; height:20px; stroke:currentColor; fill:none; stroke-width:2.6; stroke-linecap:round; stroke-linejoin:round;}
  .cal-sched-card[data-state="rest"] .cal-sched-dots, .cal-sched-card[data-state="empty"] .cal-sched-dots{display:none;}

  /* calendar cards */
  :is(#panel-deadlines, #dl-window) .cal-card{
    background:var(--sch-card); border:1px solid var(--sch-card-border); border-radius:28px; box-shadow:var(--sch-shadow);
    backdrop-filter:none; -webkit-backdrop-filter:none;
  }
  :is(#panel-deadlines, #dl-window) .week-arrow, :is(#panel-deadlines, #dl-window) #cal-drawer-btn, :is(#panel-deadlines, #dl-window) #cal-view-wrap #cal-view-btn{
    background:var(--sch-card-2); border:1px solid var(--sch-card-border); box-shadow:var(--sch-shadow); color:var(--text);
  }
  :is(#panel-deadlines, #dl-window) .week-arrow.cal-day-back{background:var(--accent-2-dark); border-color:transparent; color:var(--btn-text);}
  :is(#panel-deadlines, #dl-window) .cal-month-label, :is(#panel-deadlines, #dl-window) .cal-day-label, :is(#panel-deadlines, #dl-window) .week-range{
    background:var(--sch-card-2); border:1px solid var(--sch-card-border); border-radius:18px; box-shadow:var(--sch-shadow);
  }

  /* month grid: separate rounded day tiles instead of hairline table lines */
  :is(#panel-deadlines, #dl-window) .cal-month-dow-row{gap:4px; margin-bottom:6px;}
  :is(#panel-deadlines, #dl-window) .cal-month-dow-row span{font-size:.64rem; font-weight:800; color:var(--text-faint);}
  :is(#panel-deadlines, #dl-window) .cal-month-dow-row span:nth-child(n+6){color:color-mix(in srgb, var(--accent-pink) 70%, var(--text-faint));}
  :is(#panel-deadlines, #dl-window) .cal-month-grid{gap:4px; background:none; border-radius:0; overflow:visible;}
  :is(#panel-deadlines, #dl-window) .cal-month-row{gap:4px; background:none;}
  :is(#panel-deadlines, #dl-window) .cal-cell{
    min-height:92px; padding:6px 4px 4px; border-radius:14px; background:var(--sch-card-2);
    transition:transform .15s ease, background .2s ease;
  }
  :is(#panel-deadlines, #dl-window) .cal-cell:active{transform:scale(.96);}
  :is(#panel-deadlines, #dl-window) .cal-cell.dim{background:color-mix(in srgb, var(--sch-card-2) 45%, transparent);}
  :is(#panel-deadlines, #dl-window) .cal-cell.today{
    background:color-mix(in srgb, var(--accent-2) 12%, var(--sch-card-2));
    box-shadow:inset 0 0 0 1.5px color-mix(in srgb, var(--accent-2) 60%, transparent);
  }
  :is(#panel-deadlines, #dl-window) .cal-cell-num{font-weight:800; font-size:.8rem; min-width:22px; line-height:22px; border-radius:11px;}
  :is(#panel-deadlines, #dl-window) .cal-cell.today .cal-cell-num{background:var(--accent-2-dark); color:var(--btn-text); padding:0 5px;}
  /* bars are placed in 1/7ths of the row — a transparent border insets them
     into their own tiles so neighbours don't touch across the new gaps */
  :is(#panel-deadlines, #dl-window) .cal-month-row .cal-bar{clip-path:inset(0 3px round 7px);}
  :is(#panel-deadlines, #dl-window) .cal-month-row .cal-bar span{padding:0 7px;}

  /* week / 3 days / day time grids */
  :is(#panel-deadlines, #dl-window) .cal-tg-event{border-radius:10px;}
  :is(#panel-deadlines, #dl-window) .cal-tg-daycol-head.today .cal-tg-num{
    color:var(--btn-text); background:var(--accent-2-dark); border-radius:10px; padding:0 6px;
  }

  /* «Ближайшее» list — same cards as the schedule's lessons */
  :is(#panel-deadlines, #dl-window) .dl-card{
    background:var(--sch-card); border:1px solid var(--sch-card-border); border-radius:22px; box-shadow:var(--sch-shadow);
    backdrop-filter:none; -webkit-backdrop-filter:none;
  }
  :is(#panel-deadlines, #dl-window) .dl-swipe-wrap{border-radius:22px;}
  :is(#panel-deadlines, #dl-window) .dl-swipe-trash{border-radius:22px;}
  :is(#panel-deadlines, #dl-window) .dl-check-btn:not(.done), :is(#panel-deadlines, #dl-window) .dl-edit-btn, :is(#panel-deadlines, #dl-window) .dl-locate-btn{background:var(--sch-card-2); border-color:var(--sch-card-border);}

  /* drawer entry for Расписание */
  #drawer-schedule svg{stroke:var(--accent-2-dark);}
  /* Week / 3 days: same compact nav as Month so "28 сент. – 4 окт." fits on one line */
  :is(#panel-deadlines, #dl-window) #cal-week-card .week-arrow, :is(#panel-deadlines, #dl-window) #cal-3day-card .week-arrow,
  :is(#panel-deadlines, #dl-window) #cal-week-card #cal-drawer-btn, :is(#panel-deadlines, #dl-window) #cal-3day-card #cal-drawer-btn,
  :is(#panel-deadlines, #dl-window) #cal-week-card #cal-view-wrap #cal-view-btn, :is(#panel-deadlines, #dl-window) #cal-3day-card #cal-view-wrap #cal-view-btn{width:34px; height:34px;}
  :is(#panel-deadlines, #dl-window) #cal-week-card .week-arrow svg, :is(#panel-deadlines, #dl-window) #cal-3day-card .week-arrow svg{width:18px; height:18px;}
  :is(#panel-deadlines, #dl-window) #cal-week-card .week-range, :is(#panel-deadlines, #dl-window) #cal-3day-card .week-range{
    white-space:nowrap; padding:7px 10px; font-size:.92rem; min-width:0; overflow:hidden; text-overflow:ellipsis;
  }
  :is(#panel-deadlines, #dl-window) #cal-3day-card .week-range{font-size:.82rem; padding:7px 8px; letter-spacing:-.01em;}

  /* ---------- Часовой пояс ---------- */
  .ev-tz-note{margin:8px 2px 0; font-size:.76rem; line-height:1.4; color:var(--text-dim);}
  .ev-tz-note b{font-weight:700; color:var(--text);}
  .ev-tz-change{margin-left:4px; font-weight:700; color:var(--accent-2-dark); cursor:pointer; white-space:nowrap;}
  .cal-tz-text{display:flex; flex-direction:column; line-height:1.25;}
  .cal-tz-text small{font-size:.74rem; font-weight:600; color:var(--text-dim); overflow:hidden; text-overflow:ellipsis;}
  /* opened on top of the event sheet (z 90) */
  .tz-overlay{z-index:92;}
  .tz-sheet{max-height:82vh; display:flex; flex-direction:column;}
  .tz-sheet #tz-search{flex:none; margin-bottom:6px;}
  .tz-list{flex:1; min-height:0; overflow-y:auto; overscroll-behavior:contain; margin:0 -4px; padding:0 4px calc(8px + env(safe-area-inset-bottom));}
  .tz-row{display:flex; align-items:center; gap:10px; padding:12px 6px; border-top:1px solid var(--panel-border); cursor:pointer; border-radius:10px; transition:background .15s;}
  .tz-row:first-child{border-top:none;}
  .tz-row:active{background:var(--pill-bg);}
  .tz-city{flex:1; min-width:0; font-size:.92rem; font-weight:700; color:var(--text); overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
  .tz-tag{margin-left:8px; padding:2px 7px; border-radius:999px; font-size:.64rem; font-weight:800; vertical-align:middle;
    background:color-mix(in srgb, var(--accent-2) 16%, transparent); color:var(--accent-2-dark);}
  .tz-off{flex:none; font-size:.8rem; font-weight:700; color:var(--text-dim); font-variant-numeric:tabular-nums;}
  .tz-check{flex:none; width:18px; height:18px; stroke:var(--accent-2-dark); fill:none; stroke-width:2.6; stroke-linecap:round; stroke-linejoin:round; visibility:hidden;}
  .tz-row.selected .tz-city{color:var(--accent-2-dark);}
  .tz-row.selected .tz-check{visibility:visible;}
  .tz-empty{padding:24px 0; text-align:center; font-size:.86rem; color:var(--text-faint);}

  /* Расписание: horizontal swipes belong to the day switcher (see setupScheduleSwipe) */
  /* the neighbouring day waits just past the right/left edge while paging */
  .schedule-screen{overflow-x:hidden;}

  /* ---------- срок хранения аудио лекции ---------- */
  .audio-retention-note{display:flex; align-items:flex-start; gap:8px; margin:0 0 12px; padding:10px 12px; border-radius:14px;
    font-size:.78rem; line-height:1.4; color:var(--text-dim); background:var(--pill-bg); border:1px solid var(--panel-border);}
  .audio-retention-note svg{flex:none; width:16px; height:16px; margin-top:1px; stroke:currentColor; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round;}
  .audio-retention-note.soon{color:var(--text); background:color-mix(in srgb, var(--accent) 14%, var(--pill-bg)); border-color:color-mix(in srgb, var(--accent) 35%, transparent);}
  .audio-retention-note.soon svg{stroke:var(--accent);}

  /* Unbounded is wider than the old Non-Bureau: calendar nav labels stay on one line */
  :is(#panel-deadlines, #dl-window) .cal-month-label, :is(#panel-deadlines, #dl-window) .cal-day-label, :is(#panel-deadlines, #dl-window) .week-range{
    white-space:nowrap; min-width:0; overflow:hidden; text-overflow:ellipsis;
  }
  :is(#panel-deadlines, #dl-window) #cal-month-card .cal-month-label, :is(#panel-deadlines, #dl-window) #cal-day-card .cal-day-label{font-size:.9rem; padding:7px 10px;}

  /* sign-in screen of the iPhone/iPad app */
  .app-login{position:fixed; inset:0; z-index:10000; background:var(--bg); display:flex; flex-direction:column; align-items:center; justify-content:center; padding:32px 28px calc(32px + env(safe-area-inset-bottom)); text-align:center;}
  .app-login-logo{width:96px; height:96px; object-fit:contain; margin-bottom:14px;}
  .app-login h2{margin:0 0 10px;}
  .app-login-text{max-width:340px; color:var(--text-dim); font-size:.92rem; line-height:1.45; margin:0 0 26px;}
  .app-login-btn{width:100%; max-width:340px;}
  /* Apple's guidelines: black button on a light page, white on a dark one */
  .app-login-apple{display:flex; align-items:center; justify-content:center; gap:6px; width:100%; max-width:340px; box-sizing:border-box; margin-top:12px; padding:14px 18px; border-radius:16px; background:#000; color:#fff; font-weight:600; font-size:1rem; cursor:pointer; font-family:-apple-system, system-ui, sans-serif;}
  [data-theme="dark"] .app-login-apple{background:#fff; color:#000;}
  .app-login-apple-logo{font-size:1.2rem; line-height:1; margin-top:-3px;}
  .app-login-status{min-height:1.4em; margin-top:14px; font-size:.84rem; color:var(--text-dim);}


  /* ---------- Главная: Расписание / Дедлайны под кнопками ---------- */
  .home-w{border-radius:22px; padding:14px 14px 8px;}
  .home-w-head{display:flex; align-items:center; gap:10px; margin-bottom:6px;}
  .home-w-icon{width:34px; height:34px; border-radius:50%; flex:none; display:flex; align-items:center; justify-content:center;}
  .home-w-icon svg{width:18px; height:18px; stroke:currentColor; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round;}
  .home-w-schedule .home-w-icon{background:color-mix(in srgb, var(--accent-2) 26%, transparent); color:var(--accent-2);}
  .home-w-deadlines .home-w-icon{background:color-mix(in srgb, var(--accent) 26%, transparent); color:var(--accent);}
  .home-w-titles{flex:1; min-width:0; cursor:pointer; display:flex; flex-direction:column;}
  .home-w-titles b{font-family:'Unbounded'; font-size:.9rem; font-weight:700; color:var(--text);}
  .home-w-titles span{font-size:.76rem; font-weight:600; color:var(--text-dim); margin-top:1px;}
  .home-w-gear, .home-w-open{
    width:30px; height:30px; border-radius:50%; flex:none; display:flex; align-items:center; justify-content:center;
    cursor:pointer; color:var(--text-dim); -webkit-tap-highlight-color:transparent; transition:transform .15s ease;
  }
  .home-w-gear:active, .home-w-open:active{transform:scale(.88); background:var(--panel-bg-strong);}
  .home-w-gear svg{width:17px; height:17px; stroke:currentColor; fill:none; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round;}
  .home-w-open svg{width:18px; height:18px; stroke:currentColor; fill:none; stroke-width:2.4; stroke-linecap:round; stroke-linejoin:round;}
  .home-w-row{
    display:flex; align-items:center; gap:10px; padding:9px 2px; cursor:pointer;
    border-top:1px solid var(--panel-border); -webkit-tap-highlight-color:transparent;
  }
  .home-w-row:active{opacity:.7;}
  .home-w-row.past{opacity:.45;}
  .home-w-time{width:40px; flex:none; font-size:.8rem; font-weight:700; color:var(--text-dim); text-align:right;}
  .home-w-row.now .home-w-time{color:var(--accent-2);}
  .home-w-bar{width:3px; height:30px; border-radius:3px; flex:none;}
  .home-w-dot{width:9px; height:9px; border-radius:50%; flex:none; margin:0 4px 0 2px;}
  .home-w-main{flex:1; min-width:0; display:flex; flex-direction:column;}
  .home-w-main b{font-size:.88rem; font-weight:700; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .home-w-main span{font-size:.74rem; font-weight:600; color:var(--text-dim); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top:1px;}
  .home-w-dl.overdue .home-w-main span{color:var(--danger);}
  /* ДЗ on a lesson row: a quiet "+" when there is none, a yellow chip when
     there is, a green tick once done — one glance, no extra lines */
  .home-w-hw{
    flex:none; min-width:30px; height:26px; padding:0 7px; border-radius:13px; box-sizing:border-box;
    display:flex; align-items:center; justify-content:center; font-size:.7rem; font-weight:800;
    color:var(--text-faint); background:transparent; border:1px dashed var(--panel-border-strong);
  }
  .home-w-hw svg{width:13px; height:13px; stroke:currentColor; fill:none; stroke-width:2.6; stroke-linecap:round; stroke-linejoin:round;}
  .home-w-hw.has{color:#1a1400; background:var(--accent-yellow); border:none;}
  .home-w-hw.done{color:#4cd07d; background:color-mix(in srgb, #4cd07d 18%, transparent); border:none;}
  .home-w-empty{padding:10px 2px 8px; font-size:.84rem; color:var(--text-dim); border-top:1px solid var(--panel-border);}
  .home-w-empty-cta, .home-w-more{
    display:block; padding:10px 2px 8px; border-top:1px solid var(--panel-border);
    font-size:.84rem; font-weight:700; color:var(--accent-2-dark); cursor:pointer;
  }

  /* one-time questions: "что показать здесь?" on Главная, "что первым?" on Дедлайны */
  .layout-ask{
    margin:0 0 14px; padding:16px; border-radius:22px;
    background:color-mix(in srgb, var(--accent-3) 14%, var(--panel-bg));
    border:1px solid color-mix(in srgb, var(--accent-3) 34%, var(--panel-border));
  }
  .home-w-ask{margin:0;}
  .layout-ask-title{font-family:'Unbounded'; font-weight:700; font-size:.9rem; color:var(--text);}
  .layout-ask-sub{margin-top:4px; font-size:.78rem; line-height:1.4; color:var(--text-dim);}
  .layout-ask-btns{display:flex; gap:8px; margin-top:12px;}
  .layout-ask-btns span{
    flex:1; text-align:center; padding:10px 4px; border-radius:14px; cursor:pointer;
    background:var(--bg); border:1px solid var(--panel-border); font-size:.84rem; font-weight:700; color:var(--text);
    transition:transform .12s ease;
  }
  .layout-ask-btns span:active{transform:scale(.95);}
  .layout-hint{margin-top:12px;}
  #layout-overlay .tempchat-cta{margin-top:14px;}

  /* ДЗ line on a lesson card in Расписание — only when there is homework */
  .schedule-hw{
    display:flex; align-items:center; gap:6px; margin-top:7px; max-width:100%;
    font-size:.8rem; font-weight:600; color:var(--text);
  }
  .schedule-hw svg{width:14px; height:14px; flex:none; stroke:var(--accent-yellow); fill:none; stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round;}
  .schedule-hw span{overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
  .schedule-hw.done{color:var(--text-faint);}
  .schedule-hw.done span{text-decoration:line-through;}
  .schedule-hw.done svg{stroke:#4cd07d; stroke-width:2.8;}

  /* homework sheet */
  .hw-head{min-width:0;}
  .hw-head h3{margin-bottom:2px;}
  .hw-subject{font-size:.84rem; font-weight:600; color:var(--text-dim); overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
  .hw-when{margin-bottom:12px;}
  .hw-when span{display:flex; flex-direction:column; align-items:center; gap:1px; line-height:1.2;}
  .hw-when small{font-size:.7rem; font-weight:600; color:var(--text-faint);}
  .hw-text{min-height:120px; resize:vertical; font-size:16px; line-height:1.45;}
  .hw-note{margin:8px 2px 0; font-size:.76rem; line-height:1.4; color:var(--text-dim);}
  .hw-done{display:flex; align-items:center; gap:10px; margin:14px 2px 2px; cursor:pointer; font-weight:700; font-size:.92rem;}
  .hw-done input{display:none;}
  .hw-done-box{
    width:24px; height:24px; border-radius:8px; border:2px solid var(--panel-border-strong);
    display:flex; align-items:center; justify-content:center; transition:background .15s, border-color .15s;
  }
  .hw-done-box svg{width:15px; height:15px; stroke:#fff; fill:none; stroke-width:3; stroke-linecap:round; stroke-linejoin:round; opacity:0; transition:opacity .15s;}
  .hw-done input:checked + .hw-done-box{background:#4cd07d; border-color:#4cd07d;}
  .hw-done input:checked + .hw-done-box svg{opacity:1;}
  #hw-overlay .tempchat-cta{margin-top:16px;}
  .hw-delete{display:block; width:100%; margin-top:8px; text-align:center; box-sizing:border-box;}

  /* ---------- Повторение: карточки и тест ---------- */
  .study-sheet{min-height:72vh;}
  .study-progress{height:4px; border-radius:4px; background:var(--panel-bg-strong); overflow:hidden; margin:-4px 0 16px;}
  .study-progress span{display:block; height:100%; width:0; border-radius:4px; background:var(--accent-3); transition:width .3s ease;}
  .study-loading{display:flex; flex-direction:column; align-items:center; gap:12px; padding:48px 12px; text-align:center; font-weight:700; color:var(--text-dim);}
  .study-loading small{font-weight:600; color:var(--text-faint);}
  .study-counter{font-size:.8rem; font-weight:600; color:var(--text-dim); margin:0 2px 12px;}
  .flashcard{perspective:1200px; height:300px; cursor:pointer; -webkit-tap-highlight-color:transparent;}
  .flashcard-inner{position:relative; width:100%; height:100%; transition:transform .5s cubic-bezier(.3,1.2,.4,1); transform-style:preserve-3d;}
  .flashcard.flipped .flashcard-inner{transform:rotateY(180deg);}
  .flashcard-face{
    position:absolute; inset:0; backface-visibility:hidden; -webkit-backface-visibility:hidden;
    border-radius:24px; padding:22px 20px; box-sizing:border-box; overflow-y:auto;
    display:flex; flex-direction:column; justify-content:center; align-items:center; text-align:center;
    border:1px solid var(--panel-border);
  }
  .flashcard-front{background:color-mix(in srgb, var(--accent-3) 16%, var(--panel-bg));}
  .flashcard-back{background:color-mix(in srgb, var(--accent-2) 14%, var(--panel-bg)); transform:rotateY(180deg);}
  .flashcard-label{position:absolute; top:14px; left:18px; font-size:.68rem; font-weight:800; text-transform:uppercase; letter-spacing:.05em; color:var(--text-faint);}
  .flashcard-text{font-size:1.08rem; font-weight:700; line-height:1.45; color:var(--text);}
  .flashcard-back .flashcard-text{font-weight:600; font-size:1rem;}
  .study-actions{display:flex; gap:10px; margin-top:16px;}
  .study-actions .btn{flex:1; text-align:center; padding:13px; border-radius:18px; font-weight:700;}
  .study-know{background:#4cd07d !important; color:#062611 !important; border-color:transparent !important;}
  .quiz-q{font-size:1.05rem; font-weight:700; line-height:1.45; margin:0 2px 14px;}
  .quiz-options{display:flex; flex-direction:column; gap:8px;}
  .quiz-option{
    display:flex; align-items:flex-start; gap:12px; padding:13px 14px; border-radius:16px; cursor:pointer;
    background:var(--panel-bg); border:1.5px solid var(--panel-border); transition:transform .12s ease, background .2s, border-color .2s;
    -webkit-tap-highlight-color:transparent;
  }
  .quiz-option:active{transform:scale(.98);}
  .quiz-letter{flex:none; width:24px; height:24px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:.75rem; font-weight:800; background:var(--panel-bg-strong); color:var(--text-dim);}
  .quiz-option-text{font-size:.92rem; font-weight:600; line-height:1.4; padding-top:2px;}
  .quiz-options.answered .quiz-option{cursor:default;}
  .quiz-options.answered .quiz-option:not(.right):not(.wrong){opacity:.5;}
  .quiz-option.right{border-color:#4cd07d; background:color-mix(in srgb, #4cd07d 16%, var(--panel-bg));}
  .quiz-option.right .quiz-letter{background:#4cd07d; color:#062611;}
  .quiz-option.wrong{border-color:var(--danger); background:color-mix(in srgb, var(--danger) 14%, var(--panel-bg));}
  .quiz-option.wrong .quiz-letter{background:var(--danger); color:#fff;}
  .quiz-explain{margin:14px 2px 0; padding:12px 14px; border-radius:14px; background:var(--panel-bg-strong); font-size:.86rem; line-height:1.45; color:var(--text-dim);}
  #quiz-next{margin-top:16px;}
  .study-done{display:flex; flex-direction:column; align-items:center; gap:6px; padding:36px 12px 24px; text-align:center;}
  .study-done-emoji{font-size:2.6rem; margin-bottom:6px;}
  .study-done b{font-family:'Unbounded'; font-size:1.1rem;}
  .study-done span{color:var(--text-dim); font-weight:600;}
  .study-fresh{display:block; width:100%; margin-top:8px; text-align:center; box-sizing:border-box;}

  /* ---------- Рисование от руки ---------- */
  .sketch-screen{
    position:fixed; inset:0; z-index:200; background:var(--bg); display:flex; flex-direction:column;
    padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
    opacity:0; pointer-events:none; transform:translateY(24px); transition:opacity .22s ease, transform .28s cubic-bezier(.2,.8,.2,1);
  }
  .sketch-screen.open{opacity:1; pointer-events:auto; transform:none;}
  .sketch-top{display:flex; align-items:center; justify-content:space-between; gap:8px; padding:10px 14px;}
  .sketch-history{display:flex; gap:6px;}
  .sketch-btn{padding:9px 14px; border-radius:18px; font-weight:700; font-size:.9rem; cursor:pointer; color:var(--text); background:var(--panel-bg-strong);}
  .sketch-btn.primary{background:var(--accent-2-dark); color:var(--btn-text);}
  .sketch-icon{width:38px; height:38px; border-radius:50%; display:flex; align-items:center; justify-content:center; cursor:pointer; background:var(--panel-bg-strong); transition:opacity .15s, transform .12s;}
  .sketch-icon:active{transform:scale(.9);}
  .sketch-icon.off{opacity:.35;}
  .sketch-icon svg{width:19px; height:19px; stroke:var(--text); fill:none; stroke-width:2.1; stroke-linecap:round; stroke-linejoin:round;}
  /* the sheet itself is always white paper — the drawing lands in the note as-is */
  .sketch-stage{
    flex:1; min-height:0; margin:0 10px; border-radius:18px; overflow:hidden; position:relative;
    background-color:#fff; box-shadow:0 0 0 1px rgba(0,0,0,.08) inset;
    touch-action:none; -webkit-user-select:none; user-select:none; -webkit-touch-callout:none;
  }
  .sketch-stage[data-paper="grid"]{background-image:linear-gradient(rgba(10,108,255,.10) 1px, transparent 1px), linear-gradient(90deg, rgba(10,108,255,.10) 1px, transparent 1px); background-size:24px 24px;}
  .sketch-stage[data-paper="lines"]{background-image:linear-gradient(rgba(10,108,255,.14) 1px, transparent 1px); background-size:100% 30px; background-position:0 18px;}
  #sketch-canvas{display:block; touch-action:none;}
  .sketch-tools{padding:10px 14px 8px; display:flex; flex-direction:column; gap:10px;}
  .sketch-tool-row{display:flex; align-items:center; justify-content:center; gap:8px;}
  .sketch-tool, .sketch-size{
    width:44px; height:44px; border-radius:14px; display:flex; align-items:center; justify-content:center; cursor:pointer;
    background:var(--panel-bg); border:1.5px solid var(--panel-border); transition:transform .12s, border-color .15s, background .15s;
    -webkit-tap-highlight-color:transparent;
  }
  .sketch-tool:active, .sketch-size:active{transform:scale(.9);}
  .sketch-tool svg{width:21px; height:21px; stroke:var(--text); fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round;}
  .sketch-tool.selected, .sketch-size.selected{border-color:var(--accent-2); background:color-mix(in srgb, var(--accent-2) 16%, var(--panel-bg));}
  .sketch-size i{display:block; border-radius:50%; background:var(--text);}
  .sketch-sep{width:1px; height:28px; background:var(--panel-border-strong); margin:0 4px;}
  .sketch-colors{display:flex; justify-content:center; gap:12px;}
  .sketch-color{width:30px; height:30px; border-radius:50%; cursor:pointer; box-shadow:0 0 0 2px var(--bg), 0 0 0 3px transparent; transition:box-shadow .15s, transform .12s;}
  .sketch-color.selected{box-shadow:0 0 0 2px var(--bg), 0 0 0 4px var(--text); transform:scale(1.05);}

  /* PDF с пометками / «Рисовать поверх»: страницы одна под другой */
  .sketch-pages{
    flex:1; min-height:0; overflow-y:auto; -webkit-overflow-scrolling:touch; padding:4px 10px 12px;
    display:flex; flex-direction:column; gap:12px; touch-action:pan-y;
  }
  .sketch-page{position:relative; width:100%; max-width:900px; margin:0 auto; flex:none; background:#fff; border-radius:6px; overflow:hidden; box-shadow:0 4px 18px -8px rgba(0,0,0,.45);}
  .sketch-page img{position:absolute; inset:0; width:100%; height:100%; display:block; -webkit-user-select:none; user-select:none; -webkit-touch-callout:none; pointer-events:none;}
  .sketch-page-canvas{position:absolute; inset:0; width:100%; height:100%; touch-action:pan-y;}
  .sketch-busy{
    position:absolute; left:50%; top:45%; transform:translate(-50%,-50%); display:none; flex-direction:column; align-items:center; gap:12px;
    padding:20px 26px; border-radius:20px; background:var(--panel-bg-strong); box-shadow:var(--shadow); font-weight:700; color:var(--text); z-index:2;
  }
  .sketch-busy.show{display:flex;}
  .sketch-mode.selected{background:color-mix(in srgb, var(--accent-2) 22%, var(--panel-bg-strong));}
  .photo-lightbox-actions{
    position:absolute; left:50%; bottom:calc(28px + env(safe-area-inset-bottom)); transform:translateX(-50%);
    display:flex; gap:8px;
  }
  .photo-lightbox-btn{
    display:flex; align-items:center; gap:8px; padding:12px 18px; border-radius:24px; cursor:pointer;
    background:var(--accent-2-dark); color:var(--btn-text); font-weight:700; font-size:.9rem; white-space:nowrap;
    box-shadow:0 10px 24px -8px rgba(0,0,0,.6);
  }
  .photo-lightbox-btn.secondary{background:rgba(255,255,255,.14); color:#fff; -webkit-backdrop-filter:blur(12px); backdrop-filter:blur(12px);}
  .photo-lightbox-btn svg{width:18px; height:18px; stroke:currentColor; fill:none; stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round;}

  /* режим прослушивания: абзац, о котором сейчас говорят, и строка расшифровки */
  #detail-body.replay .replay-block{cursor:pointer; border-radius:8px; transition:background .35s ease, box-shadow .35s ease;}
  #detail-body.replay .replay-block:active{background:color-mix(in srgb, var(--accent-2) 10%, transparent);}
  #detail-body.replay .replay-now{
    background:color-mix(in srgb, var(--accent-2) 14%, transparent);
    box-shadow:-8px 0 0 color-mix(in srgb, var(--accent-2) 14%, transparent), 8px 0 0 color-mix(in srgb, var(--accent-2) 14%, transparent);
  }
  #transcript-list.replay .transcript-seg{transition:opacity .3s ease;}
  #transcript-list.replay .transcript-seg.replay-now .transcript-seg-text{color:var(--text);}
  #transcript-list.replay .transcript-seg.replay-now .transcript-time{color:var(--accent-2); font-weight:800;}
  #transcript-list.replay .transcript-seg.replay-now{box-shadow:inset 3px 0 0 var(--accent-2); padding-left:10px; margin-left:-10px; border-radius:4px;}

  /* ссылка на заметку */
  .share-link-box{margin:4px 0 14px; padding:12px 14px; border-radius:14px; background:var(--pill-bg); border:1px solid var(--panel-border); font-size:.86rem; font-weight:600; color:var(--text); word-break:break-all;}
  .share-actions{display:flex; gap:8px; margin-top:8px;}
  .share-actions .btn{flex:1; text-align:center;}

  /* второй ряд инструментов: толщины + цвета, компактнее, чтобы влезало в iPhone */
  .sketch-row2{gap:6px;}
  .sketch-row2 .sketch-size{width:34px; height:34px; border-radius:11px;}
  .sketch-row2 .sketch-colors{gap:8px;}
  .sketch-row2 .sketch-color{width:26px; height:26px;}
  .sketch-tool-row{flex-wrap:nowrap;}

  /* перемотка ±15 с в плеере */
  .note-audio-skip{
    flex:none; position:relative; width:30px; height:30px; display:flex; align-items:center; justify-content:center;
    cursor:pointer; color:var(--text-dim); -webkit-tap-highlight-color:transparent; transition:transform .12s ease;
  }
  .note-audio-skip:active{transform:scale(.85);}
  .note-audio-skip svg{position:absolute; inset:0; width:30px; height:30px; stroke:currentColor; fill:none; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round;}
  .note-audio-skip b{position:relative; font-size:.56rem; font-weight:800; margin-top:1px;}

  /* вторая заметка рядом: телефон — нижняя половина, iPad/компьютер — справа */
  .side-note{
    position:fixed; left:0; right:0; bottom:0; height:46vh; z-index:80; display:flex; flex-direction:column;
    background:var(--bg); border-top:1px solid var(--panel-border-strong); border-radius:22px 22px 0 0;
    box-shadow:0 -14px 40px -18px rgba(0,0,0,.6);
    transform:translateY(105%); transition:transform .3s cubic-bezier(.2,.8,.2,1);
    padding-bottom:env(safe-area-inset-bottom);
  }
  .side-note.open{transform:none;}
  .side-note-head{display:flex; align-items:center; gap:8px; padding:12px 14px 8px;}
  .side-note-titles{flex:1; min-width:0; display:flex; flex-direction:column;}
  .side-note-titles b{font-family:'Unbounded'; font-size:.88rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .side-note-titles span{font-size:.74rem; font-weight:600; color:var(--text-dim);}
  .side-note-body{flex:1; min-height:0; overflow-y:auto; -webkit-overflow-scrolling:touch; padding:4px 16px 24px; white-space:normal;}
  body.side-note-open #note-toolbar-float{opacity:0; pointer-events:none;}
  body.side-note-open #panel-note-detail{padding-bottom:48vh;}
  @media (min-width: 820px){
    .side-note{left:auto; top:0; width:40vw; height:auto; border-radius:0; border-top:none; border-left:1px solid var(--panel-border-strong);
      transform:translateX(105%); padding-top:env(safe-area-inset-top); box-shadow:-14px 0 40px -18px rgba(0,0,0,.5);}
    .side-note.open{transform:none;}
    body.side-note-open #note-toolbar-float{opacity:1; pointer-events:auto;}
    body.side-note-open #panel-note-detail{padding-bottom:0; margin-right:40vw;}
  }
  .side-pick-list{margin-top:10px; max-height:52vh; overflow-y:auto;}
  .side-pick-row{display:flex; flex-direction:column; gap:2px; padding:12px 4px; border-top:1px solid var(--panel-border); cursor:pointer;}
  .side-pick-row:first-child{border-top:none;}
  .side-pick-row:active{background:var(--panel-bg);}
  .side-pick-row b{font-size:.92rem;}
  .side-pick-row span{font-size:.76rem; color:var(--text-dim); font-weight:600;}
  .side-pick-empty{padding:24px 8px; text-align:center; color:var(--text-dim);}

  /* ---------- Контент-менеджер ---------- */
  .cm-sheet{min-height:60vh;}
  .cm-section{margin:18px 2px 8px; font-size:.72rem; font-weight:800; text-transform:uppercase; letter-spacing:.05em; color:var(--text-dim);}
  .cm-section:first-child{margin-top:4px;}
  .cm-card{display:flex; align-items:center; gap:10px; padding:12px; border-radius:18px; background:var(--panel-bg); border:1px solid var(--panel-border); margin-bottom:8px;}
  .cm-card-icon{width:38px; height:38px; border-radius:50%; flex:none; display:flex; align-items:center; justify-content:center;}
  .cm-card-icon svg{width:19px; height:19px; stroke:currentColor; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round;}
  .cm-blue{background:color-mix(in srgb, var(--accent-2) 24%, transparent); color:var(--accent-2);}
  .cm-purple{background:color-mix(in srgb, var(--accent-3) 26%, transparent); color:var(--accent-3);}
  .cm-pink{background:color-mix(in srgb, var(--accent-pink) 24%, transparent); color:var(--accent-pink);}
  .cm-card-text{flex:1; min-width:0; display:flex; flex-direction:column;}
  .cm-card-text b{font-size:.9rem;}
  .cm-card-text span{font-size:.76rem; font-weight:600; color:var(--text-dim); line-height:1.35;}
  .cm-chip{flex:none; padding:7px 11px; border-radius:14px; background:var(--panel-bg-strong); font-size:.78rem; font-weight:700; color:var(--text); cursor:pointer; -webkit-tap-highlight-color:transparent; transition:transform .12s;}
  .cm-chip:active{transform:scale(.93);}
  .cm-grid{display:grid; grid-template-columns:repeat(3, 1fr); gap:6px;}
  @media (min-width: 600px){ .cm-grid{grid-template-columns:repeat(5, 1fr);} }
  .cm-tile{position:relative; aspect-ratio:1; border-radius:12px; overflow:hidden; background:var(--panel-bg-strong); cursor:pointer;}
  .cm-tile.loading{animation:cmPulse 1.2s ease-in-out infinite;}
  @keyframes cmPulse{50%{opacity:.55;}}
  .cm-tile img{width:100%; height:100%; object-fit:cover; display:block; background:#fff;}
  .cm-tile-badge{position:absolute; left:5px; bottom:5px; padding:2px 6px; border-radius:8px; background:rgba(0,0,0,.6); color:#fff; font-size:.64rem; font-weight:700;}
  .cm-tile-off{left:auto; right:5px; bottom:auto; top:5px; background:rgba(0,0,0,.5);}
  .cm-empty{padding:14px; border-radius:16px; border:1px dashed var(--panel-border-strong); color:var(--text-dim); font-size:.84rem; line-height:1.4; text-align:center;}
  .cm-photo-preview{display:flex; justify-content:center; margin:-4px 0 12px;}
  .cm-photo-preview img{max-width:100%; max-height:34vh; border-radius:14px; background:#fff;}
  .cm-flash{animation:cmFlash 1.4s ease;}
  @keyframes cmFlash{0%,60%{box-shadow:0 0 0 3px var(--accent-2); border-radius:14px;} 100%{box-shadow:0 0 0 0 transparent;}}


  /* ---------- Главная: виджеты как на iPhone ---------- */
  .home-widgets{display:grid; grid-template-columns:1fr 1fr; grid-auto-flow:row dense; gap:12px; margin-top:14px;}
  .home-widgets .w-wide, .home-edit-bar, .home-edit-link{grid-column:1 / -1;}
  .home-w{position:relative; -webkit-user-select:none; user-select:none; -webkit-touch-callout:none;}
  .home-w-small{
    aspect-ratio:1 / .92; padding:14px; border-radius:22px; display:flex; flex-direction:column; justify-content:space-between;
    cursor:pointer; overflow:hidden; transition:transform .15s cubic-bezier(.34,1.56,.64,1);
  }
  .home-w-small:active{transform:scale(.96);}
  .home-w-small .home-w-icon{width:34px; height:34px;}
  .home-w-small-main{display:flex; flex-direction:column; min-width:0;}
  .home-w-value{font-family:'Unbounded'; font-weight:700; font-size:1.15rem; line-height:1.15; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .home-w-label{margin-top:3px; font-size:.86rem; font-weight:800; line-height:1.25; color:var(--text);
    display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;}
  .home-w-sub{margin-top:2px; font-size:.72rem; font-weight:600; color:var(--text-dim); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  /* цвета — те же, что у кнопок «Записать лекцию» / «Импортировать файл» */
  .w-c-blue{--wc:var(--accent-2);} .w-c-orange{--wc:var(--accent);} .w-c-yellow{--wc:var(--accent-yellow);}
  .w-c-purple{--wc:var(--accent-3);} .w-c-pink{--wc:var(--accent-pink);} .w-c-green{--wc:#4cd07d;}
  .home-w-small[class*="w-c-"]{background:color-mix(in srgb, var(--wc) 16%, var(--panel-bg)); border-color:color-mix(in srgb, var(--wc) 34%, var(--panel-border));}
  .home-w[class*="w-c-"] .home-w-icon{background:color-mix(in srgb, var(--wc) 30%, transparent); color:var(--wc);}

  /* режим «Изменить» */
  .home-widgets.editing .home-w{animation:wJiggle .26s ease-in-out infinite alternate; animation-delay:var(--jiggle-delay, 0s);}
  .home-widgets.editing .home-w.dragging{animation:none; z-index:5; box-shadow:0 22px 40px -14px rgba(0,0,0,.6); transition:none; opacity:.96;}
  @keyframes wJiggle{from{transform:rotate(-.7deg);} to{transform:rotate(.7deg);}}
  .home-w-remove{
    position:absolute; top:-7px; left:-7px; z-index:3; width:24px; height:24px; border-radius:50%;
    display:flex; align-items:center; justify-content:center; cursor:pointer;
    background:var(--panel-bg-strong); border:1px solid var(--panel-border-strong); box-shadow:0 4px 10px -4px rgba(0,0,0,.5);
  }
  .home-w-remove svg{width:13px; height:13px; stroke:var(--text); fill:none; stroke-width:3; stroke-linecap:round;}
  .home-widgets.editing .home-w{overflow:visible;}
  .home-edit-bar{display:flex; justify-content:space-between; align-items:center;}
  .home-edit-add, .home-edit-done{padding:9px 16px; border-radius:18px; font-weight:700; font-size:.88rem; cursor:pointer; display:flex; align-items:center; gap:6px;}
  .home-edit-add{background:var(--panel-bg-strong); color:var(--text);}
  .home-edit-add svg{width:16px; height:16px; stroke:currentColor; fill:none; stroke-width:2.6; stroke-linecap:round;}
  .home-edit-done{background:var(--accent-2-dark); color:var(--btn-text);}
  .home-edit-link{justify-self:center; margin:2px 0 6px; padding:8px 14px; border-radius:16px; font-size:.8rem; font-weight:700; color:var(--text-dim); cursor:pointer;}
  .home-edit-link:active{background:var(--panel-bg);}

  /* галерея виджетов */
  .wg-row{display:flex; align-items:center; gap:12px; padding:12px 4px; border-top:1px solid var(--panel-border); cursor:pointer;}
  .wg-row:first-child{border-top:none;}
  .wg-row:active{background:var(--panel-bg);}
  .wg-icon{width:42px; height:42px; border-radius:14px; flex:none; display:flex; align-items:center; justify-content:center;
    background:color-mix(in srgb, var(--wc) 24%, var(--panel-bg)); color:var(--wc);}
  .wg-icon svg{width:21px; height:21px; stroke:currentColor; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round;}
  .wg-text{flex:1; min-width:0; display:flex; flex-direction:column;}
  .wg-text b{font-size:.92rem;}
  .wg-text span{font-size:.76rem; font-weight:600; color:var(--text-dim);}
  .wg-add{width:30px; height:30px; border-radius:50%; flex:none; display:flex; align-items:center; justify-content:center; background:var(--accent-2-dark);}
  .wg-add svg{width:16px; height:16px; stroke:var(--btn-text); fill:none; stroke-width:2.8; stroke-linecap:round;}

  /* ---------- «Спросить ИИ» во время записи ---------- */
  .note-toolbar-ask{color:#fff; border:none; background:linear-gradient(135deg, var(--accent-2), var(--accent-3) 60%, var(--accent-pink));}
  .note-toolbar-ask svg{fill:currentColor; stroke:none; width:19px; height:19px;}
  /* заметка остаётся видна за листом — это подсказка, а не отдельный экран */
  .live-ask-overlay{background:rgba(0,0,0,.28);}
  .live-ask-sheet{display:flex; flex-direction:column; max-height:54vh; padding:14px 14px calc(12px + env(safe-area-inset-bottom));}
  .live-ask-head{display:flex; align-items:center; gap:10px; margin-bottom:8px;}
  .live-ask-spark{width:32px; height:32px; border-radius:50%; flex:none; display:flex; align-items:center; justify-content:center; color:#fff;
    background:linear-gradient(135deg, var(--accent-2), var(--accent-3) 60%, var(--accent-pink));}
  .live-ask-spark svg{width:16px; height:16px; fill:currentColor;}
  .live-ask-titles{flex:1; min-width:0; display:flex; flex-direction:column;}
  .live-ask-titles b{font-family:'Unbounded'; font-size:.88rem;}
  .live-ask-titles span{display:flex; align-items:center; gap:5px; font-size:.72rem; font-weight:700; color:var(--text-dim);}
  .live-ask-dot{display:inline-block; width:7px; height:7px; border-radius:50%; background:#ff453a; animation:liveDot 1.2s ease-in-out infinite;}
  .live-ask-dot.paused{background:var(--text-faint); animation:none;}
  @keyframes liveDot{50%{opacity:.3;}}
  .live-ask-thread{flex:1; min-height:60px; overflow-y:auto; -webkit-overflow-scrolling:touch; padding:2px 2px 6px;}
  .live-ask-empty{padding:10px 4px; font-size:.84rem; line-height:1.4; color:var(--text-dim);}
  .live-ask-q{margin:8px 0 6px auto; max-width:85%; width:fit-content; padding:8px 12px; border-radius:16px 16px 4px 16px;
    background:var(--accent-2-dark); color:var(--btn-text); font-size:.88rem; font-weight:600;}
  .live-ask-a{padding:10px 12px; border-radius:16px 16px 16px 4px; background:var(--panel-bg); border:1px solid var(--panel-border);
    font-size:.9rem; line-height:1.45; max-width:95%;}
  .live-ask-a p{margin:0 0 6px;} .live-ask-a p:last-of-type{margin-bottom:0;}
  .live-ask-a ul{margin:4px 0 6px; padding-left:18px;}
  .live-ask-a small{display:block; margin-top:4px; font-size:.74rem; color:var(--text-dim);}
  .live-ask-err{color:var(--danger);}
  .live-ask-insert{display:inline-block; margin-top:8px; padding:5px 10px; border-radius:12px; background:var(--panel-bg-strong); font-size:.76rem; font-weight:700; cursor:pointer;}
  .live-ask-insert.done{color:#4cd07d; cursor:default;}
  .live-ask-typing{display:inline-flex; gap:4px;}
  .live-ask-typing i{width:7px; height:7px; border-radius:50%; background:var(--text-dim); animation:liveTyping 1s ease-in-out infinite;}
  .live-ask-typing i:nth-child(2){animation-delay:.15s;} .live-ask-typing i:nth-child(3){animation-delay:.3s;}
  @keyframes liveTyping{0%,100%{opacity:.25; transform:translateY(0);} 50%{opacity:1; transform:translateY(-3px);}}
  .live-ask-chips{display:flex; gap:6px; overflow-x:auto; padding:6px 0 8px; scrollbar-width:none;}
  .live-ask-chips::-webkit-scrollbar{display:none;}
  .live-ask-chips span{flex:none; padding:7px 11px; border-radius:14px; background:var(--panel-bg-strong); font-size:.78rem; font-weight:700; cursor:pointer; white-space:nowrap;}
  .live-ask-chips span:active{transform:scale(.95);}
  .live-ask-input-row{display:flex; align-items:flex-end; gap:8px; padding:6px 6px 6px 14px; border-radius:22px; background:var(--pill-bg); border:1px solid var(--panel-border);}
  .live-ask-input{flex:1; min-width:0; resize:none; border:none; outline:none; background:none; color:var(--text); font:inherit; font-size:16px; line-height:1.35; padding:6px 0; max-height:96px;}
  .live-ask-send{width:34px; height:34px; border-radius:50%; flex:none; display:flex; align-items:center; justify-content:center; background:var(--accent-2-dark); cursor:pointer;}
  .live-ask-send svg{width:17px; height:17px; stroke:var(--btn-text); fill:none; stroke-width:2.6; stroke-linecap:round; stroke-linejoin:round;}

  /* ---------- Бумага заметок (как в Notability) ----------
     Одна система для страниц заметки, листа для рисования, превью и галереи:
     переменные --paper-* ставит applyNoteStyle() на <html>, тип сетки —
     html[data-paper]; у превью в галерее свой data-paper и свои переменные. */
  @font-face{font-family:'Caveat'; src:url('fonts/caveat-500-cyrillic.woff2') format('woff2'); font-weight:500 700; font-display:swap; unicode-range:U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;}
  @font-face{font-family:'Caveat'; src:url('fonts/caveat-500-latin.woff2') format('woff2'); font-weight:500 700; font-display:swap; unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}
  @font-face{font-family:'Comfortaa'; src:url('fonts/comfortaa-500-cyrillic.woff2') format('woff2'); font-weight:500 700; font-display:swap; unicode-range:U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;}
  @font-face{font-family:'Comfortaa'; src:url('fonts/comfortaa-500-latin.woff2') format('woff2'); font-weight:500 700; font-display:swap; unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}
  @font-face{font-family:'JetBrains Mono'; src:url('fonts/jetbrains-mono-400-cyrillic.woff2') format('woff2'); font-weight:400 700; font-display:swap; unicode-range:U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;}
  @font-face{font-family:'JetBrains Mono'; src:url('fonts/jetbrains-mono-400-latin.woff2') format('woff2'); font-weight:400 700; font-display:swap; unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}
  @font-face{font-family:'PT Serif'; src:url('fonts/pt-serif-400-cyrillic.woff2') format('woff2'); font-weight:400; font-display:swap; unicode-range:U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;}
  @font-face{font-family:'PT Serif'; src:url('fonts/pt-serif-400-latin.woff2') format('woff2'); font-weight:400; font-display:swap; unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}
  @font-face{font-family:'PT Serif'; src:url('fonts/pt-serif-700-cyrillic.woff2') format('woff2'); font-weight:700; font-display:swap; unicode-range:U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;}
  @font-face{font-family:'PT Serif'; src:url('fonts/pt-serif-700-latin.woff2') format('woff2'); font-weight:700; font-display:swap; unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}
  :root{--paper-size:28px; --paper-line:var(--grid-line); --paper-major:color-mix(in srgb, var(--grid-line) 100%, var(--text) 18%); --paper-accent:rgba(229,57,53,.42); --paper-bg:var(--bg); --note-font:inherit; --note-font-scale:1;}
  .paper{background-color:var(--paper-bg);}
  :is(html[data-paper="plain"] .paper:not([data-paper]), .paper[data-paper="plain"]){background-image:var(--paper-extra, linear-gradient(transparent, transparent)); background-size:100% 100%;}
  :is(html[data-paper="grid"] .paper:not([data-paper]), .paper[data-paper="grid"]){background-image:var(--paper-extra, linear-gradient(transparent, transparent)), linear-gradient(var(--paper-line) 1px, transparent 1px), linear-gradient(90deg, var(--paper-line) 1px, transparent 1px); background-size:100% 100%, var(--paper-size) var(--paper-size), var(--paper-size) var(--paper-size);}
  :is(html[data-paper="dots"] .paper:not([data-paper]), .paper[data-paper="dots"]){background-image:var(--paper-extra, linear-gradient(transparent, transparent)), radial-gradient(circle at 1.5px 1.5px, var(--paper-major) 1.3px, transparent 1.8px); background-size:100% 100%, var(--paper-size) var(--paper-size);}
  :is(html[data-paper="lines"] .paper:not([data-paper]), .paper[data-paper="lines"]){background-image:var(--paper-extra, linear-gradient(transparent, transparent)), linear-gradient(transparent calc(var(--paper-size) - 1px), var(--paper-line) calc(var(--paper-size) - 1px)); background-size:100% 100%, 100% var(--paper-size);}
  :is(html[data-paper="ruled"] .paper:not([data-paper]), .paper[data-paper="ruled"]){background-image:var(--paper-extra, linear-gradient(transparent, transparent)), linear-gradient(90deg, transparent 38px, var(--paper-accent) 38px, var(--paper-accent) 39.5px, transparent 39.5px), linear-gradient(transparent calc(var(--paper-size) - 1px), var(--paper-line) calc(var(--paper-size) - 1px)); background-size:100% 100%, 100% 100%, 100% var(--paper-size);}
  :is(html[data-paper="engineering"] .paper:not([data-paper]), .paper[data-paper="engineering"]){background-image:var(--paper-extra, linear-gradient(transparent, transparent)), linear-gradient(var(--paper-major) 1px, transparent 1px), linear-gradient(90deg, var(--paper-major) 1px, transparent 1px), linear-gradient(var(--paper-line) 1px, transparent 1px), linear-gradient(90deg, var(--paper-line) 1px, transparent 1px); background-size:100% 100%, calc(var(--paper-size) * 5) calc(var(--paper-size) * 5), calc(var(--paper-size) * 5) calc(var(--paper-size) * 5), var(--paper-size) var(--paper-size), var(--paper-size) var(--paper-size);}
  :is(html[data-paper="mm"] .paper:not([data-paper]), .paper[data-paper="mm"]){background-image:var(--paper-extra, linear-gradient(transparent, transparent)), linear-gradient(var(--paper-major) 1px, transparent 1px), linear-gradient(90deg, var(--paper-major) 1px, transparent 1px), linear-gradient(var(--paper-line) 0.5px, transparent 0.5px), linear-gradient(90deg, var(--paper-line) 0.5px, transparent 0.5px); background-size:100% 100%, calc(var(--paper-size) * 2.5) calc(var(--paper-size) * 2.5), calc(var(--paper-size) * 2.5) calc(var(--paper-size) * 2.5), calc(var(--paper-size) / 4) calc(var(--paper-size) / 4), calc(var(--paper-size) / 4) calc(var(--paper-size) / 4);}
  :is(html[data-paper="iso"] .paper:not([data-paper]), .paper[data-paper="iso"]){background-image:var(--paper-extra, linear-gradient(transparent, transparent)), radial-gradient(circle at 1.5px 1.5px, var(--paper-major) 1.3px, transparent 1.8px), radial-gradient(circle at calc(var(--paper-size) / 2 + 1.5px) calc(var(--paper-size) * 0.866 + 1.5px), var(--paper-major) 1.3px, transparent 1.8px); background-size:100% 100%, var(--paper-size) calc(var(--paper-size) * 1.732), var(--paper-size) calc(var(--paper-size) * 1.732);}
  :is(html[data-paper="cornell"] .paper:not([data-paper]), .paper[data-paper="cornell"]){background-image:var(--paper-extra, linear-gradient(transparent, transparent)), linear-gradient(90deg, transparent 28%, var(--paper-accent) 28%, var(--paper-accent) calc(28% + 1.5px), transparent calc(28% + 1.5px)), linear-gradient(transparent calc(var(--paper-size) - 1px), var(--paper-line) calc(var(--paper-size) - 1px)); background-size:100% 100%, 100% 100%, 100% var(--paper-size);}
  :is(html[data-paper="music"] .paper:not([data-paper]), .paper[data-paper="music"]){background-image:var(--paper-extra, linear-gradient(transparent, transparent)), repeating-linear-gradient(to bottom, var(--paper-major) 0 1px, transparent 1px calc(var(--paper-size) / 3.5), var(--paper-major) calc(var(--paper-size) / 3.5) calc(var(--paper-size) / 3.5 + 1px), transparent calc(var(--paper-size) / 3.5 + 1px) calc(var(--paper-size) / 1.75), var(--paper-major) calc(var(--paper-size) / 1.75) calc(var(--paper-size) / 1.75 + 1px), transparent calc(var(--paper-size) / 1.75 + 1px) calc(var(--paper-size) * 0.857), var(--paper-major) calc(var(--paper-size) * 0.857) calc(var(--paper-size) * 0.857 + 1px), transparent calc(var(--paper-size) * 0.857 + 1px) calc(var(--paper-size) * 1.143), var(--paper-major) calc(var(--paper-size) * 1.143) calc(var(--paper-size) * 1.143 + 1px), transparent calc(var(--paper-size) * 1.143 + 1px) calc(var(--paper-size) * 2.5)); background-size:100% 100%, 100% calc(var(--paper-size) * 2.5);}
  /* не «как в теме» — у бумаги свой цвет, и текст на ней свой */
  html[data-paper-tone="light"] :is(#note-summary-view, .sketch-pages), .note-style-preview[data-tone="light"]{--text:#1c1c1e; --text-dim:#56565d; --text-faint:#8b8b92;}
  html[data-paper-tone="dark"] :is(#note-summary-view, .sketch-pages), .note-style-preview[data-tone="dark"]{--text:#f1f1f3; --text-dim:#a9a9b0; --text-faint:#77777e;}
  #note-canvas-editable, #detail-body, .note-style-preview-text{font-family:var(--note-font);}
  #note-canvas-editable{line-height:var(--paper-size) !important; font-size:calc(15px * var(--note-font-scale)) !important;}
  #detail-body{font-size:calc(.92rem * var(--note-font-scale));}
  .note-photo-embed.show{background:transparent;}

  /* бесконечный лист: страницы в стиле бумаги заметок */
  .sketch-page.sketch-blank{border-radius:4px; box-shadow:0 0 0 1px var(--panel-border), 0 4px 18px -10px rgba(0,0,0,.4);}
  .sketch-color-auto{background:linear-gradient(135deg, #1c1c1e 50%, #f4f5f7 50%) !important;}

  /* ---------- лист «Бумага и шрифт» ---------- */
  .note-style-overlay{z-index:220;}
  .note-style-sheet{max-height:88vh;}
  .note-style-preview{border-radius:16px; border:1px solid var(--panel-border); overflow:hidden; color:var(--text);}
  #note-style-preview{position:sticky; top:-24px; z-index:2; margin-bottom:4px; height:118px; box-shadow:0 8px 18px -12px rgba(0,0,0,.45);}
  .note-style-preview-text{padding:2px 14px; font-size:calc(15px * var(--note-font-scale)); line-height:var(--paper-size); color:var(--text);}
  #note-style-preview[data-paper="ruled"] .note-style-preview-text{padding-left:48px;}
  .ns-gallery{display:grid; grid-template-columns:repeat(3, 1fr); gap:10px;}
  @media (min-width: 600px){ .ns-gallery{grid-template-columns:repeat(5, 1fr);} }
  .ns-tile{display:flex; flex-direction:column; gap:6px; cursor:pointer; -webkit-tap-highlight-color:transparent;}
  .ns-tile-paper{position:relative; aspect-ratio:3 / 4; border-radius:12px; border:1.5px solid var(--panel-border); --paper-size:14px !important; display:flex; align-items:flex-end; padding:8px; transition:transform .12s;}
  .ns-tile:active .ns-tile-paper{transform:scale(.96);}
  .ns-tile.selected .ns-tile-paper{border-color:var(--accent-2); box-shadow:0 0 0 2px var(--accent-2);}
  .ns-tile-aa{font-size:1.15rem; font-weight:700; color:var(--text);}
  .ns-tile-name{font-size:.74rem; font-weight:700; text-align:center; color:var(--text-dim); line-height:1.2;}
  .ns-tile.selected .ns-tile-name{color:var(--text);}
  .ns-papers{display:flex; gap:8px; overflow-x:auto; padding-bottom:4px; scrollbar-width:none;}
  .ns-papers::-webkit-scrollbar{display:none;}
  .ns-paper-chip{flex:none; display:flex; flex-direction:column; align-items:center; gap:5px; width:66px; cursor:pointer; font-size:.7rem; font-weight:700; color:var(--text-dim); text-align:center;}
  .ns-paper-swatch{width:54px; height:54px; border-radius:12px; border:1.5px solid var(--panel-border);}
  .ns-paper-chip.selected{color:var(--text);}
  .ns-paper-chip.selected .ns-paper-swatch{border-color:var(--accent-2); box-shadow:0 0 0 2px var(--accent-2);}
  .ns-swatches{display:flex; flex-wrap:wrap; gap:10px;}
  .ns-swatch{width:32px; height:32px; border-radius:50%; cursor:pointer; border:1px solid var(--panel-border-strong); box-shadow:0 0 0 2px var(--bg), 0 0 0 3px transparent; transition:box-shadow .15s, transform .12s;}
  .ns-swatch.selected{box-shadow:0 0 0 2px var(--bg), 0 0 0 4px var(--text);}
  .ns-swatch.ns-auto{background:conic-gradient(var(--text) 0 25%, var(--bg) 0 50%, var(--text) 0 75%, var(--bg) 0);}
  .ns-bg-swatch{border-radius:10px;}
  .ns-fonts{display:grid; grid-template-columns:repeat(5, 1fr); gap:8px;}
  .ns-font{display:flex; flex-direction:column; align-items:center; gap:4px; padding:10px 4px; border-radius:14px; background:var(--panel-bg); border:1.5px solid var(--panel-border); cursor:pointer; text-align:center;}
  .ns-font b{font-size:1.3rem; line-height:1.1;}
  .ns-font span{font-size:.64rem; font-weight:700; color:var(--text-dim); line-height:1.15;}
  .ns-font.selected{border-color:var(--accent-2); background:color-mix(in srgb, var(--accent-2) 12%, var(--panel-bg));}

  /* рисование — только на iPad (класс is-ipad ставит app.js) */
  html:not(.is-ipad) .ipad-only{display:none !important;}

  /* тест: выбор уровня; карточки: уровень; карта понятий; аудио-пересказ */
  .study-level{display:flex; flex-direction:column; gap:4px; padding:16px; margin-bottom:10px; border-radius:18px; cursor:pointer;
    background:var(--panel-bg); border:1.5px solid var(--panel-border); transition:transform .12s;}
  .study-level:active{transform:scale(.98);}
  .study-level b{font-family:'Unbounded'; font-size:.95rem;}
  .study-level span{font-size:.82rem; color:var(--text-dim); line-height:1.4;}
  .study-level[data-kind="quiz_exam"]{border-color:color-mix(in srgb, var(--accent-pink) 45%, var(--panel-border));}
  .flashcard-level{position:absolute; top:16px; right:18px; display:flex; gap:3px;}
  .flashcard-level i{width:6px; height:6px; border-radius:50%; background:var(--panel-border-strong);}
  .flashcard-level i.on{background:#4cd07d;}
  .flashcard-label{max-width:65%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
  .study-mindmap{overflow:auto; -webkit-overflow-scrolling:touch; border-radius:16px; background:var(--panel-bg); border:1px solid var(--panel-border); padding:10px; min-height:220px;}
  .study-mindmap pre.mermaid{margin:0; background:none; display:flex; justify-content:center; min-width:min-content;}
  .study-mindmap svg{max-width:none !important; height:auto;}
  .podcast-player{display:flex; flex-direction:column; align-items:center; gap:10px; padding:14px; border-radius:18px; background:var(--panel-bg); border:1px solid var(--panel-border); min-height:60px; justify-content:center;}
  .podcast-player audio{width:100%;}
  .podcast-speed{display:flex; gap:6px;}
  .podcast-speed span{padding:6px 12px; border-radius:12px; background:var(--panel-bg-strong); font-size:.78rem; font-weight:700; cursor:pointer;}
  .podcast-speed span.selected{background:var(--accent-2-dark); color:var(--btn-text);}
  .podcast-script{margin-top:12px; display:flex; flex-direction:column; gap:8px; max-height:40vh; overflow-y:auto;}
  .podcast-line{display:flex; flex-direction:column; gap:2px; padding:9px 12px; border-radius:14px; background:var(--panel-bg); font-size:.86rem; line-height:1.45; max-width:90%;}
  .podcast-line b{font-size:.72rem; color:var(--accent-3);}
  .podcast-line.b{align-self:flex-end; background:color-mix(in srgb, var(--accent-2) 12%, var(--panel-bg));}
  .podcast-line.b b{color:var(--accent-2-dark);}

  /* шпаргалка по папке */
  .folder-guide{display:flex; align-items:center; gap:12px; margin:4px 0 16px; padding:12px 14px; border-radius:18px; cursor:pointer;
    background:color-mix(in srgb, var(--accent-3) 14%, var(--panel-bg)); border:1px solid color-mix(in srgb, var(--accent-3) 34%, var(--panel-border));
    transition:transform .12s;}
  .folder-guide:active{transform:scale(.98);}
  .folder-guide.loading{opacity:.6; pointer-events:none; animation:cmPulse 1.2s ease-in-out infinite;}
  .folder-guide-icon{width:36px; height:36px; border-radius:50%; flex:none; display:flex; align-items:center; justify-content:center; color:#fff;
    background:linear-gradient(135deg, var(--accent-2), var(--accent-3) 60%, var(--accent-pink));}
  .folder-guide-icon svg{width:17px; height:17px; fill:currentColor;}
  .folder-guide b{display:block; font-size:.92rem;}
  .folder-guide span{font-size:.76rem; color:var(--text-dim); line-height:1.35;}

  /* ---------- «Все функции» ---------- */
  .drawer-item-fx svg{color:var(--accent-3);}
  .drawer-fx-count{margin-left:auto; min-width:24px; padding:2px 8px; border-radius:10px; text-align:center;
    background:color-mix(in srgb, var(--accent-3) 18%, transparent); color:var(--accent-3); font-size:.74rem; font-weight:800;}
  .fx-sheet{max-height:88vh;}
  .fx-search{margin:0 0 4px;}
  .fx-group{border-radius:18px; overflow:hidden; background:var(--panel-bg); border:1px solid var(--panel-border);}
  .fx-row{display:flex; align-items:center; gap:12px; padding:11px 12px; cursor:pointer; border-top:1px solid var(--panel-border); -webkit-tap-highlight-color:transparent;}
  .fx-row:first-child{border-top:none;}
  .fx-row:active{background:var(--panel-bg-strong);}
  .fx-icon{width:36px; height:36px; border-radius:11px; flex:none; display:flex; align-items:center; justify-content:center;
    background:color-mix(in srgb, var(--wc, var(--text-dim)) 22%, transparent); color:var(--wc, var(--text-dim));}
  .w-c-gray{--wc:var(--text-dim);}
  .fx-icon svg{width:19px; height:19px; stroke:currentColor; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round;}
  .fx-text{flex:1; min-width:0; display:flex; flex-direction:column;}
  .fx-text b{font-size:.92rem;}
  .fx-text span{font-size:.75rem; font-weight:600; color:var(--text-dim); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .fx-chevron{width:16px; height:16px; flex:none; stroke:var(--text-faint); fill:none; stroke-width:2.4; stroke-linecap:round; stroke-linejoin:round;}
  /* выбор заметки поверх каталога */
  #side-pick-overlay{z-index:95;}

  /* рисование: новые инструменты (Notability) */
  .sketch-tool-row:first-child{overflow-x:auto; justify-content:safe center; scrollbar-width:none;}
  .sketch-tool-row:first-child::-webkit-scrollbar{display:none;}
  .sketch-tool{flex:none;}
  .sketch-tool[data-tool="eraser"].whole{position:relative;}
  .sketch-tool[data-tool="eraser"].whole::after{content:"целиком"; position:absolute; bottom:-14px; left:50%; transform:translateX(-50%); font-size:.56rem; font-weight:800; color:var(--accent-2); white-space:nowrap;}
  .sketch-color-custom{position:relative; overflow:hidden; background:conic-gradient(#ff3b30, #ffcc00, #34c759, #0a84ff, #af52de, #ff3b30);}
  .sketch-color-custom input{position:absolute; inset:0; opacity:0; width:100%; height:100%; cursor:pointer;}
  .sketch-text-input{
    position:absolute; z-index:3; min-width:120px; max-width:80%; padding:0; margin:0; border:1.5px dashed var(--accent-2); border-radius:4px;
    background:transparent; font-family:-apple-system, system-ui, sans-serif; font-weight:600; line-height:1.25; resize:none; outline:none; overflow:hidden;
  }

  /* «В папку» */
  .folder-move-row.current b{color:var(--accent-2-dark);}
  .folder-move-new{margin-top:14px;}
  .folder-move-new .tempchat-cta{margin-top:10px;}
  .folder-move-out{display:block; width:100%; margin-top:8px; text-align:center; box-sizing:border-box;}

  /* ---------- Режим презентации ---------- */
  .present-screen{position:fixed; inset:0; z-index:230; background:var(--bg); display:none; flex-direction:column;
    padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom);}
  .present-screen.open{display:flex;}
  .present-top{display:flex; align-items:center; gap:8px; padding:10px 16px;}
  .present-title{flex:1; min-width:0; font-family:'Unbounded'; font-weight:700; font-size:.95rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .present-zoom{padding:8px 12px; border-radius:14px; background:var(--panel-bg-strong); font-weight:800; font-size:.85rem; cursor:pointer;}
  .present-scroll{flex:1; min-height:0; overflow-y:auto; -webkit-overflow-scrolling:touch; touch-action:pan-y;}
  .present-body{max-width:900px; margin:0 auto; padding:12px 28px 80px; line-height:1.55;}
  .present-body img{max-width:100%;}
  .present-laser{position:fixed; inset:0; width:100%; height:100%; pointer-events:none; z-index:2;}
  .present-hint{position:fixed; left:50%; bottom:calc(20px + env(safe-area-inset-bottom)); transform:translateX(-50%); z-index:3;
    padding:9px 16px; border-radius:16px; background:var(--panel-bg-strong); font-size:.8rem; font-weight:700; color:var(--text-dim);
    opacity:0; transition:opacity .4s; pointer-events:none; white-space:nowrap;}
  .present-hint.show{opacity:1;}


  /* ==========================================================================
     ОФОРМЛЕНИЕ «КАК В NOTABILITY» — включается переключателем
     («Все функции» → «Оформление как в Notability»), html[data-look="notability"].
     Без переключателя ничего из этого блока не действует: обычный вид
     Vouz Ai остаётся как был.
     ========================================================================== */
  :root[data-look="notability"], :root[data-look="notability"][data-theme="light"]{
    --bg:#f2f2f7; --bg-2:#ececf1; --panel-bg:#ffffff; --panel-bg-strong:#efeff4; --pill-bg:#efeff4;
    --panel-border:rgba(60,60,67,0.12); --panel-border-strong:rgba(60,60,67,0.2);
    --text:#1c1c1e; --text-dim:#6e6e73; --text-faint:#aeaeb2;
    --accent:#2b6ff2; --accent-2:#2b6ff2; --accent-2-dark:#225fd6; --accent-3:#2b6ff2; --accent-pink:#2b6ff2; --accent-yellow:#c49a1a; --danger:#ff3b30; --ai:#2b6ff2;
    --cat-1:#2b6ff2; --cat-2:#a8823f; --cat-3:#7b68b8; --cat-4:#3f8f72; --cat-5:#b0606c; --cat-6:#5f7387;
    --ev-green:#34c759; --ev-cyan:#32ade6; --ev-pink:#ff2d55; --ev-purple:#af52de; --ev-blue:#2b6ff2;
    --shadow:0 1px 2px rgba(0,0,0,0.04), 0 8px 24px -12px rgba(0,0,0,0.12);
    --btn-text:#ffffff; --grid-line:rgba(60,80,120,0.12);
    --font-display:-apple-system, "SF Pro Display", system-ui, "Segoe UI", Roboto, sans-serif; --radius-card:16px;
    color-scheme:light;
  }
  :root[data-look="notability"][data-theme="dark"]{
    --bg:#000000; --bg-2:#0c0c0e; --panel-bg:#1c1c1e; --panel-bg-strong:#2c2c2e; --pill-bg:#2c2c2e;
    --panel-border:rgba(255,255,255,0.08); --panel-border-strong:rgba(255,255,255,0.15);
    --text:#f2f2f7; --text-dim:#98989f; --text-faint:#636366;
    --accent:#4b8bff; --accent-2:#4b8bff; --accent-2-dark:#3a7af0; --accent-3:#4b8bff; --accent-pink:#4b8bff; --accent-yellow:#d6b24a; --danger:#ff453a; --ai:#4b8bff;
    --cat-1:#4b8bff; --cat-2:#c9a46b; --cat-3:#a593d8; --cat-4:#6fb59a; --cat-5:#d08a95; --cat-6:#8fa3b8;
    --ev-green:#30d158; --ev-cyan:#64d2ff; --ev-pink:#ff375f; --ev-purple:#bf5af2; --ev-blue:#4b8bff;
    --shadow:0 10px 28px -14px rgba(0,0,0,0.7);
    --btn-text:#ffffff; --grid-line:rgba(255,255,255,0.07);
    --font-display:-apple-system, "SF Pro Display", system-ui, "Segoe UI", Roboto, sans-serif; --radius-card:16px;
    color-scheme:dark;
  }
  /* системный шрифт везде, кроме названия «Vouz Ai», формул и кода */
  :root[data-look="notability"] body *:not(.katex):not(.katex *):not(code):not(pre):not(.header-title h1):not(.drawer-header h3):not(.app-login h2):not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *):not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player)){
    font-family:-apple-system, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif !important; }
  :root[data-look="notability"] h1:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *), :root[data-look="notability"] h2:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *), :root[data-look="notability"] h3:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){letter-spacing:-0.015em;}
  :root[data-look="notability"] body{background:var(--bg); -webkit-font-smoothing:antialiased;}
  :root[data-look="notability"] .glass:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){background:var(--panel-bg); border:1px solid var(--panel-border); border-radius:var(--radius-card);
    backdrop-filter:none; -webkit-backdrop-filter:none; box-shadow:var(--shadow);}
  :root[data-look="notability"] .glass:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *)::before{display:none !important;}
  :root[data-look="notability"] .tabbar:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *), :root[data-look="notability"] .tabbar-search:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *), :root[data-look="notability"] .tabbar-collapse-add:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *), :root[data-look="notability"] .tabbar-collapse-btn:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){background-color:color-mix(in srgb, var(--panel-bg) 88%, transparent) !important;
    backdrop-filter:blur(20px) saturate(1.4) !important; -webkit-backdrop-filter:blur(20px) saturate(1.4) !important;
    border:1px solid var(--panel-border) !important;
    box-shadow:0 1px 2px rgba(0,0,0,.05), 0 10px 30px -12px rgba(0,0,0,.22) !important;}
  :root[data-look="notability"] .tab-indicator:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){background:color-mix(in srgb, var(--accent-2) 12%, transparent) !important; box-shadow:none !important; border:none !important;}
  :root[data-look="notability"] .tab.active:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *), :root[data-look="notability"] .tab.active span:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){color:var(--accent-2) !important;}
  :root[data-look="notability"] .tab-agent-glow:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){display:none;}
  :root[data-look="notability"] .tab-agent-btn svg:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){fill:currentColor !important; stroke:none !important; filter:none !important; animation:none !important; width:22px; height:22px;}
  :root[data-look="notability"] .tab-agent:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){color:var(--text-dim);}
  :root[data-look="notability"] .home-agent-quick:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){background:var(--panel-bg); border:1px solid var(--panel-border); box-shadow:var(--shadow);}
  :root[data-look="notability"] .home-agent-quick:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *)::after, :root[data-look="notability"] .home-agent-beam:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){display:none !important;}
  :root[data-look="notability"] .home-agent-quick:focus-within:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){border-color:var(--accent-2); box-shadow:0 0 0 3px color-mix(in srgb, var(--accent-2) 18%, transparent);}
  :root[data-look="notability"] .agent-pill:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *)::after{display:none !important;}
  :root[data-look="notability"] .home-action-card:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){border-radius:var(--radius-card); padding:20px 10px;}
  :root[data-look="notability"] .home-action-record:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){background:var(--accent-2) !important; border-color:transparent !important;}
  :root[data-look="notability"] .home-action-record .home-action-icon:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){background:rgba(255,255,255,.18) !important; color:#fff !important;}
  :root[data-look="notability"] .home-action-record .home-action-label:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){color:#fff;}
  :root[data-look="notability"] .home-action-import:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){background:var(--panel-bg) !important; border-color:var(--panel-border) !important;}
  :root[data-look="notability"] .home-action-import .home-action-icon:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){background:color-mix(in srgb, var(--accent-2) 12%, transparent) !important; color:var(--accent-2) !important;}
  :root[data-look="notability"] .home-action-label:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){font-weight:650; font-size:.92rem;}
  :root[data-look="notability"] .home-w-small[class*="w-c-"]:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){background:var(--panel-bg) !important; border-color:var(--panel-border) !important;}
  :root[data-look="notability"] .home-w[class*="w-c-"] .home-w-icon:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *), :root[data-look="notability"] .home-w-schedule .home-w-icon:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *), :root[data-look="notability"] .home-w-deadlines .home-w-icon:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){background:color-mix(in srgb, var(--accent-2) 11%, transparent) !important; color:var(--accent-2) !important;}
  :root[data-look="notability"] .home-w-value:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){font-weight:700; letter-spacing:-0.02em;}
  :root[data-look="notability"] .home-w-hw.has:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){background:color-mix(in srgb, var(--accent-2) 14%, transparent); color:var(--accent-2);}
  :root[data-look="notability"] .note-toolbar-ask:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *), :root[data-look="notability"] .live-ask-spark:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *), :root[data-look="notability"] .folder-guide-icon:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){background:var(--accent-2) !important;}
  :root[data-look="notability"] .folder-guide:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){background:var(--panel-bg) !important; border-color:var(--panel-border) !important;}
  :root[data-look="notability"] .layout-ask:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){background:var(--panel-bg) !important; border-color:var(--panel-border) !important;}
  :root[data-look="notability"] .home-hero:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){padding:6px 4px 18px; text-align:left;}
  :root[data-look="notability"] .home-hello:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){font-size:.92rem; font-weight:600; color:var(--text-dim);}
  :root[data-look="notability"] .home-date:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){margin-top:2px; font-size:1.65rem; font-weight:750; letter-spacing:-0.025em; line-height:1.15;}
  :root[data-look="notability"] .home-sum:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){display:flex; flex-wrap:wrap; gap:6px; margin-top:12px;}
  :root[data-look="notability"] .home-sum:empty:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){display:none;}
  :root[data-look="notability"] .home-sum-chip:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){padding:6px 12px; border-radius:999px; font-size:.82rem; font-weight:600; cursor:pointer;
    background:var(--panel-bg); border:1px solid var(--panel-border); color:var(--text);}
  :root[data-look="notability"] .home-sum-chip:active:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){background:var(--panel-bg-strong);}
  :root[data-look="notability"] .home-sum-chip.warn:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){color:var(--danger); border-color:color-mix(in srgb, var(--danger) 35%, var(--panel-border));}
  :root[data-look="notability"][data-theme="dark"] .home-action-record:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){background:#4a6cf0 !important;}
  :root[data-look="notability"] .agent-round-btn:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){background:var(--panel-bg); border:1px solid var(--panel-border); box-shadow:0 1px 2px rgba(0,0,0,.05);
    backdrop-filter:none; -webkit-backdrop-filter:none;}
  :root[data-look="notability"] .schedule-screen:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *), :root[data-look="notability"][data-theme="light"] .schedule-screen:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){--sch-bg:var(--bg); --sch-card:var(--panel-bg); --sch-card-border:var(--panel-border); --sch-shadow:var(--shadow);
    background:var(--bg);}
  :root[data-look="notability"] :is(#panel-deadlines, #dl-window):not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *), :root[data-look="notability"][data-theme="light"] :is(#panel-deadlines, #dl-window):not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){--sch-card:var(--panel-bg); --sch-card-2:var(--panel-bg); --sch-card-border:var(--panel-border); --sch-shadow:var(--shadow);}
  :root[data-look="notability"] :is(#panel-deadlines, #dl-window) .cal-month-grid:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *), :root[data-look="notability"] :is(#panel-deadlines, #dl-window) .cal-month-row:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){gap:0;}
  :root[data-look="notability"] :is(#panel-deadlines, #dl-window) .cal-cell:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *), :root[data-look="notability"] :is(#panel-deadlines, #dl-window) .cal-cell.dim:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){background:none; border-radius:0; min-height:84px; border-top:1px solid var(--panel-border);}
  :root[data-look="notability"] :is(#panel-deadlines, #dl-window) .cal-cell.dim .cal-cell-num:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){opacity:.45;}
  :root[data-look="notability"] :is(#panel-deadlines, #dl-window) .cal-cell.today:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){background:none; box-shadow:none;}
  :root[data-look="notability"] :is(#panel-deadlines, #dl-window) .cal-cell.today .cal-cell-num:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){background:var(--accent-2); color:#fff;}
  :root[data-look="notability"] :is(#panel-deadlines, #dl-window) .cal-cell-num:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){font-weight:600;}
  :root[data-look="notability"] :is(#panel-deadlines, #dl-window) .cal-month-dow-row span:nth-child(n+6):not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){color:var(--text-faint);}
  :root[data-look="notability"] :is(#panel-deadlines, #dl-window) .cal-month-row .cal-bar:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){clip-path:inset(0 2px round 5px);}
  :root[data-look="notability"][data-theme="dark"] .home-action-record:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){background:#4a6cf0 !important;}
  :root[data-look="notability"] .agent-round-btn:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){background:var(--panel-bg); border:1px solid var(--panel-border); box-shadow:0 1px 2px rgba(0,0,0,.05);
    backdrop-filter:none; -webkit-backdrop-filter:none;}
  :root[data-look="notability"] .ai-note-card .ai-note-card-icon:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *), :root[data-look="notability"] .fx-icon:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *), :root[data-look="notability"] .wg-icon:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *), :root[data-look="notability"] .cm-card-icon:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *), :root[data-look="notability"] .home-w-icon:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *), :root[data-look="notability"] .schedule-empty-icon:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){background:color-mix(in srgb, var(--accent-2) 11%, transparent) !important; color:var(--accent-2) !important;}
  :root[data-look="notability"] .fx-row:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *), :root[data-look="notability"] .wg-row:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){--wc:var(--accent-2);}
  :root[data-look="notability"] .ai-note-card:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){background:var(--panel-bg); border:1px solid var(--panel-border); box-shadow:none;}
  :root[data-look="notability"] .flashcard-front:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *), :root[data-look="notability"] .flashcard-back:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){background:var(--panel-bg);}
  :root[data-look="notability"] .flashcard-back:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){box-shadow:inset 0 3px 0 var(--accent-2);}
  :root[data-look="notability"] .home-w-continue:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){display:flex; align-items:center; gap:12px; padding:12px 14px; cursor:pointer;}
  :root[data-look="notability"] .home-w-continue .home-w-icon:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){width:40px; height:40px;}
  :root[data-look="notability"] .home-w-continue .home-w-main span:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){color:var(--text-dim);}
  :root[data-look="notability"] .home-w-continue .home-w-cta:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){flex:none; padding:7px 12px; border-radius:12px; background:var(--accent-2); color:#fff; font-size:.8rem; font-weight:650;}
  :root[data-look="notability"] .cm-card-text span:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  :root[data-look="notability"] .cm-card .cm-chip:not(:is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player) *){padding:7px 10px;}

  /* заметки — без изменений: внутри экранов заметок обычные цвета и шрифт Vouz Ai */
  :root[data-look="notability"][data-theme="light"] :is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player){
    --bg:#ffffff; --bg-2:#f7f7f8;
    --panel-bg:#f2f2f4; --panel-bg-strong:#e7e7ea;
    --pill-bg:#e6e6ea;
    --panel-border:rgba(0,0,0,0.08); --panel-border-strong:rgba(0,0,0,0.15);
    --text:#0e0e10; --text-dim:#68686f; --text-faint:#9a9aa1;
    --accent:#dd7f28; --accent-2:#0a84ff; --accent-2-dark:#0a75e0; --accent-3:#7a4fe0;
    --accent-pink:#e0397e; --accent-yellow:#c99400; --danger:#e0453c;
    --ai:#5b56f0;
    --cat-1:#0a84ff; --cat-2:#dd7f28; --cat-3:#7a4fe0; --cat-4:#199468; --cat-5:#e0397e; --cat-6:#c99400;
    --ev-green:#52e6a0; --ev-cyan:#37c9ff; --ev-pink:#ff5fc9; --ev-purple:#9d6bff; --ev-blue:#2f5fdb;
    --shadow:0 10px 26px -16px rgba(0,0,0,0.14);
    --btn-text:#ffffff;
    --grid-line:rgba(72,104,140,0.24);
    color-scheme:light;
  }
  :root[data-look="notability"][data-theme="dark"] :is(#panel-notes, #panel-notes-all, #panel-note-folder, #panel-note-detail, #note-toolbar-float, #note-detail-topbar, #note-format-toolbar, #note-format-expand-panel, #note-audio-player){
    --bg:#000000; --bg-2:#0d0d0f;
    --panel-bg:#161618; --panel-bg-strong:#212124;
    --pill-bg:#18181b;
    --panel-border:rgba(255,255,255,0.1); --panel-border-strong:rgba(255,255,255,0.19);
    --text:#f4f5f7; --text-dim:#9b9ba3; --text-faint:#6e6e75;
    --accent:#ff9d4d; --accent-2:#3ec2ff; --accent-2-dark:#2ba3dd; --accent-3:#a06bff;
    --accent-pink:#ff5fa2; --accent-yellow:#ffd23f; --danger:#ff5c5c;
    --ai:#6f6bff;
    --cat-1:#3ec2ff; --cat-2:#ff9d4d; --cat-3:#a06bff; --cat-4:#2fd4a0; --cat-5:#ff5fa2; --cat-6:#ffd23f;
    --ev-green:#52e6a0; --ev-cyan:#37c9ff; --ev-pink:#ff5fc9; --ev-purple:#9d6bff; --ev-blue:#2f5fdb;
    --shadow:0 14px 32px -18px rgba(0,0,0,0.5);
    --btn-text:#0a0a10;
    --grid-line:rgba(72,92,114,0.26);
    color-scheme:dark;
  }
  :root[data-look="notability"][data-theme="light"]:has(#panel-notes.active, #panel-notes-all.active, #panel-note-folder.active, #panel-note-detail.active) body{background:#ffffff;}
  :root[data-look="notability"][data-theme="dark"]:has(#panel-notes.active, #panel-notes-all.active, #panel-note-folder.active, #panel-note-detail.active) body{background:#000000;}

  /* ---------- Главная «как в Notability» (только с переключателем) ---------- */
  .home-nb, .home-nb-title{display:none;}
  :root[data-look="notability"] .home-nb-title{display:block; font-size:2.05rem; font-weight:750; letter-spacing:-0.025em; margin:2px 2px 12px; text-align:left;}
  :root[data-look="notability"] .home-hero{display:none;}
  :root[data-look="notability"] .home-widgets{display:none !important;}
  /* поле ИИ — как поле поиска iOS */
  :root[data-look="notability"] .home-agent-quick{
    background:var(--panel-bg-strong) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4.3-4.3'/%3E%3C/svg%3E") no-repeat 12px center / 18px;
    border:none !important; box-shadow:none !important; border-radius:12px !important; padding:3px 4px 3px 38px; margin-bottom:14px;
  }
  :root[data-look="notability"] #home-agent-quick{background-color:var(--panel-bg-strong) !important; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4.3-4.3'/%3E%3C/svg%3E") !important; background-repeat:no-repeat !important; background-position:12px center !important; background-size:18px !important;}
  :root[data-look="notability"] .home-action-label{white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  :root[data-look="notability"] .home-agent-quick:focus-within{box-shadow:0 0 0 3px color-mix(in srgb, var(--accent-2) 22%, transparent) !important;}
  :root[data-look="notability"] .home-agent-input{font-size:1rem; padding:8px 0;}
  :root[data-look="notability"] .home-agent-expand, :root[data-look="notability"] .home-agent-send{width:32px; height:32px;}
  /* «Записать» / «Импорт» — компактные кнопки в ряд, как «Новая заметка» в Notability */
  :root[data-look="notability"] .home-actions-row{gap:10px; margin:0 0 22px;}
  :root[data-look="notability"] .home-action-card{flex-direction:row; justify-content:center; gap:8px; padding:12px 10px !important; border-radius:12px !important; box-shadow:none !important;}
  :root[data-look="notability"] .home-action-card .home-action-icon{width:26px; height:26px; background:none !important;}
  :root[data-look="notability"] .home-action-card .home-action-icon svg{width:20px; height:20px;}
  :root[data-look="notability"] .home-action-label{font-size:.95rem; font-weight:650;}
  :root[data-look="notability"] .home-action-label br{display:none;}
  :root[data-look="notability"] .home-action-import{border:1px solid var(--panel-border) !important;}
  /* недавние — сетка листов */
  :root[data-look="notability"] .home-nb{display:block; padding-bottom:20px;}
  .home-nb-head{display:flex; align-items:baseline; justify-content:space-between; margin:6px 2px 12px;}
  .home-nb-head h3{font-size:1.3rem; font-weight:750; letter-spacing:-0.02em;}
  .home-nb-all{font-size:.95rem; font-weight:600; color:var(--accent-2); cursor:pointer;}
  .home-nb-grid{display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:16px 14px; margin-bottom:24px;}
  @media (min-width: 600px){ .home-nb-grid{grid-template-columns:repeat(3, minmax(0, 1fr));} }
  .home-nb-grid .note-carousel-card{width:auto; border-radius:12px;}
  .home-nb-grid .note-carousel-card .note-thumb{height:auto; aspect-ratio:3 / 4;}
  .home-nb-empty{grid-column:1 / -1; padding:18px; border-radius:12px; background:var(--panel-bg); color:var(--text-dim); font-size:.9rem;}
  /* папки — сгруппированный список iOS */
  .home-nb-folders{border-radius:12px; overflow:hidden; background:var(--panel-bg); border:1px solid var(--panel-border);}
  .home-nb-folder{display:flex; align-items:center; gap:12px; padding:12px 14px; cursor:pointer; border-top:1px solid var(--panel-border);}
  .home-nb-folder:first-child{border-top:none;}
  .home-nb-folder:active{background:var(--panel-bg-strong);}
  .home-nb-folder-icon{width:30px; height:30px; border-radius:8px; flex:none; display:flex; align-items:center; justify-content:center; background:color-mix(in srgb, var(--fc) 18%, transparent); color:var(--fc);}
  .home-nb-folder-icon svg{width:18px; height:18px; fill:currentColor; stroke:none;}
  .home-nb-folder-name{flex:1; min-width:0; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .home-nb-folder b{font-weight:600; color:var(--text-faint);}
  .home-nb-chev{width:16px; height:16px; stroke:var(--text-faint); fill:none; stroke-width:2.4; stroke-linecap:round; stroke-linejoin:round; flex:none;}
  .hal-short{display:none;}
  :root[data-look="notability"] .home-action-label .hal-full{display:none;}
  :root[data-look="notability"] .home-action-label .hal-short{display:inline;}

  /* ---------- виджеты: ярче и живее ---------- */
  /* маленькие — насыщенный градиент цвета виджета, белый текст, большая иконка-водяной знак */
  .home-w-small{position:relative; border:none !important; box-shadow:0 14px 30px -18px var(--wg-shadow, rgba(0,0,0,.5));}
  .home-w-small.w-c-blue{background:linear-gradient(150deg, #58c8ff 0%, #2f7dff 100%) !important; --wg-shadow:rgba(47,125,255,.6);}
  .home-w-small.w-c-orange{background:linear-gradient(150deg, #ffb35c 0%, #ff6a3d 100%) !important; --wg-shadow:rgba(255,106,61,.6);}
  .home-w-small.w-c-yellow{background:linear-gradient(150deg, #ffe066 0%, #ffb020 100%) !important; --wg-shadow:rgba(255,176,32,.55);}
  .home-w-small.w-c-purple{background:linear-gradient(150deg, #b58cff 0%, #6a4dff 100%) !important; --wg-shadow:rgba(106,77,255,.6);}
  .home-w-small.w-c-pink{background:linear-gradient(150deg, #ff8cc0 0%, #ff4d7d 100%) !important; --wg-shadow:rgba(255,77,125,.6);}
  .home-w-small.w-c-green{background:linear-gradient(150deg, #6ee39b 0%, #1fae74 100%) !important; --wg-shadow:rgba(31,174,116,.55);}
  .home-w-small .home-w-value, .home-w-small .home-w-label{color:#fff;}
  .home-w-small .home-w-sub{color:rgba(255,255,255,.82);}
  .home-w-small.w-c-yellow .home-w-value, .home-w-small.w-c-yellow .home-w-label{color:#3a2600;}
  .home-w-small.w-c-yellow .home-w-sub{color:rgba(58,38,0,.72);}
  .home-w-small .home-w-icon{background:rgba(255,255,255,.24) !important; color:#fff !important;}
  .home-w-small.w-c-yellow .home-w-icon{background:rgba(58,38,0,.12) !important; color:#3a2600 !important;}
  .home-w-small .home-w-value{font-size:1.32rem;}
  .home-w-deco{position:absolute; right:-14px; bottom:-14px; width:96px; height:96px; stroke:#fff; fill:none; stroke-width:1.4; stroke-linecap:round; stroke-linejoin:round; opacity:.16; pointer-events:none;}
  .home-w-small.w-c-yellow .home-w-deco{stroke:#3a2600; opacity:.1;}
  .home-w-small > *:not(.home-w-deco){position:relative; z-index:1;}
  /* широкие: цветная иконка заголовка и мягкая подсветка цветом виджета */
  .home-w-schedule{background:linear-gradient(180deg, color-mix(in srgb, var(--accent-2) 10%, var(--pill-bg)) 0%, var(--pill-bg) 55%) !important;}
  .home-w-deadlines{background:linear-gradient(180deg, color-mix(in srgb, var(--accent) 10%, var(--pill-bg)) 0%, var(--pill-bg) 55%) !important;}
  .home-w-notes{background:linear-gradient(180deg, color-mix(in srgb, var(--accent-3) 10%, var(--pill-bg)) 0%, var(--pill-bg) 55%) !important;}
  .home-w-notes .home-w-icon{background:color-mix(in srgb, var(--accent-3) 26%, transparent); color:var(--accent-3);}
  .home-w-titles b{font-size:.95rem;}
  /* «Последние заметки» — лента листов как «Недавние конспекты» */
  .home-w-notes .home-w-body{margin:4px -14px 0; padding:2px 14px 8px;}
  .home-w-notes-strip{margin:0; padding:4px 0 6px;}
  /* в оформлении «как в Notability» виджеты скрыты — правила выше на него не влияют */
  .home-w-small .home-w-value.long{font-size:1.02rem; white-space:normal; line-height:1.15;}

  /* виджеты-ленты (Избранное, Общие, Без папки) и папки */
  .home-w-strip.w-c-yellow{background:linear-gradient(180deg, color-mix(in srgb, var(--accent-yellow) 12%, var(--pill-bg)) 0%, var(--pill-bg) 55%) !important;}
  .home-w-strip.w-c-blue{background:linear-gradient(180deg, color-mix(in srgb, var(--accent-2) 10%, var(--pill-bg)) 0%, var(--pill-bg) 55%) !important;}
  .home-w-strip.w-c-purple{background:linear-gradient(180deg, color-mix(in srgb, var(--accent-3) 10%, var(--pill-bg)) 0%, var(--pill-bg) 55%) !important;}
  .home-w-strip.w-c-orange{background:linear-gradient(180deg, color-mix(in srgb, var(--accent) 10%, var(--pill-bg)) 0%, var(--pill-bg) 55%) !important;}
  .home-w-strip .home-w-body{margin:4px -14px 0; padding:2px 14px 8px;}
  .home-w-strip.w-c-yellow .home-w-icon{background:color-mix(in srgb, var(--accent-yellow) 30%, transparent); color:var(--accent-yellow);}
  .home-w-strip.w-c-blue .home-w-icon{background:color-mix(in srgb, var(--accent-2) 26%, transparent); color:var(--accent-2);}
  .home-w-strip.w-c-purple .home-w-icon{background:color-mix(in srgb, var(--accent-3) 26%, transparent); color:var(--accent-3);}
  .home-w-strip.w-c-orange .home-w-icon{background:color-mix(in srgb, var(--accent) 26%, transparent); color:var(--accent);}
  .home-w-strip .home-w-empty{border-top:none; padding:6px 2px 10px;}
  .home-w-folder-icon{width:32px; height:32px; border-radius:10px; flex:none; display:flex; align-items:center; justify-content:center;
    background:color-mix(in srgb, var(--fc) 22%, transparent); color:var(--fc);}
  .home-w-folder-icon svg{width:18px; height:18px; fill:currentColor; stroke:none;}

  /* ---------- Дедлайны ⇅ Расписание ----------
     ⇅ next to the calendar filter swaps the tab: the nearest deadline goes up
     into the small card (tap → calendar + «Ближайшее» as a full-screen window),
     the timetable takes the calendar's place, inline. */
  #cal-drawer-wrap{display:flex; align-items:center; gap:6px;}
  .cal-swap-btn{width:34px; height:34px; background:var(--sch-card-2, var(--panel-bg-strong)); border:1px solid var(--sch-card-border, var(--panel-border)); box-shadow:var(--sch-shadow, none); color:var(--text);}
  .cal-swap-btn svg{width:18px; height:18px; transition:transform .4s cubic-bezier(.2,.8,.2,1);}
  .cal-swap-btn:active{transform:scale(.9);}
  #panel-deadlines.dl-swapped .cal-swap-btn svg{transform:rotate(180deg);}
  :is(#panel-deadlines, #dl-window) .cal-month-nav, :is(#panel-deadlines, #dl-window) .week-nav{gap:6px;}
  #panel-deadlines #cal-month-card .cal-month-label{white-space:nowrap; min-width:0; overflow:hidden; text-overflow:ellipsis;}

  .cal-dl-card .cal-sched-icon{color:var(--accent-pink, var(--accent-2-dark));}
  .cal-dl-card[data-state="overdue"] .cal-sched-eyebrow{color:var(--danger);}

  /* calendar window: hidden in the swapped tab until the card is tapped */
  .dl-window-top{display:none;}
  #panel-deadlines.dl-swapped > #dl-window{display:none;}
  .dl-window.open{
    display:block; position:fixed; inset:0; z-index:80; overflow-y:auto; overscroll-behavior:contain;
    max-width:none; margin:0;
    background:radial-gradient(120% 60% at 50% 0%, color-mix(in srgb, var(--accent-2) 9%, transparent), transparent 70%), var(--dlw-bg, var(--bg));
    padding:calc(var(--tg-safe-top, 0px) + 8px) 16px calc(152px + env(safe-area-inset-bottom));
    animation:dlw-in .34s cubic-bezier(.22,1,.36,1);
  }
  :root[data-theme="light"] .dl-window.open{--dlw-bg:#eef2f8;}
  .dl-window.open > *{max-width:608px; margin-left:auto; margin-right:auto;}
  .dl-window.open .dl-window-top{display:flex;}
  .dl-window.closing{animation:dlw-out .26s cubic-bezier(.4,0,1,1) forwards;}
  @keyframes dlw-in{from{transform:translateX(100%); opacity:.6;}}
  @keyframes dlw-out{to{transform:translateX(100%); opacity:.6;}}
  body.dlwin-open .tabbar-dock, body.dlwin-open .tabbar-collapse-cluster{z-index:85;}

  /* timetable shown inline in the swapped tab */
  .schedule-screen.inline{
    position:relative; inset:auto; z-index:auto; overflow:visible; overflow-x:clip;
    transform:none; opacity:1; visibility:visible; pointer-events:auto; transition:none;
    background:none; padding:0 0 8px; margin-top:4px;
  }
  .schedule-screen.inline #schedule-back{display:none;}
  .schedule-screen.inline .schedule-top{margin-bottom:12px;}
  #sched-swap-btn{display:none;}
  .schedule-screen.inline #sched-swap-btn{display:flex;}
  .dl-swap-in{animation:dl-swap-in .45s cubic-bezier(.2,.8,.2,1) both;}
  @keyframes dl-swap-in{from{opacity:0; transform:translateY(18px) scale(.98);}}

  /* ---------- Аккаунт ---------- */
  .home-top-right{display:flex; align-items:center; gap:10px;}
  .acc-btn{
    position:relative; width:42px; height:42px; border-radius:50%; flex:none; cursor:pointer; padding:2px;
    background:conic-gradient(from 210deg, var(--accent-2), var(--accent-pink, #ff5fa2), #8b7bff, var(--accent-2));
    box-shadow:0 6px 16px -8px rgba(0,0,0,0.55); transition:transform .15s ease;
  }
  .acc-btn:active{transform:scale(.92);}
  .acc-btn .acc-avatar{width:100%; height:100%; border:2px solid var(--bg);}
  .acc-avatar{
    display:flex; align-items:center; justify-content:center; flex:none; overflow:hidden; border-radius:50%;
    width:44px; height:44px; background:linear-gradient(135deg, color-mix(in srgb, var(--accent-2) 30%, var(--panel-bg-strong)), color-mix(in srgb, #8b7bff 26%, var(--panel-bg-strong)));
    color:var(--accent-2-dark); font-family:'Unbounded'; font-weight:800; font-size:.86rem; letter-spacing:.02em;
  }
  .acc-avatar img{width:100%; height:100%; object-fit:cover; display:block;}
  .acc-avatar-ph svg{width:56%; height:56%; display:block; margin:auto; stroke:currentColor; fill:none; stroke-width:2; stroke-linecap:round;}
  .acc-avatar-ph{display:flex; width:100%; height:100%;}
  .acc-avatar-lg{width:68px; height:68px; font-size:1.3rem; box-shadow:0 0 0 3px var(--bg), 0 0 0 5px color-mix(in srgb, var(--accent-2) 55%, transparent);}

  .drawer-account{
    display:flex; align-items:center; gap:12px; padding:10px 12px; margin:0 0 12px; border-radius:18px; cursor:pointer;
    background:var(--panel-bg); border:1px solid var(--panel-border); transition:transform .15s ease;
  }
  .drawer-account:active{transform:scale(.98);}
  .drawer-account-text{display:flex; flex-direction:column; min-width:0; flex:1;}
  .drawer-account-text b{font-size:.95rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
  .drawer-account-text span{font-size:.74rem; color:var(--text-faint); font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
  .drawer-account-chev{width:18px; height:18px; stroke:var(--text-faint); fill:none; stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round; flex:none;}

  .account-sheet{max-height:90vh; overflow-y:auto; overscroll-behavior:contain;}
  .acc-profile{display:flex; align-items:center; gap:16px; margin:2px 2px 18px;}
  .acc-profile-text{display:flex; flex-direction:column; gap:2px; min-width:0;}
  .acc-profile-text b{font-family:'Unbounded'; font-weight:800; font-size:1.12rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
  .acc-profile-text span{font-size:.82rem; color:var(--text-dim); font-weight:600;}
  .acc-profile-text .acc-study{color:var(--accent-2-dark); font-size:.76rem; font-weight:700;}
  .acc-profile-text span:empty{display:none;}
  .acc-stats{display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:8px; margin-bottom:12px;}
  .acc-stat{display:flex; flex-direction:column; align-items:center; gap:2px; padding:12px 6px; border-radius:18px; background:var(--panel-bg); border:1px solid var(--panel-border);}
  .acc-stat b{font-family:'Unbounded'; font-weight:800; font-size:1.05rem; font-variant-numeric:tabular-nums;}
  .acc-stat span{font-size:.7rem; color:var(--text-faint); font-weight:700;}
  .acc-plan{
    display:flex; align-items:center; gap:12px; padding:12px 14px; margin-bottom:12px; border-radius:18px;
    background:linear-gradient(120deg, color-mix(in srgb, var(--accent-2) 16%, var(--panel-bg)), color-mix(in srgb, #8b7bff 14%, var(--panel-bg)));
    border:1px solid color-mix(in srgb, var(--accent-2) 30%, transparent);
  }
  .acc-plan-icon{width:36px; height:36px; border-radius:12px; display:flex; align-items:center; justify-content:center; flex:none; background:color-mix(in srgb, var(--accent-2) 20%, transparent); color:var(--accent-2-dark);}
  .acc-plan-icon svg{width:19px; height:19px; fill:currentColor; stroke:none;}
  .acc-plan-text{display:flex; flex-direction:column; flex:1; min-width:0;}
  .acc-plan-text span{font-size:.7rem; color:var(--text-faint); font-weight:700; text-transform:uppercase; letter-spacing:.06em;}
  .acc-plan-text b{font-size:.98rem;}
  .acc-plan-soon{font-size:.72rem; font-weight:700; color:var(--accent-2-dark); white-space:nowrap;}
  .acc-list{border-radius:18px; background:var(--panel-bg); border:1px solid var(--panel-border); overflow:hidden; margin-bottom:12px;}
  .acc-row{display:flex; align-items:center; gap:12px; padding:13px 14px; cursor:pointer; font-weight:600; font-size:.9rem;}
  .acc-row + .acc-row{border-top:1px solid var(--panel-border);}
  .acc-row:active{background:var(--panel-bg-strong);}
  .acc-row svg{width:20px; height:20px; stroke:var(--text-dim); fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; flex:none;}
  .acc-row span{flex:1; min-width:0;}
  .acc-row em{font-style:normal; font-size:.78rem; color:var(--text-faint); font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:45%;}
  .acc-row-danger, .acc-row-danger svg{color:var(--danger); stroke:var(--danger);}
  .acc-switch{width:44px; height:26px; border-radius:13px; background:var(--panel-bg-strong); border:1px solid var(--panel-border); position:relative; flex:none; transition:background .2s;}
  .acc-switch::after{content:""; position:absolute; top:2px; left:2px; width:20px; height:20px; border-radius:50%; background:#fff; box-shadow:0 2px 6px rgba(0,0,0,.25); transition:transform .22s cubic-bezier(.2,.8,.2,1);}
  .acc-switch.on{background:var(--accent-2-dark); border-color:transparent;}
  .acc-switch.on::after{transform:translateX(18px);}

  /* ---------- вход: почта и пароль ---------- */
  .app-login{overflow-y:auto; justify-content:safe center;}
  .app-login-or{display:flex; align-items:center; gap:12px; width:100%; max-width:340px; margin:20px 0 14px; color:var(--text-faint); font-size:.78rem; font-weight:700;}
  .app-login-or::before, .app-login-or::after{content:""; flex:1; height:1px; background:var(--panel-border);}
  .app-login-email{display:flex; flex-direction:column; gap:10px; width:100%; max-width:340px;}
  .app-login-email .field{width:100%; box-sizing:border-box; text-align:left;}
  .app-login-seg{display:grid; grid-template-columns:1fr 1fr; padding:4px; border-radius:14px; background:var(--panel-bg); border:1px solid var(--panel-border); margin-bottom:2px;}
  .app-login-seg span{padding:9px 0; border-radius:10px; font-weight:700; font-size:.88rem; color:var(--text-dim); cursor:pointer; transition:background .2s, color .2s;}
  .app-login-seg span.active{background:var(--panel-bg-strong); color:var(--text); box-shadow:0 4px 12px -8px rgba(0,0,0,.4);}
  .app-login-submit{
    appearance:none; border:none; cursor:pointer; padding:14px 18px; border-radius:16px; font:inherit; font-weight:700; font-size:1rem;
    background:var(--panel-bg-strong); color:var(--text); border:1px solid var(--panel-border); transition:transform .15s ease, opacity .2s;
  }
  .app-login-submit:active{transform:scale(.98);}
  .app-login-submit:disabled{opacity:.6;}
  .app-login-status.error{color:var(--danger);}
  :root[data-theme="light"] .app-login-logo{filter:brightness(0);}
  .app-login-google{width:100%; max-width:340px; margin-top:12px; display:flex; justify-content:center; min-height:44px;}

  /* ---------- Аккаунт: способы входа ---------- */
  .acc-section{margin:4px 4px 8px; font-size:.7rem; font-weight:800; letter-spacing:.06em; text-transform:uppercase; color:var(--text-faint);}
  .acc-id-icon{width:30px; height:30px; border-radius:9px; display:flex; align-items:center; justify-content:center; flex:none; font-weight:800; font-size:.9rem; color:#fff;}
  .acc-id-icon svg{width:17px; height:17px; stroke:#fff; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round;}
  .acc-id-icon.tg{background:#2aabee;}
  .acc-id-icon.google{background:#fff; border:1px solid var(--panel-border); color:#4285f4; font-family:Arial, sans-serif;}
  .acc-id-icon.mail{background:var(--accent-2-dark);}
  .acc-id-icon.apple{background:#000;}
  :root[data-theme="dark"] .acc-id-icon.apple{background:#fff;}
  :root[data-theme="dark"] .acc-id-icon.apple svg{stroke:#000;}
  .acc-id-text{display:flex; flex-direction:column; flex:1; min-width:0;}
  .acc-id-text b{font-size:.9rem;}
  .acc-id-text small{font-size:.74rem; color:var(--text-faint); font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
  .acc-id-ok{font-size:.74rem; font-weight:800; color:#1f9d55; white-space:nowrap;}
  :root[data-theme="dark"] .acc-id-ok{color:#4cd07d;}
  .acc-id-link{font-size:.78rem; font-weight:800; color:var(--accent-2-dark); padding:7px 12px; border-radius:999px; background:color-mix(in srgb, var(--accent-2) 14%, transparent); white-space:nowrap;}
  .link-google{display:flex; justify-content:center; min-height:44px;}
  .link-google:empty{display:none;}
  .link-email{max-width:none;}
  #link-screen{z-index:10001;}
  .acc-id-icon.apple{font-family:-apple-system, system-ui, sans-serif; font-size:1rem;}
  :root[data-theme="dark"] .acc-id-icon.apple{color:#000;}
  .acc-row .acc-id-icon, .acc-row .acc-id-ok, .acc-row .acc-id-link{flex:none;}
  .acc-row .acc-id-text{flex:1; min-width:0;}

  /* пустая Главная нового аккаунта */
  .home-add-empty{
    grid-column:1 / -1; display:flex; align-items:center; gap:14px; padding:18px; margin-top:4px; cursor:pointer;
    border-radius:24px; border:2px dashed color-mix(in srgb, var(--accent-2) 45%, var(--panel-border));
    background:color-mix(in srgb, var(--accent-2) 6%, transparent); transition:transform .15s ease;
  }
  .home-add-empty:active{transform:scale(.98);}
  .home-add-empty-plus{width:46px; height:46px; border-radius:15px; flex:none; display:flex; align-items:center; justify-content:center; background:var(--accent-2-dark); box-shadow:0 8px 18px -10px var(--accent-2-dark);}
  .home-add-empty-plus svg{width:24px; height:24px; stroke:var(--btn-text, #fff); fill:none; stroke-width:2.4; stroke-linecap:round;}
  .home-add-empty-text{display:flex; flex-direction:column; gap:3px; min-width:0;}
  .home-add-empty-text b{font-family:'Unbounded'; font-weight:800; font-size:.98rem;}
  .home-add-empty-text small{font-size:.8rem; color:var(--text-dim); font-weight:600; line-height:1.35;}

  .home-add-empty-text small{color:var(--text);}

  /* ---------- «Аккаунт» как настройки в Telegram / iOS ---------- */
  /* у каждой строки цветная иконка-квадрат, у переходов — «›»; без серых подписей
     и без разрядки капсом */
  .acc-row > svg:first-child{width:30px; height:30px; padding:6px; box-sizing:border-box; border-radius:9px; stroke:#fff; stroke-width:2.2; background:#8e8e93;}
  #account-tz > svg:first-child{background:#5856d6;}
  #account-style > svg:first-child{background:#34c759;}
  #account-look > svg:first-child{background:#af52de;}
  #account-privacy > svg:first-child{background:#007aff;}
  #account-signout > svg:first-child{background:#ff3b30;}
  .acc-row-danger > svg:first-child{background:#ff3b30; stroke:#fff;}
  #account-tz::after, #account-style::after, #account-privacy::after{
    content:""; width:8px; height:8px; flex:none; margin:0 3px 0 -2px;
    border-top:2.2px solid var(--text); border-right:2.2px solid var(--text);
    transform:rotate(45deg); opacity:.35;
  }
  .acc-row em{color:var(--text); font-weight:500;}
  .acc-section{text-transform:none; letter-spacing:0; font-size:.95rem; color:var(--text); margin:6px 4px 8px;}
  .acc-stat span{color:var(--text); font-weight:600;}
  .acc-plan-text span{text-transform:none; letter-spacing:0; font-size:.76rem; color:var(--text);}
  .acc-profile-text span{color:var(--text);}
  .acc-id-text small{color:var(--text); font-weight:500;}
  .drawer-account-text span{color:var(--text);}
  .acc-id-icon.google svg{width:18px; height:18px; stroke:none;}

  /* ---------- светлая тема: серый фон, бывшие серые кнопки и карточки — белые ---------- */
  :root[data-theme="light"]:not([data-look="notability"]){
    --bg:#f2f2f7; --bg-2:#ececf1;
    --panel-bg:#ffffff; --panel-bg-strong:#e9e9ee;
    --pill-bg:#ffffff;
  }

  /* ---------- все виджеты Главной — в стиле «Записать лекцию» / «Импортировать файл» ---------- */
  /* светлая заливка цветом виджета, цветная обводка, иконка в цветном кружке, обычный текст;
     без оранжевого и жёлтого (у виджетов они заменены в HOME_WIDGETS) */
  .home-w-schedule{--wc:var(--accent-2);} .home-w-deadlines{--wc:var(--accent-pink);} .home-w-notes{--wc:var(--accent-3);}
  :root:not([data-look="notability"]) :is(.home-w-small, .home-w-schedule, .home-w-deadlines, .home-w-notes, .home-w-strip){
    background:color-mix(in srgb, var(--wc) 22%, var(--panel-bg)) !important;
    border:1px solid color-mix(in srgb, var(--wc) 42%, var(--panel-border)) !important;
    box-shadow:0 16px 36px -20px rgba(0,0,0,0.35);
  }
  :root:not([data-look="notability"]) .home-w-small :is(.home-w-value, .home-w-label){color:var(--text) !important;}
  :root:not([data-look="notability"]) .home-w-small .home-w-sub{color:var(--text) !important; opacity:.75;}
  :root:not([data-look="notability"]) :is(.home-w-small, .home-w-schedule, .home-w-deadlines, .home-w-notes, .home-w-strip) .home-w-icon{
    background:color-mix(in srgb, var(--wc) 38%, transparent) !important; color:var(--wc) !important;
  }
  :root:not([data-look="notability"]) .home-w-small .home-w-deco{stroke:var(--wc) !important; opacity:.14 !important;}
  :root:not([data-look="notability"]) :is(.home-w-schedule, .home-w-deadlines, .home-w-notes, .home-w-strip) .home-w-titles span{color:var(--text); opacity:.75;}

/* ==========================================================================
   ЕДИНАЯ ДИЗАЙН-СИСТЕМА (04.10.2026)
   Одни и те же детали во всех меню, шторках и списках — чтобы приложение
   выглядело цельным. Слой лежит в конце файла и переопределяет старое.
   Откат: git tag design-before-unify-2026-10-04.

   1. ШТОРКА (.tempchat-sheet): ручка сверху, радиус 28, заголовок Unbounded,
      круглая кнопка закрытия справа.
   2. СГРУППИРОВАННЫЙ СПИСОК (.ui-list и родственные): одна панель с тонкими
      разделителями; в строке — цветной значок-квадрат 32px (белый значок на
      цвете, как в настройках iOS), заголовок, пояснение, «›».
   3. ПОДПИСЬ РАЗДЕЛА: один стиль везде — обычный регистр, основной цвет.
   4. КНОПКИ: основная (синяя), вторичная, опасная — одной высоты и радиуса.
   5. ПОЛЯ ВВОДА и ПЕРЕКЛЮЧАТЕЛИ — одной высоты и радиуса.
   Цвета значков — палитра --ic-*, одинаковая в обеих темах.
   ========================================================================== */
:root{
  --r-sheet:28px; --r-card:18px; --r-ctl:14px; --r-btn:16px; --r-ico:9px;
  --ic-blue:#0a84ff; --ic-green:#34c759; --ic-purple:#af52de; --ic-orange:#ff9500;
  --ic-pink:#ff2d55; --ic-teal:#30b0c7; --ic-indigo:#5856d6; --ic-red:#ff3b30; --ic-gray:#8e8e93;
  --ui-sep:var(--panel-border);
}

/* ---- 1. шторка ---- */
.tempchat-sheet{
  border-radius:var(--r-sheet) var(--r-sheet) 0 0; padding:10px 20px calc(22px + env(safe-area-inset-bottom));
  border-top:1px solid var(--panel-border-strong);
}
.tempchat-sheet::before{
  content:""; display:block; width:38px; height:5px; border-radius:3px; margin:0 auto 16px;
  background:color-mix(in srgb, var(--text-faint) 45%, transparent);
}
.tempchat-sheet h3{font-size:1.15rem; line-height:1.25;}
.event-sheet-head{margin-bottom:16px; min-height:34px;}
.event-sheet-close{width:34px; height:34px; background:var(--panel-bg-strong); border:none;}
.event-sheet-close svg{width:15px; height:15px; stroke:var(--text);}
.tempchat-overlay{background:rgba(0,0,0,0.5); -webkit-backdrop-filter:blur(3px); backdrop-filter:blur(3px);}
.hw-subject, .schedule-import-hint{color:var(--text-dim);}
.schedule-import-hint{font-size:.84rem; margin-bottom:14px;}
.tempchat-sheet > .tempchat-row:last-of-type{margin-bottom:18px;}

/* ---- 2. сгруппированные списки ---- */
.ui-list, .acc-list, .fx-group, #cal-list, .cal-schedule-entry, .drawer-nav, #tz-list, .side-pick-list{
  border-radius:var(--r-card); background:var(--panel-bg); border:1px solid var(--panel-border);
  overflow:hidden; margin-bottom:14px;
}
.drawer-nav{gap:0; padding-bottom:0;}
#tz-list, .side-pick-list{margin:10px 0 0;}
.cal-schedule-entry{margin-bottom:12px;}
:is(.ui-list > .upload-choice-row, .ui-list > .ai-note-card, .acc-row, .fx-row, .wg-row, .drawer-item, #cal-list > .cal-list-item, .cal-schedule-entry, .tz-row, .side-pick-row){
  display:flex; align-items:center; gap:13px; padding:11px 14px; min-height:56px; border-radius:0; margin:0;
  background:transparent; border:none; border-top:1px solid var(--ui-sep); box-shadow:none; cursor:pointer;
  -webkit-tap-highlight-color:transparent; transition:background .15s ease;
}
:is(.ui-list > :first-child, .acc-list > :first-child, .fx-group > :first-child, .drawer-nav > :first-child, #cal-list > :first-child, .cal-schedule-entry, #tz-list > :first-child, .side-pick-list > :first-child){border-top:none !important;}
:is(.ui-list > .upload-choice-row, .ui-list > .ai-note-card, .acc-row, .fx-row, .wg-row, .drawer-item, #cal-list > .cal-list-item, .cal-schedule-entry, .tz-row, .side-pick-row):active{background:var(--panel-bg-strong); transform:none;}
.cal-list-item.active{background:var(--panel-bg-strong);}
.ui-list > .ai-note-card{min-height:60px;}
.ui-list > .schedule-import-primary{background:transparent;}

/* значок-квадрат */
.ui-list > .upload-choice-row > svg,
.ui-list .ai-note-card-icon,
.fx-icon, .wg-icon, .cal-schedule-icon{
  width:32px; height:32px; border-radius:var(--r-ico); flex:none; padding:0;
  display:flex; align-items:center; justify-content:center;
  background:var(--ic, var(--ic-blue)); color:#fff; box-shadow:none;
}
.ui-list > .upload-choice-row > svg{padding:6px; stroke:#fff; stroke-width:2.1; fill:none;}
.ui-list .ai-note-card-icon svg, .fx-icon svg, .wg-icon svg, .cal-schedule-icon svg{width:18px; height:18px; stroke:#fff; stroke-width:2.1;}
.acc-row > svg:first-child{border-radius:var(--r-ico);}
.drawer-item > svg{width:32px; height:32px; padding:6px; border-radius:var(--r-ico); background:var(--ic, var(--ic-gray)); stroke:#fff; stroke-width:2.1;}
.drawer-item{font-size:.92rem; font-weight:700;}
.drawer-item:active{background:var(--panel-bg-strong);}
.drawer-item-danger{color:var(--danger);}
.drawer-item-danger > svg{--ic:var(--ic-red);}
.cal-dot-badge{width:14px; height:14px; margin:0 9px;}

/* цвета значков */
.w-c-blue{--ic:var(--ic-blue);} .w-c-orange{--ic:var(--ic-orange);} .w-c-yellow{--ic:var(--ic-orange);}
.w-c-purple{--ic:var(--ic-purple);} .w-c-pink{--ic:var(--ic-pink);} .w-c-green{--ic:var(--ic-green);} .w-c-gray{--ic:var(--ic-gray);}
.ai-note-card-yellow{--ic:var(--ic-orange);} .ai-note-card-purple{--ic:var(--ic-purple);}
.ai-note-card-pink{--ic:var(--ic-pink);} .ai-note-card-blue{--ic:var(--ic-blue);}
#schedule-import-uni{--ic:var(--ic-indigo);} #schedule-import-link{--ic:var(--ic-blue);} #schedule-import-camera{--ic:var(--ic-orange);}
#schedule-import-image{--ic:var(--ic-pink);} #schedule-import-file{--ic:var(--ic-teal);} #schedule-import-text{--ic:var(--ic-green);}
#schedule-import-manual{--ic:var(--ic-purple);} #schedule-import-clear{--ic:var(--ic-red);}
#upload-choice-audio{--ic:var(--ic-pink);} #upload-choice-video{--ic:var(--ic-purple);}
#upload-choice-doc{--ic:var(--ic-teal);} #upload-choice-link{--ic:var(--ic-blue);}
.drawer-item[data-tab="home"]{--ic:var(--ic-blue);} .drawer-item[data-tab="notes"]{--ic:var(--ic-purple);}
.drawer-item[data-tab="deadlines"]{--ic:var(--ic-pink);} #drawer-functions{--ic:var(--ic-orange);}
#drawer-schedule{--ic:var(--ic-teal);} #drawer-signout{--ic:var(--ic-gray);} #drawer-privacy{--ic:var(--ic-green);}
#cal-schedule-entry{--ic:var(--ic-teal);} #cal-tz-entry{--ic:var(--ic-indigo);}
#account-tz > svg:first-child{background:var(--ic-indigo);} #account-style > svg:first-child{background:var(--ic-green);}
#account-look > svg:first-child{background:var(--ic-purple);} #account-privacy > svg:first-child{background:var(--ic-blue);}

/* текст строки: заголовок + пояснение */
.upload-choice-title, .ai-note-card-title, .fx-text b, .wg-text b, .acc-id-text b, .side-pick-row b, .tz-city{font-size:.94rem; font-weight:700; color:var(--text); line-height:1.25;}
.upload-choice-sub, .ai-note-card-sub, .fx-text span, .wg-text span, .acc-id-text small, .side-pick-row span{font-size:.78rem; font-weight:500; color:var(--text-dim); line-height:1.3; margin-top:1px;}
.ai-note-card-sub:empty{display:none;}
.ui-list > .upload-choice-row > div{flex:1; min-width:0;}
.ui-list > .upload-choice-row::after{
  content:""; width:8px; height:8px; flex:none; margin:0 4px 0 0;
  border-top:2.2px solid var(--text); border-right:2.2px solid var(--text); transform:rotate(45deg); opacity:.3;
}
.ui-list .ai-note-card-chevron{display:none;}
.ui-list > .ai-note-card::after{
  content:""; width:8px; height:8px; flex:none; margin:0 4px 0 0;
  border-top:2.2px solid var(--text); border-right:2.2px solid var(--text); transform:rotate(45deg); opacity:.3;
}
.schedule-import-danger .upload-choice-title, #schedule-import-clear .upload-choice-title{color:var(--danger);}
.schedule-import-danger svg{stroke:#fff;}
.fx-chevron, .cal-schedule-chevron, .drawer-account-chev{stroke:var(--text); opacity:.3;}
.wg-add{background:var(--ic-blue);}
.wg-add svg{stroke:#fff;}

/* ---- 3. подписи разделов ---- */
.schedule-field-label, .cm-section, .dl-section-title, .drawer-section-title, .acc-section, .sched-open-eyebrow, .sched-teacher-eyebrow{
  font-family:var(--font-text); font-size:.92rem; font-weight:800; letter-spacing:0;
  text-transform:none; color:var(--text); margin:18px 4px 8px;
}
.schedule-field-label:first-child, .cm-section:first-child, .dl-section-title:first-child, .sched-open-eyebrow{margin-top:2px;}
.cal-schedule-section{margin:16px 4px 8px;}

/* ---- 4. кнопки ---- */
.tempchat-cta, .btn, .btn.primary{
  min-height:50px; padding:12px 18px; border-radius:var(--r-btn);
  font-family:'Unbounded',system-ui,sans-serif; font-size:.82rem; font-weight:600; letter-spacing:0;
  display:flex; align-items:center; justify-content:center; text-align:center;
}
.tempchat-cta, .btn.primary{
  background:var(--accent-2-dark); color:var(--btn-text); border:none;
  box-shadow:0 8px 20px -10px color-mix(in srgb, var(--accent-2-dark) 60%, transparent);
}
.btn{background:var(--panel-bg-strong); color:var(--text); border:none; box-shadow:none; backdrop-filter:none; -webkit-backdrop-filter:none;}
.btn.danger{color:var(--danger); background:color-mix(in srgb, var(--danger) 12%, var(--panel-bg));}
.tempchat-cta:active, .btn:active{transform:scale(.98);}
.drawer-new-chat{
  display:flex; justify-content:center; width:100%; min-height:48px; padding:12px 18px; border-radius:var(--r-btn);
  font-family:'Unbounded',system-ui,sans-serif; font-size:.8rem; font-weight:600;
  box-shadow:0 8px 20px -10px color-mix(in srgb, var(--accent-2-dark) 60%, transparent);
}
.row .btn + .btn, .row .tempchat-cta + .btn{margin:0;}

/* ---- 5. поля и переключатели ---- */
.field{border-radius:var(--r-ctl); padding:13px 14px; background:var(--pill-bg); border:1px solid var(--panel-border);}
input.field:not([type="checkbox"]){min-height:48px;}
.field:focus{outline:none; border-color:color-mix(in srgb, var(--accent-2) 70%, transparent); box-shadow:0 0 0 3px color-mix(in srgb, var(--accent-2) 18%, transparent);}
.pill-dropdown-btn{min-height:48px; padding:0 14px; border-radius:var(--r-ctl); background:var(--pill-bg); font-size:.9rem;}
.schedule-seg, .app-login-seg{padding:3px; border-radius:var(--r-ctl); background:var(--panel-bg-strong); border:none;}
.schedule-seg span, .app-login-seg span{border-radius:11px; font-weight:700;}
.schedule-seg span.selected, .app-login-seg span.active{background:var(--bg); color:var(--text); box-shadow:0 2px 8px -4px rgba(0,0,0,.35);}
.acc-stat{border-radius:var(--r-card);}
.acc-plan{border-radius:var(--r-card);}
.cal-schedule-entry{border:1px solid var(--panel-border) !important; background:var(--panel-bg) !important; border-radius:var(--r-card) !important; padding:10px 14px;}
.cal-schedule-entry:active{background:var(--panel-bg-strong) !important;}
#cal-new-group-btn{margin-top:4px;}
.eyebrow, .notes-all-group-title, .schedule-preview-day, .cal-sched-eyebrow{
  font-family:var(--font-text); font-size:.92rem; font-weight:800; letter-spacing:0; text-transform:none; color:var(--text);
}
.ev-date-field label{font-size:.8rem; font-weight:700; letter-spacing:0; text-transform:none; color:var(--text); margin-bottom:5px;}

/* ==========================================================================
   ДИЗАЙН 2 (04.10.2026, по отзыву): Главная — короткая собранная страница
   (ряд быстрых действий, мини-расписание, дедлайны, недавние конспекты);
   мягкое свечение сверху на всех экранах, как было в Расписании; системный
   шрифт для текста (SF Pro на iPhone); карточки — белые/графитовые
   поверхности iOS без цветных рамок. Точка отката — тег design-before-v2-2026-10-04.
   ========================================================================== */
:root{--home-card:#1c1c1e; --home-card-shadow:0 1px 0 rgba(255,255,255,.04) inset, 0 12px 28px -18px rgba(0,0,0,.7);}
@media (prefers-color-scheme: light){
  :root:not([data-theme="dark"]){--home-card:#ffffff; --home-card-shadow:0 1px 2px rgba(20,30,60,.04), 0 10px 26px -16px rgba(20,30,60,.16);}
}
:root[data-theme="light"]{--home-card:#ffffff; --home-card-shadow:0 1px 2px rgba(20,30,60,.04), 0 10px 26px -16px rgba(20,30,60,.16);}
:root[data-theme="dark"]{--home-card:#1c1c1e; --home-card-shadow:0 1px 0 rgba(255,255,255,.04) inset, 0 12px 28px -18px rgba(0,0,0,.7);}

/* ---- текст: системный шрифт ---- */
body, .field, button, input, textarea, select{font-family:var(--font-text);}
body{-webkit-font-smoothing:antialiased; letter-spacing:-.005em;}

/* ---- свечение сверху — на всех экранах, как в Расписании ---- */
body::before{
  content:""; position:fixed; left:0; right:0; top:0; height:72vh; z-index:0; pointer-events:none;
  background:
    radial-gradient(90% 55% at 15% 0%, color-mix(in srgb, var(--accent-2) 13%, transparent), transparent 70%),
    radial-gradient(80% 50% at 90% 0%, color-mix(in srgb, var(--accent-3) 10%, transparent), transparent 70%);
}
.schedule-screen{
  background:
    radial-gradient(90% 55% at 15% 0%, color-mix(in srgb, var(--accent-2) 13%, transparent), transparent 70%),
    radial-gradient(80% 50% at 90% 0%, color-mix(in srgb, var(--accent-3) 10%, transparent), transparent 70%),
    var(--sch-bg) !important;
}

/* ---- шапка Главной: меню слева; «+», колокольчик и аватар справа ---- */
.home-top-row{margin-bottom:10px;}
.home-top-right{display:flex; align-items:center; gap:8px;}
#panel-home .home-top-row .agent-round-btn{width:40px; height:40px;}
#panel-home .home-top-row .agent-round-btn svg{width:20px; height:20px;}
#panel-home .acc-btn{width:40px; height:40px;}
.home-hero{padding:6px 6px 18px;}
.home-tagline{font-size:1.22rem; line-height:1.3;}

/* ---- блоки Главной: столбик, без «Изменить виджеты» ---- */
#home-widgets{display:flex !important; flex-direction:column; gap:14px; margin-top:16px;}
#home-widgets .home-w{
  background:var(--home-card) !important; border:none !important; box-shadow:var(--home-card-shadow) !important;
  border-radius:22px !important; padding:14px 16px 6px !important;
  backdrop-filter:none !important; -webkit-backdrop-filter:none !important;
}
#home-widgets .home-w-head{gap:10px; margin-bottom:4px;}
#home-widgets .home-w-titles{flex-direction:row; align-items:baseline; gap:8px;}
#home-widgets .home-w-titles b{font-size:1rem;}
#home-widgets .home-w-titles span{font-family:var(--font-text); font-size:.82rem; font-weight:600; opacity:1 !important; color:var(--q2) !important;}
:root[data-theme="dark"] #home-widgets .home-w-titles span{color:var(--q1) !important;}
#home-widgets .home-w-open{color:var(--text); opacity:.35;}
#home-widgets .home-w-row{border-top:.5px solid var(--panel-border-strong); padding:11px 0; margin-left:0;}
#home-widgets .home-w-row:first-child{border-top:none;}
#home-widgets .home-w-time{font-family:var(--font-text); font-size:.86rem; font-weight:600; color:var(--text); width:42px; text-align:left;}
#home-widgets .home-w-row.now .home-w-time{color:var(--accent-2-dark);}
#home-widgets .home-w-bar{width:4px; height:34px;}
#home-widgets .home-w-main b{font-size:.95rem; font-weight:600;}
#home-widgets .home-w-main span{font-size:.8rem; font-weight:500; color:var(--text-dim);}
#home-widgets .home-w-dot{width:10px; height:10px;}
#home-widgets .home-w-empty, #home-widgets .home-w-empty-cta, #home-widgets .home-w-more{border-top:.5px solid var(--panel-border-strong); font-size:.88rem;}
#home-widgets .home-w-empty{color:var(--text);}
#home-widgets .home-w-more{color:var(--accent-2-dark); font-weight:600;}

/* недавние конспекты — та же лента листов, что во вкладке «Заметки», без коробки */
.home-sec .notes-recent-header{margin:6px 2px 10px;}
.home-sec .dl-section-title{margin:0; font-family:'Unbounded',system-ui,sans-serif; font-size:1rem; font-weight:600;}
.home-sec-strip{margin:0 -16px !important; padding:2px 16px 8px !important; scroll-padding:0 16px; scroll-snap-type:x mandatory;}
.home-sec-strip > *{scroll-snap-align:start;}

/* ---- Расписание: без плашки под датами — группа тихой подписью под заголовком ---- */
.schedule-title-wrap{flex:1; min-width:0; display:flex; flex-direction:column; align-items:center;}
.schedule-title-wrap h3{margin:0;}
.schedule-title-wrap .schedule-shared-chip{
  margin:3px 0 0 !important; padding:0 !important; background:none !important; width:auto; max-width:100%;
  font-size:.76rem; font-weight:600; color:var(--accent-2-dark); gap:4px;
}
.schedule-title-wrap .schedule-shared-chip svg{width:13px; height:13px;}
.schedule-arrow{width:40px !important; height:40px !important; background:transparent !important; border:none !important; box-shadow:none !important;}

/* ==========================================================================
   ДИЗАЙН 2.1 (04.10.2026): спокойнее и «дороже» — без глянцевых градиентов
   и цветных теней; кнопки — белые/графитовые круги с тонким цветным значком
   (как в Apple / Revolut); никакого серого текста на цветных плашках;
   профиль — системным шрифтом; вкладка «Дедлайны» — переключатель
   «Календарь | Расписание» вместо карточек сверху.
   ========================================================================== */
.mono{font-variant-numeric:normal;}

/* профиль — системный шрифт, обычные цифры */
.acc-profile-text b{font-family:var(--font-text) !important; font-weight:700 !important; font-size:1.3rem !important; letter-spacing:-.01em;}
.acc-stat b{font-family:var(--font-text) !important; font-weight:700 !important; font-size:1.25rem !important; font-variant-numeric:normal !important;}
.acc-stat span, .acc-stat small{color:var(--text) !important; opacity:1 !important; font-weight:500;}
.acc-plan-text *{color:var(--text) !important;}

/* без серого текста на цветном */
.rec-idle-sub{color:color-mix(in srgb, var(--accent-2) 55%, #0b1830) !important; font-family:var(--font-text) !important; font-weight:500 !important;}
:root[data-theme="dark"] .rec-idle-sub{color:color-mix(in srgb, var(--accent-2) 45%, #fff) !important;}
.note-folder-meta{color:color-mix(in srgb, var(--fc) 50%, #1a1a1a) !important; font-weight:500;}
:root[data-theme="dark"] .note-folder-meta{color:color-mix(in srgb, var(--fc) 45%, #fff) !important;}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]) .rec-idle-sub{color:color-mix(in srgb, var(--accent-2) 45%, #fff) !important;}
  :root:not([data-theme="light"]) .note-folder-meta{color:color-mix(in srgb, var(--fc) 45%, #fff) !important;}
  }

/* «Дедлайны»: переключатель «Календарь | Расписание» вместо карточек сверху */
#cal-sched-card, #cal-dl-card, .cal-swap-btn, #cal-swap-btn, #sched-swap-btn{display:none !important;}
.dl-seg{
  position:relative; display:grid; grid-template-columns:1fr 1fr; padding:3px; margin:4px 0 14px;
  border-radius:12px; background:color-mix(in srgb, var(--text) 7%, transparent);
}
.dl-seg-thumb{
  position:absolute; top:3px; bottom:3px; left:3px; width:calc(50% - 3px); border-radius:9px;
  background:var(--home-card); box-shadow:0 1px 3px rgba(0,0,0,.12), 0 0 0 .5px rgba(0,0,0,.04);
  transition:transform .3s cubic-bezier(.22,1,.36,1);
}
:root[data-theme="dark"] .dl-seg-thumb{background:#3a3a3e;}
.dl-seg.right .dl-seg-thumb{transform:translateX(100%);}
.dl-seg-opt{
  position:relative; z-index:1; text-align:center; padding:8px 0; cursor:pointer; -webkit-tap-highlight-color:transparent;
  font-family:var(--font-text); font-size:.9rem; font-weight:600; color:var(--text);
}
/* расписание внутри «Дедлайнов»: без своего заголовка и подложки — сверху уже переключатель */
.schedule-screen.inline{background:transparent !important; box-shadow:none !important; border:none !important; padding-top:0 !important;}
.schedule-screen.inline .schedule-top{display:none !important;}

/* ==========================================================================
   ДИЗАЙН 2.3 (04.10.2026): только четыре цвета рамки строки ИИ — зелёный
   #52e6a0, голубой #37c9ff, розовый #ff5fc9, фиолетовый #9d6bff; мягкие
   заливки, значок в полупрозрачном круге (без «ядерных» сплошных кругов),
   все быстрые действия одного размера.
   ========================================================================== */
.home-action-record, #home-widgets .home-w-schedule{--c:#37c9ff;}
.home-action-import, #home-widgets .home-w-deadlines{--c:#ff5fc9;}
.home-q-review{--c:#52e6a0;}
.home-q-deadline{--c:#9d6bff;}
.home-q, #home-widgets .home-w, .home-chip{
  --tint:color-mix(in srgb, var(--c) 14%, var(--panel-bg));
  --edge:color-mix(in srgb, var(--c) 34%, var(--panel-border));
  --ink:color-mix(in srgb, var(--c) 58%, #0b1220);
  --dot:color-mix(in srgb, var(--c) 26%, transparent);
}
:root[data-theme="dark"] :is(.home-q, #home-widgets .home-w, .home-chip){
  --tint:color-mix(in srgb, var(--c) 13%, #161618); --edge:color-mix(in srgb, var(--c) 30%, transparent);
  --ink:var(--c); --dot:color-mix(in srgb, var(--c) 22%, transparent);
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]) :is(.home-q, #home-widgets .home-w, .home-chip){
    --tint:color-mix(in srgb, var(--c) 13%, #161618); --edge:color-mix(in srgb, var(--c) 30%, transparent);
    --ink:var(--c); --dot:color-mix(in srgb, var(--c) 22%, transparent);
  }
}

/* быстрые действия: четыре одинаковые плашки */
.home-quick{display:grid; grid-template-columns:repeat(4, 1fr); gap:8px; margin:18px 0 2px;}
#panel-home .home-q{
  display:flex !important; flex-direction:column !important; align-items:center !important; justify-content:center !important;
  gap:8px !important; min-width:0; padding:13px 4px 11px !important; border-radius:18px !important; cursor:pointer;
  background:var(--tint) !important; border:1px solid var(--edge) !important; box-shadow:none !important;
  -webkit-tap-highlight-color:transparent; transition:transform .15s ease;
}
.home-q:active{transform:scale(.95) !important;}
.home-q-icon{
  position:relative; width:38px; height:38px; border-radius:50%; flex:none; display:flex; align-items:center; justify-content:center;
  background:var(--dot); color:var(--ink);
}
.home-q-icon svg{width:19px; height:19px; stroke:var(--ink); fill:none; stroke-width:2.1; stroke-linecap:round; stroke-linejoin:round;}
.home-q-label{
  font-family:var(--font-text); font-weight:600; font-size:.78rem; line-height:1.2; color:var(--text);
  max-width:100%; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; text-align:center;
}
.home-q .home-action-spinner{border-color:var(--dot); border-top-color:var(--ink);}
.home-q.loading{pointer-events:none;}
.home-q.loading .home-q-icon > svg{display:none;}
.home-q.loading .home-action-spinner{display:block;}
.home-q-badge{
  position:absolute; top:-5px; right:-7px; min-width:18px; height:18px; padding:0 5px; border-radius:9px; box-sizing:border-box;
  display:none; align-items:center; justify-content:center; font-family:var(--font-text); font-size:.66rem; font-weight:700;
  color:#fff; background:#ff5fc9; border:2px solid var(--panel-bg);
}
.home-q-badge.show{display:flex;}

/* «+» вверху — как колокольчик */
.home-new-btn{color:var(--text) !important; background:var(--pill-bg) !important; border:1px solid var(--panel-border) !important; box-shadow:0 6px 16px -8px rgba(0,0,0,.35) !important;}
.home-new-btn svg{stroke:currentColor !important; stroke-width:2.2; fill:none; stroke-linecap:round;}

/* карточки расписания и дедлайнов */
#home-widgets .home-w{background:var(--tint) !important; border:1px solid var(--edge) !important; box-shadow:none !important;}
#home-widgets .home-w-icon{
  width:30px !important; height:30px !important; border-radius:50% !important;
  background:var(--dot) !important; color:var(--ink) !important; box-shadow:none !important;
}
#home-widgets .home-w-icon svg{width:16px; height:16px; stroke:var(--ink); stroke-width:2.1;}
#home-widgets .home-w-titles b{font-family:'Unbounded',system-ui,sans-serif !important; font-weight:700; font-size:.95rem; letter-spacing:0;}
#home-widgets .home-w-titles span{
  font-family:var(--font-text); font-size:.72rem !important; font-weight:600 !important; color:var(--ink) !important;
  padding:2px 8px; border-radius:999px; background:var(--dot); border:none; align-self:center;
}
#home-widgets .home-w-open{color:var(--ink); opacity:.7;}
#home-widgets .home-w-row{border-top:1px solid color-mix(in srgb, var(--c) 18%, transparent);}
#home-widgets .home-w-row:first-child{border-top:none;}
#home-widgets .home-w-time{color:var(--text); font-weight:600;}
#home-widgets .home-w-bar{background:var(--c) !important;}
#home-widgets .home-w-main b{font-weight:600; font-size:.95rem;}
#home-widgets .home-w-meta{display:flex !important; align-items:center; gap:6px; margin-top:4px !important; font-size:.8rem !important; font-weight:500 !important; color:var(--text) !important; opacity:.85;}
.home-chip{
  font-style:normal; flex:none; font-family:var(--font-text); font-size:.7rem; font-weight:600; line-height:1.45;
  padding:0 8px; border-radius:999px; color:var(--ink); background:var(--dot);
}
.home-chip.danger{--c:#ff5fc9;}
#home-widgets .home-w-hw{border-color:color-mix(in srgb, var(--c) 40%, transparent); color:var(--ink);}
#home-widgets .home-w-dot{background:var(--c) !important;}
#home-widgets .home-w-more, #home-widgets .home-w-empty-cta{color:var(--ink) !important; border-top:1px solid color-mix(in srgb, var(--c) 18%, transparent) !important;}
#home-widgets .home-w-empty{color:var(--text) !important; border-top:none !important;}
.home-sec .dl-section-title{font-family:'Unbounded',system-ui,sans-serif !important; font-weight:700 !important; font-size:1rem !important; letter-spacing:0;}

/* ==========================================================================
   ДИЗАЙН 2.4 (04.10.2026): мягкие значки во всех меню и настройках (в тех же
   четырёх цветах рамки строки ИИ), мини-расписание на Главной — карточками
   пар как на экране «Расписание», другой зелёный у «Карточек», цветной «+».
   ========================================================================== */
:root{
  --ic-blue:#37c9ff; --ic-teal:#37c9ff; --ic-indigo:#9d6bff; --ic-purple:#9d6bff;
  --ic-pink:#ff5fc9; --ic-orange:#ff5fc9; --ic-red:#ff5f7e; --ic-green:#5cc98a; --ic-gray:#8e8e93;
  --icon-ink-mix:#0b1220;
}
:root[data-theme="dark"]{--icon-ink-mix:#ffffff;}
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]){--icon-ink-mix:#ffffff;} }

/* значок: полупрозрачный круг-квадрат своего цвета и значок этим же цветом */
.ui-list > .upload-choice-row > svg, .ui-list .ai-note-card-icon, .fx-icon, .wg-icon, .cal-schedule-icon,
.drawer-item > svg, .acc-row > svg:first-child, .wg-add{
  background:color-mix(in srgb, var(--ic, var(--ic-blue)) 20%, transparent) !important;
  color:color-mix(in srgb, var(--ic, var(--ic-blue)) 62%, var(--icon-ink-mix)) !important;
  stroke:color-mix(in srgb, var(--ic, var(--ic-blue)) 62%, var(--icon-ink-mix)) !important;
  box-shadow:none !important;
}
:root[data-theme="dark"] :is(.ui-list > .upload-choice-row > svg, .ui-list .ai-note-card-icon, .fx-icon, .wg-icon, .cal-schedule-icon, .drawer-item > svg, .acc-row > svg:first-child, .wg-add){
  color:var(--ic, var(--ic-blue)) !important; stroke:var(--ic, var(--ic-blue)) !important;
}
.ui-list .ai-note-card-icon svg, .fx-icon svg, .wg-icon svg, .cal-schedule-icon svg, .wg-add svg{stroke:currentColor !important;}
.drawer-item[data-tab="home"]{--ic:var(--ic-blue);} .drawer-item[data-tab="notes"]{--ic:var(--ic-purple);}
.drawer-item[data-tab="deadlines"]{--ic:var(--ic-pink);}
#account-tz{--ic:var(--ic-purple);} #account-style{--ic:var(--ic-green);} #account-look{--ic:var(--ic-pink);} #account-privacy{--ic:var(--ic-blue);}
#account-signout{--ic:var(--ic-gray);} .acc-row-danger{--ic:var(--ic-red);}
/* значки способов входа (Telegram, почта) — мягче, Google и Apple как есть */
.acc-id-icon:not(.google):not(.apple){background:color-mix(in srgb, #37c9ff 20%, transparent) !important; color:color-mix(in srgb, #37c9ff 62%, var(--icon-ink-mix)) !important;}
:root[data-theme="dark"] .acc-id-icon:not(.google):not(.apple){color:#37c9ff !important;}
.acc-id-icon:not(.google):not(.apple) svg{stroke:currentColor; fill:none;}

/* «Карточки» — другой зелёный */
.home-q-review{--c:#5cc98a;}

/* «+» вверху — голубой, как «Запись» */
.home-new-btn{
  background:color-mix(in srgb, #37c9ff 18%, var(--pill-bg)) !important; border:1px solid color-mix(in srgb, #37c9ff 38%, transparent) !important;
  color:color-mix(in srgb, #37c9ff 60%, #0b1220) !important; box-shadow:none !important;
}
:root[data-theme="dark"] .home-new-btn{color:#37c9ff !important;}
.home-new-btn svg{stroke:currentColor !important;}

/* мини-расписание — карточки пар как на экране «Расписание» */
#panel-home{--sch-card:var(--home-card); --sch-card-border:transparent; --sch-shadow:var(--home-card-shadow);}
.home-sched .dl-section-title{display:flex; align-items:baseline; gap:8px;}
.home-sched-count{font-family:var(--font-text); font-size:.82rem; font-weight:600; color:color-mix(in srgb, #37c9ff 60%, #0b1220);}
:root[data-theme="dark"] .home-sched-count{color:#37c9ff;}
.home-sched{display:flex; flex-direction:column; gap:10px;}
.home-sched .notes-recent-header{margin:2px 2px 0;}
.home-sched .schedule-card{padding:13px 12px 13px 14px; border-radius:20px;}
.home-sched .schedule-time{width:46px; font-size:.86rem; color:var(--text);}
.home-sched .schedule-time span:last-child{opacity:.6;}
.home-sched .schedule-bar{min-height:42px;}
.home-sched .schedule-title{font-size:.95rem; font-weight:700;}
.home-sched .schedule-meta{font-size:.8rem; color:var(--text); opacity:.7;}
.home-sched .home-w-hw{border:1px dashed color-mix(in srgb, #37c9ff 50%, transparent); color:color-mix(in srgb, #37c9ff 60%, #0b1220);}
:root[data-theme="dark"] .home-sched .home-w-hw{color:#37c9ff;}
.home-sched-empty{justify-content:center; font-size:.9rem; font-weight:600; color:var(--text);}

/* ---------- запись звука: плавная «жидкость» в кнопке микрофона ----------
   Уровень двигает заливку transform'ом (композитор, без раскладки и
   перерисовки), волны едут свойством translate вместо mask-position, а пока
   запись не идёт, анимации стоят на паузе, а не крутятся в скрытых кнопках. */
.rec-mic-fill{
  height:calc(100% + 6px) !important; bottom:-3px !important;
  transform:translateY(calc((1 - var(--fill, 0)) * 100% - 7px));
  transition:opacity .2s ease !important;
  animation:recMicBobT 2.9s ease-in-out infinite !important;
  will-change:transform;
}
@keyframes recMicBobT{ 0%, 100%{translate:0 0;} 50%{translate:0 -1px;} }
.rec-mic-fill::before, .rec-mic-fill::after, .rec-mic-wave3{
  left:-64px !important; right:-64px !important;
  transition:none !important; will-change:transform;
}
.rec-mic-fill::before{animation:recWaveL 3.4s linear infinite !important;}
.rec-mic-fill::after{animation:recWaveR 2.5s linear infinite !important;}
.rec-mic-wave3{animation:recWaveL 4.2s linear .5s infinite !important;}
@keyframes recWaveL{ from{translate:0 0;} to{translate:-48px 0;} }
@keyframes recWaveR{ from{translate:0 0;} to{translate:48px 0;} }
.rec-mic-fill, .rec-mic-fill::before, .rec-mic-fill::after, .rec-mic-wave3{animation-play-state:paused !important;}
.note-toolbar-btn.main.recording:not(.paused) .rec-mic-fill,
.note-toolbar-btn.main.recording:not(.paused) .rec-mic-fill::before,
.note-toolbar-btn.main.recording:not(.paused) .rec-mic-fill::after,
.note-toolbar-btn.main.recording:not(.paused) .rec-mic-wave3,
.note-format-btn.main.recording:not(.paused) .rec-mic-fill,
.note-format-btn.main.recording:not(.paused) .rec-mic-fill::before,
.note-format-btn.main.recording:not(.paused) .rec-mic-fill::after,
.note-format-btn.main.recording:not(.paused) .rec-mic-wave3,
.rec-float-bar:not(.paused) .rec-float-pause .rec-mic-fill,
.rec-float-bar:not(.paused) .rec-float-pause .rec-mic-fill::before,
.rec-float-bar:not(.paused) .rec-float-pause .rec-mic-fill::after,
.rec-float-bar:not(.paused) .rec-float-pause .rec-mic-wave3{animation-play-state:running !important;}

/* живая расшифровка во время записи — то же окно, что «Спросить ИИ», строки как в «Расшифровке» */
.live-tr-sheet{max-height:72vh;}
.live-tr-list{min-height:38vh; gap:14px;}
.live-tr-list .transcript-seg-text{font-size:.98rem;}
/* невидимая метка момента записи в начале строки черновика */
.t-mark{font-style:normal;}
/* несколько записей в заметке: отметки начала на полосе и чип «Запись N из M» */
.note-audio-rec-mark{position:absolute; top:-2px; bottom:-2px; width:2px; margin-left:-1px; border-radius:1px; background:var(--text); opacity:.35; pointer-events:none;}
.note-audio-rec{font-family:var(--font-text); font-size:.68rem; font-weight:700; color:var(--accent-2-dark); padding:0 8px; border-radius:999px; background:color-mix(in srgb, var(--accent-2) 14%, transparent); cursor:pointer;}
#note-rec-timer.elsewhere{cursor:pointer; pointer-events:auto !important;}

/* ==========================================================================
   ПЛАВНОСТЬ (09.10.2026)
   1) Закрытые шторки и затемнения раньше оставались прозрачными слоями на
      весь экран (opacity:0) — и у каждой работало размытие фона; ~25 таких
      слоёв браузер пересчитывал при каждой прокрутке и каждом переходе.
      Теперь закрытые по-настоящему скрыты (visibility) и не рисуются вовсе.
   2) Анимации внутри закрытых шторок стоят на паузе.
   3) Свечения, которые постоянно «дышали» фильтрами (кнопка «Агент», строка
      ИИ на Главной), — статичные: выглядят так же, но не перерисовываются
      каждый кадр. Бегущая рамка строки ИИ крутится только при вводе.
   ========================================================================== */
.tempchat-overlay{visibility:hidden; transition:opacity .25s ease, visibility 0s linear .25s;}
.tempchat-overlay.open{visibility:visible; transition:opacity .25s ease, visibility 0s;}
.photo-lightbox{visibility:hidden; transition:opacity .25s ease, visibility 0s linear .25s;}
.photo-lightbox.open{visibility:visible; transition:opacity .25s ease, visibility 0s;}
.drawer-overlay, .cal-drawer-overlay{visibility:hidden; transition:opacity .3s ease, visibility 0s linear .3s;}
.drawer-overlay.open, .cal-drawer-overlay.open{visibility:visible; transition:opacity .3s ease, visibility 0s;}
.sketch-screen:not(.open){visibility:hidden; transition:opacity .22s ease, transform .28s cubic-bezier(.2,.8,.2,1), visibility 0s linear .28s;}
.note-plus-overlay:not(.open){visibility:hidden; transition:visibility 0s linear .3s;}
.tempchat-overlay:not(.open) *, .tempchat-overlay:not(.open) *::before, .tempchat-overlay:not(.open) *::after{animation-play-state:paused !important;}

.tab-agent-glow{animation:none !important; filter:blur(8px);}
.tab-agent-btn svg{animation:none !important;}
.home-agent-quick::after{animation:none !important; filter:drop-shadow(0 0 6px rgba(120,150,255,.4));}
.home-agent-beam{animation-play-state:paused;}
.home-agent-quick:focus-within .home-agent-beam{animation-play-state:running;}
/* у круглых кнопок фон непрозрачный — размытие под ними не видно, но стоит дорого */
.agent-round-btn, .transcript-ask-btn{backdrop-filter:none !important; -webkit-backdrop-filter:none !important;}
/* переходы между экранами — мягче, как в iOS: новый въезжает с плавным
   замедлением, уходящий быстро тает (не наслаиваются) */
.panel{transition:opacity .16s ease, transform .2s ease;}
.panel.active.show{transition:opacity .26s ease, transform .38s cubic-bezier(.32,.72,0,1);}
.panel.push-enter, .panel.pop-enter{transition:none;}
/* шторки и боковые меню — та же кривая */
.tempchat-sheet{transition:transform .38s cubic-bezier(.32,.72,0,1);}
.drawer, .cal-drawer{transition:transform .34s cubic-bezier(.32,.72,0,1);}
/* строки меню «+», спрятанные атрибутом hidden (пункты только для записи) */
.note-plus-row[hidden]{display:none !important;}

/* месяц в календаре — нативная лента страниц (листает система, 120 Гц) */
.cal-month-pager{display:flex; align-items:flex-start; overflow-x:auto; overflow-y:hidden; scroll-snap-type:x mandatory; overscroll-behavior-x:contain; -webkit-overflow-scrolling:touch; scrollbar-width:none; touch-action:pan-x pan-y;}
.cal-month-pager::-webkit-scrollbar{display:none;}
.cal-month-slide{flex:0 0 100%; min-width:100%; box-sizing:border-box; scroll-snap-align:start; scroll-snap-stop:always;}
/* Расписание — дни листаются нативной лентой (система, 120 Гц); поля по краям
   ленты — чтобы тени и рамка «сейчас» у карточек не обрезались */
.schedule-pager{display:flex; align-items:flex-start; overflow-x:auto; overflow-y:hidden; scroll-snap-type:x mandatory; overscroll-behavior-x:contain; -webkit-overflow-scrolling:touch; scrollbar-width:none; touch-action:pan-x pan-y; margin:-4px -4px -20px;}
.schedule-pager::-webkit-scrollbar{display:none;}
/* без scroll-snap-stop:always — сильный взмах проносит ленту через несколько
   дней (как обычная прокрутка), она не тормозит на каждом; встаёт ровно на день */
.schedule-pager > .schedule-list{flex:0 0 100%; min-width:100%; box-sizing:border-box; padding:4px 4px 20px; scroll-snap-align:start; scroll-snap-stop:normal;}
.schedule-side{pointer-events:none;}
/* Расписание: свайп в любом месте — лента дней заходит под шапку (шапка
   пропускает касания, кроме своих кнопок и дат) и тянется до низа экрана;
   место под «Предметы»/«Изменить» и панель вкладок — внутри страниц ленты */
.schedule-screen{--sch-pb:calc(152px + env(safe-area-inset-bottom)); padding-bottom:0;}
.schedule-screen.inline{--sch-pb:72px; padding-bottom:0;}
.schedule-top, .schedule-nav{position:relative; z-index:2; pointer-events:none;}
#schedule-back, #schedule-today-btn, #sched-swap-btn, .schedule-shared-chip, .schedule-arrow, .schedule-daypill, .schedule-date{pointer-events:auto;}
.schedule-pager{margin-top:calc(-4px - var(--sch-head, 0px));}
.schedule-pager > .schedule-list{padding-top:calc(4px + var(--sch-head, 0px)); padding-bottom:calc(20px + var(--sch-pb));}
/* «Предметы» + «Изменить» — закреплены над панелью вкладок, не ездят */
body > .schedule-fab-bar{
  --sch-card:var(--panel-bg); --sch-card-border:var(--panel-border); --sch-shadow:var(--shadow);
  position:fixed; left:50%; bottom:calc(88px + env(safe-area-inset-bottom)); transform:translateX(-50%);
  z-index:84; opacity:0; visibility:hidden; pointer-events:none;
  transition:opacity .2s ease, visibility 0s linear .2s;
}
:root[data-theme="light"] body > .schedule-fab-bar{--sch-card:#ffffff; --sch-card-border:rgba(20,40,90,0.05); --sch-shadow:0 10px 26px -16px rgba(30,55,110,0.28);}
body.schedule-open > .schedule-fab-bar, body.dl-tab-active.dl-swapped:not(.dlwin-open) > .schedule-fab-bar{
  opacity:1; visibility:visible; pointer-events:auto; transition:opacity .2s ease, visibility 0s;
}
/* закрытые шторки после анимации закрытия совсем выходят из раскладки (см. sheetParking в app.js) */
.tempchat-overlay.parked{display:none !important;}
/* Расписание: нажатие на текущую дату в шапке — системный выбор даты (поле лежит поверх даты, прозрачное) */
.schedule-date.d0{position:relative;}
.schedule-date-pick{position:absolute; inset:0; width:100%; height:100%; opacity:0; border:0; padding:0; margin:0; -webkit-appearance:none; appearance:none; cursor:pointer; font-size:16px; z-index:1;}
.schedule-date-pick::-webkit-calendar-picker-indicator{position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer;}
/* ---------- Маркер в конспекте ---------- */
#note-toolbar-marker.on{background:color-mix(in srgb, var(--marker-color, var(--accent-yellow)) 28%, var(--panel-bg-strong)); border-color:color-mix(in srgb, var(--marker-color, var(--accent-yellow)) 60%, transparent);}
#note-toolbar-marker .marker-tip{stroke:var(--marker-color, var(--accent-yellow)); stroke-width:3;}
.marker-palette{
  position:fixed; left:50%; bottom:calc(84px + env(safe-area-inset-bottom)); z-index:41;
  display:flex; gap:10px; padding:8px 10px; border-radius:999px;
  background:color-mix(in srgb, var(--pill-bg) 92%, transparent); border:1px solid var(--panel-border-strong);
  box-shadow:0 14px 30px -14px rgba(0,0,0,.5);
  opacity:0; pointer-events:none; transform:translateX(-50%) translateY(12px) scale(.92);
  transition:opacity .2s ease, transform .25s cubic-bezier(.22,1,.36,1);
}
.marker-palette.show{opacity:1; pointer-events:auto; transform:translateX(-50%) translateY(0) scale(1);}
.marker-swatch{width:30px; height:30px; border-radius:50%; cursor:pointer; border:2px solid transparent; display:flex; align-items:center; justify-content:center; color:var(--text); transition:transform .15s ease, border-color .15s ease;}
.marker-swatch:active{transform:scale(.88);}
.marker-swatch.hl-y{background:var(--accent-yellow);} .marker-swatch.hl-g{background:var(--ev-green);}
.marker-swatch.hl-b{background:var(--ev-cyan);} .marker-swatch.hl-p{background:var(--ev-pink);}
.marker-swatch.selected{border-color:var(--text);}
.marker-eraser{background:var(--panel-bg-strong); border-color:var(--panel-border);}
.marker-eraser.selected{border-color:var(--text);}
.marker-eraser svg{width:17px; height:17px; stroke:currentColor; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round;}
/* в режиме маркера: вбок по тексту — выделение, вверх-вниз — прокрутка; без клавиатуры и системного выделения */
#detail-body.marker-mode{touch-action:pan-y; -webkit-user-select:none; user-select:none; -webkit-touch-callout:none; cursor:text;}
::highlight(marker-preview){background-color:color-mix(in srgb, var(--marker-color, #ffd23f) 45%, transparent);}
::highlight(marker-erase){background-color:color-mix(in srgb, var(--text) 14%, transparent); text-decoration:line-through;}
/* маркер: след пальца и «закрашивание» выделения */
.marker-trail{position:fixed; inset:0; width:100vw; height:100vh; pointer-events:none; z-index:39; display:none; overflow:visible;}
.marker-trail path{fill:none; stroke:var(--marker-color, #ffd23f); stroke-linecap:round; stroke-linejoin:round; opacity:.42; mix-blend-mode:normal;}
:root[data-theme="light"] .marker-trail path{opacity:.5; mix-blend-mode:multiply;}
.marker-trail.erase path{stroke:var(--text); opacity:.14;}
.marker-trail.fade path{opacity:0; transition:opacity .3s ease;}
/* новое выделение заливается слева направо (по каждому куску строки) */
.note-body mark.mark-fill{
  background-repeat:no-repeat !important; background-position:left center !important;
  animation:markFill .4s cubic-bezier(.22,1,.36,1) both;
}
.note-body mark.mark-fill.hl-y{background-image:linear-gradient(color-mix(in srgb, var(--accent-yellow) 38%, transparent), color-mix(in srgb, var(--accent-yellow) 38%, transparent)) !important; background-color:transparent !important;}
.note-body mark.mark-fill.hl-g{background-image:linear-gradient(color-mix(in srgb, var(--ev-green) 34%, transparent), color-mix(in srgb, var(--ev-green) 34%, transparent)) !important; background-color:transparent !important;}
.note-body mark.mark-fill.hl-b{background-image:linear-gradient(color-mix(in srgb, var(--ev-cyan) 32%, transparent), color-mix(in srgb, var(--ev-cyan) 32%, transparent)) !important; background-color:transparent !important;}
.note-body mark.mark-fill.hl-p{background-image:linear-gradient(color-mix(in srgb, var(--ev-pink) 30%, transparent), color-mix(in srgb, var(--ev-pink) 30%, transparent)) !important; background-color:transparent !important;}
@keyframes markFill{from{background-size:0% 100%;} to{background-size:100% 100%;}}
/* подложка выделения выходит за края текста, но буквы не сдвигает — иначе
   выделенная часть слова отрывалась от остальных букв («Прои зводная») */
.note-body mark, .note-thumb-inner mark{padding:.04em .1em; margin:0 -.1em;}
/* событие на весь день в неделе/дне: название с начала, не больше двух строк */
.cal-tg-allday-text{display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; min-width:0; word-break:normal; overflow-wrap:anywhere; hyphens:auto;}
/* закрытые боковые меню не рисуются (только после анимации закрытия) */
.drawer:not(.open), .cal-drawer:not(.open){visibility:hidden; transition:transform .34s cubic-bezier(.32,.72,0,1), visibility 0s linear .34s;}
.drawer.open, .cal-drawer.open{visibility:visible; transition:transform .34s cubic-bezier(.32,.72,0,1), visibility 0s;}
/* «край прокрутки», как в iOS: когда страница прокручена, у верхнего края
   содержимое мягко растворяется под шапкой и плавающими кнопками, а не
   просвечивает между ними (заголовки наезжали на «VOUZ Ai» и «назад») */
header::before{
  content:''; position:absolute; z-index:-1; pointer-events:none;
  left:calc(50% - 50vw); width:100vw;
  top:calc(18px - var(--tg-safe-top, 0px));
  height:calc(var(--tg-safe-top, 0px) - 18px + 100% + 70px);
  background:linear-gradient(to bottom, var(--bg) 0, var(--bg) calc(100% - 78px), transparent 100%);
  opacity:0; transition:opacity .2s ease;
}
header.edge::before{opacity:1;}
/* в конспекте под шапкой ещё ряд плавающих кнопок («назад», меню) — затемнение доходит и до них */
body:has(#note-detail-topbar.show) header::before{height:calc(var(--tg-safe-top, 0px) - 18px + 100% + 128px); background:linear-gradient(to bottom, var(--bg) 0, var(--bg) calc(100% - 64px), transparent 100%);}
