/* ==========================================================================
   ZAMEL Product Security – design tokens
   Brand values live here only; swap them to match the official brand book.
   ========================================================================== */
:root {
  --brand-red: #e61e28;
  --brand-navy: #0f2a44;
  --brand-navy-strong: #0a1f33;

  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --surface-sunken: #eef2f6;
  --ink: #16212e;
  --ink-soft: #334155;
  --muted: #5b6777;
  --border: #dbe2ea;
  --border-strong: #c3cdd8;

  --primary: #154a7a;
  --primary-hover: #0f3b63;
  --primary-soft: #e8f0f8;
  --focus: #2f7fd1;

  --success: #17714c;
  --success-soft: #e6f4ed;
  --warning: #9a5b00;
  --warning-soft: #fdf3e1;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --info-soft: #eaf2fb;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 42, 68, 0.06);
  --shadow: 0 1px 3px rgba(15, 42, 68, 0.08), 0 6px 20px rgba(15, 42, 68, 0.06);

  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;

  /* Bootstrap bridge */
  --bs-body-font-family: var(--font);
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--bg);
  --bs-border-color: var(--border);
  --bs-link-color-rgb: 21, 74, 122;
  --bs-link-hover-color-rgb: 15, 59, 99;
  --bs-emphasis-color: var(--ink);
  --bs-secondary-color: var(--muted);
}

/* ---------- Base ---------- */
html { font-size: 16px; scroll-padding-top: 5rem; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); line-height: 1.55; -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); letter-spacing: -0.01em; line-height: 1.25; }
h1 { font-size: clamp(1.75rem, 1.2rem + 1.8vw, 2.4rem); font-weight: 700; margin-bottom: 0.5rem; }
h2 { font-size: 1.35rem; font-weight: 650; }
h3 { font-size: 1.08rem; font-weight: 650; }
p { margin-bottom: 0.85rem; }
a { color: var(--primary); text-underline-offset: 0.18em; }
a:hover { color: var(--primary-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
code, pre, kbd { font-family: var(--font-mono); }
.subtle { color: var(--muted); }
.pre-wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.skip-link { position: absolute; left: 1rem; top: -3rem; background: var(--surface); padding: 0.5rem 1rem; border-radius: var(--radius-sm); z-index: 1000; box-shadow: var(--shadow); }
.skip-link:focus { top: 0.5rem; }

.site-main { flex: 1 0 auto; padding-top: 2rem; padding-bottom: 3.5rem; }
.site-main:focus { outline: none; }

/* ---------- Header ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.site-header .navbar { padding: 0.6rem 0; }
.brand { display: inline-flex; align-items: center; gap: 0.75rem; text-decoration: none; color: var(--ink); margin-right: 2rem; }
.brand:hover { color: var(--ink); }
.brand-logo { display: block; height: 32px; width: auto; }
.brand-logo-footer { height: 36px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; border-left: 1px solid var(--border-strong); padding-left: 0.75rem; }
.brand-text strong { font-size: 0.95rem; font-weight: 650; white-space: nowrap; }
.brand-text span { font-size: 0.72rem; letter-spacing: 0.12em; color: var(--muted); font-weight: 600; }
.site-header .nav-link { white-space: nowrap; color: var(--ink-soft); font-weight: 550; padding: 0.5rem 0.8rem !important; border-radius: var(--radius-sm); }
.site-header .nav-link:hover { color: var(--primary); background: var(--surface-muted); }
.site-header .nav-link.is-active { color: var(--primary); box-shadow: inset 0 -2px 0 var(--primary); border-radius: 0; }
.header-actions { display: flex; align-items: center; gap: 1rem; }
.header-actions .btn { white-space: nowrap; }
.header-link { font-weight: 550; text-decoration: none; }
.lang-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.lang-switch a { padding: 0.2rem 0.65rem; font-size: 0.8rem; font-weight: 650; text-decoration: none; color: var(--muted); }
.lang-switch a.is-active { background: var(--brand-navy); color: #fff; }
.navbar-toggler { border-color: var(--border); }
.navbar-toggler:focus { box-shadow: 0 0 0 3px rgba(47, 127, 209, 0.35); }

.ops-bar { background: var(--brand-navy); color: #dbe6f2; }
.ops-bar-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1.5rem; min-height: 2.9rem; }
.ops-bar nav { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.ops-bar a { color: #dbe6f2; text-decoration: none; font-weight: 550; font-size: 0.93rem; padding: 0.55rem 0.8rem; }
.ops-bar a:hover { color: #fff; }
.ops-bar a.is-active { color: #fff; box-shadow: inset 0 -3px 0 var(--brand-red); }
.ops-user { display: flex; align-items: center; gap: 0.75rem; font-size: 0.88rem; }
.ops-user form { margin: 0; }
.link-button { background: none; border: 0; padding: 0; color: #dbe6f2; text-decoration: underline; font: inherit; cursor: pointer; }
.link-button:hover { color: #fff; }

@media (max-width: 1199.98px) {
  .header-actions { flex-wrap: wrap; padding: 0.75rem 0 0.5rem; }
  .site-header .nav-link.is-active { box-shadow: inset 3px 0 0 var(--primary); }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--brand-navy-strong); color: #c9d6e3; padding: 3rem 0 1.25rem; font-size: 0.92rem; }
.site-footer a { color: #e6eef6; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.3fr repeat(3, 1fr); gap: 2rem; }
.footer-col { display: flex; flex-direction: column; gap: 0.45rem; }
.footer-col h2 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: #8fa6bd; margin-bottom: 0.35rem; font-weight: 700; }
.footer-about p { margin: 0.5rem 0 0; }
.footer-about .brand-logo { align-self: flex-start; }
.footer-bottom { display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid rgba(255, 255, 255, 0.12); margin-top: 2.5rem; padding-top: 1.1rem; color: #8fa6bd; }
@media (max-width: 767.98px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-about { grid-column: 1 / -1; } }

/* ---------- Buttons ---------- */
.btn { font-weight: 600; border-radius: var(--radius-sm); padding: 0.55rem 1.05rem; }
.btn-lg { padding: 0.75rem 1.4rem; font-size: 1.02rem; }
.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.85rem; }
.btn-primary { --bs-btn-bg: var(--primary); --bs-btn-border-color: var(--primary); --bs-btn-hover-bg: var(--primary-hover); --bs-btn-hover-border-color: var(--primary-hover); --bs-btn-active-bg: var(--primary-hover); --bs-btn-active-border-color: var(--primary-hover); --bs-btn-disabled-bg: var(--primary); --bs-btn-disabled-border-color: var(--primary); }
.btn-outline-secondary { --bs-btn-color: var(--ink-soft); --bs-btn-border-color: var(--border-strong); --bs-btn-bg: var(--surface); --bs-btn-hover-color: var(--primary); --bs-btn-hover-bg: var(--primary-soft); --bs-btn-hover-border-color: var(--primary); --bs-btn-active-bg: var(--primary-soft); --bs-btn-active-color: var(--primary); --bs-btn-active-border-color: var(--primary); }
.btn-danger-outline { color: var(--danger); border: 1px solid #e7b4ae; background: var(--surface); }
.btn-danger-outline:hover { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }

/* ---------- Surfaces & layout ---------- */
.surface { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: clamp(1.25rem, 0.8rem + 1.5vw, 2rem); margin-bottom: 1.5rem; box-shadow: var(--shadow-sm); }
.surface > :last-child { margin-bottom: 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.section-head h1, .section-head h2 { margin-bottom: 0.25rem; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.74rem; font-weight: 700; color: var(--brand-red); margin-bottom: 0.4rem; }
.lead-text, .hero-text { font-size: 1.08rem; color: var(--ink-soft); max-width: 46rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem 1.5rem; margin-bottom: 1rem; }
@media (max-width: 767.98px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.detail-card, .module-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem; }
.detail-card h3:not(:first-child) { margin-top: 1.25rem; }
.module-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; }
.link-card { display: block; text-decoration: none; color: var(--ink); transition: border-color 0.15s, box-shadow 0.15s; }
.link-card:hover { border-color: var(--primary); box-shadow: var(--shadow); color: var(--ink); }
.link-card strong { display: block; font-size: 1.05rem; margin: 0.2rem 0 0.35rem; }
.link-card p { color: var(--muted); margin: 0; }
.metric-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; color: var(--muted); }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1rem; font-size: 0.9rem; color: var(--muted); }

/* ---------- Home ---------- */
.home-hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 2rem; align-items: stretch; margin-bottom: 2rem; }
.home-hero-copy { padding: 1rem 0; }
.home-hero-copy h1 { font-size: clamp(2rem, 1.3rem + 2.4vw, 3rem); }
.home-hero-panel { background: var(--brand-navy); color: #dbe6f2; border-radius: var(--radius-lg); padding: 1.75rem; display: flex; flex-direction: column; gap: 1rem; }
.home-hero-panel h2 { color: #fff; font-size: 1.1rem; }
.home-hero-panel ol { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.6rem; }
.home-hero-panel a { color: #fff; }
.trust-line { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin-top: 1.25rem; color: var(--muted); font-size: 0.93rem; }
.trust-line span::before { content: "✓"; color: var(--success); font-weight: 700; margin-right: 0.4rem; }
.process-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; counter-reset: step; }
.process-step { border-top: 3px solid var(--primary); padding-top: 0.9rem; }
.process-step span { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.process-step h3 { margin: 0.35rem 0; }
.process-step p { color: var(--ink-soft); margin: 0; }
@media (max-width: 991.98px) { .home-hero { grid-template-columns: 1fr; } .process-list { grid-template-columns: 1fr; } }
.contact-band { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1.25rem; background: var(--primary-soft); border-color: #cfe0f0; }
.contact-band h2 { margin-bottom: 0.25rem; }

/* ---------- Page header (inner pages) ---------- */
.page-header { margin-bottom: 1.5rem; max-width: 52rem; }
.page-header p { color: var(--ink-soft); font-size: 1.05rem; }
.hero { margin-bottom: 1.5rem; }
.hero h1 { margin-bottom: 0.6rem; }

/* ---------- Documents ---------- */
.document-list { display: grid; gap: 1.75rem; }
.document-group-head { margin-bottom: 0.6rem; }
.document-group-head h2 { margin: 0.2rem 0 0; }
.document-group-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 0.75rem; }
.document-list-item { display: flex; flex-direction: column; gap: 0.25rem; padding: 0.95rem 1.1rem; border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--ink); background: var(--surface); height: 100%; transition: border-color 0.15s, box-shadow 0.15s; }
.document-list-item:hover { border-color: var(--primary); box-shadow: var(--shadow); color: var(--ink); }
.document-list-item strong { color: var(--primary); }
.document-list-item span { color: var(--muted); font-size: 0.93rem; }

.markdown-surface { max-width: 56rem; }
.markdown-document { font-size: 1.01rem; color: var(--ink-soft); }
.markdown-document h1 { color: var(--ink); margin-bottom: 1rem; }
.markdown-document h2 { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.markdown-document h3 { margin-top: 1.5rem; }
.markdown-document blockquote { background: var(--surface-muted); border-left: 4px solid var(--primary); padding: 0.75rem 1rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--muted); font-size: 0.93rem; }
.markdown-document blockquote p { margin: 0.15rem 0; }
.markdown-document table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.94rem; display: block; overflow-x: auto; }
.markdown-document th, .markdown-document td { border: 1px solid var(--border); padding: 0.5rem 0.7rem; vertical-align: top; }
.markdown-document th { background: var(--surface-muted); color: var(--ink); }
.markdown-document code { background: var(--surface-sunken); padding: 0.1rem 0.35rem; border-radius: 4px; font-size: 0.9em; }
.markdown-document li { margin-bottom: 0.3rem; }

/* ---------- Forms ---------- */
.form-label { font-weight: 600; color: var(--ink); margin-bottom: 0.3rem; }
.form-label .optional { font-weight: 400; color: var(--muted); font-size: 0.88rem; }
.form-label .required { color: var(--danger); margin-left: 0.15rem; }
.form-control, .form-select { border-color: var(--border-strong); border-radius: var(--radius-sm); padding: 0.55rem 0.75rem; color: var(--ink); background-color: var(--surface); }
.form-control:focus, .form-select:focus { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(47, 127, 209, 0.2); }
.form-control::placeholder { color: #8994a3; }
textarea.form-control { min-height: 6rem; }
.textarea-md { min-height: 7rem; }
.textarea-lg, .medium-textarea { min-height: 9rem; }
.textarea-xl { min-height: 12rem; }
.form-hint { color: var(--muted); font-size: 0.88rem; margin: 0.3rem 0 0; }
.form-check-input { width: 1.15em; height: 1.15em; border-color: var(--border-strong); margin-top: 0.2em; flex: none; }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.form-check-input:focus { box-shadow: 0 0 0 3px rgba(47, 127, 209, 0.25); }
.check-list { display: grid; gap: 0.6rem; margin: 0.5rem 0 1rem; }
.check-row, .consent-box { display: flex; gap: 0.65rem; align-items: flex-start; cursor: pointer; }
.consent-box { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.65rem 0.8rem; }
.text-danger, .field-validation-error { color: var(--danger) !important; font-size: 0.88rem; }
.validation-summary-errors ul { margin: 0; padding-left: 1.2rem; }
.validation-summary-errors { background: var(--danger-soft); border: 1px solid #f1bdb7; border-radius: var(--radius); padding: 0.75rem 1rem; margin-bottom: 1rem; }
.input-validation-error { border-color: var(--danger) !important; }
.field { margin-bottom: 1.1rem; }
.filters-row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-bottom: 1.25rem; }
.filters-row .form-control, .filters-row .form-select { width: auto; min-width: 12rem; flex: 1 1 12rem; }
.filter-check { display: inline-flex; gap: 0.4rem; align-items: center; white-space: nowrap; font-size: 0.93rem; }

/* Choice cards (radio groups rendered as selectable tiles) */
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 0.65rem; }
.choice-card { position: relative; display: flex; gap: 0.65rem; align-items: flex-start; border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 0.8rem 0.9rem; cursor: pointer; background: var(--surface); transition: border-color 0.15s, background 0.15s; }
.choice-card:hover { border-color: var(--primary); }
.choice-card input { margin-top: 0.25rem; accent-color: var(--primary); flex: none; }
.choice-card strong { display: block; font-size: 0.97rem; }
.choice-card span { color: var(--muted); font-size: 0.86rem; }
.choice-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 1px var(--primary); }
.choice-card:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- Report wizard ---------- */
.wizard { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 2rem; align-items: start; }
.wizard-steps { position: sticky; top: 6rem; list-style: none; margin: 0; padding: 0; display: grid; gap: 0.25rem; }
.wizard-steps li { display: flex; gap: 0.75rem; align-items: center; padding: 0.55rem 0.7rem; border-radius: var(--radius-sm); color: var(--muted); font-weight: 550; }
.wizard-steps li .step-no { width: 1.8rem; height: 1.8rem; border-radius: 50%; display: inline-grid; place-items: center; border: 2px solid var(--border-strong); font-size: 0.85rem; font-weight: 700; background: var(--surface); flex: none; }
.wizard-steps li.is-current { color: var(--ink); background: var(--surface); box-shadow: var(--shadow-sm); }
.wizard-steps li.is-current .step-no { border-color: var(--primary); color: var(--primary); }
.wizard-steps li.is-done .step-no { background: var(--primary); border-color: var(--primary); color: #fff; }
.wizard-panel { display: block; }
.js .wizard-panel[hidden] { display: none; }
.wizard-panel + .wizard-panel { margin-top: 1.5rem; }
.js .wizard-panel + .wizard-panel { margin-top: 0; }
.wizard-panel-head { margin-bottom: 1.25rem; }
.wizard-panel-head p { color: var(--muted); margin: 0; }
.wizard-nav { display: flex; justify-content: space-between; gap: 0.75rem; border-top: 1px solid var(--border); padding-top: 1.25rem; margin-top: 1.5rem; }
.wizard-nav .spacer { flex: 1; }
.no-js-only { display: block; }
.js .no-js-only { display: none; }
.js-only { display: none; }
.js .js-only { display: inline-flex; }
fieldset.field { border: 0; padding: 0; min-width: 0; }
fieldset.field legend { font-size: 1rem; font-weight: 600; margin-bottom: 0.45rem; float: none; }
.conditional[hidden] { display: none !important; }
.side-note { background: var(--info-soft); border-radius: var(--radius); padding: 1rem 1.1rem; font-size: 0.92rem; color: var(--ink-soft); }
.side-note h3 { font-size: 0.95rem; }
.side-note ul { padding-left: 1.1rem; margin: 0; }
@media (max-width: 991.98px) {
  .wizard { grid-template-columns: 1fr; gap: 1rem; }
  .wizard-steps { position: static; grid-auto-flow: column; overflow-x: auto; }
  .wizard-steps li .step-label { display: none; }
  .wizard-steps li.is-current .step-label { display: inline; }
}

/* ---------- Confirmation & tracking ---------- */
.token-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 1.25rem 0; }
.token-card { border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 1rem 1.1rem; background: var(--surface-muted); display: grid; gap: 0.4rem; }
.token-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; color: var(--muted); }
.token-card code { font-size: 1.2rem; color: var(--ink); word-break: break-all; font-weight: 600; }
@media (max-width: 767.98px) { .token-grid { grid-template-columns: 1fr; } }
.status-track { display: flex; flex-wrap: wrap; gap: 0.25rem; list-style: none; padding: 0; margin: 1rem 0 1.5rem; }
.status-track li { flex: 1 1 8rem; padding: 0.55rem 0.7rem; border-top: 4px solid var(--border); font-size: 0.88rem; color: var(--muted); }
.status-track li.is-done { border-color: var(--primary); color: var(--ink-soft); }
.status-track li.is-current { border-color: var(--brand-red); color: var(--ink); font-weight: 650; }
.message-thread { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: 0.75rem; }
.message { border: 1px solid var(--border); border-radius: var(--radius); padding: 0.8rem 1rem; max-width: 46rem; background: var(--surface); }
.message.from-team { border-left: 4px solid var(--primary); }
.message.from-reporter { border-left: 4px solid var(--border-strong); background: var(--surface-muted); margin-left: auto; }
.message-meta { font-size: 0.82rem; color: var(--muted); display: block; margin-bottom: 0.3rem; }
.message p { margin: 0; }
.message.is-unread { box-shadow: 0 0 0 2px var(--warning); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.table { margin: 0; --bs-table-bg: transparent; --bs-table-color: var(--ink); }
.table thead th { background: var(--surface-muted); color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; border-bottom-color: var(--border); white-space: nowrap; }
.table td, .table th { padding: 0.7rem 0.85rem; border-color: var(--border); vertical-align: top; }
.table tbody tr:hover { background: var(--surface-muted); }
.report-table a { text-decoration: none; }
.report-table a:hover { text-decoration: underline; }
.deadline-table tr.state-overdue td:first-child, .report-table tr.state-overdue td:first-child { box-shadow: inset 4px 0 0 var(--danger); }
.deadline-table tr.state-due-soon td:first-child { box-shadow: inset 4px 0 0 var(--warning); }
.draft-row td { padding-top: 0; border-top: 0; }
.table-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.table-actions form { margin: 0; }

/* ---------- Badges, notices ---------- */
.pill { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: 999px; padding: 0.12rem 0.65rem; font-size: 0.82rem; font-weight: 600; color: var(--ink-soft); background: var(--surface); }
.pill-danger { border-color: #e7b4ae; color: var(--danger); background: var(--danger-soft); }
.report-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.state-badge { display: inline-block; border-radius: 999px; padding: 0.12rem 0.6rem; font-size: 0.8rem; font-weight: 650; margin: 0 0.25rem 0.25rem 0; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-soft); white-space: nowrap; }
.state-badge.state-overdue { background: var(--danger-soft); border-color: #eab0a9; color: var(--danger); }
.state-badge.state-due-soon { background: var(--warning-soft); border-color: #eccb91; color: var(--warning); }
.state-badge.state-done { background: var(--success-soft); border-color: #a9d6bf; color: var(--success); }
.state-badge.state-late { background: var(--warning-soft); border-color: #eccb91; color: var(--warning); }
.severity-critical, .severity-high { color: var(--danger); font-weight: 650; }
.severity-medium { color: var(--warning); font-weight: 600; }
.pill.severity-critical, .pill.severity-high { border-color: #e7b4ae; background: var(--danger-soft); }
.notice { border-radius: var(--radius); padding: 0.85rem 1.1rem; margin-bottom: 1.25rem; border: 1px solid var(--border); background: var(--surface); }
.notice > :last-child { margin-bottom: 0; }
.notice-success { background: var(--success-soft); border-color: #a9d6bf; }
.notice-error { background: var(--danger-soft); border-color: #eab0a9; }
.notice-urgent { background: var(--danger-soft); border-color: var(--danger); border-left-width: 5px; }
.notice-warning { background: var(--warning-soft); border-color: #eccb91; }
.notice-neutral, .notice-info { background: var(--info-soft); border-color: #c6dbf1; }

/* ---------- Operations ---------- */
.area-operations .site-main { max-width: 1320px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 0.85rem; margin-bottom: 2rem; }
.stat-tile { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.15rem; text-decoration: none; color: var(--ink); display: grid; background: var(--surface); }
.stat-tile:hover { border-color: var(--primary); color: var(--ink); }
.stat-tile.is-alert { border-color: #eab0a9; background: var(--danger-soft); }
.stat-value { font-size: 1.9rem; font-weight: 700; line-height: 1.1; font-family: var(--font-display); }
.stat-label { color: var(--muted); font-size: 0.9rem; }
.case-header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem; margin-bottom: 1.25rem; }
.case-header h1 { font-size: 1.6rem; }
.case-facts { display: grid; gap: 0.6rem; margin: 0; min-width: 16rem; padding: 0.9rem 1.1rem; background: var(--surface-muted); border-radius: var(--radius); border: 1px solid var(--border); }
.case-facts dt { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; }
.case-facts dd { margin: 0; font-weight: 600; }
.case-facts .is-overdue dd { color: var(--danger); }
.section-tabs { position: sticky; top: 4.6rem; z-index: 5; background: var(--surface); display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; border-bottom: 1px solid var(--border); padding: 0.6rem 0; margin-bottom: 1.5rem; }
.section-tabs a { color: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: 0.93rem; }
.section-tabs a:hover { color: var(--primary); }
.case-section { margin-bottom: 2.5rem; scroll-margin-top: 8rem; }
.case-section > h2, .case-section > .section-head h2 { margin-bottom: 0.75rem; }
.regulatory-case { border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1.25rem; }
.regulatory-case.is-closed { background: var(--surface-muted); }
.regulatory-case-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; margin-bottom: 0.75rem; }
.case-actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; margin-top: 0.9rem; }
.inline-row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: flex-end; }
.inline-row .form-control { width: auto; }
.inline-form summary, .decision-card summary { cursor: pointer; color: var(--primary); font-weight: 600; }
.inline-form form { margin-top: 0.5rem; max-width: 26rem; display: grid; gap: 0.3rem; }
.decision-card { border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 1rem 1.25rem; background: var(--surface-muted); }
.decision-card form { margin-top: 0.75rem; }
.regulatory-decisions { margin-top: 1rem; }
.evidence, .draft-text { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-sunken); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.75rem 1rem; font-size: 0.88rem; color: var(--ink); max-height: 28rem; overflow-y: auto; }
.timeline { list-style: none; padding: 0; margin: 1rem 0 0; }
.timeline li { border-left: 2px solid var(--border-strong); padding: 0 0 1rem 1rem; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 0.35rem; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--primary); }
.timeline-meta { font-size: 0.82rem; color: var(--muted); }
.fact-list { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; }
.fact-list dt { font-weight: 500; color: var(--muted); }
.fact-list dd { margin: 0; }
.plain-list { padding-left: 1.1rem; }
.attachment-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.6rem; }
.attachment-item { display: grid; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.6rem 0.8rem; text-decoration: none; color: var(--ink); }
.attachment-item:hover { border-color: var(--primary); }
.attachment-item span { color: var(--muted); font-size: 0.85rem; }
.ops-update-form { display: grid; gap: 0.25rem; }

/* ---------- Identity / account ---------- */
.identity-manage-grid { display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: 2rem; }
.identity-manage-nav .nav { flex-direction: column; gap: 0.2rem; }
.identity-manage-nav .nav-link { color: var(--ink-soft); border-radius: var(--radius-sm); padding: 0.45rem 0.7rem; }
.identity-manage-nav .nav-link.active, .identity-manage-nav .nav-link:hover { background: var(--primary-soft); color: var(--primary); }
.identity-manage-content { max-width: 40rem; }
.identity-readonly-field { background: var(--surface-muted); }
.mfa-qr-code { background: #fff; padding: 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); display: inline-block; }
.mfa-qr-code svg, .mfa-qr-code img { width: 12rem; height: 12rem; }
@media (max-width: 767.98px) { .identity-manage-grid { grid-template-columns: 1fr; } }

/* ---------- Misc content ---------- */
.pgp-block { white-space: pre-wrap; word-break: break-all; font-family: var(--font-mono); font-size: 0.8rem; background: var(--surface-sunken); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem; max-height: 22rem; overflow: auto; }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; }
.visually-hidden-focusable:not(:focus) { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; }

@media print {
  .site-header, .site-footer, .section-tabs, form, .btn { display: none !important; }
  body { background: #fff; }
  .surface { border: 0; box-shadow: none; padding: 0; }
}

.narrow-surface { max-width: 48rem; }
.narrow-surface-sm { max-width: 36rem; }
.fingerprint { font-size: 0.95rem; word-spacing: 0.25em; overflow-wrap: anywhere; color: var(--ink); }
.site-main h2[tabindex="-1"]:focus, .wizard-panel h2:focus { outline: none; }

/* ---------- Administration ---------- */
.admin-layout { display: grid; gap: 1.5rem; }
.admin-layout.is-editing { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: start; }
.admin-editor { position: sticky; top: 7.5rem; }
.report-table tr.is-selected td { background: var(--primary-soft); }
.matrix-table td, .matrix-table th { text-align: center; vertical-align: middle; }
.matrix-table th[scope="row"], .matrix-table thead th:first-child { text-align: left; }
.matrix-table thead th { white-space: normal; }
@media (max-width: 1199.98px) { .admin-layout.is-editing { grid-template-columns: 1fr; } .admin-editor { position: static; } }
.admin-layout.is-editing .col-groups { display: none; }

/* ---------- Case tabs ---------- */
.case-tabs { position: sticky; top: 4.6rem; z-index: 5; background: var(--surface); display: flex; gap: 0.25rem; border-bottom: 1px solid var(--border); margin: 0 0 1.75rem; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.case-tabs a { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.7rem 0.95rem; color: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: 0.95rem; white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.case-tabs a:hover { color: var(--primary); }
.case-tabs a.is-active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-badge { display: inline-grid; place-items: center; min-width: 1.35rem; height: 1.35rem; padding: 0 0.35rem; border-radius: 999px; background: var(--surface-sunken); color: var(--muted); font-size: 0.75rem; font-weight: 700; }
.tab-badge-alert { background: var(--danger); color: #fff; }
.js .tab-panel[hidden] { display: none; }
.js .tab-panel { margin-bottom: 0; }

/* ---------- Reporting channels ---------- */
.channel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 34rem), 1fr)); gap: 1.25rem; margin-top: 1.5rem; }
.channel-card { margin: 0; display: flex; flex-direction: column; scroll-margin-top: 8rem; }
.channel-card:target { box-shadow: 0 0 0 3px var(--focus); }
.channel-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; margin-bottom: 1rem; }
.channel-head h2 { font-size: 1.1rem; margin-bottom: 0.2rem; }
.channel-card .fact-list { grid-template-columns: 7.5rem 1fr; font-size: 0.93rem; }
.channel-links { list-style: none; padding: 0; margin: 0.9rem 0 0; display: flex; flex-wrap: wrap; gap: 0.3rem 1.1rem; font-size: 0.9rem; }
@media (max-width: 575.98px) { .channel-grid { grid-template-columns: 1fr; } .channel-card .fact-list { grid-template-columns: 1fr; } }
