/* ==========================================================================
   Asila UI — design system foundation (standard: skill «assila-ui-ux»)
   One product for the seller workspace, the admin and the login page.
   Layers: tokens → base → shell → components → states → utilities.
   Screen-specific rules live in styles.css (workspace) and admin.css (admin);
   they use these tokens and never redefine the components.
   ========================================================================== */

/* ---------- 0. Inter (local woff2: latin + cyrillic + қазақ әғқңөұүһі) ---------- */
@font-face { font-family: Inter; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/inter-cyrillic-ext-400-normal.woff2") format("woff2"); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: Inter; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/inter-cyrillic-400-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Inter; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/inter-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Inter; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/inter-latin-400-normal.woff2") format("woff2"); 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: Inter; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/inter-cyrillic-ext-500-normal.woff2") format("woff2"); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: Inter; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/inter-cyrillic-500-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Inter; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/inter-latin-ext-500-normal.woff2") format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Inter; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/inter-latin-500-normal.woff2") format("woff2"); 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: Inter; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/inter-cyrillic-ext-600-normal.woff2") format("woff2"); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: Inter; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/inter-cyrillic-600-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Inter; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/inter-latin-ext-600-normal.woff2") format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Inter; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/inter-latin-600-normal.woff2") format("woff2"); 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: Inter; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/inter-cyrillic-ext-700-normal.woff2") format("woff2"); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: Inter; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/inter-cyrillic-700-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Inter; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/inter-latin-ext-700-normal.woff2") format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Inter; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/inter-latin-700-normal.woff2") format("woff2"); 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; }

/* ---------- 1. Tokens ---------- */
:root {
  /* neutrals */
  --n0: #ffffff;
  --n25: #fafbfc;
  --n50: #f6f8fb;
  --n75: #f3f5f8;
  --n100: #eef1f5;
  --n150: #e8ebf0;
  --n200: #e2e6ed;
  --n300: #cfd5df;
  --n400: #a3aab8;
  --n500: #8a91a0;
  --n600: #5f6779;
  --n700: #454e60;
  --n800: #2d3546;
  --n900: #1b2333;

  /* roles */
  --bg: #eef1f6;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-2: rgba(255, 255, 255, 0.5);
  --surface-3: rgba(232, 236, 243, 0.72);
  --line: rgba(28, 32, 44, 0.08);
  --line-strong: var(--n300);
  --text: var(--n900);
  --text-2: var(--n700);
  --muted: var(--n600);          /* ≥4.5:1 on --bg and --surface */
  --faint: var(--n500);          /* placeholders, disabled; never essential text */

  /* ASS-MEK brand base (rebrand TASK-041; full redesign is a separate task) */
  --ass-cyan: #00E5FF;
  --ass-purple: #7B3FF6;
  --ass-navy: #0B1533;
  --ass-light: #E5E7FF;
  --brand: #0B1533;                /* navy (design_tokens.json colors.navy) */
  --brand-accent: #00E5FF;         /* cyan */
  --brand-gold: #d4b573;           /* decorative accents only, never status */
  --brand-leaf: #8da66b;           /* decorative accents only, never status */
  --primary: #7B3FF6;              /* ASS-MEK purple; white text on it ≥ 5:1 */
  --primary-hover: #6A2FE0;
  --primary-press: #5A22C8;
  --primary-soft: #F1EBFF;
  --primary-soft-2: #E5E7FF;
  --primary-text: #5B25D0;
  --focus-ring: 0 0 0 3px rgba(0, 229, 255, 0.55);
  --success-proposed: #22C55E;
  --warning-proposed: #F59E0B;
  --error-proposed: #EF4444;
  --card-radius: 12px;             /* design_tokens.json spacing.card_radius_px */

  --success: #1e6b43;
  --success-soft: #e8f5ee;
  --success-line: #bfe3cd;
  --warning: #8a5300;
  --warning-strong: #b54708;
  --warning-soft: #fff4e2;
  --warning-line: #f3d49b;
  --danger: #b42318;
  --danger-solid: #d92d20;
  --danger-soft: #fdeceb;
  --danger-line: #f4c7c3;
  --violet: #5b3fc4;
  --violet-soft: #f1ecff;

  /* platforms */
  --pf-ig: linear-gradient(135deg, #f9b233, #e1306c 55%, #833ab4);
  --pf-fb: #1877f2;
  --pf-tt: #111111;
  --pf-tg: #229ed9;
  --pf-yt: #e62117;
  --pf-wa: #25d366;

  /* type */
  --font: Montserrat, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --fs-xs: 12px;     /* meta, badges — never smaller */
  --fs-sm: 13px;     /* secondary lines, captions, labels */
  --fs-md: 14px;     /* dense UI, chips, table cells */
  --fs-base: 15px;   /* body text, list titles */
  --fs-lg: 16px;     /* inputs (no iOS zoom), sheet body */
  --fs-xl: 17px;     /* card and section titles */
  --fs-h2: 20px;     /* sheet titles, big section titles */
  --fs-h1: 24px;     /* page title on phones */
  --fs-display: 28px;/* page title ≥1024, key numbers */
  --lh: 1.45;
  --lh-tight: 1.25;

  /* space: 4px grid */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 20px;
  --s6: 24px;
  --s8: 32px;
  --s10: 40px;
  --gutter: 16px;

  /* radius */
  --r-2xs: 4px;
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* control heights */
  --h-sm: 36px;
  --h-md: 44px;
  --h-lg: 52px;

  /* elevation: soft glass, not a hard drop */
  --sh-1: 0 1px 2px rgba(28, 36, 56, 0.05);
  --sh-2: 0 10px 28px rgba(28, 36, 56, 0.08);
  --sh-3: 0 18px 48px rgba(28, 36, 56, 0.12);
  --glass: rgba(255, 255, 255, 0.62);
  --glass-strong: rgba(255, 255, 255, 0.84);
  --glass-edge: rgba(28, 32, 44, 0.08);
  --glass-blur: blur(22px) saturate(1.75);
  --glass-shadow: 0 12px 32px rgba(28, 36, 56, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.85);

  /* layers */
  --z-sticky: 20;
  --z-nav: 30;
  --z-menu: 40;
  --z-overlay: 60;
  --z-viewer: 1000;

  /* shell */
  --nav-w: 240px;
  --rail-w: 96px;
  --topbar-h: 56px;
  --tabbar-h: 72px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --content-max: 1280px;
  --form-max: 720px;

  /* legacy aliases — older selectors keep working through tokens */
  --blue: var(--primary);
  --ink: var(--text);
  --accent: var(--primary);
  --radius: var(--r-lg);
  --ok: var(--success);
  --ok-bg: var(--success-soft);
  --warn: var(--warning);
  --warn-bg: var(--warning-soft);
  --warn-line: var(--warning-line);

  /* Soft 3D / neumorphism elevation tokens (light theme) */
  --elev-hi: rgba(255, 255, 255, 0.95);
  --elev-lo: rgba(11, 21, 51, 0.16);
  --elev-raised-1: -4px -4px 10px var(--elev-hi), 4px 4px 12px var(--elev-lo);
  --elev-raised-2: -8px -8px 18px var(--elev-hi), 8px 8px 22px var(--elev-lo);
  --elev-inset: inset -3px -3px 7px var(--elev-hi), inset 3px 3px 8px var(--elev-lo);
  --elev-edge: rgba(11, 21, 51, 0.14);
  --elev-ease: 150ms ease;

  color-scheme: light;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
@media (min-width: 768px) {
  :root { --gutter: 24px; }
}
@media (min-width: 1024px) {
  :root { --gutter: 32px; }
}

/* ---------- 1b. Dark theme (data-theme="dark", or system when data-theme is absent/"system") ---------- */
:root[data-theme="dark"] {
  --bg: #0B1533;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-2: rgba(255, 255, 255, 0.04);
  --surface-3: rgba(255, 255, 255, 0.10);
  --line: rgba(229, 231, 255, 0.14);
  --line-strong: rgba(229, 231, 255, 0.28);
  --text: #E5E7FF;
  --text-2: #C9CCEF;
  --muted: #A5AAD6;
  --faint: #8187B8;
  --primary: #8F5CFF;
  --primary-hover: #A279FF;
  --primary-press: #B590FF;
  --primary-soft: rgba(143, 92, 255, 0.18);
  --primary-soft-2: rgba(143, 92, 255, 0.28);
  --primary-text: #C9B3FF;
  --success: #4ADE80;
  --success-soft: rgba(34, 197, 94, 0.16);
  --success-line: rgba(34, 197, 94, 0.4);
  --warning: #FBBF24;
  --warning-strong: #F59E0B;
  --warning-soft: rgba(245, 158, 11, 0.16);
  --warning-line: rgba(245, 158, 11, 0.4);
  --danger: #F87171;
  --danger-solid: #EF4444;
  --danger-soft: rgba(239, 68, 68, 0.16);
  --danger-line: rgba(239, 68, 68, 0.4);
  --violet: #B590FF;
  --violet-soft: rgba(143, 92, 255, 0.18);
  --sh-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --sh-2: 0 10px 28px rgba(0, 0, 0, 0.4);
  --sh-3: 0 18px 48px rgba(0, 0, 0, 0.5);
  --glass: rgba(11, 21, 51, 0.7);
  --glass-strong: rgba(11, 21, 51, 0.9);
  --glass-edge: rgba(229, 231, 255, 0.14);
  --glass-shadow: 0 12px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(229, 231, 255, 0.08);
  --elev-hi: rgba(120, 140, 255, 0.14);
  --elev-lo: rgba(2, 5, 16, 0.75);
  --elev-edge: rgba(229, 231, 255, 0.22);
  color-scheme: dark;
}
:root[data-theme="dark"] body {
  background:
    radial-gradient(900px 480px at 0% -10%, rgba(123, 63, 246, 0.28), transparent 55%),
    radial-gradient(800px 420px at 100% 0%, rgba(0, 229, 255, 0.12), transparent 50%),
    linear-gradient(180deg, #0B1533 0%, #070e24 100%);
  background-attachment: fixed;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    --bg: #0B1533;
    --surface: rgba(255, 255, 255, 0.06);
    --surface-2: rgba(255, 255, 255, 0.04);
    --surface-3: rgba(255, 255, 255, 0.10);
    --line: rgba(229, 231, 255, 0.14);
    --line-strong: rgba(229, 231, 255, 0.28);
    --text: #E5E7FF;
    --text-2: #C9CCEF;
    --muted: #A5AAD6;
    --faint: #8187B8;
    --primary: #8F5CFF;
    --primary-hover: #A279FF;
    --primary-press: #B590FF;
    --primary-soft: rgba(143, 92, 255, 0.18);
    --primary-soft-2: rgba(143, 92, 255, 0.28);
    --primary-text: #C9B3FF;
    --success: #4ADE80;
    --success-soft: rgba(34, 197, 94, 0.16);
    --success-line: rgba(34, 197, 94, 0.4);
    --warning: #FBBF24;
    --warning-strong: #F59E0B;
    --warning-soft: rgba(245, 158, 11, 0.16);
    --warning-line: rgba(245, 158, 11, 0.4);
    --danger: #F87171;
    --danger-solid: #EF4444;
    --danger-soft: rgba(239, 68, 68, 0.16);
    --danger-line: rgba(239, 68, 68, 0.4);
    --violet: #B590FF;
    --violet-soft: rgba(143, 92, 255, 0.18);
    --sh-1: 0 1px 2px rgba(0, 0, 0, 0.4);
    --sh-2: 0 10px 28px rgba(0, 0, 0, 0.4);
    --sh-3: 0 18px 48px rgba(0, 0, 0, 0.5);
    --glass: rgba(11, 21, 51, 0.7);
    --glass-strong: rgba(11, 21, 51, 0.9);
    --glass-edge: rgba(229, 231, 255, 0.14);
    --glass-shadow: 0 12px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(229, 231, 255, 0.08);
    --elev-hi: rgba(120, 140, 255, 0.14);
    --elev-lo: rgba(2, 5, 16, 0.75);
    --elev-edge: rgba(229, 231, 255, 0.22);
    color-scheme: dark;
  }
  :root:not([data-theme="light"]):not([data-theme="dark"]) body {
    background:
      radial-gradient(900px 480px at 0% -10%, rgba(123, 63, 246, 0.28), transparent 55%),
      radial-gradient(800px 420px at 100% 0%, rgba(0, 229, 255, 0.12), transparent 50%),
      linear-gradient(180deg, #0B1533 0%, #070e24 100%);
    background-attachment: fixed;
  }
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-tap-highlight-color: transparent; overflow-x: clip; }
body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(900px 480px at 0% -10%, rgba(255, 255, 255, 0.95), transparent 55%),
    radial-gradient(800px 420px at 100% 0%, rgba(214, 222, 234, 0.85), transparent 50%),
    linear-gradient(180deg, #f7f8fb 0%, #e7ebf2 100%);
  background-attachment: fixed;
  color: var(--text);
  font-size: var(--fs-base);
  line-height: var(--lh);
}
img, video, canvas, svg { max-width: 100%; }
img, video { height: auto; }

:where(button, input, select, textarea) { font: inherit; color: inherit; letter-spacing: inherit; }
:where(button) { cursor: pointer; border: 0; background: none; padding: 0; text-align: inherit; touch-action: manipulation; }
button:disabled { cursor: not-allowed; }
:where(a) { color: inherit; text-decoration: none; }
a, button, summary, label { -webkit-touch-callout: none; }
summary { cursor: pointer; }
p { margin: 0 0 var(--s3); }
p:last-child { margin-bottom: 0; }
h1, h2, h3, h4 { margin: 0; line-height: var(--lh-tight); color: var(--text); overflow-wrap: anywhere; }
h1 { font-size: var(--fs-h1); font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: var(--fs-xl); font-weight: 650; letter-spacing: -0.01em; }
h3 { font-size: var(--fs-base); font-weight: 650; }
@media (min-width: 1024px) {
  h1 { font-size: var(--fs-display); }
}
small { font-size: var(--fs-sm); }
code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--surface-2);
  border-radius: var(--r-xs);
  padding: 1px 5px;
  overflow-wrap: anywhere;
}
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s4) 0; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--r-xs); }
::selection { background: var(--primary-soft-2); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Icons */
.icon, .i { width: 20px; height: 20px; flex: none; vertical-align: middle; }

/* ---------- 3. Shell (workspace and admin share it) ---------- */
/* Phone (<768): top bar + content + bottom tab bar.
   Tablet (768–1023): icon rail on the left.
   Desktop (≥1024): sidebar with sections, brand on top, account at the bottom. */
.app-shell {
  min-height: 100dvh;
  padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 20px);
}
.app-nav {
  position: fixed;
  z-index: var(--z-nav);
  left: 12px;
  right: 12px;
  bottom: calc(10px + var(--safe-b));
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: stretch;
  min-height: var(--tabbar-h);
  padding: 6px 8px;
  border: 1px solid var(--glass-edge);
  border-radius: 32px;
  background: var(--glass);
  box-shadow: var(--glass-shadow);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}
.nav-brand, .nav-label, .nav-foot, .nav-item.more-link { display: none; }
.nav-item {
  position: relative;
  min-width: 0;
  min-height: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 2px;
  border-radius: var(--r-md);
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}
.nav-item > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 32px;
  border-radius: var(--r-pill);
  flex: none;
}
.nav-wait {
  position: absolute;
  top: 6px;
  right: 10px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--r-pill);
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
.nav-icon .icon, .nav-icon .i { width: 24px; height: 24px; }
.nav-item[aria-current="page"], .nav-item.on { color: var(--primary-text); }
.nav-item[aria-current="page"] .nav-icon, .nav-item.on .nav-icon { background: var(--primary-soft); }
.nav-item:hover { color: var(--text); }
.nav-item[aria-current="page"]:hover { color: var(--primary-text); }

.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-height: calc(var(--topbar-h) + var(--safe-t));
  margin: 0 12px;
  padding: var(--safe-t) var(--s4) 0;
  border: 1px solid var(--glass-edge);
  border-top: 0;
  border-radius: 0 0 24px 24px;
  background: var(--glass);
  box-shadow: var(--glass-shadow);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}
.topbar-title { flex: 1; min-width: 0; }
.topbar-title strong, .topbar-title small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title strong { font-size: var(--fs-base); font-weight: 650; }
.topbar-title small { font-size: var(--fs-xs); color: var(--muted); }
.brand, .brand-mark {
  display: block;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  background: var(--brand);
  object-fit: cover;
}
.business { display: flex; align-items: center; gap: var(--s3); min-width: 0; min-height: var(--h-md); text-align: left; }
.business > span:last-child { min-width: 0; }
.business strong, .business small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.business strong { font-size: var(--fs-base); font-weight: 650; }
.business small { font-size: var(--fs-xs); color: var(--muted); }
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--h-md);
  height: var(--h-md);
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 650;
  flex: none;
}
main { display: block; min-width: 0; }
.page {
  width: 100%;
  max-width: var(--content-max);
  padding: var(--s6) var(--gutter) var(--s10);
}

/* Phone tab bar stays visible in the post editor. Hiding it made the bottom
   buttons look dead: taps landed on empty space where Сегодня/Ещё used to be. */

@media (min-width: 768px) {
  .app-shell {
    display: grid;
    grid-template-columns: var(--rail-w) minmax(0, 1fr);
    gap: 16px;
    padding: 16px;
    padding-bottom: 16px;
  }
  .topbar { display: none; }
  .app-nav {
    position: sticky;
    top: 16px;
    left: auto;
    right: auto;
    bottom: auto;
    grid-column: 1;
    grid-row: 1 / span 2;
    height: calc(100dvh - 32px);
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: var(--s4) var(--s2);
    border: 1px solid var(--glass-edge);
    border-radius: 28px;
    background: var(--glass);
    box-shadow: var(--glass-shadow);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .app-shell > main { grid-column: 2; min-width: 0; }
  .nav-brand { display: flex; justify-content: center; padding: var(--s1) 0 var(--s3); }
  .nav-brand .business > span:last-child { display: none; }
  .nav-item.more-link { display: flex; }
  .nav-more { display: none !important; }
  .nav-item { min-height: 60px; font-size: 11px; }
  .nav-item > span:last-child { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.15; overflow-wrap: normal; }
  .nav-foot { display: flex; flex-direction: column; gap: 2px; margin-top: auto; padding-top: var(--s3); border-top: 1px solid var(--line); }
}
@media (min-width: 1024px) {
  .app-shell { grid-template-columns: var(--nav-w) minmax(0, 1fr); }
  .app-nav { padding: var(--s4) var(--s3); }
  .nav-brand { justify-content: flex-start; padding: 0 var(--s2) var(--s4); }
  .nav-brand .business > span:last-child { display: block; }
  .nav-label {
    display: block;
    margin: var(--s4) var(--s3) var(--s1);
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--muted);
  }
  .nav-brand + .nav-label { margin-top: 0; }
  .nav-item {
    flex-direction: row;
    justify-content: flex-start;
    gap: var(--s3);
    min-height: var(--h-md);
    padding: 0 var(--s3) 0 var(--s2);
    font-size: var(--fs-md);
    color: var(--text-2);
    text-align: left;
  }
  .nav-icon { width: 28px; height: 28px; border-radius: var(--r-sm); }
  .nav-icon .icon, .nav-icon .i { width: 20px; height: 20px; }
  .nav-item > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .nav-wait { position: static; margin-left: auto; }
  .nav-item:hover { background: var(--surface-2); }
  .nav-item[aria-current="page"], .nav-item.on { background: var(--primary-soft); }
  .nav-item[aria-current="page"] .nav-icon, .nav-item.on .nav-icon { background: transparent; }
}

/* ---------- 4. Page header ---------- */
.title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s3) var(--s4);
  margin: 0 0 var(--s4);
}
.title-row > div:first-child, .title-row > h1 { flex: 1 1 220px; min-width: 0; }
.eyebrow { margin: 0 0 var(--s1); font-size: var(--fs-sm); font-weight: 500; color: var(--muted); }
.page-sub, .catalog-intro, .lead {
  margin: 0 0 var(--s5);
  max-width: 72ch;
  font-size: var(--fs-md);
  line-height: 1.5;
  color: var(--muted);
}
.section-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); min-height: var(--h-md); margin: 0 0 var(--s2); }

/* ---------- 5. Buttons ---------- */
/* .primary — the one main action of a screen; .secondary — tonal blue (supporting action);
   .ghost-button/.ghost — neutral outlined; .text-button — inline action; .danger — outlined destructive
   trigger; .danger.solid — confirmation of a destructive action; .icon-button — 44×44 square. */
.btn, .primary, .secondary, .ghost-button, .ghost, .danger, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: var(--h-md);
  min-width: var(--h-md);
  padding: 0 var(--s4);
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-size: var(--fs-md);
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
  transition: background-color 0.12s, border-color 0.12s, color 0.12s, box-shadow 0.12s;
}
.btn .icon, .primary .icon, .secondary .icon, .ghost-button .icon, .ghost .icon, .danger .icon { width: 18px; height: 18px; }
.primary { background: var(--primary); color: #fff; }
.primary:hover { background: var(--primary-hover); }
.primary:active { background: var(--primary-press); }
.secondary { background: var(--primary-soft); color: var(--primary-text); border-color: var(--primary-soft-2); }
.secondary:hover { background: var(--primary-soft-2); }
.ghost-button, .ghost { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.ghost-button:hover, .ghost:hover { background: var(--surface-2); }
.danger { background: var(--surface); color: var(--danger); border-color: var(--danger-line); }
.danger:hover { background: var(--danger-soft); }
.danger.solid { background: var(--danger-solid); color: #fff; border-color: var(--danger-solid); }
.danger.solid:hover { background: var(--danger); }
.btn.lg, .primary.lg { min-height: var(--h-lg); font-size: var(--fs-base); }
.full { width: 100%; }
.text-button {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  min-height: var(--h-md);
  padding: 0 var(--s2);
  border-radius: var(--r-pill);
  color: var(--primary-text);
  font-size: var(--fs-md);
  font-weight: 600;
}
.text-button:hover { background: var(--primary-soft); }
.text-button .icon { width: 16px; height: 16px; }
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--h-md);
  height: var(--h-md);
  flex: none;
  border-radius: var(--r-pill);
  color: var(--text-2);
}
.icon-button:hover { background: var(--surface-2); }
:is(.btn, .primary, .secondary, .ghost-button, .ghost, .danger, .button, .text-button, .icon-button):disabled,
:is(.btn, .primary, .secondary, .ghost-button, .ghost, .danger, .button)[aria-disabled="true"] {
  opacity: 0.5;
  pointer-events: none;
}
[aria-busy="true"] { cursor: progress; }

/* ---------- 6. Fields ---------- */
:where(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]), select, textarea) {
  width: 100%;
  min-width: 0;
  min-height: var(--h-md);
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-lg);
  font-weight: 400;
  line-height: 1.4;
}
:where(textarea) { min-height: 96px; resize: vertical; }
:where(select) {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 52%, calc(100% - 15px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
:where(input, select, textarea)::placeholder { color: var(--faint); opacity: 1; }
:where(input:not([type="checkbox"]):not([type="radio"]), select, textarea):focus { outline: none; border-color: var(--primary); box-shadow: var(--focus-ring); }
:where(input, select, textarea):disabled, :where(input, textarea)[readonly] { background: var(--surface-2); color: var(--text-2); }
:where(input[type="checkbox"], input[type="radio"]) { width: 20px; height: 20px; margin: 0; accent-color: var(--primary); flex: none; }
:where(input[type="file"]) { max-width: 100%; min-height: var(--h-md); font-size: var(--fs-md); color: var(--text-2); }
input[type="file"]::file-selector-button {
  min-height: 40px;
  margin-right: var(--s3);
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
@media (min-width: 1024px) {
  :where(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]), select, textarea) { font-size: var(--fs-base); }
}
.field, .stack-form label:not(.check):not(.big-check) {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-2);
}
.hint, .field-hint { margin: 0; font-size: var(--fs-sm); line-height: 1.45; color: var(--muted); font-weight: 400; }
.error, .field-error, .login-error { color: var(--danger); font-size: var(--fs-sm); }
.check-row, label.check {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--s3);
  min-height: var(--h-md);
  font-size: var(--fs-base);
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}
.big-check, label.big-check {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-base);
  font-weight: 500;
  line-height: 1.45;
  cursor: pointer;
}
.big-check input { margin-top: 2px; }
.big-check small { display: block; margin-top: 2px; color: var(--muted); font-size: var(--fs-sm); font-weight: 400; }
.big-check:has(input:checked) { border-color: var(--primary-soft-2); background: var(--primary-soft); }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { padding: 0; margin: 0 0 var(--s2); font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); }
.form-actions { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }

/* ---------- 7. Chips, chip rows, segmented control ---------- */
.chip, .filter-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: none;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text-2);
  font-size: var(--fs-md);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.chip:hover, .filter-chip:hover { border-color: var(--n400); }
.chip:has(input:checked), .chip[aria-pressed="true"], .chip.on, .filter-chip.on, .filter-chip[aria-pressed="true"] {
  background: var(--primary-soft);
  border-color: var(--primary-soft-2);
  color: var(--primary-text);
}
.filter-chip span { min-width: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--surface-3); color: var(--text-2); font-size: var(--fs-xs); line-height: 20px; }
.filter-chip.on span { background: var(--primary-soft-2); color: var(--primary-text); }
/* one-line scrolling row on phones (edge to edge), wraps from 768 */
.chip-row, .filter-row, .inbox-filters {
  display: flex;
  gap: var(--s2);
  margin: 0 calc(-1 * var(--gutter)) var(--s4);
  padding: 2px var(--gutter);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-padding: 0 var(--gutter);
}
.chip-row::-webkit-scrollbar, .filter-row::-webkit-scrollbar, .inbox-filters::-webkit-scrollbar { display: none; }
.chip-sep { flex: none; width: 1px; margin: 6px 2px; background: var(--line); }
@media (min-width: 768px) {
  .chip-row, .filter-row, .inbox-filters { flex-wrap: wrap; overflow: visible; margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
}
.seg, .cc-seg, .subtabs, .pv-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--r-md);
  background: var(--surface-3);
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.seg::-webkit-scrollbar, .subtabs::-webkit-scrollbar, .pv-tabs::-webkit-scrollbar { display: none; }
.seg > *, .cc-seg > button, .subtabs > a, .pv-tab {
  flex: 1 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 var(--s3);
  border-radius: 9px;
  color: var(--text-2);
  font-size: var(--fs-md);
  font-weight: 600;
  white-space: nowrap;
}
.seg > [aria-pressed="true"], .seg > .on, .seg > [aria-current="page"],
.cc-seg > button.on, .subtabs > a[aria-current="page"], .pv-tab.on {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--sh-1);
}

/* ---------- 8. Surfaces: cards, rows, badges, notices ---------- */
.card, .panel {
  min-width: 0;
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  border-radius: var(--r-lg);
  box-shadow: var(--glass-shadow);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}
.panel { padding: var(--s4); }
@media (min-width: 1024px) {
  .panel { padding: var(--s5); }
}
:where(button.card, a.card) { display: block; width: 100%; text-align: left; transition: border-color 0.12s, background-color 0.12s; }
:where(button.card, a.card):hover { border-color: var(--line-strong); }
.card-title { font-size: var(--fs-xl); font-weight: 650; }

/* list row: avatar/thumb · text (title, meta, preview) · trailing meta */
.row {
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-height: 72px;
  padding: var(--s3) var(--s4);
  min-width: 0;
}
.row-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.row-main > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { flex: none; display: grid; justify-items: end; gap: 6px; font-size: var(--fs-xs); color: var(--muted); }

/* badges / status pills — one look everywhere */
.badge, .pill, .pill-s, .status, .content-status, .tag, .stock-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  color: var(--text-2);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  vertical-align: middle;
}
.badge.ok, .pill-ok, .pill-s.ok, .status, .s-published { background: var(--success-soft); color: var(--success); }
.badge.warn, .pill-warn, .tag.warning, .stock-label, .s-preview, .s-draft { background: var(--warning-soft); color: var(--warning); }
.badge.err, .pill-error, .s-error, .s-rejected { background: var(--danger-soft); color: var(--danger); }
.badge.info, .tag, .s-approved, .s-confirmed, .pill-local { background: var(--primary-soft); color: var(--primary-text); }
.s-review { background: var(--warning-soft); color: var(--warning); }
.badge.plan, .s-scheduled { background: var(--violet-soft); color: var(--violet); }
.badge.off, .pill-off, .pill-s.off { background: var(--surface-3); color: var(--muted); }
.count-badge { min-width: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--primary); color: #fff; font-size: var(--fs-xs); font-weight: 700; line-height: 20px; text-align: center; }

/* inline notices */
.notice, .state-note {
  display: block;
  margin: 0 0 var(--s3);
  padding: var(--s3) 14px;
  border: 1px solid var(--primary-soft-2);
  border-radius: var(--r-md);
  background: var(--primary-soft);
  color: var(--text);
  font-size: var(--fs-md);
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.notice-ok, .notice.ok, .notice-ok-inline { background: var(--success-soft); border-color: var(--success-line); color: var(--success); }
.notice-warn, .notice.warn, .state-note.warn { background: var(--warning-soft); border-color: var(--warning-line); color: var(--warning); }
.notice-error, .notice.err { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }

/* ---------- 9. Overlays ---------- */
/* Workspace dialog: bottom sheet on phones, centered modal from 768 */
dialog {
  position: fixed;
  inset: auto 0 0;
  width: 100%;
  max-width: 100%;
  max-height: 92dvh;
  margin: 0;
  padding: 0 var(--s4) calc(var(--s4) + var(--safe-b));
  border: 1px solid var(--glass-edge);
  border-bottom: 0;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: var(--glass-strong);
  color: var(--text);
  box-shadow: var(--sh-3);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  overflow-y: auto;
  overscroll-behavior: contain;
}
dialog::backdrop { background: rgba(16, 24, 40, 0.45); }
dialog[open] { animation: sheet-in 0.2s ease-out; }
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.sheet-handle { width: 36px; height: 4px; margin: 8px auto 4px; border-radius: var(--r-pill); background: var(--line-strong); }
.sheet-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  min-height: 56px;
  margin: 0 calc(-1 * var(--s4));
  padding: 0 var(--s2) 0 var(--s4);
  background: var(--surface);
}
.sheet-head h2 { flex: 1; min-width: 0; font-size: var(--fs-h2); overflow-wrap: anywhere; }
.sheet-body { font-size: var(--fs-base); line-height: 1.55; padding-top: var(--s1); }
.modal-open { overflow: hidden; }
@media (min-width: 768px) {
  dialog {
    inset: 0;
    width: min(560px, calc(100% - 48px));
    height: fit-content;
    max-height: min(86dvh, 900px);
    margin: auto;
    padding: 0 var(--s6) var(--s6);
    border-radius: var(--r-xl);
  }
  .sheet-head { margin: 0 calc(-1 * var(--s6)); padding: var(--s2) var(--s3) 0 var(--s6); }
  .sheet-handle { display: none; }
}

/* popover menus (details/summary or JS-toggled) */
.menu-panel, .head-menu-panel, .cc-menu-list, .soc-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: var(--z-menu);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 220px;
  max-width: calc(100vw - 2 * var(--gutter));
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--sh-2);
}
.menu-item, .cc-menu-list button, .head-menu-panel .text-button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--s3);
  width: 100%;
  min-height: var(--h-md);
  padding: 0 var(--s3);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: var(--fs-base);
  font-weight: 500;
  text-align: left;
}
.menu-item:hover, .cc-menu-list button:hover, .head-menu-panel .text-button:hover { background: var(--surface-2); }
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }

/* CSS-only bottom sheet (admin «Ещё», works without JS) */
.sheet-toggle { position: fixed; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.sheet-backdrop { position: fixed; inset: 0; z-index: var(--z-overlay); background: rgba(16, 24, 40, 0.45); opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.css-sheet {
  position: fixed;
  z-index: calc(var(--z-overlay) + 1);
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 86dvh;
  overflow-y: auto;
  padding: 0 var(--s3) calc(var(--s4) + var(--safe-b));
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: var(--surface);
  box-shadow: var(--sh-3);
  transform: translateY(105%);
  visibility: hidden;
  transition: transform 0.22s ease, visibility 0s linear 0.22s;
}
.sheet-toggle:checked ~ .sheet-backdrop { opacity: 1; pointer-events: auto; }
.sheet-toggle:checked ~ .css-sheet { transform: none; visibility: visible; transition: transform 0.22s ease; }
.css-sheet .sheet-head { margin: 0 calc(-1 * var(--s3)); }
.sheet-item {
  display: flex;
  align-items: center;
  gap: var(--s3);
  width: 100%;
  min-height: var(--h-lg);
  padding: 0 var(--s3);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: var(--fs-lg);
  font-weight: 500;
}
.sheet-item:hover { background: var(--surface-2); }
.sheet-item[aria-current="page"] { background: var(--primary-soft); color: var(--primary-text); font-weight: 600; }
.sheet-item.danger-text { color: var(--danger); }
.sheet-item .icon, .sheet-item .i { width: 22px; height: 22px; }
.sheet-list { display: grid; gap: 2px; }
@media (min-width: 768px) {
  .sheet-toggle, .sheet-backdrop, .css-sheet { display: none; }
}

/* ---------- 10. States: empty, loading, progress ---------- */
.empty-state, .catalog-empty, .placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s2);
  padding: var(--s8) var(--s5);
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg);
  color: var(--muted);
}
.empty-state h2, .catalog-empty h2, .placeholder h2 { font-size: var(--fs-xl); color: var(--text); }
.empty-state p, .catalog-empty p, .placeholder p { max-width: 44ch; margin: 0; font-size: var(--fs-md); }
.empty-icon, .placeholder-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--r-lg);
  background: var(--primary-soft);
  color: var(--primary);
}
.demo-note, .loading-note { margin: var(--s3) 0; font-size: var(--fs-md); color: var(--muted); }
.skeleton, .cc-skel-row {
  border-radius: var(--r-md);
  background: linear-gradient(100deg, var(--n100) 30%, var(--n50) 50%, var(--n100) 70%) 0 0 / 300% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { to { background-position: -300% 0; } }
.spinner, .cc-spin {
  display: inline-block;
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid var(--primary-soft-2);
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
progress.bar, .gp-bar, .render-bar {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 6px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  overflow: hidden;
}
progress.bar::-webkit-progress-bar, .gp-bar::-webkit-progress-bar, .render-bar::-webkit-progress-bar { background: var(--surface-3); border-radius: var(--r-pill); }
progress.bar::-webkit-progress-value, .gp-bar::-webkit-progress-value, .render-bar::-webkit-progress-value { background: var(--primary); border-radius: var(--r-pill); }
progress.bar::-moz-progress-bar, .gp-bar::-moz-progress-bar, .render-bar::-moz-progress-bar { background: var(--primary); border-radius: var(--r-pill); }

/* ---------- 11. Data display ---------- */
.table-wrap { max-width: 100%; overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; font-size: var(--fs-md); }
table.data th { font-size: var(--fs-xs); font-weight: 600; color: var(--muted); white-space: nowrap; background: var(--surface-2); }
table.data tr:last-child td { border-bottom: 0; }
dl.kv { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: var(--s2) var(--s4); margin: var(--s3) 0 0; }
dl.kv dt { color: var(--muted); font-size: var(--fs-sm); }
dl.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 767px) {
  dl.kv { grid-template-columns: 1fr; gap: 2px; }
  dl.kv dt { margin-top: var(--s2); }
}
.detail { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s4); padding: var(--s3) 0; border-bottom: 1px solid var(--line); font-size: var(--fs-md); }
.detail > span { color: var(--muted); }
.detail strong { text-align: right; font-weight: 600; overflow-wrap: anywhere; }

/* disclosure */
details.collapse, details.tech, .page-more { border-top: 1px solid var(--line); }
details.collapse > summary, details.tech > summary, .page-more > summary, .disclosure > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  min-height: var(--h-md);
  font-weight: 600;
  color: var(--text);
}
details.collapse > summary::after, details.tech > summary::after, .page-more > summary::after, .disclosure > summary::after {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin: 0 6px 4px auto;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.15s;
}
details[open] > summary::after { transform: rotate(-135deg); margin-bottom: -2px; }

/* platform badges */
.pf-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.pf-badge.xs { width: 20px; height: 20px; border-radius: var(--r-xs); font-size: 9px; }
.pf-ig { background: var(--pf-ig); }
.pf-fb { background: var(--pf-fb); font-size: 15px; }
.pf-fb.xs { font-size: 12px; }
.pf-tt { background: var(--pf-tt); }
.pf-tg { background: var(--pf-tg); }
.pf-yt { background: var(--pf-yt); }
.pf-wa { background: var(--pf-wa); }
.pf-x { background: var(--n500); }

/* ---------- 12. Utilities ---------- */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.muted { color: var(--muted); }
.danger-text { color: var(--danger); }
.ok-text { color: var(--success); }
.stack { display: flex; flex-direction: column; gap: var(--s3); min-width: 0; }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); min-width: 0; }
.break, .wrap-anywhere { overflow-wrap: anywhere; }
.nowrap { white-space: nowrap; }
.tabular { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* phone tab bar vs sidebar items (Сегодня · Входящие · Клиенты · Контент · Настройки) */
.nav-item.side-only { display: none; }
@media (min-width: 768px) {
  .nav-item.side-only { display: flex; }
  .nav-item.tab-only { display: none; }
}

/* error state: same shape as the empty state, danger accent, one recovery action */
.error-state { border-color: var(--danger-line); }
.error-state .empty-icon { background: var(--danger-soft); color: var(--danger); font-size: var(--fs-h2); font-weight: 700; }
.loading-note { display: flex; align-items: center; gap: var(--s2); }

/* keyboard: first Tab jumps over the navigation */
.skip-link { position: absolute; left: var(--s2); top: -100px; z-index: var(--z-viewer); display: inline-flex; align-items: center; min-height: var(--h-md); padding: 0 var(--s4); border-radius: var(--r-md); background: var(--primary); color: #fff; font-weight: 600; }
.skip-link:focus { top: var(--s2); }
main:focus { outline: none; }
.img-fallback { display: grid; place-items: center; border-radius: 50%; background: var(--surface-3); color: var(--text-2); font-weight: 700; }

/* ==========================================================================
   13. Shell v2 (TASK-049): ASS-MEK brand frame + soft 3D elevation.
   Sources: brandbook v2 and UI spec v1 (app/brand-src). Layout rule from the spec:
   desktop ≥1280 sidebar with logo · tablet 769–1279 compact rail with the symbol ·
   phone ≤768 top bar with logo + bottom navigation. Scoped to .app-v2 / body.v2 so the
   admin shell is untouched.
   ========================================================================== */

/* visible focus, WCAG 2.2 AA (≥3:1 against both the page and the gap): violet on light, cyan on navy */
:root { --ring: #5B25D0; --ring-gap: #ffffff; --focus-ring: 0 0 0 2px var(--ring-gap), 0 0 0 4px var(--ring); }
:root[data-theme="dark"] { --ring: #00E5FF; --ring-gap: #0B1533; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) { --ring: #00E5FF; --ring-gap: #0B1533; }
}

/* logo variants per theme (originals from brand-src, never redrawn) */
:root {
  --lg-l: block; --lg-d: none;
  --brand-mountain: url(/assets/brand/mountains-day.jpg);
  /* scrims over the photo: light = pale #E5E7FF veil, dark = navy #0B1533 veil (text stays AA) */
  --scrim-hero: linear-gradient(180deg, rgba(229, 231, 255, 0.04), rgba(229, 231, 255, 0.16));
  --scrim-bar: linear-gradient(rgba(255, 255, 255, 0.66), rgba(255, 255, 255, 0.58));
  --scrim-login: linear-gradient(180deg, rgba(229, 231, 255, 0.04), rgba(229, 231, 255, 0.14));
}
:root[data-theme="dark"] {
  --lg-l: none; --lg-d: block;
  --scrim-hero: linear-gradient(180deg, rgba(11, 21, 51, 0.22), rgba(11, 21, 51, 0.42));
  --scrim-bar: linear-gradient(rgba(11, 21, 51, 0.62), rgba(11, 21, 51, 0.54));
  --scrim-login: linear-gradient(180deg, rgba(11, 21, 51, 0.20), rgba(11, 21, 51, 0.38));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    --lg-l: none; --lg-d: block;
    --scrim-hero: linear-gradient(180deg, rgba(11, 21, 51, 0.22), rgba(11, 21, 51, 0.42));
    --scrim-bar: linear-gradient(rgba(11, 21, 51, 0.62), rgba(11, 21, 51, 0.54));
    --scrim-login: linear-gradient(180deg, rgba(11, 21, 51, 0.20), rgba(11, 21, 51, 0.38));
  }
}
.app-v2 .logo-img, .app-v2 .logo-symbol { display: none; height: auto; }
.app-v2 .logo-symbol { width: 40px; height: 40px; object-fit: contain; }
.app-v2 .logo-top { width: 156px; }
.app-v2 .logo-top.for-light { display: var(--lg-l); }
.app-v2 .logo-top.for-dark { display: var(--lg-d); }
.app-v2 .business { padding: 0; }

/* top bar: brand (phone) / slogan (tablet, desktop) · theme switch · account */
.app-v2 .topbar-brand { flex: 1; min-width: 0; }
.app-v2 .topbar-slogan { display: none; flex: 1; margin: 0; min-width: 0; font-size: var(--fs-md); font-weight: 600; color: var(--text-2); }
.app-v2 .topbar .head-menu { margin-left: 0; }
.theme-switch { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--elev-edge); border-radius: var(--r-pill); box-shadow: var(--elev-inset); }
.ts-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--r-pill); color: var(--text-2); transition: box-shadow var(--elev-ease), background-color var(--elev-ease); }
.ts-btn .icon { width: 20px; height: 20px; }
.ts-btn[aria-pressed="true"] { background: var(--primary); color: #fff; box-shadow: var(--elev-raised-1); }
.ts-btn:not([aria-pressed="true"]):hover { background: var(--surface-3); }
.ts-btn:active { box-shadow: var(--elev-inset); }
.ts-btn:focus-visible { box-shadow: var(--focus-ring); }
/* language switch: same pill as the theme switch; top bar on wide screens, account menu on narrow ones */
.lang-switch { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--elev-edge); border-radius: var(--r-pill); box-shadow: var(--elev-inset); }
.ls-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 8px; border-radius: var(--r-pill); color: var(--text-2); font-size: var(--fs-sm); font-weight: 650; line-height: 1; transition: box-shadow var(--elev-ease), background-color var(--elev-ease); }
.ls-btn[aria-pressed="true"] { background: var(--primary); color: #fff; box-shadow: var(--elev-raised-1); }
.ls-btn:not([aria-pressed="true"]):hover { background: var(--surface-3); }
.ls-btn:active { box-shadow: var(--elev-inset); }
.ls-btn:focus-visible { box-shadow: var(--focus-ring); }
.lang-switch.lang-top { display: none; }
.head-menu-panel .lang-switch.lang-menu { display: flex; justify-content: space-between; margin: 4px; }
.head-menu-panel .lang-switch.lang-menu .ls-btn { flex: 1; }
@media (min-width: 768px) {
  .lang-switch.lang-top { display: inline-flex; }
  .head-menu-panel .lang-switch.lang-menu { display: none; }
}

/* hero band: decorative area of the spec (90–140 px phone, 120–200 px desktop).
   The mountain art itself is NOT in the brand package as a standalone file (see report):
   set --brand-mountain: url(/assets/brand/<file>) once it is supplied. Until then — brand gradient only. */
.app-v2 .hero-band {
  height: 96px;
  margin: var(--s3) 12px 0;
  border: 1px solid var(--elev-edge);
  border-radius: var(--card-radius);
  background-color: var(--ass-navy);
  background-image: var(--scrim-hero), var(--brand-mountain);
  background-size: cover;
  background-position: center 62%;
  box-shadow: var(--elev-inset);
}
/* top bar: the same mountain photo behind a stronger scrim, so slogan / switch / avatar keep AA contrast */
.app-v2 .topbar {
  background-color: var(--ass-navy);
  background-image: var(--scrim-bar), var(--brand-mountain);
  background-size: cover;
  background-position: center 40%;
  /* sharp photo: no blur behind the bar */
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
/* login: mountain behind the card (fixed, whole page) */
body.login {
  background-color: var(--ass-navy);
  background-image: var(--scrim-login), var(--brand-mountain);
  background-size: cover;
  background-position: center bottom;
  background-attachment: fixed;
}
/* ≥1600 px wide screens use the 2K original; phones decode the same file scaled down (no upscaling anywhere) */

/* ---- tablet and desktop (≥769): grid with topbar · hero · main ---- */
@media (min-width: 768px) {
  .app-v2 .topbar { display: flex; grid-column: 2; grid-row: 1; top: 16px; margin: 0; padding: 0 var(--s4); border-top: 1px solid var(--elev-edge); border-radius: var(--r-lg); }
  .app-v2 .hero-band { grid-column: 2; grid-row: 2; height: 140px; margin: 0; }
  .app-v2 > main { grid-column: 2; grid-row: 3; }
  .app-v2 .app-nav { grid-row: 1 / span 3; }
  .app-v2 .topbar-brand { display: none; }
  .app-v2 .topbar-slogan { display: block; }
  .app-v2 .logo-symbol { display: block; }
  .app-v2 .nav-item.side-only { display: flex; }
}
/* tablet 1024–1279 keeps the compact rail (the base rules would switch to the sidebar at 1024) */
@media (min-width: 1024px) and (max-width: 1279px) {
  .app-v2 { grid-template-columns: var(--rail-w) minmax(0, 1fr); }
  .app-v2 .app-nav { padding: var(--s4) var(--s2); }
  .app-v2 .nav-brand { justify-content: center; padding: var(--s1) 0 var(--s3); }
  .app-v2 .nav-item { flex-direction: column; justify-content: center; gap: 4px; min-height: 60px; padding: 6px 2px; font-size: 11px; color: var(--muted); text-align: center; }
  .app-v2 .nav-icon { width: 52px; height: 32px; border-radius: var(--r-pill); }
  .app-v2 .nav-icon .icon { width: 24px; height: 24px; }
  .app-v2 .nav-item > span:last-child { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.15; }
  .app-v2 .nav-wait { position: absolute; margin-left: 0; }
  .app-v2 .nav-item:hover, .app-v2 .nav-item[aria-current="page"] { background: none; }
  .app-v2 .nav-item[aria-current="page"] .nav-icon { background: var(--primary-soft); }
  .app-v2 .nav-brand .business > span { display: none; }
}
/* desktop ≥1280: sidebar with the full logo (180–240 px wide per brandbook) */
@media (min-width: 1280px) {
  .app-v2 { grid-template-columns: var(--nav-w) minmax(0, 1fr); }
  .app-v2 .logo-symbol { display: none; }
  .app-v2 .logo-full { width: 200px; }
  .app-v2 .logo-full.for-light { display: var(--lg-l); }
  .app-v2 .logo-full.for-dark { display: var(--lg-d); }
  .app-v2 .nav-item[aria-current="page"] { background: linear-gradient(90deg, #7B3FF6, #4F5BFF); color: #fff; }
  .app-v2 .nav-item[aria-current="page"]:hover { color: #fff; }
  .app-v2 .nav-item[aria-current="page"] .nav-wait { background: #fff; color: #5B25D0; }
  .app-v2 .hero-band { height: 160px; }
}
/* exactly 768 is a phone (spec: ≤768 bottom navigation): undo the base rail for it */
@media (min-width: 768px) and (max-width: 768px) {
  .app-v2 { display: block; padding: 0 0 calc(var(--tabbar-h) + var(--safe-b) + 20px); }
  .app-v2 .topbar { position: sticky; top: 0; margin: 0 12px; border-top: 0; border-radius: 0 0 24px 24px; }
  .app-v2 .hero-band { margin: var(--s3) 12px 0; height: 96px; }
  .app-v2 .topbar-brand { display: block; }
  .app-v2 .topbar-slogan, .app-v2 .logo-symbol { display: none; }
  .app-v2 .app-nav { position: fixed; top: auto; left: 12px; right: 12px; bottom: calc(10px + var(--safe-b)); height: auto; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; padding: 6px 8px; border-radius: 32px; overflow: visible; }
  .app-v2 .nav-brand, .app-v2 .nav-foot { display: none; }
  .app-v2 .nav-item { min-height: 64px; font-size: var(--fs-xs); }
  .app-v2 .nav-item > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* ---- soft 3D (--elev-*): menu, tiles and buttons raised; search/fields inset; press = inset in 150 ms ---- */
body.v2 .app-nav, body.v2 .topbar { border-color: var(--elev-edge); box-shadow: var(--elev-raised-2); }
body.v2 .nav-item { transition: box-shadow var(--elev-ease), background-color var(--elev-ease), color var(--elev-ease); }
body.v2 .nav-item:active { box-shadow: var(--elev-inset); }
body.v2 .nav-item:focus-visible { box-shadow: var(--focus-ring); }
body.v2 .nav-item[aria-current="page"] .nav-icon { box-shadow: var(--elev-inset); }
@media (min-width: 1280px) {
  body.v2 .nav-item[aria-current="page"] { box-shadow: var(--elev-raised-1); }
  body.v2 .nav-item[aria-current="page"] .nav-icon { box-shadow: none; }
  body.v2 .nav-item[aria-current="page"]:active { box-shadow: var(--elev-inset); }
  body.v2 .nav-item[aria-current="page"]:focus-visible { box-shadow: var(--elev-raised-1), var(--focus-ring); }
}
body.v2 .avatar { border: 1px solid var(--elev-edge); box-shadow: var(--elev-raised-1); }
body.v2 .head-menu > summary:focus-visible { box-shadow: var(--elev-raised-1), var(--focus-ring); }

/* tiles */
body.v2 :is(.card, .panel, .work-card):not(.inbox-row) { border-color: var(--elev-edge); box-shadow: var(--elev-raised-1); }
body.v2 :is(button.card, a.card, .work-card):active { box-shadow: var(--elev-inset); }
body.v2 :is(button.card, a.card, .work-card) { transition: box-shadow var(--elev-ease), border-color var(--elev-ease); }
body.v2 :is(button.card, a.card, .work-card):focus-visible { box-shadow: var(--elev-raised-1), var(--focus-ring); }

/* buttons and chips */
body.v2 :is(.btn, .primary, .secondary, .ghost-button, .ghost, .danger, .button) {
  border-color: var(--elev-edge);
  box-shadow: var(--elev-raised-1);
  transition: box-shadow var(--elev-ease), background-color var(--elev-ease), border-color var(--elev-ease), color var(--elev-ease);
}
body.v2 .primary { border-color: transparent; }
body.v2 :is(.btn, .primary, .secondary, .ghost-button, .ghost, .danger, .button):active { box-shadow: var(--elev-inset); }
body.v2 :is(.btn, .primary, .secondary, .ghost-button, .ghost, .danger, .button):focus-visible { box-shadow: var(--elev-raised-1), var(--focus-ring); }
body.v2 :is(.btn, .primary, .secondary, .ghost-button, .ghost, .danger, .button):disabled { box-shadow: none; }
body.v2 :is(.text-button, .icon-button):focus-visible { box-shadow: var(--focus-ring); }

/* search and fields: pressed-in */
body.v2 :where(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]), select, textarea) {
  border-color: var(--elev-edge);
  box-shadow: var(--elev-inset);
  transition: box-shadow var(--elev-ease), border-color var(--elev-ease);
}
body.v2 :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea):focus,
body.v2 :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea):focus-visible { border-color: var(--primary); box-shadow: var(--elev-inset), var(--focus-ring); }
body.v2 .seg, body.v2 .cc-seg, body.v2 .subtabs, body.v2 .pv-tabs { box-shadow: var(--elev-inset); }

/* phone: the bottom bar keeps clear of the home indicator; ≤768 content padding 16 px */
@media (max-width: 768px) {
  .app-v2 .page { padding-left: 16px; padding-right: 16px; }
}

/* ==========================================================================
   14. Home / Today (TASK-050): summary cards, quick actions, list cards.
   Reference: app/brand-src/tz/.../references 01/02 (main dark / light).
   Markup + styles only; tokens and --elev-* from parts 1–2. Scoped to .page-today.
   ========================================================================== */
.page-today .title-row { margin-bottom: var(--s4); }
.page-today .title-row h1 { font-size: 28px; line-height: 1.15; letter-spacing: -0.02em; }
.page-today .today-slogan { margin: var(--s1) 0 0; font-size: var(--fs-md); color: var(--text-2); }

/* summary cards: equal size, icon tile + label + number */
.kpi-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); margin: 0 0 var(--s4); }
.kpi-card {
  display: flex; align-items: center; gap: var(--s3); min-width: 0; min-height: 76px; padding: var(--s3) var(--s4);
  background: var(--surface); border: 1px solid var(--elev-edge); border-radius: var(--r-lg); box-shadow: var(--elev-raised-1);
}
.kpi-ico { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; color: #fff; box-shadow: var(--elev-raised-1); }
.kpi-ico .icon { width: 24px; height: 24px; }
.k-cyan .kpi-ico { background: linear-gradient(135deg, #00B8D9, #4F5BFF); }
.k-purple .kpi-ico { background: linear-gradient(135deg, #7B3FF6, #B04FF0); }
.k-green .kpi-ico { background: linear-gradient(135deg, #12B981, #00B8D9); }
.kpi-body { display: grid; gap: 2px; min-width: 0; }
.kpi-label { font-size: var(--fs-sm); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi-num { font-size: 26px; line-height: 1.1; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }

/* layout: lists + quick actions (side by side on wide screens) */
.today-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s4); align-items: start; }
.page-today .today-work { min-width: 0; }
.page-today .today-block {
  padding: var(--s4); background: var(--surface); border: 1px solid var(--elev-edge); border-radius: var(--r-lg); box-shadow: var(--elev-raised-1);
}
.page-today .today-block + .today-block { margin-top: var(--s4); }
.page-today .today-sub { font-size: var(--fs-xl); font-weight: 650; color: var(--text); }
.page-today .today-block .inbox-row { box-shadow: none; background: var(--surface-2); }
.page-today .today-empty { padding: var(--s4); background: var(--surface); border: 1px solid var(--elev-edge); border-radius: var(--r-lg); box-shadow: var(--elev-raised-1); max-width: none; }

/* quick actions: 2×2 tiles of one size */
.quick-card { padding: var(--s4); background: var(--surface); border: 1px solid var(--elev-edge); border-radius: var(--r-lg); box-shadow: var(--elev-raised-1); }
.quick-card .today-sub { margin-bottom: var(--s3); font-size: var(--fs-xl); font-weight: 650; color: var(--text); }
.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
.quick-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s2); min-width: 0; min-height: 84px; padding: var(--s3) var(--s2);
  background: var(--surface-2); color: var(--text); border: 1px solid var(--elev-edge); border-radius: var(--r-lg); box-shadow: var(--elev-raised-1);
  font-size: var(--fs-sm); font-weight: 600; text-align: center;
  transition: box-shadow var(--elev-ease);
}
.quick-btn:active { box-shadow: var(--elev-inset); }
.quick-btn:focus-visible { box-shadow: var(--elev-raised-1), var(--focus-ring); }
.quick-ico { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--primary-soft); color: var(--primary-text); }
.quick-ico .icon { width: 22px; height: 22px; }
.quick-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (min-width: 1100px) {
  .today-layout { grid-template-columns: minmax(0, 1fr) 280px; }
}
/* narrow phones: cards stack in one column so numbers and labels never clip */
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: minmax(0, 1fr); gap: var(--s2); }
  .kpi-card { min-height: 64px; }
  .page-today .title-row h1 { font-size: 24px; }
}

/* ==========================================================================
   15. Other sections (TASK-051): Inbox, Clients/CRM, Content, Catalog, Settings/Profile, Admin.
   Same soft-3D language as parts 1–3 (--elev-*, tokens from app/brand-src). Styles only.
   Raised = list rows, cards, columns, tables; inset = fields, tabs, chips-bar; press = inset in 150 ms.
   ========================================================================== */

/* list rows and cards: raised tiles */
body.v2 :is(.inbox-row, .crm-card, .catalog-item, .inbox-pane, .crm-col) {
  border-color: var(--elev-edge);
  transition: box-shadow var(--elev-ease), border-color var(--elev-ease), background-color var(--elev-ease);
}
body.v2 :is(.inbox-row, .crm-card, .catalog-item) { box-shadow: var(--elev-raised-1); }
body.v2 :is(.inbox-row, .crm-card, .catalog-item):active { box-shadow: var(--elev-inset); }
body.v2 :is(.inbox-row, .crm-card, .catalog-item):focus-visible { box-shadow: var(--elev-raised-1), var(--focus-ring); }
body.v2 .inbox-row[aria-current="true"] { box-shadow: var(--elev-inset); }
body.v2 .crm-col { box-shadow: var(--elev-inset); }
body.v2 .crm-col .crm-card { background: var(--surface); }
body.v2 .crm-col.drop { box-shadow: var(--elev-inset), 0 0 0 2px var(--primary); }
body.v2 .inbox-pane.thread, body.v2 .inbox-pane.customer { box-shadow: var(--elev-raised-1); }
body.v2 .inbox-list { gap: var(--s3); }

/* chat: composer inset, bubbles flat-raised */
body.v2 .composer-wrap { border-top-color: var(--elev-edge); }
body.v2 .thread-head { border-bottom-color: var(--elev-edge); }

/* chips / filters: raised, selected = pressed-in */
body.v2 :is(.chip, .filter-chip) { border-color: var(--elev-edge); box-shadow: var(--elev-raised-1); transition: box-shadow var(--elev-ease), background-color var(--elev-ease), border-color var(--elev-ease); }
body.v2 :is(.chip:has(input:checked), .chip[aria-pressed="true"], .chip.on, .filter-chip.on, .filter-chip[aria-pressed="true"], .crm-stage-tabs .filter-chip[aria-selected="true"]) { box-shadow: var(--elev-inset); }
body.v2 :is(.chip, .filter-chip):active { box-shadow: var(--elev-inset); }
body.v2 :is(.chip, .filter-chip):focus-visible, body.v2 .chip:has(input:focus-visible) { box-shadow: var(--elev-raised-1), var(--focus-ring); }

/* settings / profile blocks, product details, big checks */
body.v2 .set-block { border-color: var(--elev-edge); box-shadow: var(--elev-raised-1); }
body.v2 .big-check { border-color: var(--elev-edge); box-shadow: var(--elev-raised-1); }
body.v2 .big-check:has(input:checked) { box-shadow: var(--elev-inset); }
body.v2 .big-check:has(input:focus-visible) { box-shadow: var(--elev-raised-1), var(--focus-ring); }
body.v2 .product-field, body.v2 .package-contents { border-color: var(--elev-edge); }

/* switches: checkboxes in settings rows look like toggles (keyboard focus ring kept) */
body.v2 :is(.check-row, label.check) input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; flex: none; position: relative;
  width: 44px; height: 26px; margin: 0; border: 1px solid var(--elev-edge); border-radius: var(--r-pill);
  background: var(--surface-3); box-shadow: var(--elev-inset); cursor: pointer;
  transition: background-color var(--elev-ease), box-shadow var(--elev-ease);
}
body.v2 :is(.check-row, label.check) input[type="checkbox"]::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--surface-solid, #fff); border: 1px solid var(--elev-edge); box-shadow: var(--elev-raised-1);
  transition: transform var(--elev-ease);
}
body.v2 :is(.check-row, label.check) input[type="checkbox"]:checked { background: var(--primary); border-color: transparent; }
body.v2 :is(.check-row, label.check) input[type="checkbox"]:checked::after { transform: translateX(18px); }
body.v2 :is(.check-row, label.check) input[type="checkbox"]:focus-visible { box-shadow: var(--elev-inset), var(--focus-ring); }
body.v2 :is(.check-row, label.check) input[type="checkbox"]:disabled { opacity: 0.5; cursor: not-allowed; }

/* tables */
body.v2 .table-wrap, body.admin .table-wrap { border-color: var(--elev-edge); box-shadow: var(--elev-raised-1); }
body.v2 table.data th, body.admin table.data th { background: var(--surface-2); border-bottom: 1px solid var(--elev-edge); }
body.v2 table.data tbody tr:hover td, body.admin table.data tbody tr:hover td { background: var(--primary-soft); }

/* modal windows / bottom sheets */
body.v2 dialog, body.admin dialog { border-color: var(--elev-edge); box-shadow: var(--elev-raised-2); }
body.v2 dialog::backdrop, body.admin dialog::backdrop { background: rgba(11, 21, 51, 0.55); }
body.v2 .sheet-head { border-bottom: 1px solid var(--elev-edge); }
body.v2 .sheet-item:focus-visible { box-shadow: var(--focus-ring); }
body.v2 :is(.menu-panel, .head-menu-panel, .cc-menu-list, .soc-menu-panel, .tpl-list) { border-color: var(--elev-edge); box-shadow: var(--elev-raised-2); }

/* empty states: raised dashed tile with brand icon tile */
body.v2 :is(.empty-state, .catalog-empty, .placeholder) { border-color: var(--elev-edge); border-style: dashed; box-shadow: var(--elev-inset); }
body.v2 :is(.empty-icon, .placeholder-icon) { box-shadow: var(--elev-raised-1); }
body.v2 .pane-empty, body.v2 .crm-col-empty { border-color: var(--elev-edge); }

/* notices and toasts */
body.v2 :is(.notice, .state-note) { box-shadow: var(--elev-raised-1); }
body.v2 :is(.cc-toast, .crm-toast) { border: 1px solid var(--elev-edge); box-shadow: var(--elev-raised-2); }

/* content calendar and media cards (content.css classes use the common .card/.panel/.cc-* names) */
body.v2 :is(.cc-card, .cc-post, .cc-tile, .cc-item) { border-color: var(--elev-edge); }
body.v2 :is(.cc-card, .cc-post, .cc-tile, .cc-item) { box-shadow: var(--elev-raised-1); }
body.v2 :is(.cc-card, .cc-post, .cc-tile, .cc-item):active { box-shadow: var(--elev-inset); }
body.v2 :is(.cc-card, .cc-post, .cc-tile, .cc-item):focus-visible { box-shadow: var(--elev-raised-1), var(--focus-ring); }

/* admin (body.admin): same tiles, fields and buttons; its shell stays as is */
body.admin :is(.panel, .vendor, .soc, .account, .ig-card, .dev-tile, .dev-block, .stat-tiles li, .page-more) { border-color: var(--elev-edge); box-shadow: var(--elev-raised-1); }
body.admin .dev-tile { transition: box-shadow var(--elev-ease), border-color var(--elev-ease); }
body.admin .dev-tile:active { box-shadow: var(--elev-inset); }
body.admin .dev-tile:focus-visible { outline: 0; box-shadow: var(--elev-raised-1), var(--focus-ring); }
body.admin .steps li { border-color: var(--elev-edge); box-shadow: var(--elev-raised-1); }
body.admin .steps li.current { box-shadow: var(--elev-inset); }
body.admin :is(.btn, .primary, .secondary, .ghost-button, .ghost, .danger, .button) {
  border-color: var(--elev-edge); box-shadow: var(--elev-raised-1);
  transition: box-shadow var(--elev-ease), background-color var(--elev-ease), border-color var(--elev-ease), color var(--elev-ease);
}
body.admin .primary { border-color: transparent; }
body.admin :is(.btn, .primary, .secondary, .ghost-button, .ghost, .danger, .button):active { box-shadow: var(--elev-inset); }
body.admin :is(.btn, .primary, .secondary, .ghost-button, .ghost, .danger, .button):focus-visible { box-shadow: var(--elev-raised-1), var(--focus-ring); }
body.admin :is(.btn, .primary, .secondary, .ghost-button, .ghost, .danger, .button):disabled { box-shadow: none; }
body.admin :where(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]), select, textarea) {
  border-color: var(--elev-edge); box-shadow: var(--elev-inset); transition: box-shadow var(--elev-ease), border-color var(--elev-ease);
}
body.admin :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea):focus-visible { border-color: var(--primary); box-shadow: var(--elev-inset), var(--focus-ring); }
body.admin :is(.text-button, .icon-button, .back-link, .table-link):focus-visible { outline: 0; box-shadow: var(--focus-ring); }
body.admin .empty-state, body.admin .catalog-empty { border-color: var(--elev-edge); box-shadow: var(--elev-inset); }
body.admin :is(.app-nav, .topbar) { border-color: var(--elev-edge); }

/* narrow screens: no horizontal scroll from raised tiles; dialogs keep clear of the home indicator */
@media (max-width: 480px) {
  body.v2 .inbox-row { padding: var(--s3); gap: var(--s2); }
  body.v2 .table-wrap, body.admin .table-wrap { margin-left: 0; margin-right: 0; }
  body.v2 dialog { padding-bottom: calc(var(--s4) + var(--safe-b)); }
}
@media (prefers-reduced-motion: reduce) {
  body.v2 :is(.check-row, label.check) input[type="checkbox"], body.v2 :is(.check-row, label.check) input[type="checkbox"]::after { transition: none; }
}

/* ==========================================================================
   16. Shell v3 (TASK-063): approved mock-up A.
   Left menu #0B1533 248 px (collapses to a 68 px icon rail) · hero 200 px with the mountain photo ·
   AI panel 340 px (hides to an edge tab) · focus mode · phone ≤768: hero, 3 cards, bottom menu, round AI button.
   Colours, logos and the photo are the originals from app/brand-src (assets/brand).
   ========================================================================== */
.sh {
  --cn: 248px; --aiw: clamp(320px, var(--ai-w, 340px), 70vw); --ca: var(--aiw);
  --sh-pop: #ffffff;
  --sh-scrim: linear-gradient(180deg, rgba(11, 21, 51, 0.34), rgba(11, 21, 51, 0.52));
  /* left menu + phone tab bar: light theme = theme tokens, dark theme = brand navy (blocks below) */
  --nv-bg: var(--glass-strong); --nv-fg: var(--text-2); --nv-fg-hi: var(--text); --nv-fg-mute: var(--muted);
  --nv-edge: var(--line); --nv-hover: var(--surface-3); --nv-shadow: var(--sh-2);
  --nv-on-bg: var(--primary-soft); --nv-on-fg: var(--primary-text); --nv-on-edge: var(--primary);
  --nv-on-glow: 0 0 0 1px var(--primary-soft-2);
  --nv-btn-bg: var(--surface-2); --nv-btn-edge: var(--line-strong); --nv-btn-shadow: var(--elev-raised-1);
  --nv-ring: 0 0 0 2px var(--ring-gap), 0 0 0 4px var(--ring);
  --nv-badge-bg: var(--primary); --nv-badge-fg: #fff; --nv-count: var(--primary-text);
  --nv-tip-bg: var(--text); --nv-tip-fg: var(--bg);
  --nv-logo-l: block; --nv-logo-d: none;
  display: grid; grid-template-columns: var(--cn) minmax(0, 1fr) var(--ca); min-height: 100dvh;
  transition: grid-template-columns 200ms ease;
}
:root[data-theme="dark"] .sh {
  --sh-pop: #111D44; --sh-scrim: linear-gradient(180deg, rgba(11, 21, 51, 0.5), rgba(11, 21, 51, 0.66));
  --nv-bg: #0B1533; --nv-fg: #C9CEF5; --nv-fg-hi: #fff; --nv-fg-mute: rgba(201, 206, 245, 0.6);
  --nv-edge: rgba(229, 231, 255, 0.1); --nv-hover: rgba(229, 231, 255, 0.09); --nv-shadow: 6px 0 24px rgba(2, 5, 16, 0.25);
  --nv-on-bg: #5B25D0; --nv-on-fg: #fff; --nv-on-edge: rgba(0, 229, 255, 0.6);
  --nv-on-glow: 0 0 0 1px rgba(0, 229, 255, 0.25), 0 0 18px rgba(0, 229, 255, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  --nv-btn-bg: rgba(229, 231, 255, 0.08); --nv-btn-edge: rgba(229, 231, 255, 0.18);
  --nv-btn-shadow: -3px -3px 8px rgba(120, 140, 255, 0.1), 4px 4px 10px rgba(2, 5, 16, 0.6);
  --nv-ring: 0 0 0 2px #0B1533, 0 0 0 4px #00E5FF;
  --nv-badge-bg: #00E5FF; --nv-badge-fg: #0B1533; --nv-count: #00E5FF;
  --nv-tip-bg: #0B1533; --nv-tip-fg: #fff;
  --nv-logo-l: none; --nv-logo-d: block;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) .sh {
    --sh-pop: #111D44; --sh-scrim: linear-gradient(180deg, rgba(11, 21, 51, 0.5), rgba(11, 21, 51, 0.66));
    --nv-bg: #0B1533; --nv-fg: #C9CEF5; --nv-fg-hi: #fff; --nv-fg-mute: rgba(201, 206, 245, 0.6);
    --nv-edge: rgba(229, 231, 255, 0.1); --nv-hover: rgba(229, 231, 255, 0.09); --nv-shadow: 6px 0 24px rgba(2, 5, 16, 0.25);
    --nv-on-bg: #5B25D0; --nv-on-fg: #fff; --nv-on-edge: rgba(0, 229, 255, 0.6);
    --nv-on-glow: 0 0 0 1px rgba(0, 229, 255, 0.25), 0 0 18px rgba(0, 229, 255, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.22);
    --nv-btn-bg: rgba(229, 231, 255, 0.08); --nv-btn-edge: rgba(229, 231, 255, 0.18);
    --nv-btn-shadow: -3px -3px 8px rgba(120, 140, 255, 0.1), 4px 4px 10px rgba(2, 5, 16, 0.6);
    --nv-ring: 0 0 0 2px #0B1533, 0 0 0 4px #00E5FF;
    --nv-badge-bg: #00E5FF; --nv-badge-fg: #0B1533; --nv-count: #00E5FF;
    --nv-tip-bg: #0B1533; --nv-tip-fg: #fff;
    --nv-logo-l: none; --nv-logo-d: block;
  }
}
.sh[data-nav="mini"] { --cn: 68px; }
.sh[data-ai="closed"] { --ca: 0px; }
.sh[data-focus="1"] { --cn: 0px; --ca: 0px; }
.sh-main { min-width: 0; }
.sh .page { max-width: none; padding: var(--s6) 28px var(--s10); }

/* --- left menu --- */
.sh-nav {
  position: sticky; top: 0; z-index: 35; display: flex; flex-direction: column; height: 100dvh;
  background: var(--nv-bg); color: var(--nv-fg); border-right: 1px solid var(--nv-edge);
  box-shadow: var(--nv-shadow); overflow: visible;
}
.sh[data-focus="1"] .sh-nav { visibility: hidden; border: 0; box-shadow: none; }
.sh-nav-top { padding: 20px 16px 12px; }
.sh-brand { display: block; width: 100%; border-radius: 14px; }
.sh-logo-full { display: block; width: 100%; height: auto; border-radius: 12px; }
.sh-logo-full.for-light { display: var(--nv-logo-l); }
.sh-logo-full.for-dark { display: var(--nv-logo-d); }
.sh-logo-mini { display: none; margin: 0 auto; width: 40px; height: 40px; object-fit: contain; }
.sh-nav-list { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 4px; padding: 8px 12px; overflow-y: auto; overscroll-behavior: contain; }
.sh-item {
  position: relative; display: flex; align-items: center; gap: 12px; flex: none; height: 44px; padding: 0 12px;
  border-radius: 14px; border: 1px solid transparent; color: var(--nv-fg); font-size: var(--fs-md); font-weight: 600; white-space: nowrap;
  transition: background-color var(--elev-ease), box-shadow var(--elev-ease), color var(--elev-ease);
}
.sh-ico { display: grid; place-items: center; flex: none; width: 24px; height: 24px; }
.sh-ico .icon { width: 22px; height: 22px; }
.sh-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sh-item:hover { background: var(--nv-hover); color: var(--nv-fg-hi); }
.sh-item[aria-current="page"] {
  background: var(--nv-on-bg); color: var(--nv-on-fg); border-color: var(--nv-on-edge);
  box-shadow: var(--nv-on-glow);
}
.sh-item:focus-visible, .sh-collapse:focus-visible, .sh-tab:focus-visible { box-shadow: var(--nv-ring); }
.sh-sep { flex: none; margin: 8px 4px; border: 0; border-top: 1px solid var(--nv-edge); }
.sh-group { display: flex; flex-direction: column; gap: 4px; flex: none; }
.sh-group-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; height: 28px; padding: 0 12px; border-radius: 10px;
  color: var(--nv-fg-mute); font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; text-align: left;
}
.sh-group-head:hover { color: var(--nv-fg-hi); }
.sh-group-head:focus-visible { box-shadow: var(--nv-ring); }
.sh-chev { display: grid; place-items: center; flex: none; width: 16px; height: 16px; transition: transform var(--elev-ease); }
.sh-chev .icon { width: 14px; height: 14px; }
.sh-group.is-closed .sh-chev { transform: rotate(-90deg); }
.sh-group-items { display: flex; flex-direction: column; gap: 4px; }
.sh-group.is-closed .sh-group-items { display: none; }
button.sh-item { width: 100%; background: none; font-family: inherit; text-align: left; cursor: pointer; }
.sh-logout { color: var(--nv-fg); }
/* icon rail: no headers, groups are told apart by separators and always open */
.sh[data-nav="mini"] .sh-group-head { display: none; }
.sh[data-nav="mini"] .sh-group.is-closed .sh-group-items { display: flex; }
.sh-badge {
  display: inline-flex; align-items: center; justify-content: center; margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 999px; background: var(--nv-badge-bg); color: var(--nv-badge-fg); font-size: var(--fs-xs); font-weight: 700; line-height: 1;
}
.sh-nav-foot { padding: 8px 12px 16px; }
.sh-collapse {
  display: flex; align-items: center; gap: 12px; width: 100%; height: 44px; padding: 0 12px; border-radius: 14px;
  background: var(--nv-btn-bg); border: 1px solid var(--nv-btn-edge); color: var(--nv-fg-hi); font-size: var(--fs-md); font-weight: 600;
  box-shadow: var(--nv-btn-shadow); transition: box-shadow var(--elev-ease);
}
.sh-collapse:active { box-shadow: var(--elev-inset); }
.sh-collapse .icon { width: 22px; height: 22px; margin: 0 1px; }
/* icon rail 68 px: labels go to a tooltip */
.sh[data-nav="mini"] .sh-nav-top { padding: 20px 0 12px; }
.sh[data-nav="mini"] .sh-logo-full { display: none; }
.sh[data-nav="mini"] .sh-logo-mini { display: block; }
.sh[data-nav="mini"] .sh-nav-list { overflow: visible; padding: 8px 12px; }
.sh[data-nav="mini"] .sh-item, .sh[data-nav="mini"] .sh-collapse { justify-content: center; width: 44px; padding: 0; }
.sh[data-nav="mini"] .sh-nav-foot { display: flex; justify-content: center; padding: 8px 0 16px; }
.sh[data-nav="mini"] .sh-label { display: none; }
.sh[data-nav="mini"] .sh-badge { position: absolute; top: -4px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px; }
.sh[data-nav="mini"] .sh-item::after {
  content: attr(data-tip); position: absolute; left: calc(100% + 14px); top: 50%; transform: translateY(-50%); z-index: 50;
  padding: 6px 10px; border-radius: 10px; background: var(--nv-tip-bg); color: var(--nv-tip-fg); border: 1px solid var(--nv-on-edge);
  font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; box-shadow: 0 6px 18px rgba(2, 5, 16, 0.5); opacity: 0; pointer-events: none; transition: opacity var(--elev-ease);
}
.sh[data-nav="mini"] .sh-item:hover::after, .sh[data-nav="mini"] .sh-item:focus-visible::after { opacity: 1; }
@media (max-height: 700px) {
  .sh-item { height: 40px; }
  .sh-nav-top { padding-top: 12px; }
}
/* compact grouped menu: small muted group labels, thin separators, whole menu fits ~800px without scrolling */
.sh-nav-list { gap: 0; padding: 4px 12px; }
.sh-nav-top { padding: 14px 16px 6px; }
.sh-nav-foot { padding: 6px 12px 10px; }
.sh-item { height: 34px; border-radius: 10px; }
.sh-group, .sh-group-items { gap: 1px; }
.sh-group-head { height: 20px; padding: 0 12px; border-radius: 6px; font-size: 10px; font-weight: 600; letter-spacing: 0.08em; color: var(--nv-fg-mute); }
.sh-chev, .sh-chev .icon { width: 12px; height: 12px; }
.sh-group-head { justify-content: flex-start; }
.sh-group-head { transition: height var(--elev-ease), font-size var(--elev-ease), color var(--elev-ease), background var(--elev-ease); }
.sh-group.is-closed .sh-group-head { height: 34px; padding: 0 12px; font-size: var(--fs-sm); font-weight: 600; letter-spacing: 0.02em; text-transform: none; color: var(--nv-fg-hi); background: var(--nv-hover); border-radius: 10px; }
.sh-group.is-closed .sh-chev, .sh-group.is-closed .sh-chev .icon { width: 16px; height: 16px; }
.sh-count { display: none; }
.sh-group.is-closed .sh-count { display: inline; color: var(--nv-count); }
.sh-sep { margin: 3px 8px; border-top-width: 1px; border-top-color: var(--nv-edge); }
.sh-collapse { height: 34px; border-radius: 10px; }
.sh[data-nav="mini"] .sh-nav-list { padding: 4px 12px; }
.sh[data-nav="mini"] .sh-nav-top { padding: 14px 0 6px; }
.sh[data-nav="mini"] .sh-item, .sh[data-nav="mini"] .sh-collapse { width: 44px; }
.sh[data-nav="mini"] .sh-nav-foot { padding: 6px 0 10px; }
@media (max-height: 700px) {
  .sh-item, .sh-collapse { height: 30px; }
  .sh-nav-top { padding-top: 8px; }
  .sh-group-head { height: 16px; }
}

/* --- hero with the photo --- */
.sh-hero {
  position: relative; display: flex; flex-direction: column; gap: 20px; min-height: 104px; padding: 16px 28px 28px; color: #fff;
  background-color: #0B1533; background-image: var(--sh-scrim), var(--brand-mountain); background-size: cover; background-position: center 60%;
  border-radius: 0 0 28px 28px; box-shadow: var(--elev-raised-2);
}
.sh-hero.is-today { min-height: 200px; padding-bottom: 88px; }
.sh[data-focus="1"] .sh-hero.is-today { min-height: 104px; padding-bottom: 28px; }
.sh-hero:not(.is-today) .sh-hero-text, .sh[data-focus="1"] .sh-hero-text { display: none; }
.sh-hero-bar { display: flex; align-items: center; gap: var(--s3); }
.sh-hero-logo { display: none; flex: none; width: 44px; height: 44px; place-items: center; }
.sh-hero-logo img { width: 36px; height: 36px; object-fit: contain; }
.sh-hero-actions { display: flex; align-items: center; gap: var(--s2); margin-left: auto; flex: none; } /* margin-left:auto держит кнопки справа, когда виджет цели скрыт */
.sh-glass {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.16); border: 1px solid rgba(255, 255, 255, 0.34); color: #fff; font-size: var(--fs-md); font-weight: 600;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 6px 16px rgba(11, 21, 51, 0.28); transition: background-color var(--elev-ease), box-shadow var(--elev-ease);
}
.sh-glass.icon { width: 44px; padding: 0; }
button.sh-glass:hover { background: rgba(255, 255, 255, 0.26); }
button.sh-glass:active { box-shadow: inset 2px 2px 6px rgba(11, 21, 51, 0.35); }
.sh-glass:focus-visible, .sh-hero .avatar:focus-visible { box-shadow: 0 0 0 2px #0B1533, 0 0 0 4px #00E5FF; }
.sh-glass[aria-pressed="true"] { background: #5B25D0; border-color: rgba(0, 229, 255, 0.7); }
.sh-glass:disabled { opacity: 0.55; cursor: not-allowed; }
.sh-search { flex: 1 1 auto; max-width: 440px; min-width: 0; padding: 0 16px; }
.sh-search input {
  flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; background: transparent; box-shadow: none; color: #fff; font-size: var(--fs-md);
}
.sh-search input::placeholder { color: rgba(255, 255, 255, 0.85); }
.sh-search input:focus, .sh-search input:focus-visible { box-shadow: none; border: 0; outline: 0; }
.sh-search:focus-within { box-shadow: 0 0 0 2px #0B1533, 0 0 0 4px #00E5FF; }
.sh-search input::-webkit-search-cancel-button { filter: invert(1); }
/* выпадающие результаты общего поиска (TASK-097): тот же фон, что у меню шапки */
.sh-search-pop { position: absolute; top: calc(100% + 8px); left: 0; z-index: 70; width: max(100%, 340px); max-width: calc(100vw - 2 * var(--gutter)); max-height: min(70vh, 480px); overflow-y: auto; padding: var(--s2); border-radius: var(--r-lg); background: var(--sh-pop); color: var(--text); border: 1px solid var(--elev-edge); box-shadow: var(--elev-raised-1); text-align: left; font-weight: 400; }
.sh-search-pop[hidden] { display: none; }
.sh-search-group h4 { margin: var(--s2) var(--s2) 2px; color: var(--muted); font-size: var(--fs-sm); font-weight: 600; text-transform: none; }
.sh-search-item { display: grid; gap: 2px; width: 100%; min-height: var(--h-md); padding: 8px var(--s2); border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.sh-search-item:hover, .sh-search-item:focus-visible { background: var(--surface-2); }
.sh-search-item strong { font-size: var(--fs-md); font-weight: 600; overflow-wrap: anywhere; }
.sh-search-item span { color: var(--muted); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.sh-search-empty { margin: 0; padding: var(--s3); color: var(--muted); font-size: var(--fs-md); }
/* виджет целей в шапке (TASK-075): между поиском и «Фокусом»; цели меняются по кругу */
.gw { flex: 1 1 0; min-width: 170px; gap: 2px; padding: 0 6px 0 4px; justify-content: flex-start; font-weight: 500; }
.gw[hidden], .gw-nav[hidden] { display: none; }
.gw-main { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; height: 100%; padding: 0 6px; border: 0; border-radius: 999px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.gw-main:focus-visible, .gw-arrow:focus-visible, .gw-dot:focus-visible { outline: 2px solid #00E5FF; outline-offset: 1px; }
.gw-ico { display: inline-flex; flex: none; }
.gw-ico .icon, .gw-ico svg { width: 20px; height: 20px; }
.gw-text { display: grid; gap: 2px; min-width: 0; line-height: 1.15; }
.gw-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-sm); font-weight: 650; }
.gw-prog { display: flex; align-items: center; gap: 8px; min-width: 0; }
.gw-stats { flex: none; font-size: var(--fs-xs); font-variant-numeric: tabular-nums; white-space: nowrap; }
.gw .kpi-bar { flex: 1 1 auto; min-width: 28px; height: 5px; margin: 0; background: rgba(255, 255, 255, 0.28); box-shadow: none; }
.gw-empty .gw-title { font-weight: 600; }
.gw-nav { display: inline-flex; align-items: center; flex: none; gap: 2px; }
.gw-arrow { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: none; color: inherit; cursor: pointer; }
.gw-arrow:hover { background: rgba(255, 255, 255, 0.22); }
.gw-arrow .icon, .gw-arrow svg { width: 14px; height: 14px; }
.gw-dots { display: inline-flex; align-items: center; gap: 2px; }
.gw-dot { position: relative; width: 12px; height: 24px; padding: 0; border: 0; background: none; cursor: pointer; }
.gw-dot::after { content: ""; position: absolute; left: 3px; top: 9px; width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, 0.45); }
.gw-dot[aria-current="true"]::after { background: #fff; }
.sh-bell .sh-badge { position: absolute; top: -4px; right: -4px; margin: 0; min-width: 20px; height: 20px; }
.sh-hero .head-menu { position: relative; }
.sh-hero .avatar {
  width: 44px; height: 44px; background: rgba(255, 255, 255, 0.2); color: #fff; border: 1px solid rgba(255, 255, 255, 0.4);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 6px 16px rgba(11, 21, 51, 0.28);
}
.sh-hero .head-menu-panel { background: var(--sh-pop); color: var(--text); border: 1px solid var(--elev-edge); z-index: 60; }
.sh-hero .head-menu-panel .lang-switch.lang-menu { display: flex; }
.sh-hero-text h1 { color: #fff; font-size: clamp(26px, 3vw, 36px); line-height: 1.15; text-shadow: 0 2px 12px rgba(11, 21, 51, 0.5); }
.sh-eyebrow { margin: 0 0 4px; color: rgba(255, 255, 255, 0.92); font-size: var(--fs-md); font-weight: 600; text-shadow: 0 1px 8px rgba(11, 21, 51, 0.5); }
.sh-sum { margin: 6px 0 0; color: #fff; font-size: var(--fs-base); text-shadow: 0 1px 8px rgba(11, 21, 51, 0.5); }

/* --- Today: summary cards overlap the hero --- */
.sh .page-today { position: relative; z-index: 2; margin-top: -64px; padding-top: 0; }
.sh[data-focus="1"] .page-today { margin-top: 0; padding-top: var(--s6); }
.page-today .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); }
.page-today button.kpi-card { width: 100%; text-align: left; align-items: flex-start; min-height: 104px; }
.k-orange .kpi-ico { background: linear-gradient(135deg, #F59E0B, #EF7A1A); }
.kpi-note { display: block; color: var(--muted); font-size: var(--fs-xs); line-height: 1.3; }
.kpi-bar { display: block; height: 6px; margin-top: 6px; border-radius: 999px; background: var(--surface-3); box-shadow: inset 1px 1px 3px var(--elev-lo); overflow: hidden; }
.kpi-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #12B981, #00B8D9); }
.today-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); align-items: stretch; }
.sh-card {
  display: flex; flex-direction: column; min-width: 0; padding: var(--s5); background: var(--surface); border: 1px solid var(--elev-edge);
  border-radius: var(--r-lg); box-shadow: var(--elev-raised-1);
}
.sh-card-title { margin-bottom: var(--s3); font-size: var(--fs-xl); font-weight: 650; }
.wk-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--s2); margin-bottom: var(--s3); }
.wk-head .sh-card-title { margin: 0; min-width: 0; }
.wk-sync[hidden] { display: none; }
.wk-sync span { white-space: normal; text-align: left; }
.wk-sync-status { margin: 0 0 var(--s3); overflow-wrap: anywhere; }
.sh-card-body { flex: 1; min-height: 120px; }
.sh-list { display: grid; gap: var(--s2); margin: 0; padding: 0; list-style: none; }
.sh-row {
  display: flex; align-items: center; gap: var(--s3); width: 100%; min-height: 58px; padding: 10px 12px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--elev-edge); text-align: left; transition: box-shadow var(--elev-ease);
}
.sh-row:active { box-shadow: var(--elev-inset); }
.sh-row:focus-visible { box-shadow: var(--focus-ring); }
.sh-row.late { background: var(--warning-soft); border-color: var(--warning-line); }
.sh-row-main { display: grid; flex: 1; min-width: 0; gap: 2px; }
.sh-row-main strong, .sh-row-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-row-main strong { font-size: var(--fs-base); font-weight: 650; color: var(--text); }
.sh-row.late .sh-row-main strong, .sh-row.late .sh-row-main small { color: var(--warning); }
.sh-row-main small { font-size: var(--fs-sm); color: var(--muted); }
.sh-row-meta { display: flex; flex: none; flex-direction: column; align-items: flex-end; gap: 4px; color: var(--muted); font-size: var(--fs-xs); }
.sh-dot { flex: none; width: 20px; height: 20px; border: 2px solid var(--primary); border-radius: 50%; }
.sh-row.late .sh-dot { border-color: var(--warning-strong); }
.sh-net { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: #5f6779; color: #fff; font-size: var(--fs-sm); font-weight: 700; }
.sh-net.n-instagram { background: var(--pf-ig); }
.sh-net.n-facebook { background: var(--pf-fb); }
.sh-net.n-tiktok { background: var(--pf-tt); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35); }
.sh-net.n-telegram { background: var(--pf-tg); }
.sh-net.n-youtube { background: var(--pf-yt); }
.sh-net.n-whatsapp { background: var(--pf-wa); color: #0B1533; }
.sh-empty { margin: 0; padding: var(--s3); border: 1px dashed var(--elev-edge); border-radius: var(--r-md); color: var(--text-2); font-size: var(--fs-md); line-height: 1.5; }
.sh-raised {
  display: flex; align-items: center; justify-content: center; gap: var(--s2); width: 100%; min-height: 48px; margin-top: var(--s4); padding: 0 var(--s4);
  border-radius: var(--r-md); background: linear-gradient(145deg, #8A55FA, #6A2FE0); border: 1px solid rgba(255, 255, 255, 0.25); color: #fff; font-size: var(--fs-md); font-weight: 650;
  box-shadow: var(--elev-raised-1); transition: box-shadow var(--elev-ease);
}
.sh-raised .icon { width: 20px; height: 20px; }
.sh-raised:active { box-shadow: var(--elev-inset); }
.sh-raised:focus-visible { box-shadow: var(--elev-raised-1), var(--focus-ring); }
.sh-raised.sm { min-height: 40px; margin: 0; flex: 1; }
.sh-raised:disabled { opacity: 0.55; box-shadow: none; }
.sh-link { color: var(--primary-text); font-size: var(--fs-md); font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
.sh-mob-only { display: none; }

/* --- AI panel --- */
.sh-ai {
  position: sticky; top: 0; z-index: 30; display: flex; flex-direction: column; gap: var(--s3); height: 100dvh; min-width: 0; padding: var(--s4);
  background: var(--sh-pop); border-left: 1px solid var(--elev-edge); box-shadow: -6px 0 24px rgba(11, 21, 51, 0.1); overflow-x: hidden; overflow-y: auto;
}
.sh[data-ai="closed"] .sh-ai, .sh[data-focus="1"] .sh-ai { visibility: hidden; padding: 0; border: 0; box-shadow: none; overflow: hidden; }
.sh-ai-grip { position: fixed; top: 0; bottom: 0; right: calc(var(--aiw) - 5px); z-index: 31; width: 10px; cursor: col-resize; touch-action: none; background: transparent; }
.sh-ai-grip::after { content: ""; position: absolute; top: 50%; left: 3px; width: 4px; height: 48px; margin-top: -24px; border-radius: 999px; background: var(--elev-edge); transition: background 120ms ease; }
.sh-ai-grip:hover::after, .sh-ai-grip.drag::after, .sh-ai-grip:focus-visible::after { background: var(--primary-text); }
.sh-ai-grip:focus-visible { outline: none; }
.sh[data-ai="closed"] .sh-ai-grip, .sh[data-focus="1"] .sh-ai-grip { display: none; }
body.ai-resizing { cursor: col-resize; user-select: none; -webkit-user-select: none; }
body.ai-resizing .sh-ai, body.ai-resizing .sh-main { pointer-events: none; }
.sh-ai-head { display: flex; align-items: center; gap: var(--s2); }
.sh-ai-head strong { flex: 1; min-width: 0; font-size: var(--fs-lg); }
.sh-ai-ico { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: linear-gradient(135deg, #7B3FF6, #00B8D9); color: #fff; box-shadow: var(--elev-raised-1); }
.sh-ai-ico .icon { width: 20px; height: 20px; }
.sh-ai .sh-glass { background: var(--surface-3); color: var(--text); border-color: var(--elev-edge); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: var(--elev-raised-1); }
.sh-ai .sh-glass:disabled { box-shadow: none; }
.sh-ai-block { display: grid; gap: var(--s3); padding: var(--s3); border: 1px solid var(--elev-edge); border-radius: var(--r-lg); box-shadow: var(--elev-inset); }
.sh-ai-block h3 { font-size: var(--fs-base); }
.sh-ai-btns { display: flex; gap: var(--s2); }
.sh-ai-chat { display: grid; align-content: start; gap: var(--s2); flex: 1 1 0; min-height: 120px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
.sh-ai > * { flex-shrink: 0; }
.sh-ai > .sh-ai-chat { flex-shrink: 1; }
.sh-ai > .sh-ai-block { max-height: 34%; overflow-y: auto; }
.sh-msg { margin: 0; padding: var(--s3); border-radius: var(--r-md); font-size: var(--fs-md); line-height: 1.5; }
.sh-msg.bot { background: var(--surface-3); color: var(--text); border-top-left-radius: 4px; }
.sh-ai-chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.sh-ai-chips button { min-height: 36px; padding: 0 var(--s3); border-radius: 999px; border: 1px solid var(--elev-edge); background: var(--surface-2); color: var(--text); font-size: var(--fs-sm); font-weight: 600; box-shadow: var(--elev-raised-1); }
.sh-ai-chips button:disabled { opacity: 0.6; box-shadow: none; cursor: not-allowed; }
.sh-ai-form { display: flex; align-items: center; gap: var(--s2); }
.sh-ai-form input { flex: 1; min-width: 0; height: 44px; padding: 0 var(--s4); border-radius: 999px; }
.sh-ai-tab {
  position: fixed; right: 0; top: 50%; z-index: 30; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 44px; min-height: 76px;
  transform: translateY(-50%); border-radius: 16px 0 0 16px; background: linear-gradient(160deg, #7B3FF6, #5B25D0); color: #fff; border: 1px solid rgba(0, 229, 255, 0.5); border-right: 0;
  box-shadow: -4px 4px 14px rgba(91, 37, 208, 0.45), 0 0 14px rgba(0, 229, 255, 0.35);
}
.sh-ai-tab .icon { width: 22px; height: 22px; }
.sh-ai-tab b { min-width: 22px; height: 22px; padding: 0 4px; border-radius: 999px; background: #00E5FF; color: #0B1533; font-size: var(--fs-xs); line-height: 22px; text-align: center; }
.sh-ai-tab:focus-visible, .sh-fab:focus-visible { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #5B25D0; }
.sh-fab {
  position: fixed; right: 20px; bottom: calc(20px + var(--safe-b)); z-index: 36; display: none; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(145deg, #8A55FA, #5B25D0); border: 1px solid rgba(0, 229, 255, 0.55); box-shadow: 0 8px 22px rgba(91, 37, 208, 0.5), 0 0 14px rgba(0, 229, 255, 0.4);
}
.sh-dots { display: flex; gap: 4px; }
.sh-dots i { width: 7px; height: 7px; border-radius: 50%; background: #fff; }
.sh-tabs { display: none; }

/* >=1280: three columns; the AI tab appears at the edge when the panel is hidden */
@media (min-width: 1280px) {
  .sh[data-ai="closed"]:not([data-focus="1"]) .sh-ai-tab { display: flex; }
}
/* <1280: two columns, the AI panel is a drawer opened by the round button */
@media (max-width: 1279px) {
  .sh { grid-template-columns: var(--cn) minmax(0, 1fr); }
  .sh-ai { position: fixed; top: 0; right: 0; bottom: 0; width: min(var(--aiw), 100vw); height: auto; transform: translateX(105%); visibility: hidden; transition: transform 200ms ease, visibility 0s linear 200ms; box-shadow: -10px 0 30px rgba(2, 5, 16, 0.3); }
  .sh[data-ai="open"] .sh-ai { transform: none; visibility: visible; transition: transform 200ms ease; }
  .sh[data-ai="closed"] .sh-ai { padding: var(--s4); border-left: 1px solid var(--elev-edge); }
  .sh[data-focus="1"] .sh-ai { visibility: hidden; }
  .sh-fab { display: flex; }
  .sh[data-ai="open"] .sh-fab, .sh[data-focus="1"] .sh-fab { display: none; }
  .sh[data-ai="open"] .sh-ai { z-index: 70; }
  .sh-ai-grip { z-index: 71; }
}
@media (max-width: 1100px) {
  .page-today .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .today-cols { grid-template-columns: minmax(0, 1fr); }
}

/* --- phone <=768 --- */
@media (max-width: 768px) {
  .sh { display: block; padding-bottom: calc(72px + var(--safe-b) + 28px); }
  .sh-nav { display: none; }
  .sh .page { padding: var(--s4) 16px var(--s6); }
  .sh-hero { gap: 14px; min-height: 96px; padding: 12px 16px 20px; border-radius: 0 0 24px 24px; }
  .sh-hero.is-today { min-height: 168px; padding-bottom: 64px; }
  .sh-hero-logo { display: grid; }
  .sh-hero-bar { gap: var(--s2); flex-wrap: wrap; }
  .sh-hero-actions { gap: 6px; }
  .gw { order: 3; flex: 1 1 100%; min-width: 0; }
  .sh-focus, .sh-ai-head .sh-glass { display: none; }
  .sh-search { padding: 0 12px; }
  .sh-hero-text h1 { font-size: 24px; }
  .sh .page-today { margin-top: -48px; padding-top: 0; }
  .sh[data-focus="1"] .page-today { margin-top: 0; padding-top: var(--s4); }
  .page-today .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2); }
  .page-today .kpi-card.k-orange { display: none; }
  .page-today button.kpi-card { flex-direction: column; align-items: flex-start; gap: var(--s2); min-height: 112px; padding: var(--s3); }
  .page-today .kpi-note { display: none; }
  .page-today .kpi-num { font-size: 24px; }
  .sh-mob-only { display: flex; margin-top: var(--s4); }
  .sh-card { padding: var(--s4); }
  .sh-tabs {
    position: fixed; left: 12px; right: 12px; bottom: calc(10px + var(--safe-b)); z-index: 40; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; padding: 6px;
    border-radius: 28px; background: var(--nv-bg); border: 1px solid var(--nv-edge); box-shadow: var(--nv-shadow);
  }
  .sh-tab {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0; min-height: 56px; padding: 4px 2px; border-radius: 22px;
    color: var(--nv-fg); font-size: var(--fs-xs); font-weight: 600; line-height: 1.2;
  }
  .sh-tab > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sh-tab[aria-current="page"] { background: var(--nv-on-bg); color: var(--nv-on-fg); box-shadow: var(--nv-on-glow); }
  .sh-tab .sh-badge { position: absolute; top: 2px; right: 8px; min-width: 18px; height: 18px; padding: 0 4px; margin: 0; }
  .sh-fab { bottom: calc(10px + 72px + var(--safe-b) + 14px); right: 16px; }
  .sh-ai { top: 0; left: 0; right: 0; bottom: 0; width: auto; max-height: none; height: 100dvh; border-radius: 0; border-left: 0; border-top: 0; transform: translateY(105%); padding-bottom: calc(var(--s4) + var(--safe-b)); }
  .sh-ai-grip, .sh[data-ai="open"] .sh-ai-grip { display: none; }
  .sh[data-ai="open"] .sh-ai { transform: none; }
  .sh[data-ai="open"] .sh-ai-head .sh-glass { display: inline-flex; }
  .sh-ai-head .sh-glass .icon { transform: rotate(90deg); }
  body.inbox-thread-open .sh-hero, body.inbox-thread-open .sh-tabs, body.inbox-thread-open .sh-fab, body.inbox-card-open .sh-hero, body.inbox-card-open .sh-tabs, body.inbox-card-open .sh-fab { display: none; }
}
@media (max-width: 380px) {
  .sh-hero-actions .sh-bell { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sh, .sh-ai { transition: none; }
}

/* ---------- 17. Звонки и встречи, Дела (TASK-065) ---------- */
.sh-net.n-call { background: linear-gradient(135deg, #7B3FF6, #B04FF0); }
.sh-net.n-meeting { background: linear-gradient(135deg, #F59E0B, #EF7A1A); }
.sh-net .icon { width: 18px; height: 18px; }
.wk-form { display: grid; gap: var(--s3); }
.wk-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.wk-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wk-grid[hidden], .wk-dup[hidden] { display: none; }
.wk-found, .wk-dup { display: grid; gap: var(--s2); }
.wk-pick { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; min-height: 48px; padding: 8px 12px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--elev-edge); text-align: left; color: var(--text); }
.wk-pick small { color: var(--muted); font-size: var(--fs-sm); }
.wk-pick:focus-visible { box-shadow: var(--focus-ring); }
.wk-total { display: grid; gap: 4px; margin-bottom: var(--s3); }
.wk-lists, .wk-items { display: grid; gap: var(--s3); margin: 0; padding: 0; list-style: none; }
.wk-items { gap: var(--s1, 4px); margin-top: var(--s2); }
.wk-list { display: grid; gap: var(--s1, 4px); padding: var(--s3); border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--elev-edge); }
.wk-list.late { background: var(--warning-soft); border-color: var(--warning-line); }
.wk-list.is-complete { opacity: 0.75; }
.wk-list-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); }
.wk-list-title { display: grid; gap: 2px; min-width: 0; }
.wk-list-title strong { font-size: var(--fs-base); font-weight: 650; color: var(--text); overflow-wrap: anywhere; }
.wk-list-title small, .wk-count, .wk-note { color: var(--muted); font-size: var(--fs-sm); }
.wk-list.late .wk-list-title strong { color: var(--warning); }
.wk-list-meta { display: flex; flex: none; align-items: center; gap: var(--s2); }
.wk-item { display: grid; gap: 2px; }
.wk-tick { display: flex; align-items: center; gap: var(--s3); width: 100%; min-height: 44px; padding: 4px 0; text-align: left; color: var(--text); font-size: var(--fs-base); }
.wk-tick:focus-visible { box-shadow: var(--focus-ring); border-radius: var(--r-md); }
.wk-tick .sh-dot { display: grid; place-items: center; color: #fff; }
.wk-tick .sh-dot .icon { width: 14px; height: 14px; }
.wk-item.is-done .sh-dot { background: var(--success); border-color: var(--success); }
.wk-item.is-done .wk-text { text-decoration: line-through; color: var(--muted); }
.wk-text { min-width: 0; overflow-wrap: anywhere; }
.wk-comment { justify-self: start; min-height: 32px; font-size: var(--fs-sm); }
.wk-note { padding-left: 32px; }
.wk-item-row { display: flex; align-items: center; gap: var(--s2); }
.wk-item-row .wk-tick { flex: 1; min-width: 0; }
.wk-text { overflow-wrap: anywhere; }
.wk-item-del { flex: none; display: grid; place-items: center; width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; color: var(--muted); }
.wk-item-del .icon { width: 18px; height: 18px; }
.wk-assign { margin-top: var(--s3); }
.wk-add { display: flex; align-items: flex-end; gap: var(--s2); margin-top: var(--s3); }
.wk-add .field { flex: 1; min-width: 0; margin: 0; }
.wk-add button { flex: none; min-height: 44px; }
.wk-build { display: grid; gap: var(--s2); }
.wk-build-label { font-weight: 600; }
.wk-build-list { display: grid; gap: var(--s2); margin: 0; padding: 0; list-style: none; }
.wk-build-row { display: flex; align-items: center; gap: var(--s2); min-height: 44px; }
.wk-build-row.is-drag { opacity: .5; }
.wk-build-grip { flex: none; width: 16px; color: var(--muted); cursor: grab; text-align: center; user-select: none; }
.wk-build-box { flex: none; width: 20px; height: 20px; border: 2px solid var(--primary); border-radius: 5px; }
.wk-build-input { flex: 1; min-width: 0; min-height: 44px; }
.wk-build-rev, .wk-build-del { flex: none; display: grid; place-items: center; width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; color: var(--muted); }
.wk-build-rev { font-weight: 700; font-size: var(--fs-base); }
.wk-build-rev.is-on { color: var(--primary); border-color: var(--primary); background: var(--primary-soft, transparent); }
.wk-build-del .icon { width: 18px; height: 18px; }
.wk-build-add { justify-self: start; min-height: 44px; }
.wk-review { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); padding-left: 32px; }
.wk-review .text-button { min-height: 32px; min-width: 120px; font-size: var(--fs-sm); }
.wk-review .badge, .wk-note.is-returned { overflow-wrap: anywhere; }
.wk-note.is-returned { color: var(--danger, var(--muted)); }
@media (max-width: 768px) {
  .wk-grid, .wk-grid-2 { grid-template-columns: minmax(0, 1fr); }
}

/* «Дела» и «Звонки и встречи»: две колонки (TASK-079) — слева список, справа подробности и неделя; на телефоне правый блок открывается по тапу */
.wk-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s5); align-items: start; }
.wk-col { min-width: 0; }
.wk-side { display: grid; gap: var(--s4); min-width: 0; position: sticky; top: var(--s4); }
.wk-detail { display: grid; gap: var(--s3); padding: var(--s4); border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--elev-edge); }
.wk-detail.late { background: var(--warning-soft); border-color: var(--warning-line); }
.wk-detail h3 { margin: 0; font-size: var(--fs-lg); font-weight: 650; overflow-wrap: anywhere; }
.wk-detail p { margin: 0; overflow-wrap: anywhere; }
.wk-actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
.wk-back { display: none; justify-self: start; min-height: 40px; }
.wk-pickrow[aria-pressed="true"] { border-color: var(--primary); box-shadow: var(--focus-ring); }
.wk-pickrow.is-complete { opacity: 0.75; }
.wk-sums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2); }
.wk-sum { display: grid; gap: 2px; padding: var(--s3); border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--elev-edge); }
.wk-sum strong { font-size: var(--fs-xl); font-variant-numeric: tabular-nums; }
.wk-sum small { color: var(--muted); font-size: var(--fs-sm); }
.wk-sum.warn { background: var(--warning-soft); border-color: var(--warning-line); }
.wk-sum.warn strong { color: var(--warning); }
.wk-week { display: grid; gap: var(--s2); }
.wk-week h3 { margin: 0; font-size: var(--fs-lg); font-weight: 650; }
.wk-days { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.wk-day { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: var(--s2); align-items: start; padding: 6px var(--s2); border-radius: var(--r-md); border: 1px solid transparent; }
.wk-day.is-today { background: var(--primary-soft); border-color: var(--primary); }
.wk-dow { color: var(--text-2); font-size: var(--fs-sm); white-space: nowrap; }
.wk-dow b { color: var(--text); }
.wk-chips { display: grid; gap: 4px; min-width: 0; }
.wk-chip { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: var(--fs-sm); color: var(--text); }
.wk-chip .icon { flex: none; width: 14px; height: 14px; }
.wk-chip > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-chip.c-task .icon { color: var(--success); }
.wk-chip.c-call .icon, .wk-chip.c-next .icon { color: var(--primary-text); }
.wk-chip.c-meeting .icon { color: var(--warning); }
.wk-more, .wk-free { color: var(--muted); font-size: var(--fs-sm); }
/* TASK-099: удаление/правка/перенос звонков и встреч прямо в разделе */
.wk-callli { display: flex; align-items: stretch; gap: var(--s2); }
.wk-callli > .wk-pickrow { flex: 1 1 auto; min-width: 0; }
/* TASK-099: группы «Предстоящие / Прошедшие», блок итога, красная «Удалить» в углу карточки */
.wk-group { display: flex; align-items: baseline; gap: var(--s2); margin: var(--s4) 0 var(--s2); font-size: var(--fs-md); font-weight: 650; }
.wk-group:first-child { margin-top: 0; }
.wk-group-n { color: var(--muted); font-size: var(--fs-sm); font-weight: 500; }
.wk-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); }
.wk-head-row > :first-child { min-width: 0; flex: 1 1 auto; }
.wk-corner { flex: none; min-height: 36px; padding: 0 var(--s3); }
.wk-outcome { display: grid; gap: var(--s3); padding: var(--s3); border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--warning-line); }
.wk-outcome > .badge { justify-self: start; }
.wk-outcome-btns > button { flex: 1 1 0; min-width: 0; }
.wk-chip[draggable="true"] { cursor: grab; }
.wk-day.is-drop { background: var(--primary-soft); border-color: var(--primary); }
.wk-toast { position: fixed; left: 50%; bottom: var(--s5); transform: translateX(-50%); z-index: 1000; max-width: calc(100vw - 32px); padding: var(--s2) var(--s4); border-radius: var(--r-md); background: var(--text); color: var(--surface); font-size: var(--fs-sm); opacity: 0; pointer-events: none; transition: opacity .2s; }
.wk-toast.is-on { opacity: 1; }
@media (max-width: 1023px) {
  .wk-split { grid-template-columns: minmax(0, 1fr); }
  .wk-side { display: none; position: static; }
  .wk-split.is-side .wk-col { display: none; }
  .wk-split.is-side .wk-side { display: grid; }
  .wk-back { display: inline-flex; align-items: center; }
}

/* ---------- 17b. Окна «Состоялся / Не состоялся» (TASK-085) ---------- */
.cd-form { padding-bottom: var(--s2); }
.cd-fieldset { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; gap: var(--s2); }
.cd-fieldset legend { padding: 0; margin-bottom: var(--s1, 4px); font-weight: 650; }
.cd-seg { display: flex; flex-wrap: wrap; gap: var(--s2); }
.cd-seg label { flex: 1 1 0; min-width: 96px; position: relative; display: block; }
.cd-seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.cd-seg span { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 12px; border-radius: var(--r-md); border: 1px solid var(--elev-edge); background: var(--surface-2); color: var(--text); text-align: center; line-height: 1.25; }
.cd-seg input:checked + span { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-text); font-weight: 650; }
.cd-seg input:focus-visible + span { box-shadow: var(--focus-ring); }
.cd-chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.cd-chips:empty { display: none; }
.cd-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 2px 4px 2px 12px; border-radius: var(--r-pill); background: var(--primary-soft); color: var(--primary-text); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.cd-chip button { min-width: 28px; min-height: 28px; border-radius: var(--r-pill); color: inherit; }
.contact-dialog .form-actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
.contact-dialog .form-actions > button { flex: 1 1 140px; }

/* ---------- 18. ИИ-помощник: панель и настройки (TASK-066) ---------- */
.sh-msg.me { background: var(--primary-soft); color: var(--primary-text); border-top-right-radius: 4px; justify-self: end; max-width: 92%; white-space: pre-wrap; overflow-wrap: anywhere; }
.sh-msg.bot { white-space: pre-wrap; overflow-wrap: anywhere; }
.sh-msg.bot.md { white-space: normal; }
.sh-msg.md .md-line { display: block; }
.sh-msg.md .md-line + .md-line, .sh-msg.md ul + .md-line, .sh-msg.md .md-line + ul { margin-top: var(--s2); }
.sh-msg.md ul { margin: var(--s2) 0 0; padding-left: 20px; display: grid; gap: 4px; }
.sh-msg.md ul:first-child { margin-top: 0; }
/* TASK-123: таблицы в ответах Асмека */
.sh-msg.md { min-width: 0; max-width: 100%; }
.sh-msg.md .md-table-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; margin: var(--s2) 0; border: 1px solid var(--line-strong); border-radius: 8px; }
.sh-msg.md .md-table-wrap:first-child { margin-top: 0; }
.sh-msg.md .md-table { border-collapse: collapse; width: 100%; font-size: var(--fs-sm, 13px); line-height: 1.4; color: var(--text); }
.sh-msg.md .md-table th, .sh-msg.md .md-table td { padding: 6px 10px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: normal; }
.sh-msg.md .md-table th:last-child, .sh-msg.md .md-table td:last-child { border-right: 0; }
.sh-msg.md .md-table tbody tr:last-child td { border-bottom: 0; }
.sh-msg.md .md-table th { background: var(--surface-3); font-weight: 600; white-space: nowrap; }
.sh-msg.md .md-table td { min-width: 72px; }
.sh-msg.err { background: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger-line); }
.ai-think { color: var(--muted); font-style: italic; }
.ai-steps { margin: 0; padding-left: 20px; display: grid; gap: var(--s2); color: var(--text); font-size: var(--fs-md); line-height: 1.5; }
.ai-steps a, .asst-settings a { color: var(--primary-text); text-decoration: underline; text-underline-offset: 3px; }
#ai-pending { display: grid; gap: var(--s3); }
.sh-empty .sh-raised { margin-top: var(--s3); }
.ai-card { display: grid; gap: var(--s3); padding: var(--s3); border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--elev-edge); box-shadow: var(--elev-raised-1); }
.ai-card-kind { font-size: var(--fs-xs); font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; color: var(--primary-text); }
.ai-card-lines { display: grid; gap: var(--s1, 4px); min-width: 0; }
.ai-card-lines strong { font-size: var(--fs-base); color: var(--text); overflow-wrap: anywhere; }
.ai-card-lines p { margin: 0; font-size: var(--fs-md); line-height: 1.45; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-edit { display: grid; gap: var(--s2); }
.ai-edit label { display: grid; gap: 4px; font-size: var(--fs-sm); color: var(--muted); }
.ai-edit input, .ai-edit textarea { width: 100%; min-width: 0; }
.sh-ai-btns { flex-wrap: wrap; }
.sh-ai-btns > button { flex: 1 1 0; min-width: 92px; }
.sh-ghost { display: flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 var(--s3); border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--elev-edge); color: var(--text); font-size: var(--fs-md); font-weight: 600; }
.sh-ghost:hover { background: var(--surface-3); }
.sh-ghost:focus-visible { box-shadow: var(--focus-ring); }
.sh-ghost:disabled, .sh-ai-btns button:disabled { opacity: 0.55; cursor: not-allowed; }
.ai-flash { margin: 0; padding: var(--s2) var(--s3); border-radius: var(--r-md); font-size: var(--fs-md); line-height: 1.45; }
.ai-flash.ok { background: var(--success-soft); color: var(--success); border: 1px solid var(--success-line); }
.ai-flash.err { background: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger-line); }
.sh-ai .sh-glass.rec { background: var(--danger-solid); color: #fff; animation: ai-pulse 1.2s ease-out infinite; }
@keyframes ai-pulse { 0% { box-shadow: 0 0 0 0 var(--danger-line); } 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.ai-voice { display: flex; align-items: center; gap: var(--s2); margin: 0 0 var(--s2); padding: var(--s2) var(--s3); border-radius: var(--r-md); font-size: var(--fs-md); line-height: 1.45; background: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger-line); }
.ai-voice[hidden] { display: none; }
.ai-voice.idle { background: transparent; color: inherit; border-color: var(--line, currentColor); opacity: 0.85; }
.ai-voice .dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--danger-solid); animation: ai-blink 1s ease-in-out infinite; }
.ai-voice.idle .dot { animation: none; background: currentColor; opacity: 0.5; }
@keyframes ai-blink { 50% { opacity: 0.25; } }
/* TASK-084: язык голоса, автоозвучка, кнопка «Прочитать вслух» */
.ai-voice-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); margin: 0 0 var(--s2); font-size: var(--fs-md); }
.ai-voice-tools .ai-lang { display: inline-flex; align-items: center; gap: var(--s2); }
.ai-voice-tools select { height: 36px; padding: 0 var(--s2); border-radius: var(--r-md); }
.ai-voice-tools .ai-auto { display: inline-flex; align-items: center; gap: var(--s2); cursor: pointer; }
.ai-voice-tools .ai-auto input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ai-sw { flex: none; position: relative; width: 36px; height: 20px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line, currentColor); transition: background .15s; }
.ai-sw::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: currentColor; opacity: .6; transition: transform .15s; }
.ai-auto input:checked + .ai-sw { background: var(--primary-soft); }
.ai-auto input:checked + .ai-sw::after { transform: translateX(16px); opacity: 1; }
.ai-auto input:focus-visible + .ai-sw { outline: 2px solid var(--primary); outline-offset: 2px; }
.ai-auto input:disabled ~ span { opacity: .5; }
.ai-say { display: inline-flex; vertical-align: middle; align-items: center; justify-content: center; width: 28px; height: 28px; margin-left: var(--s2); padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; opacity: .7; }
.ai-say:hover, .ai-say.on { opacity: 1; background: var(--primary-soft); }
.ai-say svg { width: 16px; height: 16px; }
@media (prefers-reduced-motion: reduce) { .sh-ai .sh-glass.rec, .ai-voice .dot { animation: none; } }
.sh-ai-form input:disabled { opacity: 0.6; }
.asst-settings { display: grid; gap: var(--s3); }
.asst-form { display: grid; gap: var(--s3); }
.asst-form select, .asst-form textarea, .asst-form input { width: 100%; min-width: 0; }
.asst-keyrow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2); margin: 0; }
.asst-mask { font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
.asst-row, .asst-tpl { display: flex; flex-wrap: wrap; gap: var(--s2); }
.asst-row > button, .asst-tpl > button { flex: 1 1 120px; min-height: 44px; }
.asst-pill { display: inline-flex; align-items: center; min-height: 28px; padding: 0 var(--s3); border-radius: 999px; font-size: var(--fs-sm); font-weight: 600; background: var(--surface-3); color: var(--muted); border: 1px solid var(--elev-edge); }
.asst-pill.ok { background: var(--success-soft); color: var(--success); border-color: var(--success-line); }
.asst-pill.bad { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.asst-journal summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; }
.asst-j { display: grid; gap: var(--s2); margin: 0 0 var(--s2); padding: 0; list-style: none; }
.asst-j li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); font-size: var(--fs-md); }
.asst-j-t { color: var(--muted); font-variant-numeric: tabular-nums; }
.asst-j-a { min-width: 0; overflow-wrap: anywhere; }

/* ---------- TASK-080: подразделы «ИИ-помощник», баланс и расход DeepSeek, встроенные «Подключения» ---------- */
.set-subtabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
.set-subtab { display: grid; gap: 2px; align-content: start; min-height: 64px; padding: var(--s2) var(--s3); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); color: var(--text); text-align: left; }
.set-subtab:hover { background: var(--primary-soft); }
.set-subtab[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); }
.set-subtab strong { font-size: var(--fs-md); font-weight: 650; }
.set-subtab small { font-size: var(--fs-sm); color: var(--muted); line-height: 1.35; overflow-wrap: anywhere; }
.set-embed { display: block; width: 100%; min-height: 420px; border: 0; background: transparent; color-scheme: light dark; }
/* TASK-120: окно сети — отдельный полноэкранный фрейм в body страницы, поверх меню, шапки и панели Асмека */
.net-overlay-frame { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; border: 0; background: transparent; color-scheme: light dark; z-index: 2000; }
.asst-bal { display: grid; gap: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--line); }
.asst-bal h4 { margin: 0; font-size: var(--fs-md); }
.asst-bal .asst-row { align-items: end; }
.asst-bal .asst-row > label { flex: 2 1 200px; display: grid; gap: var(--s2); min-width: 0; }
.asst-bal .asst-row > label select { width: 100%; min-width: 0; }
.asst-bal-sum { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s2) var(--s3); margin: 0; }
.asst-bal-sum strong { font-size: var(--fs-xl); font-variant-numeric: tabular-nums; }
.asst-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--s2); }
.asst-links > a, .asst-bal .asst-row > button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 var(--s3); text-align: center; white-space: normal; }
.asst-warn { margin: 0; padding: var(--s3); border: 1px solid var(--danger-line); border-radius: var(--r-md); background: var(--danger-soft); color: var(--danger); font-weight: 600; }
.asst-usage { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
.asst-usage th, .asst-usage td { padding: var(--s2) var(--s2); border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
.asst-usage th:first-child, .asst-usage td:first-child { text-align: left; }
.asst-usage th { color: var(--muted); font-weight: 600; font-size: var(--fs-sm); }
.asst-lim { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s3); }
@media (max-width: 480px) { .set-subtabs { grid-template-columns: 1fr; } .asst-usage { font-size: var(--fs-sm); } }

/* ---------- Помощники кабинета (TASK-068): только токены темы, работает в светлой и тёмной ---------- */
.hp-h { margin: var(--s4) 0 var(--s2); }
.hp-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2); margin-top: var(--s3); }
.hp-top .hp-h { margin: 0; }
.hp-top button { min-height: var(--h-md); flex: 0 0 auto; }
.hp-invite .form-actions { margin-top: var(--s3); }
.hp-list { display: grid; gap: var(--s3); }
.hp-invite-row { display: flex; gap: var(--s2); align-items: stretch; }
.hp-invite-row .hp-email { flex: 1 1 auto; min-width: 0; }
.hp-invite-row input { width: 100%; min-width: 0; }
.hp-invite-row button { flex: 0 0 auto; min-height: var(--h-md); }
.hp-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2); }
.hp-who { display: grid; gap: 2px; min-width: 0; }
.hp-who strong, .hp-who .hint { overflow-wrap: anywhere; }
.hp-remove { min-height: var(--h-md); flex: 0 0 auto; }
.hp-perms { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s3); margin-top: var(--s3); }
.hp-perm { display: grid; gap: var(--s1, 4px); min-width: 0; font-size: var(--fs-md); }
.hp-perm select { width: 100%; min-width: 0; min-height: var(--h-md); }
.hp-never { margin: 0 0 var(--s2); padding-left: 1.2em; font-size: var(--fs-md); line-height: 1.6; }
.hp-pending { display: grid; gap: var(--s3); }
.cabinet-bar { display: flex; align-items: center; gap: var(--s2); padding: var(--s2) var(--s3); background: var(--surface-2); border-bottom: 1px solid var(--elev-edge); }
.cabinet-bar[data-acting="1"] { border-bottom-color: var(--primary); }
.cabinet-bar label { display: flex; align-items: center; gap: var(--s2); min-width: 0; width: 100%; font-size: var(--fs-md); }
.cabinet-bar select { flex: 1 1 auto; min-width: 0; max-width: 28rem; min-height: var(--h-md); }
@media (max-width: 520px) {
  .hp-invite-row { flex-direction: column; }
  .hp-invite-row button { width: 100%; }
  .hp-remove { width: 100%; }
}

/* ---------- 19. Цели (TASK-075) ---------- */
.gl-tabs { margin-bottom: var(--s3); }
.gl-card.is-win { opacity: 1; }
.gl-title { display: flex; align-items: center; gap: var(--s2); }
.gl-title-ico { display: inline-flex; flex: none; color: var(--accent, currentColor); }
.gl-title-ico .icon, .gl-title-ico svg { width: 20px; height: 20px; }
.kpi-bar.pace-behind i, .kpi-bar.pace-missed i { background: var(--warning-strong); }
.kpi-bar.pace-done i, .kpi-bar.pace-ok i { background: var(--success); }
.gl-total, .gl-metric { display: grid; gap: 4px; }
.gl-total { margin: var(--s2) 0; }
.gl-total strong { font-size: var(--fs-base); color: var(--text); }
.gl-metric { padding: var(--s3) 0; border-top: 1px solid var(--elev-edge); }
.gl-metric-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.gl-metric-head strong { min-width: 0; overflow-wrap: anywhere; font-size: var(--fs-md); font-weight: 650; color: var(--text); }
.gl-metric-head .badge { flex: none; }
.gl-src, .gl-reward { color: var(--muted); font-size: var(--fs-sm); }
.gl-reward { display: flex; align-items: center; gap: 6px; }
.gl-reward .icon { width: 14px; height: 14px; flex: none; }
.gl-add { justify-self: start; min-height: var(--h-md); }
.gl-advice, .gl-nudge { margin: 0; padding: var(--s2) var(--s3); border-radius: var(--r-md); background: var(--surface-3); color: var(--text-2); font-size: var(--fs-md); line-height: 1.5; overflow-wrap: anywhere; }
.gl-advice, .gl-nudge { background: none; padding-left: 0; padding-right: 0; }
.gl-advice.warn, .gl-nudge.warn { color: var(--text-2); border-left: 3px solid var(--warning-strong); padding-left: var(--s3); border-radius: 0; }
.gl-advice.win, .gl-nudge.win { color: var(--text-2); border-left: 3px solid var(--success); padding-left: var(--s3); border-radius: 0; }
.gl-nudge { display: block; margin-top: 4px; font-size: var(--fs-sm); }
.gl-entries { display: grid; gap: 4px; margin: var(--s2) 0 0; padding: 0; list-style: none; color: var(--muted); font-size: var(--fs-sm); }
.gl-entries li { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.gl-entries span { min-width: 0; overflow-wrap: anywhere; }
.gl-freq { display: flex; align-items: center; gap: var(--s2); margin-top: var(--s2); color: var(--muted); font-size: var(--fs-sm); }
.gl-freq select { min-height: var(--h-md); min-width: 0; }
.gl-set { display: grid; gap: var(--s2); margin: 0; padding: var(--s3); border: 1px solid var(--elev-edge); border-radius: var(--r-md); }
.gl-set [hidden] { display: none; }
.gl-cc-note { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s3); padding: var(--s2) var(--s3); border-radius: var(--r-md); border: 1px solid var(--elev-edge); color: var(--text-2); font-size: var(--fs-md); }
.gl-row.late .sh-row-main strong { color: var(--warning); }
.gl-row .sh-row-main { min-width: 0; }
.gl-row .kpi-bar { margin-top: 2px; }
.gl-history, .gl-programs { display: grid; gap: var(--s2); margin-top: var(--s3); }
.gl-programs { margin: 0 0 var(--s3); }
.gl-h-title { margin: 0; font-size: var(--fs-md); font-weight: 650; color: var(--text); }
.gl-history .gl-entries li { justify-content: flex-start; align-items: baseline; }
.gl-h-date { flex: none; min-width: 3.6em; color: var(--muted); }
.gl-h-what { flex: 1 1 auto; min-width: 0; color: var(--text-2); }
.gl-history .gl-entries b { flex: none; color: var(--text); font-variant-numeric: tabular-nums; }
.gl-history .gl-entries b.gl-h-miss { color: var(--warning); font-weight: 600; }
.gl-more summary { cursor: pointer; color: var(--muted); font-size: var(--fs-sm); min-height: var(--h-md); display: flex; align-items: center; }
.gl-ended { color: var(--warning); }
.gl-prog { display: grid; gap: var(--s2); }
.gl-prog-need { margin: 0; font-size: var(--fs-md); color: var(--text); }
.gl-join { justify-self: start; min-height: var(--h-md); }
.cc-chip { display: inline-flex; align-items: center; min-height: 22px; padding: 0 var(--s2); border-radius: var(--r-md); background: var(--surface-3); color: var(--text-2); font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; }
.cc-chip.empty { background: var(--warning-soft); color: var(--warning); font-weight: 500; }
/* карточка цели в две колонки: слева цель, справа список выполненного (на телефоне — одна колонка) */
.gl-cols { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--s4); align-items: start; }
.gl-left { display: grid; gap: var(--s1, 4px); min-width: 0; }
.gl-right { display: grid; gap: var(--s2); align-content: start; min-width: 0; padding: var(--s3); border-radius: var(--r-md); background: var(--surface-3); }
.gl-sum { display: flex; justify-content: flex-end; text-align: right; }
.gl-sum strong { font-size: var(--fs-md); font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.gl-right .gl-entries { margin-top: 0; }
.gl-right .sh-empty { margin: 0; }
/* две цены товара из прайс-листа */
.price-pair { display: flex; flex-wrap: wrap; gap: var(--s1, 4px) var(--s3); color: var(--muted); font-size: var(--fs-sm); }
.price-pair b { color: var(--text); font-variant-numeric: tabular-nums; }
.price-table { display: grid; gap: var(--s1, 4px); }
.price-table > div { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); }
.price-table span { color: var(--muted); }
.price-table b { color: var(--text); font-variant-numeric: tabular-nums; }
/* цена уровня (TASK-100): подсказка «Укажите уровень…» и админские поля цен */
.price-hint { color: var(--muted); font-style: italic; }
.price-admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--s3); }
/* уровни Forever (TASK-100): значки, выбор уровня в профиле, бонусы уровня */
.lvl-pin { flex: none; vertical-align: -0.25em; }
.lvl-pin.lvl-none { display: inline-block; width: 22px; height: 22px; border-radius: 50%; border: 1.5px dashed var(--muted); box-sizing: border-box; }
.lvl-price { display: inline-flex; align-items: center; gap: var(--s1, 4px); }
/* TASK-124: цены крупнее и жирнее, цена уровня выделена */
.price-pair { flex-direction: column; gap: 2px; margin-top: var(--s1, 4px); font-size: var(--fs-sm); }
.price-pair b, .price-table b { font-size: var(--fs-lg); font-weight: 800; }
.price-pair .lvl-price { padding: 2px var(--s2); border-radius: var(--r-sm); background: var(--primary-soft); color: var(--text); font-weight: 600; width: fit-content; max-width: 100%; flex-wrap: wrap; }
.price-pair .lvl-price b { color: var(--primary); font-size: var(--fs-xl); }
.price-table .lvl-price { padding: 2px var(--s2); border-radius: var(--r-sm); background: var(--primary-soft); color: var(--text); font-weight: 600; }
.product-code { font-size: var(--fs-lg); }
.lvl-badge { display: inline-flex; align-items: center; gap: var(--s2); min-width: 0; }
.lvl-badge > span { overflow-wrap: anywhere; }
.head-me .head-me-lvl { display: block; margin-top: var(--s1, 4px); font-size: var(--fs-sm); color: var(--text); }
.lvl-pin-img { object-fit: contain; border-radius: 0; }
/* бейдж уровня на аватарке (TASK-118): правый нижний угол поверх края круга, обводка под тему */
.avatar, .ava-host { position: relative; }
.ava-host { display: inline-block; flex: none; line-height: 0; }
.ava-lvl { position: absolute; right: -3px; bottom: -3px; display: grid; place-items: center; border-radius: 50%; line-height: 0; pointer-events: auto; filter: drop-shadow(0 0 0 var(--surface)) drop-shadow(0 0 1px var(--surface)) drop-shadow(0 0 1px var(--surface)); }
.ava-lvl .lvl-pin, .avatar .ava-lvl img.lvl-pin, .ava-host .ava-lvl img.lvl-pin { display: block !important; vertical-align: baseline; width: 100% !important; height: 100% !important; max-width: 100% !important; max-height: 100% !important; border-radius: 0; object-fit: contain; }
.ava-lvl { overflow: visible; box-sizing: border-box; max-width: 40%; max-height: 40%; min-width: 14px; min-height: 14px; }
.sh-hero .avatar .ava-lvl { filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 1px #fff); }
:root[data-theme="dark"] .ava-lvl { filter: drop-shadow(0 0 1px #0B1533) drop-shadow(0 0 1px #0B1533); }
/* выбор уровня выпадающим списком (значок + название); список раскрывается в потоке страницы, не перекрывая соседние блоки */
.lvl-dd { display: grid; gap: var(--s2); margin: var(--s3) 0 0; max-width: 420px; min-width: 0; }
.lvl-dd-label { color: var(--muted); font-size: var(--fs-sm); }
.lvl-dd-btn { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); width: 100%; min-height: 44px; padding: var(--s2) var(--s3); border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); color: var(--text); text-align: left; cursor: pointer; }
.lvl-dd-btn:focus-visible, .lvl-opt:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.lvl-dd-btn svg:last-child { flex: none; transition: transform .15s; transform: rotate(90deg); }
.lvl-dd.is-open .lvl-dd-btn svg:last-child { transform: rotate(-90deg); }
.lvl-dd-cur { display: inline-flex; align-items: center; gap: var(--s2); min-width: 0; overflow-wrap: anywhere; }
.lvl-dd-list { list-style: none; margin: 0; padding: var(--s1, 4px); display: grid; gap: 2px; max-height: 340px; overflow-y: auto; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface-2); }
.lvl-dd-list[hidden] { display: none; }
.lvl-opt { display: flex; align-items: center; gap: var(--s2); width: 100%; min-height: 44px; padding: var(--s2) var(--s3); border: 0; border-radius: var(--r-md); background: transparent; color: var(--text); text-align: left; cursor: pointer; min-width: 0; overflow-wrap: anywhere; }
.lvl-opt:hover { background: var(--surface-3); }
.lvl-opt.is-on { box-shadow: inset 0 0 0 1px var(--accent, currentColor); background: var(--surface-3); }
/* значки уровней: загрузка в профиле у админа */
.lvl-ic-list { list-style: none; margin: var(--s3) 0 0; padding: 0; display: grid; gap: var(--s2); }
.lvl-ic-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s3); padding: var(--s2) var(--s3); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); min-width: 0; }
.lvl-ic-name { display: inline-flex; align-items: center; gap: var(--s2); min-width: 0; flex: 1 1 200px; overflow-wrap: anywhere; }
.lvl-ic-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); min-width: 0; }
.lvl-ic-ctl > .ghost-button, .lvl-ic-ctl > .primary { min-height: 44px; }
.lvl-ic-file { cursor: pointer; max-width: 100%; overflow-wrap: anywhere; }
.lvl-ic-msg { flex: 1 0 100%; color: var(--muted); }
.lvl-ic-msg.is-err { color: var(--danger); }
.lvl-info { margin-top: var(--s4); padding: var(--s3); border-radius: var(--r-md); background: var(--surface-3); }
.lvl-info h4 { display: flex; align-items: center; gap: var(--s2); margin: 0 0 var(--s2); }
.lvl-info ul { margin: 0 0 var(--s2); padding-left: 1.2em; display: grid; gap: var(--s1, 4px); }
.catalog-import { margin: var(--s3) 0; }
.catalog-import summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
@media (max-width: 768px) {
  .gl-cols { grid-template-columns: minmax(0, 1fr); }
  .gl-sum { justify-content: flex-start; text-align: left; }
}
@media (max-width: 520px) {
  .gl-join { justify-self: stretch; }
  .gl-cc-note { flex-direction: column; align-items: stretch; }
  .gl-metric-head { flex-wrap: wrap; }
}

/* ---------- Команда (TASK-087) ---------- */
.tm-wrap { display: grid; gap: var(--s4); }
.tm-tabs { margin-bottom: var(--s3); flex-wrap: wrap; }
.tm-tabs button { position: relative; }
.tm-dot { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; margin-left: 6px; padding: 0 6px; border-radius: 10px; background: var(--primary); color: #fff; font-size: var(--fs-sm); font-weight: 650; line-height: 1; }
.tm-dot.men { background: var(--warning); }
.tm-nav-dot { margin-left: auto; }
.tm-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.tm-row > :first-child { min-width: 0; flex: 1 1 12rem; overflow-wrap: anywhere; }
.tm-list { display: grid; gap: var(--s2); margin: 0; padding: 0; list-style: none; }
.tm-list > li { display: flex; align-items: center; gap: var(--s3); padding: var(--s3); border: 1px solid var(--elev-edge); border-radius: var(--r-md); background: var(--surface); }
.tm-list .tm-who { min-width: 0; flex: 1 1 auto; display: grid; gap: 2px; overflow-wrap: anywhere; }
.tm-list .tm-who small, .tm-hint { color: var(--muted); font-size: var(--fs-sm); }
.tm-rank { flex: none; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--surface-3); color: var(--text-2); font-weight: 650; font-size: var(--fs-sm); }
.tm-rank.top { background: var(--primary-soft); color: var(--primary-text); }
.tm-list .tm-val { flex: none; font-variant-numeric: tabular-nums; font-weight: 650; color: var(--text); }
.tm-list .kpi-bar { margin-top: 4px; }
.tm-me { outline: 2px solid var(--primary-soft); }
.tm-actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
.tm-actions > button, .tm-actions > a { min-height: var(--h-md); }
.tm-link { width: 100%; min-width: 0; font-size: var(--fs-sm); }
.tm-chat { display: grid; grid-template-rows: minmax(14rem, 55vh) auto; gap: var(--s3); }
.tm-msgs { overflow-y: auto; display: flex; flex-direction: column; gap: var(--s2); padding: var(--s3); border: 1px solid var(--elev-edge); border-radius: var(--r-md); background: var(--surface-2); overscroll-behavior: contain; }
.tm-msg { max-width: min(34rem, 92%); display: grid; gap: 4px; padding: var(--s2) var(--s3); border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--elev-edge); overflow-wrap: anywhere; }
.tm-msg.mine { align-self: flex-end; background: var(--primary-soft); border-color: transparent; }
.tm-msg.ment { border-color: var(--warning-line); background: var(--warning-soft); }
.tm-bad { color: var(--danger); }
.tm-url { flex: 1 1 14rem; min-width: 0; min-height: var(--h-md); font-size: var(--fs-sm); }
.tm-msg.fresh::before { content: attr(data-new); justify-self: start; color: var(--primary-text); font-size: var(--fs-sm); font-weight: 650; }
.tm-msg b { font-size: var(--fs-sm); color: var(--text-2); }
.tm-msg p { margin: 0; white-space: pre-wrap; font-size: var(--fs-md); color: var(--text); }
.tm-msg time { color: var(--muted); font-size: var(--fs-sm); }
.tm-msg img { max-width: 100%; max-height: 16rem; border-radius: var(--r-md); display: block; }
.tm-file { display: inline-flex; align-items: center; gap: 6px; min-height: var(--h-md); color: var(--primary-text); font-size: var(--fs-md); overflow-wrap: anywhere; }
.tm-mention { color: var(--primary-text); font-weight: 650; }
.tm-compose { display: grid; gap: var(--s2); }
.tm-compose textarea { width: 100%; min-height: 4.5rem; resize: vertical; }
.tm-compose-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.tm-compose-bar select { min-height: var(--h-md); min-width: 0; max-width: 100%; }
.tm-compose-bar .primary { margin-left: auto; }
.tm-mat { display: grid; gap: var(--s2); padding: var(--s3); border: 1px solid var(--elev-edge); border-radius: var(--r-md); background: var(--surface); }
.tm-mat p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--fs-md); }
.tm-pin { color: var(--muted); font-size: var(--fs-sm); display: flex; align-items: center; gap: 6px; }
@media (max-width: 520px) {
  .tm-compose-bar .primary { margin-left: 0; width: 100%; }
  .tm-actions > button, .tm-actions > a { flex: 1 1 100%; }
  .tm-msg { max-width: 100%; }
}

/* Реклама (TASK-074) */
.ads-tabs { margin-bottom: var(--s3); }
.ads-group { display: grid; gap: var(--s2); margin: 0; padding: 0; border: 0; min-width: 0; }
.ads-group legend { padding: 0; margin-bottom: var(--s1); font-size: var(--fs-sm); color: var(--text-2); font-weight: 600; }
.ads-chips { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
.ads-chips .chip { min-height: var(--h-md); }
.ads-add { display: inline-flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.ads-add input { min-height: var(--h-md); width: 11rem; max-width: 100%; }
.ads-add .ghost-button { min-height: var(--h-md); }
.ads-builder { margin-top: var(--s4); }
.ads-summary { margin: 0; }
.ads-verdict { margin: var(--s2) 0; }
.ads-verdict > * { flex: 1 1 0; text-align: center; white-space: nowrap; }
.ads-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); gap: var(--s2); margin: var(--s2) 0; }
.ads-tiles > div { display: grid; gap: 2px; padding: var(--s2) var(--s3); border-radius: var(--r-md); background: var(--surface-2); }
.ads-tiles b { font-size: var(--fs-lg, 1.1rem); }
.ads-tiles small { color: var(--text-2); }
.ads-empty .primary { margin-top: var(--s2); }
/* TASK-070: Meta tester banner on «Сегодня» */
#mt-banner { display: flex; flex-direction: column; gap: var(--s3); margin-bottom: var(--s3); }
#mt-banner .sh-empty { border-style: solid; }
#mt-banner .mt-banner-msg:empty { display: none; }
.mt-banner-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--s2); }
.mt-banner-actions .sh-raised { margin-top: 0; text-decoration: none; }
@media (max-width: 520px) {
  .ads-add { display: flex; width: 100%; }
  .ads-add input { flex: 1 1 8rem; width: auto; }
  .ads-verdict { flex-wrap: wrap; }
}

/* ---------- Forever: ссылки в верхней панели (TASK-091) ---------- */
.sh-hero .forever-menu > summary.sh-glass { cursor: pointer; }
.forever-panel { width: min(320px, calc(100vw - 2 * var(--gutter))); max-height: min(70vh, 520px); overflow-y: auto; }
.forever-panel .forever-link { text-decoration: none; min-width: 0; }
.forever-panel .forever-link span { min-width: 0; overflow-wrap: anywhere; }
.forever-row { display: flex; align-items: center; gap: 2px; }
.forever-row .forever-link { flex: 1 1 auto; width: auto; }
.forever-edit { flex: none; min-height: var(--h-md); padding: 0 var(--s2); border-radius: var(--r-sm); color: var(--muted); font-size: var(--fs-sm); }
.forever-edit:hover { background: var(--surface-2); color: var(--text); }
.forever-foot { padding: var(--s2) var(--s3) var(--s3); border-top: 1px solid var(--line); margin-top: var(--s2); }
.forever-add { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); }
.forever-add .icon { width: 16px; height: 16px; }
.forever-field { display: grid; gap: var(--s1); font-size: var(--fs-sm); color: var(--muted); }
.forever-actions { display: flex; gap: var(--s2); }
.forever-actions > button { flex: 1 1 0; min-height: var(--h-md); }
.forever-del-btn { color: var(--danger); border: 1px solid var(--danger-line); border-radius: var(--r-sm); background: var(--danger-soft); }
@media (min-width: 768px) { #forever-dialog { max-width: 420px; } }
.forever-head { margin: var(--s2) var(--s3) 0; color: var(--muted); font-size: var(--fs-sm); font-weight: 600; }
.forever-note { margin: 0 var(--s3); color: var(--muted); font-size: var(--fs-sm); }
.forever-note:empty { display: none; }
.forever-form { display: grid; gap: var(--s3); }
.forever-form .forever-note { margin: 0; color: var(--danger); }
.forever-form input { width: 100%; min-width: 0; min-height: var(--h-md); }
.forever-foot .forever-add { min-height: var(--h-md); width: 100%; }
@media (max-width: 520px) {
  .sh-hero .forever-panel { right: -50px; }
}

/* TASK-093: welcome wizard + reminder */
.welcome-dialog .sheet-body { display: grid; gap: var(--s3); }
.wl-steps { display: flex; gap: var(--s2); list-style: none; margin: 0; padding: 0; }
.wl-steps li { flex: 1 1 0; height: 4px; border-radius: var(--r-pill); background: var(--line-strong); }
.wl-steps li.on, .wl-steps li.done { background: var(--primary); }
.wl-dot { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.welcome-dialog .field { display: grid; gap: var(--s1, 4px); }
.welcome-dialog .field input:not([type=radio]) { width: 100%; min-width: 0; min-height: var(--h-md); box-sizing: border-box; }
.welcome-dialog .form-actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
.welcome-dialog .form-actions > button, .welcome-dialog .form-actions > a { flex: 1 1 140px; min-height: var(--h-md); box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; text-align: center; text-decoration: none; }
.welcome-dialog .wl-fb { width: 100%; min-height: var(--h-md); box-sizing: border-box; display: flex; align-items: center; justify-content: center; text-align: center; text-decoration: none; }
.wl-ok { margin: 0; padding: var(--s2) var(--s3); border-radius: var(--r-md); background: var(--success-soft); border: 1px solid var(--success-line); color: var(--success); overflow-wrap: anywhere; }
.wl-help { font-size: var(--fs-sm); color: var(--muted); }
.wl-help summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; }
.wl-help ol { margin: var(--s1, 4px) 0 0; padding-left: 1.2em; display: grid; gap: var(--s1, 4px); }
#welcome-reminder { display: flex; flex-direction: column; gap: var(--s3); margin-bottom: var(--s3); }
#welcome-reminder .sh-empty { border-style: solid; }

/* TASK-127: обращения — вид мессенджера (админка и кабинет). Сообщения пользователя слева, ответы администратора справа. */
.chat-app { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: var(--s3); height: clamp(460px, calc(100dvh - 170px), 820px); min-height: 0; }
.chat-list { display: flex; flex-direction: column; gap: var(--s2); min-height: 0; overflow-y: auto; padding: var(--s2); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overscroll-behavior: contain; }
.chat-item { display: grid; gap: 4px; padding: var(--s3); border: 1px solid transparent; border-radius: var(--r-md); color: var(--text); text-decoration: none; min-width: 0; }
.chat-item:hover { background: var(--surface-3); }
.chat-item.is-open { background: var(--primary-soft-2); border-color: var(--primary); color: #1b2333; }
.chat-item-top { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s2); min-width: 0; }
.chat-item-who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-base); }
.chat-item.is-unread .chat-item-who { font-weight: 700; }
.chat-item-time { flex: none; font-size: var(--fs-xs); color: var(--muted); }
.chat-item.is-open .chat-item-time, .chat-item.is-open .chat-item-last { color: #454e60; }
.chat-item-last { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-sm); color: var(--text-2); }
.chat-item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1); }
.chat-chip { display: inline-flex; align-items: center; min-height: 22px; padding: 0 var(--s2); border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; }
.chat-item.is-open .chat-chip { background: rgba(255, 255, 255, 0.7); color: #454e60; }
.chat-chip.chat-st-new { background: var(--primary); color: #fff; }
.chat-chip.chat-st-work { background: var(--warning-soft); color: var(--warning); }
.chat-chip.chat-st-done { background: var(--success-soft); color: var(--success); }
.chat-count { margin-left: auto; display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--primary); color: #fff; font-size: var(--fs-xs); font-weight: 700; }
.chat-empty { margin: 0; padding: var(--s4); color: var(--muted); font-size: var(--fs-md); text-align: center; }
.chat-pane { position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-width: 0; min-height: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.chat-pane-empty { display: grid; place-items: center; grid-template-rows: 1fr; }
.chat-head { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); }
.chat-title { display: grid; flex: 1 1 160px; min-width: 0; }
.chat-title strong, .chat-title small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-title small { font-size: var(--fs-sm); color: var(--muted); }
.chat-back { display: none; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 999px; background: var(--surface-3); color: var(--text); text-decoration: none; font-size: 20px; flex: none; }
.chat-info { flex: none; }
.chat-info-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text-2); font-weight: 700; font-style: italic; cursor: pointer; list-style: none; }
.chat-info-btn::-webkit-details-marker { display: none; }
.chat-info[open] .chat-info-btn { background: var(--primary); border-color: var(--primary); color: #fff; }
.chat-info-body { position: absolute; z-index: 5; top: calc(100% - 4px); right: var(--s3); width: min(360px, calc(100% - 2 * var(--s3))); margin: 0; padding: var(--s3) var(--s4); display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s1) var(--s3); background: var(--bg); color: var(--text); border: 1px solid var(--line-strong); border-radius: var(--r-md); box-shadow: 0 10px 30px rgba(11, 21, 51, 0.18); font-size: var(--fs-sm); }
.chat-info-body dt { color: var(--muted); }
.chat-info-body dd { margin: 0; overflow-wrap: anywhere; }
.chat-statuses { display: flex; flex: 1 1 100%; gap: var(--s2); }
.chat-st-form { flex: 1 1 0; min-width: 0; margin: 0; display: block; }
.chat-st { width: 100%; min-height: 40px; padding: 0 var(--s2); border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text); font-size: var(--fs-md); font-weight: 600; white-space: nowrap; cursor: pointer; }
.chat-st:hover { background: var(--surface-3); }
.chat-st.on.chat-st-new { background: var(--primary); border-color: var(--primary); color: #fff; }
.chat-st.on.chat-st-work { background: var(--warning-soft); border-color: var(--warning-line); color: var(--warning); }
.chat-st.on.chat-st-done { background: var(--success-soft); border-color: var(--success-line); color: var(--success); }
.chat-thread { display: flex; flex-direction: column; gap: var(--s3); min-height: 0; overflow-y: auto; padding: var(--s4); overscroll-behavior: contain; background: var(--surface-2); }
.chat-msg { display: grid; gap: 3px; max-width: min(34rem, 86%); }
.chat-msg.is-user { align-self: flex-start; justify-items: start; }
.chat-msg.is-admin { align-self: flex-end; justify-items: end; }
.chat-bubble { display: grid; gap: var(--s2); padding: var(--s2) var(--s3); border-radius: 16px; overflow-wrap: anywhere; }
.chat-msg.is-user .chat-bubble { background: var(--surface-3); color: var(--text); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.chat-msg.is-admin .chat-bubble { background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.chat-text { margin: 0; white-space: pre-wrap; font-size: var(--fs-base); line-height: 1.45; }
.chat-time { font-size: var(--fs-xs); color: var(--muted); padding: 0 var(--s1); }
.chat-shot { display: block; }
.chat-shot img { display: block; width: auto; max-width: 100%; max-height: 120px; border-radius: 10px; object-fit: cover; }
.chat-compose { display: flex; align-items: flex-end; gap: var(--s2); padding: var(--s3); border-top: 1px solid var(--line); margin: 0; }
.chat-compose textarea { flex: 1 1 auto; min-width: 0; min-height: 44px; max-height: 160px; padding: 10px var(--s3); resize: none; font-size: var(--fs-lg); line-height: 1.35; }
.chat-send, .chat-attach { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 44px; padding: 0 var(--s4); border-radius: var(--r-md); border: 1px solid var(--primary); background: var(--primary); color: #fff; font-weight: 600; cursor: pointer; }
.chat-send:hover { background: var(--primary-hover); }
.chat-attach { width: 44px; padding: 0; background: var(--surface-2); border-color: var(--line-strong); color: var(--text-2); }
.chat-attach.has-file { border-color: var(--primary); color: var(--primary-text); }
.chat-attach .icon { width: 20px; height: 20px; }
.chat-file-name { margin: 0; padding: 0 var(--s3) var(--s2); font-size: var(--fs-sm); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 767px) {
  .chat-app { grid-template-columns: minmax(0, 1fr); height: clamp(420px, calc(100dvh - 190px), 760px); }
  .chat-app.has-open .chat-list { display: none; }
  .chat-app:not(.has-open) .chat-pane { display: none; }
  .chat-back { display: inline-flex; }
  .chat-head { padding: var(--s3); }
  .chat-thread { padding: var(--s3); }
  .chat-msg { max-width: 92%; }
  .chat-send { padding: 0 var(--s3); }
}
