/* ==========================================================================
   KHPA.io — Unified Stylesheet
   Ko Hawaiʻi Pae ʻĀina — Official Public Portal
   Single canonical stylesheet shared by every page on the site.
   Sections: Design tokens / Base / Skip link / Topbar / Header & Nav /
   Breadcrumbs / Layout / Buttons / Panels & Cards / Document Library /
   Forms / Bot / Footer / Utilities / Responsive
   ========================================================================== */

/* ---- Design tokens -------------------------------------------------- */
:root{
  /* Civic palette: navy for authority, parchment/cream ground, gold accent,
     muted earth green for secondary emphasis. */
  --navy:#1e2a36;
  --navy-2:#141d27;
  --heading:#1e2a36;
  --gold:#b6922e;
  --gold-soft:#e6d7a3;
  --earth:#5b6b4d;
  --line:#d8d2c4;
  --panel:#f7f3ea;
  --text:#1f1f1f;
  --text-soft:#333333;
  --muted:#5b6570;
  --white:#ffffff;
  --cream:#f4f1e8;
  --focus:#2563a8;
  --danger:#8a2c0d;
  --surface:#ffffff;
  --tint-bg:#fbf7ea;
  --tint-border:#d8c9a7;
  --earth-tint-bg:#f4f6f0;
  --earth-tint-border:#dde3d3;
  --hero-from:#fbf8f1;
  --hero-to:#f4ecdb;
  --hero-border:#d8c9a7;

  color-scheme: light;

  --font-serif: Georgia, "Times New Roman", Cambria, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, "Noto Sans", sans-serif;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 2px 10px rgba(0,0,0,.05);
  --shadow-md: 0 6px 20px rgba(0,0,0,.06);
}

/* ---- Base ------------------------------------------------------------ */
*{ box-sizing:border-box; }

html{ scroll-behavior:smooth; }

body{
  margin:0;
  font-family: var(--font-sans);
  color:var(--text);
  background:var(--cream);
  line-height:1.6;
}

h1, h2, h3, .page-title, .panel-title{
  font-family: var(--font-serif);
}

img{
  max-width:100%;
  height:auto;
  display:block;
}

a{ color:var(--heading); }

a:not(.button):not(.btn):not(.nav a){
  text-underline-offset:.15em;
}

/* Visible focus outline everywhere — keyboard navigation must be obvious */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible{
  outline:3px solid var(--focus);
  outline-offset:2px;
  border-radius:4px;
}

.container{
  width:min(1160px, calc(100% - 32px));
  margin:0 auto;
}

/* ---- Skip link --------------------------------------------------------- */
.skip-link{
  position:absolute;
  left:-9999px;
  top:auto;
}

.skip-link:focus{
  left:16px;
  top:16px;
  z-index:9999;
  background:#fff;
  color:#1f1f1f;
  border:1px solid #d8d2c4;
  padding:10px 12px;
  border-radius:var(--radius-sm);
}

/* ---- Assistance topbar -------------------------------------------------- */
.topbar{
  background:var(--navy-2);
  color:#e7e9ec;
  font-size:.9rem;
}

.topbar .container{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  padding:8px 0;
}

.topbar a{
  color:#f2ecda;
  font-weight:600;
  text-decoration:none;
}

.topbar a:hover,
.topbar a:focus-visible{ text-decoration:underline; }

.topbar-links{
  display:flex;
  gap:16px;
  flex-wrap:wrap;
}

/* ---- System banners (offline / update available) --------------------------- */
.system-banner{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  flex-wrap:wrap;
  padding:10px 16px;
  text-align:center;
  font-size:.92rem;
  font-weight:600;
  border-bottom:1px solid var(--tint-border);
  background:var(--tint-bg);
  color:var(--heading);
}

.system-banner[hidden]{ display:none; }

.system-banner .button,
.system-banner .btn{ min-height:36px; padding:6px 14px; font-size:.88rem; }

/* ---- Site header & primary nav ------------------------------------------ */
.site-header{
  background:var(--surface);
  border-bottom:1px solid var(--line);
  box-shadow:0 2px 10px rgba(0,0,0,.04);
}

.header-inner{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:1rem;
  padding:18px 0;
}

.brand-wrap{
  display:flex;
  align-items:center;
  gap:1rem;
  color:inherit;
  text-decoration:none;
  min-width:0;
}

.seal{
  width:72px;
  height:72px;
  display:flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
}

.seal img{
  max-height:72px;
  width:auto;
}

.brand h1{
  margin:0;
  font-size:clamp(1.35rem, 2vw, 1.9rem);
  color:var(--heading);
  line-height:1.2;
}

.tagline{
  margin:.3rem 0 0;
  color:var(--muted);
  font-size:.95rem;
}

.navbar{
  background:var(--navy);
  color:#fff;
  border-top:1px solid rgba(255,255,255,.08);
}

.nav-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:1rem;
  flex-wrap:wrap;
  padding:10px 0;
}

.nav-toggle{
  display:none;
  align-items:center;
  gap:8px;
  background:transparent;
  border:1px solid rgba(255,255,255,.4);
  color:#fff;
  font:inherit;
  font-weight:700;
  padding:10px 14px;
  min-height:44px;
  border-radius:var(--radius-sm);
  cursor:pointer;
}

.nav-toggle .bar{
  display:block;
  width:20px;
  height:2px;
  background:#fff;
  position:relative;
}

.nav-toggle .bar::before,
.nav-toggle .bar::after{
  content:"";
  position:absolute;
  left:0;
  width:20px;
  height:2px;
  background:#fff;
}

.nav-toggle .bar::before{ top:-6px; }
.nav-toggle .bar::after{ top:6px; }

.nav{
  list-style:none;
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  padding:0;
  margin:0;
}

.nav li{ margin:0; }

.nav a{
  color:#fff;
  text-decoration:none;
  font-weight:600;
  padding:10px 12px;
  min-height:44px;
  display:flex;
  align-items:center;
  border-radius:var(--radius-sm);
}

.nav a:hover,
.nav a:focus-visible{
  background:rgba(255,255,255,.12);
}

.nav a[aria-current="page"],
.nav a.active{
  background:rgba(255,255,255,.16);
  font-weight:700;
  box-shadow:inset 0 -3px 0 var(--gold);
}

.topbar-controls{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
}

.theme-toggle,
.install-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:44px;
  min-width:44px;
  padding:8px 12px;
  border:1px solid rgba(255,255,255,.35);
  background:transparent;
  color:#fff;
  border-radius:999px;
  font:inherit;
  font-weight:600;
  cursor:pointer;
  gap:.4rem;
}

.theme-toggle:hover,
.theme-toggle:focus-visible,
.install-btn:hover,
.install-btn:focus-visible{
  background:rgba(255,255,255,.12);
}

.install-btn[hidden]{
  display:none;
}

.theme-toggle .icon{ font-size:1rem; line-height:1; }

.lang-toggle{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.lang-btn{
  border:1px solid rgba(255,255,255,.35);
  background:transparent;
  color:#fff;
  padding:8px 14px;
  min-height:44px;
  border-radius:999px;
  font:inherit;
  font-weight:600;
  cursor:pointer;
}

.lang-btn.active{
  background:#fff;
  color:#1e2a36;
  border-color:#fff;
}

/* ---- Breadcrumbs --------------------------------------------------------- */
.breadcrumbs{
  padding:12px 0;
  font-size:.9rem;
  color:var(--muted);
}

.breadcrumbs ol{
  list-style:none;
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin:0;
  padding:0;
}

.breadcrumbs li{ display:flex; align-items:center; gap:6px; }

.breadcrumbs li + li::before{
  content:"/";
  color:var(--line);
}

.breadcrumbs a{ color:var(--heading); text-decoration:underline; text-underline-offset:.2em; }

.breadcrumbs [aria-current="page"]{ color:var(--muted); font-weight:600; }

/* ---- Layout -------------------------------------------------------------- */
main{ padding:28px 0 40px; }

.hero-panel{
  background:linear-gradient(to bottom, var(--hero-from), var(--hero-to));
  border:1px solid var(--hero-border);
  border-radius:var(--radius);
  padding:2rem;
  margin:0 0 1.25rem;
  box-shadow:var(--shadow-md);
}

.eyebrow{
  margin:0 0 .5rem;
  font-size:.8rem;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:var(--heading);
  opacity:.8;
  font-weight:700;
}

.page-title{
  margin:0;
  color:var(--heading);
  font-size:clamp(1.8rem, 3vw, 2.6rem);
  line-height:1.15;
}

.section-divider{
  height:4px;
  width:110px;
  background:var(--gold);
  margin:12px 0 18px 0;
  border-radius:999px;
}

.lede{
  font-size:1.06rem;
  color:var(--text-soft);
  max-width:820px;
}

.hero-actions{
  display:flex;
  gap:.75rem;
  flex-wrap:wrap;
  margin-top:1.25rem;
}

.notice{
  margin:1rem 0 1.5rem;
  padding:14px 16px;
  border-left:4px solid var(--gold);
  background:var(--tint-bg);
  border-radius:10px;
  border:1px solid var(--tint-border);
}

.notice.notice-earth{
  border-left-color:var(--earth);
  background:var(--earth-tint-bg);
  border-color:var(--earth-tint-border);
}

/* ---- Buttons --------------------------------------------------------------- */
.button, .btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:44px;
  padding:10px 18px;
  border-radius:10px;
  text-decoration:none;
  font-weight:700;
  font-size:1rem;
  border:1px solid var(--navy);
  background:var(--navy);
  color:#fff;
  cursor:pointer;
  line-height:1.2;
  gap:.5rem;
}

.button:hover,
.button:focus-visible,
.btn:hover,
.btn:focus-visible{
  opacity:.92;
  text-decoration:none;
}

.button.secondary, .btn.secondary{
  background:var(--surface);
  color:var(--heading);
  border:1px solid var(--line);
}

.button.gold{
  background:var(--gold);
  border-color:var(--gold);
  color:#2a2210;
}

.button.large{
  min-height:56px;
  padding:14px 26px;
  font-size:1.08rem;
  width:100%;
}

.button.block{ width:100%; }

.button[disabled],
.button.disabled{
  background:#cfd6df;
  border-color:#cfd6df;
  color:#243244;
  pointer-events:none;
  cursor:not-allowed;
}

.pill{
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  background:var(--tint-bg);
  border:1px solid var(--tint-border);
  color:var(--heading);
  font-size:.85rem;
  font-weight:700;
}

/* ---- Quick action grid (homepage primary CTAs) ----------------------------- */
.action-grid{
  display:grid;
  grid-template-columns:repeat(4, minmax(0,1fr));
  gap:14px;
  margin-top:1.5rem;
}

.action-grid .button{
  flex-direction:column;
  gap:.35rem;
  padding:20px 16px;
  min-height:84px;
  font-size:1rem;
  text-align:center;
}

.action-grid .button .action-icon{
  font-size:1.4rem;
  line-height:1;
}

/* ---- Panels & cards --------------------------------------------------------- */
.panel{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:20px;
  margin:0 0 18px;
  box-shadow:var(--shadow-sm);
}

.panel-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:14px;
}

.panel-title{
  margin:0;
  color:var(--heading);
  font-size:1.2rem;
}

.badge{
  display:inline-flex;
  align-items:center;
  border:1px solid var(--tint-border);
  background:var(--tint-bg);
  color:var(--heading);
  border-radius:999px;
  padding:6px 10px;
  font-size:.85rem;
  font-weight:600;
}

.doclist{
  list-style:none;
  margin:0;
  padding:0;
  border-top:1px solid var(--line);
}

.doclist li{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  padding:14px 0;
  border-bottom:1px solid var(--line);
}

.doclist .left{ min-width:0; }

.doclist .left strong{
  display:block;
  color:var(--heading);
  margin-bottom:4px;
}

.meta{
  color:var(--muted);
  font-size:.96rem;
}

.tiles.two-col{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:1rem;
}

.tiles.three-col{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:1rem;
}

.tile{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:1.25rem;
  height:100%;
  box-shadow:var(--shadow-sm);
}

.tile h3{
  margin-top:0;
  margin-bottom:.5rem;
  color:var(--heading);
}

.actions{
  margin-top:1rem;
  display:flex;
  gap:.75rem;
  flex-wrap:wrap;
}

/* Quick access service cards (homepage) */
.service-grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:1.1rem;
  margin-top:1rem;
}

.service-card{
  background:var(--surface);
  border:1px solid var(--line);
  border-top:4px solid var(--gold);
  border-radius:var(--radius);
  padding:1.4rem;
  box-shadow:var(--shadow-sm);
  display:flex;
  flex-direction:column;
}

.service-card .icon{
  font-size:1.6rem;
  margin-bottom:.5rem;
}

.service-card h3{
  margin:.1rem 0 .5rem;
  color:var(--heading);
  font-size:1.15rem;
}

.service-card p{
  color:var(--text-soft);
  flex:1;
}

/* Wallet reference card */
.wallet-card{
  background:linear-gradient(135deg, var(--navy), var(--navy-2));
  color:#fff;
  border-radius:var(--radius);
  padding:1.5rem;
  box-shadow:var(--shadow-md);
}

.wallet-card h3{ color:#fff; margin-top:0; }
.wallet-card a.button{ background:var(--gold); border-color:var(--gold); color:#2a2210; }
.wallet-card a.button.secondary{ background:transparent; color:#fff; border-color:rgba(255,255,255,.5); }
.wallet-card .badge{ background:rgba(255,255,255,.14); border-color:rgba(255,255,255,.35); color:#fff; }

/* ---- Document library ------------------------------------------------------- */
.doc-toolbar{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  align-items:center;
  margin-bottom:1rem;
}

.doc-search{
  flex:1 1 260px;
  position:relative;
}

.doc-search input[type="search"]{
  width:100%;
  min-height:48px;
  padding:10px 16px;
  border:1px solid var(--line);
  border-radius:999px;
  font-size:1rem;
  background:var(--surface);
  color:var(--text);
}

.doc-filters{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.doc-filter{
  min-height:44px;
  padding:8px 16px;
  border-radius:999px;
  border:1px solid var(--line);
  background:var(--surface);
  color:var(--heading);
  font-weight:700;
  cursor:pointer;
  font-size:.92rem;
}

.doc-filter[aria-pressed="true"]{
  background:var(--navy);
  color:#fff;
  border-color:var(--navy);
}

.doc-count{
  font-size:.85em;
  opacity:.8;
}

.doc-clear{
  min-height:44px;
  padding:8px 16px;
  border-radius:999px;
  border:1px solid transparent;
  background:transparent;
  color:var(--heading);
  font-weight:700;
  cursor:pointer;
  font-size:.92rem;
  text-decoration:underline;
  text-underline-offset:.2em;
}

.doc-clear:hover,
.doc-clear:focus-visible{
  color:var(--danger);
}

/* Most Requested quick-jump strip */
.most-requested{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:10px;
  margin:0 0 1.25rem;
  padding:14px 16px;
  background:var(--tint-bg);
  border:1px solid var(--tint-border);
  border-radius:var(--radius);
}

.most-requested strong{
  color:var(--heading);
  margin-right:4px;
}

.most-requested a{
  display:inline-flex;
  align-items:center;
  min-height:36px;
  padding:6px 12px;
  border-radius:999px;
  background:var(--surface);
  border:1px solid var(--tint-border);
  color:var(--heading);
  font-weight:600;
  font-size:.92rem;
  text-decoration:none;
}

.most-requested a:hover,
.most-requested a:focus-visible{
  border-color:var(--navy);
}

.doc-card .badge.featured{
  background:var(--gold);
  border-color:var(--gold);
  color:#2a2210;
}

.doc-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(280px, 1fr));
  gap:16px;
  margin-top:1rem;
}

.doc-card{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:1.15rem;
  box-shadow:var(--shadow-sm);
  display:flex;
  flex-direction:column;
}

.doc-card[hidden]{
  display:none;
}

.doc-card .doc-category{
  align-self:flex-start;
  margin-bottom:.6rem;
}

.doc-card h3{
  margin:0 0 .4rem;
  color:var(--heading);
  font-size:1.08rem;
}

.doc-card p{
  color:var(--text-soft);
  font-size:.95rem;
  flex:1;
  margin:0 0 1rem;
}

.doc-card .doc-actions{
  display:flex;
  gap:.6rem;
  flex-wrap:wrap;
}

.doc-empty{
  padding:2rem;
  text-align:center;
  color:var(--muted);
  border:1px dashed var(--line);
  border-radius:var(--radius);
}

/* ---- Registration hub sections --------------------------------------------- */
.reg-section-nav{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:1rem 0 1.5rem;
}

.reg-section-nav a{
  min-height:44px;
  display:inline-flex;
  align-items:center;
  padding:8px 14px;
  border-radius:999px;
  border:1px solid var(--line);
  background:var(--surface);
  color:var(--heading);
  font-weight:700;
  text-decoration:none;
  font-size:.92rem;
}

.reg-section-nav a:hover,
.reg-section-nav a:focus-visible{
  border-color:var(--navy);
}

/* How to Apply — numbered step cards */
.steps{
  list-style:none;
  margin:0;
  padding:0;
  display:grid;
  grid-template-columns:repeat(4, minmax(0,1fr));
  gap:14px;
  counter-reset:khpa-step;
}

.steps li{
  counter-increment:khpa-step;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:1.1rem;
  position:relative;
  padding-top:2.6rem;
}

.steps li::before{
  content:counter(khpa-step);
  position:absolute;
  top:.9rem;
  left:1.1rem;
  width:28px;
  height:28px;
  border-radius:50%;
  background:var(--navy);
  color:#fff;
  font-weight:700;
  font-family:var(--font-serif);
  display:flex;
  align-items:center;
  justify-content:center;
}

.steps h4{
  margin:0 0 .35rem;
  color:var(--heading);
  font-size:1rem;
}

.steps p{
  margin:0;
  color:var(--text-soft);
  font-size:.94rem;
}

/* Required documents checklist */
.checklist{
  list-style:none;
  margin:0;
  padding:0;
}

.checklist li{
  display:flex;
  align-items:flex-start;
  gap:10px;
  padding:10px 0;
  border-bottom:1px solid var(--line);
}

.checklist li:last-child{ border-bottom:none; }

.checklist li::before{
  content:"✓";
  flex:0 0 auto;
  width:24px;
  height:24px;
  border-radius:50%;
  background:var(--earth);
  color:#fff;
  font-size:.8rem;
  font-weight:700;
  display:flex;
  align-items:center;
  justify-content:center;
  margin-top:.1rem;
}

/* Office directory field rows (Island Offices) */
.office-field{
  display:flex;
  gap:8px;
  align-items:baseline;
  padding:4px 0;
  flex-wrap:wrap;
}

.office-field .field-label{
  flex:0 0 auto;
  min-width:84px;
  font-weight:700;
  color:var(--heading);
  font-size:.88rem;
  text-transform:uppercase;
  letter-spacing:.03em;
}

.office-field .field-value{
  color:var(--text-soft);
}

/* ---- Forms ------------------------------------------------------------------ */
.form-grid{
  display:grid;
  grid-template-columns:repeat(12, 1fr);
  gap:16px;
  margin-top:.5rem;
}

.field{
  grid-column:span 6;
  display:flex;
  flex-direction:column;
  gap:6px;
}

.field-full{ grid-column:span 12; }

.field label,
.field legend{
  font-weight:700;
  color:var(--heading);
}

.hint{
  font-size:.88rem;
  color:var(--muted);
  margin:0;
}

.field input,
.field select,
.field textarea{
  min-height:48px;
  padding:10px 14px;
  border:1px solid var(--line);
  border-radius:var(--radius-sm);
  background:var(--surface);
  font-size:1rem;
  font-family:inherit;
  color:var(--text);
}

.field textarea{ min-height:120px; }

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible{
  outline:3px solid var(--focus);
  outline-offset:1px;
}

fieldset{
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:1rem 1.1rem 1.25rem;
  margin:0 0 1.25rem;
}

fieldset legend{
  padding:0 8px;
  font-family:var(--font-serif);
  font-size:1.05rem;
  color:var(--heading);
}

.required-note{
  font-size:.88rem;
  color:var(--muted);
  margin:0 0 1rem;
}

.assist-form{ margin-top:.5rem; }

/* ---- Bot section -------------------------------------------------------------- */
.bot-wrap{
  border:1px solid var(--line);
  border-radius:var(--radius);
  overflow:hidden;
  background:var(--tint-bg);
}

.bot-messages{
  max-height:260px;
  overflow-y:auto;
  padding:14px;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.bot-message{
  padding:10px 14px;
  border-radius:12px;
  max-width:85%;
  font-size:.96rem;
}

.bot-message.bot{
  background:var(--surface);
  border:1px solid var(--line);
  align-self:flex-start;
  color:var(--text);
}

.bot-message.user{
  background:var(--navy);
  color:#fff;
  align-self:flex-end;
}

.bot-input-row{
  display:flex;
  gap:10px;
  padding:14px;
  border-top:1px solid var(--line);
  background:var(--surface);
}

.bot-input-row input{
  flex:1;
  min-height:48px;
  padding:10px 14px;
  border:1px solid var(--line);
  border-radius:var(--radius-sm);
  font-size:1rem;
  background:var(--surface);
  color:var(--text);
}

/* ---- Footer -------------------------------------------------------------------- */
.site-footer{
  background:var(--surface);
  border-top:1px solid var(--line);
  margin-top:30px;
}

.footer-grid{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:20px;
  padding:26px 0;
}

.footer-col h4{
  margin-top:0;
  margin-bottom:10px;
  color:var(--heading);
  font-family:var(--font-serif);
}

.footer-col p{ margin:0 0 8px; }

.footer-bottom{
  border-top:1px solid var(--line);
  padding:14px 0;
  text-align:center;
  color:var(--muted);
  font-size:.88rem;
}

/* ---- Utilities ------------------------------------------------------------------ */
.small{ color:var(--muted); font-size:.92rem; }
.text-center{ text-align:center; }
.mt-0{ margin-top:0; }
.mt-xs{ margin-top:8px; }
.mt-md{ margin-top:16px; }
.mb-0{ margin-bottom:0; }
.mb-xs{ margin-bottom:.25rem; }
.mb-sm{ margin-bottom:.75rem; }
.m-0{ margin:0; }
.stack-sm{ margin:0 0 10px; }
.stack-md{ margin:0 0 14px; }
.my-md{ margin:16px 0; }
.my-lg{ margin:20px 0; }

.form-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:12px;
}

.bot-actions{
  padding:0 14px 14px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.hero-img{
  width:100%;
  border:1px solid var(--line);
  border-radius:var(--radius-sm);
}

.visually-hidden{
  position:absolute;
  width:1px; height:1px;
  padding:0; margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

/* ---- Responsive ------------------------------------------------------------------ */
@media (max-width: 960px){
  .action-grid{ grid-template-columns:repeat(2, minmax(0,1fr)); }
  .service-grid{ grid-template-columns:repeat(2, minmax(0,1fr)); }
  .footer-grid{ grid-template-columns:repeat(2, minmax(0,1fr)); }
  .steps{ grid-template-columns:repeat(2, minmax(0,1fr)); }
}

@media (max-width: 860px){
  .tiles.two-col, .tiles.three-col{ grid-template-columns:1fr; }

  .hero-panel{ padding:1.25rem; }

  .brand-wrap{ align-items:flex-start; }

  .doclist li{ flex-direction:column; align-items:flex-start; }
}

@media (max-width: 780px){
  .field{ grid-column:span 12; }

  .bot-input-row{ flex-direction:column; }

  .header-inner{ padding:14px 0; }

  .seal{ width:56px; height:56px; }

  .seal img{ max-height:56px; }

  .action-grid{ grid-template-columns:1fr; }
  .service-grid{ grid-template-columns:1fr; }
  .footer-grid{ grid-template-columns:1fr; }
  .steps{ grid-template-columns:1fr; }

  .nav-toggle{ display:inline-flex; }

  .nav-row{ align-items:flex-start; }

  /* Mobile menu: height/opacity transition instead of an instant display
     jump — kept to a single lightweight CSS transition, no JS animation. */
  .nav{
    display:flex;
    flex-direction:column;
    gap:2px;
    width:100%;
    max-height:0;
    opacity:0;
    visibility:hidden;
    overflow:hidden;
    padding-bottom:0;
    transition:max-height .25s ease, opacity .2s ease, visibility 0s linear .25s;
  }

  .nav.open{
    max-height:600px;
    opacity:1;
    visibility:visible;
    padding-bottom:10px;
    transition:max-height .25s ease, opacity .2s ease, visibility 0s linear 0s;
  }

  .nav a{ width:100%; }

  .lang-toggle{ width:100%; }
}

@media (max-width: 560px){
  .topbar .container{ flex-direction:column; align-items:stretch; }
  .topbar-controls{ justify-content:space-between; }
}

@media (prefers-reduced-motion: reduce){
  .nav{ transition:none; }
}

/* ---- Dark mode ------------------------------------------------------------------
   Token-driven: nearly every surface/text color in this file reads from a
   custom property, so redefining the tokens here is enough to retheme the
   whole site. Two selectors carry the same values on purpose: the
   prefers-color-scheme block follows the OS/browser setting automatically,
   while [data-theme="dark"] lets the on-page toggle (see Js/site.js) force
   the choice either way, overriding the system preference. */
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --heading:#e7dab8;
    --text:#d7dde2;
    --text-soft:#b9c2c9;
    --muted:#93a0aa;
    --line:#313d47;
    --surface:#1a222c;
    --cream:#10151b;
    --tint-bg:#2a2416;
    --tint-border:#4a4020;
    --earth-tint-bg:#1c241c;
    --earth-tint-border:#35402f;
    --hero-from:#171f27;
    --hero-to:#1c2733;
    --hero-border:#3a4652;
    --gold:#c9a13a;
    --earth:#7a8f68;
    --focus:#4d9de0;
    --danger:#d9633b;
    --shadow-sm: 0 2px 10px rgba(0,0,0,.35);
    --shadow-md: 0 6px 20px rgba(0,0,0,.45);
    color-scheme: dark;
  }

  :root:not([data-theme="light"]) .office-card{
    background:var(--surface);
  }
}

:root[data-theme="dark"]{
  --heading:#e7dab8;
  --text:#d7dde2;
  --text-soft:#b9c2c9;
  --muted:#93a0aa;
  --line:#313d47;
  --surface:#1a222c;
  --cream:#10151b;
  --tint-bg:#2a2416;
  --tint-border:#4a4020;
  --earth-tint-bg:#1c241c;
  --earth-tint-border:#35402f;
  --hero-from:#171f27;
  --hero-to:#1c2733;
  --hero-border:#3a4652;
  --gold:#c9a13a;
  --earth:#7a8f68;
  --focus:#4d9de0;
  --danger:#d9633b;
  --shadow-sm: 0 2px 10px rgba(0,0,0,.35);
  --shadow-md: 0 6px 20px rgba(0,0,0,.45);
  color-scheme: dark;
}

:root[data-theme="dark"] .office-card{
  background:var(--surface);
}

/* ---- Print --------------------------------------------------------------------- */
@media print{
  .topbar, .navbar, .nav-toggle, .skip-link, .site-footer, .breadcrumbs,
  .lang-toggle, .hero-actions, .action-grid, .bot-wrap, .doc-toolbar,
  .most-requested, #docEmpty, .reg-section-nav, .system-banner{
    display:none !important;
  }

  body{ background:#fff; color:#000; }

  main{ padding:0; }

  .panel, .doc-card, .service-card, .tile, .hero-panel, .wallet-card, fieldset{
    box-shadow:none !important;
    border:1px solid #000 !important;
    background:#fff !important;
    color:#000 !important;
    break-inside:avoid;
  }

  .wallet-card *{ color:#000 !important; }

  .button, .btn{
    border:1px solid #000 !important;
    background:none !important;
    color:#000 !important;
  }

  .doc-grid{ grid-template-columns:1fr; }
  .doc-actions{ flex-direction:column; align-items:flex-start; }

  a[href^="http"]::after,
  a[href^="/pdf"]::after,
  a[href^="/img/"]::after{
    content:" (" attr(href) ")";
    font-size:.8em;
    color:#333;
    word-break:break-all;
  }
}
