/* Orkesteri — нейтральная основа, цвета провайдеров как акценты, заголовки с засечками. */
@property --ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
:root {
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --r-xs: 3px; --r-sm: 6px; --r: 8px; --r-lg: 10px; --r-2xl: 16px; --aside-w: 248px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
/* Акцент интерфейса выбирает пользователь (data-accent на <html>); по умолчанию — нейтральный графит.
   Всё остальное выводится из одного цвета --tint. */
:root, [data-accent="graphite"] { --tint-l: #3b3b41; --ink-l: #ffffff; --tint-d: #d9d9de; --ink-d: #1e1e22; }
[data-accent="indigo"]     { --tint-l: #5551d9; --ink-l: #ffffff; --tint-d: #9893ff; --ink-d: #16152e; }
[data-accent="ocean"]      { --tint-l: #0b78b5; --ink-l: #ffffff; --tint-d: #56b7ea; --ink-d: #08202e; }
[data-accent="sage"]       { --tint-l: #2e8460; --ink-l: #ffffff; --tint-d: #66c99a; --ink-d: #0b2219; }
[data-accent="terracotta"] { --tint-l: #c25a34; --ink-l: #ffffff; --tint-d: #ee8d66; --ink-d: #2c130a; }
[data-accent="amber"]      { --tint-l: #d6930f; --ink-l: #231803; --tint-d: #f3b844; --ink-d: #231803; }
[data-accent="orchid"]     { --tint-l: #a1449a; --ink-l: #ffffff; --tint-d: #d888d2; --ink-d: #2a0f27; }
[data-accent="rose"]       { --tint-l: #cf476d; --ink-l: #ffffff; --tint-d: #f27c9d; --ink-d: #2e0c16; }
:root[data-theme] {
  --accent: var(--tint); --accent-ink: var(--tint-ink);
  --accent-soft: color-mix(in srgb, var(--tint) 9%, transparent); --accent-line: color-mix(in srgb, var(--tint) 32%, transparent);
  --action: var(--tint); --action-ink: var(--tint-ink);
  --action-hover: color-mix(in srgb, var(--tint) 86%, var(--text-flip));
  --selection: color-mix(in srgb, var(--tint) 11%, transparent);
  --brand: linear-gradient(90deg, var(--tint), color-mix(in srgb, var(--tint) 55%, var(--surface)));
  --aside-wash: linear-gradient(170deg, color-mix(in srgb, var(--tint) 10%, transparent) 0%, transparent 70%);
}
:root[data-theme="light"] { --text-flip: #000; }
:root[data-theme="dark"] { --text-flip: #fff; }
:root[data-theme="light"] {
  --bg: #ffffff; --surface: #ffffff; --surface-2: #f5f5f6; --surface-3: #ebebed;
  --line: #e8e8ea; --line-strong: #d6d6da; --text: #1f1f22; --text-2: #5c5c63; --muted: #8e8e96;
  --btn: #1f1f22; --btn-ink: #ffffff; --generic: #0000000d; --generic-hover: #00000017;
  --ok: #2f9e5b; --ok-soft: #2f9e5b14; --warn: #c27c00; --warn-soft: #ffbe3d26; --bad: #e5474e; --bad-soft: #e5474e12;
  --info: #3f62e0; --info-soft: #3f62e012;
  --c-yellow: #e0a100; --c-blue: #3a6cff; --c-teal: #13a89b; --c-gray: #8e8e96; --c-user: #5c5c63;
  --c-clay: #c96f4f; --c-ink: #2a2a30; --c-orange: #ef6a00; --c-violet: #6a5af0; --c-forest: #2f7a5c;
  --c-rose: #d94f7a; --c-sky: #1e95d8; --c-lime: #5f9c12; --c-plum: #8e3fa8; --c-sand: #a8823f; --c-slate: #56677d;
  --shadow: none; --float: 0 8px 28px -10px #1f1f2233, 0 0 0 1px #0000000f;
  --glow-a: #ffbe3d00; --glow-b: #2dd4bf00; --glow-c: #5b8cff00;
  --tint: var(--tint-l); --tint-ink: var(--ink-l);
}
:root[data-theme="dark"] {
  --bg: #1e1e22; --surface: #26262b; --surface-2: #2d2d33; --surface-3: #37373e;
  --line: #34343a; --line-strong: #44444b; --text: #ececef; --text-2: #a8a8b0; --muted: #7c7c85;
  --btn: #ececef; --btn-ink: #1e1e22; --generic: #ffffff12; --generic-hover: #ffffff1f;
  --ok: #4fce83; --ok-soft: #4fce831c; --warn: #ffbe3d; --warn-soft: #ffbe3d1f; --bad: #ff6b72; --bad-soft: #ff6b721c;
  --info: #8aa2ff; --info-soft: #8aa2ff1f;
  --c-yellow: #f6c244; --c-blue: #6b96ff; --c-teal: #33d1bd; --c-gray: #8b8b94; --c-user: #c9c9cf;
  --c-clay: #e8936f; --c-ink: #dadae4; --c-orange: #ff8d33; --c-violet: #9d92ff; --c-forest: #5fbf98;
  --c-rose: #f27ea3; --c-sky: #5cc2f5; --c-lime: #a5d85c; --c-plum: #c983e0; --c-sand: #dcbd7d; --c-slate: #98aac0;
  --shadow: none; --float: 0 14px 36px -12px #000a, 0 0 0 1px #ffffff12;
  --glow-a: #0000; --glow-b: #0000; --glow-c: #0000;
  --tint: var(--tint-d); --tint-ink: var(--ink-d);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 14px/1.5 var(--font-ui); color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  background-image: radial-gradient(700px 420px at 92% -8%, var(--glow-c), transparent 70%),
    radial-gradient(620px 380px at 70% -14%, var(--glow-b), transparent 70%), radial-gradient(560px 360px at 52% -12%, var(--glow-a), transparent 70%);
  background-attachment: fixed;
}
::selection { background: var(--accent-line); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
code, pre, .mono { font-family: var(--font-mono); font-size: .86em; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
.display { font-family: var(--font-display); font-weight: 600; letter-spacing: -.015em; }
.muted { color: var(--muted); } .t2 { color: var(--text-2); } .small { font-size: 13px; } .tiny { font-size: 12px; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.boot { min-height: 100vh; }

/* ---------- каркас ---------- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px;
  padding: 22px 14px 18px; border-right: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(10px);
}
.logo { display: flex; align-items: center; gap: 10px; padding: 0 10px 20px; color: var(--text); }
.logo:hover { text-decoration: none; }
.logo svg { flex: none; }
.logo .word { font-family: var(--font-display); font-size: 22px; font-weight: 600; letter-spacing: -.015em; }
.logo:hover .mark-net .pulse { animation-duration: 1.2s; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm);
  color: var(--text-2); font-weight: 500; transition: background .15s, color .15s;
}
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a { position: relative; }
.nav a.active { background: var(--surface-2); color: var(--text); }
.nav a.active::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.nav a.active svg { color: var(--accent); }
.nav a svg { opacity: .9; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); padding: 18px 10px 6px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 14px; padding: 0 6px; }
.quota .row-between { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.meter { height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.meter > i { display: block; height: 100%; width: 0; border-radius: inherit; transition: width .5s var(--ease);
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 55%, var(--surface-3)), var(--accent)); }
.meter.ok > i { background: var(--ok); } .meter.warn > i { background: var(--warn); } .meter.bad > i { background: var(--bad); }
.me { display: flex; align-items: center; gap: 8px; }
.avatar {
  width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-3); color: var(--text); font-weight: 600; font-size: 13px; border: 1px solid var(--line-strong);
}
.me .who { min-width: 0; flex: 1; font-size: 13px; line-height: 1.25; }
.me .who b, .me .who span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .who b { font-weight: 500; }

.main { min-width: 0; padding: 26px 32px 80px; outline: none; }
.page { max-width: 1200px; margin: 0 auto; animation: rise .35s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head h1 { font-family: var(--font-display); font-size: 30px; line-height: 1.15; letter-spacing: -.015em; }
.page-head p { margin: 6px 0 0; color: var(--text-2); }
.crumb { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.crumb:hover { color: var(--text); text-decoration: none; }

/* ---------- примитивы ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { font-size: 15px; font-weight: 600; }
.card-head .sub { font-size: 13px; color: var(--muted); font-weight: 400; }
.stack { display: flex; flex-direction: column; gap: 16px; } .stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.grid-2e { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.sticky { position: sticky; top: 24px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 400 14px/1 var(--font-ui); height: 32px;
  padding: 0 13px; border-radius: var(--r-sm); border: 0; background: var(--generic); color: var(--text);
  cursor: pointer; transition: background .15s, transform .08s, opacity .15s; white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--generic-hover); text-decoration: none; }
.btn.outlined { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn.outlined:hover { background: var(--generic); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn.primary { background: var(--action); color: var(--action-ink); font-weight: 500; }
.btn.primary:hover { background: var(--action-hover); }
.btn.ghost { background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--generic); color: var(--text); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; border-radius: var(--r-sm); }
.btn.lg { height: 36px; padding: 0 18px; font-size: 15px; border-radius: var(--r); }
.btn.icon { width: 32px; padding: 0; } .btn.sm.icon { width: 28px; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); }
.field .hint { color: var(--muted); font-size: 12px; }
.input, .textarea, .select {
  font: 14px/1.4 var(--font-ui); color: var(--text); background: transparent; border: 1px solid var(--line-strong);
  border-radius: var(--r-sm); padding: 6px 10px; min-height: 32px; width: 100%; transition: border-color .15s, box-shadow .15s, background .15s;
}
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.input:hover, .textarea:hover, .select:hover { border-color: var(--muted); }
.input:focus, .textarea:focus, .select:focus, .input:focus-visible, .textarea:focus-visible, .select:focus-visible {
  outline: none; border-radius: var(--r-sm); border-color: var(--focus-1); animation: breathe 3.2s ease-in-out infinite; }
.textarea { resize: vertical; min-height: 84px; line-height: 1.55; }
.input.sm { padding: 3px 8px; min-height: 28px; font-size: 13px; }
.input.num { width: 92px; text-align: right; font-variant-numeric: tabular-nums; }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; color: var(--text); font-size: 14px; user-select: none; }
.check input { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }
.switch { position: relative; display: inline-block; vertical-align: middle; width: 34px; height: 20px; 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(--surface-3); border: 1px solid var(--line-strong); transition: background .2s; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-2); transition: transform .2s var(--ease), background .2s; }
.switch input:checked + i { background: var(--accent); border-color: var(--accent); }
.switch input:checked + i::after { transform: translateX(14px); background: #fff; }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; line-height: 1; height: 22px;
  padding: 0 8px; border-radius: var(--r-sm); background: var(--generic); color: var(--text-2); white-space: nowrap;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); } .pill.run { background: var(--accent-soft); color: var(--accent); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.run .dot { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.tag { font: 12px var(--font-mono); padding: 3px 7px; border-radius: var(--r-xs); background: var(--generic); color: var(--text-2); white-space: nowrap; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 13px; font-weight: 500; color: var(--text-2); padding: 0 10px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table tbody tr.link { cursor: pointer; transition: background .12s; }
.table tbody tr.link:hover td { background: var(--surface-2); }
.table tbody tr.link td:first-child { border-radius: 6px 0 0 6px; } .table tbody tr.link td:last-child { border-radius: 0 6px 6px 0; }
.table-wrap { overflow-x: auto; margin: 0 -10px; padding: 0 10px; }

.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 34px 16px; color: var(--muted); }
.empty svg { opacity: .7; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--accent-soft); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.notice { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: var(--r); border: 1px solid var(--warn); background: var(--warn-soft); color: var(--text); font-size: 14px; }
.notice svg { color: var(--warn); flex: none; margin-top: 1px; }
.notice.bad { border-color: var(--bad); background: var(--bad-soft); } .notice.bad svg { color: var(--bad); }

.toasts { position: fixed; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 8px; z-index: 50; pointer-events: none; }
.toast {
  pointer-events: auto; max-width: 380px; padding: 11px 15px 11px 18px; border-radius: var(--r); font-size: 14px; position: relative; overflow: hidden;
  background: var(--surface); color: var(--text); border: 0; box-shadow: var(--float); animation: toast .25s var(--ease);
}
.toast::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand); }
.toast.bad::before { background: var(--bad); }

@keyframes toast { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ---------- вход ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art { position: relative; overflow: hidden; border-right: 1px solid var(--line); background: var(--surface); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-art .net { position: absolute; inset: 0; opacity: .85; -webkit-mask-image: radial-gradient(55% 32% at 30% 50%, transparent 35%, #000 85%); mask-image: radial-gradient(55% 32% at 30% 50%, transparent 35%, #000 85%); }
.auth-art .net svg { width: 100%; height: 100%; }
.auth-art::after { content: ""; position: absolute; inset: 0; background: radial-gradient(70% 60% at 30% 55%, transparent, var(--surface) 90%); pointer-events: none; }
.auth-art > :not(.net) { z-index: 1; }
.auth-art .quote { position: relative; font-family: var(--font-display); font-size: 40px; line-height: 1.12; max-width: 520px; letter-spacing: -.02em; }
.auth-art .quote em { font-style: italic; background: var(--brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-art .roles { position: relative; display: flex; gap: 22px; color: var(--text-2); font-size: 14px; }
.auth-art .roles b { display: block; color: var(--text); font-weight: 500; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; }
.auth-form form { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 16px; }
.auth-form h1 { font-family: var(--font-display); font-size: 30px; }
.err { color: var(--bad); font-size: 13px; min-height: 18px; }

/* ---------- проекты ---------- */
.composer { position: relative; overflow: visible; padding: 26px; z-index: 2; }

.composer .net { position: absolute; right: 10px; top: 8px; width: 260px; height: 90px; opacity: .8; pointer-events: none; }
.composer h2 { font-family: var(--font-display); font-size: 24px; margin-bottom: 4px; letter-spacing: -.01em; }
.composer .textarea { min-height: 104px; font-size: 15px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: 13px var(--font-ui); padding: 5px 10px; border-radius: var(--r-sm); border: 0; background: var(--generic);
  color: var(--text-2); cursor: pointer; transition: all .15s;
}
.chip:hover { background: var(--generic-hover); color: var(--text); }
.chip.mono { font-family: var(--font-mono); font-size: 12px; }
.segmented { display: inline-flex; padding: 2px; border-radius: var(--r-sm); background: var(--generic); }
.segmented button { display: inline-flex; align-items: center; gap: 6px; font: 400 13px var(--font-ui); border: 0; background: transparent; color: var(--text-2); height: 24px; padding: 0 10px; border-radius: 4px; cursor: pointer; }
.segmented button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px #00000026, 0 0 0 1px #0000000a; }

/* ---------- проект: чат ---------- */
.page.wide { max-width: none; }
.page-head.compact { margin-bottom: 18px; }
.page-head.compact h1 { font-size: 28px; }
.chat-page { display: flex; flex-direction: column; min-height: calc(100vh - 210px); }
.chat-col { max-width: 820px; margin: 0 auto; }
.thread { display: flex; flex-direction: column; gap: 16px; }
.msg { display: flex; gap: 12px; align-items: flex-start; max-width: 100%; }
.msg .bubble { padding: 10px 14px; border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.6; min-width: 0; }
.msg .bubble .md { white-space: normal; }
.msg.assistant .bubble { background: var(--surface-2); border: 0; border-top-left-radius: 5px; max-width: calc(100% - 44px); }
.msg.user { flex-direction: row-reverse; align-self: flex-end; max-width: 88%; }
.msg.user .bubble { background: var(--selection); border: 0; border-top-right-radius: 5px; }
.msg .avatar { width: 30px; height: 30px; font-size: 12px; margin-top: 2px; }
.avatar.bot { background: var(--surface-2); border-color: var(--line-strong); }
.bubble.typing { display: flex; align-items: center; gap: 4px; padding: 8px 14px; }
.thinking { display: inline-flex; gap: 4px; padding: 6px 4px; }
.thinking i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: bounce 1.2s infinite; }
.thinking i:nth-child(2) { animation-delay: .15s; } .thinking i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
.thread-tail { margin-top: 16px; }
.inline-card { margin-left: 42px; padding: 16px 18px; }
details.inline-card > summary { display: flex; align-items: center; justify-content: space-between; cursor: pointer; list-style: none; }
details.inline-card > summary::-webkit-details-marker { display: none; }
details.inline-card[open] > summary { margin-bottom: 14px; }
details.inline-card summary svg { color: var(--ok); }
details.inline-card summary .sigil svg, .inline-card .sigil svg { color: inherit; }
.spec { display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; font-size: 14px; margin: 0; }
.spec dt { color: var(--muted); } .spec dd { margin: 0; }
.spec ul { margin: 0; padding-left: 18px; } .spec li + li { margin-top: 3px; }
.actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line-strong); }
.tasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.tasks li { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; }
.team { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.team .member { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.progress-card .activity { min-height: 20px; }
.file-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip.on { color: var(--text); background: var(--selection); }
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.eq i { width: 3px; background: var(--accent); border-radius: 1px; animation: eq .9s ease-in-out infinite; transform-origin: bottom; }
.eq i:nth-child(1) { height: 5px; } .eq i:nth-child(2) { height: 11px; animation-delay: .2s; } .eq i:nth-child(3) { height: 8px; animation-delay: .4s; }
@keyframes eq { 50% { transform: scaleY(.35); } }

/* цвета агентов: провайдер → цвет и узор */
.c-yellow { --c: var(--c-yellow); --pattern: radial-gradient(color-mix(in srgb, var(--c) 60%, transparent) 1.1px, transparent 1.6px) 0 0 / 9px 9px; }
.c-blue { --c: var(--c-blue); --pattern: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 45%, transparent) 0 1px, transparent 1px 7px); }
.c-teal { --c: var(--c-teal); --pattern: repeating-linear-gradient(0deg, color-mix(in srgb, var(--c) 32%, transparent) 0 1px, transparent 1px 10px), repeating-linear-gradient(90deg, color-mix(in srgb, var(--c) 32%, transparent) 0 1px, transparent 1px 10px); }
.c-gray { --c: var(--c-gray); --pattern: radial-gradient(color-mix(in srgb, var(--c) 40%, transparent) 1px, transparent 1.4px) 0 0 / 8px 8px; }
.c-user { --c: var(--c-user); --pattern: radial-gradient(color-mix(in srgb, var(--c) 30%, transparent) 1px, transparent 1.4px) 0 0 / 8px 8px; }
/* новые провайдеры: свой цвет и свой узор на карточках */
.c-clay { --c: var(--c-clay); --pattern: repeating-radial-gradient(circle at 100% 0, color-mix(in srgb, var(--c) 38%, transparent) 0 1px, transparent 1px 8px); }
.c-ink { --c: var(--c-ink); --pattern: repeating-linear-gradient(45deg, color-mix(in srgb, var(--c) 28%, transparent) 0 1px, transparent 1px 9px), repeating-linear-gradient(-45deg, color-mix(in srgb, var(--c) 28%, transparent) 0 1px, transparent 1px 9px); }
.c-orange { --c: var(--c-orange); --pattern: repeating-linear-gradient(0deg, color-mix(in srgb, var(--c) 30%, transparent) 0 3px, transparent 3px 10px); }
.c-violet { --c: var(--c-violet); --pattern: repeating-conic-gradient(color-mix(in srgb, var(--c) 22%, transparent) 0 25%, transparent 0 50%) 0 0 / 12px 12px; }
.c-forest { --c: var(--c-forest); --pattern: repeating-linear-gradient(90deg, color-mix(in srgb, var(--c) 34%, transparent) 0 1px, transparent 1px 7px); }
.c-rose { --c: var(--c-rose); --pattern: radial-gradient(color-mix(in srgb, var(--c) 45%, transparent) 1.6px, transparent 2.2px) 0 0 / 13px 13px; }
.c-sky { --c: var(--c-sky); --pattern: repeating-linear-gradient(45deg, color-mix(in srgb, var(--c) 40%, transparent) 0 1px, transparent 1px 7px); }
.c-lime { --c: var(--c-lime); --pattern: radial-gradient(color-mix(in srgb, var(--c) 50%, transparent) .9px, transparent 1.3px) 0 0 / 6px 6px; }
.c-plum { --c: var(--c-plum); --pattern: repeating-linear-gradient(60deg, color-mix(in srgb, var(--c) 28%, transparent) 0 1px, transparent 1px 10px), repeating-linear-gradient(-60deg, color-mix(in srgb, var(--c) 28%, transparent) 0 1px, transparent 1px 10px); }
.c-sand { --c: var(--c-sand); --pattern: repeating-linear-gradient(0deg, color-mix(in srgb, var(--c) 34%, transparent) 0 1px, transparent 1px 6px); }
.c-slate { --c: var(--c-slate); --pattern: repeating-linear-gradient(0deg, color-mix(in srgb, var(--c) 26%, transparent) 0 1px, transparent 1px 12px), repeating-linear-gradient(90deg, color-mix(in srgb, var(--c) 26%, transparent) 0 2px, transparent 2px 12px); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c); margin-right: 6px; }

/* сигил агента — векторный знак вместо буквы */
.sigil { width: 34px; height: 34px; flex: none; display: inline-grid; place-items: center; border-radius: 11px; color: var(--c);
  background: color-mix(in srgb, var(--c) 13%, transparent); border: 1px solid color-mix(in srgb, var(--c) 34%, transparent); }
.sigil svg { width: 24px; height: 24px; overflow: visible; }
.sigil.sm { width: 22px; height: 22px; border-radius: 7px; } .sigil.sm svg { width: 15px; height: 15px; }
.sigil.lg { width: 46px; height: 46px; border-radius: 14px; } .sigil.lg svg { width: 32px; height: 32px; }
.sigil .core { fill: currentColor; } .sigil .ring { fill: none; stroke: currentColor; stroke-width: 1.4; }
.sigil .faint { fill: none; stroke: currentColor; stroke-width: 1; opacity: .4; }

/* знак сети (логотип) */
.mark-net { color: var(--text); flex: none; }
.mark-net .edge { fill: none; stroke-width: 1.8; stroke-linecap: round; }
.mark-net .hub { fill: currentColor; }
.mark-net .faint { fill: none; stroke: currentColor; opacity: .35; stroke-width: 1.2; stroke-linecap: round; }
.mark-net .orbit-ring { stroke-dasharray: 1.5 3; stroke-width: 1; }
.mark-net .knot-bg { fill: none; stroke: var(--logo-bg, var(--surface)); stroke-width: 5; stroke-linecap: round; }
.mark-net .knot, .mark-net .venn { fill: none; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.mark-net .knot-ink { fill: currentColor; }
.stroke-yellow { stroke: var(--c-yellow); } .stroke-teal { stroke: var(--c-teal); } .stroke-blue { stroke: var(--c-blue); }
.mark-net.live .spoke { stroke-dasharray: 1.2 2; animation: flow 2.4s linear infinite; }
.mark-net .halo { opacity: .22; }
.mark-net .halo:not(.pulse) { display: none; }
.mark-net:not(.live) .halo { display: none; }
.mark-net .pulse { animation: netpulse 3.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.mark-net .pulse.p2 { animation-delay: 1.05s; } .mark-net .pulse.p3 { animation-delay: 2.1s; }
@keyframes netpulse { 0%, 70%, 100% { transform: scale(1); opacity: .22; } 35% { transform: scale(1.7); opacity: 0; } }
.st-yellow { stop-color: var(--c-yellow); } .st-blue { stop-color: var(--c-blue); } .st-teal { stop-color: var(--c-teal); }
.st-gray { stop-color: var(--c-gray); } .st-user { stop-color: var(--c-user); }
.fill-yellow { fill: var(--c-yellow); } .fill-blue { fill: var(--c-blue); } .fill-teal { fill: var(--c-teal); } .fill-gray { fill: var(--c-gray); } .fill-user { fill: var(--c-user); }
.net .ln { stroke: var(--line-strong); stroke-width: 1; }
.net .ln.hot { stroke-dasharray: 3 6; animation: flow 1.6s linear infinite; }
.net .nd { opacity: .9; } .net .nd-halo { opacity: .16; }
.net .tw { animation: twinkle 4s ease-in-out infinite; } .net .tw.d1 { animation-delay: 1.3s; } .net .tw.d2 { animation-delay: 2.6s; }
@keyframes twinkle { 50% { opacity: .35; } }

/* ---------- проект: доска ---------- */
.board { position: relative; height: calc(100vh - 200px); min-height: 460px; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  background-color: var(--bg); background-image: radial-gradient(color-mix(in srgb, var(--text) 9%, transparent) 1px, transparent 1.3px); background-size: 24px 24px; }
.board::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(120% 90% at 50% 50%, transparent 55%, color-mix(in srgb, var(--bg) 85%, transparent)); }
.board-vp { position: absolute; inset: 0; cursor: grab; touch-action: none; }
.board-vp.grabbing { cursor: grabbing; }
.board-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.board-wires { position: absolute; left: 0; top: 0; overflow: visible; }
.wire path { fill: none; }
.wire .base { stroke: var(--line-strong); stroke-width: 1.5; }
.wire.dep .base { stroke-dasharray: 3 6; }
.wire .glow, .wire .flow { opacity: 0; transition: opacity .3s; }
.wire.active .glow { opacity: .16; stroke-width: 9; }
.wire.active .flow { opacity: 1; stroke-width: 2.2; }
.wire.active .base { opacity: 0; }
.wire .port { fill: var(--bg); stroke: var(--line-strong); stroke-width: 1.5; }
.wire.active .port { stroke: var(--c); }
.wire .spark { opacity: 0; } .wire.active .spark { opacity: 1; fill: var(--c); }
.board-cards { position: absolute; inset: 0; }

.acard { position: absolute; width: 248px; height: 150px; display: flex; flex-direction: column; gap: 9px; text-align: left; padding: 14px 14px 12px;
  font: inherit; color: var(--text); border-radius: 12px; cursor: pointer; isolation: isolate;
  background: linear-gradient(165deg, color-mix(in srgb, var(--c) 13%, var(--surface-2)) 0%, var(--surface-2) 46%);
  border: 1px solid color-mix(in srgb, var(--c) 26%, var(--line-strong));
  box-shadow: 0 1px 0 #ffffff08 inset, 0 16px 36px -24px #000;
  transition: transform .2s var(--ease), box-shadow .25s, border-color .25s, opacity .25s; }
.acard::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 62px; border-radius: 12px 12px 0 0; background: var(--pattern); z-index: -1; opacity: .55;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent), linear-gradient(90deg, transparent 35%, #000); -webkit-mask-composite: source-in;
  mask-image: linear-gradient(180deg, #000, transparent), linear-gradient(90deg, transparent 35%, #000); mask-composite: intersect; }
.acard:hover { transform: translateY(-3px); box-shadow: 0 1px 0 #ffffff08 inset, 0 22px 40px -22px #000, 0 0 0 1px color-mix(in srgb, var(--c) 35%, transparent); }
.acard.open { box-shadow: 0 0 0 2px var(--c), 0 22px 40px -22px #000; }
.acard::after { content: ""; position: absolute; inset: -1px; border-radius: 13px; padding: 1.5px; pointer-events: none; opacity: 0;
  background: conic-gradient(from var(--ang), transparent 0 62%, var(--c) 80%, #fff8 86%, transparent 92%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.acard.s-working::after, .acard.s-review::after { opacity: 1; animation: orbit 2.6s linear infinite; }
.acard.s-review::after { animation-duration: 4s; }
@keyframes orbit { to { --ang: 360deg; } }
.acard.s-working, .acard.s-review { box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 30%, transparent), 0 18px 44px -16px color-mix(in srgb, var(--c) 40%, transparent); }
.acard.s-working .sigil svg { animation: spin 9s linear infinite; }
.acard.s-waiting { opacity: .55; } .acard.s-idle { opacity: .8; }
.acard.c-user { cursor: default; }
.acard-top { display: flex; align-items: center; gap: 11px; }
.acard-name { font-family: var(--font-display); font-weight: 600; font-size: 17px; line-height: 1.15; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acard-role { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.acard-task { font-size: 13px; color: var(--text-2); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.acard-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; }
.acard-state { display: inline-flex; align-items: center; gap: 6px; color: var(--c); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acard-state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.acard.s-working .acard-state::before { animation: pulse 1.2s ease-in-out infinite; }
.acard.s-waiting .acard-state, .acard.s-idle .acard-state { color: var(--muted); }
.acard.s-done .acard-state { color: var(--ok); } .acard.s-retry .acard-state { color: var(--warn); } .acard.s-warn .acard-state { color: var(--bad); }
.acard-cost { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.acard-badge { position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: #fff; border: 2px solid var(--bg); animation: pop .35s var(--ease); }
.acard-badge.ok { background: var(--ok); color: #06210f; } .acard-badge.retry { background: var(--warn); color: #2a1a00; } .acard-badge.warn { background: var(--bad); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.acard-model { position: absolute; bottom: -20px; left: 6px; font-size: 10.5px; color: var(--muted); }
.acard .eq i { background: var(--c); }
.board-tools { position: absolute; left: 14px; bottom: 14px; display: flex; gap: 6px; align-items: center; padding: 6px; border-radius: 12px; background: color-mix(in srgb, var(--surface) 90%, transparent); border: 1px solid var(--line); backdrop-filter: blur(8px); z-index: 2; }
.board-tools .btn.icon { width: 30px; height: 30px; padding: 0; font-size: 16px; }
.board-legend { position: absolute; left: 14px; top: 12px; display: flex; gap: 14px; font-size: 12px; color: var(--text-2); padding: 7px 12px; border-radius: 10px; background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--line); backdrop-filter: blur(8px); z-index: 2; }
.board-legend .sw { width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent); }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 92%); display: flex; flex-direction: column; background: var(--surface);
  border-left: 1px solid var(--line-strong); box-shadow: -24px 0 50px -30px #000; animation: slide .25s var(--ease); z-index: 3; }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
.drawer-head { position: relative; padding: 18px 18px 14px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, color-mix(in srgb, var(--c, var(--accent)) 12%, var(--surface)), var(--surface)); }
.drawer-head::before { content: ""; position: absolute; inset: 0; background: var(--pattern); opacity: .35; pointer-events: none; -webkit-mask-image: linear-gradient(200deg, #000, transparent 60%); mask-image: linear-gradient(200deg, #000, transparent 60%); }
.drawer-head > * { position: relative; }
.drawer-name { font-family: var(--font-display); font-weight: 600; font-size: 21px; letter-spacing: -.01em; }
.drawer-task { margin-top: 12px; font-size: 14px; }
.drawer-why { margin-top: 6px; font-size: 13px; color: var(--text-2); }
.drawer-log > * { flex: none; }
.drawer-log { flex: 1; overflow-y: auto; padding: 14px 18px 24px; display: flex; flex-direction: column; gap: 12px; }
.lg { border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); overflow: hidden; }
.lg-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 12px; }
.lg-head .btn { margin-left: auto; padding: 2px 6px; }
.lg-kind { font-weight: 600; text-transform: uppercase; letter-spacing: .06em; font-size: 11px; }
.lg.lg-in .lg-kind { color: var(--info); } .lg.lg-think .lg-kind { color: var(--warn); } .lg.lg-out .lg-kind { color: var(--ok); }
.lg .t, .lg-note .t { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.lg-text { margin: 0; padding: 10px 12px; font: 12px/1.55 var(--font-mono); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-2); }
.lg.lg-think .lg-text { font-family: var(--font-ui); font-style: italic; font-size: 13px; }
.lg-text.clamp { max-height: 168px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.lg-note { display: flex; gap: 8px; align-items: baseline; font-size: 13px; color: var(--text-2); padding: 2px 4px; }

.code { margin: 0; padding: 16px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); overflow: auto; max-height: 520px; font: 12.5px/1.6 var(--font-mono); white-space: pre; tab-size: 2; }
.code .ln { display: inline-block; width: 3ch; margin-right: 14px; color: var(--muted); text-align: right; user-select: none; opacity: .6; }

.md { font-size: 15px; line-height: 1.65; }
.md > :first-child { margin-top: 0; }
.md h1, .md h2, .md h3 { font-family: var(--font-display); margin: 22px 0 8px; } .md h1 { font-size: 26px; } .md h2 { font-size: 20px; } .md h3 { font-size: 17px; }
.md p { margin: 8px 0; } .md ul, .md ol { margin: 8px 0; padding-left: 22px; } .md li + li { margin-top: 4px; }
.md code { padding: 2px 6px; border-radius: 6px; background: var(--surface-3); }
.md pre { padding: 14px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); overflow: auto; }
.md pre code { padding: 0; background: none; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.md a { word-break: break-all; }

/* ---------- дашборд ---------- */
.stat { padding: 18px 20px; position: relative; overflow: hidden; }
.stat { --sc: var(--accent); }
.stat .label { font-size: 13px; color: var(--text-2); }
.stat .value { font-family: var(--font-display); font-size: 32px; font-weight: 600; margin: 6px 0 2px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat .sub { font-size: 13px; color: var(--text-2); }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid line { stroke: var(--line); }
.chart .axis text { fill: var(--muted); font: 11px var(--font-ui); }
.chart .bar { fill: url(#bar-grad); opacity: .92; transition: opacity .15s; } .chart .bar:hover { opacity: 1; }
.chart .g1 { stop-color: var(--accent); } .chart .g2 { stop-color: color-mix(in srgb, var(--accent) 65%, var(--surface)); }
.chart .bar.zero { fill: var(--surface-3); }
.hbars { display: flex; flex-direction: column; gap: 12px; }
.hbar .row-between { font-size: 13px; margin-bottom: 5px; }
.hbar .track { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.hbar .track i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.split { display: flex; height: 12px; border-radius: 99px; overflow: hidden; gap: 2px; margin: 6px 0 16px; }
.split i { display: block; height: 100%; }
.legend { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 8px; }

/* ---------- админка ---------- */
.provider { display: flex; flex-direction: column; gap: 14px; }
.provider .head { display: flex; align-items: center; gap: 12px; }
.provider .mark { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-weight: 700; font-size: 14px; background: var(--surface-3); color: var(--text-2); }

.provider .name { font-weight: 600; } .provider .key { font: 12px var(--font-mono); color: var(--muted); }
.models-out { display: flex; flex-direction: column; gap: 8px; }
.models-out .chips { max-height: 132px; overflow-y: auto; }
.skillset { display: flex; gap: 4px; flex-wrap: wrap; }
.skillset label { display: inline-flex; }
.skillset input { position: absolute; opacity: 0; pointer-events: none; }
.skillset span { font-size: 12px; padding: 4px 9px; border-radius: 99px; border: 1px solid var(--line-strong); color: var(--muted); cursor: pointer; user-select: none; transition: all .12s; }
.skillset input:checked + span { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }
.skillset input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }

@media (max-width: 1080px) { .grid-2, .grid-2e, .grid-3 { grid-template-columns: 1fr; } .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sticky { position: static; } }
@media (max-width: 820px) {
  .inline-card { margin-left: 0; }
  .shell { grid-template-columns: 1fr; } .side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .side-foot { margin-top: 12px; } .main { padding: 24px 18px 60px; } .auth { grid-template-columns: 1fr; } .auth-art { display: none; }
  .files { grid-template-columns: 1fr; } .form-grid { grid-template-columns: 1fr; } .spec { grid-template-columns: 1fr; gap: 2px 0; } .spec dd { margin-bottom: 10px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- команда агентов (админка) ---------- */
.provider .mark { color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); }
.provider { position: relative; overflow: hidden; }
.provider.on { border-color: color-mix(in srgb, var(--c) 30%, var(--line)); }
.persona-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.persona { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--r-lg);
  background: linear-gradient(170deg, color-mix(in srgb, var(--c) 9%, var(--surface-2)), var(--surface-2) 45%); border: 1px solid color-mix(in srgb, var(--c) 24%, var(--line)); }
.persona::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 64px; background-image: var(--pattern); opacity: .5; pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 20%, #000); mask-image: linear-gradient(90deg, transparent 20%, #000); }
.persona > * { position: relative; }
.persona.off { opacity: .6; }
.persona-top { display: flex; align-items: center; gap: 12px; }
.persona-name { font-family: var(--font-display); font-weight: 600; font-size: 18px; letter-spacing: -.01em; padding: 5px 9px; background: transparent; border-color: transparent; }
.persona-name:hover { border-color: var(--line-strong); }
.persona .textarea { min-height: 60px; font-size: 13px; background: var(--surface); }
.mono-sm { font-family: var(--font-mono) !important; font-size: 12px !important; }
.persona details.fold > summary { font-size: 13px; }


/* ---------- каркас в духе Gravity UI ---------- */
.shell { display: grid; grid-template-columns: var(--aside-w) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .22s var(--ease); }
.shell.collapsed { --aside-w: 56px; }
.aside { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow: hidden auto; background: var(--surface);
  border-right: 1px solid var(--line); z-index: 6; }
.aside::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 360px; background: var(--aside-wash); pointer-events: none; }
.aside > * { position: relative; }
.a-head { height: 56px; display: flex; align-items: center; padding: 0 6px; }
.a-brand { display: flex; align-items: center; gap: 8px; color: var(--text); min-width: 0; height: 36px; padding: 0 4px; }
/* знак стоит в той же 36-пиксельной колонке, что и значки меню, — по центру свёрнутой панели */
.a-logo { width: 36px; height: 36px; flex: none; display: grid; place-items: center; }
.a-logo svg { display: block; }
.a-brand:hover { text-decoration: none; }
.a-word { font-family: var(--font-display); font-size: 20px; line-height: 1; font-weight: 600; letter-spacing: -.015em; white-space: nowrap; }
.a-cta { display: flex; align-items: center; gap: 10px; margin: 6px 10px 10px; height: 36px; padding: 0 9px; border-radius: var(--r);
  font: 500 14px var(--font-ui); color: var(--text); cursor: pointer; border: 0; background: var(--surface); box-shadow: var(--float); white-space: nowrap; text-align: left; }
.a-cta:hover { background: var(--surface-2); }
.a-nav, .a-recent { display: flex; flex-direction: column; gap: 1px; padding: 0 6px; }
.a-item { display: flex; align-items: center; gap: 12px; height: 36px; padding: 0 9px 0 12px; border-radius: var(--r-sm); color: var(--text);
  font: 400 14px var(--font-ui); background: transparent; border: 0; cursor: pointer; text-align: left; width: 100%; white-space: nowrap; min-width: 0; }
.a-item:hover { background: var(--generic); text-decoration: none; }
.a-item.active { background: var(--selection); }
.a-icon { width: 20px; flex: none; display: flex; align-items: center; justify-content: center; color: var(--text-2); }
.a-item.active .a-icon { color: var(--text); }
.a-label { overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.a-sep { height: 1px; background: var(--line); margin: 8px 6px; }
.a-section { font-size: 12px; color: var(--muted); padding: 2px 10px 4px; white-space: nowrap; }
.a-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.a-dot.ok { background: var(--ok); } .a-dot.warn { background: var(--warn); } .a-dot.bad { background: var(--bad); }
.a-dot.run { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); animation: pulse 1.4s ease-in-out infinite; }
.a-foot { margin-top: auto; display: flex; flex-direction: column; gap: 1px; padding: 10px 6px 10px; border-top: 1px solid var(--line); }
.a-quota { padding: 4px 10px 10px; }
.a-quota .row-between { margin-bottom: 6px; }
.a-user .avatar { width: 26px; height: 26px; font-size: 11px; }
.a-user .who { display: flex; flex-direction: column; line-height: 1.2; }
.a-user .who b { font-weight: 500; font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.a-logout { flex: none; width: 28px; height: 28px; }
/* сворачивание: значки стоят на тех же местах, панель просто сужается, подписи плавно гаснут —
   поэтому анимация в обе стороны идёт от одного края */
.a-word, .a-label, .a-section, .a-quota, .a-mini { transition: opacity .16s var(--ease), max-height .22s var(--ease), padding .22s var(--ease), width .22s var(--ease); }
.a-section, .a-quota { max-height: 120px; overflow: hidden; }
.shell.collapsed .a-word, .shell.collapsed .a-label { opacity: 0; text-overflow: clip; }
.shell.collapsed .a-section, .shell.collapsed .a-quota { opacity: 0; max-height: 0; padding-top: 0; padding-bottom: 0; pointer-events: none; }
.shell.collapsed .a-mini { opacity: 0; width: 0; padding: 0; overflow: hidden; pointer-events: none; }
.a-cta { transition: width .22s var(--ease), background .2s; width: calc(100% - 20px); overflow: hidden; }
.shell.collapsed .a-cta { width: 36px; }
.shell.collapsed .a-cta .a-label { opacity: 0; }
.content { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 5; height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 32px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; white-space: nowrap; }
.crumbs a { color: var(--text-2); } .crumbs a:hover { color: var(--text); text-decoration: none; }
.crumb-sep { color: var(--muted); }
.crumb-cur { color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.topbar-actions > div { display: flex; gap: 8px; align-items: center; }
@media (max-width: 820px) {
  .shell, .shell.collapsed { grid-template-columns: 1fr; --aside-w: 0px; }
  .aside { position: static; height: auto; } .topbar { padding: 0 16px; }
}

.spot { margin-bottom: 4px; overflow: visible; }
.spot .sp { stroke: none; }
.spot .sp-yellow { fill: color-mix(in srgb, var(--c-yellow) 30%, transparent); }
.spot .sp-teal { fill: color-mix(in srgb, var(--c-teal) 26%, transparent); }
.spot .sp-blue { fill: color-mix(in srgb, var(--c-blue) 24%, transparent); }
.spot .sp-line { fill: none; stroke: var(--text); stroke-width: 1.5; stroke-linecap: round; opacity: .75; stroke-dasharray: 260; stroke-dashoffset: 260; animation: draw 1.6s var(--ease) .1s forwards; }
.spot .sp-spark { stroke: var(--c-yellow); stroke-width: 1.6; stroke-linecap: round; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.empty { padding: 30px 16px 34px; }
.empty-title { font-weight: 600; font-size: 16px; color: var(--text); }


/* ---------- поле ввода (композер) ---------- */
/* док — sticky внутри страницы: не «прыгает» во время анимации появления, в отличие от position: fixed */
.composer-dock { position: sticky; bottom: 0; margin-top: auto; padding: 18px 0 18px; z-index: 4;
  background: linear-gradient(to bottom, transparent, var(--bg) 28px); }
.cmp { display: flex; flex-direction: column; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface);
  box-shadow: 0 1px 2px #0000000d, 0 10px 30px -18px #00000040; transition: border-color .15s, box-shadow .15s; }
.cmp:focus-within { border-color: var(--focus-1); animation: breathe-cmp 3.2s ease-in-out infinite; }
.cmp-input:focus-visible { outline: none; }
.cmp.disabled { background: var(--surface-2); box-shadow: none; }
.cmp-input { border: 0; outline: 0; resize: none; background: transparent; color: var(--text); font: 15px/1.5 var(--font-ui);
  padding: 13px 16px 4px; min-height: 48px; max-height: 220px; width: 100%; display: block; }
.cmp-input::placeholder { color: var(--muted); }
.cmp-input:disabled { cursor: not-allowed; }
.cmp-start .cmp-input { min-height: 96px; }
.cmp-files { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px 0; }
.cmp-file { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 4px 0 8px; border-radius: var(--r-sm); background: var(--generic); font-size: 12.5px; color: var(--text); max-width: 260px; }
.cmp-file .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-file .sz { color: var(--muted); }
.cmp-file button { display: grid; place-items: center; width: 20px; height: 20px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); cursor: pointer; }
.cmp-file button:hover { background: var(--generic-hover); color: var(--text); }
.cmp-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px 8px 8px; }
.cmp-left, .cmp-right { display: flex; align-items: center; gap: 2px; }
.cmp-tool, .cmp-send { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text-2); cursor: pointer; transition: background .15s, color .15s; }
.cmp-tool:hover:not(:disabled), .cmp-send:hover:not(:disabled) { background: var(--generic); color: var(--text); }
.cmp-tool:disabled, .cmp-send:disabled { opacity: .4; cursor: default; }
.cmp-send { color: var(--text); }
.cmp-tool.rec { color: var(--bad); background: var(--bad-soft); width: auto; padding: 0 9px; display: inline-flex; gap: 6px; }
.rec-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); animation: pulse 1s ease-in-out infinite; }
.cmp-divider { width: 1px; height: 18px; background: var(--line); margin: 0 6px; }
.cmp-level-wrap { position: relative; }
.cmp-level { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px; border: 0; border-radius: var(--r-sm); background: transparent;
  color: var(--text-2); font: 13px var(--font-ui); cursor: pointer; }
.cmp-level:hover:not(:disabled) { background: var(--generic); color: var(--text); }
.cmp-level:disabled { opacity: .55; cursor: default; }
.cmp-menu { position: absolute; left: 0; bottom: calc(100% + 8px); width: 330px; padding: 6px; border-radius: var(--r-lg); background: var(--surface);
  box-shadow: var(--float); z-index: 20; animation: toast .15s var(--ease); }
.cmp-start .cmp-menu { bottom: auto; top: calc(100% + 8px); }
.cmp-menu-title { font-size: 12px; color: var(--muted); padding: 6px 10px 4px; }
.cmp-menu-item { display: block; width: 100%; text-align: left; border: 0; background: transparent; color: var(--text); font: 14px var(--font-ui);
  padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer; }
.cmp-menu-item:hover { background: var(--generic); }
.cmp-menu-item.on { background: var(--selection); }
.cmp-menu-item b { font-weight: 500; }
.cmp-menu-points { font-size: 12px; color: var(--text-2); margin-top: 2px; line-height: 1.45; }
.cmp-hint { font-size: 12px; color: var(--muted); margin-right: 10px; }
.cmp-start { box-shadow: none; }
.bubble-wrap { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.msg.user .bubble-wrap { align-items: flex-end; }
.msg-files { display: flex; flex-wrap: wrap; gap: 6px; }

/* оценка стоимости и резерв */
.estimate { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; margin-top: 16px; padding: 14px 16px; border-radius: var(--r);
  background: var(--surface-2); }
.estimate-num { font-family: var(--font-display); font-size: 24px; font-weight: 600; letter-spacing: -.01em; margin: 2px 0; white-space: nowrap; }
.estimate-num .muted { font-family: var(--font-ui); font-size: 14px; font-weight: 400; }
.estimate-cost { font-family: var(--font-ui); font-size: 14px; font-weight: 400; color: var(--text-2); }
.estimate-note { display: flex; gap: 8px; align-items: flex-start; color: var(--text-2); line-height: 1.45; }
.estimate-note svg { flex: none; margin-top: 2px; color: var(--ok); }
.estimate.short { background: var(--bad-soft); } .estimate.short .estimate-note svg { color: var(--bad); }
.reserve { margin-top: 14px; }
.meter.thin { height: 4px; margin-top: 6px; }
.meter.stacked { display: flex; }
.meter.stacked > b { display: block; height: 100%; background: repeating-linear-gradient(135deg, var(--muted) 0 3px, transparent 3px 6px); opacity: .55; }
@media (max-width: 820px) { .estimate { grid-template-columns: 1fr; } .cmp-menu { width: min(330px, 86vw); } }

/* фокус полей: тонкая светло-серая рамка, мягко «дышит» */
:root { --focus-1: #d4d4d8; --focus-2: #a9a9b1; --focus-halo: #a9a9b11f; }
[data-theme="dark"] { --focus-1: #4a4a52; --focus-2: #7a7a84; --focus-halo: #ffffff10; }
@keyframes breathe {
  0%, 100% { border-color: var(--focus-1); box-shadow: 0 0 0 0 var(--focus-halo); }
  50% { border-color: var(--focus-2); box-shadow: 0 0 0 3px var(--focus-halo); }
}
@keyframes breathe-cmp {
  0%, 100% { border-color: var(--focus-1); box-shadow: 0 0 0 0 var(--focus-halo), 0 10px 30px -18px #00000040; }
  50% { border-color: var(--focus-2); box-shadow: 0 0 0 4px var(--focus-halo), 0 10px 30px -18px #00000040; }
}
@media (prefers-reduced-motion: reduce) {
  .input:focus, .textarea:focus, .select:focus, .cmp:focus-within { animation: none; border-color: var(--focus-2); }
}

/* квота: остаток, цвет плавно от зелёного к красному */
.meter.quota > i { background: var(--q, var(--ok)); transition: width .6s var(--ease), background-color .6s var(--ease); }
.meter.quota.unlimited > i { background: var(--ok); opacity: .45; }

/* просмотр результатов: документы и таблицы */
.file-view { margin-top: 12px; }
.doc-view { padding: 22px 26px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); max-height: 620px; overflow: auto; }
.table-view { border-radius: var(--r); border: 1px solid var(--line); max-height: 560px; overflow: auto; }
.table-view .table th { position: sticky; top: 0; background: var(--surface-2); padding: 10px; }
.table-view .table td { padding: 8px 10px; }
.table-view .table td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- доска: непрерывные анимации с плавным затуханием ----------
   Анимации крутятся всегда, а состояние управляет только прозрачностью (с переходом),
   поэтому смена статуса не обрывает кольцо, эквалайзер, пульс и искры, а мягко гасит их. */
.acard { transition: transform .2s var(--ease), box-shadow .6s var(--ease), border-color .6s, opacity .6s,
  left .6s var(--ease), top .6s var(--ease); }
.acard.enter { animation: rise .45s var(--ease) both; }
.acard::after { animation: orbit 3s linear infinite; opacity: 0; transition: opacity .9s var(--ease); }
.acard.s-working::after { opacity: 1; animation-duration: 3s; }
.acard.s-review::after { opacity: .7; animation-duration: 3s; }
.acard .sigil svg { animation: spin 9s linear infinite; animation-play-state: paused; }
.acard.s-working .sigil svg { animation: spin 9s linear infinite; animation-play-state: running; }
.acard .eq { opacity: 0; transition: opacity .7s var(--ease); }
.acard.s-working .eq { opacity: 1; }
.acard .eq i { animation-play-state: running; }
.acard-sigil { display: contents; }
.acard-state { position: relative; transition: color .6s var(--ease); }
.acard.s-working .acard-state::before { animation: none; }
.acard-state::after { content: ""; position: absolute; left: 0; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%;
  background: currentColor; animation: halo 1.6s ease-out infinite; filter: opacity(0); transition: filter .7s var(--ease); pointer-events: none; }
.acard.s-working .acard-state::after, .acard.s-review .acard-state::after { filter: opacity(1); }
.acard-state.swap { animation: swapin .45s var(--ease); }
@keyframes halo { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(2.8); opacity: 0; } }
@keyframes swapin { from { opacity: 0; transform: translateY(3px); } }
.acard-badge { transition: opacity .4s; }
.wire .glow, .wire .flow, .wire .base { transition: opacity .8s var(--ease), stroke .6s; }
.wire .spark { opacity: 0; transition: opacity .8s var(--ease); }
.wire.active .spark { opacity: 1; fill: var(--c); }
.wire .spark { fill: var(--c, var(--muted)); }
.wire .port { transition: stroke .6s; }
@media (prefers-reduced-motion: reduce) {
  .acard::after, .acard .sigil svg, .acard .eq i, .acard-state::after { animation: none; }
}

/* ---------- оформление: акцент и тема ---------- */
.appearance { position: fixed; z-index: 60; width: 236px; padding: 14px; border-radius: var(--r-lg); background: var(--surface);
  box-shadow: var(--float); animation: rise .22s var(--ease); }
.appearance h4 { margin: 0 0 10px; font-size: 12px; font-weight: 500; color: var(--muted); }
.swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.swatch { width: 36px; height: 36px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; justify-self: center; position: relative;
  background: var(--sw); box-shadow: inset 0 0 0 1px #00000014; transition: transform .2s var(--ease); }
.swatch:hover { transform: scale(1.08); }
.swatch::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--sw); opacity: 0; transform: scale(.85);
  transition: opacity .25s, transform .25s var(--ease); }
.swatch[aria-pressed="true"]::after { opacity: 1; transform: none; }
.swatch:focus-visible { outline: none; } .swatch:focus-visible::after { opacity: .6; transform: none; }
.seg { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; gap: 3px; border-radius: var(--r); background: var(--surface-2); }
.seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px; border: 0; border-radius: 6px;
  font: inherit; font-size: 13px; color: var(--text-2); background: transparent; cursor: pointer; transition: background .2s, color .2s; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px #0000001f; }
.a-swatch { width: 16px; height: 16px; border-radius: 50%; background: var(--tint); box-shadow: inset 0 0 0 1px #00000020; display: inline-block; }
html.theming, html.theming * { transition: background-color .35s var(--ease), color .35s var(--ease), border-color .35s var(--ease) !important; }

/* изображения в результате */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-bottom: 14px; }
.thumb { padding: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface-2); cursor: zoom-in;
  aspect-ratio: 4 / 3; transition: transform .2s var(--ease), box-shadow .2s; }
.thumb:hover { transform: translateY(-2px); box-shadow: var(--float); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-view { margin: 0; padding: 16px; border-radius: var(--r); border: 1px solid var(--line); background:
  repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0 / 16px 16px; text-align: center; }
.img-view img { max-width: 100%; max-height: 560px; border-radius: 6px; box-shadow: 0 10px 30px -18px #000; }
.img-view figcaption { margin-top: 8px; }

/* ---------- статистика: ровная сетка 4 колонки ---------- */
.dash { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.dash > .span-2 { grid-column: span 2; } .dash > .span-4 { grid-column: 1 / -1; }
.kpi { display: flex; flex-direction: column; min-height: 148px; padding: 18px 20px 16px; }
.kpi-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.kpi-ic { width: 26px; height: 26px; border-radius: 7px; display: inline-grid; place-items: center; color: var(--accent); background: var(--accent-soft); }
.kpi-value { font-family: var(--font-display); font-size: 30px; font-weight: 600; line-height: 1.1; margin: 14px 0 4px;
  font-variant-numeric: tabular-nums; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub { font-size: 12.5px; color: var(--muted); }
.kpi-foot { margin-top: auto; padding-top: 12px; }
.kpi-foot .meter { margin: 0; }
.dash-card { display: flex; flex-direction: column; min-width: 0; padding: 18px 20px 20px; }
.dash-card .card-head { min-height: 28px; margin-bottom: 14px; }
.dash-card > :last-child:not(.card-head) { flex: 1; }
.dash-card .chart { width: 100%; height: auto; display: block; }
@media (max-width: 1080px) { .dash { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dash > .span-2 { grid-column: 1 / -1; } }

/* ---------- блок аккаунта: профиль + оформление + выход ---------- */
.a-account { display: flex; align-items: center; gap: 2px; padding-right: 2px; }
.a-account .a-user { flex: 1; height: 46px; color: var(--text); }
.a-account .a-user .avatar { width: 28px; height: 28px; font-size: 12px; }
.a-mini { flex: none; width: 30px; height: 30px; color: var(--text-2); }
.a-mini:hover { color: var(--text); }
.a-appearance[aria-expanded="true"] { background: var(--generic); color: var(--text); }
.appearance::after { content: ""; position: absolute; bottom: -6px; left: calc(var(--arrow, 50%) - 6px); width: 12px; height: 12px;
  background: var(--surface); transform: rotate(45deg); box-shadow: 1px 1px 0 #0000000f; }
.appearance { animation: popup .2s var(--ease); transform-origin: var(--arrow, 50%) 100%; }
@keyframes popup { from { opacity: 0; transform: translateY(6px) scale(.97); } }

/* аватарки */
.avatar.img { padding: 0; overflow: hidden; border-color: transparent; background: var(--surface-3); }
.avatar.img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar[class*="av-"] { color: #fff; border-color: transparent; }
.av-graphite { background: #3b3b41; } .av-indigo { background: #5551d9; } .av-ocean { background: #0b78b5; } .av-sage { background: #2e8460; }
.av-terracotta { background: #c25a34; } .av-amber { background: #d6930f; color: #231803 !important; } .av-orchid { background: #a1449a; } .av-rose { background: #cf476d; }

/* ---------- профиль ---------- */
.profile { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }
.profile-card { text-align: center; padding: 28px 24px 22px; }
.profile-card .avatar.xl { width: 112px; height: 112px; font-size: 44px; font-family: var(--font-display); margin: 0 auto; border-width: 0; }
.avatar-wrap { position: relative; width: 112px; margin: 0 auto 14px; }
.avatar-edit { position: absolute; right: -2px; bottom: -2px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); cursor: pointer; box-shadow: var(--float); }
.avatar-edit:hover { background: var(--surface-2); }
.profile-name { font-family: var(--font-display); font-size: 22px; font-weight: 600; margin: 0; overflow-wrap: anywhere; }
.profile-mail { color: var(--muted); font-size: 13px; margin-top: 2px; overflow-wrap: anywhere; }
.profile-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; text-align: left; }
.profile-facts div { padding: 10px 12px; border-radius: var(--r); background: var(--surface-2); }
.profile-facts b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }
.profile-facts span { font-size: 12px; color: var(--muted); }
.profile-forms { display: flex; flex-direction: column; gap: 18px; }
.colors { display: flex; flex-wrap: wrap; gap: 10px; }
.colors .swatch { width: 30px; height: 30px; }
.form-row { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px; align-items: start; padding: 14px 0; border-top: 1px solid var(--line); }
.form-row:first-of-type { border-top: 0; padding-top: 2px; }
.form-row > label, .form-row > .lbl { font-size: 13px; font-weight: 500; padding-top: 7px; }
.form-row .hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
@media (max-width: 900px) { .profile { grid-template-columns: 1fr; } .form-row { grid-template-columns: 1fr; gap: 6px; } }

/* свёрнутое меню: аккуратный квадрат вокруг аватарки */
.a-account .a-user .a-icon { width: 28px; margin: 0 -4px; }


/* доска: перетаскивание без выделения текста; сетка двигается вместе с карточками */
.board-vp { user-select: none; -webkit-user-select: none; }
.board { background-image: none; }
.board-vp { background-image: radial-gradient(color-mix(in srgb, var(--text) 9%, transparent) 1px, transparent 1.3px);
  background-size: var(--grid, 24px) var(--grid, 24px); background-position: var(--gx, 0) var(--gy, 0); }

/* разделитель итераций в чате */
.round-sep { display: flex; align-items: center; gap: 12px; margin: 18px 0 6px; color: var(--muted); font-size: 12px; }
.round-sep::before, .round-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.round-sep span { padding: 3px 10px; border-radius: 99px; background: var(--surface-2); white-space: nowrap; }

/* ---------- вход: Google, «проверьте почту» ---------- */
.google-btn { width: 100%; justify-content: center; gap: 10px; background: var(--surface); border: 1px solid var(--line-strong); color: var(--text); text-decoration: none; }
.google-btn:hover { background: var(--surface-2); }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.mail-sent { display: flex; } .mail-ic { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }

/* ---------- подписки ---------- */
.plan-badge { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600;
  background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.plan-badge.p-plus { background: var(--accent-soft); color: var(--accent); }
.plan-badge.p-expert { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 20%, transparent), color-mix(in srgb, var(--accent) 8%, transparent)); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-line); }
a.a-quota { display: block; text-decoration: none; color: inherit; border-radius: var(--r); transition: background .2s; }
a.a-quota:hover { background: var(--generic); }
.a-quota-num { font-size: 15px; font-weight: 600; margin: 4px 0 6px; font-variant-numeric: tabular-nums; }
.a-quota-num .muted { font-size: 12px; font-weight: 400; }
.usage-card { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-bottom: 18px; }
.usage-card > .muted { grid-column: 1 / -1; }
.use-num { font-family: var(--font-display); font-size: 26px; font-weight: 600; margin: 8px 0 10px; font-variant-numeric: tabular-nums; }
.use-num .muted { font-family: var(--font-ui, inherit); font-size: 13px; font-weight: 400; }
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.plan-card { display: flex; flex-direction: column; padding: 22px; }
.plan-card.current { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.plan-head { display: flex; align-items: center; justify-content: space-between; }
.plan-price { font-family: var(--font-display); font-size: 28px; font-weight: 600; margin: 14px 0 4px; }
.plan-list { list-style: none; padding: 0; margin: 14px 0 18px; display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; }
.plan-list li { display: flex; gap: 9px; align-items: flex-start; } .plan-list svg { flex: none; margin-top: 1px; color: var(--accent); }
.plan-foot { margin-top: auto; } .plan-foot .btn { width: 100%; justify-content: center; }
.soon { margin-left: 6px; font-size: 11px; opacity: .7; }
.plans-table td { vertical-align: middle; } .plans-table .input { width: 130px; max-width: none; }
.auth-states { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
@media (max-width: 1000px) { .plans { grid-template-columns: 1fr; } .usage-card { grid-template-columns: 1fr; } }

/* ---------- прямой чат с координатором ---------- */
.cmp-target { display: inline-flex; padding: 2px; gap: 2px; border-radius: 8px; background: var(--surface-2); margin-left: 6px; }
.cmp-target-item { height: 26px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--text-2); font: inherit; font-size: 12.5px; cursor: pointer; }
.cmp-target-item.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px #0000001f; }
.avatar.coord { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.msg-who { font-size: 11.5px; color: var(--muted); margin: 0 0 4px 4px; }
.cmp-menu-item:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- меню проекта и диалоги ---------- */
.menu { position: fixed; z-index: 70; min-width: 190px; padding: 5px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--float); animation: popup .16s var(--ease); }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent;
  color: var(--text); font: inherit; font-size: 13.5px; cursor: pointer; text-align: left; }
.menu-item:hover, .menu-item:focus-visible { background: var(--generic); outline: none; }
.menu-item.danger { color: var(--bad); }
.menu-sep { height: 1px; background: var(--line); margin: 4px 6px; }
.backdrop { position: fixed; inset: 0; z-index: 80; background: #0000004d; display: grid; place-items: center; animation: fadein .15s; }
@keyframes fadein { from { opacity: 0; } }
.dialog { width: min(420px, calc(100vw - 32px)); padding: 22px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--float);
  display: flex; flex-direction: column; gap: 12px; animation: popup .2s var(--ease); }
.dialog h3 { margin: 0; font-family: var(--font-display); font-size: 19px; }
.dialog p { margin: 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.btn.danger { background: var(--bad); color: #fff; border-color: transparent; }
.btn.danger:hover { filter: brightness(1.06); }
.table td.act, .table th.act { width: 44px; text-align: right; padding-right: 8px; }
.editable-title { cursor: text; border-radius: 6px; transition: background .2s; }
.editable-title:hover { background: var(--generic); }

/* ручная расстановка карточек */
.acard { cursor: grab; touch-action: none; }
.acard.dragging { cursor: grabbing; transition: box-shadow .2s, border-color .6s !important; z-index: 5; box-shadow: 0 18px 40px -16px #0000004d, 0 0 0 1px var(--line-strong); }
.board-wires { overflow: visible; }
.board-tools .btn.icon:disabled { opacity: .4; }

/* ---------- «Проверьте почту» ---------- */
.check-mail { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; max-width: 380px; margin: 0 auto; }
.check-mail h1 { margin: 6px 0 0; }
.check-mail .t2 { margin: 0; }
.cm-art { width: 168px; height: 126px; margin-bottom: 4px; }
.cm-halo { fill: var(--accent-soft); }
.cm-paper { fill: var(--surface); stroke: var(--line-strong); stroke-width: 1.5; animation: cm-rise 2.8s var(--ease) infinite alternate; transform-origin: 80px 50px; }
.cm-lines { stroke: color-mix(in srgb, var(--text) 22%, transparent); stroke-width: 3; stroke-linecap: round; fill: none; animation: cm-rise 2.8s var(--ease) infinite alternate; }
.cm-env { fill: var(--surface-2); stroke: var(--line-strong); stroke-width: 1.5; stroke-linejoin: round; }
.cm-fold { stroke: var(--line-strong); stroke-width: 1.5; fill: none; stroke-linecap: round; }
.cm-dot { fill: var(--ok); }
.cm-check { stroke: #fff; stroke-width: 2.2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
@keyframes cm-rise { from { transform: translateY(4px); } to { transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .cm-paper, .cm-lines { animation: none; } }
.cm-addr { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 99px; background: var(--surface-2);
  font-weight: 600; font-size: 14px; max-width: 100%; overflow-wrap: anywhere; }
.cm-addr svg { color: var(--muted); flex: none; }
.cm-steps { text-align: left; margin: 8px 0 4px; padding-left: 20px; color: var(--text-2); font-size: 13.5px; line-height: 1.55; align-self: stretch; }
.cm-steps li { padding-left: 4px; margin: 3px 0; }
.cm-actions { display: flex; flex-direction: column; gap: 8px; align-self: stretch; margin-top: 8px; }
.cm-actions .btn { width: 100%; justify-content: center; gap: 8px; }
.cm-actions .btn:disabled { opacity: .65; font-variant-numeric: tabular-nums; }
.cm-note { min-height: 18px; font-size: 13px; color: var(--ok); }
.cm-hint { font-size: 12.5px; color: var(--muted); margin: 0 0 4px; }

/* ---------- компьютер пользователя ---------- */
.cmp-extra { display: inline-flex; }
.cmp-extra:empty { display: none; }
.cmp-device { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; margin-left: 6px; border-radius: 8px;
  border: 1px dashed var(--line-strong); background: transparent; color: var(--text-2); font: inherit; font-size: 12.5px; cursor: pointer;
  transition: background .2s, color .2s, border-color .2s; }
.cmp-device:hover:not(:disabled) { background: var(--generic); color: var(--text); }
.cmp-device.on { border-style: solid; border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }
.cmp-device .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.cmp-device.on .dot { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.cmp-device.on.offline .dot { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.cmp-device:disabled { opacity: .6; cursor: default; }
.dev-list { display: flex; flex-direction: column; gap: 10px; }
.dev { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r); background: var(--surface-2); }
.dev-ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--surface); color: var(--muted); position: relative; }
.dev-ic.on { color: var(--accent); }
.dev-ic.on::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); border: 2px solid var(--surface-2); }
.a-cta svg, .a-item .a-icon { flex: none; }

/* колечко лимита — видно только в свёрнутой панели */
.a-ring { display: grid; place-items: center; position: relative; width: 36px; height: 0; margin: 0 4px; opacity: 0; overflow: hidden;
  transition: opacity .16s var(--ease), height .22s var(--ease), margin .22s var(--ease); pointer-events: none; }
.shell.collapsed .a-ring { height: 36px; margin: 2px 4px 6px; opacity: 1; pointer-events: auto; }
.a-ring:hover { text-decoration: none; background: var(--generic); border-radius: var(--r-sm); }
.a-ring svg { position: absolute; inset: 4px; }
.a-ring .ring-bg { fill: none; stroke: var(--line-strong); stroke-width: 3; }
.a-ring .ring-fg { fill: none; stroke-width: 3; stroke-linecap: round; transition: stroke-dasharray .6s var(--ease), stroke .6s var(--ease); }
.a-ring-num { position: relative; font: 600 9px var(--font-ui); color: var(--text-2); letter-spacing: -.02em; }

/* плашки в чате — по ширине колонки сообщений, а не всей ленты */
/* сообщения ассистента и плашки (задание, план, ход работы, результат) — одна колонка одной ширины */
.chat-col { --bubble-max: 680px; }
.msg.assistant .bubble-wrap { flex: 1; min-width: 0; max-width: var(--bubble-max); }
.msg.assistant .bubble { max-width: none; }
.msg.assistant .bubble.typing { align-self: flex-start; }
.inline-card { margin-left: 42px; margin-right: 0; width: calc(100% - 42px); max-width: var(--bubble-max); }
/* поле ввода ближе к нижнему краю окна */
.main:has(.chat-page) { padding-bottom: 0; }
.chat-page { min-height: calc(100vh - 48px - 26px); }
.chat-page .composer-dock { padding: 14px 0 16px; }
@media (max-width: 820px) { .inline-card { margin-left: 0; max-width: 100%; } }

/* ---------- промокоды ---------- */
.dialog.wide { width: min(540px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; }
.dialog .field .row { gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.chip.on { background: var(--selection); color: var(--text); }
.promo-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.promo-tools .input { width: min(280px, 100%); }
.promo-code { display: flex; align-items: center; gap: 4px; }
.promo-code code { font-family: var(--font-mono); font-size: 13px; letter-spacing: .02em; }
.btn.icon.xs { width: 24px; height: 24px; min-height: 24px; padding: 0; }
.promo-table tr.dim td > *:not(:last-child) { opacity: .6; }
.promo-table td.nowrap { white-space: nowrap; }
.promo-table .btn.on { color: var(--info); }
.btn.danger-hover:hover { color: var(--bad); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--text); cursor: pointer; border-bottom: 1px dashed var(--line-strong); }
.link-btn:hover { color: var(--accent); border-color: currentColor; }
td.center { text-align: center; padding: 26px 10px; }
.promo-fresh { margin-bottom: 16px; border: 1px solid var(--ok-soft); }
.promo-codes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.promo-codes code { font-family: var(--font-mono); font-size: 14px; padding: 6px 10px; border-radius: var(--r-sm); background: var(--surface-2); user-select: all; }
.promo-history { max-height: 50vh; overflow: auto; }
.promo-history .who { display: flex; flex-direction: column; line-height: 1.25; }

/* ввод промокода на странице «Подписка» */
.promo-card { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; flex-wrap: wrap; }
.promo-card .promo-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.promo-card .promo-txt { flex: 1; min-width: 200px; }
.promo-card .promo-txt b { display: block; margin-bottom: 2px; }
.promo-card form { display: flex; gap: 8px; flex: 0 1 380px; }
.promo-card form .input { flex: 1; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .03em; }
.promo-card form .input::placeholder { font-family: var(--font-ui); text-transform: none; letter-spacing: 0; }
.plan-until { font-size: 12px; color: var(--muted); }
[hidden] { display: none !important; }
.chip.on, .chip.on:hover { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-line); }
.page-head > div:first-child { flex: 1 1 420px; max-width: 760px; }

/* ---------- хранилище ---------- */
.storage-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; margin-bottom: 18px; }
.storage-card.full { box-shadow: inset 0 0 0 1px var(--bad-soft), var(--shadow, none); }
.storage-note { display: flex; gap: 7px; align-items: flex-start; margin: 10px 0 0; }
.storage-note svg { flex: none; margin-top: 2px; }
.storage-warn { color: var(--bad); margin: 8px 0 0; }
.storage-list { display: flex; flex-direction: column; gap: 4px; }
.storage-list > .muted { margin-bottom: 4px; }
.storage-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px 64px; align-items: center; gap: 12px; padding: 5px 8px; margin: 0 -8px;
  border-radius: var(--r-sm); color: var(--text); font-size: 13.5px; }
.storage-row:hover { background: var(--generic); text-decoration: none; }
.storage-row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.storage-row .bar { height: 4px; border-radius: 4px; background: var(--generic); overflow: hidden; }
.storage-row .bar i { display: block; height: 100%; background: var(--text-2); border-radius: 4px; }
.storage-row .sz { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12.5px; }
@media (max-width: 1000px) { .storage-card { grid-template-columns: 1fr; } }

/* ---------- скачать приложение ---------- */
.a-download { margin-bottom: 6px; }
.dl-hero { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 24px; align-items: center; padding: 30px 32px; margin-bottom: 18px; overflow: hidden; }
.dl-brand { gap: 12px; margin-bottom: 10px; }
.dl-brand .display { font-size: 28px; font-weight: 600; letter-spacing: -.015em; }
.dl-hero p { max-width: 620px; margin: 0 0 16px; }
.dl-points { list-style: none; padding: 0; margin: 0 0 22px; display: flex; flex-direction: column; gap: 9px; font-size: 14px; }
.dl-points li { display: flex; gap: 10px; align-items: flex-start; } .dl-points svg { flex: none; margin-top: 2px; color: var(--accent); }
.dl-cta { gap: 14px; flex-wrap: wrap; }
.btn.lg { height: 42px; padding: 0 20px; font-size: 15px; gap: 9px; }
.dl-art { display: grid; place-items: center; color: var(--text); opacity: .9; }
.dl-art svg { filter: drop-shadow(0 18px 30px #00000022); }
.dl-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.dl-card { display: flex; flex-direction: column; gap: 8px; padding: 20px; }
.dl-card p { margin: 0; }
.dl-card.mine { box-shadow: inset 0 0 0 1px var(--accent-line), var(--float); }
.dl-card.soon .dl-glyph { opacity: .55; }
.dl-glyph { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--text); }
.dl-glyph svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.dl-name { font-size: 16px; font-weight: 600; }
.dl-meta { min-height: 18px; }
.dl-foot { margin-top: auto; padding-top: 8px; }
.dl-admin { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; padding-top: 12px; border-top: 1px dashed var(--line); }
.dl-admin .row { gap: 6px; flex-wrap: wrap; }
.dl-file { display: none; }
.dl-progress { height: 4px; }
.dl-progress > i { background: var(--accent); transition: width .2s; }
.dl-steps > summary { display: flex; align-items: center; justify-content: space-between; cursor: pointer; list-style: none; }
.dl-steps > summary::-webkit-details-marker { display: none; }
.dl-steps[open] > summary svg { transform: rotate(180deg); }
.dl-steps ol { margin: 14px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.55; }
@media (max-width: 1000px) { .dl-grid { grid-template-columns: 1fr; } .dl-hero { grid-template-columns: 1fr; } .dl-art { display: none; } }

/* ---------- язык ---------- */
.lang-select { display: flex; align-items: center; gap: 8px; }
.lang-select .lang-ic { display: grid; place-items: center; color: var(--text-2); flex: none; }
.lang-select .select { min-width: 200px; }
.lang-select.compact .select { min-width: 0; flex: 1; }
.appearance .lang-select { margin-top: 2px; }
.auth-form { position: relative; }
.auth-lang { position: absolute; top: 20px; right: 24px; width: 230px; }
.appearance .seg + h4 { margin-top: 14px; }
.kpi-cache { font-size: 12px; color: var(--ok); }

/* ---------- цены ---------- */
.plans-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 14px; flex-wrap: wrap; }
.plans-head h2 { margin: 0; font-family: var(--font-display); font-size: 22px; }
.segmented.billing .save { margin-left: 6px; font-size: 11px; font-weight: 600; color: var(--ok); }
.plan-price-wrap { margin: 14px 0 6px; }
.plan-price-wrap .plan-price { margin: 0; display: flex; align-items: baseline; gap: 2px; flex-wrap: wrap; }
.plan-price .per { font-family: var(--font-ui); font-size: 14px; font-weight: 400; color: var(--muted); }
.plan-price .old { font-family: var(--font-ui); font-size: 15px; font-weight: 400; color: var(--muted); margin-left: 10px; }
.plan-price-sub { display: flex; align-items: center; gap: 8px; min-height: 22px; font-size: 13px; color: var(--muted); }
.plan-price-sub.disc { color: var(--ok); }
.discount-card { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; border: 1px solid var(--ok-soft); }
.discount-card > div { flex: 1; }
.discount-card .promo-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); flex: none; }
.discount-card .disc-code { font-family: var(--font-mono); font-size: 13px; padding: 4px 8px; border-radius: var(--r-sm); background: var(--surface-2); }
.disc-cell { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.promo-fields { display: flex; flex-direction: column; gap: 12px; }

/* ---------- «Эксперт»: модели и замена агентов ---------- */
.acard-model { font-size: 11px; letter-spacing: .01em; }
.acard-swap { display: grid; place-items: center; width: 26px; height: 26px; margin-left: 2px; border-radius: 8px; color: var(--text-2); flex: none;
  cursor: pointer; transition: background .15s, color .15s; }
.acard-swap:hover, .acard-swap:focus-visible { background: var(--generic); color: var(--text); outline: none; }
.acard-swap[hidden] { display: none; }
.model-chip { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; margin: 3px 0 2px; border-radius: 6px; font-size: 11.5px;
  color: var(--text-2); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.tasks li .swap-btn { align-self: center; flex: none; }
.pinned-why { color: var(--accent) !important; }
.team-picker { position: fixed; z-index: 70; width: 320px; max-height: min(440px, 70vh); display: flex; flex-direction: column; gap: 8px; padding: 12px;
  border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--float); animation: popup .18s var(--ease); }
.tp-head { display: flex; flex-direction: column; gap: 2px; padding: 0 4px; }
.tp-list { display: flex; flex-direction: column; gap: 1px; overflow: auto; margin: 0 -4px; padding: 0 4px; }
.tp-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; border-radius: var(--r-sm); background: none;
  color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.tp-item:hover { background: var(--generic); }
.tp-item.on { background: var(--selection); }
.tp-item svg:last-child { color: var(--ok); flex: none; }
.tp-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.tp-text b { font-weight: 500; font-size: 14px; }
.tp-tier { font-size: 11px; padding: 1px 6px; border-radius: 99px; background: var(--generic); color: var(--text-2); flex: none; }
.tp-tier.strong { background: var(--accent-soft); color: var(--accent); }

/* ---------- провайдеры: несколько ключей ---------- */
.providers-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 14px; align-items: start; }
.provider .head .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.key-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.provider::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 70px; background-image: var(--pattern); opacity: .45; pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 35%, #000); mask-image: linear-gradient(90deg, transparent 35%, #000); }
.provider > * { position: relative; }
.provider .head .btn.icon { flex: none; }
.provider .key { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.key-list { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 4px; }
.key-row { display: flex; align-items: flex-start; gap: 8px; padding: 8px 6px 8px 10px; border-radius: var(--r-sm); background: var(--surface-2); }
.key-row.off { opacity: .55; }
.key-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.key-name { font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.key-name .mono { font-weight: 400; font-size: 12px; }
.key-share { height: 3px; border-radius: 3px; background: var(--generic); overflow: hidden; }
.key-share i { display: block; height: 100%; background: var(--c); border-radius: 3px; transition: width .5s var(--ease); }
.key-err { color: var(--bad); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.key-actions { display: flex; align-items: center; gap: 2px; flex: none; }
.switch.sm { transform: scale(.82); }
.key-add { display: flex; flex-direction: column; gap: 6px; }
.key-add .key-label { width: 100%; }
.colors .swatch[class*="c-"] { --sw: var(--c); width: 28px; height: 28px; }

/* аудио в результате проекта */
.audio-list { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 12px; }
.audio-item { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: var(--r-sm); background: var(--surface-2); }
.audio-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audio-item audio, .audio-view audio { height: 36px; max-width: 100%; }
.audio-item audio { width: 320px; }
.audio-view { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.audio-view audio { width: 100%; }

/* Linux: несколько форматов в одной карточке — столбиком */
.dl-formats { display: flex; flex-direction: column; gap: 6px; }
.dl-formats .btn { width: 100%; justify-content: flex-start; gap: 8px; }
.dl-formats .btn > span { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.dl-sub { font-size: 12px; color: var(--t3); font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn.primary .dl-sub { color: inherit; opacity: .7; }
.dl-steps code { font-size: 12.5px; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
