/* ═══════════════════════════════════════════════════════════════
   Клуб Volvo 940 — дизайн-система (mobile-first, dark)
   ═══════════════════════════════════════════════════════════════ */
:root {
  --bg: #0d1117;
  --bg-elev: #151b26;
  --bg-panel: #1a2230;
  --bg-hover: #223047;
  --border: #2a3548;
  --border-soft: #20293a;
  --text: #e6edf6;
  --text-dim: #96a3b6;
  --text-faint: #67748a;
  --accent: #4f8cff;
  --accent-soft: rgba(79, 140, 255, .14);
  --accent-2: #34c98e;
  --danger: #ef5566;
  --warn: #f0a93c;
  --radius: 14px;
  --radius-sm: 10px;
  --topbar-h: 60px;
  --bottomnav-h: 64px;
  --shadow: 0 8px 30px rgba(0, 0, 0, .45);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
img { max-width: 100%; }
.hidden { display: none !important; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2c3a52; border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ─── Кнопки ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px;
  border-radius: var(--radius-sm);
  background: var(--bg-hover);
  border: 1px solid var(--border);
  font-weight: 600; font-size: 15px;
  transition: background .15s, transform .05s, border-color .15s;
  user-select: none;
}
.btn:hover { background: #2a3b58; border-color: #3a4c6e; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn-primary { background: var(--accent); border-color: transparent; color: #fff; }
.btn-primary:hover { background: #6ba1ff; }
.btn-ghost { background: transparent; }
.btn-danger { background: rgba(239, 85, 102, .15); border-color: rgba(239, 85, 102, .4); color: #ff8a96; }
.btn-danger:hover { background: rgba(239, 85, 102, .25); }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { min-height: 50px; font-size: 16px; width: 100%; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  font-size: 20px; color: var(--text-dim);
  transition: background .15s, color .15s, transform .05s;
  flex-shrink: 0;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.icon-btn:active { transform: scale(.92); }
.icon-btn.active { background: var(--accent-soft); color: var(--accent); }

/* ─── Шапка ─── */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px;
  background: rgba(13, 17, 23, .85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo-img { border-radius: 10px; flex-shrink: 0; }
.brand-text { min-width: 0; }
.brand-text h1 { font-size: 17px; font-weight: 700; letter-spacing: .2px; white-space: nowrap; }
.brand-text p { font-size: 12px; color: var(--text-dim); white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: 4px; }
.top-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  font-size: 20px; color: var(--text-dim); text-decoration: none;
  transition: background .15s, color .15s;
}
.top-btn:hover { background: var(--bg-hover); color: var(--text); }
.user-label { font-size: 13px; color: var(--text-dim); margin-right: 8px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#chatToggle { display: none; }

/* ─── Экран входа ─── */
.auth-gate {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(8, 11, 16, .92);
  backdrop-filter: blur(8px);
}
.auth-card {
  width: 100%; max-width: 400px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px 28px;
  text-align: center;
  box-shadow: var(--shadow);
}
.auth-logo { border-radius: 18px; margin-bottom: 16px; }
.auth-card h2 { font-size: 20px; margin-bottom: 8px; }
.auth-card p { color: var(--text-dim); font-size: 14px; margin-bottom: 20px; }
.auth-card input {
  width: 100%; min-height: 52px;
  padding: 12px 16px; margin-bottom: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--mono); font-size: 18px; letter-spacing: 2px; text-align: center;
  text-transform: uppercase;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.auth-card input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.auth-error {
  margin-top: 14px; padding: 10px 14px;
  background: rgba(239, 85, 102, .12);
  border: 1px solid rgba(239, 85, 102, .35);
  border-radius: var(--radius-sm);
  color: #ff9aa5; font-size: 14px;
}
.auth-hint { margin-top: 18px; font-size: 13px; color: var(--text-faint); }
.layout.blurred { filter: blur(6px); pointer-events: none; user-select: none; }

/* ─── Каркас ─── */
.layout {
  position: fixed;
  inset: var(--topbar-h) 0 var(--bottomnav-h) 0;
  display: flex;
  overflow: hidden;
}
.screen { flex: 1; display: flex; min-width: 0; min-height: 0; }

/* ─── Каталог: сайдбар ─── */
.sidebar {
  display: flex; flex-direction: column;
  width: 100%;
  background: var(--bg-elev);
  border-right: 1px solid var(--border-soft);
  min-height: 0;
}
.sidebar-head {
  padding: 12px;
  border-bottom: 1px solid var(--border-soft);
  position: sticky; top: 0; z-index: 2;
  background: var(--bg-elev);
}
.sidebar-head input {
  width: 100%; min-height: 44px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.sidebar-head input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tree { flex: 1; overflow-y: auto; padding: 8px; -webkit-overflow-scrolling: touch; }

.node .row {
  display: flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 9px 10px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  cursor: pointer; user-select: none;
  color: var(--text-dim);
  transition: background .12s, color .12s;
}
.node .row:hover { background: var(--bg-hover); color: var(--text); }
.node .row.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.node .chev { font-size: 10px; width: 14px; text-align: center; transition: transform .18s; color: var(--text-faint); flex-shrink: 0; }
.node .row.open .chev { transform: rotate(90deg); }
.node .row .icon { flex-shrink: 0; }
.node .children { margin-left: 16px; border-left: 1px solid var(--border-soft); padding-left: 6px; }

/* ─── Контент / документ ─── */
.content {
  flex: 1; overflow-y: auto;
  min-width: 0; min-height: 0;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
  display: none; /* на мобильном скрыт, пока не открыт документ */
}
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 70%;
  padding: 40px 24px; text-align: center;
  gap: 6px;
}
.empty-icon { font-size: 56px; margin-bottom: 12px; }
.empty-state h2 { font-size: 22px; margin-bottom: 6px; }
.empty-state p { color: var(--text-dim); max-width: 420px; margin-bottom: 20px; }
.doc { max-width: 860px; margin: 0 auto; padding: 20px 18px 60px; }
.doc-title { font-size: 24px; line-height: 1.3; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--border-soft); }
.doc-body { font-size: 16px; line-height: 1.7; }
.doc-body h1 { font-size: 22px; margin: 26px 0 12px; }
.doc-body h2 { font-size: 19px; margin: 24px 0 10px; color: #bcd2ff; }
.doc-body h3 { font-size: 17px; margin: 20px 0 8px; color: #9db9ea; }
.doc-body p { margin: 12px 0; }
.doc-body ul, .doc-body ol { margin: 12px 0 12px 22px; }
.doc-body li { margin: 6px 0; }
.doc-body table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14px; display: block; overflow-x: auto; }
.doc-body th, .doc-body td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; }
.doc-body th { background: var(--bg-panel); }
.doc-body code { background: var(--bg-panel); padding: 2px 6px; border-radius: 6px; font-family: var(--mono); font-size: .9em; }
.doc-body pre { background: var(--bg-elev); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 14px; overflow-x: auto; margin: 14px 0; }
.doc-body pre code { background: none; padding: 0; }
.doc-body blockquote { border-left: 3px solid var(--accent); margin: 14px 0; padding: 4px 0 4px 14px; color: var(--text-dim); }
.doc-body img { border-radius: var(--radius-sm); margin: 10px 0; }
.doc-body hr { border: none; border-top: 1px solid var(--border-soft); margin: 22px 0; }
.doc-path { margin-top: 30px; padding-top: 12px; border-top: 1px solid var(--border-soft); font-size: 13px; color: var(--text-faint); font-family: var(--mono); word-break: break-all; }
.doc-head {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 4px;
  padding: 6px 10px;
  background: rgba(13, 17, 23, .9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}
.crumb { font-size: 14px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Мобильный: документ открывается поверх каталога */
.layout.doc-open .sidebar { display: none; }
.layout.doc-open .content { display: block; }

/* ─── Чат ─── */
.screen-chat {
  position: fixed; inset: var(--topbar-h) 0 var(--bottomnav-h) 0;
  z-index: 40;
  background: var(--bg);
  flex-direction: column;
}
.chat-wrap { flex: 1; display: flex; flex-direction: column; min-height: 0; max-width: 900px; width: 100%; margin: 0 auto; }
.chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-elev);
  flex-shrink: 0;
}
.chat-title { font-weight: 700; font-size: 16px; }
.chat-header-actions { display: flex; gap: 2px; }
.chat-history-panel {
  padding: 10px 12px; max-height: 45%; overflow-y: auto;
  background: var(--bg-elev); border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
}
.chat-history-title { font-size: 13px; font-weight: 700; color: var(--text-dim); margin-bottom: 8px; }
.chat-history-list { display: grid; gap: 6px; }
.chat-history-item {
  display: flex; flex-direction: column; gap: 3px; width: 100%; padding: 9px 10px;
  text-align: left; color: var(--text); background: var(--bg); border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); cursor: pointer;
}
.chat-history-item:hover { border-color: var(--accent); }
.chat-history-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-history-item small { color: var(--text-faint); }
.chat-config {
  padding: 12px 14px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
}
.cfg-fields { display: grid; grid-template-columns: 1fr; gap: 10px; }
.cfg-fields label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-dim); font-weight: 600; }
.cfg-fields select {
  min-height: 44px; padding: 8px 12px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 15px; outline: none;
}
.cfg-fields select:focus { border-color: var(--accent); }
.cfg-summary-row { margin-top: 10px; font-size: 13px; color: var(--text-faint); }
.cfg-summary-row span { color: var(--accent); font-weight: 600; }

.chat-body {
  flex: 1; overflow-y: auto;
  padding: 16px 14px;
  display: flex; flex-direction: column; gap: 12px;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}
.msg { display: flex; }
.msg.user { justify-content: flex-end; }
.msg.bot { justify-content: flex-start; }
.bubble {
  max-width: 88%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 15px; line-height: 1.6;
  white-space: pre-wrap; word-wrap: break-word;
  overflow-wrap: anywhere;
}
.msg.user .bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 6px; }
.msg.bot .bubble { background: var(--bg-panel); border: 1px solid var(--border-soft); border-bottom-left-radius: 6px; }
.bubble .user-cfg { font-size: 12px; opacity: .85; margin-bottom: 4px; font-weight: 600; }
.bubble .msg-time { display: block; margin-top: 6px; font-size: 11px; color: var(--text-faint); }
.msg.user .bubble .msg-time { color: rgba(255,255,255,.75); }

/* Печатает / стриминг */
.typing .bubble::after,
.streaming .bubble .caret {
  content: '';
  display: inline-block; width: 8px; height: 16px;
  margin-left: 4px; vertical-align: -2px;
  background: var(--accent);
  animation: blink 1s steps(2) infinite;
}
.typing .bubble::after { content: '▋'; background: none; color: var(--accent); width: auto; height: auto; }
@keyframes blink { 50% { opacity: 0; } }

.srcs { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border-soft); display: flex; flex-wrap: wrap; gap: 6px; }
.srcs-title { width: 100%; font-size: 12px; color: var(--text-faint); font-weight: 600; margin-bottom: 2px; }
.src-chip {
  padding: 6px 10px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px; color: var(--accent);
  cursor: pointer;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: background .12s, border-color .12s;
}
.src-chip:hover { background: var(--accent-soft); border-color: var(--accent); }
.fail-note {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 16px;
  background: rgba(240, 169, 60, .1);
  border: 1px solid rgba(240, 169, 60, .35);
  border-radius: var(--radius-sm);
  font-size: 14px; color: #f3c87e;
  max-width: 88%;
}

.chat-input {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: var(--bg-elev);
  border-top: 1px solid var(--border-soft);
  flex-shrink: 0;
}
.chat-input textarea {
  flex: 1;
  min-height: 46px; max-height: 140px;
  padding: 11px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 22px;
  font-size: 15px; line-height: 1.4;
  outline: none; resize: none;
  transition: border-color .15s, box-shadow .15s;
}
.chat-input textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.chat-input button {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-size: 19px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .15s, transform .05s;
}
.chat-input button:hover { background: #6ba1ff; }
.chat-input button:active { transform: scale(.92); }
.chat-input button:disabled { background: var(--bg-hover); color: var(--text-faint); }
.chat-stop { background: var(--danger) !important; }
.chat-stop:hover { background: #ff7381 !important; }

/* ─── Нижняя навигация ─── */
.bottom-nav {
  position: fixed; inset: auto 0 0 0; z-index: 50;
  height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  background: rgba(13, 17, 23, .92);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border-soft);
}
.nav-btn {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  font-size: 22px;
  color: var(--text-faint);
  transition: color .15s;
}
.nav-btn span { font-size: 11px; font-weight: 600; }
.nav-btn.active { color: var(--accent); }

/* ═══════════════════════════════════════════════════
   ДЕСКТОП ≥1024px
   ═══════════════════════════════════════════════════ */
@media (min-width: 1024px) {
  :root { --bottomnav-h: 0px; }
  .bottom-nav { display: none; }
  #chatToggle { display: inline-flex; }
  .layout { inset: var(--topbar-h) 0 0 0; }
  .sidebar { width: 340px; flex-shrink: 0; }
  .content { display: block; }
  .doc { padding: 32px 40px 80px; }
  .doc-body { font-size: 16.5px; }

  /* Чат — выдвижная панель справа */
  .screen-chat {
    inset: var(--topbar-h) 0 0 auto;
    width: min(480px, 44vw);
    border-left: 1px solid var(--border);
    box-shadow: -18px 0 50px rgba(0, 0, 0, .5);
    transform: translateX(105%);
    transition: transform .28s cubic-bezier(.32, .72, .35, 1);
    display: flex;
  }
  .screen-chat.hidden { display: flex !important; } /* скрытие только transform */
  .screen-chat.open { transform: translateX(0); }
  .chat-wrap { max-width: none; }
  .bubble { max-width: 92%; }
  .cfg-fields { grid-template-columns: 1fr 1fr 1fr; }
  .user-label { display: inline; }
}

/* Планшеты: конфиг в 3 колонки уже с 720px */
@media (min-width: 720px) and (max-width: 1023px) {
  .cfg-fields { grid-template-columns: 1fr 1fr 1fr; }
  .doc { padding: 28px 32px 70px; }
}

/* ═══════════════════════════════════════════════════
   АДМИНКА (тот же дизайн-язык)
   ═══════════════════════════════════════════════════ */
.admin-body .topbar { position: sticky; }
.admin-panel { padding: 20px 16px 60px; max-width: 1200px; margin: 0 auto; }
.admin-nav {
  display: flex; gap: 6px; overflow-x: auto;
  padding: 4px; margin-bottom: 20px;
  background: var(--bg-elev);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  scrollbar-width: none;
}
.admin-nav::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 42px; padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; white-space: nowrap;
  color: var(--text-dim);
  transition: background .15s, color .15s;
}
.tab:hover { background: var(--bg-hover); color: var(--text); }
.tab.active { background: var(--accent); color: #fff; }
.badge {
  min-width: 22px; height: 22px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--danger); color: #fff;
  border-radius: 999px; font-size: 12px; font-weight: 700;
}
.tab.active .badge { background: rgba(255, 255, 255, .25); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 24px; }
.card {
  background: var(--bg-elev);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 18px;
}
.card-num { font-size: 30px; font-weight: 800; color: var(--accent); }
.card-label { font-size: 13px; color: var(--text-dim); margin-top: 4px; }
.admin-panel h3 { font-size: 17px; margin: 20px 0 12px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.toolbar input, .toolbar select, .note-input {
  min-height: 44px; padding: 8px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px; outline: none;
}
.toolbar input { flex: 1; min-width: 180px; }
.toolbar input:focus, .toolbar select:focus, .note-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.table-wrap { overflow-x: auto; border: 1px solid var(--border-soft); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
.table th, .table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--border-soft); }
.table th { background: var(--bg-elev); color: var(--text-dim); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(255, 255, 255, .02); }
.mono { font-family: var(--mono); font-size: 13px; }

.list { display: flex; flex-direction: column; gap: 10px; }
.list-item {
  background: var(--bg-elev);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.li-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.li-q { font-weight: 600; font-size: 15px; }
.li-title { font-weight: 600; }
.li-answer { margin-top: 8px; font-size: 14px; color: var(--text-dim); white-space: pre-wrap; }
.li-sub { margin-top: 6px; font-size: 12px; color: var(--text-faint); }
.li-note { margin-top: 8px; font-size: 13px; color: #f3c87e; }
.li-actions { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.li-actions .note-input { flex: 1; min-width: 180px; }

.tag {
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.tag-ok { background: rgba(52, 201, 142, .15); color: #4fe0a8; }
.tag-fail { background: rgba(239, 85, 102, .15); color: #ff8a96; }
.tag-warn { background: rgba(240, 169, 60, .15); color: #f3c87e; }
.hint { color: var(--text-faint); font-size: 14px; padding: 10px 2px; }

.form-card { max-width: 560px; margin-bottom: 16px; }
.form-card h3 { margin-top: 0; }
.form-card label { display: block; margin-bottom: 12px; font-size: 13px; color: var(--text-dim); font-weight: 600; }
.form-card input, .form-card select {
  width: 100%; min-height: 44px; margin-top: 6px;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px; outline: none;
}
.form-card input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: flex; gap: 10px; margin-top: 6px; }
.check-label { display: flex !important; align-items: center; gap: 8px; }
.check-label input { width: auto; min-height: auto; margin: 0; }
.llm-key-state { margin: -4px 0 12px; color: var(--text-faint); font-size: 13px; }
.llm-status { margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: rgba(52, 201, 142, .15); color: #4fe0a8; }
.llm-status.error { background: rgba(239, 85, 102, .15); color: #ff8a96; }
.result-card { border-color: rgba(52, 201, 142, .4); }
.token-code {
  font-family: var(--mono); font-size: 26px; letter-spacing: 3px;
  text-align: center; padding: 16px; margin: 12px 0;
  background: var(--bg); border: 1px dashed var(--border);
  border-radius: var(--radius-sm); color: var(--accent-2);
  user-select: all;
}
.result-card .btn { margin-right: 8px; }
.pager { display: flex; align-items: center; gap: 14px; margin-top: 16px; justify-content: center; color: var(--text-dim); font-size: 14px; }
