/*
 * DriveJo theme: the logo's black, red and white.
 * Layout: red ticker → header + scrollable category rail → lead story with side rows → category strips.
 * Red (--accent) is the brand colour for fills (badges, ticker, active marks) with white text on it;
 * red used as text switches to --accent-ink, which is darkened in light mode and lightened in dark mode for contrast.
 */
:root {
  --bg: #f5f5f6;
  --panel: #ffffff;
  --panel-2: #f1f1f3;
  --line: #e1e2e5;
  --fg: #17181b;
  --muted: #62656b;
  --logo-grey: #87888c;
  --accent: #e42614;
  --accent-ink: #c41f10;
  --on-accent: #ffffff;
  --red: #c41f10;
  --shadow: 0 1px 2px rgba(23, 24, 27, .06), 0 8px 24px -16px rgba(23, 24, 27, .25);
  --scrim: linear-gradient(0deg, rgba(10, 10, 12, .92) 0%, rgba(10, 10, 12, .55) 45%, transparent 80%);

  --display: "Changa", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --body: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;

  --radius: 10px;
  --wrap: 1240px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #111214;
  --panel: #1a1b1e;
  --panel-2: #212327;
  --line: #2d3036;
  --fg: #f4f4f5;
  --muted: #9b9ea4;
  --accent-ink: #ff5a47;
  --red: #ff5a47;
  --shadow: none;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
/* Component display rules (grid, flex) must never beat the hidden attribute. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.7;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.35; text-wrap: balance; margin: 0; }

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Ticker ---------- */
.ticker { background: var(--accent); color: var(--on-accent); font-size: 13px; font-weight: 600; }
.ticker .wrap { display: flex; align-items: center; gap: 12px; height: 36px; overflow: hidden; }
.ticker-label {
  flex: none; background: #ffffff; color: var(--accent);
  padding: 1px 10px; border-radius: 4px; font-family: var(--display); font-weight: 700;
}
.ticker-track { overflow: hidden; flex: 1; min-width: 0; mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.ticker-items { display: flex; gap: 40px; width: max-content; animation: ticker 60s linear infinite; }
.ticker-items a { white-space: nowrap; }
.ticker-items a:hover { text-decoration: underline; }
.ticker:hover .ticker-items { animation-play-state: paused; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(50%); } }
@media (prefers-reduced-motion: reduce) { .ticker-items { animation: none; } }

/* ---------- Header ---------- */
.site-header { background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--panel); }
.header-row { display: flex; align-items: center; gap: 16px; height: 64px; }
.logo { font-family: var(--display); font-weight: 800; font-size: 28px; letter-spacing: .5px; direction: ltr; flex: none; line-height: 1; }
.logo span { color: var(--accent-ink); }
.header-search { margin-inline-start: auto; display: flex; align-items: center; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding-inline: 14px 6px; height: 40px; width: min(320px, 100%); }
.header-search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--fg); font: inherit; font-size: 14px; outline: none; }
.header-search input::placeholder { color: var(--muted); }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
  border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2); color: var(--fg); cursor: pointer;
}
.header-search .icon-btn { width: 30px; height: 30px; border: 0; background: transparent; }
.icon-btn:hover { border-color: var(--accent); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }

.rail { border-top: 1px solid var(--line); }
.rail ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.rail ul::-webkit-scrollbar { display: none; }
.rail a { display: block; padding: 11px 12px; font-size: 15px; font-weight: 500; color: var(--muted); white-space: nowrap; box-shadow: inset 0 -3px 0 transparent; }
.rail a:hover { color: var(--fg); }
.rail a[aria-current="page"] { color: var(--fg); box-shadow: inset 0 -3px 0 var(--accent); }

@media (max-width: 640px) {
  .header-row { height: 56px; gap: 10px; }
  .logo { font-size: 24px; }
  .header-search { width: auto; flex: 1; }
}

/* ---------- Shared bits ---------- */
main { padding-block: 24px 56px; }
.badge {
  display: inline-block; font-size: 12px; font-weight: 700; line-height: 1.6;
  background: var(--accent); color: var(--on-accent); padding: 1px 8px; border-radius: 4px;
}
.badge.hot { background: var(--fg); color: var(--bg); }
.gauges { display: flex; flex-wrap: wrap; gap: 6px; }
.gauge {
  font-size: 12px; font-variant-numeric: tabular-nums; border: 1px solid var(--line);
  border-radius: 4px; padding: 0 8px; color: var(--muted); white-space: nowrap;
}
.gauge.speed { border-color: var(--red); color: var(--red); font-weight: 700; }
.meta { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; }

.cover { position: relative; aspect-ratio: 16 / 9; background: var(--panel-2); overflow: hidden; max-width: 100%; }
.cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.cover.empty { background: linear-gradient(160deg, var(--panel-2), var(--line)); display: grid; place-items: center; color: var(--muted); }
.cover.empty svg { width: 46%; opacity: .5; }
a:hover .cover img { transform: scale(1.03); }
@media (prefers-reduced-motion: reduce) { .cover img { transition: none; } a:hover .cover img { transform: none; } }

.section-title { display: flex; align-items: center; gap: 10px; font-size: 20px; margin-block: 36px 16px; }
.section-title::before { content: ""; width: 22px; height: 4px; background: var(--accent); border-radius: 2px; flex: none; }
.section-title a.more { margin-inline-start: auto; font-family: var(--body); font-size: 14px; font-weight: 500; color: var(--accent-ink); }
.section-title a.more:hover { text-decoration: underline; }

/* ---------- Lead + side rows ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 16px; }
.lead { position: relative; display: block; border-radius: var(--radius); overflow: hidden; background: #000; color: #fff; }
.lead .cover { aspect-ratio: 16 / 10; height: 100%; }
.lead-text { position: absolute; inset: auto 0 0 0; padding: 28px 24px 22px; background: var(--scrim); display: grid; gap: 10px; }
.lead-text h1, .lead-text h2 { font-size: clamp(22px, 2.6vw, 32px); }
.lead-text p { margin: 0; color: rgba(255, 255, 255, .82); max-width: 60ch; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lead .gauge { border-color: rgba(255, 255, 255, .3); color: rgba(255, 255, 255, .85); }
.lead .gauge.speed { border-color: #ff5a47; color: #ff5a47; }

.side { display: grid; gap: 12px; align-content: start; }
.row-card {
  display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 12px; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; box-shadow: var(--shadow);
}
.row-card .cover { border-radius: 6px; }
.row-card h3 { font-size: 15px; margin-block: 4px; }
.row-card:hover h3 { color: var(--accent-ink); }

@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  /* Long Arabic headlines outgrow the photo on phones, so the text sits below it instead of over it. */
  .lead { background: #121418; }
  .lead .cover { aspect-ratio: 16 / 10; height: auto; }
  .lead-text { position: static; background: none; padding: 16px 16px 18px; }
  .lead-text h1 { font-size: 22px; }
  .row-card { grid-template-columns: 112px minmax(0, 1fr); }
}

/* ---------- Tile grid ---------- */
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.tile-body { padding: 12px 14px 14px; display: grid; gap: 8px; align-content: start; flex: 1; }
.tile h3 { font-size: 16px; }
.tile:hover h3 { color: var(--accent-ink); }
@media (max-width: 1000px) { .grid, .grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .grid, .grid.three { grid-template-columns: minmax(0, 1fr); }
  .grid .tile { display: grid; grid-template-columns: 120px minmax(0, 1fr); }
  .grid .tile .cover { aspect-ratio: 1; height: 100%; }
  .grid .tile .tile-body { padding: 10px 12px; }
  .grid .tile h3 { font-size: 15px; }
}

/* ---------- Home layout with sidebar ---------- */
.with-aside { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.with-aside .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1000px) { .with-aside { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .with-aside .grid { grid-template-columns: minmax(0, 1fr); } }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.panel h2 { font-size: 17px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.panel h2::before { content: ""; width: 14px; height: 4px; background: var(--accent); border-radius: 2px; }
.rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: rank; }
.rank li { counter-increment: rank; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; align-items: start; }
.rank li::before {
  content: counter(rank); font-family: var(--display); font-weight: 800; font-size: 22px; line-height: 1.1;
  color: var(--accent-ink); font-variant-numeric: tabular-nums;
}
.rank a { font-weight: 500; font-size: 15px; line-height: 1.5; }
.rank a:hover { color: var(--accent-ink); }
.aside-stack { display: grid; gap: 16px; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 130px); }

/* ---------- Archive / search ---------- */
.page-head { padding-block: 8px 12px; display: grid; gap: 6px; }
.page-head .eyebrow { font-size: 13px; font-weight: 700; color: var(--accent-ink); }
.page-head h1 { font-size: clamp(26px, 3.4vw, 38px); }
.page-head p { margin: 0; color: var(--muted); max-width: 65ch; }
.search-big { display: flex; gap: 8px; margin-top: 8px; max-width: 640px; }
.search-big input { flex: 1; min-width: 0; height: 48px; padding-inline: 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); color: var(--fg); font: inherit; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 44px; padding-inline: 18px;
  border-radius: var(--radius); border: 1px solid transparent; background: var(--accent); color: var(--on-accent);
  font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.search-big .btn { height: 48px; }
.btn:hover { filter: brightness(1.05); }
.btn.ghost { background: var(--panel); color: var(--fg); border-color: var(--line); }
.btn.danger { background: transparent; color: var(--red); border-color: var(--red); }
.empty-state { text-align: center; padding: 56px 16px; color: var(--muted); display: grid; gap: 8px; justify-items: center; }
.empty-state h2 { color: var(--fg); font-size: 22px; }

.pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 32px; }
.pagination a, .pagination span {
  min-width: 42px; height: 42px; display: inline-grid; place-items: center; padding-inline: 12px;
  border-radius: 8px; border: 1px solid var(--line); background: var(--panel); font-variant-numeric: tabular-nums;
}
.pagination a:hover { border-color: var(--accent); }
.pagination .current { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 700; }
.pagination .disabled { color: var(--muted); opacity: .6; }

/* ---------- Article (spec-sheet layout: text column + sticky side column) ---------- */
.read-progress { height: 3px; background: transparent; }
.read-progress span { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: right; transition: transform .1s linear; }
@media (prefers-reduced-motion: reduce) { .read-progress span { transition: none; } }

.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; max-width: 1160px; margin-inline: auto; }
.article { min-width: 0; }
.article-side { display: grid; gap: 16px; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 124px); }
.mobile-only { display: none; }
@media (max-width: 960px) {
  .article-layout { grid-template-columns: minmax(0, 1fr); }
  .article-side { display: none; }
  .mobile-only { display: grid; gap: 12px; margin-bottom: 24px; }
}

.crumbs { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.crumbs a:hover { color: var(--accent-ink); }
.article h1 { font-size: clamp(26px, 3.6vw, 38px); margin-block: 10px 14px; }
.article .lede { font-size: 19px; color: var(--muted); margin: 0 0 18px; max-width: 65ch; }
.article-cover { border-radius: var(--radius); overflow: hidden; margin: 22px 0 8px; }
.article-cover .cover { aspect-ratio: 16 / 9; }
.figcap { font-size: 13px; color: var(--muted); margin: 0 0 24px; }
.article .prose { max-width: 70ch; }

.side-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.side-card h2 { font-size: 15px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.side-card h2::before { content: ""; width: 14px; height: 4px; background: var(--accent); border-radius: 2px; flex: none; }
.specs { margin: 0; display: grid; }
.specs div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.specs div:last-child { border-bottom: 0; padding-bottom: 0; }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; font-family: var(--display); font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; text-align: end; }
.specs dd.hot { color: var(--red); }
.toc { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 14px; }
.toc a { display: block; padding: 6px 0 6px; padding-inline-start: 16px; position: relative; color: var(--muted); line-height: 1.5; }
.toc a::before { content: ""; position: absolute; inset-inline-start: 2px; top: 1em; width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.toc a:hover { color: var(--fg); }
.toc a.active { color: var(--fg); font-weight: 600; }
.toc a.active::before { background: var(--accent); }
details.side-card summary { cursor: pointer; font-family: var(--display); font-weight: 700; font-size: 15px; list-style: none; display: flex; align-items: center; gap: 8px; }
details.side-card summary::-webkit-details-marker { display: none; }
details.side-card summary::after { content: "+"; margin-inline-start: auto; color: var(--muted); }
details[open].side-card summary::after { content: "−"; }
details.side-card .toc { margin-top: 10px; }
.prose [id] { scroll-margin-top: calc(env(safe-area-inset-top, 0px) + 130px); }

.prose { font-size: 18px; line-height: 1.95; overflow-wrap: anywhere; }
.prose > * + * { margin-top: 1.1em; }
.prose p { margin: 0; }
.prose h2 { font-size: 24px; margin-top: 1.8em; }
.prose h3 { font-size: 20px; margin-top: 1.6em; }
.prose a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.prose img { border-radius: 8px; height: auto; margin-inline: auto; }
.prose figure { margin: 1.4em 0; }
.prose figcaption { font-size: 14px; color: var(--muted); margin-top: 6px; text-align: center; }
.prose blockquote { margin: 1.6em 0; padding: 0; font-family: var(--display); font-size: 21px; line-height: 1.7; color: var(--fg); }
.prose blockquote::before { content: "”"; display: block; font-size: 56px; line-height: .6; color: var(--accent-ink); margin-bottom: 8px; }
.prose ul, .prose ol { padding-inline-start: 1.4em; }
.prose li + li { margin-top: .4em; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: start; }
.prose th { background: var(--panel-2); }
.embed { position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #000; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); max-width: 70ch; }
.tags a { font-size: 14px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); }
.tags a:hover { border-color: var(--accent); }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 20px; font-size: 14px; color: var(--muted); }
.share a, .share button { font: inherit; font-size: 14px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--fg); cursor: pointer; }
.share a:hover, .share button:hover { border-color: var(--accent); }

/* ---------- Footer ---------- */
.site-footer { background: var(--panel); border-top: 1px solid var(--line); padding-block: 32px; font-size: 14px; color: var(--muted); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)); gap: 24px; }
.footer-grid h3 { font-size: 15px; color: var(--fg); margin-bottom: 10px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer-grid a:hover { color: var(--accent-ink); }
.footer-bottom { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .footer-grid > :first-child { grid-column: 1 / -1; } }

/* ---------- Forms (login + admin) ---------- */
.field { display: grid; gap: 6px; }
.field label { font-weight: 500; font-size: 14px; }
.field .hint { font-size: 13px; color: var(--muted); }
.input, .field input[type=text], .field input[type=email], .field input[type=password], .field input[type=url], .field input[type=datetime-local], .field select, .field textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel); color: var(--fg); font: inherit; font-size: 15px;
}
.field textarea { min-height: 120px; resize: vertical; line-height: 1.8; }
.field textarea.code { min-height: 360px; font-family: ui-monospace, Menlo, monospace; font-size: 13px; direction: ltr; text-align: left; }
.error { color: var(--red); font-size: 13px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.flash { padding: 12px 16px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); margin-bottom: 16px; font-weight: 500; }

.auth-box { max-width: 420px; margin: 48px auto; display: grid; gap: 16px; }
.auth-box h1 { font-size: 26px; }

/* ---------- Admin ---------- */
.admin-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 20px; }
.admin-bar h1 { font-size: 26px; margin-inline-end: auto; }
.admin-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.admin-tabs a { padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); font-weight: 500; font-size: 14px; }
.admin-tabs a[aria-current="page"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: middle; }
.table th { font-weight: 600; color: var(--muted); background: var(--panel-2); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table .t-title { font-weight: 500; min-width: 260px; }
.table .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.status { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.status.published { background: color-mix(in srgb, #1f9d55 18%, transparent); color: #1f9d55; }
.status.draft { background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.row-actions { display: flex; gap: 8px; align-items: center; white-space: nowrap; }
.row-actions a { color: var(--accent-ink); font-weight: 500; }
.row-actions button { background: none; border: 0; color: var(--red); font: inherit; cursor: pointer; padding: 0; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.form-grid .stack { display: grid; gap: 16px; }
@media (max-width: 900px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.filters input, .filters select { min-height: 42px; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--fg); font: inherit; font-size: 14px; }
.filters input { flex: 1; min-width: 200px; }
.spec-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }

/* ---------- Header extras ---------- */
.wa-btn { height: 40px; background: #1f9d55; color: #fff; font-size: 14px; flex: none; }
.rail-sep { width: 1px; background: var(--line); margin: 10px 6px; flex: none; }
@media (max-width: 760px) { .wa-btn { display: none; } }

/* ---------- Badges ---------- */
.badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.badge.outline { background: transparent; color: var(--accent-ink); box-shadow: inset 0 0 0 1px var(--accent); }
.badge.sponsored { background: var(--panel-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }

/* ---------- Ads ---------- */
.ad-slot { display: grid; gap: 4px; justify-items: center; margin-block: 16px; overflow: hidden; max-width: 100%; }
.ad-slot img { height: auto; }
.ad-label { font-size: 11px; color: var(--muted); letter-spacing: .04em; }
.prose .ad-slot { margin-block: 1.6em; }

/* ---------- Newsletter ---------- */
.newsletter { display: grid; gap: 8px; }
.newsletter-label { font-weight: 600; font-size: 14px; color: var(--fg); }
.newsletter-row { display: flex; gap: 6px; }
.newsletter-row input { flex: 1; min-width: 0; height: 44px; padding-inline: 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--fg); font: inherit; font-size: 14px; }
.newsletter-ok { margin: 0; font-size: 14px; color: #1f9d55; font-weight: 600; }
.newsletter-box { margin-top: 28px; max-width: 70ch; }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.footer-about { display: grid; gap: 12px; align-content: start; }
.footer-about p { margin: 0; }
.socials { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.socials a { display: inline-block; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; }
.socials a:hover { border-color: var(--accent); color: var(--fg); }

/* ---------- Article extras ---------- */
.article-video { margin: 22px 0 18px; }
.review-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 24px; max-width: 70ch; box-shadow: var(--shadow); }
.review-total { display: grid; justify-items: center; background: var(--accent); color: var(--on-accent); border-radius: 12px; padding: 12px 18px; }
.review-score { font-family: var(--display); font-weight: 800; font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; }
.review-out { font-size: 12px; font-weight: 600; }
.review-bars { display: grid; gap: 8px; }
.review-bar { display: grid; grid-template-columns: 9em minmax(0, 1fr) 2em; gap: 10px; align-items: center; font-size: 14px; }
.review-bar .bar { height: 8px; border-radius: 4px; background: var(--panel-2); overflow: hidden; }
.review-bar .bar span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.review-bar b { font-variant-numeric: tabular-nums; text-align: end; }
.review-verdict { grid-column: 1 / -1; margin: 0; padding-top: 12px; border-top: 1px solid var(--line); }
@media (max-width: 560px) { .review-card { grid-template-columns: minmax(0, 1fr); } .review-total { justify-self: start; } .review-bar { grid-template-columns: 7em minmax(0, 1fr) 2em; } }
.model-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.model-chip { display: grid; padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); font-size: 14px; }
.model-chip span { color: var(--muted); font-size: 13px; }
.model-chip:hover { border-color: var(--accent); }

/* ---------- Car guide ---------- */
.car-filters select { flex: 1; min-width: 150px; }
.car-card .price { display: grid; gap: 2px; margin-top: auto; }
.car-card .price b { font-family: var(--display); font-size: 18px; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.car-card .price small { color: var(--muted); font-size: 12px; }
.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.brand-chip { display: grid; gap: 2px; justify-items: center; text-align: center; padding: 14px 10px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); }
.brand-chip img { height: 36px; width: auto; object-fit: contain; }
.brand-chip small { color: var(--muted); font-size: 12px; }
.brand-chip:hover { border-color: var(--accent); }
.brand-head { display: flex; gap: 18px; align-items: center; }
.brand-logo { width: 84px; height: 84px; object-fit: contain; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px; flex: none; }
.spec-table th { width: 40%; background: transparent; color: var(--muted); font-weight: 500; }
.spec-table td { font-weight: 600; font-variant-numeric: tabular-nums; }
.price-card { display: grid; gap: 10px; }
.price-card p { margin: 0; }
.price-big { font-family: var(--display); font-weight: 800; font-size: 26px; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.dealer-mini { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.dealer-mini li { display: flex; justify-content: space-between; gap: 8px; }
.dealer-mini small { color: var(--muted); }
.dealer-mini a:hover { color: var(--accent-ink); }
@media (max-width: 960px) { .model-side { display: grid; position: static; margin-top: 8px; } }
.compare-pick select { flex: 1; min-width: 180px; }
.compare-table { min-width: 560px; }
.compare-table thead th { vertical-align: bottom; background: var(--panel); color: var(--fg); }
.compare-table thead a { display: grid; gap: 8px; font-family: var(--display); font-size: 15px; }
.compare-table thead img { width: 100%; max-width: 220px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; }
.compare-table tbody th { color: var(--muted); font-weight: 500; background: var(--panel-2); white-space: nowrap; }
.compare-table td { font-weight: 600; }

/* ---------- Tools ---------- */
.fuel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.fuel-tile { display: grid; gap: 6px; }
.fuel-name { color: var(--muted); font-weight: 600; }
.fuel-price { font-family: var(--display); font-weight: 800; font-size: 34px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.fuel-price small { font-family: var(--body); font-size: 13px; font-weight: 500; color: var(--muted); }
.fuel-diff { font-size: 13px; font-weight: 600; color: var(--muted); }
.fuel-diff.up { color: var(--red); }
.fuel-diff.down { color: #1f9d55; }
.fuel-mini { display: block; }
.fuel-mini dl { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fuel-mini dl div { display: grid; }
.fuel-mini dt { font-size: 12px; color: var(--muted); }
.fuel-mini dd { margin: 0; font-family: var(--display); font-weight: 700; font-variant-numeric: tabular-nums; }
.fuel-mini:hover { border-color: var(--accent); }
.stack-lg { display: grid; gap: 16px; align-content: start; }
.calc-form { display: grid; gap: 16px; }
fieldset.field { border: 0; padding: 0; margin: 0; }
fieldset.field legend { font-weight: 500; font-size: 14px; margin-bottom: 6px; }
.radio-row { display: flex; flex-wrap: wrap; gap: 16px; }
.calc-result h2 { font-size: 18px; margin-bottom: 8px; }
.specs .total { border-top: 2px solid var(--fg); border-bottom: 0; margin-top: 4px; padding-top: 12px; }
.specs .total dt { color: var(--fg); font-weight: 700; }
.specs .total dd { font-size: 20px; }
.report-card { display: grid; gap: 8px; align-content: start; }
.report-card h2 { font-size: 18px; }
.report-card:hover { border-color: var(--accent); }
.sales-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sales-list li { display: grid; grid-template-columns: 2.2em minmax(8em, 14em) minmax(0, 1fr) 5em; gap: 12px; align-items: center; }
.sales-rank { font-family: var(--display); font-weight: 800; font-size: 20px; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.sales-name { font-weight: 600; }
.sales-name a:hover { color: var(--accent-ink); }
.sales-bar { height: 10px; background: var(--panel-2); border-radius: 5px; overflow: hidden; }
.sales-bar span { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.sales-units { text-align: end; font-variant-numeric: tabular-nums; color: var(--muted); }
@media (max-width: 560px) { .sales-list li { grid-template-columns: 2em minmax(0, 1fr) 4.5em; } .sales-bar { display: none; } }

/* ---------- Dealers ---------- */
.dealer-card { display: grid; gap: 8px; align-content: start; }
.dealer-card:hover { border-color: var(--accent); }
.dealer-top { display: flex; gap: 12px; align-items: center; }
.dealer-top img { width: 48px; height: 48px; object-fit: contain; border-radius: 8px; flex: none; }
.dealer-top h3 { font-size: 16px; }
.dealer-top .badge { margin-inline-start: auto; }
.dealer-card p { margin: 0; }
.contact-card { display: grid; gap: 12px; align-content: start; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tile-media { position: relative; }
.play-mark { position: absolute; inset-inline-start: 10px; bottom: 10px; width: 36px; height: 36px; border-radius: 50%; background: rgba(8, 9, 11, .75); color: #fff; display: grid; place-items: center; }
.play-mark svg { width: 18px; height: 18px; margin-inline-start: -2px; }
.score-mark { position: absolute; inset-inline-end: 10px; top: 10px; background: var(--accent); color: var(--on-accent); font-family: var(--display); font-weight: 800; font-size: 16px; border-radius: 8px; padding: 2px 10px; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .grid .tile .tile-media .cover { aspect-ratio: 1; height: 100%; } .grid .tile .tile-media { height: 100%; } }

/* ---------- Admin shell ---------- */
.admin-shell { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 28px; padding-block: 24px 56px; align-items: start; }
.admin-nav { display: grid; gap: 14px; position: sticky; top: 88px; }
.admin-nav-group { display: grid; gap: 2px; }
.admin-nav-label { font-size: 12px; font-weight: 700; color: var(--muted); padding-inline: 12px; margin-bottom: 2px; }
.admin-nav a { padding: 8px 12px; border-radius: 8px; font-size: 14px; font-weight: 500; }
.admin-nav a:hover { background: var(--panel); }
.admin-nav a[aria-current="page"] { background: var(--accent); color: var(--on-accent); }
.admin-main { min-width: 0; }
@media (max-width: 900px) {
  .admin-shell { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .admin-nav { position: static; display: flex; overflow-x: auto; gap: 6px; padding-bottom: 4px; }
  .admin-nav-group { display: flex; gap: 6px; flex: none; }
  .admin-nav-label { display: none; }
  .admin-nav a { white-space: nowrap; border: 1px solid var(--line); background: var(--panel); }
}
.admin .panel h2 { font-size: 16px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.stat { display: grid; gap: 4px; }
.stat span { color: var(--muted); font-size: 13px; }
.stat b { font-family: var(--display); font-size: 30px; font-variant-numeric: tabular-nums; line-height: 1.2; }
a.stat:hover { border-color: var(--accent); }
.todo { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.todo a { color: var(--accent-ink); font-weight: 500; }
.todo a:hover { text-decoration: underline; }
.serp { display: grid; gap: 2px; padding: 12px 14px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); }
.serp-url { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.serp-title { font-size: 18px; color: #1a0dab; line-height: 1.4; }
:root[data-theme="dark"] .serp-title { color: #8ab4f8; }
.serp-desc { font-size: 13px; color: var(--muted); line-height: 1.6; }
.hint.over { color: var(--red); }
.rows-editor { display: grid; gap: 8px; }
.rows-editor .row { display: grid; grid-template-columns: 4em minmax(0, 2fr) minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.rows-editor .row button { background: none; border: 0; color: var(--red); cursor: pointer; font: inherit; }
.score-grid { display: grid; grid-template-columns: minmax(0, 1fr) 5em; gap: 8px 10px; align-items: center; font-size: 14px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; max-height: 220px; overflow: auto; padding: 4px; }

/* ---------- Post editor live preview (popup) ---------- */
.preview-modal {
  position: fixed; inset: 0; z-index: 70; display: grid; place-items: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: rgba(8, 9, 11, .62);
}
.preview-dialog {
  width: min(1280px, 100%); height: 100%; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .6);
}
body.modal-open { overflow: hidden; }
.preview-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.preview-title { font-size: 16px; margin-inline-end: 8px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { font: inherit; font-size: 13px; padding: 5px 12px; border: 0; background: var(--panel); color: var(--muted); cursor: pointer; }
.seg button + button { border-inline-start: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.preview-status { font-size: 12px; color: var(--muted); margin-inline-start: auto; }
.preview-close { width: 36px; height: 36px; }
.preview-stage { position: relative; flex: 1; overflow: hidden; background: var(--bg); }
.preview-frame { position: absolute; top: 0; inset-inline-start: 0; border: 0; background: var(--bg); transform-origin: top right; }
@media (max-width: 640px) {
  .preview-modal { padding: 0; }
  .preview-dialog { border-radius: 0; border: 0; }
  .preview-title { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .preview-modal:not([hidden]) .preview-dialog { animation: preview-in .18s ease-out; }
  @keyframes preview-in { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
}

/* ---------- Users and roles ---------- */
.role-options { display: grid; gap: 8px; }
.role-option { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.role-option:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--panel)); }
.role-option input { margin-top: 5px; accent-color: var(--accent); }
.role-option span { display: grid; gap: 2px; }
.role-option small { color: var(--muted); font-size: 13px; }
.role-card { display: grid; gap: 4px; }
.role-card p { margin: 0; }
.role-card:hover { border-color: var(--accent); }
.perm-group { display: grid; gap: 10px; margin: 16px 0 0; border: 1px solid var(--line); }
.perm-group legend { font-family: var(--display); font-weight: 700; padding-inline: 6px; }
.perm-group[disabled] { opacity: .75; }
.perm { align-items: flex-start; }
.perm code { font-size: 12px; color: var(--muted); margin-inline-start: 6px; }

/* ---------- Share and follow ---------- */
.share-row { display: flex; flex-wrap: wrap; gap: 8px; }
.share-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 40px; height: 40px; padding-inline: 10px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--fg); font: inherit; font-size: 13px; cursor: pointer;
}
.share-btn svg { width: 18px; height: 18px; flex: none; }
.share-btn:hover { border-color: var(--accent); }
.share-whatsapp:hover { color: #1f9d55; border-color: #1f9d55; }
.share-facebook:hover { color: #1877f2; border-color: #1877f2; }
.share-telegram:hover { color: #229ed9; border-color: #229ed9; }
.share-linkedin:hover { color: #0a66c2; border-color: #0a66c2; }
.share-end { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); display: grid; gap: 10px; max-width: 70ch; }
.share-end h2 { font-size: 16px; }

/* ---------- Videos ---------- */
.videos-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; }
.yt-btn { background: #e62117; color: #fff; }
.yt-btn svg { width: 20px; height: 20px; }
.video-feature { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.video-feature-text { display: grid; gap: 10px; align-content: start; }
.video-feature-text h2 { font-size: 22px; }
.video-feature-text h2 a:hover { color: var(--accent-ink); }
.video-feature-text p { margin: 0; color: var(--muted); }
@media (max-width: 900px) { .video-feature { grid-template-columns: minmax(0, 1fr); } }
.play-mark.big { inset: 50% auto auto 50%; transform: translate(-50%, -50%); width: 54px; height: 54px; background: rgba(230, 33, 23, .92); }
.play-mark.big svg { width: 26px; height: 26px; }
.video-card:hover .play-mark.big { background: #e62117; }
.video-modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(8, 9, 11, .8); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.video-modal-box { width: min(1040px, 100%); background: var(--panel); border-radius: 14px; overflow: hidden; }
.video-modal-bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.video-modal-bar h2 { font-size: 16px; margin-inline-end: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-modal .embed { border-radius: 0; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-ink); font-weight: 500; cursor: pointer; }
.error-flash { border-color: var(--red); color: var(--red); }

/* ---------- File dropzone (logo upload) ---------- */
.field-label { font-weight: 500; font-size: 14px; }
.logo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.dropzone {
  position: relative; display: grid; place-items: center; gap: 6px; min-height: 150px; padding: 16px; text-align: center; cursor: pointer;
  border: 2px dashed var(--line); border-radius: var(--radius); background: var(--panel-2); color: var(--muted);
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.dragging { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--panel-2)); }
.dropzone:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.dropzone.has-file { border-style: solid; }
.dropzone.dark-preview { background: #15181d; }
.dropzone-empty { display: grid; gap: 4px; justify-items: center; }
.dropzone-empty svg { width: 30px; height: 30px; color: var(--accent-ink); }
.dropzone-empty b { color: var(--fg); font-size: 14px; }
.dropzone-empty small { font-size: 12px; }
.dropzone-preview { max-height: 90px; max-width: 100%; object-fit: contain; }
.dropzone-name { font-size: 12px; direction: ltr; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .dropzone { transition: none; } }

/* ---------- Logo image in header/footer ---------- */
.logo img { height: 34px; width: auto; display: block; }
.site-footer .logo img { height: 30px; }
.logo .logo-dark { display: none; }
:root[data-theme="dark"] .logo.has-dark .logo-light { display: none; }
:root[data-theme="dark"] .logo.has-dark .logo-dark { display: block; }
@media (max-width: 640px) { .logo img { height: 28px; } }

/* ---------- Cookie banner ---------- */
.cookie-banner {
  position: fixed; z-index: 90; inset-inline: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  max-width: 720px; margin-inline: auto; display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: center;
  padding: 16px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .45);
}
.cookie-text { flex: 1 1 320px; min-width: 0; display: grid; gap: 4px; }
.cookie-text h2 { font-size: 16px; }
.cookie-text p { margin: 0; font-size: 14px; color: var(--muted); }
.cookie-text a { color: var(--accent-ink); text-decoration: underline; }
.cookie-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.cookie-actions .btn { min-width: 96px; }
.footer-links { display: inline-flex; flex-wrap: wrap; gap: 14px; }
.footer-links a:hover { color: var(--accent-ink); }

/* ---------- Integrations ---------- */
.integration { display: grid; gap: 14px; }
.integration-head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.integration-head h2 { font-size: 18px; }
.integration-head p { margin: 4px 0 0; }
.steps { margin: 0; padding-inline-start: 20px; display: grid; gap: 6px; font-size: 14px; }
.steps a { color: var(--accent-ink); text-decoration: underline; }
.steps code, .copy-item code { font-size: 13px; background: var(--panel-2); padding: 1px 6px; border-radius: 4px; overflow-wrap: anywhere; }
.copy-list { display: grid; gap: 6px; }
.copy-item { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 6px 6px 6px 10px; border: 1px solid var(--line); border-radius: 8px; }
.copy-item .btn { height: 34px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 15px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { position: relative; width: 44px; height: 24px; border-radius: 999px; background: var(--line); transition: background .15s; flex: none; }
.switch-track::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: inset-inline-start .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { inset-inline-start: 23px; }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .switch-track, .switch-track::after { transition: none; } }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.label-row a { font-size: 13px; color: var(--accent-ink); }
.captcha { min-height: 65px; }
.pick-list { display: grid; gap: 4px; max-height: 420px; overflow: auto; }
.pick { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; padding: 8px; border-radius: 8px; align-items: start; }
.pick:hover { background: var(--panel-2); }
.pick small { grid-column: 2; }
.send-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
fieldset[disabled] { opacity: .8; }
@media (max-width: 640px) {
  .admin .site-header .header-row { flex-wrap: wrap; height: auto; padding-block: 8px; gap: 8px; }
  .admin .site-header .header-row > .meta, .admin .site-header .header-row .btn .meta { display: none; }
  .admin .site-header .header-row .btn { height: 36px; padding-inline: 10px; font-size: 13px; }
  .admin .site-header .header-row > a.btn:first-of-type { margin-inline-start: auto; }
}

/* ---------- AI writer ---------- */
.ai-btn { background: linear-gradient(135deg, #e42614, #a8180b); color: #ffffff; }
.ai-btn svg { width: 18px; height: 18px; }
.ai-dialog { width: min(640px, 100%); max-height: 100%; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .6); display: flex; flex-direction: column; }
.ai-body { display: grid; gap: 14px; padding: 16px; }
.ai-body .field textarea { min-height: 130px; }
.ai-examples { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-examples button { font: inherit; font-size: 13px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2); color: var(--fg); cursor: pointer; }
.ai-examples button:hover { border-color: var(--accent); }
.ai-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--panel-2); }
.ai-progress { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }
.ai-notice { border-color: color-mix(in srgb, #8b5cf6 45%, var(--line)); background: color-mix(in srgb, #8b5cf6 10%, var(--panel)); }
.ai-disclosure { margin-top: 20px; font-size: 13px; color: var(--muted); max-width: 70ch; padding: 10px 14px; border-radius: 8px; background: var(--panel-2); }
