/* © 2026 Nikita Odintsov (Никита Одинцов). Creator and rights holder / создатель и правообладатель. All rights reserved. */
/* Light theme (owner 24.10): neutral white and light grey like the Claude app, the cream was too heavy; terracotta
   stays for accents only. */
/* ATHEYA design 2026-10-24 (owner's approved prototype, docs/design/atheya-2026-10-24): stage 1 — palette, type,
   controls. Loads after every other stylesheet and only re-points the existing tokens, so removing this one link
   brings the previous look back. */

:root, html[data-resolved-theme="light"], html[data-theme="light"], html[data-theme="system"] {
  --bg: #FFFFFF;
  --shell: #F7F7F5;
  --surface: #FFFFFF;
  --card: #FFFFFF;
  --hover: #EEEDEA;
  --accent: #B4532F;
  --accent-hover: #7A3420;
  --text: #1F1E1D;
  --text-soft: #3D3B38;
  --muted: #6F6C67;
  --tint: #B4532F;
  --border: rgba(31, 30, 29, 0.10);
  --border-soft: rgba(31, 30, 29, 0.06);
  --danger: #B03A2B;
  --ok: #3D7443;
  --warning: #8F6210;
  --ws-ok: #3D7443;
  --ws-warn: #8F6210;
  --ws-err: #B03A2B;
  --ws-primary: #B4532F;
  --ws-radius: 20px;
  --ws-radius-sm: 12px;
  --radius-lg: 20px;
  --nav-fg: #2B2A28;
  --nav-icon: #6F6C67;
  --input: #FFFFFF;
  --cyan-glow: rgba(180, 83, 47, 0.32);
  --ath-btn: #B4532F;
  --ath-btn-tx: #FBF7F0;
  --ath-acc-soft: rgba(180, 83, 47, 0.07);
  --ath-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .06);
  color-scheme: light;
}
html[data-resolved-theme="dark"], html[data-resolved-theme="dark"][data-theme] {
  --bg: #0B0A0A;
  --shell: #141312;
  --surface: #1A1918;
  --card: #1A1918;
  --hover: #232121;
  --accent: #C96442;
  --accent-hover: #F0A27F;
  --text: #FBF7F0;
  --text-soft: #E9DCCB;
  --muted: #A8A29A;
  --tint: #F0A27F;
  --border: rgba(251, 247, 240, 0.08);
  --border-soft: rgba(251, 247, 240, 0.06);
  --danger: #E08576;
  --ok: #8DB38A;
  --warning: #D9AE62;
  --ws-ok: #8DB38A;
  --ws-warn: #D9AE62;
  --ws-err: #E08576;
  --ws-primary: #B4532F;
  --nav-fg: #E9DCCB;
  --nav-icon: #A8A29A;
  --input: #141312;
  --cyan-glow: rgba(201, 100, 66, 0.38);
  --ath-btn: #B4532F;
  --ath-btn-tx: #FBF7F0;
  --ath-acc-soft: rgba(201, 100, 66, 0.14);
  --ath-shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 16px 40px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

/* Onest (SIL OFL 1.1, fonts/Onest-OFL.txt), served from this portal so it works offline. */
/* cyrillic-ext */
@font-face { font-family: Onest; font-style: normal; font-weight: 400 600; font-display: swap; src: url(/static/fonts/onest-cyrillic-ext.woff2) format("woff2"); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
/* cyrillic */
@font-face { font-family: Onest; font-style: normal; font-weight: 400 600; font-display: swap; src: url(/static/fonts/onest-cyrillic.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
/* latin-ext */
@font-face { font-family: Onest; font-style: normal; font-weight: 400 600; font-display: swap; src: url(/static/fonts/onest-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
/* latin */
@font-face { font-family: Onest; font-style: normal; font-weight: 400 600; font-display: swap; src: url(/static/fonts/onest-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Type: Onest, served with the portal, otherwise the system face (SF Pro on Apple devices). */
html body, html body button, html body input, html body textarea, html body select {
  font-family: Onest, "SF Pro Text", -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Primary action: #B4532F with ivory text (contrast ≥ 4.5:1 in both themes). */
html body .ws-primary, html[data-resolved-theme="dark"] .ws-primary, html body .primary-button, html body button.primary {
  background: var(--ath-btn) !important;
  border-color: var(--ath-btn) !important;
  color: var(--ath-btn-tx) !important;
  border-radius: 14px;
}
html body .ws-primary:hover:not(:disabled), html body .primary-button:hover:not(:disabled) { filter: brightness(1.08); }
html body .ws-primary:disabled { opacity: .55; }

/* Quiet secondary controls: hairline, rounded, no fill. */
html body .ws-btn { border-radius: 12px; border-color: var(--border); }

/* Active navigation row: the soft accent wash of the prototype. */
html body .nav-item.active { background: var(--ath-acc-soft) !important; color: var(--text) !important; }
html body .nav-item.active .nav-icon { color: var(--accent) !important; }

/* Cards and sheets: calm depth instead of borders only. */
html body .nv-summary, html body .nv-card, html body .ws-card { border-radius: 20px; }

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Stage 2: phone tab bar (atheya-mobile.js) ---------- */
#ath-tabbar { display: none; }
@media (max-width: 760px) {
  #ath-tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--shell) 84%, transparent);
    -webkit-backdrop-filter: blur(24px) saturate(1.2); backdrop-filter: blur(24px) saturate(1.2);
    border-top: 1px solid var(--border);
  }
  #ath-tabbar button {
    flex: 1 1 0; min-width: 0; min-height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    border: 0; background: none; color: var(--muted); font-size: 10.5px; line-height: 1.2; letter-spacing: .01em; cursor: pointer;
    -webkit-tap-highlight-color: transparent; transition: color .15s cubic-bezier(.2, .8, .2, 1);
  }
  #ath-tabbar button[hidden] { display: none; }
  #ath-tabbar svg { width: 24px; height: 24px; }
  #ath-tabbar button.on { color: var(--accent); }
  #ath-tabbar button.on svg { fill: var(--ath-acc-soft); }
  #ath-tabbar span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* The tab bar replaces the menu button; the composer and pages sit above it. */
  body.ath-has-tabbar #open-sidebar-button { display: none !important; }
  body.ath-has-tabbar .composer-shell { bottom: calc(60px + env(safe-area-inset-bottom)) !important; }
  body.ath-has-tabbar .app > .chat { box-sizing: border-box; padding-bottom: calc(60px + env(safe-area-inset-bottom)) !important; }
  /* Export buttons live in «Ещё» on the phone; the top bar keeps the title and the main actions only. */
  body.ath-has-tabbar .topbar [id^="export-chat-"], body.ath-has-tabbar #import-chat-button { display: none !important; }
  body.ath-has-tabbar .view-panel, body.ath-has-tabbar .page { padding-bottom: calc(84px + env(safe-area-inset-bottom)) !important; }
  body.ath-has-tabbar .sidebar { z-index: 70; }
}

/* ---------- Owner's phone check 24.10 ---------- */
/* Old cyan accents left in shared rules (secondary buttons on cards). */
html body .view-card button, html body .view-card-link, html body .compact {
  border: 1px solid var(--border) !important; background: var(--ath-acc-soft) !important; color: var(--accent) !important;
  border-radius: 12px; font-weight: 600; box-shadow: none !important;
}
html body .view-card button:hover, html body .view-card-link:hover { border-color: var(--accent) !important; }
/* Group tabs (Боты · Доска задач · Цены, Результаты · Файлы): one quiet segmented row. */
html body .ng-tabs { background: var(--bg); border-bottom: 1px solid var(--border); }
html body .ng-tabs button { border-radius: 10px; }
html body .ng-tabs button.active { background: var(--ath-acc-soft); color: var(--text); }

@media (max-width: 760px) {
  /* The web app runs under the iPhone status bar (black-translucent): the top bar starts below it, otherwise iOS
     blurs the title. shell.css set a flat padding that dropped the safe area. */
  html body .topbar {
    padding-top: env(safe-area-inset-top) !important;
    min-height: calc(52px + env(safe-area-inset-top)) !important;
    background: color-mix(in srgb, var(--bg) 88%, transparent) !important;
  }
  /* The twelve settings links duplicate «Ещё» on the phone. */
  body.ath-has-tabbar #settings-tabs { display: none !important; }
  /* Помощники: the bot list is a compact strip above the chat, not half the screen. */
  html body .bc-side { max-height: none; }
  html body .bc-chief { flex-direction: row; margin: 2px 14px 6px; padding: 8px 12px; gap: 10px; justify-content: flex-start; width: calc(100% - 28px); }
  html body .bc-chief svg, html body .bc-chief img, html body .bc-chief .bc-avatar { width: 32px !important; height: 32px !important; }
  html body .bc-list { flex-direction: row; overflow-x: auto; padding: 0 14px; gap: 6px; scrollbar-width: none; }
  html body .bc-list .bc-item { width: auto; flex: none; max-width: 70vw; }
  html body .bc-empty { padding: 2px 0 6px; text-align: left; font-size: 12.5px; }
  html body .bc-side-foot { display: flex; gap: 8px; overflow-x: auto; padding: 6px 14px 12px; scrollbar-width: none; }
  html body .bc-side-foot .bc-market { width: auto; flex: none; padding: 8px 14px; font-weight: 500; }
}

/* ---------- Stage 3: the empty chat is the ATHEYA Simple home (app.js homeScreenHtml) ---------- */
html body .empty-chat.ath-home {
  display: flex; flex-direction: column; align-items: stretch; text-align: left; gap: 0;
  max-width: 640px; margin: clamp(24px, 9vh, 96px) auto 24px; padding: 0 4px; min-height: 0;
}
html body .ath-home h1 {
  margin: 0; font-size: clamp(32px, 6vw, 44px); line-height: 1.08; letter-spacing: -.035em; font-weight: 500; color: var(--text);
}
html body .ath-home .ath-home-private {
  display: flex; align-items: center; gap: 6px; margin: 10px 0 26px; font-size: 13px; color: var(--muted);
}
.ath-home-private svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.4; flex: none; }
.ath-home-prompts { display: flex; flex-direction: column; gap: 8px; }
html body .ath-home-prompts button {
  display: flex; align-items: center; width: 100%; min-height: 48px; padding: 12px 16px; gap: 10px;
  border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text);
  font: inherit; font-size: 15px; text-align: left; cursor: pointer; box-shadow: none;
  transition: border-color .15s cubic-bezier(.2, .8, .2, 1), background .15s cubic-bezier(.2, .8, .2, 1);
}
html body .ath-home-prompts button::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; opacity: .85;
}
html body .ath-home-prompts button:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: var(--ath-acc-soft); }
.ath-home-recent { display: flex; flex-direction: column; margin-top: 28px; }
.ath-home-recent > span { font-size: 12.5px; color: var(--muted); padding: 0 2px 6px; }
html body .ath-home-recent button {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px; width: 100%; min-height: 48px;
  padding: 12px 2px; border: 0; border-top: 1px solid var(--border); border-radius: 0; background: none;
  color: var(--text); font: inherit; font-size: 15px; text-align: left; cursor: pointer;
}
.ath-home-recent button span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ath-home-recent button small { flex: none; font-size: 12.5px; color: var(--muted); }
html body .ath-home .studio-starters { margin-top: 28px; }
@media (max-width: 760px) {
  html body .ath-home .studio-starters { display: none; }
  html body .empty-chat.ath-home { margin-top: 28px; padding: 0 6px; }
}

/* ---------- Stage 4: chat — the person's message in a quiet bubble, ATHEYA's answer as plain text ---------- */
html body .message.user .message-card {
  background: var(--hover) !important; border: 0 !important; box-shadow: none !important;
  border-radius: 20px 20px 6px 20px !important; color: var(--text) !important;
}
html body .message.assistant .message-card {
  background: transparent !important; border: 0 !important; box-shadow: none !important; padding-left: 0 !important; padding-right: 0 !important;
}
html body .message .message-meta { color: var(--muted); font-size: 12px; letter-spacing: .01em; }
html body .message-body { font-size: 15.5px; line-height: 1.6; }
html body .message-export button {
  border: 1px solid var(--border) !important; background: transparent !important; color: var(--muted) !important;
  border-radius: 999px !important; font-size: 12px !important; padding: 4px 10px !important; box-shadow: none !important;
}
html body .message-export button:hover { color: var(--accent) !important; border-color: var(--accent) !important; }
/* Composer: one calm rounded field, the send button in the accent. */
html body .composer { border-radius: 22px !important; border: 1px solid var(--border) !important; background: var(--surface) !important; box-shadow: var(--ath-shadow) !important; }
html body #send-button, html body .composer .send-button {
  background: var(--ath-btn) !important; color: var(--ath-btn-tx) !important; border-color: var(--ath-btn) !important; border-radius: 50% !important;
}

/* ---------- Owner 24.10: the menu reads like a working app — larger type, more air ---------- */
@media (min-width: 761px) {
  :root { --sidebar: 268px; }
  html body .sidebar { width: 268px; padding: 12px 10px !important; }
  html body .nav-stack .nav-item { height: 38px; gap: 11px; padding: 0 10px !important; border-radius: 10px !important; font-size: 15px !important; }
  html body .nav-stack .nav-item .nav-icon, html body .nav-stack .nav-item .nav-icon svg { width: 18px; height: 18px; }
  html body .history .section-label { font-size: 13px; padding: 6px 10px; }
  html body .history-row, html body .history-item { min-height: 36px !important; padding: 7px 10px !important; border-radius: 10px !important; font-size: 14.5px !important; }
  html body .history-model { font-size: 11.5px !important; }
  .shell-user strong { font-size: 14px; }
  .shell-user small { font-size: 12px; }
  html body .topbar { font-size: 14px; }
}
html body .empty-chat.ath-home { width: 100%; margin-left: auto !important; margin-right: auto !important; align-self: center; }
html body .sidebar .sidebar-head, html body .sidebar .brand { background: transparent !important; }

/* =====================================================================================================
   Redesign v2 (owner 24.10, docs/design/atheya-2026-10-24-v2) — skeleton built by atheya-v2.js.
   ===================================================================================================== */
/* Top bar: the chat's name, the privacy line, one «Экспорт» menu */
body.v2 .chat > .topbar .topbar-title, body.v2 .chat > .topbar .topbar-actions, body.v2 #studio-command-button,
body.v2 .chat > .topbar > .top-action:not(#back-to-chat-button), body.v2 #settings-top-button { display: none !important; }
body.v2 .chat > .topbar { display: flex !important; align-items: center; gap: 12px; min-height: 56px; border-bottom: 1px solid var(--border) !important; }
.v2-title { display: flex; flex-direction: column; min-width: 0; margin-right: auto; }
.v2-title strong { font-size: 15px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52vw; }
.v2-private { display: none; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); }
body.v2-in-chat .v2-private { display: inline-flex; }
body.v2:not(.v2-owner) #shell-model, body.v2:not(.v2-owner) .shell-more { display: none !important; }
body.v2 #shell-model { order: 2; font-size: 13px; color: var(--muted); }
.v2-export { position: relative; }
.v2-exp-btn { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text-soft); font: inherit; font-size: 13.5px; cursor: pointer; }
.v2-exp-btn:hover { background: var(--hover); }
body.v2:not(.v2-in-chat) .v2-export { display: none; }
.v2-exp-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 170px; padding: 5px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--ath-shadow); display: flex; flex-direction: column; }
.v2-exp-pop[hidden] { display: none; }
.v2-exp-pop button { text-align: left; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.v2-exp-pop button:hover { background: var(--hover); }

/* Composer: «+», «⋯» and chips of what is on */
html body .composer-shell.cx .cx-more { font-size: 18px !important; letter-spacing: 1px; }
.cx-chips { display: flex; align-items: center; gap: 6px; margin-left: 4px; min-width: 0; }
html body .composer-shell.cx .cx-bar .cx-chip { display: inline-flex !important; align-items: center; gap: 6px; height: 26px; padding: 0 8px 0 10px !important; border-radius: 999px !important; background: var(--ath-acc-soft) !important; color: var(--accent) !important; font-size: 13px !important; }
.cx-chip b { font-weight: 400; opacity: .7; }
body.v2:not(.v2-owner) .chat-status-line { display: none !important; }

/* «Управление» overview */
.v2-manage-page { padding: 32px clamp(16px, 4vw, 48px) 64px !important; }
.v2-mhead h1 { margin: 0; font-size: 28px; font-weight: 600; letter-spacing: -.02em; }
.v2-mhead p { margin: 6px 0 24px; color: var(--muted); font-size: 14px; }
.v2-mgrid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; max-width: 1240px; }
.v2-status { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); font-size: 14px; }
.v2-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.v2-status i.bad { background: var(--danger); }
.v2-status strong { font-weight: 500; margin-right: auto; }
.v2-link { border: 0; background: none; color: var(--accent); font: inherit; font-size: 13.5px; cursor: pointer; padding: 4px 6px; border-radius: 8px; }
.v2-link:hover { background: var(--ath-acc-soft); }
.v2-link:disabled { color: var(--muted); cursor: default; background: none; }
.v2-tgroup { margin: 22px 0 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.v2-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.v2-tile { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); font: inherit; text-align: left; text-decoration: none; cursor: pointer; min-height: 76px; }
.v2-tile:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.v2-tile strong { font-size: 15px; font-weight: 600; }
.v2-tile span { font-size: 13px; color: var(--muted); line-height: 1.35; }
.v2-laws { padding: 16px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.v2-laws-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.v2-laws-head strong { font-size: 15px; font-weight: 600; }
.v2-btn { height: 32px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.v2-btn:disabled { color: var(--muted); cursor: default; }
.v2-law { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.v2-law > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.v2-law strong { font-size: 14px; font-weight: 500; }
.v2-law span { font-size: 12.5px; color: var(--muted); }
.v2-law span.bad { color: var(--danger); }
.v2-bar { height: 3px; margin-top: 6px; border-radius: 999px; background: var(--hover); overflow: hidden; }
.v2-bar i { display: block; height: 100%; background: var(--accent); }
@media (max-width: 980px) { .v2-mgrid { grid-template-columns: 1fr; } }

/* Settings-tabs cloud: «Документы» has its own tabs now (navgroups.js), so the old cloud is not shown anywhere */
body.v2 #settings-tabs { display: none !important; }

@media (max-width: 760px) {
  body.v2 .chat > .topbar { min-height: calc(52px + env(safe-area-inset-top)) !important; gap: 8px; }
  .v2-title { align-items: center; margin: 0 auto; }
  .v2-title strong { max-width: 60vw; font-size: 15px; }
  body.v2 .v2-export { display: none; }
}
/* v2 polish after the stand check */
body.v2 .chat > .topbar .v2-title { order: 0; margin-right: 0; }
body.v2 .chat > .topbar #shell-model { order: 1; margin-right: auto; }
body.v2 .chat > .topbar .shell-top-actions { order: 3; }
body.v2 .chat > .topbar #companion-open { order: 4; }
body.v2:not(.v2-owner) .chat > .topbar .v2-title { margin-right: auto; }
.v2-laws-head .v2-btn { white-space: nowrap; }
/* Page heads: calm 28 px titles, no shouting eyebrows */
body.v2 .view-head h1 { font-size: clamp(24px, 3vw, 30px) !important; letter-spacing: -.02em !important; font-weight: 600 !important; line-height: 1.15 !important; }
body.v2 .view-head .eyebrow { display: none !important; }
body.v2 .view-head p { font-size: 14.5px !important; max-width: 640px; }
@media (max-width: 760px) {
  body.v2 .chat > .topbar { flex-wrap: nowrap !important; display: flex !important; grid-template-columns: none !important; }
  body.v2 .chat > .topbar #shell-model, body.v2 .chat > .topbar #companion-open { display: none !important; }
  body.v2 .v2-title { flex: 1; min-width: 0; }
  body.v2 .message-body table { display: block; overflow-x: auto; max-width: 100%; }
}

/* ---------- Redesign v2, stage 2: chat ---------- */
body.v2 .message-body table { border-collapse: separate !important; border-spacing: 0; border: 1px solid var(--border) !important; border-radius: 14px !important; overflow: hidden; font-size: 15px; line-height: 22px; margin: 6px 0 !important; }
body.v2 .message-body th { background: var(--shell) !important; color: var(--text-soft) !important; font-weight: 600 !important; font-size: 14px; border: 0 !important; padding: 10px 14px !important; text-align: left; }
body.v2 .message-body td { border: 0 !important; border-top: 1px solid var(--border) !important; padding: 10px 14px !important; background: transparent !important; }
body.v2 .message-body td[data-level="bad"] { color: var(--danger); font-weight: 500; }
body.v2 .message-body td[data-level="warn"] { color: var(--warning); font-weight: 500; }
body.v2 .message-body td[data-level="ok"] { color: var(--ok); font-weight: 500; }
body.v2 .message-export { display: flex; align-items: center; gap: 2px; margin: 6px 0 0 -8px; }
html body.v2 .message-export button { height: 32px; padding: 0 10px !important; border: 0 !important; border-radius: 10px !important; background: transparent !important; color: var(--muted) !important; font-size: 14px !important; }
html body.v2 .message-export button:hover { background: var(--hover) !important; color: var(--text) !important; }
html body.v2 .message-export .v2-copy { width: 32px; padding: 0 !important; display: inline-grid; place-items: center; }
html body.v2 .message-export .v2-copy.done { color: var(--ok) !important; }
/* File card */
body.v2 .artifact-card { border: 1px solid var(--border) !important; border-radius: 16px !important; background: var(--surface) !important; padding: 10px 10px 10px 12px !important; max-width: 460px; box-shadow: none !important; }
body.v2 .artifact-head { display: flex !important; align-items: center; gap: 12px; }
body.v2 .artifact-head > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
body.v2 .artifact-head strong { font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.v2 .artifact-head span:not(.artifact-badge) { font-size: 13px; color: var(--muted); }
.artifact-badge { flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 12px; font-weight: 600; letter-spacing: .02em; background: var(--hover); color: var(--text-soft); }
.artifact-badge[data-ext^="xls"], .artifact-badge[data-ext="csv"] { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.artifact-badge[data-ext="pdf"] { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.artifact-badge[data-ext^="doc"], .artifact-badge[data-ext="rtf"], .artifact-badge[data-ext^="ppt"] { background: var(--ath-acc-soft); color: var(--accent); }
html body.v2 .artifact-download { height: 34px; padding: 0 12px !important; border: 1px solid var(--border) !important; border-radius: 10px !important; background: var(--surface) !important; color: var(--text) !important; font-size: 14px !important; box-shadow: none !important; }
/* Microphone */
html body .composer-shell.cx .cx-bar .v2-mic.rec { color: var(--danger) !important; background: color-mix(in srgb, var(--danger) 10%, transparent) !important; }
html body .composer-shell.cx .cx-bar .v2-mic.busy { opacity: .5; }
body.v2 .message-table-wrap { border: 0 !important; border-radius: 0 !important; background: none !important; box-shadow: none !important; padding: 0 !important; overflow-x: auto; }
html body.v2 .message-body td[data-level="bad"] { color: var(--danger) !important; font-weight: 500 !important; }
html body.v2 .message-body td[data-level="warn"] { color: var(--warning) !important; font-weight: 500 !important; }
html body.v2 .message-body td[data-level="ok"] { color: var(--ok) !important; font-weight: 500 !important; }

/* ---------- Redesign v2, stage 3: Ai Private Review ---------- */
body.v2 #navigator-view { --nv-red: var(--danger); --nv-orange: var(--warning); --nv-green: var(--ok); }
body.v2 .nv-head h1 { font-size: clamp(24px, 3vw, 30px) !important; font-weight: 600; letter-spacing: -.02em; }
body.v2 .nv-head p { color: var(--muted); font-size: 14.5px; }
body.v2 .nv-title h2 { font-size: 24px; font-weight: 600; letter-spacing: -.015em; }
/* list */
body.v2 .nv-card { border-radius: 16px; background: var(--surface); padding: 16px 18px; gap: 8px; }
body.v2 .nv-card:hover { background: var(--surface); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
body.v2 .nv-card-title { font-size: 16px; }
body.v2 .nv-dot { color: inherit !important; background: transparent !important; padding: 2px 8px; font-weight: 500; font-size: 12.5px; }
body.v2 .nv-dot.red { background: color-mix(in srgb, var(--danger) 12%, transparent) !important; color: var(--danger) !important; }
body.v2 .nv-dot.orange { background: color-mix(in srgb, var(--warning) 14%, transparent) !important; color: var(--warning) !important; }
body.v2 .nv-dot.green { background: color-mix(in srgb, var(--ok) 13%, transparent) !important; color: var(--ok) !important; }
/* result: the answer first */
.nv-v2-top { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0 10px; }
.nv-v2-sum { padding: 14px 16px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.nv-v2-sum span { font-size: 12.5px; color: var(--muted); }
.nv-v2-sum p { margin: 4px 0 0; font-size: 15px; font-weight: 500; line-height: 1.45; }
.nv-v2-tile { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 14px 16px; border-radius: 16px; }
.nv-v2-tile b { font-size: 28px; font-weight: 600; line-height: 1; }
.nv-v2-tile span { font-size: 13px; color: var(--text-soft); }
.nv-v2-tile.red { background: color-mix(in srgb, var(--danger) 9%, transparent); } .nv-v2-tile.red b { color: var(--danger); }
.nv-v2-tile.orange { background: color-mix(in srgb, var(--warning) 11%, transparent); } .nv-v2-tile.orange b { color: var(--warning); }
.nv-v2-tile.green { background: color-mix(in srgb, var(--ok) 10%, transparent); } .nv-v2-tile.green b { color: var(--ok); }
.nv-v2-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.nv-v2-actions .nv-hint { margin-right: auto; }
.nv-v2-how { margin-top: 10px; }
.nv-v2-how > summary { cursor: pointer; color: var(--muted); font-size: 13.5px; }
/* tabs: underline, not pills */
body.v2 .nv-tabs { gap: 2px; border-bottom: 1px solid var(--border); margin: 18px 0 8px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
body.v2 .nv-tabs button { border: 0 !important; border-radius: 0 !important; background: none !important; color: var(--muted) !important; padding: 10px 12px !important; font-size: 14px !important; white-space: nowrap; border-bottom: 2px solid transparent !important; margin-bottom: -1px; }
body.v2 .nv-tabs button[aria-selected="true"] { color: var(--text) !important; border-bottom-color: var(--accent) !important; font-weight: 500; }
/* risks: rows, the level as a coloured word */
body.v2 .nv-risks { display: flex; flex-direction: column; gap: 0; }
body.v2 .nv-risk { border: 0 !important; border-bottom: 1px solid var(--border) !important; border-radius: 0 !important; background: transparent !important; padding: 14px 4px !important; }
body.v2 .nv-badge { background: transparent !important; color: var(--ok) !important; padding: 0 !important; font-size: 13px !important; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
body.v2 .nv-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
body.v2 .nv-badge.nv-red { color: var(--danger) !important; } body.v2 .nv-badge.nv-orange { color: var(--warning) !important; }
body.v2 .nv-badge.nv-recon { color: var(--accent) !important; }
body.v2 .nv-risk h4 { font-size: 15px; font-weight: 500; }
body.v2 .nv-when { font-size: 13px; color: var(--muted); }
body.v2 .nv-basis { color: var(--muted); font-size: 13px !important; }
body.v2 .nv-summary { border-radius: 16px !important; background: var(--surface) !important; }
body.v2 .nv-progress { border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
body.v2 .nv-bar { border-radius: 999px; }
body.v2 .nv-bar i { background: var(--accent) !important; }
@media (max-width: 760px) {
  .nv-v2-top { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nv-v2-sum { grid-column: 1 / -1; }
  .nv-v2-actions { justify-content: stretch; }
  .nv-v2-actions .nv-hint { width: 100%; }
  .nv-v2-actions button { flex: 1; }
}
@media (max-width: 760px) { body.v2 .nv-head p { display: none; } body.v2 .nv-head h1 { font-size: 22px !important; } }

/* ---------- Redesign v2, stage 5: Ещё · Настройки · Документы · Вход ---------- */
/* «Ещё» (phone) */
.v2-more-page { padding: 20px 16px 96px !important; max-width: 640px; margin: 0 auto; }
.v2-more-page h1 { margin: 6px 0 16px; font-size: 30px; font-weight: 600; letter-spacing: -.02em; }
.v2-me { display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: 12px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.v2-ava { width: 40px; height: 40px; border-radius: 50%; background: var(--hover); display: grid; place-items: center; font-weight: 600; }
.v2-me strong, .v2-card-row strong { display: block; font-size: 16px; font-weight: 500; }
.v2-me small, .v2-card-row small, .v2-li small { display: block; font-size: 13px; color: var(--muted); }
.v2-card { display: flex; flex-direction: column; margin-bottom: 12px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); overflow: hidden; }
.v2-card-row { flex-direction: row; align-items: center; gap: 12px; padding: 14px 16px; width: 100%; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.v2-card-row > span:nth-child(2) { flex: 1; }
.v2-ic { width: 36px; height: 36px; border-radius: 10px; background: var(--ath-acc-soft); color: var(--accent); display: grid; place-items: center; }
.v2-li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 10px 16px; border: 0; border-top: 1px solid var(--border); background: none; color: var(--text); font: inherit; font-size: 16px; text-align: left; cursor: pointer; }
.v2-li:first-child { border-top: 0; }
.v2-li svg { color: var(--muted); flex: none; }
.v2-exit { color: var(--danger); }
.v2-switch { width: 44px; height: 26px; border-radius: 999px; background: var(--hover); position: relative; flex: none; transition: background .2s; }
.v2-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s cubic-bezier(.2,.8,.2,1); }
.v2-switch.on { background: var(--accent); }
.v2-switch.on::after { transform: translateX(18px); }
.v2-foot { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 18px; font-size: 13px; color: var(--muted); }
/* the chat list on the phone: the menu button stays in the chat's top bar */
@media (max-width: 760px) {
  body.v2.ath-has-tabbar.v2-in-chat #open-sidebar-button { display: inline-grid !important; place-items: center; width: 40px; height: 40px; border: 0; background: none; font-size: 20px; color: var(--text); }
}
/* Settings dialog: calm grouped rows */
body.v2 .shell-dialog { border-radius: 24px !important; border: 1px solid var(--border); box-shadow: 0 30px 80px rgba(0,0,0,.18) !important; background: var(--bg) !important; }
body.v2 .shell-dialog-nav { background: var(--shell) !important; }
body.v2 .shell-dialog-nav button, body.v2 .shell-dialog-nav a { font-size: 14.5px !important; border-radius: 10px !important; min-height: 36px; }
body.v2 .shell-dialog-nav button.active { background: var(--hover) !important; font-weight: 500; }
body.v2 .shell-general h2 { font-size: 24px; font-weight: 600; letter-spacing: -.015em; }
body.v2 .shell-general .row { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); padding: 14px 16px; margin-bottom: 8px; }
body.v2 .shell-general .row .t { font-size: 15px; font-weight: 500; }
body.v2 .shell-general .row .d { font-size: 13px; color: var(--muted); }
/* Документы, Память, Файлы: cards like the rest */
body.v2 .view-card { border-radius: 16px !important; background: var(--surface) !important; border: 1px solid var(--border) !important; box-shadow: none !important; }
body.v2 .view-card > span:first-child { text-transform: none !important; letter-spacing: 0 !important; font-size: 12.5px !important; color: var(--muted) !important; }
body.v2 .view-card input, body.v2 .view-card textarea, body.v2 .view-card select { border-radius: 10px !important; }
/* Sign-in */
body:not(.signed-in) .auth-screen { background: var(--bg) !important; }
.auth-card { border-radius: 24px !important; border: 1px solid var(--border) !important; background: var(--surface) !important; box-shadow: var(--ath-shadow) !important; }
.auth-card .brand-mark { border-radius: 50% !important; }
.auth-card .brand strong { letter-spacing: .02em; }
.auth-copy h1 { font-size: 28px !important; font-weight: 600 !important; letter-spacing: -.02em !important; }
.auth-form input { border-radius: 12px !important; min-height: 46px; }
.auth-form .primary { min-height: 48px; border-radius: 14px !important; }
.history-day { padding: 10px 10px 4px; font-size: 12px; font-weight: 500; color: var(--muted); }

/* Folder granted for a bot's task (owner 24.10) */
.bc-folder-pick { position: absolute; right: 24px; bottom: 120px; z-index: 40; width: min(440px, calc(100% - 32px)); padding: 16px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: var(--ath-shadow); display: flex; flex-direction: column; gap: 8px; }
.bc-folder-list { display: flex; flex-direction: column; gap: 4px; max-height: 240px; overflow-y: auto; }
.bc-folder-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.bc-folder-item small { color: var(--muted); font-size: 12px; }
.bc-folder-item:hover { border-color: var(--accent); }
.bc-folder-pick input { padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; font: inherit; background: var(--input); color: var(--text); }
#bc-root.bc { position: relative; }
.bc-plan-folder { margin: 2px 0 6px; font-size: 12.5px; color: var(--muted); }
