/* =========================================================================
   ARIA Programme — public site
   Aesthetic: sovereign engineering datasheet × night rail
   Display: Bricolage Grotesque · Body: Archivo · Data: Space Mono
   ========================================================================= */

:root{
  --ink:        #0b0d0c;
  --ink-2:      #121512;
  --panel:      #151916;
  --paper:      #f1ede2;
  --muted:      #8d8f85;
  --line:       rgba(241,237,226,.12);
  --line-soft:  rgba(241,237,226,.07);
  --signal:     #e8932e;
  --signal-dim: rgba(232,147,46,.16);
  --signal-bright: #f4a13b;
  --steel:      #7d9b97;
  --navy:       #0e2a52;
  --navy-2:     #1a3a6a;
  --navy-soft:  rgba(14,42,82,.18);
  --maxw:       1180px;
  --ease:       cubic-bezier(.2,.7,.2,1);
  color-scheme: dark;
}

/* ---------------------------------------------------------------------------
   LIGHT / DARK THEME SYSTEM
   The whole stylesheet reads from the variables above. A light theme is just
   a re-definition of those variables. Resolution order:
     1. Explicit choice:   <html data-theme="light"|"dark">  (set by toggle)
     2. No choice + OS pref: @media (prefers-color-scheme: light)
     3. Fallback:           the dark :root values above
   The civic public-page theme (body.public-page) is a separate, deliberate
   brand treatment and is intentionally NOT overridden here.
   --------------------------------------------------------------------------- */

/* Light values, shared by the explicit toggle and the OS-preference path. */
:root[data-theme="light"]{
  --ink:        #f4f2ea;   /* page background — warm off-white */
  --ink-2:      #eae6da;
  --panel:      #ffffff;
  --paper:      #1c1f1a;   /* primary text — near-black */
  --muted:      #5f6258;
  --line:       rgba(20,24,18,.16);
  --line-soft:  rgba(20,24,18,.08);
  --signal:     #c2740f;   /* darker amber for AA contrast on light bg */
  --signal-dim: rgba(194,116,15,.14);
  --signal-bright: #a9640c;
  --steel:      #4f6f6a;
  --navy:       #0e2a52;
  --navy-2:     #1a3a6a;
  --navy-soft:  rgba(14,42,82,.10);
  color-scheme: light;
}

/* Follow the OS preference only when the user hasn't explicitly chosen. */
@media (prefers-color-scheme: light){
  :root:not([data-theme="dark"]){
    --ink:        #f4f2ea;
    --ink-2:      #eae6da;
    --panel:      #ffffff;
    --paper:      #1c1f1a;
    --muted:      #5f6258;
    --line:       rgba(20,24,18,.16);
    --line-soft:  rgba(20,24,18,.08);
    --signal:     #c2740f;
    --signal-dim: rgba(194,116,15,.14);
    --signal-bright: #a9640c;
    --steel:      #4f6f6a;
    --navy-soft:  rgba(14,42,82,.10);
    color-scheme: light;
  }
}

/* Theme toggle button in the header nav. */
.theme-toggle{
  background:transparent;border:1px solid var(--line);color:var(--muted);
  cursor:pointer;border-radius:3px;padding:5px 9px;font-size:.78rem;line-height:1;
  display:inline-flex;align-items:center;gap:6px;transition:color .25s,border-color .25s;
  font-family:inherit;
}
.theme-toggle:hover{color:var(--paper);border-color:var(--paper)}
.theme-toggle .ico{width:15px;height:15px;display:inline-block}
/* show the right icon for the active theme */
.theme-toggle .ico-sun{display:none}
.theme-toggle .ico-moon{display:inline-block}
:root[data-theme="light"] .theme-toggle .ico-sun{display:inline-block}
:root[data-theme="light"] .theme-toggle .ico-moon{display:none}
@media (prefers-color-scheme: light){
  :root:not([data-theme="dark"]) .theme-toggle .ico-sun{display:inline-block}
  :root:not([data-theme="dark"]) .theme-toggle .ico-moon{display:none}
}

/* ---------------------------------------------------------------------------
   BRIGHT WORK SURFACE  (Option C)
   The document library and admin pages are reading/working surfaces where
   legibility matters more than the night-rail mood of the public site. They
   carry body.lib-body or body.aria-work and get a high-contrast bright
   palette: white cards, strong borders, near-black text. This is applied
   regardless of the dark/light toggle — these pages are intentionally bright.
   The navy programme header is preserved (set separately below). Public
   landing pages never carry these classes, so their civic theme is untouched.
   --------------------------------------------------------------------------- */
body.lib-body, body.aria-work,
:root[data-theme="light"] body.lib-body, :root[data-theme="light"] body.aria-work,
:root[data-theme="dark"] body.lib-body, :root[data-theme="dark"] body.aria-work{
  --ink:        #fbfaf6;   /* page background — bright warm white */
  --ink-2:      #f2efe6;   /* secondary surface / inset panels */
  --panel:      #ffffff;   /* cards — pure white for crisp contrast */
  --paper:      #13150f;   /* primary text — near-black */
  --muted:      #4a4d44;   /* secondary text — AA on white & on #f2efe6 */
  --line:       rgba(20,24,18,.20);   /* stronger borders than light theme */
  --line-soft:  rgba(20,24,18,.12);
  --signal:     #b4690d;   /* amber darkened for AA on white */
  --signal-dim: rgba(180,105,13,.12);
  --signal-bright: #9c5a0b;
  --steel:      #3a5a55;   /* teal-grey darkened for AA on white */
  --navy-soft:  rgba(14,42,82,.08);
  color-scheme: light;
  background: var(--ink);
  color: var(--paper);
}
/* Inset/dark panels on admin pages that previously hard-coded #0f1216 etc.
   are remapped to the bright inset surface via these helper backgrounds so
   inline styles referencing the variables follow the scheme. */
body.lib-body .lib-card .muted,
body.aria-work .lib-card .muted{ color: var(--muted); }

*{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%}
body{
  background:var(--ink);
  color:var(--paper);
  font-family:"Archivo",system-ui,sans-serif;
  font-size:17px;
  line-height:1.65;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
  overflow-x:hidden;
}
img{max-width:100%;display:block}
a{color:inherit;text-decoration:none}
.wrap{max-width:var(--maxw);margin:0 auto;padding:0 32px}
.mono{font-family:"Space Mono",monospace;letter-spacing:.02em}
.muted{color:var(--muted)}

.skip{position:absolute;left:-999px;top:0;background:var(--signal);color:#000;
  padding:10px 16px;z-index:99;font-weight:600}
.skip:focus{left:8px;top:8px}

/* ---------- Header ---------- */
.site-head{
  position:sticky;top:0;z-index:50;
  background:rgba(11,13,12,.82);
  backdrop-filter:saturate(140%) blur(10px);
  border-bottom:1px solid var(--line-soft);
}
.head-inner{display:flex;align-items:center;justify-content:space-between;
  height:74px}
.brand{display:flex;align-items:center;gap:14px}
.brand-mark{display:flex;flex-direction:column;gap:4px;width:30px}
.brand-mark .rail{height:3px;background:var(--signal);border-radius:2px}
.brand-mark .rail:nth-child(2){background:var(--paper);width:70%}
.brand-text strong{
  font-family:"Bricolage Grotesque",sans-serif;
  font-weight:800;font-size:1.18rem;letter-spacing:.06em;display:block;line-height:1}
.brand-text em{font-style:normal;font-size:.66rem;letter-spacing:.22em;
  text-transform:uppercase;color:var(--muted)}
.nav{display:flex;align-items:center;gap:30px;font-size:.86rem}
.nav a{color:var(--muted);transition:color .25s}
.nav a:hover{color:var(--paper)}
.nav-cta{
  color:var(--paper)!important;border:1px solid var(--line);
  padding:9px 18px;border-radius:2px;transition:.25s}
.nav-cta:hover{background:var(--signal);color:#000!important;border-color:var(--signal)}
.nav-login{color:var(--signal)!important;font-weight:600;
  display:inline-flex;align-items:center;gap:7px}
.nav-login::before{content:"";width:6px;height:6px;border-radius:50%;
  background:var(--signal);opacity:.7}
.nav-login:hover{color:var(--paper)!important}

/* Admin link in the header nav. Visible at every breakpoint
   (protected from the mobile-hide selector) and given a quiet
   accent so it's findable without dominating. */
.nav-admin{color:var(--signal-dim)!important;font-weight:500;
  letter-spacing:.04em;
  border:1px solid rgba(232,196,110,.25);border-radius:2px;
  padding:5px 10px;
  transition:.2s}
.nav-admin:hover{color:var(--signal)!important;
  border-color:var(--signal-dim);background:rgba(232,196,110,.05)}

/* ---------- Status banners ---------- */
.banner{font-size:.92rem;padding:13px 0}
.banner .wrap{padding:0 32px}
.banner-ok{background:var(--signal-dim);color:var(--signal);
  border-bottom:1px solid rgba(232,147,46,.3)}
.banner-err{background:rgba(200,70,55,.14);color:#e88a7d;
  border-bottom:1px solid rgba(200,70,55,.32)}

/* Healthcheck banner — admin-only deployment/environment issues */
.hc-banner{background:rgba(200,70,55,.18);
  border-top:3px solid #c84637;border-bottom:1px solid rgba(200,70,55,.4);
  color:#fdd6d0;padding:18px 0;font-size:.9rem;line-height:1.5}
.hc-banner-inner{max-width:1200px;margin:0 auto;padding:0 32px}
.hc-banner-h{display:block;font-family:"Space Mono",monospace;
  font-size:.82rem;text-transform:uppercase;letter-spacing:.12em;
  color:#fff;margin-bottom:10px}
.hc-banner-list{margin:0;padding-left:22px;list-style:square}
.hc-banner-list li{margin:4px 0;color:#fdd6d0;display:flex;
  align-items:flex-start;gap:12px;justify-content:space-between}
.hc-issue-text{flex:1;min-width:200px}
.hc-issue-ack{display:inline-block;margin:0}
.hc-ack-btn{background:rgba(253,214,208,.08);color:#fdd6d0;
  border:1px solid rgba(253,214,208,.3);font-size:.7rem;
  padding:3px 10px;border-radius:2px;cursor:pointer;
  font-family:"Space Mono",monospace;letter-spacing:.04em;
  transition:background .15s,border-color .15s}
.hc-ack-btn:hover{background:rgba(253,214,208,.16);
  border-color:rgba(253,214,208,.55)}
.hc-banner-note{font-size:.74rem;color:rgba(253,214,208,.65);
  margin:10px 0 0;font-style:italic}

/* ---------- Hero ---------- */
.hero{
  position:relative;overflow:hidden;
  padding:120px 0 70px;
  border-bottom:1px solid var(--line-soft);
  background:radial-gradient(120% 90% at 75% 0%,
    rgba(232,147,46,.07),transparent 60%),var(--ink);
}
.hero-grid{
  position:absolute;inset:0;opacity:.5;pointer-events:none;
  background-image:
    linear-gradient(var(--line-soft) 1px,transparent 1px),
    linear-gradient(90deg,var(--line-soft) 1px,transparent 1px);
  background-size:64px 64px;
  mask-image:linear-gradient(180deg,#000,transparent 85%);
}
.corridor{position:absolute;right:-5%;top:0;bottom:0;width:60%;
  pointer-events:none;opacity:.6}
.corridor-line{
  position:absolute;height:1px;width:140%;left:-20%;
  background:linear-gradient(90deg,transparent,var(--signal),transparent);
  transform:rotate(-9deg);transform-origin:left;
  animation:drift 9s linear infinite;
}
.corridor-line:nth-child(1){top:26%;animation-delay:0s;opacity:.35}
.corridor-line:nth-child(2){top:46%;animation-delay:-3s;opacity:.55}
.corridor-line:nth-child(3){top:66%;animation-delay:-6s;opacity:.3}
@keyframes drift{
  0%{transform:rotate(-9deg) translateX(-6%)}
  100%{transform:rotate(-9deg) translateX(6%)}
}
.hero-inner{position:relative;z-index:2}
.eyebrow{
  font-family:"Space Mono",monospace;font-size:.78rem;letter-spacing:.28em;
  text-transform:uppercase;color:var(--signal);margin-bottom:26px}
.hero-title{
  font-family:"Bricolage Grotesque",sans-serif;
  font-weight:800;line-height:.96;
  font-size:clamp(2.9rem,8.5vw,7rem);
  letter-spacing:-.02em;max-width:13ch;margin-bottom:34px}
.hero-title span{display:block}
.hero-title .accent{color:var(--signal)}
.hero-lede{font-size:clamp(1.05rem,1.7vw,1.32rem);max-width:54ch;
  color:#d8d5ca;margin-bottom:40px}
.hero-actions{display:flex;gap:16px;flex-wrap:wrap}
.btn{
  display:inline-block;padding:15px 30px;font-size:.92rem;font-weight:600;
  border-radius:2px;transition:.28s var(--ease);letter-spacing:.01em}
.btn-solid{background:var(--signal);color:#0b0d0c}
.btn-solid:hover{transform:translateY(-2px);
  box-shadow:0 14px 30px -12px rgba(232,147,46,.6)}
.btn-ghost{border:1px solid var(--line);color:var(--paper)}
.btn-ghost:hover{border-color:var(--paper);background:rgba(241,237,226,.05)}
.hero-foot{position:relative;z-index:2;display:flex;justify-content:space-between;
  margin-top:80px;padding-top:22px;border-top:1px solid var(--line-soft);
  font-size:.78rem;letter-spacing:.2em;text-transform:uppercase}

/* ---------- Blocks ---------- */
.block{padding:110px 0;border-bottom:1px solid var(--line-soft)}
.block-alt{background:var(--ink-2)}
.sec-head{display:flex;align-items:baseline;gap:22px;margin-bottom:54px}
.sec-no{
  font-family:"Space Mono",monospace;font-size:.95rem;color:var(--signal);
  border:1px solid var(--signal-dim);padding:6px 12px;border-radius:2px;
  flex-shrink:0}
.sec-head h2{
  font-family:"Bricolage Grotesque",sans-serif;font-weight:800;
  font-size:clamp(1.9rem,4vw,3.1rem);letter-spacing:-.02em;line-height:1.05}

.lead{font-size:clamp(1.2rem,2vw,1.6rem);line-height:1.4;
  font-family:"Bricolage Grotesque",sans-serif;font-weight:400}
.prose-2col{display:grid;grid-template-columns:1fr 1fr;gap:60px}
.prose-2col .lead{color:var(--paper)}
.prose-body p{color:#cfccc2;margin-bottom:18px}
.prose-body p:last-child{margin-bottom:0}

/* ---------- Pillars ---------- */
.pillars{display:grid;grid-template-columns:repeat(2,1fr);gap:1px;
  background:var(--line-soft);border:1px solid var(--line-soft)}
.pillar{background:var(--ink);padding:42px;position:relative;
  transition:background .3s}
.block-alt .pillar{background:var(--ink-2)}
.pillar:hover{background:var(--panel)}
.pillar-no{color:var(--signal);font-size:.8rem;letter-spacing:.2em}
.pillar h3{
  font-family:"Bricolage Grotesque",sans-serif;font-weight:600;
  font-size:1.5rem;margin:14px 0 14px;letter-spacing:-.01em}
.pillar p{color:#c7c4ba;font-size:.98rem}
.pillar:nth-child(5){grid-column:1 / -1}

/* ---------- Datasheet ---------- */
.datasheet-note{font-size:.76rem;letter-spacing:.18em;text-transform:uppercase;
  color:var(--muted);margin-bottom:30px}
.datasheet{display:grid;grid-template-columns:repeat(3,1fr);gap:1px;
  background:var(--line-soft);border:1px solid var(--line-soft)}
.stat{background:var(--ink);padding:40px 36px}
.block .stat{background:var(--ink)}
.stat-value{display:flex;align-items:baseline;gap:10px;
  border-bottom:1px solid var(--signal-dim);padding-bottom:16px;margin-bottom:16px}
.stat .num{
  font-family:"Bricolage Grotesque",sans-serif;font-weight:800;
  font-size:clamp(2.2rem,4vw,3.2rem);letter-spacing:-.03em;line-height:1;
  color:var(--paper)}
.stat .unit{font-size:.82rem;color:var(--signal);letter-spacing:.1em}
.stat-label{color:var(--muted);font-size:.92rem}

/* ---------- Footprint ---------- */
.footprint{display:grid;grid-template-columns:1fr 1.1fr;gap:64px;align-items:start}
.fp-statement .lead{color:var(--paper)}
.fp-list{list-style:none}
.fp-list li{display:grid;grid-template-columns:110px 1fr;gap:24px;
  padding:24px 0;border-top:1px solid var(--line-soft)}
.fp-list li:last-child{border-bottom:1px solid var(--line-soft)}
.fp-list .mono{color:var(--signal);font-size:.78rem;letter-spacing:.16em;
  padding-top:3px}
.fp-list p{color:#cfccc2;font-size:.98rem}

/* ---------- Commitments ---------- */
.commitments{display:grid;grid-template-columns:repeat(4,1fr);gap:28px}
.commitment{border-top:2px solid var(--signal);padding-top:22px}
.commitment h3{font-family:"Bricolage Grotesque",sans-serif;font-weight:600;
  font-size:1.18rem;margin-bottom:10px}
.commitment p{color:#c7c4ba;font-size:.92rem}

/* ---------- Contact ---------- */
.contact-grid{display:grid;grid-template-columns:.85fr 1.15fr;gap:64px;
  align-items:start}
.contact-intro .lead{color:var(--paper);margin-bottom:24px}
.contact-form{display:flex;flex-direction:column;gap:20px}
.hp{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}
.field{display:flex;flex-direction:column;gap:8px}
.field label{font-size:.82rem;letter-spacing:.06em;text-transform:uppercase;
  color:var(--muted)}
.field .opt{text-transform:none;letter-spacing:0}
.field input,.field textarea{
  background:var(--ink);border:1px solid var(--line);color:var(--paper);
  padding:14px 16px;font-family:inherit;font-size:1rem;border-radius:2px;
  transition:border-color .25s,box-shadow .25s;resize:vertical}
.block-alt .field input,.block-alt .field textarea{background:var(--ink)}
.field input:focus,.field textarea:focus{
  outline:none;border-color:var(--signal);
  box-shadow:0 0 0 3px var(--signal-dim)}
.contact-form .btn{align-self:flex-start;cursor:pointer;border:none}

/* ---------- Footer ---------- */
.site-foot{padding:70px 0 50px;background:var(--ink-2);
  border-top:1px solid var(--line-soft)}
.foot-grid{display:grid;
  grid-template-columns:1.4fr 1fr 1fr 1.4fr;gap:40px}
.foot-brand strong{font-family:"Bricolage Grotesque",sans-serif;
  font-weight:800;font-size:1.3rem;letter-spacing:.06em}
.foot-brand p{font-size:.88rem;color:#bdbab0;margin-top:8px}
.foot-brand .muted{color:var(--muted)}
.foot-col h4{font-size:.76rem;letter-spacing:.18em;text-transform:uppercase;
  color:var(--signal);margin-bottom:16px}
.foot-col a{display:block;font-size:.9rem;color:#bdbab0;padding:5px 0;
  transition:color .2s}
.foot-col a:hover{color:var(--paper)}
.foot-meta p{font-size:.76rem;padding:3px 0}

/* ---------- Gallery ---------- */
.gallery{display:grid;grid-template-columns:repeat(3,1fr);gap:1px;
  background:var(--line-soft);border:1px solid var(--line-soft)}
.shot{position:relative;margin:0;overflow:hidden;background:var(--ink-2);
  aspect-ratio:4/3}
.shot img{width:100%;height:100%;object-fit:cover;
  transition:transform .7s var(--ease);filter:grayscale(.25) contrast(1.05)}
.shot:hover img{transform:scale(1.05);filter:none}
.shot figcaption{position:absolute;left:0;right:0;bottom:0;
  padding:14px 18px;font-size:.74rem;letter-spacing:.12em;
  text-transform:uppercase;color:var(--paper);
  background:linear-gradient(transparent,rgba(11,13,12,.9))}
.shot:nth-child(1){grid-column:span 2;grid-row:span 2;aspect-ratio:auto}

/* ---------- Documents ---------- */
.doc-group{margin-bottom:46px}
.doc-group:last-child{margin-bottom:0}
.doc-group-h{font-size:.78rem;letter-spacing:.2em;text-transform:uppercase;
  color:var(--signal);margin-bottom:18px;
  padding-bottom:12px;border-bottom:1px solid var(--line-soft)}
.doc-list{list-style:none}
.doc a{display:flex;align-items:center;gap:24px;padding:22px 4px;
  border-bottom:1px solid var(--line-soft);transition:padding .25s,background .25s}
.doc a:hover{background:var(--ink);padding-left:18px;padding-right:18px}
.block-alt .doc a:hover{background:var(--ink)}
.doc-type{flex-shrink:0;font-size:.72rem;letter-spacing:.1em;
  color:var(--signal);border:1px solid var(--signal-dim);
  padding:7px 11px;border-radius:2px;min-width:62px;text-align:center}
.doc-meta{flex:1;display:flex;flex-direction:column;gap:4px}
.doc-title{font-family:"Bricolage Grotesque",sans-serif;font-weight:600;
  font-size:1.12rem}
.doc-desc{color:var(--muted);font-size:.92rem}
.doc-arrow{flex-shrink:0;color:var(--muted);font-size:1.1rem;
  transition:transform .25s,color .25s}
.doc a:hover .doc-arrow{color:var(--signal);transform:translateY(3px)}

/* ---------- Document library ---------- */
.lib-body{background:var(--ink)}

/* ---------- Document viewer ---------- */
.viewer-body{background:var(--ink);display:flex;flex-direction:column;min-height:100vh}
.viewer-bar{background:var(--ink-2);border-bottom:1px solid var(--line-soft);
  position:sticky;top:74px;z-index:30}
.viewer-bar-inner{display:flex;align-items:center;justify-content:space-between;
  gap:24px;padding:18px 0}
.viewer-meta{flex:1;min-width:0}
.viewer-crumb{font-size:.66rem;letter-spacing:.18em;text-transform:uppercase;
  color:var(--signal);display:block;margin-bottom:4px}
.viewer-title{font-family:"Bricolage Grotesque",sans-serif;font-weight:700;
  font-size:1.2rem;letter-spacing:-.01em;line-height:1.2;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.viewer-desc{color:var(--muted);font-size:.85rem;margin-top:3px;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.viewer-actions{flex-shrink:0}
.viewer-actions .btn{font-size:.84rem;padding:11px 22px}
.viewer-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.doc-notes[hidden]{display:none}
.doc-notes.is-open{animation:noteIn .18s var(--ease)}
@keyframes noteIn{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
.viewer-noticed{font-size:.78rem;color:var(--muted);letter-spacing:.06em}

/* Back-to-library row above the title in the viewer bar */
.viewer-back-row{display:flex;align-items:center;justify-content:space-between;
  gap:14px;margin-bottom:6px;flex-wrap:wrap}
.viewer-back{color:var(--signal);font-size:.78rem;text-decoration:none;
  display:inline-flex;align-items:center;gap:6px;
  padding:4px 10px 4px 0;
  transition:color .15s}
.viewer-back:hover{color:var(--paper)}
.viewer-album-pos{font-size:.7rem;color:var(--muted);letter-spacing:.06em}

/* Image album prev/next arrows overlaying the image */
.viewer-album-arrow{position:absolute;top:50%;transform:translateY(-50%);
  z-index:5;
  background:rgba(20,20,18,.7);
  color:var(--paper);text-decoration:none;
  font-size:1.4rem;line-height:1;
  width:48px;height:64px;
  display:flex;align-items:center;justify-content:center;
  border:1px solid var(--line-soft);border-radius:3px;
  transition:background .15s,border-color .15s}
.viewer-album-arrow:hover{background:rgba(20,20,18,.95);
  border-color:var(--signal-dim);color:var(--signal)}
.viewer-album-prev{left:14px}
.viewer-album-next{right:14px}

/* Zoom toolbar (images, DOCX, XLSX) */
.viewer-zoom{display:flex;align-items:center;gap:4px;flex-shrink:0;
  background:var(--ink);border:1px solid var(--line-soft);
  border-radius:3px;padding:3px}
.zoom-btn{font-family:"Space Mono",monospace;font-size:.85rem;
  background:transparent;color:var(--paper);border:none;
  width:32px;height:32px;cursor:pointer;border-radius:2px;
  display:flex;align-items:center;justify-content:center;
  transition:background .15s,color .15s;line-height:1;padding:0}
.zoom-btn:hover:not(:disabled){background:var(--line-soft);color:var(--signal)}
.zoom-btn:disabled{opacity:.3;cursor:not-allowed}
.zoom-btn.zoom-reset{width:auto;padding:0 10px;font-size:.7rem;
  letter-spacing:.06em;color:var(--muted);text-transform:uppercase}
.zoom-btn.zoom-reset:hover:not(:disabled){color:var(--signal)}
.zoom-level{font-size:.78rem;color:var(--muted);min-width:46px;
  text-align:center;padding:0 4px;user-select:none}

/* Hint for content where browser zoom is needed (PDF, TXT) */
.viewer-zoom-hint{font-size:.7rem;color:var(--muted);
  letter-spacing:.04em;flex-shrink:0;padding:6px 12px;
  border:1px dashed var(--line-soft);border-radius:2px;
  background:rgba(241,237,226,.02)}

/* The image needs to stay positioned within its scrollable parent */
.viewer-image-wrap{position:relative}
.viewer-image{transition:transform .12s ease-out;
  transform-origin:center center;
  user-select:none;-webkit-user-drag:none}

/* DOCX/XLSX zoom needs the container scrollable */
.viewer-zoomable{transition:transform .12s ease-out,width .12s ease-out;
  transform-origin:top center}

.viewer-stage{flex:1;display:flex;background:var(--ink-2);min-height:0}
.viewer-frame{flex:1;width:100%;border:none;background:#fff;display:block}
.viewer-frame-text{background:var(--paper);max-width:900px;margin:0 auto}
.viewer-image-wrap{flex:1;display:flex;align-items:center;justify-content:center;
  padding:30px;overflow:auto}
.viewer-image{max-width:100%;max-height:calc(100vh - 200px);
  box-shadow:0 30px 60px -20px rgba(0,0,0,.7)}
.viewer-fallback{flex:1;display:flex;flex-direction:column;align-items:center;
  justify-content:center;text-align:center;padding:60px 24px;gap:18px}
.viewer-fallback h2{font-family:"Bricolage Grotesque",sans-serif;font-weight:600;
  font-size:1.5rem;color:var(--paper)}
.viewer-fallback p{color:#cfccc2;max-width:50ch}

/* ============================================================
   Office document rendering — readability polish (v2.9.10)
   - Warmer paper (#fbf8f0) vs old (#f5f2ea) — easier on eyes
   - Body sized at 1.05rem with line-height 1.65 for comfortable reading
   - Serif body font ("Charter" et al) — reads at length better than Calibri
   - Heading hierarchy preserved but visually punchier
   - Reading column capped at 70ch on desktop to avoid eye fatigue
   - Spreadsheets: bigger cells, sticky header, softer grid
============================================================ */
.viewer-office{flex:1;background:#ebe6d7;color:#171715;overflow:auto;
  padding:36px 32px;
  font-family:"Charter","Iowan Old Style","Source Serif Pro","Georgia",
              "Times New Roman",serif;
  font-size:1.05rem;line-height:1.65;letter-spacing:.005em;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility}
.viewer-office-loading{text-align:center;padding:80px 20px;color:#6b6b6b;
  font-style:italic}
.viewer-office .docx-wrapper{background:#fbf8f0;padding:56px 64px;
  max-width:780px;margin:0 auto;
  box-shadow:0 6px 28px -8px rgba(0,0,0,.15),
             0 2px 4px rgba(0,0,0,.05);
  border-radius:2px}
.viewer-office .docx{padding:0;background:transparent}

/* Heading hierarchy — tighten letter spacing, lift weight, more space */
.viewer-office .docx-wrapper h1,
.viewer-office .docx-wrapper h2,
.viewer-office .docx-wrapper h3,
.viewer-office .docx-wrapper h4,
.viewer-office .docx-wrapper h5,
.viewer-office .docx-wrapper h6{
  font-family:"Charter","Iowan Old Style","Georgia",serif;
  color:#0e1212;font-weight:700;
  letter-spacing:-.01em;line-height:1.25;
  margin:1.4em 0 .5em}
.viewer-office .docx-wrapper h1{font-size:1.85rem;margin-top:0;
  border-bottom:1px solid #d8d1bd;padding-bottom:.4em}
.viewer-office .docx-wrapper h2{font-size:1.45rem}
.viewer-office .docx-wrapper h3{font-size:1.18rem}
.viewer-office .docx-wrapper h4{font-size:1.05rem}
.viewer-office .docx-wrapper h5,
.viewer-office .docx-wrapper h6{font-size:.95rem;font-weight:600;
  text-transform:uppercase;letter-spacing:.08em;color:#3a3a36}

/* Body paragraphs — generous rhythm. !important needed because
   docx-preview emits inline styles that would otherwise win. */
.viewer-office .docx-wrapper p{
  margin:0 0 .9em !important;
  font-size:1.05rem !important;
  line-height:1.7 !important;
  color:#1a1a18 !important;
  font-family:"Charter","Iowan Old Style","Source Serif Pro","Georgia",serif !important}
.viewer-office .docx-wrapper p:last-child{margin-bottom:0 !important}

/* Lists — preserve hierarchy but breathe */
.viewer-office .docx-wrapper ul,
.viewer-office .docx-wrapper ol{margin:.6em 0 1.2em;padding-left:1.6em}
.viewer-office .docx-wrapper li{margin-bottom:.4em;line-height:1.65}
.viewer-office .docx-wrapper li > p{margin-bottom:.4em !important}

/* Emphasis */
.viewer-office .docx-wrapper strong,
.viewer-office .docx-wrapper b{color:#0e1212;font-weight:700}
.viewer-office .docx-wrapper em,
.viewer-office .docx-wrapper i{color:#2a2a26}

/* Links */
.viewer-office .docx-wrapper a{color:#0046a6;
  text-decoration:underline;text-decoration-thickness:1px;
  text-underline-offset:2px}
.viewer-office .docx-wrapper a:hover{color:#003378}

/* Tables in DOCX — softer borders, room to breathe */
.viewer-office .docx-wrapper table{
  border-collapse:collapse;margin:1em 0;font-size:.96rem;line-height:1.5}
.viewer-office .docx-wrapper table td,
.viewer-office .docx-wrapper table th{
  border:1px solid #d8d1bd;padding:8px 12px;vertical-align:top}
.viewer-office .docx-wrapper table th{
  background:#efe9d5;font-weight:600;text-align:left}

/* ============================================================
   XLSX (spreadsheet) styling
============================================================ */
.viewer-sheet{padding:24px 28px;font-family:"Inter","Segoe UI",sans-serif}
.viewer-sheet-name{font-size:.78rem;letter-spacing:.14em;text-transform:uppercase;
  color:#1f3a78;margin:28px 0 10px;padding:7px 14px;background:#dde4f3;
  display:inline-block;border-radius:2px;font-weight:600}
.viewer-sheet-name:first-child{margin-top:0}
.viewer-sheet-table{overflow:auto;background:#fff;
  border:1px solid #d8d4c8;margin-bottom:22px;border-radius:2px;
  max-height:70vh}
.viewer-sheet-table table{border-collapse:separate;border-spacing:0;
  width:100%;font-size:.92rem;line-height:1.45}
.viewer-sheet-table td,.viewer-sheet-table th{
  border-right:1px solid #ece8da;
  border-bottom:1px solid #ece8da;
  padding:8px 14px;text-align:left;
  background:#fff;white-space:nowrap;color:#1a1a18}
.viewer-sheet-table tr:nth-child(odd) td{background:#fbfaf5}
.viewer-sheet-table tr:hover td{background:#f3eddc}
/* Sticky first row — keeps headers visible while panning long sheets */
.viewer-sheet-table thead th,
.viewer-sheet-table tr:first-child td{
  position:sticky;top:0;z-index:2;
  background:#efe9d5 !important;font-weight:600;color:#0e1212;
  border-bottom:2px solid #c4bda3}
/* Sticky first column — keeps row labels visible while scrolling right */
.viewer-sheet-table td:first-child,
.viewer-sheet-table th:first-child{
  position:sticky;left:0;z-index:1;
  background:#f7f3e6;font-weight:500;
  border-right:1px solid #d8d1bd}
.viewer-sheet-table thead th:first-child,
.viewer-sheet-table tr:first-child td:first-child{
  z-index:3;background:#e8e0c5 !important}

/* Plain-text (.txt, .md) iframe styling — uses viewer-frame-text */
.viewer-frame-text{background:var(--paper);max-width:780px;margin:0 auto;
  padding:0}


/* Top filter bar: folder tabs with counts (no dropdowns) */
/* Page heading above the folder bar (library main heading) */
.lib-page-head{background:var(--ink);
  border-bottom:1px solid var(--line-soft)}
.lib-page-head-inner{padding:28px 0 22px}
.lib-page-head h1{margin:0 0 6px;font-size:1.6rem;font-weight:600;
  letter-spacing:-.01em;color:var(--paper)}
.lib-page-head .datasheet-note{margin:0;font-size:.78rem;
  color:var(--muted);letter-spacing:.04em}

/* Folder bar: wraps across multiple rows so all folders are visible at
   once without horizontal scrolling, which matters now we have 23
   canonical folders. We drop the sticky positioning because a wrapping
   bar of unknown height can't reliably anchor a sticky subfolderbar
   beneath it; both bars scroll with the page instead. The header
   itself stays sticky (defined elsewhere). */
/* Search bar — sits above the folder bar. Form submits to documents.php?q=…
   so search runs server-side across every visible document. */
/* Landing tiles — admin-curated featured images at the top of the
   library landing. 4 tiles fit one row on desktop, 2 columns on
   tablet, 1 column on phone. */
.lib-tiles{background:var(--ink);padding:20px 0;
  border-bottom:1px solid var(--line-soft)}
.lib-tiles-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px}

/* Public-site rendering of the same tile component, as a full section
   under the hero. Less compressed, more visual breathing room. */
.block-tiles{padding:64px 0;background:var(--ink);
  border-bottom:1px solid var(--line-soft)}
.public-tiles-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:18px}
.public-tiles-grid .lib-tile-caption{padding:14px 18px;font-size:.82rem}

.lib-tile{position:relative;display:block;border:1px solid var(--line-soft);
  border-radius:3px;overflow:hidden;background:var(--ink-2);
  transition:border-color .18s,transform .18s}
.lib-tile:hover{border-color:var(--signal-dim);transform:translateY(-2px)}
.lib-tile-img{display:block;width:100%;aspect-ratio:16/10;
  background:var(--ink);overflow:hidden}
.lib-tile-img img{width:100%;height:100%;object-fit:cover;display:block;
  transition:transform .3s ease-out}
.lib-tile:hover .lib-tile-img img{transform:scale(1.04)}
.lib-tile-caption{display:block;padding:10px 14px;
  font-size:.78rem;color:var(--paper);line-height:1.4;
  background:rgba(20,20,18,.4)}

.searchbar{background:var(--ink);border-bottom:1px solid var(--line-soft);
  padding:10px 0}
.searchbar-inner{display:flex;align-items:center}
.searchbar-form{display:flex;align-items:center;gap:8px;width:100%;
  flex-wrap:wrap}
.searchbar-label{font-size:.7rem;letter-spacing:.2em;text-transform:uppercase;
  color:var(--muted);flex-shrink:0;padding:0 4px 0 0}
.searchbar-input{flex:1 1 280px;min-width:0;
  background:var(--ink-2);border:1px solid var(--line-soft);
  color:var(--paper);font-family:"Archivo",sans-serif;font-size:.85rem;
  padding:8px 12px;border-radius:2px;
  transition:border-color .15s}
.searchbar-input::placeholder{color:var(--muted);opacity:.7}
.searchbar-input:focus{outline:none;border-color:var(--signal-dim)}
.searchbar-btn{background:var(--ink-2);border:1px solid var(--signal-dim);
  color:var(--signal);font-family:"Archivo",sans-serif;font-size:.78rem;
  letter-spacing:.04em;padding:8px 18px;border-radius:2px;
  cursor:pointer;transition:.15s}
.searchbar-btn:hover{background:var(--signal-dim);color:#000}
.searchbar-clear{font-size:.72rem;color:var(--muted);
  padding:6px 10px;border:1px solid transparent;border-radius:2px;
  transition:color .15s,border-color .15s}
.searchbar-clear:hover{color:var(--paper);border-color:var(--line-soft)}

.folderbar{background:var(--ink-2);
  border-bottom:1px solid var(--line-soft);padding:8px 0}
.folderbar-inner{display:flex;flex-wrap:wrap;align-items:stretch;
  gap:4px 0;row-gap:4px}
.folderbar-label{display:flex;align-items:center;padding:8px 16px 8px 0;
  font-size:.7rem;letter-spacing:.2em;text-transform:uppercase;
  color:var(--muted);flex-shrink:0;width:100%}
.fb-tab{display:inline-flex;align-items:center;gap:6px;
  color:var(--muted);font-size:.78rem;padding:8px 14px;
  border:1px solid transparent;border-radius:2px;
  white-space:nowrap;
  transition:color .2s,border-color .2s,background .2s}
.fb-tab:hover{color:var(--paper);background:rgba(241,237,226,.03);
  border-color:var(--line-soft)}
.fb-tab.active{color:var(--signal);background:rgba(232,196,110,.06);
  border-color:var(--signal-dim)}
.fb-count{font-family:"Space Mono",monospace;font-size:.62rem;
  background:var(--line-soft);color:var(--muted);
  padding:1px 6px;border-radius:8px;line-height:1.4;min-width:18px;
  text-align:center;white-space:nowrap}
.fb-tab.active .fb-count{background:var(--signal-dim);color:var(--signal)}
.fb-count-doc{color:var(--paper)}
.fb-count-img{color:var(--paper)}
.fb-count-sep{margin:0 3px;color:var(--muted);opacity:.7}
.fb-tab.active .fb-count-doc,
.fb-tab.active .fb-count-img{color:var(--signal)}
.fb-tab.active .fb-count-sep{color:rgba(232,196,110,.5)}

/* Subfolder filter bar — appears under folderbar when active folder has subs.
   Wraps too, but typically has at most 8 entries so usually fits one row. */
.subfolderbar{background:var(--ink);
  border-bottom:1px solid var(--line-soft);padding:6px 0}
.subfolderbar .folderbar-inner{display:flex;flex-wrap:wrap;
  padding-left:16px;gap:2px 0;row-gap:2px}
.subfolderbar .folderbar-label{width:100%;padding:6px 16px 6px 0;font-size:.65rem}
.sub-tab{display:inline-flex;align-items:center;gap:6px;
  color:var(--muted);font-size:.72rem;letter-spacing:.04em;padding:6px 12px;
  border:1px solid transparent;border-radius:2px;
  white-space:nowrap;
  transition:color .2s,border-color .2s,background .2s}
.sub-tab:hover{color:var(--paper);background:rgba(241,237,226,.03);
  border-color:var(--line-soft)}
.sub-tab.active{color:var(--signal);background:rgba(232,196,110,.06);
  border-color:var(--signal-dim)}
.sub-tab .fb-count{font-size:.6rem}

/* Subfolder label on doc entries when viewing All */
.side-sub{display:inline-block;background:var(--line-soft);
  color:var(--muted);font-size:.62rem;letter-spacing:.08em;
  padding:1px 6px;border-radius:2px;margin-left:6px;
  vertical-align:middle;text-transform:uppercase}

/* Folder tree in admin user-edit page */
.folder-tree-block{margin-bottom:10px}
.folder-tree-block .pending-folder strong{color:var(--paper);font-weight:500}
.folder-tree-hint{color:var(--muted);font-size:.7rem;
  font-style:italic;margin-left:8px}
.subfolder-list{margin-left:26px;margin-top:4px;
  border-left:1px solid var(--line-soft);padding-left:14px}
.subfolder-row{font-size:.85rem;color:var(--muted)}
.subfolder-row input:checked + *,
.subfolder-row:has(input:checked){color:var(--paper)}

/* Library layout: sidebar (selected folder's files) + main pane */
.lib-shell{padding-top:36px;padding-bottom:80px;min-height:60vh}

/* Sidebar — full width now that the right pane is gone */
.lib-side{border:1px solid var(--line-soft);border-radius:3px;
  background:var(--ink-2);overflow:hidden}
.side-head{display:flex;justify-content:space-between;align-items:center;
  padding:18px 24px;border-bottom:1px solid var(--line-soft);background:var(--ink);
  gap:14px;flex-wrap:wrap}
.side-head h2{font-size:.78rem;letter-spacing:.18em;text-transform:uppercase;
  color:var(--signal)}
.side-head-right{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.side-count{font-size:.7rem;color:var(--muted)}
.side-count-split{display:block;margin-top:2px;font-size:.65rem;
  color:var(--muted);opacity:.85}

/* View toggle — Grid vs List buttons in the side-head */
.view-toggle{display:inline-flex;border:1px solid var(--line-soft);
  border-radius:2px;overflow:hidden;background:var(--ink-2)}
.view-toggle-btn{display:inline-flex;align-items:center;gap:6px;
  padding:6px 10px;color:var(--muted);font-size:.72rem;letter-spacing:.06em;
  border-right:1px solid var(--line-soft);
  transition:color .15s,background .15s}
.view-toggle-btn:last-child{border-right:none}
.view-toggle-btn:hover{color:var(--paper);background:rgba(241,237,226,.04)}
.view-toggle-btn.active{color:var(--signal);background:rgba(232,196,110,.08)}
.view-toggle-btn svg{display:block}
.view-toggle-label{font-size:.7rem}

.side-empty{padding:32px 24px;color:var(--muted);font-style:italic;font-size:.95rem}

/* Default (list) layout */
.side-list{list-style:none}
.side-list-list .side-item{border-bottom:1px solid var(--line-soft)}
.side-list-list .side-item:last-child{border-bottom:none}
.side-list-list .side-item a{display:flex;align-items:flex-start;gap:16px;
  padding:16px 24px;
  color:#cfccc2;font-size:.95rem;transition:background .18s,color .18s}
.side-list-list .side-item a:hover{background:var(--ink);color:var(--paper)}

/* Grid layout — tiles instead of rows */
.side-list-grid{display:grid;
  grid-template-columns:repeat(auto-fill,minmax(180px,1fr));
  gap:16px;padding:20px 24px}
.side-list-grid .side-item{border:none;background:transparent}
.side-list-grid .side-item a{display:flex;flex-direction:column;gap:8px;
  padding:0;color:#cfccc2;transition:transform .15s,color .15s}
.side-list-grid .side-item a:hover{color:var(--paper);transform:translateY(-2px)}
/* Bright work surface: document file rows/tiles use dark text (was #cfccc2,
   invisible on the bright sidebar). Scoped so other contexts are untouched. */
body.lib-body .side-list-list .side-item a{color:var(--paper)}
body.lib-body .side-list-list .side-item a:hover{background:var(--signal-dim);color:#000}
body.lib-body .side-list-grid .side-item a{color:var(--paper)}
body.lib-body .side-list-grid .side-item a:hover{color:var(--signal-bright)}
/* Light meta texts that also appear on the bright admin page */
body.lib-body .user-last-when{color:var(--muted)}
body.lib-body .pending-fact{color:var(--paper)}
.side-list-grid .side-thumb{width:100%;height:140px;margin-top:0}
.side-list-grid .side-type{align-self:flex-start;margin-top:0}
.side-list-grid .side-meta{gap:4px}
.side-list-grid .side-title{font-size:.84rem;line-height:1.3}
.side-list-grid .side-desc{font-size:.75rem;line-height:1.4;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;
  overflow:hidden}
.side-list-grid .side-sub{margin-left:0;display:inline-block;margin-top:2px}

/* Existing .side-list rule replaced above. Keep these for both modes: */
.side-item{break-inside:avoid}
.side-type{flex-shrink:0;font-size:.62rem;letter-spacing:.06em;
  color:var(--signal);border:1px solid var(--signal-dim);
  padding:4px 7px;border-radius:2px;min-width:46px;text-align:center;
  margin-top:1px}

/* Image thumbnail (replaces the type badge for image documents).
   Wrapper holds both the <img> and a text fallback label; if the
   image fails to load, JS toggles a class that hides the img and
   reveals the fallback text label. */
.side-thumb{flex-shrink:0;display:block;position:relative;
  width:80px;height:60px;
  background:var(--ink);border:1px solid var(--line-soft);border-radius:2px;
  overflow:hidden;
  margin-top:1px}
.side-thumb img{display:block;width:100%;height:100%;object-fit:cover;
  transition:opacity .18s}
.side-thumb-fallback{display:none;
  position:absolute;inset:0;
  align-items:center;justify-content:center;text-align:center;
  font-size:.62rem;letter-spacing:.06em;color:var(--signal)}
.side-thumb-failed img{display:none}
.side-thumb-failed .side-thumb-fallback{display:flex}
.side-item-img a{align-items:center}
.side-item:hover .side-thumb{border-color:var(--signal-dim)}

.side-meta{flex:1;display:flex;flex-direction:column;gap:3px;min-width:0}
.side-title{font-weight:500;line-height:1.3}
.side-desc{color:var(--muted);font-size:.85rem;line-height:1.5}

/* Banners above folder bar (replace right pane functions) */
.lib-page-notice{background:var(--ink-2);padding:14px 0;
  border-bottom:1px solid var(--line-soft);color:var(--paper);font-size:.92rem}
.lib-page-notice strong{color:var(--paper);margin-right:6px}
.lib-page-action{background:rgba(232,147,46,.08);
  border-bottom:1px solid var(--signal-dim);padding:12px 0;font-size:.9rem;
  color:var(--paper)}
.lib-page-action .wrap{display:flex;align-items:center;
  justify-content:space-between;gap:16px;flex-wrap:wrap}
.lib-page-action .btn-small{margin:0}

/* Removed: .lib-main (right pane is gone). lib-main-head retained
   because admin.php / profile.php / backup.php / admin-user.php still
   use it for their page titles. */
.lib-main-head{margin-bottom:36px}
.lib-main-head h1{font-family:"Bricolage Grotesque",sans-serif;font-weight:800;
  font-size:clamp(1.7rem,3vw,2.5rem);letter-spacing:-.02em;margin-bottom:10px}
.lib-card{border:1px solid var(--line-soft);background:var(--ink-2);
  padding:32px;border-radius:3px;margin-bottom:24px}
.lib-card .lead{font-family:"Bricolage Grotesque",sans-serif;font-size:1.4rem;
  font-weight:600;margin-bottom:10px}
.lib-card .muted{color:var(--muted);font-size:.95rem;line-height:1.6}
.lib-card code{font-family:"Space Mono",monospace;color:var(--steel);
  background:var(--ink);padding:2px 7px;border-radius:2px;font-size:.85em}
.lib-card-action{border-color:var(--signal-dim);background:var(--signal-dim)}
.lib-card-action .lead{color:var(--paper)}
.lib-types{display:flex;gap:8px;flex-wrap:wrap;margin-top:20px}
.lib-type-chip{font-size:.7rem;letter-spacing:.06em;color:var(--steel);
  border:1px solid var(--line-soft);padding:5px 10px;border-radius:2px;
  background:var(--ink)}
.panel-empty{border:1px dashed var(--line);border-radius:3px;
  padding:44px;text-align:center}
.panel-empty .lead{color:var(--paper);margin-bottom:12px}
.panel-empty code{font-family:"Space Mono",monospace;font-size:.85em;
  color:var(--steel)}
.panel-folder{margin-bottom:44px;scroll-margin-top:160px;
  border-radius:3px;transition:background .4s}
.panel-folder.flash{background:var(--signal-dim)}
.panel-folder-h{font-size:.78rem;letter-spacing:.2em;
  text-transform:uppercase;color:var(--signal);margin-bottom:14px;
  padding-bottom:12px;border-bottom:1px solid var(--line-soft)}

.role-badge{display:inline-block;font-family:"Space Mono",monospace;
  font-size:.66rem;letter-spacing:.14em;text-transform:uppercase;
  padding:3px 9px;border-radius:2px;margin:0 6px;border:1px solid;
  vertical-align:middle}
.role-admin{color:var(--signal);border-color:var(--signal-dim);
  background:var(--signal-dim)}
.role-member{color:var(--steel);border-color:rgba(125,155,151,.3);
  background:rgba(125,155,151,.1)}
.role-partner{color:var(--muted);border-color:var(--line);
  background:rgba(241,237,226,.04)}

/* ---------- User table (admin console) ---------- */
.user-table{width:100%;border-collapse:collapse;
  background:var(--ink-2);border:1px solid var(--line);border-radius:3px}
.user-table thead{background:var(--ink)}
.user-table th{font-family:"Space Mono",monospace;font-size:.7rem;
  text-transform:uppercase;letter-spacing:.12em;
  color:var(--muted);text-align:left;padding:12px 16px;
  border-bottom:1px solid var(--line)}
.user-table td{padding:14px 16px;border-bottom:1px solid var(--line-soft);
  vertical-align:middle;font-size:.9rem}
.user-table tr:last-child td{border-bottom:none}
.user-table tr:hover{background:rgba(232,147,46,.03)}
.user-row-self{background:rgba(232,147,46,.04)}
.user-name{color:var(--paper);font-weight:500;margin-bottom:2px}
.user-email{font-size:.78rem;color:var(--muted)}
.user-folders{font-size:.82rem;color:var(--paper);max-width:280px;
  line-height:1.4}
.user-dl-yes{color:var(--signal);font-size:.82rem}
.user-dl-no{color:var(--muted);font-size:.82rem}
.user-last{font-size:.78rem}
.user-last-when{display:block;color:#cfccc2;font-size:.72rem}
.user-last-geo{display:block;color:var(--muted);font-size:.66rem;
  letter-spacing:.04em;margin-top:2px}
.user-last-never{color:var(--muted);font-style:italic;font-size:.72rem;
  opacity:.7}
.user-self-tag{display:inline-block;background:var(--signal-dim);
  color:var(--signal);font-size:.6rem;letter-spacing:.12em;
  text-transform:uppercase;padding:1px 7px;border-radius:2px;
  margin-left:6px;vertical-align:middle}
.btn-small{font-size:.78rem;padding:6px 14px;letter-spacing:.05em}

/* Admin tools row at top of admin console */
.admin-tools{margin-top:14px;display:flex;gap:8px;flex-wrap:wrap}
.admin-tools .btn{font-size:.7rem;letter-spacing:.08em;text-transform:uppercase}

/* Backup table — share user-table styles, plus narrow action column */
.backup-table td:last-child{white-space:nowrap;min-width:380px}
.backup-table .btn-small{font-size:.7rem;padding:4px 10px;margin-right:4px}
.backup-files{list-style:none;padding:0;margin:8px 0 0;font-size:.78rem}
.backup-files li{padding:4px 10px;background:var(--ink);
  border:1px solid var(--line-soft);border-radius:2px;
  margin-bottom:3px;color:var(--paper)}

/* ---------- Secure access panel ---------- */
.secure-panel{display:grid;grid-template-columns:1.4fr 1fr;gap:48px;
  align-items:center;border:1px solid var(--line);
  background:var(--ink);padding:48px;border-radius:3px}
.secure-copy .lead{color:var(--paper);margin-bottom:14px}
.secure-action{display:flex;flex-direction:column;align-items:flex-start;
  gap:14px;border-left:1px solid var(--line-soft);padding-left:44px}
.lock-glyph{font-size:2rem;filter:grayscale(1) brightness(1.6);
  opacity:.7;margin-bottom:4px}
.secure-sub{font-size:.82rem;color:var(--muted);letter-spacing:.04em}
a.secure-sub:hover{color:var(--signal)}
.nav-user{color:var(--muted);font-size:.78rem;letter-spacing:.08em;
  padding:0 8px;border:1px solid var(--line-soft);
  border-radius:2px;line-height:2.1;transition:color .2s,border-color .2s}
a.nav-user:hover{color:var(--signal);border-color:var(--signal-dim)}

/* Profile page */
.profile-facts{padding:32px}
.profile-section-h{font-size:.74rem;letter-spacing:.18em;text-transform:uppercase;
  color:var(--signal);margin-bottom:18px}
.profile-dl{display:grid;grid-template-columns:140px 1fr;gap:14px 24px;
  margin-bottom:18px}
.profile-dl dt{font-size:.78rem;letter-spacing:.08em;text-transform:uppercase;
  color:var(--muted);padding-top:2px}
.profile-dl dd{color:var(--paper);font-size:.95rem;line-height:1.5}
.profile-note{color:var(--muted);font-size:.82rem;line-height:1.5;
  border-top:1px solid var(--line-soft);padding-top:16px;margin-top:6px}
.profile-dl dd .profile-note{display:inline;border:none;padding:0;margin:0 0 0 8px;
  font-size:.74rem;color:var(--muted)}

/* ---------- Auth screen ---------- */
.auth-body{min-height:100vh;display:flex;
  background:radial-gradient(120% 90% at 50% 0%,
    rgba(232,147,46,.07),transparent 60%),var(--ink)}
.auth-shell{margin:auto;width:100%;max-width:430px;padding:40px 24px}
.auth-card{background:var(--ink-2);border:1px solid var(--line);
  border-radius:4px;padding:44px 40px}
.auth-card-tabs{max-width:520px;padding:36px 38px 32px}
.auth-tabs{display:flex;gap:2px;margin:24px 0 28px;
  border-bottom:1px solid var(--line)}
.auth-tab{flex:1;text-align:center;padding:14px 8px;font-size:.9rem;
  color:var(--muted);font-weight:500;border-bottom:2px solid transparent;
  margin-bottom:-1px;transition:color .2s,border-color .2s}
.auth-tab:hover{color:var(--paper)}
.auth-tab.active{color:var(--signal);border-bottom-color:var(--signal)}
.auth-panel{display:none}
.auth-panel.active{display:block}
.auth-h-sm{font-family:"Bricolage Grotesque",sans-serif;font-weight:700;
  font-size:1.3rem;margin-bottom:10px}
.auth-brand{display:flex;align-items:center;gap:14px;margin-bottom:34px}
.auth-brand strong{font-family:"Bricolage Grotesque",sans-serif;
  font-weight:800;font-size:1.2rem;letter-spacing:.06em;display:block;
  line-height:1}
.auth-brand em{font-style:normal;font-size:.66rem;letter-spacing:.2em;
  text-transform:uppercase;color:var(--muted)}
.auth-h{font-family:"Bricolage Grotesque",sans-serif;font-weight:800;
  font-size:1.9rem;letter-spacing:-.02em;margin-bottom:8px}
.auth-sub{color:var(--muted);font-size:.92rem;margin-bottom:28px}
.auth-form{display:flex;flex-direction:column;gap:18px;margin-bottom:24px}
.auth-form .btn{align-self:stretch;text-align:center;cursor:pointer;
  border:none;margin-top:4px}
.auth-error{background:rgba(200,70,55,.14);color:#e88a7d;
  border:1px solid rgba(200,70,55,.32);border-radius:2px;
  padding:12px 14px;font-size:.9rem;margin-bottom:22px}
.auth-back{display:inline-block;font-size:.84rem;color:var(--muted)}
.auth-back:hover{color:var(--signal)}
.auth-intro{color:#cfccc2;font-size:.94rem;margin-bottom:24px;line-height:1.5}
.auth-forgot{margin-top:14px;text-align:center;font-size:.82rem}
.auth-forgot a{color:var(--muted);transition:color .15s}
.auth-forgot a:hover{color:var(--signal)}
.auth-aside{font-size:.86rem;color:var(--muted);text-align:center;
  margin:8px 0 18px}
.auth-aside a{color:var(--signal)}
.auth-hint{font-size:.78rem;color:var(--muted);margin-top:-12px;margin-bottom:8px}
.auth-hint-inline{font-size:.78rem;color:var(--muted);font-weight:normal}
.auth-form label{font-size:.86rem;color:var(--paper);margin-bottom:4px;
  display:block;font-weight:500}
.auth-form input,.auth-form select,.auth-form textarea{
  background:var(--ink);border:1px solid var(--line);color:var(--paper);
  font:inherit;font-size:.94rem;padding:10px 12px;border-radius:2px;width:100%}
.auth-form input:focus,.auth-form select:focus,.auth-form textarea:focus{
  outline:none;border-color:var(--signal)}
.auth-form textarea{resize:vertical;min-height:80px;font-family:inherit}

/* Admin pending queue */
.lib-card-ok{border-color:rgba(125,155,151,.4);background:rgba(125,155,151,.1)}
.lib-card-err{border-color:rgba(200,70,55,.4);background:rgba(200,70,55,.1)}
.pending-card{display:grid;grid-template-columns:1fr 360px;gap:36px;
  align-items:start}
.pending-meta h2{font-family:"Bricolage Grotesque",sans-serif;font-weight:600;
  font-size:1.2rem;margin-bottom:10px}
.pending-user{font-size:.85rem;color:var(--muted);font-weight:400}
.pending-fact{font-size:.88rem;color:#cfccc2;margin-bottom:6px}
.pending-fact strong{color:var(--muted);font-weight:500}
.pending-ip{font-size:.75rem;color:var(--muted);margin-left:8px}
.pending-reason{font-style:italic;color:var(--muted);border-left:2px solid var(--signal-dim);
  padding-left:14px;margin-top:14px;font-size:.92rem;line-height:1.55}
.pending-form{background:var(--ink);padding:18px;border-radius:3px;
  border:1px solid var(--line-soft)}
.pending-controls{display:flex;flex-direction:column;gap:14px}
.pending-controls label{font-size:.78rem;color:var(--muted);
  text-transform:uppercase;letter-spacing:.08em}
.pending-controls label span{display:block;margin-bottom:4px}
.pending-controls select{background:var(--ink-2);border:1px solid var(--line);
  color:var(--paper);font:inherit;font-size:.88rem;padding:8px 10px;
  border-radius:2px;width:100%;text-transform:none;letter-spacing:0}
.pending-controls fieldset{border:1px solid var(--line);padding:12px;
  border-radius:2px}
.pending-controls legend{font-size:.72rem;color:var(--muted);padding:0 6px;
  letter-spacing:.1em;text-transform:uppercase}
.pending-folder{display:flex;align-items:center;gap:8px;font-size:.86rem;
  color:var(--paper);text-transform:none;letter-spacing:0;
  padding:4px 0;cursor:pointer}
.pending-folder input{margin:0}
.pending-dl{display:flex;align-items:center;gap:8px;font-size:.86rem;
  color:var(--paper);text-transform:none;letter-spacing:0;cursor:pointer}
.pending-dl input{margin:0}
.pending-actions{display:flex;gap:10px;margin-top:18px}
.pending-actions .btn{flex:1;text-align:center;cursor:pointer;
  border:none;font-size:.86rem;padding:11px}
.btn-ghost{background:transparent;border:1px solid var(--line)!important;
  color:var(--paper)}
.btn-ghost:hover{border-color:var(--signal)!important;color:var(--signal)}
.btn-block{width:100%;text-align:center}

/* ---------- Reveal animations ---------- */
.reveal{opacity:0;transform:translateY(22px);
  animation:rise .9s var(--ease) forwards}
.reveal.d1{animation-delay:.05s}.reveal.d2{animation-delay:.15s}
.reveal.d3{animation-delay:.25s}.reveal.d4{animation-delay:.35s}
.reveal.d5{animation-delay:.5s}.reveal.d6{animation-delay:.65s}
@keyframes rise{to{opacity:1;transform:none}}
.reveal-on-scroll{opacity:0;transform:translateY(26px);
  transition:opacity .8s var(--ease),transform .8s var(--ease)}
.reveal-on-scroll.in{opacity:1;transform:none}

/* ---------- Responsive ---------- */
@media (max-width:900px){
  body{font-size:16px}
  .wrap{padding:0 22px}
  .nav{gap:14px;font-size:.8rem;flex-wrap:wrap;justify-content:flex-end}
  /* On gated app pages, keep user name, Admin link, and Sign out always
   * visible; on the public homepage the over-long primary nav can collapse
   * to just the CTA. Protected classes: .nav-cta (Sign out / Enquire),
   * .nav-login (Log in), .nav-user (username link), .nav-admin (Admin /
   * Back to admin). Anything else (Programme/Infrastructure/etc. anchor
   * links on the public site) is hidden. */
  .nav a:not(.nav-cta):not(.nav-login):not(.nav-user):not(.nav-admin){display:none}
  .nav-login::before{display:none}
  .nav-user{display:inline-block;font-size:.72rem;max-width:120px;
    overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

  /* Public homepage layout (existing rules) */
  .block{padding:74px 0}
  .hero{padding:84px 0 56px}
  .prose-2col,.footprint,.contact-grid{grid-template-columns:1fr;gap:36px}
  .pillars{grid-template-columns:1fr}
  .pillar:nth-child(5){grid-column:auto}
  .datasheet{grid-template-columns:1fr 1fr}
  .gallery{grid-template-columns:1fr 1fr}
  .secure-panel{grid-template-columns:1fr;gap:30px;padding:32px}
  .secure-action{border-left:none;padding-left:0;
    border-top:1px solid var(--line-soft);padding-top:26px}
  .panel{padding:24px 0 0 0}

  /* Library layout — folder bars wrap normally on mobile, slightly tighter */
  .lib-shell{padding-top:24px;padding-bottom:48px}
  .lib-side{position:static}
  .folderbar{padding:6px 0}
  .subfolderbar{padding:4px 0}
  .fb-tab{padding:7px 11px;font-size:.74rem}
  .sub-tab{padding:5px 10px;font-size:.68rem}

  /* Page heading band — smaller on tablets/phones */
  .lib-page-head-inner{padding:22px 0 18px}
  .lib-page-head h1{font-size:1.3rem;letter-spacing:-.01em}
  .lib-page-head .datasheet-note{font-size:.72rem}

  .shot:nth-child(1){grid-column:auto;grid-row:auto;aspect-ratio:4/3}
  .doc a{gap:16px;padding:18px 4px}
  .doc a:hover{padding-left:10px;padding-right:10px}
  .commitments{grid-template-columns:1fr 1fr;gap:24px}
  .foot-grid{grid-template-columns:1fr 1fr;gap:30px}
  .sec-head{flex-direction:column;gap:14px;margin-bottom:38px}
  .fp-list li{grid-template-columns:1fr;gap:6px}

  /* Viewer toolbar wraps cleanly on narrow screens */
  .viewer-bar-inner{flex-wrap:wrap;gap:14px}
  .viewer-meta{flex:1 1 100%}
  .viewer-title{font-size:1.1rem}
  .viewer-zoom{order:2}
  .viewer-actions{order:3}

  /* Admin tools row — wrap onto multiple lines on tablet, stack onto
     full-width buttons on small phones so labels are readable */
  .admin-tools{gap:6px}
  .admin-tools .btn{font-size:.65rem;padding:6px 10px;
    flex:1 1 auto;min-width:120px;text-align:center}

  /* Image album arrows: smaller on mobile so they don't dominate */
  .viewer-album-arrow{width:36px;height:48px;font-size:1.1rem}
  .viewer-album-prev{left:6px}
  .viewer-album-next{right:6px}

  /* Back-to-library row: keep on its own line above the title */
  .viewer-back{font-size:.72rem}
  .viewer-album-pos{font-size:.65rem}

  /* Cards: less internal padding on smaller screens */
  .lib-card{padding:22px}
  .lib-main-head h1{font-size:1.5rem}
}

@media (max-width:720px){
  /* ===== Phone-sized: convert wide tables to stacked cards ===== */
  .user-table,.user-table thead,.user-table tbody,
  .user-table tr,.user-table td,.user-table th{display:block}
  .user-table thead{display:none}    /* hide column headers; we label per cell */
  .user-table tr{background:var(--ink-2);border:1px solid var(--line-soft);
    border-radius:3px;padding:14px;margin-bottom:12px}
  .user-table tr:hover{background:var(--ink-2)}
  .user-table td{padding:6px 0;border:none;display:flex;
    justify-content:space-between;align-items:center;gap:12px;
    font-size:.88rem}
  .user-table td::before{content:attr(data-label);
    font-family:"Space Mono",monospace;font-size:.65rem;
    color:var(--muted);text-transform:uppercase;letter-spacing:.1em;
    flex-shrink:0}
  .user-table td:first-child{flex-direction:column;align-items:flex-start;
    padding:0 0 10px;border-bottom:1px solid var(--line-soft);margin-bottom:10px}
  .user-table td:first-child::before{display:none}
  .user-table td:last-child{flex-direction:column;align-items:stretch;
    padding-top:12px;border-top:1px solid var(--line-soft);margin-top:8px;gap:6px}
  .user-table td:last-child::before{display:none}
  .user-table td:last-child .btn,
  .user-table td:last-child form{margin:0}
  .backup-table td:last-child{min-width:0}
  .backup-table .btn-small{font-size:.78rem;padding:8px 12px;width:100%}

  /* Tighter folder bars on phone */
  .folderbar-label,.subfolderbar .folderbar-label{display:none}
  .folderbar-inner{padding-left:0}
  .fb-tab{padding:10px 12px}
  .sub-tab{padding:6px 10px}

  /* Zoom buttons hit-target — bump up to iOS minimum */
  .zoom-btn{width:44px;height:44px;font-size:1rem}
  .zoom-btn.zoom-reset{width:auto;padding:0 14px;height:44px}

  /* Form inputs: bigger tap targets */
  .auth-form input,.auth-form select,.auth-form textarea{
    font-size:16px;padding:12px 14px}   /* 16px prevents iOS auto-zoom */
  .btn{padding:14px 22px;font-size:.95rem;min-height:44px;
    display:inline-flex;align-items:center;justify-content:center}
  .btn-small{padding:10px 14px;font-size:.82rem;min-height:36px}

  /* Pending request cards (admin) — stack their content vertically */
  .pending-card{flex-direction:column;gap:18px}
  .pending-controls{width:100%}

  /* Login/signup screen */
  .auth-tabs{font-size:.85rem}

  /* Header at tablet/small-laptop widths: brand subtitle and username
     link both compress so admin/library/sign-out stay visible. */
  .brand-text em{font-size:.6rem;letter-spacing:.18em}
  .nav{gap:14px;font-size:.82rem}
  .nav-user{max-width:100px;overflow:hidden;text-overflow:ellipsis;
    white-space:nowrap;display:inline-block;vertical-align:middle}
  .nav-cta{padding:8px 14px}
  /* Public-site anchor links eat space — hide them in nav on tablets,
     they're not the primary actions for logged-in users anyway. */
  .nav a[href^="#"]{display:none}

  /* Search bar: keep label inline but allow button to wrap below input
     on narrower screens. */
  .searchbar-input{flex:1 1 100%}
  .searchbar-label{flex:1 0 100%;margin-bottom:2px}

  /* Viewer (view.php) on tablet/phone: shrink the title bar, let the
     content stage use as much vertical space as possible. */
  .viewer-bar{padding:10px 0 12px}
  .viewer-bar-inner{flex-direction:column;align-items:stretch;gap:10px}
  .viewer-title{font-size:1.05rem;line-height:1.3}
  .viewer-desc{font-size:.78rem}
  .viewer-actions{align-self:stretch;display:flex;gap:8px}
  .viewer-actions .btn{flex:1;font-size:.78rem;padding:10px 14px}
  .viewer-back-row{flex-direction:row;justify-content:space-between;
    align-items:center;margin-bottom:4px}
  .viewer-crumb{font-size:.6rem}

  /* PDF/iframe: fill remaining vertical space, no explicit height */
  .viewer-stage{min-height:75vh}
  .viewer-frame{min-height:75vh;width:100%}

  /* Image viewer: scale down to fit screen with reasonable margins */
  .viewer-image-wrap{padding:12px}
  .viewer-image{max-width:100%;max-height:calc(100vh - 240px)}

  /* Office docs (DOCX/XLSX): mobile reflow strategy.
     docx-preview emits inline width:21cm + fixed-width paragraphs that
     overflow on phones. Rather than zooming the whole page down (text
     becomes unreadable), we force everything to reflow: override the
     inline widths, let text wrap naturally to the viewport. Layout-
     sensitive elements (tables, text boxes with hard widths) become
     horizontally pannable via overflow-x:auto on the table wrapper. */
  .viewer-office{padding:8px 0;overflow-x:auto;-webkit-overflow-scrolling:touch;
    font-size:1rem;line-height:1.6}
  .viewer-office .docx-wrapper{padding:20px 16px !important;
    max-width:100% !important;width:auto !important;
    margin:0 auto !important;
    box-shadow:none !important;border-radius:0}
  /* Reflow every block-level element inside docx-preview's output. */
  .viewer-office .docx-wrapper section,
  .viewer-office .docx-wrapper .docx,
  .viewer-office .docx-wrapper article,
  .viewer-office .docx-wrapper p,
  .viewer-office .docx-wrapper div{
    max-width:100% !important;
    width:auto !important;
    box-sizing:border-box !important;
    word-wrap:break-word;
    overflow-wrap:anywhere;
  }
  /* Mobile body type sizing — slightly smaller than desktop but still readable */
  .viewer-office .docx-wrapper p{
    font-size:1rem !important;line-height:1.65 !important}
  /* Mobile heading sizes — tighten so they don't dominate the viewport */
  .viewer-office .docx-wrapper h1{font-size:1.45rem}
  .viewer-office .docx-wrapper h2{font-size:1.25rem}
  .viewer-office .docx-wrapper h3{font-size:1.08rem}
  .viewer-office .docx-wrapper h4,
  .viewer-office .docx-wrapper h5,
  .viewer-office .docx-wrapper h6{font-size:1rem}
  /* Tables stay at native width but become pannable inside their own
     scroll area (instead of pushing the whole page off-screen). */
  .viewer-office .docx-wrapper table{
    max-width:100% !important;
    display:block;overflow-x:auto;-webkit-overflow-scrolling:touch;
    font-size:.88rem !important}
  /* Text-box / floating containers: docx-preview uses inline transform
     and position:absolute for some Word elements. Force them inline so
     they don't overhang the viewport. */
  .viewer-office .docx-wrapper [style*="position:absolute"],
  .viewer-office .docx-wrapper [style*="position: absolute"]{
    position:static !important;
    transform:none !important;
  }
  /* XLSX cells on mobile — larger than v2.9.9's microscopic 0.74rem.
     Sticky header/first-col rules from desktop carry through. */
  .viewer-sheet{padding:14px 10px}
  .viewer-sheet-name{font-size:.72rem;padding:5px 10px;letter-spacing:.1em}
  .viewer-sheet-table table{font-size:.84rem;line-height:1.4}
  .viewer-sheet-table td,.viewer-sheet-table th{padding:6px 10px}

  /* Sidebar grid on tablets: 2 columns instead of auto-fill */
  .side-list-grid{grid-template-columns:repeat(2,1fr);gap:12px;padding:14px 16px}
  .side-list-grid .side-thumb{height:110px}
  .view-toggle-label{display:none}
  .view-toggle-btn{padding:6px 8px}

  /* Landing tiles: 2 per row on tablet */
  .lib-tiles-grid,
  .public-tiles-grid{grid-template-columns:repeat(2,1fr);gap:12px}
  .block-tiles{padding:36px 0}
}

@media (max-width:480px){
  /* ===== Tight phones (iPhone SE etc) ===== */
  .wrap{padding:0 16px}
  .lib-page-head h1{font-size:1.15rem}
  .lib-page-head .datasheet-note{font-size:.68rem;line-height:1.5}
  .head-inner{gap:10px}
  .brand-text strong{font-size:1rem}
  .brand-text em{font-size:.6rem}

  /* On small phones, the long brand subtitle and username link push the
     Admin/Sign-out buttons off-screen. Compress the brand to just "ARIA"
     and hide the username link so the important buttons stay top-right
     and tappable. The Admin link (when present) and Sign out always
     remain visible. */
  .brand-text em{display:none}
  .nav{gap:10px;flex-shrink:0;font-size:.78rem}
  .nav-user{display:none}
  .nav a{padding:4px 0}
  .nav-cta{padding:6px 12px;font-size:.78rem}

  /* Hide some less-essential public-site nav links on phones so
     the main actions (Log in, Enquire) stay reachable. */
  .nav a[href^="#"]{display:none}

  /* Less padding everywhere */
  .lib-card{padding:18px}
  .lib-main-head h1{font-size:1.3rem}

  /* Thumbnails shrink on phones to leave more room for the title */
  .side-thumb{width:64px;height:48px}
  .side-item a{padding:12px 16px;gap:12px}

  /* Landing tiles: single column on phone */
  .lib-tiles-grid,
  .public-tiles-grid{grid-template-columns:1fr;gap:10px}
  .lib-tile-img{aspect-ratio:16/9}
  .block-tiles{padding:24px 0}
}

@media (prefers-reduced-motion:reduce){
  *{animation:none!important;transition:none!important}
  .reveal,.reveal-on-scroll{opacity:1!important;transform:none!important}
}

@media (max-width:520px){
  .datasheet,.commitments,.foot-grid{grid-template-columns:1fr}
  .gallery{grid-template-columns:1fr}
  .hero-foot{flex-direction:column;gap:10px}

  /* Admin tools row: stack each button on its own line for small phones,
     so labels are big enough to read. */
  .admin-tools{flex-direction:column;align-items:stretch}
  .admin-tools .btn{width:100%;flex:0 0 auto;min-width:0;
    padding:10px 12px;font-size:.72rem}
}

/* ===========================================================================
   PUBLIC-PAGE LIGHT THEME (Option C — civic/government-style)
   ===========================================================================
   Applied via body.public-page. The existing dark theme above is untouched
   so logged-in pages (documents.php, view.php, admin.*) keep working.
   Palette: navy #0e2a52 + signal gold #e8932e on white. Public Sans / Inter.
   =========================================================================== */
body.public-page{
  background:#fff;
  color:#1a1a1a;
  font-family:"Public Sans","Inter",-apple-system,BlinkMacSystemFont,
              "Segoe UI",sans-serif;
  font-size:1rem;
  line-height:1.6;
}

/* Government strip — top disclaimer */
body.public-page .gov-strip{
  background:#0e2a52;color:#fff;padding:9px 0;text-align:center;
  font-size:.78rem;letter-spacing:.04em;font-family:"Public Sans","Inter",sans-serif}
body.public-page .gov-strip .wrap{padding:0 32px}
body.public-page .gov-strip-em{color:#f4a13b;font-weight:600}

/* Site header on public pages */
body.public-page .site-head{background:#fff;border-bottom:3px solid #0e2a52;
  position:sticky;top:0;z-index:50;backdrop-filter:none}
body.public-page .head-inner{padding:18px 32px;display:flex;
  align-items:center;justify-content:space-between;gap:24px}
body.public-page .brand{display:flex;align-items:center;gap:14px;
  text-decoration:none;color:#0e2a52}
body.public-page .brand-bar{width:6px;height:36px;background:#e8932e;
  display:inline-block;border-radius:0}
body.public-page .brand-text strong{font-size:1.2rem;font-weight:800;
  letter-spacing:-.015em;color:#0e2a52;display:block;line-height:1.1}
body.public-page .brand-text em{font-style:normal;color:#4a5570;
  font-weight:500;font-size:.74rem;letter-spacing:.06em;display:block;
  margin-top:2px}

body.public-page .nav{display:flex;gap:26px;align-items:center;
  font-size:.88rem;color:#0e2a52;font-weight:500}
body.public-page .nav a{color:#0e2a52;text-decoration:none;
  padding:6px 0;border-bottom:3px solid transparent;
  transition:border-color .15s, color .15s}
body.public-page .nav a:hover{border-bottom-color:#e8932e}
body.public-page .nav-login{color:#4a5570 !important}
body.public-page .nav-cta{background:#0e2a52 !important;color:#fff !important;
  padding:10px 22px !important;border:none !important;border-radius:2px;
  font-weight:600;letter-spacing:.02em}
body.public-page .nav-cta:hover{background:#e8932e !important;
  color:#0e2a52 !important;border-bottom-color:transparent !important}

/* Hero — deep navy with subtle line grid overlay */
body.public-page .hero{
  background:linear-gradient(135deg,#0e2a52 0%,#1a3a6a 100%);
  color:#fff;padding:64px 0 72px;position:relative;overflow:hidden;
  border-bottom:6px solid #e8932e}
body.public-page .hero::before{
  content:"";position:absolute;inset:0;pointer-events:none;
  background-image:repeating-linear-gradient(90deg,
    rgba(255,255,255,.045) 0,rgba(255,255,255,.045) 1px,
    transparent 1px,transparent 80px)}
body.public-page .hero-inner{position:relative;padding:0 32px;max-width:1200px;
  margin:0 auto}
body.public-page .hero-grid,
body.public-page .corridor{display:none}    /* old decorations, hide */
body.public-page .eyebrow{display:inline-block;padding:6px 14px;
  background:rgba(232,147,46,.18);color:#f4a13b;font-size:.74rem;
  font-weight:600;letter-spacing:.14em;text-transform:uppercase;
  border-left:3px solid #e8932e;margin-bottom:22px}
body.public-page .hero-title{
  font-size:clamp(2.2rem,5vw,3.8rem);font-weight:800;line-height:1.05;
  letter-spacing:-.02em;color:#fff;max-width:18ch;margin-bottom:22px}
body.public-page .hero-title span{display:inline}
body.public-page .hero-title .accent{color:#f4a13b}
body.public-page .hero-lede{
  font-size:1.1rem;line-height:1.55;color:#cfd8e8;max-width:58ch;
  margin-bottom:28px;font-weight:400}
body.public-page .hero-actions{display:flex;gap:14px;flex-wrap:wrap}
body.public-page .hero-foot{display:none}

/* Buttons (public-page scope) */
body.public-page .btn{padding:14px 28px;font-size:.92rem;font-weight:600;
  border-radius:2px;text-decoration:none;transition:all .15s;
  letter-spacing:.02em;display:inline-flex;align-items:center;gap:8px;
  border:2px solid transparent;cursor:pointer;font-family:inherit}
body.public-page .btn-solid,
body.public-page .hero-actions .btn:first-child{
  background:#e8932e;color:#0e2a52;border-color:#e8932e}
body.public-page .btn-solid:hover,
body.public-page .hero-actions .btn:first-child:hover{
  background:#f4a13b;border-color:#f4a13b}
body.public-page .btn-ghost,
body.public-page .hero-actions .btn:nth-child(2){
  background:transparent;color:#fff;border-color:#fff}
body.public-page .btn-ghost:hover,
body.public-page .hero-actions .btn:nth-child(2):hover{
  background:#fff;color:#0e2a52}

/* Sections — white background, structured spacing */
body.public-page section{padding:52px 0;background:#fff;
  border-bottom:1px solid #e5e8ee}
body.public-page section.alt-band{background:#f6f8fc}
body.public-page section .wrap{max-width:1200px;margin:0 auto;padding:0 32px}
body.public-page .section-label,
body.public-page .eyebrow-civic{display:inline-block;padding:5px 12px;
  background:#0e2a52;color:#fff;font-size:.7rem;font-weight:600;
  letter-spacing:.14em;text-transform:uppercase;margin-bottom:14px}
body.public-page h2{font-size:clamp(1.7rem,3.4vw,2.4rem);font-weight:800;
  line-height:1.12;letter-spacing:-.018em;color:#0e2a52;
  margin-bottom:16px;max-width:22ch}
body.public-page h2::after{content:"";display:block;width:56px;height:3px;
  background:#e8932e;margin-top:12px}
body.public-page h3{font-size:1.12rem;font-weight:700;color:#0e2a52;
  margin-bottom:10px;letter-spacing:-.005em}
body.public-page p{font-size:1rem;line-height:1.6;color:#1a1a1a;
  margin-bottom:.9em;max-width:62ch}
body.public-page p.muted{color:#4a5570}

/* Stripped-down banners */
body.public-page .banner{padding:14px 0;font-size:.92rem}
body.public-page .banner-ok{background:#dceee5;color:#0c5236;
  border-left:4px solid #1f8a5b}
body.public-page .banner-err{background:#fbe2dd;color:#7a1f12;
  border-left:4px solid #c84637}

/* Card grid — bordered structured cards (no shadows, no rounded corners) */
body.public-page .card-grid,
body.public-page .pillars,
body.public-page .footprint{display:grid;
  grid-template-columns:repeat(3,1fr);gap:0;margin-top:28px;
  border-left:1px solid #d9deea}
body.public-page .card,
body.public-page .pillar,
body.public-page .footprint-card{
  padding:22px;border-right:1px solid #d9deea;border-bottom:1px solid #d9deea;
  border-top:4px solid #0e2a52;transition:background .15s;background:#fff}
body.public-page .card:hover,
body.public-page .pillar:hover,
body.public-page .footprint-card:hover{background:#f6f8fc}
body.public-page .card-no,
body.public-page .pillar-no{display:inline-block;background:#0e2a52;
  color:#f4a13b;font-size:.66rem;font-weight:700;letter-spacing:.14em;
  padding:3px 8px;margin-bottom:14px;font-family:"Space Mono",monospace}
body.public-page .card p,
body.public-page .pillar p,
body.public-page .footprint-card p{font-size:.94rem;line-height:1.65;
  color:#3a4566;max-width:none}

/* Number stats panel */
body.public-page .stats-strip{background:#0e2a52;color:#fff;
  padding:60px 0;border-bottom:6px solid #e8932e}
body.public-page .stats-strip h2{color:#fff}
body.public-page .stats-strip h2::after{background:#f4a13b}
body.public-page .stats-grid{display:grid;
  grid-template-columns:repeat(4,1fr);gap:32px;margin-top:48px}
body.public-page .stat-num{font-size:clamp(2rem,4vw,3.2rem);font-weight:800;
  letter-spacing:-.02em;color:#f4a13b;line-height:1;margin-bottom:8px}
body.public-page .stat-label{font-size:.78rem;letter-spacing:.12em;
  text-transform:uppercase;color:#cfd8e8;font-weight:500}

/* Public-facing tile grid (landing tiles for non-logged-in visitors) */
body.public-page .public-tiles-grid{display:grid;
  grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:24px;
  margin-top:40px}
body.public-page .public-tile{display:block;text-decoration:none;
  background:#fff;border:1px solid #d9deea;border-top:4px solid #e8932e;
  padding:24px;color:#1a1a1a;transition:all .15s}
body.public-page .public-tile:hover{background:#f6f8fc;
  border-color:#0e2a52;border-top-color:#0e2a52}
body.public-page .public-tile h4{color:#0e2a52;font-size:1rem;
  font-weight:700;margin-bottom:8px}
body.public-page .public-tile p{font-size:.86rem;color:#4a5570;margin:0}

/* Contact form — civic style */
body.public-page #contact{background:#f6f8fc}
body.public-page .contact-form{max-width:640px;margin-top:36px}
body.public-page .contact-form label{display:block;font-size:.74rem;
  font-weight:600;letter-spacing:.1em;text-transform:uppercase;
  color:#0e2a52;margin-bottom:6px;margin-top:18px}
body.public-page .contact-form input,
body.public-page .contact-form textarea,
body.public-page .contact-form select{
  width:100%;padding:12px 14px;background:#fff;
  border:2px solid #d9deea;color:#1a1a1a;
  font-size:.96rem;border-radius:2px;
  font-family:inherit;transition:border-color .15s}
body.public-page .contact-form input:focus,
body.public-page .contact-form textarea:focus,
body.public-page .contact-form select:focus{
  outline:none;border-color:#0e2a52}
body.public-page .contact-form textarea{min-height:140px;resize:vertical}
body.public-page .contact-form button{margin-top:24px;
  background:#0e2a52;color:#fff;border:2px solid #0e2a52;
  padding:14px 28px;font-size:.94rem;font-weight:600;letter-spacing:.02em;
  border-radius:2px;cursor:pointer;font-family:inherit;transition:all .15s}
body.public-page .contact-form button:hover{
  background:#e8932e;border-color:#e8932e;color:#0e2a52}

/* Auth pages (login / forgot / reset) — light card on cool grey */
body.public-page.auth-body,
body.public-page .auth-body{background:#f6f8fc}
body.public-page .auth-shell{min-height:calc(100vh - 60px);
  display:flex;align-items:center;justify-content:center;padding:40px 20px}
body.public-page .auth-card{
  background:#fff;border:1px solid #d9deea;border-top:4px solid #0e2a52;
  padding:40px;max-width:480px;width:100%;border-radius:2px;
  box-shadow:0 6px 24px -8px rgba(14,42,82,.12)}
body.public-page .auth-brand{display:flex;align-items:center;gap:14px;
  text-decoration:none;color:#0e2a52;margin-bottom:30px;padding-bottom:24px;
  border-bottom:1px solid #d9deea}
body.public-page .auth-brand .brand-mark{display:flex;flex-direction:column;
  gap:3px;width:6px;background:#e8932e;height:36px;border-radius:0}
body.public-page .auth-brand .rail{display:none}
body.public-page .auth-brand strong{display:block;font-size:1.1rem;
  font-weight:800;color:#0e2a52;letter-spacing:-.015em}
body.public-page .auth-brand em{display:block;font-style:normal;
  color:#4a5570;font-size:.78rem;font-weight:500;margin-top:2px}
body.public-page .auth-tabs{display:flex;gap:0;margin:0 -40px 24px;
  border-bottom:1px solid #d9deea;padding:0 40px}
body.public-page .auth-tab{padding:14px 20px;text-decoration:none;
  color:#4a5570;font-weight:500;font-size:.88rem;letter-spacing:.04em;
  border-bottom:3px solid transparent;margin-bottom:-1px;
  transition:all .15s}
body.public-page .auth-tab:hover{color:#0e2a52}
body.public-page .auth-tab.active{color:#0e2a52;border-bottom-color:#e8932e;
  font-weight:700}
body.public-page .auth-card label{display:block;font-size:.74rem;
  font-weight:600;letter-spacing:.1em;text-transform:uppercase;
  color:#0e2a52;margin-bottom:6px;margin-top:18px}
body.public-page .auth-card input,
body.public-page .auth-card textarea,
body.public-page .auth-card select{
  width:100%;padding:12px 14px;background:#fff;
  border:2px solid #d9deea;color:#1a1a1a;
  font-size:.96rem;border-radius:2px;font-family:inherit;
  transition:border-color .15s}
body.public-page .auth-card input:focus,
body.public-page .auth-card select:focus,
body.public-page .auth-card textarea:focus{outline:none;border-color:#0e2a52}
body.public-page .auth-card button[type="submit"],
body.public-page .auth-card .btn-solid{
  margin-top:24px;background:#0e2a52;color:#fff;border:2px solid #0e2a52;
  padding:14px 28px;font-size:.94rem;font-weight:600;letter-spacing:.02em;
  border-radius:2px;cursor:pointer;width:100%;text-align:center;
  font-family:inherit;transition:all .15s;display:block;text-decoration:none}
body.public-page .auth-card button[type="submit"]:hover,
body.public-page .auth-card .btn-solid:hover{
  background:#e8932e;border-color:#e8932e;color:#0e2a52}
body.public-page .auth-card .form-error,
body.public-page .auth-card .auth-error{
  background:#fbe2dd;color:#7a1f12;padding:12px 14px;
  border-left:4px solid #c84637;font-size:.88rem;margin:18px 0;border-radius:2px}
body.public-page .auth-card .form-ok,
body.public-page .auth-card .auth-ok{
  background:#dceee5;color:#0c5236;padding:12px 14px;
  border-left:4px solid #1f8a5b;font-size:.88rem;margin:18px 0;border-radius:2px}
body.public-page .auth-card a{color:#0e2a52;font-weight:500;
  text-decoration:underline;text-decoration-thickness:1px;
  text-underline-offset:2px}
body.public-page .auth-card a:hover{color:#e8932e}
body.public-page .auth-card .mono,
body.public-page .auth-card .auth-hint{color:#4a5570;font-size:.82rem;
  margin-top:14px;line-height:1.5}

/* Footer (public pages) */
body.public-page footer,
body.public-page .site-foot{background:#0e2a52;color:#cfd8e8;
  padding:40px 0;border-top:6px solid #e8932e;margin-top:0}
body.public-page footer .wrap{max-width:1200px;margin:0 auto;padding:0 32px}
body.public-page footer a{color:#f4a13b;text-decoration:none}
body.public-page footer a:hover{text-decoration:underline}

/* Mobile adjustments for public-page */
@media (max-width:720px){
  body.public-page .gov-strip{font-size:.7rem;padding:7px 0}
  body.public-page .gov-strip .wrap{padding:0 18px}
  body.public-page .head-inner{padding:14px 18px;flex-wrap:wrap;gap:14px}
  body.public-page .nav{flex-wrap:wrap;gap:14px;font-size:.82rem;
    width:100%;justify-content:flex-start}
  body.public-page .nav a:not(.nav-cta):not(.nav-login){display:none}
  body.public-page .hero{padding:50px 0 60px}
  body.public-page .hero-inner{padding:0 18px}
  body.public-page .hero-foot{display:none}
  body.public-page section{padding:48px 0}
  body.public-page section .wrap{padding:0 18px}
  body.public-page .card-grid,
  body.public-page .pillars,
  body.public-page .footprint,
  body.public-page .stats-grid{grid-template-columns:1fr;gap:0;
    border-left:none;border-top:1px solid #d9deea}
  body.public-page .stats-grid{padding:0 18px}
  body.public-page .auth-card{padding:28px 22px}
  body.public-page .auth-tabs{margin:0 -22px 20px;padding:0 22px}
}

/* ----- Public-page: adapt EXISTING index.php class names to civic look ---- */

/* `.block` is the standard section wrapper in index.php */
body.public-page .block{padding:52px 0;background:#fff;
  border-bottom:1px solid #e5e8ee}
body.public-page .block-alt{background:#f6f8fc}
body.public-page .block .wrap,
body.public-page .block-alt .wrap{max-width:1200px;margin:0 auto;padding:0 32px}

/* Section header (`<div class="sec-head"><span class="sec-no">02</span><h2>…</h2>`) */
body.public-page .sec-head{margin-bottom:24px;display:flex;
  align-items:baseline;gap:18px;flex-wrap:wrap}
body.public-page .sec-no{display:inline-block;background:#0e2a52;
  color:#f4a13b;font-size:.72rem;font-weight:700;letter-spacing:.18em;
  padding:5px 12px;font-family:"Space Mono",monospace}
body.public-page .sec-head h2{margin-bottom:0}

/* Prose body in programme section */
body.public-page .prose-body p{font-size:1rem;line-height:1.6;
  color:#1a1a1a;margin-bottom:.9em;max-width:62ch}

/* Pillars — already styled by .pillars rule above */
body.public-page .pillar h3{font-size:1.12rem;font-weight:700;
  color:#0e2a52;margin-bottom:10px}

/* Datasheet (figures) — convert to civic stats strip */
body.public-page #figures{background:#0e2a52;color:#fff;border-bottom:6px solid #e8932e;
  padding:42px 0}
body.public-page #figures .sec-no{background:#fff;color:#0e2a52}
body.public-page #figures h2{color:#fff}
body.public-page #figures h2::after{background:#f4a13b}
body.public-page #figures .datasheet-note{color:#cfd8e8;font-family:"Space Mono",monospace;
  font-size:.78rem;letter-spacing:.06em;margin-bottom:22px}
body.public-page .datasheet{display:grid;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:24px;
  margin-top:24px}
body.public-page .stat{padding:0}
body.public-page .stat-value{display:flex;align-items:baseline;gap:8px;
  margin-bottom:6px}
body.public-page .stat-value .num{font-size:clamp(1.7rem,3.4vw,2.4rem);
  font-weight:800;color:#f4a13b;letter-spacing:-.02em;line-height:1}
body.public-page .stat-value .unit{font-family:"Space Mono",monospace;
  font-size:.78rem;color:#cfd8e8;font-weight:500}
body.public-page .stat-label{font-size:.72rem;letter-spacing:.12em;
  text-transform:uppercase;color:#cfd8e8;font-weight:500;line-height:1.4}

/* Footprint — convert to structured cards */
body.public-page .footprint{display:grid;
  grid-template-columns:1fr 1fr;gap:36px;border-left:none;margin-top:28px}
body.public-page .fp-statement p.lead{font-size:1.12rem;line-height:1.5;
  color:#0e2a52;font-weight:600;max-width:none}
body.public-page .fp-list{list-style:none;padding:0;margin:0;
  border-left:1px solid #d9deea}
body.public-page .fp-list li{padding:14px 18px;border-bottom:1px solid #d9deea;
  border-top:4px solid transparent}
body.public-page .fp-list li:first-child{border-top:4px solid #0e2a52}
body.public-page .fp-list li .mono{display:inline-block;background:#0e2a52;
  color:#f4a13b;font-size:.66rem;font-weight:700;letter-spacing:.14em;
  padding:3px 8px;margin-bottom:6px;font-family:"Space Mono",monospace}
body.public-page .fp-list li p{margin:0;font-size:.92rem;color:#3a4566}

/* Commitments grid */
body.public-page .commitments{display:grid;
  grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:0;
  margin-top:28px;border-left:1px solid #d9deea}
body.public-page .commitment{padding:20px;border-right:1px solid #d9deea;
  border-bottom:1px solid #d9deea;border-top:4px solid #e8932e;background:#fff}
body.public-page .commitment h3{font-size:.92rem;font-weight:700;
  color:#0e2a52;margin-bottom:8px;letter-spacing:.04em;text-transform:uppercase}
body.public-page .commitment p{font-size:.9rem;color:#3a4566;margin:0}

/* Gallery shots */
body.public-page .gallery{display:grid;
  grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:18px;
  margin-top:28px}
body.public-page .shot{margin:0;background:#fff;border:1px solid #d9deea;
  border-top:4px solid #0e2a52}
body.public-page .shot img{width:100%;height:auto;display:block}
body.public-page .shot figcaption{padding:10px 14px;font-size:.8rem;
  color:#4a5570;font-family:"Space Mono",monospace;background:#f6f8fc;
  border-top:1px solid #d9deea}

/* Secure documents panel */
body.public-page .secure-panel{display:grid;grid-template-columns:1fr 1fr;
  gap:36px;margin-top:22px;align-items:start}
body.public-page .secure-copy p.lead{font-size:1.1rem;line-height:1.5;
  color:#0e2a52;font-weight:600;max-width:none}
body.public-page .secure-copy p.muted{color:#4a5570;font-size:.95rem}
body.public-page .secure-cta{background:#fff;border:1px solid #d9deea;
  border-top:4px solid #e8932e;padding:22px}
body.public-page .secure-cta .btn{display:inline-flex;margin-top:12px}
body.public-page .secure-cta h3{color:#0e2a52;font-size:.96rem;
  margin-bottom:10px;letter-spacing:.04em;text-transform:uppercase}
body.public-page .secure-cta p{font-size:.9rem;color:#3a4566}

/* Contact section */
body.public-page #contact{background:#f6f8fc;padding:52px 0}
body.public-page #contact .wrap{max-width:1200px}
body.public-page .contact-shell{display:grid;grid-template-columns:1fr 1fr;
  gap:36px;margin-top:24px;align-items:start}
body.public-page .contact-intro p{font-size:1.05rem;line-height:1.5;
  color:#0e2a52;font-weight:500;max-width:none}
body.public-page .contact-intro .mono{font-family:"Space Mono",monospace;
  font-size:.8rem;color:#4a5570;margin-top:14px;display:block}
body.public-page .form-row{margin-top:14px}
body.public-page .form-row label{display:block;font-size:.72rem;
  font-weight:600;letter-spacing:.1em;text-transform:uppercase;
  color:#0e2a52;margin-bottom:5px}
body.public-page .form-row input,
body.public-page .form-row textarea,
body.public-page .form-row select{
  width:100%;padding:10px 12px;background:#fff;
  border:2px solid #d9deea;color:#1a1a1a;
  font-size:.94rem;border-radius:2px;font-family:inherit;
  transition:border-color .15s}
body.public-page .form-row input:focus,
body.public-page .form-row textarea:focus,
body.public-page .form-row select:focus{outline:none;border-color:#0e2a52}
body.public-page .form-row textarea{min-height:110px;resize:vertical}
body.public-page .form-submit{margin-top:20px;background:#0e2a52;
  color:#fff;border:2px solid #0e2a52;padding:12px 24px;
  font-size:.92rem;font-weight:600;letter-spacing:.02em;border-radius:2px;
  cursor:pointer;font-family:inherit;transition:all .15s}
body.public-page .form-submit:hover{background:#e8932e;
  border-color:#e8932e;color:#0e2a52}

/* Landing tiles section */
body.public-page .block-tiles{background:#f6f8fc;padding:52px 0;
  border-bottom:1px solid #e5e8ee}
body.public-page .lib-tiles-intro{margin-bottom:18px;color:#3a4566}

/* Healthcheck banner on light pages */
body.public-page .hc-banner{background:#fbe2dd;color:#7a1f12;
  border-left:4px solid #c84637;padding:16px 0}
body.public-page .hc-banner-h{color:#7a1f12}
body.public-page .hc-banner-list li{color:#7a1f12}
body.public-page .hc-banner-note{color:#9a4f44}
body.public-page .hc-ack-btn{background:#fff;color:#7a1f12;
  border:1px solid #c84637}

/* Skip link */
body.public-page .skip{position:absolute;left:-9999px;top:0;
  background:#0e2a52;color:#fff;padding:10px 18px;z-index:9999}
body.public-page .skip:focus{left:18px;top:12px}

/* Footer (existing site-foot class in includes/footer.php) */
body.public-page .site-foot{background:#0e2a52;color:#cfd8e8;
  padding:32px 0;border-top:6px solid #e8932e;font-size:.86rem}
body.public-page .site-foot .wrap{max-width:1200px;margin:0 auto;padding:0 32px;
  display:flex;flex-wrap:wrap;gap:18px;align-items:center;
  justify-content:space-between}
body.public-page .site-foot a{color:#f4a13b;text-decoration:none}
body.public-page .site-foot a:hover{text-decoration:underline}
body.public-page .site-foot .mono{font-family:"Space Mono",monospace;
  font-size:.72rem;color:rgba(207,216,232,.7)}

/* Mobile extra rules */
@media (max-width:720px){
  body.public-page .footprint,
  body.public-page .secure-panel,
  body.public-page .contact-shell{grid-template-columns:1fr;gap:32px}
  body.public-page .sec-head{flex-direction:column;align-items:flex-start;gap:10px}
  body.public-page .datasheet{grid-template-columns:repeat(2,1fr);gap:24px}
}

/* ============================================================
   LIBRARY + ADMIN MODERNISATION (v2.10.1)
   Dark theme stays, but adopts the new navy/gold palette as
   accents to align visually with the public-page civic theme.
   ============================================================ */

/* Library top bar (Programme documents & plans) */
body.lib-body .lib-page-head{background:linear-gradient(135deg,var(--navy),var(--navy-2));
  border-bottom:4px solid var(--signal);padding:24px 0}
body.lib-body .lib-page-head h1{color:#fff;font-size:1.4rem;
  letter-spacing:-.01em;margin-bottom:6px}
body.lib-body .lib-page-head .datasheet-note{color:#cfd8e8;font-size:.78rem}
body.lib-body .lib-page-head .role-badge{background:var(--signal);color:var(--navy);
  font-weight:700;padding:2px 8px;letter-spacing:.06em}

/* Folder bar tabs (the row of folder buttons) */
body.lib-body .folderbar{background:var(--ink-2);border-bottom:1px solid var(--line)}
body.lib-body .folderbar-label{color:var(--muted);font-size:.66rem;letter-spacing:.18em;
  margin-right:14px}
body.lib-body .fb-tab{color:var(--paper);border:1px solid transparent;
  border-bottom:2px solid transparent;transition:all .15s}
body.lib-body .fb-tab:hover{color:var(--signal-bright);border-bottom-color:var(--signal-dim)}
body.lib-body .fb-tab.active{color:var(--signal-bright);
  border-bottom-color:var(--signal);background:var(--signal-dim)}
body.lib-body .fb-count{color:var(--steel);font-family:"Space Mono",monospace}
body.lib-body .fb-tab.active .fb-count{color:var(--signal-bright)}

/* Sidebar + main split: sharper, slightly more contrast */
body.lib-body .lib-side{background:var(--ink-2);border-right:1px solid var(--line)}
body.lib-body .lib-side-header{background:var(--navy);color:#fff;
  border-bottom:3px solid var(--signal);padding:14px 18px}
body.lib-body .lib-side-header h2{color:#fff;font-size:.86rem;
  letter-spacing:.04em}
body.lib-body .lib-side-header .side-count{color:#cfd8e8;font-size:.7rem}
body.lib-body .side-list a,
body.lib-body .side-list li{transition:background .12s}
body.lib-body .side-list a:hover{background:rgba(232,147,46,.05);
  border-left:2px solid var(--signal)}

/* Document content panels */
body.lib-body .lib-main-head h1{color:var(--paper);font-size:1.55rem;
  letter-spacing:-.01em}
body.lib-body .lib-main-head h1::after{content:"";display:block;width:48px;
  height:3px;background:var(--signal);margin-top:10px}

/* Tables (user-table on admin, folder lists, etc.) — modern accent */
body.lib-body .user-table thead{background:var(--navy);border-bottom:2px solid var(--signal)}
body.lib-body .user-table thead th{color:#fff;font-weight:600;letter-spacing:.06em}
body.lib-body .user-table td{padding:14px 16px;border-bottom:1px solid var(--line-soft);
  transition:background .12s}
body.lib-body .user-table tr:hover{background:rgba(232,147,46,.04)}
body.lib-body .role-badge{padding:3px 10px;border-radius:2px;font-weight:600;
  letter-spacing:.06em;font-size:.7rem}
body.lib-body .role-admin{background:var(--signal);color:var(--navy)}
body.lib-body .role-member{background:var(--steel);color:var(--ink)}
body.lib-body .role-partner{background:#5a6b85;color:#fff}

/* Buttons inside bright work pages: orange fill, black text (per request) */
body.lib-body .btn,
body.lib-body button.btn{transition:all .15s;letter-spacing:.02em;
  font-weight:600;border-radius:2px;background:var(--signal);color:#000;
  border:1px solid var(--signal)}
body.lib-body .btn-small{padding:7px 14px;font-size:.74rem}
body.lib-body .btn:hover{background:var(--signal-bright);color:#000;
  border-color:var(--signal-bright)}
/* Ghost buttons (e.g. Notes) stay outlined, dark text for contrast */
body.lib-body .btn-ghost{background:transparent;color:var(--paper);
  border:1px solid var(--line)}
body.lib-body .btn-ghost:hover{background:var(--signal-dim);color:#000;
  border-color:var(--signal)}
body.lib-body .nav-cta{background:var(--signal);color:#000 !important;
  border-color:var(--signal);font-weight:700}
body.lib-body .nav-cta:hover{background:var(--signal-bright);color:#000 !important;
  border-color:var(--signal-bright)}
/* Admin link in the bright top bar — make it a readable orange-outlined pill */
body.lib-body .site-head .nav-admin{color:var(--signal) !important;
  border-color:var(--signal-dim);font-weight:600}
body.lib-body .site-head .nav-admin:hover{color:#000 !important;
  background:var(--signal);border-color:var(--signal)}

/* Admin tools row */
body.lib-body .admin-tools{padding:18px 0;border-top:1px solid var(--line-soft);
  border-bottom:1px solid var(--line-soft);display:flex;flex-wrap:wrap;
  gap:8px;align-items:center;margin-bottom:24px}
body.lib-body .admin-tools::before{content:"TOOLS";font-family:"Space Mono",monospace;
  font-size:.66rem;letter-spacing:.2em;color:var(--muted);margin-right:14px}

/* Profile section headers, admin section headers */
body.lib-body .profile-section-h{color:var(--signal);
  border-bottom:1px solid var(--line-soft);padding-bottom:10px;margin-bottom:18px}

/* Forms in admin/profile */
body.lib-body input[type="text"],
body.lib-body input[type="email"],
body.lib-body input[type="password"],
body.lib-body input[type="number"],
body.lib-body select,
body.lib-body textarea{background:var(--ink);border:1px solid var(--line);
  color:var(--paper);padding:10px 14px;border-radius:2px;
  font-family:"Space Mono",monospace;font-size:.88rem;
  transition:border-color .15s}
body.lib-body input:focus,
body.lib-body select:focus,
body.lib-body textarea:focus{outline:none;border-color:var(--signal);
  box-shadow:0 0 0 1px var(--signal-dim)}

/* Tighter dashboard / admin spacing (consistent with public tightening) */
body.lib-body main.wrap{padding-top:24px}
body.lib-body section{margin-bottom:32px}
body.lib-body .lib-shell{padding-top:0}

/* Healthcheck banner — already has its own style. Refine for admin context */
body.lib-body .hc-banner{background:linear-gradient(90deg,#3a1410,#4a1a14);
  border-left:4px solid #c84637;color:#ffe5e0;padding:14px 0}
body.lib-body .hc-banner-h{color:#fff;letter-spacing:.02em}

/* Viewer (view.php) chrome — modernise the title bar */
body.lib-body .viewer-bar{background:var(--navy);border-bottom:3px solid var(--signal);
  padding:16px 0}
body.lib-body .viewer-title{color:#fff;font-weight:700;letter-spacing:-.01em}
body.lib-body .viewer-desc{color:#cfd8e8}
body.lib-body .viewer-crumb{color:rgba(207,216,232,.7)}

/* Site head on bright work pages — light bar, dark text, navy accent line */
body.lib-body .site-head{border-bottom:1px solid var(--line);
  background:rgba(251,250,246,.94);backdrop-filter:blur(8px)}
body.lib-body .site-head .nav a{color:var(--paper)}
body.lib-body .site-head .nav-user{color:var(--paper);font-weight:600}
body.lib-body .site-head .brand-text strong{color:var(--paper)}
body.lib-body .site-head .brand-text em{color:var(--muted)}
body.lib-body .brand-mark .rail{background:var(--signal)}

/* Make the deploy label, when shown, less prominent */
body.lib-body p.mono.muted[style*="font-size:.65rem"]{
  border-top:1px solid var(--line-soft);margin-top:32px;padding-top:18px}

/* ----- Public-page: live network map CTA section ----- */
body.public-page .block-networkcta{background:#fff;padding:52px 0;
  border-bottom:1px solid #e5e8ee}
body.public-page .networkcta-panel{display:grid;grid-template-columns:1.4fr 1fr;
  gap:36px;margin-top:24px;align-items:start}
body.public-page .networkcta-copy p.lead{font-size:1.1rem;line-height:1.5;
  color:#0e2a52;font-weight:600;max-width:none;margin-bottom:.6em}
body.public-page .networkcta-copy p.muted{color:#4a5570;font-size:.95rem;
  margin-bottom:1.2em}
body.public-page .networkcta-side{display:flex;flex-direction:column;gap:0;
  border-left:1px solid #d9deea}
body.public-page .networkcta-tile{display:block;text-decoration:none;
  padding:16px 20px;border-bottom:1px solid #d9deea;border-top:4px solid transparent;
  background:#fff;transition:background .15s,border-color .15s}
body.public-page .networkcta-tile:first-child{border-top:4px solid #0e2a52}
body.public-page .networkcta-tile:hover{background:#f6f8fc}
body.public-page .networkcta-tile strong{display:block;color:#0e2a52;
  font-size:1rem;font-weight:700;margin-bottom:3px}
body.public-page .networkcta-tile span{display:block;color:#4a5570;font-size:.84rem}
@media (max-width:720px){
  body.public-page .networkcta-panel{grid-template-columns:1fr;gap:24px}
  body.public-page .networkcta-side{border-left:none;
    border-top:1px solid #d9deea}
}

/* =========================================================================
   LIBRARY TAB BAR — shared across documents.php + network/*.php pages
   ========================================================================= */
body.lib-body .lib-tabbar{background:var(--ink-2);border-bottom:1px solid var(--line);
  position:sticky;top:0;z-index:30}
body.lib-body .lib-tabbar-inner{display:flex;flex-wrap:wrap;align-items:stretch;
  padding:0;gap:0}
body.lib-body .lib-tab{display:inline-flex;align-items:center;
  padding:14px 22px;font-size:.84rem;font-weight:600;letter-spacing:.04em;
  text-decoration:none;color:var(--paper);
  border-bottom:3px solid transparent;
  transition:color .12s,border-color .12s,background .12s}
body.lib-body .lib-tab:hover{color:var(--signal-bright);background:var(--signal-dim)}
body.lib-body .lib-tab.active{color:var(--signal-bright);
  border-bottom-color:var(--signal);background:var(--signal-dim)}

/* Mobile: tabs become a horizontal-scroll strip so a phone can still
   reach all six without wrapping into a six-line stack */
@media (max-width:720px){
  body.lib-body .lib-tabbar-inner{flex-wrap:nowrap;overflow-x:auto;
    -webkit-overflow-scrolling:touch}
  body.lib-body .lib-tab{padding:12px 16px;font-size:.78rem;flex:0 0 auto}
}

/* =========================================================================
   NETWORK PAGE PALETTE OVERRIDES — light touch only, layout untouched
   The network viewer ships its own CSS at /network/assets/css/style.css
   which is loaded by network/includes/header.php. We DON'T load this main
   style.css there — the rules below apply only when the network pages
   are embedded into the library shell (the integrated approach).
   ========================================================================= */
body.lib-body .net-shell{padding:24px 0 60px}
body.lib-body .net-shell h1{color:var(--paper);font-size:1.4rem;
  letter-spacing:-.005em;margin-bottom:6px}
body.lib-body .net-shell .lede{color:var(--muted);font-size:.92rem;
  margin-bottom:18px}
body.lib-body .net-shell .stat-cards{display:grid;
  grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:14px;
  margin:18px 0 24px}
body.lib-body .net-shell .stat-card{background:var(--ink-2);
  border:1px solid var(--line);border-top:3px solid var(--signal);
  padding:18px;font-size:.78rem;color:var(--muted);letter-spacing:.06em;
  text-transform:uppercase}
body.lib-body .net-shell .stat-card .big{display:block;font-size:1.8rem;
  font-weight:700;color:var(--signal-bright);letter-spacing:-.01em;
  font-family:"Inter",sans-serif;margin-bottom:4px;text-transform:none}
body.lib-body .net-shell .filter-bar{display:flex;gap:10px;flex-wrap:wrap;
  background:var(--ink-2);border:1px solid var(--line);padding:14px;
  margin-bottom:18px}
body.lib-body .net-shell .filter-bar input,
body.lib-body .net-shell .filter-bar select{background:var(--ink);
  border:1px solid var(--line);color:var(--paper);padding:8px 12px;
  font-size:.84rem;font-family:"Inter",sans-serif;border-radius:2px}
body.lib-body .net-shell .filter-bar button{background:var(--signal);
  color:var(--navy);border:none;padding:8px 18px;font-size:.84rem;
  font-weight:600;letter-spacing:.02em;cursor:pointer;border-radius:2px}
body.lib-body .net-shell .filter-bar button:hover{background:var(--signal-bright)}
body.lib-body .net-shell .clear-link{color:var(--muted);text-decoration:none;
  align-self:center;font-size:.82rem}
body.lib-body .net-shell .clear-link:hover{color:var(--signal-bright)}
body.lib-body .net-shell .result-count{font-size:.82rem;color:var(--muted);
  margin-bottom:14px}
body.lib-body .net-shell .data-table{width:100%;border-collapse:collapse;
  background:var(--ink-2);border:1px solid var(--line);font-size:.86rem}
body.lib-body .net-shell .data-table thead{background:var(--navy);
  border-bottom:2px solid var(--signal)}
body.lib-body .net-shell .data-table th{color:#fff;text-align:left;
  padding:10px 14px;font-size:.74rem;letter-spacing:.06em;font-weight:600}
body.lib-body .net-shell .data-table td{padding:10px 14px;
  border-bottom:1px solid var(--line-soft);color:var(--paper)}
body.lib-body .net-shell .data-table tr:hover td{background:rgba(232,147,46,.04)}
body.lib-body .net-shell .data-table .mono{font-family:"Space Mono",monospace;
  font-size:.78rem;color:var(--steel)}
body.lib-body .net-shell .data-table .num{text-align:right;
  font-family:"Inter",sans-serif;font-variant-numeric:tabular-nums}
body.lib-body .net-shell .data-table .small{font-size:.78rem}
body.lib-body .net-shell .pill{display:inline-block;padding:2px 8px;
  font-size:.7rem;font-weight:700;letter-spacing:.04em;border-radius:2px;
  background:var(--navy);color:#cfd8e8}
body.lib-body .net-shell .pill-NSW{background:#4A89C7;color:#fff}
body.lib-body .net-shell .pill-VIC{background:#7AB85F;color:#fff}
body.lib-body .net-shell .pill-QLD{background:#E8923A;color:#0e2a52}
body.lib-body .net-shell .pill-WA{background:#D6585F;color:#fff}
body.lib-body .net-shell .pill-SA{background:#B569C2;color:#fff}
body.lib-body .net-shell .pill-NT{background:#E8C570;color:#0e2a52}
body.lib-body .net-shell .pill-TAS{background:#5FB5B5;color:#fff}
body.lib-body .net-shell .pill-ACT{background:#A7C957;color:#0e2a52}
body.lib-body .net-shell .pill-TJ{background:#cfd8e8;color:#0e2a52}
body.lib-body .net-shell .wave-badge{display:inline-block;padding:2px 8px;
  font-size:.7rem;font-weight:700;border-radius:2px;background:var(--steel);
  color:var(--ink)}
body.lib-body .net-shell .wave-badge.w6{background:#FFD580;color:#0e2a52}
body.lib-body .net-shell .wave-badge.w61{background:#FF9F40;color:#0e2a52}
body.lib-body .net-shell .wave-badge.w62{background:#9D6BFF;color:#fff}
body.lib-body .net-shell .wave-badge.w63{background:#FF4D6D;color:#fff}
body.lib-body .net-shell .role-tag{display:inline-block;padding:3px 9px;
  font-size:.72rem;font-weight:600;border-radius:2px;
  background:var(--navy);color:#cfd8e8;letter-spacing:.04em}
body.lib-body .net-shell .role-capital{background:var(--signal);color:var(--navy)}
body.lib-body .net-shell .role-mfg{background:var(--steel);color:var(--ink)}
body.lib-body .net-shell .role-integration{background:#9D6BFF;color:#fff}
body.lib-body .net-shell .role-station{background:#1f3a78;color:#cfd8e8}
body.lib-body .net-shell .note{background:rgba(232,147,46,.06);
  border-left:3px solid var(--signal);padding:14px 18px;font-size:.88rem;
  color:var(--paper);line-height:1.55}
body.lib-body .net-shell .muted{color:var(--muted)}

/* Map page layout — keep the viewer's 3-column structure, restyle chrome */
body.lib-body .net-map-layout{display:grid;
  grid-template-columns:240px 1fr 320px;gap:14px;
  height:calc(100vh - 200px);min-height:600px}
body.lib-body .net-map-layout .map-controls,
body.lib-body .net-map-layout .map-inspector{
  background:var(--ink-2);border:1px solid var(--line);padding:14px;
  overflow:auto;font-size:.84rem}
body.lib-body .net-map-layout .map-controls h3{font-size:.7rem;
  letter-spacing:.14em;text-transform:uppercase;color:var(--muted);
  margin:14px 0 8px;font-weight:600}
body.lib-body .net-map-layout .map-controls h3:first-child{margin-top:0}
body.lib-body .net-map-layout .btn-row,
body.lib-body .net-map-layout .btn-grid{display:flex;flex-wrap:wrap;gap:4px;
  margin-bottom:6px}
body.lib-body .net-map-layout .btn-grid{display:grid;
  grid-template-columns:repeat(3,1fr)}
body.lib-body .net-map-layout .map-controls button{background:var(--ink-2);
  color:var(--paper);border:1px solid var(--line);padding:6px 10px;
  font-size:.76rem;font-weight:600;cursor:pointer;border-radius:2px;
  transition:all .12s}
body.lib-body .net-map-layout .map-controls button:hover{
  border-color:var(--signal);color:var(--signal-bright)}
body.lib-body .net-map-layout .map-controls button.active{
  background:var(--signal);color:var(--navy);border-color:var(--signal)}
body.lib-body .net-map-layout .map-controls label{display:flex;
  align-items:center;gap:8px;font-size:.82rem;color:var(--paper);
  padding:4px 0;cursor:pointer}
body.lib-body .net-map-layout .map-controls input[type="checkbox"]{accent-color:var(--signal)}
body.lib-body .net-map-layout .map-stage{background:#06101C;
  border:1px solid var(--line);overflow:hidden;position:relative;
  cursor:grab}
body.lib-body .net-map-layout .map-stage:active{cursor:grabbing}
body.lib-body .net-map-layout .map-stage svg{width:100%;height:100%;
  display:block;transform-origin:0 0;transition:transform .15s ease-out}
body.lib-body .net-map-layout .map-inspector .search-box input{width:100%;
  background:var(--ink);border:1px solid var(--line);color:var(--paper);
  padding:9px 12px;font-size:.86rem;border-radius:2px;margin-bottom:8px}
body.lib-body .net-map-layout .map-inspector .hint{font-size:.74rem;
  color:var(--muted);margin-bottom:10px}
body.lib-body .net-map-layout .map-inspector kbd{background:var(--ink-2);
  border:1px solid var(--line);padding:1px 6px;font-size:.74rem;
  border-radius:2px;color:var(--signal-bright);font-family:"Space Mono",monospace}
body.lib-body .net-map-layout .results,
body.lib-body .net-map-layout .inspector{margin-top:10px}
body.lib-body .net-map-layout .results .row{padding:6px 8px;cursor:pointer;
  border-radius:2px;font-size:.82rem;color:var(--paper)}
body.lib-body .net-map-layout .results .row:hover{background:rgba(232,147,46,.06)}
body.lib-body .map-tip{position:fixed;background:var(--navy);color:#fff;
  padding:8px 12px;font-size:.78rem;pointer-events:none;border-radius:2px;
  box-shadow:0 6px 18px rgba(0,0,0,.4);z-index:100;display:none;
  border:1px solid var(--signal-dim);max-width:280px;line-height:1.4}
@media (max-width:1000px){
  body.lib-body .net-map-layout{grid-template-columns:1fr;height:auto}
  body.lib-body .net-map-layout .map-stage{height:60vh}
}

/* =========================================================================
   LIBRARY SUB-TABBAR (v2.13.0)
   Second level of nav under "Network Map" top tab.
   Visually subordinate to .lib-tabbar — slightly smaller, thinner.
   ========================================================================= */
body.lib-body .lib-subtabbar{background:#0b0e12;border-bottom:1px solid var(--line-soft);
  position:sticky;top:51px;z-index:29}
body.lib-body .lib-subtabbar-inner{display:flex;flex-wrap:wrap;align-items:center;
  padding:0;gap:0}
body.lib-body .lib-subtab-label{display:inline-flex;align-items:center;
  padding:10px 16px 10px 0;font-size:.7rem;letter-spacing:.14em;
  text-transform:uppercase;color:var(--muted);
  border-bottom:2px solid transparent}
body.lib-body .lib-subtab{display:inline-flex;align-items:center;
  padding:10px 18px;font-size:.78rem;font-weight:500;letter-spacing:.02em;
  text-decoration:none;color:var(--steel);
  border-bottom:2px solid transparent;
  transition:color .12s,border-color .12s,background .12s}
body.lib-body .lib-subtab:hover{color:var(--paper);background:rgba(232,147,46,.03)}
body.lib-body .lib-subtab.active{color:var(--signal-bright);
  border-bottom-color:var(--signal);background:rgba(232,147,46,.05)}

/* Mobile — sub-tabs scroll horizontally if needed */
@media (max-width:720px){
  body.lib-body .lib-subtabbar{top:43px}
  body.lib-body .lib-subtabbar-inner{flex-wrap:nowrap;overflow-x:auto;
    -webkit-overflow-scrolling:touch}
  body.lib-body .lib-subtab-label{display:none}
  body.lib-body .lib-subtab{padding:9px 14px;font-size:.74rem;flex:0 0 auto}
}

/* =========================================================================
   FOOTPRINT PER-JURISDICTION TABLE (public landing, v2.13.1)
   Lives on the public-page light theme (cream/navy/gold).
   ========================================================================= */
.public-page .fp-table{width:100%;border-collapse:collapse;margin:20px 0 28px;
  background:#fff;border:1px solid #d8d3c6;font-size:.92rem;
  font-family:"Public Sans",system-ui,sans-serif}
.public-page .fp-table thead{background:#0e2a52;color:#fff}
.public-page .fp-table thead th{padding:11px 14px;text-align:left;
  font-size:.74rem;letter-spacing:.08em;text-transform:uppercase;font-weight:600;
  border-bottom:3px solid #e8932e}
.public-page .fp-table thead th.num{text-align:right}
.public-page .fp-table tbody td{padding:10px 14px;border-bottom:1px solid #ece7da;
  color:#1a1d22}
.public-page .fp-table tbody tr:hover td{background:#faf5e8}
.public-page .fp-table td.num{text-align:right;font-variant-numeric:tabular-nums;
  font-weight:500}
.public-page .fp-table tfoot{background:#faf5e8;border-top:2px solid #0e2a52;
  font-weight:600}
.public-page .fp-table tfoot th,
.public-page .fp-table tfoot td{padding:11px 14px;font-size:.94rem;
  color:#0e2a52}
.public-page .fp-table tfoot td.num{text-align:right;font-variant-numeric:tabular-nums}

/* Jurisdiction pills (public theme) — coordinated with map pill palette */
.public-page .fp-pill{display:inline-block;padding:2px 8px;font-size:.7rem;
  font-weight:700;letter-spacing:.04em;border-radius:2px;
  background:#0e2a52;color:#fff;margin-right:6px;min-width:38px;text-align:center;
  font-family:"Public Sans",system-ui,sans-serif}
.public-page .fp-pill-NSW{background:#4A89C7;color:#fff}
.public-page .fp-pill-VIC{background:#7AB85F;color:#fff}
.public-page .fp-pill-QLD{background:#E8923A;color:#fff}
.public-page .fp-pill-WA {background:#D6585F;color:#fff}
.public-page .fp-pill-SA {background:#B569C2;color:#fff}
.public-page .fp-pill-NT {background:#C29A2B;color:#fff}
.public-page .fp-pill-TAS{background:#5FB5B5;color:#fff}
.public-page .fp-pill-ACT{background:#7A9C3A;color:#fff}
.public-page .fp-pill-TJ {background:#3a3f48;color:#fff}

/* Mobile — collapse wider columns gracefully */
@media (max-width:600px){
  .public-page .fp-table{font-size:.85rem}
  .public-page .fp-table thead th,
  .public-page .fp-table tbody td,
  .public-page .fp-table tfoot th,
  .public-page .fp-table tfoot td{padding:8px 10px}
}

/* =========================================================================
   JURISDICTIONS PAGE (v2.14.0)
   Overview grid of 9 cards + detail-page styling.
   ========================================================================= */
body.lib-body .juris-grid{display:grid;
  grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:14px;
  margin:18px 0 4px}
body.lib-body .juris-card{display:block;text-decoration:none;
  background:var(--ink-2);border:1px solid var(--line);border-top:3px solid var(--steel);
  padding:18px 20px 16px;transition:transform .12s,border-color .12s,background .12s;
  color:var(--paper)}
body.lib-body .juris-card:hover{transform:translateY(-2px);
  background:#13171c;border-color:rgba(232,147,46,.4)}
body.lib-body .juris-card-head{display:flex;align-items:center;gap:12px;
  margin-bottom:14px}
body.lib-body .juris-card-code{display:inline-flex;align-items:center;justify-content:center;
  padding:3px 10px;font-size:.78rem;font-weight:700;letter-spacing:.06em;
  border-radius:2px;min-width:40px;font-family:"Inter",sans-serif}
body.lib-body .juris-card-head h3{font-size:1.02rem;color:var(--paper);
  font-weight:600;margin:0;letter-spacing:-.005em}
body.lib-body .juris-card-stats{display:grid;grid-template-columns:repeat(3,1fr);
  gap:8px;margin:0 0 12px;padding:0}
body.lib-body .juris-card-stats > div{display:flex;flex-direction:column;gap:2px}
body.lib-body .juris-card-stats dt{font-size:.68rem;color:var(--muted);
  letter-spacing:.08em;text-transform:uppercase;margin:0;font-weight:500}
body.lib-body .juris-card-stats dd{font-size:1.15rem;color:var(--signal-bright);
  font-weight:700;margin:0;letter-spacing:-.01em;font-variant-numeric:tabular-nums}
body.lib-body .juris-card-stats dd .unit{font-size:.7rem;font-weight:500;
  color:var(--muted);margin-left:3px}
body.lib-body .juris-card-cta{font-size:.78rem;color:var(--signal-bright);
  margin:0;font-weight:600;letter-spacing:.02em}
body.lib-body .juris-card:hover .juris-card-cta{color:var(--signal)}

/* "Open in main map" call-to-action */
body.lib-body .btn-juris-mapview{display:inline-block;padding:9px 18px;
  background:var(--signal);color:var(--navy);text-decoration:none;
  font-size:.84rem;font-weight:600;letter-spacing:.02em;border-radius:2px;
  transition:background .12s;margin-bottom:14px}
body.lib-body .btn-juris-mapview:hover{background:var(--signal-bright)}

/* =========================================================================
   BROADMEADOW MASTERPLAN landing section (v2.14.3)
   Public theme. Inline slide viewer (stage + thumbnail strip) replaces the
   prior cover thumbnail. Click stage → lightbox. Download still available
   in detail row below.
   ========================================================================= */

.public-page .bmp-lead{font-size:1.2rem;line-height:1.5;color:#0e2a52;
  font-weight:500;letter-spacing:-.005em;margin:14px 0 22px;max-width:880px}

/* ----- Inline viewer ----- */
.public-page .bmp-viewer{margin:0 0 28px;background:#0a1424;
  border:1px solid #d8d3c6;overflow:hidden;
  box-shadow:0 6px 18px rgba(14,42,82,.10)}
.public-page .bmp-stage{position:relative;background:#0a1424;
  aspect-ratio:16/9;display:flex;align-items:center;justify-content:center;
  overflow:hidden}
.public-page .bmp-stage img{display:block;width:100%;height:100%;
  object-fit:contain;cursor:zoom-in;transition:opacity .15s}
.public-page .bmp-stage img:hover{opacity:.96}

.public-page .bmp-nav{position:absolute;top:50%;transform:translateY(-50%);
  background:rgba(14,42,82,.7);color:#fff;border:none;
  width:44px;height:64px;font-size:2rem;line-height:1;cursor:pointer;
  display:flex;align-items:center;justify-content:center;
  transition:background .12s;font-family:Georgia,serif;z-index:2}
.public-page .bmp-nav:hover{background:#e8932e;color:#0e2a52}
.public-page .bmp-nav.bmp-prev{left:0}
.public-page .bmp-nav.bmp-next{right:0}
.public-page .bmp-counter{position:absolute;bottom:14px;left:50%;
  transform:translateX(-50%);background:rgba(14,42,82,.85);color:#fff;
  padding:6px 14px;font-size:.78rem;letter-spacing:.08em;z-index:2;
  border-radius:2px}
.public-page .bmp-expand{position:absolute;top:14px;right:14px;
  background:rgba(14,42,82,.7);color:#fff;border:none;
  width:36px;height:36px;font-size:1.2rem;cursor:pointer;border-radius:2px;
  transition:background .12s;z-index:2}
.public-page .bmp-expand:hover{background:#e8932e;color:#0e2a52}

/* ----- Thumbnail strip ----- */
.public-page .bmp-thumbs{display:flex;gap:6px;padding:10px;
  background:#06101C;overflow-x:auto;scrollbar-width:thin;
  -webkit-overflow-scrolling:touch}
.public-page .bmp-thumb{position:relative;flex:0 0 auto;width:88px;height:50px;
  padding:0;border:2px solid transparent;background:#0a1424;cursor:pointer;
  overflow:hidden;transition:border-color .12s,transform .12s}
.public-page .bmp-thumb img{width:100%;height:100%;object-fit:cover;display:block;
  opacity:.65;transition:opacity .12s}
.public-page .bmp-thumb:hover img{opacity:.9}
.public-page .bmp-thumb.active{border-color:#e8932e}
.public-page .bmp-thumb.active img{opacity:1}
.public-page .bmp-thumb-num{position:absolute;bottom:2px;right:4px;
  font-size:.66rem;color:#fff;background:rgba(14,42,82,.85);
  padding:1px 5px;border-radius:1px;font-family:"Space Mono",monospace;
  font-weight:500}

/* ----- Detail row: copy + stats side by side ----- */
.public-page .bmp-detail{display:grid;grid-template-columns:1.4fr 1fr;
  gap:32px;align-items:start}
@media (max-width:860px){
  .public-page .bmp-detail{grid-template-columns:1fr;gap:22px}
}

.public-page .bmp-detail-copy p{color:#1a1d22;font-size:.98rem;
  line-height:1.6;margin-bottom:16px}
.public-page .bmp-detail-copy p:last-of-type{margin-bottom:18px}

/* Stats — fixed 2-column for balance with 8 entries; 1-column on mobile */
.public-page .bmp-stats{display:grid;grid-template-columns:1fr 1fr;
  gap:10px 22px;margin:0;padding:20px 22px;
  background:#fff;border:1px solid #ece7da;border-left:3px solid #e8932e}
.public-page .bmp-stats > div{display:flex;flex-direction:column;gap:2px;
  padding:4px 0;border-bottom:1px dotted #ece7da}
.public-page .bmp-stats > div:nth-last-child(-n+2){border-bottom:none}
.public-page .bmp-stats dt{font-size:.7rem;letter-spacing:.08em;
  text-transform:uppercase;color:#6b6557;font-weight:600;margin:0}
.public-page .bmp-stats dd{font-size:1.05rem;color:#0e2a52;font-weight:700;
  margin:0;font-variant-numeric:tabular-nums}
@media (max-width:520px){
  .public-page .bmp-stats{grid-template-columns:1fr}
  .public-page .bmp-stats > div:nth-last-child(-n+2){border-bottom:1px dotted #ece7da}
  .public-page .bmp-stats > div:last-child{border-bottom:none}
}

.public-page .bmp-actions{display:flex;flex-wrap:wrap;align-items:center;
  gap:14px;margin:0}
.public-page .bmp-filesize{font-size:.8rem;font-weight:500;color:#faf5e8;
  opacity:.85;margin-left:4px}
.public-page .bmp-meta{font-size:.78rem;color:#6b6557;letter-spacing:.06em}

/* ----- Lightbox modal ----- */
.public-page .bmp-lightbox{display:none;position:fixed;inset:0;
  background:rgba(6,16,28,.95);z-index:10000;align-items:center;
  justify-content:center;padding:30px}
.public-page .bmp-lightbox.open{display:flex}
.public-page .bmp-lightbox img{max-width:96%;max-height:90vh;
  object-fit:contain;box-shadow:0 20px 60px rgba(0,0,0,.6)}
.public-page .bmp-lightbox-close{position:absolute;top:20px;right:24px;
  background:none;border:none;color:#fff;font-size:2.4rem;line-height:1;
  cursor:pointer;padding:6px 10px;font-family:Georgia,serif}
.public-page .bmp-lightbox-close:hover{color:#e8932e}
.public-page .bmp-lightbox-nav{position:absolute;top:50%;
  transform:translateY(-50%);background:rgba(14,42,82,.6);color:#fff;
  border:none;width:60px;height:80px;font-size:2.6rem;line-height:1;
  cursor:pointer;font-family:Georgia,serif;transition:background .12s}
.public-page .bmp-lightbox-nav:hover{background:#e8932e;color:#0e2a52}
.public-page .bmp-lightbox-prev{left:20px}
.public-page .bmp-lightbox-next{right:20px}
.public-page .bmp-lightbox-counter{position:absolute;bottom:24px;left:50%;
  transform:translateX(-50%);background:rgba(14,42,82,.85);color:#fff;
  padding:8px 18px;font-size:.86rem;letter-spacing:.08em;border-radius:2px}

@media (max-width:680px){
  .public-page .bmp-nav{width:36px;height:50px;font-size:1.5rem}
  .public-page .bmp-thumb{width:72px;height:40px}
  .public-page .bmp-lightbox-nav{width:44px;height:60px;font-size:1.8rem}
}

/* =========================================================================
   JURISDICTION FOCUSED MAP (v2.14.1)
   Embeds the full national SVG zoomed to one state, dims everything that
   doesn't carry data-juris=<selected>. The wrapper sets a data-juris
   attribute so descendant selectors can target by current state.
   ========================================================================= */
body.lib-body .juris-map-wrap{background:#06101C;border:1px solid var(--line);
  padding:14px;margin-bottom:12px}
body.lib-body .juris-map-stage{background:#06101C;overflow:hidden;
  max-height:560px}
body.lib-body .juris-map-stage svg{display:block;width:100%;height:auto;
  max-height:520px}

/* Dim everything NOT carrying the focused jurisdiction's data-juris */
body.lib-body .juris-map-wrap[data-juris="NSW"] svg [data-juris]:not([data-juris="NSW"]),
body.lib-body .juris-map-wrap[data-juris="VIC"] svg [data-juris]:not([data-juris="VIC"]),
body.lib-body .juris-map-wrap[data-juris="QLD"] svg [data-juris]:not([data-juris="QLD"]),
body.lib-body .juris-map-wrap[data-juris="WA"]  svg [data-juris]:not([data-juris="WA"]),
body.lib-body .juris-map-wrap[data-juris="SA"]  svg [data-juris]:not([data-juris="SA"]),
body.lib-body .juris-map-wrap[data-juris="NT"]  svg [data-juris]:not([data-juris="NT"]),
body.lib-body .juris-map-wrap[data-juris="TAS"] svg [data-juris]:not([data-juris="TAS"]),
body.lib-body .juris-map-wrap[data-juris="ACT"] svg [data-juris]:not([data-juris="ACT"]),
body.lib-body .juris-map-wrap[data-juris="TJ"]  svg [data-juris]:not([data-juris="TJ"]){
  opacity:0.18;
}

/* Hide labels group on focused maps so they don't crowd a small viewBox */
body.lib-body .juris-map-wrap[data-juris="ACT"] svg #labels,
body.lib-body .juris-map-wrap[data-juris="TAS"] svg #labels{
  opacity:0.35;
}

body.lib-body .juris-map-legend{display:flex;align-items:center;gap:10px;
  font-size:.74rem;color:var(--muted);margin:10px 0 0;flex-wrap:wrap}
body.lib-body .juris-map-legend .dot{display:inline-block;width:12px;height:4px;
  border-radius:1px;margin-right:4px;vertical-align:middle}
body.lib-body .juris-map-legend .dot-dim{background:var(--muted);opacity:0.4}
body.lib-body .juris-map-legend .sep{color:var(--line);margin:0 4px}

/* =========================================================================
   COLLAPSIBLE TREE (v2.14.4) — native <details>/<summary>
   Used on Route Register, Station Index, and Jurisdictions detail.
   ========================================================================= */
body.lib-body .tree{margin:14px 0 24px}
body.lib-body .tree details{background:var(--ink-2);border:1px solid var(--line);
  margin-bottom:8px;overflow:hidden}
body.lib-body .tree details[open]{border-color:rgba(232,147,46,.45);
  box-shadow:0 0 0 1px rgba(232,147,46,.08) inset}

body.lib-body .tree summary{cursor:pointer;padding:11px 14px 11px 38px;
  list-style:none;position:relative;font-family:"Inter",sans-serif;
  font-size:.88rem;color:var(--paper);user-select:none;
  display:flex;align-items:center;gap:12px;background:#13171c;
  transition:background .12s;border-bottom:1px solid transparent}
body.lib-body .tree summary:hover{background:#181c22}
body.lib-body .tree details[open] > summary{
  border-bottom-color:var(--line);background:var(--ink-2)}

/* Custom disclosure indicator */
body.lib-body .tree summary::-webkit-details-marker{display:none}
body.lib-body .tree summary::before{content:"";position:absolute;left:14px;
  top:50%;width:0;height:0;border-style:solid;
  border-width:5px 0 5px 8px;
  border-color:transparent transparent transparent var(--signal-bright);
  transform:translateY(-50%);transition:transform .15s}
body.lib-body .tree details[open] > summary::before{
  transform:translateY(-50%) rotate(90deg)}

/* Nested level offset + smaller text */
body.lib-body .tree details details{margin:0;border:none;
  border-top:1px solid var(--line-soft);background:#0d1014}
body.lib-body .tree details details > summary{padding-left:54px;
  font-size:.82rem;background:#0d1014;font-weight:500;color:var(--paper)}
body.lib-body .tree details details > summary::before{left:30px;
  border-left-color:var(--steel)}
body.lib-body .tree details details > summary:hover{background:#10141a}
body.lib-body .tree details details[open] > summary{
  background:#0d1014;border-bottom-color:var(--line-soft)}

/* Group header pieces */
body.lib-body .tree-code{font-family:"Space Mono",monospace;font-size:.78rem;
  color:var(--signal);font-weight:700;background:rgba(232,147,46,.10);
  padding:2px 8px;border-radius:2px;min-width:42px;text-align:center}
body.lib-body .tree-name{flex:1;font-weight:600;letter-spacing:-.005em}
body.lib-body .tree-counts{font-family:"Space Mono",monospace;font-size:.74rem;
  color:var(--muted);font-weight:500}
body.lib-body .tree-counts strong{color:var(--paper);font-weight:600}

/* Body container — the table or list sits inside */
body.lib-body .tree-body{padding:0;background:var(--ink-2)}
body.lib-body .tree-body > .data-table{margin:0;border:none}
body.lib-body .tree-body > .data-table thead{display:none}  /* parent table has its own header context */
body.lib-body .tree-body > .data-table tbody tr:last-child td{border-bottom:none}
body.lib-body .tree-body > .data-table tbody td{border-color:var(--line-soft)}

/* "Expand all / collapse all" controls */
body.lib-body .tree-controls{display:flex;gap:10px;margin:0 0 10px;
  align-items:center;flex-wrap:wrap}
body.lib-body .tree-controls button{background:var(--ink-2);border:1px solid var(--line);
  color:var(--signal-bright);padding:5px 12px;font-size:.76rem;font-weight:600;
  cursor:pointer;border-radius:2px;font-family:"Inter",sans-serif;
  letter-spacing:.02em;transition:all .12s}
body.lib-body .tree-controls button:hover{border-color:var(--signal);
  background:rgba(232,147,46,.08)}
body.lib-body .tree-controls .tree-controls-meta{color:var(--muted);
  font-size:.78rem;margin-left:auto}

/* Inline route table inside a details body — cell sizes */
body.lib-body .tree-body .data-table th,
body.lib-body .tree-body .data-table td{padding:7px 12px;font-size:.82rem}

/* Empty-state inside a group */
body.lib-body .tree-empty{padding:18px;color:var(--muted);
  text-align:center;font-size:.84rem;font-style:italic}

/* =========================================================================
   STATION STATUS BADGES (v2.14.5 — UPD-008)
   ========================================================================= */
body.lib-body .status-badge{display:inline-block;padding:2px 9px;
  font-size:.66rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;
  border-radius:2px;font-family:"Inter",sans-serif;line-height:1.4;
  vertical-align:middle}
body.lib-body .status-operational{background:#7d9b97;color:#06101C}  /* sea green = currently served */
body.lib-body .status-reactivated{background:#5b85b8;color:#fff}      /* blue = was rail, reopens */
body.lib-body .status-new        {background:#e8932e;color:#0e2a52}   /* gold = greenfield */
body.lib-body .status-heritage   {background:#a68763;color:#fff}      /* tan = heritage tourist */
body.lib-body .status-freight_only{background:#5b6480;color:#fff}     /* slate = freight, no pax */
body.lib-body .status-op-text{display:inline-block;margin-left:8px;font-size:.74rem;
  color:var(--muted);font-style:italic}

/* Verification stat cards (UPD-006 + UPD-007) */
body.lib-body .verify-cards{margin-bottom:14px}
body.lib-body .verify-card{position:relative;padding-bottom:10px;
  border-top-color:#7d9b97 !important}
body.lib-body .verify-card .verify-sub{display:block;font-size:.7rem;
  color:var(--muted);margin-top:6px;letter-spacing:0;
  font-family:"Inter",sans-serif;line-height:1.35;text-transform:none;
  font-weight:400}
body.lib-body .verify-card-total{border-top-color:#e8932e !important;
  background:rgba(232,147,46,.06)}
body.lib-body .verify-card-total .big{color:var(--signal-bright)}

/* Jurisdiction-specific explainer notes (UPD-015/016/017) */
body.lib-body .juris-explainer{background:var(--ink-2);border:1px solid var(--line);
  border-left:3px solid #5b85b8;padding:14px 18px;margin:18px 0;
  font-size:.86rem;line-height:1.55;color:var(--paper)}
body.lib-body .juris-explainer strong{color:#5b85b8;font-weight:600}

/* =========================================================================
   TOPIC LANDING PAGES (v2.14.13 — SEO)
   ========================================================================= */
body.public-page .topic-page{padding:48px 0 80px;max-width:780px;margin:0 auto}
body.public-page .topic-hero{margin-bottom:40px;padding-bottom:28px;
  border-bottom:1px solid rgba(14,42,82,.15)}
body.public-page .topic-eyebrow{font-family:"Space Mono",monospace;
  font-size:.74rem;color:#5b85b8;text-transform:uppercase;letter-spacing:.08em;
  margin:0 0 12px}
body.public-page .topic-hero h1{font-family:"Public Sans",sans-serif;
  font-size:2.3rem;line-height:1.15;color:#0e2a52;letter-spacing:-.02em;
  font-weight:800;margin:0 0 16px}
body.public-page .topic-lede{font-size:1.15rem;line-height:1.55;color:#2d3a52;
  margin:0}
body.public-page .topic-block{margin:32px 0}
body.public-page .topic-block h2{font-family:"Public Sans",sans-serif;
  font-size:1.35rem;color:#0e2a52;font-weight:700;letter-spacing:-.01em;
  margin:0 0 12px}
body.public-page .topic-body p{font-size:1rem;line-height:1.65;color:#2d3a52;
  margin:0 0 12px}
body.public-page .topic-related{list-style:none;padding:0;margin:0;
  display:grid;grid-template-columns:repeat(2,1fr);gap:10px 18px}
@media (max-width:680px){body.public-page .topic-related{grid-template-columns:1fr}}
body.public-page .topic-related li{padding:10px 14px;background:#f3f5f9;
  border-left:3px solid #5b85b8;border-radius:0 2px 2px 0}
body.public-page .topic-related a{color:#0e2a52;font-weight:600;
  text-decoration:none;font-size:.92rem;line-height:1.4}
body.public-page .topic-related a:hover{color:#5b85b8;text-decoration:underline}
