/* Панель TG Autopilot. Светлая и тёмная темы на CSS-переменных; без внешних шрифтов и библиотек. */
:root {
  --bg: #f4f5f8; --surface: #ffffff; --surface-2: #f8f9fb; --text: #182033; --muted: #66708a; --border: #e2e5ee;
  --accent: #2f5fd0; --accent-ink: #ffffff; --accent-soft: #e8eefc;
  --ok: #17803d; --ok-soft: #e3f5ea; --warn: #a95d00; --warn-soft: #fdf0d9; --err: #c0262d; --err-soft: #fce8e8;
  --info: #1e6fa8; --info-soft: #e2f0fa; --shadow: 0 1px 2px rgba(20, 30, 60, .06), 0 1px 8px rgba(20, 30, 60, .04);
  --radius: 10px; --side-w: 232px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
:root[data-theme="dark"] {
  --bg: #0e1118; --surface: #161b25; --surface-2: #1b2130; --text: #e5e9f2; --muted: #93a0b8; --border: #2a3245;
  --accent: #7aa2ff; --accent-ink: #0b1220; --accent-soft: #1d2a4a;
  --ok: #52c982; --ok-soft: #12291d; --warn: #f0b04a; --warn-soft: #33260f; --err: #ff7b80; --err-soft: #3a1618;
  --info: #6bb7ee; --info-soft: #132a3c; --shadow: 0 1px 2px rgba(0, 0, 0, .4);
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #0e1118; --surface: #161b25; --surface-2: #1b2130; --text: #e5e9f2; --muted: #93a0b8; --border: #2a3245;
    --accent: #7aa2ff; --accent-ink: #0b1220; --accent-soft: #1d2a4a;
    --ok: #52c982; --ok-soft: #12291d; --warn: #f0b04a; --warn-soft: #33260f; --err: #ff7b80; --err-soft: #3a1618;
    --info: #6bb7ee; --info-soft: #132a3c; --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  }
}
* { box-sizing: border-box; }
html { color-scheme: light dark; }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h2 { font-size: 17px; margin-bottom: 12px; }
h3 { font-size: 14px; margin: 16px 0 8px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
code, pre { font-family: var(--mono); font-size: 12.5px; }
code { background: var(--surface-2); border: 1px solid var(--border); padding: 1px 5px; border-radius: 5px; }
pre { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; overflow: auto; margin: 6px 0 0; max-height: 320px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .break { word-break: break-word; } .nowrap { white-space: nowrap; }
.warn-text { color: var(--warn); } .err-text { color: var(--err); } .center { text-align: center; margin: 16px 0; }
.only-mobile { display: none; } .grow { flex: 1; }

/* режим */
.modebar { padding: 6px 20px; font-size: 13px; text-align: center; border-bottom: 1px solid var(--border); }
.modebar-dry { background: var(--warn-soft); color: var(--warn); }
.modebar-live { background: var(--err-soft); color: var(--err); }
.modebar .sep { opacity: .5; margin: 0 6px; }

/* каркас */
.shell { display: flex; min-height: calc(100vh - 32px); }
.side { width: var(--side-w); flex: none; background: var(--surface); border-right: 1px solid var(--border); padding: 16px 12px; position: sticky; top: 0; align-self: flex-start; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--text); padding: 4px 8px 16px; }
.brand:hover { text-decoration: none; }
.brand-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-size: 13px; font-weight: 800; }
.brand-lg { font-size: 22px; padding: 0 0 8px; } .brand-lg .brand-mark { width: 38px; height: 38px; font-size: 15px; }
.nav { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin: 1px 0; border-radius: 8px; color: var(--text); font-size: 14.5px; }
.nav:hover { background: var(--surface-2); text-decoration: none; }
.nav.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-title { margin: 16px 10px 4px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ico { flex: none; }
.main { flex: 1; min-width: 0; }
.top { display: flex; align-items: center; gap: 12px; padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.page-title { font-size: 20px; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.top-right form { margin: 0; }
.userbox { display: flex; align-items: center; gap: 8px; color: var(--text); padding: 2px 8px; border-radius: 8px; }
.userbox:hover { background: var(--surface-2); text-decoration: none; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; }
.who { display: flex; flex-direction: column; line-height: 1.15; font-size: 14px; } .who small { color: var(--muted); font-size: 12px; }
.content { padding: 20px 24px 48px; max-width: 1280px; }

/* карточки и сетка */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.card.narrow { max-width: 560px; }
.card.link { color: inherit; } .card.link:hover { text-decoration: none; border-color: var(--accent); }
.grid { display: grid; gap: 16px; margin-bottom: 16px; }
.grid > .card { margin-bottom: 0; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-k { color: var(--muted); font-size: 13px; } .stat-v { font-size: 30px; font-weight: 700; line-height: 1.2; margin: 2px 0; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-between h2 { margin-bottom: 12px; }
.empty { text-align: center; padding: 36px 18px; color: var(--muted); } .empty .big { font-size: 48px; font-weight: 700; color: var(--text); }
.note { background: var(--info-soft); color: var(--info); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; }

/* hero */
.hero { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 20px; border-radius: var(--radius); margin-bottom: 16px; border: 1px solid var(--border); background: var(--surface); }
.hero-title { font-size: 22px; font-weight: 700; }
.hero-ok { background: var(--ok-soft); border-color: transparent; } .hero-ok .hero-title { color: var(--ok); }
.hero-warn { background: var(--warn-soft); border-color: transparent; } .hero-warn .hero-title { color: var(--warn); }
.hero-bad, .hero-live { background: var(--err-soft); border-color: transparent; } .hero-bad .hero-title, .hero-live .hero-title { color: var(--err); }
.mode-big { font-weight: 800; font-size: 20px; letter-spacing: .06em; padding: 10px 18px; border-radius: 10px; border: 2px solid currentColor; white-space: nowrap; }
.mode-dry { color: var(--warn); background: var(--surface); } .mode-live { color: var(--err); background: var(--surface); }

/* кнопки, формы */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); } .btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn-danger { background: var(--err); border-color: var(--err); color: #fff; } .btn-danger:hover { background: var(--err); filter: brightness(1.08); }
.btn-danger-ghost { color: var(--err); } .btn-danger-ghost:hover { background: var(--err-soft); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { padding: 4px 10px; font-size: 13px; } .btn-block { width: 100%; }
form.inline { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
input, select, textarea { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: 14.5px; }
form.inline input, form.inline select { width: auto; margin: 0; padding: 4px 8px; font-size: 13px; }
textarea { resize: vertical; }
label.check { display: inline-flex; align-items: center; gap: 6px; margin: 0 14px 6px 0; color: var(--text); }
label.check input { width: auto; margin: 0; }
fieldset { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px 4px; margin: 0 0 12px; }
legend { font-size: 13px; color: var(--muted); padding: 0 6px; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 14px; }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; background: var(--ok-soft); color: var(--ok); }
.flash-err { background: var(--err-soft); color: var(--err); }

/* чипы и индикаторы */
.chip { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.chip-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip-err { background: var(--err-soft); color: var(--err); border-color: transparent; }
.chip-info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.chip-lvl-error, .chip-lvl-critical { background: var(--err-soft); color: var(--err); border-color: transparent; }
.chip-lvl-warning { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip-lvl-info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.chip-cat { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.dot-ok { background: var(--ok); } .dot-warn { background: var(--warn); } .dot-fail { background: var(--err); } .dot-off, .dot-new { background: var(--border); box-shadow: inset 0 0 0 2px var(--muted); }
progress.bar { width: 100%; height: 10px; border: 0; border-radius: 999px; overflow: hidden; background: var(--surface-2); appearance: none; -webkit-appearance: none; display: block; margin-top: 6px; }
progress.bar::-webkit-progress-bar { background: var(--surface-2); border-radius: 999px; }
progress.bar::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
progress.bar::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
progress.bar-warn::-webkit-progress-value { background: var(--warn); } progress.bar-warn::-moz-progress-bar { background: var(--warn); }
progress.bar-fail::-webkit-progress-value { background: var(--err); } progress.bar-fail::-moz-progress-bar { background: var(--err); }
.spend { display: grid; gap: 14px; margin-bottom: 8px; }

/* списки и таблицы */
.health { list-style: none; margin: 0; padding: 0; }
.health li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.health li:last-child { border-bottom: 0; } .health em { margin-left: auto; color: var(--muted); font-style: normal; font-size: 13px; text-align: right; }
.err-list { list-style: none; margin: 0; padding: 0; } .err-list li { padding: 6px 0; border-bottom: 1px solid var(--border); } .err-list li:last-child { border-bottom: 0; }
.li-line { padding: 6px 0; border-bottom: 1px solid var(--border); } .li-line:last-child { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 600; font-size: 12.5px; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; } .tbl td.wide { min-width: 260px; }
.tbl-tight th, .tbl-tight td { padding: 6px 10px; }
.card > .tbl, .card > .table-wrap { margin-top: 4px; }
.empty-cell { text-align: center; color: var(--muted); padding: 28px !important; }
.reason { font-size: 13px; color: var(--warn); margin-top: 2px; }
.tabs { display: flex; gap: 4px; margin-bottom: 14px; flex-wrap: wrap; }
.tab { padding: 7px 14px; border-radius: 8px; color: var(--muted); border: 1px solid transparent; }
.tab:hover { background: var(--surface); text-decoration: none; } .tab.active { background: var(--surface); border-color: var(--border); color: var(--text); font-weight: 600; }
.count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 12px; text-align: center; margin-left: 4px; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 6px 14px; margin: 0 0 12px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; min-width: 0; word-break: break-word; }
.kv-tight { grid-template-columns: 130px 1fr; }
.verdict { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; background: var(--surface); border: 1px solid var(--border); border-left-width: 4px; }
.verdict-ok { border-left-color: var(--ok); } .verdict-warn { border-left-color: var(--warn); } .verdict-fail { border-left-color: var(--err); } .verdict-skip { border-left-color: var(--muted); } .verdict-wait { border-left-color: var(--info); }

/* лента событий */
.filters .cats { margin-top: 4px; }
.feed-head { margin: 4px 0 8px; }
.live { font-size: 13px; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.live[data-state="on"] { background: var(--ok-soft); color: var(--ok); }
.live[data-state="on"]::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-right: 6px; animation: pulse 1.6s infinite; }
.live[data-state="off"] { background: var(--warn-soft); color: var(--warn); }
@keyframes pulse { 50% { opacity: .3; } }
.ev { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--border); border-radius: 8px; padding: 8px 12px; margin-bottom: 6px; }
.ev-warning { border-left-color: var(--warn); } .ev-error, .ev-critical { border-left-color: var(--err); } .ev-info { border-left-color: var(--info); } .ev-debug { opacity: .75; }
.ev-new { animation: fresh 2.4s ease-out; }
@keyframes fresh { from { background: var(--accent-soft); } }
.ev-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.ev-ts { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.ev-msg { flex: 1 1 320px; min-width: 0; word-break: break-word; }
.ev-meta { display: flex; gap: 12px; flex-wrap: wrap; align-items: baseline; margin-top: 2px; }
.ev-payload { flex-basis: 100%; } .ev-payload summary { cursor: pointer; color: var(--accent); }
.feed-inner .ev { box-shadow: none; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 8px; border-left: 2px solid var(--border); margin-left: 6px; }
.tl { position: relative; padding: 0 0 16px 22px; }
.tl-dot { position: absolute; left: -7px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--info); border: 2px solid var(--surface); }
.tl-warning .tl-dot { background: var(--warn); } .tl-error .tl-dot, .tl-critical .tl-dot { background: var(--err); } .tl-debug .tl-dot { background: var(--muted); }
.tl-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .tl-head time { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.tl-msg { margin-top: 2px; }

/* новости */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; align-items: start; } .split > .card { margin-bottom: 0; }
.source-text { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px; max-height: 420px; overflow: auto; font-size: 14px; }
.tg-preview { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; }
.fc { border-radius: 8px; padding: 10px 14px; } .fc ul { margin: 6px 0 0; padding-left: 18px; }
.fc-ok { background: var(--ok-soft); color: var(--ok); } .fc-bad { background: var(--err-soft); color: var(--err); }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.actions form { margin: 0; }
.testres { margin: 8px 0; padding: 8px 10px; background: var(--surface-2); border-radius: 8px; } .testres ul { margin: 4px 0 0; padding-left: 18px; }
.src .kv { margin-top: 10px; }

/* управление */
.switches { display: grid; gap: 10px; }
.switch { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); flex-wrap: wrap; }
.switch.is-stopped { border-color: var(--err); background: var(--err-soft); }
.switch-side { display: flex; align-items: center; gap: 10px; }

/* настройки */
.set-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 18px; }
.set-row { margin-bottom: 14px; } .set-row > label { margin-bottom: 0; color: var(--text); font-weight: 600; }

/* расходы */
.chart { width: 100%; height: 170px; } .chart .bar-r { fill: var(--accent); } .chart .bar-r:hover { filter: brightness(1.2); }
.chart .ax { stroke: var(--border); stroke-width: 1; } .chart .ax-t { fill: var(--muted); font-size: 9px; }

/* диалоги */
.chat { display: grid; gap: 10px; } .msg { padding: 10px 14px; border-radius: 12px; max-width: 78%; background: var(--surface-2); }
.msg-user { justify-self: start; } .msg-bot { justify-self: end; background: var(--accent-soft); }
pre.mini { max-height: 140px; }

/* вход */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login { width: 100%; max-width: 380px; padding: 28px; }

@media (max-width: 1000px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g2, .split { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .only-mobile { display: inline-flex; }
  .side { position: fixed; z-index: 20; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .side.open { transform: none; }
  .top { padding: 10px 16px; } .content { padding: 16px 16px 40px; } .who { display: none; }
  .page-title { font-size: 18px; } .hero { flex-direction: column; align-items: flex-start; }
  .kv { grid-template-columns: 1fr; gap: 0; } .kv dt { margin-top: 8px; }
  .g4 { grid-template-columns: 1fr 1fr; } .stat-v { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Ключи и токены */
.grp { margin: 22px 0 8px; font-size: 16px; }
.secret .secret-name { margin: 0 0 2px; font-size: 16px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: minmax(130px, 200px) 1fr; gap: 4px 14px; margin: 12px 0; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; word-break: break-word; }
.secret-row input { flex: 1 1 260px; min-width: 0; font-family: ui-monospace, Menlo, Consolas, monospace; }
.ok-text { color: var(--ok); }
label.check { display: flex; gap: 8px; align-items: center; margin: 8px 0; font-weight: 500; }

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
textarea.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.set-grid label.check { display: flex; gap: 8px; align-items: center; } .set-grid label.check input { width: auto; margin: 0; }

/* Ключи и каналы: одна карточка на платформу, ключ и каналы рядом */
.kc-bar { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.kc-intro { margin: 0; max-width: 62ch; }
.kc-add { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.kc-none { margin: 4px 0 0; }
.kc { padding: 14px 16px; margin-bottom: 12px; }
.kc-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.kc-head h2 { margin: 0; font-size: 17px; }
.kc-caps { margin-left: auto; }
.kc-grid { display: grid; grid-template-columns: minmax(240px, 5fr) minmax(300px, 7fr); gap: 14px 22px; align-items: start; }
.kc-grid-ai { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.kc-keys, .kc-chans { min-width: 0; }
.kc-keys { border-right: 1px solid var(--border); padding-right: 18px; }
.kc-key { padding: 0 0 10px; } .kc-key + .kc-key, .kc-key + .kc-plus { margin-top: 2px; }
.kc-label { font-size: 13px; color: var(--muted); }
.kc-code { font-size: 11px; opacity: .8; }
.kc-val { margin: 2px 0 4px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.kc-note { color: var(--muted); margin-top: 2px; }
.kc-note .err-text { margin-top: 2px; }
.kc-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: flex-start; margin-top: 6px; }
.kc-actions form { margin: 0; }
.kc-more > summary { cursor: pointer; list-style: none; }
.kc-more > summary::-webkit-details-marker { display: none; }
.kc-more[open] > summary.btn { background: var(--accent-soft); border-color: var(--accent); }
.kc-form { margin-top: 8px; display: grid; gap: 6px; min-width: 240px; max-width: 420px; }
.kc-form input { margin: 0; font-family: var(--mono); font-size: 13px; }
.kc-plus > summary, .kc-plus-row a, .kc-extra .kc-more > summary { color: var(--accent); font-size: 13px; }
.kc-plus-row { display: flex; gap: 16px; margin-top: 8px; font-size: 13px; }
.kc-extra { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border); }
.kc-extra .kc-more > summary { display: inline-block; }
.kc-list { list-style: none; margin: 0; padding: 0; }
.kc-ch { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.kc-ch:first-child { padding-top: 0; } .kc-ch:last-child { border-bottom: 0; }
.kc-ch-main { flex: 1 1 220px; min-width: 0; }
.kc-ch-name { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.kc-ch-id code { word-break: break-all; }
.kc-ch-act { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; position: relative; }
.kc-ch-act form { margin: 0; }
.kc-empty { margin: 0; }
.kc-pop, .kc-dots { position: relative; }
.kc-menu { position: absolute; right: 0; z-index: 8; min-width: 190px; margin-top: 4px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 6px 24px rgba(20, 30, 60, .18); display: grid; gap: 2px; }
.kc-pop .kc-menu { left: 0; right: auto; }
.kc-menu a { display: block; padding: 7px 10px; border-radius: 6px; color: var(--text); }
.kc-menu a:hover { background: var(--surface-2); text-decoration: none; }
.kc-menu-wide { width: min(380px, 86vw); padding: 10px 12px; gap: 10px; }
.kc-menu-wide .kc-key { padding-bottom: 6px; border-bottom: 1px solid var(--border); } .kc-menu-wide .kc-key:last-child { border-bottom: 0; padding-bottom: 0; }
.kc-hist { margin-top: 12px; } .kc-hist > summary { color: var(--accent); font-size: 13px; }
.kc-newform .check { margin-top: 4px; }
@media (max-width: 760px) {
  .kc-grid { grid-template-columns: 1fr; }
  .kc-keys { border-right: 0; padding-right: 0; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
  .kc-caps { margin-left: 0; width: 100%; }
  .kc-add { margin-left: 0; }
  .kc-ch-act { width: 100%; }
}
@media (max-width: 760px) { #history .tbl th:nth-child(2), #history .tbl td:nth-child(2) { display: none; } }
