:root{
    --red:#c8102e;
    --red-dark:#8f0b21;
    --black:#111111;
    --ink:#1c1c1c;
    --muted:#5b6470;
    --line:#e5e7eb;
    --bg:#ffffff;
    --bg-alt:#f7f7f8;
    --radius:10px;
    --shadow:0 6px 24px rgba(17,17,17,.08);
    --max:1120px;
  }
  
  *,*::before,*::after{box-sizing:border-box}
  html{-webkit-text-size-adjust:100%}
  body{
    margin:0;font-family:"Segoe UI",system-ui,-apple-system,Roboto,Arial,sans-serif;
    color:var(--ink);background:var(--bg);line-height:1.6;
  }
  img{max-width:100%;height:auto;display:block}
  a{color:var(--red);text-decoration:none}
  a:hover{text-decoration:underline}
  
  .container{max-width:var(--max);margin:0 auto;padding:0 20px}
  .sr-only{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{position:absolute;left:-999px;top:0;background:var(--black);color:#fff;padding:10px 14px;z-index:100}
  .skip-link:focus{left:10px}
  
  /* Header */
  .site-header{background:#fff;border-bottom:1px solid var(--line);position:sticky;top:0;z-index:50}
  .header-inner{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:14px 20px}
  .brand{display:flex;align-items:center;gap:12px;color:var(--black)}
  .brand:hover{text-decoration:none}
  .brand-mark{
    display:inline-grid;place-items:center;width:38px;height:38px;border-radius:8px;
    background:var(--red);color:#fff;font-weight:800;font-size:1.15rem;
  }
  .brand-text strong{display:block;font-size:1.05rem;color:var(--black)}
  .brand-text small{color:var(--muted);font-size:.78rem}
  
  .primary-nav ul{display:flex;gap:20px;list-style:none;margin:0;padding:0}
  .primary-nav a{color:var(--ink);font-weight:500;padding:6px 0}
  .primary-nav a.is-active{color:var(--red);border-bottom:2px solid var(--red)}
  
  .nav-toggle{display:none;background:none;border:0;padding:6px;cursor:pointer}
  .nav-toggle-bar{display:block;width:24px;height:2px;background:var(--black);margin:4px 0}
  
  /* Hero */
  .hero{background:linear-gradient(180deg,#fff 0%,var(--bg-alt) 100%);padding:64px 0}
  .hero-inner{display:grid;grid-template-columns:1.15fr .85fr;gap:40px;align-items:center}
  .eyebrow{color:var(--red);text-transform:uppercase;letter-spacing:.12em;font-size:.8rem;font-weight:700;margin:0 0 8px}
  .hero h1{font-size:2.6rem;line-height:1.15;margin:0 0 16px;color:var(--black)}
  .lead{font-size:1.08rem;color:var(--muted)}
  .hero-actions{display:flex;gap:12px;margin-top:20px;flex-wrap:wrap}
  
  .hero-card{background:#fff;border:1px solid var(--line);border-left:6px solid var(--red);border-radius:var(--radius);padding:24px;box-shadow:var(--shadow)}
  .hero-card-tag{color:var(--red);font-size:.75rem;font-weight:700;text-transform:uppercase;letter-spacing:.1em}
  .hero-card h3{margin:8px 0}
  
  /* Sections */
  .section{padding:56px 0}
  .section-alt{background:var(--bg-alt)}
  .section-head{max-width:720px;margin-bottom:28px}
  .section-head h2{margin:0 0 8px;font-size:1.9rem;color:var(--black)}
  .section-cta{margin-top:28px}
  
  .page-hero{background:var(--black);color:#fff;padding:52px 0}
  .page-hero h1{margin:0 0 8px;color:#fff;font-size:2.1rem}
  .page-hero .lead{color:#e6e6e6}
  
  /* Grid + cards */
  .grid{display:grid;gap:20px}
  .grid-2{grid-template-columns:repeat(2,1fr)}
  .grid-3{grid-template-columns:repeat(3,1fr)}
  .card{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:22px;box-shadow:var(--shadow)}
  .card h3{margin:0 0 8px;color:var(--black)}
  .card p{margin:0 0 12px;color:var(--muted)}
  .tag{display:inline-block;background:#fde8eb;color:var(--red-dark);padding:3px 10px;border-radius:999px;font-size:.75rem;font-weight:600}
  .link-arrow{color:var(--red);font-weight:600}
  .link-arrow::after{content:" →"}
  
  /* Buttons */
  .btn{display:inline-block;padding:11px 20px;border-radius:8px;font-weight:600;border:2px solid transparent;cursor:pointer;font-size:.98rem}
  .btn:hover{text-decoration:none}
  .btn-primary{background:var(--red);color:#fff}
  .btn-primary:hover{background:var(--red-dark)}
  .btn-ghost{border-color:var(--black);color:var(--black);background:transparent}
  .btn-ghost:hover{background:var(--black);color:#fff}
  
  /* Prose */
  .prose{max-width:760px}
  .prose h2{margin-top:32px;color:var(--black)}
  .prose p{margin:0 0 16px}
  .notice{background:#fff7e6;border-left:4px solid #e8a300;padding:12px 16px;border-radius:6px;color:#5c4400}
  
  /* Flash */
  .flash{margin-top:16px;padding:12px 16px;border-radius:8px;font-weight:500}
  .flash-success{background:#e7f6ec;color:#106b2c}
  .flash-error{background:#fde8eb;color:#8f0b21}
  .flash-info{background:#e8f0fe;color:#1a3a8f}
  
  /* Footer */
  .site-footer{background:var(--black);color:#d9d9d9;padding:44px 0 20px;margin-top:40px}
  .footer-grid{display:grid;grid-template-columns:1.3fr 1fr 1fr 1fr;gap:28px}
  .footer-grid h4,.footer-grid h5{color:#fff;margin:0 0 12px}
  .footer-grid ul{list-style:none;padding:0;margin:0}
  .footer-grid li{margin-bottom:6px}
  .site-footer a{color:#d9d9d9}
  .site-footer a:hover{color:#fff}
  .footer-bottom{border-top:1px solid #333;margin-top:28px;padding-top:16px;display:flex;justify-content:space-between;flex-wrap:wrap;gap:8px;font-size:.9rem}
  .muted{color:var(--muted)}
  
  /* Admin */
  .admin .admin-header{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:24px}
  .admin-table{width:100%;border-collapse:collapse;background:#fff;border:1px solid var(--line);border-radius:var(--radius);overflow:hidden}
  .admin-table th,.admin-table td{padding:12px 14px;text-align:left;border-bottom:1px solid var(--line);font-size:.95rem}
  .admin-table th{background:var(--bg-alt);font-weight:700}
  .pill{display:inline-block;padding:2px 10px;border-radius:999px;font-size:.75rem;font-weight:700;text-transform:uppercase}
  .pill-published{background:#e7f6ec;color:#106b2c}
  .pill-draft{background:#fff3cd;color:#7a5b00}
  .pill-archived{background:#eee;color:#555}
  
  .form-stack{display:flex;flex-direction:column;gap:16px;max-width:820px}
  .form-stack label{display:flex;flex-direction:column;gap:6px;font-weight:600;color:var(--black)}
  .form-stack input[type=text],.form-stack input[type=number],.form-stack input[type=email],
  .form-stack textarea,.form-stack select{
    font:inherit;padding:10px 12px;border:1px solid var(--line);border-radius:8px;background:#fff;
  }
  .form-stack textarea.mono{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:.92rem}
  .form-stack fieldset{border:1px solid var(--line);border-radius:var(--radius);padding:16px;display:flex;flex-direction:column;gap:12px}
  .form-stack legend{padding:0 8px;font-weight:700}
  .form-stack label.inline{flex-direction:row;align-items:center;gap:8px}
  
  /* Responsive */
  @media (max-width: 860px){
    .hero-inner{grid-template-columns:1fr}
    .grid-2,.grid-3{grid-template-columns:1fr}
    .footer-grid{grid-template-columns:1fr 1fr}
    .nav-toggle{display:block}
    .primary-nav{display:none;position:absolute;top:100%;left:0;right:0;background:#fff;border-bottom:1px solid var(--line);padding:16px 20px}
    .primary-nav.is-open{display:block}
    .primary-nav ul{flex-direction:column;gap:12px}
    .header-inner{position:relative}
  }

  /* -------------------------------------------------------------
   Phase 3 additions: catalogue and product pages
   ------------------------------------------------------------- */

.catalogue-h {
    margin: 0 0 16px;
    font-size: 1.4rem;
  }
  
  .category-chips {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }
  .category-chips a {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--ink);
    font-weight: 500;
  }
  .category-chips a:hover {
    border-color: var(--red);
    color: var(--red);
    text-decoration: none;
  }
  
  .product-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .product-card h3 {
    margin: 6px 0 4px;
  }
  .product-card h3 a {
    color: var(--black);
  }
  .product-card h3 a:hover {
    color: var(--red);
    text-decoration: none;
  }
  .product-card-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: auto;
  }
  
  .license-badge,
  .platform-badge,
  .featured-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
  }
  .license-badge  { background: #eef2ff; color: #2b3a8f; }
  .license-free   { background: #e7f6ec; color: #106b2c; }
  .license-trial  { background: #fff3cd; color: #7a5b00; }
  .license-commercial { background: #fde8eb; color: var(--red-dark); }
  .platform-badge { background: #f3f4f6; color: #374151; text-transform: none; letter-spacing: 0; }
  .featured-badge { background: var(--red); color: #fff; }
  
  /* Product detail page */
  
  .product-hero .eyebrow a {
    color: var(--red);
  }
  .product-hero .lead {
    max-width: 780px;
  }
  .product-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
  }
  
  .product-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 40px;
    align-items: start;
  }
  .product-block {
    margin-bottom: 40px;
  }
  .product-block h2 {
    margin: 0 0 12px;
    font-size: 1.35rem;
    color: var(--black);
  }
  
  .product-aside {
    position: sticky;
    top: 90px;
  }
  .aside-card {
    background: var(--bg-alt);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 16px;
  }
  .aside-card h3 {
    margin: 0 0 10px;
    font-size: 1.05rem;
  }
  .aside-links {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .aside-links li { margin-bottom: 6px; }
  
  /* Releases */
  
  .release-list {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .release-list > li {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-bottom: 12px;
    background: #fff;
  }
  .release-head {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
  }
  .release-channel {
    font-size: .72rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
  }
  .release-stable  { background: #e7f6ec; color: #106b2c; }
  .release-beta    { background: #fff3cd; color: #7a5b00; }
  .release-preview { background: #e8f0fe; color: #1a3a8f; }
  .release-hotfix  { background: #fde8eb; color: var(--red-dark); }
  .release-latest  { background: var(--red); color: #fff; font-size:.7rem; padding: 2px 8px; border-radius: 4px; font-weight:700; text-transform: uppercase; letter-spacing:.04em; }
  .release-date    { color: var(--muted); font-size: .9rem; }
  .release-notes   { margin-top: 12px; font-size: .95rem; color: var(--ink); }
  .release-min     { margin-top: 8px; color: var(--muted); font-size: .9rem; }
  
  /* Responsive */
  
  @media (max-width: 860px) {
    .product-layout { grid-template-columns: 1fr; }
    .product-aside  { position: static; }
  }

  /* Client logos band */
.client-logos {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    align-items: center;
  }
  .client-logos li {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 90px;
  }
  .client-logos img {
    max-height: 48px;
    max-width: 100%;
    filter: grayscale(100%);
    opacity: .85;
    transition: filter .2s, opacity .2s;
  }
  .client-logos li:hover img {
    filter: grayscale(0);
    opacity: 1;
  }
  .client-logo-text {
    font-weight: 600;
    color: var(--ink);
    text-align: center;
  }
  .client-logos a { color: inherit; }

  /* -------------------------------------------------------------
   Admin chrome
   ------------------------------------------------------------- */

.admin-body {
    background: #f4f5f7;
  }
  
  .admin-bar {
    background: #fff;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 40;
  }
  .admin-bar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
  }
  .admin-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--black);
    font-weight: 700;
  }
  .admin-brand:hover { text-decoration: none; }
  .admin-brand-text {
    font-size: .95rem;
    letter-spacing: .02em;
  }
  .admin-brand-text strong { color: var(--red); }
  
  .admin-nav { flex: 1; }
  .admin-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 8px;
  }
  .admin-nav a {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--ink);
    font-weight: 500;
    font-size: .92rem;
  }
  .admin-nav a:hover {
    background: #f0f0f1;
    text-decoration: none;
  }
  .admin-nav a.is-active {
    background: var(--red);
    color: #fff;
  }
  
  .admin-user {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .admin-user-name {
    color: var(--muted);
    font-size: .9rem;
  }
  .admin-logout-form { margin: 0; }
  .button-sm { padding: 6px 14px; font-size: .85rem; }
  
  .admin-flash-wrap {
    max-width: 1200px;
    margin: 16px auto 0;
    padding: 0 20px;
  }
  
  .admin-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px 60px;
  }
  
  .admin-foot {
    background: #fff;
    border-top: 1px solid var(--line);
    margin-top: 60px;
  }
  .admin-foot-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: .85rem;
  }
  
  /* The auth card on /admin/login centres vertically and has no top bar */
  .admin-auth {
    min-height: calc(100vh - 120px);
    display: grid;
    place-items: center;
    padding: 40px 20px;
  }
  .auth-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 8px 32px rgba(17,17,17,.06);
  }
  .auth-brand { margin-bottom: 20px; }
  .auth-card h1 { margin: 0 0 6px; font-size: 1.5rem; }
  .auth-card label { display: block; margin-top: 14px; font-weight: 600; font-size: .9rem; }
  .auth-card input[type=email],
  .auth-card input[type=password] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    margin-top: 4px;
  }
  .auth-card input:focus {
    outline: 2px solid var(--red);
    outline-offset: 1px;
    border-color: var(--red);
  }
  .auth-footnote { margin-top: 18px; text-align: center; font-size: .9rem; }
  
  /* Buttons — some admin views use .button, others use .btn */
  .button {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 600;
    font-size: .95rem;
    border: 2px solid transparent;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
  }
  .button:hover { text-decoration: none; }
  .button-primary { background: var(--red); color: #fff; }
  .button-primary:hover { background: var(--red-dark); }
  .button-secondary { background: transparent; border-color: var(--line); color: var(--ink); }
  .button-secondary:hover { border-color: var(--black); }
  .button-full { width: 100%; margin-top: 18px; }
  
  /* Responsive */
  @media (max-width: 860px) {
    .admin-bar-inner { flex-wrap: wrap; }
    .admin-nav-toggle { display: block; order: 3; margin-left: auto; }
    .admin-nav { display: none; flex-basis: 100%; order: 4; }
    .admin-nav.is-open { display: block; }
    .admin-nav ul { flex-direction: column; }
    .admin-user { order: 2; }
    .admin-user-name { display: none; }
  }
/* -------------------------------------------------------------
   Admin: page heads, forms, tables
   ------------------------------------------------------------- */

   .admin-page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
  }
  .admin-page-head h1 { margin: 0 0 4px; font-size: 1.5rem; }
  
  .admin-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 24px;
    margin-bottom: 24px;
  }
  
  .admin-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  
  .form-section {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 18px 20px;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0 0 20px;
  }
  .form-section legend {
    padding: 0 8px;
    font-weight: 700;
    color: var(--black);
    font-size: .95rem;
  }
  
  .admin-form label,
  .form-section label {
    display: block;
    font-weight: 600;
    font-size: .9rem;
    color: var(--black);
    margin-top: 4px;
  }
  .admin-form input[type=text],
  .admin-form input[type=email],
  .admin-form input[type=url],
  .admin-form input[type=password],
  .admin-form input[type=number],
  .admin-form select,
  .admin-form textarea,
  .form-section input[type=text],
  .form-section input[type=email],
  .form-section input[type=url],
  .form-section input[type=number],
  .form-section select,
  .form-section textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    background: #fff;
    margin-top: 4px;
  }
  .admin-form input:focus,
  .admin-form select:focus,
  .admin-form textarea:focus,
  .form-section input:focus,
  .form-section select:focus,
  .form-section textarea:focus {
    outline: 2px solid var(--red);
    outline-offset: 1px;
    border-color: var(--red);
  }
  .admin-form textarea.mono,
  .form-section textarea.mono {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: .9rem;
    line-height: 1.5;
  }
  
  .checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
  }
  .checkbox-row input { margin: 0; }
  
  .checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
  }
  
  .form-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
  }
  
  .hint {
    color: var(--muted);
    font-size: .82rem;
    margin: 4px 0 0;
  }
  
  /* Tables — extend the existing admin-table look */
  .admin-table .actions {
    white-space: nowrap;
  }
  .admin-table .actions a,
  .admin-table .actions button {
    color: var(--red);
  }
  .admin-table td code {
    font-size: .82rem;
  }
  
  .inline-form {
    display: inline;
  }
  .link-plain,
  .link-danger {
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    font: inherit;
  }
  .link-plain { color: var(--red); }
  .link-danger { color: var(--red-dark); font-weight: 600; }
  .link-plain:hover,
  .link-danger:hover { text-decoration: underline; }
  
  /* Pager */
  .pager {
    display: flex;
    gap: 6px;
    margin-top: 18px;
    flex-wrap: wrap;
  }
  .pager a,
  .pager-current {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--line);
    font-size: .9rem;
    color: var(--ink);
  }
  .pager-current {
    background: var(--red);
    color: #fff;
    border-color: var(--red);
  }
  
  /* Panels used on dashboard & editor pages */
  .content-panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 20px 22px;
    margin-top: 20px;
  }
  .content-panel h2 {
    margin: 0 0 12px;
    font-size: 1.15rem;
    color: var(--black);
  }
  
  @media (max-width: 860px) {
    .admin-form-grid { grid-template-columns: 1fr; }
  }
  .admin-page-head-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
  }

  /* -------------------------------------------------------------
   Admin dashboard
   ------------------------------------------------------------- */

.dash-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
  }
  
  .metric-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .metric-label {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    font-weight: 700;
  }
  .metric-value {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--black);
    line-height: 1.1;
  }
  .metric-sub {
    font-size: .85rem;
    color: var(--muted);
  }
  
  .dash-section-h {
    margin: 8px 0 16px;
    font-size: 1.1rem;
    color: var(--black);
  }
  
  .dash-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    margin-bottom: 32px;
  }
  .dash-action {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--ink);
    transition: border-color .15s, box-shadow .15s;
  }
  .dash-action:hover {
    border-color: var(--red);
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(200,16,46,.06);
  }
  .dash-action-icon {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: var(--red);
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
  }
  .dash-action strong {
    display: block;
    color: var(--black);
  }
  .dash-action small {
    display: block;
    color: var(--muted);
    font-size: .82rem;
    margin-top: 2px;
  }
  
  .dash-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
  }
  .dash-columns > .content-panel {
    margin-top: 0;
  }
  
  .panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
  }
  .panel-head h2 {
    margin: 0;
    font-size: 1.05rem;
    color: var(--black);
  }
  .panel-head a {
    font-size: .85rem;
    color: var(--red);
  }
  
  .dash-table {
    width: 100%;
    border-collapse: collapse;
  }
  .dash-table td {
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
    font-size: .92rem;
  }
  .dash-table tr:last-child td {
    border-bottom: 0;
  }
  .dash-table .align-right {
    text-align: right;
    white-space: nowrap;
    vertical-align: middle;
  }
  
  .account-details {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 8px 20px;
    margin: 0;
  }
  .account-details dt {
    color: var(--muted);
    font-weight: 600;
    font-size: .88rem;
  }
  .account-details dd {
    margin: 0;
  }
  
  @media (max-width: 860px) {
    .dash-columns { grid-template-columns: 1fr; }
  }

  /* Block D: release editor */

.form-section-h {
    margin: 24px 0 8px;
    font-size: 1rem;
    color: var(--black);
  }
  
  .release-list {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .release-list > li {
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
  }
  .release-list > li:last-child {
    border-bottom: 0;
  }
  
  .eyebrow a {
    color: var(--red);
    font-weight: 500;
  }

  /* Prerequisites text box */
.release-prereqs {
    margin-top: 14px;
    padding: 12px 16px;
    background: var(--bg-alt);
    border-left: 3px solid var(--red);
    border-radius: 6px;
  }
  .release-prereqs h4 {
    margin: 0 0 8px;
    font-size: .95rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--red-dark);
  }
  .release-prereqs .prose { font-size: .95rem; }
  .release-prereqs ul { margin: 0 0 0 18px; }
  
  /* File sections */
  .release-prereqs-files,
  .release-main-files {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
  }
  .release-prereqs-files h4,
  .release-main-files h4 {
    margin: 0 0 10px;
    font-size: .92rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--red-dark);
  }
  .file-download-list {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .file-download-list li {
    padding: 8px 0;
    border-bottom: 1px dashed var(--line);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
  }
  .file-download-list li:last-child { border-bottom: 0; }
  .file-meta {
    color: var(--muted);
    font-size: .82rem;
  }

  /* Product hero image */
.product-hero-image {
    max-width: var(--max);
    margin: -40px auto 0;
    padding: 0 20px;
    position: relative;
    z-index: 2;
  }
  .product-hero-image img {
    width: 100%;
    max-height: 460px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(17,17,17,.18);
    background: #eee;
  }
  
  /* Gallery strip */
  .product-gallery {
    padding: 24px 0;
    background: var(--bg-alt);
  }
  .gallery-strip {
    display: flex;
    gap: 12px;
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    scrollbar-width: thin;
  }
  .gallery-strip li { flex: 0 0 auto; }
  .gallery-thumb {
    display: block;
    width: 140px;
    height: 90px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    background: #eee;
  }
  .gallery-thumb:hover { border-color: var(--red); }
  .gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  
  /* YouTube embed */
  .aside-video .youtube-embed {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
  }
  .aside-video iframe {
    width: 100%;
    height: 100%;
    border: 0;
  }
  
  /* Media previews in admin */
  .media-preview {
    margin-top: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 6px;
    background: #fff;
    display: inline-block;
    max-width: 240px;
  }
  .media-preview img {
    max-width: 100%;
    display: block;
    border-radius: 6px;
  }
  
  /* Admin gallery grid */
  .gallery-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-top: 12px;
  }
  .gallery-admin-item {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px;
    background: #fff;
    text-align: center;
  }
  .gallery-admin-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 6px;
    background: #eee;
  }
  .muted.small { font-size: .78rem; }

  /* Product cards on the homepage and catalogue */
.product-card {
  padding: 0;                /* image goes edge-to-edge */
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.product-card-image {
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--bg-alt);
  overflow: hidden;
}
.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}
.product-card:hover .product-card-image img {
  transform: scale(1.03);
}

.product-card-image-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1c1c1c, #2a2a2a);
  color: #fff;
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* Restore internal padding on the text content since we removed the
   card's outer padding to make the image full-bleed. */
.product-card > .tag,
.product-card > h3,
.product-card > p,
.product-card > .link-arrow {
  padding-left: 22px;
  padding-right: 22px;
}
.product-card > .tag {
  margin-top: 18px;
}
.product-card > .link-arrow {
  padding-bottom: 22px;
  margin-top: auto;
}

/* -------------------------------------------------------------
   Portfolio
   ------------------------------------------------------------- */

   .portfolio-card {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  
  .portfolio-card-image {
    display: block;
    aspect-ratio: 16 / 10;
    background: var(--bg-alt);
    overflow: hidden;
  }
  .portfolio-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
  }
  .portfolio-card:hover .portfolio-card-image img {
    transform: scale(1.03);
  }
  .portfolio-card-placeholder {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1c1c1c, #2a2a2a);
    color: #fff;
    font-weight: 800;
    font-size: 2rem;
    letter-spacing: .04em;
    text-transform: uppercase;
  }
  
  .portfolio-card-body {
    padding: 18px 22px 22px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
  }
  .portfolio-card-body h3 {
    margin: 6px 0 4px;
  }
  .portfolio-card-body h3 a {
    color: var(--black);
  }
  .portfolio-card-body h3 a:hover {
    color: var(--red);
    text-decoration: none;
  }
  .portfolio-card-body .link-arrow {
    margin-top: auto;
  }
  
  .portfolio-client {
    margin: 0;
    color: var(--muted);
    font-size: .9rem;
  }
  
  .portfolio-filter {
    padding: 16px 0;
  }
  
  /* Individual project page */
  
  .portfolio-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 16px;
    font-size: .95rem;
  }
  .portfolio-meta strong {
    color: var(--red);
  }
  
  .portfolio-hero-image {
    max-width: var(--max);
    margin: -40px auto 0;
    padding: 0 20px;
    position: relative;
    z-index: 2;
  }
  .portfolio-hero-image img {
    width: 100%;
    max-height: 520px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(17,17,17,.18);
    background: #eee;
  }
  
  .portfolio-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 40px;
    align-items: start;
  }
  
  .portfolio-gallery {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
  }
  .portfolio-gallery-thumb {
    display: block;
    aspect-ratio: 4 / 3;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-alt);
  }
  .portfolio-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .25s ease;
  }
  .portfolio-gallery-thumb:hover img {
    transform: scale(1.04);
  }
  
  .tech-tags {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  
  @media (max-width: 860px) {
    .portfolio-layout { grid-template-columns: 1fr; }
  }

  .card-grid.five {
    grid-template-columns: repeat(5, 1fr);
  }
  @media (max-width: 1280px) {
    .card-grid.five { grid-template-columns: repeat(3, 1fr); }
  }
  @media (max-width: 860px) {
    .card-grid.five { grid-template-columns: repeat(2, 1fr); }
  }
  @media (max-width: 600px) {
    .card-grid.five { grid-template-columns: 1fr; }
  }

  .dash-columns + .dash-columns {
    margin-top: 24px;
  }

  /* -------------------------------------------------------------
   Blog
   ------------------------------------------------------------- */

.blog-search {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  max-width: 520px;
}
.blog-search input[type=search] {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}
.blog-search input[type=search]:focus {
  outline: 2px solid var(--red);
  outline-offset: 1px;
  border-color: var(--red);
}

.blog-filters { padding: 20px 0; }
.filter-group { margin-bottom: 12px; }
.filter-group:last-child { margin-bottom: 0; }
.filter-label {
  margin: 0 0 8px;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  font-weight: 700;
}

/* Listing */

.blog-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.blog-list-item {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.blog-list-item:last-child { border-bottom: 0; padding-bottom: 0; }

.blog-list-image {
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-alt);
}
.blog-list-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}
.blog-list-image:hover img { transform: scale(1.03); }

.blog-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1c1c1c, #2a2a2a);
  color: #fff;
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.blog-list-body h2 {
  margin: 6px 0 4px;
  font-size: 1.35rem;
}
.blog-list-body h2 a {
  color: var(--black);
}
.blog-list-body h2 a:hover {
  color: var(--red);
  text-decoration: none;
}
.blog-meta {
  color: var(--muted);
  font-size: .88rem;
  margin: 0 0 8px;
}
.blog-excerpt {
  color: var(--ink);
  margin: 0 0 10px;
}

/* Article */

.blog-hero-image {
  max-width: var(--max);
  margin: -40px auto 0;
  padding: 0 20px;
  position: relative;
  z-index: 2;
}
.blog-hero-image img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(17,17,17,.18);
  background: #eee;
}

.blog-article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 40px;
  align-items: start;
}
.blog-article {
  max-width: none;
}
.blog-article img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 20px 0;
}
.blog-article pre {
  background: #1c1c1c;
  color: #eee;
  padding: 16px 18px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: .9rem;
}
.blog-article code {
  background: #f4f5f7;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: .9em;
}
.blog-article pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

.tag-inline {
  background: var(--red);
  color: #fff;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 600;
  vertical-align: middle;
}

@media (max-width: 860px) {
  .blog-list-item { grid-template-columns: 1fr; gap: 14px; }
  .blog-article-layout { grid-template-columns: 1fr; }
}

/* -------------------------------------------------------------
   WYSIWYG editor
   ------------------------------------------------------------- */

   .wysiwyg {
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
  }
  
  .wysiwyg-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 6px;
    border-bottom: 1px solid var(--line);
    background: #f8f9fa;
  }
  
  .wysiwyg-btn {
    min-width: 32px;
    height: 32px;
    border: 1px solid transparent;
    border-radius: 5px;
    background: transparent;
    color: var(--ink);
    font-size: .9rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0 8px;
    line-height: 1;
    transition: background .12s, border-color .12s;
  }
  .wysiwyg-btn:hover {
    background: #fff;
    border-color: var(--line);
  }
  .wysiwyg-btn:active {
    background: var(--red);
    color: #fff;
  }
  
  .wysiwyg-editor {
    min-height: 320px;
    max-height: 600px;
    overflow-y: auto;
    padding: 18px 20px;
    outline: none;
    font-size: 1rem;
    line-height: 1.65;
    color: var(--ink);
  }
  .wysiwyg-editor:focus {
    background: #fff;
  }
  .wysiwyg-editor h2 { font-size: 1.5rem; margin: 20px 0 10px; }
  .wysiwyg-editor h3 { font-size: 1.2rem; margin: 18px 0 8px; }
  .wysiwyg-editor p  { margin: 0 0 14px; }
  .wysiwyg-editor ul, .wysiwyg-editor ol { margin: 0 0 14px 24px; }
  .wysiwyg-editor blockquote {
    border-left: 3px solid var(--red);
    margin: 14px 0;
    padding: 8px 16px;
    color: var(--muted);
    background: var(--bg-alt);
    border-radius: 4px;
  }
  .wysiwyg-editor code {
    background: #f4f5f7;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: .9em;
    font-family: ui-monospace, Menlo, Consolas, monospace;
  }
  .wysiwyg-editor img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 8px 0;
  }
  
  /* Source mode: shows the raw HTML as text. */
  .wysiwyg-source .wysiwyg-editor {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: .88rem;
    white-space: pre-wrap;
    background: #1c1c1c;
    color: #eee;
  }
  
  /* -------------------------------------------------------------
     Blog admin
     ------------------------------------------------------------- */
  
  .tag-input-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .tag-input {
    font: inherit;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
  }
  .tag-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
  }
  .tag-suggestions button {
    background: #f4f5f7;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 3px 10px;
    font-size: .82rem;
    cursor: pointer;
    color: var(--ink);
  }
  .tag-suggestions button:hover {
    background: var(--red);
    color: #fff;
    border-color: var(--red);
  }

  /* Social share buttons */

.share-buttons {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.share-buttons li {
  display: block;
}
.share-buttons a,
.share-buttons button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: .9rem;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s, background .15s;
  text-align: left;
}
.share-buttons a:hover,
.share-buttons button:hover {
  background: var(--bg-alt);
  border-color: var(--red);
  color: var(--red);
  text-decoration: none;
}
.share-icon {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #f4f5f7;
  font-weight: 700;
  font-size: .85rem;
  flex-shrink: 0;
  color: var(--black);
}
.share-buttons a:hover .share-icon,
.share-buttons button:hover .share-icon {
  background: var(--red);
  color: #fff;
}
.share-buttons .share-copy.is-copied {
  background: #e7f6ec;
  border-color: #106b2c;
  color: #106b2c;
}

/* Inline share block */
.share-inline {
  margin: 40px 0;
  padding: 20px;
  background: var(--bg-alt);
  border-radius: 10px;
}
.share-inline h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}
.share-inline .share-buttons {
  flex-direction: row;
  flex-wrap: wrap;
}
.share-inline .share-buttons a,
.share-inline .share-buttons button {
  width: auto;
}

/* -------------------------------------------------------------
   Tutorials
   ------------------------------------------------------------- */

   .tutorial-filters { padding: 20px 0; }

   .tutorial-filter-form .filter-row {
     display: flex;
     gap: 16px;
     align-items: flex-end;
     flex-wrap: wrap;
   }
   .tutorial-filter-form label {
     display: block;
     font-size: .82rem;
     text-transform: uppercase;
     letter-spacing: .05em;
     color: var(--muted);
     font-weight: 700;
     margin-bottom: 4px;
   }
   .tutorial-filter-form select {
     min-width: 220px;
     padding: 9px 12px;
     border: 1px solid var(--line);
     border-radius: 8px;
     font: inherit;
     background: #fff;
   }
   .filter-actions {
     display: flex;
     gap: 8px;
   }
   
   /* Cards */
   .tutorial-card {
     padding: 0;
     overflow: hidden;
     display: flex;
     flex-direction: column;
   }
   .tutorial-card-image {
     display: block;
     aspect-ratio: 16 / 9;
     background: var(--bg-alt);
     overflow: hidden;
   }
   .tutorial-card-image img {
     width: 100%;
     height: 100%;
     object-fit: cover;
     transition: transform .3s ease;
   }
   .tutorial-card:hover .tutorial-card-image img {
     transform: scale(1.03);
   }
   .tutorial-placeholder {
     display: grid;
     place-items: center;
     width: 100%;
     height: 100%;
     background: linear-gradient(135deg, #1c1c1c, #2a2a2a);
     color: #fff;
     font-weight: 800;
     font-size: 2rem;
     letter-spacing: .04em;
     text-transform: uppercase;
   }
   .tutorial-card-body {
     padding: 18px 22px 22px;
     display: flex;
     flex-direction: column;
     gap: 8px;
     flex: 1;
   }
   .tutorial-card-body h3 {
     margin: 6px 0 4px;
   }
   .tutorial-card-body h3 a {
     color: var(--black);
   }
   .tutorial-card-body h3 a:hover {
     color: var(--red);
     text-decoration: none;
   }
   .tutorial-card-body .link-arrow {
     margin-top: auto;
   }
   
   .tutorial-badges {
     display: flex;
     flex-wrap: wrap;
     gap: 6px;
     align-items: center;
   }
   .difficulty-badge,
   .duration-badge,
   .step-count {
     display: inline-block;
     padding: 2px 10px;
     border-radius: 999px;
     font-size: .72rem;
     font-weight: 700;
     letter-spacing: .04em;
     text-transform: uppercase;
   }
   .difficulty-beginner     { background: #e7f6ec; color: #106b2c; }
   .difficulty-intermediate { background: #fff3cd; color: #7a5b00; }
   .difficulty-advanced     { background: #fde8eb; color: var(--red-dark); }
   .duration-badge          { background: #eef2ff; color: #2b3a8f; }
   .step-count              { background: #f3f4f6; color: #374151; }
   
   .tutorial-product {
     color: var(--muted);
     font-size: .88rem;
     margin: 0;
   }
   
   /* Individual tutorial */
   .tutorial-meta {
     display: flex;
     gap: 8px;
     flex-wrap: wrap;
     margin-top: 16px;
   }
   
   .tutorial-layout {
     display: grid;
     grid-template-columns: minmax(0, 1fr) 300px;
     gap: 40px;
     align-items: start;
   }
   .tutorial-main { max-width: none; }
   
   .tutorial-intro {
     margin-bottom: 32px;
   }
   
   .tutorial-video { margin: 32px 0; }
   .tutorial-video h2 {
     font-size: 1.35rem;
     margin: 0 0 12px;
   }
   .youtube-embed {
     position: relative;
     width: 100%;
     aspect-ratio: 16 / 9;
     border-radius: 8px;
     overflow: hidden;
     background: #000;
   }
   .youtube-embed iframe {
     width: 100%;
     height: 100%;
     border: 0;
   }
   
   .tutorial-steps {
     margin-top: 32px;
   }
   .steps-heading {
     font-size: 1.5rem;
     margin: 0 0 20px;
     padding-bottom: 8px;
     border-bottom: 2px solid var(--line);
   }
   
   .steps-list {
     list-style: none;
     margin: 0;
     padding: 0;
     counter-reset: step;
   }
   .step-item {
     counter-increment: step;
     margin-bottom: 40px;
     padding-left: 0;
     scroll-margin-top: 100px;
   }
   .step-item:last-child { margin-bottom: 0; }
   
   .step-header {
     display: flex;
     gap: 14px;
     align-items: flex-start;
     margin-bottom: 12px;
   }
   .step-number {
     display: inline-grid;
     place-items: center;
     flex-shrink: 0;
     width: 36px;
     height: 36px;
     border-radius: 50%;
     background: var(--red);
     color: #fff;
     font-weight: 800;
     font-size: 1rem;
   }
   .step-heading {
     margin: 0;
     font-size: 1.2rem;
     line-height: 1.4;
     color: var(--black);
     padding-top: 4px;
   }
   .step-body {
     font-size: .98rem;
     margin-left: 50px;
   }
   .step-body p { margin: 0 0 12px; }
   .step-figure {
     margin: 16px 0 0 50px;
     border-radius: 10px;
     overflow: hidden;
     background: var(--bg-alt);
   }
   .step-figure img {
     width: 100%;
     height: auto;
     display: block;
   }
   .step-figure figcaption {
     padding: 8px 12px;
     font-size: .85rem;
     color: var(--muted);
     background: #fff;
     border: 1px solid var(--line);
     border-top: 0;
   }
   
   /* Sidebar table of contents */
   .step-toc {
     list-style: none;
     margin: 0;
     padding: 0;
     counter-reset: toc;
   }
   .step-toc li {
     counter-increment: toc;
     margin-bottom: 6px;
     font-size: .9rem;
   }
   .step-toc li::before {
     content: counter(toc) ". ";
     color: var(--red);
     font-weight: 700;
   }
   .step-toc a {
     color: var(--ink);
   }
   .step-toc a:hover {
     color: var(--red);
     text-decoration: none;
   }
   
   @media (max-width: 860px) {
     .tutorial-layout { grid-template-columns: 1fr; }
     .step-body,
     .step-figure {
       margin-left: 0;
     }
   }
   .tutorial-filter-form .filter-search {
    flex: 1 1 260px;
    min-width: 220px;
  }
  .tutorial-filter-form input[type=search] {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    background: #fff;
  }
  .tutorial-filter-form input[type=search]:focus {
    outline: 2px solid var(--red);
    outline-offset: 1px;
    border-color: var(--red);
  }
  /* -------------------------------------------------------------
   Tutorial admin — step editor
   ------------------------------------------------------------- */

.step-editor-list {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  counter-reset: step;
}
.step-editor-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 10px;
  background: #fff;
}
.step-editor-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.step-editor-num {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-weight: 700;
  font-size: .82rem;
  flex-shrink: 0;
}
.step-editor-actions {
  margin-left: auto;
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: .9rem;
}
.step-editor-thumb {
  margin-top: 8px;
}
.step-editor-thumb img {
  max-height: 80px;
  border-radius: 6px;
  border: 1px solid var(--line);
}
.step-editor-body {
  margin-top: 8px;
  font-size: .92rem;
  color: var(--muted);
  max-height: 120px;
  overflow: hidden;
  position: relative;
}
.step-editor-body::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(to bottom, transparent, #fff);
}

.step-add-form {
  border-top: 2px solid var(--line);
  padding-top: 20px;
  margin-top: 20px;
}
.step-add-form h3 {
  margin: 0 0 12px;
  font-size: 1.05rem;
  color: var(--black);
}

/* -------------------------------------------------------------
   Contact form
   ------------------------------------------------------------- */

   .contact-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    gap: 40px;
    align-items: start;
  }
  .contact-form-col h2 { margin-top: 0; }
  
  .contact-form .admin-form-grid {
    margin-bottom: 4px;
  }
  
  .contact-form input.has-error,
  .contact-form textarea.has-error {
    border-color: var(--red);
    background: #fff5f7;
  }
  .error-msg {
    color: var(--red-dark);
    font-size: .85rem;
    margin: 2px 0 0;
    font-weight: 500;
  }
  
  /* Honeypot — hidden but present in DOM. Do not use display:none,
     some bots skip those. Move offscreen instead. */
  .hp-field {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
  }
  
  .contact-pref {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 12px;
  }
  .contact-pref legend {
    padding: 0 6px;
    font-weight: 600;
    font-size: .9rem;
  }
  .contact-pref .checkbox-row {
    margin: 6px 0;
  }
  
  .consent-row {
    align-items: flex-start;
    margin-top: 20px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
    font-weight: 400;
    line-height: 1.5;
    font-size: .93rem;
  }
  .consent-row input {
    margin-top: 3px;
    flex-shrink: 0;
  }
  
  .faq-list {
    margin: 0;
  }
  .faq-list dt {
    font-weight: 700;
    color: var(--black);
    margin-top: 12px;
  }
  .faq-list dt:first-child { margin-top: 0; }
  .faq-list dd {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: .92rem;
  }
  .faq-list dd p { margin: 0 0 8px; }
  .faq-list dd p:last-child { margin-bottom: 0; }
  
  @media (max-width: 860px) {
    .contact-layout { grid-template-columns: 1fr; }
  }

  .recaptcha-wrap {
    margin: 20px 0 4px;
  }
  .recaptcha-wrap .g-recaptcha {
    margin-bottom: 4px;
  }
  /* Enquiries admin */
.status-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.status-tabs a {
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--ink);
  font-size: .9rem;
  font-weight: 500;
  background: #fff;
  border: 1px solid var(--line);
}
.status-tabs a:hover { text-decoration: none; border-color: var(--red); color: var(--red); }
.status-tabs a.is-active { background: var(--red); color: #fff; border-color: var(--red); }
.tab-count {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(0,0,0,.08);
  font-size: .78rem;
  font-weight: 700;
}
.status-tabs a.is-active .tab-count { background: rgba(255,255,255,.22); }

.enquiry-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}
.enquiry-body {
  font-size: .96rem;
  line-height: 1.6;
  white-space: pre-line;
}
@media (max-width: 860px) {
  .enquiry-layout { grid-template-columns: 1fr; }
}

.section-dark {
  background: #1c1c1c;
  color: #e6e6e6;
}
.section-dark h2, .section-dark h3 { color: #fff; }
.section-dark .muted { color: #a0a0a0; }
.section-dark a { color: #ffb3c0; }
.section-dark .btn-ghost-light {
  background: transparent;
  border: 2px solid #fff;
  color: #fff;
}
.section-dark .btn-ghost-light:hover {
  background: #fff;
  color: #1c1c1c;
}
.cta-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
  align-items: start;
}
.newsletter-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.newsletter-form input[type=email] {
  flex: 1 1 220px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #444;
  background: #262626;
  color: #fff;
  font: inherit;
}
.newsletter-form input[type=email]:focus {
  outline: 2px solid var(--red);
  outline-offset: 1px;
  border-color: var(--red);
}
.metric-highlight {
  border-color: var(--red);
  background: #fff5f7;
}
@media (max-width: 860px) {
  .cta-grid { grid-template-columns: 1fr; }
}

/* Hero — gradient fallback and image variant */
.hero {
  position: relative;
  padding: 64px 0;
  background: linear-gradient(180deg, #fff 0%, var(--bg-alt) 100%);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}

.hero.has-image {
  color: #fff;
  padding: 140px 0 120px;
}

/* The overlay only shows when a background image is applied. */
.hero:not(.has-image) .hero-overlay {
  display: none;
}

.hero.has-image .hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.78) 0%,
    rgba(0, 0, 0, 0.62) 40%,
    rgba(0, 0, 0, 0.42) 100%
  );
  z-index: 1;
  pointer-events: none;
}

.hero.has-image .hero-inner {
  position: relative;
  z-index: 2;
}

.hero.has-image .eyebrow {
  color: #ffb3c0;
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
}
.hero.has-image h1 {
  color: #fff;
  text-shadow: 0 2px 6px rgba(0,0,0,.4);
}
.hero.has-image .lead {
  color: #e8e8e8;
  text-shadow: 0 1px 2px rgba(0,0,0,.4);
}

/* Buttons on dark hero */
.hero.has-image .btn-primary {
  background: var(--red);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
}
.hero.has-image .btn-ghost {
  border-color: #fff;
  color: #fff;
  background: transparent;
}
.hero.has-image .btn-ghost:hover {
  background: #fff;
  color: var(--black);
}

/* The floating card gets a glass effect */
.hero.has-image .hero-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-left: 6px solid var(--red);
  color: var(--black);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.hero.has-image .hero-card h3 { color: var(--black); }
.hero.has-image .hero-card p  { color: var(--muted); }
.hero.has-image .hero-card-tag { color: var(--red); }