/* Source: accepted landing mockup /ds v15, 2026-11-14. See landing/README.md. */
/* Дизайн-система JARV. Единственный источник дизайна для макетов и оболочки.
   Обновляется через preview (id: ds). Подключать только ссылкой, не копировать:
   <link rel="stylesheet" href="/ds/jarv-ds.css">, на корне class="j-root".
   Тема: data-theme="dark" или class="dark" на <html>. */
@import url("https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap");

:root{
    /* Semantic OKLCH tokens (light theme) */
    --bg: oklch(0.985 0.002 260);
    --bg-elev: oklch(0.97 0.003 260);
    --surface: oklch(1 0 0);
    --surface-2: oklch(0.965 0.004 260);
    --hover: oklch(0.5 0.01 260 / 0.08);
    --surface-border: oklch(0.86 0.005 260);
    --surface-border-strong: oklch(0.74 0.008 260);
    --text: oklch(0.2 0.01 260);
    --text-muted: oklch(0.42 0.012 260);
    --text-faint: oklch(0.58 0.01 260);
    --glass-bg: oklch(0.99 0 0 / 0.78);
    --glass-border: oklch(0.2 0.01 260 / 0.12);
    --user-bubble-bg: oklch(0.95 0.003 260);
    --user-bubble-border: oklch(0.88 0.006 260);
    --code-bg: oklch(0.965 0.004 260);
    --code-border: oklch(0.88 0.006 260);
    --selection: oklch(0.72 0.18 65 / 0.3);
    --sidebar-shadow: 0 4px 24px oklch(0 0 0 / 0.08);

    /* Brand / accent (amber-orange) */
    --brand: oklch(0.69 0.2 41);
    --brand-strong: oklch(0.62 0.21 41);
    --brand-soft: oklch(0.69 0.2 41 / 0.14);
    --brand-fg: oklch(0.99 0 0);

    /* Done / success green */
    --done-green: oklch(0.62 0.18 145);

    /* Info: опубликованная страница, цвет как в продукте */
    --info: oklch(0.588 0.158 242);
    --info-hover: oklch(0.685 0.169 237);
    --info-fg: oklch(0.99 0 0);

    /* Destructive (used by shadcn destructive variants) */
    --destructive: oklch(0.62 0.22 25);
    --destructive-foreground: oklch(0.99 0 0);

    /* shadcn-compat aliases — resolve to semantic OKLCH tokens above.
       Tailwind utilities (bg-background, text-primary, ...) read these. */
    --background: var(--bg);
    --foreground: var(--text);
    --card: var(--surface);
    --card-foreground: var(--text);
    --popover: var(--surface);
    --popover-foreground: var(--text);
    --primary: var(--brand);
    --primary-foreground: var(--brand-fg);
    --secondary: var(--surface-2);
    --secondary-foreground: var(--text);
    --muted: var(--surface-2);
    --muted-foreground: var(--text-muted);
    --accent: var(--hover);
    --accent-foreground: var(--text);
    --border: var(--surface-border);
    --input: var(--surface-border);
    --ring: var(--brand);

    /* Shadows (light theme — намеренно мягкие; .dark усиливает ниже) */
    --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.035);
    --shadow-md: 0 4px 12px oklch(0 0 0 / 0.05);
    --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.07);

    /* Typography scale */
    --tx-2xs: 11px;
    --tx-xs: 12px;
    --tx-sm: 13px;
    --tx-base: 14.5px;
    --tx-md: 15px;
    --tx-lg: 17px;
    --tx-xl: 20px;
    --tx-2xl: 26px;

    /* Radii */
    --r-xs: 6px;
    --r-sm: 10px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-xl: 20px;
    --r-pill: 999px;
    --r-sheet: 22px;

    /* Motion */
    --t-fast: 140ms;
    --t-base: 220ms;
    --t-slow: 380ms;
    --ease-out: cubic-bezier(0.2, 0.7, 0.3, 1);
    --ease-msg: cubic-bezier(0.22, 1, 0.36, 1);

    /* Радиусы компонентов: tailwind rounded-lg, md, sm */
    --radius: var(--r-md);
    --r-lg-c: var(--r-md);
    --r-md-c: calc(var(--r-md) - 2px);
    --r-sm-c: calc(var(--r-md) - 4px);
    --ring: var(--brand);
    --font-sans: Nunito, system-ui, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

.dark,[data-theme="dark"]{
    /* Semantic OKLCH tokens (dark theme).
       shadcn-compat aliases (--background, --primary, ...) inherit from :root
       and resolve to these dark values via var() at computed-style time. */
    --bg: oklch(0.16 0.004 260);
    --bg-elev: oklch(0.2 0.005 260);
    --surface: oklch(0.22 0.006 260);
    --surface-2: oklch(0.26 0.007 260);
    --hover: oklch(0.4 0.01 260 / 0.5);
    --surface-border: oklch(0.3 0.008 260);
    --surface-border-strong: oklch(0.42 0.01 260);
    --text: oklch(0.96 0.005 260);
    --text-muted: oklch(0.74 0.007 260);
    --text-faint: oklch(0.56 0.008 260);
    --glass-bg: oklch(0.2 0.005 260 / 0.72);
    --glass-border: oklch(0.45 0.01 260 / 0.35);
    --user-bubble-bg: oklch(0.24 0.008 260);
    --user-bubble-border: oklch(0.32 0.01 260);
    --code-bg: oklch(0.18 0.005 260);
    --code-border: oklch(0.28 0.008 260);
    --selection: oklch(0.72 0.18 65 / 0.28);
    --sidebar-shadow: 0 4px 24px oklch(0 0 0 / 0.3);

    --brand: oklch(0.72 0.2 41);
    --brand-strong: oklch(0.64 0.21 41);
    --brand-soft: oklch(0.72 0.2 41 / 0.18);
    --brand-fg: oklch(0.18 0.005 260);

    --done-green: oklch(0.62 0.18 145);

    --destructive: oklch(0.65 0.21 25);
    --destructive-foreground: oklch(0.99 0 0);

    --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.5);
    --shadow-md: 0 4px 12px oklch(0 0 0 / 0.45);
    --shadow-lg: 0 14px 40px oklch(0 0 0 / 0.55);
}

/* ---------- Основа ---------- */
.dark,[data-theme="dark"]{color-scheme:dark}
.j-root{background:var(--bg);color:var(--text);font-family:var(--font-sans);font-size:var(--tx-base);line-height:1.45;font-feature-settings:"rlig" 1,"calt" 1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility}
.j-root *,.j-root *::before,.j-root *::after{box-sizing:border-box}
.j-root ::selection{background:var(--selection)}
.j-root ::-webkit-scrollbar{width:8px;height:8px}
.j-root ::-webkit-scrollbar-track{background:transparent}
.j-root ::-webkit-scrollbar-thumb{background-color:var(--surface-border);border-radius:4px}
.j-mono{font-family:var(--font-mono)}
.j-muted{color:var(--text-muted)}
.j-faint{color:var(--text-faint)}
.j-sm{font-size:var(--tx-sm)}
.j-xs{font-size:var(--tx-xs)}
.j-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
[class*="j-"]:focus-visible{outline:2px solid var(--ring);outline-offset:2px}

/* ---------- Кнопка: shared/ui/button ---------- */
.j-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:40px;padding:0 16px;border:1px solid transparent;border-radius:var(--r-md-c);background:none;color:var(--text);font:500 14px/1 var(--font-sans);white-space:nowrap;cursor:pointer;transition:background-color var(--t-fast) var(--ease-out),color var(--t-fast) var(--ease-out)}
.j-btn svg{width:16px;height:16px;flex:none;pointer-events:none}
.j-btn:disabled,.j-btn[aria-disabled="true"]{opacity:.5;pointer-events:none}
.j-btn--primary{background:var(--brand);color:var(--brand-fg)}
.j-btn--primary:hover{background:color-mix(in oklch,var(--brand) 90%,transparent)}
.j-btn--destructive{background:var(--destructive);color:var(--destructive-foreground)}
.j-btn--info{background:var(--info);color:var(--info-fg)}
.j-btn--info:hover{background:var(--info-hover)}
.j-btn--destructive:hover{background:color-mix(in oklch,var(--destructive) 90%,transparent)}
.j-btn--outline{border-color:var(--surface-border);background:var(--bg)}
.j-btn--outline:hover,.j-btn--ghost:hover{background:var(--hover)}
.j-btn--secondary{background:var(--surface-2)}
.j-btn--secondary:hover{background:color-mix(in oklch,var(--surface-2) 80%,transparent)}
.j-btn--link{padding:0;height:auto;color:var(--brand);text-underline-offset:4px}
.j-btn--link:hover{text-decoration:underline}
.j-btn--sm{height:36px;padding:0 12px}
.j-btn--lg{height:44px;padding:0 32px}
.j-btn--icon{width:40px;padding:0}
.j-btn--icon.j-btn--sm{width:36px}

/* ---------- Поля: shared/ui/input, textarea ---------- */
.j-input,.j-textarea{display:flex;width:100%;padding:8px 12px;border:1px solid var(--surface-border);border-radius:var(--r-md-c);background:var(--bg);color:var(--text);font:400 14px/1.4 var(--font-sans);outline:0;transition:border-color var(--t-fast),box-shadow var(--t-fast)}
.j-input{height:40px}
.j-textarea{min-height:80px;resize:vertical}
.j-input::placeholder,.j-textarea::placeholder{color:var(--text-muted)}
/* Фокус поля — только чуть более заметная своя рамка, без цветного кольца */
.j-input:focus,.j-textarea:focus,.j-input:focus-visible,.j-textarea:focus-visible{outline:0;border-color:var(--surface-border-strong);box-shadow:none}
.j-input:disabled,.j-textarea:disabled{opacity:.5;cursor:not-allowed}
.j-input[aria-invalid="true"],.j-textarea[aria-invalid="true"],.j-input[aria-invalid="true"]:focus,.j-textarea[aria-invalid="true"]:focus{border-color:var(--destructive)}
.j-label{display:block;margin-bottom:6px;font-size:var(--tx-sm);font-weight:500}
.j-help{margin-top:6px;font-size:var(--tx-xs);color:var(--text-muted)}
.j-help--error{color:var(--destructive)}
.j-select{appearance:none;-webkit-appearance:none;padding-right:32px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 10px center}
@media (max-width:767px){.j-input,.j-textarea{font-size:16px}}

/* ---------- Флажок и переключатель ---------- */
.j-check{appearance:none;-webkit-appearance:none;width:16px;height:16px;margin:0;flex:none;border:1px solid var(--brand);border-radius:var(--r-sm-c);background:none;cursor:pointer;display:inline-grid;place-items:center}
.j-check:checked{background:var(--brand)}
.j-check:checked::after{content:"";width:9px;height:5px;margin-top:-2px;border-left:2px solid var(--brand-fg);border-bottom:2px solid var(--brand-fg);transform:rotate(-45deg)}
.j-check:indeterminate::after{content:"";width:8px;height:2px;background:var(--brand)}
.j-switch{appearance:none;-webkit-appearance:none;position:relative;width:44px;height:24px;margin:0;flex:none;border-radius:var(--r-pill);background:var(--surface-border);cursor:pointer;transition:background-color var(--t-fast)}
.j-switch::after{content:"";position:absolute;top:2px;left:2px;width:20px;height:20px;border-radius:50%;background:var(--bg);box-shadow:var(--shadow-md);transition:transform var(--t-fast) var(--ease-out)}
.j-switch:checked{background:var(--brand)}
.j-switch:checked::after{transform:translateX(20px)}
.j-check:disabled,.j-switch:disabled{opacity:.5;cursor:not-allowed}

/* ---------- Вкладки: shared/ui/tabs ---------- */
.j-tabs{display:inline-flex;align-items:center;height:40px;padding:4px;border-radius:var(--r-md-c);background:var(--surface-2);color:var(--text-muted)}
.j-tab{height:32px;padding:0 12px;border:0;border-radius:var(--r-sm-c);background:none;color:inherit;font:500 14px/1 var(--font-sans);white-space:nowrap;cursor:pointer;transition:all var(--t-fast)}
.j-tab[aria-selected="true"]{background:var(--bg);color:var(--text);box-shadow:var(--shadow-sm)}

/* ---------- Бейдж, карточка, разделитель ---------- */
.j-badge{display:inline-flex;align-items:center;padding:2px 10px;border:1px solid transparent;border-radius:var(--r-pill);background:var(--brand);color:var(--brand-fg);font-size:12px;font-weight:600;line-height:1.35}
.j-badge--secondary{background:var(--surface-2);color:var(--text)}
.j-badge--destructive{background:var(--destructive);color:var(--destructive-foreground)}
.j-badge--outline{border-color:var(--surface-border);background:none;color:var(--text)}
.j-badge--done{background:color-mix(in oklch,var(--done-green) 16%,transparent);color:var(--done-green)}
.j-card{border:1px solid var(--surface-border);border-radius:var(--r-lg-c);background:var(--surface);color:var(--text);box-shadow:var(--shadow-sm)}
.j-card__head{padding:24px 24px 0}
.j-card__title{margin:0;font-size:24px;font-weight:600;line-height:1;letter-spacing:-.01em}
.j-card__desc{margin:6px 0 0;font-size:14px;color:var(--text-muted)}
.j-card__body{padding:24px}
.j-card__foot{display:flex;align-items:center;gap:8px;padding:0 24px 24px}
.j-sep{height:1px;border:0;margin:0;background:var(--surface-border)}

/* ---------- Диалог: shared/ui/dialog ---------- */
.j-overlay{position:fixed;inset:0;z-index:50;background:rgb(0 0 0/.6);backdrop-filter:blur(4px);animation:j-fade var(--t-base) var(--ease-out)}
.j-dialog{position:fixed;left:50%;top:50%;z-index:51;display:grid;gap:16px;width:100%;max-width:512px;max-height:calc(100dvh - 32px);overflow:auto;padding:24px;transform:translate(-50%,-50%);border:1px solid var(--surface-border);background:var(--bg);box-shadow:var(--shadow-lg);animation:j-fade var(--t-base) var(--ease-out)}
@media (min-width:640px){.j-dialog{border-radius:var(--r-lg-c)}}
/* Клавиатура телефона: --j-kb = её высота (ставит jarv-ds.js). Окно встаёт по центру видимой части */
.j-dialog{top:calc(50% - var(--j-kb,0px) / 2);max-height:calc(100dvh - var(--j-kb,0px) - 32px)}
.j-dialog__title{margin:0;font-size:18px;font-weight:600;line-height:1;letter-spacing:-.01em}
.j-dialog__desc{margin:6px 0 0;font-size:14px;color:var(--text-muted)}
.j-dialog__foot{display:flex;justify-content:flex-end;gap:8px}
.j-dialog__x{position:absolute;right:12px;top:12px;display:grid;place-items:center;width:32px;height:32px;padding:0;border:0;border-radius:var(--r-sm-c);background:none;color:var(--text-muted);cursor:pointer;transition:color var(--t-fast),background-color var(--t-fast)}
.j-dialog__x:hover{background:var(--hover);color:var(--text)}
.j-dialog__x svg{width:16px;height:16px}
/* Телефон: кнопки окна в один ряд, делят ширину поровну; кнопка-иконка не растягивается */
@media (max-width:639px){.j-dialog__foot>.j-btn{flex:1 1 0;min-width:0}.j-dialog__foot>.j-btn--icon{flex:none}}
@keyframes j-fade{from{opacity:0}to{opacity:1}}

/* ---------- Меню, поповер, подсказка ---------- */
.j-menu{min-width:128px;padding:4px;border:1px solid var(--surface-border);border-radius:var(--r-md-c);background:var(--surface);color:var(--text);box-shadow:var(--shadow-lg)}
.j-menu__item{display:flex;align-items:center;gap:8px;width:100%;padding:6px 8px;border:0;border-radius:var(--r-sm-c);background:none;color:inherit;font:400 14px/1.4 var(--font-sans);text-align:left;cursor:pointer}
.j-menu__item:hover,.j-menu__item:focus-visible{background:var(--hover)}
.j-menu__item--danger{color:var(--destructive)}
.j-menu__label{padding:6px 8px;font-size:14px;font-weight:600}
.j-menu__sep{height:1px;margin:4px -4px;background:var(--surface-2)}
.j-tooltip{display:inline-block;padding:6px 12px;border:1px solid var(--surface-border);border-radius:var(--r-md-c);background:var(--surface);color:var(--text);font-size:12px;box-shadow:var(--shadow-md)}

/* ---------- Аватар, скелетон, уведомление ---------- */
.j-avatar{display:inline-grid;place-items:center;width:40px;height:40px;flex:none;overflow:hidden;border-radius:50%;background:var(--surface-2);font-size:14px;font-weight:500}
.j-avatar--sm{width:32px;height:32px;font-size:12px}
.j-skeleton{display:block;border-radius:var(--r-md-c);background:var(--surface-2);animation:j-pulse 2s cubic-bezier(.4,0,.6,1) infinite}
@keyframes j-pulse{50%{opacity:.5}}
.j-toast{display:inline-flex;align-items:center;gap:10px;padding:12px 14px;border:1px solid var(--surface-border);border-radius:var(--r-md-c);background:var(--surface);color:var(--text);font-size:14px;box-shadow:var(--shadow-lg)}

/* ---------- Паттерны ---------- */
.j-empty{padding:32px 16px;text-align:center;color:var(--text-muted)}
.j-empty svg{display:block;margin:0 auto 10px;color:var(--text-faint)}
.j-empty__title{display:block;margin-bottom:2px;color:var(--text);font-weight:600}
.j-row{display:flex;align-items:center;gap:12px;min-height:56px;padding:8px 4px;border-bottom:1px solid var(--surface-border)}
.j-row:last-child{border-bottom:0}
.j-row__main{flex:1;min-width:0}
.j-row__main>*{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.j-row__sub{color:var(--text-muted);font-size:var(--tx-xs)}
@media (prefers-reduced-motion:reduce){.j-root *{animation:none!important;transition:none!important}}

/* ---------- Плавающие слои ---------- */
.j-pop{position:fixed;z-index:70;animation:j-fade var(--t-fast) var(--ease-out)}
.j-pop[hidden]{display:none}
.j-pop--sheet{left:0!important;right:0;top:auto!important;bottom:var(--j-kb,0px);width:auto!important;max-width:none!important;max-height:calc(100dvh - var(--j-kb,0px) - 48px);overflow-y:auto;padding:12px;border-radius:var(--r-lg) var(--r-lg) 0 0;padding-bottom:calc(12px + env(safe-area-inset-bottom))}
/* Список на телефоне: шторка с ручкой, крупные строки и поиск 16px (iOS не увеличивает страницу), список с поиском открывается высоким */
.j-pop--sheet::before{content:"";display:block;width:36px;height:4px;margin:-2px auto 10px;border-radius:var(--r-pill);background:color-mix(in oklch,var(--text-muted) 30%,transparent)}
.j-pop--sheet:has(.j-list__search){height:min(75dvh,calc(100dvh - var(--j-kb,0px) - 48px))}
.j-pop--sheet .j-option{grid-template-columns:22px 1fr;min-height:44px;padding:11px 10px;font-size:16px;line-height:1.35}
.j-pop--sheet .j-option::before{margin-top:7px}
.j-pop--sheet .j-list__search{height:48px;font-size:16px}
.j-pop--sheet .j-list__head{padding:12px 10px 4px;font-size:13px}
.j-backdrop{position:fixed;inset:0;z-index:69;background:rgb(0 0 0/.6);backdrop-filter:blur(4px);animation:j-fade var(--t-base) var(--ease-out)}
.j-popover{width:288px;max-width:calc(100vw - 24px);padding:16px;border:1px solid var(--surface-border);border-radius:var(--r-md-c);background:var(--surface);color:var(--text);box-shadow:var(--shadow-md)}

/* ---------- Выпадающий список ---------- */
.j-pick{position:relative;width:100%}
.j-pick__btn{align-items:center;justify-content:space-between;gap:8px;text-align:left;cursor:pointer}
.j-pick__btn>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.j-pick__btn[data-empty="true"]>span{color:var(--text-muted)}
.j-pick__btn[aria-invalid="true"]{border-color:var(--destructive)}
.j-list{max-height:320px;overflow-y:auto;min-width:200px}
.j-option{display:grid;grid-template-columns:18px 1fr;gap:6px;align-items:start;width:100%;padding:6px 8px;border:0;border-radius:var(--r-sm-c);background:none;color:inherit;font:400 14px/1.4 var(--font-sans);text-align:left;cursor:pointer}
.j-option:hover,.j-option:focus-visible{background:var(--hover);outline:0}
.j-option[aria-disabled="true"]{opacity:.5;pointer-events:none}
.j-option[hidden]{display:none}
.j-option small{grid-column:2;display:block;color:var(--text-muted);font-size:var(--tx-xs);line-height:1.3}
.j-option::before{content:"";grid-column:1;width:9px;height:5px;margin:6px 0 0 3px;transform:rotate(-45deg)}
.j-option[aria-selected="true"]::before{border-left:2px solid var(--brand);border-bottom:2px solid var(--brand)}
.j-list__search{display:block;width:calc(100% + 8px);height:40px;margin:-4px -4px 4px;padding:0 12px;border:0;border-bottom:1px solid var(--surface-border);border-radius:var(--r-md-c) var(--r-md-c) 0 0;background:none;color:var(--text);font:400 14px var(--font-sans);outline:0}
.j-list__search:focus,.j-list__search:focus-visible,.j-command__input:focus,.j-command__input:focus-visible,.j-tags input:focus-visible{outline:0;border-bottom-color:var(--surface-border-strong)}
.j-tags input:focus-visible{outline:0}
.j-list__empty{padding:20px 8px;color:var(--text-muted);font-size:var(--tx-sm);text-align:center}
.j-list__empty[hidden]{display:none}
.j-list__head{padding:6px 8px 2px;color:var(--text-muted);font-size:var(--tx-xs);font-weight:500}

/* ---------- Подменю ---------- */
.j-sub{position:relative}
.j-sub>.j-menu{position:absolute;left:100%;top:-5px;display:none;min-width:180px;margin-left:4px}
.j-sub:hover>.j-menu,.j-sub:focus-within>.j-menu,.j-sub[data-open="true"]>.j-menu{display:block}
.j-menu__item svg,.j-menu__chevron{width:16px;height:16px;flex:none}
.j-menu__chevron{margin-left:auto;opacity:.6}
.j-menu__hint{margin-left:auto;color:var(--text-muted);font-size:var(--tx-xs);letter-spacing:.08em}
@media (max-width:639px){.j-sub>.j-menu{position:static;margin:2px 0 2px 12px;box-shadow:none;border:0;padding:0}}

/* ---------- Календарь ---------- */
.j-date{display:inline-flex;align-items:center;justify-content:space-between;gap:8px;min-width:150px;height:40px;padding:0 12px;border:1px solid var(--surface-border);border-radius:var(--r-md-c);background:var(--bg);color:var(--text);font:400 14px/1 var(--font-sans);cursor:pointer;transition:border-color var(--t-fast)}
.j-date:hover{border-color:color-mix(in oklch,var(--brand) 60%,transparent)}
.j-date[data-empty="true"] span{color:var(--text-muted)}
.j-date svg{width:16px;height:16px;flex:none;color:var(--text-muted)}
.j-date--sm{height:32px;padding:0 10px;font-size:var(--tx-xs)}
.j-cal{width:300px;max-width:100%;padding:12px;border:1px solid var(--surface-border);border-radius:var(--r-md);background:var(--surface);color:var(--text);box-shadow:var(--shadow-lg)}
.j-cal--flat{box-shadow:none}
.j-cal__head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
.j-cal__title{font-weight:600;text-transform:capitalize}
.j-cal__nav{display:grid;place-items:center;width:32px;height:32px;border:0;border-radius:var(--r-sm-c);background:none;color:var(--text-muted);cursor:pointer}
.j-cal__nav:hover{background:var(--hover);color:var(--text)}
.j-cal__nav svg{width:16px;height:16px}
.j-cal__grid{display:grid;grid-template-columns:repeat(7,1fr);row-gap:2px}
.j-cal__wd{height:28px;display:grid;place-items:center;color:var(--text-muted);font-size:var(--tx-xs)}
.j-cal__day{height:38px;padding:0;border:0;background:none;color:var(--text);font:400 14px var(--font-sans);cursor:pointer;border-radius:var(--r-sm-c);font-variant-numeric:tabular-nums}
.j-cal__day:hover{background:var(--hover)}
.j-cal__day[data-outside="true"]{color:var(--text-faint)}
.j-cal__day[data-today="true"]{box-shadow:inset 0 0 0 1px var(--surface-border-strong)}
.j-cal__day[data-middle="true"]{border-radius:0;background:var(--brand-soft)}
.j-cal__day[aria-selected="true"]{background:var(--brand);color:var(--brand-fg);font-weight:600}
.j-cal__day:disabled{opacity:.35;pointer-events:none}
.j-cal__foot{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:8px}
.j-cal__presets{display:flex;flex-wrap:wrap;gap:4px;margin-bottom:8px}

/* ---------- Сайдбар: shared/layout ---------- */
.j-shell{position:relative;display:flex;height:100%;min-height:0;background:var(--bg);overflow:hidden}
.j-rail{position:absolute;left:12px;top:12px;bottom:12px;z-index:3;display:flex;flex-direction:column;align-items:center;gap:4px;width:60px;padding:12px 0;border-radius:18px;background:var(--bg-elev);box-shadow:var(--sidebar-shadow)}
.j-rail__sep{width:20px;height:1px;margin:8px 0;background:var(--surface-border)}
.j-rail__btn{position:relative;display:grid;place-items:center;width:44px;height:44px;border:0;border-radius:var(--r-md-c);background:none;color:var(--text-muted);cursor:pointer;transition:background-color var(--t-fast),color var(--t-fast)}
.j-rail__btn svg{width:20px;height:20px}
.j-rail__btn:hover{background:var(--hover);color:var(--text)}
.j-rail__btn[aria-current="page"]{background:var(--brand-soft);color:var(--brand)}
.j-rail__btn[aria-current="page"]::before{content:"";position:absolute;left:0;top:14px;width:3px;height:16px;border-radius:var(--r-pill);background:var(--brand)}
.j-rail__end{margin-top:auto;display:flex;flex-direction:column;align-items:center;gap:4px}
.j-dot{position:absolute;right:6px;top:6px;width:8px;height:8px;border-radius:50%;background:var(--brand)}
.j-side{display:flex;flex-direction:column;flex:none;width:300px;min-height:0;padding:20px 12px 12px 84px;background:var(--bg-elev);border-right:1px solid var(--surface-border);transition:width var(--t-base) var(--ease-out),padding var(--t-base) var(--ease-out);overflow:hidden}
.j-side__head{display:flex;align-items:center;gap:8px;min-height:36px;margin-bottom:8px;font-size:var(--tx-sm);font-weight:600}
.j-side__head>span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.j-side__scroll{flex:1;min-height:0;overflow-y:auto}
.j-side__label{padding:12px 6px 4px;color:var(--text-muted);font-size:var(--tx-xs);font-weight:500}
.j-side__item{display:flex;align-items:center;gap:10px;width:100%;min-height:36px;padding:8px 6px;border:0;border-radius:var(--r-md-c);background:none;color:var(--text);font:400 var(--tx-base)/1.3 var(--font-sans);text-align:left;text-decoration:none;cursor:pointer;transition:background-color var(--t-fast)}
.j-side__item svg{width:18px;height:18px;flex:none}
.j-side__item>span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.j-side__item:hover{background:var(--hover)}
.j-side__item[aria-current="page"]{background:var(--hover);font-weight:600}
.j-side__count{flex:none!important;color:var(--text-muted);font-size:var(--tx-xs)}
.j-side__group summary{list-style:none}
.j-side__group summary::-webkit-details-marker{display:none}
.j-side__group summary svg:first-child{transition:transform var(--t-fast)}
.j-side__group[open]>summary svg:first-child{transform:rotate(90deg)}
.j-side__sub{padding-left:16px}
.j-shell[data-collapsed="true"] .j-side{width:84px;padding-left:0;padding-right:0;border-right-color:transparent}
.j-shell[data-collapsed="true"] .j-side>*{visibility:hidden}
.j-shell__main{flex:1;min-width:0;overflow:auto}
@media (max-width:767px){
  .j-side{position:absolute;inset:0 auto 0 0;z-index:2;box-shadow:var(--shadow-lg)}
  .j-shell[data-collapsed="true"] .j-side{width:0;border:0}
  .j-shell[data-collapsed="true"] .j-rail{left:-80px}
  .j-rail{transition:left var(--t-base) var(--ease-out)}
}

/* ---------- Навигация ---------- */
.j-crumbs{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:0;padding:0;list-style:none;color:var(--text-muted);font-size:var(--tx-sm)}
.j-crumbs li+li::before{content:"/";margin-right:6px;color:var(--text-faint)}
.j-crumbs a{color:inherit;text-decoration:none}
.j-crumbs a:hover{color:var(--text)}
.j-crumbs [aria-current="page"]{color:var(--text);font-weight:500}
.j-pager{display:flex;align-items:center;gap:4px}
.j-pager button{display:grid;place-items:center;width:32px;height:32px;border:0;border-radius:var(--r-md-c);background:none;color:var(--text);font:400 14px var(--font-sans);cursor:pointer}
.j-pager button:hover:not(:disabled){background:var(--hover)}
.j-pager button:disabled{opacity:.5;cursor:not-allowed}
.j-pager button[aria-current="page"]{background:var(--brand);color:var(--brand-fg)}
.j-pager svg{width:16px;height:16px}
.j-pager span{padding:0 8px;color:var(--text-muted);font-size:var(--tx-sm)}
.j-line-tabs{display:flex;gap:16px;border-bottom:1px solid var(--surface-border);overflow-x:auto;overflow-y:hidden}
/* Вкладки прокручиваются пальцем и колесом без видимой полосы прокрутки */
.j-line-tabs{scrollbar-width:none}
.j-line-tabs::-webkit-scrollbar{display:none}
.j-line-tab{position:relative;height:40px;padding:0 2px;border:0;background:none;color:var(--text-muted);font:500 14px var(--font-sans);white-space:nowrap;cursor:pointer}
.j-line-tab:hover,.j-line-tab[aria-selected="true"]{color:var(--text)}
.j-line-tab[aria-selected="true"]::after{content:"";position:absolute;left:0;right:0;bottom:0;height:2px;border-radius:2px;background:var(--brand)}

/* ---------- Шторка ---------- */
.j-sheet{position:fixed;z-index:51;display:flex;flex-direction:column;gap:16px;padding:24px;overflow-y:auto;background:var(--bg);box-shadow:var(--shadow-lg);animation:j-sheet 280ms var(--ease-msg) backwards}
.j-sheet[hidden]{display:none}
.j-sheet[data-side="right"]{--j-x:100%;inset:0 0 0 auto;width:75%;max-width:448px;border-left:1px solid var(--surface-border)}
.j-sheet[data-side="left"]{--j-x:-100%;inset:0 auto 0 0;width:75%;max-width:448px;border-right:1px solid var(--surface-border)}
.j-sheet[data-side="bottom"]{--j-y:100%;inset:auto 0 0 0;bottom:var(--j-kb,0px);max-height:min(85dvh,calc(100dvh - var(--j-kb,0px) - 24px));transition:bottom var(--t-fast) var(--ease-out),max-height var(--t-fast) var(--ease-out);border-top:1px solid var(--surface-border);border-radius:var(--r-sheet) var(--r-sheet) 0 0}
.j-sheet__handle{position:absolute;left:50%;top:8px;width:36px;height:4px;transform:translateX(-50%);border-radius:var(--r-pill);background:color-mix(in oklch,var(--text-muted) 30%,transparent)}
@keyframes j-sheet{from{transform:translate3d(var(--j-x,0),var(--j-y,0),0)}}
.j-dialog[hidden]{display:none}

/* ---------- Палитра команд ---------- */
.j-command{position:fixed;left:50%;top:18%;z-index:51;width:calc(100% - 24px);max-width:560px;overflow:hidden;transform:translateX(-50%);border:1px solid var(--surface-border);border-radius:var(--r-lg-c);background:var(--surface);box-shadow:var(--shadow-lg);animation:j-fade var(--t-fast) var(--ease-out)}
.j-command[hidden]{display:none}
.j-command__input{display:block;width:100%;height:44px;padding:0 14px;border:0;border-bottom:1px solid var(--surface-border);background:none;color:var(--text);font:400 14px var(--font-sans);outline:0}
.j-command__list{max-height:320px;overflow-y:auto;padding:4px}

/* ---------- Прочие поля ---------- */
.j-radio{appearance:none;-webkit-appearance:none;width:16px;height:16px;margin:0;flex:none;border:1px solid var(--brand);border-radius:50%;background:none;cursor:pointer;display:inline-grid;place-items:center}
.j-radio:checked::after{content:"";width:8px;height:8px;border-radius:50%;background:var(--brand)}
.j-slider{appearance:none;-webkit-appearance:none;width:100%;height:20px;margin:0;background:none;cursor:pointer}
.j-slider::-webkit-slider-runnable-track{height:8px;border-radius:var(--r-pill);background:linear-gradient(to right,var(--brand) var(--j-val,50%),var(--surface-2) var(--j-val,50%))}
.j-slider::-moz-range-track{height:8px;border-radius:var(--r-pill);background:var(--surface-2)}
.j-slider::-moz-range-progress{height:8px;border-radius:var(--r-pill);background:var(--brand)}
.j-slider::-webkit-slider-thumb{-webkit-appearance:none;width:20px;height:20px;margin-top:-6px;border:2px solid var(--brand);border-radius:50%;background:var(--bg)}
.j-slider::-moz-range-thumb{width:16px;height:16px;border:2px solid var(--brand);border-radius:50%;background:var(--bg)}
.j-tags{display:flex;flex-wrap:wrap;align-items:center;gap:6px;min-height:40px;padding:4px 6px;border:1px solid var(--surface-border);border-radius:var(--r-md-c);background:var(--bg);cursor:text}
.j-tags:focus-within{border-color:var(--surface-border-strong);box-shadow:none}
.j-tags input{flex:1;min-width:120px;height:28px;padding:0 4px;border:0;outline:0;background:none;color:var(--text);font:400 14px var(--font-sans)}
.j-tag{display:inline-flex;align-items:center;gap:4px;height:28px;padding:0 4px 0 8px;border-radius:var(--r-sm-c);background:var(--surface-2);font-size:var(--tx-sm);font-weight:500}
.j-tag button{display:grid;place-items:center;width:20px;height:20px;border:0;border-radius:4px;background:none;color:var(--text-muted);cursor:pointer}
.j-tag button:hover{background:var(--hover);color:var(--text)}
.j-drop{display:block;padding:24px 16px;border:1px dashed var(--surface-border-strong);border-radius:var(--r-md);color:var(--text-muted);text-align:center;cursor:pointer;transition:border-color var(--t-fast),background-color var(--t-fast)}
.j-drop:hover,.j-drop[data-over="true"]{border-color:var(--brand);background:var(--brand-soft)}

/* ---------- Данные и обратная связь ---------- */
.j-table-wrap{overflow-x:auto;border:1px solid var(--surface-border);border-radius:var(--r-md-c)}
.j-table{width:100%;border-collapse:collapse;font-size:var(--tx-sm)}
.j-table th{padding:8px 12px;border-bottom:1px solid var(--surface-border);background:var(--bg-elev);color:var(--text-muted);font-weight:500;text-align:left;white-space:nowrap}
.j-table td{padding:8px 12px;border-bottom:1px solid var(--surface-border);vertical-align:middle}
.j-table tr:last-child td{border-bottom:0}
.j-table tbody tr:hover{background:var(--hover)}
.j-table th[aria-sort]{cursor:pointer}
.j-table th[aria-sort="ascending"]::after{content:" ↑"}
.j-table th[aria-sort="descending"]::after{content:" ↓"}
.j-acc{border-bottom:1px solid var(--surface-border)}
.j-acc summary{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:44px;font-weight:500;cursor:pointer;list-style:none}
.j-acc summary::-webkit-details-marker{display:none}
.j-acc summary::after{content:"";width:8px;height:8px;margin-right:4px;border-right:2px solid var(--text-muted);border-bottom:2px solid var(--text-muted);transform:rotate(45deg);transition:transform var(--t-fast)}
.j-acc[open] summary::after{transform:rotate(-135deg)}
.j-acc__body{padding-bottom:12px;color:var(--text-muted)}
.j-alert{display:flex;gap:10px;padding:12px 14px;border:1px solid var(--surface-border);border-radius:var(--r-md-c);background:var(--surface-2)}
.j-alert svg{width:18px;height:18px;flex:none;margin-top:1px}
.j-alert b{display:block;font-weight:600}
.j-alert--brand{border-color:transparent;background:var(--brand-soft)}
.j-alert--danger{border-color:transparent;background:color-mix(in oklch,var(--destructive) 14%,transparent)}
.j-alert--done{border-color:transparent;background:color-mix(in oklch,var(--done-green) 14%,transparent)}
.j-progress{display:block;height:8px;overflow:hidden;border-radius:var(--r-pill);background:var(--surface-2)}
.j-progress i{display:block;height:100%;border-radius:inherit;background:var(--brand);transition:width var(--t-base) var(--ease-out)}
.j-spinner{display:inline-block;width:16px;height:16px;border:2px solid var(--surface-border-strong);border-top-color:var(--brand);border-radius:50%;animation:j-spin .8s linear infinite}
@keyframes j-spin{to{transform:rotate(360deg)}}
.j-kbd{display:inline-grid;place-items:center;min-width:20px;height:20px;padding:0 5px;border:1px solid var(--surface-border);border-radius:5px;background:var(--bg-elev);color:var(--text-muted);font:500 11px var(--font-mono)}
[data-j-tip]{position:relative}
[data-j-tip]:hover::after,[data-j-tip]:focus-visible::after{content:attr(data-j-tip);position:absolute;z-index:60;left:50%;bottom:calc(100% + 6px);transform:translateX(-50%);width:max-content;max-width:240px;padding:6px 12px;border:1px solid var(--surface-border);border-radius:var(--r-md-c);background:var(--surface);color:var(--text);font:400 12px/1.35 var(--font-sans);box-shadow:var(--shadow-md);pointer-events:none}

/* ---------- Запись голоса ---------- */
.j-rec{--j-lvl:0;position:relative;display:flex;align-items:center;gap:10px;flex:1;min-width:0;min-height:44px;touch-action:none;user-select:none;-webkit-user-select:none;animation:j-rec-in var(--t-slow) var(--ease-msg) backwards;transition:opacity var(--t-fast),transform var(--t-fast)}
.j-rec[data-out="true"]{opacity:0;transform:translateY(4px)}
.j-rec__dot{width:10px;height:10px;flex:none;border-radius:50%;background:var(--destructive);animation:j-rec-dot 1.4s ease-in-out infinite}
.j-rec__time{flex:none;min-width:36px;font-size:var(--tx-sm);font-variant-numeric:tabular-nums}
.j-rec__wave{display:flex;align-items:center;justify-content:space-between;flex:1;min-width:0;height:28px;overflow:hidden}
.j-rec__wave i{flex:none;width:3px;height:calc(3px + var(--h,0) * 25px);border-radius:var(--r-pill);background:var(--brand);transition:height 130ms var(--ease-out)}
.j-rec__hint{flex:none;color:var(--text-muted);font-size:var(--tx-xs);white-space:nowrap}
.j-rec__cancel{flex:none;height:32px;padding:0 8px;border:0;border-radius:var(--r-sm-c);background:none;color:var(--text-muted);font:500 var(--tx-sm) var(--font-sans);cursor:pointer}
.j-rec__cancel:hover{background:var(--hover);color:var(--text)}
.j-rec__btn{position:relative;display:grid;place-items:center;width:44px;height:44px;flex:none;border:0;border-radius:50%;background:var(--brand);color:var(--brand-fg);cursor:pointer;animation:j-rec-pop var(--t-slow) var(--ease-msg) backwards;transition:width var(--t-base) var(--ease-out),opacity var(--t-fast),transform var(--t-base) var(--ease-out)}
.j-rec__btn svg{position:relative;z-index:1;width:20px;height:20px}
.j-rec__btn::before,.j-rec__btn::after{content:"";position:absolute;inset:0;border-radius:50%;background:var(--brand);pointer-events:none;transition:transform 140ms linear;animation:j-fade var(--t-slow) var(--ease-out) backwards}
.j-rec__btn::before{opacity:.2;transform:scale(calc(1.12 + var(--j-lvl) * .5))}
.j-rec__btn::after{opacity:.1;transform:scale(calc(1.25 + var(--j-lvl) * .9))}
.j-rec__label{flex:none;color:var(--text-muted);font-size:var(--tx-sm)}
/* Запись ушла на распознавание: кнопка сворачивается, по волне бежит движение */
.j-rec--busy .j-rec__btn{width:0;opacity:0;transform:scale(.4);overflow:hidden;pointer-events:none}
.j-rec--busy .j-rec__wave i{height:22px;transform-origin:center;animation:j-rec-run 1.5s ease-in-out infinite;animation-delay:calc(var(--i,0) * -24ms)}
@keyframes j-rec-in{from{opacity:0;transform:translateY(6px)}}
@keyframes j-rec-pop{from{transform:scale(.5);opacity:0}}
@keyframes j-rec-dot{50%{opacity:.35;transform:scale(.8)}}
@keyframes j-rec-run{0%,100%{transform:scaleY(.18);opacity:.35}50%{transform:scaleY(1);opacity:1}}
@media (prefers-reduced-motion:reduce){.j-rec,.j-rec__btn{animation:none}.j-rec__btn::before,.j-rec__btn::after{transform:scale(1.2)}.j-rec__dot{animation:none}.j-rec--busy .j-rec__wave i{animation:none;transform:scaleY(.4)}}

/* ---------- Сторона подсказки: после базового правила data-j-tip ---------- */
[data-j-tip-side="bottom"]:hover::after,[data-j-tip-side="bottom"]:focus-visible::after{top:calc(100% + 6px);bottom:auto}
[data-j-tip-side="bottom-end"]:hover::after,[data-j-tip-side="bottom-end"]:focus-visible::after{top:calc(100% + 6px);right:0;bottom:auto;left:auto;transform:none}
