:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --paper: #ffffff;
  --ink: #17202a;
  --muted: #5e6a76;
  --line: #e3e8ee;
  --line-strong: #d3dae3;
  --accent: #0c6b4c;
  --accent-ink: #ffffff;
  --accent-soft: #e7f5ef;
  --user: #f3f7f5;
  --danger: #b42318;
  --danger-soft: #fdeceb;
  --shadow: 0 1px 2px rgba(23, 32, 42, 0.04), 0 12px 32px rgba(23, 32, 42, 0.06);
  --radius: 16px;
  --sidebar: 300px;
  --chat: 820px;
  --font: "Avenir Next", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
.app {
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.side-head .brand { min-width: 0; }
.icon-btn.side-close { display: none; }
.lang-slim, #chatLang { max-width: 128px; }
.sidebar {
  background: var(--paper);
  border-inline-end: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 18px 14px 14px;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 8px;
  text-decoration: none;
  color: inherit;
}
.mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 700;
  letter-spacing: -0.04em;
}
.brand strong { font-size: 18px; letter-spacing: -0.03em; }
.brand span { display: block; color: var(--muted); font-size: 12px; font-weight: 500; }
.side-btn, .ghost, .primary {
  border: 1px solid var(--line-strong);
  background: var(--paper);
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 600;
}
.side-btn, .primary { width: 100%; }
.primary, button.primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.primary:hover { background: #0a5a40; }
.ghost:hover, .side-btn:hover, .icon-btn:hover { background: #f7f9fb; }
.search {
  width: 100%;
  border: 1px solid var(--line);
  background: #f8fafb;
  border-radius: 12px;
  padding: 10px 12px;
}
.search:focus, textarea:focus, input:focus, select:focus {
  outline: none;
  border-color: #8dbeab;
  box-shadow: 0 0 0 3px rgba(12, 107, 76, 0.15);
}
.history {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  flex: 1;
}
.history li {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
}
.history li:hover { background: #f6f8fa; }
.history li.active { background: var(--accent-soft); border-color: #c9e6da; }
.history .title { font-weight: 600; font-size: 14px; }
.history .meta, .quiet { color: var(--muted); font-size: 12px; }
.side-actions { display: flex; gap: 8px; }
.side-actions .ghost { flex: 1; padding: 8px; font-size: 13px; }
.main { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 18px;
  background: rgba(244, 246, 248, 0.9);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 5;
  min-width: 0;
}
.controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
select.slim, .icon-btn {
  border: 1px solid var(--line-strong);
  background: var(--paper);
  border-radius: 999px;
  height: 38px;
}
select.slim { padding: 0 12px; }
.icon-btn {
  width: 38px;
  padding: 0;
  display: inline-grid;
  place-items: center;
}
.icon-btn svg { width: 18px; height: 18px; display: block; }
.icon-btn.on { background: var(--accent-soft); border-color: #b7dfcf; color: var(--accent); }
.icon-btn.live { background: #fff4f2; border-color: #f3c1bb; color: var(--danger); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(0.96); } }
.chat {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 8px 18px 18px;
}
.empty {
  max-width: var(--chat);
  margin: 28px auto 12px;
  text-align: center;
  padding: 8px 4px 20px;
}
.empty h2 { font-size: 40px; letter-spacing: -0.045em; margin: 0 0 8px; font-weight: 600; }
.empty p { color: var(--muted); margin: 0 0 18px; }
.prompts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: start; }
.prompts button {
  text-align: start;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.prompts button:hover { border-color: #b7dfcf; }
.thread { width: min(100%, var(--chat)); max-width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.msg { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; align-items: start; width: 100%; min-width: 0; }
.msg.user { grid-template-columns: minmax(0, 1fr) 36px; }
.msg.user .avatar { order: 2; }
.msg.user .bubble { order: 1; margin-inline-start: 12%; background: #e7f5ef; border-color: #cfe6db; }
.avatar {
  width: 36px; height: 36px; border-radius: 12px;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  background: #e7edf2; color: #314052;
}
.msg.user .avatar { background: var(--accent); color: white; }
.bubble {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px 14px;
  box-shadow: 0 1px 1px rgba(23, 32, 42, 0.03);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.msg.user .bubble { background: var(--user); }
.content { line-height: 1.65; overflow-wrap: anywhere; word-break: break-word; min-width: 0; max-width: 100%; }
.content p { margin: 0 0 8px; }
.content p:last-child { margin-bottom: 0; }
.content ul, .content ol { margin: 6px 0 8px; padding-inline-start: 1.2em; }
.content h3 { margin: 8px 0 6px; font-size: 16px; }
.content code {
  font-family: var(--mono);
  font-size: 0.92em;
  background: #eef2f5;
  padding: 0 4px;
  border-radius: 6px;
}
.msg-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 8px; color: var(--muted); font-size: 12px; min-width: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin-inline-start: auto; }
.actions button, .copy-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  height: 30px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 12px;
}
.actions button.speaking { color: var(--danger); border-color: #f3c1bb; background: var(--danger-soft); }
.actions button.chosen.like { color: var(--accent); border-color: #b7dfcf; background: var(--accent-soft); }
.actions button.chosen.dislike { color: var(--danger); border-color: #f3c1bb; background: var(--danger-soft); }
.code-wrap { position: relative; margin: 8px 0; min-width: 0; max-width: 100%; }
pre.code {
  margin: 0;
  max-width: 100%;
  background: #f6f8fa;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre;
}
.copy-btn { position: absolute; top: 8px; inset-inline-end: 8px; }
.result-card, .file-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--accent);
  background: #fbfefc;
  border-radius: 14px;
  padding: 12px 14px;
  margin: 8px 0;
}
.result-card .k { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.result-card .v { font-size: 28px; font-weight: 700; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.file-card a.primary { width: auto; text-decoration: none; display: inline-block; padding: 8px 12px; }
.content img.shot { max-width: min(100%, 520px); border-radius: 14px; display: block; margin: 8px 0; cursor: zoom-in; border: 1px solid var(--line); }
.atts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.att { width: 84px; text-align: center; font-size: 12px; color: var(--muted); }
.thumb {
  width: 72px; height: 72px; margin: 0 auto 4px; border-radius: 12px;
  border: 1px solid var(--line); background: #f6f8fa; display: grid; place-items: center;
  position: relative; overflow: hidden; cursor: pointer;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.att .name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm {
  position: absolute; top: 4px; inset-inline-end: 4px; width: 20px; height: 20px;
  border: 0; border-radius: 999px; background: #fff; color: var(--danger); line-height: 20px;
}
.composer-wrap { width: 100%; min-width: 0; padding: 0 18px 16px; }
.composer {
  width: min(100%, var(--chat));
  max-width: 100%;
  margin: 0 auto;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  position: relative;
}
.composer .atts,
.composer .listen,
.composer textarea { grid-column: 1 / -1; }
.composer textarea {
  width: 100%;
  min-width: 0;
  border: 0;
  resize: none;
  min-height: 48px;
  max-height: 180px;
  padding: 10px 4px;
  background: transparent;
  box-shadow: none;
  overflow-x: hidden;
  overflow-y: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.composer textarea:focus { box-shadow: none; }
.toolrow, .sendrow { display: flex; gap: 6px; align-items: center; min-width: 0; }
.toolrow { grid-column: 1; flex-wrap: wrap; }
.sendrow { grid-column: 2; flex: none; justify-content: flex-end; }
.sendrow .primary, .sendrow .ghost { width: auto; white-space: nowrap; }
.sendrow .primary { border-radius: 999px; padding: 10px 16px; }
.composer .atts { margin: 0; }
.listen {
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
}
.drawer, .modal {
  position: fixed;
  inset: 0;
  background: rgba(23, 32, 42, 0.35);
  display: none;
  place-items: center;
  z-index: 30;
  padding: 18px;
}
.drawer.open, .modal.open { display: grid; }
.panel {
  width: min(480px, 100%);
  background: var(--paper);
  border-radius: 20px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.panel h3 { margin: 0 0 6px; letter-spacing: -0.03em; }
.panel .quiet { margin-bottom: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field input, .field select {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}
.status { min-height: 1.2em; color: var(--muted); font-size: 14px; }
.menu-btn { display: none; }
.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid #d5ddd9; border-top-color: var(--accent);
  animation: spin 0.7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.modal img { max-width: min(92vw, 960px); max-height: 78vh; border-radius: 16px; display: block; background: white; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 500px at 10% -10%, #d7efe4, transparent 50%), var(--bg); }
.auth-shell { width: min(980px, 100%); display: grid; grid-template-columns: 1.05fr 0.95fr; background: var(--paper); border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow); overflow: hidden; }
.auth-hero { background: #0c6b4c; color: #f4fbf7; padding: 36px 32px; display: flex; flex-direction: column; justify-content: space-between; gap: 28px; min-height: 520px; }
.auth-hero h2 { margin: 0 0 14px; font-size: 32px; letter-spacing: -0.04em; line-height: 1.15; }
.auth-hero ul { margin: 0; padding-inline-start: 18px; }
.auth-hero li { margin: 8px 0; }
.auth-hero p { margin: 0; opacity: 0.85; }
.brand-light, .brand-light strong { color: white; }
.brand-light span span { color: rgba(255,255,255,0.75); }
.mark-light { background: white; color: #0c6b4c; }
.auth-card { width: auto; border: 0; border-radius: 0; box-shadow: none; padding: 32px 28px; }
.auth-card-top { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.stat b { display: block; font-size: 22px; letter-spacing: -0.03em; }
.stat span { color: var(--muted); font-size: 13px; }
@media (max-width: 860px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-hero { min-height: 0; padding: 24px; }
  .auth-hero h2 { font-size: 26px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}
.tabs { display: flex; gap: 8px; margin: 16px 0; }
.tabs button { flex: 1; }
.tabs button.active { background: var(--accent); color: white; border-color: var(--accent); }
.pane { display: none; }
.pane.active { display: block; }
.auth-card .primary { margin-top: 6px; }
.top-lang { margin-bottom: 8px; }
.jump-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.jump-grid a {
  display: block; background: #fff; border: 1px solid #e6edf5; border-radius: 14px;
  padding: 14px 16px; text-decoration: none; color: #1e293b; font-weight: 700;
}
.jump-grid a:hover { border-color: #b9d0fb; color: #2f6fed; }
body.nav-open::before, body.admin-nav-open::before {
  content: ""; position: fixed; inset: 0; background: rgba(15, 23, 42, 0.35); z-index: 15;
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .menu-btn, .icon-btn.side-close { display: inline-grid; }
  .sidebar {
    position: fixed;
    inset-inline-start: 0;
    top: 0;
    bottom: 0;
    width: min(86vw, 320px);
    z-index: 20;
    transform: translateX(-105%);
    transition: transform 180ms ease;
    box-shadow: var(--shadow);
  }
  [dir="rtl"] .sidebar { transform: translateX(105%); }
  body.nav-open .sidebar { transform: none; }
  .prompts { grid-template-columns: 1fr; }
  .empty h2 { font-size: 30px; }
  .composer { border-radius: 18px; }
  .msg.user .bubble { margin-inline-start: 0; }
  .composer-wrap { padding: 0 10px calc(12px + env(safe-area-inset-bottom)); }
  .chat { padding: 8px 12px 12px; }
  .sheet h1, .admin-main h1 { font-size: 26px; }
  .jump-grid { grid-template-columns: 1fr 1fr; }
  .auth-card, .card, .panel { max-width: 100%; }
  .topbar .quiet { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .controls { gap: 6px; }
  .sheet { padding: 18px 14px 40px; }
  .key-table { display: block; overflow-x: auto; }
}
a.ghost { display: inline-flex; align-items: center; text-decoration: none; color: inherit; }
.side-links { display: flex; gap: 8px; margin-top: auto; }
.side-links a {
  flex: 1; text-align: center; text-decoration: none; color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px; padding: 8px 6px; font-size: 13px; font-weight: 600;
  background: var(--paper);
}
.result-card .v, .file-card { overflow-wrap: anywhere; min-width: 0; }
.voice-pop {
  position: absolute;
  inset-inline-end: 12px;
  bottom: calc(100% + 8px);
  width: min(320px, calc(100vw - 36px));
  max-height: 280px;
  overflow: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 6px;
  z-index: 12;
}
.voice-pop button {
  display: block; width: 100%; text-align: start;
  border: 0; background: transparent; border-radius: 10px; padding: 8px 10px; font-size: 13px;
}
.voice-pop button.on, .voice-pop button:hover { background: var(--accent-soft); }
.sheet { max-width: 980px; margin: 0 auto; padding: 28px 20px 64px; }
.sheet-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.doc pre, .sheet pre, .key-table-wrap { max-width: 100%; }
.sheet h1 { margin: 0; letter-spacing: -0.04em; font-size: 32px; }
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px;
}
.card h2 { margin: 0 0 8px; font-size: 18px; letter-spacing: -0.03em; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; margin: 8px 0 12px; font-weight: 600; }
.key-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.key-table th, .key-table td { text-align: start; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.key-table th { color: var(--muted); font-weight: 600; }
.badge { display: inline-block; border-radius: 999px; padding: 2px 8px; font-size: 12px; font-weight: 700; background: #eef2f5; }
.badge.pending { background: #fff6e5; color: #8a5a00; }
.badge.approved { background: var(--accent-soft); color: var(--accent); }
.badge.declined { background: var(--danger-soft); color: var(--danger); }
.quota-grid { display: grid; gap: 12px; margin-top: 16px; }
.quota-card { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: #f8fafb; }
.quota-card h3 { margin: 0 0 6px; font-size: 15px; }
.quota-card p { margin: 4px 0; }
.quota-nums { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.quota-nums span { background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: 12px; }
.mind-list { margin: 0; padding-left: 18px; }
.mind-list li { margin: 6px 0; }
.limit-num, .limit-every, .limit-unit {
  border: 1px solid var(--line);
  background: #f8fafb;
  border-radius: 12px;
  padding: 8px 10px;
  font: inherit;
}
.limit-num, .limit-every { width: 88px; }
.limit-span { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.key-table .ghost { width: auto; padding: 6px 10px; font-size: 13px; }
#limitEditor b, #limitEditor .quiet { display: block; }
.clear-rows { display: flex; flex-direction: column; }
.clear-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid #e8eef6; }
.clear-row b { display: block; font-size: 14px; }
.clear-row .quiet { display: block; margin-top: 2px; }
.clear-row .ghost, #clearSpace .primary { width: auto; flex: none; }
.learn-actions { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; }
.learn-actions .status { margin: 0; }
.cron-line { white-space: pre-wrap; word-break: break-all; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 12px; font-size: 12px; }
.src { display: inline-block; border-radius: 999px; padding: 2px 8px; font-size: 12px; background: #f1f5f9; color: #334155; }
.src.self { background: #ecfdf3; color: #047857; }
.src.external { background: #e8f1ff; color: #2f6fed; }
.actions-inline { display: flex; flex-wrap: wrap; gap: 6px; }
.actions-inline .ghost, .actions-inline .primary { width: auto; padding: 6px 10px; font-size: 13px; }
.secret {
  font-family: var(--mono); font-size: 13px; background: #f6f8fa; border-radius: 12px;
  padding: 12px; word-break: break-all; border: 1px solid var(--line);
}
.doc pre {
  background: #17202a; color: #f4f6f8; border-radius: 14px; padding: 14px; overflow: auto; font-size: 13px;
}
.doc code { font-family: var(--mono); }
.doc h2 { margin-top: 28px; }
.doc p, .doc li { color: var(--ink); }
.doc ul { padding-inline-start: 18px; }
@media (max-width: 720px) {
  .row2 { grid-template-columns: 1fr; }
  .sheet h1 { font-size: 26px; }
  .sheet-head { align-items: flex-start; flex-direction: column; }
}
.admin-body { background: #f4f7fb; min-height: 100vh; color: #1e293b; }
.admin-body .primary, .admin-body button.primary { background: #2f6fed; border-color: #2f6fed; color: #fff; }
.learn-actions .primary, .engine-actions .primary, .engine-actions .ghost { width: auto; }
.engine-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.demo-reply { margin: 8px 0 0; white-space: pre-wrap; }
.admin-body .primary:hover { background: #245ad0; }
.admin-app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; align-items: start; }
.admin-side {
  position: sticky; top: 0; height: 100vh; max-height: 100vh; width: 248px; overflow: auto;
  background: #fff; border-right: 1px solid #e6edf5; padding: 18px 12px;
  display: flex; flex-direction: column; gap: 18px;
}
.admin-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #0f172a; padding: 4px 8px 8px; }
.admin-logo span {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: #2f6fed; color: white; font-weight: 750;
}
.admin-logo strong { font-size: 16px; }
.admin-side nav { display: flex; flex-direction: column; gap: 2px; }
.admin-side button, .admin-side nav a {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px; flex: none;
  white-space: nowrap; text-align: start;
  border: 0; background: transparent; color: #475569; border-radius: 10px;
  padding: 10px 12px; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none;
}
.admin-side button svg, .admin-side nav a svg { width: 18px; height: 18px; flex: none; }
.admin-side button.on, .admin-side button:hover, .admin-side nav a.on, .admin-side nav a:hover { background: #e8f1ff; color: #2f6fed; }
.admin-foot { margin-top: auto; color: #64748b; text-decoration: none; font-weight: 650; font-size: 13px; padding: 10px 12px; }
.admin-main { padding: 18px 22px 40px; min-width: 0; }
.admin-main h1 { margin: 0 0 6px; letter-spacing: -0.04em; font-size: 28px; }
.admin-top { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.admin-search {
  flex: 1; max-width: 420px; border: 1px solid #e2e8f0; background: #fff;
  border-radius: 12px; padding: 10px 14px;
}
.admin-who { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.admin-who strong { display: block; font-size: 14px; line-height: 1.2; }
.admin-who small { display: block; color: #64748b; font-size: 12px; }
.avatar {
  width: 36px; height: 36px; border-radius: 999px; display: grid; place-items: center;
  background: #dbeafe; color: #1d4ed8; font-weight: 750;
}
.chart-row { display: grid; grid-template-columns: 1.3fr 0.9fr; gap: 16px; margin-bottom: 16px; }
.panel-card {
  background: #fff; border: 1px solid #e6edf5; border-radius: 16px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04); padding: 16px 16px 12px; margin-bottom: 16px;
}
.panel-card header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.panel-card h2 { margin: 0; font-size: 16px; letter-spacing: -0.02em; }
.panel-card canvas { display: block; }
#barChart { width: 100%; height: 230px; }
.pie-wrap { display: flex; align-items: center; gap: 18px; }
#pieChart { width: 180px; height: 180px; flex: none; }
.pie-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: #475569; }
.pie-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 8px; }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.metric {
  background: #fff; border: 1px solid #e6edf5; border-radius: 16px; padding: 16px 18px;
  display: flex; align-items: center; gap: 14px; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}
.metric .bubble {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: #e8f1ff; color: #2f6fed; flex: none;
}
.metric .bubble svg { width: 20px; height: 20px; }
.metric b { display: block; font-size: 26px; letter-spacing: -0.04em; line-height: 1.1; }
.metric span { color: #64748b; font-size: 13px; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding-top: 10px; color: #64748b; font-size: 13px; }
.pager button { border: 1px solid #e2e8f0; background: #fff; border-radius: 8px; padding: 6px 10px; font-size: 13px; }
.pager button:disabled { opacity: 0.45; cursor: default; }
#adminMenu { display: none; }
@media (min-width: 1100px) {
  .metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .chart-row, .jump-grid { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .pie-wrap { justify-content: center; }
  .admin-app { grid-template-columns: 1fr; }
  #adminMenu { display: inline-flex; }
  .admin-side {
    position: fixed; top: 0; left: 0; height: 100vh; max-height: 100vh; width: min(84vw, 280px); z-index: 30;
    transform: translateX(-105%); transition: transform 180ms ease; box-shadow: var(--shadow);
  }
  body.admin-nav-open .admin-side { transform: none; }
  .admin-main { padding: 16px 14px 40px; }
  .admin-who small { display: none; }
  .admin-search { max-width: none; }
  .admin-top { position: static; flex-wrap: wrap; }
  .admin-who { margin-left: 0; width: 100%; justify-content: space-between; }
}
@media (max-width: 560px) {
  .metric-grid, .dev-grid, .dev-pills { grid-template-columns: 1fr; }
  .admin-who strong { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
.dev-sheet { max-width: 1080px; }
.dev-hero { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; margin-bottom: 16px; flex-wrap: wrap; }
.dev-hero h1 { margin-bottom: 6px; }
.dev-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.dev-pills span { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 650; }
.dev-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 16px; }
.dev-points { margin: 12px 0; padding-inline-start: 18px; }
.dev-points li { margin: 6px 0; }
.dev-tabs { display: flex; gap: 8px; margin-bottom: 10px; }
.dev-tabs button { width: auto; border-radius: 999px; padding: 6px 12px; }
.dev-tabs button.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.dev-reply, .dev-sample { white-space: pre-wrap; word-break: break-word; }
.card a.primary { display: inline-block; width: auto; text-decoration: none; text-align: center; padding: 10px 16px; }
.admin-top { position: sticky; top: 0; z-index: 4; background: rgba(244, 247, 251, 0.92); backdrop-filter: blur(8px); padding: 8px 0; margin-bottom: 8px; }
#hourChart, #rankChart { width: 100%; height: 180px; }
.panel-card header .quiet { font-size: 13px; }
