:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-soft: #f0f1f6;
  --ink: #11131a;
  --muted: #6f7380;
  --line: #e3e5ec;
  --primary: #7657f6;
  --primary-dark: #6342e8;
  --primary-soft: #eee9ff;
  --dark: #0b0d12;
  --dark-2: #12151d;
  --success: #14875b;
  --danger: #c8394c;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow: 0 18px 50px rgba(22, 25, 35, 0.09);
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--sans); color: var(--ink); background: var(--bg); line-height: 1.6; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
.container { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }

.site-header { position: sticky; top: 0; z-index: 50; background: rgba(11, 13, 18, 0.9); backdrop-filter: blur(18px); border-bottom: 1px solid rgba(255,255,255,0.08); }
.navbar { min-height: 74px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 800; font-size: 1.2rem; letter-spacing: -0.03em; }
.brand > span > span { color: var(--primary); }
.site-header .brand { color: #fff; }
.nav-links { display: flex; align-items: center; gap: 30px; color: #c2c6d1; font-size: 0.92rem; }
.nav-links > a:not(.button):hover { color: #fff; }

.button { min-height: 44px; padding: 0 18px; border: 1px solid transparent; border-radius: var(--radius-sm); display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 750; font-size: 0.92rem; transition: .2s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: #fff; background: var(--primary); box-shadow: 0 10px 24px rgba(118,87,246,.25); }
.button-primary:hover { background: var(--primary-dark); }
.button-secondary { color: var(--ink); background: var(--surface); border-color: var(--line); }
.button-secondary:hover { border-color: #c9cbd5; }
.button-dark { background: #1b1f2a; color: #e9ebf3; border-color: #2a2f3c; }
.button-ghost { background: transparent; color: inherit; border-color: var(--line); }
.button-small { min-height: 36px; padding-inline: 13px; font-size: .82rem; }
.button-block { width: 100%; }

.hero { background: radial-gradient(circle at 75% 35%, rgba(118,87,246,.23), transparent 32%), var(--dark); color: #fff; padding: 86px 0 0; overflow: hidden; }
.hero-grid { min-height: 440px; display: grid; grid-template-columns: 1.05fr .95fr; gap: 70px; align-items: center; }
.hero-copy { padding-bottom: 55px; }
.hero-pill { display: inline-flex; align-items: center; gap: 9px; padding: 7px 12px; border: 1px solid rgba(255,255,255,.12); border-radius: 999px; color: #cfd2dd; font-size: .76rem; text-transform: uppercase; letter-spacing: .12em; }
.hero-pill span { width: 7px; height: 7px; border-radius: 50%; background: #8a6cff; box-shadow: 0 0 14px #8a6cff; }
.hero h1 { margin: 23px 0 20px; font-size: clamp(3.2rem, 6vw, 5.8rem); line-height: .98; letter-spacing: -.07em; }
.hero h1 em { color: #9278ff; font-style: normal; }
.hero-copy > p { color: #aeb3c1; max-width: 610px; font-size: 1.05rem; }
.hero-actions { display: flex; gap: 12px; margin-top: 30px; }
.hero .button-secondary { background: rgba(255,255,255,.04); color: #fff; border-color: rgba(255,255,255,.14); }
.hero-code-card { position: relative; background: #11141c; border: 1px solid rgba(255,255,255,.12); border-radius: 20px; box-shadow: 0 30px 90px rgba(0,0,0,.42); transform: rotate(1.5deg); overflow: hidden; }
.window-bar { height: 48px; display: flex; align-items: center; gap: 7px; padding: 0 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.window-bar span { width: 10px; height: 10px; border-radius: 50%; background: #3a3f4d; }
.window-bar span:first-child { background: #ff6b74; }
.window-bar span:nth-child(2) { background: #f1bf55; }
.window-bar span:nth-child(3) { background: #65cc85; }
.window-bar small { margin-left: auto; color: #7f8595; font-family: var(--mono); }
.hero-code-card pre { margin: 0; padding: 34px 30px 44px; font: 1rem/1.85 var(--mono); color: #dfe2ec; overflow: auto; }
.code-purple { color: #b49fff; } .code-blue { color: #76c8ff; } .code-green { color: #74d99f; }
.code-glow { position: absolute; width: 170px; height: 170px; right: -50px; bottom: -60px; background: rgba(118,87,246,.34); filter: blur(60px); }
.stats-strip { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid rgba(255,255,255,.1); }
.stats-strip div { padding: 25px 0; display: flex; align-items: baseline; gap: 12px; }
.stats-strip div + div { border-left: 1px solid rgba(255,255,255,.1); padding-left: 40px; }
.stats-strip strong { font-size: 1.55rem; }
.stats-strip span { color: #858b9b; font-size: .85rem; }

.snippet-section { padding: 92px 0 110px; }
.section-heading { display: flex; justify-content: space-between; gap: 40px; align-items: end; }
.eyebrow { color: var(--primary); font-size: .72rem; font-weight: 850; letter-spacing: .16em; }
.section-heading h2, .admin-page-head h1 { margin: 7px 0 0; font-size: clamp(2rem, 4vw, 3rem); line-height: 1.12; letter-spacing: -.045em; }
.section-heading > p { color: var(--muted); max-width: 430px; margin: 0; }
.search-panel { margin-top: 32px; background: var(--surface); border: 1px solid var(--line); padding: 10px; border-radius: 14px; display: grid; grid-template-columns: 1fr 190px auto; gap: 10px; box-shadow: 0 10px 30px rgba(25,27,35,.04); }
.search-input { display: flex; align-items: center; gap: 10px; padding-inline: 12px; }
.search-input span { font-size: 1.35rem; color: var(--muted); }
.search-input input, .search-panel select { border: 0; background: transparent; outline: 0; min-height: 44px; width: 100%; color: var(--ink); }
.search-panel select { border-left: 1px solid var(--line); padding-left: 15px; }
.snippet-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 20px; margin-top: 30px; }
.snippet-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; min-height: 280px; display: flex; flex-direction: column; transition: .22s ease; }
.snippet-card:hover { transform: translateY(-5px); border-color: #d0c8ff; box-shadow: var(--shadow); }
.snippet-card-top, .snippet-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.language-badge { display: inline-flex; align-items: center; gap: 8px; color: #4f3bc3; background: var(--primary-soft); border-radius: 999px; padding: 5px 10px; font-family: var(--mono); font-size: .72rem; font-weight: 800; text-transform: uppercase; }
.language-badge i { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.date-label { font-size: .75rem; color: #9296a2; }
.snippet-card h3 { margin: 23px 0 10px; font-size: 1.23rem; line-height: 1.35; letter-spacing: -.025em; }
.snippet-card h3 a:hover { color: var(--primary); }
.snippet-card > p { color: var(--muted); font-size: .9rem; margin: 0 0 18px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 7px; }
.tag-row span { color: #6c6f7b; background: #f4f4f7; border: 1px solid #e8e9ef; border-radius: 7px; padding: 3px 7px; font: .72rem var(--mono); }
.tag-row.large { margin-top: 20px; }
.snippet-card-footer { margin-top: auto; padding-top: 20px; border-top: 1px solid var(--line); }
.mini-stats { display: flex; gap: 14px; color: #858995; font-size: .78rem; }
.card-link { color: var(--primary); font-weight: 800; font-size: .82rem; }
.card-link span { margin-left: 5px; transition: .2s; display: inline-block; }
.card-link:hover span { transform: translateX(3px); }
.empty-state { text-align: center; background: var(--surface); border: 1px dashed #cfd2dc; border-radius: var(--radius); padding: 70px 20px; margin-top: 30px; }
.empty-state.small { margin: 0; }
.empty-icon { width: 58px; height: 58px; border-radius: 16px; margin: 0 auto 15px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font: 800 1.1rem var(--mono); }
.empty-state h3 { margin: 0 0 6px; }
.empty-state p { margin: 0; color: var(--muted); }
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 36px; }
.pagination a { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; background: var(--surface); border: 1px solid var(--line); font-size: .85rem; }
.pagination a.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.snippet-detail-section { padding: 52px 0 100px; }
.breadcrumb { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: .78rem; white-space: nowrap; overflow: hidden; }
.breadcrumb a { color: var(--primary); }
.detail-header { display: grid; grid-template-columns: 1fr auto; gap: 50px; align-items: end; padding: 48px 0 32px; }
.detail-meta { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: .8rem; }
.detail-header h1 { margin: 16px 0 12px; font-size: clamp(2.2rem,5vw,4rem); letter-spacing: -.055em; line-height: 1.05; }
.detail-header p { color: var(--muted); max-width: 760px; margin: 0; }
.detail-stats { display: flex; gap: 35px; }
.detail-stats div { text-align: right; }
.detail-stats strong { display: block; font-size: 1.7rem; line-height: 1; }
.detail-stats span { color: var(--muted); font-size: .75rem; }
.code-panel { background: #0e1118; color: #e8ebf3; border-radius: 18px; overflow: hidden; box-shadow: 0 24px 70px rgba(13,15,21,.18); }
.code-toolbar, .code-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 18px; border-bottom: 1px solid #282d38; }
.file-label { display: flex; align-items: center; gap: 12px; }
.file-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; background: #211a42; color: #a58fff; font: 700 .78rem var(--mono); }
.file-label strong { display: block; font: .78rem var(--mono); }
.file-label small { display: block; color: #7e8493; font-size: .67rem; margin-top: 2px; }
.toolbar-actions { display: flex; gap: 8px; }
.toolbar-actions .button.copied { background: #174b36; border-color: #246849; }
.code-scroll { overflow: auto; max-height: 680px; }
.code-scroll pre { margin: 0; padding: 25px 28px 30px; min-width: max-content; }
.code-scroll code { font: .88rem/1.75 var(--mono); tab-size: 2; }
.code-footer { border-top: 1px solid #282d38; border-bottom: 0; justify-content: flex-end; color: #707786; font: .66rem var(--mono); }
.detail-bottom-card { margin-top: 26px; padding: 28px 30px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); display: flex; align-items: center; justify-content: space-between; gap: 35px; }
.detail-bottom-card h2 { margin: 6px 0; font-size: 1.35rem; }
.detail-bottom-card p { margin: 0; color: var(--muted); font-size: .9rem; }

.hljs { color: #d9deea; background: transparent; }
.hljs-comment, .hljs-quote { color: #6d7484; font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-literal { color: #b9a3ff; }
.hljs-string, .hljs-doctag, .hljs-regexp { color: #85dda9; }
.hljs-title, .hljs-section, .hljs-function .hljs-title { color: #79c7ff; }
.hljs-number, .hljs-symbol, .hljs-bullet { color: #f3b875; }
.hljs-variable, .hljs-template-variable, .hljs-attribute { color: #f18b9a; }
.hljs-built_in, .hljs-type { color: #69d4c0; }
.hljs-meta { color: #97a4ff; }

.site-footer { background: #101219; color: #d7dae3; border-top: 1px solid #222631; padding: 48px 0; }
.footer-grid { display: flex; justify-content: space-between; align-items: end; gap: 30px; }
.site-footer p { margin: 12px 0 0; color: #828895; font-size: .86rem; }
.footer-meta { display: flex; gap: 20px; color: #747a88; font-size: .75rem; }

.status-page { min-height: 70vh; display: grid; place-items: center; padding: 70px 0; }
.status-card { text-align: center; max-width: 650px; }
.status-code { display: inline-block; color: var(--primary); font: 900 5rem/1 var(--mono); opacity: .25; }
.status-card h1 { margin: 8px 0; font-size: 2.4rem; letter-spacing: -.04em; }
.status-card p { color: var(--muted); margin: 0 auto 24px; }

.auth-body { background: var(--dark); }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1.02fr .98fr; }
.auth-panel { padding: clamp(35px,6vw,85px); }
.auth-brand-panel { color: #fff; display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; background: radial-gradient(circle at 80% 70%, rgba(118,87,246,.3), transparent 35%), #0b0d12; }
.brand-light { color: #fff; }
.auth-brand-panel h1 { margin: 12px 0 18px; font-size: clamp(3rem,5vw,5.4rem); line-height: 1; letter-spacing: -.07em; }
.auth-brand-panel p { color: #9fa5b4; max-width: 610px; }
.auth-terminal { border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.03); border-radius: 12px; padding: 14px 18px; display: flex; justify-content: space-between; font: .78rem var(--mono); color: #898f9e; }
.auth-terminal strong { color: #9f89ff; }
.auth-form-panel { background: #f7f7fa; display: grid; place-items: center; }
.auth-form-wrap { width: min(440px, 100%); }
.auth-form-wrap h2 { margin: 8px 0 5px; font-size: 2.1rem; letter-spacing: -.04em; }
.auth-form-wrap > p { color: var(--muted); margin: 0 0 24px; }
.mobile-brand { display: none; }
.form-stack { display: grid; gap: 16px; }
.form-stack label > span, .form-grid label > span { display: block; font-size: .78rem; font-weight: 800; margin-bottom: 7px; }
.form-stack input, .form-grid input, .form-grid select, .form-grid textarea, .admin-filter input, .admin-filter select { width: 100%; border: 1px solid #dcdfe7; background: #fff; border-radius: 10px; padding: 12px 13px; outline: none; color: var(--ink); }
.form-stack input:focus, .form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus, .admin-filter input:focus, .admin-filter select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.password-field { position: relative; }
.password-field input { padding-right: 80px; }
.password-field button { position: absolute; right: 7px; top: 7px; bottom: 7px; border: 0; background: #f0eefb; color: var(--primary); border-radius: 7px; font-size: .72rem; font-weight: 800; }
.back-link { display: inline-block; color: var(--muted); font-size: .8rem; margin-top: 22px; }
.alert { border-radius: 11px; padding: 12px 14px; margin-bottom: 18px; font-size: .84rem; }
.alert-success { color: #0f6845; background: #e9f8f0; border: 1px solid #c8ecd9; }
.alert-error { color: #9e2637; background: #fff0f2; border: 1px solid #f1ccd2; }
.error-list ul { margin: 7px 0 0 18px; padding: 0; }

.admin-body { background: #f2f3f7; }
.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 250px 1fr; }
.admin-sidebar { position: sticky; top: 0; height: 100vh; background: #0d1017; color: #c6cad5; padding: 22px 16px; display: flex; flex-direction: column; z-index: 80; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 24px; }
.sidebar-head .brand { color: #fff; }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 9px; background: transparent; display: grid; place-items: center; }
.sidebar-close { display: none; color: #fff; border-color: #2d3240; }
.sidebar-nav { display: grid; gap: 5px; }
.sidebar-nav a { display: flex; align-items: center; gap: 12px; border-radius: 10px; padding: 11px 12px; color: #949aa9; font-size: .86rem; font-weight: 700; }
.sidebar-nav a:hover, .sidebar-nav a.active { color: #fff; background: #1a1e28; }
.nav-icon { width: 24px; text-align: center; font: .8rem var(--mono); }
.sidebar-bottom { margin-top: auto; border-top: 1px solid #232734; padding-top: 18px; }
.admin-profile { display: flex; align-items: center; gap: 10px; padding: 0 7px 15px; }
.avatar { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--primary); color: #fff; font-weight: 900; }
.admin-profile strong { display: block; color: #fff; font-size: .83rem; }
.admin-profile span { color: #727887; font-size: .68rem; }
.admin-sidebar .button-ghost { color: #9da3b1; border-color: #2b303d; }
.admin-main { min-width: 0; }
.admin-topbar { height: 72px; padding: 0 28px; background: rgba(255,255,255,.85); backdrop-filter: blur(15px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 40; }
.admin-topbar > div strong { display: block; font-size: .84rem; }
.admin-topbar > div .eyebrow { font-size: .58rem; }
.admin-topbar > a { margin-left: auto; }
.sidebar-toggle { display: none; }
.admin-content { padding: 34px clamp(20px,4vw,48px) 70px; }
.admin-page-head { display: flex; justify-content: space-between; align-items: end; gap: 25px; margin-bottom: 26px; }
.admin-page-head.compact { align-items: start; }
.admin-page-head p { color: var(--muted); margin: 6px 0 0; }
.metric-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 15px; }
.metric-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; gap: 14px; align-items: flex-start; }
.metric-card.accent { background: #131621; color: #fff; border-color: #131621; }
.metric-icon { flex: 0 0 42px; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px; background: var(--primary-soft); color: var(--primary); font: 800 .85rem var(--mono); }
.metric-card small { display: block; color: var(--muted); font-weight: 700; }
.metric-card strong { display: block; font-size: 1.65rem; line-height: 1.25; }
.metric-card p { margin: 3px 0 0; color: #969aa6; font-size: .68rem; }
.metric-card.accent .metric-icon { background: rgba(118,87,246,.22); }
.dashboard-grid { display: grid; grid-template-columns: 1.6fr .8fr; gap: 16px; margin-top: 16px; }
.admin-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.card-head h2 { margin: 5px 0 0; font-size: 1.15rem; }
.card-head > a { color: var(--primary); font-size: .75rem; font-weight: 800; }
.admin-list { display: grid; }
.admin-list-row { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.list-language { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; background: var(--primary-soft); color: var(--primary); font: 800 .72rem var(--mono); }
.list-main strong { display: block; font-size: .82rem; }
.list-main span { color: var(--muted); font-size: .68rem; }
.status-badge { display: inline-flex; justify-content: center; min-width: 72px; padding: 4px 8px; border-radius: 999px; font-size: .65rem; text-transform: uppercase; font-weight: 850; letter-spacing: .04em; }
.status-badge.published { color: #14724f; background: #e7f7ef; }
.status-badge.draft { color: #866314; background: #fff6d9; }
.list-count { color: var(--muted); font-size: .7rem; }
.rank-list { list-style: none; margin: 0; padding: 0; display: grid; }
.rank-list li { display: flex; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); }
.rank-list li > span { color: #b2b5c0; font: 800 .74rem var(--mono); }
.rank-list strong { display: block; font-size: .78rem; }
.rank-list small { display: block; color: var(--muted); font-size: .67rem; }
.empty-compact { padding: 28px 0; color: var(--muted); font-size: .82rem; text-align: center; }
.admin-filter { display: grid; grid-template-columns: 1fr 180px auto; gap: 10px; margin-bottom: 15px; }
.table-card { padding: 0; overflow: hidden; }
.responsive-table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 13px 18px; color: #8a8e99; background: #fafafd; border-bottom: 1px solid var(--line); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; }
td { padding: 15px 18px; border-bottom: 1px solid var(--line); font-size: .8rem; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
.table-title { display: flex; align-items: center; gap: 11px; min-width: 280px; }
.table-title strong { display: block; }
.table-title small { display: block; color: var(--muted); font: .65rem var(--mono); }
.performance { display: flex; gap: 12px; color: var(--muted); white-space: nowrap; }
.table-actions { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.table-actions a, .table-actions button { color: var(--primary); font-size: .72rem; font-weight: 800; background: none; border: 0; padding: 0; }
.table-actions button { color: var(--danger); }
.table-actions form { display: inline; }
.admin-pagination { justify-content: flex-end; }

.editor-layout { display: grid; grid-template-columns: minmax(0,1fr) 290px; gap: 16px; align-items: start; }
.editor-main { padding: 24px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 17px; }
.field-span-two { grid-column: 1 / -1; }
.form-grid small { display: block; color: var(--muted); font-size: .67rem; margin-top: 5px; }
.code-editor-block { margin-top: 20px; border: 1px solid #282d38; border-radius: 13px; overflow: hidden; background: #0e1118; }
.editor-toolbar { height: 44px; padding: 0 14px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #282d38; color: #8b92a1; font: .68rem var(--mono); }
.code-editor { display: block; width: 100%; min-height: 520px; resize: vertical; border: 0; outline: 0; padding: 20px; background: #0e1118; color: #dbe0eb; font: .83rem/1.7 var(--mono); tab-size: 2; }
.editor-sidebar { display: grid; gap: 15px; }
.sticky-card { position: sticky; top: 90px; }
.editor-sidebar h2 { margin: 6px 0; font-size: 1.15rem; }
.editor-sidebar p { margin: 0 0 18px; color: var(--muted); font-size: .78rem; }
.editor-sidebar .button + .button { margin-top: 8px; }
.tips-card ul { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 9px; }
.tips-card li { color: var(--muted); font-size: .75rem; padding-left: 19px; position: relative; }
.tips-card li::before { content: '✓'; position: absolute; left: 0; color: var(--success); font-weight: 900; }
.sidebar-backdrop { display: none; }

@media (max-width: 1050px) {
  .snippet-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .nav-links > a:not(.button) { display: none; }
  .hero { padding-top: 55px; }
  .hero-grid { grid-template-columns: 1fr; gap: 25px; }
  .hero-copy { padding-bottom: 0; }
  .hero-code-card { margin-bottom: 40px; transform: none; }
  .stats-strip div + div { padding-left: 20px; }
  .section-heading { align-items: start; flex-direction: column; gap: 10px; }
  .detail-header { grid-template-columns: 1fr; gap: 25px; }
  .detail-stats { justify-content: flex-start; }
  .detail-stats div { text-align: left; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand-panel { display: none; }
  .auth-form-panel { min-height: 100vh; }
  .mobile-brand { display: flex; align-items: center; gap: 10px; font-weight: 850; margin-bottom: 45px; }
  .admin-shell { display: block; }
  .admin-sidebar { position: fixed; inset: 0 auto 0 0; width: 270px; transform: translateX(-102%); transition: .22s ease; box-shadow: 20px 0 50px rgba(0,0,0,.25); }
  .admin-sidebar.open { transform: translateX(0); }
  .sidebar-close, .sidebar-toggle { display: grid; }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(7,9,13,.55); }
  .sidebar-backdrop.show { display: block; }
  .editor-layout { grid-template-columns: 1fr; }
  .sticky-card { position: static; }
}

@media (max-width: 650px) {
  .container { width: min(100% - 24px,1180px); }
  .navbar { min-height: 66px; }
  .nav-links { gap: 8px; }
  .hero h1 { font-size: 3.5rem; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .stats-strip { grid-template-columns: 1fr; }
  .stats-strip div { padding: 17px 0; }
  .stats-strip div + div { padding-left: 0; border-left: 0; border-top: 1px solid rgba(255,255,255,.1); }
  .search-panel { grid-template-columns: 1fr; }
  .search-panel select { border-left: 0; border-top: 1px solid var(--line); padding-left: 12px; }
  .snippet-grid { grid-template-columns: 1fr; }
  .snippet-section { padding-block: 65px; }
  .code-toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar-actions { width: 100%; display: grid; grid-template-columns: repeat(3,1fr); }
  .detail-bottom-card { align-items: stretch; flex-direction: column; }
  .footer-grid { align-items: start; flex-direction: column; }
  .footer-meta { flex-direction: column; gap: 4px; }
  .admin-topbar { padding-inline: 14px; }
  .admin-topbar > div { display: none; }
  .admin-content { padding-inline: 14px; }
  .admin-page-head { align-items: stretch; flex-direction: column; }
  .metric-grid { grid-template-columns: 1fr; }
  .admin-filter { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .field-span-two { grid-column: auto; }
  .admin-list-row { grid-template-columns: auto 1fr auto; }
  .admin-list-row .list-count { display: none; }
  .auth-panel { padding: 28px 20px; }
}

/* AI-assisted snippet analysis */
.editor-toolbar-actions { display: flex; align-items: center; gap: 12px; }
.ai-toolbar-button { min-height: 30px; padding: 0 11px; border: 1px solid #3d4352; border-radius: 7px; background: #1a1f2a; color: #dbe0eb; font: 700 .66rem var(--mono); transition: .2s ease; }
.ai-toolbar-button:hover { border-color: #7657f6; color: #fff; }
.ai-toolbar-button:disabled { cursor: wait; opacity: .65; }
.ai-analysis-bar { min-height: 38px; padding: 10px 14px; border-top: 1px solid #282d38; background: #131722; color: #9299a8; font-size: .69rem; line-height: 1.45; }
[data-ai-state="loading"] .ai-analysis-bar { color: #c8c3ff; }
[data-ai-state="success"] .ai-analysis-bar { color: #89d6b2; }
[data-ai-state="warning"] .ai-analysis-bar { color: #e9c777; }
[data-ai-state="error"] .ai-analysis-bar { color: #ef9c9c; }
.ai-privacy-note { margin: 8px 2px 0; color: var(--muted); font-size: .67rem; line-height: 1.5; }

@media (max-width: 650px) {
  .editor-toolbar { height: auto; min-height: 44px; align-items: flex-start; gap: 8px; padding-block: 10px; }
  .editor-toolbar-actions { align-items: flex-end; flex-direction: column; gap: 7px; }
  .ai-toolbar-button { max-width: 180px; white-space: normal; text-align: right; }
}
