/* GamepadTester.pro — original light workbench design
   Not a dark-lab clone. Brand-first hero + full-bleed live tool stage.
   All SEO blocks stay in normal server HTML flow.
*/

:root {
  --bg: #eef3f8;
  --bg-elevated: #ffffff;
  --bg-muted: #e3ebf4;
  --bg-ink: #0b1220;
  --text: #0b1220;
  --text-muted: #536277;
  --border: #cfdcec;
  --border-strong: #a9bdd6;
  --accent: #0b69f3;
  --accent-hover: #0854c7;
  --accent-soft: #e7f0ff;
  --teal: #0891b2;
  --success: #15803d;
  --warning: #b45309;
  --danger: #b91c1c;
  --shadow: 0 10px 28px rgba(11, 18, 32, 0.06);
  --shadow-lg: 0 28px 70px rgba(11, 18, 32, 0.12);
  --radius: 20px;
  --radius-sm: 14px;
  --radius-pill: 999px;
  --container: 1120px;
  --container-wide: 1240px;
  --font: "Manrope", "Segoe UI", sans-serif;
  --font-display: "Outfit", "Manrope", "Segoe UI", sans-serif;
  --mono: ui-monospace, "Cascadia Code", "Segoe UI Mono", Menlo, Consolas, monospace;
  --header-h: 4.5rem;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  overflow-x: clip;
  max-width: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1000px 520px at 8% -10%, rgba(11, 105, 243, 0.14), transparent 58%),
    radial-gradient(900px 480px at 92% 0%, rgba(8, 145, 178, 0.1), transparent 52%),
    linear-gradient(180deg, #f7fafc 0%, var(--bg) 40%, #e7eef6 100%);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: clip;
  max-width: 100%;
  position: relative;
}

.site-header,
.site-main,
.site-footer {
  max-width: 100%;
  overflow-x: clip;
}

.sr-only,
.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  width: auto;
  height: auto;
  margin: 0;
  clip: auto;
  padding: 0.55rem 0.85rem;
  border-radius: 10px;
  background: #fff;
  color: var(--accent);
  box-shadow: var(--shadow);
  overflow: visible;
  white-space: normal;
}

img { max-width: 100%; height: auto; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

:focus-visible {
  outline: 3px solid #93c5fd;
  outline-offset: 2px;
}

[hidden] { display: none !important; }

.container,
.container-wide {
  width: 100%;
  margin-inline: auto;
  padding-inline: 1rem;
  box-sizing: border-box;
}

.container { max-width: calc(var(--container) + 2rem); }
.container-wide { max-width: calc(var(--container-wide) + 2rem); }

/* Sidebar column only exists when an enabled AdSense sidebar unit is output */
.container-wide.has-ad-sidebar {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 1100px) {
  .container-wide.has-ad-sidebar {
    grid-template-columns: minmax(0, 1fr) 280px;
    align-items: start;
  }
}

.layout-primary {
  width: min(100%, 1080px);
  margin-inline: auto;
}

.container-wide.has-ad-sidebar .layout-primary {
  width: 100%;
  margin-inline: 0;
}

.ad-slot {
  margin: 1rem auto;
  padding: 0.5rem;
  border-radius: 14px;
  border: 1px dashed var(--border);
  background: rgba(255, 255, 255, 0.65);
  overflow: hidden;
  text-align: center;
  max-width: 1080px;
}

.ad-slot--sidebar {
  position: sticky;
  top: calc(var(--header-h) + 0.75rem);
  max-width: none;
}

/* ========== HEADER ========== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  backdrop-filter: blur(16px) saturate(1.2);
  background: rgba(247, 250, 252, 0.88);
  border-bottom: 1px solid rgba(207, 220, 236, 0.9);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.03em;
  text-decoration: none;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.brand:hover { text-decoration: none; color: var(--text); }

.brand-mark {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 0.8rem;
  background: linear-gradient(145deg, #2f86ff, #0b69f3 58%, #0891b2);
  box-shadow: 0 10px 22px rgba(11, 105, 243, 0.3);
  position: relative;
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 2px;
}

.brand-mark::before {
  width: 42%;
  height: 10%;
  left: 29%;
  top: 34%;
  box-shadow: 0 10px 0 rgba(255, 255, 255, 0.92);
}

.brand-mark::after {
  width: 10%;
  height: 34%;
  left: 45%;
  top: 33%;
}

.nav {
  display: none;
  align-items: center;
  gap: 0.1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.nav a {
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  padding: 0.5rem 0.72rem;
  border-radius: 999px;
}

.nav a:hover {
  color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-cta { display: none !important; }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.6rem;
  height: 2.6rem;
  padding: 0 0.7rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  font-size: 0.85rem;
}

.nav-panel {
  display: none;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.97);
  padding: 0.85rem 0 1.1rem;
}

.nav-panel.is-open { display: block; }

.nav-panel .nav {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.nav-panel .nav a {
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
}

@media (min-width: 980px) {
  .nav {
    display: flex;
    flex: 1;
  }
  .nav-toggle { display: none; }
  .nav-panel { display: none !important; }
  .header-cta { display: inline-flex !important; }
}

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  padding: 0.8rem 1.3rem;
  font: inherit;
  font-weight: 780;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn-primary {
  background: linear-gradient(135deg, #2f86ff, #0b69f3 60%, #0854c7);
  color: #fff;
  box-shadow: 0 14px 30px rgba(11, 105, 243, 0.28);
}

.btn-primary:hover { color: #fff; }

.btn-secondary {
  background: #fff;
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-secondary:hover { border-color: #8eb0d8; color: var(--text); }

.btn-sm {
  padding: 0.52rem 0.95rem;
  font-size: 0.9rem;
}

/* ========== HERO / WORKBENCH ========== */
.hero {
  padding: 1.5rem 0 0.5rem;
}

.hero-intro {
  max-width: 860px;
  margin: 0 auto 1.25rem;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 0.75rem;
  color: var(--accent);
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* SEO H1 is the main ranking headline — never the domain name */
.hero-intro h1 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 5.5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.04em;
  color: var(--bg-ink);
}

.hero-intro .prose,
.hero-intro .prose p,
.hero-lead,
.hero-lead p {
  margin: 0 auto;
  max-width: 42rem;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.hero-lead p + p {
  margin-top: 0.65rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 1.15rem;
}

.workbench {
  position: relative;
  width: min(100%, 980px);
  margin: 0.5rem auto 0;
  padding: 1.15rem;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.95)),
    var(--bg-elevated);
  border: 1px solid rgba(207, 220, 236, 0.95);
  box-shadow: var(--shadow-lg);
}

.workbench::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent, rgba(11, 105, 243, 0.05), transparent);
  opacity: 0.8;
}

.tool-shell {
  position: relative;
  z-index: 1;
  padding: 0;
  min-height: 340px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.tool-status-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.8rem 1rem;
  border-radius: 16px;
  background: #f3f7fc;
  border: 1px solid var(--border);
}

.tool-status-bar[data-connected="1"] {
  background: linear-gradient(90deg, #eaf3ff, #e7f8f8);
  border-color: #b7d3ff;
}

.tool-status-bar .status-text {
  margin: 0;
  font-weight: 740;
  color: var(--text-muted);
}

.tool-status-bar[data-connected="1"] .status-text { color: #0b4f9e; }

.tool-connect {
  display: grid;
  gap: 0.75rem;
  place-items: center;
  text-align: center;
  padding: 3rem 1.25rem;
  border-radius: 20px;
  border: 1px dashed var(--border-strong);
  background:
    radial-gradient(500px 180px at 50% 0%, rgba(11, 105, 243, 0.08), transparent 70%),
    #fafcfe;
}

.tool-connect h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  letter-spacing: -0.03em;
}

.tool-quicklinks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1rem;
}

.tool-quicklinks a {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

.tool-quicklinks a:hover {
  color: var(--accent);
  border-color: #9fc0ef;
  background: var(--accent-soft);
}

.panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.muted { color: var(--text-muted); }

/* ========== SECTIONS ========== */
.section { padding: 3rem 0; }

.section-head {
  margin: 0 0 1.5rem;
  max-width: 720px;
}

.section-head--center {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

.section-kicker {
  margin: 0 0 0.45rem;
  color: var(--teal);
  font-weight: 800;
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.section-head h2,
.section > .container > h2,
.section > .container-wide > h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  letter-spacing: -0.03em;
}

.section-card { padding: 1.5rem 1.55rem; }

/* ========== TOOL CATEGORIES (all features) ========== */
.tool-categories {
  display: grid;
  gap: 1.25rem;
}

.tool-category {
  padding: 1.2rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.tool-category-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.9rem;
}

.tool-category-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.tool-category-head p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.grid-tools {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.7rem;
}

.tool-card {
  display: grid;
  gap: 0.35rem;
  align-content: start;
  padding: 1rem 1.05rem;
  min-height: 108px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  color: inherit;
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.tool-card:hover {
  transform: translateY(-2px);
  border-color: #9fc0ef;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
}

.tool-card-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.82rem;
  margin-bottom: 0.15rem;
}

.tool-card strong {
  font-size: 0.98rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.tool-card span {
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

/* ========== PROSE / FAQ ========== */
.prose { color: var(--text); }
.prose p, .prose ol, .prose ul, .prose h3 {
  margin-top: 0;
  margin-bottom: 0.9rem;
}
.prose h3 {
  font-family: var(--font-display);
  font-size: 1.12rem;
  margin-top: 1.25rem;
  letter-spacing: -0.02em;
}

.content-figure {
  margin: 0 0 1.25rem;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.5);
}

.content-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 1rem;
}

.breadcrumbs a { color: var(--text-muted); }

.faq details {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  padding: 0.95rem 1.1rem;
  margin-bottom: 0.65rem;
  box-shadow: 0 4px 14px rgba(11, 18, 32, 0.03);
}

.faq summary {
  cursor: pointer;
  font-weight: 760;
  font-family: var(--font-display);
}

.cta-band {
  text-align: center;
  padding: 2.4rem 1.4rem;
  border-radius: 24px;
  background:
    radial-gradient(640px 220px at 50% 0%, rgba(11, 105, 243, 0.12), transparent 70%),
    #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.cta-band h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3vw, 2rem);
  letter-spacing: -0.03em;
}

.cta-band p {
  margin: 0 auto 1.2rem;
  max-width: 34rem;
  color: var(--text-muted);
}

/* ========== TOOL PAGE ========== */
.hero--tool .hero-intro {
  text-align: left;
  margin-left: 0;
  max-width: none;
}

.hero--tool .hero-intro .prose,
.hero--tool .hero-intro .prose p,
.hero--tool .hero-lead,
.hero--tool .hero-lead p {
  margin-left: 0;
}

.hero--tool .hero-actions { justify-content: flex-start; }

.hero--tool h1 {
  font-size: clamp(1.7rem, 4.5vw, 2.6rem);
}

/* ========== FOOTER ========== */
.site-footer {
  margin-top: 2rem;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, #f5f8fc, #e8eef6);
  padding: 1.35rem 0 1rem;
}

.footer-grid {
  display: grid;
  gap: 0.85rem;
}

.footer-brand .brand {
  font-size: 0.95rem;
}

.footer-brand p {
  margin: 0.45rem 0 0;
  color: var(--text-muted);
  max-width: 28rem;
  font-size: 0.86rem;
  line-height: 1.45;
}

.footer-accordions {
  display: grid;
  gap: 0.4rem;
}

.footer-acc {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  overflow: hidden;
}

.footer-acc summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  font-weight: 800;
  user-select: none;
}

.footer-acc summary::-webkit-details-marker { display: none; }

.footer-acc summary::after {
  content: "+";
  font-size: 1rem;
  line-height: 1;
  color: var(--text-muted);
  font-weight: 700;
}

.footer-acc[open] summary::after { content: "–"; }

.footer-acc nav {
  display: grid;
  gap: 0.15rem;
  padding: 0 0.55rem 0.65rem;
}

.footer-acc a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 650;
  font-size: 0.9rem;
  padding: 0.4rem 0.4rem;
  border-radius: 8px;
}

.footer-acc a:hover {
  color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.55rem 0.85rem;
  margin-top: 0.95rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.82rem;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
}

.footer-legal a {
  color: var(--text-muted);
  font-weight: 650;
  text-decoration: none;
}

.footer-legal a:hover {
  color: var(--accent);
  text-decoration: underline;
}

@media (min-width: 860px) {
  .footer-grid {
    grid-template-columns: minmax(0, 1.2fr) repeat(3, minmax(0, 1fr));
    align-items: start;
    gap: 1.25rem;
  }

  .footer-accordions {
    display: contents;
  }

  .footer-acc {
    border: 0;
    border-radius: 0;
    background: transparent;
    overflow: visible;
  }

  .footer-acc summary {
    pointer-events: none;
    cursor: default;
    padding: 0 0 0.65rem;
    letter-spacing: 0.1em;
  }

  .footer-acc summary::after {
    display: none;
  }

  .footer-acc nav {
    padding: 0;
    gap: 0.45rem;
  }

  .footer-acc a {
    padding: 0;
    border-radius: 0;
  }

  .footer-acc a:hover {
    background: transparent;
  }
}

/* ========== ADMIN (preserved) ========== */
.admin-body { background: #f3f5f9; }
.admin-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
.admin-nav {
  background: #0f172a;
  color: #e2e8f0;
  padding: 1.25rem 1rem;
}
.admin-nav a {
  display: block;
  color: #cbd5e1;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  text-decoration: none;
  margin-bottom: 0.25rem;
}
.admin-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  text-decoration: none;
}
.admin-main { padding: 1.5rem; }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.85rem;
  margin: 1rem 0 1.5rem;
}
.stat {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
}
.stat strong { display: block; font-size: 1.5rem; }
.form {
  display: grid;
  gap: 0.85rem;
  max-width: 420px;
}
.form label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
}
.form input {
  font: inherit;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}
.alert {
  padding: 0.8rem 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
}
.alert-error {
  background: #fee2e2;
  color: var(--danger);
  border: 1px solid #fecaca;
}
.alert-success {
  background: #dcfce7;
  color: var(--success);
  border: 1px solid #bbf7d0;
}
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.login-card {
  width: min(100%, 420px);
  padding: 1.5rem;
}
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th,
.admin-table td {
  text-align: left;
  padding: 0.7rem 0.55rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.admin-table .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}
.admin-form { display: grid; gap: 0.85rem; }
.admin-form label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
}
.admin-form input,
.admin-form textarea,
.admin-form select {
  font: inherit;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  width: 100%;
}
.admin-form .checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}
.admin-form .checkbox input { width: auto; }
.admin-grid-2 { display: grid; gap: 1rem; }
.help {
  margin: 0 0 0.75rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
}
.linkish {
  background: none;
  border: none;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}
.linkish.danger { color: var(--danger); }
.schema-preview {
  background: #0f172a;
  color: #e2e8f0;
  padding: 0.9rem;
  border-radius: 10px;
  overflow: auto;
  max-height: 280px;
  font-size: 0.82rem;
}
.faq-row,
.menu-row {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem;
  margin-bottom: 0.65rem;
  background: #fafbfd;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.55rem;
}
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.85rem;
}
.media-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem;
  background: #fff;
}

@media (min-width: 960px) {
  .admin-grid-2 { grid-template-columns: 1.15fr 0.85fr; }
}

@media (max-width: 800px) {
  .admin-shell { grid-template-columns: 1fr; }
}

/* ========== RESPONSIVE: tablet / mobile ========== */
@media (max-width: 979px) {
  .container,
  .container-wide {
    padding-inline: 0.85rem;
  }

  .brand {
    font-size: 0.98rem;
    min-width: 0;
    max-width: calc(100% - 5.5rem);
  }

  .brand span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .header-inner {
    min-height: 3.75rem;
    gap: 0.65rem;
  }

  .hero {
    padding: 1.1rem 0 0.25rem;
  }

  .hero-intro {
    margin-bottom: 1rem;
  }

  .hero-intro h1 {
    font-size: clamp(1.65rem, 7vw, 2.35rem);
    word-wrap: break-word;
  }

  .hero-actions {
    width: 100%;
  }

  .hero-actions .btn {
    flex: 1 1 10rem;
  }

  .workbench {
    padding: 0.75rem;
    border-radius: 18px;
  }

  .tool-connect {
    padding: 1.75rem 0.85rem;
  }

  .tool-status-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .tool-status-bar .btn {
    width: 100%;
  }

  .tool-quicklinks {
    justify-content: center;
  }

  .section {
    padding: 2rem 0;
  }

  .section-card {
    padding: 1.15rem 1rem;
  }

  .grid-tools {
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
  }

  .tool-card {
    min-height: 0;
    padding: 0.85rem 0.8rem;
  }

  .tool-category {
    padding: 0.95rem;
    border-radius: 16px;
  }

  .cta-band {
    padding: 1.75rem 1rem;
    border-radius: 18px;
  }
}

@media (max-width: 560px) {
  .container,
  .container-wide {
    padding-inline: 0.75rem;
  }

  .site-main,
  .layout-primary,
  .hero,
  .hero-intro,
  .workbench,
  .section-card,
  .prose,
  .tool-shell {
    min-width: 0;
    max-width: 100%;
  }

  .workbench {
    padding: 0.65rem;
    border-radius: 16px;
  }

  .brand-mark {
    width: 1.9rem;
    height: 1.9rem;
    flex-shrink: 0;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .btn {
    width: 100%;
    flex: none;
  }

  .grid-tools {
    grid-template-columns: 1fr;
  }

  .tool-category-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .tool-quicklinks {
    max-width: 100%;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .engine-meta {
    grid-template-columns: 1fr 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .tool-card { transition: none; }
}
