@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local("Vazirmatn"), local("Vazirmatn-Regular"), url("/fonts/Vazirmatn-Regular.woff2") format("woff2");
}

@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: local("Vazirmatn Medium"), local("Vazirmatn-Medium"), url("/fonts/Vazirmatn-Medium.woff2") format("woff2");
}

@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: local("Vazirmatn SemiBold"), local("Vazirmatn-SemiBold"), url("/fonts/Vazirmatn-SemiBold.woff2") format("woff2");
}

@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
  src: local("Vazirmatn Bold"), local("Vazirmatn-Bold"), url("/fonts/Vazirmatn-Bold.woff2") format("woff2");
}

:root {
  --accent: #7c6cff;
  --accent-strong: #6352f5;
  --accent-soft: #a99fff;
  --accent-contrast: #ffffff;
  --accent-2: #c26bff;
  --accent-3: #22d3ee;
  --accent-a08: rgba(124, 108, 255, .08);
  --accent-a12: rgba(124, 108, 255, .12);
  --accent-a18: rgba(124, 108, 255, .18);
  --accent-a28: rgba(124, 108, 255, .28);
  --accent-a45: rgba(124, 108, 255, .45);
  --accent-deep: #2a2170;

  --grad-brand: linear-gradient(135deg, #5b5bf6 0%, #8b5cf6 50%, #22b8e6 100%);
  --grad-brand-soft: linear-gradient(135deg, rgba(99, 102, 241, .16) 0%, rgba(34, 211, 238, .10) 100%);
  --grad-cool: linear-gradient(135deg, #22d3ee 0%, #6366f1 100%);
  --grad-warm: linear-gradient(135deg, #fbbf24 0%, #f472b6 100%);
  --grad-fresh: linear-gradient(135deg, #34d399 0%, #22d3ee 100%);
  --grad-sheen: linear-gradient(120deg, rgba(255,255,255,0) 18%, rgba(255,255,255,.22) 38%, rgba(255,255,255,0) 58%);
  --grad-mesh:
    radial-gradient(28rem 20rem at 12% -8%, rgba(139, 92, 246, .45), rgba(139, 92, 246, 0) 64%),
    radial-gradient(24rem 18rem at 96% 4%, rgba(34, 211, 238, .35), rgba(34, 211, 238, 0) 62%),
    radial-gradient(26rem 22rem at 60% 118%, rgba(236, 72, 153, .28), rgba(236, 72, 153, 0) 64%);

  --success: #34d399;
  --success-ink: #053725;
  --warning: #fbbf24;
  --warning-ink: #452b00;
  --danger: #fb7185;
  --danger-ink: #4a0512;
  --info: #38bdf8;
  --info-ink: #04263f;
  --success-line: rgba(52, 211, 153, .32);
  --warning-line: rgba(251, 191, 36, .32);
  --danger-line: rgba(251, 113, 133, .34);
  --info-line: rgba(56, 189, 248, .32);

  --font-fa: "Vazirmatn", "Vazir", "IRANSans", Tahoma, "Segoe UI", sans-serif;
  --font-en: "Vazirmatn", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "SFMono-Regular", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;

  --fs-2xs: 0.75rem;
  --fs-xs:  0.8125rem;
  --fs-sm:  0.875rem;
  --fs-md:  1rem;
  --fs-lg:  1.125rem;
  --fs-xl:  1.375rem;
  --fs-2xl: 1.75rem;
  --fs-3xl: 2.125rem;
  --fs-4xl: 2.625rem;

  --lh-tight: 1.3;
  --lh-snug: 1.5;
  --lh-normal: 1.75;
  --lh-loose: 1.95;

  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-extrabold: 800;
  --fw-black: 800;

  --density: 1;
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;

  --r-xs: 10px;
  --r-sm: 14px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-xl: 30px;
  --r-2xl: 36px;
  --r-full: 999px;

  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-in: cubic-bezier(.55, 0, 1, .45);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease-smooth: cubic-bezier(.4, 0, .2, 1);
  --dur-fast: 140ms;
  --dur-base: 240ms;
  --dur-slow: 420ms;

  --topbar-h: 60px;
  --tabbar-h: 96px;
  --sidebar-w: 276px;
  --content-max: 1320px;
  --tap: 48px;
  --control-h: 50px;

  --z-base: 1;
  --z-sticky: 50;
  --z-drawer: 200;
  --z-modal: 300;
  --z-toast: 400;
  --z-palette: 500;

  --border: var(--line);
  --text: var(--ink);
  --text-muted: var(--ink-3);
  --radius-sm: var(--r-sm);
  --radius-md: var(--r-md);
  --sp-7: 28px;
}

:root,
html[data-theme="dark"] {
  --bg: #0b0e26;
  --bg-deep: #070920;
  --surface-1: #141838;
  --surface-2: #191e44;
  --surface-3: #20264f;
  --surface-4: #2a3162;
  --surface: #141838;

  --surface-1-t: rgba(20, 24, 58, .72);
  --surface-2-t: rgba(26, 31, 70, .62);
  --card-bg: linear-gradient(160deg, rgba(36, 41, 96, .70) 0%, rgba(22, 26, 62, .62) 55%, rgba(18, 22, 52, .70) 100%);

  --line: rgba(165, 175, 255, .14);
  --line-soft: rgba(165, 175, 255, .08);
  --line-strong: rgba(185, 195, 255, .26);

  --ink: #f3f4ff;
  --ink-2: #bcc1e6;
  --ink-3: #8b93c4;
  --ink-inverse: #0b0e26;

  --overlay: rgba(4, 5, 18, .70);
  --glass: rgba(12, 15, 40, .62);
  --glass-strong: rgba(14, 17, 44, .90);
  --glass-border: rgba(170, 180, 255, .16);

  --sheen-top: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,0) 42%);
  --sheen-edge: rgba(200, 205, 255, .18);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .45);
  --shadow-sm: 0 6px 18px rgba(2, 4, 24, .45), 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-md: 0 16px 40px rgba(2, 4, 24, .55), 0 2px 8px rgba(0, 0, 0, .3);
  --shadow-lg: 0 30px 70px rgba(2, 4, 24, .65), 0 4px 16px rgba(0, 0, 0, .35);
  --shadow-accent: 0 14px 34px rgba(99, 82, 245, .45);

  --glow-accent: 0 0 0 1px rgba(124, 108, 255, .3), 0 10px 32px rgba(124, 108, 255, .35);
  --glow-soft: 0 0 26px rgba(124, 108, 255, .26);

  --success-bg: rgba(52, 211, 153, .13);
  --warning-bg: rgba(251, 191, 36, .13);
  --danger-bg: rgba(251, 113, 133, .14);
  --info-bg: rgba(56, 189, 248, .13);

  --skeleton-1: rgba(170, 180, 255, .05);
  --skeleton-2: rgba(170, 180, 255, .11);

  --aurora-1: rgba(99, 102, 241, .55);
  --aurora-2: rgba(168, 85, 247, .38);
  --aurora-3: rgba(34, 211, 238, .30);
  --aurora-4: rgba(217, 70, 239, .14);
  --dot-grid: rgba(180, 190, 255, .10);
  --bg-pattern-opacity: 1;

  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #e7e9f2;
  --bg-deep: #dcdfeb;
  --surface-1: #f3f4f9;
  --surface-2: #eef0f6;
  --surface-3: #e4e7f1;
  --surface-4: #d8dcea;
  --surface: #f3f4f9;

  --surface-1-t: rgba(241, 242, 248, .86);
  --surface-2-t: rgba(236, 238, 245, .80);
  --card-bg: var(--surface-1);

  --line: rgba(38, 44, 100, .12);
  --line-soft: rgba(38, 44, 100, .07);
  --line-strong: rgba(38, 44, 100, .22);

  --ink: #1b1f3b;
  --ink-2: #464b70;
  --ink-3: #585d83;
  --ink-inverse: #f7f8fc;

  --overlay: rgba(22, 25, 52, .42);
  --glass: rgba(234, 236, 244, .84);
  --glass-strong: rgba(240, 241, 248, .95);
  --glass-border: rgba(38, 44, 100, .10);

  --sheen-top: linear-gradient(180deg, rgba(255,255,255,.42), rgba(255,255,255,0) 46%);
  --sheen-edge: rgba(255, 255, 255, .5);

  --shadow-xs: 0 1px 2px rgba(30, 36, 90, .08);
  --shadow-sm: 0 6px 18px rgba(50, 56, 130, .10), 0 1px 2px rgba(30, 36, 90, .05);
  --shadow-md: 0 16px 38px rgba(50, 56, 130, .13), 0 2px 8px rgba(30, 36, 90, .06);
  --shadow-lg: 0 30px 70px rgba(50, 56, 130, .18), 0 4px 14px rgba(30, 36, 90, .08);
  --shadow-accent: 0 12px 28px rgba(99, 82, 245, .24);

  --glow-accent: 0 0 0 1px rgba(124, 108, 255, .22), 0 10px 26px rgba(124, 108, 255, .20);
  --glow-soft: 0 0 22px rgba(124, 108, 255, .14);

  --accent: #5a49e8;
  --accent-strong: #4a3ad6;
  --accent-soft: #8478ef;

  --success: #047857;
  --warning: #a34a06;
  --danger: #d0173f;
  --info: #0271ae;
  --success-line: rgba(4, 120, 87, .28);
  --warning-line: rgba(163, 74, 6, .28);
  --danger-line: rgba(208, 23, 63, .26);
  --info-line: rgba(2, 113, 174, .26);

  --success-bg: rgba(5, 150, 105, .10);
  --warning-bg: rgba(217, 119, 6, .11);
  --danger-bg: rgba(225, 29, 72, .09);
  --info-bg: rgba(2, 132, 199, .09);

  --skeleton-1: rgba(38, 44, 100, .06);
  --skeleton-2: rgba(38, 44, 100, .11);

  --aurora-1: rgba(99, 102, 241, .13);
  --aurora-2: rgba(236, 72, 153, .07);
  --aurora-3: rgba(34, 211, 238, .09);
  --aurora-4: rgba(99, 102, 241, 0);
  --dot-grid: rgba(60, 64, 150, .07);

  color-scheme: light;
}

html[data-density="compact"] {
  --topbar-h: 54px;
  --control-h: 44px;
  --tap: 44px;
  --sp-1: 3px;
  --sp-2: 6px;
  --sp-3: 9px;
  --sp-4: 12px;
  --sp-5: 15px;
  --sp-6: 18px;
  --sp-7: 20px;
  --sp-8: 24px;
  --sp-10: 30px;
  --sp-12: 36px;
  --sp-16: 48px;
  --lh-tight: 1.22;
  --lh-snug: 1.38;
  --lh-normal: 1.55;
  --lh-loose: 1.7;
  --r-xs: 8px;
  --r-sm: 11px;
  --r-md: 14px;
  --r-lg: 18px;
}

html[data-accent="violet"] {
  --accent: #a855f7; --accent-strong: #9333ea; --accent-soft: #c084fc;
  --accent-a08: rgba(168, 85, 247, .08); --accent-a12: rgba(168, 85, 247, .12);
  --accent-a18: rgba(168, 85, 247, .18); --accent-a28: rgba(168, 85, 247, .28);
  --accent-a45: rgba(168, 85, 247, .45);
  --grad-brand: linear-gradient(135deg, #7c3aed 0%, #a855f7 50%, #ec4899 100%);
}
html[data-accent="blue"] {
  --accent: #3b82f6; --accent-strong: #2563eb; --accent-soft: #93c5fd;
  --accent-a08: rgba(59, 130, 246, .08); --accent-a12: rgba(59, 130, 246, .12);
  --accent-a18: rgba(59, 130, 246, .18); --accent-a28: rgba(59, 130, 246, .28);
  --accent-a45: rgba(59, 130, 246, .45);
  --grad-brand: linear-gradient(135deg, #2563eb 0%, #3b82f6 50%, #06b6d4 100%);
}
html[data-accent="teal"] {
  --accent: #14b8a6; --accent-strong: #0d9488; --accent-soft: #5eead4;
  --accent-a08: rgba(20, 184, 166, .08); --accent-a12: rgba(20, 184, 166, .12);
  --accent-a18: rgba(20, 184, 166, .18); --accent-a28: rgba(20, 184, 166, .28);
  --accent-a45: rgba(20, 184, 166, .45);
  --grad-brand: linear-gradient(135deg, #0d9488 0%, #14b8a6 50%, #22d3ee 100%);
}
html[data-accent="rose"] {
  --accent: #f43f5e; --accent-strong: #e11d48; --accent-soft: #fda4af;
  --accent-a08: rgba(244, 63, 94, .08); --accent-a12: rgba(244, 63, 94, .12);
  --accent-a18: rgba(244, 63, 94, .18); --accent-a28: rgba(244, 63, 94, .28);
  --accent-a45: rgba(244, 63, 94, .45);
  --grad-brand: linear-gradient(135deg, #e11d48 0%, #f43f5e 50%, #fb923c 100%);
}
html[data-accent="amber"] {
  --accent: #f59e0b; --accent-strong: #d97706; --accent-soft: #fcd34d; --accent-contrast: #1f1300;
  --accent-a08: rgba(245, 158, 11, .08); --accent-a12: rgba(245, 158, 11, .12);
  --accent-a18: rgba(245, 158, 11, .18); --accent-a28: rgba(245, 158, 11, .28);
  --accent-a45: rgba(245, 158, 11, .45);
  --grad-brand: linear-gradient(135deg, #d97706 0%, #f59e0b 50%, #f43f5e 100%);
}

@media (prefers-contrast: more) {
  html[data-theme="dark"]  { --line: rgba(255,255,255,.22); --line-strong: rgba(255,255,255,.36); --ink-2: #d2d6f0; }
  html[data-theme="light"] { --line: rgba(20,23,53,.24);    --line-strong: rgba(20,23,53,.42);    --ink-2: #343858; }
}

@media (prefers-reduced-motion: reduce) {
  :root { --dur-fast: 1ms; --dur-base: 1ms; --dur-slow: 1ms; }
}

@media (min-width: 1600px) {
  :root { --content-max: 1520px; --sidebar-w: 292px; }
}

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
}

html,
body { min-height: 100%; }

body {
  margin: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-en);
  font-size: var(--fs-md);
  line-height: var(--lh-snug);
  font-weight: var(--fw-regular);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  touch-action: manipulation;
}

body::before {
  content: "";
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(52rem 34rem at 4% -12%, var(--aurora-1), rgba(0,0,0,0) 62%),
    radial-gradient(46rem 30rem at 104% 0%, var(--aurora-2), rgba(0,0,0,0) 58%),
    radial-gradient(44rem 30rem at 50% 112%, var(--aurora-3), rgba(0,0,0,0) 60%),
    var(--bg);
}

body::after {
  content: "";
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(var(--dot-grid) 1.2px, rgba(0,0,0,0) 1.3px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.55) 45%, rgba(0,0,0,0) 85%);
          mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.55) 45%, rgba(0,0,0,0) 85%);
}

html:not([data-theme="light"]) body::before {
  top: -8%; right: -8%; bottom: -8%; left: -8%;
  background:
    radial-gradient(42rem 30rem at 10% 6%, var(--aurora-1), rgba(0,0,0,0) 66%),
    radial-gradient(34rem 26rem at 94% 16%, var(--aurora-3), rgba(0,0,0,0) 62%),
    radial-gradient(44rem 30rem at 72% 100%, var(--aurora-2), rgba(0,0,0,0) 64%),
    radial-gradient(30rem 24rem at 6% 92%, var(--aurora-4), rgba(0,0,0,0) 62%),
    radial-gradient(38rem 28rem at 42% 48%, rgba(79, 70, 229, .16), rgba(0,0,0,0) 70%),
    radial-gradient(60rem 40rem at 50% 45%, rgba(0,0,0,0) 55%, rgba(3, 4, 16, .5) 100%),
    linear-gradient(165deg, #10143a 0%, #0b0e28 45%, #080a1f 100%);
  -webkit-animation: tr-aurora-drift 60s ease-in-out infinite alternate;
          animation: tr-aurora-drift 60s ease-in-out infinite alternate;
  will-change: transform;
}

html:not([data-theme="light"]) body::after {
  opacity: var(--bg-pattern-opacity, 1);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1600 1000' preserveAspectRatio='xMidYMid slice'%3E%3Cpath d='M-10 90 H150 L220 160 H330' fill='none' stroke='%239fa9ff' stroke-opacity='0.35' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='330' cy='160' r='3.2' fill='none' stroke='%239fa9ff' stroke-opacity='0.4' stroke-width='1.2'/%3E%3Cpath d='M-10 106 H160 L230 176 H366' fill='none' stroke='%239fa9ff' stroke-opacity='0.32' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='366' cy='176' r='3.2' fill='none' stroke='%239fa9ff' stroke-opacity='0.37' stroke-width='1.2'/%3E%3Cpath d='M-10 122 H170 L240 192 H402' fill='none' stroke='%239fa9ff' stroke-opacity='0.28' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='402' cy='192' r='3.2' fill='none' stroke='%239fa9ff' stroke-opacity='0.34' stroke-width='1.2'/%3E%3Cpath d='M-10 138 H180 L250 208 H438' fill='none' stroke='%239fa9ff' stroke-opacity='0.25' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='438' cy='208' r='3.2' fill='none' stroke='%239fa9ff' stroke-opacity='0.31000000000000005' stroke-width='1.2'/%3E%3Cpath d='M-10 154 H190 L260 224 H474' fill='none' stroke='%239fa9ff' stroke-opacity='0.22' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='474' cy='224' r='3.2' fill='none' stroke='%239fa9ff' stroke-opacity='0.28' stroke-width='1.2'/%3E%3Cpath d='M60 420 V560 L120 620 H190' fill='none' stroke='%235eead4' stroke-opacity='0.30' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='190' cy='620' r='3.2' fill='none' stroke='%235eead4' stroke-opacity='0.34' stroke-width='1.2'/%3E%3Cpath d='M76 420 V580 L136 640 H230' fill='none' stroke='%235eead4' stroke-opacity='0.30' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='230' cy='640' r='3.2' fill='none' stroke='%235eead4' stroke-opacity='0.34' stroke-width='1.2'/%3E%3Cpath d='M92 420 V600 L152 660 H270' fill='none' stroke='%235eead4' stroke-opacity='0.30' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='270' cy='660' r='3.2' fill='none' stroke='%235eead4' stroke-opacity='0.34' stroke-width='1.2'/%3E%3Cpath d='M1610 300 H1450 L1390 360 V470' fill='none' stroke='%239fa9ff' stroke-opacity='0.32' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='1390' cy='470' r='3.2' fill='none' stroke='%239fa9ff' stroke-opacity='0.36' stroke-width='1.2'/%3E%3Cpath d='M1610 318 H1438 L1378 378 V500' fill='none' stroke='%239fa9ff' stroke-opacity='0.32' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='1378' cy='500' r='3.2' fill='none' stroke='%239fa9ff' stroke-opacity='0.36' stroke-width='1.2'/%3E%3Cpath d='M1610 336 H1426 L1366 396 V530' fill='none' stroke='%239fa9ff' stroke-opacity='0.32' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='1366' cy='530' r='3.2' fill='none' stroke='%239fa9ff' stroke-opacity='0.36' stroke-width='1.2'/%3E%3Cpath d='M1610 354 H1414 L1354 414 V560' fill='none' stroke='%239fa9ff' stroke-opacity='0.32' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='1354' cy='560' r='3.2' fill='none' stroke='%239fa9ff' stroke-opacity='0.36' stroke-width='1.2'/%3E%3Cpath d='M1610 120 H1500 L1460 160 H1380' fill='none' stroke='%235eead4' stroke-opacity='0.30' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='1380' cy='160' r='3.2' fill='none' stroke='%235eead4' stroke-opacity='0.34' stroke-width='1.2'/%3E%3Crect x='1250' y='150' width='70' height='52' rx='8' fill='none' stroke='%239fa9ff' stroke-opacity='.30' stroke-width='1.2'/%3E%3Cpath d='M1260.0 150 v-12' fill='none' stroke='%239fa9ff' stroke-opacity='0.32' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M1260.0 202 v12' fill='none' stroke='%239fa9ff' stroke-opacity='0.32' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M1272.5 150 v-12' fill='none' stroke='%239fa9ff' stroke-opacity='0.32' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M1272.5 202 v12' fill='none' stroke='%239fa9ff' stroke-opacity='0.32' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M1285.0 150 v-12' fill='none' stroke='%239fa9ff' stroke-opacity='0.32' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M1285.0 202 v12' fill='none' stroke='%239fa9ff' stroke-opacity='0.32' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M1297.5 150 v-12' fill='none' stroke='%239fa9ff' stroke-opacity='0.32' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M1297.5 202 v12' fill='none' stroke='%239fa9ff' stroke-opacity='0.32' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M1310.0 150 v-12' fill='none' stroke='%239fa9ff' stroke-opacity='0.32' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M1310.0 202 v12' fill='none' stroke='%239fa9ff' stroke-opacity='0.32' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M1250 162 h-12' fill='none' stroke='%239fa9ff' stroke-opacity='0.32' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M1320 162 h12' fill='none' stroke='%239fa9ff' stroke-opacity='0.32' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M1250 176 h-12' fill='none' stroke='%239fa9ff' stroke-opacity='0.32' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M1320 176 h12' fill='none' stroke='%239fa9ff' stroke-opacity='0.32' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M1250 190 h-12' fill='none' stroke='%239fa9ff' stroke-opacity='0.32' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M1320 190 h12' fill='none' stroke='%239fa9ff' stroke-opacity='0.32' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Crect x='1272' y='166' width='26' height='20' rx='4' fill='%239fa9ff' fill-opacity='.08'/%3E%3Cline x1='1180' y1='760' x2='1290' y2='730' stroke='%239fa9ff' stroke-opacity='.14' stroke-width='1'/%3E%3Cline x1='1180' y1='760' x2='1290' y2='800' stroke='%239fa9ff' stroke-opacity='.14' stroke-width='1'/%3E%3Cline x1='1180' y1='760' x2='1290' y2='870' stroke='%239fa9ff' stroke-opacity='.14' stroke-width='1'/%3E%3Cline x1='1180' y1='760' x2='1290' y2='940' stroke='%239fa9ff' stroke-opacity='.14' stroke-width='1'/%3E%3Cline x1='1180' y1='830' x2='1290' y2='730' stroke='%239fa9ff' stroke-opacity='.14' stroke-width='1'/%3E%3Cline x1='1180' y1='830' x2='1290' y2='800' stroke='%239fa9ff' stroke-opacity='.14' stroke-width='1'/%3E%3Cline x1='1180' y1='830' x2='1290' y2='870' stroke='%239fa9ff' stroke-opacity='.14' stroke-width='1'/%3E%3Cline x1='1180' y1='830' x2='1290' y2='940' stroke='%239fa9ff' stroke-opacity='.14' stroke-width='1'/%3E%3Cline x1='1180' y1='900' x2='1290' y2='730' stroke='%239fa9ff' stroke-opacity='.14' stroke-width='1'/%3E%3Cline x1='1180' y1='900' x2='1290' y2='800' stroke='%239fa9ff' stroke-opacity='.14' stroke-width='1'/%3E%3Cline x1='1180' y1='900' x2='1290' y2='870' stroke='%239fa9ff' stroke-opacity='.14' stroke-width='1'/%3E%3Cline x1='1180' y1='900' x2='1290' y2='940' stroke='%239fa9ff' stroke-opacity='.14' stroke-width='1'/%3E%3Cline x1='1290' y1='730' x2='1400' y2='780' stroke='%239fa9ff' stroke-opacity='.14' stroke-width='1'/%3E%3Cline x1='1290' y1='730' x2='1400' y2='860' stroke='%239fa9ff' stroke-opacity='.14' stroke-width='1'/%3E%3Cline x1='1290' y1='800' x2='1400' y2='780' stroke='%239fa9ff' stroke-opacity='.14' stroke-width='1'/%3E%3Cline x1='1290' y1='800' x2='1400' y2='860' stroke='%239fa9ff' stroke-opacity='.14' stroke-width='1'/%3E%3Cline x1='1290' y1='870' x2='1400' y2='780' stroke='%239fa9ff' stroke-opacity='.14' stroke-width='1'/%3E%3Cline x1='1290' y1='870' x2='1400' y2='860' stroke='%239fa9ff' stroke-opacity='.14' stroke-width='1'/%3E%3Cline x1='1290' y1='940' x2='1400' y2='780' stroke='%239fa9ff' stroke-opacity='.14' stroke-width='1'/%3E%3Cline x1='1290' y1='940' x2='1400' y2='860' stroke='%239fa9ff' stroke-opacity='.14' stroke-width='1'/%3E%3Cline x1='1400' y1='780' x2='1500' y2='820' stroke='%239fa9ff' stroke-opacity='.14' stroke-width='1'/%3E%3Cline x1='1400' y1='860' x2='1500' y2='820' stroke='%239fa9ff' stroke-opacity='.14' stroke-width='1'/%3E%3Ccircle cx='1180' cy='760' r='5' fill='%230b0e28' stroke='%235eead4' stroke-opacity='.45' stroke-width='1.3'/%3E%3Ccircle cx='1180' cy='760' r='2' fill='%235eead4' fill-opacity='0.5'/%3E%3Ccircle cx='1180' cy='830' r='5' fill='%230b0e28' stroke='%235eead4' stroke-opacity='.45' stroke-width='1.3'/%3E%3Ccircle cx='1180' cy='830' r='2' fill='%235eead4' fill-opacity='0.5'/%3E%3Ccircle cx='1180' cy='900' r='5' fill='%230b0e28' stroke='%235eead4' stroke-opacity='.45' stroke-width='1.3'/%3E%3Ccircle cx='1180' cy='900' r='2' fill='%235eead4' fill-opacity='0.5'/%3E%3Ccircle cx='1290' cy='730' r='5' fill='%230b0e28' stroke='%235eead4' stroke-opacity='.45' stroke-width='1.3'/%3E%3Ccircle cx='1290' cy='730' r='2' fill='%235eead4' fill-opacity='0.5'/%3E%3Ccircle cx='1290' cy='800' r='5' fill='%230b0e28' stroke='%235eead4' stroke-opacity='.45' stroke-width='1.3'/%3E%3Ccircle cx='1290' cy='800' r='2' fill='%235eead4' fill-opacity='0.5'/%3E%3Ccircle cx='1290' cy='870' r='5' fill='%230b0e28' stroke='%235eead4' stroke-opacity='.45' stroke-width='1.3'/%3E%3Ccircle cx='1290' cy='870' r='2' fill='%235eead4' fill-opacity='0.5'/%3E%3Ccircle cx='1290' cy='940' r='5' fill='%230b0e28' stroke='%235eead4' stroke-opacity='.45' stroke-width='1.3'/%3E%3Ccircle cx='1290' cy='940' r='2' fill='%235eead4' fill-opacity='0.5'/%3E%3Ccircle cx='1400' cy='780' r='5' fill='%230b0e28' stroke='%235eead4' stroke-opacity='.45' stroke-width='1.3'/%3E%3Ccircle cx='1400' cy='780' r='2' fill='%235eead4' fill-opacity='0.5'/%3E%3Ccircle cx='1400' cy='860' r='5' fill='%230b0e28' stroke='%235eead4' stroke-opacity='.45' stroke-width='1.3'/%3E%3Ccircle cx='1400' cy='860' r='2' fill='%235eead4' fill-opacity='0.5'/%3E%3Ccircle cx='1500' cy='820' r='5' fill='%230b0e28' stroke='%235eead4' stroke-opacity='.45' stroke-width='1.3'/%3E%3Ccircle cx='1500' cy='820' r='2' fill='%235eead4' fill-opacity='0.5'/%3E%3Cellipse cx='330' cy='860' rx='58' ry='20' fill='none' stroke='%23f0abfc' stroke-opacity='.20' stroke-width='1.1' transform='rotate%28-30 330 860%29'/%3E%3Cellipse cx='330' cy='860' rx='58' ry='20' fill='none' stroke='%23f0abfc' stroke-opacity='.20' stroke-width='1.1' transform='rotate%2830 330 860%29'/%3E%3Cellipse cx='330' cy='860' rx='58' ry='20' fill='none' stroke='%23f0abfc' stroke-opacity='.20' stroke-width='1.1' transform='rotate%2890 330 860%29'/%3E%3Ccircle cx='330' cy='860' r='4' fill='%23f0abfc' fill-opacity='0.55'/%3E%3Cellipse cx='800' cy='-120' rx='760' ry='260' fill='none' stroke='%239fa9ff' stroke-opacity='.07' stroke-width='1.2'/%3E%3Cellipse cx='800' cy='1130' rx='820' ry='250' fill='none' stroke='%235eead4' stroke-opacity='.06' stroke-width='1.2'/%3E%3Ccircle cx='264' cy='690' r='1.0' fill='%23ffffff' fill-opacity='0.45'/%3E%3Ccircle cx='346' cy='793' r='1.1' fill='%23ffffff' fill-opacity='0.4'/%3E%3Ccircle cx='378' cy='3' r='1.1' fill='%23ffffff' fill-opacity='0.34'/%3E%3Ccircle cx='111' cy='794' r='0.8' fill='%23ffffff' fill-opacity='0.28'/%3E%3Ccircle cx='68' cy='998' r='1.4' fill='%23ffffff' fill-opacity='0.49'/%3E%3Ccircle cx='985' cy='34' r='1.0' fill='%23ffffff' fill-opacity='0.32'/%3E%3Ccircle cx='185' cy='952' r='0.7' fill='%23ffffff' fill-opacity='0.33'/%3E%3Ccircle cx='1308' cy='125' r='1.0' fill='%23ffffff' fill-opacity='0.57'/%3E%3Ccircle cx='299' cy='37' r='0.8' fill='%23ffffff' fill-opacity='0.54'/%3E%3Ccircle cx='1248' cy='209' r='1.3' fill='%23ffffff' fill-opacity='0.56'/%3E%3Ccircle cx='196' cy='476' r='0.8' fill='%23ffffff' fill-opacity='0.53'/%3E%3Ccircle cx='1477' cy='888' r='0.9' fill='%23ffffff' fill-opacity='0.35'/%3E%3Ccircle cx='722' cy='386' r='0.6' fill='%23ffffff' fill-opacity='0.34'/%3E%3Ccircle cx='149' cy='718' r='1.0' fill='%23ffffff' fill-opacity='0.6'/%3E%3Ccircle cx='996' cy='181' r='0.9' fill='%23ffffff' fill-opacity='0.25'/%3E%3Ccircle cx='1483' cy='347' r='0.9' fill='%23ffffff' fill-opacity='0.43'/%3E%3Ccircle cx='165' cy='66' r='1.3' fill='%23ffffff' fill-opacity='0.52'/%3E%3Ccircle cx='1438' cy='958' r='1.5' fill='%23ffffff' fill-opacity='0.35'/%3E%3Ccircle cx='1538' cy='591' r='1.0' fill='%23ffffff' fill-opacity='0.55'/%3E%3Ccircle cx='601' cy='247' r='0.7' fill='%23ffffff' fill-opacity='0.25'/%3E%3Ccircle cx='1288' cy='774' r='1.4' fill='%23ffffff' fill-opacity='0.38'/%3E%3Ccircle cx='83' cy='258' r='1.0' fill='%23ffffff' fill-opacity='0.3'/%3E%3Ccircle cx='273' cy='69' r='1.4' fill='%23ffffff' fill-opacity='0.32'/%3E%3Ccircle cx='1574' cy='746' r='0.8' fill='%23ffffff' fill-opacity='0.38'/%3E%3Ccircle cx='1534' cy='526' r='0.6' fill='%23ffffff' fill-opacity='0.49'/%3E%3Ccircle cx='339' cy='838' r='1.4' fill='%23ffffff' fill-opacity='0.51'/%3E%3Ccircle cx='1359' cy='308' r='0.8' fill='%23ffffff' fill-opacity='0.4'/%3E%3Ccircle cx='1229' cy='10' r='1.5' fill='%23ffffff' fill-opacity='0.47'/%3E%3Ccircle cx='38' cy='594' r='1.4' fill='%23ffffff' fill-opacity='0.45'/%3E%3Ccircle cx='1534' cy='906' r='0.7' fill='%23ffffff' fill-opacity='0.24'/%3E%3Ccircle cx='150' cy='25' r='0.7' fill='%23ffffff' fill-opacity='0.37'/%3E%3Ccircle cx='1388' cy='655' r='1.1' fill='%23ffffff' fill-opacity='0.23'/%3E%3Ccircle cx='266' cy='184' r='1.2' fill='%23ffffff' fill-opacity='0.34'/%3E%3Ccircle cx='880' cy='46' r='1.4' fill='%23ffffff' fill-opacity='0.48'/%3E%3Ccircle cx='742' cy='63' r='0.8' fill='%23ffffff' fill-opacity='0.5'/%3E%3Ccircle cx='502' cy='42' r='0.9' fill='%23ffffff' fill-opacity='0.34'/%3E%3Ccircle cx='1441' cy='295' r='1.1' fill='%23ffffff' fill-opacity='0.39'/%3E%3Ccircle cx='1517' cy='99' r='1.1' fill='%23ffffff' fill-opacity='0.43'/%3E%3Ccircle cx='1175' cy='967' r='1.2' fill='%23ffffff' fill-opacity='0.31'/%3E%3Ccircle cx='1304' cy='977' r='0.9' fill='%23ffffff' fill-opacity='0.33'/%3E%3Ccircle cx='1589' cy='108' r='0.7' fill='%23ffffff' fill-opacity='0.21'/%3E%3Ccircle cx='1303' cy='760' r='1.2' fill='%23ffffff' fill-opacity='0.37'/%3E%3Ccircle cx='32' cy='645' r='1.1' fill='%23ffffff' fill-opacity='0.37'/%3E%3Ccircle cx='78' cy='434' r='1.2' fill='%23ffffff' fill-opacity='0.28'/%3E%3Ccircle cx='1308' cy='724' r='0.8' fill='%23ffffff' fill-opacity='0.37'/%3E%3Ccircle cx='1541' cy='85' r='1.0' fill='%23ffffff' fill-opacity='0.38'/%3E%3Ccircle cx='1147' cy='890' r='1.2' fill='%23ffffff' fill-opacity='0.51'/%3E%3Ccircle cx='1214' cy='668' r='1.2' fill='%23ffffff' fill-opacity='0.47'/%3E%3Ccircle cx='392' cy='917' r='1.2' fill='%23ffffff' fill-opacity='0.34'/%3E%3Ccircle cx='1320' cy='964' r='0.6' fill='%23ffffff' fill-opacity='0.6'/%3E%3Ccircle cx='233' cy='553' r='0.9' fill='%23ffffff' fill-opacity='0.21'/%3E%3Ccircle cx='1510' cy='742' r='0.7' fill='%23ffffff' fill-opacity='0.37'/%3E%3Ccircle cx='1530' cy='704' r='0.9' fill='%23ffffff' fill-opacity='0.27'/%3E%3Ccircle cx='1522' cy='322' r='1.4' fill='%23ffffff' fill-opacity='0.29'/%3E%3Ccircle cx='245' cy='681' r='1.1' fill='%23ffffff' fill-opacity='0.26'/%3E%3Ccircle cx='444' cy='379' r='1.0' fill='%23ffffff' fill-opacity='0.38'/%3E%3Ccircle cx='1537' cy='34' r='1.4' fill='%23ffffff' fill-opacity='0.52'/%3E%3Ccircle cx='1127' cy='19' r='0.6' fill='%23ffffff' fill-opacity='0.39'/%3E%3Ccircle cx='12' cy='544' r='0.9' fill='%23ffffff' fill-opacity='0.22'/%3E%3Ccircle cx='727' cy='894' r='0.7' fill='%23ffffff' fill-opacity='0.34'/%3E%3Ccircle cx='1267' cy='822' r='0.6' fill='%23ffffff' fill-opacity='0.4'/%3E%3Ccircle cx='300' cy='403' r='0.8' fill='%23ffffff' fill-opacity='0.41'/%3E%3Ccircle cx='1284' cy='843' r='1.4' fill='%23ffffff' fill-opacity='0.57'/%3E%3Ccircle cx='28' cy='582' r='1.4' fill='%23ffffff' fill-opacity='0.21'/%3E%3Ccircle cx='95' cy='815' r='1.2' fill='%23ffffff' fill-opacity='0.43'/%3E%3Ccircle cx='754' cy='800' r='0.8' fill='%23ffffff' fill-opacity='0.32'/%3E%3Ccircle cx='1424' cy='71' r='1.1' fill='%23ffffff' fill-opacity='0.21'/%3E%3Ccircle cx='1085' cy='190' r='0.7' fill='%23ffffff' fill-opacity='0.29'/%3E%3Ccircle cx='59' cy='495' r='1.2' fill='%23ffffff' fill-opacity='0.47'/%3E%3Ccircle cx='253' cy='104' r='1.1' fill='%23ffffff' fill-opacity='0.57'/%3E%3Ccircle cx='839' cy='78' r='0.8' fill='%23ffffff' fill-opacity='0.53'/%3E%3Ccircle cx='65' cy='352' r='1.2' fill='%23ffffff' fill-opacity='0.4'/%3E%3Ccircle cx='279' cy='710' r='0.7' fill='%23ffffff' fill-opacity='0.39'/%3E%3Ccircle cx='1362' cy='807' r='1.2' fill='%23ffffff' fill-opacity='0.56'/%3E%3Ccircle cx='348' cy='778' r='1.4' fill='%23ffffff' fill-opacity='0.4'/%3E%3Ccircle cx='1552' cy='390' r='1.4' fill='%23ffffff' fill-opacity='0.58'/%3E%3Ccircle cx='1270' cy='11' r='1.2' fill='%23ffffff' fill-opacity='0.33'/%3E%3Ccircle cx='258' cy='931' r='1.4' fill='%23ffffff' fill-opacity='0.41'/%3E%3Ccircle cx='331' cy='998' r='1.3' fill='%23ffffff' fill-opacity='0.41'/%3E%3Ccircle cx='1184' cy='883' r='0.7' fill='%23ffffff' fill-opacity='0.33'/%3E%3Ccircle cx='649' cy='178' r='1.3' fill='%23ffffff' fill-opacity='0.41'/%3E%3Ccircle cx='580' cy='131' r='1.0' fill='%23ffffff' fill-opacity='0.19'/%3E%3Ccircle cx='929' cy='26' r='0.8' fill='%23ffffff' fill-opacity='0.46'/%3E%3Ccircle cx='171' cy='928' r='1.4' fill='%23ffffff' fill-opacity='0.4'/%3E%3Ccircle cx='822' cy='123' r='1.0' fill='%23ffffff' fill-opacity='0.28'/%3E%3Ccircle cx='1025' cy='771' r='0.8' fill='%23ffffff' fill-opacity='0.45'/%3E%3Ccircle cx='57' cy='823' r='1.3' fill='%23ffffff' fill-opacity='0.43'/%3E%3Ccircle cx='1178' cy='731' r='1.0' fill='%23ffffff' fill-opacity='0.34'/%3E%3Ccircle cx='6' cy='664' r='1.1' fill='%23ffffff' fill-opacity='0.42'/%3E%3Ccircle cx='1596' cy='197' r='1.3' fill='%23ffffff' fill-opacity='0.28'/%3E%3Ccircle cx='1300' cy='483' r='0.9' fill='%23ffffff' fill-opacity='0.2'/%3E%3Ccircle cx='1322' cy='500' r='1.0' fill='%23ffffff' fill-opacity='0.37'/%3E%3Ccircle cx='1384' cy='751' r='0.8' fill='%23ffffff' fill-opacity='0.34'/%3E%3Ccircle cx='1251' cy='793' r='1.4' fill='%23ffffff' fill-opacity='0.26'/%3E%3Ccircle cx='1425' cy='77' r='1.2' fill='%23ffffff' fill-opacity='0.31'/%3E%3Ccircle cx='234' cy='831' r='1.2' fill='%23ffffff' fill-opacity='0.29'/%3E%3Ccircle cx='589' cy='193' r='0.7' fill='%23ffffff' fill-opacity='0.24'/%3E%3Ccircle cx='1409' cy='655' r='1.3' fill='%23ffffff' fill-opacity='0.19'/%3E%3Ccircle cx='1540' cy='374' r='1.2' fill='%23ffffff' fill-opacity='0.45'/%3E%3Ccircle cx='585' cy='346' r='1.0' fill='%23ffffff' fill-opacity='0.45'/%3E%3Ccircle cx='822' cy='224' r='1.2' fill='%23ffffff' fill-opacity='0.19'/%3E%3Ccircle cx='933' cy='87' r='0.7' fill='%23ffffff' fill-opacity='0.39'/%3E%3Ccircle cx='1279' cy='327' r='0.8' fill='%23ffffff' fill-opacity='0.32'/%3E%3Ccircle cx='77' cy='187' r='1.2' fill='%23ffffff' fill-opacity='0.24'/%3E%3Ccircle cx='1356' cy='221' r='1.1' fill='%23ffffff' fill-opacity='0.23'/%3E%3Ccircle cx='185' cy='405' r='0.8' fill='%23ffffff' fill-opacity='0.5'/%3E%3Ccircle cx='326' cy='577' r='1.1' fill='%23ffffff' fill-opacity='0.52'/%3E%3Cpath d='M515 60 h10 M520 55 v10' fill='none' stroke='%23f0abfc' stroke-opacity='0.47' stroke-width='1.1' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M1075 90 h10 M1080 85 v10' fill='none' stroke='%23f0abfc' stroke-opacity='0.47' stroke-width='1.1' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M1535 620 h10 M1540 615 v10' fill='none' stroke='%23f0abfc' stroke-opacity='0.47' stroke-width='1.1' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M85 330 h10 M90 325 v10' fill='none' stroke='%23f0abfc' stroke-opacity='0.47' stroke-width='1.1' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M755 960 h10 M760 955 v10' fill='none' stroke='%23f0abfc' stroke-opacity='0.47' stroke-width='1.1' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M975 40 h10 M980 35 v10' fill='none' stroke='%23f0abfc' stroke-opacity='0.47' stroke-width='1.1' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"),
    radial-gradient(var(--dot-grid) 1.1px, rgba(0,0,0,0) 1.2px);
  background-size: cover, 26px 26px;
  background-position: center, 13px 13px;
  background-repeat: no-repeat, repeat;
  -webkit-mask-image: radial-gradient(130% 100% at 50% 30%, rgba(0,0,0,.55) 0%, #000 60%);
          mask-image: radial-gradient(130% 100% at 50% 30%, rgba(0,0,0,.55) 0%, #000 60%);
}

@media (hover: hover) and (pointer: fine) {
  html:not([data-theme="light"]) .card,
  html:not([data-theme="light"]) .stat,
  html:not([data-theme="light"]) .quick-action,
  html:not([data-theme="light"]) .identity-bar {
    -webkit-backdrop-filter: blur(5px) saturate(135%);
            backdrop-filter: blur(5px) saturate(135%);
  }
}
@media (hover: none), (pointer: coarse) {
  html:not([data-theme="light"]) {
    --card-bg: linear-gradient(160deg, rgba(34, 39, 92, .84) 0%, rgba(21, 25, 60, .80) 55%, rgba(17, 21, 50, .84) 100%);
  }
}

@-webkit-keyframes tr-aurora-drift {
  0%   { -webkit-transform: translate3d(0, 0, 0) scale(1); }
  50%  { -webkit-transform: translate3d(-2.5%, 1.5%, 0) scale(1.05); }
  100% { -webkit-transform: translate3d(2%, -1.5%, 0) scale(1.03); }
}
@keyframes tr-aurora-drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(-2.5%, 1.5%, 0) scale(1.05); }
  100% { transform: translate3d(2%, -1.5%, 0) scale(1.03); }
}

@media (prefers-reduced-motion: reduce) {
  html:not([data-theme="light"]) body::before { -webkit-animation: none; animation: none; }
}

@media print {
  body::before, body::after { display: none; }
}

html[dir="rtl"] body {
  font-family: var(--font-fa);
  line-height: var(--lh-normal);
}

html[dir="rtl"] *:not(.ltr):not(.mono):not(code):not(pre):not(kbd) { letter-spacing: 0; }

html[dir="rtl"] .ltr,
html[dir="rtl"] input[type="number"],
html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="url"],
html[dir="rtl"] input[type="tel"] {
  direction: ltr;
  unicode-bidi: embed;
  text-align: left;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  color: var(--ink);
}

h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }

p { margin: 0; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}

a:hover { color: var(--accent-soft); }

img, video, canvas { max-width: 100%; display: block; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
  margin: 0;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}

ul, ol { margin: 0; padding: 0; list-style: none; }

hr { border: 0; border-top: 1px solid var(--line); margin: var(--sp-4) 0; }

code, pre, .mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
  direction: ltr;
  unicode-bidi: embed;
}

code.block {
  display: block;
  margin-top: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-xs);
  background: var(--surface-3);
  overflow-x: auto;
  white-space: nowrap;
}

.num, .stat-value, td.num, .mono {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.ico {
  width: 1.25em;
  height: 1.25em;
  flex: 0 0 auto;
  display: inline-block;
  vertical-align: -0.25em;
  stroke-width: 2;
}

.ico--xs { width: 1em; height: 1em; vertical-align: -0.15em; }

html[dir="rtl"] .flip-rtl { transform: scaleX(-1); }

img.emoji {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  margin: 0 .05em;
  vertical-align: -0.2em;
}

:focus { outline: none; }

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

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

.skip-link {
  position: fixed;
  top: -100px;
  right: var(--sp-4);
  z-index: var(--z-palette);
  padding: var(--sp-3) var(--sp-5);
  background: var(--accent);
  color: var(--accent-contrast);
  border-radius: var(--r-sm);
  font-weight: var(--fw-semibold);
  box-shadow: var(--shadow-md);
}

.skip-link:focus-visible { top: var(--sp-4); }

* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: var(--r-full);
  border: 3px solid transparent;
  background-clip: content-box;
}

::selection { background: var(--accent-a45); color: var(--ink); }

.row      { display: flex; align-items: center; gap: var(--sp-2); }
.row--end { justify-content: flex-end; }
.row--wrap { flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.col      { display: flex; flex-direction: column; gap: var(--sp-2); }
.wrap     { flex-wrap: wrap; }
.grow     { flex: 1 1 auto; min-width: 0; }
.center   { display: flex; align-items: center; justify-content: center; }
.hidden   { display: none !important; }
[hidden]  { display: none !important; }

.muted    { color: var(--ink-2); }
.faint    { color: var(--ink-3); }
.tiny     { font-size: var(--fs-xs); }
.small    { font-size: var(--fs-sm); }
.strong   { font-weight: var(--fw-semibold); }
.bold     { font-weight: var(--fw-bold); }

.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger  { color: var(--danger); }
.text-accent  { color: var(--accent); }

.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ltr { direction: ltr; unicode-bidi: embed; }
.rtl { direction: rtl; unicode-bidi: embed; }

.divider {
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, rgba(0,0,0,0), var(--line), rgba(0,0,0,0));
  margin: var(--sp-3) 0;
}

html.no-flex-gap .row > * + *,
html.no-flex-gap .page-hero > * + *,
html.no-flex-gap .btn > * + * { margin-right: var(--sp-2); }
html.no-flex-gap[dir="ltr"] .row > * + *,
html.no-flex-gap[dir="ltr"] .btn > * + * { margin-right: 0; margin-left: var(--sp-2); }
html.no-flex-gap .stack > * + *,
html.no-flex-gap .col > * + * { margin-top: var(--sp-3); }

#app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.fullscreen {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6) var(--sp-4);
  padding-bottom: calc(var(--sp-6) + env(safe-area-inset-bottom));
}

.boot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
  color: var(--ink-2);
}

.maintenance {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-5);
  max-width: 32rem;
  padding: var(--sp-8) var(--sp-6);
  text-align: center;
  border-radius: var(--r-xl);
  border: 1px solid var(--line);
  background: var(--surface-1-t);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-lg);
}

.maintenance__icon { font-size: 3.25rem; line-height: 1; }
.maintenance__text { font-size: var(--fs-md); line-height: var(--lh-loose); color: var(--ink); margin: 0; }

.shell {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
}

.main {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
}

.sidebar {
  display: none;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  flex-direction: column;
  padding: var(--sp-5) var(--sp-4);
  background: var(--surface-1-t);
  -webkit-backdrop-filter: saturate(160%) blur(22px);
  backdrop-filter: saturate(160%) blur(22px);
  border-left: 1px solid var(--line);
  z-index: 51;
}

html[dir="ltr"] .sidebar { border-left: 0; border-right: 1px solid var(--line); }

.sidebar::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 16rem;
  pointer-events: none;
  background: linear-gradient(180deg, var(--accent-a12), rgba(0,0,0,0) 80%);
}

.sidebar > * { position: relative; }

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  padding: var(--sp-3);
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface-2);
  box-shadow: var(--shadow-xs);
}

.brand-name { font-weight: var(--fw-bold); font-size: var(--fs-md); }
.brand-tag { font-size: var(--fs-2xs); color: var(--ink-3); }

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  margin: 0 -8px;
  padding: 0 8px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-gutter: stable;
}

.sidebar__nav::-webkit-scrollbar { width: 10px; }
.sidebar__nav::-webkit-scrollbar-track { background: transparent; }
.sidebar__nav::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
  min-height: 40px;
}
.sidebar__nav:hover { scrollbar-color: var(--accent-a45) transparent; }
.sidebar__nav:hover::-webkit-scrollbar-thumb { background-color: var(--accent-a45); }
.sidebar__nav::-webkit-scrollbar-thumb:active { background-color: var(--accent); }

.sidebar__footer {
  padding-top: var(--sp-3);
  margin-top: var(--sp-2);
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: 46px;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  text-align: right;
  width: 100%;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

html[dir="ltr"] .nav-item { text-align: left; }

.nav-item:hover { background: var(--surface-3); color: var(--ink); }

.nav-item.is-active {
  background: var(--grad-brand-soft);
  color: var(--ink);
  font-weight: var(--fw-semibold);
  box-shadow: inset 0 0 0 1px var(--accent-a18);
}

.nav-item.is-active::before {
  content: "";
  position: absolute;
  right: -8px;
  top: 22%;
  bottom: 22%;
  width: 4px;
  border-radius: 0 0 0 0;
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
  background: var(--grad-brand);
}

html[dir="ltr"] .nav-item.is-active::before { right: auto; left: -8px; border-radius: 0 4px 4px 0; }

.nav-item__icon {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 11px;
  background: var(--surface-3);
  color: var(--ink-2);
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

.nav-item__icon .ico { width: 19px; height: 19px; }

.nav-item.is-active .nav-item__icon {
  background: var(--grad-brand);
  color: #fff;
  box-shadow: 0 6px 16px var(--accent-a45);
}

.nav-item kbd { margin-right: auto; flex: 0 0 auto; }
html[dir="ltr"] .nav-item kbd { margin-right: 0; margin-left: auto; }

.nav-item__badge {
  margin-right: auto;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: var(--r-full);
  background: var(--danger);
  color: #fff;
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  display: flex;
  align-items: center;
  justify-content: center;
}

html[dir="ltr"] .nav-item__badge { margin-right: 0; margin-left: auto; }

.topbar {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  height: calc(var(--topbar-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) var(--sp-4) 0;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(170%) blur(20px);
  backdrop-filter: saturate(170%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-base) var(--ease-out), background var(--dur-base) var(--ease-out);
}

.topbar.is-scrolled {
  background: var(--glass-strong);
  border-bottom-color: var(--line);
}

.topbar__brand .logo { width: 38px; height: 38px; border-radius: 12px; }

.shell-nav-btn {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 12px;
  margin-inline-end: 2px;
}
.shell-nav-btn .ico { width: 21px; height: 21px; }

.topbar__title {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--accent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar__sub {
  font-size: var(--fs-2xs);
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar__actions {
  margin-right: auto;
  display: flex;
  align-items: center;
  gap: 2px;
}

html[dir="ltr"] .topbar__actions { margin-right: 0; margin-left: auto; }

.topbar__actions .btn--icon { width: 44px; height: 44px; }
.topbar__actions .ico { width: 22px; height: 22px; }

.update-banner {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin: var(--sp-3) var(--sp-4) 0;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  background: var(--grad-brand-soft);
  border: 1px solid var(--accent-a28);
  font-size: var(--fs-sm);
  color: var(--ink);
}

.update-banner.hidden { display: none; }

.owner-password-warning {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin: var(--sp-3) var(--sp-4) 0;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  background: var(--danger-bg);
  border: 1px solid var(--danger-line);
  color: var(--ink);
}

.owner-password-warning__icon { color: var(--danger); }
.owner-password-warning__body { flex: 1 1 200px; }

.content {
  flex: 1 1 auto;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--sp-5) var(--sp-4);
}

.app-credit {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--sp-4) var(--sp-4) calc(var(--tabbar-h) + var(--sp-4) + env(safe-area-inset-bottom));
  text-align: center;
  font-size: var(--fs-2xs);
  letter-spacing: .06em;
  color: var(--ink-3);
  opacity: .7;
  -webkit-user-select: none;
  user-select: none;
}

.app-credit--flush { padding-bottom: calc(var(--sp-4) + env(safe-area-inset-bottom)); }

.app-credit a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
  opacity: .9;
}
.app-credit a:hover { opacity: 1; }

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

.page-header > .grow { min-width: 200px; }

.page-header__title {
  font-size: var(--fs-xl);
  font-weight: var(--fw-extrabold);
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}

.page-header__sub {
  margin-top: var(--sp-1);
  font-size: var(--fs-sm);
  color: var(--ink-2);
  line-height: var(--lh-snug);
  max-width: 68ch;
}

.page-header__actions { display: flex; gap: var(--sp-2); flex: 0 1 auto; flex-wrap: wrap; max-width: 100%; }

.grid { display: grid; gap: var(--sp-4); }
.grid--stats  { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.grid--cards  { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid--wide   { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.grid--split  { grid-template-columns: 1fr; }
.grid--tools  { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grid--2      { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

@media (max-width: 420px) {
  .grid--stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
  .grid--tools { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
}

.stack { display: flex; flex-direction: column; gap: var(--sp-3); }
.stack--tight { gap: var(--sp-2); }
.stack--loose { gap: var(--sp-5); }

.tabbar {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  z-index: var(--z-sticky);
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  height: 70px;
  padding: 6px;
  border-radius: 26px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
}

.tab {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 20px;
  color: var(--ink-3);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-medium);
  transition: color var(--dur-fast) var(--ease-out), background var(--dur-base) var(--ease-out);
}

.tab__icon {
  width: 34px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  transition: background var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-spring);
}

.tab__icon .ico { width: 23px; height: 23px; }

.tab__label {
  max-width: 100%;
  padding: 0 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11.5px;
  line-height: 1.2;
}

.tab:active .tab__icon { transform: scale(.9); }

.tab.is-active { color: var(--ink); font-weight: var(--fw-bold); }

.tab.is-active .tab__icon {
  background: var(--grad-brand);
  color: #fff;
  box-shadow: 0 6px 16px var(--accent-a45);
  width: 46px;
}

.tab__badge {
  position: absolute;
  top: 2px;
  left: 50%;
  margin-left: 6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--r-full);
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: var(--fw-bold);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg);
}

.btn--icon .tab__badge { top: 2px; left: auto; right: 2px; margin: 0; }

@media (min-width: 900px) {
  .sidebar { display: flex; }
  .tabbar { display: none; }
  .topbar__brand { display: none; }

  .content { padding: var(--sp-8); }

  .app-credit { padding: var(--sp-4) var(--sp-8) var(--sp-8); }

  .chat__composer,
  .chat__attachments { bottom: 0; }

  .topbar {
    height: calc(var(--topbar-h) + 10px + env(safe-area-inset-top));
    padding-left: var(--sp-8);
    padding-right: var(--sp-8);
  }

  .topbar__title { font-size: var(--fs-xl); }
  .update-banner, .owner-password-warning { margin: var(--sp-4) var(--sp-8) 0; }

  .grid--split { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  .page-header { margin-bottom: var(--sp-6); }
  .page-header__title { font-size: var(--fs-2xl); }
  .grid { gap: var(--sp-5); }
  .stack--loose { gap: var(--sp-6); }
}

@media (min-width: 1280px) {
  .grid--stats { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
  .grid--cards { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
  .grid--tools { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
}

@media (min-width: 1600px) {
  .content { padding-left: var(--sp-10); padding-right: var(--sp-10); }
  .grid--split { grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); }
}

@media (max-width: 360px) {
  .content { padding-left: var(--sp-3); padding-right: var(--sp-3); }
  .tab__label { font-size: 10.5px; }
  .tabbar { left: 6px; right: 6px; }
}

@supports not ((inset-inline-start: 0) or (inset-inline-end: 0)) {
  html[dir="rtl"] .shell-nav-btn { margin-left: 2px; }
  html[dir="ltr"] .shell-nav-btn { margin-right: 2px; }
}

.card {
  position: relative;
  background: var(--card-bg, var(--surface-1));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out);
}

.card::before {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  border-radius: inherit;
  background: var(--sheen-top);
  pointer-events: none;
}

.card > * { position: relative; }

.card--flat { box-shadow: none; background: var(--surface-2); }
.card--raised { box-shadow: var(--shadow-md); }
.card--pad-lg { padding: var(--sp-6); }
.card--pad-sm { padding: var(--sp-3); }

.card--interactive { cursor: pointer; }
.card--interactive:hover {
  border-color: var(--accent-a28);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.card--interactive:active { transform: translateY(-1px); }

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
  flex-wrap: wrap;
}

.card__title {
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  letter-spacing: -0.01em;
}

.card__desc {
  font-size: var(--fs-sm);
  color: var(--ink-2);
  line-height: var(--lh-snug);
}

.hero {
  position: relative;
  overflow: hidden;
  border: 0;
  border-radius: var(--r-xl);
  padding: var(--sp-6);
  color: #fff;
  background: var(--accent-deep);
  box-shadow: var(--shadow-accent);
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  top: -20%; right: -20%; bottom: -20%; left: -20%;
  z-index: -1;
  background: var(--grad-mesh), var(--grad-brand);
  background-blend-mode: screen, normal;
  filter: saturate(115%);
  animation: hero-drift 24s var(--ease-smooth) infinite alternate;
}

@keyframes hero-drift {
  from { transform: translate3d(-1.5%, -1%, 0) scale(1.02); }
  to   { transform: translate3d(1.5%, 1%, 0) scale(1.06); }
}

@media (prefers-reduced-motion: reduce) {
  .hero::before { animation: none; }
}

.hero::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: -1;
  background:
    radial-gradient(30rem 20rem at 88% -24%, rgba(255,255,255,.30), transparent 62%),
    radial-gradient(24rem 18rem at 4% 124%, rgba(0,0,0,.28), transparent 62%);
  pointer-events: none;
}

.hero > * { position: relative; z-index: 1; }
.hero__label {
  font-size: var(--fs-xs);
  opacity: .85;
  font-weight: var(--fw-semibold);
  letter-spacing: .02em;
}
.hero__value {
  font-size: var(--fs-3xl);
  font-weight: var(--fw-black);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-top: var(--sp-1);
  text-shadow: 0 2px 18px rgba(0, 0, 0, .22);
}
.hero__meta {
  margin-top: var(--sp-3);
  font-size: var(--fs-sm);
  opacity: .92;
}

@media (min-width: 900px) {
  .hero {
    padding: var(--sp-6) var(--sp-8);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: var(--sp-8);
  }

  .hero__label { grid-column: 1; grid-row: 1; align-self: end; }
  .hero__value { grid-column: 1; grid-row: 2; align-self: start; font-size: var(--fs-4xl); }

  .hero__meta {
    grid-column: 2;
    grid-row: 1 / span 2;
    justify-self: end;
    align-self: center;
    margin-top: 0;
    padding: var(--sp-2) var(--sp-4);
    border-radius: var(--r-full);
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .18);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    font-weight: var(--fw-medium);
  }
}

.stat {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  background: var(--card-bg, var(--surface-1));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--sp-3) var(--sp-4);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
}

.stat::before {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  border-radius: inherit;
  background: var(--sheen-top);
  pointer-events: none;
}

.stat::after {
  content: "";
  position: absolute;
  top: 0;
  right: 18%; left: 18%;
  height: 2px;
  border-radius: var(--r-full);
  background: var(--grad-brand);
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-out);
}

.stat:hover {
  border-color: var(--accent-a28);
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
}

.stat:hover::after { opacity: 1; }

.stat__body { min-width: 0; flex: 1 1 auto; position: relative; }

.stat--action { cursor: pointer; text-align: start; width: 100%; }
.stat--action:hover { border-color: var(--accent); }
.stat--action:active { transform: translateY(0) scale(.99); }

.stat__icon {
  position: relative;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  background: var(--accent-a12);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent-a18);
  transition: transform var(--dur-base) var(--ease-spring);
}

.stat:hover .stat__icon { transform: scale(1.06) rotate(-3deg); }

.stat__icon--success { background: var(--success-bg); color: var(--success); box-shadow: inset 0 0 0 1px rgba(42,214,152,.22); }
.stat__icon--warning { background: var(--warning-bg); color: var(--warning); box-shadow: inset 0 0 0 1px rgba(245,177,58,.22); }
.stat__icon--danger  { background: var(--danger-bg);  color: var(--danger);  box-shadow: inset 0 0 0 1px rgba(255,95,121,.22); }
.stat__icon--info    { background: var(--info-bg);    color: var(--info);    box-shadow: inset 0 0 0 1px rgba(72,178,251,.22); }

.stat__label {
  font-size: var(--fs-xs);
  color: var(--ink-2);
  font-weight: var(--fw-medium);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.stat__value {
  font-size: var(--fs-xl);
  font-weight: var(--fw-black);
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-top: 1px;
  font-variant-numeric: tabular-nums;
}

.stat__hint {
  margin-top: 2px;
  font-size: var(--fs-2xs);
  color: var(--ink-3);
}

@media (min-width: 900px) {
  .stat { padding: var(--sp-4) var(--sp-5); }
  .stat__value { font-size: var(--fs-2xl); }
  .stat__icon { width: 46px; height: 46px; font-size: 1.25rem; }
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: var(--tap);
  padding: 0 var(--sp-5);
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  overflow: hidden;
  transition: background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out),
              filter var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
}

.btn:active:not(:disabled) { transform: scale(.972); }

.btn:disabled,
.btn.is-loading {
  opacity: .55;
  cursor: not-allowed;
  pointer-events: none;
}

.btn.is-loading { color: transparent !important; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: spin .7s linear infinite;
  color: var(--ink);
}
.btn--primary.is-loading::after,
.btn--gradient.is-loading::after { color: var(--accent-contrast); }

.btn--primary {
  background: var(--accent);
  color: var(--accent-contrast);
  box-shadow: 0 6px 18px rgba(99, 82, 245, .34),
              inset 0 1px 0 rgba(255, 255, 255, .22);
}
.btn--primary:hover {
  background: var(--accent-strong);
  box-shadow: 0 10px 26px rgba(99, 82, 245, .44),
              inset 0 1px 0 rgba(255, 255, 255, .22);
}

.btn--gradient {
  background: var(--grad-brand);
  color: #fff;
  box-shadow: var(--shadow-accent), inset 0 1px 0 rgba(255, 255, 255, .24);
}
.btn--gradient:hover { filter: brightness(1.08) saturate(1.05); }

.btn--gradient::before {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: var(--grad-sheen);
  transform: translateX(-120%);
  pointer-events: none;
}

.btn--gradient:hover::before { animation: btn-sheen .9s var(--ease-out); }

@keyframes btn-sheen {
  to { transform: translateX(120%); }
}

.btn--secondary {
  background: var(--surface-3);
  color: var(--ink);
  border-color: var(--line);
}
.btn--secondary:hover { background: var(--surface-4); border-color: var(--line-strong); }

.btn--ghost { background: transparent; color: var(--ink-2); }
.btn--ghost:hover { background: var(--surface-3); color: var(--ink); }

.btn--danger {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 6px 18px rgba(255, 95, 121, .3), inset 0 1px 0 rgba(255,255,255,.2);
}
.btn--danger:hover { filter: brightness(1.07); }

.btn--danger-soft { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.btn--danger-soft:hover { background: var(--danger); color: #fff; }

.btn--success {
  background: var(--success);
  color: #06281c;
  box-shadow: 0 6px 18px rgba(42, 214, 152, .28), inset 0 1px 0 rgba(255,255,255,.24);
}
.btn--success:hover { filter: brightness(1.06); }

.btn--sm { min-height: 34px; padding-right: var(--sp-3); padding-left: var(--sp-3); font-size: var(--fs-xs); border-radius: var(--r-xs); }
.btn--lg { min-height: 54px; padding-right: var(--sp-6); padding-left: var(--sp-6); font-size: var(--fs-md); border-radius: var(--r-md); }
.btn--block { width: 100%; }
.btn--icon { padding: 0; width: var(--tap); min-width: var(--tap); border-radius: var(--r-sm); }
.btn--icon.btn--sm { width: 34px; min-width: 34px; }

.fab {
  position: fixed;
  inset-inline-end: var(--sp-4);
  bottom: calc(var(--tabbar-h) + var(--sp-4) + env(safe-area-inset-bottom));
  z-index: calc(var(--z-sticky) + 1);
  width: 58px;
  height: 58px;
  border-radius: var(--r-full);
  display: grid;
  place-items: center;
  font-size: 1.45rem;
  background: var(--grad-brand);
  color: #fff;
  box-shadow: var(--shadow-accent), inset 0 1px 0 rgba(255, 255, 255, .28);
  transition: transform var(--dur-base) var(--ease-spring),
              box-shadow var(--dur-base) var(--ease-out);
}
.fab:hover { transform: translateY(-2px) scale(1.04); box-shadow: var(--shadow-lg), var(--glow-soft); }
.fab:active { transform: scale(.92); }

@media (min-width: 900px) {
  .fab { bottom: var(--sp-6); inset-inline-end: var(--sp-6); }
}

.field { display: flex; flex-direction: column; gap: var(--sp-2); }

.field__label {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.field__hint { font-size: var(--fs-2xs); color: var(--ink-3); }

.field__error {
  font-size: var(--fs-2xs);
  color: var(--danger);
  display: none;
  align-items: center;
  gap: var(--sp-1);
}

.field.has-error .field__error { display: flex; }
.field.has-error .input,
.field.has-error .select,
.field.has-error .textarea {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(255, 95, 121, .14);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: var(--tap);
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--ink);
  font-size: var(--fs-sm);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .12);
  transition: border-color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}

html[data-theme="light"] .input,
html[data-theme="light"] .select,
html[data-theme="light"] .textarea { box-shadow: inset 0 1px 2px rgba(20, 26, 45, .04); }

.input::placeholder,
.textarea::placeholder { color: var(--ink-3); }

.input:hover,
.select:hover,
.textarea:hover { border-color: var(--line-strong); }

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface-1);
  box-shadow: 0 0 0 3px var(--accent-a18);
}

.textarea { min-height: 110px; resize: vertical; line-height: var(--lh-snug); }

.select {
  appearance: none;
  padding-inline-end: var(--sp-8);
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%),
                    linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

html[dir="rtl"] .select {
  background-position: 13px 50%, 18px 50%;
}

.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .input { padding-inline-start: var(--sp-10); }
.input-wrap__icon {
  position: absolute;
  inset-inline-start: var(--sp-4);
  color: var(--ink-3);
  pointer-events: none;
  font-size: .95rem;
  transition: color var(--dur-fast) var(--ease-out);
}

.input-wrap:focus-within .input-wrap__icon { color: var(--accent); }

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  cursor: pointer;
  min-height: var(--tap);
}

.switch__input { position: absolute; opacity: 0; width: 0; height: 0; }

.switch__track {
  width: 46px;
  height: 27px;
  border-radius: var(--r-full);
  background: var(--surface-4);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .2);
  transition: background var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
  flex: 0 0 auto;
  position: relative;
}

.switch__thumb {
  position: absolute;
  top: 2px;
  inset-inline-start: 2px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--ink-2);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
  transition: transform var(--dur-base) var(--ease-spring),
              background var(--dur-base) var(--ease-out);
}

.switch__input:checked + .switch__track {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .18), 0 0 14px var(--accent-a45);
}
.switch__input:checked + .switch__track .switch__thumb { background: #fff; transform: translateX(19px); }
html[dir="rtl"] .switch__input:checked + .switch__track .switch__thumb { transform: translateX(-19px); }
.switch__input:focus-visible + .switch__track { box-shadow: 0 0 0 3px var(--accent-a28); }

.check {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: var(--tap);
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  cursor: pointer;
  font-size: var(--fs-sm);
  transition: border-color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
}

.check:hover { border-color: var(--line-strong); background: var(--surface-3); }
.check input { accent-color: var(--accent); width: 18px; height: 18px; flex: 0 0 auto; }
.check.is-checked { border-color: var(--accent); background: var(--accent-a12); }

.check--card {
  width: 100%;
  align-items: flex-start;
  padding: var(--sp-3);
}
.check--card .check__box { margin-top: 2px; }

.check--row { width: 100%; }
.check--row .badge { flex: 0 0 auto; }

.option-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-1);
  text-align: start;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}

.option-row:hover { border-color: var(--line-strong); background: var(--surface-2); }
.option-row:active { transform: scale(.995); }

.option-row.is-active {
  border-color: var(--accent);
  background: var(--accent-a12);
  box-shadow: 0 0 0 3px var(--accent-a08);
}

.option-row__icon { font-size: 1.25rem; flex: 0 0 auto; }
.option-row__title { display: block; font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.option-row__desc { display: block; font-size: var(--fs-xs); color: var(--ink-3); margin-top: 2px; }

.option-row__check {
  flex: 0 0 auto;
  opacity: 0;
  color: var(--accent);
  font-weight: var(--fw-bold);
  transform: scale(.7);
  transition: opacity var(--dur-fast) var(--ease-out),
              transform var(--dur-base) var(--ease-spring);
}

.option-row.is-active .option-row__check { opacity: 1; transform: scale(1); }

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 116px;
  padding: var(--sp-4);
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: var(--fs-sm);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}

.dropzone:hover,
.dropzone.is-dragover {
  border-color: var(--accent);
  background: var(--accent-a08);
  color: var(--ink);
}

.dropzone.has-file { border-style: solid; border-color: var(--success); color: var(--success); }
.dropzone__icon { font-size: 1.7rem; }
.dropzone__hint { font-size: var(--fs-2xs); color: var(--ink-3); }

.uploader__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
}

[data-record-voice].is-recording {
  border-color: var(--danger);
  color: var(--danger);
  animation: rec-pulse 1.2s ease-in-out infinite;
}

@keyframes rec-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .55; }
}

@media (prefers-reduced-motion: reduce) {
  [data-record-voice].is-recording { animation: none; }
}

.uploader__item.is-removed {
  opacity: .55;
  border-style: dashed;
  border-color: var(--danger);
}

.uploader__item.is-removed .uploader__name { text-decoration: line-through; }

.field--amount .segmented--sign { margin-bottom: var(--sp-2); }

.field--amount input {
  direction: ltr;
  unicode-bidi: isolate;
  text-align: start;
  font-variant-numeric: tabular-nums;
}

.field--amount [data-amount-preview] {
  min-height: 1.1em;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.field--amount.has-error [data-amount-preview] { color: var(--danger); }
.field--amount.has-error input { border-color: var(--danger); }

.btn--with-label {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  white-space: nowrap;
}

.btn--with-label .btn__label { font-size: var(--fs-xs); }

@media (max-width: 360px) {
  .btn--with-label .btn__label { display: none; }
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--sp-3);
}

@media (min-width: 1280px) {
  .gallery { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--sp-4); }
}

.gallery__item {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
}

.gallery__item:hover {
  transform: translateY(-3px);
  border-color: var(--accent-a28);
  box-shadow: var(--shadow-md);
}

.gallery__image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  background: var(--surface-3, var(--surface-2));
  transition: transform var(--dur-slow) var(--ease-out);
}

.gallery__item:hover .gallery__image { transform: scale(1.04); }

.gallery__caption {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--fs-2xs);
  color: var(--ink-2);
  min-width: 0;
}

.gallery__actions {
  display: flex;
  gap: var(--sp-2);
  padding: 0 var(--sp-3) var(--sp-3);
  margin-top: auto;
}

.gallery__actions .btn { flex: 1; }
.gallery__actions .btn--icon { flex: none; }

.uploader__list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
}

.uploader__item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}

.uploader__thumb { font-size: 1.1rem; flex: none; }

.uploader__meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.uploader__name {
  display: block;
  font-size: var(--fs-xs);
  color: var(--ink);
}

.uploader__size {
  display: block;
  font-size: var(--fs-2xs);
  color: var(--ink-3);
  direction: ltr;
  unicode-bidi: isolate;
}

.uploader__remove {
  flex: none;
  width: var(--tap);
  height: var(--tap);
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--r-xs);
  background: transparent;
  color: var(--ink-3);
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}

.uploader__remove:hover { background: var(--danger-bg); color: var(--danger); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 3px var(--sp-2);
  border-radius: var(--r-full);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
  line-height: 1.5;
  white-space: nowrap;
  background: var(--surface-3);
  color: var(--ink-2);
  border: 1px solid var(--line-soft);
}

.badge--success { background: var(--success-bg); color: var(--success); border-color: transparent; }
.badge--warning { background: var(--warning-bg); color: var(--warning); border-color: transparent; }
.badge--danger  { background: var(--danger-bg);  color: var(--danger);  border-color: transparent; }
.badge--info    { background: var(--info-bg);    color: var(--info);    border-color: transparent; }
.badge--muted   { background: var(--surface-3);  color: var(--ink-3);   border-color: var(--line-soft); }

.card--graded {
  border-color: var(--success-line);
  background: linear-gradient(
    180deg,
    var(--success-bg),
    var(--surface-2) 70%
  );
  box-shadow: 0 0 0 3px var(--success-bg);
}

.grade-block {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
}

.grade-block__value {
  font-family: var(--font-en);
  font-size: var(--fs-3xl);
  font-weight: var(--fw-extrabold);
  line-height: 1.1;
  color: var(--success);
  direction: ltr;
  unicode-bidi: isolate;
}

.grade-block__label {
  font-size: var(--fs-xs);
  color: var(--ink-3);
}

.feedback-block {
  margin-top: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  background: var(--surface-3);
  border-inline-start: 3px solid var(--accent);
}

.feedback-block__label {
  display: block;
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
  color: var(--ink-3);
  margin-bottom: var(--sp-1);
}

.feedback-block__body {
  display: block;
  margin: 0;
  font-size: var(--fs-sm);
  line-height: var(--lh-normal);
  color: var(--ink);
  white-space: pre-wrap;
}
.badge--accent  { background: var(--accent-a18); color: var(--accent); border-color: transparent; }
.badge--solid   { background: var(--accent); color: var(--accent-contrast); border-color: transparent; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 36px;
  padding: 0 var(--sp-4);
  border-radius: var(--r-full);
  background: var(--surface-3);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
}

.chip:hover { border-color: var(--line-strong); color: var(--ink); transform: translateY(-1px); }
.chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
  font-weight: var(--fw-semibold);
  box-shadow: 0 6px 16px var(--accent-a45);
}

.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }

.chip--icon {
  justify-content: center;
  width: 36px;
  padding: 0;
  font-size: var(--fs-sm);
}

.prefs-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2) var(--sp-4);
}

.prefs-bar__theme { display: flex; gap: var(--sp-2); }

.segmented {
  display: inline-flex;
  padding: 4px;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: none;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .14);
  scroll-behavior: smooth;

  background:
    linear-gradient(to right, var(--surface-3) 60%, transparent) left center / 28px 100% no-repeat local,
    linear-gradient(to left,  var(--surface-3) 60%, transparent) right center / 28px 100% no-repeat local,
    linear-gradient(to right, rgba(0, 0, 0, .22), transparent) left center / 18px 100% no-repeat scroll,
    linear-gradient(to left,  rgba(0, 0, 0, .22), transparent) right center / 18px 100% no-repeat scroll,
    var(--surface-3);
}
.segmented::-webkit-scrollbar { display: none; }

@media (hover: hover) and (pointer: fine) {
  .segmented, .cl-filters { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
  .segmented::-webkit-scrollbar, .cl-filters::-webkit-scrollbar { display: block; height: 6px; }
  .segmented::-webkit-scrollbar-thumb, .cl-filters::-webkit-scrollbar-thumb {
    background: var(--line-strong);
    border-radius: 999px;
  }
  .segmented:hover::-webkit-scrollbar-thumb, .cl-filters:hover::-webkit-scrollbar-thumb { background: var(--accent-a45); }
}

@media (prefers-reduced-motion: reduce) {
  .segmented { scroll-behavior: auto; }
}

.stack > .segmented,
.col > .segmented { align-self: flex-start; max-width: 100%; }

.segmented__item {
  min-height: 34px;
  padding-right: var(--sp-4); padding-left: var(--sp-4);
  border-radius: var(--r-full);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: var(--ink-2);
  white-space: nowrap;
  transition: background var(--dur-base) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
}

.segmented__item:hover { color: var(--ink); }

.segmented__item.is-active {
  background: var(--surface-1);
  color: var(--ink);
  font-weight: var(--fw-semibold);
  box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line);
}

.list { display: flex; flex-direction: column; gap: var(--sp-2); }

.list-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: 64px;
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  text-align: start;
  width: 100%;
  transition: border-color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}

.list-item--stacked {
  flex-direction: column;
  align-items: stretch;
  gap: var(--sp-2);
}

.list-item--button { cursor: pointer; font: inherit; color: inherit; }
.list-item--button:hover { border-color: var(--accent); background: var(--surface-2); }
.list-item--button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.list-item.is-muted { opacity: .62; }
.list-item.is-muted:hover { opacity: .85; }

.list-item--clickable { cursor: pointer; }
.list-item--clickable:hover {
  border-color: var(--accent-a28);
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
}
.list-item--clickable:active { transform: scale(.995); }

.list-item__avatar {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  color: var(--accent-contrast);
  background: var(--grad-brand);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .26), 0 4px 12px var(--accent-a28);
  letter-spacing: 0;
}

.list-item__avatar--muted { background: var(--surface-4); color: var(--ink-2); box-shadow: none; }
.list-item__avatar--emoji { background: var(--surface-3); font-size: 1.2rem; box-shadow: inset 0 0 0 1px var(--line); }

.list-item__body { flex: 1 1 auto; min-width: 0; display: block; }

.list-item__title {
  display: block;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-item__sub {
  display: block;
  margin-top: 2px;
  font-size: var(--fs-xs);
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-item__meta {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.list-item__chevron {
  color: var(--ink-3);
  font-size: .8rem;
  flex: 0 0 auto;
  transition: transform var(--dur-base) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
html[dir="rtl"] .list-item__chevron { transform: scaleX(-1); }

html[dir="ltr"] .list-item--clickable:hover .list-item__chevron { transform: translateX(3px); color: var(--accent); }
html[dir="rtl"] .list-item--clickable:hover .list-item__chevron { transform: scaleX(-1) translateX(3px); color: var(--accent); }

@media (min-width: 900px) {
  .list-item { padding: var(--sp-3) var(--sp-5); }
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-1);
  box-shadow: var(--shadow-xs);
}

.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }

.table th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: start;
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-3);
  background: var(--surface-2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.table td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

.table tbody tr { transition: background var(--dur-fast) var(--ease-out); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table tbody tr.is-highlighted td { background: var(--accent-a08); }

@media (max-width: 640px) {
  .table-wrap:has(.table[data-cards]) { border: 0; background: transparent; box-shadow: none; overflow: visible; }
  .table[data-cards] thead { display: none; }
  .table[data-cards], .table[data-cards] tbody, .table[data-cards] tr, .table[data-cards] td { display: block; width: 100%; }
  .table[data-cards] tbody { display: flex; flex-direction: column; gap: var(--sp-2); }
  .table[data-cards] tr {
    padding: var(--sp-2) var(--sp-3);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--surface-1);
    box-shadow: var(--shadow-xs);
  }
  .table[data-cards] td {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--sp-3);
    padding: 6px 0;
    border-bottom: 1px dashed var(--line-soft);
    text-align: end;
    overflow-wrap: anywhere;
    min-width: 0;
  }
  .table[data-cards] tr td:last-child { border-bottom: 0; }
  .table[data-cards] td[data-label]::before {
    content: attr(data-label);
    flex: 0 0 auto;
    max-width: 45%;
    text-align: start;
    font-size: var(--fs-2xs);
    font-weight: var(--fw-semibold);
    color: var(--ink-3);
  }
  .table[data-cards] td:not([data-label])::before, .table[data-cards] td[data-label=""]::before { content: none; }
  .table[data-cards] td:has(> :nth-child(2)) { display: block; text-align: start; }
  .table[data-cards] td:has(> :nth-child(2))::before { display: block; max-width: none; margin-bottom: 2px; }
  .table[data-cards] tbody tr:hover td { background: transparent; }
}

.progress {
  position: relative;
  height: 9px;
  border-radius: var(--r-full);
  background: var(--surface-4);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .2);
}

.progress__bar {
  position: relative;
  height: 100%;
  border-radius: var(--r-full);
  background: var(--grad-brand);
  box-shadow: 0 0 12px var(--accent-a45);
  transition: width var(--dur-slow) var(--ease-out);
}

.progress--sm { height: 6px; }
.progress__bar--success { background: var(--success); box-shadow: 0 0 12px rgba(42, 214, 152, .4); }
.progress__bar--warning { background: var(--warning); box-shadow: 0 0 12px rgba(245, 177, 58, .4); }
.progress__bar--danger  { background: var(--danger);  box-shadow: 0 0 12px rgba(255, 95, 121, .4); }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-12) var(--sp-5);
  text-align: center;
  color: var(--ink-2);
}

.empty__icon {
  width: 76px;
  height: 76px;
  border-radius: var(--r-lg);
  display: grid;
  place-items: center;
  font-size: 2rem;
  background: var(--surface-3);
  color: var(--ink-3);
  box-shadow: inset 0 0 0 1px var(--line), 0 12px 30px rgba(0, 0, 0, .16);
}

.empty__title { font-size: var(--fs-md); font-weight: var(--fw-semibold); color: var(--ink); }
.empty__desc { font-size: var(--fs-sm); max-width: 44ch; line-height: var(--lh-snug); }

.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  line-height: var(--lh-snug);
  border: 1px solid transparent;
}

.alert--danger  { background: var(--danger-bg);  color: var(--danger);  border-color: var(--danger-line); }
.alert--warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-line); }
.alert--success { background: var(--success-bg); color: var(--success); border-color: var(--success-line); }
.alert--info    { background: var(--info-bg);    color: var(--info);    border-color: var(--info-line); }
.alert__icon { flex: 0 0 auto; font-size: 1.05rem; }
.alert__body { flex: 1 1 auto; min-width: 0; }

.skeleton {
  border-radius: var(--r-sm);
  background: linear-gradient(90deg, var(--skeleton-1) 25%, var(--skeleton-2) 50%, var(--skeleton-1) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s linear infinite;
}

.skeleton--text { height: 12px; margin-top: 5px; margin-bottom: 5px; }
.skeleton--title { height: 18px; width: 45%; }
.skeleton--line  { height: 12px; width: 100%; }
.skeleton--line-sm { height: 12px; width: 60%; }
.skeleton--avatar { width: 44px; height: 44px; border-radius: var(--r-sm); flex: 0 0 auto; }
.skeleton--card { height: 96px; border-radius: var(--r-lg); }
.skeleton--stat { height: 118px; border-radius: var(--r-lg); }

@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

@keyframes spin { to { transform: rotate(360deg); } }

.spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2.5px solid var(--line-strong);
  border-top-color: var(--accent);
  animation: spin .75s linear infinite;
  filter: drop-shadow(0 0 8px var(--accent-a28));
}

.spinner--sm { width: 16px; height: 16px; border-width: 2px; filter: none; }

.overlay {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: var(--z-modal);
  background: var(--overlay);
  backdrop-filter: blur(8px) saturate(120%);
  -webkit-backdrop-filter: blur(8px) saturate(120%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: overlay-in var(--dur-base) var(--ease-out);
}

@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
  position: relative;
  width: 100%;
  max-height: 92vh;
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  background: var(--surface-1);
  border: 1px solid var(--line-strong);
  border-bottom: 0;
  border-start-start-radius: var(--r-xl);
  border-start-end-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  animation: sheet-in var(--dur-slow) var(--ease-out);
  overflow: hidden;
}

.modal::before {
  content: "";
  position: absolute;
  top: 0;
  right: 8%; left: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--sheen-edge), transparent);
  pointer-events: none;
  z-index: 2;
}

@keyframes sheet-in {
  from { transform: translateY(26px); opacity: .5; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal__grabber {
  width: 44px;
  height: 4px;
  border-radius: var(--r-full);
  background: var(--line-strong);
  margin: var(--sp-3) auto var(--sp-1);
  flex: 0 0 auto;
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-5) var(--sp-3);
  flex: 0 0 auto;
}

.modal__title { font-size: var(--fs-lg); font-weight: var(--fw-bold); letter-spacing: -0.02em; }

.modal__body {
  padding: var(--sp-2) var(--sp-5) var(--sp-5);
  overflow-y: auto;
  flex: 1 1 auto;
  -webkit-overflow-scrolling: touch;
}

.modal__footer {
  display: flex;
  gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-5);
  padding-bottom: max(var(--sp-4), env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-soft);
  background: var(--surface-1);
  flex: 0 0 auto;
}

.modal__footer .btn { flex: 1 1 auto; }

@media (min-width: 700px) {
  .overlay { align-items: center; padding: var(--sp-6); }
  .modal {
    max-width: 580px;
    max-height: 84vh;
    max-height: 84dvh;
    border-radius: var(--r-xl);
    border-bottom: 1px solid var(--line-strong);
    animation: modal-in var(--dur-base) var(--ease-out);
  }
  .modal--wide { max-width: 880px; }
  .modal__grabber { display: none; }
  .modal__header { padding-top: var(--sp-5); }
  .modal__footer .btn { flex: 0 1 auto; min-width: 120px; }
  .modal__footer { justify-content: flex-end; }
}

@media (min-width: 1600px) {
  .modal { max-width: 640px; }
  .modal--wide { max-width: 1000px; }
}

@keyframes modal-in {
  from { transform: scale(.96) translateY(10px); opacity: 0; }
  to   { transform: scale(1) translateY(0);     opacity: 1; }
}

.drawer-overlay {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: var(--z-drawer);
  background: var(--overlay);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  justify-content: flex-end;
  animation: overlay-in var(--dur-base) var(--ease-out);
}

html[dir="rtl"] .drawer-overlay { justify-content: flex-start; }

.drawer {
  width: min(440px, 92vw);
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--surface-1);
  border-inline-start: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  animation: drawer-in var(--dur-slow) var(--ease-out);
}

html[dir="rtl"] .drawer { border-inline-start: 0; border-inline-end: 1px solid var(--line); }

@keyframes drawer-in {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

html[dir="rtl"] .drawer { animation-name: drawer-in-rtl; }
@keyframes drawer-in-rtl {
  from { transform: translateX(-100%); }
  to   { transform: translateX(0); }
}

.drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-5);
  padding-top: max(var(--sp-5), env(safe-area-inset-top));
  border-bottom: 1px solid var(--line-soft);
  flex: 0 0 auto;
}

.drawer__body { flex: 1 1 auto; overflow-y: auto; padding: var(--sp-4); }
.drawer__footer {
  padding: var(--sp-3) var(--sp-4);
  padding-bottom: max(var(--sp-3), env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-soft);
  display: flex;
  gap: var(--sp-2);
}

.palette-overlay {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: var(--z-palette);
  background: var(--overlay);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: max(var(--sp-8), env(safe-area-inset-top)) var(--sp-4) var(--sp-4);
  animation: overlay-in var(--dur-fast) var(--ease-out);
}

@media (min-width: 900px) {
  .palette-overlay { padding-top: 14vh; }
}

.palette {
  position: relative;
  width: min(660px, 100%);
  max-height: 70vh;
  max-height: 70dvh;
  display: flex;
  flex-direction: column;
  background: var(--glass-strong);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--accent-a12);
  overflow: hidden;
  animation: modal-in var(--dur-base) var(--ease-out);
}

.palette__input {
  width: 100%;
  min-height: 60px;
  padding: var(--sp-4) var(--sp-5);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: var(--fs-lg);
  color: var(--ink);
}

.palette__input:focus { outline: none; }
.palette__results { overflow-y: auto; padding: var(--sp-2); }

.palette__item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  min-height: 54px;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-sm);
  text-align: start;
  color: var(--ink);
  transition: background var(--dur-fast) var(--ease-out);
}

.palette__item:hover,
.palette__item.is-active { background: var(--accent-a12); }

.palette__kind {
  font-size: var(--fs-2xs);
  color: var(--ink-3);
  padding: 2px var(--sp-2);
  border-radius: var(--r-full);
  background: var(--surface-3);
  border: 1px solid var(--line-soft);
  flex: 0 0 auto;
}

.palette__hint {
  padding: var(--sp-2) var(--sp-5);
  border-top: 1px solid var(--line-soft);
  font-size: var(--fs-2xs);
  color: var(--ink-3);
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

kbd {
  display: inline-block;
  direction: ltr;
  unicode-bidi: isolate;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  background: var(--surface-3);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-2);
}

.alerts {
  position: fixed;
  right: 0; left: 0;
  top: calc(var(--topbar-h) + var(--sp-3) + env(safe-area-inset-top));
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  padding-right: var(--sp-4); padding-left: var(--sp-4);
  pointer-events: none;
}

@media (min-width: 900px) {
  .alerts {
    inset-inline-start: auto;
    inset-inline-end: var(--sp-6);
    top: calc(var(--topbar-h) + var(--sp-6));
    align-items: flex-end;
    padding-right: 0; padding-left: 0;
  }
}

.alert-banner {
  pointer-events: auto;
  width: 100%;
  max-width: 30rem;
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  background: var(--glass-strong);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: var(--shadow-lg);
  animation: banner-in var(--dur-base) var(--ease-out);
}

.alert-banner--success { border-color: var(--success-line); }
.alert-banner--danger  { border-color: var(--danger-line); }

.alert-banner.is-clickable { cursor: pointer; }
.alert-banner.is-clickable:hover { border-color: var(--accent); }

.alert-banner__icon { font-size: 1.25rem; flex: none; line-height: 1.4; }

.alert-banner__body { flex: 1; min-width: 0; }

.alert-banner__title {
  display: block;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--ink);
  line-height: var(--lh-snug);
}

.alert-banner__text {
  display: block;
  margin-top: 2px;
  font-size: var(--fs-xs);
  color: var(--ink-2);
  line-height: var(--lh-snug);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.alert-banner__close {
  flex: none;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--r-xs);
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  font-size: var(--fs-xs);
}

.alert-banner__close:hover { background: var(--surface-3); color: var(--ink); }

.alert-banner.is-leaving {
  animation: banner-out var(--dur-base) var(--ease-out) forwards;
}

@keyframes banner-in {
  from { opacity: 0; transform: translateY(-14px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes banner-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-12px); }
}

@media (prefers-reduced-motion: reduce) {
  .alert-banner,
  .alert-banner.is-leaving { animation: none; }
}

.toasts {
  position: fixed;
  right: 0; left: 0;
  bottom: calc(var(--tabbar-h) + var(--sp-4) + env(safe-area-inset-bottom));
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  padding-right: var(--sp-4); padding-left: var(--sp-4);
  pointer-events: none;
}

@media (min-width: 900px) {
  .toasts {
    bottom: var(--sp-6);
    inset-inline-start: auto;
    inset-inline-end: var(--sp-6);
    align-items: flex-end;
  }
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  max-width: min(460px, 100%);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  background: var(--glass-strong);
  backdrop-filter: blur(18px) saturate(170%);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-md);
  color: var(--ink);
  font-size: var(--fs-sm);
  pointer-events: auto;
  animation: toast-in var(--dur-slow) var(--ease-spring);
}

@keyframes toast-in {
  from { transform: translateY(18px) scale(.95); opacity: 0; }
  to   { transform: translateY(0) scale(1);      opacity: 1; }
}

.toast.is-leaving { animation: toast-out var(--dur-base) var(--ease-in) forwards; }
@keyframes toast-out {
  to { transform: translateY(10px) scale(.97); opacity: 0; }
}

.toast--success { border-color: var(--success); box-shadow: var(--shadow-md), 0 0 0 1px rgba(42,214,152,.2); }
.toast--error   { border-color: var(--danger);  box-shadow: var(--shadow-md), 0 0 0 1px rgba(255,95,121,.2); }
.toast--warning { border-color: var(--warning); box-shadow: var(--shadow-md), 0 0 0 1px rgba(245,177,58,.2); }
.toast__icon { flex: 0 0 auto; font-size: 1.05rem; }
.toast__action { flex: 0 0 auto; color: var(--accent); font-weight: var(--fw-semibold); font-size: var(--fs-xs); }
.toast__close {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
}
.toast__close:hover { color: var(--ink); background: var(--surface-3); border-color: var(--line-soft); }
.toast__close:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.toast__close svg { width: 15px; height: 15px; }

.offline-bar {
  position: fixed;
  right: 0; left: 0;
  top: 0;
  z-index: var(--z-toast);
  padding: var(--sp-2) var(--sp-4);
  padding-top: max(var(--sp-2), env(safe-area-inset-top));
  background: var(--warning);
  color: #241800;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  text-align: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
  animation: slide-down var(--dur-base) var(--ease-out);
}

@keyframes slide-down { from { transform: translateY(-100%); } to { transform: translateY(0); } }

.global-loader {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: var(--z-toast);
  display: grid;
  place-items: center;
  background: var(--overlay);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.global-loader__box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-6) var(--sp-8);
  background: var(--glass-strong);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  font-size: var(--fs-sm);
  color: var(--ink-2);
}

.top-progress {
  position: fixed;
  right: 0; left: 0;
  top: 0;
  height: 3px;
  z-index: var(--z-toast);
  background: var(--grad-brand);
  box-shadow: 0 0 12px var(--accent-a45);
  transform-origin: 0 50%;
  animation: top-progress 1.2s var(--ease-out) infinite;
}

html[dir="rtl"] .top-progress { transform-origin: 100% 50%; }

@keyframes top-progress {
  0%   { transform: scaleX(0);   opacity: 1; }
  70%  { transform: scaleX(.85); opacity: 1; }
  100% { transform: scaleX(1);   opacity: 0; }
}

.logo {
  position: relative;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  background: var(--grad-brand);
  box-shadow: var(--shadow-accent), inset 0 1px 0 rgba(255, 255, 255, .3);
  color: #fff;
  overflow: hidden;
}

.logo::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: radial-gradient(60% 50% at 30% 12%, rgba(255,255,255,.5), transparent 70%);
  pointer-events: none;
}

.logo--lg {
  width: 68px;
  height: 68px;
  border-radius: var(--r-lg);
  font-size: 2rem;
}

.logo--sm { width: 32px; height: 32px; border-radius: var(--r-sm); font-size: 1rem; }

.logo--mark,
.auth__logo--mark {
  background: none;
  box-shadow: none;
}
.logo--mark::after,
.auth__logo--mark::after { display: none; }

.brand-mark {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
  filter: drop-shadow(0 10px 22px rgba(99, 82, 245, .38));
}

.brand-name { font-size: var(--fs-md); font-weight: var(--fw-bold); letter-spacing: -0.02em; }
.brand-tag  { font-size: var(--fs-2xs); color: var(--ink-3); }

.reveal > * {
  animation: reveal var(--dur-slow) var(--ease-out) backwards;
}

.reveal > *:nth-child(1) { animation-delay: 0ms; }
.reveal > *:nth-child(2) { animation-delay: 45ms; }
.reveal > *:nth-child(3) { animation-delay: 90ms; }
.reveal > *:nth-child(4) { animation-delay: 135ms; }
.reveal > *:nth-child(5) { animation-delay: 180ms; }
.reveal > *:nth-child(6) { animation-delay: 225ms; }
.reveal > *:nth-child(n+7) { animation-delay: 270ms; }

@keyframes reveal {
  from { opacity: 0; transform: translateY(14px) scale(.99); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .reveal > * { animation: none; }
  .modal, .overlay, .drawer, .toast, .palette { animation: none; }
  .btn--gradient:hover::before { animation: none; }
}

.identity-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-width: 0;
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--card-bg, var(--surface-1));
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.identity-bar::before {
  content: "";
  position: absolute;
  top: -60%;
  inset-inline-start: -10%;
  width: 22rem;
  height: 14rem;
  pointer-events: none;
  background: radial-gradient(closest-side, var(--accent-a12), transparent 72%);
}

.identity-bar > * { position: relative; }

.identity-bar__avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  inline-size: 44px;
  block-size: 44px;
  border-radius: 50%;
  background: var(--accent-a18);
  color: var(--accent);
  font-weight: var(--fw-bold);
  font-size: var(--fs-sm);
  text-transform: uppercase;
  box-shadow: inset 0 0 0 1px var(--accent-a28);
}

.identity-bar__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 auto;
}

.identity-bar__name {
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  letter-spacing: -.01em;
}

.identity-bar__meta {
  font-size: var(--fs-2xs);
  color: var(--ink-3);
  margin-top: 1px;
}

.identity-bar__class { flex: 0 0 auto; max-inline-size: 45%; }

@media (max-width: 520px) {
  .identity-bar__class { display: none; }
}

@media (min-width: 900px) {
  .identity-bar { padding: var(--sp-4) var(--sp-5); }
  .identity-bar__avatar { inline-size: 48px; block-size: 48px; font-size: var(--fs-md); }
  .identity-bar__name { font-size: var(--fs-lg); }
}

.priority {
  position: relative;
  border-radius: var(--r-lg);
  background: var(--surface-2);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-4) var(--sp-4) var(--sp-3);
  overflow: hidden;
}

.priority::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0; left: 0;
  height: 3px;
  background: var(--grad-brand);
  opacity: .9;
}

.priority--alarm::before {
  background: linear-gradient(90deg, var(--danger), var(--warning));
}

.priority__head {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}

.priority__spark {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  background: var(--accent-a12);
  font-size: 1.05rem;
  line-height: 1;
}

.priority__title {
  margin: 0;
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}

.priority__sub {
  margin: 2px 0 0;
  font-size: var(--fs-xs);
  color: var(--ink-3);
  line-height: 1.35;
}

.priority__pills { display: flex; gap: var(--sp-1); flex: 0 0 auto; }

.priority__pill {
  min-width: 26px;
  padding: 2px var(--sp-2);
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 700;
  text-align: center;
  line-height: 1.5;
}

.priority__pill--danger  { background: var(--danger-bg);  color: var(--danger); }
.priority__pill--warning { background: var(--warning-bg); color: var(--warning); }

.priority__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.priority__item { margin: 0; }

.priority__btn {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  padding-inline-start: calc(var(--sp-3) + 6px);
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: inherit;
  text-align: start;
  font: inherit;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-smooth),
              transform var(--dur-fast) var(--ease-smooth);
}

.priority__btn:hover { background: var(--surface-3); }
.priority__btn:active { transform: scale(.995); }

.priority__rail {
  position: absolute;
  inset-inline-start: 0;
  top: var(--sp-2); bottom: var(--sp-2);
  width: 3px;
  border-radius: 999px;
}

.priority__rail--danger  { background: var(--danger); }
.priority__rail--warning { background: var(--warning); }
.priority__rail--info    { background: var(--info); }

.priority__icon {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  font-size: 1.05rem;
  line-height: 1;
}

.priority__icon--danger  { background: var(--danger-bg);  color: var(--danger); }
.priority__icon--warning { background: var(--warning-bg); color: var(--warning); }
.priority__icon--info    { background: var(--info-bg);    color: var(--info); }

.priority__body { flex: 1 1 auto; min-width: 0; }

.priority__row { display: flex; align-items: baseline; gap: var(--sp-2); min-width: 0; }

.priority__label {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
}

.priority__count {
  flex: 0 0 auto;
  padding: 1px var(--sp-2);
  border-radius: 999px;
  background: var(--surface-4);
  color: var(--ink-2);
  font-size: var(--fs-xs);
  font-weight: 700;
}

.priority__desc {
  display: block;
  margin-top: 2px;
  font-size: var(--fs-xs);
  color: var(--ink-3);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.priority__meta {
  flex: 0 0 auto;
  align-self: center;
  font-size: var(--fs-xs);
  font-weight: 600;
  white-space: nowrap;
}

.priority__meta--danger  { color: var(--danger); }
.priority__meta--warning { color: var(--warning); }
.priority__meta--info    { color: var(--ink-3); }

.priority__chevron {
  flex: 0 0 auto;
  color: var(--ink-3);
  font-size: 1.1rem;
  line-height: 1;
}

[dir="rtl"] .priority__chevron { transform: scaleX(-1); }

.priority__more {
  margin: var(--sp-2) 0 0;
  padding-inline-start: var(--sp-3);
  font-size: var(--fs-xs);
  color: var(--ink-3);
}

.priority--clear { padding: var(--sp-3) var(--sp-4); }
.priority--clear::before { background: var(--success); opacity: .55; }

.priority__clear { display: flex; align-items: center; gap: var(--sp-3); }

.priority__clear-icon {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  background: var(--success-bg);
  color: var(--success);
  font-size: 1rem;
  line-height: 1;
}

.priority__clear-title {
  display: block;
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--ink);
}

.priority__clear-desc {
  display: block;
  font-size: var(--fs-xs);
  color: var(--ink-3);
}

@media (min-width: 700px) {
  .priority { padding: var(--sp-5) var(--sp-5) var(--sp-4); }
  .priority__btn { padding: var(--sp-3) var(--sp-4); padding-inline-start: calc(var(--sp-4) + 6px); }
}

.modelbar {
  border-radius: var(--r-lg);
  background: var(--surface-2);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  margin-bottom: var(--sp-3);
}

.modelbar__head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  padding: var(--sp-3);
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-smooth);
}

.modelbar__head:hover { background: var(--surface-3); }

.modelbar__icon {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  background: var(--accent-a12);
  font-size: 1rem;
  line-height: 1;
}

.modelbar__head-body { flex: 1 1 auto; min-width: 0; }

.modelbar__title {
  display: block;
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}

.modelbar__current {
  display: block;
  margin-top: 2px;
  font-size: var(--fs-xs);
  color: var(--ink-3);
  line-height: 1.3;
}

.modelbar__action {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  color: var(--accent);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.modelbar__chevron {
  display: inline-block;
  font-size: 1rem;
  line-height: 1;
  transition: transform var(--dur-base) var(--ease-out);
}

.modelbar.is-open .modelbar__chevron { transform: rotate(180deg); }

.modelbar__body {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--dur-base) var(--ease-out),
              opacity var(--dur-fast) var(--ease-smooth);
  opacity: 0;
}

.modelbar.is-open .modelbar__body { max-height: 1400px; opacity: 1; }

.modelbar__inner { padding: 0 var(--sp-3) var(--sp-3); }

.modelbar__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--sp-2);
}

.modelchip {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface-1);
  color: var(--ink-2);
  font: inherit;
  font-size: var(--fs-sm);
  cursor: pointer;
  min-width: 0;
  transition: border-color var(--dur-fast) var(--ease-smooth),
              background var(--dur-fast) var(--ease-smooth),
              transform var(--dur-fast) var(--ease-smooth);
}

.modelchip:hover { border-color: var(--accent); transform: translateY(-1px); }
.modelchip:active { transform: translateY(0) scale(.99); }

.modelchip__icon { flex: 0 0 auto; font-size: .95rem; line-height: 1; }
.modelchip__name { flex: 1 1 auto; min-width: 0; font-weight: 600; }

.modelchip__check {
  flex: 0 0 auto;
  opacity: 0;
  color: var(--success);
  font-weight: 700;
  transition: opacity var(--dur-fast) var(--ease-smooth);
}

.modelchip.is-selected {
  border-color: var(--accent);
  background: var(--accent-a08);
  color: var(--ink);
}

.modelchip.is-selected .modelchip__check { opacity: 1; }

@media (min-width: 700px) {
  .modelbar__head { padding: var(--sp-3) var(--sp-4); }
  .modelbar__inner { padding: 0 var(--sp-4) var(--sp-4); }
}

.showcase {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}

.showcase__slider {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface-3);
  box-shadow: var(--shadow-sm);
  isolation: isolate;
}

.showcase__slider::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px var(--accent-a18),
              inset 0 -40px 60px -30px rgba(0, 0, 0, .55);
  z-index: 2;
}

.showcase__stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 7;
}

@media (max-width: 560px) {
  .showcase__stage { aspect-ratio: 16 / 9; }
}

.showcase__slide {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 700ms var(--ease-smooth), visibility 700ms;
}

.showcase__slide.is-active { opacity: 1; visibility: visible; }

.showcase__slide[data-go] { cursor: pointer; }

.showcase__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.001);
  transition: transform 900ms var(--ease-out);
}

.showcase__slider:hover .showcase__slide.is-active .showcase__img { transform: scale(1.05); }

.showcase__caption {
  position: absolute;
  right: 0; left: 0;
  bottom: 0;
  padding: var(--sp-6) var(--sp-4) var(--sp-3);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, .72));
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.4;
  z-index: 1;
}

.showcase__dots {
  position: absolute;
  bottom: 2px;
  inset-inline-end: var(--sp-2);
  display: flex;
  align-items: center;
  gap: 2px;
  z-index: 3;
}

.showcase__dot {
  position: relative;
  width: 30px;
  height: 28px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  overflow: visible;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: width var(--dur-base) var(--ease-out);
}

.showcase__dot::before {
  content: "";
  display: block;
  width: 22px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .35);
  transition: background var(--dur-fast) var(--ease-smooth),
              width var(--dur-base) var(--ease-out);
}

.showcase__dot:hover::before { background: rgba(255, 255, 255, .6); }

.showcase__dot.is-active { width: 42px; }
.showcase__dot.is-active::before { width: 34px; background: rgba(255, 255, 255, .9); }

.showcase__dot:focus-visible { outline: none; }
.showcase__dot:focus-visible::before {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.showcase__dot-fill { display: none; }

.showcase__ticker {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
  overflow: hidden;
}

.showcase__ticker-icon { flex: 0 0 auto; font-size: .95rem; line-height: 1; }

.showcase__marquee {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 36px, #000 calc(100% - 36px), transparent);
          mask-image: linear-gradient(to right, transparent, #000 36px, #000 calc(100% - 36px), transparent);
}

.showcase__track {
  --ticker-duration: 40s;
  display: flex;
  width: max-content;
  will-change: transform;
  animation: showcase-marquee var(--ticker-duration) linear infinite;
}

[dir="rtl"] .showcase__track { animation-name: showcase-marquee-rtl; }

.showcase__seq {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  padding-inline-end: var(--sp-5);
  flex: 0 0 auto;
}

.showcase__tick {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  white-space: nowrap;
  font-size: var(--fs-sm);
  color: var(--ink-2);
}

.showcase__tick[data-go] { cursor: pointer; }
.showcase__tick[data-go]:hover .showcase__tick-text { color: var(--accent); }

.showcase__tick-dot { color: var(--accent); font-size: .6rem; line-height: 1; }

.showcase__tick-text { transition: color var(--dur-fast) var(--ease-smooth); }

.showcase__ticker:hover .showcase__track,
.showcase__ticker:focus-within .showcase__track { animation-play-state: paused; }

@keyframes showcase-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@keyframes showcase-marquee-rtl {
  from { transform: translateX(0); }
  to   { transform: translateX(50%); }
}

@media (prefers-reduced-motion: reduce) {
  .showcase__track { animation: none; }
  .showcase__marquee { overflow-x: auto; }
  .showcase__seq[data-seq-clone] { display: none; }
  .showcase__slide { transition: none; }
  .showcase__img { transition: none; }
  .showcase__slider:hover .showcase__slide.is-active .showcase__img { transform: none; }
}

@media (min-width: 900px) {
  .showcase__stage {
    aspect-ratio: 21 / 7;
    max-height: 320px;
  }
  .showcase__ticker { padding: var(--sp-2) var(--sp-4); }
}

.shw-admin__item { transition: opacity var(--dur-fast) var(--ease-smooth); }

.shw-admin__item.is-off { opacity: .55; }

.shw-admin__thumb {
  flex: 0 0 auto;
  width: 84px;
  height: 56px;
  border-radius: var(--r-sm);
  object-fit: cover;
  background: var(--surface-3);
  border: 1px solid var(--line);
}

.shw-admin__thumb--text {
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  line-height: 1;
}

@media (max-width: 420px) {
  .shw-admin__thumb { width: 64px; height: 44px; }
}

.attach-strip {
  display: flex;
  gap: var(--sp-2);
  overflow-x: auto;
  overflow-y: hidden;
  padding-top: var(--sp-1); padding-bottom: var(--sp-1);
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.attach {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  max-width: 13rem;
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: var(--fs-xs);
  text-align: start;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}

.attach--static { cursor: default; }

@media (hover: hover) {
  .attach:not(.attach--static):hover {
    border-color: var(--danger);
    transform: translateY(-1px);
  }
  .attach:not(.attach--static):hover .attach__remove { opacity: 1; }
}

.attach__thumb {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: var(--r-xs);
  background: var(--surface-3, var(--surface-2));
  box-shadow: inset 0 0 0 1px var(--line);
  display: block;
}

.attach__icon { font-size: var(--fs-lg); }

.attach__name {
  min-width: 0;
  max-width: 8.5rem;
  font-size: var(--fs-2xs);
  line-height: var(--lh-snug);
}

.attach__remove {
  flex: 0 0 auto;
  font-size: var(--fs-2xs);
  color: var(--danger);
  opacity: .65;
  transition: opacity var(--dur-fast) var(--ease-out);
}

.attach-strip--sent {
  margin-top: var(--sp-2);
  flex-wrap: wrap;
  overflow: visible;
}

.attach-strip--sent .attach {
  background: var(--surface-1-t, var(--surface-2));
  max-width: 11rem;
}

.attach-strip--sent .attach__thumb { width: 40px; height: 40px; }

.badge--soft { background: var(--surface-3); color: var(--ink-2); border-color: transparent; }

.log-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 60vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.log-entry {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-1);
  border-inline-start: 3px solid var(--line-strong);
}

.log-entry--login    { border-inline-start-color: var(--success); }
.log-entry--security { border-inline-start-color: var(--warning); }
.log-entry--error    { border-inline-start-color: var(--danger); }
.log-entry--question { border-inline-start-color: var(--accent); }

.log-entry__icon { flex: 0 0 auto; font-size: var(--fs-sm); line-height: 1.4; }
.log-entry__body { display: flex; flex-direction: column; gap: var(--sp-1); min-width: 0; flex: 1 1 auto; }
.log-entry__title { font-size: var(--fs-xs); color: var(--ink); overflow-wrap: anywhere; }

.log-entry__meta { display: flex; flex-wrap: wrap; gap: var(--sp-1); }

.log-chip {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  color: var(--ink-3);
  background: var(--surface-3);
  border-radius: var(--r-xs);
  padding: 1px var(--sp-2);
  direction: ltr;
  unicode-bidi: isolate;
}

.log-entry__time {
  flex: 0 0 auto;
  font-size: var(--fs-2xs);
  color: var(--ink-3);
  white-space: nowrap;
  direction: ltr;
  unicode-bidi: isolate;
}

.marquee-host { position: relative; z-index: 2; }
.marquee-host[hidden] { display: none !important; }

.marquee {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  padding-top: var(--sp-2); padding-bottom: var(--sp-2);
  padding-inline-start: var(--sp-3); padding-inline-end: calc(var(--sp-3) + 2rem);
  background: linear-gradient(90deg, var(--accent-a18), var(--accent-a08));
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.marquee__viewport { overflow: hidden; width: 100%; }

.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee-scroll var(--marquee-duration, 30s) linear infinite;
}

[dir="rtl"] .marquee__track { animation-name: marquee-scroll-rtl; }

.marquee__group {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding-inline-end: var(--sp-6);
  white-space: nowrap;
}

.marquee__item { font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.marquee__sep { color: var(--accent); opacity: .6; }
.marquee__link { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.marquee__img {
  height: 3rem;
  width: auto;
  border-radius: var(--radius-sm);
  object-fit: cover;
  margin-inline-end: var(--sp-3);
}

.marquee__pause {
  position: absolute;
  top: 50%;
  inset-inline-end: var(--sp-2);
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  inline-size: 1.75rem;
  block-size: 1.75rem;
  border: 0;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  font-size: .7rem;
  opacity: .75;
}
.marquee__pause:hover { opacity: 1; }

.marquee[data-paused] .marquee__track { animation-play-state: paused; }
.marquee:hover .marquee__track { animation-play-state: paused; }

@keyframes marquee-scroll     { from { transform: translateX(0);    } to { transform: translateX(-50%); } }
@keyframes marquee-scroll-rtl { from { transform: translateX(0);    } to { transform: translateX(50%);  } }

@media (prefers-reduced-motion: reduce) {
  .marquee__track { animation: none; width: auto; }
  .marquee__viewport { overflow-x: auto; scrollbar-width: thin; }
  .marquee__group:nth-child(2) { display: none; }
  .marquee__pause { display: none; }
}

.marquee-admin__thumb {
  height: 2.5rem; width: auto;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.events-strip { display: flex; flex-direction: column; gap: var(--sp-2); }
.events-strip[hidden] { display: none !important; }

.events-strip__title {
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text-muted);
}

.events-strip__grid {
  display: grid;
  gap: var(--sp-2);
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
}

.event-btn {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border: 1px solid var(--border);
  border-inline-start: 3px solid var(--event-accent, var(--accent));
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.event-btn:hover {
  transform: translateY(-1px);
  border-color: var(--event-accent, var(--accent));
  box-shadow: var(--shadow-sm);
}
.event-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.event-btn__icon { font-size: 1.4rem; line-height: 1; flex: none; }
.event-btn__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.event-btn__label { font-weight: 600; font-size: var(--fs-sm); }
.event-btn__desc {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.event-btn__go { color: var(--text-muted); flex: none; font-size: var(--fs-sm); }

.backup-modules {
  display: grid;
  gap: var(--sp-2);
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
}

.backup-module {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  padding: var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.backup-module:hover { border-color: var(--accent); }
.backup-module:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-a08);
}

.backup-module input { margin-top: 3px; flex: none; }
.backup-module__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.backup-module__label {
  display: flex; align-items: center; gap: var(--sp-2);
  font-weight: 600; font-size: var(--fs-sm);
}
.backup-module__meta { overflow: hidden; text-overflow: ellipsis; }

.list-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.list-row + .list-row { margin-top: var(--sp-2); }
.list-row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.list-row__title {
  display: flex; align-items: center; gap: var(--sp-2);
  font-weight: 600; font-size: var(--fs-sm); min-width: 0;
}
.list-row__meta { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.list-row__actions { display: flex; align-items: center; gap: 4px; flex: none; }

.owner-password-warning {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border: 1px solid var(--danger);
  border-radius: var(--radius-md);
  background: var(--danger-bg);
}
.owner-password-warning__body { flex: 1; min-width: 0; }

@supports not ((inset-inline-start: 0) or (inset-inline-end: 0)) {
  html[dir="rtl"] .fab { left: var(--sp-4); }
  html[dir="ltr"] .fab { right: var(--sp-4); }
  @media (min-width: 900px) { html[dir="rtl"] .fab { left: var(--sp-6); } }
  @media (min-width: 900px) { html[dir="ltr"] .fab { right: var(--sp-6); } }
  html[dir="rtl"] .select { padding-left: var(--sp-8); }
  html[dir="ltr"] .select { padding-right: var(--sp-8); }
  html[dir="rtl"] .input-wrap .input { padding-right: var(--sp-10); }
  html[dir="ltr"] .input-wrap .input { padding-left: var(--sp-10); }
  html[dir="rtl"] .input-wrap__icon { right: var(--sp-4); }
  html[dir="ltr"] .input-wrap__icon { left: var(--sp-4); }
  html[dir="rtl"] .switch__thumb { right: 2px; }
  html[dir="ltr"] .switch__thumb { left: 2px; }
  html[dir="rtl"] .feedback-block { border-right: 3px solid var(--accent); }
  html[dir="ltr"] .feedback-block { border-left: 3px solid var(--accent); }
  html[dir="rtl"] .modal { border-top-right-radius: var(--r-xl); border-top-left-radius: var(--r-xl); }
  html[dir="ltr"] .modal { border-top-left-radius: var(--r-xl); border-top-right-radius: var(--r-xl); }
  html[dir="rtl"] .drawer { border-right: 1px solid var(--line); }
  html[dir="ltr"] .drawer { border-left: 1px solid var(--line); }
  html[dir="rtl"] .drawer { border-right: 0; border-left: 1px solid var(--line); }
  @media (min-width: 900px) { html[dir="rtl"] .alerts { right: auto; left: var(--sp-6); } }
  @media (min-width: 900px) { html[dir="ltr"] .alerts { left: auto; right: var(--sp-6); } }
  @media (min-width: 900px) { html[dir="rtl"] .toasts { right: auto; left: var(--sp-6); } }
  @media (min-width: 900px) { html[dir="ltr"] .toasts { left: auto; right: var(--sp-6); } }
  html[dir="rtl"] .identity-bar::before { right: -10%; }
  html[dir="ltr"] .identity-bar::before { left: -10%; }
  html[dir="rtl"] .priority__btn { padding-right: calc(var(--sp-3) + 6px); }
  html[dir="ltr"] .priority__btn { padding-left: calc(var(--sp-3) + 6px); }
  html[dir="rtl"] .priority__rail { right: 0; }
  html[dir="ltr"] .priority__rail { left: 0; }
  html[dir="rtl"] .priority__more { padding-right: var(--sp-3); }
  html[dir="ltr"] .priority__more { padding-left: var(--sp-3); }
  @media (min-width: 700px) { html[dir="rtl"] .priority__btn { padding-right: calc(var(--sp-4) + 6px); } }
  @media (min-width: 700px) { html[dir="ltr"] .priority__btn { padding-left: calc(var(--sp-4) + 6px); } }
  html[dir="rtl"] .showcase__dots { left: var(--sp-2); }
  html[dir="ltr"] .showcase__dots { right: var(--sp-2); }
  html[dir="rtl"] .showcase__seq { padding-left: var(--sp-5); }
  html[dir="ltr"] .showcase__seq { padding-right: var(--sp-5); }
  html[dir="rtl"] .log-entry { border-right: 3px solid var(--line-strong); }
  html[dir="ltr"] .log-entry { border-left: 3px solid var(--line-strong); }
  html[dir="rtl"] .log-entry--login { border-right-color: var(--success); }
  html[dir="ltr"] .log-entry--login { border-left-color: var(--success); }
  html[dir="rtl"] .log-entry--security { border-right-color: var(--warning); }
  html[dir="ltr"] .log-entry--security { border-left-color: var(--warning); }
  html[dir="rtl"] .log-entry--error { border-right-color: var(--danger); }
  html[dir="ltr"] .log-entry--error { border-left-color: var(--danger); }
  html[dir="rtl"] .log-entry--question { border-right-color: var(--accent); }
  html[dir="ltr"] .log-entry--question { border-left-color: var(--accent); }
  html[dir="rtl"] .marquee { padding-right: var(--sp-3); padding-left: calc(var(--sp-3) + 2rem); }
  html[dir="ltr"] .marquee { padding-left: var(--sp-3); padding-right: calc(var(--sp-3) + 2rem); }
  html[dir="rtl"] .marquee__group { padding-left: var(--sp-6); }
  html[dir="ltr"] .marquee__group { padding-right: var(--sp-6); }
  html[dir="rtl"] .marquee__img { margin-left: var(--sp-3); }
  html[dir="ltr"] .marquee__img { margin-right: var(--sp-3); }
  html[dir="rtl"] .marquee__pause { left: var(--sp-2); }
  html[dir="ltr"] .marquee__pause { right: var(--sp-2); }
  html[dir="rtl"] .event-btn { border-right: 3px solid var(--event-accent, var(--accent)); }
  html[dir="ltr"] .event-btn { border-left: 3px solid var(--event-accent, var(--accent)); }
}

.login__lang {
  display: flex;
  justify-content: center;
  gap: var(--sp-2);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-top: var(--sp-6); margin-bottom: var(--sp-3);
}

.section-title:first-child { margin-top: 0; }

.section-title__text {
  position: relative;
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  letter-spacing: -0.015em;
  padding-inline-start: var(--sp-3);
}

.section-title__text::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 12%; bottom: 12%;
  width: 3px;
  border-radius: var(--r-full);
  background: var(--grad-brand);
}

.section-title__link {
  font-size: var(--fs-xs);
  color: var(--accent);
  font-weight: var(--fw-semibold);
  transition: opacity var(--dur-fast) var(--ease-out);
}

.section-title__link:hover { opacity: .75; }

.quick-action {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  background: var(--card-bg, var(--surface-1));
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  text-align: start;
  width: 100%;
  overflow: hidden;
  transition: border-color var(--dur-base) var(--ease-out),
              background var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
}

.quick-action::before {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  border-radius: inherit;
  background: var(--sheen-top);
  pointer-events: none;
}

.quick-action:hover {
  border-color: var(--accent-a28);
  background: var(--accent-a08);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.quick-action:active { transform: translateY(-1px); }

.quick-action__icon {
  position: relative;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: transform var(--dur-base) var(--ease-spring),
              background var(--dur-base) var(--ease-out);
}

.quick-action:hover .quick-action__icon {
  transform: scale(1.08) rotate(-4deg);
  background: var(--accent-a18);
}

.quick-action__title { display: block; font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.quick-action__desc  { display: block; font-size: var(--fs-2xs); color: var(--ink-3); margin-top: 2px; line-height: var(--lh-snug); }

.chart-card { display: flex; flex-direction: column; gap: var(--sp-3); }

.chart {
  width: 100%;
  overflow: visible;
}

.chart__grid-line { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 4; }
.chart__axis-label { fill: var(--ink-3); font-size: 10px; }
.chart__line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 3px 10px var(--accent-a45));
}
.chart__area { fill: url(#chartGradient); }
.chart__dot { fill: var(--surface-1); stroke: var(--accent); stroke-width: 2.5; }
.chart__bar {
  fill: var(--accent);
  rx: 4;
  filter: drop-shadow(0 2px 8px var(--accent-a28));
  transition: fill var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out);
}
.chart__bar:hover { fill: var(--accent-soft); }
.chart__bar--muted { fill: var(--surface-4); }
.chart__bar-track { fill: var(--surface-3); opacity: .45; rx: 4; }

.chart-axis {
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-2xs);
  color: var(--ink-3);
  margin-top: var(--sp-1);
  font-variant-numeric: tabular-nums;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  font-size: var(--fs-2xs);
  color: var(--ink-2);
}

.chart-legend__item { display: flex; align-items: center; gap: var(--sp-2); }
.chart-legend__swatch { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }

.ring { display: grid; place-items: center; position: relative; }
.ring__track { stroke: var(--surface-4); }
.ring__value {
  stroke: var(--accent);
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px var(--accent-a45));
  transition: stroke-dashoffset var(--dur-slow) var(--ease-out);
}
.ring__label {
  position: absolute;
  text-align: center;
  font-size: var(--fs-lg);
  font-weight: var(--fw-black);
  font-variant-numeric: tabular-nums;
}
.ring__label small { display: block; font-size: var(--fs-2xs); font-weight: var(--fw-medium); color: var(--ink-3); }

.sparkline { width: 100%; height: 32px; overflow: visible; }
.sparkline__path { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; }

.chat {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  min-height: 50vh;
  min-height: 50dvh;
}

.chat__scroll {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding-bottom: var(--sp-3);
}

.msg { display: flex; gap: var(--sp-2); max-width: 88%; }
.msg--user { align-self: flex-end; flex-direction: row-reverse; }
.msg--ai   { align-self: flex-start; }

.msg__bubble {
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-lg);
  font-size: var(--fs-sm);
  line-height: var(--lh-normal);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  animation: msg-in var(--dur-base) var(--ease-out) backwards;
}

@keyframes msg-in {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.msg--user .msg__bubble {
  background: var(--grad-brand);
  color: #fff;
  border-end-end-radius: var(--r-xs);
  box-shadow: 0 8px 22px var(--accent-a28), inset 0 1px 0 rgba(255, 255, 255, .22);
}

.msg--ai .msg__bubble {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink);
  border-end-start-radius: var(--r-xs);
  box-shadow: var(--shadow-xs);
}

.msg__avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: var(--r-xs);
  display: grid;
  place-items: center;
  font-size: .9rem;
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px var(--line);
}

.msg__image { border-radius: var(--r-md); margin-top: var(--sp-2); max-width: 100%; }

.chat__attachments {
  position: sticky;
  bottom: calc(var(--tabbar-h) + var(--sp-2) + env(safe-area-inset-bottom));
  padding-bottom: var(--sp-2);
  z-index: 3;
}

.chat__composer {
  position: sticky;
  bottom: calc(var(--tabbar-h) + var(--sp-2) + env(safe-area-inset-bottom));
  z-index: 3;
  display: flex;
  align-items: flex-end;
  gap: var(--sp-2);
  padding: var(--sp-3);
  background: var(--glass-strong);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  transition: border-color var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
}

.chat__composer:focus-within {
  border-color: var(--accent);
  box-shadow: var(--shadow-md), 0 0 0 3px var(--accent-a18);
}

.chat__composer .textarea {
  min-height: var(--tap);
  max-height: 140px;
  border: 0;
  background: transparent;
  padding: var(--sp-2);
  resize: none;
  box-shadow: none;
}

.chat__composer .textarea:focus { box-shadow: none; }

@media (min-width: 900px) {
  .chat { max-width: 880px; margin-right: auto; margin-left: auto; width: 100%; }
  .msg { max-width: 74%; }
}

.typing { display: inline-flex; gap: 4px; align-items: center; padding: var(--sp-1) 0; }
.typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-3);
  animation: typing 1.2s var(--ease-out) infinite;
}
.typing span:nth-child(2) { animation-delay: .18s; }
.typing span:nth-child(3) { animation-delay: .36s; }

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: .45; }
  30%           { transform: translateY(-4px); opacity: 1; }
}

.quiz-progress {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--glass-strong);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: calc(var(--topbar-h) + var(--sp-2));
  z-index: 2;
}

.quiz-progress__count { font-size: var(--fs-xs); font-weight: var(--fw-semibold); white-space: nowrap; }
.quiz-progress__timer { font-variant-numeric: tabular-nums; font-weight: var(--fw-bold); }
.quiz-progress__timer.is-urgent { color: var(--danger); animation: pulse 1s var(--ease-out) infinite; }

@keyframes pulse { 50% { opacity: .5; } }

.quiz-question {
  padding: var(--sp-5);
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
}

@media (min-width: 900px) {
  .quiz-question { padding: var(--sp-6) var(--sp-8); }
}

.quiz-question__text {
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
  margin-bottom: var(--sp-4);
}

.quiz-choice {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  min-height: 56px;
  padding: var(--sp-3) var(--sp-4);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
  text-align: start;
  font-size: var(--fs-sm);
  transition: border-color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
}

.quiz-choice:hover { border-color: var(--line-strong); background: var(--surface-3); }
.quiz-choice:active { transform: scale(.995); }

.quiz-choice.is-selected {
  border-color: var(--accent);
  background: var(--accent-a12);
  font-weight: var(--fw-semibold);
  box-shadow: 0 0 0 3px var(--accent-a08);
}

.quiz-choice__marker {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  display: grid;
  place-items: center;
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  transition: border-color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              transform var(--dur-base) var(--ease-spring);
}

.quiz-choice.is-selected .quiz-choice__marker {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-contrast);
  transform: scale(1.06);
}

.quiz-choice__marker.is-correct {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-contrast);
  box-shadow: 0 0 0 3px var(--accent-a28);
}

.quiz-choice.is-correct { border-color: var(--success); background: var(--success-bg); }
.quiz-choice.is-wrong   { border-color: var(--danger);  background: var(--danger-bg); }

.quiz-dots { display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.quiz-dots__dot {
  width: 28px;
  height: 28px;
  border-radius: var(--r-xs);
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
  color: var(--ink-3);
  display: grid;
  place-items: center;
  transition: background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.quiz-dots__dot.is-answered { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.quiz-dots__dot.is-current  { outline: 2px solid var(--accent); outline-offset: 1px; }

.quiz-result {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-10) var(--sp-5);
  border-radius: var(--r-xl);
  background: var(--accent-deep);
  color: #fff;
  text-align: center;
  box-shadow: var(--shadow-accent);
  overflow: hidden;
  isolation: isolate;
}

.quiz-result::before {
  content: "";
  position: absolute;
  top: -20%; right: -20%; bottom: -20%; left: -20%;
  z-index: -1;
  background: var(--grad-mesh), var(--grad-brand);
  background-blend-mode: screen, normal;
}

.quiz-result__score {
  font-size: var(--fs-4xl);
  font-weight: var(--fw-black);
  line-height: 1;
  letter-spacing: -0.04em;
  text-shadow: 0 4px 24px rgba(0, 0, 0, .25);
}
.quiz-result__label { font-size: var(--fs-sm); opacity: .92; }

.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: var(--sp-3);
}

@media (min-width: 1280px) {
  .badges-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

.badge-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-2);
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
  text-align: center;
  transition: transform var(--dur-base) var(--ease-spring),
              box-shadow var(--dur-base) var(--ease-out);
}

.badge-tile.is-unlocked {
  border-color: var(--accent-a28);
  background: var(--accent-a08);
  box-shadow: 0 0 0 1px var(--accent-a12);
}

.badge-tile.is-unlocked:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: var(--shadow-md), var(--glow-soft);
}

.badge-tile__emoji {
  font-size: 1.8rem;
  line-height: 1;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .25));
}
.badge-tile.is-locked .badge-tile__emoji { filter: grayscale(1); opacity: .3; }
.badge-tile__name { font-size: var(--fs-2xs); font-weight: var(--fw-semibold); line-height: 1.3; }
.badge-tile__progress { width: 100%; height: 4px; border-radius: var(--r-full); background: var(--surface-4); overflow: hidden; }
.badge-tile__progress span { display: block; height: 100%; background: var(--grad-brand); }

.rank-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  transition: background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}

.rank-row:hover { background: var(--surface-2); border-color: var(--line-soft); }
.rank-row.is-me { background: var(--accent-a12); border-color: var(--accent-a28); }

.rank-row__num {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: var(--r-xs);
  display: grid;
  place-items: center;
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  background: var(--surface-3);
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.rank-row__num--1 { background: linear-gradient(135deg, #ffd75e, #e39d0b); color: #3d2900; box-shadow: 0 4px 14px rgba(227, 157, 11, .38); }
.rank-row__num--2 { background: linear-gradient(135deg, #e2e7f0, #a9b2c4); color: #2a3040; box-shadow: 0 4px 14px rgba(169, 178, 196, .28); }
.rank-row__num--3 { background: linear-gradient(135deg, #eeae79, #b9723c); color: #3a1f07; box-shadow: 0 4px 14px rgba(185, 114, 60, .3); }

.notif {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border-radius: var(--r-md);
  border: 1px solid transparent;
  transition: background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
  cursor: pointer;
  width: 100%;
  text-align: start;
}

.notif:hover { background: var(--surface-2); border-color: var(--line-soft); }

.notif.is-unread {
  background: var(--accent-a08);
  border-color: var(--accent-a18);
}

.notif__icon {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px var(--line);
}

.notif__title { display: block; font-size: var(--fs-sm); font-weight: var(--fw-semibold); line-height: 1.35; }
.notif__body  {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  font-size: var(--fs-xs);
  color: var(--ink-2);
  margin-top: 2px;
  line-height: var(--lh-snug);
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.notif-wrap.is-expanded .notif__body { display: block; -webkit-line-clamp: unset; }

.notif__close {
  position: absolute;
  inset-inline-end: var(--sp-2);
  top: var(--sp-2);
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  z-index: 2;
}
.notif__close:hover { color: var(--ink); background: var(--surface-3); border-color: var(--line-soft); }
.notif__close:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.notif__close svg { width: 15px; height: 15px; }
.notif-wrap { position: relative; }
.notif { padding-inline-end: calc(var(--sp-3) + 30px); }

.notif__attach {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  min-height: 34px;
  margin-inline-start: calc(38px + var(--sp-3) * 2);
  margin-top: calc(var(--sp-1) * -1); margin-bottom: var(--sp-2);
  padding: 0 var(--sp-3);
  border-radius: var(--r-pill, 999px);
  border: 1px solid var(--accent-a18);
  background: var(--accent-a08);
  color: var(--accent);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  cursor: pointer;
}
.notif__attach svg { width: 14px; height: 14px; }
.notif__attach:hover { background: var(--accent-a18); }
.notif__time  { display: block; font-size: var(--fs-2xs); color: var(--ink-3); margin-top: var(--sp-1); }

.notif__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-a45);
  flex: 0 0 auto;
  align-self: center;
}

.announce {
  padding: var(--sp-4);
  border-radius: var(--r-md);
  background: var(--surface-1);
  border: 1px solid var(--line);
  transition: border-color var(--dur-base) var(--ease-out);
}

.announce:hover { border-color: var(--line-strong); }

.announce.is-pinned {
  border-color: var(--accent-a28);
  background: var(--accent-a08);
}

.announce__title { font-size: var(--fs-sm); font-weight: var(--fw-bold); }
.announce__body  { font-size: var(--fs-sm); color: var(--ink-2); line-height: var(--lh-normal); margin-top: var(--sp-2); white-space: pre-wrap; }
.announce__meta  { font-size: var(--fs-2xs); color: var(--ink-3); margin-top: var(--sp-3); }

.pinned-banner {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border-radius: var(--r-md);
  background: var(--accent-a12);
  border: 1px solid var(--accent-a28);
  overflow: hidden;
}

.pinned-banner::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  inset-inline-start: 0;
  width: 3px;
  background: var(--grad-brand);
}

.thread { display: flex; flex-direction: column; gap: var(--sp-3); max-height: 46vh; max-height: 46dvh; overflow-y: auto; padding-inline-end: var(--sp-1); }

.thread-msg { max-width: 86%; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); font-size: var(--fs-sm); line-height: var(--lh-snug); }
.thread-msg--member { align-self: flex-start; background: var(--surface-3); border-end-start-radius: var(--r-xs); box-shadow: inset 0 0 0 1px var(--line-soft); }
.thread-msg--leader { align-self: flex-end; background: var(--grad-brand); color: #fff; border-end-end-radius: var(--r-xs); box-shadow: 0 6px 18px var(--accent-a28); }
.thread-msg__time { font-size: var(--fs-2xs); opacity: .7; margin-top: var(--sp-1); }

.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-4);
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  text-align: start;
  overflow: hidden;
  transition: border-color var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              background var(--dur-base) var(--ease-out);
}

.tool-card::before {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  border-radius: inherit;
  background: var(--sheen-top);
  pointer-events: none;
}

.tool-card:hover {
  border-color: var(--accent-a28);
  background: var(--accent-a08);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.tool-card__icon {
  font-size: 1.5rem;
  transition: transform var(--dur-base) var(--ease-spring);
}

.tool-card:hover .tool-card__icon { transform: scale(1.1) rotate(-5deg); }

.tool-card__title { font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.tool-card__desc { font-size: var(--fs-2xs); color: var(--ink-3); line-height: var(--lh-snug); }

.secret-box {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border-radius: var(--r-md);
  background: var(--surface-3);
  border: 1px dashed var(--line-strong);
  font-family: var(--font-mono);
  font-size: var(--fs-md);
  direction: ltr;
  word-break: break-all;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .18);
}

.class-picker { width: min(520px, 100%); display: flex; flex-direction: column; gap: var(--sp-4); }

@media (min-width: 900px) {
  .class-picker { width: min(600px, 100%); }
}

.timeline { display: flex; flex-direction: column; gap: var(--sp-2); }

.timeline-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  background: var(--surface-2);
  border-radius: var(--r-sm);
  border: 1px solid var(--line-soft);
  transition: border-color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
}

.timeline-row:hover { border-color: var(--line); background: var(--surface-3); }

.timeline-row__badge {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: var(--r-xs);
  display: grid;
  place-items: center;
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  background: var(--surface-4);
  color: var(--ink-2);
}

.review {
  position: relative;
  border-inline-start: 3px solid var(--line);
  padding-inline-start: var(--sp-4);
}

.review.is-right { border-inline-start-color: var(--success); }
.review.is-wrong { border-inline-start-color: var(--danger); }

.review__head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}

.review__badge {
  grid-column: 1;
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
  padding: 2px var(--sp-2);
  border-radius: var(--r-full);
  background: var(--surface-2);
  color: var(--ink-2);
  white-space: nowrap;
}

.review.is-right .review__badge { color: var(--success); }
.review.is-wrong .review__badge { color: var(--danger); }

.review__n {
  grid-column: 2;
  justify-self: start;
  font-size: var(--fs-2xs);
  color: var(--ink-3);
  font-weight: var(--fw-bold);
}

.review__q {
  grid-column: 1 / -1;
  grid-row: 2;
  font-size: var(--fs-md);
  font-weight: var(--fw-medium);
  line-height: var(--lh-normal);
  color: var(--ink);
}

.review__hint {
  grid-column: 3;
  grid-row: 1;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: var(--r-full);
  border: 1px solid var(--accent-a28);
  background: var(--accent-a08);
  color: var(--accent);
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  line-height: 1;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-spring),
              background-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}

.review__hint:hover { transform: scale(1.08); }

.review__hint.is-open {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: transparent;
}

.review__choices {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.review__choice {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: var(--fs-sm);
  line-height: var(--lh-snug);
}

.review__choice.is-correct {
  border-color: var(--success);
  background: var(--success-bg);
}

.review__choice.is-wrong {
  border-color: var(--danger);
  background: var(--danger-bg);
}

.review__choice-num {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-full);
  background: var(--surface-3, var(--surface-1));
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  color: var(--ink-2);
}

.review__choice-text { flex: 1 1 auto; min-width: 0; color: var(--ink-2); }

.review__tag {
  flex: 0 0 auto;
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
  padding: 1px var(--sp-2);
  border-radius: var(--r-full);
}

.review__tag--correct { background: var(--success); color: var(--success-ink); }
.review__tag--wrong   { background: var(--danger);  color: var(--danger-ink); }

.review__explain {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
  padding: var(--sp-3);
  border-radius: var(--r-sm);
  border: 1px dashed var(--accent-a28);
  background: var(--accent-a08);
  animation: review-explain-in var(--dur-base) var(--ease-out);
}

@keyframes review-explain-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.review__explain-icon { flex: 0 0 auto; font-size: var(--fs-md); }

.review__explain-text {
  font-size: var(--fs-sm);
  line-height: var(--lh-normal);
  color: var(--ink-2);
  white-space: pre-wrap;
}

.quiz-explain {
  padding-top: var(--sp-3);
  border-top: 1px dashed var(--line);
}

@media (prefers-reduced-motion: reduce) {
  .review__explain { animation: none; }
}

.switch-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--fs-sm);
  color: var(--ink-2);
  cursor: pointer;
  padding-top: var(--sp-1); padding-bottom: var(--sp-1);
}
.switch-row input { inline-size: 18px; block-size: 18px; accent-color: var(--accent); flex: 0 0 auto; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--line);
}
.stat-row .strong { font-size: var(--fs-lg); font-weight: 700; }

.msg__bubble .md-h { display: inline-block; font-size: 1.02em; margin-top: 2px; }
.msg__bubble .md-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .9em;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--surface-3);
  direction: ltr;
  unicode-bidi: isolate;
}
.msg__bubble .md-pre {
  margin: var(--sp-2) 0;
  padding: var(--sp-3);
  border-radius: var(--r-sm);
  background: var(--surface-3);
  border: 1px solid var(--line);
  overflow-x: auto;
  white-space: pre;
  text-align: left;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--fs-xs);
  line-height: 1.6;
}
.chat-send .ico { width: 20px; height: 20px; }
html[dir="rtl"] .chat-send .ico { transform: scaleX(-1); }

.guidance-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  width: 100%;
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-lg);
  border: 1px solid var(--accent-a28);
  background:
    radial-gradient(120% 140% at 100% 0%, var(--accent-a18), transparent 60%),
    linear-gradient(135deg, var(--surface-2), var(--surface-1));
  box-shadow: var(--shadow-sm);
  text-align: start;
  cursor: pointer;
  overflow: hidden;
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out);
}
.guidance-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--accent-a45); }
.guidance-card:active { transform: translateY(0); }
.guidance-card__icon {
  flex: 0 0 auto;
  width: 52px; height: 52px;
  border-radius: var(--r-md);
  display: grid; place-items: center;
  color: #fff;
  background: var(--grad-brand, linear-gradient(135deg, var(--accent), var(--accent-strong)));
  box-shadow: 0 10px 24px var(--accent-a28);
}
.guidance-card__icon .ico { width: 26px; height: 26px; }
.guidance-card__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.guidance-card__eyebrow { font-size: var(--fs-2xs); font-weight: var(--fw-semibold); color: var(--accent); letter-spacing: .01em; }
.guidance-card__title { font-size: var(--fs-md); font-weight: var(--fw-bold); line-height: 1.4; }
.guidance-card__desc { font-size: var(--fs-xs); color: var(--ink-2); line-height: var(--lh-snug); }
.guidance-card__go { flex: 0 0 auto; color: var(--accent); }
.guidance-card__go .ico { width: 22px; height: 22px; }
@media (max-width: 420px) {
  .guidance-card { padding: var(--sp-4); gap: var(--sp-3); }
  .guidance-card__icon { width: 44px; height: 44px; }
  .guidance-card__go { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .guidance-card, .guidance-card:hover { transition: none; transform: none; }
}

.cl-integrity {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
  flex-wrap: wrap;
}
.cl-integrity > .ico { width: 22px; height: 22px; flex: 0 0 auto; }
.cl-integrity.is-ok { border-color: var(--success-line); background: var(--success-bg); }
.cl-integrity.is-ok > .ico { color: var(--success); }
.cl-integrity.is-broken { border-color: var(--danger-line); background: var(--danger-bg); color: var(--ink); }
.cl-integrity.is-broken > .ico { color: var(--danger); }
.cl-integrity .grow { min-width: 12rem; }

.cl-highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--sp-3);
}
.cl-highlight {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface-1);
  text-align: start;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.cl-highlight:hover { border-color: var(--accent-a28); transform: translateY(-1px); }
.cl-highlight > .ico { width: 20px; height: 20px; color: var(--accent); flex: 0 0 auto; margin-top: 2px; }
.cl-highlight .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.cl-filters { overflow-x: auto; flex-wrap: nowrap; padding-bottom: var(--sp-1); scrollbar-width: none; }
.cl-filters::-webkit-scrollbar { display: none; }
.cl-filters .chip { flex: 0 0 auto; }
.cl-filters .chip .ico { width: 15px; height: 15px; }

.cl-toolbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--sp-2);
  align-items: center;
  margin-top: var(--sp-3); margin-bottom: var(--sp-3);
}
.cl-toolbar .cl-check { grid-column: 1 / -1; }
.cl-check { display: inline-flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-xs); color: var(--ink-2); cursor: pointer; }
.cl-check input { inline-size: 18px; block-size: 18px; accent-color: var(--accent); }

.cl-list { display: flex; flex-direction: column; gap: var(--sp-2); }

.cl-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--sp-3);
  align-items: start;
  width: 100%;
  padding: var(--sp-3);
  border-radius: var(--r-md);
  border: 1px solid var(--line-soft);
  background: var(--surface-1);
  text-align: start;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.cl-item:hover { background: var(--surface-2); border-color: var(--line); }
.cl-item.is-problem { border-color: var(--warning-line); }
.cl-item__icon {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  background: var(--accent-a12);
  color: var(--accent);
}
.cl-item__icon .ico { width: 18px; height: 18px; }
.cl-item--server .cl-item__icon { background: var(--warning-bg); color: var(--warning); }
.cl-item--security .cl-item__icon { background: var(--danger-bg); color: var(--danger); }
.cl-item--system .cl-item__icon { background: var(--surface-3); color: var(--ink-2); }
.cl-item__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cl-item__title { font-size: var(--fs-sm); font-weight: var(--fw-semibold); line-height: 1.45; overflow-wrap: anywhere; }
.cl-item__who { font-size: var(--fs-2xs); color: var(--ink-3); line-height: 1.5; overflow-wrap: anywhere; }
.cl-item__who strong { color: var(--ink-2); font-weight: var(--fw-semibold); }
.cl-item__time { font-size: var(--fs-2xs); color: var(--ink-3); white-space: nowrap; padding-top: 2px; }

.cl-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--sp-4); }
.cl-detail-grid .field__label .ico { width: 15px; height: 15px; vertical-align: -2px; }
.cl-kv {
  display: grid;
  grid-template-columns: minmax(90px, max-content) 1fr;
  gap: 6px var(--sp-3);
  margin: 0;
  font-size: var(--fs-xs);
}
.cl-kv dt { color: var(--ink-3); }
.cl-kv dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
html[dir="rtl"] .cl-kv dd.ltr { text-align: right; }
.cl-files { margin: 0; padding-inline-start: var(--sp-5); display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-xs); }
.cl-files li { overflow-wrap: anywhere; }
.cl-raw summary { cursor: pointer; color: var(--ink-2); }
.cl-raw pre {
  max-height: 280px; overflow: auto; white-space: pre-wrap; word-break: break-all;
  background: var(--surface-3); padding: var(--sp-3); border-radius: var(--r-sm); margin-top: var(--sp-2);
}

@media (max-width: 640px) {
  .cl-item { grid-template-columns: auto 1fr; }
  .cl-item__time { grid-column: 2; padding-top: 0; }
  .cl-toolbar { grid-template-columns: 1fr; }
  .cl-kv { grid-template-columns: 1fr; gap: 2px; }
  .cl-kv dd { margin-bottom: var(--sp-2); }
}

.sheet-view {
  display: block;
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  border-radius: var(--r-sm);
  background: var(--surface-3);
}
.sheet-view--pdf { height: 72vh; border: 0; }
.sheet-map__row {
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) 0;
  border-bottom: 1px dashed var(--line);
}
.sheet-map__row:last-child { border-bottom: 0; }
.sheet-map__row .select { flex: 1 1 180px; min-width: 0; }
.sheet-map__row .truncate { flex: 1 1 140px; min-width: 0; }

.class-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: var(--sp-3);
}
.class-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  width: 100%;
  padding: var(--sp-4);
  text-align: start;
  color: inherit;
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-1);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
}
.class-card:hover { border-color: var(--accent-a28); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.class-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.class-card.is-current {
  border-color: var(--accent-a45);
  background: linear-gradient(0deg, var(--accent-a08), var(--accent-a08)), var(--surface-1);
  box-shadow: 0 0 0 3px var(--accent-a12), var(--shadow-sm);
}
.class-card.is-muted { opacity: .72; }
.class-card__top { display: flex; align-items: center; gap: var(--sp-3); }
.class-card__avatar {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  font-weight: var(--fw-bold);
  color: #fff;
  background: var(--grad-brand);
  box-shadow: 0 8px 18px var(--accent-a28);
}
.class-card__title { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.class-card__name { font-weight: var(--fw-bold); font-size: var(--fs-md); overflow-wrap: anywhere; }
.class-card__sub { font-size: var(--fs-xs); color: var(--ink-3); }
.class-card__meta { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); font-size: var(--fs-xs); color: var(--ink-2); }
.class-card__meta > span { display: inline-flex; align-items: center; gap: 4px; }
.class-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding-top: var(--sp-2);
  border-top: 1px solid var(--line-soft);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--accent);
}
.class-card__foot .ico { width: 16px; height: 16px; }

.class-enter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border-radius: var(--r-md);
  border: 1px solid var(--accent-a28);
  background: var(--grad-brand-soft);
}
.class-enter.is-current { border-color: var(--success-line); background: var(--success-bg); }
.class-enter > .grow { min-width: 200px; }
.class-enter__icon {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  background: var(--surface-1);
  color: var(--accent);
}
.class-enter.is-current .class-enter__icon { color: var(--success); }
.class-enter__title { display: block; font-weight: var(--fw-bold); }
.class-enter__desc { display: block; margin-top: 2px; font-size: var(--fs-xs); color: var(--ink-2); line-height: var(--lh-snug); }
.card--accent { border-color: var(--accent-a45); box-shadow: 0 0 0 3px var(--accent-a12); }
.join-form { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: stretch; }
.join-form .input { flex: 1 1 12rem; width: auto; min-width: 0; }
.join-form .btn { flex: 0 0 auto; }

button.identity-bar__class { cursor: pointer; display: inline-flex; align-items: center; gap: 4px; border: 1px solid transparent; font: inherit; }
button.identity-bar__class:hover { border-color: var(--accent-a45); }
button.identity-bar__class .ico { width: 14px; height: 14px; flex: 0 0 auto; }

.sms-help {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  border: 1px solid var(--warning-line);
  background: var(--warning-bg);
  font-size: var(--fs-xs);
  line-height: var(--lh-relaxed, 1.8);
  text-align: start;
}
.sms-help__title { display: flex; align-items: center; gap: var(--sp-2); font-weight: var(--fw-bold); font-size: var(--fs-sm); }
.sms-help__title .ico { width: 18px; height: 18px; flex: 0 0 auto; }
.sms-help ol { margin: 0; padding: 0 1.25em; display: flex; flex-direction: column; gap: 4px; }
.sms-help code, .sms-help .ussd {
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
  padding: 0 6px;
  border-radius: var(--r-xs);
  background: var(--surface-1);
  border: 1px solid var(--line);
  font-weight: var(--fw-bold);
  letter-spacing: .04em;
}
.sms-help__support { align-self: flex-start; }

.class-tabs { margin-bottom: var(--sp-1); }
.class-tabs .segmented__item { display: inline-flex; align-items: center; gap: 6px; }
.class-tab[hidden] { display: none !important; }
[data-member-tabs] { margin-bottom: var(--sp-4); }

.class-students__actions {
  display: flex; flex-wrap: wrap; gap: var(--sp-2);
  margin-top: var(--sp-3); margin-bottom: var(--sp-3);
}
.class-students__search { margin-bottom: var(--sp-3); }

.invite-code {
  display: grid;
  justify-items: center;
  gap: var(--sp-2);
  padding: var(--sp-5) var(--sp-4);
  margin-top: var(--sp-3); margin-bottom: var(--sp-3);
  border-radius: var(--r-lg);
  border: 1px dashed var(--accent-a45);
  background: var(--accent-a08);
  text-align: center;
}
.invite-code__label { font-size: var(--fs-sm); color: var(--ink-2); }
.invite-code__value {
  font-family: var(--font-mono);
  font-size: clamp(1.35rem, 5vw, 2rem);
  font-weight: var(--fw-bold);
  letter-spacing: .08em;
  color: var(--ink);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-md);
  background: var(--surface-1);
  box-shadow: var(--shadow-xs), inset 0 0 0 1px var(--line);
  max-width: 100%;
  overflow-wrap: anywhere;
  cursor: copy;
}
.invite-code__value:hover { box-shadow: var(--glow-soft), inset 0 0 0 1px var(--accent-a45); }
.invite-code__meta { font-size: var(--fs-xs); color: var(--ink-3); }
.invite-code__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-2); margin-top: var(--sp-1); }
.invite-code--empty { border-style: solid; background: var(--surface-2); }

.class-codes__new,
.class-codes__history {
  margin-top: var(--sp-3);
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  padding: var(--sp-2) var(--sp-3);
  background: var(--surface-2);
}
.class-codes__new > summary,
.class-codes__history > summary {
  cursor: pointer;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--ink-2);
  padding: var(--sp-2) 0;
  display: flex; align-items: center; gap: 6px;
}
.class-codes__form { display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); padding-top: var(--sp-2); padding-bottom: var(--sp-2); }
.class-codes__history .list { margin-top: var(--sp-2); margin-bottom: var(--sp-2); }

.quiz-media-field { display: grid; gap: 6px; min-width: 0; }
.quiz-media-upload { display: inline-flex; align-items: center; gap: 6px; width: fit-content; max-width: 100%; font-size: 12px; color: var(--ink-2); cursor: pointer; }
.quiz-media-upload input[type="file"] { max-width: min(100%, 360px); }
.quiz-choice-editor { min-width: 0; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 5px; align-items: center; }
.quiz-media-upload--choice { padding: 6px; border: 1px dashed var(--line-strong); border-radius: 9px; }
.quiz-media { display: block; max-width: min(100%, 520px); max-height: 320px; object-fit: contain; border-radius: 12px; border: 1px solid var(--line); margin-top: 8px; margin-bottom: 8px; }
.quiz-media-audio { display: block; width: min(100%, 520px); margin-top: 8px; margin-bottom: 8px; }
@media (max-width: 520px) { .quiz-choice-editor { grid-template-columns: minmax(0,1fr); } .quiz-media-upload--choice { justify-self: start; } }

@supports not ((inset-inline-start: 0) or (inset-inline-end: 0)) {
  html[dir="rtl"] .section-title__text { padding-right: var(--sp-3); }
  html[dir="ltr"] .section-title__text { padding-left: var(--sp-3); }
  html[dir="rtl"] .section-title__text::before { right: 0; }
  html[dir="ltr"] .section-title__text::before { left: 0; }
  html[dir="rtl"] .msg--user .msg__bubble { border-bottom-left-radius: var(--r-xs); }
  html[dir="ltr"] .msg--user .msg__bubble { border-bottom-right-radius: var(--r-xs); }
  html[dir="rtl"] .msg--ai .msg__bubble { border-bottom-right-radius: var(--r-xs); }
  html[dir="ltr"] .msg--ai .msg__bubble { border-bottom-left-radius: var(--r-xs); }
  html[dir="rtl"] .notif__close { left: var(--sp-2); }
  html[dir="ltr"] .notif__close { right: var(--sp-2); }
  html[dir="rtl"] .notif { padding-left: calc(var(--sp-3) + 30px); }
  html[dir="ltr"] .notif { padding-right: calc(var(--sp-3) + 30px); }
  html[dir="rtl"] .notif__attach { margin-right: calc(38px + var(--sp-3) * 2); }
  html[dir="ltr"] .notif__attach { margin-left: calc(38px + var(--sp-3) * 2); }
  html[dir="rtl"] .pinned-banner::before { right: 0; }
  html[dir="ltr"] .pinned-banner::before { left: 0; }
  html[dir="rtl"] .thread { padding-left: var(--sp-1); }
  html[dir="ltr"] .thread { padding-right: var(--sp-1); }
  html[dir="rtl"] .thread-msg--member { border-bottom-right-radius: var(--r-xs); }
  html[dir="ltr"] .thread-msg--member { border-bottom-left-radius: var(--r-xs); }
  html[dir="rtl"] .thread-msg--leader { border-bottom-left-radius: var(--r-xs); }
  html[dir="ltr"] .thread-msg--leader { border-bottom-right-radius: var(--r-xs); }
  html[dir="rtl"] .review { border-right: 3px solid var(--line); padding-right: var(--sp-4); }
  html[dir="ltr"] .review { border-left: 3px solid var(--line); padding-left: var(--sp-4); }
  html[dir="rtl"] .review.is-right { border-right-color: var(--success); }
  html[dir="ltr"] .review.is-right { border-left-color: var(--success); }
  html[dir="rtl"] .review.is-wrong { border-right-color: var(--danger); }
  html[dir="ltr"] .review.is-wrong { border-left-color: var(--danger); }
  html[dir="rtl"] .cl-files { padding-right: var(--sp-5); }
  html[dir="ltr"] .cl-files { padding-left: var(--sp-5); }
}

.btn { min-height: var(--tap); }
.btn--sm { min-height: 40px; padding-left: 14px; padding-right: 14px; font-size: var(--fs-sm); }
.btn--xs { min-height: 34px; padding: 0 12px; font-size: var(--fs-xs); border-radius: var(--r-xs); }
.btn--icon.btn--sm { width: 40px; min-width: 40px; }
.btn--lg { min-height: 56px; font-size: var(--fs-md); }
.btn .ico { width: 1.2em; height: 1.2em; }
.btn--quiet { background: var(--surface-3); color: var(--ink-2); }
.btn--quiet:hover { background: var(--accent-a12); color: var(--accent); }
.btn--danger-text { color: var(--danger); }
.btn--danger-text:hover { background: var(--danger-bg); color: var(--danger); }

.input, .select, .textarea {
  min-height: var(--control-h);
  font-size: 16px;
  border-radius: var(--r-sm);
}
.textarea--code {
  font-family: var(--font-fa);
  font-size: 15px;
  line-height: 1.8;
  direction: rtl;
  min-height: 320px;
}
.field__label { font-size: var(--fs-sm); }
.field__hint { font-size: var(--fs-xs); line-height: var(--lh-normal); }

.segmented__item { min-height: 40px; font-size: var(--fs-sm); padding-left: 16px; padding-right: 16px; }
.segmented--sm .segmented__item { min-height: 34px; font-size: var(--fs-xs); padding-left: 12px; padding-right: 12px; }

.chip { min-height: 36px; }
.badge--xs { font-size: 10px; padding: 1px 7px; min-height: 0; }

.stat__icon .ico,
.list-item__avatar .ico,
.empty__icon .ico,
.alert > .ico,
.toast__icon .ico { width: 22px; height: 22px; }
.alert > .ico { flex: 0 0 auto; margin-top: 1px; }
.list-item__chevron .ico { width: 18px; height: 18px; }
.stat__icon--accent { background: var(--accent-a12); color: var(--accent); }
.stat__icon--info { background: var(--info-bg); color: var(--info); }

.list-item__avatar--icon {
  background: var(--accent-a12);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent-a18);
}
.list-item__avatar--gold {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 55%, #f97316 100%);
  color: #3a1d00;
  box-shadow: 0 6px 16px rgba(245, 158, 11, .35), inset 0 1px 0 rgba(255,255,255,.4);
}
.list--cards { gap: var(--sp-3); }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--ink-3); flex: 0 0 auto; }
.dot--accent { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-a18); }

.grid--2 { display: grid; grid-template-columns: 1fr; gap: var(--sp-3); }
@media (min-width: 560px) { .grid--2 { grid-template-columns: 1fr 1fr; } }

.check__input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}
.check { position: relative; }
.check__box,
.choice__box {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 2px solid var(--line-strong);
  background: var(--surface-1);
  color: transparent;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out),
              transform var(--dur-base) var(--ease-spring), box-shadow var(--dur-fast) var(--ease-out);
}
.check__box .ico,
.choice__box .ico { width: 16px; height: 16px; stroke-width: 3; }
.check__input:checked + .check__box,
.check__input:checked + .choice__box {
  background: var(--grad-brand);
  border-color: transparent;
  color: #fff;
  transform: scale(1.04);
  box-shadow: 0 4px 12px var(--accent-a28);
}
.check__input:focus-visible + .check__box,
.check__input:focus-visible + .choice__box { box-shadow: 0 0 0 3px var(--accent-a28); }

.check--terms {
  align-items: flex-start;
  padding: 14px 16px;
  line-height: var(--lh-normal);
  background: var(--accent-a08);
  border-color: var(--accent-a18);
}
.check--terms .check__box { margin-top: 2px; }

.choice-grid { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.choice {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  background: var(--surface-2);
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.choice:hover { border-color: var(--accent-a45); }
.choice .choice__box { width: 22px; height: 22px; border-radius: 50%; }
.choice--row { display: flex; width: 100%; border-radius: var(--r-sm); background: transparent; border-color: transparent; padding: 8px 10px; }
.choice--row:hover { background: var(--surface-3); border-color: transparent; }
.choice--row .choice__box { border-radius: 7px; }

.fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.fieldset > legend { padding: 0; margin-bottom: var(--sp-2); }

.choice-cards { display: grid; grid-template-columns: 1fr; gap: var(--sp-3); }
@media (min-width: 640px) { .choice-cards { grid-template-columns: 1fr 1fr; } }
.choice-card { position: relative; display: block; cursor: pointer; }
.choice-card > input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  padding: 16px 18px;
  border: 2px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.choice-card:hover .choice-card__body { border-color: var(--accent-a45); }
.choice-card > input:checked + .choice-card__body {
  border-color: var(--accent);
  background: var(--accent-a08);
  box-shadow: 0 0 0 4px var(--accent-a12);
}
.choice-card > input:focus-visible + .choice-card__body { box-shadow: 0 0 0 4px var(--accent-a28); }
.choice-card__title { display: flex; align-items: center; gap: 8px; font-weight: var(--fw-bold); }
.choice-card__title .ico { color: var(--accent); }
.choice-card__desc { font-size: var(--fs-xs); color: var(--ink-2); line-height: var(--lh-normal); }

.auth {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px calc(28px + env(safe-area-inset-bottom));
  overflow: hidden;
}
.auth__bg { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.auth__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: .55;
  -webkit-animation: auth-float 18s ease-in-out infinite alternate;
          animation: auth-float 18s ease-in-out infinite alternate;
}
.auth__orb--1 { width: 420px; height: 420px; top: -140px; right: -120px; background: radial-gradient(circle, #7c3aed 0%, rgba(124,58,237,0) 70%); }
.auth__orb--2 { width: 380px; height: 380px; bottom: -160px; left: -120px; background: radial-gradient(circle, #06b6d4 0%, rgba(6,182,212,0) 70%); -webkit-animation-duration: 22s; animation-duration: 22s; }
.auth__orb--3 { width: 300px; height: 300px; top: 40%; left: 45%; background: radial-gradient(circle, #ec4899 0%, rgba(236,72,153,0) 70%); opacity: .28; -webkit-animation-duration: 26s; animation-duration: 26s; }
html[data-theme="light"] .auth__orb { opacity: .32; }
html[data-theme="light"] .auth__orb--3 { opacity: .16; }
.auth__grid {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  background-image:
    linear-gradient(var(--dot-grid) 1px, rgba(0,0,0,0) 1px),
    linear-gradient(90deg, var(--dot-grid) 1px, rgba(0,0,0,0) 1px);
  background-size: 44px 44px;
  opacity: .5;
  -webkit-mask-image: radial-gradient(circle at 50% 40%, #000 0%, rgba(0,0,0,0) 70%);
          mask-image: radial-gradient(circle at 50% 40%, #000 0%, rgba(0,0,0,0) 70%);
}
@-webkit-keyframes auth-float { from { -webkit-transform: translate(0, 0) scale(1); } to { -webkit-transform: translate(30px, 40px) scale(1.12); } }
@keyframes auth-float { from { transform: translate(0, 0) scale(1); } to { transform: translate(30px, 40px) scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .auth__orb { -webkit-animation: none; animation: none; } }

.auth__wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.auth__hero { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.auth__logo {
  width: 76px;
  height: 76px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--grad-brand);
  box-shadow: 0 18px 40px rgba(99, 82, 245, .45), inset 0 1px 0 rgba(255,255,255,.35);
  position: relative;
}
.auth__logo::after {
  content: "";
  position: absolute; top: -6px; right: -6px; bottom: -6px; left: -6px;
  border-radius: 30px;
  border: 1px solid var(--accent-a28);
}
.auth__logo .ico { width: 40px; height: 40px; stroke-width: 1.8; }
.auth__logo .brand-mark { width: 100%; height: 100%; border-radius: 24px; }
.auth__logo--sm { width: 56px; height: 56px; border-radius: 18px; margin: 0 auto 6px; }
.auth__logo--sm::after { border-radius: 23px; }
.auth__logo--sm .ico { width: 28px; height: 28px; }
.auth__logo--sm .brand-mark { border-radius: 18px; }
.auth__title {
  font-size: 1.9rem;
  font-weight: var(--fw-black);
  background: linear-gradient(135deg, var(--ink) 0%, var(--accent-soft) 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
}
.auth__tagline { color: var(--ink-2); font-size: var(--fs-sm); max-width: 34ch; line-height: var(--lh-normal); }
.auth__features { display: none; }

.auth__panel { display: flex; flex-direction: column; gap: 14px; }

.auth-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px 20px;
  border-radius: var(--r-xl);
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
          backdrop-filter: blur(18px) saturate(140%);
}
.auth-card::before {
  content: "";
  position: absolute;
  top: 0; left: 12%; right: 12%;
  height: 2px;
  border-radius: 2px;
  background: var(--grad-brand);
  opacity: .9;
}
.auth-card__head { display: flex; flex-direction: column; gap: 6px; }
.auth-card__head h2 { font-size: var(--fs-xl); font-weight: var(--fw-extrabold); }
.auth-card__head p { color: var(--ink-2); font-size: var(--fs-sm); line-height: var(--lh-normal); }
.auth-card__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 10px;
  text-align: center;
}
.auth-card .field { margin: 0; }
.auth-card__links > .faint { display: none; }
@media (min-width: 400px) { .auth-card__links > .faint { display: inline; } }

.step-pill {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--r-full);
  background: var(--accent-a12);
  color: var(--accent);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
  padding: 0 4px;
  color: var(--ink-2);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  text-decoration: none;
}
.link-btn:hover { color: var(--accent); }
.link-btn:disabled { opacity: .5; cursor: default; }
.link-btn--strong { color: var(--accent); font-weight: var(--fw-bold); }
.check--terms .link-btn { min-height: 0; padding: 0; display: inline; }

.input-wrap__action {
  position: absolute;
  top: 50%;
  -webkit-transform: translateY(-50%);
          transform: translateY(-50%);
  left: 6px;
  width: 40px;
  height: 40px;
  border-radius: var(--r-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
}
html[dir="ltr"] .input-wrap__action { left: auto; right: 6px; }
.input-wrap__action:hover { color: var(--accent); background: var(--accent-a08); }
.input-wrap .input.ltr { padding-left: 52px; padding-right: 16px; }
html[dir="ltr"] .input-wrap .input.ltr { padding-left: 16px; padding-right: 52px; }

.strength { display: flex; gap: 6px; margin-top: 8px; }
.strength > span { flex: 1 1 0; height: 5px; border-radius: 3px; background: var(--surface-4); transition: background var(--dur-base) var(--ease-out); }
.strength[data-score="1"] > span:nth-child(-n+1) { background: var(--danger); }
.strength[data-score="2"] > span:nth-child(-n+2) { background: var(--warning); }
.strength[data-score="3"] > span:nth-child(-n+3) { background: #a3e635; }
.strength[data-score="4"] > span { background: var(--success); }

.phone-num {
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
  white-space: nowrap;
}
.auth-support-link { margin-inline-start: 6px; white-space: nowrap; }
.auth-support-link svg { width: 15px; height: 15px; }

.stepper { display: flex; align-items: flex-start; margin: 0 0 2px; padding: 0; list-style: none; }
.stepper__item {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}
.stepper__item + .stepper__item::before {
  content: "";
  position: absolute;
  top: 15px;
  inset-inline-start: calc(-50% + 22px);
  inset-inline-end: calc(50% + 22px);
  height: 2px;
  border-radius: 2px;
  background: var(--surface-4);
}
.stepper__item.is-current::before,
.stepper__item.is-done::before { background: var(--grad-brand); }
.stepper__dot {
  position: relative;
  z-index: 1;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  background: var(--surface-3);
  color: var(--ink-3);
  border: 2px solid var(--surface-4);
  transition: background var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.stepper__dot svg { width: 16px; height: 16px; }
.stepper__item.is-current .stepper__dot {
  background: var(--grad-brand);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 0 0 4px var(--accent-a18);
}
.stepper__item.is-done .stepper__dot { background: var(--success); color: #fff; border-color: transparent; }
.stepper__label { font-size: var(--fs-2xs); font-weight: var(--fw-semibold); color: var(--ink-3); line-height: 1.4; }
.stepper__item.is-current .stepper__label { color: var(--ink); }
.stepper__item.is-done .stepper__label { color: var(--ink-2); }

.auth-section { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.auth-section + .auth-section { padding-top: 16px; border-top: 1px dashed var(--line); }
.auth-section__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  color: var(--accent);
}
.auth-section__title svg { width: 16px; height: 16px; }

.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field .field__label .req { color: var(--danger); margin-inline-start: 3px; font-weight: var(--fw-bold); }
.auth-input { position: relative; display: flex; align-items: center; }
.auth-input__icon {
  position: absolute;
  top: 50%;
  -webkit-transform: translateY(-50%);
          transform: translateY(-50%);
  display: flex;
  color: var(--ink-3);
  pointer-events: none;
  transition: color var(--dur-fast) var(--ease-out);
}
.auth-input__icon svg { width: 18px; height: 18px; }
.auth-input:focus-within .auth-input__icon { color: var(--accent); }
.auth-input__end {
  position: absolute;
  top: 50%;
  -webkit-transform: translateY(-50%);
          transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 2px;
}
html[dir="rtl"] .auth-input__icon { right: 14px; }
html[dir="ltr"] .auth-input__icon { left: 14px; }
html[dir="rtl"] .auth-input__end { left: 6px; }
html[dir="ltr"] .auth-input__end { right: 6px; }
html[dir="rtl"] .auth-input .input { padding-right: 44px; padding-left: 40px; }
html[dir="ltr"] .auth-input .input { padding-left: 44px; padding-right: 40px; }
html[dir="rtl"] .auth-input--toggle .input { padding-left: 76px; }
html[dir="ltr"] .auth-input--toggle .input { padding-right: 76px; }
.auth-input__status { display: flex; justify-content: center; width: 24px; }
.auth-input__status:empty { display: none; }
.auth-input__status svg { width: 18px; height: 18px; }
.auth-field.is-valid .auth-input__status { color: var(--success); }
.auth-field.has-error .auth-input__status { color: var(--danger); }
.auth-field.is-valid .input { border-color: var(--success); }
.auth-field.has-error .input {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(255, 95, 121, .14);
}
.auth-input__toggle {
  width: 38px;
  height: 38px;
  border-radius: var(--r-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
}
.auth-input__toggle:hover { color: var(--accent); background: var(--accent-a08); }
.auth-input__toggle svg { width: 18px; height: 18px; }
.auth-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--accent-a18);
  border-top-color: var(--accent);
  -webkit-animation: auth-spin .8s linear infinite;
          animation: auth-spin .8s linear infinite;
}
@-webkit-keyframes auth-spin { to { -webkit-transform: rotate(360deg); transform: rotate(360deg); } }
@keyframes auth-spin { to { -webkit-transform: rotate(360deg); transform: rotate(360deg); } }

.field__msg { margin: 0; font-size: var(--fs-2xs); line-height: var(--lh-normal); color: var(--ink-3); }
.field__msg:empty { display: none; }
.field__msg.is-error { color: var(--danger); font-weight: var(--fw-semibold); }
.field__msg.is-ok { color: var(--success); font-weight: var(--fw-semibold); }
.link-btn--inline { display: inline; min-height: 0; padding: 0; font-size: inherit; }
.auth-field.has-error .check--terms {
  border-color: var(--danger);
  background: rgba(255, 95, 121, .06);
}

.pw-meter { display: flex; align-items: center; gap: 10px; }
.pw-meter .strength { flex: 1 1 auto; margin-top: 0; }
.pw-meter__label { min-width: 3.5em; text-align: end; font-size: var(--fs-2xs); font-weight: var(--fw-bold); color: var(--ink-3); }
.pw-meter__label[data-score="1"] { color: var(--danger); }
.pw-meter__label[data-score="2"] { color: var(--warning); }
.pw-meter__label[data-score="3"] { color: #65a30d; }
.pw-meter__label[data-score="4"] { color: var(--success); }
.pw-rules { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; padding: 0; list-style: none; }
.pw-rules li { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-2xs); color: var(--ink-3); }
.pw-rules li svg {
  width: 14px;
  height: 14px;
  padding: 2px;
  border-radius: 50%;
  background: var(--surface-4);
  color: transparent;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.pw-rules li.is-met { color: var(--ink-2); }
.pw-rules li.is-met svg { background: var(--success); color: #fff; }

.auth-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: -4px 0 0;
  font-size: var(--fs-2xs);
  line-height: var(--lh-normal);
  color: var(--ink-3);
}
.auth-note svg { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--success); }

.account-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--accent-a08);
  border: 1px solid var(--accent-a18);
}
.account-chip__avatar {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--grad-brand);
  color: #fff;
  font-weight: var(--fw-bold);
}
.account-chip__body { display: flex; flex-direction: column; min-width: 0; }
.account-chip__name { font-size: var(--fs-sm); font-weight: var(--fw-bold); color: var(--ink); }
.account-chip__meta { font-size: var(--fs-2xs); color: var(--ink-3); }

.input--otp {
  text-align: center !important;
  font-size: 1.75rem;
  font-weight: var(--fw-bold);
  letter-spacing: .45em !important;
  min-height: 64px;
  font-family: var(--font-mono);
  padding-left: .45em;
}

.notice-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface-1-t);
}
.notice-card__icon {
  width: 42px; height: 42px;
  flex: 0 0 auto;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
}
.notice-card__body strong { display: block; margin-bottom: 4px; font-size: var(--fs-sm); }
.notice-card__body p { font-size: var(--fs-xs); color: var(--ink-2); line-height: var(--lh-normal); }
.notice-card--festival {
  background: linear-gradient(135deg, rgba(251,191,36,.14) 0%, rgba(244,114,182,.12) 100%);
  border-color: rgba(251, 191, 36, .32);
}
.notice-card--festival .notice-card__icon { background: var(--grad-warm); color: #3b1a00; box-shadow: 0 8px 18px rgba(244,114,182,.3); }

.portal-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface-1-t);
  color: var(--ink);
  transition: border-color var(--dur-fast) var(--ease-out), -webkit-transform var(--dur-fast) var(--ease-out);
  transition: border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.portal-link:hover { color: var(--ink); border-color: rgba(20,184,166,.5); }
.portal-link:active { -webkit-transform: scale(.99); transform: scale(.99); }
.portal-link strong { display: block; font-size: var(--fs-sm); }
.portal-link .small { display: block; line-height: var(--lh-normal); }
.portal-link__icon {
  width: 42px; height: 42px; flex: 0 0 auto; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #14b8a6 0%, #6366f1 100%); color: #fff;
  box-shadow: 0 8px 18px rgba(20,184,166,.3);
}
.portal-link > .ico { color: var(--ink-3); }

.prefs-bar--auth { justify-content: center; }

.account-picks { display: flex; flex-direction: column; gap: 10px; }
.account-pick { position: relative; display: block; cursor: pointer; }
.account-pick > input { position: absolute; opacity: 0; pointer-events: none; }
.account-pick__body {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 2px solid var(--line);
  background: var(--surface-2);
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.account-pick__avatar {
  width: 42px; height: 42px; flex: 0 0 auto; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--grad-brand); color: #fff; font-weight: var(--fw-bold); font-size: var(--fs-sm);
}
.account-pick__name { display: block; font-weight: var(--fw-bold); font-size: var(--fs-sm); }
.account-pick__meta { display: block; font-size: var(--fs-xs); color: var(--ink-3); }
.account-pick__check {
  width: 26px; height: 26px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--line-strong); color: transparent;
}
.account-pick__check .ico { width: 15px; height: 15px; stroke-width: 3; }
.account-pick > input:checked + .account-pick__body { border-color: var(--accent); background: var(--accent-a08); }
.account-pick > input:checked + .account-pick__body .account-pick__check { background: var(--accent); border-color: var(--accent); color: #fff; }

@media (min-width: 980px) {
  .auth { padding: 40px; }
  .auth__wrap {
    max-width: 1060px;
    flex-direction: row;
    align-items: center;
    gap: 64px;
  }
  .auth__wrap--single { max-width: 480px; }
  .auth__hero { flex: 1 1 0; text-align: right; align-items: flex-start; gap: 16px; }
  html[dir="ltr"] .auth__hero { text-align: left; }
  .auth__logo { width: 92px; height: 92px; border-radius: 28px; }
  .auth__logo .ico { width: 48px; height: 48px; }
  .auth__logo .brand-mark { border-radius: 28px; }
  .auth__title { font-size: 3rem; }
  .auth__tagline { font-size: var(--fs-lg); max-width: 30ch; }
  .auth__features { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
  .auth__features li {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px;
    border-radius: var(--r-md);
    background: var(--surface-1-t);
    border: 1px solid var(--glass-border);
    font-weight: var(--fw-medium);
  }
  .auth__features li .ico {
    width: 38px; height: 38px; padding: 9px; border-radius: 12px;
    background: var(--accent-a12); color: var(--accent);
  }
  .auth__panel { flex: 0 0 440px; width: 440px; }
  .auth-card { padding: 32px 30px; }
}

.page-hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border-radius: var(--r-xl);
  background: var(--grad-mesh), var(--surface-1);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  flex-wrap: wrap;
}
.page-hero::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: var(--sheen-top);
  pointer-events: none;
}
.page-hero > * { position: relative; z-index: 1; }
.page-hero > .grow { flex: 1 1 0; min-width: 0; }
.page-hero__back { flex: 0 0 auto; background: var(--surface-2-t); }
.page-hero__icon {
  width: 52px; height: 52px; flex: 0 0 auto;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  background: var(--grad-brand);
  box-shadow: var(--shadow-accent), inset 0 1px 0 rgba(255,255,255,.3);
}
.page-hero__icon .ico { width: 26px; height: 26px; }
.page-hero--cool .page-hero__icon { background: var(--grad-cool); box-shadow: 0 12px 28px rgba(34,211,238,.32); }
.page-hero--warm .page-hero__icon { background: var(--grad-warm); color: #3b1a00; box-shadow: 0 12px 28px rgba(244,114,182,.32); }
.page-hero__title { font-size: var(--fs-xl); font-weight: var(--fw-extrabold); line-height: var(--lh-tight); }
.page-hero__sub { margin-top: 4px; font-size: var(--fs-sm); color: var(--ink-2); line-height: var(--lh-normal); }
.page-hero__actions { display: flex; gap: 8px; flex-wrap: wrap; width: 100%; }
.page-hero__actions .btn { flex: 1 1 auto; }
@media (min-width: 700px) {
  .page-hero { padding: 22px 24px; flex-wrap: nowrap; }
  .page-hero__icon { width: 60px; height: 60px; border-radius: 18px; }
  .page-hero__title { font-size: var(--fs-2xl); }
  .page-hero__actions { width: auto; }
  .page-hero__actions .btn { flex: 0 0 auto; }
}

[data-page-body] { display: flex; flex-direction: column; gap: var(--sp-4); }
[data-page-body] > .section-title { margin-bottom: -4px; }

.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--sp-3);
}
.stat-strip:empty { display: none; }
.stat-strip .stat__value { font-size: var(--fs-lg); line-height: 1.35; overflow-wrap: anywhere; }
@media (max-width: 479px) {
  .stat-strip { grid-template-columns: 1fr 1fr; }
  .stat-strip > .stat:nth-child(3):last-child { grid-column: 1 / -1; }
}

.toolbar { display: flex; flex-direction: column; gap: var(--sp-3); }
.toolbar > .segmented { align-self: stretch; }
@media (min-width: 820px) {
  .toolbar { flex-direction: row; align-items: center; justify-content: space-between; }
  .toolbar > .segmented { align-self: auto; }
}
.search-box { position: relative; display: flex; align-items: center; flex: 0 0 auto; }
@media (min-width: 820px) { .search-box { flex: 0 1 360px; } }
.search-box > .ico { position: absolute; right: 14px; color: var(--ink-3); pointer-events: none; }
html[dir="ltr"] .search-box > .ico { right: auto; left: 14px; }
.search-box .input { padding-right: 44px; border-radius: var(--r-full); }
html[dir="ltr"] .search-box .input { padding-right: 16px; padding-left: 44px; }

.empty--hero { padding: 40px 20px; border-radius: var(--r-xl); border: 1px dashed var(--line-strong); background: var(--surface-1-t); }
.empty__art {
  width: 96px; height: 96px;
  border-radius: 32px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  background: var(--grad-brand);
  box-shadow: var(--shadow-accent);
  -webkit-transform: rotate(-6deg);
          transform: rotate(-6deg);
  margin-bottom: 6px;
}
.empty__art .ico { width: 48px; height: 48px; stroke-width: 1.7; }

.terms-summary {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; margin-bottom: 16px;
  border-radius: var(--r-md);
  background: var(--success-bg);
  border: 1px solid var(--success-line);
  color: var(--ink);
  font-size: var(--fs-sm);
  line-height: var(--lh-normal);
}
.terms-summary > .ico { color: var(--success); width: 24px; height: 24px; flex: 0 0 auto; }

.prose { font-size: 15px; line-height: 2; color: var(--ink); overflow-wrap: break-word; }
.prose h1, .prose h2, .prose h3 { margin: 1.4em 0 .5em; line-height: 1.5; }
.prose h1 { font-size: 1.35rem; }
.prose h2 { font-size: 1.15rem; padding-right: 12px; border-right: 4px solid var(--accent); }
html[dir="ltr"] .prose h2 { padding-right: 0; border-right: 0; padding-left: 12px; border-left: 4px solid var(--accent); }
.prose h3 { font-size: 1.02rem; color: var(--accent); }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 .8em; }
.prose ul, .prose ol { margin: 0 0 1em; padding-right: 1.4em; list-style: disc; }
.prose ol { list-style: decimal; }
html[dir="ltr"] .prose ul, html[dir="ltr"] .prose ol { padding-right: 0; padding-left: 1.4em; }
.prose li { margin: .25em 0; }
.prose strong { color: var(--ink); font-weight: var(--fw-bold); }
.prose a { text-decoration: underline; }
.prose blockquote { margin: 0 0 1em; padding: 10px 14px; border-radius: var(--r-sm); background: var(--accent-a08); }
.prose hr { margin: 1.5em 0; }

.overlay--locked { -webkit-backdrop-filter: blur(14px) saturate(120%); backdrop-filter: blur(14px) saturate(120%); }
.terms-gate { max-height: 94vh; max-height: 94dvh; }
.terms-gate__head {
  display: flex; align-items: center; gap: 14px;
  padding: 20px 20px 14px;
  border-bottom: 1px solid var(--line-soft);
  flex: 0 0 auto;
}
.terms-gate__badge {
  width: 48px; height: 48px; flex: 0 0 auto; border-radius: 15px;
  display: flex; align-items: center; justify-content: center;
  background: var(--grad-brand); color: #fff; box-shadow: var(--shadow-accent);
}
.terms-gate__body { padding-top: 16px; }
.terms-gate__footer { flex-direction: column; align-items: stretch; gap: 12px; }
.terms-gate__footer .row { width: 100%; }
.terms-gate__footer .row .btn { flex: 1 1 0; }
@media (min-width: 700px) {
  .terms-gate__footer .row .btn { flex: 0 0 auto; min-width: 140px; }
}

.ticket-row.is-unread { border-color: var(--accent-a45); background: var(--accent-a08); }
.ticket-filter { margin-bottom: var(--sp-3); }
.ticket-row.is-closed:not(.is-unread) { background: var(--surface-2); }
.ticket-row.is-closed .list-item__avatar { color: var(--success); }
.ticket-row.is-unread .list-item__title { font-weight: var(--fw-extrabold); }
.ticket-head .card__title { font-size: var(--fs-md); }

.chat-thread { display: flex; flex-direction: column; gap: 12px; padding: 4px 0; }
.bubble {
  position: relative;
  max-width: 88%;
  padding: 12px 14px;
  border-radius: 20px;
  font-size: var(--fs-sm);
  line-height: var(--lh-normal);
  box-shadow: var(--shadow-xs);
  display: flex; flex-direction: column; gap: 6px;
}
@media (min-width: 700px) { .bubble { max-width: 72%; } }
.bubble--mine {
  -ms-flex-item-align: start;
  align-self: flex-start;
  background: var(--grad-brand);
  color: #fff;
  border-top-right-radius: 6px;
}
html[dir="ltr"] .bubble--mine { align-self: flex-end; border-top-right-radius: 6px; }
.bubble--mine .faint, .bubble--mine .strong { color: rgba(255,255,255,.85); }
.bubble--mine .badge { background: rgba(255,255,255,.22); color: #fff; }
.bubble--theirs {
  align-self: flex-end;
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-top-left-radius: 6px;
}
html[dir="ltr"] .bubble--theirs { align-self: flex-start; }
.bubble--theirs.bubble--staff { border-color: var(--accent-a28); background: linear-gradient(180deg, var(--accent-a08), rgba(0,0,0,0)), var(--surface-1); }
.bubble__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: var(--fs-xs); }
.bubble__text { white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
.bubble .chip--file { align-self: flex-start; }
.bubble--mine .chip--file { background: rgba(255,255,255,.18); color: #fff; border-color: rgba(255,255,255,.3); }

.chip--file { max-width: 100%; gap: 6px; }
.chip--file .truncate { max-width: 180px; }
.attachment-preview { max-width: 100%; max-height: 70vh; margin: 0 auto; border-radius: var(--r-md); }

.reply-box { display: flex; flex-direction: column; gap: var(--sp-3); }
.reply-box .row--end .btn { flex: 0 0 auto; }
@media (max-width: 480px) { .reply-box .row--end .btn { flex: 1 1 0; } }

.file-pick {
  display: flex; align-items: center; gap: 10px;
  min-height: var(--tap);
  padding: 10px 14px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.file-pick:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-a08); }
.file-pick.has-file { border-style: solid; border-color: var(--success-line); background: var(--success-bg); color: var(--ink); }
.file-pick.has-file > .ico { color: var(--success); }
.file-pick > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.stars { display: flex; justify-content: center; gap: 6px; direction: ltr; }
.star {
  width: 48px; height: 48px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-3);
  transition: -webkit-transform var(--dur-base) var(--ease-spring), color var(--dur-fast) var(--ease-out);
  transition: transform var(--dur-base) var(--ease-spring), color var(--dur-fast) var(--ease-out);
}
.star .ico { width: 32px; height: 32px; }
.star:hover { -webkit-transform: scale(1.12); transform: scale(1.12); }
.star.is-on { color: #fbbf24; }
.star.is-on .ico { fill: #fbbf24; }

.scope-picker { display: grid; grid-template-columns: 1fr; gap: var(--sp-3); }
@media (min-width: 720px) { .scope-picker { grid-template-columns: 1fr 1fr; } }
.scope-group {
  margin: 0; min-width: 0;
  padding: 10px 10px 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.scope-group__title {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%;
  padding: 2px 6px 8px;
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  float: right;
}
.scope-group__title + * { clear: both; }
.card--inset { background: var(--surface-2); box-shadow: none; }

.dropzone--big {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 170px;
  padding: 24px 16px;
  border: 2px dashed var(--line-strong);
  border-radius: var(--r-lg);
  background: var(--surface-2);
  text-align: center;
  cursor: pointer;
}
.dropzone--big:hover, .dropzone--big.is-over { border-color: var(--accent); background: var(--accent-a08); }
.dropzone--big.has-file { border-style: solid; border-color: var(--success-line); background: var(--success-bg); }
.dropzone--big .dropzone__icon {
  width: 64px; height: 64px; border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  background: var(--grad-brand); color: #fff; box-shadow: var(--shadow-accent);
  font-size: inherit;
}
.dropzone--big.has-file .dropzone__icon { background: var(--grad-fresh); }
.dropzone--big .dropzone__icon .ico { width: 30px; height: 30px; }
.dropzone__title { font-weight: var(--fw-bold); font-size: var(--fs-sm); overflow-wrap: anywhere; }

.progress { position: relative; }
.progress__label {
  position: absolute; top: 50%; left: 50%;
  -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%);
  font-size: 11px; font-weight: var(--fw-bold); color: var(--ink);
}
[data-upload-progress] { height: 18px; border-radius: 9px; }
.progress--live .progress__bar {
  background-image: linear-gradient(45deg, rgba(255,255,255,.22) 25%, rgba(0,0,0,0) 25%, rgba(0,0,0,0) 50%, rgba(255,255,255,.22) 50%, rgba(255,255,255,.22) 75%, rgba(0,0,0,0) 75%, rgba(0,0,0,0));
  background-size: 22px 22px;
  -webkit-animation: progress-stripes 1s linear infinite;
          animation: progress-stripes 1s linear infinite;
}
@-webkit-keyframes progress-stripes { to { background-position: 22px 0; } }
@keyframes progress-stripes { to { background-position: 22px 0; } }

.update-card { display: flex; flex-direction: column; gap: var(--sp-3); }
.update-card.is-running { border-color: var(--accent-a45); box-shadow: var(--glow-accent); }

.psteps { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.psteps__item { position: relative; display: flex; gap: 12px; padding-bottom: 14px; }
.psteps__item::before {
  content: "";
  position: absolute;
  top: 26px; bottom: 0; right: 12px;
  width: 2px;
  background: var(--line);
}
html[dir="ltr"] .psteps__item::before { right: auto; left: 12px; }
.psteps__item:last-child::before { display: none; }
.psteps__dot {
  position: relative; z-index: 1;
  width: 26px; height: 26px; flex: 0 0 auto; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-3); border: 2px solid var(--line-strong); color: #fff;
}
.psteps__dot .ico { width: 14px; height: 14px; stroke-width: 3; }
.psteps__item--done .psteps__dot { background: var(--success); border-color: var(--success); }
.psteps__item--done::before { background: var(--success-line); }
.psteps__item--failed .psteps__dot { background: var(--danger); border-color: var(--danger); }
.psteps__item--running .psteps__dot { border-color: var(--accent); background: var(--accent-a18); }
.psteps__item--running .psteps__dot::after {
  content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent);
  -webkit-animation: pulse-dot 1.1s ease-in-out infinite; animation: pulse-dot 1.1s ease-in-out infinite;
}
@-webkit-keyframes pulse-dot { 50% { -webkit-transform: scale(.55); opacity: .6; } }
@keyframes pulse-dot { 50% { transform: scale(.55); opacity: .6; } }
.psteps__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding-top: 2px; }
.psteps__title { font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.psteps__item--pending .psteps__title { color: var(--ink-3); font-weight: var(--fw-regular); }
.psteps__detail { font-size: var(--fs-xs); color: var(--ink-3); overflow-wrap: anywhere; }

.code-block {
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: var(--bg-deep);
  border: 1px solid var(--line);
  color: var(--danger);
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 260px;
  overflow: auto;
  text-align: left;
}

.more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 420px) { .more-grid { grid-template-columns: repeat(4, 1fr); } }
.more-grid__item {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 6px 12px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
  min-height: 96px;
  transition: -webkit-transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
  transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.more-grid__item:hover { border-color: var(--accent-a45); }
.more-grid__item:active { -webkit-transform: scale(.96); transform: scale(.96); }
.more-grid__icon {
  width: 46px; height: 46px; border-radius: 15px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-a12); color: var(--accent);
}
.more-grid__icon .ico { width: 24px; height: 24px; }
.more-grid__icon--danger { background: var(--danger-bg); color: var(--danger); }
.more-grid__label { font-size: var(--fs-xs); font-weight: var(--fw-semibold); text-align: center; line-height: 1.5; color: var(--ink); }
.more-grid__item:nth-child(5n+2) .more-grid__icon:not(.more-grid__icon--danger) { background: var(--info-bg); color: var(--info); }
.more-grid__item:nth-child(5n+3) .more-grid__icon:not(.more-grid__icon--danger) { background: var(--success-bg); color: var(--success); }
.more-grid__item:nth-child(5n+4) .more-grid__icon:not(.more-grid__icon--danger) { background: var(--warning-bg); color: var(--warning); }
.more-grid__item:nth-child(5n+5) .more-grid__icon:not(.more-grid__icon--danger) { background: rgba(236,72,153,.13); color: #ec4899; }

@supports not (aspect-ratio: 1 / 1) {
  .showcase__stage { height: 0; padding-top: 43.75%; }
  .gallery__image { height: 170px; }
}
@supports not (aspect-ratio: 1 / 1) {
  @media (max-width: 560px) { .showcase__stage { padding-top: 56.25%; } }
  @media (min-width: 900px) { .showcase__stage { padding-top: 33.34%; } }
}

.notice-card--festival.is-pending {
  border-color: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, .25), 0 12px 28px -12px rgba(245, 158, 11, .5);
}

@media (max-width: 420px) {
  .hide-sm { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

.sec-event { padding: var(--sp-2) 0; border-bottom: 1px solid var(--line); min-width: 0; }
.sec-event:last-child { border-bottom: 0; }
.sec-event__title { font-weight: 600; font-size: var(--fs-sm); }
.sec-event__meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: var(--fs-xs); color: var(--ink-3); min-width: 0; }
.sec-event__meta > .truncate { max-width: 100%; }
.sec-event.is-failed .sec-event__title { color: var(--danger); }


.auth-aside {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
  text-align: center;
}
.auth-aside__hint {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  margin: 0;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-lg);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: var(--fs-xs);
  line-height: 1.75;
  text-align: start;
}
.auth-aside__hint .ico { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 3px; color: var(--accent); }
.link-btn--muted { color: var(--ink-3); display: inline-flex; align-items: center; gap: 6px; }
.link-btn--muted .ico { width: 16px; height: 16px; }
.link-btn--muted:hover { color: var(--ink); }

.card--danger { border-color: var(--danger-line); }
.card--danger .card__title { color: var(--danger); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--sp-2) var(--sp-4); }
.info-grid__item { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.info-grid__label { font-size: var(--fs-xs); color: var(--ink-3); }
.info-grid__value { font-size: var(--fs-sm); color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.data-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--r-lg); }
.data-table { width: 100%; border-collapse: collapse; font-size: var(--fs-xs); }
.data-table th, .data-table td { padding: var(--sp-2) var(--sp-3); text-align: start; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table th { background: var(--surface-2); color: var(--ink-2); font-weight: 600; white-space: nowrap; position: sticky; top: 0; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table td.num, .data-table th.num { text-align: end; }
.dim-bars { display: flex; flex-direction: column; gap: var(--sp-2); }
.dim-bar__head { display: flex; justify-content: space-between; gap: var(--sp-2); font-size: var(--fs-xs); }
.dim-bar__track { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.dim-bar__fill { height: 100%; border-radius: 999px; background: var(--accent); }
.info-grid__value .badge, .badge--wrap {
  white-space: normal; border-radius: var(--r-md); text-align: start; max-width: 100%;
}
.data-table .badge--wrap { min-width: 13em; }
.data-table td .badge + .badge { margin-top: 4px; }
.data-table { min-width: 680px; }
.data-table td { white-space: normal; word-break: normal; }
.data-table td.strong, .data-table td:first-child { min-width: 8em; }

.list-item__title--wrap, .list-item__sub--wrap {
  white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere;
}
.person-card { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-1); box-shadow: var(--shadow-xs); }
.person-card__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--sp-1) var(--sp-3); }
.person-card__name { font-weight: var(--fw-bold); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.person-card__meta { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); font-size: var(--fs-xs); color: var(--ink-2); }
.person-card__result { font-size: var(--fs-xs); color: var(--ink); background: var(--surface-2); border-radius: var(--r-sm); padding: var(--sp-2) var(--sp-3); }
.person-card__actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.person-cards { display: flex; flex-direction: column; gap: var(--sp-2); }
.person-card.is-muted { opacity: .72; }

.site-roles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
@media (max-width: 760px) { .site-roles { grid-template-columns: 1fr; } }
.site-role { padding: var(--sp-4); }
.site-store {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px 10px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: var(--fs-xs);
  line-height: var(--lh-normal);
}
.site-store:empty { display: none; }
.site-store > .ico { flex: none; width: 16px; height: 16px; margin-top: 2px; }
.site-store > .spinner { margin-top: 2px; }
.site-store .grow { min-width: 60%; }
.site-store small { display: block; color: var(--ink-3); }
.site-store .btn { flex: none; }
.site-store.is-ok { border-color: var(--success-line); background: var(--success-bg); }
.site-store.is-ok > .ico { color: var(--success); }
.site-store.is-busy { border-color: var(--info-line); background: var(--info-bg); }
.site-store.is-info { border-color: var(--info-line); background: var(--info-bg); }
.site-store.is-info > .ico { color: var(--info); }
.site-store.is-bad { border-color: var(--danger-line); background: var(--danger-bg); }
.site-store.is-bad > .ico { color: var(--danger); }
.site-store__warn { color: var(--warning-ink, var(--warning)) !important; }
.site-role .field { margin: 0; }

.auth-aside__links { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-2) var(--sp-4); }
.auth-aside__links .link-btn { text-decoration: none; }

@supports not ((inset-inline-start: 0) or (inset-inline-end: 0)) {
  html[dir="rtl"] .auth-support-link { margin-right: 6px; }
  html[dir="ltr"] .auth-support-link { margin-left: 6px; }
  html[dir="rtl"] .stepper__item + .stepper__item::before { right: calc(-50% + 22px); left: calc(50% + 22px); }
  html[dir="ltr"] .stepper__item + .stepper__item::before { left: calc(-50% + 22px); right: calc(50% + 22px); }
  html[dir="rtl"] .auth-field .field__label .req { margin-right: 3px; }
  html[dir="ltr"] .auth-field .field__label .req { margin-left: 3px; }
}

.fest .alert .btn { flex: 0 0 auto; }
@media (max-width: 560px) {
  .fest .alert { flex-wrap: wrap; }
  .fest .alert .alert__body { flex: 1 1 200px; }
  .fest .alert .btn { margin-inline-start: auto; }
}

.fest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: var(--sp-3);
}
@media (max-width: 480px) {
  .fest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); }
}

.fest-cat {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-2);
  min-height: 150px;
  padding: var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface-1);
  color: var(--ink);
  font: inherit; text-align: start; cursor: pointer;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
}
.fest-cat::after {
  content: ""; position: absolute; inset-inline-end: -40px; top: -40px;
  width: 120px; height: 120px; border-radius: 50%;
  background: var(--fest-tint, var(--accent-a12));
  opacity: .9; pointer-events: none;
}
.fest-cat:hover { border-color: var(--fest-color, var(--accent)); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.fest-cat:active { transform: scale(.985); }
.fest-cat:focus-visible { outline: 2px solid var(--fest-color, var(--accent)); outline-offset: 2px; }
.fest-cat__icon {
  position: relative; z-index: 1;
  width: 44px; height: 44px; border-radius: var(--r-md);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; background: var(--fest-grad, var(--grad-brand));
  box-shadow: 0 8px 18px -10px var(--fest-color, var(--accent));
}
.fest-cat__icon svg { width: 22px; height: 22px; }
.fest-cat__title { position: relative; z-index: 1; font-weight: var(--fw-bold); font-size: var(--fs-md); line-height: var(--lh-snug); }
.fest-cat__meta { position: relative; z-index: 1; font-size: var(--fs-xs); color: var(--ink-3); }
.fest-cat__foot { position: relative; z-index: 1; margin-top: auto; display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.fest-cat__foot .badge svg { width: 13px; height: 13px; margin-inline-end: 3px; vertical-align: -2px; }

.fest-cat--c0 { --fest-color: #6366f1; --fest-tint: rgba(99, 102, 241, .12); --fest-grad: linear-gradient(135deg, #6366f1, #22b8e6); }
.fest-cat--c1 { --fest-color: #ec4899; --fest-tint: rgba(236, 72, 153, .11); --fest-grad: linear-gradient(135deg, #f472b6, #8b5cf6); }
.fest-cat--c2 { --fest-color: #f59e0b; --fest-tint: rgba(245, 158, 11, .13); --fest-grad: linear-gradient(135deg, #f59e0b, #ef4444); }
.fest-cat--c3 { --fest-color: #10b981; --fest-tint: rgba(16, 185, 129, .12); --fest-grad: linear-gradient(135deg, #22c55e, #0ea5e9); }
.fest-cat--c4 { --fest-color: #0ea5e9; --fest-tint: rgba(14, 165, 233, .12); --fest-grad: linear-gradient(135deg, #0ea5e9, #6366f1); }
.fest-cat--c5 { --fest-color: #a855f7; --fest-tint: rgba(168, 85, 247, .12); --fest-grad: linear-gradient(135deg, #a855f7, #14b8a6); }

.fest-defs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--sp-3) var(--sp-4);
}
.fest-defs__label { font-size: var(--fs-xs); color: var(--ink-3); margin-bottom: 2px; }
.fest-defs__value { font-weight: var(--fw-semibold); word-break: break-word; }
.fest-block + .fest-block { margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px dashed var(--line); }
.fest-block__text { white-space: pre-wrap; line-height: var(--lh-loose); color: var(--ink-2); }

.fest-form .field__error { color: var(--danger); font-size: var(--fs-xs); margin-top: 4px; }
.fest-form [aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-bg); }
.fest-form [data-form-errors] ul { margin: var(--sp-2) 0 0; padding-inline-start: 20px; }
.fest-form [data-form-errors] li { margin: 2px 0; }
.fest-members .table { min-width: 720px; }
.fest-members .input { min-width: 110px; }
.fest-members td { vertical-align: middle; }

.psyv {
  --pv-surface: var(--surface-1);
  --pv-surface-2: var(--surface-2);
  --pv-surface-3: var(--surface-3);
  --pv-border: var(--line);
  --pv-border-strong: var(--line-strong);
  --pv-ink: var(--ink);
  --pv-ink-soft: var(--ink-2);
  --pv-ink-muted: var(--ink-3);
  --pv-brand: var(--accent);
  --pv-brand-ink: var(--accent-strong);
  --pv-brand-soft: var(--accent-a12);
  --pv-brand-2: var(--accent-2);
  --pv-grad: var(--grad-brand);
  --pv-grad-soft: var(--grad-brand-soft);
  --pv-good: var(--success);
  --pv-good-soft: var(--success-bg);
  --psy-s1: #2a78d6; --psy-s2: #eb6834; --psy-s3: #1baf7a; --psy-s4: #eda100;
  --psy-s5: #e87ba4; --psy-s6: #008300; --psy-s7: #4a3aa7; --psy-s8: #e34948;
}
html[data-theme="dark"] .psyv { --pv-brand-ink: var(--accent-soft); }

.psyv-narrow { max-width: 680px; margin-right: auto; margin-left: auto; width: 100%; }
.psyv-center { text-align: center; align-items: center; }
.psyv-qimg { display: block; max-width: 100%; height: auto; margin: var(--sp-3) auto; border-radius: var(--r-md); border: 1px solid var(--pv-border); background: #fff; }

.psyv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--sp-4); }
@media (max-width: 480px) { .psyv-grid { grid-template-columns: 1fr; } }

.psyv .tcard {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  background: var(--pv-surface); border: 1px solid var(--pv-border);
  border-radius: var(--r-xl); box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s;
}
.psyv .tcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.psyv .tcard__cover {
  position: relative; height: 112px; display: flex; align-items: flex-end; justify-content: space-between;
  padding: 12px 16px; background: var(--pv-grad); color: #fff; overflow: hidden;
}
.psyv .tcard__cover::before { content: ""; position: absolute; width: 180px; height: 180px; border-radius: 50%; top: -80px; inset-inline-start: -40px; background: rgba(255,255,255,.16); }
.psyv .tcard__cover::after { content: ""; position: absolute; width: 90px; height: 90px; border-radius: 50%; bottom: -40px; inset-inline-start: 42%; background: rgba(255,255,255,.1); }
.psyv .tcard__emoji {
  position: relative; z-index: 1; width: 64px; height: 64px; border-radius: 20px;
  display: flex; align-items: center; justify-content: center; font-size: 2.1rem; line-height: 1;
  background: rgba(255,255,255,.22); border: 1px solid rgba(255,255,255,.35);
}
.psyv .tcard__cover .badge { position: relative; z-index: 1; background: rgba(255,255,255,.92); color: #312e81; }
.psyv .tcard--c1 .tcard__cover { background: linear-gradient(135deg, #14b8a6, #6366f1); }
.psyv .tcard--c2 .tcard__cover { background: linear-gradient(135deg, #f472b6, #8b5cf6); }
.psyv .tcard--c3 .tcard__cover { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.psyv .tcard--c4 .tcard__cover { background: linear-gradient(135deg, #22c55e, #0ea5e9); }
.psyv .tcard--c5 .tcard__cover { background: linear-gradient(135deg, #6366f1, #0ea5e9); }
.psyv .tcard__cover--art { height: auto; padding: 0; display: block; background: var(--pv-surface-2); }
.psyv .tcard__cover--art::before, .psyv .tcard__cover--art::after { display: none; }
.psyv .tcard__cover--art img { display: block; width: 100%; height: 180px; object-fit: cover; }
.psyv .tcard__cover--art .badge { position: absolute; top: 12px; inset-inline-end: 12px; }
.psyv .tcard__body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1 1 auto; }
.psyv .tcard__title { font-size: 1.05rem; font-weight: var(--fw-extrabold); line-height: 1.6; margin: 0; }
.psyv .tcard__sub { font-size: .84rem; color: var(--pv-ink-muted); margin: 0; }
.psyv .tcard__desc { font-size: .86rem; color: var(--pv-ink-soft); line-height: 1.85; margin: 0; }
.psyv .tcard__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: .8rem; color: var(--pv-ink-muted); margin-top: 2px; }
.psyv .tcard__meta > span { display: inline-flex; align-items: center; gap: 5px; }
.psyv .tcard__meta svg { width: 16px; height: 16px; }
.psyv .tcard__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 10px; }
.psyv .tcard__actions .btn { flex: 1 1 auto; }

.psyv .quiz { display: flex; flex-direction: column; gap: var(--sp-4); }
.psyv .quiz__progress {
  position: sticky; top: calc(var(--topbar-h, 56px) + 8px); z-index: 5;
  padding: 10px 14px; border-radius: var(--r-lg);
  background: var(--glass-strong, var(--pv-surface));
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid var(--pv-border);
}
.psyv .quiz__bar, .psyv .sq__bar { height: 8px; border-radius: 999px; background: var(--pv-surface-3); overflow: hidden; display: flex; }
.psyv .quiz__bar span, .psyv .sq__bar span { display: block; height: 100%; background: var(--pv-grad); border-radius: 999px; transition: width .35s ease; }
.psyv .question { background: var(--pv-surface); border: 1px solid var(--pv-border); border-radius: var(--r-lg); padding: var(--sp-5) var(--sp-4); box-shadow: var(--shadow-xs); }
.psyv .question__num { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: .76rem; font-weight: 800; color: var(--pv-brand-ink); background: var(--pv-brand-soft); margin: 0; }
.psyv .question__text { font-size: 1.04rem; font-weight: 700; line-height: 1.9; margin: var(--sp-2) 0 0; }
.psyv .question__hint { font-size: .82rem; color: var(--pv-ink-muted); margin: var(--sp-1) 0 0; }
.psyv .question__options { display: flex; flex-direction: column; gap: 10px; margin-top: var(--sp-4); }
.psyv .option {
  display: flex; align-items: center; gap: var(--sp-3); width: 100%;
  padding: 12px var(--sp-4); min-height: 56px;
  border: 1.5px solid var(--pv-border); border-radius: var(--r-md);
  background: var(--pv-surface); color: var(--pv-ink); cursor: pointer;
  font: inherit; font-size: .95rem; line-height: 1.7; text-align: start;
  transition: border-color .15s, background .15s, transform .08s;
}
.psyv .option:hover { border-color: var(--pv-brand); }
.psyv .option:active { transform: scale(.99); }
.psyv .option[aria-pressed="true"] { border-color: var(--pv-brand); background: var(--pv-brand-soft); color: var(--pv-brand-ink); font-weight: 700; }
.psyv .option__mark {
  flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--pv-border-strong); display: flex; align-items: center; justify-content: center;
}
.psyv .option[aria-pressed="true"] .option__mark { border-color: var(--pv-brand); background: var(--pv-brand); }
.psyv .option[aria-pressed="true"] .option__mark::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.psyv .option--multi .option__mark { border-radius: 7px; }

.psyv .intro-card { overflow: hidden; border-radius: var(--r-xl); background: var(--pv-surface); border: 1px solid var(--pv-border); box-shadow: var(--shadow-lg); }
.psyv .intro-card__art { display: block; width: 100%; height: auto; }
.psyv .intro-card__cover { padding: 26px 20px; text-align: center; background: var(--pv-grad); color: #fff; }
.psyv .intro-card__emoji { font-size: 3rem; line-height: 1; }
.psyv .intro-card__body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.psyv .intro-card__heading { font-size: 1.35rem; font-weight: 900; line-height: 1.6; margin: 0; }
.psyv .intro-facts { display: flex; flex-wrap: wrap; gap: 8px; }
.psyv .intro-facts span {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px;
  background: var(--pv-surface-2); border: 1px solid var(--pv-border);
  font-size: .82rem; font-weight: 700; color: var(--pv-ink-soft);
}
.psyv .intro-facts svg { width: 16px; height: 16px; color: var(--pv-brand); }

.psyv .sq { display: flex; flex-direction: column; gap: 12px; max-width: 680px; margin: 0 auto; width: 100%; }
.psyv .sq__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.psyv .sq__title { font-weight: 800; font-size: .92rem; color: var(--pv-ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.psyv .sq__count { flex: 0 0 auto; padding: 3px 12px; border-radius: 999px; background: var(--pv-brand-soft); color: var(--pv-brand-ink); font-weight: 900; font-size: .88rem; font-variant-numeric: tabular-nums; }
.psyv .sq__bar { height: 10px; }
.psyv .sq__meta { display: flex; justify-content: space-between; font-size: .8rem; color: var(--pv-ink-muted); margin: 0; }
.psyv .sq__card {
  background: var(--pv-surface); border: 1px solid var(--pv-border); border-radius: var(--r-xl);
  padding: 20px 16px 16px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: 10px; min-height: 330px;
}
.psyv .sq__card.is-entering { animation: psyvRise .24s cubic-bezier(.22,.61,.36,1); }
@keyframes psyvRise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.psyv .sq__card .question__num { align-self: flex-start; }
.psyv .sq__text { font-size: 1.12rem; font-weight: 800; line-height: 1.95; margin: 0 0 6px; }
.psyv .sq__nav { display: flex; gap: 10px; }
.psyv .sq__nav .btn { flex: 1 1 0; }
.psyv .sq__foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }

.psyv .lk-list, .psyv .ab-list { display: flex; flex-direction: column; gap: 10px; }
.psyv .lk, .psyv .ab {
  position: relative; display: flex; align-items: center; width: 100%;
  border: 2px solid var(--pv-border); background: var(--pv-surface); color: var(--pv-ink);
  font: inherit; font-weight: 700; text-align: start; cursor: pointer;
  transition: border-color .15s, background .15s, transform .08s, box-shadow .08s;
}
.psyv .lk { gap: 14px; min-height: 56px; padding: 10px 14px; border-radius: 18px; font-size: .98rem; }
.psyv .lk:hover, .psyv .ab:hover { border-color: var(--pv-brand); }
.psyv .lk:active { transform: scale(.99); }
.psyv .lk__dot { flex: 0 0 auto; border-radius: 50%; background: var(--pv-brand); }
.psyv .lk--1 .lk__dot { width: 12px; height: 12px; margin: 0 6px; opacity: .35; }
.psyv .lk--2 .lk__dot { width: 16px; height: 16px; margin: 0 4px; opacity: .5; }
.psyv .lk--3 .lk__dot { width: 20px; height: 20px; margin: 0 2px; opacity: .65; }
.psyv .lk--4 .lk__dot { width: 22px; height: 22px; margin: 0 1px; opacity: .8; }
.psyv .lk--5 .lk__dot { width: 24px; height: 24px; opacity: 1; }
.psyv .lk__text, .psyv .ab__text { flex: 1 1 auto; }
.psyv .lk__check, .psyv .ab__check {
  flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--pv-border-strong); color: transparent;
}
.psyv .lk__check svg, .psyv .ab__check svg { width: 16px; height: 16px; stroke-width: 3; }
.psyv .lk[aria-pressed="true"], .psyv .ab[aria-pressed="true"] { border-color: var(--pv-brand); background: var(--pv-brand-soft); color: var(--pv-brand-ink); }
.psyv .lk[aria-pressed="true"] .lk__check, .psyv .ab[aria-pressed="true"] .ab__check { background: var(--pv-brand); border-color: var(--pv-brand); color: #fff; }
.psyv .ab { gap: 12px; min-height: 76px; padding: 14px; border-radius: 20px; font-size: 1.02rem; line-height: 1.8; box-shadow: 0 4px 0 var(--pv-border); }
.psyv .ab:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--pv-border); }
.psyv .ab__key {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--pv-grad-soft); color: var(--pv-brand-ink); font-weight: 900; font-size: .9rem;
}
.psyv .ab[aria-pressed="true"] .ab__key { background: var(--pv-grad); color: #fff; }

.psyv .result__hero {
  position: relative; overflow: hidden; background: var(--pv-grad); color: #fff;
  border-radius: var(--r-xl); padding: 26px 20px; text-align: center; box-shadow: var(--shadow-accent, var(--shadow-lg));
}
.psyv .result__eyebrow { font-size: .8rem; opacity: .85; font-weight: 700; margin: 0; }
.psyv .result__top { font-size: 1.6rem; font-weight: 900; margin: var(--sp-1) 0 0; color: #fff; }
.psyv .result__band { display: inline-block; font-size: .9rem; font-weight: 700; margin-top: var(--sp-2); padding: 2px 14px; border-radius: 999px; background: rgba(255,255,255,.2); }
.psyv .result__desc { font-size: .92rem; opacity: .95; margin: var(--sp-3) 0 0; line-height: 2; }

.psyv-chart { display: flex; flex-direction: column; gap: var(--sp-1); }
.psyv .barrow { display: grid; grid-template-columns: 1fr auto; gap: 6px var(--sp-3); align-items: center; padding: var(--sp-2) 0; }
.psyv .barrow__label { font-size: .88rem; font-weight: 700; }
.psyv .barrow__band { font-size: .76rem; color: var(--pv-ink-muted); }
.psyv .barrow__track { grid-column: 1 / -1; height: 14px; border-radius: 999px; background: var(--pv-surface-3); overflow: hidden; display: flex; }
.psyv .barrow__fill { height: 100%; border-radius: 999px; transition: width .6s cubic-bezier(.22,.61,.36,1); }
.psyv .barrow__value { font-size: .88rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.psyv .legend__dot { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; display: inline-block; }

.psyv .dimcard { border: 1px solid var(--pv-border); border-radius: var(--r-lg); padding: var(--sp-4); background: var(--pv-surface); box-shadow: var(--shadow-xs); }
.psyv .dimcard__top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.psyv .dimcard__name { font-weight: 800; font-size: .95rem; display: flex; align-items: center; gap: var(--sp-2); }
.psyv .dimcard__pct { font-weight: 900; font-variant-numeric: tabular-nums; }
.psyv .dimcard__desc { font-size: .84rem; color: var(--pv-ink-soft); margin: var(--sp-2) 0 0; line-height: 1.9; }
.psyv .dimcard__advice { font-size: .84rem; color: var(--pv-brand-ink); margin: var(--sp-2) 0 0; padding: 8px 12px; border-radius: 12px; background: var(--pv-brand-soft); }

.psyv .res-page { max-width: 820px; margin: 0 auto; width: 100%; }
.psyv .res { position: relative; overflow: hidden; border-radius: var(--r-2xl, 28px); background: var(--pv-surface); border: 1px solid var(--pv-border); box-shadow: var(--shadow-lg); }
.psyv .res__art { display: block; width: 100%; height: auto; }
.psyv .res__confetti { position: absolute; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; overflow: hidden; z-index: 2; }
.psyv .res__confetti i { position: absolute; top: -20px; width: 9px; height: 14px; border-radius: 3px; opacity: 0; animation: psyvConfetti 2.8s ease-in forwards; }
@keyframes psyvConfetti { 0% { opacity: 1; transform: translateY(0) rotate(0); } 100% { opacity: 0; transform: translateY(560px) rotate(540deg); } }
.psyv .res__body { padding: 0 18px 22px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.psyv .res__badge {
  display: inline-flex; align-items: center; gap: 6px; margin-top: -20px; position: relative; z-index: 1;
  padding: 6px 16px; border-radius: 999px; color: #fff; font-weight: 800; font-size: .86rem;
  box-shadow: 0 10px 24px -8px rgba(0,0,0,.35); border: 3px solid var(--pv-surface);
}
.psyv .res__badge svg { width: 16px; height: 16px; }
.psyv .res__eyebrow { font-size: .84rem; font-weight: 700; color: var(--pv-ink-muted); margin: 6px 0 0; }
.psyv .res__code { font-size: 3rem; font-weight: 900; line-height: 1.1; letter-spacing: .12em; text-align: center; font-family: Arial, Helvetica, sans-serif; margin: 0; }
.psyv .res__title { font-size: 1.4rem; font-weight: 900; line-height: 1.6; margin: 0; }
.psyv .res__title--big { font-size: 1.65rem; }
.psyv .res__headline { font-size: 1.02rem; font-weight: 800; color: var(--pv-ink-soft); margin: 0; }
.psyv .res__desc { font-size: .95rem; line-height: 2.05; color: var(--pv-ink-soft); max-width: 60ch; margin: 0; }
.psyv .res__dynamic, .psyv .res__when { display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; color: var(--pv-ink-muted); font-weight: 600; margin: 0; }
.psyv .res__dynamic svg, .psyv .res__when svg { width: 16px; height: 16px; }
.psyv .res__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 6px; }

.psyv .chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 4px 0; }
.psyv .card .chips { justify-content: flex-start; margin-top: 10px; }
.psyv .chip-tag { display: inline-flex; align-items: center; padding: 5px 12px; border-radius: 999px; background: var(--pv-surface-2); border: 1px solid var(--pv-border); font-size: .82rem; font-weight: 700; color: var(--pv-ink-soft); }
.psyv .chip-tag--good { background: var(--pv-good-soft); border-color: transparent; color: var(--pv-good); }
.psyv .chip-tag--brand { background: var(--pv-brand-soft); border-color: transparent; color: var(--pv-brand-ink); }
.psyv .card__title svg { width: 20px; height: 20px; vertical-align: -4px; color: var(--pv-brand); }

.psyv .tip {
  display: flex; gap: 10px; align-items: flex-start; text-align: start; width: 100%;
  margin-top: 10px; padding: 12px 14px; border-radius: 16px;
  background: var(--pv-brand-soft); color: var(--pv-brand-ink); font-size: .9rem; line-height: 1.95;
}
.psyv .tip svg { width: 22px; height: 22px; flex: 0 0 auto; margin-top: 4px; }

.psyv .axes { display: flex; flex-direction: column; gap: 18px; }
.psyv .axis__labels { display: flex; justify-content: space-between; gap: 10px; font-size: .88rem; color: var(--pv-ink-muted); font-weight: 700; margin-bottom: 6px; }
.psyv .axis__side b { font-family: Arial, Helvetica, sans-serif; font-size: 1rem; }
.psyv .axis__side.is-win { color: var(--pv-ink); }
.psyv .axis__side.is-win b { color: var(--pv-brand-2); }
.psyv .axis__track { display: flex; height: 16px; border-radius: 999px; overflow: hidden; background: var(--pv-surface-3); }
.psyv .axis__fill--a { background: linear-gradient(90deg, #8b5cf6, #6366f1); }
.psyv .axis__fill--b { background: linear-gradient(90deg, #14b8a6, #0ea5e9); }
.psyv .axis__foot { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: .8rem; font-weight: 800; color: var(--pv-ink-muted); font-variant-numeric: tabular-nums; }
.psyv .axis__text { margin: 6px 0 0; font-size: .88rem; line-height: 1.9; color: var(--pv-ink-soft); }

.psyv .checklist { margin: 0; padding-inline-start: 22px; display: flex; flex-direction: column; gap: 6px; font-size: .9rem; line-height: 1.9; color: var(--pv-ink-soft); }
.psyv .checklist li::marker { color: var(--pv-brand); font-weight: 800; }
.psyv .more { margin-top: 10px; }
.psyv .more summary { cursor: pointer; font-weight: 800; font-size: .88rem; color: var(--pv-brand); padding: 6px 0; }

.psyv .mibars { display: flex; flex-direction: column; gap: 12px; margin-top: var(--sp-3); }
.psyv .mibar { display: flex; gap: 12px; align-items: center; }
.psyv .mibar__emoji { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; background: var(--pv-surface-2); border: 1px solid var(--pv-border); }
.psyv .mibar.is-top .mibar__emoji { background: var(--pv-grad-soft); border-color: transparent; }
.psyv .mibar__main { flex: 1 1 auto; min-width: 0; }
.psyv .mibar__head { display: flex; justify-content: space-between; gap: 8px; font-size: .9rem; font-weight: 800; }
.psyv .mibar__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.psyv .mibar__score { font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.psyv .mibar__score small { font-weight: 600; color: var(--pv-ink-muted); font-size: .72rem; }
.psyv .mibar__track { height: 12px; border-radius: 999px; background: var(--pv-surface-3); overflow: hidden; display: flex; margin: 5px 0 2px; }
.psyv .mibar__track span { display: block; height: 100%; border-radius: 999px; transition: width .6s cubic-bezier(.22,.61,.36,1); }
.psyv .mibar__level { font-size: .76rem; font-weight: 800; }

.psyv .trios { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 760px) { .psyv .trios { grid-template-columns: repeat(3, 1fr); } }
.psyv .trio { overflow: hidden; border-radius: 22px; border: 1px solid var(--pv-border); background: var(--pv-surface-2); display: flex; flex-direction: column; }
.psyv .trio img { display: block; width: 100%; height: auto; }
.psyv .trio__body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; }
.psyv .trio__body p { margin: 0; }
.psyv .trio__rank { font-size: .8rem; font-weight: 800; color: var(--pv-ink-muted); }
.psyv .trio__title { font-weight: 900; font-size: 1rem; }
.psyv .trio__nick { font-size: .82rem; font-weight: 700; color: var(--pv-brand-2); }
.psyv .trio--first { border-color: var(--pv-brand); box-shadow: 0 0 0 3px var(--pv-brand-soft); }

.psyv .consult-cta .btn { margin-top: var(--sp-3); }

@media print {
  .psyv .res__actions, .psyv .consult-cta, .psyv .res__confetti { display: none !important; }
}

@supports not ((inset-inline-start: 0) or (inset-inline-end: 0)) {
  @media (max-width: 560px) { html[dir="rtl"] .fest .alert .btn { margin-right: auto; } }
  @media (max-width: 560px) { html[dir="ltr"] .fest .alert .btn { margin-left: auto; } }
  html[dir="rtl"] .fest-cat::after { left: -40px; }
  html[dir="ltr"] .fest-cat::after { right: -40px; }
  html[dir="rtl"] .fest-cat__foot .badge svg { margin-left: 3px; }
  html[dir="ltr"] .fest-cat__foot .badge svg { margin-right: 3px; }
  html[dir="rtl"] .fest-form [data-form-errors] ul { padding-right: 20px; }
  html[dir="ltr"] .fest-form [data-form-errors] ul { padding-left: 20px; }
  html[dir="rtl"] .psyv .tcard__cover::before { right: -40px; }
  html[dir="ltr"] .psyv .tcard__cover::before { left: -40px; }
  html[dir="rtl"] .psyv .tcard__cover::after { right: 42%; }
  html[dir="ltr"] .psyv .tcard__cover::after { left: 42%; }
  html[dir="rtl"] .psyv .tcard__cover--art .badge { left: 12px; }
  html[dir="ltr"] .psyv .tcard__cover--art .badge { right: 12px; }
  html[dir="rtl"] .psyv .checklist { padding-right: 22px; }
  html[dir="ltr"] .psyv .checklist { padding-left: 22px; }
}

.pc {
  --pc-gap: 22px;
  --pc-bubble: 60px;
  --pc-grad: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 62%, #f472b6 100%);
  position: fixed;
  inset-inline-end: var(--pc-gap);
  bottom: calc(var(--pc-gap) + env(safe-area-inset-bottom));
  z-index: 190;
  font-family: inherit;
}
.pc.is-off .pc-bubble {
  background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
  box-shadow: 0 10px 26px -10px rgba(71, 85, 105, .7), 0 2px 6px rgba(0, 0, 0, .2);
}
.pc.is-off .pc-bubble__dot { display: none; }
.pc-bubble__off {
  position: absolute;
  bottom: -2px;
  inset-inline-start: -2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--warning);
  color: #fff;
  display: grid;
  place-items: center;
  border: 2px solid var(--bg);
}
.pc-bubble__off[hidden] { display: none; }
.pc-bubble__off .ico { width: 11px; height: 11px; }
.pc.is-off .pc-head__avatar { background: linear-gradient(135deg, #94a3b8, #64748b); }

.pc-bubble {
  position: relative;
  width: var(--pc-bubble);
  height: var(--pc-bubble);
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  color: #fff;
  background: var(--pc-grad);
  box-shadow: 0 14px 34px -8px rgba(124, 108, 255, .7), 0 2px 6px rgba(0, 0, 0, .25);
  display: grid;
  place-items: center;
  transition: transform var(--dur-base) var(--ease-spring), box-shadow var(--dur-base) var(--ease-out),
              opacity var(--dur-base) var(--ease-out);
}
.pc-bubble:hover { transform: translateY(-2px) scale(1.05); }
.pc-bubble:active { transform: scale(.96); }
.pc-bubble:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 3px; }
.pc-bubble__icon .ico { width: 27px; height: 27px; }
.pc-bubble__dot {
  position: absolute;
  top: 3px;
  inset-inline-start: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--success);
  border: 2.5px solid var(--bg);
}
.pc-bubble__badge, .pc-tab__badge {
  position: absolute;
  top: -4px;
  inset-inline-end: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 12px;
  font-weight: var(--fw-bold);
  display: grid;
  place-items: center;
  border: 2px solid var(--bg);
}
.pc-bubble__label {
  position: absolute;
  inset-inline-end: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(0);
  padding: 7px 14px;
  border-radius: 999px;
  white-space: nowrap;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--ink);
  background: var(--glass-strong);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-fast) var(--ease-out);
}
.pc-bubble:hover .pc-bubble__label, .pc-bubble:focus-visible .pc-bubble__label { opacity: 1; }
.pc.has-unread .pc-bubble::after {
  content: "";
  position: absolute;
  top: -6px; right: -6px; bottom: -6px; left: -6px;
  border-radius: 50%;
  border: 2px solid var(--accent-soft);
  animation: pc-pulse 1.8s var(--ease-out) infinite;
}
@keyframes pc-pulse {
  0% { opacity: .9; transform: scale(.92); }
  100% { opacity: 0; transform: scale(1.35); }
}

.pc-tuck {
  position: absolute;
  top: -10px;
  inset-inline-start: -10px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--ink-2);
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  touch-action: manipulation;
  transition: opacity var(--dur-fast);
}
.pc-tuck .ico { width: 12px; height: 12px; }
.pc:hover .pc-tuck, .pc-tuck:focus-visible { opacity: 1; }
.pc-tab {
  display: none;
  position: absolute;
  bottom: 0;
  inset-inline-end: 0;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: var(--pc-grad);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  place-items: center;
  opacity: .78;
  touch-action: manipulation;
  transition: opacity var(--dur-fast), transform var(--dur-fast);
}
.pc-tab:hover, .pc-tab:focus-visible { opacity: 1; transform: scale(1.08); }
.pc-tab:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; }
.pc-tab .ico { width: 19px; height: 19px; }
.pc.is-tucked .pc-bubble, .pc.is-tucked .pc-tuck { display: none; }
.pc.is-tucked .pc-tab { display: grid; }
.pc.pc--side:not(.is-open) .pc-bubble, .pc.pc--side:not(.is-open) .pc-tuck { display: none; }
.pc.pc--side:not(.is-open) .pc-tab {
  display: grid;
  position: fixed;
  inset-inline-end: 12px;
  bottom: calc(160px + env(safe-area-inset-bottom));
  opacity: 1;
}

.pc-panel {
  position: fixed;
  box-sizing: border-box;
  max-width: calc(100vw - 16px);
  min-width: 0;
  inset-inline-end: var(--pc-gap);
  bottom: calc(var(--pc-gap) + env(safe-area-inset-bottom));
  width: min(390px, calc(100vw - 16px));
  height: min(620px, calc(100vh - 96px));
  height: min(620px, calc(100dvh - 96px));
  max-height: calc(100vh - 16px);
  max-height: calc(100dvh - 16px);
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  overflow: hidden;
  background: var(--surface-1);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(124, 108, 255, .08);
  transform-origin: bottom var(--pc-origin, left);
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px) scale(.96);
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out),
              visibility 0s linear var(--dur-base);
}
[dir="ltr"] .pc-panel, .pc[dir="ltr"] .pc-panel { --pc-origin: right; }
.pc.is-open .pc-panel {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-spring), visibility 0s;
}
.pc.is-open .pc-bubble, .pc.is-open .pc-tuck { opacity: 0; pointer-events: none; transform: scale(.6); }
.pc.is-large .pc-panel { width: min(580px, calc(100vw - 40px)); height: min(800px, calc(100vh - 60px)); }
.pc.is-resizing .pc-panel { transition: none; user-select: none; }

.pc-resize {
  position: absolute;
  top: 0;
  inset-inline-start: 0;
  width: 22px;
  height: 22px;
  z-index: 3;
  cursor: nesw-resize;
  touch-action: none;
}
.pc[dir="ltr"] .pc-resize { cursor: nwse-resize; }
.pc-resize::before {
  content: "";
  position: absolute;
  top: 6px;
  inset-inline-start: 6px;
  width: 9px;
  height: 9px;
  border-top: 2px solid rgba(255, 255, 255, .55);
  border-inline-start: 2px solid rgba(255, 255, 255, .55);
  border-start-start-radius: 3px;
}

.pc-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 14px 12px;
  padding-inline-start: 18px;
  color: #fff;
  background: linear-gradient(120deg, var(--accent-deep) 0%, var(--accent-strong) 55%, var(--accent-2) 120%);
}
.pc-head__avatar {
  position: relative;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .28);
}
.pc-head__avatar .ico { width: 22px; height: 22px; }
.pc-head__dot {
  position: absolute;
  bottom: 0;
  inset-inline-end: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--success);
  border: 2px solid var(--accent-strong);
}
.pc-head__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pc-head__title { font-size: var(--fs-md); font-weight: var(--fw-bold); }
.pc-head__sub { font-size: var(--fs-2xs); opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-head__actions { display: flex; gap: 2px; }
.pc-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 0;
  color: #fff;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.pc-icon-btn:hover { background: rgba(255, 255, 255, .14); }
.pc-icon-btn .ico { width: 18px; height: 18px; }

.pc-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 14px 8px;
  background:
    radial-gradient(420px 260px at 100% 0%, var(--accent-a08), transparent 70%),
    var(--surface-1);
}
.pc-loading { display: grid; place-items: center; height: 100%; }
.pc-empty { display: grid; justify-items: center; gap: 10px; padding: 30px 12px; text-align: center; color: var(--ink-2); }
.pc-empty .ico { width: 28px; height: 28px; color: var(--warning); }
.pc-muted { color: var(--ink-3); font-size: var(--fs-sm); }

.pc-intro { display: grid; gap: 14px; }
.pc-intro__hero {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border-radius: 18px;
  background: var(--accent-a12);
  border: 1px solid var(--accent-a18);
}
.pc-intro__hero p { margin: 0; font-size: var(--fs-sm); line-height: var(--lh-normal); color: var(--ink); }
.pc-intro__icon {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--pc-grad);
}
.pc-intro__icon .ico { width: 20px; height: 20px; }
.pc-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: pcstep; }
.pc-steps li {
  counter-increment: pcstep;
  display: grid;
  grid-template-columns: 28px 1fr;
  column-gap: 10px;
  align-items: start;
}
.pc-steps li::before {
  content: counter(pcstep, persian);
  grid-row: span 2;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  color: var(--accent-soft);
  background: var(--accent-a12);
}
[lang="en"] .pc-steps li::before { content: counter(pcstep); }
.pc-steps b { font-size: var(--fs-sm); }
.pc-steps span { font-size: var(--fs-2xs); color: var(--ink-3); line-height: var(--lh-snug); }
.pc-prices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pc-price {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.pc-price b { font-size: var(--fs-sm); }
.pc-price span { font-size: var(--fs-sm); font-weight: var(--fw-bold); color: var(--accent-soft); }
.pc-price small { font-size: 11.5px; line-height: 1.55; color: var(--ink-3); }
.pc-crisis {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 12.5px;
  line-height: var(--lh-snug);
  color: var(--ink-2);
  background: var(--danger-bg);
  border: 1px solid var(--danger-line);
}
.pc-crisis .ico { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--danger); }
.pc-crisis__text { min-width: 0; flex: 1 1 auto; overflow-wrap: anywhere; }
.pc-crisis__close { flex: 0 0 auto; width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); cursor: pointer; font-size: 20px; line-height: 1; display: grid; place-items: center; }
.pc-crisis__close:hover { background: var(--surface-3); }

.pc-thread { display: flex; flex-direction: column; gap: 10px; }
.pc-note {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  color: var(--ink-3);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.pc-note .ico { width: 12px; height: 12px; }
.pc-msg { display: flex; flex-direction: column; max-width: 86%; gap: 4px; }
.pc-msg--them { align-self: flex-start; align-items: flex-start; }
.pc-msg--me { align-self: flex-end; align-items: flex-end; }
.pc-msg__who { font-size: 11.5px; color: var(--accent-soft); font-weight: var(--fw-semibold); padding-right: 6px; padding-left: 6px; }
.pc-table-wrap {
  max-width: min(100%, 760px);
  overflow-x: auto;
  margin: 4px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  font-family: var(--font-fa);
  -webkit-overflow-scrolling: touch;
}
.pc-chat-table {
  width: 100%;
  min-width: 420px;
  border-collapse: collapse;
  font: inherit;
  line-height: var(--lh-normal);
  text-align: start;
}
.pc-chat-table th, .pc-chat-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: start;
  white-space: normal;
}
.pc-chat-table th {
  font-weight: var(--fw-bold);
  background: var(--surface-3);
  color: var(--ink);
}
.pc-chat-table tr:last-child td { border-bottom: 0; }

.pc-msg__bubble {
  padding: 10px 14px;
  border-radius: 18px;
  font-size: var(--fs-sm);
  line-height: var(--lh-normal);
  white-space: normal;
  overflow-wrap: anywhere;
}
.pc-msg--them .pc-msg__bubble {
  background: var(--surface-3);
  color: var(--ink);
  border-start-start-radius: 6px;
  border: 1px solid var(--line);
}
.pc-msg--me .pc-msg__bubble {
  color: #fff;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  border-start-end-radius: 6px;
  box-shadow: 0 8px 20px -12px rgba(99, 82, 245, .8);
}
.pc-msg__time { font-size: 11px; color: var(--ink-3); padding-right: 6px; padding-left: 6px; }
.pc-msg__ask, .pc-msg__free {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  padding: 3px 10px;
  border-radius: 999px;
  color: var(--warning);
  background: var(--warning-bg);
}
.pc-msg__free { color: var(--success); background: var(--success-bg); }
.pc-msg__ask .ico { width: 12px; height: 12px; }
.pc-qchip {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  padding: 4px 10px;
  border-radius: 10px;
  font-size: 11.5px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
}
.pc-qchip s { opacity: .6; }
.pc-qchip__status { font-weight: var(--fw-semibold); }
.pc-qchip--wait .pc-qchip__status { color: var(--warning); }
.pc-qchip--ok .pc-qchip__status { color: var(--success); }
.pc-qchip--back .pc-qchip__status { color: var(--accent-3); }
.pc-sys { align-self: center; max-width: 92%; text-align: center; }
.pc-sys span {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 12px;
  line-height: var(--lh-snug);
  color: var(--ink-2);
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
}
.pc-closed { margin-top: 14px; padding: 12px; border-radius: 16px; text-align: center; background: var(--surface-2); border: 1px solid var(--line); }
.pc-closed p { margin: 0 0 6px; font-size: var(--fs-sm); color: var(--ink-2); }
.pc-closed > p .ico { width: 16px; height: 16px; color: var(--success); vertical-align: -3px; }
.pc-closed__rated { color: var(--warning) !important; }
.pc-rate { display: grid; gap: 6px; justify-items: center; font-size: var(--fs-sm); }
.pc-stars { display: inline-flex; gap: 2px; direction: ltr; }
.pc-stars button { border: 0; background: none; color: var(--ink-3); cursor: pointer; padding: 3px; border-radius: 8px; }
.pc-stars button:hover, .pc-stars button:hover ~ button { color: var(--warning); }
.pc-stars .ico { width: 22px; height: 22px; }

.pc-typing {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 18px 6px;
  font-size: 12px;
  color: var(--ink-3);
  background: var(--surface-1);
}
.pc-typing[hidden] { display: none; }
.pc-dots { display: inline-flex; gap: 3px; }
.pc-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-soft); animation: pc-dot 1.2s infinite ease-in-out; }
.pc-dots i:nth-child(2) { animation-delay: .15s; }
.pc-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes pc-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.pc-foot {
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.pc-compose { display: flex; align-items: flex-end; gap: 8px; min-width: 0; width: 100%; }
.pc-input {
  flex: 1 1 auto;
  min-width: 0;
  width: 0;
  min-height: 44px;
  max-height: 160px;
  resize: none;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: var(--surface-1);
  color: var(--ink);
  font: inherit;
  font-size: var(--fs-sm);
  line-height: var(--lh-snug);
}
.pc-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-a18); }
.pc-send {
  flex: 0 0 44px;
  min-width: 44px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  color: #fff;
  background: var(--pc-grad);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-accent);
}
.pc-send .ico { width: 19px; height: 19px; }
[dir="rtl"] .pc-send .ico { transform: scaleX(-1); }
.pc-send:disabled { opacity: .55; cursor: progress; }
.pc.is-sending .pc-send .ico { animation: pc-dot 1s infinite; }
.pc-tiers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.pc-tier {
  display: grid;
  gap: 1px;
  justify-items: center;
  padding: 6px 4px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-1);
  color: var(--ink-2);
  cursor: pointer;
  font: inherit;
}
.pc-tier b { font-size: 12.5px; }
.pc-tier span { font-size: 11.5px; color: var(--ink-3); }
.pc-tier.is-active { border-color: var(--accent); background: var(--accent-a12); color: var(--ink); box-shadow: 0 0 0 2px var(--accent-a18); }
.pc-tier.is-active span { color: var(--accent-soft); }
.pc-tier:disabled { opacity: .38; cursor: not-allowed; }
.pc-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--ink-3); }
.pc-meta b { color: var(--ink); }
.pc-meta .is-over { color: var(--danger); font-weight: var(--fw-bold); }
.pc-foot__row { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); }
.pc-wallet { display: inline-flex; align-items: center; gap: 5px; }
.pc-wallet .ico { width: 14px; height: 14px; }
.pc-wallet b { color: var(--ink-2); }
.pc-link {
  border: 0;
  background: none;
  padding: 2px 4px;
  font: inherit;
  font-size: 12px;
  color: var(--accent-soft);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.pc-link .ico { width: 14px; height: 14px; }
.pc-link--muted { color: var(--ink-3); }
.pc-free {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 12px;
  line-height: var(--lh-snug);
  color: var(--ink-2);
  background: var(--success-bg);
  border: 1px solid var(--success-line);
}
.pc-free span { flex: 1; }
.pc-free .ico { flex: none; width: 16px; height: 16px; color: var(--success); }
.pc-free--muted { background: var(--surface-1); border-color: var(--line); }
.pc-confirm {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--warning-bg);
  border: 1px solid var(--warning-line);
  font-size: 12.5px;
}
.pc-confirm[hidden] { display: none; }
.pc-confirm p { margin: 0; line-height: var(--lh-snug); }
.pc-confirm .ico { width: 15px; height: 15px; vertical-align: -3px; color: var(--warning); }
.pc-confirm__actions { display: flex; justify-content: flex-end; gap: 6px; }
.pc-check { display: inline-flex; gap: 6px; align-items: center; color: var(--ink-3); font-size: 12px; }
.pc-alert {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: var(--lh-snug);
  color: var(--ink-2);
  background: var(--surface-1);
  border: 1px solid var(--line);
}
.pc-alert .ico { flex: none; width: 16px; height: 16px; margin-top: 2px; }
.pc-alert--warn { background: var(--warning-bg); border-color: var(--warning-line); }
.pc-alert--off { background: var(--warning-bg); border-color: var(--warning-line); color: var(--ink); }
.pc-alert--off .ico { color: var(--warning); }

.pc-off {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 28px 14px 18px;
  text-align: center;
}
.pc-off__icon {
  width: 64px;
  height: 64px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #94a3b8, #64748b);
  box-shadow: 0 14px 30px -14px rgba(71, 85, 105, .8);
}
.pc-off__icon .ico { width: 28px; height: 28px; }
.pc-off__title { margin: 6px 0 0; font-weight: var(--fw-bold); font-size: var(--fs-md, 1rem); color: var(--ink); }
.pc-off__text { margin: 0; max-width: 32ch; font-size: var(--fs-sm); line-height: var(--lh-normal); color: var(--ink-2); }
.pc-off .btn { margin-top: 6px; }

.pc-history { display: grid; gap: 10px; }
.pc-history h3 { margin: 4px 0 2px; font-size: var(--fs-md); }
.pc-history > .pc-link, .pc-thread > .pc-link { justify-self: start; align-self: flex-start; }
.pc-hitem {
  display: grid;
  gap: 4px;
  text-align: start;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.pc-hitem:hover { border-color: var(--accent-a45); }
.pc-hitem__top { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: var(--fs-sm); }
.pc-hitem__preview { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-hitem__meta { font-size: 11.5px; color: var(--ink-3); }

@media (max-width: 899px) {
  .pc {
    --pc-gap: 14px;
    --pc-bubble: 56px;
    bottom: calc(var(--tabbar-h) + 6px + env(safe-area-inset-bottom));
  }
  .pc.pc--lift { bottom: calc(var(--tabbar-h) + 88px + env(safe-area-inset-bottom)); }
  .pc-tuck { opacity: .85; }
  .pc-bubble__label { display: none; }
}
@media (max-width: 699px) {
  .pc-panel, .pc.is-large .pc-panel {
    top: 0; right: 0; bottom: 0; left: 0;
    width: 100% !important;
    height: 100% !important;
    height: 100vh !important;
    height: 100dvh !important;
    border-radius: 0;
    border: 0;
    padding-top: env(safe-area-inset-top);
    background: var(--surface-1);
  }
  .pc-only-desktop, .pc-resize { display: none; }
  .pc-head { padding-top: 12px; }
  .pc-tier b { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .pc-panel, .pc-bubble { transition: none; }
  .pc.has-unread .pc-bubble::after, .pc-dots i { animation: none; }
}

.pcd {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: var(--sp-4);
  height: calc(100vh - var(--topbar-h) - 96px);
  height: calc(100dvh - var(--topbar-h) - 96px);
  min-height: 540px;
}
.pcd-list, .pcd-chat {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-radius: var(--r-lg, 22px);
  background: var(--surface-1);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.pcd-list__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.pcd-presence { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.pcd-presence input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pcd-switch {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: var(--surface-4);
  transition: background var(--dur-fast);
}
.pcd-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  inset-inline-start: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-xs);
  transition: inset-inline-start var(--dur-fast) var(--ease-out);
}
.pcd-presence input:checked + .pcd-switch { background: var(--success); }
.pcd-presence input:checked + .pcd-switch::after { inset-inline-start: 21px; }
.pcd-presence input:focus-visible + .pcd-switch { outline: 2px solid var(--accent); outline-offset: 2px; }
.pcd-off {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 10px 12px 0;
  padding: 9px 11px;
  border-radius: var(--r-md, 12px);
  background: var(--warning-bg);
  border: 1px solid var(--warning-line);
  font-size: var(--fs-xs, .78rem);
  line-height: 1.7;
  color: var(--ink);
}
.pcd-off[hidden] { display: none; }
.pcd-off .ico { flex: none; width: 15px; height: 15px; margin-top: 3px; color: var(--warning); }
.pcd-tabs { margin: 10px 12px 4px; overflow: hidden; }
.pcd-tabs .segmented__item { flex: 1 1 0; min-width: 0; padding-right: 6px; padding-left: 6px; font-size: 12.5px; white-space: nowrap; justify-content: center; }
.pcd-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  margin-inline-start: 4px;
  border-radius: 999px;
  font-size: 11px;
  background: var(--surface-3);
}
.pcd-count.is-hot { background: var(--danger); color: #fff; }
.pcd-items { flex: 1; overflow-y: auto; padding: 6px 8px 12px; display: grid; align-content: start; gap: 6px; }
.pcd-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  width: 100%;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.pcd-item:hover { background: var(--surface-2); }
.pcd-item.is-active { background: var(--accent-a12); border-color: var(--accent-a28); }
.pcd-item.is-waiting .pcd-item__avatar { box-shadow: 0 0 0 2px var(--surface-1), 0 0 0 4px var(--warning); }
.pcd-item__avatar {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: var(--fw-bold);
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
}
.pcd-item__avatar--lg { width: 44px; height: 44px; }
.pcd-item__body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.pcd-item__top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.pcd-item__top b { font-size: var(--fs-sm); }
.pcd-item__top time { flex: none; font-size: 11px; color: var(--ink-3); }
.pcd-item__ctx { font-size: 11.5px; color: var(--ink-3); }
.pcd-item__preview { font-size: 12.5px; color: var(--ink-2); }
.pcd-item__preview em { color: var(--accent-soft); font-style: normal; }
.pcd-item__tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.pcd-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  color: var(--ink-2);
  background: var(--surface-3);
}
.pcd-tag .ico { width: 11px; height: 11px; }
.pcd-tag--wait { color: var(--warning); background: var(--warning-bg); }
.pcd-none { display: grid; justify-items: center; gap: 8px; padding: 40px 16px; text-align: center; color: var(--ink-3); font-size: var(--fs-sm); }
.pcd-none .ico { width: 30px; height: 30px; opacity: .6; }

.pcd-empty { margin: auto; display: grid; justify-items: center; gap: 8px; max-width: 420px; padding: 24px; text-align: center; }
.pcd-empty p { margin: 0; }
.pcd-empty__icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: var(--shadow-accent);
}
.pcd-empty__icon .ico { width: 30px; height: 30px; }
.pcd-loading { padding: 16px; }
.pcd-chat__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.pcd-chat__actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.pcd-back { display: none; }
.pcd-banner {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 16px;
  font-size: 12.5px;
  color: var(--ink-2);
  background: var(--accent-a08);
  border-bottom: 1px solid var(--line);
}
.pcd-banner .ico { flex: none; width: 16px; height: 16px; color: var(--accent-soft); }
.pcd-thread {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background:
    radial-gradient(520px 300px at 0% 0%, var(--accent-a08), transparent 70%),
    var(--surface-1);
}
.pcd-thread .pc-msg { max-width: 78%; }
.pcd-typing { padding-right: 20px; padding-left: 20px; }
.pcd-q {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 11.5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
}
.pcd-q--wait { color: var(--warning); border-color: var(--warning-line); background: var(--warning-bg); }
.pcd-q--ok { color: var(--success); border-color: var(--success-line); background: var(--success-bg); }
.pcd-q--back { color: var(--accent-3); }
.pcd-pending { display: grid; gap: 6px; padding: 8px 16px; border-top: 1px solid var(--warning-line); background: var(--warning-bg); }
.pcd-pending__row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 10px; font-size: 12.5px; }
.pcd-pending__row > span:first-child { flex: 1 1 240px; min-width: 0; line-height: var(--lh-snug); }
.pcd-pending__row .ico { width: 14px; height: 14px; vertical-align: -2px; color: var(--warning); }
.pcd-pending__actions { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; margin-inline-start: auto; }
.pcd-pending select { width: auto; flex: none; height: 34px; padding: 0 10px; padding-inline-end: 28px; font-size: 12.5px; border-radius: 10px; max-width: 210px; }
.pcd-compose { display: grid; gap: 8px; padding: 10px 16px 12px; border-top: 1px solid var(--line); background: var(--surface-2); }
.pcd-compose .pc-input { max-height: 180px; min-height: 56px; }
.pcd-compose__row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

@media (max-width: 899px) {
  .pcd { grid-template-columns: 1fr; height: calc(100vh - var(--topbar-h) - var(--tabbar-h) - 40px); height: calc(100dvh - var(--topbar-h) - var(--tabbar-h) - 40px); min-height: 460px; }
  .pcd-chat { display: none; }
  .pcd.is-chatting .pcd-list { display: none; }
  .pcd.is-chatting .pcd-chat { display: flex; }
  .pcd-back { display: inline-grid; }
  .pcd-thread .pc-msg { max-width: 88%; }
  .pcd-chat__head { flex-wrap: wrap; }
  .pcd-chat__actions { width: 100%; justify-content: flex-start; }
}

.pca-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--sp-3); }
.pca-card { display: grid; gap: var(--sp-3); align-content: start; }
.pca-card.is-off { opacity: .72; }
.pca-avatar {
  position: relative;
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: var(--fw-bold);
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.pca-online {
  position: absolute;
  bottom: -2px;
  inset-inline-end: -2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--success);
  border: 2px solid var(--surface-1);
}
.pca-bio { margin: 0; line-height: var(--lh-snug); }
.pca-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.pca-stats span {
  display: grid;
  gap: 1px;
  justify-items: center;
  padding: 8px 4px;
  border-radius: 12px;
  font-size: 11px;
  color: var(--ink-3);
  background: var(--surface-2);
  text-align: center;
}
.pca-stats b { font-size: var(--fs-md); color: var(--ink); }
.pca-stats__wide { grid-column: 1 / -1; }
.pca-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); }
@media (max-width: 760px) { .pca-fields { grid-template-columns: 1fr; } }
.pca-tiers { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--sp-2); }
.pca-tier { display: grid; gap: 3px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.pca-tier__price { font-size: var(--fs-lg); font-weight: var(--fw-bold); color: var(--accent-soft); }
.pca-transcript {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 12px;
  border-radius: 16px;
  background: var(--surface-2);
}

.pca-switch {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  border-inline-start: 4px solid var(--success);
}
.pca-switch.is-off { border-inline-start-color: var(--warning); background: var(--warning-bg); }
.pca-switch__icon {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  box-shadow: 0 10px 24px -12px rgba(22, 163, 74, .8);
}
.pca-switch.is-off .pca-switch__icon { background: linear-gradient(135deg, #94a3b8, #64748b); box-shadow: none; }
.pca-switch__icon .ico { width: 22px; height: 22px; }
.pca-switch__text { flex: 1 1 auto; min-width: 0; }
.pca-switch__text p { margin: 0; line-height: var(--lh-normal); }
.pca-switch__title { display: flex; align-items: center; gap: 8px; font-weight: var(--fw-bold); margin-bottom: 2px !important; }
.pca-switch__control { flex: none; transform: scale(1.15); }
@media (max-width: 560px) {
  .pca-switch { flex-wrap: wrap; }
  .pca-switch__icon { width: 40px; height: 40px; }
  .pca-switch__text { flex-basis: calc(100% - 110px); }
}
.pca-quote {
  margin: 0;
  padding: 10px 14px;
  border-inline-start: 3px solid var(--warning);
  border-radius: 10px;
  background: var(--surface-2);
  font-size: var(--fs-sm);
  line-height: var(--lh-normal);
  color: var(--ink);
}

@media (min-width: 900px) { .pca-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.pc-pending { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.pc-msg.is-pending .pc-msg__bubble { opacity: .78; box-shadow: none; }
.pc-msg__state { font-size: 11px; color: var(--ink-3); padding-right: 6px; padding-left: 6px; }
.pc-consent[hidden] { display: none; }
.pc-consent {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 16px 14px 14px;
  border-radius: 18px;
  text-align: center;
  background: var(--surface-1);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-sm);
  animation: pc-consent-in var(--dur-base) var(--ease-out);
}
.pc-consent__icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--pc-grad);
  box-shadow: 0 10px 22px -12px rgba(124, 108, 255, .8);
}
.pc-consent__icon .ico { width: 20px; height: 20px; }
.pc-consent__title { margin: 2px 0 0; font-weight: var(--fw-bold); font-size: var(--fs-sm); color: var(--ink); }
.pc-consent p { margin: 0; font-size: 12.5px; line-height: var(--lh-normal); color: var(--ink-2); }
.pc-consent__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 4px; }
.pc-consent--funds .pc-consent__icon { background: linear-gradient(135deg, #f59e0b, #ea580c); }
@keyframes pc-consent-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.pc-alert[hidden] { display: none; }
.pc-alert .pc-link { margin-inline-start: 4px; }
.pc-foot:empty { display: none; }

.pc-msg--ai .pc-msg__who { display: inline-flex; align-items: center; gap: 5px; color: var(--accent-3, var(--accent-soft)); }
.pc-msg--ai .pc-msg__who .ico { width: 13px; height: 13px; }
.pc-ai-tag {
  display: inline-block;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: var(--fw-semibold);
  color: var(--accent);
  background: var(--accent-a08);
  border: 1px solid var(--line);
}
.pc-msg--them.pc-msg--ai .pc-msg__bubble {
  background: linear-gradient(160deg, var(--accent-a08), transparent 70%), var(--surface-3);
  border-color: var(--line-strong);
}
.pc-msg--me.pc-msg--ai .pc-msg__bubble {
  color: var(--ink);
  background: linear-gradient(160deg, var(--accent-a08), transparent 70%), var(--surface-2);
  border: 1px dashed var(--line-strong);
  box-shadow: none;
}

.pc-modebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 11.5px;
  color: var(--ink-3);
}
.pc-modebar > span { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.pc-modebar > span .ico { width: 13px; height: 13px; flex: none; }
.pc-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 5px 11px;
  border-radius: 999px;
  font: inherit;
  font-size: 12px;
  font-weight: var(--fw-semibold);
  color: var(--accent);
  background: var(--accent-a08);
  border: 1px solid var(--line-strong);
  cursor: pointer;
  transition: background var(--dur-fast, .15s) ease;
}
.pc-chip-btn:hover { background: var(--surface-3); }
.pc-chip-btn:focus-visible { outline: none; box-shadow: var(--ring, 0 0 0 3px var(--accent-a08)); }
.pc-chip-btn .ico { width: 14px; height: 14px; }
.pc-intro__hero--ai .pc-intro__icon { background: linear-gradient(135deg, var(--accent), var(--accent-3, var(--accent-2))); }
.pc-link--human { display: inline-flex; align-items: center; gap: 6px; justify-self: center; margin: 2px auto 10px; }
.pc-link--human .ico { width: 15px; height: 15px; }
.pc-consent--human .pc-consent__icon { background: linear-gradient(135deg, #10b981, #0ea5e9); }

.pc-crisis--live {
  position: sticky;
  top: 0;
  z-index: 2;
  margin-bottom: 10px;
  background: linear-gradient(var(--danger-bg), var(--danger-bg)), var(--surface-1);
  font-weight: var(--fw-medium, 500);
  box-shadow: 0 10px 24px -18px rgba(225, 29, 72, .7);
}

.pcd-alerts { display: grid; gap: 6px; margin-bottom: 10px; }
.pcd-alerts[hidden] { display: none; }
.pcd-alerts__title { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 12.5px; font-weight: var(--fw-bold); color: var(--danger); }
.pcd-alerts__title .ico { width: 15px; height: 15px; }
.pcd-alert {
  display: grid;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 14px;
  background: var(--danger-bg);
  border: 1px solid var(--danger-line);
}
.pcd-alert.is-new { animation: pcd-alert-pulse 1.6s ease-in-out infinite; }
@keyframes pcd-alert-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(225, 29, 72, .0); } 50% { box-shadow: 0 0 0 4px rgba(225, 29, 72, .18); } }
.pcd-alert__main {
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "level name time" "reason reason reason";
  gap: 2px 8px;
  align-items: center;
}
.pcd-alert__main:focus-visible { outline: 2px solid var(--danger); outline-offset: 3px; border-radius: 8px; }
.pcd-alert__level {
  grid-area: level;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: var(--fw-bold);
  color: #fff;
  background: var(--danger);
}
.pcd-alert--high .pcd-alert__level { background: #ea580c; }
.pcd-alert__main b { grid-area: name; font-size: 12.5px; }
.pcd-alert__main time { grid-area: time; font-size: 11px; color: var(--ink-3); }
.pcd-alert__reason { grid-area: reason; font-size: 11.5px; color: var(--ink-2); }
.pcd-alert__actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.pcd-tag--crisis { color: var(--danger); background: var(--danger-bg); font-weight: var(--fw-semibold); }
.pcd-tag--ai { color: var(--accent); background: var(--accent-a08); }
.pcd-item.is-crisis { box-shadow: inset 3px 0 0 var(--danger); }
.pcd-crisis {
  display: grid;
  gap: 6px;
  padding: 8px 16px;
  background: var(--danger-bg);
  border-bottom: 1px solid var(--danger-line);
}
.pcd-crisis p { margin: 0; color: var(--ink-2); }
.pcd-crisis__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; font-size: 12.5px; }
.pcd-crisis__row .ico { width: 14px; height: 14px; color: var(--danger); vertical-align: -2px; }
.pcd-crisis__actions { display: flex; gap: 6px; }
.pcd-banner--ai .ico { color: var(--accent); }

.pca-ai {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: var(--sp-3, 12px);
}
.pca-ai__icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex: none;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-3, var(--accent-2)));
}
.pca-ai.is-off .pca-ai__icon { filter: grayscale(.8); opacity: .7; }
.pca-ai__icon .ico { width: 20px; height: 20px; }
.pca-ai__text p { margin: 0; }
.pca-ai__text p.pca-ai__usage { margin-top: 4px; line-height: 1.8; }
.pca-alerts-card {
  display: grid;
  gap: 6px;
  justify-items: start;
  padding: 12px 16px;
  margin-bottom: var(--sp-3, 12px);
  background: var(--danger-bg);
  border-color: var(--danger-line);
}
.pca-alerts-card p { margin: 0; }
.pca-alerts-card__title { display: flex; align-items: center; gap: 6px; font-weight: var(--fw-bold); color: var(--danger); }
.pca-alerts-card__title .ico { width: 16px; height: 16px; }
.pca-alert .list-item__avatar { color: var(--danger); background: var(--danger-bg); }
.pca-transcript-alerts { display: grid; gap: 4px; padding: 8px 12px; border-radius: 12px; background: var(--danger-bg); border: 1px solid var(--danger-line); }
.pca-transcript-alerts p { margin: 0; }
.pca-transcript-alerts .ico { width: 13px; height: 13px; color: var(--danger); vertical-align: -2px; }

@media (prefers-reduced-motion: reduce) {
  .pcd-alert.is-new { animation: none; }
}

.pcd-tabs .segmented__item { padding-right: 4px; padding-left: 4px; gap: 2px; }
.pcd-tabs .pcd-count { min-width: 18px; height: 18px; padding: 0 4px; margin-inline-start: 2px; font-size: 10.5px; }

.pc-context { display: grid; gap: 10px; }
.pc-context-hero {
  display: flex; align-items: center; gap: 10px; padding: 12px;
  border-radius: 18px; color: #fff;
  background: linear-gradient(135deg, var(--accent-deep), var(--accent-strong) 60%, var(--accent-2));
  box-shadow: var(--shadow-sm);
}
.pc-context-avatar {
  width: 44px; height: 44px; flex: 0 0 auto; display: grid; place-items: center;
  border-radius: 14px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.24);
}
.pc-context-avatar .ico { width: 21px; height: 21px; }
.pc-context-kicker { display: block; font-size: 10.5px; opacity: .75; }
.pc-context-hero h3 { margin: 2px 0 0; font-size: var(--fs-md); }
.pc-context-hero p { margin: 2px 0 0; font-size: 11.5px; opacity: .82; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-context-refresh { flex: 0 0 auto; }
.pc-context-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.pc-context-kpis > div {
  min-width: 0; padding: 9px 7px; border-radius: 12px; text-align: center;
  background: var(--surface-2); border: 1px solid var(--line);
}
.pc-context-kpis small { display: block; color: var(--ink-3); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-context-kpis b { display: block; margin-top: 2px; font-size: var(--fs-md); color: var(--ink); }
.pc-context-search {
  display: flex; align-items: center; gap: 7px; padding: 8px 10px; border-radius: 13px;
  background: var(--surface-2); border: 1px solid var(--line);
}
.pc-context-search > .ico { flex: 0 0 auto; width: 16px; height: 16px; color: var(--ink-3); }
.pc-context-search input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: 12px; }
.pc-context-access {
  display: flex; gap: 8px; align-items: flex-start; padding: 10px 11px; border-radius: 14px;
  background: var(--info-bg); border: 1px solid var(--info-line, var(--line)); color: var(--ink-2);
}
.pc-context-access.is-on { background: var(--success-bg); border-color: var(--success-line); }
.pc-context-access > .ico { flex: 0 0 auto; width: 16px; height: 16px; margin-top: 2px; color: var(--info); }
.pc-context-access.is-on > .ico { color: var(--success); }
.pc-context-access b { display: block; font-size: 11.5px; color: var(--ink); }
.pc-context-access small { display: block; margin-top: 3px; font-size: 10.8px; line-height: 1.55; }
.pc-context-class { border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.pc-context-class > summary {
  display: flex; align-items: center; gap: 8px; padding: 10px; cursor: pointer; list-style: none; min-width: 0;
}
.pc-context-class > summary::-webkit-details-marker { display: none; }
.pc-context-class > summary:hover { background: var(--surface-3); }
.pc-context-class__icon { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; color: var(--accent); background: var(--accent-a12); flex: 0 0 auto; }
.pc-context-class__icon .ico { width: 17px; height: 17px; }
.pc-context-class summary b { display: block; font-size: 12.5px; }
.pc-context-class summary small { display: block; margin-top: 2px; color: var(--ink-3); font-size: 10.5px; }
.pc-context-counts { display: inline-flex; gap: 3px; flex: 0 0 auto; }
.pc-context-counts em { min-width: 25px; padding: 3px 5px; border-radius: 999px; font-style: normal; text-align: center; font-size: 10px; color: var(--ink-2); background: var(--surface-3); border: 1px solid var(--line); }
.pc-context-class__body { display: grid; gap: 8px; padding: 0 10px 10px; }
.pc-context-section { display: grid; gap: 6px; }
.pc-context-section__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--ink-2); }
.pc-context-section__head b { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; }
.pc-context-section__head .ico { width: 14px; height: 14px; color: var(--accent); }
.pc-context-list { display: grid; gap: 5px; }
.pc-context-item { padding: 8px 9px; border-radius: 11px; background: var(--surface-1); border: 1px solid var(--line-soft); min-width: 0; }
.pc-context-item b { display: block; font-size: 11.5px; overflow-wrap: anywhere; }
.pc-context-item small { display: block; margin-top: 2px; color: var(--ink-3); font-size: 10px; line-height: 1.5; }
.pc-context-item p { margin: 4px 0 0; color: var(--ink-2); font-size: 10.8px; line-height: 1.55; }
.pc-context-files { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.pc-context-file { display: inline-flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%; padding: 3px 7px; border-radius: 8px; color: var(--ink-2); background: var(--surface-3); font-size: 9.8px; }
.pc-context-file .ico { width: 11px; height: 11px; flex: 0 0 auto; color: var(--accent); }
.pc-context-ask { justify-self: stretch; justify-content: center; margin-top: 2px; padding: 7px 8px; border-radius: 10px; background: var(--accent-a08); text-decoration: none; border: 1px dashed var(--accent-a28); }
.pc-context-empty { display: flex; align-items: center; gap: 6px; padding: 7px 8px; border-radius: 10px; background: var(--surface-1); color: var(--ink-3); font-size: 10.5px; }
.pc-context-empty .ico { width: 13px; height: 13px; color: var(--ink-3); }
.pc-context-no-classes { display: grid; justify-items: center; gap: 5px; padding: 24px 12px; text-align: center; color: var(--ink-2); border: 1px dashed var(--line-strong); border-radius: 14px; }
.pc-context-no-classes .ico { width: 28px; height: 28px; color: var(--accent); }
.pc-context-no-classes b { font-size: 12px; }
.pc-context-no-classes small { color: var(--ink-3); font-size: 10.5px; }
.pc-context-foot { display: flex; justify-content: space-between; gap: 8px; padding-top: 8px; border-top: 1px dashed var(--line-strong); color: var(--ink-3); font-size: 11px; }
.pc-context-foot span { display: inline-flex; align-items: center; gap: 4px; }
.pc-context-foot .ico { width: 14px; height: 14px; }
.pc-context-foot b { color: var(--ink); }
@media (max-width: 420px) {
  .pc-context-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pc-context-counts em { min-width: 22px; padding-right: 4px; padding-left: 4px; }
}

.pc-context-questions{display:grid;gap:8px;margin-top:10px}
.pc-context-question{padding:9px 10px;border:1px solid rgba(255,255,255,.08);border-radius:10px;background:rgba(255,255,255,.025)}
.pc-context-question p{margin:5px 0;line-height:1.7}
.pc-context-question small,.pc-context-question div{display:block;line-height:1.7;margin-top:3px}


@media (max-width: 420px) {
  .pc-panel { inset-inline-end: 8px; width: calc(100vw - 16px); max-width: calc(100vw - 16px); height: min(680px, calc(100vh - 16px)); height: min(680px, calc(100dvh - 16px)); max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); border-radius: 20px; }
  .pc-compose { gap: 6px; }
  .pc-input { padding-right: 11px; padding-left: 11px; }
  .pc-send { width: 42px; min-width: 42px; flex-basis: 42px; height: 42px; }
}

.pc-insights { display: grid; gap: 8px; margin: 2px 0 4px; }
.pc-insights__title {
  display: flex; align-items: center; gap: 6px; margin: 0;
  font-size: var(--fs-sm); font-weight: var(--fw-bold); color: var(--ink-1, inherit);
}
.pc-insights__title svg { width: 16px; height: 16px; color: var(--accent-soft); flex: none; }
.pc-insights__hint { margin: 0; font-size: var(--fs-2xs); color: var(--ink-3); }
.pc-insight {
  display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start;
  width: 100%; padding: 10px 12px; border-radius: 14px; text-align: start; cursor: pointer;
  font: inherit; color: inherit; background: var(--surface-2); border: 1px solid var(--line);
  transition: border-color .15s ease, transform .15s ease, background-color .15s ease;
}
.pc-insight:hover { border-color: var(--accent-soft); background: var(--surface-3); }
.pc-insight:active { transform: scale(.985); }
.pc-insight:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 2px; }
.pc-insight__icon {
  width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center;
  background: var(--info-bg); color: var(--info); flex: none;
}
.pc-insight__icon svg { width: 16px; height: 16px; }
.pc-insight__text { display: grid; gap: 2px; min-width: 0; }
.pc-insight__text b { font-size: var(--fs-sm); line-height: var(--lh-snug); overflow-wrap: anywhere; }
.pc-insight__text small { font-size: var(--fs-2xs); color: var(--ink-3); line-height: var(--lh-snug); overflow-wrap: anywhere; }
.pc-insight--urgent { border-color: var(--danger-line); }
.pc-insight--urgent .pc-insight__icon { background: var(--danger-bg); color: var(--danger); }
.pc-insight--warn { border-color: var(--warning-line); }
.pc-insight--warn .pc-insight__icon { background: var(--warning-bg); color: var(--warning); }
.pc-insight--good { border-color: var(--success-line); }
.pc-insight--good .pc-insight__icon { background: var(--success-bg); color: var(--success); }
@media (prefers-reduced-motion: reduce) { .pc-insight { transition: none; } .pc-insight:active { transform: none; } }

.pca-ai__test { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 10px; }
.pca-ai__test .btn { flex: none; }
.pca-ai__test .tiny { flex: 1 1 220px; min-width: 0; }
.pca-ai__result { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.pca-ai__result p { margin: 0 0 4px; }
.pca-ai__rows { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.pca-ai__row { display: grid; grid-template-columns: 18px 1fr; gap: 8px; align-items: start; font-size: var(--fs-sm); }
.pca-ai__row svg, .pca-ai__row .ico { width: 16px; height: 16px; margin-top: 3px; }
.pca-ai__row.is-ok svg, .pca-ai__row.is-ok .ico { color: var(--success); }
.pca-ai__row.is-fail svg, .pca-ai__row.is-fail .ico { color: var(--danger); }
.pca-ai__row small { display: block; margin-top: 2px; color: var(--ink-3); font-size: var(--fs-2xs); line-height: var(--lh-snug); }
.pca-ai__row code { display: block; margin-top: 4px; padding: 4px 6px; border-radius: 6px; background: var(--surface-3); font-size: 11.5px; overflow-wrap: anywhere; white-space: pre-wrap; text-align: left; }

.pc-msg { min-width: 0; }
.pc-msg__bubble { min-width: 0; max-width: 100%; }
.pc-msg__bubble .pc-table-wrap { max-width: 100%; }
.pc-msg__bubble .pc-chat-table { min-width: 280px; }
.pc-msg__bubble .pc-chat-table th,
.pc-msg__bubble .pc-chat-table td { overflow-wrap: anywhere; }
.pca-ai { align-items: flex-start; }
.pca-ai__text { min-width: 0; flex: 1 1 auto; }

.pc-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  margin-bottom: 12px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.pc-tab-btn {
  flex: 1 1 0;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 6px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 12px;
  font-weight: var(--fw-semibold);
  cursor: pointer;
  white-space: nowrap;
}
.pc-tab-btn .ico { width: 14px; height: 14px; flex: none; }
.pc-tab-btn span { overflow: hidden; text-overflow: ellipsis; }
.pc-tab-btn.is-on { background: var(--surface-1); color: var(--accent); box-shadow: var(--shadow-sm); }
.pc-tab-btn:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 1px; }

.pc-msg.is-live .pc-msg__bubble::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 14px;
  margin-inline-start: 3px;
  vertical-align: -2px;
  border-radius: 2px;
  background: var(--accent);
  animation: pc-caret 1s steps(2) infinite;
}
@keyframes pc-caret { 50% { opacity: 0; } }

.pc-sum-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px dashed var(--accent-soft);
  background: var(--accent-a12);
  color: var(--ink);
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.pc-sum-link .ico { width: 20px; height: 20px; flex: none; color: var(--accent); }
.pc-sum-link span { display: grid; gap: 2px; min-width: 0; }
.pc-sum-link b { font-size: 13px; }
.pc-sum-link small { font-size: 11.5px; color: var(--ink-2); line-height: var(--lh-snug); }
.pc-sum-link:hover { border-style: solid; }

.pc-sum-empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 22px 8px;
  text-align: center;
}
.pc-sum-empty > .ico { width: 34px; height: 34px; color: var(--accent); }
.pc-sum-empty p { margin: 0; font-size: 12.5px; line-height: var(--lh-base); color: var(--ink-2); }
.pc-sum {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  background: var(--surface-1);
  border: 1px solid var(--line);
}
.pc-sum__head { display: grid; gap: 2px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.pc-sum__kicker { font-size: 11px; color: var(--accent); font-weight: var(--fw-bold); }
.pc-sum__head h3 { margin: 0; font-size: var(--fs-md); }
.pc-sum__head small { font-size: 11px; color: var(--ink-3); }
.pc-sum__headline { margin: 0; font-size: 13.5px; font-weight: var(--fw-bold); line-height: var(--lh-snug); }
.pc-sum__overview { margin: 0; font-size: 12.5px; line-height: var(--lh-base); color: var(--ink-2); }
.pc-sum__part h4 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px;
  font-size: 12.5px;
  color: var(--ink);
}
.pc-sum__part h4 .ico { width: 15px; height: 15px; color: var(--accent); }
.pc-sum__part ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.pc-sum__part li {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 12.5px;
  line-height: var(--lh-snug);
}
.pc-sum__part li small { font-size: 11.5px; color: var(--ink-2); }
.pc-sum__tip { color: var(--accent) !important; }
.pc-sum__note { margin: 0; font-size: 11.5px; color: var(--ink-3); }
.pc-sum__disclaimer {
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  line-height: var(--lh-snug);
  color: var(--ink-3);
}
.pc-sum-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pc-sum-fine { margin: 8px 0 0; font-size: 11px; }
.pc-alert--info { background: var(--accent-a12); border-color: var(--accent-soft); margin: 0 0 10px; }

.pc-access { display: grid; gap: 12px; }
.pc-access__main { align-items: flex-start; }
.pc-access__main b { font-size: 13px; line-height: var(--lh-snug); }
.pc-access__text { margin: 0; font-size: 12.5px; line-height: var(--lh-base); color: var(--ink-2); }
.pc-access__never {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 12px;
  line-height: var(--lh-snug);
}
.pc-access__never .ico { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--success); }
.pc-access__group { margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; display: grid; gap: 8px; }
.pc-access__group legend { padding: 0 6px; font-size: 12px; font-weight: var(--fw-bold); color: var(--ink-2); }
.pc-access__item { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; line-height: var(--lh-snug); cursor: pointer; }
.pc-access__item input { accent-color: var(--accent); width: 16px; height: 16px; flex: none; margin-top: 1px; }
.pc-access__item--sub { padding-inline-start: 22px; }

.pc-print { display: none; }
@media print {
  body.pc-printing > *:not(.pc-print) { display: none !important; }
  body.pc-printing { background: #fff !important; }
  body.pc-printing .pc-print { display: block; padding: 10mm; color: #111; font-size: 12pt; }
  body.pc-printing .pc-sum { border: 0; padding: 0; gap: 14px; background: #fff; }
  body.pc-printing .pc-sum__head h3 { font-size: 18pt; }
  body.pc-printing .pc-sum__headline { font-size: 13pt; }
  body.pc-printing .pc-sum__overview,
  body.pc-printing .pc-sum__part li { font-size: 11pt; color: #111; }
  body.pc-printing .pc-sum__part li { background: #f4f4f6; break-inside: avoid; }
  body.pc-printing .pc-sum__part li small,
  body.pc-printing .pc-sum__note,
  body.pc-printing .pc-sum__disclaimer { font-size: 9.5pt; color: #444; }
  body.pc-printing .pc-sum__part h4 { font-size: 12pt; }
  body.pc-printing .pc-sum__part { break-inside: avoid; }
}

@supports not ((inset-inline-start: 0) or (inset-inline-end: 0)) {
  html[dir="rtl"] .pc { left: var(--pc-gap); }
  html[dir="ltr"] .pc { right: var(--pc-gap); }
  html[dir="rtl"] .pc-bubble__off { right: -2px; }
  html[dir="ltr"] .pc-bubble__off { left: -2px; }
  html[dir="rtl"] .pc-bubble__dot { right: 3px; }
  html[dir="ltr"] .pc-bubble__dot { left: 3px; }
  html[dir="rtl"] .pc-bubble__badge,
html[dir="rtl"] .pc-tab__badge { left: -4px; }
  html[dir="ltr"] .pc-bubble__badge,
html[dir="ltr"] .pc-tab__badge { right: -4px; }
  html[dir="rtl"] .pc-bubble__label { left: calc(100% + 12px); }
  html[dir="ltr"] .pc-bubble__label { right: calc(100% + 12px); }
  html[dir="rtl"] .pc-tuck { right: -10px; }
  html[dir="ltr"] .pc-tuck { left: -10px; }
  html[dir="rtl"] .pc-tab { left: 0; }
  html[dir="ltr"] .pc-tab { right: 0; }
  html[dir="rtl"] .pc.pc--side:not(.is-open) .pc-tab { left: 12px; }
  html[dir="ltr"] .pc.pc--side:not(.is-open) .pc-tab { right: 12px; }
  html[dir="rtl"] .pc-panel { left: var(--pc-gap); }
  html[dir="ltr"] .pc-panel { right: var(--pc-gap); }
  html[dir="rtl"] .pc-resize { right: 0; }
  html[dir="ltr"] .pc-resize { left: 0; }
  html[dir="rtl"] .pc-resize::before { right: 6px; border-right: 2px solid rgba(255, 255, 255, .55); border-top-right-radius: 3px; }
  html[dir="ltr"] .pc-resize::before { left: 6px; border-left: 2px solid rgba(255, 255, 255, .55); border-top-left-radius: 3px; }
  html[dir="rtl"] .pc-head { padding-right: 18px; }
  html[dir="ltr"] .pc-head { padding-left: 18px; }
  html[dir="rtl"] .pc-head__dot { left: 0; }
  html[dir="ltr"] .pc-head__dot { right: 0; }
  html[dir="rtl"] .pc-msg--them .pc-msg__bubble { border-top-right-radius: 6px; }
  html[dir="ltr"] .pc-msg--them .pc-msg__bubble { border-top-left-radius: 6px; }
  html[dir="rtl"] .pc-msg--me .pc-msg__bubble { border-top-left-radius: 6px; }
  html[dir="ltr"] .pc-msg--me .pc-msg__bubble { border-top-right-radius: 6px; }
  html[dir="rtl"] .pcd-switch::after { right: 3px; }
  html[dir="ltr"] .pcd-switch::after { left: 3px; }
  html[dir="rtl"] .pcd-presence input:checked + .pcd-switch::after { right: 21px; }
  html[dir="ltr"] .pcd-presence input:checked + .pcd-switch::after { left: 21px; }
  html[dir="rtl"] .pcd-count { margin-right: 4px; }
  html[dir="ltr"] .pcd-count { margin-left: 4px; }
  html[dir="rtl"] .pcd-pending__actions { margin-right: auto; }
  html[dir="ltr"] .pcd-pending__actions { margin-left: auto; }
  html[dir="rtl"] .pcd-pending select { padding-left: 28px; }
  html[dir="ltr"] .pcd-pending select { padding-right: 28px; }
  html[dir="rtl"] .pca-online { left: -2px; }
  html[dir="ltr"] .pca-online { right: -2px; }
  html[dir="rtl"] .pca-switch { border-right: 4px solid var(--success); }
  html[dir="ltr"] .pca-switch { border-left: 4px solid var(--success); }
  html[dir="rtl"] .pca-switch.is-off { border-right-color: var(--warning); }
  html[dir="ltr"] .pca-switch.is-off { border-left-color: var(--warning); }
  html[dir="rtl"] .pca-quote { border-right: 3px solid var(--warning); }
  html[dir="ltr"] .pca-quote { border-left: 3px solid var(--warning); }
  html[dir="rtl"] .pc-alert .pc-link { margin-right: 4px; }
  html[dir="ltr"] .pc-alert .pc-link { margin-left: 4px; }
  html[dir="rtl"] .pcd-tabs .pcd-count { margin-right: 2px; }
  html[dir="ltr"] .pcd-tabs .pcd-count { margin-left: 2px; }
  @media (max-width: 420px) { html[dir="rtl"] .pc-panel { left: 8px; } }
  @media (max-width: 420px) { html[dir="ltr"] .pc-panel { right: 8px; } }
  html[dir="rtl"] .pc-msg.is-live .pc-msg__bubble::after { margin-right: 3px; }
  html[dir="ltr"] .pc-msg.is-live .pc-msg__bubble::after { margin-left: 3px; }
  html[dir="rtl"] .pc-access__item--sub { padding-right: 22px; }
  html[dir="ltr"] .pc-access__item--sub { padding-left: 22px; }
}

.fin {
  --fin-ai: #8b5cf6;
  --fin-storage: #0ea5e9;
  --fin-classes: #f59e0b;
  --fin-psychology: #ec4899;
  --fin-counseling: #14b8a6;
  --fin-academic: #6366f1;
  --fin-festival: #f97316;
  --fin-other: #94a3b8;
  --fin-io: #22c55e;
}
.fin-g--ai { --fin-c: var(--fin-ai); }
.fin-g--storage { --fin-c: var(--fin-storage); }
.fin-g--classes { --fin-c: var(--fin-classes); }
.fin-g--psychology { --fin-c: var(--fin-psychology); }
.fin-g--counseling { --fin-c: var(--fin-counseling); }
.fin-g--academic { --fin-c: var(--fin-academic); }
.fin-g--festival { --fin-c: var(--fin-festival); }
.fin-g--other { --fin-c: var(--fin-other); }
.fin-g--io { --fin-c: var(--fin-io); }

.fin-note { margin: 0 0 var(--sp-3); line-height: var(--lh-normal); }
.fin-empty { display: grid; justify-items: center; gap: 8px; padding: var(--sp-6) var(--sp-3); color: var(--ink-3); text-align: center; }
.fin-empty .ico { width: 26px; height: 26px; opacity: .7; }
.fin-empty p { margin: 0; font-size: var(--fs-sm); }

.fin-period { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); }
.fin-period__row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); justify-content: space-between; }
.fin-period__title { display: inline-flex; align-items: center; gap: 8px; font-weight: var(--fw-bold); }
.fin-period__title .ico { width: 18px; height: 18px; color: var(--accent-soft); }
.fin-period__chips { flex: 1 1 520px; min-width: 0; max-width: 100%; overflow-x: auto; scrollbar-width: thin; }
.fin-period__chips .segmented__item { white-space: nowrap; }
.fin-period__label { margin: 0; font-size: var(--fs-sm); color: var(--ink-2); }
.fin-custom { display: grid; grid-template-columns: 1fr 1fr auto; gap: var(--sp-3); align-items: end; }
.fin-custom[hidden] { display: none; }
.fin-custom .field { margin: 0; }
.fin-custom .field__hint { display: none; }
@media (max-width: 640px) { .fin-custom { grid-template-columns: 1fr; } }

.fin-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 820px) { .fin-kpis { grid-template-columns: 1fr 1fr; } }
.fin .stat__value { overflow-wrap: normal; word-break: keep-all; }
.fin .stat__label { white-space: normal; }

.fin-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: var(--sp-4); align-items: start; }
@media (max-width: 980px) { .fin-grid { grid-template-columns: 1fr; } }

.fin-services { display: grid; gap: var(--sp-2); }
.fin-service {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
  padding: 10px 12px 8px;
  display: grid;
  gap: 7px;
}
.fin-service__head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: start;
  cursor: pointer;
  font: inherit;
}
.fin-service__head:hover .fin-service__name b { color: var(--accent-soft); }
.fin-service__icon {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--fin-c);
  box-shadow: 0 8px 18px -10px var(--fin-c);
}
.fin-service__icon .ico { width: 19px; height: 19px; }
.fin-service__name { flex: 1 1 auto; min-width: 0; display: grid; gap: 1px; }
.fin-service__name b { font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color var(--dur-fast); }
.fin-service__name small { font-size: var(--fs-xs); color: var(--ink-3); }
.fin-service__amount { flex: none; display: grid; justify-items: end; gap: 1px; text-align: end; }
.fin-service__amount b { font-size: var(--fs-sm); }
.fin-service__amount small { font-size: var(--fs-xs); color: var(--ink-3); }
.fin-bar { display: block; height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.fin-bar span { display: block; height: 100%; border-radius: inherit; background: var(--fin-c); }
.fin-service__more summary {
  cursor: pointer;
  font-size: var(--fs-xs);
  color: var(--ink-3);
  list-style-position: inside;
}
.fin-service__more[open] summary { margin-bottom: 8px; }
.fin-refund { color: var(--warning-ink, var(--warning)); }
.fin-kv { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 0 0 8px; }
.fin-kv div { padding: 6px 8px; border-radius: 10px; background: var(--surface-1); border: 1px solid var(--line-soft); }
.fin-kv dt { font-size: 11px; color: var(--ink-3); }
.fin-kv dd { margin: 0; font-size: var(--fs-xs); font-weight: var(--fw-semibold); }
@media (max-width: 560px) { .fin-kv { grid-template-columns: 1fr 1fr; } }
.fin-reasons { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.fin-reasons li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: var(--fs-xs);
  background: var(--surface-1);
}
.fin-reasons li span:nth-child(2) { color: var(--ink-3); }
.fin-total { margin: var(--sp-3) 0 0; font-size: var(--fs-sm); color: var(--ink-2); text-align: end; }

.fin-income { list-style: none; margin: 0 0 var(--sp-3); padding: 0; display: grid; gap: var(--sp-2); }
.fin-income li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.fin-income li.is-revenue { border-color: var(--success-line); background: var(--success-bg); }
.fin-income__icon {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--surface-3);
  color: var(--ink-2);
}
.fin-income li.is-revenue .fin-income__icon { background: var(--success); color: #fff; }
.fin-income__icon .ico { width: 17px; height: 17px; }
.fin-income__name { flex: 1 1 auto; min-width: 0; display: grid; }
.fin-income__name b { font-size: var(--fs-sm); }
.fin-income__name small { font-size: var(--fs-xs); color: var(--ink-3); }
.fin-income__amount { display: grid; justify-items: end; gap: 3px; }
.fin-income__amount b { font-size: var(--fs-sm); white-space: nowrap; }

.fin-legend { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--ink-3); }
.fin-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-inline-start: 6px; }
.fin-legend__spent { background: var(--accent); }
.fin-legend__rev { background: var(--success); }
.fin-chart {
  display: flex;
  align-items: stretch;
  gap: 6px;
  height: 190px;
  padding: 8px 4px 0;
  overflow-x: auto;
  scrollbar-width: thin;
}
.fin-chart__col { flex: 1 0 22px; display: grid; grid-template-rows: 1fr auto; gap: 6px; min-width: 22px; }
.fin-chart.is-dense .fin-chart__col { flex-basis: 14px; min-width: 14px; gap: 4px; }
.fin-chart__bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  border-bottom: 1px solid var(--line);
}
.fin-chart__bar { width: 44%; max-width: 16px; border-radius: 4px 4px 0 0; }
.fin-chart__bar--spent { background: linear-gradient(180deg, var(--accent-soft), var(--accent)); }
.fin-chart__bar--rev { background: linear-gradient(180deg, #4ade80, var(--success)); }
.fin-chart__label { font-size: 10px; color: var(--ink-3); text-align: center; white-space: nowrap; min-height: 14px; }

.fin-top__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.fin-top__list button {
  display: grid;
  grid-template-columns: 30px minmax(0, 1.4fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
  transition: border-color var(--dur-fast), background var(--dur-fast);
}
.fin-top__list button:hover { border-color: var(--accent-a45); background: var(--surface-3); }
.fin-rank {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  background: var(--accent-a18);
  color: var(--accent-soft);
}
.fin-top__list li:first-child .fin-rank { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; }
.fin-top__where { display: grid; font-size: var(--fs-xs); color: var(--ink-2); min-width: 0; }
.fin-top__where small { color: var(--ink-3); }
.fin-top__amount { font-size: var(--fs-sm); white-space: nowrap; }
@media (max-width: 600px) {
  .fin-top__list button { grid-template-columns: 28px minmax(0, 1fr) auto; }
  .fin-top__where { display: none; }
}

.fin-who { display: grid; gap: 1px; min-width: 0; }
.fin-who__name { font-size: var(--fs-sm); font-weight: var(--fw-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fin-who__sub { font-size: var(--fs-xs); color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.fin-filters { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, .8fr); gap: var(--sp-2); margin-bottom: var(--sp-3); }
.fin-dir { grid-column: 1 / -1; overflow-x: auto; scrollbar-width: thin; }
.fin-dir .segmented__item { white-space: nowrap; }
.fin-search { position: relative; display: block; }
.fin-search > .ico { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--ink-3); pointer-events: none; }
.fin-search .input { padding-inline-start: 38px; width: 100%; }
@media (max-width: 640px) { .fin-filters { grid-template-columns: minmax(0, 1fr); } }
.fin-person-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--sp-3);
  padding: 8px 12px;
  border-radius: var(--r-md);
  background: var(--accent-a12);
  border: 1px solid var(--accent-a28);
  font-size: var(--fs-sm);
}
.fin-person-filter[hidden] { display: none; }
.fin-person-filter > span { flex: 1 1 auto; }
.fin-person-filter .ico { width: 16px; height: 16px; }
.fin-sums { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: var(--sp-2); font-size: var(--fs-xs); color: var(--ink-2); }
.fin-sums:empty { display: none; }
.fin-sums span { display: inline-flex; align-items: center; gap: 4px; }
.fin-sums .ico { width: 14px; height: 14px; }

.fin-table { display: grid; gap: 4px; }
.fin-tr {
  display: grid;
  grid-template-columns: 128px minmax(0, 1.1fr) minmax(0, 1.5fr) 104px 96px minmax(0, .8fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
  transition: border-color var(--dur-fast), background var(--dur-fast);
}
button.fin-tr:hover { border-color: var(--accent-a45); background: var(--surface-3); }
.fin-tr--head {
  cursor: default;
  background: none;
  padding-top: 4px; padding-bottom: 4px;
  font-size: var(--fs-xs);
  color: var(--ink-3);
  font-weight: var(--fw-semibold);
}
.fin-td { min-width: 0; }
.fin-td--when { font-size: var(--fs-xs); color: var(--ink-2); }
.fin-td--where { display: grid; gap: 3px; }
.fin-td--where small { font-size: var(--fs-xs); color: var(--ink-3); }
.fin-where-chip { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-size: var(--fs-sm); }
.fin-where-chip .ico {
  flex: none;
  width: 22px;
  height: 22px;
  padding: 4px;
  border-radius: 7px;
  color: #fff;
  background: var(--fin-c, var(--fin-other));
}
.fin-where-chip b { font-weight: var(--fw-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fin-td--amount { font-weight: var(--fw-bold); direction: ltr; text-align: end; font-variant-numeric: tabular-nums; }
.fin-td--amount.is-in { color: var(--success); }
.fin-td--amount.is-out { color: var(--danger); }
.fin-tr--refund .fin-td--amount { color: var(--warning-ink, var(--warning)); }
.fin-td--balance { font-size: var(--fs-xs); color: var(--ink-2); text-align: end; font-variant-numeric: tabular-nums; }
.fin-m { display: none; color: var(--ink-3); }
.fin-td--by { font-size: var(--fs-xs); color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fin-pager { display: flex; align-items: center; justify-content: center; gap: var(--sp-3); margin-top: var(--sp-3); }
.fin-pager:empty { display: none; }

@media (max-width: 900px) {
  .fin-tr--head { display: none; }
  .fin-tr {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "where amount"
      "who   balance"
      "when  by";
    gap: 4px 12px;
    padding: 10px 12px;
  }
  .fin-td--where { grid-area: where; }
  .fin-td--amount { grid-area: amount; align-self: start; }
  .fin-td--who { grid-area: who; }
  .fin-td--balance { grid-area: balance; }
  .fin-m { display: inline; }
  .fin-td--when { grid-area: when; color: var(--ink-3); }
  .fin-td--by { grid-area: by; text-align: end; color: var(--ink-3); }
}

.fin-detail-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.fin-detail-head p { margin: 0; }
.fin-detail-head__icon {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--accent-a18);
  color: var(--accent-soft);
}
.fin-detail-head__icon .ico { width: 21px; height: 21px; }
.fin-detail-head__amount { font-size: var(--fs-lg); white-space: nowrap; }
.fin-detail-head__amount.is-in { color: var(--success); }
.fin-detail-head__amount.is-out { color: var(--danger); }

.modal__footer:has([data-only-person]) { flex-wrap: wrap; }
@media (max-width: 560px) {
  .modal__footer:has([data-only-person]) .btn { flex: 1 1 auto; }
  .modal__footer:has([data-only-person]) [data-close] { display: none; }
}

@supports not ((inset-inline-start: 0) or (inset-inline-end: 0)) {
  html[dir="rtl"] .fin-legend i { margin-right: 6px; }
  html[dir="ltr"] .fin-legend i { margin-left: 6px; }
  html[dir="rtl"] .fin-search > .ico { right: 12px; }
  html[dir="ltr"] .fin-search > .ico { left: 12px; }
  html[dir="rtl"] .fin-search .input { padding-right: 38px; }
  html[dir="ltr"] .fin-search .input { padding-left: 38px; }
}

.nav-group {
  padding: var(--sp-3) 14px 4px; font-size: var(--fs-2xs); font-weight: var(--fw-bold);
  color: var(--ink-3); letter-spacing: .03em; text-transform: uppercase;
}
.nav-group:first-child { padding-top: 2px; }
.nav-group--rule { padding: 0; margin: var(--sp-2) 14px; height: 1px; background: var(--line-soft); }

.sm-page { display: flex; flex-direction: column; gap: var(--sp-6); min-width: 0; }
.sm-page--tight { gap: var(--sp-4); }
.sm-grid { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.sm-grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.sm-grid--main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .sm-grid--main { grid-template-columns: minmax(0, 1fr); } }
.sm-row { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.sm-row--between { justify-content: space-between; }
.sm-spacer { flex: 1 1 auto; }
.sm-muted { color: var(--ink-3); }
.sm-small { font-size: var(--fs-xs); }
.sm-strong { font-weight: var(--fw-bold); }
.sm-num { font-variant-numeric: tabular-nums; }
.sm-ltr { direction: ltr; unicode-bidi: isolate; }

.sm-hero {
  position: relative; overflow: hidden; border-radius: var(--r-xl);
  padding: var(--sp-6) var(--sp-6) var(--sp-5);
  background: var(--grad-brand); color: #fff; box-shadow: var(--shadow-accent);
  isolation: isolate;
}
.sm-hero::before {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: -1; opacity: .55;
  background:
    radial-gradient(22rem 14rem at 8% 0%, rgba(255,255,255,.28), rgba(255,255,255,0) 70%),
    radial-gradient(18rem 12rem at 100% 100%, rgba(34,211,238,.45), rgba(34,211,238,0) 70%);
}
.sm-hero::after {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: -1; opacity: .18;
  background-image: radial-gradient(rgba(255,255,255,.9) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 85%);
          mask-image: linear-gradient(180deg, #000, transparent 85%);
}
.sm-hero__eyebrow { font-size: var(--fs-xs); opacity: .85; letter-spacing: .02em; }
.sm-hero__title { font-size: var(--fs-2xl); font-weight: var(--fw-black); line-height: var(--lh-tight); margin: var(--sp-1) 0 0; }
.sm-hero__sub { opacity: .9; margin-top: var(--sp-2); font-size: var(--fs-sm); }
.sm-hero__chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-4); }
.sm-hero__chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--r-full);
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.22); font-size: var(--fs-xs);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: #fff; cursor: default;
}
button.sm-hero__chip { cursor: pointer; font: inherit; font-size: var(--fs-xs); }
button.sm-hero__chip:hover { background: rgba(255,255,255,.26); }
.sm-hero__chip .ico { width: 15px; height: 15px; }
@media (max-width: 640px) {
  .sm-hero { padding: var(--sp-5) var(--sp-4) var(--sp-4); border-radius: var(--r-lg); }
  .sm-hero__title { font-size: var(--fs-xl); }
}

.sm-kpis { display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.sm-kpi {
  position: relative; display: flex; gap: var(--sp-3); align-items: flex-start; min-width: 0;
  padding: var(--sp-4); border-radius: var(--r-lg); background: var(--surface-1);
  border: 1px solid var(--line); box-shadow: var(--shadow-xs);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
button.sm-kpi { text-align: start; font: inherit; color: inherit; cursor: pointer; width: 100%; }
button.sm-kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: var(--line-strong); }
.sm-kpi__icon {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  background: var(--accent-a12); color: var(--accent);
}
.sm-kpi__icon .ico { width: 22px; height: 22px; }
.sm-kpi--success .sm-kpi__icon { background: var(--success-bg); color: var(--success); }
.sm-kpi--warning .sm-kpi__icon { background: var(--warning-bg); color: var(--warning); }
.sm-kpi--danger .sm-kpi__icon { background: var(--danger-bg); color: var(--danger); }
.sm-kpi--info .sm-kpi__icon { background: var(--info-bg); color: var(--info); }
.sm-kpi__body { min-width: 0; flex: 1 1 auto; }
.sm-kpi__label { color: var(--ink-3); font-size: var(--fs-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-kpi__value { font-size: var(--fs-xl); font-weight: var(--fw-black); line-height: 1.2; margin-top: 2px; font-variant-numeric: tabular-nums; }
.sm-kpi__hint { color: var(--ink-3); font-size: var(--fs-2xs); margin-top: 2px; }
.sm-kpi__spark { position: absolute; right: var(--sp-4); left: var(--sp-4); bottom: 6px; height: 22px; opacity: .6; pointer-events: none; }

.sm-card {
  background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs); min-width: 0; display: flex; flex-direction: column;
}
.sm-card__head {
  display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-4) var(--sp-4) 0; flex-wrap: wrap;
}
.sm-card__title { font-weight: var(--fw-bold); font-size: var(--fs-md); display: flex; align-items: center; gap: var(--sp-2); }
.sm-card__title .ico { color: var(--accent); width: 18px; height: 18px; }
.sm-card__sub { color: var(--ink-3); font-size: var(--fs-xs); }
.sm-card__body { padding: var(--sp-4); min-width: 0; }
.sm-card__body--flush { padding: 0; }
.sm-card__foot { padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--line-soft); }

.sm-toolbar { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.sm-search { position: relative; display: block; min-width: 180px; }
.sm-toolbar .sm-search { flex: 1 1 240px; }
.sm-search .input { padding-inline-start: 40px; height: 44px; width: 100%; }
.sm-search .ico { position: absolute; inset-inline-start: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-3); width: 18px; height: 18px; pointer-events: none; }
.sm-toolbar .select { height: 44px; min-width: 140px; flex: 0 1 190px; }
.sm-toolbar .btn { height: 44px; }
.sm-toolbar .check--row { flex: 0 0 auto; width: auto; margin: 0; }

.sm-table-wrap { overflow-x: auto; border-radius: var(--r-md); -webkit-overflow-scrolling: touch; }
.sm-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-sm); }
.sm-table th {
  position: sticky; top: 0; z-index: 1; text-align: start; font-weight: var(--fw-semibold); color: var(--ink-3);
  font-size: var(--fs-xs); padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.sm-table td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.sm-table tr:last-child td { border-bottom: 0; }
.sm-table tbody tr { transition: background var(--dur-fast); }
.sm-table tbody tr:hover { background: var(--accent-a08); }
.sm-table tr.is-selected { background: var(--accent-a12); }
.sm-table tr[data-open] { cursor: pointer; }
.sm-table .sm-col-check { width: 40px; }
.sm-table .sm-col-actions { text-align: end; white-space: nowrap; }
.sm-table .sm-col-num { text-align: center; font-variant-numeric: tabular-nums; }
.sm-cell-person { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; }
.sm-cell-person__name { font-weight: var(--fw-semibold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-cell-person__sub { color: var(--ink-3); font-size: var(--fs-2xs); }
@media (max-width: 720px) {
  .sm-table--cards thead { display: none; }
  .sm-table--cards, .sm-table--cards tbody, .sm-table--cards tr, .sm-table--cards td { display: block; width: 100%; }
  .sm-table--cards tr { border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: var(--sp-2); padding: var(--sp-2) 0; background: var(--surface-1); }
  .sm-table--cards td { border: 0; padding: 6px 14px; display: flex; justify-content: space-between; gap: var(--sp-3); }
  .sm-table--cards td[data-label]::before { content: attr(data-label); color: var(--ink-3); font-size: var(--fs-2xs); flex: 0 0 auto; }
  .sm-table--cards td.sm-col-check { display: none; }
  .sm-table--cards td.sm-col-actions { justify-content: flex-end; }
}

.sm-bulkbar {
  position: sticky; bottom: calc(var(--tabbar-h) - 12px); z-index: var(--z-sticky);
  display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap;
  padding: 10px 14px; border-radius: var(--r-md); background: var(--glass-strong);
  border: 1px solid var(--glass-border); box-shadow: var(--shadow-md);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  animation: sm-rise var(--dur-base) var(--ease-out);
}
@media (min-width: 900px) { .sm-bulkbar { bottom: var(--sp-4); } }
@keyframes sm-rise { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

.sm-avatar {
  flex: 0 0 auto; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center;
  font-weight: var(--fw-bold); font-size: var(--fs-xs); color: #fff; background: var(--grad-cool);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}
.sm-avatar--lg { width: 64px; height: 64px; border-radius: 20px; font-size: var(--fs-lg); }
.sm-avatar[data-tone="1"] { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.sm-avatar[data-tone="2"] { background: linear-gradient(135deg, #0ea5e9, #22d3ee); }
.sm-avatar[data-tone="3"] { background: linear-gradient(135deg, #10b981, #34d399); }
.sm-avatar[data-tone="4"] { background: linear-gradient(135deg, #f59e0b, #f97316); }
.sm-avatar[data-tone="5"] { background: linear-gradient(135deg, #ec4899, #f43f5e); }
.sm-avatar[data-tone="6"] { background: linear-gradient(135deg, #14b8a6, #0ea5e9); }

.sm-pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: var(--r-full);
  font-size: var(--fs-2xs); font-weight: var(--fw-semibold); white-space: nowrap; line-height: 1.6;
  background: var(--surface-3); color: var(--ink-2); border: 1px solid transparent;
}
.sm-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.sm-pill--plain::before { display: none; }
.sm-pill--success { background: var(--success-bg); color: var(--success); border-color: var(--success-line); }
.sm-pill--warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-line); }
.sm-pill--danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-line); }
.sm-pill--info { background: var(--info-bg); color: var(--info); border-color: var(--info-line); }
.sm-pill--accent { background: var(--accent-a12); color: var(--accent); border-color: var(--accent-a28); }

.sm-meter { display: flex; flex-direction: column; gap: 6px; }
.sm-meter__head { display: flex; justify-content: space-between; gap: var(--sp-2); font-size: var(--fs-xs); }
.sm-meter__label { color: var(--ink-2); font-weight: var(--fw-semibold); }
.sm-meter__value { color: var(--ink-3); font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.sm-meter__track { height: 8px; border-radius: var(--r-full); background: var(--surface-3); overflow: hidden; }
.sm-meter__bar { height: 100%; border-radius: inherit; background: var(--grad-cool); transition: width var(--dur-slow) var(--ease-out); }
.sm-meter--warn .sm-meter__bar { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.sm-meter--full .sm-meter__bar { background: linear-gradient(90deg, #e11d48, #fb7185); }
.sm-meter__foot { color: var(--ink-3); font-size: var(--fs-2xs); }

.sm-checklist { display: grid; gap: var(--sp-2); }
.sm-step {
  display: flex; align-items: center; gap: var(--sp-3); padding: 10px 12px; border-radius: var(--r-md);
  border: 1px dashed var(--line-strong); background: transparent; color: inherit; font: inherit;
  text-align: start; cursor: pointer; width: 100%;
}
.sm-step:hover { border-color: var(--accent); background: var(--accent-a08); }
.sm-step__dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-3); flex: 0 0 auto; }
.sm-step__dot .ico { width: 15px; height: 15px; }
.sm-step--static, .sm-step--static:hover { cursor: default; border-color: var(--line-soft); background: transparent; }
.sm-step.is-done { border-style: solid; border-color: var(--success-line); background: var(--success-bg); cursor: default; }
.sm-step.is-done .sm-step__dot { background: var(--success); color: #fff; }

.sm-att { display: flex; flex-direction: column; gap: 6px; }
.sm-att__row {
  display: flex; align-items: center; gap: var(--sp-3); padding: 8px 10px; border-radius: var(--r-md);
  border: 1px solid var(--line-soft); background: var(--surface-1);
  transition: border-color var(--dur-fast), background var(--dur-fast);
}
.sm-att__row[data-status="absent"] { border-color: var(--danger-line); background: var(--danger-bg); }
.sm-att__row[data-status="late"] { border-color: var(--warning-line); background: var(--warning-bg); }
.sm-att__row[data-status="excused"] { border-color: var(--info-line); background: var(--info-bg); }
.sm-att__num { width: 26px; text-align: center; color: var(--ink-3); font-size: var(--fs-2xs); font-variant-numeric: tabular-nums; }
.sm-att__name { flex: 1 1 auto; min-width: 0; font-weight: var(--fw-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-att__choices { display: inline-flex; gap: 4px; flex: 0 0 auto; }
.sm-att__choice {
  min-width: 42px; height: 36px; padding: 0 8px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink-2); font: inherit; font-size: var(--fs-xs); font-weight: var(--fw-semibold);
  cursor: pointer; transition: all var(--dur-fast);
}
.sm-att__choice:hover { border-color: var(--line-strong); }
.sm-att__choice[aria-pressed="true"][data-value="present"] { background: var(--success); border-color: var(--success); color: #fff; }
.sm-att__choice[aria-pressed="true"][data-value="absent"] { background: var(--danger); border-color: var(--danger); color: #fff; }
.sm-att__choice[aria-pressed="true"][data-value="late"] { background: var(--warning); border-color: var(--warning); color: #1f1300; }
.sm-att__choice[aria-pressed="true"][data-value="excused"] { background: var(--info); border-color: var(--info); color: #fff; }
.sm-att__late { width: 64px; height: 36px; text-align: center; }
@media (max-width: 560px) {
  .sm-att__row { flex-wrap: wrap; }
  .sm-att__choices { width: 100%; justify-content: space-between; }
  .sm-att__choice { flex: 1 1 0; }
}
.sm-att-summary { display: flex; gap: var(--sp-2); flex-wrap: wrap; }

.sm-gradebook { overflow: auto; max-height: 70vh; border: 1px solid var(--line); border-radius: var(--r-md); }
.sm-gradebook table { border-collapse: separate; border-spacing: 0; font-size: var(--fs-sm); min-width: 100%; }
.sm-gradebook th, .sm-gradebook td { padding: 6px 8px; border-bottom: 1px solid var(--line-soft); border-inline-end: 1px solid var(--line-soft); white-space: nowrap; }
.sm-gradebook thead th { position: sticky; top: 0; background: var(--surface-2); z-index: 2; font-size: var(--fs-2xs); color: var(--ink-3); }
.sm-gradebook .sm-gb-name { position: sticky; inset-inline-start: 0; background: var(--surface-1); z-index: 1; min-width: 170px; font-weight: var(--fw-semibold); }
.sm-gradebook thead .sm-gb-name { z-index: 3; background: var(--surface-2); }
.sm-gradebook input, .sm-gradebook select {
  width: 70px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2);
  color: var(--ink); text-align: center; font: inherit; font-variant-numeric: tabular-nums;
}
.sm-gradebook select { width: 118px; }
.sm-gradebook input:focus, .sm-gradebook select:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.sm-gradebook input.is-dirty, .sm-gradebook select.is-dirty { border-color: var(--accent); background: var(--accent-a08); }
.sm-gradebook input.is-invalid { border-color: var(--danger); background: var(--danger-bg); }
.sm-gb-avg { font-weight: var(--fw-bold); text-align: center; }
.sm-gb-avg.is-low { color: var(--danger); }
.sm-gb-head { display: flex; flex-direction: column; gap: 2px; align-items: center; }
.sm-gb-head button { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; font-size: var(--fs-2xs); padding: 0; }

.sm-tt { overflow: auto; border: 1px solid var(--line); border-radius: var(--r-md); }
.sm-tt table { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 720px; }
.sm-tt th { background: var(--surface-2); font-size: var(--fs-2xs); color: var(--ink-3); padding: 8px; position: sticky; top: 0; z-index: 1; }
.sm-tt td { padding: 4px; border-top: 1px solid var(--line-soft); border-inline-start: 1px solid var(--line-soft); height: 64px; vertical-align: top; }
.sm-tt__day { font-weight: var(--fw-bold); font-size: var(--fs-xs); white-space: nowrap; padding-right: 10px !important; padding-left: 10px !important; vertical-align: middle !important; background: var(--surface-2); }
.sm-tt__slot {
  display: flex; flex-direction: column; gap: 2px; height: 100%; min-height: 56px; width: 100%; padding: 6px 8px; border-radius: 10px;
  border: 1px solid transparent; background: var(--accent-a12); color: var(--ink); text-align: start; font: inherit; cursor: default;
  border-inline-start: 3px solid var(--slot-color, var(--accent));
}
.sm-tt__slot--empty { background: transparent; border: 1px dashed var(--line); color: var(--ink-3); align-items: center; justify-content: center; }
button.sm-tt__slot { cursor: pointer; }
button.sm-tt__slot:hover { border-color: var(--accent); }
.sm-tt__subject { font-weight: var(--fw-bold); font-size: var(--fs-xs); }
.sm-tt__meta { color: var(--ink-3); font-size: var(--fs-2xs); }

.sm-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.sm-cal__head { text-align: center; font-size: var(--fs-2xs); color: var(--ink-3); padding: 4px 0; }
.sm-cal__cell {
  min-height: 86px; border-radius: 12px; border: 1px solid var(--line-soft); background: var(--surface-1); padding: 6px;
  display: flex; flex-direction: column; gap: 3px; min-width: 0;
}
.sm-cal__cell.is-out { opacity: .38; }
.sm-cal__cell.is-today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-a45); }
.sm-cal__cell.is-weekend { background: var(--surface-2); }
.sm-cal__day { font-size: var(--fs-2xs); font-weight: var(--fw-bold); color: var(--ink-2); }
.sm-cal__event { font-size: 11px; padding: 2px 6px; border-radius: 6px; background: var(--accent-a12); color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border: 0; text-align: start; cursor: pointer; font-family: inherit; }
.sm-cal__event[data-kind="holiday"] { background: var(--danger-bg); color: var(--danger); }
.sm-cal__event[data-kind="exam"] { background: var(--warning-bg); color: var(--warning); }
.sm-cal__event[data-kind="meeting"] { background: var(--info-bg); color: var(--info); }
@media (max-width: 640px) { .sm-cal__cell { min-height: 58px; } .sm-cal__event { font-size: 10px; padding: 1px 4px; } }

.sm-inbox { display: grid; grid-template-columns: minmax(250px, 340px) minmax(0, 1fr); gap: var(--sp-4); min-height: 60vh; }
@media (max-width: 900px) { .sm-inbox { grid-template-columns: minmax(0, 1fr); } .sm-inbox.is-open .sm-inbox__list { display: none; } .sm-inbox:not(.is-open) .sm-inbox__thread { display: none; } }
.sm-inbox__list { display: flex; flex-direction: column; gap: 6px; }
.sm-inbox [data-back] { display: none; }
@media (max-width: 900px) { .sm-inbox [data-back] { display: inline-flex; } }
.sm-thread-item {
  display: flex; gap: var(--sp-2); align-items: center; padding: 10px 12px; border-radius: var(--r-md);
  border: 1px solid var(--line-soft); background: var(--surface-1); cursor: pointer; text-align: start; width: 100%; color: inherit; font: inherit;
}
.sm-thread-item:hover, .sm-thread-item.is-active { border-color: var(--accent-a45); background: var(--accent-a08); }
.sm-thread-item.is-unread .sm-thread-item__subject { font-weight: var(--fw-black); }
.sm-thread-item.is-unread::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: 0 0 auto; }
.sm-thread-item__body { min-width: 0; flex: 1 1 auto; }
.sm-thread-item__subject { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-thread-item__meta { font-size: var(--fs-2xs); color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-chat { display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-4); max-height: 58vh; overflow-y: auto; }
.sm-bubble { max-width: 78%; padding: 10px 14px; border-radius: 16px; background: var(--surface-3); line-height: var(--lh-normal); white-space: pre-wrap; word-break: break-word; }
.sm-bubble--mine { align-self: flex-end; background: var(--grad-brand); color: #fff; border-end-end-radius: 6px; }
.sm-bubble:not(.sm-bubble--mine) { align-self: flex-start; border-end-start-radius: 6px; }
.sm-bubble__meta { font-size: var(--fs-2xs); opacity: .75; margin-top: 4px; }
.sm-composer { display: flex; gap: var(--sp-2); padding: var(--sp-3); border-top: 1px solid var(--line-soft); align-items: flex-end; }
.sm-composer .textarea { min-height: 46px; max-height: 160px; resize: vertical; flex: 1 1 auto; }

.sm-profile-head { display: flex; gap: var(--sp-4); align-items: center; flex-wrap: wrap; }
.sm-profile-head__name { font-size: var(--fs-xl); font-weight: var(--fw-black); }
.sm-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--sp-3); }
.sm-kv__item { padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line-soft); min-width: 0; }
.sm-kv__label { font-size: var(--fs-2xs); color: var(--ink-3); }
.sm-kv__value { font-weight: var(--fw-semibold); margin-top: 2px; word-break: break-word; }

.sm-timeline { display: flex; flex-direction: column; gap: 2px; }
.sm-timeline__item { display: flex; gap: var(--sp-3); padding: 8px 4px; border-bottom: 1px solid var(--line-soft); align-items: flex-start; }
.sm-timeline__item:last-child { border-bottom: 0; }
.sm-timeline__icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-a12); color: var(--accent); flex: 0 0 auto; }
.sm-timeline__icon .ico { width: 16px; height: 16px; }
.sm-timeline__icon--danger { background: var(--danger-bg); color: var(--danger); }
.sm-timeline__icon--success { background: var(--success-bg); color: var(--success); }
.sm-timeline__icon--warning { background: var(--warning-bg); color: var(--warning); }
.sm-timeline__body { min-width: 0; flex: 1 1 auto; }
.sm-timeline__title { font-weight: var(--fw-semibold); font-size: var(--fs-sm); }
.sm-timeline__meta { font-size: var(--fs-2xs); color: var(--ink-3); }
.sm-date-badge { flex: 0 0 auto; width: 48px; text-align: center; border-radius: 12px; background: var(--accent-a12); color: var(--accent); padding: 4px 0; line-height: 1.2; }
.sm-date-badge b { display: block; font-size: var(--fs-lg); }
.sm-date-badge small { font-size: 10px; }

.sm-tabs { display: flex; gap: 4px; padding: 4px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line-soft); overflow-x: auto; scrollbar-width: none; }
.sm-tabs::-webkit-scrollbar { display: none; }
.drawer.drawer--wide { width: min(780px, 96vw); }
.sm-tab { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 12px; border: 0; background: transparent; color: var(--ink-2); font: inherit; font-size: var(--fs-sm); font-weight: var(--fw-semibold); cursor: pointer; white-space: nowrap; }
.sm-tab .ico { width: 16px; height: 16px; }
.sm-tab:hover { color: var(--ink); background: var(--surface-3); }
.sm-tab.is-active { background: var(--surface-1); color: var(--accent); box-shadow: var(--shadow-xs); }
.sm-tab__count { font-size: 11px; padding: 0 6px; border-radius: var(--r-full); background: var(--accent-a18); color: var(--accent); }

.sm-chipset { display: flex; flex-wrap: wrap; gap: 6px; }
.sm-chipset label { cursor: pointer; }
.sm-chipset input { position: absolute; opacity: 0; pointer-events: none; }
.sm-chipset span { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: var(--r-full); border: 1px solid var(--line); background: var(--surface-2); font-size: var(--fs-xs); transition: all var(--dur-fast); }
.sm-chipset input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.sm-chipset input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.sm-perm-group { border: 1px solid var(--line-soft); border-radius: var(--r-md); padding: var(--sp-3); }
.sm-perm-group__title { font-weight: var(--fw-bold); font-size: var(--fs-sm); margin-bottom: var(--sp-2); }
.sm-perm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 6px; }

.sm-cred-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--sp-2); }
.sm-cred { border: 1px dashed var(--line-strong); border-radius: var(--r-md); padding: 10px 12px; }
.sm-cred__name { font-weight: var(--fw-bold); }
.sm-cred__row { font-size: var(--fs-xs); color: var(--ink-2); direction: ltr; text-align: left; font-family: var(--font-mono); }

.sm-child {
  position: relative; overflow: hidden; border-radius: var(--r-xl); padding: var(--sp-5);
  background: var(--surface-1); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.sm-child::before { content: ""; position: absolute; top: 0; right: 0; left: 0; height: 5px; background: var(--grad-brand); }
.sm-child__head { display: flex; gap: var(--sp-3); align-items: center; }
.sm-child__name { font-size: var(--fs-lg); font-weight: var(--fw-black); }
.sm-child__stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--sp-2); margin-top: var(--sp-4); }
.sm-child__stat { border-radius: var(--r-md); background: var(--surface-2); padding: 10px; text-align: center; }
.sm-child__stat b { display: block; font-size: var(--fs-lg); font-variant-numeric: tabular-nums; }
.sm-child__stat span { font-size: var(--fs-2xs); color: var(--ink-3); }
.sm-today { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: var(--fw-bold); padding: 4px 10px; border-radius: var(--r-full); }

.sm-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--sp-2); padding: var(--sp-10) var(--sp-4); }
.sm-empty__art { width: 76px; height: 76px; border-radius: 26px; display: grid; place-items: center; background: var(--grad-brand-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-a18); margin-bottom: var(--sp-2); }
.sm-empty__art .ico { width: 34px; height: 34px; }
.sm-empty__title { font-weight: var(--fw-bold); font-size: var(--fs-md); }
.sm-empty__desc { color: var(--ink-3); font-size: var(--fs-sm); max-width: 440px; line-height: var(--lh-normal); }

.sm-more { display: flex; justify-content: center; padding: var(--sp-3); }

.sm-form { display: flex; flex-direction: column; gap: var(--sp-3); }
.sm-form__row { display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.sm-form__section { font-weight: var(--fw-bold); font-size: var(--fs-sm); color: var(--ink-2); margin-top: var(--sp-2); padding-top: var(--sp-3); border-top: 1px solid var(--line-soft); }

@media print {
  .sidebar, .topbar, .tabbar, .sm-toolbar, .sm-bulkbar, .btn, .app-credit, .marquee-host { display: none !important; }
  .content { padding: 0 !important; }
  .sm-card, .sm-kpi { box-shadow: none !important; break-inside: avoid; }
  body { background: #fff !important; color: #000 !important; }
  html.sm-print-modal body > *:not(.sm-print-target) { display: none !important; }
  html.sm-print-modal .sm-print-target { position: static !important; background: none !important; backdrop-filter: none !important; }
  html.sm-print-modal .sm-print-target .modal { max-height: none !important; width: 100% !important; max-width: none !important; box-shadow: none !important; overflow: visible !important; transform: none !important; }
  html.sm-print-modal .sm-print-target .modal__body { overflow: visible !important; max-height: none !important; }
  html.sm-print-modal .sm-print-target .modal__footer,
  html.sm-print-modal .sm-print-target .modal__grabber,
  html.sm-print-modal .sm-print-target .modal__header .btn { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .sm-kpi, .sm-bulkbar, .sm-meter__bar { transition: none !important; animation: none !important; }
}

.sm-day { display: inline-flex; align-items: center; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: var(--r-full); background: var(--surface-2); min-height: 44px; }
.sm-day__label { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.15; min-width: 92px; padding: 0 4px; }
.sm-day__label b { font-size: var(--fs-xs); }
.sm-day__label span { font-size: var(--fs-2xs); color: var(--ink-3); }

@supports not ((inset-inline-start: 0) or (inset-inline-end: 0)) {
  html[dir="rtl"] .sm-search .input { padding-right: 40px; }
  html[dir="ltr"] .sm-search .input { padding-left: 40px; }
  html[dir="rtl"] .sm-search .ico { right: 13px; }
  html[dir="ltr"] .sm-search .ico { left: 13px; }
  html[dir="rtl"] .sm-gradebook th,
html[dir="rtl"] .sm-gradebook td { border-left: 1px solid var(--line-soft); }
  html[dir="ltr"] .sm-gradebook th,
html[dir="ltr"] .sm-gradebook td { border-right: 1px solid var(--line-soft); }
  html[dir="rtl"] .sm-gradebook .sm-gb-name { right: 0; }
  html[dir="ltr"] .sm-gradebook .sm-gb-name { left: 0; }
  html[dir="rtl"] .sm-tt td { border-right: 1px solid var(--line-soft); }
  html[dir="ltr"] .sm-tt td { border-left: 1px solid var(--line-soft); }
  html[dir="rtl"] .sm-tt__slot { border-right: 3px solid var(--slot-color, var(--accent)); }
  html[dir="ltr"] .sm-tt__slot { border-left: 3px solid var(--slot-color, var(--accent)); }
  html[dir="rtl"] .sm-bubble--mine { border-bottom-left-radius: 6px; }
  html[dir="ltr"] .sm-bubble--mine { border-bottom-right-radius: 6px; }
  html[dir="rtl"] .sm-bubble:not(.sm-bubble--mine) { border-bottom-right-radius: 6px; }
  html[dir="ltr"] .sm-bubble:not(.sm-bubble--mine) { border-bottom-left-radius: 6px; }
}

.wst { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); min-width: 0; }
.wst > * { min-width: 0; }
.wst__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.wst__periods { flex: 0 1 auto; max-width: 100%; overflow-x: auto; }
.wst__dl { flex: none; }
.wst__range { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; font-size: var(--fs-xs); color: var(--ink-2); }
.wst__range .ico { width: 15px; height: 15px; color: var(--ink-3); }
.wst__sums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-2); }
.wst__sum {
  display: grid; gap: 4px; min-width: 0;
  padding: 10px 12px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--line-soft);
}
.wst__sum span { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); color: var(--ink-2); }
.wst__sum span .ico { width: 14px; height: 14px; }
.wst__sum small { color: var(--ink-3); }
.wst__sum b { font-size: var(--fs-md); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.wst__sum--in b { color: var(--success); }
.wst__sum--out b { color: var(--danger); }
.wst__sum--close { border-color: var(--accent-a45); background: var(--accent-a08); }
.wst__services { display: flex; flex-wrap: wrap; gap: 6px; }
.wst__svc {
  display: inline-flex; align-items: baseline; gap: 5px; padding: 4px 10px;
  border-radius: var(--r-full); background: var(--surface-2); border: 1px solid var(--line-soft);
  font-size: var(--fs-xs); color: var(--ink-2);
}
.wst__svc b { color: var(--ink); font-weight: var(--fw-semibold); }
.wst__svc small { color: var(--ink-3); }
.wst__list { display: grid; gap: 4px; }
.wst__row {
  display: grid; grid-template-columns: 118px minmax(0, 1fr) 118px 110px; gap: 12px; align-items: center;
  padding: 8px 12px; border-radius: var(--r-sm); background: var(--surface-2);
  border-inline-start: 3px solid transparent;
}
.wst__row--in { border-inline-start-color: var(--success); }
.wst__row--out { border-inline-start-color: var(--danger); }
.wst__row--refund { border-inline-start-color: var(--warning); }
.wst__row--head { background: none; padding-top: 2px; padding-bottom: 2px; font-size: var(--fs-xs); color: var(--ink-3); font-weight: var(--fw-semibold); border: 0; }
.wst__when { display: grid; gap: 1px; font-variant-numeric: tabular-nums; }
.wst__when b { font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.wst__when small { font-size: var(--fs-xs); color: var(--ink-3); text-align: start; }
.wst__what { display: grid; gap: 2px; min-width: 0; }
.wst__what b { font-size: var(--fs-sm); font-weight: var(--fw-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wst__what small { font-size: var(--fs-xs); color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wst__amount { direction: ltr; text-align: end; font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.wst__row--in .wst__amount { color: var(--success); }
.wst__row--out .wst__amount { color: var(--danger); }
.wst__row--refund .wst__amount { color: var(--warning-ink, var(--warning)); }
.wst__bal { text-align: end; font-size: var(--fs-xs); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.wst__m { display: none; }
.wst__empty { display: grid; justify-items: center; gap: 6px; padding: var(--sp-6) var(--sp-3); text-align: center; color: var(--ink-3); }
.wst__empty .ico { width: 28px; height: 28px; opacity: .7; }
.wst__empty p { margin: 0; max-width: 46ch; }
.wst__who { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: var(--sp-3); }
.wst__who[hidden] { display: none; }
.wst__who .ico { width: 16px; height: 16px; color: var(--ink-3); }
.wst__who small { font-size: var(--fs-xs); color: var(--ink-3); }
.fin-statement__form { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.fin-statement__form .fin-search { flex: 1 1 240px; }

@media (max-width: 720px) {
  .wst__sums { grid-template-columns: 1fr 1fr; }
  .wst__row { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; }
  .wst__row--head { display: none; }
  .wst__when { grid-column: 1; grid-row: 1; display: flex; gap: 6px; align-items: baseline; }
  .wst__what { grid-column: 1; grid-row: 2; }
  .wst__amount { grid-column: 2; grid-row: 1; }
  .wst__bal { grid-column: 2; grid-row: 2; }
  .wst__m { display: inline; }
  .wst__bar { flex-direction: column; align-items: stretch; }
  .wst__dl { width: 100%; justify-content: center; }
  .wst__services { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
  .wst__periods .segmented__item { padding-right: 11px; padding-left: 11px; }
  .wst__svc { flex: none; }
}

.ticket-head__danger { margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px dashed var(--line-soft); }
.purge-dlg__target { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--r-md); background: var(--danger-bg, var(--surface-2)); }
.purge-dlg__target .ico { width: 18px; height: 18px; color: var(--danger); flex: none; }
.purge-dlg__target b { overflow-wrap: anywhere; }
.purged-bar { display: flex; flex-wrap: wrap; gap: var(--sp-2); justify-content: space-between; }
.purged-bar .segmented { max-width: 100%; overflow-x: auto; }
.purged-bar [hidden] { display: none; }
.purged-list { display: grid; gap: var(--sp-2); }
.purged-item {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--sp-3); align-items: start;
  padding: var(--sp-3) var(--sp-4); border-radius: var(--r-lg);
  background: var(--card-bg, var(--surface-1)); border: 1px solid var(--line-soft);
}
.purged-item--expired { opacity: .72; }
.purged-item__icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--surface-3); color: var(--ink-2); }
.purged-item__icon .ico { width: 19px; height: 19px; }
.purged-item__body { display: grid; gap: 3px; min-width: 0; }
.purged-item__body p { margin: 0; }
.purged-item__title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.purged-item__title b { overflow-wrap: anywhere; }
.purged-item__side { display: grid; justify-items: end; gap: 6px; }
@media (max-width: 600px) {
  .purged-item { grid-template-columns: auto minmax(0, 1fr); }
  .purged-item__side { grid-column: 1 / -1; justify-items: start; grid-auto-flow: column; align-items: center; justify-content: space-between; }
}

:root { --wheel-empty: #9aa0bd; --wheel-rim: #1b1f45; }
html[data-theme="light"] { --wheel-empty: #b9bdd3; --wheel-rim: #2a2f63; }

.rw-stage {
  display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: var(--sp-6); align-items: center;
  overflow: hidden; position: relative;
}
.rw-stage::before {
  content: ""; position: absolute; top: -40%; right: auto; bottom: auto; left: -20%; width: 70%; aspect-ratio: 1;
  background: radial-gradient(circle, var(--accent-a18), transparent 65%); pointer-events: none;
}
.rw-stage__wheel { position: relative; display: grid; place-items: center; }
.rw-stage__side { position: relative; display: grid; gap: var(--sp-3); min-width: 0; }
.rw-kicker { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--accent); text-transform: uppercase; letter-spacing: .04em; }
.rw-kicker .ico { width: 15px; height: 15px; }
.rw-title { margin: 0; font-size: var(--fs-2xl); font-weight: var(--fw-black); line-height: var(--lh-tight); }
.rw-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2); }
.rw-fact { display: grid; gap: 3px; padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line-soft); min-width: 0; }
.rw-fact span { font-size: var(--fs-xs); color: var(--ink-2); }
.rw-fact b { font-size: var(--fs-md); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.rw-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.rw-spin { flex: 1 1 220px; justify-content: center; }
.rw-fine { margin: 0; line-height: var(--lh-normal); }
.rw-stage.is-off .wheel { filter: grayscale(.85); opacity: .7; }

.wheel { position: relative; width: min(100%, 380px); aspect-ratio: 1; }
.wheel__svg { display: block; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 18px 30px rgba(10, 12, 40, .35)); }
.wheel__rim { fill: var(--wheel-rim); stroke: rgba(255, 255, 255, .18); stroke-width: 2; }
.wheel__ring { fill: none; stroke: rgba(255, 255, 255, .55); stroke-width: 2; }
.wheel__rotor { transform-origin: 160px 160px; transform-box: view-box; transition-property: transform; transition-timing-function: cubic-bezier(.12, .7, .08, 1); }
.wheel__seg path { stroke: rgba(255, 255, 255, .55); stroke-width: 1.2; }
.wheel__label { fill: #fff; font-family: var(--font-fa); font-weight: 800; paint-order: stroke; stroke: rgba(0, 0, 0, .28); stroke-width: 2px; }
.wheel__unit { fill: rgba(255, 255, 255, .92); font-family: var(--font-fa); font-weight: 600; }
.wheel__seg--zero .wheel__label { fill: #1c1f3d; stroke: rgba(255, 255, 255, .5); }
.wheel__seg--zero .wheel__unit { fill: #1c1f3d; }
.wheel__seg--top .wheel__label { fill: #3b1d00; stroke: rgba(255, 255, 255, .6); }
.wheel__seg--top .wheel__unit { fill: #3b1d00; }
.wheel__peg { fill: #fff; opacity: .9; }
.wheel__pointer {
  position: absolute; top: -2%; left: 50%; width: 34px; height: 44px; transform: translateX(-50%);
  background: linear-gradient(180deg, #fff 0%, #e7e8f5 100%);
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .35));
  z-index: 2;
}
.wheel__pointer::after {
  content: ""; position: absolute; top: 5px; right: 8px; bottom: 14px; left: 8px; background: var(--accent);
  clip-path: polygon(50% 100%, 0 0, 100% 0);
}
.wheel.is-spinning .wheel__pointer { animation: wheel-tick .16s ease-in-out infinite alternate; }
@keyframes wheel-tick { from { transform: translateX(-50%) rotate(-6deg); } to { transform: translateX(-50%) rotate(6deg); } }
.wheel__hub {
  position: absolute; top: 50%; left: 50%; width: 27%; aspect-ratio: 1; transform: translate(-50%, -50%);
  display: grid; place-items: center; padding: 0;
  border: 4px solid rgba(255, 255, 255, .85); border-radius: 50%;
  background: var(--grad-brand, var(--accent)); color: #fff; cursor: pointer;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .35), inset 0 2px 0 rgba(255, 255, 255, .35);
  font: inherit; font-weight: var(--fw-black); font-size: clamp(13px, 3.4vw, 17px);
  transition: transform var(--dur-fast) var(--ease-out);
}
.wheel__hub:hover:not(:disabled) { transform: translate(-50%, -50%) scale(1.05); }
.wheel__hub:disabled { cursor: not-allowed; filter: grayscale(.4); }
.wheel.is-waiting .wheel__hub { animation: wheel-pulse .8s ease-in-out infinite; }
@keyframes wheel-pulse { 50% { box-shadow: 0 0 0 10px var(--accent-a28), 0 8px 22px rgba(0, 0, 0, .35); } }
.wheel--calm .wheel__pointer { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  .wheel.is-spinning .wheel__pointer, .wheel.is-waiting .wheel__hub { animation: none; }
}

.rw-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-4); align-items: start; }
.rw-odds__list { display: grid; gap: 5px; margin: var(--sp-2) 0 0; padding: 0; list-style: none; }
.rw-odds__list li { display: grid; grid-template-columns: 112px minmax(0, 1fr) 62px; gap: 10px; align-items: center; font-size: var(--fs-xs); }
.rw-odds__list--compact li { grid-template-columns: 104px minmax(0, 1fr) 56px; }
.rw-odds__prize { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rw-odds__bar { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.rw-odds__bar i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.rw-odds__pct { text-align: end; font-variant-numeric: tabular-nums; color: var(--ink); font-weight: var(--fw-semibold); }
.rw-totals { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: var(--sp-2); font-size: var(--fs-xs); color: var(--ink-2); }
.rw-hist { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.rw-hist li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--surface-2); }
.rw-hist li.is-win { background: var(--success-bg, var(--surface-2)); }
.rw-hist__icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--surface-3); color: var(--ink-2); flex: none; }
.rw-hist li.is-win .rw-hist__icon { color: var(--success); }
.rw-hist__icon .ico { width: 16px; height: 16px; }
.rw-hist .grow { display: grid; gap: 1px; min-width: 0; }
.rw-hist small { font-size: var(--fs-xs); color: var(--ink-3); }
.rw-hist__net { font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; font-size: var(--fs-sm); }
.rw-hist__net.is-up { color: var(--success); }
.rw-hist__net.is-down { color: var(--ink-3); }

.rw-result { position: relative; display: grid; justify-items: center; gap: 6px; padding: var(--sp-4) var(--sp-2); text-align: center; overflow: hidden; }
.rw-result p { margin: 0; }
.rw-result__icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--surface-3); color: var(--ink-2); }
.rw-result__icon .ico { width: 30px; height: 30px; }
.rw-result--win .rw-result__icon { background: var(--grad-warm, var(--warning)); color: #fff; box-shadow: 0 10px 26px rgba(245, 158, 11, .35); }
.rw-result__amount { font-size: var(--fs-3xl); font-weight: var(--fw-black); line-height: var(--lh-tight); }
.rw-result--win .rw-result__amount { color: var(--success); }
.rw-confetti { position: absolute; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; }
.rw-confetti i {
  position: absolute; top: -10px; left: calc(var(--i) * 5.5%); width: 7px; height: 12px; border-radius: 2px;
  background: hsl(calc(var(--i) * 37) 85% 60%);
  animation: rw-fall 1.8s calc(var(--i) * 45ms) ease-in forwards;
}
@keyframes rw-fall { to { transform: translateY(260px) rotate(540deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .rw-confetti { display: none; } }

@media (max-width: 860px) {
  .rw-stage { grid-template-columns: 1fr; gap: var(--sp-4); }
  .rw-stage__wheel { order: -1; }
  .rw-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .rw-facts { grid-template-columns: 1fr 1fr; }
  .rw-facts .rw-fact:last-child { grid-column: 1 / -1; }
  .rw-title { font-size: var(--fs-xl); }
  .rw-odds__list li { grid-template-columns: 96px minmax(0, 1fr) 54px; gap: 8px; }
}

.rwa { --rwa-rev: #2a78d6; --rwa-pay: #eb6834; }
html[data-theme="dark"] .rwa { --rwa-rev: #3987e5; --rwa-pay: #d95926; }
.rwa-tabs { max-width: 100%; overflow-x: auto; }
.rwa-tabs .segmented__item { display: inline-flex; align-items: center; gap: 6px; }
.rwa-tabs .segmented__item .ico { width: 15px; height: 15px; }
.rwa-status { display: grid; gap: var(--sp-3); }
.rwa-status__main { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); }
.rwa-status__main .grow { min-width: 200px; }
.rwa-status__main p { margin: 0; }
.rwa-switch { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; background: var(--surface-3); color: var(--ink-3); flex: none; }
.rwa-switch.is-on { background: var(--success-bg, var(--surface-3)); color: var(--success); }
.rwa-switch .ico { width: 21px; height: 21px; }
.rwa-monitor { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-md); border: 1px solid var(--line-soft); background: var(--surface-2); }
.rwa-monitor > .ico { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.rwa-monitor--success > .ico { color: var(--success); }
.rwa-monitor--warning { border-color: var(--warning-line, var(--line-soft)); }
.rwa-monitor--warning > .ico { color: var(--warning); }
.rwa-monitor--danger { border-color: var(--danger-line, var(--line-soft)); background: var(--danger-bg, var(--surface-2)); }
.rwa-monitor--danger > .ico { color: var(--danger); }
.rwa-monitor p { margin: 0; }
.rwa-monitor ul { margin: 4px 0 0; padding-inline-start: 18px; font-size: var(--fs-xs); color: var(--ink-2); }
.rwa-check--critical { color: var(--danger); font-weight: var(--fw-semibold); }
.rwa-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.rwa-row .segmented { max-width: 100%; overflow-x: auto; }
.rwa-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rwa-guard__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-2); margin: var(--sp-3) 0; }
.rwa-guard__grid > div { display: grid; gap: 3px; padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line-soft); min-width: 0; }
.rwa-guard__grid span { font-size: var(--fs-xs); color: var(--ink-2); }
.rwa-guard__grid b { font-size: var(--fs-md); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.rwa-legend { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--ink-2); }
.rwa-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-start: 6px; }
.rwa-legend__rev { background: var(--rwa-rev); }
.rwa-legend__pay { background: var(--rwa-pay); }
.rwa-chart { display: flex; gap: 4px; align-items: stretch; height: 190px; padding-top: var(--sp-2); overflow-x: auto; border-bottom: 1px solid var(--line-soft); }
.rwa-chart__col { flex: 1 0 16px; min-width: 16px; display: grid; grid-template-rows: 1fr auto; gap: 4px; border-radius: 4px; outline: none; }
.rwa-chart__col:hover, .rwa-chart__col:focus-visible { background: var(--accent-a08); }
.rwa-chart__bars { display: flex; align-items: flex-end; justify-content: center; gap: 2px; min-height: 0; }
.rwa-chart__bar { width: 42%; max-width: 12px; min-height: 0; border-radius: 4px 4px 0 0; }
.rwa-chart__bar--rev { background: var(--rwa-rev); }
.rwa-chart__bar--pay { background: var(--rwa-pay); }
.rwa-chart__label { font-size: 10px; color: var(--ink-3); text-align: center; min-height: 13px; white-space: nowrap; }

.rwa-dist { display: grid; gap: 3px; margin-top: var(--sp-3); }
.rwa-dist__row { display: grid; grid-template-columns: 118px minmax(0, 1.6fr) 96px 64px 104px; gap: 10px; align-items: center; padding: 6px 10px; border-radius: var(--r-sm); background: var(--surface-2); font-size: var(--fs-sm); }
.rwa-dist__row--head { background: none; font-size: var(--fs-xs); color: var(--ink-3); font-weight: var(--fw-semibold); padding-top: 2px; padding-bottom: 2px; }
.rwa-dist__row.is-blocked { opacity: .78; }
.rwa-dist__p { position: relative; display: flex; align-items: center; gap: 8px; min-width: 0; }
.rwa-dist__p i { display: block; height: 8px; border-radius: 4px; background: var(--accent); flex: none; max-width: calc(100% - 64px); }
.rwa-dist__p small { font-size: var(--fs-xs); color: var(--ink-2); font-variant-numeric: tabular-nums; }

.rwa-top { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.rwa-top li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--surface-2); }
.rwa-top .grow { display: grid; gap: 1px; min-width: 0; }
.rwa-top small { font-size: var(--fs-xs); color: var(--ink-3); }
.rwa-top__rank { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-3); font-size: var(--fs-xs); font-weight: var(--fw-bold); flex: none; }
.rwa-top__won { display: grid; justify-items: end; gap: 1px; font-variant-numeric: tabular-nums; }

.rwa-table { display: grid; gap: 4px; }
.rwa-tr { display: grid; grid-template-columns: 140px minmax(0, 1.2fr) minmax(0, 1.1fr) minmax(0, 1.2fr); gap: 12px; align-items: center; padding: 8px 12px; border-radius: var(--r-sm); background: var(--surface-2); font-size: var(--fs-sm); }
.rwa-tr > span { min-width: 0; overflow-wrap: anywhere; }
.rwa-tr.is-win { border-inline-start: 3px solid var(--success); }
.rwa-tr--head { background: none; font-size: var(--fs-xs); color: var(--ink-3); font-weight: var(--fw-semibold); padding-top: 2px; padding-bottom: 2px; }
.rwa-table--people .rwa-tr { grid-template-columns: minmax(0, 1.6fr) 64px minmax(0, 1fr) 110px 44px; }
.rwa-table--people .rwa-tr small { display: block; }

.rwa-settings { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: var(--sp-4); align-items: start; }
.rwa-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--sp-3); align-items: start; }
.rwa-settings .rwa-guard__grid { grid-template-columns: 1fr 1fr; }

@media (max-width: 900px) {
  .rwa-settings { grid-template-columns: 1fr; }
  .rwa-guard__grid { grid-template-columns: 1fr 1fr; }
  .rwa-kpis { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .rwa-kpis .stat__icon { display: none; }
  .rwa-kpis .stat__value { font-size: var(--fs-md); }
  .rwa-tabs .segmented__item { padding-right: 10px; padding-left: 10px; font-size: var(--fs-xs); }
  .rwa-tabs .segmented__item .ico { display: none; }
}
@media (max-width: 640px) {
  .rwa-fields { grid-template-columns: 1fr; }
  .rwa-dist__row { grid-template-columns: 92px minmax(0, 1fr) 72px; }
  .rwa-dist__row > span:nth-child(4), .rwa-dist__row > span:nth-child(5) { display: none; }
  .rwa-tr, .rwa-table--people .rwa-tr { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; }
  .rwa-tr--head { display: none; }
  .rwa-table--people .rwa-tr > span:nth-child(2)::before { content: "×"; }
}


.dsc-claim { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.dsc-claim .input { flex: 1 1 auto; min-width: 0; text-transform: uppercase; letter-spacing: .04em; font-family: var(--font-en), var(--font-fa); }
.dsc-claim .btn { flex: none; }
.dsc-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.dsc-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px dashed var(--accent-a45); }
.dsc-item.is-off { border-style: solid; border-color: var(--line-soft); opacity: .72; }
.dsc-item__icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent-a12); color: var(--accent); flex: none; }
.dsc-item.is-off .dsc-item__icon { background: var(--surface-3); color: var(--ink-3); }
.dsc-item__icon .ico { width: 17px; height: 17px; }
.dsc-item__body { display: grid; gap: 2px; min-width: 0; }
.dsc-item__top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dsc-item__top b { font-family: var(--font-en), var(--font-fa); letter-spacing: .04em; }
.dsc-item__value { font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.dsc-item small { font-size: var(--fs-xs); color: var(--ink-2); }
.dsc-empty { margin: 0; }

.dsc-bar { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; justify-content: space-between; }
.dsc-bar .segmented { max-width: 100%; overflow-x: auto; }
.dsc-bar .fin-search { flex: 1 1 220px; max-width: 360px; }
.dsc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: var(--sp-3); }
.dsc-card { display: grid; gap: 8px; align-content: start; padding: var(--sp-4); border-radius: var(--r-lg);
  background: var(--card-bg, var(--surface-1)); border: 1px solid var(--line-soft); box-shadow: var(--shadow-xs); min-width: 0; }
.dsc-card--active { border-color: var(--accent-a28); }
.dsc-card--inactive, .dsc-card--expired { opacity: .8; }
.dsc-card__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dsc-code { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 9px; cursor: pointer;
  border: 1px dashed var(--accent-a45); background: var(--accent-a08); color: var(--accent); font: inherit;
  font-family: var(--font-en), var(--font-fa); font-weight: var(--fw-bold); letter-spacing: .05em; max-width: 100%; overflow: hidden; }
.dsc-code .ico { width: 14px; height: 14px; opacity: .7; flex: none; }
.dsc-card__value { margin: 0; font-size: var(--fs-md); font-weight: var(--fw-bold); }
.dsc-card__title { margin: 0; font-size: var(--fs-sm); color: var(--ink-2); }
.dsc-cats { display: flex; flex-wrap: wrap; gap: 5px; }
.dsc-card__line { display: flex; align-items: flex-start; gap: 5px; margin: 0; line-height: var(--lh-normal); }
.dsc-card__line .ico { width: 14px; height: 14px; flex: none; margin-top: 2px; }
.dsc-meters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dsc-meter { display: grid; gap: 4px; font-size: var(--fs-xs); color: var(--ink-2); }
.dsc-meter b { color: var(--ink); font-variant-numeric: tabular-nums; }
.dsc-meter i { display: block; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.dsc-meter em { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.dsc-card__total { margin: 0; font-size: var(--fs-sm); color: var(--ink-2); }
.dsc-card__actions { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 8px; border-top: 1px solid var(--line-soft); }
.dsc-del { margin-inline-start: auto; color: var(--danger); }

.dsc-form { gap: var(--sp-3); }
.dsc-sec { margin: 0; padding: var(--sp-3) var(--sp-4); border: 1px solid var(--line-soft); border-radius: var(--r-lg); display: grid; gap: var(--sp-2); min-width: 0; }
.dsc-sec legend { display: inline-flex; align-items: center; gap: 6px; padding: 0 6px; font-weight: var(--fw-bold); font-size: var(--fs-sm); }
.dsc-sec legend .ico { width: 16px; height: 16px; color: var(--accent); }
.dsc-code-input { display: flex; gap: var(--sp-2); }
.dsc-code-input .input { flex: 1 1 auto; min-width: 0; text-transform: uppercase; letter-spacing: .04em; }
.dsc-code-input .btn { flex: none; }
.dsc-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--sp-3); align-items: start; }
.dsc-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 var(--sp-3); align-items: start; }
.dsc-grid2 > [hidden] { display: none; }
.dsc-type { justify-self: start; }
.dsc-preview { display: flex; align-items: center; gap: 6px; margin: 0; font-size: var(--fs-xs); color: var(--ink-2); }
.dsc-preview:empty { display: none; }
.dsc-preview .ico { width: 14px; height: 14px; color: var(--info); }
.dsc-h { display: flex; align-items: center; gap: 6px; margin: var(--sp-2) 0 0; font-size: var(--fs-sm); }
.dsc-h .ico { width: 16px; height: 16px; color: var(--accent); }
.dsc-table { display: grid; gap: 4px; }
.dsc-tr { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 8px 12px; border-radius: var(--r-sm); background: var(--surface-2); }
.dsc-tr > span:first-child { display: grid; gap: 1px; min-width: 0; }
.dsc-tr small { font-size: var(--fs-xs); }
.dsc-tr.is-off { opacity: .65; }
@media (max-width: 640px) {
  .dsc-grid2, .dsc-grid3 { grid-template-columns: 1fr; }
  .dsc-sec { padding: var(--sp-3); }
  .dsc-bar .fin-search { max-width: none; }
  .dsc-claim { flex-wrap: wrap; }
  .dsc-claim .btn { flex: 1 1 100%; justify-content: center; }
}

@supports not ((inset-inline-start: 0) or (inset-inline-end: 0)) {
  html[dir="rtl"] .wst__row { border-right: 3px solid transparent; }
  html[dir="ltr"] .wst__row { border-left: 3px solid transparent; }
  html[dir="rtl"] .wst__row--in { border-right-color: var(--success); }
  html[dir="ltr"] .wst__row--in { border-left-color: var(--success); }
  html[dir="rtl"] .wst__row--out { border-right-color: var(--danger); }
  html[dir="ltr"] .wst__row--out { border-left-color: var(--danger); }
  html[dir="rtl"] .wst__row--refund { border-right-color: var(--warning); }
  html[dir="ltr"] .wst__row--refund { border-left-color: var(--warning); }
  html[dir="rtl"] .rwa-monitor ul { padding-right: 18px; }
  html[dir="ltr"] .rwa-monitor ul { padding-left: 18px; }
  html[dir="rtl"] .rwa-legend i { margin-right: 6px; }
  html[dir="ltr"] .rwa-legend i { margin-left: 6px; }
  html[dir="rtl"] .rwa-tr.is-win { border-right: 3px solid var(--success); }
  html[dir="ltr"] .rwa-tr.is-win { border-left: 3px solid var(--success); }
  html[dir="rtl"] .dsc-del { margin-right: auto; }
  html[dir="ltr"] .dsc-del { margin-left: auto; }
}

.ac { --ac-c1: #6366f1; --ac-c2: #a855f7; --ac-c3: #22d3ee; }
.ac .ico { flex: 0 0 auto; }
.ac-grad {
  background: linear-gradient(120deg, var(--ac-c1), var(--ac-c2) 55%, var(--ac-c3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
html[data-theme="dark"] .ac-grad { background: linear-gradient(120deg, #a5b4fc, #d8b4fe 55%, #67e8f9); -webkit-background-clip: text; background-clip: text; }

.ac-avatar {
  position: relative; flex: 0 0 auto; width: 46px; height: 46px; border-radius: 16px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--ac-c1, #6366f1), var(--ac-c2, #a855f7) 60%, var(--ac-c3, #22d3ee));
  box-shadow: 0 10px 24px -10px rgba(99, 102, 241, .7);
}
.ac-avatar .ico { width: 24px; height: 24px; }
.ac-avatar--lg { width: 64px; height: 64px; border-radius: 22px; }
.ac-avatar--lg .ico { width: 32px; height: 32px; }
.ac-avatar__spark {
  position: absolute; top: -6px; inset-inline-end: -6px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; background: #fbbf24; color: #4a2d00; box-shadow: 0 4px 10px rgba(251, 191, 36, .45);
  animation: acTwinkle 2.6s ease-in-out infinite;
}
.ac-avatar__spark .ico { width: 13px; height: 13px; }
.ac-avatar__pulse {
  position: absolute; top: -4px; right: -4px; bottom: -4px; left: -4px; border-radius: 19px; border: 2px solid rgba(124, 108, 255, .45);
  animation: acPulse 2.4s ease-out infinite;
}
.ac-avatar__badge {
  position: absolute; top: -6px; inset-inline-end: -6px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700;
  display: grid; place-items: center; box-shadow: 0 0 0 2px var(--surface-1);
}
@keyframes acPulse { 0% { transform: scale(.92); opacity: .9; } 100% { transform: scale(1.25); opacity: 0; } }
@keyframes acTwinkle { 0%, 100% { transform: rotate(0) scale(1); } 50% { transform: rotate(18deg) scale(1.12); } }

.ac-hero {
  position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 22px;
  color: #fff; isolation: isolate;
  background:
    radial-gradient(26rem 16rem at 8% -20%, rgba(255, 255, 255, .22), transparent 60%),
    radial-gradient(22rem 18rem at 105% 120%, rgba(34, 211, 238, .45), transparent 62%),
    linear-gradient(135deg, #4f46e5 0%, #7c3aed 52%, #0891b2 100%);
  box-shadow: 0 24px 50px -28px rgba(79, 70, 229, .8);
}
.ac-hero .ac-avatar { background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .35); box-shadow: none; }
.ac-hero__orbit { position: absolute; inset-inline-end: -60px; top: -60px; width: 260px; height: 260px; z-index: -1; opacity: .5; }
.ac-hero__orbit i {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-radius: 50%; border: 1px dashed rgba(255, 255, 255, .45);
  animation: acSpin 38s linear infinite;
}
.ac-hero__orbit i:nth-child(2) { top: 34px; right: 34px; bottom: 34px; left: 34px; animation-duration: 26s; animation-direction: reverse; }
.ac-hero__orbit i:nth-child(3) { top: 70px; right: 70px; bottom: 70px; left: 70px; animation-duration: 18s; }
.ac-hero__orbit i::after {
  content: ""; position: absolute; top: 50%; inset-inline-start: -5px; width: 9px; height: 9px; border-radius: 50%;
  background: #fde68a; box-shadow: 0 0 12px #fde68a;
}
@keyframes acSpin { to { transform: rotate(360deg); } }
.ac-hero__head { display: flex; gap: 14px; align-items: center; }
.ac-hero__kicker {
  display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-2xs); font-weight: 700;
  background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .3); padding: 2px 10px; border-radius: 999px;
}
.ac-hero__kicker .ico { width: 13px; height: 13px; }
.ac-hero__title { margin: 6px 0 4px; font-size: var(--fs-2xl); line-height: var(--lh-tight); color: #fff; }
.ac-hero__title .ac-grad { background: linear-gradient(120deg, #fde68a, #fff 60%, #a5f3fc); -webkit-background-clip: text; background-clip: text; }
.ac-hero__sub { margin: 0; opacity: .92; line-height: var(--lh-normal); }
.ac-hero__points { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 18px; }
@media (min-width: 760px) { .ac-hero__points { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ac-point {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: var(--r-md);
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); backdrop-filter: blur(6px);
}
.ac-point b { display: block; margin-bottom: 2px; }
.ac-point p { margin: 0; font-size: var(--fs-xs); line-height: var(--lh-normal); opacity: .92; }
.ac-point__icon { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: rgba(255, 255, 255, .2); flex: 0 0 auto; }
.ac-point__icon .ico { width: 18px; height: 18px; }
.ac-hero--compact { padding: 18px; }

.ac-consent { display: flex; flex-direction: column; gap: var(--sp-3); }
.ac-step { display: flex; align-items: center; gap: 10px; margin-top: var(--sp-2); }
.ac-step__n {
  width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: 13px;
  color: #fff; background: var(--grad-brand); box-shadow: 0 6px 14px -8px var(--accent);
}
.ac-classes { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 640px) { .ac-classes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ac-class { min-width: 0; }
.ac-all { background: var(--accent-a08); border-color: var(--accent-a18); }
.ac-kinds { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 640px) { .ac-kinds { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ac-kind { gap: 10px; }
.ac-kind__icon { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-a12); color: var(--accent); flex: 0 0 auto; }
.ac-kind__icon .ico { width: 16px; height: 16px; }
.ac-kind small, .ac-class small { line-height: 1.6; }
.ac-switch-row {
  display: flex; align-items: center; gap: var(--sp-3); padding: 10px 14px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface-2); cursor: pointer;
}
.ac-switch-row .switch { min-height: 0; }
.ac-costs { border-radius: var(--r-md); padding: 12px 16px; background: var(--warning-bg); border: 1px solid var(--warning-line); }
.ac-costs__title { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font-weight: 700; color: var(--warning); }
.ac-costs__title .ico { width: 17px; height: 17px; }
.ac-costs ul { margin: 0; padding-inline-start: 1.2em; font-size: var(--fs-sm); line-height: var(--lh-normal); }
.ac-privacy { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line-soft); }
.ac-privacy .ico { width: 18px; height: 18px; color: var(--success); margin-top: 3px; }
.ac-privacy p { margin: 0; font-size: var(--fs-xs); line-height: var(--lh-normal); color: var(--ink-2); }
.ac-start { min-height: 54px; font-size: var(--fs-md); }

.ac-top {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-radius: var(--r-xl);
  background: var(--grad-mesh), var(--surface-1); border: 1px solid var(--glass-border); box-shadow: var(--shadow-sm);
}
.ac-top__title { margin: 0; font-size: var(--fs-xl); line-height: var(--lh-tight); }
.ac-top__sub { margin: 2px 0 0; color: var(--ink-2); font-size: var(--fs-sm); }
.ac-top__chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ac-top__chips .badge .ico { width: 13px; height: 13px; }
@media (max-width: 640px) { .ac-top__chips { width: 100%; } .ac-top__chips .btn { margin-inline-start: auto; } }
.ac .block, .ac-home .block, .ac-quote .block { display: block; }
.ac-tabs .segmented__item { display: inline-flex; align-items: center; gap: 6px; position: relative; white-space: nowrap; }
.ac-tabs .segmented__item .ico { width: 16px; height: 16px; }
@media (max-width: 520px) {
  .ac-tabs { display: flex; width: 100%; }
  .ac-tabs .segmented__item { flex: 1 1 0; justify-content: center; padding-left: 6px; padding-right: 6px; font-size: var(--fs-xs); gap: 4px; }
  .ac-tabs .segmented__item .ico { width: 14px; height: 14px; }
}
@media (max-width: 360px) { .ac-tabs .segmented__item .ico { display: none; } }
.ac-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-3); box-shadow: 0 0 0 0 rgba(34, 211, 238, .6); animation: acBeat 1.6s infinite; }
@keyframes acBeat { 0% { box-shadow: 0 0 0 0 rgba(34, 211, 238, .55); } 100% { box-shadow: 0 0 0 9px rgba(34, 211, 238, 0); } }

.ac-chat { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
.ac-chat__log {
  display: flex; flex-direction: column; gap: 12px; overflow-y: auto; overscroll-behavior: contain;
  height: min(58vh, 560px); min-height: 300px; padding: 6px 4px 10px; scroll-behavior: smooth;
}
.ac-older { align-self: center; }
.ac-msg { display: flex; flex-direction: column; gap: 4px; max-width: 88%; }
.ac-msg--ai { align-self: flex-start; align-items: flex-start; }
.ac-msg--me { align-self: flex-end; align-items: flex-end; }
.ac-msg__who { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; color: var(--accent); padding-right: 6px; padding-left: 6px; }
.ac-msg__who .ico { width: 13px; height: 13px; }
.ac-msg__bubble {
  padding: 10px 14px; border-radius: 18px; line-height: var(--lh-normal); font-size: var(--fs-sm); word-break: break-word;
  background: var(--surface-2); border: 1px solid var(--line); box-shadow: var(--shadow-xs);
}
.ac-msg__bubble p { margin: 0 0 6px; }
.ac-msg__bubble p:last-child { margin-bottom: 0; }
.ac-msg__bubble ul { margin: 4px 0 6px; padding-inline-start: 1.2em; }
.ac-msg__bubble li { margin: 2px 0; }
.ac-msg--ai .ac-msg__bubble { border-end-start-radius: 6px; }
.ac-msg--me .ac-msg__bubble {
  background: linear-gradient(135deg, #5b5bf6, #7c3aed); color: #fff; border-color: transparent; border-end-end-radius: 6px;
  box-shadow: 0 8px 20px -12px rgba(91, 91, 246, .9);
}
.ac-msg.is-pending .ac-msg__bubble { opacity: .7; }
.ac-msg__time { font-size: 11px; color: var(--ink-3); padding-right: 6px; padding-left: 6px; }
.ac-msg__tag {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; border-radius: 999px;
  padding: 2px 10px; margin-bottom: 6px;
}
.ac-msg__tag .ico { width: 13px; height: 13px; }
.ac-msg__tag--proactive { background: var(--accent-a12); color: var(--accent); }
.ac-msg__tag--analysis { background: var(--success-bg); color: var(--success); }
.ac-msg__tag--crisis { background: var(--danger-bg); color: var(--danger); }
.ac-msg--proactive .ac-msg__bubble { border-color: var(--accent-a28); background: linear-gradient(160deg, var(--accent-a08), transparent 70%), var(--surface-2); }
.ac-msg--analysis .ac-msg__bubble { border-color: var(--success-line); background: linear-gradient(160deg, var(--success-bg), transparent 70%), var(--surface-2); }
.ac-msg--crisis .ac-msg__bubble { border-color: var(--danger-line); background: var(--danger-bg); }
.ac-msg__action { margin-top: 8px; }
.ac-note {
  align-self: center; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; text-align: center;
  max-width: 92%; font-size: var(--fs-xs); color: var(--ink-2); padding: 6px 12px; border-radius: 999px;
  background: var(--surface-2); border: 1px dashed var(--line);
}
.ac-note .ico { width: 14px; height: 14px; color: var(--info); }
.ac-note .ac-msg__time { padding: 0; }
.ac-typing { display: flex; align-items: center; gap: 8px; font-size: var(--fs-xs); color: var(--ink-3); padding-right: 6px; padding-left: 6px; }
.ac-dots { display: inline-flex; gap: 4px; }
.ac-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: acDot 1.2s infinite ease-in-out; }
.ac-dots i:nth-child(2) { animation-delay: .15s; }
.ac-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes acDot { 0%, 80%, 100% { transform: scale(.6); opacity: .5; } 40% { transform: scale(1); opacity: 1; } }
.ac-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.ac-chips::-webkit-scrollbar { display: none; }
.ac-chips .chip { white-space: nowrap; flex: 0 0 auto; }
.ac-composer { display: flex; gap: 8px; align-items: flex-end; }
.ac-input { flex: 1 1 auto; min-height: 52px; max-height: 160px; resize: vertical; border-radius: 16px; }
.ac-send {
  width: 52px; height: 52px; flex: 0 0 auto; border-radius: 16px; border: 0; cursor: pointer; color: #fff;
  background: var(--grad-brand); box-shadow: var(--shadow-accent); display: grid; place-items: center;
  transition: transform var(--dur-fast) var(--ease-out), opacity var(--dur-fast);
}
.ac-send .ico { width: 21px; height: 21px; }
html[dir="rtl"] .ac-send .ico { transform: scaleX(-1); }
.ac-send:hover { transform: translateY(-1px); }
.ac-send:disabled { opacity: .55; cursor: progress; transform: none; }
.ac-composer__meta { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); }

.ac-running { display: flex; flex-direction: column; gap: 10px; border-color: var(--accent-a28); }
.ac-running__head { display: flex; align-items: center; gap: 12px; }
.ac-running__head p { margin: 2px 0 0; }
.ac-scan {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: #fff; position: relative; overflow: hidden;
  background: var(--grad-brand);
}
.ac-scan::after {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: linear-gradient(180deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: translateY(-100%); animation: acScan 1.6s linear infinite;
}
@keyframes acScan { to { transform: translateY(100%); } }
.ac-progress { background: var(--grad-brand); transition: width .6s var(--ease-out); }
.ac-summary { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.ac-summary__ring { flex: 0 0 auto; }
.ac-summary > .grow { flex: 1 1 280px; }
.ac-summary__headline { margin: 8px 0 6px; font-size: var(--fs-lg); line-height: var(--lh-snug); }
.ac-summary p { margin: 0 0 6px; line-height: var(--lh-normal); }
.ac-motivation { display: flex; gap: 6px; align-items: flex-start; color: var(--accent); font-weight: 600; }
.ac-motivation .ico { width: 16px; height: 16px; margin-top: 4px; }
.ac-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 760px) { .ac-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ac-kpi {
  display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: var(--r-md);
  background: var(--card-bg); border: 1px solid var(--line); box-shadow: var(--shadow-xs); min-width: 0;
}
.ac-kpi b { font-size: var(--fs-lg); }
.ac-kpi__icon { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-a12); color: var(--accent); flex: 0 0 auto; }
.ac-kpi__icon .ico { width: 18px; height: 18px; }
.ac-trend { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 auto; }
.ac-trend .ico { width: 16px; height: 16px; }
.ac-trend--success { background: var(--success-bg); color: var(--success); }
.ac-trend--danger { background: var(--danger-bg); color: var(--danger); }
.ac-trend--info { background: var(--info-bg); color: var(--info); }
.ac-trend--muted { background: var(--surface-3); color: var(--ink-3); }
.ac-grid2 { display: grid; grid-template-columns: 1fr; gap: var(--sp-3); }
@media (min-width: 900px) { .ac-grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ac-grid2:empty { display: none; }
.ac-list .card__title .ico { width: 17px; height: 17px; }
.ac-list--success .card__title { color: var(--success); }
.ac-list--warning .card__title { color: var(--warning); }
.ac-list--info .card__title { color: var(--info); }
.ac-item {
  padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line-soft);
  border-inline-start: 3px solid var(--accent-a45);
}
.ac-list--success .ac-item { border-inline-start-color: var(--success); }
.ac-list--warning .ac-item { border-inline-start-color: var(--warning); }
.ac-item--high { border-inline-start-color: var(--danger) !important; }
.ac-item b { font-size: var(--fs-sm); }
.ac-item p { margin: 4px 0; font-size: var(--fs-sm); line-height: var(--lh-normal); color: var(--ink-2); }
.ac-item small { display: inline-flex; gap: 4px; align-items: center; }
.ac-item small .ico { width: 12px; height: 12px; }
.ac-action { display: flex; gap: 6px; align-items: flex-start; color: var(--accent) !important; font-weight: 600; }
.ac-action .ico { width: 14px; height: 14px; margin-top: 5px; }
html[dir="ltr"] .ac-action .ico { transform: scaleX(-1); }
.ac-topics { display: flex; flex-wrap: wrap; gap: 8px; }
.ac-topic {
  display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 600;
  background: var(--surface-3); border: 1px solid var(--line); color: var(--ink);
}
.ac-topic small { font-weight: 400; color: var(--ink-3); font-size: 11px; }
.ac-topic--weak { background: var(--danger-bg); border-color: var(--danger-line); color: var(--danger); }
.ac-topic--review { background: var(--warning-bg); border-color: var(--warning-line); color: var(--warning); }
.ac-topic--strong { background: var(--success-bg); border-color: var(--success-line); color: var(--success); }
.ac-topics--sm .ac-topic { padding: 2px 9px; font-weight: 500; }
.ac-legend { display: flex; gap: 6px; align-items: center; margin: 10px 0 0; }
.ac-legend .ac-topic { padding: 1px 8px; font-size: 11px; }
.ac-classgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.ac-class-card { padding: 12px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); min-width: 0; }
.ac-class-card__avg { font-size: var(--fs-2xl); font-weight: 800; margin: 4px 0; background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ac-class-card p { margin: 6px 0 0; color: var(--ink-2); line-height: var(--lh-normal); }
.ac-spark { height: 32px; margin-bottom: 4px; }
.ac-spark .sparkline { width: 100%; height: 32px; }
.ac-week { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
@media (min-width: 1180px) { .ac-week { grid-auto-flow: row; grid-template-columns: repeat(7, minmax(0, 1fr)); overflow: visible; } }
.ac-day {
  display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: var(--r-md); scroll-snap-align: start;
  background: var(--surface-2); border: 1px solid var(--line); min-width: 0;
}
.ac-day.is-today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-a28), var(--glow-soft); }
.ac-day__head { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.ac-day__head small { color: var(--ink-3); font-size: 11px; }
.ac-day__foot { margin-top: auto; font-size: 11px; color: var(--ink-3); border-top: 1px dashed var(--line); padding-top: 6px; }
.ac-task { display: flex; gap: 8px; align-items: flex-start; font-size: var(--fs-xs); line-height: 1.6; padding: 6px 8px; border-radius: 10px; background: var(--surface-1); }
.ac-task > .ico { width: 15px; height: 15px; margin-top: 3px; color: var(--accent); }
.ac-task--exam_prep > .ico { color: var(--danger); }
.ac-task--practice > .ico { color: var(--warning); }
.ac-task--task > .ico { color: var(--info); }
.ac-task--rest > .ico { color: var(--success); }
.ac-bullets { margin: 0; padding-inline-start: 1.2em; line-height: var(--lh-normal); }
.ac-sources summary { cursor: pointer; list-style: none; }
.ac-sources summary::-webkit-details-marker { display: none; }
.ac-empty-report { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: var(--sp-6); }
.ac-empty-report h2 { margin: 6px 0 0; font-size: var(--fs-lg); }
.ac-empty-report p { margin: 0; max-width: 620px; line-height: var(--lh-normal); }

.ac-quote { display: flex; flex-direction: column; gap: 12px; }
.ac-quote__facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 640px) { .ac-quote__facts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ac-quote__facts > div { padding: 10px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line-soft); }
.ac-quote__facts small { display: block; font-size: 11px; }
.ac-quote__facts b { font-size: var(--fs-md); }
.ac-quote__facts b small { display: inline; font-weight: 400; color: var(--ink-3); }
.ac-quote__files { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 12px; background: var(--surface-2); }
.ac-quote__files summary { cursor: pointer; font-size: var(--fs-sm); font-weight: 600; }
.ac-quote__files ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ac-quote__files li { display: flex; gap: 8px; align-items: center; font-size: var(--fs-xs); min-width: 0; }
.ac-quote__files li .ico { width: 14px; height: 14px; color: var(--accent); }
.ac-quote__files--out li .ico { color: var(--ink-3); }
.ac-levels { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
.ac-level {
  text-align: center; font-size: 11px; padding: 6px 2px; border-radius: 8px; background: var(--surface-3); color: var(--ink-3);
  border: 1px solid transparent; transition: all var(--dur-base) var(--ease-out);
}
.ac-level.is-past { background: var(--accent-a12); color: var(--accent); }
.ac-level.is-on { background: var(--grad-brand); color: #fff; font-weight: 700; box-shadow: var(--shadow-accent); transform: translateY(-2px); }
.ac-quote__lines { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
.ac-quote__lines p { margin: 0; }
.ac-quote__total { border-top: 1px dashed var(--line-strong); padding-top: 8px; margin-top: 2px; font-size: var(--fs-md); }
.ac-quote__total b { color: var(--accent); font-size: var(--fs-lg); }

.ac-timeline { display: flex; flex-direction: column; position: relative; }
.ac-timeline::before { content: ""; position: absolute; top: 10px; bottom: 10px; inset-inline-start: 7px; width: 2px; background: var(--line); }
.ac-tl { display: flex; align-items: center; gap: 12px; padding: 9px 0; position: relative; min-width: 0; }
.ac-tl__dot { width: 16px; height: 16px; border-radius: 50%; flex: 0 0 auto; background: var(--surface-1); border: 3px solid var(--accent); z-index: 1; }
.ac-tl.is-live .ac-tl__dot { border-color: var(--danger); animation: acBeat 1.6s infinite; }
.ac-tl__when { text-align: end; flex: 0 0 auto; font-size: var(--fs-xs); display: flex; flex-direction: column; align-items: flex-end; }
.ac-tl__when small { font-size: 11px; }
.ac-danger { border-color: var(--danger-line); }

.ac-home {
  all: unset; box-sizing: border-box; cursor: pointer; width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: var(--r-lg); border: 1px solid var(--accent-a28);
  background: linear-gradient(120deg, var(--accent-a12), rgba(34, 211, 238, .08) 70%), var(--surface-1);
  box-shadow: var(--shadow-sm); transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast);
}
.ac-home:hover { transform: translateY(-2px); box-shadow: var(--glow-accent); }
.ac-home:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; }
.ac-home b { font-size: var(--fs-sm); }
.ac-home small { font-size: var(--fs-xs); line-height: 1.6; }
.ac-home--invite { position: relative; overflow: hidden; }
.ac-home--invite::after {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: var(--grad-sheen); transform: translateX(-100%);
  animation: acSheen 4.5s ease-in-out infinite;
}
html[dir="rtl"] .ac-home--invite::after { transform: translateX(100%); animation-name: acSheenRtl; }
@keyframes acSheen { 0%, 60% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
@keyframes acSheenRtl { 0%, 60% { transform: translateX(100%); } 100% { transform: translateX(-100%); } }
.ac-home__kicker {
  display: inline-block; font-size: 11px; font-weight: 800; color: #4a2d00; background: #fbbf24; border-radius: 999px; padding: 0 8px; margin-bottom: 2px;
}
.ac-home .btn { pointer-events: none; }

.ac-dl .btn .ico { width: 15px; height: 15px; }
.aca-log {
  display: flex; flex-direction: column; gap: 8px; max-height: 56vh; overflow-y: auto; overscroll-behavior: contain;
  padding: 10px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line);
}
.aca-msg {
  padding: 8px 12px; border-radius: 12px; background: var(--surface-1); border: 1px solid var(--line-soft);
  border-inline-start: 3px solid var(--line-strong); max-width: 92%; align-self: flex-start;
}
.aca-msg--student { align-self: flex-end; border-inline-start-color: var(--accent); background: var(--accent-a08); }
.aca-msg--assistant { border-inline-start-color: var(--accent-3, #22d3ee); }
.aca-msg--system { align-self: center; border-inline-start-color: var(--info); font-size: var(--fs-xs); }
.aca-msg__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; margin-bottom: 3px; }
.aca-msg__head small { margin-inline-start: auto; font-size: 11px; }
.aca-msg__body { white-space: pre-wrap; word-break: break-word; font-size: var(--fs-sm); line-height: var(--lh-normal); }
.aca-user { display: flex; flex-direction: column; gap: 8px; }
.aca-user .strong .ico { width: 16px; height: 16px; color: var(--accent); vertical-align: -3px; }
.aca-user p { margin: 0; }
.aca-row { flex-wrap: wrap; }
.aca-row__actions {
  flex: 1 0 100%; display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center;
  padding-inline-start: 52px; margin-top: 2px;
}
@media (max-width: 520px) { .aca-row__actions { padding-inline-start: 0; } }
[data-academic-user]:empty { display: none; }

@media (prefers-reduced-motion: reduce) {
  .ac-hero__orbit i, .ac-avatar__pulse, .ac-avatar__spark, .ac-dot, .ac-dots i, .ac-scan::after, .ac-home--invite::after, .ac-tl.is-live .ac-tl__dot { animation: none !important; }
}
@media (max-width: 520px) {
  .ac-hero { padding: 18px; }
  .ac-hero__title { font-size: var(--fs-xl); }
  .ac-msg { max-width: 94%; }
  .ac-chat__log { height: min(56vh, 520px); }
}

@supports not ((inset-inline-start: 0) or (inset-inline-end: 0)) {
  html[dir="rtl"] .ac-avatar__spark { left: -6px; }
  html[dir="ltr"] .ac-avatar__spark { right: -6px; }
  html[dir="rtl"] .ac-avatar__badge { left: -6px; }
  html[dir="ltr"] .ac-avatar__badge { right: -6px; }
  html[dir="rtl"] .ac-hero__orbit { left: -60px; }
  html[dir="ltr"] .ac-hero__orbit { right: -60px; }
  html[dir="rtl"] .ac-hero__orbit i::after { right: -5px; }
  html[dir="ltr"] .ac-hero__orbit i::after { left: -5px; }
  html[dir="rtl"] .ac-costs ul { padding-right: 1.2em; }
  html[dir="ltr"] .ac-costs ul { padding-left: 1.2em; }
  @media (max-width: 640px) { html[dir="rtl"] .ac-top__chips .btn { margin-right: auto; } }
  @media (max-width: 640px) { html[dir="ltr"] .ac-top__chips .btn { margin-left: auto; } }
  html[dir="rtl"] .ac-msg__bubble ul { padding-right: 1.2em; }
  html[dir="ltr"] .ac-msg__bubble ul { padding-left: 1.2em; }
  html[dir="rtl"] .ac-msg--ai .ac-msg__bubble { border-bottom-right-radius: 6px; }
  html[dir="ltr"] .ac-msg--ai .ac-msg__bubble { border-bottom-left-radius: 6px; }
  html[dir="rtl"] .ac-msg--me .ac-msg__bubble { border-bottom-left-radius: 6px; }
  html[dir="ltr"] .ac-msg--me .ac-msg__bubble { border-bottom-right-radius: 6px; }
  html[dir="rtl"] .ac-item { border-right: 3px solid var(--accent-a45); }
  html[dir="ltr"] .ac-item { border-left: 3px solid var(--accent-a45); }
  html[dir="rtl"] .ac-list--success .ac-item { border-right-color: var(--success); }
  html[dir="ltr"] .ac-list--success .ac-item { border-left-color: var(--success); }
  html[dir="rtl"] .ac-list--warning .ac-item { border-right-color: var(--warning); }
  html[dir="ltr"] .ac-list--warning .ac-item { border-left-color: var(--warning); }
  html[dir="rtl"] .ac-item--high { border-right-color: var(--danger) !important; }
  html[dir="ltr"] .ac-item--high { border-left-color: var(--danger) !important; }
  html[dir="rtl"] .ac-bullets { padding-right: 1.2em; }
  html[dir="ltr"] .ac-bullets { padding-left: 1.2em; }
  html[dir="rtl"] .ac-timeline::before { right: 7px; }
  html[dir="ltr"] .ac-timeline::before { left: 7px; }
  html[dir="rtl"] .aca-msg { border-right: 3px solid var(--line-strong); }
  html[dir="ltr"] .aca-msg { border-left: 3px solid var(--line-strong); }
  html[dir="rtl"] .aca-msg--student { border-right-color: var(--accent); }
  html[dir="ltr"] .aca-msg--student { border-left-color: var(--accent); }
  html[dir="rtl"] .aca-msg--assistant { border-right-color: var(--accent-3, #22d3ee); }
  html[dir="ltr"] .aca-msg--assistant { border-left-color: var(--accent-3, #22d3ee); }
  html[dir="rtl"] .aca-msg--system { border-right-color: var(--info); }
  html[dir="ltr"] .aca-msg--system { border-left-color: var(--info); }
  html[dir="rtl"] .aca-msg__head small { margin-right: auto; }
  html[dir="ltr"] .aca-msg__head small { margin-left: auto; }
  html[dir="rtl"] .aca-row__actions { padding-right: 52px; }
  html[dir="ltr"] .aca-row__actions { padding-left: 52px; }
  @media (max-width: 520px) { html[dir="rtl"] .aca-row__actions { padding-right: 0; } }
  @media (max-width: 520px) { html[dir="ltr"] .aca-row__actions { padding-left: 0; } }
}

.cc {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 980px;
  margin-right: auto;
  margin-left: auto;
  height: calc(100vh - var(--topbar-h) - var(--tabbar-h) - var(--sp-5) - var(--sp-2) - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  height: calc(100dvh - var(--topbar-h) - var(--tabbar-h) - var(--sp-5) - var(--sp-2) - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  min-height: 380px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface-1-t);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.cc--embedded {
  height: 62vh;
  height: clamp(380px, calc(100vh - 330px), 720px);
  height: clamp(380px, calc(100dvh - 330px), 720px);
  max-width: none;
  box-shadow: none;
}

.modal .cc--embedded { height: 60vh; height: clamp(360px, calc(100vh - 260px), 640px); height: clamp(360px, calc(100dvh - 260px), 640px); border-radius: var(--r-md); }

.cc__state {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--sp-4);
  overflow-y: auto;
}

.cc__head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--line);
  background: var(--surface-2-t);
}

.cc__avatar {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  background: var(--grad-brand);
  color: #fff;
  box-shadow: 0 6px 16px var(--accent-a28);
}

.cc__title {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: var(--fs-sm);
}

.cc__sub { font-size: var(--fs-2xs); color: var(--ink-3); }

.cc__tools { flex: 0 0 auto; display: flex; align-items: center; gap: 2px; }
.cc__tools .btn--icon.btn--sm { width: 40px; min-width: 40px; min-height: 40px; }

.cc__search {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--line);
  background: var(--surface-2-t);
}

.cc__search[hidden] { display: none; }
.cc__search .input-wrap { flex: 1 1 auto; min-width: 0; }
.cc__search .input { min-height: 40px; height: 40px; }

.cc__banner { flex: 0 0 auto; }
.cc__banner:empty { display: none; }
.cc__banner .alert {
  align-items: center;
  flex-wrap: wrap;
  margin: var(--sp-2) var(--sp-3) 0;
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--fs-xs);
}
.cc__banner .alert:last-child { margin-bottom: var(--sp-2); }
.cc__banner .alert__body { flex: 1 1 200px; }
.cc__usage { display: block; margin-top: 2px; opacity: .85; font-variant-numeric: tabular-nums; }

.cc__pins { flex: 0 0 auto; }
.cc__pins:empty { display: none; }

.cc-pin {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--line);
  background: var(--accent-a08);
}

.cc-pin__icon { flex: 0 0 auto; color: var(--accent); display: inline-flex; }

.cc-pin__main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 2px var(--sp-2);
  border-inline-start: 2px solid var(--accent);
  border-radius: 4px;
  text-align: start;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.cc-pin__main:hover { background: var(--accent-a12); }
.cc-pin__label { font-size: var(--fs-2xs); font-weight: var(--fw-semibold); color: var(--accent); }
.cc-pin__text { font-size: var(--fs-xs); color: var(--ink-2); }

.cc__body { position: relative; flex: 1 1 auto; min-height: 0; display: flex; }

.cc__scroll {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: var(--sp-3) var(--sp-3) var(--sp-4);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

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

.cc__list {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 3px;
  min-height: 100%;
}

.cc__empty { margin: auto 0; }
.cc__empty .empty { padding: var(--sp-8) var(--sp-4); }
.cc__more { display: flex; justify-content: center; padding: var(--sp-1) 0 var(--sp-2); }

.cc-sep {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: var(--sp-3) 0 var(--sp-2);
  font-size: var(--fs-2xs);
  color: var(--ink-3);
}

.cc-sep span {
  padding: 3px var(--sp-3);
  border-radius: var(--r-full);
  background: var(--surface-3);
  border: 1px solid var(--line-soft);
}

.cc-sep--new { gap: var(--sp-2); color: var(--accent); font-weight: var(--fw-semibold); }
.cc-sep--new::before,
.cc-sep--new::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--accent-a45); }
.cc-sep--new span { background: var(--accent-a12); border-color: var(--accent-a28); }

.cc-msg {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  max-width: 88%;
  margin-top: var(--sp-2);
  border-radius: var(--r-sm);
  transition: background var(--dur-slow) var(--ease-out);
}

.cc-msg.is-joined { margin-top: 0; }
.cc-msg--other { align-self: flex-start; }
.cc-msg--mine { align-self: flex-end; flex-direction: row-reverse; }
.cc-msg.is-flash { background: var(--accent-a18); box-shadow: 0 0 0 6px var(--accent-a18); }

.cc-msg__avatar {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  background: var(--surface-4);
  color: var(--ink-2);
  box-shadow: inset 0 0 0 1px var(--line);
}

.cc-msg.is-joined .cc-msg__avatar { visibility: hidden; height: 0; }

.cc-msg__col { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cc-msg--mine .cc-msg__col { align-items: flex-end; }
.cc-msg--other .cc-msg__col { align-items: flex-start; }

.cc-msg__meta {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  max-width: 100%;
  padding: 0 var(--sp-2);
  font-size: var(--fs-2xs);
  color: var(--ink-3);
}

.cc-msg__author { font-weight: var(--fw-semibold); color: var(--ink-2); }
.cc-msg__meta .badge { padding: 0 6px; font-size: 11px; }

.cc-msg__line { display: flex; align-items: center; gap: var(--sp-1); max-width: 100%; }
.cc-msg--mine .cc-msg__line { flex-direction: row-reverse; }

.cc-msg__bubble {
  min-width: 0;
  max-width: 100%;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  line-height: var(--lh-snug);
  background: var(--surface-3);
  color: var(--ink);
  border: 1px solid var(--line);
  border-end-start-radius: var(--r-xs);
  overflow-wrap: anywhere;
}

.cc-msg.is-joined.cc-msg--other .cc-msg__bubble { border-start-start-radius: var(--r-xs); }

.cc-msg--mine .cc-msg__bubble {
  background: var(--grad-brand);
  color: #fff;
  border-color: transparent;
  border-end-start-radius: var(--r-md);
  border-end-end-radius: var(--r-xs);
  box-shadow: 0 6px 18px var(--accent-a28);
}

.cc-msg.is-joined.cc-msg--mine .cc-msg__bubble { border-start-end-radius: var(--r-xs); }
.cc-msg.is-pinned .cc-msg__bubble { box-shadow: 0 0 0 2px var(--accent-a45); }
.cc-msg.is-pending .cc-msg__bubble { opacity: .7; }
.cc-msg.is-failed .cc-msg__bubble { background: var(--danger-bg); color: var(--ink); border-color: var(--danger-line); box-shadow: none; }

.cc-msg__bubble--gone,
.cc-msg--mine .cc-msg__bubble--gone {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: transparent;
  color: var(--ink-3);
  border: 1px dashed var(--line-strong);
  box-shadow: none;
  font-size: var(--fs-xs);
  font-style: italic;
}

.cc-msg__text { white-space: pre-wrap; text-align: start; }

.cc-link {
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  color: var(--accent);
  unicode-bidi: isolate;
  word-break: break-all;
}

.cc-msg--mine .cc-link { color: #fff; }
.cc-link:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; border-radius: 3px; }

.cc-msg__foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-2);
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.4;
  opacity: .72;
  font-variant-numeric: tabular-nums;
}

.cc-msg__time { font-size: 11px; opacity: .85; }
.cc-msg__flag, .cc-msg__status { display: inline-flex; }
.cc-msg__status--bad { color: var(--danger); }

.cc-msg__failed {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-1);
  font-size: var(--fs-2xs);
  color: var(--danger);
}

.cc-msg__actions { flex: 0 0 auto; display: flex; align-items: center; gap: 2px; }

.cc-act {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--ink-3);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out);
}

.cc-act .ico { width: 17px; height: 17px; }
.cc-act:hover { background: var(--surface-3); color: var(--ink); }
.cc-act:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

@media (hover: hover) and (pointer: fine) {
  .cc-act { opacity: 0; }
  .cc-msg:hover .cc-act,
  .cc-msg:focus-within .cc-act { opacity: 1; }
}

@media (hover: none), (pointer: coarse) {
  .cc-act[data-cc-act="react"],
  .cc-act[data-cc-act="reply"] { display: none; }
  .cc-act { width: 34px; height: 34px; }
}

.cc-quote {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-bottom: var(--sp-1);
  padding: 4px var(--sp-2);
  border-inline-start: 3px solid var(--accent);
  border-radius: 6px;
  background: var(--accent-a08);
  color: inherit;
  font: inherit;
  font-size: var(--fs-2xs);
  text-align: start;
  cursor: pointer;
}

.cc-quote--gone { cursor: default; font-style: italic; opacity: .8; }
.cc-quote__author { font-weight: var(--fw-semibold); color: var(--accent); }
.cc-quote__text { opacity: .85; }
.cc-msg--mine .cc-quote { background: rgba(255, 255, 255, .16); border-inline-start-color: rgba(255, 255, 255, .8); }
.cc-msg--mine .cc-quote__author { color: #fff; }
.cc-quote:focus-visible { outline: 2px solid currentColor; outline-offset: 1px; }

.cc-img {
  display: block;
  width: 240px;
  max-width: 100%;
  max-height: 320px;
  min-height: 80px;
  margin-bottom: var(--sp-1);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--skeleton-2);
  cursor: zoom-in;
}

.cc-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cc-img img:not([src]) { visibility: hidden; }
.cc-img:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.cc-file {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  width: 100%;
  max-width: 280px;
  min-width: 0;
  margin-bottom: var(--sp-1);
  padding: var(--sp-2);
  border-radius: var(--r-sm);
  background: var(--surface-1);
  border: 1px solid var(--line);
  color: var(--ink);
  font: inherit;
  text-align: start;
}

button.cc-file { cursor: pointer; }
button.cc-file:hover { border-color: var(--accent); }
button.cc-file:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cc-file--gone { opacity: .7; border-style: dashed; }
.cc-msg--mine .cc-file { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .28); color: #fff; }

.cc-file__icon {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: var(--r-xs);
  background: var(--accent-a12);
  color: var(--accent);
}

.cc-msg--mine .cc-file__icon { background: rgba(255, 255, 255, .2); color: #fff; }
.cc-file__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cc-file__name { font-size: var(--fs-xs); font-weight: var(--fw-semibold); }
.cc-file__meta { font-size: 11px; opacity: .75; }
.cc-file__get { flex: 0 0 auto; display: inline-flex; opacity: .8; }

.cc-reacts { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 var(--sp-1); }

.cc-react {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 26px;
  padding: 0 var(--sp-2);
  border-radius: var(--r-full);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: var(--fs-2xs);
  cursor: pointer;
}

.cc-react:hover:not(:disabled) { border-color: var(--accent); }
.cc-react.is-mine { background: var(--accent-a18); border-color: var(--accent); color: var(--ink); }
.cc-react:disabled { cursor: default; }
.cc-react:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.cc__jump {
  position: absolute;
  bottom: var(--sp-3);
  inset-inline-end: var(--sp-3);
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--glass-strong);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  z-index: 2;
}

.cc__jump[hidden] { display: none; }
.cc__jump:hover { border-color: var(--accent); color: var(--accent); }
.cc__jump:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.cc__jump-badge {
  position: absolute;
  top: -6px;
  inset-inline-start: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-full);
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: var(--fw-bold);
}

.cc__results {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 3;
  padding: var(--sp-3);
  overflow-y: auto;
  background: var(--surface-1);
}

.cc__results[hidden] { display: none; }
.cc-hit { min-height: 56px; }
.cc-hit__text { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cc-hit__note { padding: var(--sp-3) var(--sp-2); }

.cc__composer {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3) var(--sp-3);
  border-top: 1px solid var(--line);
  background: var(--surface-2-t);
}

.cc__row { display: flex; align-items: flex-end; gap: var(--sp-2); }
.cc__row .btn--icon { flex: 0 0 auto; width: 44px; min-width: 44px; min-height: 44px; border-radius: 50%; }
.cc__send .ico { width: 19px; height: 19px; }
html[dir="rtl"] .cc__send .ico { transform: scaleX(-1); }

.cc__input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  max-height: 140px;
  padding: 10px var(--sp-3);
  border-radius: var(--r-md);
  resize: none;
  line-height: var(--lh-snug);
  font-size: var(--fs-md);
}

.cc__hint { min-height: 0; font-size: var(--fs-2xs); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.cc__hint:empty { display: none; }

.cc__context,
.cc__attach {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--r-xs);
  background: var(--surface-3);
  border-inline-start: 3px solid var(--accent);
}

.cc__context[hidden],
.cc__attach[hidden] { display: none; }
.cc__context-icon { flex: 0 0 auto; color: var(--accent); display: inline-flex; }
.cc__context-body, .cc__attach-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.cc__context-title { font-size: var(--fs-2xs); font-weight: var(--fw-semibold); color: var(--accent); }
.cc__context-text { font-size: var(--fs-xs); color: var(--ink-2); }

.cc__notice {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-1);
  font-size: var(--fs-xs);
  color: var(--ink-2);
}

.cc__notice-icon { flex: 0 0 auto; display: inline-flex; color: var(--ink-3); }

.cc-pop {
  position: fixed;
  z-index: 250;
  display: flex;
  gap: 2px;
  padding: 6px;
  border-radius: var(--r-full);
  background: var(--surface-1);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg);
}

.cc-emoji {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}

.cc-emoji:hover { background: var(--surface-3); transform: scale(1.15); }
.cc-emoji.is-mine { background: var(--accent-a18); box-shadow: inset 0 0 0 1px var(--accent); }
.cc-emoji:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.cc-sheet__emoji {
  display: flex;
  justify-content: space-between;
  gap: 2px;
  margin-bottom: var(--sp-3);
  padding: var(--sp-1);
  border-radius: var(--r-full);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.cc-sheet { display: flex; flex-direction: column; gap: 2px; }

.cc-sheet__item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  min-height: var(--tap);
  padding: 0 var(--sp-3);
  border-radius: var(--r-sm);
  color: var(--ink);
  font: inherit;
  font-size: var(--fs-sm);
  text-align: start;
  cursor: pointer;
}

.cc-sheet__item:hover { background: var(--surface-3); }
.cc-sheet__item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.cc-sheet__item.is-danger { color: var(--danger); }
.cc-sheet__icon { flex: 0 0 auto; display: inline-flex; color: var(--ink-3); }
.cc-sheet__item.is-danger .cc-sheet__icon { color: inherit; }

.cc-lightbox {
  display: grid;
  place-items: center;
  min-height: 200px;
  border-radius: var(--r-sm);
  background: var(--surface-3);
  overflow: hidden;
}

.cc-lightbox img { display: block; max-width: 100%; max-height: 68vh; object-fit: contain; }

.cc-set { display: flex; flex-direction: column; }

.cc-set__row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
}

.cc-set__row:last-child { border-bottom: 0; }
.cc-set__title { display: block; font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.cc-set__desc { display: block; margin-top: 2px; font-size: var(--fs-2xs); color: var(--ink-3); line-height: var(--lh-snug); }

.cc-set__usage {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-top: var(--sp-5);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--line);
}

.cc-meter__head { display: flex; justify-content: space-between; gap: var(--sp-2); font-size: var(--fs-xs); color: var(--ink-2); }
.cc-meter__track { height: 8px; margin-top: 6px; border-radius: var(--r-full); background: var(--surface-4); overflow: hidden; }
.cc-meter__fill { display: block; height: 100%; border-radius: var(--r-full); background: var(--accent); }
.cc-meter.is-warn .cc-meter__fill { background: var(--warning); }
.cc-meter.is-full .cc-meter__fill { background: var(--danger); }

.cc-members__count { margin-bottom: var(--sp-3); }
.cc-member { flex-wrap: wrap; }
.cc-member__badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.cc-members__mute { width: auto; min-width: 140px; min-height: 36px; height: 36px; padding-top: 0; padding-bottom: 0; font-size: var(--fs-xs); }

.cc-pinrow { gap: var(--sp-2); }
.cc-pinrow__main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.cc-pinrow__main:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.cc-card-badge { flex: 0 0 auto; }
.quick-action { position: relative; }
.quick-action .cc-quick-badge { position: absolute; top: var(--sp-2); inset-inline-end: var(--sp-2); }

@media (min-width: 900px) {
  .cc {
    height: calc(100vh - var(--topbar-h) - 10px - var(--sp-8) - var(--sp-8) - 56px);
    height: calc(100dvh - var(--topbar-h) - 10px - var(--sp-8) - var(--sp-8) - 56px);
  }
  .cc--embedded { height: 62vh; height: clamp(380px, calc(100vh - 330px), 720px); height: clamp(380px, calc(100dvh - 330px), 720px); }
  .cc-msg { max-width: 72%; }
  .cc__scroll { padding: var(--sp-4) var(--sp-5) var(--sp-5); }
  .cc__composer { padding: var(--sp-3) var(--sp-4) var(--sp-4); }
  .cc-img { width: 300px; }
}

@media (min-width: 900px) and (max-width: 1480px) {
  .cc--widget {
    width: calc(100% - 40px);
    margin-inline-start: auto;
    margin-inline-end: 40px;
  }
}

@media (max-width: 899px) {
  .cc--widget .cc__row { padding-inline-end: 40px; }
  .cc--widget .cc__jump { inset-inline-end: auto; inset-inline-start: var(--sp-3); }
  .cc--widget .cc__jump-badge { inset-inline-start: auto; inset-inline-end: -4px; }
}

@media (max-width: 420px) {
  .cc { border-radius: var(--r-md); }
  .cc__head { padding: var(--sp-2) var(--sp-3); }
  .cc-msg { max-width: 92%; }
  .cc-emoji { width: 34px; height: 34px; font-size: 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .cc-msg, .cc-act, .cc-emoji { transition: none; }
  .cc-emoji:hover { transform: none; }
}

@supports not ((inset-inline-start: 0) or (inset-inline-end: 0)) {
  html[dir="rtl"] .cc-pin__main { border-right: 2px solid var(--accent); }
  html[dir="ltr"] .cc-pin__main { border-left: 2px solid var(--accent); }
  html[dir="rtl"] .cc-msg__bubble { border-bottom-right-radius: var(--r-xs); }
  html[dir="ltr"] .cc-msg__bubble { border-bottom-left-radius: var(--r-xs); }
  html[dir="rtl"] .cc-msg.is-joined.cc-msg--other .cc-msg__bubble { border-top-right-radius: var(--r-xs); }
  html[dir="ltr"] .cc-msg.is-joined.cc-msg--other .cc-msg__bubble { border-top-left-radius: var(--r-xs); }
  html[dir="rtl"] .cc-msg--mine .cc-msg__bubble { border-bottom-right-radius: var(--r-md); border-bottom-left-radius: var(--r-xs); }
  html[dir="ltr"] .cc-msg--mine .cc-msg__bubble { border-bottom-left-radius: var(--r-md); border-bottom-right-radius: var(--r-xs); }
  html[dir="rtl"] .cc-msg.is-joined.cc-msg--mine .cc-msg__bubble { border-top-left-radius: var(--r-xs); }
  html[dir="ltr"] .cc-msg.is-joined.cc-msg--mine .cc-msg__bubble { border-top-right-radius: var(--r-xs); }
  html[dir="rtl"] .cc-quote { border-right: 3px solid var(--accent); }
  html[dir="ltr"] .cc-quote { border-left: 3px solid var(--accent); }
  html[dir="rtl"] .cc-msg--mine .cc-quote { border-right-color: rgba(255, 255, 255, .8); }
  html[dir="ltr"] .cc-msg--mine .cc-quote { border-left-color: rgba(255, 255, 255, .8); }
  html[dir="rtl"] .cc__jump { left: var(--sp-3); }
  html[dir="ltr"] .cc__jump { right: var(--sp-3); }
  html[dir="rtl"] .cc__jump-badge { right: -4px; }
  html[dir="ltr"] .cc__jump-badge { left: -4px; }
  html[dir="rtl"] .cc__context,
html[dir="rtl"] .cc__attach { border-right: 3px solid var(--accent); }
  html[dir="ltr"] .cc__context,
html[dir="ltr"] .cc__attach { border-left: 3px solid var(--accent); }
  html[dir="rtl"] .quick-action .cc-quick-badge { left: var(--sp-2); }
  html[dir="ltr"] .quick-action .cc-quick-badge { right: var(--sp-2); }
  @media (min-width: 900px) and (max-width: 1480px) { html[dir="rtl"] .cc--widget { margin-right: auto; margin-left: 40px; } }
  @media (min-width: 900px) and (max-width: 1480px) { html[dir="ltr"] .cc--widget { margin-left: auto; margin-right: 40px; } }
  @media (max-width: 899px) { html[dir="rtl"] .cc--widget .cc__row { padding-left: 40px; } }
  @media (max-width: 899px) { html[dir="ltr"] .cc--widget .cc__row { padding-right: 40px; } }
  @media (max-width: 899px) { html[dir="rtl"] .cc--widget .cc__jump { left: auto; right: var(--sp-3); } }
  @media (max-width: 899px) { html[dir="ltr"] .cc--widget .cc__jump { right: auto; left: var(--sp-3); } }
  @media (max-width: 899px) { html[dir="rtl"] .cc--widget .cc__jump-badge { right: auto; left: -4px; } }
  @media (max-width: 899px) { html[dir="ltr"] .cc--widget .cc__jump-badge { left: auto; right: -4px; } }
}

