/* CSISC Training — styled to match csisc.co.uk (same tokens, type and components),
   plus the shop, library, simulator and admin components for the training site. */
:root{
  --ink:#10182B;
  --paper:#F1EFE8;
  --paper-raised:#FBFAF6;
  --slate:#262D3D;
  --steel:#5E6577;
  --steel-light:#8A90A0;
  --hairline:#D8D3C3;
  --hairline-dark:#2A3346;
  --amber:#AD7A24;
  --amber-bright:#D9A63E;
  --amber-soft:#E7DAC0;
  --green:#2E5D46;
  --green-soft:#DCE8E0;
  --alert:#9C3B34;
  --alert-soft:#F2DEDA;
  --navy-head:#041A3A;
  --navy-panel:#0C1322;
  --navy-panel-raised:#161F35;
  --radius:2px;
  --max:1180px;
}

*{box-sizing:border-box;}
[hidden]{display:none !important;}
html{scroll-behavior:smooth;}
html, body{ overflow-x:hidden; max-width:100%; }
@media (prefers-reduced-motion: reduce){
  html{scroll-behavior:auto;}
  *{animation-duration:0.001ms !important; animation-iteration-count:1 !important; transition-duration:0.001ms !important;}
}
body{
  margin:0; background:var(--paper); color:var(--slate);
  font-family:'Inter',system-ui,sans-serif; font-size:16px; line-height:1.6;
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3,h4{
  font-family:'Newsreader',Georgia,serif; font-weight:500; color:var(--ink);
  margin:0 0 0.5em; letter-spacing:-0.01em; text-wrap:balance;
}
p{margin:0 0 1em;}
a{color:inherit;}
img{max-width:100%;display:block;}
code{font-family:'IBM Plex Mono',monospace;font-size:.88em;background:var(--amber-soft);padding:1px 5px;border-radius:2px;color:var(--ink)}
.muted{color:var(--steel)}
.fine{font-size:13px;color:var(--steel);margin:10px 0 0}

.eyebrow{
  font-family:'IBM Plex Mono',monospace; font-size:12.5px; letter-spacing:0.14em;
  text-transform:uppercase; color:var(--amber);
  display:flex; align-items:center; gap:10px; margin-bottom:16px;
}
.eyebrow::before{ content:""; width:22px; height:1px; background:var(--amber); display:inline-block; }

.wrap{ max-width:var(--max); margin:0 auto; padding:0 32px; }
@media(max-width:600px){ .wrap{ padding:0 20px; } }

a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible{
  outline:2px solid var(--amber); outline-offset:3px;
}

/* ---------- HEADER (as csisc.co.uk) ---------- */
header.site{
  position:sticky; top:0; z-index:50; background:var(--navy-head);
  border-bottom:1px solid rgba(255,255,255,0.1);
  box-shadow:0 6px 20px -12px rgba(4,26,58,0.5);
}
.nav-row{
  max-width:var(--max); margin:0 auto; padding:18px 32px;
  display:flex; align-items:center; justify-content:space-between; gap:24px;
}
@media(max-width:600px){ .nav-row{ padding:14px 20px; } }
.wordmark{ display:flex; align-items:baseline; gap:10px; text-decoration:none; flex-shrink:0; min-width:0; }
.wordmark .mark{ font-family:'Newsreader',serif; font-weight:600; font-size:23px; color:#F4F2EA; letter-spacing:0.01em; }
.wordmark .mark span{ color:var(--amber); }
.wordmark .sub{ font-family:'IBM Plex Mono',monospace; font-size:10.5px; color:#8A93AC; letter-spacing:0.04em; display:none; }
@media(min-width:720px){ .wordmark .sub{ display:inline; } }

nav.primary{ display:none; min-width:0; }
@media(min-width:1140px){
  nav.primary{ display:flex; gap:22px; font-size:14px; flex-shrink:1; min-width:0; }
  nav.primary a{ text-decoration:none; color:#D7DAE4; position:relative; padding:4px 0; white-space:nowrap; }
  nav.primary a::after{
    content:""; position:absolute; left:0; right:0; bottom:-2px; height:1px; background:var(--amber);
    transform:scaleX(0); transform-origin:left; transition:transform .2s ease;
  }
  nav.primary a:hover{ color:#F4F2EA; }
  nav.primary a:hover::after{ transform:scaleX(1); }
  nav.primary a.active{ color:var(--amber); }
  nav.primary a.active::after{ transform:scaleX(1); }
}
.nav-actions{ display:flex; align-items:center; gap:14px; }
.nav-actions form{ margin:0; }
.nav-link{ color:#D7DAE4; text-decoration:none; font-size:14px; background:none; border:0; padding:4px 0; cursor:pointer; font-family:'Inter',sans-serif; white-space:nowrap; }
.nav-link:hover{ color:var(--amber); }
.nav-actions .hide-sm{ display:none; }
@media(min-width:720px){ .nav-actions .hide-sm{ display:inline-flex; } }
@media(max-width:420px){ .wordmark .mark{ font-size:21px; } .nav-actions{ gap:10px; } }

.menu-toggle{
  display:inline-flex; flex-direction:column; background:none; border:1px solid rgba(255,255,255,0.3);
  padding:9px 11px; border-radius:var(--radius); cursor:pointer;
}
@media(min-width:1140px){ .menu-toggle{ display:none; } }
.menu-toggle span{ display:block; width:18px; height:1.5px; background:#F4F2EA; margin:3.5px 0; }
.mobile-panel{
  display:none; flex-direction:column; padding:8px 32px 24px;
  border-top:1px solid rgba(255,255,255,0.1); background:var(--navy-head);
}
.mobile-panel.open{ display:flex; }
@media(min-width:1140px){ .mobile-panel.open{ display:none; } }
.mobile-panel a, .mobile-panel button{
  padding:12px 0; text-decoration:none; color:#D7DAE4; border:0; border-bottom:1px solid rgba(255,255,255,0.1);
  font-size:15px; background:none; text-align:left; font-family:'Inter',sans-serif; cursor:pointer; width:100%;
}
.mobile-panel a.active{ color:var(--amber); }
.mobile-panel form{ margin:0; }

/* ---------- BUTTONS ---------- */
.btn{
  font-family:'Inter',sans-serif; font-weight:600; font-size:14px; text-decoration:none;
  display:inline-flex; align-items:center; justify-content:center; gap:8px; padding:12px 20px;
  border-radius:var(--radius); border:1px solid var(--hairline-dark); background:transparent; color:var(--ink);
  cursor:pointer; white-space:nowrap; transition:background .15s ease, color .15s ease, border-color .15s ease;
}
.btn:hover{ border-color:var(--amber); color:var(--amber); }
.btn.primary, .btn-primary{ background:var(--ink); border-color:var(--ink); color:var(--paper-raised); }
.btn.primary:hover, .btn-primary:hover{ background:var(--amber); border-color:var(--amber); color:var(--paper-raised); }
.btn-amber{ background:var(--amber); border-color:var(--amber); color:#0B1220; }
.btn-amber:hover{ background:#C79436; border-color:#C79436; color:#0B1220; }
.btn-on-dark{ border-color:rgba(255,255,255,0.35); color:#F1EFE8; }
.btn-on-dark:hover{ border-color:#D9B876; color:#D9B876; }
.btn.small{ padding:9px 14px; font-size:13.5px; }
.btn:disabled{ opacity:.45; cursor:not-allowed; }
.btn:disabled:hover{ border-color:var(--hairline-dark); color:var(--ink); }
.btn.primary:disabled:hover{ background:var(--ink); color:var(--paper-raised); }
.link-btn{ background:none; border:0; padding:4px 0; color:var(--ink); font:inherit; font-size:14px; text-decoration:underline; text-decoration-color:var(--amber); text-underline-offset:3px; cursor:pointer; }
.link-btn:hover{ color:var(--amber); }
.cart-btn{ background:none; border:1px solid rgba(255,255,255,0.3); color:#F4F2EA; padding:8px 12px; border-radius:var(--radius); font:inherit; font-size:14px; cursor:pointer; display:inline-flex; align-items:center; gap:8px; }
.cart-btn:hover{ border-color:var(--amber); }
.cart-count{ font-family:'IBM Plex Mono',monospace; background:var(--amber); color:#0B1220; border-radius:9px; padding:0 7px; font-size:12px; line-height:18px; }

/* ---------- HERO + PAGE BANNER (as csisc.co.uk) ---------- */
.hero, .page-banner{
  position:relative; display:flex; align-items:center; background-size:cover; background-position:center;
  border-bottom:1px solid var(--hairline-dark); overflow:hidden; padding:0;
}
.hero{ min-height:560px; }
.page-banner{ min-height:300px; }
.hero::before, .page-banner::before{
  content:""; position:absolute; inset:0; z-index:0;
  background:linear-gradient(100deg, rgba(9,14,26,0.94) 0%, rgba(9,14,26,0.82) 42%, rgba(9,14,26,0.42) 100%);
}
.hero .wrap, .page-banner .wrap{ position:relative; z-index:1; padding-top:64px; padding-bottom:64px; width:100%; }
.page-banner .wrap{ padding-top:52px; padding-bottom:52px; }
.hero .eyebrow, .page-banner .eyebrow{ color:#D9B876; }
.hero .eyebrow::before, .page-banner .eyebrow::before{ background:#D9B876; }
.hero-grid{ max-width:660px; }
.hero h1{ font-size:clamp(2.3rem, 4.3vw, 3.55rem); line-height:1.06; max-width:17ch; color:#F8F6EF; }
.hero h1 em, .page-banner h1 em{ font-style:italic; color:var(--amber-bright); font-weight:500; }
.hero .lede{ font-size:18px; color:#D7DAE4; max-width:48ch; margin:22px 0 34px; }
.hero-ctas{ display:flex; flex-wrap:wrap; gap:14px; margin-bottom:30px; }
.hero-note{ font-family:'IBM Plex Mono',monospace; font-size:12.5px; color:#9BA2B8; letter-spacing:0.02em; margin:0; }
.page-banner .crumb{ font-family:'IBM Plex Mono',monospace; font-size:12px; color:#9BA2B8; letter-spacing:0.04em; margin-bottom:20px; }
.page-banner .crumb a{ text-decoration:none; color:#9BA2B8; }
.page-banner .crumb a:hover{ color:var(--amber); }
.page-banner h1{ font-size:clamp(2rem, 3.6vw, 2.9rem); max-width:22ch; line-height:1.08; color:#F8F6EF; }
.page-banner .lede{ font-size:17px; color:#D7DAE4; max-width:58ch; margin:18px 0 0; }
.page-banner .lede a{ color:#D9B876; }

/* ---------- SECTIONS ---------- */
section{ padding:92px 0; }
section.tight{ padding:72px 0; }
@media(max-width:600px){ section{ padding:64px 0; } section.tight{ padding:52px 0; } }
.section-head{ max-width:660px; margin-bottom:48px; }
.section-head h2{ font-size:clamp(1.7rem, 2.6vw, 2.35rem); line-height:1.15; }
.section-head .lede{ color:var(--steel); font-size:16.5px; margin-top:14px; }
.section-head .lede a{ color:var(--ink); text-decoration-color:var(--amber); }
.border-top{ border-top:1px solid var(--hairline); }
.bg-raised{ background:var(--paper-raised); }

.icon-trio{ display:grid; grid-template-columns:1fr; gap:36px; margin-top:8px; }
@media(min-width:780px){ .icon-trio{ grid-template-columns:repeat(3,1fr); } }
.icon-item .icon{ width:38px; height:38px; margin-bottom:18px; display:block; color:var(--amber); }
.icon-item h3{ font-size:17.5px; margin-bottom:8px; }
.icon-item p{ color:var(--steel); font-size:14.5px; margin:0; }

.strip{ padding:26px 0; border-bottom:1px solid var(--hairline); border-top:1px solid var(--hairline); }
.strip .wrap{ display:flex; flex-wrap:wrap; align-items:center; gap:14px 34px; }
.strip .label{ font-family:'IBM Plex Mono',monospace; font-size:11.5px; letter-spacing:0.1em; text-transform:uppercase; color:var(--steel-light); }
.strip .frameworks{ display:flex; flex-wrap:wrap; gap:10px 28px; font-family:'IBM Plex Mono',monospace; font-size:13px; color:var(--steel); }
.strip .frameworks b{ color:var(--amber); font-weight:500; margin-right:6px; }

.feature-row{ display:grid; grid-template-columns:1fr; gap:40px; align-items:center; }
@media(min-width:940px){ .feature-row{ grid-template-columns:1fr 1fr; gap:68px; } }
.feature-media{ position:relative; }
.feature-media::before{ content:""; position:absolute; top:16px; left:16px; right:-16px; bottom:-16px; border:1px solid var(--hairline-dark); z-index:0; }
.feature-media img{ position:relative; z-index:1; width:100%; aspect-ratio:4/3; object-fit:cover; border-radius:var(--radius); }
@media(max-width:600px){ .feature-media::before{ right:-8px; bottom:-8px; top:8px; left:8px; } }
.callout-line{ font-family:'Newsreader',serif; font-style:italic; font-size:19px; line-height:1.5; color:var(--ink); border-left:3px solid var(--amber); padding-left:18px; margin:20px 0 22px; }
.bullets{ list-style:none; margin:22px 0 0; padding:0; }
.bullets li{ padding:12px 0 12px 26px; border-top:1px solid var(--hairline); font-size:14.5px; color:var(--steel); position:relative; }
.bullets li:first-child{ border-top:none; }
.bullets li::before{ content:""; position:absolute; left:0; top:23px; width:8px; height:1px; background:var(--amber); }
.bullets strong{ color:var(--ink); }

/* Briefing cards (domain-card language from csisc.co.uk) */
.domains-grid{ display:grid; grid-template-columns:1fr; gap:1px; background:var(--hairline); border:1px solid var(--hairline); }
@media(min-width:700px){ .domains-grid{ grid-template-columns:1fr 1fr; } }
@media(min-width:1040px){ .domains-grid{ grid-template-columns:1fr 1fr 1fr; } }
.domain-card{ background:var(--paper-raised); padding:30px 28px; min-width:0; }
.domain-card .clause{ font-family:'IBM Plex Mono',monospace; font-size:12px; color:var(--amber); letter-spacing:0.06em; margin-bottom:12px; display:block; text-transform:uppercase; }
.domain-card h3{ font-size:19px; margin-bottom:10px; }
.domain-card p{ color:var(--steel); font-size:14.5px; margin:0 0 10px; }
.domain-card ul{ margin:0; padding:0; list-style:none; }
.domain-card li{ font-size:13.8px; color:var(--steel); padding:6px 0 6px 16px; position:relative; border-top:1px solid var(--hairline); }
.domain-card li::before{ content:"—"; position:absolute; left:0; color:var(--steel-light); }
.kpi-table{ width:100%; border-collapse:collapse; font-size:13.8px; margin-top:4px; }
.kpi-table td{ padding:7px 0; border-top:1px solid var(--hairline); color:var(--steel); }
.kpi-table td:last-child{ text-align:right; font-family:'IBM Plex Mono',monospace; font-size:12.5px; color:var(--ink); }

/* Stats band */
.stats-band{ position:relative; background:var(--ink) center/cover no-repeat; color:#EDEAE0; padding:70px 0; }
.stats-band::before{ content:""; position:absolute; inset:0; background:rgba(16,24,43,0.93); }
.stats-band .wrap{ position:relative; z-index:1; }
.stats-grid{ display:grid; grid-template-columns:repeat(2,1fr); gap:36px; }
@media(min-width:820px){ .stats-grid{ grid-template-columns:repeat(4,1fr); } }
.stat .figure{ font-family:'Newsreader',serif; font-size:clamp(2.1rem,4vw,2.9rem); color:#F4F2EA; line-height:1; margin-bottom:10px; font-variant-numeric:tabular-nums; }
.stat .figure span{ color:var(--amber-bright); }
.stat .caption{ font-size:13.5px; color:#9BA2B8; max-width:24ch; line-height:1.5; }
.stats-band .fine{ color:#7C84A0; margin-top:34px; font-size:12.5px; }

/* CTA band */
.cta-band{ background:var(--navy-panel); color:#EDEAE0; padding:80px 0; }
.cta-band .wrap{ display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:28px; }
.cta-band h2{ color:#F4F2EA; font-size:clamp(1.7rem,3vw,2.2rem); max-width:20ch; margin:0 0 10px; }
.cta-band p{ color:#A6ADC0; max-width:52ch; margin:0; }
.cta-band .ctas{ display:flex; gap:14px; flex-wrap:wrap; }

/* ---------- SHOP ---------- */
.filters{ display:flex; gap:10px; flex-wrap:wrap; margin-bottom:28px; }
.chip{ border:1px solid var(--hairline-dark); padding:9px 18px; border-radius:20px; font-size:14px; color:var(--slate); background:transparent; cursor:pointer; font-family:'Inter',sans-serif; text-decoration:none; }
.chip:hover{ border-color:var(--amber); }
.chip[aria-pressed="true"]{ background:var(--ink); border-color:var(--ink); color:var(--paper-raised); }
.products{ display:grid; grid-template-columns:1fr; gap:1px; background:var(--hairline); border:1px solid var(--hairline); }
@media(min-width:700px){ .products{ grid-template-columns:repeat(2,1fr); } }
@media(min-width:1040px){ .products{ grid-template-columns:repeat(3,1fr); } }
.product{ background:var(--paper-raised); padding:32px 30px 28px; display:flex; flex-direction:column; gap:10px; min-width:0; }
.product.feature{ background:var(--navy-panel); color:#EDEAE0; }
.product .tag{ font-family:'IBM Plex Mono',monospace; font-size:11.5px; color:var(--amber); letter-spacing:0.08em; text-transform:uppercase; display:flex; justify-content:space-between; gap:10px; }
.product .tag .badge{ color:var(--green); }
.product.feature .tag .badge{ color:#5BA184; }
.product h3{ font-size:21px; margin:4px 0 2px; }
.product.feature h3{ color:#F4F2EA; }
.product p{ color:var(--steel); font-size:14.5px; margin:0; }
.product.feature p{ color:#A6ADC0; }
.product ul{ list-style:none; margin:4px 0 0; padding:0; flex-grow:1; }
.product li{ font-size:13.8px; color:var(--steel); padding:7px 0 7px 16px; position:relative; border-top:1px solid var(--hairline); }
.product li::before{ content:"—"; position:absolute; left:0; color:var(--steel-light); }
.product.feature li{ color:#A6ADC0; border-top-color:rgba(255,255,255,0.1); }
.p-foot{ display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; padding-top:18px; margin-top:8px; border-top:1px solid var(--hairline); }
.product.feature .p-foot{ border-top-color:rgba(255,255,255,0.14); }
.price{ font-family:'Newsreader',serif; font-size:30px; color:var(--ink); line-height:1; font-variant-numeric:tabular-nums; }
.product.feature .price{ color:#F4F2EA; }
.price s{ font-family:'Inter',sans-serif; font-size:14px; color:var(--steel-light); margin-left:8px; }
.product.feature .btn.primary{ background:var(--amber); border-color:var(--amber); color:#0B1220; }
.product.feature .btn.primary:hover{ background:#C79436; }
.product.feature .btn{ border-color:rgba(255,255,255,0.35); color:#F1EFE8; }

/* Basket drawer */
.scrim{ position:fixed; inset:0; background:rgba(9,14,26,.55); z-index:60; }
.drawer{ position:fixed; top:0; right:0; bottom:0; width:min(430px,100%); background:var(--paper-raised); border-left:1px solid var(--hairline); z-index:61; display:flex; flex-direction:column; }
.drawer-head{ display:flex; justify-content:space-between; align-items:center; padding:20px 24px; background:var(--navy-head); }
.drawer-head h3{ color:#F4F2EA; margin:0; font-size:21px; }
.x{ background:none; border:0; font-size:26px; color:#F4F2EA; line-height:1; padding:4px 8px; cursor:pointer; }
.drawer-body{ flex:1; overflow:auto; padding:8px 24px; }
.line{ display:grid; grid-template-columns:1fr auto; gap:4px 12px; padding:16px 0; border-bottom:1px solid var(--hairline); font-size:15px; color:var(--ink); }
.line strong{ font-family:'Newsreader',serif; font-size:19px; font-weight:500; }
.line .rm{ grid-column:1/-1; justify-self:start; background:none; border:0; color:var(--steel); padding:0; font-size:13px; text-decoration:underline; cursor:pointer; }
.drawer-foot{ padding:20px 24px 24px; border-top:1px solid var(--hairline); display:flex; flex-direction:column; gap:12px; }
.drawer-foot .btn{ width:100%; }
.total{ display:flex; justify-content:space-between; font-family:'Newsreader',serif; font-size:24px; color:var(--ink); font-variant-numeric:tabular-nums; }
.notice{ font-size:13.5px; color:var(--steel); background:var(--paper); border-left:3px solid var(--amber); padding:10px 12px; margin:0; }

/* ---------- FORMS ---------- */
/* Dark panel form, as the csisc.co.uk contact form */
.form-columns{ display:grid; grid-template-columns:1fr; gap:48px; align-items:start; }
@media(min-width:960px){ .form-columns{ grid-template-columns:1.2fr 1fr; } }
.panel-form{ background:var(--navy-panel); border:1px solid rgba(217,166,62,0.2); border-radius:var(--radius); padding:36px 32px 32px; }
@media(min-width:600px){ .panel-form{ padding:44px 44px 40px; } }
@media(max-width:600px){ .panel-form{ padding:28px 20px; } }
.panel-form h2{ color:#F4F2EA; font-size:26px; }
.panel-form .field{ margin-bottom:22px; }
.panel-form label{ display:block; font-family:'IBM Plex Mono',monospace; font-size:11.5px; letter-spacing:0.1em; text-transform:uppercase; color:var(--amber-bright); margin-bottom:10px; }
.panel-form label .opt-note{ text-transform:none; letter-spacing:0; color:#7C84A0; }
.panel-form input[type=text], .panel-form input[type=email], .panel-form input[type=password]{
  width:100%; background:rgba(255,255,255,0.045); border:1px solid rgba(217,166,62,0.32); border-radius:2px;
  padding:13px 15px; font-family:'Inter',sans-serif; font-size:15px; color:#F4F2EA;
}
.panel-form input:focus{ outline:none; border-color:var(--amber-bright); background:rgba(255,255,255,0.07); }
.panel-form .check{ display:flex; gap:12px; align-items:flex-start; font-family:'Inter',sans-serif; font-size:14px; text-transform:none; letter-spacing:0; color:#C7CCDB; }
.panel-form .check input{ margin-top:4px; accent-color:var(--amber); }
.panel-form button[type=submit]{ width:100%; background:var(--amber); color:#0B1220; font-weight:700; font-size:15px; padding:16px; border:none; border-radius:2px; cursor:pointer; font-family:'Inter',sans-serif; }
.panel-form button[type=submit]:hover{ background:#C79436; }
.panel-form .helper{ font-size:14px; color:#9BA2B8; margin:20px 0 0; }
.panel-form .helper a{ color:#D9B876; }
.panel-form .alert{ margin-bottom:18px; }
.aside-list h3{ font-size:22px; }

/* Light form for settings and admin */
.form{ display:flex; flex-direction:column; gap:8px; }
.form label{ font-family:'IBM Plex Mono',monospace; font-size:11.5px; letter-spacing:.08em; text-transform:uppercase; color:var(--amber); margin-top:8px; }
.form label .muted{ text-transform:none; letter-spacing:0; }
.form .btn{ margin-top:12px; align-self:flex-start; }
.form input, .form select, .sim select{
  font:inherit; font-size:15px; padding:11px 13px; border:1px solid var(--hairline-dark); border-radius:2px;
  background:var(--paper-raised); color:var(--ink); width:100%;
}
.form input:focus, .form select:focus, .sim select:focus{ outline:none; border-color:var(--amber); }

/* Alerts */
.flashes{ display:flex; flex-direction:column; gap:8px; padding-top:20px; }
.alert{ margin:0; padding:13px 16px; border-radius:2px; font-size:14.5px; border:1px solid var(--hairline); border-left-width:3px; background:var(--paper-raised); color:var(--ink); }
.alert.ok{ border-left-color:var(--green); background:var(--green-soft); }
.alert.error{ border-left-color:var(--alert); background:var(--alert-soft); }
.alert.warn{ border-left-color:var(--amber); background:var(--amber-soft); }

/* ---------- LIBRARY ---------- */
.library{ display:grid; grid-template-columns:1fr; gap:1px; background:var(--hairline); border:1px solid var(--hairline); }
@media(min-width:820px){ .library{ grid-template-columns:1fr 1fr; } }
.library > .lib-item:last-child:nth-child(odd){ grid-column:1/-1; }
.lib-item{ background:var(--paper-raised); padding:28px 28px 26px; display:flex; flex-direction:column; gap:6px; min-width:0; }
.lib-item.sim-item{ background:var(--navy-panel); }
.lib-item .tag{ font-family:'IBM Plex Mono',monospace; font-size:11.5px; color:var(--amber); letter-spacing:0.08em; text-transform:uppercase; }
.lib-item h3{ font-size:20px; margin:0; }
.lib-item.sim-item h3{ color:#F4F2EA; }
.lib-item .until{ color:var(--steel); font-size:14px; margin:0 0 12px; }
.lib-item.sim-item .until{ color:#A6ADC0; }
.lib-item.sim-item .btn{ background:var(--amber); border-color:var(--amber); color:#0B1220; }
.lib-actions .btn, .p-foot .btn{ white-space:normal; text-align:center; }
.lib-actions{ display:flex; gap:10px; flex-wrap:wrap; margin-top:auto; }
.empty{ border:1px dashed var(--hairline-dark); padding:36px 32px; background:var(--paper-raised); }
.empty .ctas{ display:flex; gap:12px; flex-wrap:wrap; margin-top:18px; }
.sub-head{ font-size:24px; margin:56px 0 18px; }
.two-col{ display:grid; grid-template-columns:1fr; gap:48px; margin-top:8px; }
@media(min-width:900px){ .two-col{ grid-template-columns:1fr 1fr; } }
.two-col > *{ min-width:0; }

/* Tables (mapping-table language) */
.table-wrap{ overflow-x:auto; min-width:0; border:1px solid var(--hairline); background:var(--paper-raised); }
table.data{ width:100%; border-collapse:collapse; font-size:14px; }
table.data th{ text-align:left; font-family:'IBM Plex Mono',monospace; font-size:11px; text-transform:uppercase; letter-spacing:0.08em; color:var(--steel-light); font-weight:500; padding:14px 18px; border-bottom:1px solid var(--hairline-dark); white-space:nowrap; }
table.data td{ padding:14px 18px; border-bottom:1px solid var(--hairline); vertical-align:top; font-variant-numeric:tabular-nums; color:var(--slate); }
table.data tr:last-child td{ border-bottom:none; }
table.data td strong{ font-family:'Newsreader',serif; font-weight:600; color:var(--ink); font-size:15.5px; }
table.data form{ margin:0; }
.pill{ display:inline-block; font-family:'IBM Plex Mono',monospace; font-size:12px; padding:2px 9px; border-radius:10px; background:var(--amber-soft); color:var(--ink); white-space:nowrap; }
.pill.ok{ background:var(--green-soft); color:var(--green); }
.pill.bad{ background:var(--alert-soft); color:var(--alert); }
.pill.off{ background:var(--hairline); color:var(--steel); }
.ent-row{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-bottom:6px; font-size:13px; }
.ent-row .link-btn{ font-size:13px; padding:0; }

/* ---------- SIMULATOR ---------- */
.sim{ background:var(--paper-raised); border:1px solid var(--hairline); border-radius:var(--radius); min-height:420px; scroll-margin-top:90px; }
.sim-setup{ display:grid; grid-template-columns:1fr; }
@media(min-width:900px){ .sim-setup{ grid-template-columns:1fr 1fr; } }
.sim-setup > div{ padding:36px 34px; min-width:0; }
.sim-setup > div + div{ background:var(--navy-panel); color:#A6ADC0; }
.sim-setup .rules .eyebrow{ color:#D9B876; }
.sim-setup .rules .eyebrow::before{ background:#D9B876; }
.sim-setup .rules ul{ padding-left:18px; margin:0 0 16px; }
.sim-setup .rules li{ margin-bottom:8px; font-size:14.5px; }
.sim-setup .rules p{ font-size:14.5px; }
.sim-setup .rules code{ background:rgba(217,166,62,0.18); color:#F4F2EA; }
.field{ display:flex; flex-direction:column; gap:10px; margin-bottom:24px; }
.field > label, .field > .lbl{ font-family:'IBM Plex Mono',monospace; font-size:11.5px; letter-spacing:.1em; text-transform:uppercase; color:var(--amber); }
.seg{ display:flex; border:1px solid var(--hairline-dark); border-radius:2px; overflow:hidden; flex-wrap:wrap; }
.seg button{ flex:1; border:0; background:transparent; color:var(--ink); padding:11px 12px; font-size:14px; min-width:120px; cursor:pointer; font-family:'Inter',sans-serif; font-weight:500; }
.seg button[aria-pressed="true"]{ background:var(--ink); color:var(--paper-raised); }
.checks{ display:flex; flex-direction:column; gap:0; }
.checks label{ display:flex; gap:12px; align-items:flex-start; font-size:14.5px; padding:9px 0; border-top:1px solid var(--hairline); color:var(--slate); }
.checks label:first-child{ border-top:0; }
.checks input{ margin-top:5px; accent-color:var(--amber); }
.checks strong{ font-family:'IBM Plex Mono',monospace; font-weight:500; color:var(--amber); margin-right:4px; }

.runner-bar{ display:flex; align-items:center; gap:18px; flex-wrap:wrap; padding:14px 24px; background:var(--navy-panel); color:#B7BECF; font-family:'IBM Plex Mono',monospace; font-size:12.5px; letter-spacing:.06em; }
.timer{ font-size:20px; color:#F4F2EA; font-variant-numeric:tabular-nums; letter-spacing:0; }
.timer.low{ color:#E08A80; }
.progress{ flex:1; height:4px; background:rgba(255,255,255,0.12); min-width:80px; border-radius:2px; overflow:hidden; }
.progress i{ display:block; height:100%; background:var(--amber-bright); transition:width .25s; }
.runner{ display:grid; grid-template-columns:1fr; }
@media(min-width:900px){ .runner{ grid-template-columns:1fr 230px; } }
.qpane{ padding:36px 34px; min-width:0; }
@media(min-width:900px){ .qpane{ border-right:1px solid var(--hairline); } }
@media(max-width:600px){ .qpane, .sim-setup > div, .results{ padding:24px 18px !important; } }
.qmeta{ display:flex; gap:14px; flex-wrap:wrap; font-family:'IBM Plex Mono',monospace; font-size:11.5px; color:var(--amber); text-transform:uppercase; letter-spacing:.09em; margin-bottom:16px; }
.qtext{ font-family:'Newsreader',serif; font-size:clamp(1.25rem,2.3vw,1.5rem); line-height:1.35; color:var(--ink); max-width:62ch; margin-bottom:26px; }
.opts{ display:grid; gap:12px; max-width:72ch; }
.opt{ display:grid; grid-template-columns:30px 1fr; gap:14px; align-items:start; text-align:left; border:1px solid var(--hairline-dark); background:var(--paper); color:var(--slate); padding:15px 18px; border-radius:2px; font-size:15px; font-family:'Inter',sans-serif; cursor:pointer; transition:border-color .15s ease, background .15s ease; }
.opt:hover:not(:disabled){ border-color:var(--amber); }
.opt .k{ font-family:'IBM Plex Mono',monospace; font-size:13px; border:1.5px solid var(--hairline-dark); border-radius:50%; text-align:center; line-height:25px; height:28px; width:28px; }
.opt.sel{ border-color:var(--amber); background:var(--amber-soft); color:var(--ink); font-weight:600; }
.opt.sel .k{ background:var(--amber); border-color:var(--amber); color:#0B1220; }
.opt.right{ border-color:var(--green); background:var(--green-soft); color:var(--ink); }
.opt.right .k{ background:var(--green); border-color:var(--green); color:#fff; }
.opt.wrong{ border-color:var(--alert); background:var(--alert-soft); }
.opt.wrong .k{ border-color:var(--alert); color:var(--alert); }
.opt:disabled{ cursor:default; }
.explain{ margin-top:22px; padding:18px 20px; border-left:3px solid var(--amber); background:var(--paper); max-width:72ch; font-size:15px; color:var(--slate); }
.explain b{ display:block; font-family:'IBM Plex Mono',monospace; font-size:11.5px; letter-spacing:.1em; text-transform:uppercase; margin-bottom:6px; font-weight:500; }
.qnav{ display:flex; justify-content:space-between; gap:10px; flex-wrap:wrap; margin-top:28px; max-width:72ch; }
.side{ padding:24px 22px; display:flex; flex-direction:column; gap:14px; }
.side .eyebrow{ margin-bottom:0; }
.grid-nav{ display:grid; grid-template-columns:repeat(5,1fr); gap:6px; }
@media(max-width:899px){ .grid-nav{ grid-template-columns:repeat(10,1fr); } }
@media(max-width:600px){ .grid-nav{ grid-template-columns:repeat(6,1fr); } }
.grid-nav button{ border:1px solid var(--hairline); background:var(--paper); color:var(--slate); font-family:'IBM Plex Mono',monospace; font-size:12px; padding:7px 0; border-radius:2px; position:relative; cursor:pointer; }
.grid-nav button.ans{ background:var(--amber-soft); border-color:var(--amber); }
.grid-nav button.cur{ outline:2px solid var(--ink); outline-offset:1px; }
.grid-nav button.flag::after{ content:""; position:absolute; top:2px; right:2px; width:6px; height:6px; background:var(--alert); border-radius:50%; }
.legend{ font-size:12px; color:var(--steel); display:flex; flex-direction:column; gap:4px; }
.confirm{ border:1px solid var(--alert); background:var(--alert-soft); padding:12px; border-radius:2px; font-size:14px; display:flex; flex-direction:column; gap:10px; }

.results{ padding:36px 34px; }
.score-row{ display:grid; grid-template-columns:auto 1fr; gap:36px; align-items:center; padding-bottom:28px; border-bottom:1px solid var(--hairline); }
@media(max-width:600px){ .score-row{ grid-template-columns:1fr; gap:12px; } }
.big-score{ font-family:'Newsreader',serif; font-size:clamp(3.4rem,9vw,4.8rem); color:var(--ink); line-height:1; font-weight:600; font-variant-numeric:tabular-nums; }
.verdict{ display:inline-block; font-family:'IBM Plex Mono',monospace; font-size:12px; letter-spacing:.1em; text-transform:uppercase; padding:4px 10px; border-radius:2px; margin-bottom:10px; }
.verdict.pass{ background:var(--green-soft); color:var(--green); }
.verdict.fail{ background:var(--alert-soft); color:var(--alert); }
.dom-bars{ display:flex; flex-direction:column; gap:14px; padding:28px 0; border-bottom:1px solid var(--hairline); }
.dom-bar{ display:grid; grid-template-columns:minmax(0,1.1fr) 2fr 56px; gap:14px; align-items:center; font-size:14px; }
@media(max-width:600px){ .dom-bar{ grid-template-columns:1fr 56px; } .dom-bar .bar{ grid-column:1/-1; grid-row:2; } }
.bar{ height:8px; background:var(--hairline); border-radius:4px; position:relative; overflow:hidden; }
.bar i{ position:absolute; inset:0 auto 0 0; background:var(--green); border-radius:4px; }
.bar.weak i{ background:var(--alert); }
.dom-bar .pct{ font-family:'IBM Plex Mono',monospace; font-size:12.5px; text-align:right; color:var(--steel); font-variant-numeric:tabular-nums; }
.review{ display:flex; flex-direction:column; margin-top:10px; }
.rv{ padding:16px 0; border-bottom:1px solid var(--hairline); }
.rv summary{ cursor:pointer; display:grid; grid-template-columns:28px 1fr; gap:10px; font-size:15px; color:var(--ink); list-style:none; }
.rv summary::-webkit-details-marker{ display:none; }
.rv .mk{ font-family:'IBM Plex Mono',monospace; }
.rv .mk.ok{ color:var(--green); } .rv .mk.no{ color:var(--alert); }
.rv .body{ padding:12px 0 0 38px; font-size:14.5px; color:var(--steel); display:flex; flex-direction:column; gap:8px; }

/* ---------- FOOTER (as csisc.co.uk) ---------- */
footer.site{ background:var(--ink); color:#B7BECF; padding:64px 0 32px; }
.footer-grid{ display:grid; grid-template-columns:1fr; gap:40px; padding-bottom:44px; border-bottom:1px solid rgba(255,255,255,0.12); }
@media(min-width:820px){ .footer-grid{ grid-template-columns:1.3fr 1fr 1fr 1fr; } }
footer.site h4{ font-family:'IBM Plex Mono',monospace; font-size:12px; letter-spacing:0.08em; text-transform:uppercase; color:#8A90A8; margin-bottom:16px; font-weight:400; }
footer.site .brand-mark{ font-family:'Newsreader',serif; font-size:22px; color:#F4F2EA; margin-bottom:14px; font-weight:600; }
footer.site .brand-mark span{ color:var(--amber); }
footer.site .brand-mark small{ font-family:'IBM Plex Mono',monospace; font-size:11px; color:#8A93AC; font-weight:400; letter-spacing:.06em; margin-left:6px; }
footer.site p{ color:#8A90A8; font-size:14px; max-width:36ch; }
footer.site ul{ list-style:none; margin:0; padding:0; }
footer.site li{ margin-bottom:10px; font-size:14px; color:#8A90A8; }
footer.site a{ text-decoration:none; color:#C7CCDB; font-size:14px; }
footer.site a:hover{ color:var(--amber); }
.footer-bottom{ padding-top:26px; display:flex; flex-wrap:wrap; justify-content:space-between; gap:16px; font-size:12.5px; color:#6D7690; }
.footer-bottom span{ max-width:80ch; }

.reveal{ opacity:1; transform:none; transition:opacity .6s ease, transform .6s ease; }
.js .reveal:not(.in){ opacity:0; transform:translateY(14px); }
