/* ═══════════════════════════════════════════════════════════════════════════
   UNIT — светлая дизайн-система (портал лаборатории и UNIT ID)

   Устроена как у школы (courses.labunit.ru): каркас с боковым меню, панели с
   волосяной рамкой, моноширинные подписи разделов, Saira в заголовках. Вместо
   неона — спокойная бумага и графит; акцент один — синий с переходом в бирюзу
   (как знак), и достаётся он только активному, главному и прогрессу.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    --bg: #f3f4f7;
    --surface: #ffffff;
    --surface-2: #f8f9fb;
    --sunken: #eef0f4;

    --line: #e4e7ee;
    --line-strong: #d4d9e3;

    --ink: #0f1222;
    --ink-2: #4f566e;
    --ink-3: #868ca3;

    --accent: #3044d0;
    --accent-2: #0c9488;
    --accent-soft: #edf0fd;
    --accent-line: #c9d0f6;

    --ok: #15835a;
    --warn: #a86400;
    --danger: #c43c3c;
    --crimson: #c0334f;
    --blue: #2f5ad6;
    --violet: #6d47d4;

    --shadow-sm: 0 1px 2px rgba(15, 18, 34, .04);
    --shadow: 0 1px 2px rgba(15, 18, 34, .04), 0 10px 30px -18px rgba(15, 18, 34, .16);
    --shadow-lg: 0 2px 4px rgba(15, 18, 34, .04), 0 24px 60px -28px rgba(15, 18, 34, .28);

    --r-sm: 9px;
    --r: 12px;
    --r-lg: 16px;
    --sidebar: 248px;

    --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --display: 'Saira', 'Inter', sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: light; background: var(--bg); }
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink); font: 400 15px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { max-width: 100%; }
h1, h2, h3, h4 { margin: 0; font-family: var(--display); font-weight: 600; letter-spacing: -.012em; line-height: 1.18; }
h1 { font-size: clamp(26px, 2.6vw, 32px); }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { margin: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: rgba(48, 68, 208, .16); }
code { font-family: var(--mono); font-size: .86em; background: var(--sunken); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; word-break: break-all; }

.ic { flex: none; }

/* ── Примитивы ──────────────────────────────────────────────────────────── */
.stack { display: flex; flex-direction: column; gap: 20px; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
.stack-xs { display: flex; flex-direction: column; gap: 4px; }
.row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.row-wrap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { margin-left: auto; }
.grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 13.5px; }
.tiny { font-size: 12px; }
.strong { font-weight: 600; }
.right { text-align: right; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pre { white-space: pre-line; }
.late { color: var(--danger) !important; }
.scroll-x { overflow-x: auto; }
.label-mono, .eyebrow {
    font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); font-weight: 500;
}

/* ── Знак ───────────────────────────────────────────────────────────────── */
.logo { display: inline-flex; align-items: center; gap: 11px; }
.logo .mark {
    width: 26px; height: 30px; flex: none;
    background: linear-gradient(150deg, var(--accent) 10%, var(--accent-2) 95%);
    -webkit-mask: url('/static/logo.png') center / contain no-repeat;
    mask: url('/static/logo.png') center / contain no-repeat;
}
.logo .word { display: flex; flex-direction: column; line-height: 1.05; }
.logo b { font-family: var(--display); font-weight: 700; font-size: 17px; letter-spacing: .16em; }
.logo small { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-top: 3px; }

/* ── Каркас: боковое меню + рабочая область ─────────────────────────────── */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100dvh; }
.side {
    position: sticky; top: 0; align-self: start; height: 100dvh;
    display: flex; flex-direction: column; gap: 4px; padding: 22px 14px 16px;
    background: var(--surface); border-right: 1px solid var(--line);
}
.side > .logo { padding: 2px 10px 22px; }
.side > nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.side-label { display: block; padding: 16px 12px 6px; }
.side-label:first-child { padding-top: 0; }
.side-link {
    position: relative; display: flex; white-space: nowrap; align-items: center; gap: 11px; padding: 8px 12px;
    border-radius: var(--r-sm); color: var(--ink-2); font-size: 14px; font-weight: 500;
    transition: background .15s, color .15s;
}
.side-link .ic { color: var(--ink-3); transition: color .15s; }
.side-link:hover { background: var(--surface-2); color: var(--ink); }
.side-link.on { background: var(--accent-soft); color: var(--accent); }
.side-link.on .ic { color: var(--accent); }
.side-link.on::before { content: ''; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.side-link .count { margin-left: auto; font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.user-card { display: flex; align-items: center; gap: 10px; padding: 6px 4px 0; min-width: 0; }
.user-card .who { flex: 1; min-width: 0; line-height: 1.3; }
.user-card .who b { display: block; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card .who span { display: block; font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { min-width: 0; }
.view { width: 100%; max-width: 1240px; padding: 34px 40px 56px; }
.page-head { display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; margin-bottom: 26px; }
.page-head .titles { flex: 1; min-width: 260px; display: flex; flex-direction: column; gap: 8px; }
.page-head .sub { color: var(--ink-2); font-size: 15px; max-width: 46em; }
.page-head .actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); }
.crumbs a:hover { color: var(--ink); }
.section-title { display: flex; align-items: baseline; gap: 12px; margin: 34px 0 14px; }
.section-title:first-child { margin-top: 0; }
.view section { margin-bottom: 40px; }
.view section:last-child { margin-bottom: 0; }
.section-title h2 { font-size: 19px; }

/* ── Поверхности ────────────────────────────────────────────────────────── */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); min-width: 0; }
.panel-pad { padding: 22px; }
.panel-head { display: flex; align-items: center; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line); min-height: 58px; }
.panel-head h3 { font-size: 15.5px; }
.panel-body { padding: 20px 22px; }
.panel-foot { padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
a.panel { display: block; transition: border-color .15s, box-shadow .15s, transform .15s; }
a.panel:hover { border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.inset { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); }
.empty { padding: 34px 22px; text-align: center; color: var(--ink-3); font-size: 14px; }

/* Списки внутри панели */
.rows > .r { display: flex; align-items: center; gap: 14px; padding: 13px 22px; border-top: 1px solid var(--line); min-width: 0; }
.rows > .r:first-child { border-top: 0; }
.rows > a.r { transition: background .12s; }
.rows > a.r:hover { background: var(--surface-2); }
.rows > .r:last-child { border-radius: 0 0 var(--r-lg) var(--r-lg); }

/* Таблицы */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
    padding: 11px 16px; text-align: left; white-space: nowrap;
    font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; font-weight: 500;
    color: var(--ink-3); border-bottom: 1px solid var(--line); background: var(--surface-2);
}
.table th:first-child { border-top-left-radius: var(--r-lg); }
.table th:last-child { border-top-right-radius: var(--r-lg); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.table tfoot td { font-weight: 600; border-top: 1px solid var(--line-strong); background: var(--surface-2); }

/* ── Кнопки ─────────────────────────────────────────────────────────────── */
.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-sm);
    background: none; font-size: 14px; font-weight: 500; line-height: 1; white-space: nowrap; cursor: pointer;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .15s;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--ink); color: #fff; box-shadow: 0 1px 0 rgba(255, 255, 255, .12) inset, 0 6px 16px -8px rgba(15, 18, 34, .55); }
.btn-primary:hover:not(:disabled) { background: #22263a; transform: translateY(-1px); }
.btn-accent {
    background: linear-gradient(90deg, var(--accent), #2a5fd0 55%, var(--accent-2)); background-origin: border-box; color: #fff;
    box-shadow: 0 8px 20px -10px rgba(48, 68, 208, .65);
}
.btn-accent:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 10px 24px -10px rgba(48, 68, 208, .8); }
.btn-ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink); box-shadow: var(--shadow-sm); }
.btn-ghost:hover:not(:disabled) { border-color: var(--accent-line); color: var(--accent); }
.btn-quiet { color: var(--ink-2); padding: 0 12px; }
.btn-quiet:hover:not(:disabled) { color: var(--ink); background: var(--sunken); }
.btn-danger { background: var(--surface); border-color: #efc9c9; color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: #fdf2f2; }
.btn-xs { height: 26px; padding: 0 8px; font-size: 12px; border-radius: 6px; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; border-radius: 11px; }
.btn-block { width: 100%; }
.btn-icon { width: 36px; padding: 0; }
.btn-icon.btn-xs { width: 26px; }
.btn-icon.btn-sm { width: 32px; }

/* ── Формы ──────────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > .label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.field > .hint { font-size: 12px; color: var(--ink-3); }
.input, .select, .textarea {
    width: 100%; height: 40px; padding: 0 12px; background: var(--surface); color: var(--ink);
    border: 1px solid var(--line-strong); border-radius: var(--r-sm); outline: none;
    box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 84px; padding: 10px 12px; line-height: 1.55; resize: vertical; }
.input:hover, .select:hover, .textarea:hover { border-color: #c3c9d6; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(48, 68, 208, .13); }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.select {
    appearance: none; padding-right: 34px; cursor: pointer;
    background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
    background-position: right 16px center, right 11px center; background-size: 5px 5px; background-repeat: no-repeat;
}
.input-sm, .select.input-sm { height: 32px; font-size: 13px; border-radius: 8px; }
.check { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); flex: none; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; align-items: end; }
.form-grid .full { grid-column: 1 / -1; }
.form-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.form-row > .input, .form-row > .select { flex: 1; min-width: 180px; }
.form-row > .select.auto, .form-row > .input.auto { flex: 0 1 auto; width: auto; min-width: 0; }
.option-box { border: 1px solid var(--line); border-radius: var(--r); padding: 16px; background: var(--surface-2); display: flex; flex-direction: column; gap: 10px; }
details > summary { list-style: none; cursor: pointer; }
details.panel:not([open]) > summary.panel-head { border-bottom: 0; }
details[open] > summary .ic { transform: rotate(180deg); }
.time-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) minmax(0, 1.2fr) minmax(0, .8fr); }
details > summary::-webkit-details-marker { display: none; }
.disclose { display: inline-flex; align-items: center; gap: 7px; color: var(--accent); font-size: 13px; font-weight: 500; }
.disclose:hover { text-decoration: underline; }

/* ── Метки ──────────────────────────────────────────────────────────────── */
.chip {
    --tone: var(--ink-3);
    display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px;
    border-radius: 99px; border: 1px solid var(--line-strong); background: var(--surface);
    font-size: 12px; font-weight: 500; color: var(--ink-2); white-space: nowrap;
}
.chip.tone {
    color: var(--tone);
    border-color: color-mix(in srgb, var(--tone) 28%, transparent);
    background: color-mix(in srgb, var(--tone) 8%, var(--surface));
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.t-crimson { --tone: var(--crimson); }
.t-blue { --tone: var(--blue); }
.t-indigo { --tone: var(--accent); }
.t-violet { --tone: var(--violet); }
.s-active { --tone: var(--ok); }
.s-paused { --tone: var(--warn); }
.s-done { --tone: var(--ink-3); }
.s-idea { --tone: var(--accent); }
.s-late { --tone: var(--danger); }
.r-admin { --tone: var(--accent); }
.r-teacher { --tone: var(--accent-2); }
.r-student { --tone: var(--ink-3); }
.count-badge { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); background: var(--sunken); border-radius: 99px; padding: 1px 8px; }

/* Аватар — инициалы */
.avatar {
    width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center;
    background: linear-gradient(150deg, #e7ebfd, #dff3f1); color: var(--accent);
    font: 600 12.5px/1 var(--sans); letter-spacing: .02em; text-transform: uppercase;
    border: 1px solid var(--line);
}
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.lg { width: 72px; height: 72px; font-size: 24px; }
.avatar.sq { border-radius: 10px; }
.avatars { display: flex; }
.avatars .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--surface); }
.avatars .avatar:first-child { margin-left: 0; }

/* Табы — как у школы: ровная линия под разделами */
.tabs { display: flex; gap: 2px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.tabs a { position: relative; padding: 10px 14px; color: var(--ink-2); font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 7px; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); }
.tabs a.on::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }

.flash { padding: 11px 14px; border-radius: var(--r-sm); font-size: 14px; background: #ecf7f1; color: var(--ok); border: 1px solid #cde9da; }
.flash.err { background: #fdf2f2; color: var(--danger); border-color: #f2d2d2; }
.flashes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }

/* ── Прогресс и этапы ───────────────────────────────────────────────────── */
.progress { height: 6px; border-radius: 99px; background: var(--sunken); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.pct { font-family: var(--display); font-weight: 600; font-size: 22px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.pct small { font-size: 14px; color: var(--ink-3); margin-left: 1px; }
.phases { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.phase { display: flex; flex-direction: column; gap: 6px; font-size: 11.5px; color: var(--ink-3); min-width: 0; }
.phase span.n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phase .seg { height: 4px; border-radius: 99px; background: var(--sunken); overflow: hidden; }
.phase .seg i { display: block; height: 100%; background: var(--accent); }
.phase.cur { color: var(--ink); font-weight: 600; }
.phase.passed { color: var(--ink-2); }
.phase.passed .seg i { background: var(--accent-2); }

/* Показатели */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 26px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow-sm); }
.stat .value { font-family: var(--display); font-size: 28px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.stat .value small { font-size: 15px; color: var(--ink-3); font-weight: 500; }
.stat .note { font-size: 12.5px; color: var(--ink-3); }

/* Проект в списке */
.proj { padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; height: 100%; }
.proj .top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.proj h3 { font-size: 17px; }
.proj .meta { display: flex; align-items: center; gap: 14px; font-size: 12.5px; color: var(--ink-3); margin-top: auto; flex-wrap: wrap; }
.proj .meta span { display: inline-flex; align-items: center; gap: 5px; }
.proj .bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; }

/* Часть проекта */
.part { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 26px; padding: 20px 22px; border-top: 1px solid var(--line); }
.part:first-child { border-top: 0; }
.part .edit { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-top: 14px; padding: 16px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); }
.part .edit .full { grid-column: 1 / -1; }

/* Канбан */
.board { display: grid; grid-template-columns: repeat(4, minmax(230px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 4px; }
.col { background: var(--sunken); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 140px; }
.col-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 6px; }
.col-head b { font-size: 13px; font-weight: 600; }
.task { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 11px 12px; font-size: 14px; box-shadow: var(--shadow-sm); }
.task:hover { border-color: var(--line-strong); }
.task .meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 7px; font-size: 12px; color: var(--ink-3); }
.task form { display: grid; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }

/* Активность */
.heat { display: grid; grid-template-rows: repeat(7, 12px); grid-auto-flow: column; grid-auto-columns: 12px; gap: 3px; }
.heat i { border-radius: 3px; background: var(--sunken); }
.heat i.l1 { background: #cfd6f7; } .heat i.l2 { background: #8f9eea; } .heat i.l3 { background: var(--accent); }
.skill { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 12px; align-items: center; font-size: 14px; }
.skill .lv { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; }
.skill .lv i { height: 5px; border-radius: 99px; background: var(--sunken); }
.skill .lv i.on { background: var(--accent); }
.kv { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px 14px; font-size: 14px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; min-width: 0; }

/* ── Публичные страницы ─────────────────────────────────────────────────── */
.wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: 28px; }
.site-top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.site-top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 68px; }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a { padding: 6px 12px; border-radius: 8px; color: var(--ink-2); font-size: 14px; font-weight: 500; white-space: nowrap; transition: color .15s, background .15s; }
.site-nav a:hover { color: var(--ink); background: var(--sunken); }
.hero { padding: 96px 0 72px; position: relative; }
.hero::before {
    content: ''; position: absolute; inset: -68px 0 0; z-index: -1; pointer-events: none;
    background: radial-gradient(48% 60% at 85% 0%, rgba(12, 148, 136, .09), transparent 70%),
                radial-gradient(44% 56% at 8% 10%, rgba(48, 68, 208, .09), transparent 70%);
}
.hero h1 { font-size: clamp(38px, 5.4vw, 64px); line-height: 1.04; letter-spacing: -.025em; max-width: 15em; }
.hero .lead { font-size: clamp(16px, 1.5vw, 19px); color: var(--ink-2); max-width: 36em; margin-top: 22px; }
.hero .eyebrow { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 22px; }
.hero .eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 0 4px rgba(12, 148, 136, .14); }
.hero-facts { display: flex; gap: 40px; margin-top: 56px; padding-top: 26px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.hero-facts div { display: flex; flex-direction: column; gap: 4px; }
.hero-facts b { font-family: var(--display); font-size: 26px; font-weight: 600; }
.hero-facts span { font-size: 13px; color: var(--ink-3); }
.section { padding: 76px 0; border-top: 1px solid var(--line); }
.section-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: end; margin-bottom: 34px; }
.section-head h2 { font-size: clamp(26px, 3vw, 36px); letter-spacing: -.02em; }
.section-head p { color: var(--ink-2); }
.dir-card { padding: 26px; display: flex; flex-direction: column; gap: 14px; }
.badge { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: var(--tone); background: color-mix(in srgb, var(--tone) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--tone) 20%, transparent); }
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.steps > div { padding: 26px 24px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.steps > div:first-child { border-left: 0; }
.steps b { font-family: var(--display); font-size: 18px; font-weight: 600; }
.steps .w { height: 4px; border-radius: 99px; background: var(--sunken); overflow: hidden; margin-bottom: 6px; }
.steps .w i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.cta { padding: 38px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: center; background: var(--ink); color: #fff; border: 0; border-radius: 20px; overflow: hidden; position: relative; }
.cta::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(50% 120% at 100% 0%, rgba(12, 148, 136, .35), transparent 60%), radial-gradient(40% 100% at 70% 120%, rgba(48, 68, 208, .45), transparent 60%); }
.cta > * { position: relative; z-index: 1; }
.cta p { color: #b9bfd3; margin-top: 8px; }
.cta .btn-ghost { background: #fff; border-color: #fff; color: var(--ink); }
.foot { padding: 30px 0 40px; color: var(--ink-3); font-size: 13px; }
.foot .wrap { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.foot a:hover { color: var(--ink); }

/* ── Вход (UNIT ID) и одиночные экраны ──────────────────────────────────── */
.solo { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.solo-main { display: flex; flex-direction: column; padding: 32px 48px; }
.solo-main .body { flex: 1; display: grid; place-items: center; padding: 40px 0; }
.solo-card { width: min(400px, 100%); display: flex; flex-direction: column; gap: 22px; }
.solo-card h1 { font-size: 30px; }
.solo-card .sub { color: var(--ink-2); margin-top: -10px; }
.solo-aside {
    position: relative; overflow: hidden; background: var(--ink); color: #fff; padding: 48px;
    display: flex; flex-direction: column; justify-content: flex-end; gap: 22px;
}
.solo-aside::before {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(60% 50% at 80% 10%, rgba(12, 148, 136, .42), transparent 70%),
                radial-gradient(70% 60% at 10% 100%, rgba(48, 68, 208, .55), transparent 70%);
}
.solo-aside::after {
    content: ''; position: absolute; right: -60px; top: 60px; width: 420px; height: 480px; opacity: .1; background: #fff;
    -webkit-mask: url('/static/logo.png') center / contain no-repeat; mask: url('/static/logo.png') center / contain no-repeat;
}
.solo-aside > * { position: relative; z-index: 1; }
.solo-aside h2 { font-size: 30px; line-height: 1.15; max-width: 13em; }
.solo-aside p { color: #b9bfd3; max-width: 30em; }
.services { display: grid; gap: 10px; max-width: 420px; }
.services div { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); font-size: 14px; }
.services div span { color: #9aa1b8; font-size: 12.5px; margin-left: auto; font-family: var(--mono); }
.center-card { max-width: 520px; margin: 8vh auto 0; }
.scopes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.scopes li { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.scopes li:first-child { border-top: 0; }
.scopes .badge { width: 34px; height: 34px; border-radius: 10px; --tone: var(--accent); }
.secret { border: 1px solid #bfe4df; background: #effaf8; border-radius: var(--r); padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }

/* ── Узкие экраны ───────────────────────────────────────────────────────── */
@media (max-width: 1080px) {
    .split { grid-template-columns: minmax(0, 1fr); }
    .part { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .shell { grid-template-columns: minmax(0, 1fr); }
    .side {
        position: sticky; top: 0; z-index: 30; height: auto; padding: 10px 12px 6px; gap: 6px 0;
        flex-direction: row; flex-wrap: wrap; align-items: center; padding-top: max(10px, env(safe-area-inset-top)); border-right: 0; border-bottom: 1px solid var(--line);
        background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    }
    .side > .logo { padding: 0 10px 0 0; }
    .side > .logo .word small { display: none; }
    .side > nav { order: 3; flex: 1 0 100%; flex-direction: row; overflow-x: auto; overflow-y: hidden; gap: 2px; scrollbar-width: none; margin: 0 -12px; padding: 0 8px; }
    .side > nav::-webkit-scrollbar { display: none; }
    .side-label { display: none; }
    .side-link { white-space: nowrap; padding: 7px 10px; font-size: 13.5px; }
    .side-link.on::before { display: none; }
    .side-link .count { display: none; }
    .side-foot { margin: 0 0 0 auto; padding: 0; border: 0; }
    .user-card { padding: 0; }
    .user-card .who { display: none; }
    .view { padding: 24px 16px 44px; }
    .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding-inline: 8px; }
    .tabs::-webkit-scrollbar { display: none; }
    .tabs a { white-space: nowrap; }
    .section-title { flex-wrap: wrap; row-gap: 4px; }
    .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
    .time-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .solo { grid-template-columns: minmax(0, 1fr); }
    .solo-aside { display: none; }
    .solo-main { padding: 22px 16px; }
    .section-head { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .steps > div:nth-child(3) { border-left: 0; }
    .steps > div:nth-child(n+3) { border-top: 1px solid var(--line); }
    .site-nav { display: none; }
    .cta { grid-template-columns: minmax(0, 1fr); padding: 28px; }
    .wrap { padding-inline: 16px; }
    .hero { padding: 64px 0 52px; }
}
@media (max-width: 560px) {
    .g4 { grid-template-columns: minmax(0, 1fr); }
    .steps { grid-template-columns: minmax(0, 1fr); }
    .steps > div { border-left: 0 !important; border-top: 1px solid var(--line); }
    .steps > div:first-child { border-top: 0; }
    .rows > .r, .panel-head, .panel-body { padding-left: 16px; padding-right: 16px; }
    .hide-sm { display: none !important; }
    .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; }
    .kv dd { margin-bottom: 10px; }
}

/* ═══ Аккаунты, устройства, разработчикам (UNIT ID) ═══════════════════════ */
.appbar { display: none; }
.side-link .short, .only-sm { display: none; }
.dot-count { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--danger); color: #fff; font: 600 11px/18px var(--sans); text-align: center; }
.form-stack { display: flex; flex-direction: column; gap: 14px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.narrow { max-width: 620px; }

/* Теги */
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 7px; font-size: 12px; font-weight: 500; color: var(--ink-2); background: var(--sunken); white-space: nowrap; }
.tag-role { color: var(--accent); background: var(--accent-soft); }
.tag-service { color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 10%, var(--surface)); }
.person-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tagbar { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; margin-bottom: 16px; }
.tagbar::-webkit-scrollbar { display: none; }
.tag-chip { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 99px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 13.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap; transition: background .15s, color .15s, border-color .15s; }
.tag-chip span { font: 500 11.5px var(--mono); color: var(--ink-3); }
.tag-chip:hover { border-color: var(--accent-line); color: var(--ink); }
.tag-chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.tag-chip.on span { color: #b9bfd3; }
.tag-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-toggle { position: relative; cursor: pointer; }
.tag-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.tag-toggle span { display: inline-flex; align-items: center; height: 34px; padding: 0 13px; border-radius: 99px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 13.5px; color: var(--ink-2); transition: background .15s, color .15s, border-color .15s; }
.tag-toggle input:checked + span { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); font-weight: 500; }
.tag-toggle input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Поиск и список людей */
.searchbar { position: relative; margin-bottom: 12px; max-width: 520px; }
.searchbar > .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.searchbar .input { padding-left: 40px; height: 44px; border-radius: 12px; }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.person { display: flex; align-items: center; gap: 13px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); min-width: 0; transition: border-color .15s, box-shadow .15s, transform .15s; }
.person:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.person:active { transform: scale(.99); }
.person.is-off { opacity: .6; }
.person-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.person-main b { font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-mail { font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-main .person-tags { margin-top: 3px; }
.person-side { display: flex; align-items: center; gap: 4px; font: 500 11.5px var(--mono); color: var(--ink-3); }
.chev { color: var(--ink-3); display: inline-flex; }
.profile-head, .hello { display: flex; align-items: center; gap: 18px; margin: 12px 0 18px; }
.profile-head { padding: 20px 22px; }
.hello { padding: 22px; margin-top: 0; background: linear-gradient(120deg, var(--surface) 55%, color-mix(in srgb, var(--accent-soft) 70%, var(--surface))); }
.profile-who, .hello-who { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.profile-who h1, .hello-who h1 { font-size: clamp(22px, 2.4vw, 28px); }

/* Плитки быстрых переходов */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.tile { display: flex; flex-direction: column; gap: 4px; padding: 15px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); min-width: 0; transition: border-color .15s, transform .15s; }
.tile .ic { color: var(--accent); margin-bottom: 6px; }
.tile b { font-size: 14.5px; font-weight: 600; }
.tile span { font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile:hover { border-color: var(--accent-line); }
.tile:active { transform: scale(.98); }
.app-badge { --tone: var(--accent); width: 38px; height: 38px; border-radius: 10px; flex: none; }

/* Устройства */
.devices { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; align-items: start; }
.device { overflow: hidden; }
.device.is-here { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.device.is-idle .device-head { opacity: .7; }
.device-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; }
.device-head b { font-size: 15px; font-weight: 600; }
.device-ic { width: 44px; height: 44px; flex: none; border-radius: 13px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); }
.device-ic.sm { width: 34px; height: 34px; border-radius: 10px; }
.device-body { border-top: 1px solid var(--line); padding: 4px 0; }
.sess { display: flex; align-items: center; gap: 10px; padding: 7px 18px; color: var(--ink-2); }
.sess > .ic { color: var(--ink-3); }
.device-foot { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; padding: 10px 14px; border-top: 1px solid var(--line); background: var(--surface-2); }
.rename { flex: 1 1 auto; min-width: 0; }
.rename[open] { flex-basis: 100%; }
.rename > summary { display: inline-flex; }
.rename form { margin-top: 8px; }
.rename form .input { flex: 1; min-width: 0; }
.swipe-promo { display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin-bottom: 14px; }
.swipe-promo .badge { flex: none; }
.ev { gap: 12px; }
.ev-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 14%, transparent); }
.ev.is-bad .ev-dot { background: var(--danger); box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 14%, transparent); }

/* Разработчикам */
.flow { list-style: none; margin: 0 0 22px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; counter-reset: step; }
.flow li { counter-increment: step; display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.flow li::before { content: counter(step, decimal-leading-zero); font: 500 11px var(--mono); color: var(--accent); letter-spacing: .1em; margin-bottom: 4px; }
.flow b { font-size: 14px; }
.flow span { font-size: 12.5px; color: var(--ink-3); }
.st-pending { --tone: var(--warn); }
.st-active { --tone: var(--ok); }
.st-rejected, .st-suspended { --tone: var(--danger); }
.note-box { display: flex; align-items: flex-start; gap: 10px; padding: 13px 16px; border-radius: var(--r); background: #fff8ec; border: 1px solid #f1dfbd; color: var(--warn); font-size: 14px; margin-bottom: 18px; }
.note-box.is-bad { background: #fdf2f2; border-color: #f2d2d2; color: var(--danger); }
.note-box .ic { margin-top: 1px; }
.copy-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.copy-row code { font-size: 13px; padding: 5px 9px; }
.requests { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 12px; }
.review { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.review .input { flex: 1; min-width: 180px; }

/* Вход: знакомые аккаунты */
.known { display: flex; flex-direction: column; gap: 8px; }
.known-row { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm); min-width: 0; }
.or { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 12.5px; }
.or::before, .or::after { content: ''; flex: 1; border-top: 1px solid var(--line); }

/* ── Вход свайпом: экран подтверждения ──────────────────────────────────── */
html.swipe-lock, html.swipe-lock body { overflow: hidden; overscroll-behavior: none; }
.swipe {
    position: fixed; inset: 0; z-index: 200; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 12px;
    padding: calc(28px + env(safe-area-inset-top)) 22px calc(22px + env(safe-area-inset-bottom));
    color: #fff; background: #0b0e1d; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none;
    opacity: 0; transition: opacity .25s ease;
}
.swipe::before {
    content: ''; position: absolute; inset: -20%; pointer-events: none;
    background: radial-gradient(55% 40% at 50% 100%, rgba(48, 68, 208, .6), transparent 70%),
                radial-gradient(40% 30% at 85% 5%, rgba(12, 148, 136, .38), transparent 70%);
    opacity: calc(.65 + var(--pull, 0) * .35); transform: translateY(calc(var(--pull, 0) * -6%));
}
.swipe > * { position: relative; }
.swipe.is-on { opacity: 1; }
.swipe-top { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; transform: translateY(14px); transition: transform .4s cubic-bezier(.2, .8, .2, 1), opacity .3s; }
.swipe.is-on .swipe-top { transform: none; }
.swipe-top .label-mono { color: #9aa1b8; }
.swipe-top h2 { font-size: clamp(22px, 6vw, 28px); max-width: 15em; text-wrap: balance; }
.swipe-top p { color: #b9bfd3; max-width: 26em; }
.swipe-stage { display: grid; place-items: center; position: relative; min-height: 0; }
.swipe-card {
    width: min(58vw, 240px); max-height: 100%; aspect-ratio: 10 / 16; padding: 20px; border-radius: 32px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center;
    background: linear-gradient(160deg, rgba(255, 255, 255, .17), rgba(255, 255, 255, .04));
    border: 1px solid rgba(255, 255, 255, .24); box-shadow: 0 34px 90px -30px rgba(48, 68, 208, .95), inset 0 1px 0 rgba(255, 255, 255, .28);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); cursor: grab; will-change: transform;
    transition: transform .45s cubic-bezier(.2, .9, .25, 1.15), opacity .45s; animation: swipe-bob 2.6s ease-in-out infinite;
}
.swipe-card.is-drag { transition: none; animation: none; cursor: grabbing; }
.swipe-card .mark { width: 46px; height: 54px; background: linear-gradient(150deg, #9aa8ff, #45dccb); -webkit-mask: url('/static/logo.png') center / contain no-repeat; mask: url('/static/logo.png') center / contain no-repeat; }
.swipe-card b { font-family: var(--display); font-size: 18px; font-weight: 600; }
.swipe-card .tiny { color: #b9bfd3; word-break: break-all; }
.swipe.is-go .swipe-card { transform: translateY(-135vh) scale(.82) !important; opacity: 0; animation: none; transition: transform .62s cubic-bezier(.55, 0, .2, 1), opacity .5s .12s; }
.swipe.is-go .swipe-top, .swipe.is-go .swipe-bottom { opacity: 0; transition: opacity .25s; }
.swipe-hint { position: absolute; bottom: 2%; display: flex; flex-direction: column-reverse; align-items: center; gap: 1px; pointer-events: none; }
.swipe-hint i { width: 13px; height: 13px; border-left: 2px solid #fff; border-top: 2px solid #fff; transform: rotate(45deg); opacity: .15; animation: swipe-chev 1.5s infinite; }
.swipe-hint i:nth-child(2) { animation-delay: .16s; }
.swipe-hint i:nth-child(3) { animation-delay: .32s; }
.swipe-bottom { display: flex; flex-direction: column; align-items: center; gap: 10px; transition: opacity .3s; }
.swipe-cta { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; }
.swipe-bottom .btn { width: min(320px, 100%); }
.swipe-bottom .btn-ghost { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .22); color: #fff; box-shadow: none; }
.swipe-bottom .btn-ghost:hover { color: #fff; border-color: rgba(255, 255, 255, .4); }
.swipe-bottom .btn-quiet { display: none; color: #fff; background: rgba(255, 255, 255, .14); }
.swipe-bottom .tiny { color: #9aa1b8; font-family: var(--mono); }
@media (hover: hover) and (pointer: fine) { .swipe-bottom .btn-quiet { display: inline-flex; } }
@keyframes swipe-chev { 0%, 100% { opacity: .15; } 40% { opacity: .95; } }
@keyframes swipe-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

/* ── Вход свайпом: ожидание и «прилёт» экрана ───────────────────────────── */
.swipe-wait { display: flex; flex-direction: column; gap: 20px; }
.relay { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: end; gap: 10px; padding: 8px 4px 0; }
.relay-phone { position: relative; width: 52px; height: 90px; border: 2px solid var(--ink); border-radius: 12px; display: grid; place-items: center; }
.relay-phone .relay-screen { position: absolute; inset: 4px; border-radius: 7px; background: linear-gradient(160deg, var(--accent), var(--accent-2)); animation: relay-out 2.8s ease-in-out infinite; }
.relay-hand { position: relative; color: #fff; display: inline-flex; animation: relay-hand 2.8s ease-in-out infinite; }
.relay-beam { display: flex; justify-content: center; gap: 9px; padding-bottom: 38px; }
.relay-beam i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); opacity: .15; animation: relay-dot 2.8s infinite; }
.relay-beam i:nth-child(2) { animation-delay: .12s; }
.relay-beam i:nth-child(3) { animation-delay: .24s; }
.relay-laptop { display: flex; flex-direction: column; align-items: center; }
.relay-laptop .relay-screen { position: relative; overflow: hidden; width: 116px; height: 74px; border: 2px solid var(--ink); border-radius: 8px 8px 2px 2px; background: var(--surface-2); }
.relay-laptop .relay-screen::after { content: ''; position: absolute; inset: 3px; border-radius: 4px; background: linear-gradient(160deg, var(--accent), var(--accent-2)); transform: translateY(110%); animation: relay-in 2.8s cubic-bezier(.2, .8, .2, 1) infinite; }
.relay-base { width: 146px; height: 6px; border-radius: 0 0 7px 7px; background: var(--ink); }
.swipe-wait.is-over .relay, .swipe-wait.is-over .relay * { animation-play-state: paused; opacity: .45; }
@keyframes relay-out { 0%, 18% { transform: none; opacity: 1; } 45% { transform: translateY(-55%) scale(.7); opacity: 0; } 46%, 88% { transform: none; opacity: 0; } 100% { opacity: 1; } }
@keyframes relay-hand { 0%, 8% { transform: translateY(18px); opacity: 0; } 20% { opacity: 1; } 42% { transform: translateY(-16px); opacity: 0; } 100% { opacity: 0; } }
@keyframes relay-dot { 0%, 38% { opacity: .15; } 50% { opacity: 1; } 64%, 100% { opacity: .15; } }
@keyframes relay-in { 0%, 52% { transform: translateY(110%); } 72%, 92% { transform: none; } 100% { transform: translateY(110%); } }

.arrive { position: fixed; inset: 0; z-index: 300; pointer-events: none; }
.arrive-sheet {
    position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: #fff;
    background: radial-gradient(60% 45% at 50% 0%, rgba(12, 148, 136, .55), transparent 70%), linear-gradient(165deg, #3044d0, #1f2c95 58%, #0b0e1d);
    transform: translateY(105%) scale(.55); border-radius: 48px; opacity: 0;
}
.arrive.is-on .arrive-sheet { animation: arrive .72s cubic-bezier(.16, .9, .25, 1) forwards; }
.arrive-sheet .mark { width: 56px; height: 64px; background: #fff; -webkit-mask: url('/static/logo.png') center / contain no-repeat; mask: url('/static/logo.png') center / contain no-repeat; opacity: 0; animation: arrive-fade .3s .42s forwards; }
.arrive-sheet b { font-family: var(--display); font-size: 22px; font-weight: 600; opacity: 0; animation: arrive-fade .3s .5s forwards; }
@keyframes arrive { 0% { transform: translateY(105%) scale(.55); border-radius: 48px; opacity: .6; } 62% { transform: translateY(0) scale(.95); border-radius: 30px; opacity: 1; } 100% { transform: none; border-radius: 0; opacity: 1; } }
@keyframes arrive-fade { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
    .swipe-card, .swipe-hint i, .relay *, .relay-laptop .relay-screen::after { animation: none !important; }
    .arrive.is-on .arrive-sheet { animation-duration: .01s; }
}

/* ═══ Телефон: как приложение — шапка сверху, вкладки снизу ═══════════════ */
@media (max-width: 900px) {
    body { background: var(--bg); }
    .appbar {
        display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 40;
        min-height: calc(58px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 16px 0;
        background: color-mix(in srgb, var(--bg) 84%, transparent); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
        border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
    }
    .appbar-mark { display: inline-flex; }
    .appbar-mark .mark { width: 22px; height: 26px; background: linear-gradient(150deg, var(--accent) 10%, var(--accent-2) 95%); -webkit-mask: url('/static/logo.png') center / contain no-repeat; mask: url('/static/logo.png') center / contain no-repeat; }
    .appbar-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
    .appbar-title small { font: 500 10px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
    .appbar-title b { font: 600 17px var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

    .side {
        position: fixed; top: auto; bottom: 0; left: 0; right: 0; z-index: 40; height: auto;
        flex-direction: row; flex-wrap: nowrap; align-items: stretch; gap: 0;
        padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); border: 0; border-top: 1px solid var(--line);
        background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px);
    }
    .side > .logo, .side-foot, .side-label, .side-link.ext, .side-link.more { display: none !important; }
    .side > nav { order: 0; flex: 1 1 auto; flex-direction: row; justify-content: space-around; overflow: visible; margin: 0; padding: 0; gap: 0; }
    .side-link {
        flex: 1 1 0; min-width: 0; flex-direction: column; justify-content: center; gap: 3px; padding: 4px 2px;
        font-size: 10.5px; font-weight: 600; letter-spacing: .01em; color: var(--ink-3); border-radius: 12px; background: none !important;
        -webkit-tap-highlight-color: transparent;
    }
    .side-link .ic { box-sizing: content-box; padding: 4px 16px; border-radius: 99px; transition: background .2s, color .2s; }
    .side-link.on { color: var(--accent); }
    .side-link.on .ic { background: var(--accent-soft); }
    .side-link:active .ic { background: var(--sunken); }
    .side-link .full { display: none; }
    .side-link .short { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .side-link .dot-count { position: absolute; top: 0; left: calc(50% + 8px); margin: 0; }

    .view { padding: 16px 16px calc(92px + env(safe-area-inset-bottom)); }
    .page-head { margin-bottom: 18px; gap: 14px; }
    .page-head .titles { min-width: 0; flex-basis: 100%; }
    .page-head h1 { font-size: 25px; }
    .page-head .sub { font-size: 14px; }
    .page-head .actions { width: 100%; }
    .page-head .actions > *, .page-head .actions form .btn { flex: 1; width: 100%; }
    .crumbs { display: none; }
    .profile-head { margin-top: 0; }

    .input, .select, .textarea { font-size: 16px; }
    .input, .select { height: 46px; border-radius: 12px; }
    .input-sm, .select.input-sm { height: 40px; font-size: 16px; }
    .btn { height: 44px; border-radius: 12px; }
    .btn-sm { height: 36px; border-radius: 10px; }
    .btn-lg { height: 50px; }
    .form-actions .btn { flex: 1; }
    .panel { border-radius: 18px; }
    .panel-foot { border-radius: 0 0 18px 18px; }
    .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .only-sm { display: block; }
    .flashes { position: sticky; top: calc(66px + env(safe-area-inset-top)); z-index: 30; }
    .flash { box-shadow: var(--shadow); }
    .solo-main { padding: calc(18px + env(safe-area-inset-top)) 18px calc(18px + env(safe-area-inset-bottom)); }
}
@media (max-width: 560px) {
    .people, .devices, .requests { grid-template-columns: minmax(0, 1fr); }
    .person { padding: 13px 14px; border-radius: 16px; }
    .hello { flex-direction: column; align-items: flex-start; gap: 14px; padding: 18px; }
    .hello .avatar.lg, .profile-head .avatar.lg { width: 60px; height: 60px; font-size: 20px; }
    .profile-head { padding: 16px; gap: 14px; }
    .device-head { padding: 14px 16px; }
    .sess { padding: 7px 16px; }
    .swipe-promo { padding: 13px 14px; align-items: flex-start; }
    .review { flex-direction: column; align-items: stretch; }
    .review .row .btn { flex: 1; }
    .relay-laptop .relay-screen { width: 96px; height: 62px; }
    .relay-base { width: 120px; }
}

/* ═══ v6: листы, вкладки, уведомления, рабочие экраны ═════════════════════ */
:root { --ease: cubic-bezier(.2, .8, .2, 1); }
html.sheet-lock, html.sheet-lock body { overflow: hidden; }

/* Нижние листы и диалоги */
dialog.sheet {
    border: 0; padding: 0; margin: auto; width: min(620px, calc(100vw - 32px)); max-height: min(88dvh, 920px);
    border-radius: 20px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); overflow: hidden;
    flex-direction: column; transition: transform .2s var(--ease);
}
dialog.sheet[open] { display: flex; animation: sheet-pop .22s var(--ease); }
dialog.sheet.closing { animation: sheet-hide .18s ease forwards; }
dialog.sheet::backdrop { background: rgba(15, 18, 34, .36); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
dialog.sheet.wide { width: min(980px, calc(100vw - 32px)); }
dialog.sheet.drawer { margin: 0 0 0 auto; width: min(480px, 100vw); height: 100dvh; max-height: 100dvh; border-radius: 0; }
dialog.sheet.drawer[open] { animation: side-in .24s var(--ease); }
dialog.sheet.drawer.closing { animation: side-out .18s ease forwards; }
.sheet-grip { display: none; }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex: none; }
.sheet-head h3 { font-size: 17px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-body { padding: 18px 20px; overflow-y: auto; flex: 1 1 auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 16px; }
.sheet-foot { padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap; background: var(--surface-2); flex: none; }
.sheet-foot .grow { flex: 1; }
@keyframes sheet-pop { from { opacity: 0; transform: translateY(10px) scale(.985); } }
@keyframes sheet-hide { to { opacity: 0; transform: translateY(10px) scale(.985); } }
@keyframes side-in { from { transform: translateX(40px); opacity: 0; } }
@keyframes side-out { to { transform: translateX(40px); opacity: 0; } }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes sheet-down { to { transform: translateY(100%); } }

/* Плотные формы: поля в ряд, а не столбиком */
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.fgrid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fgrid.one { grid-template-columns: minmax(0, 1fr); }
.fgrid .full { grid-column: 1 / -1; }

.chip-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: all .15s ease;
}
.chip-check:hover {
  background: var(--sunken);
  color: var(--ink);
  border-color: var(--ink-3);
}
.chip-check input[type="checkbox"] {
  display: none;
}
.chip-check .chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-3);
  transition: all .15s ease;
}
.chip-check:has(input:checked) {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--ink);
  border-color: var(--accent);
}
.chip-check:has(input:checked) .chip-dot {
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}
.fieldset { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.fieldset > .label-mono { margin-bottom: -2px; }
.toggle-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.toggle-row .grow > b { display: block; font-size: 14px; font-weight: 600; }
.toggle-row .grow > span { font-size: 12.5px; color: var(--ink-3); }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--line-strong); transition: background .2s; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s var(--ease); }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Сегментные вкладки */
.seg-tabs { display: flex; gap: 4px; padding: 4px; background: var(--sunken); border-radius: 13px; overflow-x: auto; scrollbar-width: none; margin-bottom: 18px; width: max-content; max-width: 100%; }
.seg-tabs::-webkit-scrollbar { display: none; }
.tab-btn { border: 0; background: none; height: 36px; padding: 0 14px; border-radius: 10px; font-size: 14px; font-weight: 500; color: var(--ink-2); display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; cursor: pointer; transition: background .15s, color .15s, box-shadow .15s; }
.tab-btn:hover { color: var(--ink); }
.tab-btn.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(15, 18, 34, .08), 0 2px 8px -4px rgba(15, 18, 34, .12); }
.tab-btn .count-badge { padding: 0 6px; }
[data-pane][hidden] { display: none !important; }

/* Всплывающие уведомления */
.toasts { position: fixed; z-index: 500; left: 50%; transform: translateX(-50%); top: calc(14px + env(safe-area-inset-top)); display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100vw - 24px)); pointer-events: none; }
.toast { padding: 12px 16px; border-radius: 14px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(-10px) scale(.98); transition: opacity .25s, transform .25s var(--ease); }
.toast.on { opacity: 1; transform: none; }
.toast.err { background: var(--danger); }

/* Верхняя панель портала (на компьютере) */
.icon-btn { position: relative; width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; color: var(--ink-2); border: 0; background: none; cursor: pointer; transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--sunken); color: var(--ink); }
.icon-btn .dot-badge { position: absolute; top: 4px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--danger); color: #fff; font: 600 10.5px/17px var(--sans); text-align: center; box-shadow: 0 0 0 2px var(--bg); }
.topbar-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.timer-pill { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px 0 10px; border-radius: 99px; background: color-mix(in srgb, var(--ok) 9%, var(--surface)); color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 25%, transparent); font: 600 13px var(--mono); white-space: nowrap; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; animation: live 1.4s ease-in-out infinite; }
@keyframes live { 50% { opacity: .3; } }
.ai-btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--accent-line); background: linear-gradient(120deg, var(--accent-soft), color-mix(in srgb, var(--accent-2) 10%, var(--surface))); color: var(--accent); font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.ai-btn:hover { box-shadow: 0 6px 18px -10px rgba(48, 68, 208, .7); }
.spark { width: 16px; height: 16px; flex: none; }
@media (min-width: 901px) {
    .main > .appbar.topbar {
        display: flex; align-items: center; gap: 14px; position: sticky; top: 0; z-index: 30; height: 62px; padding: 0 40px;
        background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.5) blur(14px); -webkit-backdrop-filter: saturate(1.5) blur(14px);
        border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
    }
    .topbar .appbar-mark, .topbar > .avatar { display: none; }
    .topbar .appbar-title { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
    .topbar .appbar-title small { font: 500 10px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
    .topbar .appbar-title b { font: 600 16px var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .tab-more { display: none !important; }
}

/* Выбор роли */
.role-switch { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; color: var(--accent); font-size: 12px; font-weight: 600; cursor: pointer; }
.role-switch .ic { color: var(--accent); }
.choice { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; transition: border-color .15s, background .15s; }
.choice:hover { border-color: var(--accent-line); }
.choice input { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice .grow > b { display: block; font-size: 14px; }
.choice .grow > span { font-size: 12.5px; color: var(--ink-3); }

/* «Ещё» на телефоне */
.more-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.more-grid a, .more-grid button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 86px; padding: 12px 8px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--ink-2); text-align: center; cursor: pointer; }
.more-grid .ic { color: var(--accent); }
.more-grid a:active, .more-grid button:active { transform: scale(.97); }

/* «Сегодня» */
.today-head { display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; margin-bottom: 22px; }
.today-head .titles { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 6px; }
.today-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.brief { position: relative; padding: 18px 20px; border-radius: var(--r-lg); border: 1px solid var(--accent-line); background: linear-gradient(130deg, color-mix(in srgb, var(--accent-soft) 85%, var(--surface)), color-mix(in srgb, var(--accent-2) 7%, var(--surface))); }
.brief-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.brief-head b { font-size: 14px; color: var(--accent); }
.brief .md { font-size: 14px; }
.ai-mark { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; color: #fff; background: linear-gradient(140deg, var(--accent), var(--accent-2)); flex: none; }
.task-row { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-top: 1px solid var(--line); min-height: 54px; }
.task-row:first-child { border-top: 0; }
.task-row .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.task-row a.t { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-row a.t:hover { color: var(--accent); }
.task-row .meta { font-size: 12px; color: var(--ink-3); display: flex; gap: 8px; flex-wrap: wrap; }
.task-check { width: 24px; height: 24px; flex: none; border-radius: 8px; border: 1.5px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; color: transparent; cursor: pointer; transition: background .15s, border-color .15s, color .15s, transform .15s; }
.task-check:hover { border-color: var(--ok); color: color-mix(in srgb, var(--ok) 45%, transparent); }
.task-check.done { background: var(--ok); border-color: var(--ok); color: #fff; transform: scale(1.06); }
.task-row.is-done a.t { text-decoration: line-through; color: var(--ink-3); }
.group-label { display: flex; align-items: center; gap: 8px; padding: 12px 18px 6px; font: 500 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); border-top: 1px solid var(--line); }
.group-label:first-child { border-top: 0; }
.group-label.late { color: var(--danger); }
.prio { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--line-strong); }
.prio.p1 { background: var(--danger); }
.prio.p2 { background: var(--accent); }

.week-bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; align-items: end; height: 92px; }
.week-bars > div { display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; justify-content: flex-end; }
.week-bars i { display: block; width: 100%; max-width: 30px; min-height: 3px; border-radius: 6px 6px 3px 3px; background: var(--sunken); }
.week-bars i.on { background: linear-gradient(180deg, var(--accent), var(--accent-2)); }
.week-bars span { font: 500 10.5px var(--mono); color: var(--ink-3); }
.week-bars .is-today span { color: var(--accent); font-weight: 600; }

/* Сигналы */
.signals { display: flex; flex-direction: column; }
.signal { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-top: 1px solid var(--line); min-height: 52px; transition: background .12s; }
.signal:first-child { border-top: 0; }
a.signal:hover { background: var(--surface-2); }
.signal .sig-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.signal.red .sig-ic { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, var(--surface)); }
.signal.amber .sig-ic { color: var(--warn); background: color-mix(in srgb, var(--warn) 11%, var(--surface)); }
.signal .grow { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.signal .grow b { font-size: 13.5px; font-weight: 500; }
.signal .grow span { font-size: 12px; color: var(--ink-3); }
.signal-strip { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-bottom: 18px; padding-bottom: 2px; }
.signal-strip::-webkit-scrollbar { display: none; }
.signal-chip { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 99px; font-size: 13px; font-weight: 500; white-space: nowrap; border: 1px solid; }
.signal-chip.red { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 28%, transparent); background: color-mix(in srgb, var(--danger) 7%, var(--surface)); }
.signal-chip.amber { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); background: color-mix(in srgb, var(--warn) 7%, var(--surface)); }
.all-good { display: flex; align-items: center; gap: 12px; padding: 16px 18px; color: var(--ok); font-size: 14px; font-weight: 500; }

/* Стендап */
.mood { display: flex; gap: 6px; }
.mood label { cursor: pointer; }
.mood input { position: absolute; opacity: 0; pointer-events: none; }
.mood span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); font-size: 18px; filter: grayscale(1); opacity: .6; transition: .15s; }
.mood input:checked + span { filter: none; opacity: 1; border-color: var(--accent); background: var(--accent-soft); transform: scale(1.06); }
.checkin-done { display: grid; gap: 8px; font-size: 13.5px; }
.checkin-done b { font-size: 11px; font-family: var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; }

/* ═══════════════════════════════════════════════════════════════════════════
   ИИ-агент и чат (дизайн-код Antigravity / ChatGPT / Codex)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Разметка ответов ИИ */
.md { line-height: 1.68; font-size: 14.5px; color: #1e293b; overflow-wrap: anywhere; }
.md > * + * { margin-top: 10px; }
.md h3 { font-size: 17px; font-weight: 600; margin-top: 20px; margin-bottom: 8px; color: var(--ink); }
.md h4 { font-size: 15.5px; font-weight: 600; margin-top: 16px; margin-bottom: 6px; color: var(--ink); }
.md h5 { font-size: 14px; font-weight: 600; margin-top: 14px; margin-bottom: 4px; color: var(--ink-2); }
.md p { margin: 8px 0; }
.md ul, .md ol { margin: 8px 0; padding-left: 22px; }
.md li { margin-bottom: 4px; line-height: 1.65; }
.md li + li { margin-top: 4px; }
.md b, .md strong { font-weight: 600; color: var(--ink); }
.md hr.md-hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.md code:not(pre code) {
  font-family: var(--mono);
  font-size: 12.5px;
  background: #f1f5f9;
  border: 1px solid rgba(0, 0, 0, 0.06);
  padding: 2px 6px;
  border-radius: 6px;
  color: #0f172a;
}

/* Блоки кода (Codex / Antigravity style) */
.code-block {
  margin: 14px 0;
  border-radius: 12px;
  overflow: hidden;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
}
.cb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 14px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-family: var(--mono);
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.cb-copy {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 0;
  color: #94a3b8;
  font-size: 11px;
  font-family: var(--sans);
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 6px;
  transition: all .15s;
}
.cb-copy:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}
.code-block pre {
  margin: 0;
  padding: 14px 16px;
  background: transparent;
  color: #e2e8f0;
  font: 13px/1.55 var(--mono);
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}
.code-block pre::-webkit-scrollbar { height: 5px; }
.code-block pre::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 3px; }
.code-block pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
pre:empty, pre code:empty, .code-block:empty { display: none !important; }

/* ═══ ИИ-агент: чат (templates/ai.html, _agent.html, static/agent.js) ═════════
   Как агент наставника в школе: лента по центру, шаги агента — тихими строками с тонкой
   линией, всё управление (файлы, режим, модель с ценой) — внутри поля ввода. Страница
   прокручивается целиком: шапка чата прилипает под верхней панелью, поле ввода — к низу. */
.view:has(> .ac) { max-width: none; padding-bottom: 0; }
/* разговор, поле ввода и подсказки стоят посередине всей свободной от меню ширины, а не колонки справа
   от списка чатов: сдвиг влево на половину колонки списка (236 + 28), пока хватает места */
@media (min-width: 901px) {
  .ac:not(.ac-compact) .ac-main { container-type: inline-size; }
  .ac:not(.ac-compact) .ac-main > :is(.ac-feed, .ac-pending, .ac-composer, .ac-chips) {
    translate: calc(-1 * clamp(0px, (100cqw - var(--ac-w)) / 2, 132px)) 0; }
}
.ac { --ac-top: 62px; --ac-w: 780px; display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 28px; align-items: start;
  min-height: calc(100dvh - 62px - 34px); }

/* список чатов */
.ac-side { position: sticky; top: calc(var(--ac-top) + 12px); display: flex; flex-direction: column; gap: 3px;
  max-height: calc(100dvh - var(--ac-top) - 30px); }
.ac-side-head { display: flex; gap: 6px; margin-bottom: 6px; }
.ac-new { flex: 1; display: inline-flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; font-size: 14px;
  box-shadow: var(--shadow-sm); transition: background .15s, border-color .15s; }
.ac-new:hover { background: var(--surface-2); border-color: var(--line-strong); }
.ac-side-link { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 0; border-radius: 10px; background: none;
  color: var(--ink-2); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.ac-side-link:hover { background: var(--sunken); color: var(--ink); }
.ac-side-link .ic { color: var(--ink-3); }
.ac-list { display: flex; flex-direction: column; gap: 1px; overflow-y: auto; scrollbar-width: thin; padding-right: 2px; }
.ac-list-label { margin: 14px 12px 4px; font: 500 10.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.ac-list-label:has(+ .ac-list-empty:not([hidden])) { display: none; }
.ac-chat { display: flex; align-items: center; border-radius: 10px; font-size: 13.5px; color: var(--ink-2); transition: background .15s, color .15s; }
.ac-chat > a { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 8px 4px 8px 12px; color: inherit; }
.ac-chat > a > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-chat:hover { background: var(--sunken); color: var(--ink); }
.ac-chat.is-on { background: var(--accent-soft); color: var(--accent); font-weight: 550; }
.ac-chat-del { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 28px; height: 28px;
  margin-right: 4px; padding: 0 7px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-3); font: inherit; font-size: 12.5px;
  cursor: pointer; opacity: 0; transition: opacity .15s, background .15s, color .15s; }
.ac-chat:hover .ac-chat-del, .ac-chat.is-on .ac-chat-del, .ac-chat-del:focus-visible, .ac-chat-del.is-armed { opacity: 1; }
.ac-chat-del:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.ac-chat-del.is-armed { color: #fff; background: var(--danger); font-weight: 600; }
@media (hover: none) { .ac-chat-del { opacity: .7; } }
.ac-title.is-new, .ac-chat span.is-new { animation: ac-title .6s ease both; }
@keyframes ac-title { from { opacity: 0; filter: blur(4px); } }
.ac-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); animation: ac-pulse 1.4s ease-in-out infinite; }
.ac-list-empty { margin: 12px; font-size: 12.5px; line-height: 1.45; color: var(--ink-3); }
.ac .ac-side-close, .ac .ac-side-open { display: none; }
.ac-scrim[hidden] { display: none; }

/* память агента */
.ac-mem { width: min(520px, calc(100vw - 32px)); max-height: 80dvh; padding: 0; border: 1px solid var(--line); border-radius: 18px;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); }
.ac-mem::backdrop { background: rgba(15, 18, 34, .36); backdrop-filter: blur(3px); }
.ac-mem[open] { display: flex; flex-direction: column; }
.ac-mem-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 6px 20px; font-size: 16px; }
.ac-mem > .ac-muted { margin: 0 20px 10px; }
.ac-mem-list { list-style: none; margin: 0; padding: 0 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.ac-mem-list li { display: flex; align-items: center; gap: 8px; padding: 6px 4px 6px 10px; border-radius: 10px; background: var(--surface-2); font-size: 13.5px; }
.ac-mem-list li span { flex: 1; min-width: 0; }
.ac-mem-list li.ac-muted { background: none; }
.ac-mem-add { display: flex; gap: 8px; padding: 12px 16px 16px; border-top: 1px solid var(--line); margin-top: 10px; }
.ac-mem-add input { flex: 1; min-width: 0; height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 13.5px; outline: none; }
.ac-mem-add input:focus { border-color: var(--accent); }

/* шапка чата */
.ac-main { min-width: 0; display: flex; flex-direction: column; min-height: calc(100dvh - 62px - 34px); }
.ac-bar { position: sticky; top: var(--ac-top); z-index: 20; display: flex; align-items: center; gap: 6px; padding: 8px 0 10px;
  background: linear-gradient(180deg, var(--bg) 75%, transparent); }
.ac-title { flex: 1; min-width: 0; font-weight: 600; font-size: 15px; color: var(--ink-2); white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; padding: 5px 8px; border-radius: 8px; cursor: text; outline: none; }
.ac-title:hover { color: var(--ink); }
.ac-title[contenteditable="true"] { color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.ac.is-empty .ac-title { visibility: hidden; }
.ac-icon { display: inline-grid; place-items: center; width: 36px; height: 36px; flex: 0 0 auto; border: 0; border-radius: 10px;
  background: transparent; color: var(--ink-3); cursor: pointer; transition: background .15s, color .15s; }
.ac-icon:hover { background: var(--sunken); color: var(--ink); }
.ac-menu { position: relative; }
.ac-menu[hidden] { display: none; }
.ac-menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 200px; display: flex; flex-direction: column; padding: 6px;
  border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.ac-menu-pop[hidden] { display: none; }
.ac-menu-pop button, .ac-menu-pop a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 0; border-radius: 9px; background: none;
  color: var(--ink-2); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.ac-menu-pop button:hover, .ac-menu-pop a:hover { background: var(--sunken); color: var(--ink); }
.ac-menu-pop .is-danger { color: var(--danger); }
.ac-menu-pop .is-danger:hover { background: color-mix(in srgb, var(--danger) 9%, transparent); color: var(--danger); }

/* лента */
.ac-feed { flex: 1; display: flex; flex-direction: column; gap: 16px; padding: 8px 0 24px; max-width: var(--ac-w); width: 100%; margin: 0 auto; }
.ac-item { min-width: 0; animation: ac-in .25s ease both; }
@keyframes ac-in { from { opacity: 0; transform: translateY(4px); } }
.ac-item:is(.is-tool, .is-todo, .is-agents) + .ac-item:is(.is-tool, .is-todo, .is-agents) { margin-top: -14px; }
.ac-item.is-user:not(:first-child) { margin-top: 10px; }
.ac-item.is-usage { margin-top: -10px; }
.ac-hello { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 0 8px 22px; text-align: center; }
.ac-hello[hidden] { display: none; }
.ac-hello h1 { margin: 0; font-size: 30px; font-weight: 600; letter-spacing: -.01em; }
.ac-hello p { margin: 0; max-width: 520px; color: var(--ink-3); font-size: 14.5px; line-height: 1.55; }
.ac-warn { color: var(--warn) !important; }
/* пустой чат: приветствие, поле ввода и подсказки — посередине экрана */
.ac.is-empty .ac-feed { flex: 0 0 auto; margin-top: auto; padding-bottom: 0; }
.ac.is-empty .ac-chips { margin-bottom: auto; }
.ac.is-empty .ac-composer { position: static; background: none; }

.ac-msg.is-user { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.ac-bubble { max-width: min(600px, 85%); padding: 10px 16px; border-radius: 20px; font-size: 15px; line-height: 1.5;
  background: var(--sunken); color: var(--ink); overflow-wrap: anywhere; }
.ac-queued { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-3); }
.ac-att { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ac-file { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 8px; font-size: 12px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); }
.ac-file button { border: 0; background: none; color: var(--ink-3); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 0 0 2px; }
.ac-md { min-width: 0; font-size: 15px; line-height: 1.65; color: var(--ink); overflow-wrap: anywhere; }
.ac-md > :first-child { margin-top: 0; }
.ac-md > :last-child { margin-bottom: 0; }
.ac-md p { margin: 0 0 12px; }
.ac-md h3, .ac-md h4, .ac-md h5 { margin: 18px 0 6px; font-family: var(--sans); font-size: 16px; font-weight: 600; }
.ac-md ul, .ac-md ol { margin: 4px 0 12px; padding-left: 22px; }
.ac-md li { margin: 4px 0; }
.ac-md li::marker { color: var(--ink-3); }
.ac-md code { padding: 1px 6px; border-radius: 6px; background: var(--sunken); border: 0; font-size: .88em; word-break: normal; }
.ac-md a { color: var(--accent); font-weight: 500; }
.ac-md a:hover { text-decoration: underline; }
.ac-md .ac-table { margin: 6px 0 12px; }
.ac-msg.is-interim .ac-md { color: var(--ink-2); font-size: 14.5px; }
.ac-code { margin: 8px 0 12px; padding: 12px 14px; border-radius: 12px; background: #10131f; color: #e2e8f0; overflow-x: auto; font: 13px/1.55 var(--mono); }
.ac-code code { background: none !important; padding: 0 !important; color: inherit; }
.ac-note { align-self: center; padding: 7px 14px; border-radius: 999px; font-size: 13px; color: var(--ink-3); background: var(--sunken); }
.ac-note.is-err { color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, transparent); display: inline-flex; gap: 6px; align-items: center; }
.ac-item > .ac-note { display: table; margin: 0 auto; }
.ac-flash { align-self: center; }
.ac-usage { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; cursor: help; opacity: .85; }
.ac-usage:hover { opacity: 1; }

/* шаги агента: «значок · что делает · подробность», раскрываются по нажатию */
.ac-step-row { display: flex; align-items: center; gap: 10px; min-width: 0; margin: 0 -8px; padding: 5px 8px; border-radius: 10px;
  font-size: 13.5px; color: var(--ink-2); list-style: none; }
summary.ac-step-row { cursor: pointer; transition: background .15s; }
summary.ac-step-row:hover { background: var(--sunken); }
summary.ac-step-row::-webkit-details-marker, .ac-plan > summary::-webkit-details-marker { display: none; }
.ac-step-ic { width: 18px; height: 18px; flex: 0 0 auto; display: grid; place-items: center; color: var(--ink-3); }
.ac-step-text { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; white-space: nowrap; overflow: hidden; }
.ac-step-name { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 550; color: var(--ink-2); }
.ac-step-sum { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--ink-3); }
.ac-step-sum.is-live { color: var(--accent); }
.ac-step-link { flex: 0 0 auto; font-size: 12.5px; font-weight: 600; color: var(--accent); }
.ac-step-link:hover { text-decoration: underline; }
.ac-step-chev { flex: 0 0 auto; display: grid; color: var(--ink-3); opacity: 0; transform: rotate(-90deg); transition: transform .2s, opacity .2s; }
summary:hover > .ac-step-chev, details[open] > summary > .ac-step-chev { opacity: 1; }
details[open] > summary > .ac-step-chev { transform: none; }
.st-running > .ac-step-row .ac-step-ic, .st-queued > .ac-step-row .ac-step-ic { color: var(--accent); }
.st-running > .ac-step-row .ac-step-name { color: var(--ink); }
.st-done.is-write > .ac-step-row .ac-step-ic { color: var(--ok); }
.st-error > .ac-step-row .ac-step-ic { color: var(--danger); }
.st-awaiting > .ac-step-row .ac-step-ic, .st-awaiting > .ac-step-row .ac-step-name { color: var(--warn); }
.st-denied > .ac-step-row .ac-step-name, .st-stopped > .ac-step-row .ac-step-name { color: var(--ink-3); text-decoration: line-through; }
.ac-step-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; margin: 4px 0 10px 9px; padding: 2px 0 2px 19px;
  border-left: 1px solid var(--line); }
.ac-spin { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent;
  animation: ac-rot .8s linear infinite; }
@keyframes ac-rot { to { transform: rotate(360deg); } }
@keyframes ac-pulse { 50% { opacity: .4; } }

/* план */
.ac-plan > summary { display: flex; align-items: center; gap: 10px; margin: 0 -8px; padding: 5px 8px; border-radius: 10px; cursor: pointer;
  list-style: none; font-size: 13.5px; color: var(--ink-2); transition: background .15s; }
.ac-plan > summary:hover { background: var(--sunken); }
.ac-plan-title { font-weight: 550; }
.ac-plan-n { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ac-plan-bar { width: 56px; height: 4px; border-radius: 99px; background: var(--sunken); overflow: hidden; }
.ac-plan-bar b { display: block; height: 100%; border-radius: inherit; background: var(--ok); transition: width .4s; }
.ac-plan ul { list-style: none; display: flex; flex-direction: column; gap: 7px; margin: 4px 0 10px 9px; padding: 3px 0 3px 19px;
  border-left: 1px solid var(--line); }
.ac-plan li { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; line-height: 1.4; color: var(--ink-2); }
.ac-plan li i { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 1px; display: grid; place-items: center; border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--line-strong); color: #fff; }
.ac-plan li.is-done { color: var(--ink-3); }
.ac-plan li.is-done i { background: var(--ok); box-shadow: none; }

/* команда помощников: по строке на каждого */
.ac-agents-head { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 13.5px; font-weight: 550; color: var(--ink-2); }
.ac-agents-head > .ic { width: 18px; color: var(--violet); }
.ac-agents-head em { font-style: normal; font-weight: 400; color: var(--ink-3); }
.ac-agents > .ac-agent { margin-left: 9px; padding-left: 11px; border-left: 1px solid var(--line); }
.ac-agent-key { display: inline-block; margin-right: 8px; padding: 0 6px; border-radius: 6px; font-size: 11px; font-weight: 700;
  background: var(--sunken); color: var(--ink-2); }
.st-running > .ac-step-row .ac-agent-key { background: var(--accent-soft); color: var(--accent); }
.ac-agent.st-done > .ac-step-row .ac-step-ic { color: var(--ok); }
.ac-agent-res { padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.ac-agent-res .ac-md { font-size: 14px; }

/* подтверждение: что именно агент сделает — словами */
.ac-confirm { padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--warn); box-shadow: var(--shadow-sm); }
.ac-confirm-what { margin: 0 0 10px; display: flex; align-items: flex-start; gap: 8px; font-size: 14.5px; line-height: 1.45; font-weight: 600; color: var(--ink); }
.ac-confirm-what .ic { flex: 0 0 auto; margin-top: 2px; color: var(--warn); }
.ac-confirm-rows { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 5px 14px; margin: 0 0 14px; font-size: 13px; }
.ac-confirm-rows dt { color: var(--ink-3); }
.ac-confirm-rows dd { margin: 0; color: var(--ink-2); line-height: 1.45; overflow-wrap: anywhere; }
.ac-confirm-btns { display: flex; gap: 8px; }
.ac-tech { margin-top: 12px; }
.ac-tech summary { cursor: pointer; font-size: 11.5px; color: var(--ink-3); }
.ac-tech pre { margin: 6px 0 0; max-height: 140px; overflow: auto; padding: 8px 10px; border-radius: 8px; background: var(--surface-2);
  font: 11.5px/1.5 var(--mono); white-space: pre-wrap; word-break: break-word; color: var(--ink-3); }
.ac-ok, .ac-no { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  font: inherit; font-weight: 600; font-size: 13.5px; transition: opacity .15s, background .15s; }
.ac-ok { border: 0; color: #fff; background: var(--ink); }
.ac-ok:hover { opacity: .88; }
.ac-no { border: 1px solid var(--line-strong); color: var(--ink-2); background: var(--surface); }
.ac-no:hover { background: var(--sunken); color: var(--ink); }
.ac-ok:disabled, .ac-no:disabled { opacity: .5; }

/* карточки результатов */
.ac-widget { min-width: 0; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.ac-muted { margin: 4px 0; font-size: 13px; color: var(--ink-3); }
.ac-tree-head { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; }
.ac-tree-head b { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 600; }
.ac-tree-head a { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--accent); white-space: nowrap; }
.ac-tree-head a:hover { text-decoration: underline; }
.ac-scroll { overflow-x: auto; }
.ac-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ac-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ac-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); }
.ac-table tr:last-child td { border-bottom: 0; }
.ac-table a { color: var(--ink); font-weight: 600; }
.ac-table a:hover { color: var(--accent); }
.ac-td-bar { display: flex; align-items: center; gap: 8px; min-width: 140px; }
.ac-bar-line { position: relative; flex: 1; height: 6px; min-width: 60px; border-radius: 999px; background: var(--sunken); overflow: hidden; }
.ac-bar-line b { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--accent); }
.ac-chart-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(80px, 1fr) 48px; align-items: center; gap: 10px; padding: 3px 0; font-size: 12.5px; }
.ac-chart-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.ac-chart-row small { color: var(--ink-3); }
.ac-chart-row b { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.ac-stats { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 4px 0 8px; }
.ac-stats span { display: inline-flex; flex-direction: column; gap: 1px; font-size: 12px; color: var(--ink-3); }
.ac-stats b { font-size: 15px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

/* поле ввода: текст сверху, под ним — файлы, режим, модель с ценой, отправка */
.ac-pending { position: sticky; bottom: 132px; z-index: 21; align-self: center; display: flex; align-items: center; gap: 10px; margin: 0 auto 8px;
  padding: 6px 6px 6px 14px; border-radius: 999px; font-size: 13.5px; color: var(--ink-2); background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--warn) 45%, var(--line)); box-shadow: var(--shadow); }
.ac-pending[hidden] { display: none; }
.ac-pending b { color: var(--warn); }
.ac-pending .ac-ok, .ac-pending .ac-no { height: 30px; }
.ac-composer { position: sticky; bottom: 0; z-index: 20; width: 100%; max-width: var(--ac-w); margin: 0 auto; padding: 10px 0 12px;
  background: linear-gradient(180deg, transparent, var(--bg) 28%); }
.ac-box { display: flex; flex-direction: column; gap: 2px; padding: 8px 8px 8px 10px; border-radius: 24px; background: var(--surface);
  border: 1px solid var(--line-strong); box-shadow: var(--shadow); transition: border-color .2s, box-shadow .2s; }
.ac-box:focus-within { border-color: var(--accent-line); box-shadow: var(--shadow), 0 0 0 4px color-mix(in srgb, var(--accent) 8%, transparent); }
.ac-box textarea { width: 100%; min-height: 30px; max-height: 220px; resize: none; padding: 8px 8px 4px; border: 0; outline: none; background: transparent;
  color: var(--ink); font: inherit; font-size: 15px; line-height: 1.5; }
.ac-box textarea::placeholder { color: var(--ink-3); }
.ac-files { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 4px; }
.ac-files[hidden] { display: none; }
.ac-box.is-drop { border-color: var(--accent); border-style: dashed; background: var(--accent-soft); }
.ac-tools { display: flex; align-items: center; gap: 4px; min-width: 0; }
.ac-tool { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; cursor: pointer;
  color: var(--ink-2); border: 1px solid var(--line); transition: background .15s, color .15s; }
.ac-tool:hover { background: var(--sunken); color: var(--ink); }
.ac-pill { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 34px; min-width: 0; padding: 0 11px; border-radius: 999px;
  border: 0; background: transparent; color: var(--ink-2); font: inherit; font-size: 13px; font-weight: 550; white-space: nowrap; cursor: pointer;
  transition: background .15s, color .15s; }
.ac-pill:hover:not(:disabled) { background: var(--sunken); color: var(--ink); }
.ac-pill:disabled { cursor: default; }
.ac-pill > span { display: inline-flex; }
.ac-pill.is-auto { color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.ac-model { position: relative; flex: 0 1 auto; min-width: 0; display: flex; }
.ac-model-btn { max-width: 100%; }
.ac-model-btn[aria-expanded="true"] { background: var(--sunken); color: var(--ink); }
.ac-model-name { min-width: 0; max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
.ac-model-price { flex: 0 0 auto; font-style: normal; font-weight: 500; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ac-model-price[hidden] { display: none; }
.ac-model-btn > .ic { flex: 0 0 auto; color: var(--ink-3); transition: transform .2s; }
.ac-model-btn[aria-expanded="true"] > .ic { transform: rotate(180deg); }
.ac-model-btn:disabled > .ic { display: none; }
/* список моделей: над кнопкой; на телефоне — шторка снизу (переносится в body) */
.ac-model-pop { position: absolute; left: -4px; bottom: calc(100% + 10px); z-index: 40; }
.ac-model-pop[hidden] { display: none; }
.ac-model-sheet { width: 360px; max-width: calc(100vw - 32px); display: flex; flex-direction: column; padding: 6px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); transform-origin: bottom left; animation: ac-pop .16s ease both; }
@keyframes ac-pop { from { opacity: 0; transform: translateY(6px) scale(.98); } }
.ac-model-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 8px 10px 6px; }
.ac-model-head b { font-size: 13px; font-weight: 600; color: var(--ink); }
.ac-model-head span { font-size: 11.5px; color: var(--ink-3); }
.ac-model-list { display: flex; flex-direction: column; gap: 2px; max-height: min(360px, 60vh); overflow-y: auto; scrollbar-width: thin; }
.ac-model-opt { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; border: 0; border-radius: 12px; background: transparent;
  color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: background .12s; }
.ac-model-opt:hover, .ac-model-opt:focus-visible { background: var(--surface-2); outline: none; }
.ac-model-opt.is-on { background: var(--accent-soft); }
.ac-model-opt-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ac-model-opt-text b { font-size: 14px; font-weight: 600; }
.ac-model-opt-text small { font-size: 11.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-model-tag { color: var(--accent); }
.ac-model-opt-price { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; font-size: 13px; font-weight: 600;
  color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ac-model-opt-price small { font-size: 10.5px; font-weight: 400; color: var(--ink-3); }
.ac-model-check { flex: 0 0 auto; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; color: transparent;
  box-shadow: inset 0 0 0 1.5px var(--line-strong); transition: background .15s; }
.ac-model-opt.is-on .ac-model-check { color: #fff; background: var(--accent); box-shadow: none; }
.ac-model-foot { margin: 4px 10px 6px; font-size: 11.5px; line-height: 1.45; color: var(--ink-3); }
.ac-model-pop.is-sheet { position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-end; background: rgba(15, 18, 34, .4);
  animation: ac-fade .2s ease both; }
.ac-model-pop.is-sheet[hidden] { display: none; }
.ac-model-pop.is-sheet .ac-model-sheet { width: 100%; max-width: none; border-radius: 22px 22px 0 0; border-width: 1px 0 0;
  padding: 8px 8px calc(12px + env(safe-area-inset-bottom)); animation: ac-sheet .26s cubic-bezier(.2, .8, .2, 1) both; }
.ac-model-pop.is-sheet .ac-model-sheet::before { content: ""; align-self: center; width: 40px; height: 4px; margin: 2px 0 6px; border-radius: 99px; background: var(--line-strong); }
.ac-model-pop.is-sheet .ac-model-list { max-height: 60vh; }
@keyframes ac-sheet { from { transform: translateY(100%); } }
@keyframes ac-fade { from { opacity: 0; } }
.ac-grow { flex: 1; }
.ac-send, .ac-stop { width: 36px; height: 36px; flex: 0 0 auto; display: grid; place-items: center; border: 0; border-radius: 50%; cursor: pointer;
  color: #fff; background: var(--ink); transition: opacity .15s, transform .15s; }
.ac-send .ic { transform: none; }
.ac-composer:not(.has-text) .ac-send { opacity: .3; }
.ac-send:disabled { opacity: .3; }
.ac-send:active, .ac-stop:active { transform: scale(.94); }
.ac-send[hidden], .ac-stop[hidden] { display: none; }
.ac-stop i { width: 11px; height: 11px; border-radius: 2px; background: #fff; }
.ac-hint { display: flex; justify-content: center; min-height: 18px; margin-top: 7px; font-size: 12px; color: var(--ink-3); text-align: center; }
.ac-status { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); }
.ac-status .ac-spin { width: 10px; height: 10px; color: var(--accent); }
.ac-status [data-live-clock] { font-variant-numeric: tabular-nums; }
.ac-status[hidden], .ac-hint [hidden] { display: none; }

/* что агент делает прямо сейчас */
.ac-live { display: flex; flex-direction: column; gap: 7px; min-width: 0; padding: 12px 14px; border-radius: 16px;
  border: 1px solid var(--accent-line); background: linear-gradient(180deg, var(--accent-soft), var(--surface)); animation: ac-in .25s ease both; }
.ac-live[hidden] { display: none; }
.ac-live-head { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.ac-live-head b { font-weight: 600; color: var(--ink); }
.ac-live-step { padding: 1px 8px; border-radius: 999px; font-size: 11.5px; color: var(--ink-3); background: var(--surface); border: 1px solid var(--line); }
.ac-live-time { margin-left: auto; font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ac-live-orb { position: relative; flex: 0 0 auto; width: 18px; height: 18px; display: grid; place-items: center; }
.ac-live-orb i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: ac-breath 1.6s ease-in-out infinite; }
.ac-live-orb::before { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid color-mix(in srgb, var(--accent) 50%, transparent);
  animation: ac-ring 1.6s ease-out infinite; }
.ac-live-orb.is-writing i { background: var(--ok); animation-duration: .8s; }
.ac-live-orb.is-writing::before { border-color: color-mix(in srgb, var(--ok) 50%, transparent); animation-duration: .9s; }
@keyframes ac-breath { 50% { transform: scale(.6); opacity: .6; } }
@keyframes ac-ring { from { transform: scale(.5); opacity: .9; } to { transform: scale(1.45); opacity: 0; } }
.ac-live-say { padding-top: 8px; border-top: 1px solid var(--line); font-size: 14.5px; }
.ac-live-say > :last-child::after { content: ""; display: inline-block; width: 7px; height: 1em; margin-left: 3px; vertical-align: -2px;
  border-radius: 1px; background: var(--accent); animation: ac-pulse 1s steps(2) infinite; }
.ac-live-think summary { cursor: pointer; font-size: 12.5px; color: var(--ink-3); }
.ac-live-think p { max-height: 180px; overflow: auto; margin: 6px 0 0; font-size: 12.5px; line-height: 1.55; font-style: italic;
  color: var(--ink-3); white-space: pre-wrap; }

/* подсказки под полем ввода — только в пустом чате */
.ac-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: 100%; max-width: var(--ac-w); margin: 8px auto 0; }
.ac-chips[hidden] { display: none; }
.ac-chips button { padding: 8px 14px; border-radius: 999px; cursor: pointer; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-2); font: inherit; font-size: 13px; transition: background .15s, color .15s, border-color .15s; }
.ac-chips button:hover { color: var(--ink); border-color: var(--line-strong); background: var(--surface-2); }

/* панель «Спросить агента» и окно мастерской: тот же чат, прокрутка внутри */
dialog.ac-sheet { background: var(--bg); padding: 0; }
dialog.ac-sheet[open] { display: flex; flex-direction: column; }
.ac.ac-compact { --ac-top: 0px; display: flex; flex-direction: column; flex: 1; min-height: 0; height: 100%; overflow-y: auto; overscroll-behavior: contain;
  gap: 0; padding: 0 16px; background: var(--bg); }
.ac-compact .ac-main { min-height: 100%; width: 100%; min-width: 0; }
.ac-compact .ac-bar { top: 0; padding: 10px 0; margin: 0 -4px; }
.ac-compact .ac-hello h1 { font-size: 24px; }
.ac-compact .ac-hello p { font-size: 13.5px; }
.ac-compact .ac-composer { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
.ac-compact .ac-pending { bottom: 128px; }
.ac-compact .ac-chips { margin-bottom: 16px; }
.wd-agent { flex: 1; min-height: 0; display: flex; }
.wd-agent > .ac.ac-compact { flex: 1; padding: 0 12px; }
.wd-agent .ac-bar [data-sheet-close] { display: none; }
.wd-empty-note { margin: 24px; color: var(--ink-3); font-size: 13.5px; }

/* телефон */
@media (max-width: 900px) {
  .view:has(> .ac) { padding: 0 16px; }
  .ac { --ac-top: calc(58px + env(safe-area-inset-top)); grid-template-columns: minmax(0, 1fr); gap: 0; min-height: calc(100dvh - 58px - 72px); }
  .ac-side { position: fixed; top: 0; bottom: 0; left: 0; z-index: 95; width: min(300px, 84vw); max-height: none;
    padding: calc(14px + env(safe-area-inset-top)) 10px 14px; background: var(--surface); transform: translateX(-102%); transition: transform .28s ease;
    box-shadow: 18px 0 50px -20px rgba(15, 18, 34, .35); }
  .ac-side.is-open { transform: none; }
  .ac .ac-side-close, .ac .ac-side-open { display: inline-grid; }
  .ac-scrim { position: fixed; inset: 0; z-index: 94; background: rgba(15, 18, 34, .36); }
  .ac-main { min-height: calc(100dvh - 58px - 72px - env(safe-area-inset-top)); }
  .ac-bar { margin: 0 -6px; }
  .ac-bubble { max-width: 88%; }
  .ac:not(.ac-compact) .ac-composer { bottom: calc(64px + env(safe-area-inset-bottom)); padding-bottom: 6px; }
  /* место под нижней навигацией: иначе в конце чата «прилипшее» поле ввода поднимается на последние сообщения */
  .ac:not(.ac-compact) .ac-main { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .ac-pill { padding: 0 9px; }
  .ac-pill [data-mode-label] { display: none; }
  .ac-model-name { max-width: 110px; }
  .ac-model-btn .ac-model-price { display: none; }
  .ac:not(.ac-compact) .ac-pending { bottom: calc(184px + env(safe-area-inset-bottom)); }
  .ac-hello h1 { font-size: 24px; }
  .ac-hello p { font-size: 14px; }
  .ac-chips { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; margin: 8px -16px 0; padding: 0 16px 4px; width: auto; }
  .ac-chips::-webkit-scrollbar { display: none; }
  .ac-chips button { flex: 0 0 auto; }
  .ac-confirm-rows { grid-template-columns: 1fr; gap: 2px; }
  .ac-confirm-rows dd { margin-bottom: 6px; }
  .ac-step-text { flex-direction: column; align-items: stretch; gap: 0; }
  .ac-step-name, .ac-step-sum { flex: 0 0 auto; }
  .ac-step-sum { font-size: 12.5px; }
  dialog.ac-sheet { height: 94dvh; }
}

/* Рабочий стол */
.quick-add { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.quick-add .btn { gap: 7px; }
.desk-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
.desk-grid { columns: 3 250px; column-gap: 12px; }
.desk-card { break-inside: avoid; margin-bottom: 12px; display: flex; flex-direction: column; gap: 8px; padding: 14px 15px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); cursor: pointer; text-align: left; width: 100%; font: inherit; color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; }
.desk-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.desk-card:active { transform: scale(.99); }
.desk-card .dc-top { display: flex; align-items: center; gap: 8px; font: 500 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.desk-card .dc-top .ic { color: var(--accent); }
.desk-card h4 { font-family: var(--sans); font-size: 15px; font-weight: 600; line-height: 1.3; }
.desk-card .dc-body { font-size: 13px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.desk-card pre.dc-body { font: 12px/1.5 var(--mono); background: var(--surface-2); border-radius: 8px; padding: 8px 10px; white-space: pre; -webkit-line-clamp: 8; }
.desk-card .dc-list { display: grid; gap: 3px; font-size: 13px; color: var(--ink-2); }
.desk-card .dc-list .on { text-decoration: line-through; color: var(--ink-3); }
.desk-card .dc-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11.5px; color: var(--ink-3); }
.desk-card.c-blue { background: #f0f3ff; border-color: #d9e0fb; }
.desk-card.c-teal { background: #ecf8f6; border-color: #cdeae5; }
.desk-card.c-amber { background: #fff8eb; border-color: #f3e2bf; }
.desk-card.c-rose { background: #fdf1f3; border-color: #f4d3da; }
.desk-card.c-violet { background: #f5f1fd; border-color: #e1d7f7; }
.swatches { display: flex; gap: 8px; }
.swatches button { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-strong); cursor: pointer; }
.swatches button.on { box-shadow: 0 0 0 2px var(--accent); }
.check-items { display: flex; flex-direction: column; gap: 2px; }
.check-item { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 10px; }
.check-item:hover { background: var(--surface-2); }
.check-item input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--ok); flex: none; margin: 0; }
.check-item input[type=text] { flex: 1; border: 0; background: none; font: inherit; font-size: 14px; padding: 4px 2px; outline: none; min-width: 0; }
.check-item.on input[type=text] { text-decoration: line-through; color: var(--ink-3); }
.check-item .x { opacity: 0; }
.check-item:hover .x, .check-item:focus-within .x { opacity: 1; }
.code-area { font: 13px/1.55 var(--mono); min-height: 280px; tab-size: 4; background: #0f1222; color: #e6e9f5; border-color: #0f1222; }
.code-area:focus { border-color: var(--accent); }
.save-state { font: 500 11px var(--mono); color: var(--ink-3); }
.drop-zone { border: 1.5px dashed var(--line-strong); border-radius: 14px; padding: 18px; text-align: center; color: var(--ink-3); font-size: 13px; transition: border-color .15s, background .15s; }
.drop-zone.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

/* Канбан */
.board { grid-template-columns: repeat(4, minmax(250px, 1fr)); scroll-snap-type: x mandatory; }
.col { scroll-snap-align: start; transition: background .15s, border-color .15s; }
.col.drop-on { background: var(--accent-soft); border-color: var(--accent-line); }
.task-card { display: flex; flex-direction: column; gap: 8px; width: 100%; padding: 11px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); text-align: left; font: inherit; color: inherit; cursor: pointer; touch-action: pan-y; user-select: none; -webkit-user-select: none; transition: border-color .15s, box-shadow .15s, transform .15s, opacity .15s; }
.task-card:hover { border-color: var(--line-strong); }
.task-card b { font-size: 13.5px; font-weight: 500; line-height: 1.35; }
.task-card .tc-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11.5px; color: var(--ink-3); }
.task-card .tc-meta .avatar { margin-left: auto; }
.task-card .tc-pill { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 6px; background: var(--sunken); font-family: var(--mono); font-size: 11px; }
.task-card .tc-pill.late { background: color-mix(in srgb, var(--danger) 10%, var(--surface)); color: var(--danger); }
.task-card.dragging { opacity: .35; }
.task-ghost { position: fixed; z-index: 600; pointer-events: none; transform: rotate(2deg) scale(1.03); box-shadow: var(--shadow-lg); border-color: var(--accent-line); }
.col-add { display: flex; gap: 6px; align-items: center; }
.col-add .input { flex: 1; min-width: 0; height: 36px; font-size: 13px; background: color-mix(in srgb, var(--surface) 70%, transparent); border-style: dashed; box-shadow: none; }
.col-add .btn { height: 36px; width: 36px; flex: none; border-radius: 10px; }
.view-toggle { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--sunken); }
.view-toggle button { height: 30px; width: 34px; border: 0; border-radius: 8px; background: none; display: grid; place-items: center; color: var(--ink-3); cursor: pointer; }
.view-toggle button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.comment { display: flex; gap: 10px; }
.comment .bubble { flex: 1; min-width: 0; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; font-size: 13.5px; white-space: pre-wrap; }
.comment .bubble small { display: block; font: 500 11px var(--mono); color: var(--ink-3); margin-bottom: 3px; }

/* Навыки: чипы с уровнем */
.skills-edit { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.skill-chip { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 6px 0 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line-strong); font-size: 13.5px; }
.skill-chip .lv-dots { display: inline-flex; gap: 3px; }
.skill-chip .lv-dots button { width: 9px; height: 9px; padding: 0; border-radius: 50%; border: 0; background: var(--line-strong); cursor: pointer; }
.skill-chip .lv-dots button.on { background: var(--accent); }
.skill-chip .x { width: 24px; height: 24px; border-radius: 50%; border: 0; background: none; color: var(--ink-3); cursor: pointer; display: grid; place-items: center; }
.skill-chip .x:hover { background: var(--sunken); color: var(--danger); }
.skills-edit .input { width: 180px; height: 36px; border-radius: 99px; }
.skill-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.skill-tag { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 11px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; }
.skill-tag i { display: inline-flex; gap: 2px; }
.skill-tag i b { width: 5px; height: 5px; border-radius: 50%; background: var(--line-strong); }
.skill-tag i b.on { background: var(--accent); }

/* Профиль */
.profile-top { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 22px; margin-bottom: 18px; }
.profile-top .who { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 6px; }
.profile-top h1 { font-size: clamp(22px, 2.4vw, 28px); }
.mini-stats { display: flex; gap: 22px; flex-wrap: wrap; }
.mini-stats div { display: flex; flex-direction: column; gap: 2px; min-width: 70px; }
.mini-stats b { font: 600 22px var(--display); font-variant-numeric: tabular-nums; line-height: 1.1; }
.mini-stats span { font-size: 12px; color: var(--ink-3); }

/* Пульс */
.health-bar { position: relative; height: 8px; border-radius: 99px; background: var(--sunken); overflow: visible; }
.health-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.health-bar em { position: absolute; top: -4px; width: 2px; height: 16px; border-radius: 2px; background: var(--ink); }
.health-bar.late i { background: var(--danger); }
.health-bar.risk i { background: var(--warn); }
.flow { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 5px; align-items: end; height: 120px; }
.flow > div { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; height: 100%; }
.flow i { display: block; width: 100%; max-width: 18px; border-radius: 4px 4px 2px 2px; min-height: 2px; }
.flow i.done { background: var(--ok); }
.flow i.new { background: var(--accent-line); }
.flow span { font: 500 9.5px var(--mono); color: var(--ink-3); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink-3); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.load-row { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(4, minmax(0, .7fr)); gap: 10px; align-items: center; padding: 11px 18px; border-top: 1px solid var(--line); font-size: 13.5px; }
.load-row:first-child { border-top: 0; }
.load-row.head { font: 500 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); background: var(--surface-2); border-radius: var(--r-lg) var(--r-lg) 0 0; }

/* Колокольчик */
.notice-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); }
.notice-row:first-child { border-top: 0; }
.notice-row.new { background: color-mix(in srgb, var(--accent-soft) 60%, var(--surface)); }
.notice-row .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13.5px; }
.notice-row .grow span { font: 500 11px var(--mono); color: var(--ink-3); }

@media (max-width: 1080px) {
    .today-grid, .desk-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
    dialog.sheet, dialog.sheet.wide, dialog.sheet.drawer { margin: auto 0 0; width: 100vw; max-width: 100vw; max-height: 94dvh; height: auto; border-radius: 22px 22px 0 0; }
    dialog.sheet.tall, dialog.sheet.drawer { height: 94dvh; }
    dialog.sheet[open], dialog.sheet.drawer[open] { animation: sheet-up .26s var(--ease); }
    dialog.sheet.closing, dialog.sheet.drawer.closing { animation: sheet-down .2s ease forwards; }
    .sheet-grip { display: block; width: 40px; height: 5px; border-radius: 9px; background: var(--line-strong); margin: 8px auto -4px; flex: none; }
    .sheet-head { padding: 12px 18px; }
    .sheet-body { padding: 16px 18px; }
    .fgrid, .fgrid.three { grid-template-columns: minmax(0, 1fr); }
    .fgrid.keep { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .side.tabs-explicit .side-link:not(.tab) { display: none !important; }
    .side .tab-more { display: flex !important; }
    .seg-tabs { width: 100%; }
    .board { grid-template-columns: repeat(4, 84%); margin-inline: -16px; padding-inline: 16px; scroll-padding-inline: 16px; }
    .more-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .load-row { grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(0, .7fr)); }
    .load-row .hide-md { display: none; }
    .desk-grid { columns: 2 150px; }
    .toasts { top: auto; bottom: calc(92px + env(safe-area-inset-bottom)); }
}
@media (max-width: 560px) {
    .desk-grid { columns: 1; }
    .profile-top { padding: 18px; gap: 14px; }
    .mini-stats { gap: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    dialog.sheet[open], dialog.sheet.closing, .toast { animation: none !important; transition: none !important; }
}

/* v6: доводка каркаса */
button.side-link { border: 0; background: none; font: inherit; cursor: pointer; width: 100%; text-align: left; }
.proj-head { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px 26px; align-items: start; margin-bottom: 18px; }
.proj-head h1 { text-wrap: balance; }
.only-sm-flex { display: none; }
button.person { width: 100%; }
button.person:disabled { opacity: 1; }
.searchbar .input { background: var(--surface); }
.task-row form { display: contents; }
input[type=range] { width: 100%; accent-color: var(--accent); }
@media (max-width: 1080px) { .proj-head { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) {
    .topbar-actions .avatar.only-sm { display: grid; }
    .topbar .ai-btn { display: none; }
    .topbar .back-btn { margin-left: -8px; }
    .only-sm-flex { display: inline-flex; }
    .hide-md { display: none !important; }
    .crumbs.hide-sm { display: none; }
    .page-head .actions .btn { flex: 1; }
}
.board { grid-template-columns: repeat(4, minmax(220px, 1fr)); }
@media (max-width: 900px) {
    .fgrid.profile-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fgrid.profile-row > :first-child { grid-column: 1 / -1; }
}
button.side-link { font: 500 14px var(--sans); }
@media (max-width: 900px) { button.side-link { font-size: 10.5px; font-weight: 600; } }
.task-row .meta { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-row .meta .prio { display: inline-block; margin-right: 6px; vertical-align: 1px; }

/* UNIT ID: вход с телефона и 2FA */
.login-option { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line-strong); background: var(--surface); text-align: left; font: inherit; color: inherit; cursor: pointer; box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s; }
.login-option:hover { border-color: var(--accent-line); box-shadow: var(--shadow); }
.login-option .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.login-option .grow b { font-size: 14.5px; }
.login-option .grow span { font-size: 12.5px; color: var(--ink-3); }
.link-pair { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: center; }
.link-qr { padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 16px; line-height: 0; box-shadow: var(--shadow-sm); }
.link-qr svg { width: 168px; height: 168px; }
.link-code { font-size: 26px; font-weight: 600; letter-spacing: .12em; }
.link-match { font: 700 46px/1 var(--display); color: var(--accent); letter-spacing: .02em; }
.steps-mini { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 8px; }
.steps-mini li { counter-increment: s; display: flex; gap: 10px; font-size: 13.5px; color: var(--ink-3); transition: color .2s; }
.steps-mini li::before { content: counter(s); flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font: 600 11px var(--mono); background: var(--sunken); color: var(--ink-3); }
.steps-mini li.on { color: var(--ink); font-weight: 500; }
.steps-mini li.on::before { background: var(--accent); color: #fff; }
.steps-mini li.passed::before { content: '✓'; background: var(--ok); color: #fff; }
.code-input { font-size: 20px; letter-spacing: .2em; text-align: center; }
.match-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.match-btn { height: 76px; border-radius: 18px; border: 1px solid var(--line-strong); background: var(--surface); font: 700 32px var(--display); color: var(--ink); cursor: pointer; box-shadow: var(--shadow-sm); transition: transform .12s, border-color .15s; }
.match-btn:hover { border-color: var(--accent); color: var(--accent); }
.match-btn:active { transform: scale(.96); }
.link-dev { width: 100%; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; }
.setup-step { display: flex; gap: 14px; align-items: flex-start; }
.step-n { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font: 600 13px var(--mono); background: var(--accent-soft); color: var(--accent); }
.recovery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.recovery-grid code { font-size: 15px; padding: 10px 12px; text-align: center; letter-spacing: .06em; }
a.swipe-promo { color: inherit; }
@media (max-width: 560px) {
    .link-pair { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
}
@media (max-width: 900px) { .shell { align-content: start; } }

/* ── Доступы: права, тройной переключатель, кольца лимитов ──────────────── */
.t-teal { --tone: var(--accent-2); }
.t-amber { --tone: var(--warn); }
.tag-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--tone, var(--blue)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tone, var(--blue)) 18%, transparent); }
.tone-blue { --tone: var(--blue); } .tone-violet { --tone: var(--violet); } .tone-crimson { --tone: var(--crimson); }
.tone-teal { --tone: var(--accent-2); } .tone-amber { --tone: var(--warn); }
.tone-pick { cursor: pointer; padding: 6px; border-radius: 10px; border: 1px solid transparent; }
.tone-pick input { position: absolute; opacity: 0; pointer-events: none; }
.tone-pick:has(input:checked) { border-color: var(--line-strong); background: var(--surface); }
.icon-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-pick label { cursor: pointer; }
.icon-pick input { position: absolute; opacity: 0; pointer-events: none; }
.icon-pick span { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: var(--ink-2); border: 1px solid var(--line-strong); background: var(--surface); transition: all .15s; }
.icon-pick input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.choice.on { border-color: var(--accent); background: var(--accent-soft); }
button.choice { width: 100%; font: inherit; color: inherit; background: var(--surface); text-align: left; }
.count-badge.bad { background: var(--danger); color: #fff; }
.tag-bad { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, var(--surface)); }
.tag-btn { border: 1px dashed var(--line-strong); background: var(--surface); cursor: pointer; gap: 4px; }
.tag-chip .tag { padding-right: 4px; gap: 4px; }
.tag-chip button { border: 0; background: none; color: inherit; opacity: .6; cursor: pointer; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; padding: 0; }
.tag-chip button:hover { opacity: 1; background: color-mix(in srgb, currentColor 12%, transparent); }
.access-row .person-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.perm-group { padding: 14px 22px 6px; border-top: 1px solid var(--line); }
.perm-group:first-of-type { border-top: 0; }
.perm-group > .label-mono { display: block; margin-bottom: 4px; }
.perm-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px dashed var(--line); }
.perm-group > .label-mono + .perm-row { border-top: 0; }
.perm-row .grow > b { display: block; font-size: 14px; font-weight: 500; }
.perm-row .grow > span { display: block; font-size: 12.5px; color: var(--ink-3); line-height: 1.4; }
.perm-state { width: 22px; height: 22px; flex: none; border-radius: 7px; display: grid; place-items: center; color: var(--ink-3); background: var(--sunken); }
.perm-state.on { color: #fff; background: var(--ok); }
.tri { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--sunken); flex: none; }
.tri label { cursor: pointer; }
.tri input { position: absolute; opacity: 0; pointer-events: none; }
.tri span { display: block; padding: 4px 9px; border-radius: 8px; font-size: 12px; font-weight: 500; color: var(--ink-3); transition: all .15s; }
.tri input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(15, 18, 34, .1); }
.tri label:nth-child(2) input:checked + span { color: var(--ok); }
.tri label:nth-child(3) input:checked + span { color: var(--danger); }
.tri input:focus-visible + span { outline: 2px solid var(--accent); }
.sticky-foot { position: sticky; bottom: 0; z-index: 2; }
@media (max-width: 900px) { .sticky-foot { bottom: calc(64px + env(safe-area-inset-bottom)); } }

/* Кольца — заполненные «бублики» расхода (как загрузка) */
.rings { display: flex; gap: 14px; flex-wrap: wrap; }
.ring { --p: 0; --c: var(--accent); position: relative; width: 112px; aspect-ratio: 1; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
    background: conic-gradient(from -90deg, var(--c) calc(var(--p) * 1%), var(--sunken) 0); }
.ring::before { content: ''; position: absolute; inset: 10px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 1px 3px rgba(15, 18, 34, .06); }
.ring > * { position: relative; }
.ring b { font: 600 18px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.ring span { font-size: 11px; color: var(--ink-3); line-height: 1.25; max-width: 76px; margin-top: 2px; }
.ring.warn { --c: var(--warn); } .ring.full { --c: var(--danger); }
.rings.sm .ring { width: 96px; } .rings.sm .ring b { font-size: 15px; }

/* Команды */
.team-card { position: relative; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.team-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-2px); }
.team-link { position: absolute; inset: 0; border-radius: inherit; z-index: 2; }
.team-card > *:not(.team-link):not(.team-menu) { position: relative; z-index: 1; pointer-events: none; }
.team-card .team-menu { position: relative; z-index: 3; pointer-events: auto; }
.team-card .team-menu * { pointer-events: auto; }
.team-card h3 { font-size: 17px; }
.team-about { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.team-foot { display: flex; align-items: center; gap: 10px; margin-top: auto; }

/* ── Мастер нового проекта: шаги на весь экран ──────────────────────────── */
dialog.sheet.wizard { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; border-radius: 0; padding: 0;
    background: radial-gradient(60% 50% at 90% 0%, rgba(12, 148, 136, .08), transparent 70%), radial-gradient(50% 50% at 0% 100%, rgba(48, 68, 208, .08), transparent 70%), var(--bg); }
dialog.sheet.wizard[open] { animation: wz-open .32s var(--ease); }
@keyframes wz-open { from { opacity: 0; transform: scale(.98); } }
.wizard-form { display: flex; flex-direction: column; height: 100%; width: 100%; }
.wizard-top { display: flex; align-items: center; gap: 16px; padding: max(14px, env(safe-area-inset-top)) 20px 14px; }
.wizard-progress { flex: 1; height: 4px; border-radius: 99px; background: var(--sunken); overflow: hidden; }
.wizard-progress i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .4s var(--ease); }
.wizard-dots { display: flex; gap: 6px; }
.wizard-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); cursor: pointer; transition: all .25s; }
.wizard-dots i.done { background: var(--accent-2); }
.wizard-dots i.on { width: 20px; border-radius: 99px; background: var(--accent); }
.wizard-stage { flex: 1; overflow-y: auto; display: grid; place-items: start center; padding: 6vh 20px 30px; }
.wz-page { width: min(560px, 100%); display: flex; flex-direction: column; gap: 14px; }
.wz-page h2 { font-size: clamp(26px, 4vw, 36px); line-height: 1.1; letter-spacing: -.02em; }
.wz-page > .muted { margin-top: -6px; font-size: 15.5px; }
.wz-big { height: 56px; font-size: 20px; font-weight: 600; border-radius: 14px; }
.wz-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.wz-card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 16px; border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; transition: all .15s; }
.wz-card input { position: absolute; opacity: 0; pointer-events: none; }
.wz-card b { font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.wz-card:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(48, 68, 208, .14); }
.wz-seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 13px; background: var(--sunken); }
.wz-seg label { cursor: pointer; }
.wz-seg input { position: absolute; opacity: 0; pointer-events: none; }
.wz-seg span { display: block; padding: 8px 16px; border-radius: 10px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.wz-seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(15, 18, 34, .1); }
.wz-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.wz-person { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 13px; border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; font-size: 14px; }
.wz-person input { position: absolute; opacity: 0; pointer-events: none; }
.wz-person > .ic { color: transparent; }
.wz-person:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.wz-person:has(input:checked) > .ic { color: var(--accent); }
.wz-suggest { display: flex; flex-wrap: wrap; gap: 6px; }
.wz-suggest .used { opacity: .45; }
.wz-final { align-items: center; text-align: center; padding-top: 4vh; }
.wz-done-mark { width: 76px; height: 76px; border-radius: 24px; display: grid; place-items: center; color: #fff; background: linear-gradient(140deg, var(--accent), var(--accent-2)); box-shadow: 0 18px 40px -16px rgba(48, 68, 208, .6); animation: wz-pop .5s var(--ease); }
@keyframes wz-pop { from { transform: scale(.6) rotate(-8deg); opacity: 0; } }
.wizard-foot { display: flex; align-items: center; gap: 8px; padding: 14px 20px max(14px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: blur(10px); }
.wizard-foot .btn { height: 46px; }
.pg-in-right { animation: pg-in-right .32s var(--ease); }
.pg-in-left { animation: pg-in-left .32s var(--ease); }
@keyframes pg-in-right { from { opacity: 0; transform: translateX(36px); } }
@keyframes pg-in-left { from { opacity: 0; transform: translateX(-36px); } }
@media (max-width: 560px) { .wizard-dots { display: none; } .wz-cards { grid-template-columns: 1fr 1fr; } .wizard-foot .btn-quiet { padding: 0 10px; } }

/* Настройки проекта по страницам */
.pages-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 13px; background: var(--sunken); overflow-x: auto; scrollbar-width: none; margin-bottom: 16px; }
.pages-tabs::-webkit-scrollbar { display: none; }
.pages-tabs .tab-btn { flex: none; }
.danger-zone { border: 1px solid #f2d2d2; background: #fdf7f7; border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }

/* Меню «⋯» на карточке */
.card-menu { position: absolute; top: 12px; right: 12px; z-index: 3; }
.card-menu > button { width: 32px; height: 32px; border-radius: 9px; border: 1px solid transparent; background: transparent; color: var(--ink-3); display: grid; place-items: center; cursor: pointer; }
.card-menu > button:hover, .card-menu[open] > button { background: var(--sunken); color: var(--ink); }
.card-menu .menu { display: none; position: absolute; right: 0; top: 36px; min-width: 200px; padding: 6px; border-radius: 13px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.card-menu[open] .menu { display: block; animation: menu-in .14s ease; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: none; border-radius: 9px; font: 500 14px var(--sans); color: var(--ink); cursor: pointer; text-align: left; }
.menu a:hover, .menu button:hover { background: var(--sunken); }
.menu .danger { color: var(--danger); }
.menu hr { margin: 4px 0; }
.proj { position: relative; }
.proj .top { padding-right: 36px; }

.proj-link { position: absolute; inset: 0; border-radius: inherit; z-index: 1; }
.proj > *:not(.proj-link):not(.card-menu) { position: relative; z-index: 0; pointer-events: none; }
.proj .card-menu { z-index: 4; }

.row-del { color: var(--ink-3); opacity: .6; }
.task-row:hover .row-del, .row-del:focus-visible { opacity: 1; }
.row-del:hover { color: var(--danger); }
@media (hover: none) { .row-del { opacity: .8; } }

/* ── Телефон: проект компактнее ─────────────────────────────────────────── */
.part-tap { cursor: pointer; }
@media (hover: hover) { .part-tap:hover { background: var(--surface-2); } }
@media (max-width: 900px) {
    .part { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 14px 16px; }
    .part .part-edit, .part .phases, .part .stack-sm > .row > .label-mono { display: none; }
    .part .stack-sm > .row { justify-content: flex-end; margin-top: -32px; pointer-events: none; }
    .part-tap:active { background: var(--surface-2); }
    [data-tabs].seg-tabs, .seg-tabs[data-tabs] { position: sticky; top: calc(58px + env(safe-area-inset-top)); z-index: 20; width: 100%;
        background: color-mix(in srgb, var(--sunken) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
    .proj-head h1 { font-size: 26px; }
    .proj-progress { padding: 14px 16px !important; }
}

/* ── Навигация: Поддержка ─────────────────────────────────────────────────── */
.side-subnav { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }
.side-sublink { display: flex; align-items: center; gap: 9px; padding: 6px 10px; border-radius: var(--radius-sm); color: var(--ink-2); font-size: 13px; text-decoration: none; transition: background .12s, color .12s; }
.side-sublink:hover { background: var(--surface-2); color: var(--ink); }
.side-sublink.on { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.row-link { transition: transform .12s, border-color .12s, box-shadow .12s; }
.row-link:hover { border-color: var(--line-strong); transform: translateY(-1px); box-shadow: var(--shadow-sm); }

/* ═══ Мастерская: рабочий стол со свободными окнами ═══════════════════════════
   Открывается внутри портала (с боковым меню); «Во весь экран» — поверх всего. */
.view:has(> .wd) { max-width: none; padding: 14px 18px 18px; }
body:has(.wd.is-full) { overflow: hidden; }
.wd {
  position: relative; height: calc(100dvh - 62px - 32px); min-height: 480px;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr);
  border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  background: var(--bg); color: var(--ink);
  --glass-line: var(--line);
  --glass-line-strong: var(--line-strong);
  --cyan: var(--accent-2);
  --lime: var(--ok);
  --amber: var(--warn);
}
.wd.is-full { position: fixed; inset: 0; z-index: 100; height: auto; min-height: 0; border: 0; border-radius: 0; }
.wd-bar {
  display: flex; align-items: center; gap: 10px; padding: 8px 14px;
  border-bottom: 1px solid var(--line); background: var(--surface);
  min-width: 0; z-index: 10;
}
.wd-icon-btn {
  flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 10px; color: var(--ink-2); text-decoration: none; border: 1px solid var(--line);
}
.wd-icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.wd-head { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wd-logo-ic { display: flex; align-items: center; color: var(--accent); }
.wd-title {
  width: 100%; min-width: 0; border: 0; outline: none; background: transparent;
  color: var(--ink); font: inherit; font-size: 15px; font-weight: 700;
  padding: 2px 6px; margin-left: -6px; border-radius: 7px;
}
.wd-title:hover, .wd-title:focus { background: var(--surface-2); }
.wd-meta { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; }
.wd-project-sel { height: 24px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); font: inherit; font-size: 11.5px; color: var(--ink); outline: none; }
.wd-tag { color: var(--ink-3); font-size: 12px; }
.wd-save { flex: 0 0 auto; font-size: 12px; color: var(--ink-3); transition: color .15s; }
.wd-save.is-busy { color: var(--accent); }
.wd-save.is-err { color: var(--danger); }
.wd-btn {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  font: inherit; font-size: 12.5px; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.wd-btn:hover { color: var(--ink); background: var(--surface-2); border-color: var(--line-strong); }
.wd-btn.is-accent { border-color: transparent; color: #fff; background: var(--accent); }
.wd-btn.is-accent:hover { filter: brightness(1.08); }

/* Холст стола */
.wd-desk {
  position: relative; overflow: hidden; min-height: 0;
  background: radial-gradient(circle at 1px 1px, rgba(15, 18, 34, .08) 1px, transparent 0) 0 0 / 24px 24px, var(--bg);
  touch-action: none;
}
.wd-hint {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 8px;
  text-align: center; color: var(--ink-3); font-size: 14px; pointer-events: none;
}
.wd-hint b { color: var(--ink); font-size: 16px; }
.wd-hint span { max-width: 340px; font-size: 13px; line-height: 1.5; }
.wd-hint[hidden] { display: none; }
.wd-snap {
  position: absolute; z-index: 5; border-radius: 14px;
  border: 2px dashed var(--accent); background: var(--accent-soft);
  pointer-events: none; transition: all .12s;
}
.wd-snap[hidden] { display: none; }

/* Окна */
.wd-win {
  position: absolute; display: flex; flex-direction: column; min-width: 280px; min-height: 190px;
  border-radius: 14px; overflow: hidden; background: var(--surface); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg); transition: border-color .12s;
}
.wd-win[hidden] { display: none; }
.wd-win.is-focus { border-color: var(--accent); box-shadow: 0 20px 60px -20px rgba(15, 18, 34, .35), 0 0 0 1px var(--accent); }
.wd-win.is-max { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; border-radius: 0; border: 0; }
.wd-win.is-drag { user-select: none; }
.wd-win.is-drag iframe, .wd.is-dragging iframe { pointer-events: none; }
.wd-win-bar {
  flex: 0 0 auto; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 8px 0 12px;
  cursor: grab; user-select: none; touch-action: none; background: var(--surface-2); border-bottom: 1px solid var(--line);
}
.wd-win.is-focus .wd-win-bar { background: color-mix(in srgb, var(--accent-soft) 40%, var(--surface-2)); }
.wd-win-ic { display: grid; color: var(--ink-3); }
.wd-win.is-focus .wd-win-ic { color: var(--accent); }
.wd-win-title { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; }
.wd-win-extra { flex: 1; min-width: 0; display: flex; justify-content: flex-end; align-items: center; gap: 4px; }
.wd-win-btn {
  flex: 0 0 auto; width: 26px; height: 26px; display: grid; place-items: center; border: 0; border-radius: 7px;
  background: transparent; color: var(--ink-3); cursor: pointer; padding: 0; font: inherit; transition: background .12s, color .12s;
}
.wd-win-btn:hover { background: var(--sunken); color: var(--ink); }
.wd-win-btn.is-close:hover { background: var(--danger); color: #fff; }
.wd-g-min { display: block; width: 10px; height: 1.6px; border-radius: 1px; background: currentColor; }
.wd-g-max { display: block; width: 9px; height: 9px; border: 1.6px solid currentColor; border-radius: 2px; }
.wd-win-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; position: relative; background: var(--surface); }
.wd-rs { position: absolute; z-index: 6; touch-action: none; }
.wd-rs[data-rs="r"] { top: 8px; bottom: 8px; right: -3px; width: 8px; cursor: ew-resize; }
.wd-rs[data-rs="l"] { top: 8px; bottom: 8px; left: -3px; width: 8px; cursor: ew-resize; }
.wd-rs[data-rs="b"] { left: 8px; right: 8px; bottom: -3px; height: 8px; cursor: ns-resize; }
.wd-rs[data-rs="rb"] { right: -3px; bottom: -3px; width: 16px; height: 16px; cursor: nwse-resize; }
.wd-rs[data-rs="lb"] { left: -3px; bottom: -3px; width: 16px; height: 16px; cursor: nesw-resize; }
.wd-win.is-max .wd-rs { display: none; }

/* Док-панель */
.wd-dock { display: flex; justify-content: center; padding: 6px 10px calc(8px + env(safe-area-inset-bottom)); background: transparent; pointer-events: none; z-index: 40; }
.wd-dock-row {
  pointer-events: auto; display: flex; align-items: center; gap: 4px; max-width: 100%; overflow-x: auto; scrollbar-width: none;
  padding: 5px; border-radius: 18px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg);
}
.wd-dock-row::-webkit-scrollbar { display: none; }
.wd-dock-group { flex: 0 0 auto; display: flex; align-items: center; gap: 2px; padding: 2px; border-radius: 13px; background: rgba(0,0,0,.03); }
.wd-dock-sep { width: 1px; height: 22px; background: var(--line); margin: 0 3px; flex: 0 0 auto; }
.wd-dock-btn {
  position: relative; flex: 0 0 auto; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 0;
  border-radius: 12px; background: transparent; color: var(--ink-2); font: inherit; cursor: pointer; touch-action: none; user-select: none;
  transition: background .15s, color .15s, transform .15s;
}
.wd-dock-btn > span { display: none; }
.wd-dock-btn:hover { background: var(--surface-2); color: var(--ink); transform: translateY(-2px); }
.wd-dock-btn:active { transform: scale(.95); }
.wd-dock-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.wd-dock-mark { position: absolute; left: 50%; bottom: 3px; width: 0; height: 3px; border-radius: 3px; transform: translateX(-50%); background: var(--ink-3); transition: width .18s, background .18s; }
.wd-dock-btn.is-open .wd-dock-mark { width: 6px; }
.wd-dock-btn.is-focus { color: var(--accent); background: var(--accent-soft); }
.wd-dock-btn.is-focus .wd-dock-mark { width: 16px; background: var(--accent); }
.wd-dock-btn em {
  position: absolute; top: 3px; right: 3px; min-width: 15px; height: 15px; padding: 0 3px; display: grid; place-items: center;
  border-radius: 8px; font-style: normal; font-size: 9.5px; font-weight: 700; color: #fff; background: var(--accent);
}
.wd-dock-btn.is-all { color: var(--ink-3); }
.wd-dock-btn.is-all:hover, .wd-dock-btn.is-all.is-focus { color: var(--ink); }

/* Каталог */
.wd-launch { position: fixed; inset: 0; z-index: 120; display: flex; align-items: flex-end; justify-content: center; padding: 16px 16px 86px; background: rgba(15, 18, 34, .45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.wd-launch[hidden] { display: none; }
.wd-launch.is-dragging { background: transparent; pointer-events: none; }
.wd-launch.is-dragging .wd-launch-card { opacity: .25; }
.wd-launch-card {
  width: min(880px, 100%); max-height: min(74vh, 700px); display: flex; flex-direction: column; border-radius: 20px;
  overflow: hidden; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: 0 30px 80px -20px rgba(0,0,0,.35);
}
.wd-launch-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.wd-launch-head b { font-size: 16px; color: var(--ink); }
.wd-launch-head span { flex: 1; min-width: 0; font-size: 12.5px; color: var(--ink-3); }
.wd-launch-body { overflow-y: auto; padding: 8px 18px 20px; }
.wd-launch-group h4 { margin: 16px 0 8px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.wd-launch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.wd-launch-item {
  position: relative; display: flex; align-items: flex-start; gap: 11px; padding: 10px 36px 10px 10px; border-radius: 12px; text-align: left; font: inherit; color: inherit;
  cursor: grab; outline: none; border: 1px solid var(--line); background: var(--surface-2); transition: background .12s, border-color .12s, transform .12s;
  touch-action: none; user-select: none;
}
.wd-launch-item:hover, .wd-launch-item:focus-visible { background: var(--surface); border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.wd-launch-ic { flex: 0 0 auto; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: var(--accent); background: var(--accent-soft); }
.wd-launch-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wd-launch-text b { font-size: 13.5px; color: var(--ink); }
.wd-launch-text small { font-size: 11.5px; line-height: 1.4; color: var(--ink-3); }
.wd-pin {
  position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; display: grid; place-items: center;
  border: 0; border-radius: 7px; background: transparent; color: var(--ink-3); cursor: pointer; opacity: .5;
}
.wd-pin:hover { opacity: 1; background: var(--sunken); }
.wd-pin.is-on { color: var(--amber); opacity: 1; }

/* Тултипы и призрак перетаскивания */
.wd-tip {
  position: fixed; z-index: 400; transform: translate(-50%, -100%); padding: 5px 10px; border-radius: 8px; white-space: nowrap;
  pointer-events: none; font-size: 12px; font-weight: 600; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow); animation: wd-tip .12s ease both;
}
.wd-tip[hidden] { display: none; }
@keyframes wd-tip { from { opacity: 0; transform: translate(-50%, calc(-100% + 4px)); } }
.wd-ghost {
  position: fixed; left: 0; top: 0; z-index: 200; display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  border-radius: 12px; pointer-events: none; font-size: 13px; font-weight: 600; background: var(--surface); color: var(--ink);
  border: 1px solid var(--accent); box-shadow: var(--shadow-lg);
}

/* Инструменты внутри окон мастерской (static/desk.js) */
.wt-btn:hover { background: var(--sunken); }
.wd-sep { width: 1px; height: 18px; background: var(--line); flex: 0 0 auto; }
.wd-desk.is-dragover { outline: 2px dashed var(--accent); outline-offset: -8px; background-color: var(--accent-soft); }
.wt-code-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.wt-code-editor { flex: 1; min-height: 0; width: 100%; border: 0; outline: none; background: var(--bg); color: var(--ink); font-family: var(--mono); font-size: 13px; line-height: 1.55; padding: 12px 14px; resize: none; tab-size: 4; }
.wt-code-out { border-top: 1px solid var(--line); background: var(--surface-2); max-height: 160px; overflow-y: auto; padding: 8px 12px; font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.wt-note-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.wt-note-editor { flex: 1; min-height: 0; width: 100%; border: 0; outline: none; background: transparent; color: var(--ink); font: inherit; font-size: 14.5px; line-height: 1.6; padding: 14px 16px; resize: none; }
.wt-note-preview { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 18px; line-height: 1.6; }
.wt-tbl-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.wt-tbl-scroll { flex: 1; min-height: 0; overflow: auto; }
.wt-tbl { border-collapse: collapse; width: max-content; font-size: 13px; }
.wt-tbl th, .wt-tbl td { border: 1px solid var(--line); padding: 0; min-width: 80px; height: 28px; }
.wt-tbl th { background: var(--surface-2); color: var(--ink-3); font-weight: 600; text-align: center; user-select: none; }
.wt-tbl td input { width: 100%; height: 100%; border: 0; outline: none; background: transparent; color: var(--ink); font: inherit; padding: 0 8px; }
.wt-tbl td input:focus { background: var(--accent-soft); }
.wt-draw-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.wt-draw-canvas-box { flex: 1; min-height: 0; position: relative; overflow: hidden; background: #ffffff; cursor: crosshair; touch-action: none; }
.wt-draw-canvas { width: 100%; height: 100%; display: block; }
.wt-swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.wt-swatch.is-on { border-color: var(--ink); transform: scale(1.15); }
.wt-check-list { display: flex; flex-direction: column; gap: 4px; }
.wt-check-row { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px; background: var(--surface-2); }
.wt-check-row.is-done span { text-decoration: line-through; color: var(--ink-3); }
.wt-tm-box { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; gap: 14px; }
.wt-tm-ring { position: relative; width: 130px; height: 130px; }
.wt-tm-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.wt-tm-track { fill: none; stroke: var(--sunken); stroke-width: 8; }
.wt-tm-progress { fill: none; stroke: var(--accent); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset .3s; }
.wt-tm-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.wt-tm-time { font-size: 26px; font-weight: 700; font-family: var(--mono); color: var(--ink); }
.wt-tm-phase { font-size: 12px; color: var(--ink-3); }

/* Телефон: окна — одно за другим во весь стол, двигать нечем */
@media (max-width: 900px) {
  .view:has(> .wd) { padding: 10px 10px 0; }
  /* --wd-h считает desk.js по настоящим верхней панели и нижней навигации (на Android они выше расчётных) */
  .wd { height: var(--wd-h, calc(100dvh - 58px - env(safe-area-inset-top) - 88px - env(safe-area-inset-bottom))); min-height: 320px; }
  .wd-bar { flex-wrap: wrap; gap: 6px; padding: 8px 10px; }
  .wd-head { flex-basis: 100%; }
  .wd-tag { display: none; }
  .wd-win { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; border-radius: 0; border: 0; min-width: 0; }
  .wd-rs { display: none; }
  .wd-dock-btn { width: 40px; height: 40px; }
}

/* Детали инструментов */
.wt-bar { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; min-height: 38px; padding: 6px 10px; border-bottom: 1px solid var(--line); background: var(--surface-2); flex-wrap: wrap; }
.wt-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 8px;
  white-space: nowrap; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font: inherit; font-size: 12px;
  text-decoration: none; cursor: pointer; transition: background .12s, color .12s;
}
.wt-btn:hover { color: var(--ink); background: var(--sunken); }
.wt-btn.is-primary { border-color: transparent; color: #fff; background: var(--accent); font-weight: 600; }
.wt-btn.is-on { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.wt-btn.is-icon { width: 28px; padding: 0; }
.wt-btn:disabled { opacity: .45; cursor: default; }
.wt-input { height: 28px; padding: 0 8px; border-radius: 7px; border: 1px solid var(--line); outline: none; background: var(--surface); color: var(--ink); font: inherit; font-size: 12.5px; }
.wt-input:focus { border-color: var(--accent); }
.wt-grow { flex: 1; min-width: 0; }
.wt-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 10px; }
.wt-spin { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: wt-spin .7s linear infinite; }
@keyframes wt-spin { to { transform: rotate(360deg); } }

/* Инструменты: Редактор кода Monaco */
.we-box { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.we-monaco { flex: 1; min-height: 0; width: 100%; }
.we-fallback { flex: 1; min-height: 0; width: 100%; border: 0; outline: none; padding: 12px; font-family: var(--mono); font-size: 13px; line-height: 1.5; resize: none; background: #0a0d17; color: #e2e8f0; tab-size: 4; }

/* Инструменты: Песочница Preview */
.wpv-box { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.wpv-stage { flex: 1; min-height: 0; position: relative; background: #fff; }
.wpv-frame { width: 100%; height: 100%; border: 0; display: block; }
.wpv-stage.is-phone { max-width: 375px; margin: 0 auto; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }

/* Инструменты: Консоль Run */
.wrun-box { flex: 1; min-height: 0; display: flex; flex-direction: column; background: #0b0e1b; color: #e2e8f0; }
.wrun-out { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 14px; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; }
.wrun-line { margin-bottom: 4px; white-space: pre-wrap; word-break: break-word; }
.wrun-line.is-err { color: #f87171; }
.wrun-line.is-info { color: #38bdf8; }
.wrun-in-bar { display: flex; align-items: center; border-top: 1px solid rgba(255,255,255,.1); padding: 4px 8px; background: rgba(0,0,0,.3); }
.wrun-in-bar input { flex: 1; background: transparent; border: 0; outline: none; color: #fff; font-family: var(--mono); font-size: 13px; }

/* Инструменты: Калькулятор */
.wcl-box { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.wcl-hist { flex: 1; min-height: 0; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.wcl-item { padding: 6px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); font-family: var(--mono); font-size: 12.5px; }
.wcl-item b { color: var(--accent); display: block; font-size: 14px; margin-top: 2px; }
.wcl-keypad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 8px; border-top: 1px solid var(--line); background: var(--surface-2); }
.wcl-btn { height: 32px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font: 600 13px var(--mono); }
.wcl-btn:hover { background: var(--sunken); }

/* Инструменты: Графики Plot */
.wplt-box { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.wplt-canvas-box { flex: 1; min-height: 0; position: relative; background: var(--surface); cursor: crosshair; }
.wplt-canvas { width: 100%; height: 100%; display: block; }

/* Инструменты: Конвертер Units */
.wun-box { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 14px; gap: 12px; }
.wun-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; }

/* Инструменты: Таблица Менделеева */
.wper-box { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.wper-grid { flex: 1; min-height: 0; overflow: auto; display: grid; grid-template-columns: repeat(18, minmax(36px, 1fr)); gap: 2px; padding: 8px; }
.wper-el { aspect-ratio: 1; border-radius: 4px; border: 1px solid var(--line); background: var(--surface-2); display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; font-size: 10px; padding: 2px; }
.wper-el:hover { border-color: var(--accent); background: var(--accent-soft); }
.wper-el b { font-size: 12px; }

/* Инструменты: Таблицы Spreadsheet */
.wtbl-box { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.wtbl-scroll { flex: 1; min-height: 0; overflow: auto; }
.wtbl { border-collapse: collapse; width: max-content; font-size: 12.5px; }
.wtbl th, .wtbl td { border: 1px solid var(--line); min-width: 80px; height: 26px; padding: 0; }
.wtbl th { background: var(--surface-2); color: var(--ink-3); font-weight: 600; text-align: center; }
.wtbl td input { width: 100%; height: 100%; border: 0; outline: none; background: transparent; color: var(--ink); padding: 0 6px; font: inherit; }
.wtbl td input:focus { background: var(--accent-soft); }

/* Инструменты: Доска / Рисование */
.wdr-box { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.wdr-canvas-box { flex: 1; min-height: 0; position: relative; background: #ffffff; cursor: crosshair; }
.wdr-canvas { width: 100%; height: 100%; display: block; }
.wdr-swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.wdr-swatch.is-on { border-color: var(--ink); transform: scale(1.15); }

/* Инструменты: Чек-листы */
.wchk-box { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 12px; gap: 8px; }
.wchk-item { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px; background: var(--surface-2); }
.wchk-item.is-done span { text-decoration: line-through; color: var(--ink-3); }

/* Инструменты: Заметки Markdown */
.wnt-box { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.wnt-editor { flex: 1; min-height: 0; width: 100%; border: 0; outline: none; padding: 14px 16px; font: inherit; font-size: 14px; line-height: 1.6; resize: none; background: transparent; color: var(--ink); }
.wnt-preview { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 18px; line-height: 1.6; }

/* Инструменты: Таймер */
.wtm-box { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; gap: 14px; }
.wtm-ring { position: relative; width: 130px; height: 130px; }
.wtm-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.wtm-track { fill: none; stroke: var(--sunken); stroke-width: 8; }
.wtm-prog { fill: none; stroke: var(--accent); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset .3s; }
.wtm-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.wtm-time { font-size: 26px; font-weight: 700; font-family: var(--mono); color: var(--ink); }

/* Инструменты: Файлы */
.wfl-box { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.wfl-tree { flex: 1; min-height: 0; overflow-y: auto; padding: 6px; }
.wfl-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.wfl-item:hover { background: var(--surface-2); }

/* Инструменты: GitHub */
.wgh-box { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.wgh-readme { flex: 1; min-height: 0; overflow-y: auto; padding: 14px; font-size: 13px; line-height: 1.6; }

/* Инструменты: JSON, Пароли, Текст, Энкодер */
.wtool-box { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 12px; gap: 10px; }




/* ── Блокировка приложения и сессии (PIN-код) ───────────────────────── */
html.app-locked body {
  overflow: hidden !important;
}
html.app-locked .shell,
html.app-locked .view,
html.app-locked .side,
html.app-locked .appbar,
html.app-locked .main {
  filter: blur(18px) !important;
  pointer-events: none !important;
  user-select: none !important;
  transition: filter .3s ease;
}

.unit-lock-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(12, 14, 22, 0.88);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  padding: 20px;
  opacity: 1;
  transition: opacity .25s ease, visibility .25s ease;
}
.unit-lock-overlay[hidden] {
  display: none !important;
}

.unit-lock-box {
  max-width: 380px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: #f3f4f8;
  margin: auto;
  animation: unit-lock-pop .3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes unit-lock-pop {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.unit-lock-brand {
  margin-bottom: 18px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}
.unit-lock-brand .logo,
.unit-lock-brand .unit-lock-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
}

.unit-lock-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.unit-lock-sub {
  font-size: 13.5px;
  color: #9aa1b8;
  margin: 0 0 22px;
  line-height: 1.45;
  min-height: 20px;
  transition: color .2s;
}
.unit-lock-sub.error-msg {
  color: #f87171 !important;
  font-weight: 500;
}
.unit-lock-sub.success-msg {
  color: #34d399 !important;
  font-weight: 500;
}

.unit-pin-dots {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-bottom: 26px;
  transition: transform .2s ease;
}

.unit-pin-dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  background: transparent;
  transition: all .2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.unit-pin-dot.filled {
  background: var(--accent, #5b6bf0);
  border-color: var(--accent, #5b6bf0);
  transform: scale(1.15);
  box-shadow: 0 0 16px rgba(91, 107, 240, 0.65);
}
.unit-pin-dots.error .unit-pin-dot {
  background: #ef4444 !important;
  border-color: #ef4444 !important;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.65) !important;
}
.unit-pin-dots.success .unit-pin-dot {
  background: #10b981 !important;
  border-color: #10b981 !important;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.65) !important;
}
.unit-pin-dots.shake {
  animation: unit-pin-shake .4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}
@keyframes unit-pin-shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-12px); }
  40%, 80% { transform: translateX(12px); }
}

.unit-setup-steps {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  justify-content: center;
}
.unit-step-pill {
  font-size: 11.5px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  color: #9aa1b8;
  transition: all .2s;
  border: 1px solid transparent;
}
.unit-step-pill.on {
  background: rgba(91, 107, 240, 0.22);
  color: #c7d2fe;
  border-color: rgba(91, 107, 240, 0.45);
  font-weight: 600;
}

.unit-dial-pad {
  display: grid;
  grid-template-columns: repeat(3, 72px);
  gap: 14px;
  justify-content: center;
  margin-bottom: 20px;
}
.unit-dial-key {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font-size: 24px;
  font-weight: 600;
  font-family: var(--mono, 'JetBrains Mono', monospace);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s, transform .12s, border-color .15s;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.unit-dial-key:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.25);
}
.unit-dial-key:active {
  background: rgba(91, 107, 240, 0.35);
  border-color: rgba(91, 107, 240, 0.6);
  transform: scale(0.92);
}
.unit-dial-key.unit-dial-back {
  font-size: 18px;
  color: #c7d2fe;
}
.unit-dial-dummy {
  width: 72px;
  height: 72px;
}

.unit-lock-foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}
.unit-lock-forgot {
  font-size: 13px;
  color: #9aa1b8;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 6px 10px;
  transition: color .15s;
}
.unit-lock-forgot:hover {
  color: #ffffff;
}
.unit-lock-hint {
  font-size: 12px;
  color: #717b9b;
  max-width: 280px;
  line-height: 1.4;
}

@media (min-width: 821px) {
  [data-lock-app], [data-change-pin], #unit-app-lock, #unit-pin-setup {
    display: none !important;
  }
}

.ac-msg.is-queued .ac-bubble { opacity: .7; }

/* Настройки ИИ: кольца лимитов и выбор вариантов плитками */
.ai-limits { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.seg-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.seg-pick label { position: relative; cursor: pointer; }
.seg-pick input { position: absolute; opacity: 0; pointer-events: none; }
.seg-pick span { display: flex; flex-direction: column; gap: 1px; min-width: 96px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); font-size: 13.5px; font-weight: 600; color: var(--ink-2); transition: border-color .15s, background .15s, color .15s; }
.seg-pick span small { font-size: 11.5px; font-weight: 400; color: var(--ink-3); }
.seg-pick label:hover span { border-color: var(--line-strong); }
.seg-pick input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.seg-pick input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.model-pick { display: flex; flex-direction: column; gap: 2px; max-height: 340px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.model-pick label { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; cursor: pointer; font-size: 13.5px; }
.model-pick label:hover { background: var(--surface-2); }
.model-pick label b { font-weight: 600; }
.model-pick label small { color: var(--ink-3); font-family: var(--mono); font-size: 11.5px; }
.model-pick .price { margin-left: auto; font: 600 12.5px var(--mono); color: var(--ink-2); white-space: nowrap; }
.model-pick .cheap { color: var(--ok); }

/* Кнопки кода приложения — только когда портал открыт как приложение и код задан */
body:not([data-lock="on"]) [data-lock-app], body:not([data-lock="on"]) [data-change-pin] { display: none !important; }

/* Настройки человека */
.set-nav { display: flex; gap: 6px; flex-wrap: wrap; margin: -8px 0 18px; }
.set-nav a { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 99px; border: 1px solid var(--line);
  background: var(--surface); font-size: 13px; font-weight: 600; color: var(--ink-2); }
.set-nav a:hover { color: var(--ink); border-color: var(--line-strong); }
.set-nav .ic { color: var(--ink-3); }
section[id] { scroll-margin-top: 80px; }
.token-box { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border-radius: 12px; border: 1px solid var(--accent-line);
  background: var(--accent-soft); }
.token-box code { flex: 1; min-width: 0; background: none; border: 0; padding: 0; font-size: 13px; color: var(--ink); word-break: break-all; }

/* ── Обновлённый лендинг лаборатории UNIT ───────────────────────────────── */
.landing-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 48px;
    align-items: center;
}
.hero-badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 26px;
}
.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 13px;
    border-radius: 99px;
    background: color-mix(in srgb, var(--surface) 75%, transparent);
    border: 1px solid var(--line);
    font-size: 13px;
    color: var(--ink-2);
    font-weight: 500;
}
.hero-tag .dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--accent-2);
    box-shadow: 0 0 6px var(--accent-2);
}

/* Карточки манифеста и принципов */
.card-unit {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: border-color .2s, transform .2s, box-shadow .2s;
}
.card-unit:hover {
    border-color: var(--line-strong);
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.15);
}
.card-unit .num {
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-2);
}
.card-unit h3 {
    font-size: 19px;
    line-height: 1.25;
}
.card-unit p {
    color: var(--ink-2);
    font-size: 14.5px;
    line-height: 1.55;
}

/* Процесс в 4 шага */
.pipeline-step {
    position: relative;
    padding: 26px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color .2s, transform .2s;
}
.pipeline-step:hover {
    border-color: var(--accent-2);
    transform: translateY(-2px);
}
.step-idx {
    font-family: var(--display);
    font-size: 28px;
    font-weight: 700;
    color: color-mix(in srgb, var(--accent) 55%, var(--ink-3));
    line-height: 1;
}

/* Блок Про Деньги */
.money-card {
    background: linear-gradient(145deg, color-mix(in srgb, var(--surface) 95%, #059669 5%), var(--surface));
    border: 1px solid color-mix(in srgb, var(--line) 75%, #10b981 25%);
    border-radius: 22px;
    padding: 42px 48px;
    position: relative;
    overflow: hidden;
}
.money-card::before {
    content: ''; position: absolute; right: -80px; top: -80px; width: 280px; height: 280px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.12), transparent 70%);
    pointer-events: none;
}
.money-headline {
    font-size: clamp(22px, 2.4vw, 30px);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 16px;
}
.money-body {
    font-size: 16px;
    line-height: 1.65;
    color: var(--ink-2);
    max-width: 52em;
}
.money-foot {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    font-weight: 600;
    color: var(--ink);
    font-size: 15.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

}

/* Блок «Рассказать о себе» (лендинг) */
.contact-card {
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 22px;
    padding: 42px 46px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.04);
}
.contact-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 26px;
    flex-wrap: wrap;
}
.contact-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 15px;
    border-radius: 99px;
    background: color-mix(in srgb, var(--accent-2) 10%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--accent-2) 26%, transparent);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--accent-2);
    white-space: nowrap;
}
.lead-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 18px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14.5px;
    font-weight: 500;
}
.lead-alert.success {
    background: color-mix(in srgb, var(--ok) 12%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent);
    color: var(--ok);
}
.lead-alert.error {
    background: color-mix(in srgb, var(--danger) 12%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent);
    color: var(--danger);
}

/* Действия с группами (редактирование / удаление) */
.team-action-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 99px;
    background: var(--surface);
    border: 1px solid var(--line);
    font-size: 13.5px;
    color: var(--ink);
    transition: all .15s ease;
}
.team-action-chip:hover {
    border-color: var(--line-strong);
}
.team-action-btn {
    background: none;
    border: none;
    padding: 2px;
    cursor: pointer;
    color: var(--ink-3);
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color .15s, transform .1s;
}
.team-action-btn:hover {
    color: var(--ink);
}
.team-action-btn.del:hover {
    color: var(--danger);
}

@media (max-width: 900px) {
    .landing-hero-grid { grid-template-columns: minmax(0, 1fr); }
    .contact-card { padding: 26px 20px; }
    .money-card { padding: 28px 24px; }
}



/* ═══ Ровная вёрстка на всех ширинах (проверено 360–1920, 2026-10-16) ═══ */
.appbar-mark { padding: 9px; margin: -9px; }                          /* знак в шапке — под палец */
.set-nav + .stack, .set-nav + form.stack { max-width: 880px; }         /* настройки не растягиваются на весь монитор */
.task-check, a.avatar.sm { position: relative; }
.task-check::after, a.avatar.sm::after { content: ''; position: absolute; inset: -8px; }   /* касание с запасом, раскладка та же */
@media (max-width: 560px) {
    .mini-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; width: 100%; }
    /* Шапка Мастерской: список проектов и кнопки — как остальные поля на телефоне */
    .wd-project-sel { height: 40px; width: 100%; font-size: 14px; border-radius: 10px; padding: 0 10px; }
    .wd-title { min-height: 36px; }
}
@media (pointer: coarse) {
    .wd-win-btn, .wt-btn.is-icon { min-width: 40px; min-height: 40px; }
    .wt-btn { min-height: 38px; }
}

/* ═══ Биржа задач ═══ */
.mk-score { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.2fr); gap: 18px 28px; align-items: center; padding: 18px 22px; margin-bottom: 18px; }
.mk-rating { display: flex; flex-direction: column; gap: 4px; }
.mk-num { font: 700 40px/1 var(--display); font-variant-numeric: tabular-nums; }
.mk-scale { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mk-bar { position: relative; height: 10px; border-radius: 99px; background: linear-gradient(90deg, color-mix(in srgb, var(--danger) 22%, var(--sunken)) 0 30%, color-mix(in srgb, var(--warn) 22%, var(--sunken)) 30% 50%, var(--sunken) 50% 70%, color-mix(in srgb, var(--ok) 22%, var(--sunken)) 70%); }
.mk-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.mk-bar em { position: absolute; top: -3px; width: 2px; height: 16px; background: var(--surface); }
.mk-ticks { position: relative; height: 14px; font: 500 10.5px var(--mono); color: var(--ink-3); }
.mk-ticks span { position: absolute; transform: translateX(-50%); }
.mk-ticks span:first-child { transform: none; }
.mk-ticks span:last-child { transform: translateX(-100%); }
.mk-rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; color: var(--ink-2); }
.mk-rules li { display: flex; gap: 8px; align-items: flex-start; }
.mk-rules .ic { color: var(--accent); margin-top: 2px; }
.mk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; align-items: start; }
.mk-card { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; }
.mk-card:target { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.mk-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: space-between; }
.mk-price { font: 700 22px var(--display); font-variant-numeric: tabular-nums; color: var(--ok); }
.mk-card h3 { font-size: 16px; text-wrap: balance; }
.mk-about { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.mk-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.mk-meta span { display: inline-flex; align-items: center; gap: 5px; }
.mk-act { margin-top: 2px; }
.mk-row:target { background: var(--accent-soft); }
.mk-review { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.mk-review .input { width: 220px; }
@media (max-width: 1080px) {
    .mk-score { grid-template-columns: auto minmax(0, 1fr); }
    .mk-rules { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
    .mk-score { grid-template-columns: minmax(0, 1fr); padding: 16px; gap: 14px; }
    .mk-grid { grid-template-columns: minmax(0, 1fr); }
    .mk-row { flex-wrap: wrap; }
    .mk-btns, .mk-review { width: 100%; }
    .mk-btns form, .mk-review .input { flex: 1; width: auto; }
    .mk-btns form { display: flex; gap: 6px; }
    .mk-btns .btn, .mk-review .btn { flex: 1; }
}
@media (max-width: 560px) {
    .mk-score { grid-template-columns: auto minmax(0, 1fr); gap: 10px 16px; }
    .mk-num { font-size: 32px; }
    .mk-rules { gap: 4px; font-size: 12.5px; }
    .mk-rules li:nth-child(n+3) { display: none; }      /* на телефоне — главное; остальное на вкладке «Мои» */
}
.view section.mk-score { margin-bottom: 16px; }

/* ═══ Биржа: отклики, выбор исполнителя, контакты, форма по шагам ═══ */
.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; }
.mk-hint { display: flex; align-items: center; gap: 6px; color: var(--warn); }
.mk-apply > summary { list-style: none; cursor: pointer; }
.mk-apply > summary::-webkit-details-marker { display: none; }
.mk-apply[open] > summary { display: none; }
.mk-apply > form { padding: 12px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); }
.mk-apply .tiny .ic { vertical-align: -2px; }
.mk-mybid { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.mk-mybid .btn-primary { flex: 1; }
.mk-offer { background: color-mix(in srgb, var(--ok) 7%, transparent); }
.mk-contact { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; padding: 6px 6px 6px 10px; border-radius: 9px; background: var(--accent-soft); align-self: flex-start; max-width: 100%; }
.mk-contact b { color: var(--ink); overflow-wrap: anywhere; user-select: all; }
.mk-bids { flex-basis: 100%; display: flex; flex-direction: column; gap: 8px; padding: 2px 0 4px; }
.mk-bid { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.mk-bid.chosen { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); background: color-mix(in srgb, var(--ok) 6%, var(--surface)); }
.mk-note { color: var(--ink-2); white-space: pre-line; margin: 2px 0 0; }
.mk-bid-act { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.mk-nobids { padding: 2px 0; }
.mk-privacy { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); background: var(--accent-soft); color: var(--ink-2); line-height: 1.45; }
.mk-privacy .ic { color: var(--accent); flex: none; margin-top: 1px; }

.wiz-step { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.wiz-dots { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.wiz-dots li { display: flex; align-items: center; gap: 7px; padding-top: 9px; border-top: 3px solid var(--sunken); font-size: 12.5px; font-weight: 500; color: var(--ink-3); cursor: pointer; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .15s, border-color .15s; }
.wiz-dots li i { font: 600 11px/1 var(--mono); font-style: normal; width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--sunken); color: var(--ink-3); flex: none; }
.wiz-dots li.on { color: var(--ink); border-color: var(--accent); }
.wiz-dots li.on i { background: var(--accent); color: #fff; }
.wiz-dots li.done { color: var(--ink-2); border-color: color-mix(in srgb, var(--accent) 45%, var(--sunken)); }
.wiz-dots li.done i { background: var(--accent-soft); color: var(--accent); }
#bounty-new .sheet-head .tiny { flex: none; }
#bounty-new .sheet-body { min-height: 320px; }
@media (max-width: 640px) {
    .mk-bid { flex-wrap: wrap; }
    .mk-bid-act { flex-direction: row; align-items: center; width: 100%; justify-content: space-between; }
    .mk-bid-act .btn { flex: 1; }
    .wiz-dots li { font-size: 11.5px; gap: 5px; }
    #bounty-new .sheet-body { min-height: 0; }
}
@media (max-width: 380px) {
    .wiz-dots li { font-size: 0; justify-content: center; }
    .wiz-dots li i { font-size: 11px; }
    .wiz-dots li.on { font-size: 11.5px; }
}
.mk-contact .btn-icon { width: 32px; height: 32px; }

/* ═══ Заявки: итог проверки на спам ═══ */
.lead-check { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 8px 12px; border-radius: 10px; font-size: 12.5px; color: var(--ink-2); background: var(--sunken); }
.lead-check b { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.lead-check .ic { flex: none; }
.lead-check.ok { background: color-mix(in srgb, var(--ok) 9%, var(--surface)); }
.lead-check.ok b { color: var(--ok); }
.lead-check.doubt { background: color-mix(in srgb, var(--warn) 11%, var(--surface)); }
.lead-check.doubt b { color: var(--warn); }
.lead-check.spam { background: color-mix(in srgb, var(--danger) 8%, var(--surface)); }
.lead-check.spam b { color: var(--danger); }
.lead-check b + span::before { content: "— "; }
.lead-spam-head { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin: -8px 0 18px; }
.lead-spam-head p { max-width: 720px; margin: 0; }
