:root {
  --bg: #05070a;
  --bg-deep: #020305;
  --panel: #080c11;
  --panel-raised: #0b1118;
  --panel-soft: #0e151d;
  --line: #1d2832;
  --line-bright: #2a3a47;
  --text: #dce5eb;
  --text-bright: #f6fbff;
  --muted: #71808b;
  --muted-2: #48545e;
  --blue: #2f63ff;
  --cyan: #35c8ff;
  --purple: #9658ff;
  --green: #52d88b;
  --amber: #d89a52;
  --red: #ff6f7b;
  --sidebar: 218px;
  --control: 34px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg-deep); }
body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(rgba(255,255,255,.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.012) 1px, transparent 1px),
    var(--bg);
  background-size: 48px 48px;
  color: var(--text);
  font-family: "Segoe UI", Inter, Arial, sans-serif;
  font-size: 13px;
  overflow-x: hidden;
}

button, input, textarea, select { font: inherit; }
a { color: inherit; text-decoration: none; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 1px solid var(--cyan);
  outline-offset: 2px;
}

.section-index {
  color: var(--cyan);
  font: 700 10px/1.2 Consolas, "Courier New", monospace;
  letter-spacing: .16em;
  text-transform: uppercase;
}

/* Login */
.login-body {
  display: grid;
  min-height: 100vh;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 44%, rgba(47,99,255,.13), transparent 27%),
    radial-gradient(circle at 50% 44%, rgba(53,200,255,.055), transparent 44%),
    #020305;
}
.login-grid {
  position: fixed;
  inset: 0;
  opacity: .25;
  background:
    linear-gradient(rgba(68,121,172,.17) 1px, transparent 1px),
    linear-gradient(90deg, rgba(68,121,172,.17) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, #000 0 25%, transparent 68%);
  transform: perspective(700px) rotateX(62deg) scale(1.7) translateY(35%);
  transform-origin: center bottom;
}
.login-panel {
  position: relative;
  z-index: 1;
  width: min(378px, calc(100vw - 30px));
  padding: 31px;
  border: 1px solid var(--line-bright);
  background: rgba(6,10,14,.94);
  box-shadow: 0 35px 100px rgba(0,0,0,.72);
}
.login-panel::before,
.login-panel::after {
  content: "";
  position: absolute;
  width: 34px;
  height: 1px;
  background: var(--cyan);
  box-shadow: 0 0 12px rgba(53,200,255,.65);
}
.login-panel::before { top: -1px; left: 18px; }
.login-panel::after { right: 18px; bottom: -1px; background: var(--purple); }
.login-mark { display: block; width: 58px; height: 58px; object-fit: contain; margin: 0 0 14px; filter: drop-shadow(0 0 14px rgba(53,200,255,.28)); }
.login-panel h1 { margin: 5px 0 6px; color: var(--text-bright); font: 650 23px/1.1 "Segoe UI", sans-serif; letter-spacing: -.025em; }
.login-panel > p { margin: 0 0 23px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.login-panel label { display: block; margin: 0 0 14px; }
.login-panel label > span, .field > span, .field-heading > span {
  display: block;
  margin: 0 0 6px;
  color: #8796a1;
  font: 700 10px/1.2 Consolas, "Courier New", monospace;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.login-panel input,
.field input,
.field textarea,
#featured-image,
.slug-field {
  width: 100%;
  min-height: var(--control);
  border: 1px solid #202c35;
  border-radius: 0;
  background: #030609;
  color: var(--text-bright);
  padding: 8px 10px;
  outline: none;
  transition: border-color .16s, background .16s, box-shadow .16s;
}
.login-panel input:hover, .field input:hover, .field textarea:hover, #featured-image:hover { border-color: #31424f; }
.login-panel input:focus, .field input:focus, .field textarea:focus, #featured-image:focus {
  border-color: var(--blue);
  background: #05090d;
  box-shadow: inset 2px 0 0 var(--cyan);
}
.login-panel .primary { width: 100%; margin: 4px 0 16px; }
.login-panel > a { color: var(--muted); font-size: 11px; }
.login-panel > a:hover { color: var(--cyan); }
.alert { margin: 0 0 15px; padding: 10px 11px; border: 1px solid; font-size: 11px; }
.alert.error { color: #ffbec3; border-color: #63323a; background: #18090d; }

/* Shared controls */
button, .primary, .secondary, .icon-button, .upload-control {
  position: relative;
  display: inline-flex;
  min-height: var(--control);
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid #2a3741;
  border-radius: 0;
  background: #0c1218;
  color: #c8d3da;
  padding: 7px 12px;
  cursor: pointer;
  font: 750 10px/1 "Segoe UI", sans-serif;
  letter-spacing: .075em;
  text-transform: uppercase;
  transition: border-color .16s, background .16s, color .16s, transform .16s, box-shadow .16s;
}
button:hover, .secondary:hover, .upload-control:hover {
  border-color: #426074;
  background: #111a22;
  color: var(--text-bright);
}
button:active, .primary:active, .secondary:active { transform: translateY(1px); }
button:disabled { cursor: wait; opacity: .48; }
.primary {
  border-color: #3868ff;
  background: linear-gradient(180deg, #315fff, #2148ca);
  color: #fff;
  box-shadow: inset 0 1px rgba(255,255,255,.13), 0 0 20px rgba(47,99,255,.12);
}
.primary:hover { border-color: #70dfff; background: linear-gradient(180deg, #356cff, #2856e8); box-shadow: 0 0 24px rgba(47,99,255,.23); }
.secondary { background: #090e13; }
.icon-button { width: var(--control); padding: 0; font-size: 18px; letter-spacing: 0; }
.full { width: 100%; margin-top: 8px; }

/* Shell */
.admin-shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.admin-side {
  position: fixed;
  z-index: 90;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  padding: 14px 10px 11px;
  border-right: 1px solid #19232c;
  background: rgba(5,8,11,.98);
  box-shadow: 12px 0 50px rgba(0,0,0,.18);
}
.admin-brand {
  display: flex;
  min-height: 52px;
  align-items: center;
  gap: 9px;
  padding: 5px 8px 11px;
  border-bottom: 1px solid #151e26;
}
.admin-brand img { width: 31px; height: 31px; object-fit: contain; filter: drop-shadow(0 0 8px rgba(53,200,255,.22)); }
.admin-brand > span { display: grid; gap: 2px; }
.admin-brand b { color: #edf8ff; font-size: 11px; letter-spacing: .16em; }
.admin-brand small { color: #477b98; font: 700 8px/1 Consolas, monospace; letter-spacing: .12em; }
.admin-side nav { display: grid; gap: 2px; padding-top: 13px; }
.nav-section { padding: 8px 9px 5px; color: #46535d; font: 700 8px/1 Consolas, monospace; letter-spacing: .14em; text-transform: uppercase; }
.secondary-section { margin-top: 9px; padding-top: 11px; border-top: 1px solid #141d24; }
.admin-side nav a {
  display: grid;
  grid-template-columns: 24px minmax(0,1fr) auto;
  min-height: 35px;
  align-items: center;
  border: 1px solid transparent;
  color: #7d8b95;
  padding: 0 8px;
  font-size: 11px;
  transition: .16s;
}
.admin-side nav a i { color: #3b4b57; font: 700 9px/1 Consolas, monospace; font-style: normal; }
.admin-side nav a b { min-width: 20px; color: #6c7b86; font: 700 9px/18px Consolas, monospace; text-align: center; }
.admin-side nav a:hover { color: #dce9f0; border-color: #1b2832; background: #0a1016; }
.admin-side nav a.active {
  border-color: #263744;
  background: linear-gradient(90deg, rgba(47,99,255,.15), rgba(53,200,255,.025));
  color: #fff;
  box-shadow: inset 2px 0 0 var(--blue);
}
.admin-side nav a.active i { color: var(--cyan); }
.admin-side-foot { display: grid; gap: 9px; margin-top: auto; padding: 13px 8px 2px; border-top: 1px solid #151e25; }
.admin-side-foot span { display: flex; align-items: center; gap: 6px; color: #53616b; font: 700 8px/1 Consolas, monospace; letter-spacing: .06em; text-transform: uppercase; }
.admin-side-foot span i { width: 5px; height: 5px; background: var(--green); box-shadow: 0 0 7px var(--green); }
.admin-side-foot a { color: #6f7c85; font-size: 10px; }
.admin-side-foot a:hover { color: var(--red); }

.admin-main { grid-column: 2; min-width: 0; padding: 0 24px 46px; }
.admin-top {
  position: sticky;
  z-index: 50;
  top: 0;
  height: 63px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 -24px 21px;
  padding: 0 24px;
  border-bottom: 1px solid #18222a;
  background: rgba(5,7,10,.92);
  backdrop-filter: blur(15px);
}
.admin-top-title { display: grid; gap: 2px; }
.admin-top-title > span { color: #2d89b3; font: 750 8px/1 Consolas, monospace; letter-spacing: .16em; }
.admin-top h1 { margin: 0; color: #e8f0f4; font-size: 17px; font-weight: 620; letter-spacing: -.015em; }
.admin-top-status { display: flex; align-items: center; gap: 7px; color: #52616c; font: 700 8px/1 Consolas, monospace; letter-spacing: .12em; }
.admin-top-status i { width: 5px; height: 5px; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.admin-menu { display: none; width: 34px; flex-direction: column; gap: 4px; padding: 9px; }
.admin-menu span { width: 100%; height: 1px; background: #a8b4bc; }

/* Dashboard / lists */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 13px; }
.stats > div {
  position: relative;
  min-height: 88px;
  padding: 13px 14px;
  overflow: hidden;
  border: 1px solid #1b2730;
  background: rgba(8,12,17,.82);
}
.stats > div::after { content: ""; position: absolute; right: -18px; bottom: -18px; width: 56px; height: 56px; border: 1px solid rgba(53,200,255,.1); transform: rotate(45deg); }
.stats span { color: #71808a; font: 700 9px/1 Consolas, monospace; letter-spacing: .09em; text-transform: uppercase; }
.stats strong { display: block; margin: 5px 0 2px; color: #f0f7fb; font: 650 25px/1 "Segoe UI", sans-serif; }
.stats small { color: #48555e; font-size: 9px; }
.admin-card { border: 1px solid #1b2730; background: rgba(7,11,15,.88); padding: 17px; }
.admin-card::selection { background: var(--blue); color: #fff; }
.card-head, .editor-heading, .modal-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.card-head { min-height: 42px; margin-bottom: 9px; padding-bottom: 12px; border-bottom: 1px solid #172129; }
.card-head h2, .editor-heading h2, .modal-head h2 { margin: 3px 0 0; color: #e7eef3; font-size: 16px; font-weight: 620; letter-spacing: -.015em; }
.item-list { display: grid; }
.item-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) 150px auto;
  gap: 18px;
  align-items: center;
  min-height: 72px;
  padding: 11px 4px;
  border-top: 1px solid #151e25;
}
.item-list .item-row:first-child { border-top: 0; }
.item-main { min-width: 0; }
.item-main h3 { margin: 3px 0 2px; overflow: hidden; color: #d8e1e7; font-size: 13px; font-weight: 610; text-overflow: ellipsis; white-space: nowrap; }
.item-main small { display: block; overflow: hidden; color: #47545e; font: 400 9px/1.3 Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.status { display: inline-flex; align-items: center; gap: 5px; color: var(--amber); font: 700 8px/1 Consolas, monospace; letter-spacing: .1em; text-transform: uppercase; }
.status i { width: 4px; height: 4px; background: currentColor; box-shadow: 0 0 6px currentColor; }
.status.published { color: var(--green); }
.status.draft { color: var(--amber); }
.item-time { display: grid; gap: 3px; color: #4f5d66; font-size: 9px; }
.item-time span { color: #38444d; font: 700 8px/1 Consolas, monospace; text-transform: uppercase; }
.item-time b { color: #687780; font-weight: 500; }
.row-actions { display: flex; gap: 5px; }
.row-actions a, .row-actions button { min-height: 29px; padding: 6px 10px; font-size: 9px; }
.row-actions a { border: 1px solid #26343e; background: #0a0f14; }
.row-actions a:hover { border-color: var(--blue); color: #fff; }
.row-actions button { color: #b46d73; }
.row-actions button:hover { border-color: #63353a; background: #160b0d; color: #ff9fa8; }
.empty { padding: 44px 20px; color: #53616b; text-align: center; font-size: 11px; }
.table .tr { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; min-height: 44px; align-items: center; padding: 0 5px; border-top: 1px solid #151e25; color: #9aa7b0; font-size: 11px; }
.table .head { min-height: 32px; border-top: 0; color: #4f5d66; font: 700 8px/1 Consolas, monospace; letter-spacing: .1em; text-transform: uppercase; }

/* Editor */
.editor-heading { min-height: 47px; margin-bottom: 11px; }
.editor-heading-copy { display: flex; align-items: flex-end; gap: 17px; }
.back-link { color: #586771; font-size: 10px; padding-bottom: 3px; }
.back-link:hover { color: var(--cyan); }
.editor-title-row { display: grid; gap: 1px; }
.editor-actions { display: flex; align-items: center; gap: 6px; }
.save-state { display: inline-flex; align-items: center; gap: 6px; margin-right: 4px; color: #5e6d76; font: 700 9px/1 Consolas, monospace; }
.save-state::before { content: ""; width: 5px; height: 5px; background: #42505a; }
.save-state[data-state="dirty"] { color: var(--amber); }
.save-state[data-state="dirty"]::before { background: var(--amber); box-shadow: 0 0 7px var(--amber); }
.save-state[data-state="saving"] { color: var(--cyan); }
.save-state[data-state="saving"]::before { background: var(--cyan); animation: blink .65s steps(2,end) infinite; }
.save-state[data-state="saved"] { color: var(--green); }
.save-state[data-state="saved"]::before { background: var(--green); }
.save-state[data-state="error"] { color: var(--red); }
.save-state[data-state="error"]::before { background: var(--red); }
@keyframes blink { 50% { opacity: .15; } }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 268px; gap: 11px; align-items: start; }
.editor-main { min-width: 0; padding: 15px; }
.editor-side { display: grid; gap: 11px; align-content: start; }
.compact-card { padding: 14px; }
.panel-label { display: flex; align-items: center; gap: 8px; margin: -2px 0 13px; padding-bottom: 9px; border-bottom: 1px solid #172129; color: #a9b5bc; font-size: 11px; font-weight: 620; }
.panel-label > span { color: var(--cyan); font: 700 8px/1 Consolas, monospace; }
.field { display: block; margin: 0 0 13px; }
.field textarea { resize: vertical; line-height: 1.5; }
.field-row { display: grid; grid-template-columns: minmax(0,1fr) 112px; gap: 10px; }
.field-row-wide { grid-template-columns: minmax(240px, .9fr) minmax(280px, 1.1fr); }
.compact-number { max-width: 112px; }
.slug-field { display: flex; align-items: center; padding: 0; }
.slug-field b { flex: 0 0 auto; padding-left: 10px; color: #46545e; font: 400 10px/1 Consolas, monospace; }
.slug-field input { min-width: 0; margin: 0; border: 0; background: transparent; box-shadow: none; }
.slug-field:focus-within { border-color: var(--blue); box-shadow: inset 2px 0 0 var(--cyan); }
.field-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.field-heading small { color: #4d5a64; font-size: 9px; }
.editor-field { margin-bottom: 0; }
#content-editor.raw-editor { display: block; width: 100%; min-height: 520px; padding: 16px; border: 1px solid #293844; background: #030609; color: #dce7ed; font: 12px/1.6 Consolas, monospace; resize: vertical; }
.editor-fallback-note { margin-top: 7px; color: var(--amber); font-size: 10px; }
.check { display: flex; align-items: flex-start; gap: 8px; margin: 3px 0 14px; color: #99a7b0; font-size: 11px; line-height: 1.4; }
.check input { width: 14px; height: 14px; margin: 1px 0 0; accent-color: var(--blue); }
.hint { margin: 11px 0 0; color: #596771; font-size: 10px; line-height: 1.55; }
.record-meta { display: grid; gap: 7px; margin: 11px 0 0; }
.record-meta div { display: flex; justify-content: space-between; gap: 10px; padding-top: 7px; border-top: 1px solid #141e25; }
.record-meta dt { color: #4a5760; font: 700 8px/1 Consolas, monospace; text-transform: uppercase; }
.record-meta dd { margin: 0; color: #8e9ba4; font-size: 9px; }
.featured-preview { position: relative; aspect-ratio: 16/9; margin: 0 0 8px; overflow: hidden; border: 1px solid #202d36; background: #030609 center/cover no-repeat; }
.featured-preview::after { content: ""; position: absolute; inset: 0; border: 1px solid rgba(255,255,255,.03); pointer-events: none; }
.featured-preview i { position: absolute; left: 7px; bottom: 6px; color: #4b5962; font: 700 8px/1 Consolas, monospace; font-style: normal; }
#featured-image { min-height: 31px; font: 9px/1 Consolas, monospace; }
.editor-shortcuts p { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: center; margin: 7px 0; color: #697781; font-size: 9px; }
.editor-shortcuts p span { justify-self: end; text-align: right; }
kbd { display: inline-block; min-width: 20px; margin-right: 2px; padding: 3px 5px; border: 1px solid #2a3741; border-bottom-color: #172028; background: #0b1117; color: #aab6be; font: 700 8px/1 Consolas, monospace; text-align: center; }

/* TinyMCE shell overrides */
.tox-tinymce { border: 1px solid #263642 !important; border-radius: 0 !important; background: #05080b !important; }
.tox .tox-editor-header { border-bottom: 1px solid #1c2933 !important; box-shadow: none !important; }
.tox .tox-menubar, .tox .tox-toolbar-overlord, .tox .tox-toolbar__primary { background: #090e13 !important; }
.tox .tox-menubar { padding-left: 4px !important; }
.tox .tox-mbtn { height: 28px !important; border-radius: 0 !important; font-size: 11px !important; }
.tox .tox-toolbar__group { padding: 0 3px !important; }
.tox .tox-tbtn { width: 28px !important; height: 28px !important; border-radius: 0 !important; }
.tox .tox-tbtn--select { width: auto !important; min-width: 83px !important; }
.tox .tox-statusbar { min-height: 25px !important; border-top: 1px solid #18232c !important; background: #080d12 !important; color: #5f6d77 !important; }
.tox .tox-statusbar__path-item, .tox .tox-statusbar__wordcount { font-size: 9px !important; }
.tox .tox-edit-area::before { border: 1px solid var(--blue) !important; border-radius: 0 !important; }

/* Image vault */
.modal { position: fixed; z-index: 200; inset: 0; display: grid; place-items: center; padding: 18px; background: rgba(0,0,0,.84); backdrop-filter: blur(5px); }
.modal[hidden] { display: none; }
.modal-panel { width: min(1040px, 96vw); height: min(760px, 92vh); overflow: auto; border: 1px solid #2b3d49; background: #070b0f; box-shadow: 0 45px 130px #000; }
.modal-head { position: sticky; z-index: 2; top: 0; min-height: 66px; padding: 11px 14px; border-bottom: 1px solid #1d2a34; background: rgba(7,11,15,.96); backdrop-filter: blur(12px); }
.modal-tools { display: flex; gap: 5px; align-items: center; }
.image-vault-status { margin: 11px 14px 0; color: #5b6973; font-size: 10px; }
.image-vault-status code { color: #82c9e6; font: 10px Consolas, monospace; }
.image-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 8px; padding: 13px 14px 18px; }
.image-option { display: block; min-width: 0; height: auto; padding: 0; border: 1px solid #1d2a33; background: #080d12; text-align: left; text-transform: none; letter-spacing: 0; }
.image-option:hover { border-color: var(--cyan); transform: translateY(-1px); box-shadow: 0 7px 25px rgba(0,0,0,.32); }
.image-option-preview { display: block; aspect-ratio: 16/10; overflow: hidden; background: #020405; }
.image-option img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .22s, filter .22s; }
.image-option:hover img { transform: scale(1.025); filter: brightness(1.1); }
.image-option-meta { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px; align-items: center; padding: 7px 8px; }
.image-option-meta b { overflow: hidden; color: #9facb5; font-size: 9px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.image-option-meta small { color: #49565f; font: 8px Consolas, monospace; }
.image-loading, .image-empty { grid-column: 1 / -1; min-height: 260px; display: grid; place-content: center; gap: 9px; color: #65737d; text-align: center; font-size: 11px; }
.image-loading i { width: 24px; height: 24px; margin: auto; border: 1px solid #263945; border-top-color: var(--cyan); animation: spin .7s linear infinite; }
.image-empty.error { color: var(--red); }
@keyframes spin { to { transform: rotate(360deg); } }

.admin-toast { position: fixed; z-index: 300; right: 18px; bottom: 18px; display: flex; align-items: center; gap: 9px; min-width: 220px; padding: 10px 12px; border: 1px solid #24506a; background: #08131a; color: #dff6ff; box-shadow: 0 15px 50px rgba(0,0,0,.48); opacity: 0; transform: translateY(8px); transition: .2s; font-size: 11px; }
.admin-toast.visible { opacity: 1; transform: none; }
.admin-toast i { width: 5px; height: 5px; background: var(--green); box-shadow: 0 0 7px var(--green); }
.admin-toast.error { border-color: #623039; background: #170a0d; color: #ffc4c9; }
.admin-toast.error i { background: var(--red); box-shadow: 0 0 7px var(--red); }
.admin-scrim { position: fixed; z-index: 80; inset: 0; background: rgba(0,0,0,.7); opacity: 0; transition: opacity .2s; }
.admin-scrim.visible { opacity: 1; }
body.modal-open { overflow: hidden; }

@media (max-width: 1160px) {
  .editor-grid { grid-template-columns: minmax(0,1fr) 235px; }
  .image-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .item-row { grid-template-columns: minmax(0,1fr) 120px auto; }
}

@media (max-width: 920px) {
  .stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .editor-grid { grid-template-columns: 1fr; }
  .editor-side { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .editor-shortcuts { display: none; }
  .image-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}

@media (max-width: 720px) {
  :root { --sidebar: 0px; }
  .admin-shell { display: block; }
  .admin-side { width: 220px; transform: translateX(-104%); transition: transform .2s ease; }
  .admin-side.open { transform: none; }
  .admin-main { padding: 0 11px 32px; }
  .admin-top { height: 54px; margin: 0 -11px 13px; padding: 0 11px; }
  .admin-menu { display: flex; margin-right: 10px; }
  .admin-top-title { margin-right: auto; }
  .admin-top-status { display: none; }
  .stats { gap: 7px; }
  .stats > div { min-height: 77px; padding: 11px; }
  .stats strong { font-size: 21px; }
  .admin-card { padding: 11px; }
  .card-head { align-items: flex-start; }
  .item-row { grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
  .item-time { display: none; }
  .editor-heading { display: block; }
  .editor-heading-copy { align-items: flex-start; }
  .editor-actions { margin-top: 10px; }
  .editor-actions .save-state { margin-right: auto; }
  .field-row, .field-row-wide { grid-template-columns: 1fr; }
  .compact-number { max-width: none; }
  .editor-side { grid-template-columns: 1fr; }
  .modal { padding: 7px; }
  .modal-panel { width: 100%; height: 94vh; }
  .modal-head { align-items: flex-start; }
  .modal-tools { flex-wrap: wrap; justify-content: flex-end; }
  .image-grid { grid-template-columns: repeat(2, minmax(0,1fr)); padding: 9px; }
  .image-vault-status { margin: 9px; }
  .tox .tox-menubar { display: none !important; }
}

@media (max-width: 430px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .card-head { display: block; }
  .card-head .primary, .card-head .secondary { margin-top: 10px; }
  .editor-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .editor-actions .save-state { grid-column: 1 / -1; }
  .row-actions { display: grid; }
  .image-grid { grid-template-columns: 1fr 1fr; }
}

/* V3 typography and finish */
:root {
  --admin-font-body: "Stack Sans Headline", "Segoe UI", system-ui, sans-serif;
  --admin-font-display: "Special Elite", "Courier New", serif;
  --admin-blue: #315fff;
}
* { scrollbar-width: thin; scrollbar-color: var(--admin-blue) #05080b; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: #05080b; }
*::-webkit-scrollbar-thumb { background: #315fff; border: 2px solid #05080b; }
body, button, input, textarea { font-family: var(--admin-font-body); }
.admin-top-title h1, .card-head h2, .editor-title-row h2, .modal-head h2, .login-panel h1 { font-family: var(--admin-font-display); font-weight: 400; letter-spacing: 0; }
.admin-top-title h1 { font-size: 25px; }
.card-head h2, .editor-title-row h2, .modal-head h2 { font-size: 23px; }
.login-panel h1 { font-size: 37px; }
.admin-side nav a, .item-main h3, .field input, .field textarea, .record-meta dd { font-size: 13px; }
.section-index, .field > span, .panel-label, .nav-section { font-size: 9px; }
.primary, .secondary, button.primary, button.secondary { letter-spacing: .035em; }
.admin-card, .compact-card, .login-panel { box-shadow: 0 18px 55px rgba(0,0,0,.12); }
.tox.tox-tinymce { border-color: #2b3c49 !important; box-shadow: 0 15px 38px rgba(0,0,0,.18); }

/* V4 settings and readability */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.settings-grid .admin-card { margin: 0; }
.settings-grid .field { margin-bottom: 14px; }
.settings-grid .field:last-child { margin-bottom: 0; }
.settings-grid .field small { display: block; margin-top: 5px; color: #6f7d87; font-size: 10px; line-height: 1.5; }
.settings-grid .field code { color: #8fdfff; }
.settings-grid textarea { min-height: 76px; resize: vertical; }
.platform-checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.settings-note { margin-top: 12px; padding: 12px; border: 1px solid #42333a; background: #120b0e; }
.settings-note.ready { border-color: #254939; background: #08120e; }
.settings-note b { color: #e2e9ee; font-size: 12px; }
.settings-note p { margin: 5px 0 0; color: #7f8c96; font-size: 11px; line-height: 1.55; }

body { font-size: 13px; }
.admin-side nav a { font-size: 13px; }
.item-main h3 { font-size: 14px; }
.item-main small, .item-time, .hint, .record-meta, .table { font-size: 11px; }
.field > span, .panel-label, .section-index, .nav-section { font-size: 10px; }
.field input, .field textarea { font-size: 13px; }
.primary, .secondary, button.primary, button.secondary { font-size: 11px; }

@media (max-width: 920px) {
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .platform-checks { grid-template-columns: 1fr; }
}

/* V5 subscribers, Brevo and SEO */
.card-head p { max-width: 680px; margin: 5px 0 0; color: #77858f; font-size: 12px; line-height: 1.5; }
.card-head-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.subscriber-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.subscriber-summary > div { display: flex; align-items: baseline; gap: 8px; min-height: 58px; padding: 12px; border: 1px solid #1e2c36; background: #070c10; }
.subscriber-summary strong { color: #edf5fa; font: 400 24px/1 var(--admin-font-display); }
.subscriber-summary span { color: #73828c; font-size: 11px; }
.subscriber-table .tr { grid-template-columns: minmax(220px, 2fr) minmax(130px, 1fr) minmax(130px, 1fr); }
.sync-state { width: fit-content; padding: 4px 7px; border: 1px solid #34424c; color: #a8b6bf; background: #0a1015; font-size: 10px; }
.sync-state.synced { color: #8ce9b8; border-color: #28513d; background: #07130d; }
.sync-state.failed { color: #ffadb5; border-color: #5a2d35; background: #16090c; }
.archive-card { margin-top: 12px; }
.settings-rule { margin: 16px 0; border: 0; border-top: 1px solid #1b2831; opacity: 1; }
.settings-note a { color: #8dcfff; text-decoration: none; }
.settings-note a:hover { color: #c7edff; }
.primary:disabled, .secondary:disabled { cursor: not-allowed; opacity: .42; }

@media (max-width: 920px) {
  .subscriber-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .subscriber-table .tr { grid-template-columns: minmax(0, 1.6fr) 1fr; }
  .subscriber-table .tr > :nth-child(3) { grid-column: 1 / -1; margin-bottom: 8px; }
  .subscriber-table .head > :nth-child(3) { display: none; }
}

@media (max-width: 560px) {
  .subscriber-summary { grid-template-columns: 1fr 1fr; }
  .card-head-actions { justify-content: flex-start; }
  .card-head-actions .primary, .card-head-actions .secondary { width: 100%; }
  .subscriber-table .tr { display: grid; grid-template-columns: 1fr; gap: 4px; padding: 10px 4px; }
  .subscriber-table .head { display: none; }
  .subscriber-table .tr > :nth-child(3) { grid-column: auto; margin-bottom: 0; }
}
