/* =========================================================
   Capitlab design system
   Font: Be Vietnam Pro (chữ), JetBrains Mono (nhãn kỹ thuật)
   Theme: sáng/tối theo hệ thống, có nút chuyển
   ========================================================= */

:root {
  --bg: #f7f9fb;
  --bg-soft: #eef2f6;
  --surface: #ffffff;
  --surface-2: #f3f6f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --accent: #0891b2;
  --accent-ink: #ffffff;
  --accent-soft: rgba(8, 145, 178, 0.1);
  --violet: #7c3aed;
  --amber: #d97706;
  --ok: #059669;
  --grid-line: rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px -8px rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 24px 60px -12px rgba(15, 23, 42, 0.25);
  --header-bg: rgba(247, 249, 251, 0.78);
  --code-bg: #0f172a;
  --code-text: #e2e8f0;
  --mix: #ffffff;
  --ink: 58%;

  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --max: 1200px;
  --header-h: 64px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0e13;
    --bg-soft: #0f141b;
    --surface: #111821;
    --surface-2: #161f2a;
    --border: #1e2a38;
    --border-strong: #2b3a4d;
    --text: #e8eef5;
    --text-2: #c3cedb;
    --muted: #8696aa;
    --accent: #22d3ee;
    --accent-ink: #04141a;
    --accent-soft: rgba(34, 211, 238, 0.12);
    --violet: #a78bfa;
    --amber: #f59e0b;
    --ok: #34d399;
    --grid-line: rgba(148, 163, 184, 0.07);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px -10px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, 0.8);
    --header-bg: rgba(10, 14, 19, 0.72);
    --code-bg: #0b1118;
    --code-text: #e2e8f0;
    --mix: #0a0e13;
    --ink: 100%;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0e13;
  --bg-soft: #0f141b;
  --surface: #111821;
  --surface-2: #161f2a;
  --border: #1e2a38;
  --border-strong: #2b3a4d;
  --text: #e8eef5;
  --text-2: #c3cedb;
  --muted: #8696aa;
  --accent: #22d3ee;
  --accent-ink: #04141a;
  --accent-soft: rgba(34, 211, 238, 0.12);
  --violet: #a78bfa;
  --amber: #f59e0b;
  --ok: #34d399;
  --grid-line: rgba(148, 163, 184, 0.07);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px -10px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, 0.8);
  --header-bg: rgba(10, 14, 19, 0.72);
  --code-bg: #0b1118;
  --code-text: #e2e8f0;
  --mix: #0a0e13;
  --ink: 100%;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
main { flex: 1; padding-bottom: 72px; }
body:not(.is-home) main { padding-top: 40px; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0; letter-spacing: -0.02em; font-weight: 700; }
p { margin: 0 0 1em; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.mono { font-family: var(--mono); }
.icon { width: 18px; height: 18px; flex: none; }
kbd {
  font-family: var(--mono);
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  line-height: 1.4;
}

.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.skip-link:focus { left: 12px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--accent);
  text-transform: none;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 20%, transparent); display: inline-block; flex: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.site-header.is-scrolled { border-bottom-color: var(--border); box-shadow: var(--shadow-sm); }
.header-row { display: flex; align-items: center; gap: 28px; height: var(--header-h); }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 1.15rem; letter-spacing: -0.03em; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 9px;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1rem;
  color: #fff;
  background: linear-gradient(135deg, #06b6d4, #7c3aed);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2), 0 4px 14px -4px rgba(124, 58, 237, 0.6);
}
.brand-text b { font-weight: 800; color: var(--accent); }

.main-nav { display: flex; gap: 4px; }
.main-nav a {
  color: var(--text-2);
  font-weight: 500;
  font-size: 0.94rem;
  padding: 7px 12px;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}
.main-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.main-nav a.is-active { color: var(--accent); background: var(--accent-soft); }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.search-trigger {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 8px 0 12px;
  min-width: 220px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: 10px;
  font-size: 0.9rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-trigger:hover { text-decoration: none; border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.search-trigger-text { flex: 1; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  height: 38px; min-width: 38px; padding: 0 9px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--mono);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); text-decoration: none; border-color: var(--border); }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: none; }
  :root:not([data-theme="light"]) .i-moon { display: block; }
}
.menu-btn { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 20px;
  border-radius: 12px;
  font: inherit; font-weight: 600; font-size: 0.97rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s var(--ease), box-shadow 0.15s, background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 24px -10px var(--accent); }
.btn-primary:hover { box-shadow: 0 12px 28px -10px var(--accent); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--border-strong); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 88px 0 96px; border-bottom: 1px solid var(--border); }
.hero-bg {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 40%, transparent 100%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 40%, transparent 100%);
}
.glow { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.35; }
.g1 { width: 460px; height: 460px; background: #06b6d4; top: -160px; left: -80px; }
.g2 { width: 420px; height: 420px; background: #7c3aed; top: -60px; right: -120px; opacity: 0.25; }
.hero-grid { position: relative; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(2.3rem, 5.2vw, 3.9rem); font-weight: 800; letter-spacing: -0.035em; line-height: 1.08; margin: 18px 0 20px; }
.grad { background: linear-gradient(100deg, #06b6d4 0%, #7c3aed 60%, #db2777 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lead { font-size: 1.12rem; color: var(--text-2); max-width: 580px; margin-bottom: 30px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.stats { display: flex; gap: 36px; margin: 40px 0 0; padding: 0; }
.stats div { display: flex; flex-direction: column; }
.stats dt { font-size: 1.8rem; font-weight: 600; color: var(--text); line-height: 1.1; }
.stats dd { margin: 4px 0 0; color: var(--muted); font-size: 0.88rem; }

.terminal {
  background: #0b1118;
  border: 1px solid #1e2a38;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(34, 211, 238, 0.06);
  overflow: hidden;
  transform: perspective(1400px) rotateY(-6deg) rotateX(2deg);
  transition: transform 0.5s var(--ease);
}
.terminal:hover { transform: none; }
.terminal-bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-bottom: 1px solid #1a2532; background: #0f1720; }
.terminal-bar span { width: 11px; height: 11px; border-radius: 50%; background: #334155; }
.terminal-bar span:nth-child(1) { background: #f87171; }
.terminal-bar span:nth-child(2) { background: #fbbf24; }
.terminal-bar span:nth-child(3) { background: #34d399; }
.terminal-bar em { margin-left: auto; font-style: normal; font-size: 0.75rem; color: #64748b; }
.terminal-body { margin: 0; padding: 22px 22px 26px; font-size: 0.86rem; line-height: 1.85; color: #cbd5e1; background: transparent; white-space: pre; overflow-x: auto; }
.c-mute { color: #64748b; }
.c-acc { color: #22d3ee; }
.c-ok { color: #34d399; }
.c-num { color: #fbbf24; }
.c-str { color: #a78bfa; }
.caret { display: inline-block; width: 8px; height: 1.05em; background: #22d3ee; vertical-align: text-bottom; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Sections ---------- */
.section { padding-top: 72px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.section-head h2 { font-size: clamp(1.4rem, 2.6vw, 1.85rem); margin-top: 8px; }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 0.92rem; white-space: nowrap; }
.link-arrow .icon { width: 16px; height: 16px; transition: transform 0.2s var(--ease); }
.link-arrow:hover { text-decoration: none; }
.link-arrow:hover .icon { transform: translateX(3px); }
.split { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; }
.stack { display: flex; flex-direction: column; gap: 14px; }

/* ---------- Topics ---------- */
.topics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.topic {
  position: relative;
  display: flex; flex-direction: column; gap: 8px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  overflow: hidden;
  transition: transform 0.2s var(--ease), border-color 0.2s, box-shadow 0.2s;
}
.topic::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(400px circle at 0% 0%, color-mix(in srgb, var(--c) 14%, transparent), transparent 60%);
  opacity: 0; transition: opacity 0.25s;
}
.topic:hover { text-decoration: none; transform: translateY(-3px); border-color: color-mix(in srgb, var(--c) 50%, var(--border)); box-shadow: var(--shadow); }
.topic:hover::before { opacity: 1; }
.topic-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  color: color-mix(in srgb, var(--c) var(--ink), #000);
  background: color-mix(in srgb, var(--c) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 25%, transparent);
  margin-bottom: 6px;
}
.topic-icon .icon { width: 22px; height: 22px; }
.topic-icon.lg { width: 52px; height: 52px; display: inline-grid; vertical-align: middle; margin: 0 14px 0 0; }
.topic-icon.lg .icon { width: 26px; height: 26px; }
.topic-name { font-weight: 700; font-size: 1.05rem; }
.topic-desc { color: var(--muted); font-size: 0.9rem; line-height: 1.55; }
.topic-count { margin-top: auto; padding-top: 8px; display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; color: color-mix(in srgb, var(--c) var(--ink), #000); }
.topic-count .icon { width: 14px; height: 14px; transition: transform 0.2s var(--ease); }
.topic:hover .topic-count .icon { transform: translateX(3px); }

/* ---------- Cards ---------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s var(--ease), border-color 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.card-body { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px 20px; flex: 1; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.card-title { font-size: 1.08rem; font-weight: 700; line-height: 1.35; }
.card-title a { color: var(--text); }
.card-title a:hover { text-decoration: none; color: var(--accent); }
.card-text { color: var(--muted); font-size: 0.92rem; margin: 0; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.stretched::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card .tags, .row .tags, .tcard .tags { position: relative; z-index: 2; margin-top: auto; }

.cover { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s var(--ease); }
.card:hover .cover img { transform: scale(1.04); }
.cover-gen {
  display: grid; place-items: center;
  background:
    radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--c) 30%, transparent), transparent 60%),
    radial-gradient(90% 80% at 0% 100%, color-mix(in srgb, var(--c) 16%, transparent), transparent 60%),
    var(--surface-2);
}
.cover-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(color-mix(in srgb, var(--c) 14%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--c) 14%, transparent) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 20%, transparent 75%);
  mask-image: radial-gradient(circle at 50% 50%, #000 20%, transparent 75%);
}
.cover-icon { position: relative; width: 56px; height: 56px; color: var(--c); stroke-width: 1.4; filter: drop-shadow(0 0 18px color-mix(in srgb, var(--c) 60%, transparent)); transition: transform 0.4s var(--ease); }
.card:hover .cover-icon { transform: scale(1.08) rotate(-3deg); }
.cover-label { position: absolute; left: 14px; bottom: 12px; font-family: var(--mono); font-size: 0.72rem; color: var(--text-2); background: color-mix(in srgb, var(--surface) 80%, transparent); border: 1px solid var(--border); padding: 3px 8px; border-radius: 6px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.74rem; font-weight: 600;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  color: color-mix(in srgb, var(--c) var(--ink), #000);
  background: color-mix(in srgb, var(--c) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 22%, transparent);
  width: fit-content;
  white-space: nowrap;
}
.pill .icon { width: 14px; height: 14px; }
a.pill:hover { text-decoration: none; background: color-mix(in srgb, var(--c) 18%, transparent); }
.meta { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--muted); font-family: var(--mono); }
.meta .icon { width: 14px; height: 14px; }
.badge { display: inline-flex; align-items: center; font-size: 0.72rem; font-weight: 700; padding: 3px 9px; border-radius: 6px; background: color-mix(in srgb, var(--amber) 16%, transparent); color: var(--amber); border: 1px solid color-mix(in srgb, var(--amber) 28%, transparent); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 6px;
  transition: color 0.15s, border-color 0.15s;
}
a.tag:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.tag-more { border-style: dashed; }

/* Rows (bài viết) */
.list { display: flex; flex-direction: column; gap: 12px; }
.row {
  position: relative;
  display: grid; grid-template-columns: 110px 1fr auto; gap: 20px; align-items: start;
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s var(--ease);
}
.row:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-2px); }
.row-date { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); padding-top: 3px; }
.row-main { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.row-top { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-title { font-size: 1.08rem; line-height: 1.35; }
.row-title a { color: var(--text); }
.row-title a:hover { text-decoration: none; color: var(--accent); }
.row-text { color: var(--muted); font-size: 0.93rem; margin: 0; }
.row-arrow { color: var(--muted); align-self: center; transition: transform 0.2s var(--ease), color 0.2s; }
.row:hover .row-arrow { color: var(--accent); transform: translateX(4px); }

/* Tutorial cards */
.tcard {
  position: relative;
  display: flex; flex-direction: column; gap: 10px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s var(--ease), border-color 0.2s, box-shadow 0.2s;
}
.tcard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--c); opacity: 0.8; }
.tcard:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.tcard-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 6px; }
.step-dots { display: inline-flex; gap: 5px; }
.step-dots span { width: 18px; height: 4px; border-radius: 4px; background: color-mix(in srgb, var(--c) 35%, var(--border)); }
.step-dots span:first-child { background: var(--c); }

/* CTA band */
.cta-band {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 40px 44px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background:
    radial-gradient(600px circle at 100% 0%, color-mix(in srgb, #7c3aed 18%, transparent), transparent 60%),
    radial-gradient(500px circle at 0% 100%, color-mix(in srgb, #06b6d4 18%, transparent), transparent 60%),
    var(--surface);
}
.cta-band h2 { font-size: clamp(1.3rem, 2.4vw, 1.7rem); margin-bottom: 8px; }
.cta-band p { color: var(--text-2); margin: 0; max-width: 620px; }

/* ---------- Page head + toolbar ---------- */
.page-head { padding: 8px 0 28px; border-bottom: 1px solid var(--border); margin-bottom: 28px; }
.page-head h1 { font-size: clamp(2rem, 4.4vw, 2.9rem); font-weight: 800; letter-spacing: -0.03em; margin: 12px 0 12px; display: flex; align-items: center; flex-wrap: wrap; }
.page-lead { color: var(--text-2); font-size: 1.08rem; max-width: 680px; margin: 0; }
.page-count { display: inline-block; margin-top: 16px; font-size: 0.78rem; color: var(--muted); border: 1px solid var(--border); padding: 3px 10px; border-radius: 999px; }

.toolbar { display: flex; flex-direction: column; gap: 14px; margin-bottom: 26px; }
.input-icon { position: relative; display: block; max-width: 460px; }
.input-icon > .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon .input { padding-left: 42px; }
.input {
  width: 100%;
  font: inherit;
  font-size: 0.95rem;
  padding: 11px 14px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder { color: var(--muted); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.input-lg { font-size: 1.1rem; padding: 16px 18px 16px 46px; }
.search-big { margin-bottom: 28px; }
.search-big .input-icon { max-width: 720px; }
textarea.input { resize: vertical; min-height: 130px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  --c: var(--accent);
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-size: 0.84rem; font-weight: 500;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s;
}
.chip .icon { width: 15px; height: 15px; color: color-mix(in srgb, var(--c) var(--ink), #000); }
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.is-active { background: color-mix(in srgb, var(--c) 14%, var(--surface)); border-color: color-mix(in srgb, var(--c) 45%, transparent); color: var(--text); }

.empty { color: var(--muted); padding: 20px 0; }

/* ---------- Detail ---------- */
.read-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; pointer-events: none; }
.read-progress span { display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, #06b6d4, #7c3aed); }

.detail-wrap { display: grid; grid-template-columns: minmax(0, 760px); justify-content: center; gap: 56px; }
.detail-wrap.has-toc { grid-template-columns: minmax(0, 760px) 240px; }
.breadcrumb { display: flex; gap: 8px; flex-wrap: wrap; font-size: 0.8rem; color: var(--muted); margin-bottom: 26px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span[aria-current] { color: var(--text-2); }
.detail-head { display: flex; flex-direction: column; gap: 14px; margin-bottom: 30px; }
.detail-head h1 { font-size: clamp(1.9rem, 4.2vw, 2.75rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; }
.lead { font-size: 1.15rem; color: var(--text-2); margin: 0; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; color: var(--muted); font-size: 0.8rem; padding-top: 14px; border-top: 1px solid var(--border); }
.detail-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.detail-meta .icon { width: 15px; height: 15px; }
.detail-cover { border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 34px; }
.detail-cover .cover-icon { width: 80px; height: 80px; }

.prose { font-size: 1.06rem; line-height: 1.8; color: var(--text-2); overflow-wrap: break-word; }
.prose > * + * { margin-top: 1.1em; }
.prose > :first-child { margin-top: 0; }
.prose p { margin-bottom: 0; }
.prose h2, .prose h3 { color: var(--text); margin-top: 2em; scroll-margin-top: calc(var(--header-h) + 20px); }
.prose h2 { font-size: 1.55rem; }
.prose h3 { font-size: 1.25rem; }
.prose ul, .prose ol { padding-left: 1.4em; margin-bottom: 0; }
.prose li { margin: 0.4em 0; padding-left: 0.2em; }
.prose ol { counter-reset: s; list-style: none; padding-left: 0; }
.prose ol > li { counter-increment: s; position: relative; padding: 14px 16px 14px 56px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin: 10px 0; }
.prose ol > li::before {
  content: counter(s, decimal-leading-zero);
  position: absolute; left: 14px; top: 16px;
  font-family: var(--mono); font-size: 0.8rem; font-weight: 600;
  color: var(--accent); background: var(--accent-soft);
  width: 30px; height: 26px; display: grid; place-items: center; border-radius: 7px;
}
.prose a { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--accent); }
.prose img { border-radius: 12px; border: 1px solid var(--border); }
.prose blockquote { margin-left: 0; margin-right: 0; margin-bottom: 0; padding: 4px 18px; border-left: 3px solid var(--accent); color: var(--text-2); background: var(--accent-soft); border-radius: 0 10px 10px 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.94rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.prose th { background: var(--surface-2); color: var(--text); }
.prose :not(pre) > code { font-family: var(--mono); font-size: 0.86em; background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; color: var(--text); }
.prose pre, pre.code {
  font-variant-ligatures: none;
  font-feature-settings: "calt" 0, "liga" 0;
  position: relative;
  font-family: var(--mono);
  font-size: 0.88rem;
  line-height: 1.7;
  background: var(--code-bg);
  color: var(--code-text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 0;
  overflow-x: auto;
}
.copy-btn {
  position: absolute; top: 8px; right: 8px;
  font-family: var(--mono); font-size: 0.72rem;
  padding: 4px 9px; border-radius: 6px;
  border: 1px solid #2b3a4d; background: #111821; color: #94a3b8;
  cursor: pointer; opacity: 0; transition: opacity 0.15s;
}
.prose pre:hover .copy-btn, .copy-btn:focus-visible { opacity: 1; }
.detail > .tags { margin-top: 36px; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 44px; }
.pager-link { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); transition: border-color 0.2s, transform 0.2s var(--ease); }
.pager-link:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); }
.pager-link.next { text-align: right; align-items: flex-end; }
.pager-link strong { font-size: 0.98rem; line-height: 1.35; }

.toc { position: sticky; top: calc(var(--header-h) + 32px); align-self: start; padding-left: 20px; border-left: 1px solid var(--border); }
.toc ol { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 2px; }
.toc a { display: block; padding: 5px 10px; margin-left: -11px; border-left: 2px solid transparent; color: var(--muted); font-size: 0.88rem; line-height: 1.4; }
.toc .lv3 a { padding-left: 22px; }
.toc a:hover { color: var(--text); text-decoration: none; }
.toc a.is-active { color: var(--accent); border-left-color: var(--accent); }

.comments { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--border); }
.comments h2 { font-size: 1.25rem; margin-bottom: 14px; }
.note { font-size: 0.9rem; color: var(--muted); background: var(--surface-2); border: 1px dashed var(--border-strong); padding: 12px 16px; border-radius: 10px; margin: 0; }
.note.success { color: var(--ok); border-style: solid; border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: color-mix(in srgb, var(--ok) 10%, transparent); margin-bottom: 16px; }

/* ---------- Contact ---------- */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.contact .page-head { border: 0; margin-bottom: 8px; padding-bottom: 0; }
.reasons { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-direction: column; gap: 18px; }
.reasons li { display: flex; gap: 14px; }
.reasons strong { display: block; margin-bottom: 2px; }
.reasons p { margin: 0; color: var(--muted); font-size: 0.93rem; }
.reason-icon { width: 42px; height: 42px; flex: none; border-radius: 11px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow); }
.form { display: flex; flex-direction: column; gap: 16px; margin-bottom: 16px; }
.form label { display: flex; flex-direction: column; gap: 7px; font-weight: 600; font-size: 0.9rem; }
.form .btn { align-self: flex-start; }

/* ---------- 404 ---------- */
.not-found { text-align: center; padding: 60px 24px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.nf-code { font-size: clamp(5rem, 16vw, 9rem); font-weight: 600; line-height: 1; background: linear-gradient(100deg, #06b6d4, #7c3aed); -webkit-background-clip: text; background-clip: text; color: transparent; }
.not-found h1 { font-size: 1.8rem; }
.not-found p { color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-soft); padding-top: 56px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 40px; }
.footer-brand p { color: var(--muted); font-size: 0.92rem; margin: 14px 0; max-width: 340px; }
.status-line { display: inline-flex; align-items: center; gap: 10px; font-size: 0.8rem; color: var(--text-2); }
.site-footer h3 { font-size: 0.78rem; font-family: var(--mono); font-weight: 500; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.site-footer ul a { color: var(--text-2); font-size: 0.92rem; }
.site-footer ul a:hover { color: var(--accent); text-decoration: none; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; padding-top: 20px; padding-bottom: 28px; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.82rem; }

/* ---------- Command palette ---------- */
.cmdk { position: fixed; inset: 0; z-index: 100; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.cmdk-backdrop { position: absolute; inset: 0; background: rgba(2, 6, 12, 0.55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fade 0.15s ease; }
.cmdk-panel { position: relative; width: 100%; max-width: 640px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; animation: pop 0.18s var(--ease); }
.cmdk-input-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); color: var(--muted); }
.cmdk-input-row input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 1.05rem; }
.cmdk-input-row input::-webkit-search-cancel-button { display: none; }
.cmdk-list { list-style: none; margin: 0; padding: 8px; max-height: min(420px, 55vh); overflow-y: auto; }
.cmdk-group { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); padding: 8px 10px 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.cmdk-item a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--text); }
.cmdk-item a:hover { text-decoration: none; }
.cmdk-item.is-active a { background: var(--accent-soft); }
.cmdk-item .ck-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--c, var(--accent)); }
.cmdk-item .ck-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cmdk-item .ck-title { font-weight: 600; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk-item .ck-sub { font-size: 0.8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk-item .ck-type { font-family: var(--mono); font-size: 0.7rem; color: var(--muted); border: 1px solid var(--border); padding: 1px 7px; border-radius: 6px; flex: none; }
.cmdk-empty { padding: 24px; text-align: center; color: var(--muted); }
.cmdk-foot { display: flex; gap: 18px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 0.72rem; color: var(--muted); background: var(--surface-2); }
.cmdk-foot kbd { margin-right: 3px; }
body.cmdk-open { overflow: hidden; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(-8px) scale(0.98); } }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .detail-wrap.has-toc { grid-template-columns: minmax(0, 760px); }
  .toc { display: none; }
  .search-trigger { min-width: 0; }
  .search-trigger-text, .search-trigger kbd { display: none; }
  .search-trigger { width: 38px; padding: 0; justify-content: center; }
}
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 44px; }
  .terminal { transform: none; max-width: 560px; }
  .grid, .topics { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; gap: 64px; }
  .contact { grid-template-columns: 1fr; gap: 32px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .menu-btn { display: inline-flex; }
  .main-nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; gap: 2px;
    padding: 10px 16px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: none;
  }
  .main-nav a { padding: 12px 14px; font-size: 1rem; }
  .site-header.nav-open .main-nav { display: flex; animation: pop 0.18s var(--ease); }
  .header-row { gap: 12px; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .hero { padding: 56px 0 64px; }
  .hero-lead { font-size: 1.02rem; }
  .stats { gap: 24px; }
  .grid, .topics { grid-template-columns: 1fr; }
  .section { padding-top: 56px; }
  .section-head { flex-wrap: wrap; }
  .row { grid-template-columns: 1fr; gap: 6px; padding: 18px; }
  .row-date { padding: 0; }
  .row-arrow { display: none; }
  .cta-band { flex-direction: column; align-items: flex-start; padding: 28px 22px; }
  .pager { grid-template-columns: 1fr; }
  .pager-link.next { text-align: left; align-items: flex-start; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; gap: 6px; }
  .terminal-body { font-size: 0.78rem; padding: 16px; }
  .panel { padding: 20px; }
  .lang-btn span { display: none; }
  body:not(.is-home) main { padding-top: 28px; }
  .cmdk { padding-top: 8vh; }
  .cmdk-foot { display: none; }
  .prose ol > li { padding-left: 52px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .terminal { transform: none; }
}

@media print {
  .site-header, .site-footer, .toc, .pager, .comments, .read-progress, .cmdk { display: none !important; }
  body { background: #fff; color: #000; }
}

/* Trường bẫy spam (honeypot): ẩn với người dùng, bot vẫn thấy trong HTML */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Tô màu code (highlight.js, chạy lúc build) */
.prose pre[data-lang]::before {
  content: attr(data-lang);
  position: absolute; top: 8px; right: 12px;
  font-family: var(--mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: #64748b; pointer-events: none; transition: opacity 0.15s;
}
.prose pre:hover::before { opacity: 0; }
.prose pre code { background: none; border: 0; padding: 0; font-family: inherit; font-size: inherit; color: inherit; }
.hljs-comment, .hljs-quote { color: #64748b; font-style: normal; }
.hljs-keyword, .hljs-selector-tag, .hljs-doctag { color: #c4b5fd; }
.hljs-type, .hljs-built_in, .hljs-class .hljs-title, .hljs-title.class_ { color: #67e8f9; }
.hljs-title, .hljs-title.function_, .hljs-section { color: #93c5fd; }
.hljs-string, .hljs-regexp, .hljs-char, .hljs-template-variable { color: #86efac; }
.hljs-number, .hljs-literal, .hljs-symbol, .hljs-bullet { color: #fcd34d; }
.hljs-meta, .hljs-meta .hljs-keyword { color: #f9a8d4; }
.hljs-meta .hljs-string { color: #86efac; }
.hljs-attr, .hljs-attribute, .hljs-variable, .hljs-params { color: #fdba74; }
.hljs-addition { color: #86efac; background: rgba(134, 239, 172, 0.08); }
.hljs-deletion { color: #fca5a5; background: rgba(252, 165, 165, 0.08); }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 700; }
.detail > .note { margin-bottom: 24px; }

/* Series */
.series-box{margin:0 0 28px;padding:16px 20px;border:1px solid var(--border);border-radius:12px;background:var(--surface)}
.series-box ol{list-style:none;margin:10px 0 0;padding:0;display:grid;gap:6px}
.series-box li{font-size:.95rem}
.series-box li .mono{opacity:.6;margin-right:6px}
.series-box li.current{font-weight:600}
.series-box li.soon{opacity:.55}
.series-box li.soon em{font-style:normal;font-size:.75rem;margin-left:6px;padding:1px 8px;border:1px solid currentColor;border-radius:99px}

/* Công cụ */
.btn-sm { padding: 6px 12px; font-size: 0.8125rem; }
.tool-wrap { padding-bottom: 48px; }
.tool-panel { padding: 24px; }
.tabs { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 20px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.tab { font: inherit; font-weight: 500; font-size: 0.875rem; color: var(--muted); border: 0; background: transparent; padding: 8px 14px; border-radius: 9px; cursor: pointer; }
.tab[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tool-field { display: grid; gap: 6px; margin-bottom: 14px; }
.tool-field > span { font-size: 0.8125rem; font-weight: 600; }
.tool-field textarea { resize: vertical; min-height: 84px; }
.tool-row { display: flex; gap: 14px; flex-wrap: wrap; }
.tool-row .tool-field { min-width: 160px; }
.tool-row .grow { flex: 1 1 240px; }
.tool-actions { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.tool-meta { font-size: 0.8125rem; opacity: .7; }
.tool-sec { margin-top: 24px; }
.tool-sec h3 { font-size: 0.9375rem; margin: 0 0 10px; }
.tool-line { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.tool-line code { flex: 1; overflow-wrap: anywhere; font-size: 0.875rem; }
.tool-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.tool-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.tool-table th, .tool-table td { padding: 9px 14px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tool-table th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: .04em; background: var(--surface-2); }
.tool-table tr:last-child td { border-bottom: 0; }
.tool-table td.val { overflow-wrap: anywhere; white-space: normal; }
.tool-result { display: flex; align-items: center; gap: 12px; padding: 10px 14px; margin-bottom: 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); flex-wrap: wrap; }
.tool-label { font-size: 0.8125rem; font-weight: 600; min-width: 130px; }
.tool-result code { flex: 1; overflow-wrap: anywhere; }
.tool-result code.big { font-size: 1.25rem; font-weight: 600; }
.tool-hint { font-size: 0.8125rem; opacity: .7; margin-top: 12px; }
.tool-local { display: flex; align-items: center; gap: 8px; margin: 14px 0 32px; font-size: 0.875rem; opacity: .75; }
.tool-local .icon { width: 16px; height: 16px; }
.note.error { border-color: #ef4444; }
.tool-notes ul { padding-left: 1.2em; }
[hidden] { display: none !important; }

.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 8px 20px; align-items: start; }
.tool-grid + .tool-grid { margin-top: 0; }

/* ---------- Trang quản trị (/admin/) ---------- */
.admin { padding-bottom: 64px; }
.admin-bar { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 16px; margin-top: 18px; }
.admin-range { display: grid; gap: 6px; font-size: 0.82rem; color: var(--muted); }
.admin-range .input { padding: 10px 14px; min-width: 160px; }
.admin-user { color: var(--muted); font-size: 0.82rem; margin-left: auto; }
.admin-block { margin-top: 40px; }
.admin-block > h2 { font-size: 1.35rem; letter-spacing: -0.02em; margin: 0 0 16px; }
.admin .panel { padding: 20px; }
.admin .panel h3 { font-size: 0.95rem; margin: 0 0 12px; }
.admin-sub { font-size: 0.9rem; margin: 18px 0 8px; }
.admin-cols { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); margin-top: 16px; }
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 4px; }
.kpi-label { font-size: 0.78rem; color: var(--muted); }
.kpi-value { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.kpi-sub { font-size: 0.74rem; color: var(--muted); }
.admin-chart { margin-top: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.chart-svg { width: 100%; height: 190px; display: block; }
.chart-grid { stroke: var(--border); stroke-width: 1; }
.chart-axis { fill: var(--muted); font-size: 10px; font-family: var(--mono); }
.chart-bar { fill: var(--accent); }
.chart-bar:hover { opacity: 0.75; }
.rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rank-row { position: relative; display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; overflow: hidden; font-size: 0.88rem; }
.rank-bar { position: absolute; inset: 0 auto 0 0; width: var(--w, 0); background: var(--accent-soft); z-index: 0; }
.rank-row > :not(.rank-bar) { position: relative; z-index: 1; }
.rank-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.rank-value { color: var(--muted); font-size: 0.8rem; white-space: nowrap; }
.rank-empty { color: var(--muted); font-size: 0.88rem; padding: 6px 10px; }
.rank.plain .rank-row { background: var(--surface-2); }
.admin .badge { background: var(--surface-2); color: var(--muted); border-color: var(--border); }
.admin .badge.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.admin .badge.bad { background: color-mix(in srgb, #ef4444 14%, transparent); color: #ef4444; border-color: color-mix(in srgb, #ef4444 30%, transparent); }
.admin .badge.warn { background: color-mix(in srgb, var(--amber) 16%, transparent); color: var(--amber); border-color: color-mix(in srgb, var(--amber) 30%, transparent); }
.note.warn { color: var(--text-2); border-color: var(--amber); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.admin-table th, .admin-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.admin-table th { font-size: 0.76rem; color: var(--muted); font-weight: 600; }
.progress { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin: 8px 0 6px; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.checklist li { display: flex; gap: 12px; align-items: flex-start; }
.checklist p { margin: 4px 0 0; font-size: 0.86rem; }
.admin .muted { color: var(--muted); }
@media (max-width: 640px) { .admin-user { margin-left: 0; } .admin-table { display: block; overflow-x: auto; } }
