/* NCSC — institutional financial workspace, NCSC.gov.uk-aligned tokens.
   Type: Inter (UI) + JetBrains Mono (IDs, hashes, file refs).
   Palette: navy / amber primary, teal-verified accent, tier-tinted surfaces. */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Brand */
  --ncsc-deep-blue:        #0d1f4a;
  --ncsc-deep-blue-muted:  #1c3a73;
  --ncsc-blue:             #2b70b9;
  --ncsc-blue-hover:       #0d1f4a;
  --ncsc-blue-muted:       #e6f0fb;
  --ncsc-amber:            #f2a900;
  --ncsc-amber-active:     #d18000;
  --ncsc-amber-bg:         #fff5d6;
  --ncsc-certified:        #00818a;
  --ncsc-teal:             #00818a;
  --ncsc-teal-muted:       #00626a;
  --ncsc-teal-bg:          #d6f3f1;
  --ncsc-code-pink:        #a91459;

  /* Status */
  --ncsc-critical:         #e3344b;
  --ncsc-critical-muted:   #b00824;
  --ncsc-critical-bg:      #fde7eb;
  --ncsc-polite:           #15b500;
  --ncsc-polite-muted:     #0a6b00;
  --ncsc-polite-bg:        #dcf6d4;

  /* Tier surfaces (used by .doc-card, .row, .ncsc-tag) */
  --tier-standard-bg:      transparent;
  --tier-standard-edge:    var(--ncsc-grey-light);
  --tier-restricted-bg:    #f1f6fb;
  --tier-restricted-edge:  #b6cce4;
  --tier-strict-bg:        #fff7e1;
  --tier-strict-edge:      #ecca6e;

  /* Neutrals — extended ramp */
  --ncsc-black:            #0a0c12;
  --ncsc-grey-dark:        #2a2f3a;
  --ncsc-grey:             #5a6172;
  --ncsc-grey-mid:         #8a93a4;
  --ncsc-grey-light:       #b9c0cc;
  --ncsc-grey-x-light:     #e1e5ec;
  --ncsc-grey-bg:          #f4f6f9;
  --ncsc-grey-soft:        #fafbfc;
  --ncsc-white:            #ffffff;

  /* Type */
  --ncsc-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --ncsc-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --ncsc-r: 4px;            /* Slightly softer than NCSC's 2px — feels more app, less webpage */
  --ncsc-r-md: 6px;
  --ncsc-r-lg: 10px;

  /* Spacing scale (tight + readable) */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px;
  --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(13, 31, 74, 0.04), 0 0 0 1px rgba(13, 31, 74, 0.04);
  --shadow-md: 0 2px 6px -1px rgba(13, 31, 74, 0.08), 0 0 0 1px rgba(13, 31, 74, 0.06);
  --shadow-lg: 0 12px 32px -8px rgba(13, 31, 74, 0.18), 0 0 0 1px rgba(13, 31, 74, 0.06);
  --shadow-xl: 0 24px 60px -16px rgba(13, 31, 74, 0.30);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--ncsc-grey-soft);
  color: var(--ncsc-black);
  font-family: var(--ncsc-font);
  font-size: 13.5px;
  line-height: 1.5;
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--ncsc-blue); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--ncsc-deep-blue); text-decoration-thickness: 2px; }
a:focus, button:focus, input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--ncsc-amber);
  outline-offset: 1px;
  border-radius: var(--ncsc-r);
}
button { font-family: inherit; cursor: pointer; }
code, .mono, .tabular {
  font-family: var(--ncsc-mono);
  font-feature-settings: 'tnum', 'zero';
}
::selection { background: var(--ncsc-deep-blue); color: var(--ncsc-white); }

/* ── Container ─────────────────────────────────────────────────────── */
.ncsc-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Masthead — deep navy, sharper than ncsc.gov.uk for app feel ──── */
.ncsc-masthead {
  background: linear-gradient(180deg, #0d1f4a 0%, #0a1838 100%);
  color: var(--ncsc-white);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 1px 0 rgba(13, 31, 74, 0.12);
}
.ncsc-masthead__inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex; align-items: center; gap: 24px;
}
.ncsc-logo {
  display: flex; align-items: center; gap: 12px;
  color: var(--ncsc-white);
  text-decoration: none;
  border: 0;
  flex: 0 0 auto;
}
.ncsc-logo:hover { text-decoration: none; color: var(--ncsc-white); }
.ncsc-logo__img {
  height: 32px;
  width: auto;
  display: block;
  flex: 0 0 auto;
}
.ncsc-logo__admin-tag {
  display: inline-block;
  background: var(--ncsc-amber);
  color: var(--ncsc-deep-blue);
  font-family: var(--ncsc-font);
  font-weight: 700;
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 3px;
  margin-left: 10px;
}

.ncsc-nav {
  display: flex; align-items: center; gap: 4px;
  flex: 1;
}
.ncsc-nav a {
  color: var(--ncsc-white);
  text-decoration: none;
  font-weight: 400;
  font-size: 14px;
  padding: 8px 12px;
  border: 0;
  display: inline-flex; align-items: center; gap: 8px;
}
.ncsc-nav a:hover {
  color: var(--ncsc-white);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}
.ncsc-nav a.is-active {
  color: var(--ncsc-white);
  text-decoration: underline;
  text-decoration-thickness: 4px;
  text-underline-offset: 6px;
  text-decoration-color: var(--ncsc-amber);
}
.ncsc-nav .count {
  background: var(--ncsc-amber);
  color: var(--ncsc-black);
  font-weight: 700;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: var(--ncsc-r);
}
.ncsc-masthead__actions {
  display: flex; align-items: center; gap: 8px;
}
.ncsc-masthead .icon-btn {
  background: transparent;
  border: 0;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  color: var(--ncsc-white);
  border-radius: var(--ncsc-r);
}
.ncsc-masthead .icon-btn:hover { background: rgba(255,255,255,0.10); }
.ncsc-masthead .icon-btn svg { width: 16px; height: 16px; }
.ncsc-masthead .icon-btn .pip {
  position: absolute; top: 6px; right: 6px;
  min-width: 16px; height: 16px;
  background: var(--ncsc-amber); color: var(--ncsc-black);
  font-size: 10px; font-weight: 700;
  border-radius: 999px;
  display: grid; place-items: center;
  padding: 0 4px;
}
.ncsc-masthead .icon-btn { position: relative; }
.ncsc-user {
  display: flex; align-items: center; gap: 10px;
  padding: 0 12px;
  color: var(--ncsc-white);
}
.ncsc-user__avatar {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  background: var(--ncsc-amber);
  color: var(--ncsc-black);
  border-radius: var(--ncsc-r);
  font-size: 11px; font-weight: 700;
}
.ncsc-user__name { font-size: 13px; font-weight: 600; line-height: 1.1; }
.ncsc-user__role { font-size: 11px; color: rgba(255,255,255,0.65); }
.ncsc-signout {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.40);
  color: var(--ncsc-white);
  padding: 6px 12px;
  border-radius: var(--ncsc-r);
  font-size: 13px;
  font-weight: 600;
  margin-left: 8px;
}
.ncsc-signout:hover { background: rgba(255,255,255,0.10); }

/* ── Phase / context strip — NCSC's "phase banner" pattern ─────────── */
.ncsc-phase {
  background: var(--ncsc-grey-bg);
  border-bottom: 1px solid var(--ncsc-grey-x-light);
  padding: 8px 0;
}
.ncsc-phase__operator {
  max-width: 1320px;
  margin: 4px auto 0;
  padding: 6px 24px 0;
  border-top: 1px dashed var(--ncsc-grey-x-light);
  font-family: var(--ncsc-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--ncsc-grey);
  text-transform: uppercase;
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
}
.ncsc-phase__operator strong { color: var(--ncsc-deep-blue); font-weight: 700; }
@media (max-width: 640px) {
  .ncsc-phase__operator { padding: 6px 14px 0; font-size: 10px; gap: 6px; }
}
.ncsc-phase__inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex; align-items: center; gap: 14px;
  font-size: 12px;
  flex-wrap: wrap;
}
.ncsc-phase .ncsc-tag {
  background: var(--ncsc-amber);
  color: var(--ncsc-black);
  padding: 2px 8px;
  border-radius: var(--ncsc-r);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  flex: 0 0 auto;
}
.ncsc-phase__item {
  color: var(--ncsc-grey-dark);
}
.ncsc-phase__item strong { color: var(--ncsc-black); font-weight: 600; }
.ncsc-phase__sep { color: var(--ncsc-grey-light); }
.ncsc-phase__grow { flex: 1; }

/* ── Page chrome ───────────────────────────────────────────────────── */
.ncsc-page {
  background: var(--ncsc-white);
  min-height: calc(100vh - 70px);
}
.ncsc-page__head {
  padding: 18px 0 16px;
  border-bottom: 1px solid var(--ncsc-grey-x-light);
  background: var(--ncsc-white);
}
.ncsc-breadcrumb {
  font-size: 12.5px;
  color: var(--ncsc-grey);
  margin-bottom: 8px;
}
.ncsc-breadcrumb a { color: var(--ncsc-blue); }
.ncsc-breadcrumb .sep { color: var(--ncsc-grey-light); margin: 0 6px; }

.ncsc-h1 {
  font-family: var(--ncsc-font);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -0.022em;
  color: var(--ncsc-black);
  margin: 0 0 4px;
}
.ncsc-lead {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ncsc-grey);
  max-width: 80ch;
  margin: 0;
}

.ncsc-section {
  padding: 20px 0 12px;
}
.ncsc-section--grey { background: var(--ncsc-grey-bg); }
.ncsc-section h2 {
  font-family: var(--ncsc-font);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.2;
  margin: 0 0 12px;
  color: var(--ncsc-black);
}

/* ── Buttons (NCSC's actual three-button family) ───────────────────── */
.ncsc-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  font-family: var(--ncsc-font);
  font-weight: 600;
  font-size: 13px;
  border-radius: var(--ncsc-r);
  border: 1px solid transparent;
  text-decoration: none;
  padding: 7px 14px;
  cursor: pointer;
  transition: background .12s ease, color .12s ease, border-color .12s ease, box-shadow .12s ease, transform .08s ease;
  letter-spacing: -0.005em;
  white-space: nowrap;
}
.ncsc-btn:active { transform: translateY(0.5px); }
.ncsc-btn:focus { outline: 3px solid var(--ncsc-amber); outline-offset: 0; }

.ncsc-btn--primary {
  background: var(--ncsc-deep-blue);
  color: var(--ncsc-white);
  border-color: var(--ncsc-deep-blue);
  box-shadow: 0 1px 2px rgba(13, 31, 74, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.10);
}
.ncsc-btn--primary:hover, .ncsc-btn--primary:focus-visible {
  background: #06143a;
  border-color: #06143a;
  color: var(--ncsc-white);
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(13, 31, 74, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.10);
}
.ncsc-btn--secondary {
  background: var(--ncsc-white);
  color: var(--ncsc-blue);
  border-color: var(--ncsc-blue);
}
.ncsc-btn--secondary:hover {
  background: var(--ncsc-white);
  color: var(--ncsc-blue-hover);
  border-color: var(--ncsc-blue-hover);
  text-decoration: none;
}
.ncsc-btn--black {
  background: var(--ncsc-black);
  color: var(--ncsc-white);
  border-color: var(--ncsc-black);
}
.ncsc-btn--black:hover { background: var(--ncsc-grey-dark); border-color: var(--ncsc-grey-dark); color: var(--ncsc-white); text-decoration: none; }
.ncsc-btn--topic {
  background: var(--ncsc-amber);
  color: var(--ncsc-black);
  border-color: var(--ncsc-amber);
}
.ncsc-btn--topic:hover { background: var(--ncsc-amber-active); border-color: var(--ncsc-amber-active); color: var(--ncsc-black); text-decoration: none; }
.ncsc-btn--ghost {
  background: transparent;
  color: var(--ncsc-blue);
  border-color: transparent;
  padding-left: 0; padding-right: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.ncsc-btn--ghost:hover { color: var(--ncsc-blue-hover); text-decoration-thickness: 2px; }
.ncsc-btn[disabled], .ncsc-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.ncsc-btn--block { width: 100%; }
.ncsc-btn--sm { padding: 5px 11px; font-size: 12.5px; }

/* ── Cards ─────────────────────────────────────────────────────────── */
.ncsc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.ncsc-grid--3 { grid-template-columns: repeat(3, 1fr); }
.ncsc-grid--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 880px) {
  .ncsc-grid--3, .ncsc-grid--2 { grid-template-columns: 1fr; }
}

.ncsc-card {
  background: var(--ncsc-white);
  border: 1px solid var(--ncsc-grey-x-light);
  border-radius: var(--ncsc-r-md);
  box-shadow: var(--shadow-sm);
  padding: 16px 18px;
  text-decoration: none;
  color: var(--ncsc-black);
  display: flex; flex-direction: column;
  transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease;
  position: relative;
}
a.ncsc-card { cursor: pointer; }
a.ncsc-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--ncsc-blue);
  text-decoration: none;
  color: var(--ncsc-black);
  transform: translateY(-1px);
}
a.ncsc-card:hover .ncsc-card__title { color: var(--ncsc-deep-blue); }
.ncsc-card__icon {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: var(--ncsc-blue-muted);
  color: var(--ncsc-deep-blue);
  border-radius: var(--ncsc-r);
  margin-bottom: 10px;
}
.ncsc-card__icon svg { width: 16px; height: 16px; }
.ncsc-card--amber .ncsc-card__icon { background: var(--ncsc-amber-bg); color: var(--ncsc-grey-dark); }
.ncsc-card--green .ncsc-card__icon { background: var(--ncsc-polite-bg); color: var(--ncsc-polite-muted); }
.ncsc-card__title {
  font-family: var(--ncsc-font);
  font-weight: 700;
  font-size: 17px;
  line-height: 1.2;
  margin: 0 0 4px;
  color: var(--ncsc-blue);
}
.ncsc-card__lead {
  font-size: 13px;
  color: var(--ncsc-grey-dark);
  margin: 0 0 10px;
  line-height: 1.5;
}
.ncsc-card__list {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
}
.ncsc-card__list li {
  border-top: 1px solid var(--ncsc-grey-x-light);
  padding: 6px 0;
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}
.ncsc-card__list li:first-child { border-top: 0; }
.ncsc-card__list .key { color: var(--ncsc-grey); flex: 0 0 auto; }
/* min-width: 0 + flex shrink so the val truncates with ellipsis instead of
   ballooning the parent card past the viewport on narrow screens. */
.ncsc-card__list .val {
  color: var(--ncsc-black); font-weight: 500; text-align: right;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0; flex: 1 1 auto;
}
.ncsc-card__cta {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--ncsc-grey-x-light);
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 700;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ncsc-blue);
}

/* Stat tile — institutional KPI block */
.ncsc-stat {
  background: var(--ncsc-white);
  border: 1px solid var(--ncsc-grey-x-light);
  border-radius: var(--ncsc-r-md);
  box-shadow: var(--shadow-sm);
  padding: 12px 16px;
  position: relative;
  overflow: hidden;
}
.ncsc-stat::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--ncsc-deep-blue);
  opacity: 0.7;
}
.ncsc-stat--accent::before { background: var(--ncsc-amber); }
.ncsc-stat--ok::before { background: var(--ncsc-polite); }
.ncsc-stat--warn::before { background: var(--ncsc-amber); }
.ncsc-stat--teal::before { background: var(--ncsc-teal); }
.ncsc-stat__label {
  font-size: 10.5px; font-weight: 600;
  color: var(--ncsc-grey);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.ncsc-stat__value {
  font-size: 24px;
  font-weight: 700;
  color: var(--ncsc-black);
  line-height: 1.05;
  margin-bottom: 2px;
  font-feature-settings: 'tnum';
  letter-spacing: -0.022em;
}
.ncsc-stat__delta {
  font-size: 11.5px; color: var(--ncsc-grey);
}

/* Tag / badge — institutional pill, sharper */
.ncsc-tag {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--ncsc-grey-bg);
  color: var(--ncsc-grey-dark);
  padding: 2px 7px;
  border-radius: 3px;
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
  font-feature-settings: 'tnum';
  line-height: 1.6;
}
.ncsc-tag--amber { background: var(--ncsc-amber-bg); color: #7a4900; border-color: rgba(242, 169, 0, 0.30); }
.ncsc-tag--blue { background: var(--ncsc-blue-muted); color: var(--ncsc-deep-blue); border-color: rgba(43, 112, 185, 0.20); }
.ncsc-tag--green { background: var(--ncsc-polite-bg); color: var(--ncsc-polite-muted); border-color: rgba(10, 107, 0, 0.20); }
.ncsc-tag--red { background: var(--ncsc-critical-bg); color: var(--ncsc-critical-muted); border-color: rgba(176, 8, 36, 0.20); }
.ncsc-tag--navy { background: var(--ncsc-deep-blue); color: var(--ncsc-white); }
.ncsc-tag--teal { background: var(--ncsc-teal-bg); color: var(--ncsc-teal-muted); border-color: rgba(0, 98, 106, 0.20); }

/* Notice / banner */
.ncsc-notice {
  border-left: 6px solid var(--ncsc-deep-blue);
  background: var(--ncsc-grey-bg);
  padding: 16px 20px;
  margin: 20px 0;
}
.ncsc-notice strong { font-weight: 700; }
.ncsc-notice--warn { border-left-color: var(--ncsc-amber); background: var(--ncsc-amber-bg); }
.ncsc-notice--green { border-left-color: var(--ncsc-polite); background: var(--ncsc-polite-bg); }
.ncsc-notice--red { border-left-color: var(--ncsc-critical); background: var(--ncsc-critical-bg); }

/* Tables */
.ncsc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.ncsc-table th {
  text-align: left;
  font-weight: 700;
  font-size: 11.5px;
  padding: 8px 12px;
  border-bottom: 2px solid var(--ncsc-deep-blue);
  color: var(--ncsc-black);
  background: var(--ncsc-grey-bg);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ncsc-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--ncsc-grey-x-light);
  vertical-align: top;
}
.ncsc-table tr:hover td { background: var(--ncsc-grey-bg); }

/* Inputs */
.ncsc-field { margin-bottom: 14px; }
.ncsc-field__label {
  display: block;
  font-weight: 700;
  font-size: 13px;
  color: var(--ncsc-black);
  margin-bottom: 4px;
}
.ncsc-field__hint {
  display: block;
  font-size: 12px;
  color: var(--ncsc-grey);
  margin-bottom: 4px;
}
.ncsc-field input[type="text"], .ncsc-field input[type="email"], .ncsc-field input[type="password"],
.ncsc-field input[type="number"], .ncsc-field input[type="date"],
.ncsc-field select, .ncsc-field textarea {
  width: 100%;
  font-family: var(--ncsc-font);
  font-size: 13.5px;
  border: 1px solid var(--ncsc-grey-light);
  border-radius: var(--ncsc-r);
  padding: 7px 10px;
  background: var(--ncsc-white);
  color: var(--ncsc-black);
}
.ncsc-field input:focus, .ncsc-field select:focus, .ncsc-field textarea:focus {
  outline: 3px solid var(--ncsc-amber);
  outline-offset: 0;
  border-color: var(--ncsc-blue);
}
.ncsc-field--error input,
.ncsc-field--error select,
.ncsc-field--error textarea { border-color: var(--ncsc-critical-muted); }
.ncsc-field__error {
  color: var(--ncsc-critical-muted);
  font-weight: 700;
  font-size: 14px;
  margin-top: 6px;
}

/* Footer — slim compliance strip */
.ncsc-footer {
  background: var(--ncsc-deep-blue);
  color: var(--ncsc-white);
  margin-top: 32px;
  border-top: 3px solid var(--ncsc-amber);
}
.ncsc-footer__strip {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 10px 24px;
  flex-wrap: wrap;
}
.ncsc-footer__seal {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px;
  color: rgba(255,255,255,0.85);
  font-weight: 500;
  letter-spacing: 0.01em;
}
.ncsc-footer__lock {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  background: var(--ncsc-amber);
  color: var(--ncsc-deep-blue);
  border-radius: var(--ncsc-r);
}
.ncsc-footer__lock svg { width: 13px; height: 13px; }
.ncsc-footer__compliance {
  display: flex; flex-wrap: wrap; gap: 5px;
}
.ncsc-footer .ncsc-tag {
  background: rgba(255,255,255,0.10);
  color: var(--ncsc-white);
  font-size: 10.5px;
  padding: 2px 7px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

@media (max-width: 880px) {
  .ncsc-h1 { font-size: 32px; }
}
@media (max-width: 580px) {
  .ncsc-masthead__inner { flex-wrap: wrap; gap: 12px; }
  .ncsc-nav { order: 3; flex-basis: 100%; overflow-x: auto; }
  .ncsc-footer__strip { justify-content: flex-start; }
  .ncsc-h1 { font-size: 26px; }
}

/* ── Auth pages ────────────────────────────────────────────────────── */
.ncsc-auth-page {
  min-height: 100vh;
  display: grid; place-items: center;
  background: var(--ncsc-grey-bg);
  padding: 32px 24px;
}
.ncsc-auth-card {
  width: min(440px, 100%);
  background: var(--ncsc-white);
  border: 1px solid var(--ncsc-grey-light);
  border-top: 8px solid var(--ncsc-deep-blue);
  border-radius: var(--ncsc-r);
  padding: 32px 36px;
}
.ncsc-auth-card .ncsc-logo { margin-bottom: 20px; }
.ncsc-auth-card .ncsc-logo__shield { background: var(--ncsc-deep-blue); color: var(--ncsc-white); }
.ncsc-auth-card .ncsc-logo__text { color: var(--ncsc-black); }
.ncsc-auth-card .ncsc-logo__sub { color: var(--ncsc-grey); }

/* Auth-card logo lockup — white logo on a deep-navy plate so the
   white-on-transparent SVG is visible on light auth cards */
.ncsc-auth-logo {
  display: inline-flex; align-items: center;
  background: var(--ncsc-deep-blue);
  padding: 14px 18px;
  border-radius: var(--ncsc-r);
  margin-bottom: 22px;
}
.ncsc-auth-logo__img {
  height: 36px;
  width: auto;
  display: block;
}
.ncsc-auth-card h1 {
  font-family: var(--ncsc-font);
  font-weight: 700;
  font-size: 28px;
  margin: 0 0 8px;
  color: var(--ncsc-black);
}
.ncsc-auth-card .ncsc-lead { font-size: 16px; margin-bottom: 22px; }
.ncsc-auth-card .ncsc-foot {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--ncsc-grey-x-light);
  font-size: 14px;
  color: var(--ncsc-grey);
}

/* Remember-me checkbox */
.ncsc-remember {
  display: flex; align-items: center; gap: 8px;
  margin: 4px 0 14px;
  font-size: 12.5px;
  color: var(--ncsc-grey-dark);
  cursor: pointer;
  user-select: none;
}
.ncsc-remember input[type="checkbox"] {
  width: 16px; height: 16px;
  margin: 0;
  accent-color: var(--ncsc-deep-blue);
  cursor: pointer;
}

/* OTP / file-number entry */
.ncsc-otp {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px;
  margin-bottom: 18px;
}
.ncsc-otp input {
  text-align: center;
  font-family: var(--ncsc-font);
  font-size: 24px;
  font-weight: 700;
  padding: 12px 0;
}

/* ── Dashboard widgets ─────────────────────────────────────────────── */
.ncsc-widget-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (max-width: 880px) { .ncsc-widget-grid { grid-template-columns: 1fr; } }

/* Mailbox layout */
.ncsc-mailbox {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 16px;
  align-items: flex-start;
}
@media (max-width: 880px) { .ncsc-mailbox { grid-template-columns: 1fr; } }
.ncsc-folders {
  background: var(--ncsc-white);
  padding: 0;
}
.ncsc-folders .ncsc-btn { width: 100%; margin-bottom: 10px; }
.ncsc-folders__list {
  list-style: none; margin: 0; padding: 0;
  border: 1px solid var(--ncsc-grey-light);
  border-radius: var(--ncsc-r);
  overflow: hidden;
}
.ncsc-folder {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--ncsc-grey-x-light);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--ncsc-black);
}
.ncsc-folder:last-child { border-bottom: 0; }
.ncsc-folder:hover { background: var(--ncsc-grey-bg); }
.ncsc-folder.is-active {
  background: var(--ncsc-deep-blue);
  color: var(--ncsc-white);
  border-left: 3px solid var(--ncsc-amber);
  padding-left: 9px;
}
.ncsc-folder.is-active .count { color: var(--ncsc-white); }
.ncsc-folder .left { display: flex; align-items: center; gap: 8px; }
.ncsc-folder svg { width: 14px; height: 14px; opacity: 0.85; }
.ncsc-folder .count { font-size: 11.5px; font-weight: 700; color: var(--ncsc-grey); }

.ncsc-list {
  background: var(--ncsc-white);
  border: 1px solid var(--ncsc-grey-light);
  border-radius: var(--ncsc-r);
  overflow: hidden;
}
.ncsc-list__head {
  padding: 10px 14px;
  border-bottom: 2px solid var(--ncsc-deep-blue);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--ncsc-white);
}
.ncsc-list__head h2 {
  font-family: var(--ncsc-font);
  font-size: 14px; font-weight: 700;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ncsc-list__meta { font-size: 12px; color: var(--ncsc-grey); }
.ncsc-list__meta a { font-weight: 700; }

.ncsc-row {
  display: grid;
  grid-template-columns: 20px 28px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 14px;
  border-bottom: 1px solid var(--ncsc-grey-x-light);
  cursor: pointer;
  background: var(--ncsc-white);
}
.ncsc-row:last-child { border-bottom: 0; }
.ncsc-row:hover { background: var(--ncsc-grey-bg); }
.ncsc-row.is-unread { background: var(--ncsc-blue-muted); border-left: 3px solid var(--ncsc-blue); padding-left: 11px; }
.ncsc-row.is-unread .from-name, .ncsc-row.is-unread .subject { font-weight: 700; }
.ncsc-row.is-locked {
  background: var(--ncsc-amber-bg);
  border-left: 3px solid var(--ncsc-amber);
  padding-left: 11px;
  cursor: not-allowed;
}
.ncsc-row .star {
  width: 20px; height: 20px;
  display: grid; place-items: center;
  cursor: pointer;
  color: var(--ncsc-grey-light);
}
.ncsc-row .star.is-starred { color: var(--ncsc-amber); }
.ncsc-row .star svg { width: 14px; height: 14px; }
.ncsc-row .ava {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  background: var(--ncsc-grey-bg);
  color: var(--ncsc-black);
  border-radius: var(--ncsc-r);
  font-weight: 700;
  font-size: 11px;
}
.ncsc-row .ava--counsel { background: var(--ncsc-blue-muted); color: var(--ncsc-deep-blue); }
.ncsc-row .ava--ceo { background: var(--ncsc-polite-bg); color: var(--ncsc-polite-muted); }
.ncsc-row .ava--cfo { background: var(--ncsc-amber-bg); color: var(--ncsc-grey-dark); }
.ncsc-row .ava--self { background: var(--ncsc-deep-blue); color: var(--ncsc-white); }
.ncsc-row .body { min-width: 0; }
.ncsc-row .top { display: flex; align-items: baseline; gap: 6px; }
.ncsc-row .from-name { font-weight: 600; font-size: 13px; color: var(--ncsc-black); }
.ncsc-row .from-email { font-size: 11.5px; color: var(--ncsc-grey); }
.ncsc-row .subject { font-size: 13px; color: var(--ncsc-grey-dark); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ncsc-row .preview { font-size: 11.5px; color: var(--ncsc-grey); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ncsc-row .meta { font-size: 11.5px; color: var(--ncsc-grey); white-space: nowrap; }

/* Document card — institutional, slim row */
.ncsc-doc-card {
  background: var(--ncsc-white);
  border: 1px solid var(--ncsc-grey-x-light);
  border-radius: var(--ncsc-r);
  box-shadow: var(--shadow-sm);
  padding: 9px 14px;
  margin-bottom: 6px;
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 12px;
  align-items: center;
  position: relative;
  transition: box-shadow .15s ease, border-color .15s ease;
}
.ncsc-doc-card:hover { box-shadow: var(--shadow-md); border-color: var(--ncsc-grey-light); }
.ncsc-doc-card.is-done { border-left: 3px solid var(--ncsc-polite); padding-left: 16px; }
.ncsc-doc-card.is-restricted { background: var(--tier-restricted-bg); border-color: var(--tier-restricted-edge); }
.ncsc-doc-card.is-strict { background: var(--tier-strict-bg); border-color: var(--tier-strict-edge); }
.ncsc-doc-card.is-locked {
  background: var(--tier-strict-bg);
  border-color: var(--tier-strict-edge);
  border-left: 3px solid var(--ncsc-amber);
  padding-left: 16px;
}
.ncsc-doc-card .ext {
  width: 32px; height: 36px;
  display: grid; place-items: center;
  background: var(--ncsc-grey-bg);
  border: 1px solid var(--ncsc-grey-x-light);
  border-radius: 3px;
  font-family: var(--ncsc-mono);
  font-size: 9px; font-weight: 700;
  color: var(--ncsc-grey-dark);
  letter-spacing: 0.02em;
}
.ncsc-doc-card.is-done .ext { background: var(--ncsc-polite-bg); border-color: var(--ncsc-polite); color: var(--ncsc-polite-muted); }
.ncsc-doc-card.is-locked .ext { background: var(--ncsc-amber); border-color: var(--ncsc-amber); color: var(--ncsc-black); }
.ncsc-doc-card .head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 1px;
}
.ncsc-doc-card .name {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--ncsc-black);
  letter-spacing: -0.005em;
}
.ncsc-doc-card .meta {
  font-size: 11px;
  color: var(--ncsc-grey);
  font-variant-numeric: tabular-nums;
}
.ncsc-doc-card .actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ncsc-doc-card .signed-line {
  margin-top: 6px;
  color: var(--ncsc-polite-muted);
  font-size: 12px;
  font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px;
}
.ncsc-doc-card .signed-line::before {
  content: ''; width: 6px; height: 6px;
  background: var(--ncsc-polite-muted); border-radius: 50%;
}

/* Workflow stage dots — Drafted → Sent → Signed → Recorded */
.doc-stages {
  display: inline-flex; align-items: center; gap: 0;
  margin-top: 8px;
  font-size: 10px;
  color: var(--ncsc-grey);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
}
.doc-stage {
  display: inline-flex; align-items: center; gap: 5px;
  padding-right: 12px;
  position: relative;
}
.doc-stage:not(:last-child)::after {
  content: '';
  width: 16px; height: 1px;
  background: var(--ncsc-grey-x-light);
  margin-right: 5px;
}
.doc-stage__dot {
  width: 8px; height: 8px;
  border: 1.5px solid var(--ncsc-grey-light);
  background: var(--ncsc-white);
  border-radius: 50%;
  flex: 0 0 8px;
}
.doc-stage--done .doc-stage__dot {
  background: var(--ncsc-polite-muted);
  border-color: var(--ncsc-polite-muted);
}
.doc-stage--done { color: var(--ncsc-polite-muted); }
.doc-stage--active .doc-stage__dot {
  background: var(--ncsc-amber);
  border-color: var(--ncsc-amber);
  box-shadow: 0 0 0 3px rgba(242, 169, 0, 0.20);
}
.doc-stage--active { color: #7a4900; }

/* Activity feed */
.ncsc-activity {
  background: var(--ncsc-white);
  border: 1px solid var(--ncsc-grey-light);
  border-radius: var(--ncsc-r);
  overflow: hidden;
}
.ncsc-activity__row {
  display: grid; grid-template-columns: 120px 1fr;
  gap: 14px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--ncsc-grey-x-light);
  font-size: 13px;
}
.ncsc-activity__row:last-child { border-bottom: 0; }
.ncsc-activity__when { color: var(--ncsc-grey); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.ncsc-activity__what { color: var(--ncsc-black); font-weight: 600; font-size: 13px; }
.ncsc-activity__who { color: var(--ncsc-grey); font-size: 11.5px; margin-top: 2px; }

/* Modal */
.ncsc-modal-host { position: relative; z-index: 200; }
.ncsc-modal-back {
  position: fixed; inset: 0;
  background: rgba(17,34,85,0.55);
  display: grid; place-items: center;
  padding: 32px;
  z-index: 200;
  animation: fade .15s ease;
}
.ncsc-modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 64px);
  overflow: auto;
  background: var(--ncsc-white);
  border-radius: var(--ncsc-r);
  border-top: 8px solid var(--ncsc-deep-blue);
  padding: 28px 32px;
  animation: rise .18s ease;
}
.ncsc-modal { position: relative; }
.ncsc-modal__x {
  position: absolute; top: 10px; right: 12px;
  background: transparent; border: 0;
  font-size: 14px; line-height: 1;
  color: var(--ncsc-grey);
  cursor: pointer;
  padding: 6px 9px;
  border-radius: var(--ncsc-r);
  z-index: 5;
}
.ncsc-modal__x:hover {
  background: var(--ncsc-grey-x-light);
  color: var(--ncsc-deep-blue);
}
.ncsc-modal h3 {
  font-family: var(--ncsc-font);
  font-size: 24px; font-weight: 700;
  margin: 0 0 6px; color: var(--ncsc-black);
  padding-right: 32px;
}
.ncsc-modal .sub { font-size: 16px; color: var(--ncsc-grey-dark); margin: 0 0 22px; }
.ncsc-modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Toast */
.ncsc-toast {
  position: fixed; right: 24px; bottom: 24px; z-index: 300;
  background: var(--ncsc-deep-blue);
  color: var(--ncsc-white);
  padding: 12px 18px;
  border-radius: var(--ncsc-r);
  border-left: 4px solid var(--ncsc-amber);
  font-size: 15px;
  font-weight: 500;
  box-shadow: 0 8px 32px -8px rgba(0,0,0,0.30);
  opacity: 0; transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease;
}
.ncsc-toast.in { opacity: 1; transform: translateY(0); }

/* Secure-progress overlay */
.ncsc-secure-back {
  position: fixed; inset: 0;
  background: rgba(17,34,85,0.66);
  display: grid; place-items: center;
  z-index: 250;
  padding: 32px;
}
.ncsc-secure-card {
  background: var(--ncsc-white);
  width: min(460px, 100%);
  border-radius: var(--ncsc-r);
  border-top: 8px solid var(--ncsc-deep-blue);
  padding: 28px 32px;
  animation: rise .25s ease;
}
.ncsc-secure-card .lock {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: var(--ncsc-blue-muted);
  color: var(--ncsc-deep-blue);
  border: 1px solid var(--ncsc-deep-blue);
  border-radius: var(--ncsc-r);
  margin-bottom: 14px;
}
.ncsc-secure-card .label {
  font-weight: 700; font-size: 12px;
  color: var(--ncsc-deep-blue);
  letter-spacing: 0.04em; text-transform: uppercase;
  margin-bottom: 4px;
}
.ncsc-secure-card .title {
  font-size: 22px; font-weight: 700; color: var(--ncsc-black); margin-bottom: 18px;
}
.ncsc-secure-card .steps {
  list-style: none; margin: 0; padding: 0;
  font-size: 15px;
}
.ncsc-secure-card .step {
  display: grid; grid-template-columns: 24px 1fr;
  gap: 12px; padding: 6px 0;
  color: var(--ncsc-grey-light);
  opacity: 0; transform: translateX(-4px);
  transition: opacity .25s, transform .25s, color .25s;
}
.ncsc-secure-card .step.in { opacity: 1; transform: translateX(0); }
.ncsc-secure-card .step.done { color: var(--ncsc-black); }
.ncsc-secure-card .step.active { color: var(--ncsc-blue); }
.ncsc-secure-card .step .ic { display: grid; place-items: center; }
.ncsc-secure-card .step .ic .spin {
  width: 14px; height: 14px;
  border: 2px solid var(--ncsc-blue);
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Audit ledger — hash-chain row */
.ledger-row {
  display: grid;
  grid-template-columns: 56px 32px 1fr;
  gap: 0;
  padding: 12px 14px;
  border-bottom: 1px solid var(--ncsc-grey-x-light);
  background: var(--ncsc-white);
}
.ledger-row:last-child { border-bottom: 0; }
.ledger-row:hover { background: var(--ncsc-grey-bg); }
.ledger-row__seq {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--ncsc-grey);
  letter-spacing: 0.04em;
  padding-top: 2px;
}
.ledger-row__rail {
  position: relative;
  display: flex; justify-content: center;
}
.ledger-row__rail::before {
  content: '';
  position: absolute;
  left: 50%; transform: translateX(-50%);
  top: 0; bottom: -12px;
  width: 1px;
  background: var(--ncsc-grey-x-light);
}
.ledger-row:last-child .ledger-row__rail::before { bottom: 50%; }
.ledger-row__node {
  width: 10px; height: 10px;
  background: var(--ncsc-deep-blue);
  border: 2px solid var(--ncsc-white);
  border-radius: 50%;
  margin-top: 4px;
  position: relative; z-index: 1;
  box-shadow: 0 0 0 1px var(--ncsc-grey-light);
}
.ledger-row__body { min-width: 0; }
.ledger-row__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 2px;
}
.ledger-row__what {
  font-size: 13px;
  font-weight: 600;
  color: var(--ncsc-black);
}
.ledger-row__when {
  font-size: 11px;
  color: var(--ncsc-grey);
  font-variant-numeric: tabular-nums;
}
.ledger-row__who {
  font-size: 11.5px;
  color: var(--ncsc-grey);
  margin-bottom: 4px;
}
.ledger-row__hash {
  display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
  background: var(--ncsc-grey-bg);
  border: 1px solid var(--ncsc-grey-x-light);
  border-radius: var(--ncsc-r);
  padding: 3px 8px;
  letter-spacing: 0;
}
.ledger-row__hash-k {
  color: var(--ncsc-grey);
  text-transform: uppercase;
  font-size: 9.5px;
  letter-spacing: 0.06em;
  font-weight: 700;
}
.ledger-row__hash-v {
  color: var(--ncsc-grey-dark);
  font-weight: 500;
}
.ledger-row__hash-v--curr { color: var(--ncsc-deep-blue); font-weight: 700; }
.ledger-row__hash-arrow { color: var(--ncsc-grey-light); }

/* Session pill in phase strip */
.ncsc-session-pill {
  display: inline-flex !important; align-items: center; gap: 6px;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
  font-size: 11.5px !important;
  color: var(--ncsc-grey-dark);
}
.ncsc-session-pill__dot {
  width: 6px; height: 6px;
  background: var(--ncsc-polite);
  border-radius: 50%;
  display: inline-block;
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* Lock overlay (idle auto-lock) */
.ncsc-lock-overlay {
  position: fixed; inset: 0;
  background: rgba(17, 34, 85, 0.94);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9999;
  display: grid; place-items: center;
  padding: 24px;
  animation: fade .2s ease;
}
.ncsc-lock-card {
  width: min(420px, 100%);
  background: var(--ncsc-white);
  border-top: 6px solid var(--ncsc-amber);
  border-radius: var(--ncsc-r);
  padding: 26px 30px 24px;
  box-shadow: 0 32px 60px -20px rgba(0, 0, 0, 0.5);
  animation: rise .25s ease;
}
.ncsc-lock-card__icon {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: var(--ncsc-amber-bg);
  color: var(--ncsc-amber-active);
  border-radius: var(--ncsc-r);
  margin: 0 auto 12px;
}
.ncsc-lock-card__icon svg { width: 20px; height: 20px; }
.ncsc-lock-card__label {
  font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ncsc-amber-active);
  text-align: center;
  margin-bottom: 4px;
}
.ncsc-lock-card h2 {
  font-size: 19px; font-weight: 700;
  text-align: center;
  margin: 0 0 6px;
  color: var(--ncsc-black);
}
.ncsc-lock-card p {
  font-size: 12.5px; color: var(--ncsc-grey);
  text-align: center;
  margin: 0 0 16px;
  line-height: 1.5;
}

/* Signed stamp on doc preview */
.ncsc-stamp {
  position: absolute; top: 24px; right: 24px;
  border: 3px solid var(--ncsc-polite-muted);
  color: var(--ncsc-polite-muted);
  padding: 6px 14px;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  transform: rotate(-7deg);
  background: rgba(208,255,199,0.7);
}

/* ── Field-based signing — Client-side PDF overlays ──────────────────── */
.pdf-page-wrap {
  position: relative;
  margin: 0 auto 16px;
  user-select: none;
  background: white;
  box-shadow: 0 4px 18px rgba(0,0,0,0.32);
  max-width: 880px;
}
.pdf-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}
.field-box {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  border-radius: 3px;
  font-family: var(--ncsc-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.10s ease;
}
.field-box--signature {
  border: 2px dashed rgba(242,169,0,0.95);
  background: rgba(242,169,0,0.18);
  color: #8a5a00;
  animation: pulseAmber 1.8s ease-in-out infinite;
}
.field-box--date,
.field-box--name,
.field-box--initials,
.field-box--text {
  border: 2px dashed rgba(43,112,185,0.85);
  background: rgba(43,112,185,0.14);
  color: var(--ncsc-deep-blue);
}
.field-box.is-clickable { cursor: pointer; }
.field-box.is-clickable:hover { transform: scale(1.02); background: rgba(242,169,0,0.30); }
.field-box.is-filled {
  border: 1px solid rgba(40,167,69,0.40);
  background: rgba(255,255,255,0.0);
  animation: none;
}
.field-box.is-filled:hover { background: rgba(40,167,69,0.06); }
.field-box__label { padding: 0 6px; pointer-events: none; white-space: nowrap; }
.field-box__value {
  padding: 0 4px;
  font-family: 'Allura', cursive;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ncsc-deep-blue);
}
@keyframes pulseAmber {
  0%, 100% { box-shadow: 0 0 0 0 rgba(242,169,0,0.40); }
  50%      { box-shadow: 0 0 0 6px rgba(242,169,0,0); }
}

.sign-counter {
  font-family: var(--ncsc-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ncsc-deep-blue);
  padding: 10px 14px;
  background: var(--ncsc-grey-bg);
  border-radius: var(--ncsc-r);
  text-align: center;
}
.sign-counter.is-done {
  background: rgba(40,167,69,0.10);
  color: #1e6d33;
}

/* ── Signature block rendered below a Client-side message body ────────── */
.mbx__msg-signature {
  margin: 18px 0 0;
  padding: 12px 14px 4px;
  border-top: 1px dashed var(--ncsc-grey-x-light);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ncsc-grey-dark, var(--ncsc-black));
}
.mbx__msg-signature img { max-width: 220px; max-height: 90px; vertical-align: middle; }
.mbx__msg-signature a { color: var(--ncsc-deep-blue); }

/* Mobile-only back-to-inbox pill — overridden to inline-flex in the
   ≤640px @media block below. Hidden by default so desktop never sees it. */
.mbx__mobile-back { display: none; }

/* ════════════════════════════════════════════════════════════════════════
   MOBILE — phones (≤640px). Pass over every page-level surface to make the
   Client portal usable on a phone. Desktop is unaffected.
   ════════════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {

  /* Global safety net — clip any stray horizontal overflow from a child element
     so the whole page can't scroll sideways. Vertical scrolling is unaffected. */
  html, body { overflow-x: hidden; max-width: 100%; }
  /* Cards must stay inside their container — no min-width content can push them wider */
  .ncsc-card { min-width: 0; }
  .ncsc-card__list li { min-width: 0; }

  /* iOS auto-zooms <input> when font-size < 16px. Force ≥16px on form fields. */
  input, select, textarea, button { font-size: 16px; }

  /* Tighter page chrome */
  .ncsc-container { padding: 0 14px; }
  .ncsc-section { padding: 18px 0 24px; }
  .ncsc-page__head { padding: 14px 0 6px; }
  .ncsc-h1 { font-size: 22px; line-height: 1.18; }
  .ncsc-lead { font-size: 14px; }

  /* ── Masthead — wrap, scroll nav, hide some labels ─────────────────── */
  .ncsc-masthead__inner {
    flex-wrap: wrap; gap: 10px; padding: 10px 14px;
  }
  .ncsc-logo__img { height: 32px; }
  .ncsc-nav {
    order: 3;
    flex-basis: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 4px;
    margin: 0 -14px;
    padding: 6px 14px;
    border-top: 1px solid rgba(255,255,255,0.08);
  }
  .ncsc-nav a { padding: 8px 10px; font-size: 13px; white-space: nowrap; }
  .ncsc-masthead__actions { gap: 6px; }
  .ncsc-user__name, .ncsc-user__role { display: none; }
  .ncsc-user__avatar { margin-right: 0; }
  .ncsc-signout { padding: 6px 10px; font-size: 12px; }

  /* Phase strip — collapse to two lines, hide separators */
  .ncsc-phase__inner {
    flex-wrap: wrap;
    gap: 6px 12px;
    padding: 8px 14px;
    font-size: 11.5px;
  }
  .ncsc-phase__sep { display: none; }
  .ncsc-phase__grow { display: none; }

  /* ── Modals — full-screen on phones ────────────────────────────────── */
  .ncsc-modal-back {
    align-items: stretch;
    padding: 0;
  }
  .ncsc-modal {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 18px 16px;
    overflow-y: auto;
  }
  /* Modal action rows stack their buttons full-width */
  .ncsc-modal .actions { flex-direction: column; gap: 8px; }
  .ncsc-modal .actions .ncsc-btn { width: 100%; }

  /* ── Mailbox — drill-down navigation (folders → list → reader) ─────── */
  /* The folders sidebar collapses into a horizontal scrolling chip strip
     above the list; selecting a thread swaps the list view for the reader. */
  .mbx {
    grid-template-columns: 1fr !important;
    height: auto !important;
    min-height: calc(100vh - 100px);
  }
  .mbx__sidebar {
    display: block;
    border-right: 0;
    border-bottom: 1px solid var(--ncsc-grey-x-light);
    max-height: 56px;
    overflow: hidden;
    position: relative;
  }
  .mbx__mailbox-info { display: none; }
  .mbx__folder-section-head { display: none; }
  .mbx__folders {
    display: flex !important;
    flex-direction: row !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0;
    padding: 8px 12px;
    border: 0;
  }
  .mbx__folder {
    flex: 0 0 auto;
    border-bottom: 0 !important;
    border-radius: 999px;
    padding: 7px 14px !important;
    font-size: 12.5px;
    background: var(--ncsc-grey-bg);
    margin: 0;
    white-space: nowrap;
  }
  .mbx__folder.is-active { background: var(--ncsc-deep-blue); color: white; }
  .mbx__folder.is-active .mbx__folder-count { color: rgba(255,255,255,0.85); }
  .mbx__folder-icon { width: 14px; height: 14px; }
  /* Drill-down: hide list when reading, hide reader when listing */
  .mbx[data-mobile-view="reader"] .mbx__list { display: none; }
  .mbx[data-mobile-view="reader"] .mbx__sidebar { display: none; }
  .mbx[data-mobile-view="list"]   .mbx__reader { display: none; }
  .mbx__list-head { padding: 12px 14px; }
  .mbx__list-head h1 { font-size: 18px; }
  .mbx__row { padding: 10px 14px; }
  .mbx__reader { padding: 14px; }
  .mbx__msg { padding: 0; }
  .mbx__msg-subject { font-size: 17px; line-height: 1.25; }
  .mbx__msg-body { font-size: 14px; line-height: 1.55; }
  .mbx__attachments-block, .mbx__thread, .mbx__composer { padding: 12px; }
  /* Back-to-list pill (rendered by JS only in mobile drill-down view) */
  .mbx__mobile-back {
    display: inline-flex; align-items: center; gap: 6px;
    background: transparent;
    border: 1px solid var(--ncsc-grey-x-light);
    color: var(--ncsc-deep-blue);
    font-weight: 600;
    font-size: 12.5px;
    padding: 6px 12px;
    border-radius: 999px;
    cursor: pointer;
    margin-bottom: 12px;
  }

  /* ── Document cards — actions row jumps below on mobile ───────────── */
  .ncsc-doc-card {
    padding: 14px;
    gap: 10px;
    /* Two-column grid (icon + body); actions span both columns below */
    grid-template-columns: 40px minmax(0, 1fr);
  }
  .ncsc-doc-card .head { flex-wrap: wrap; }
  .ncsc-doc-card .name {
    /* Long filenames like Payment_Instructions_Legal_Style.pdf must wrap */
    word-break: break-word;
    overflow-wrap: anywhere;
  }
  .ncsc-doc-card .ext { width: 40px; height: 40px; font-size: 11px; }
  .ncsc-doc-card .actions {
    grid-column: 1 / -1;
    flex-wrap: wrap;
    margin-top: 6px;
  }
  .ncsc-doc-card .actions .ncsc-btn { flex: 1 1 auto; min-width: 0; }
  .ncsc-doc-card .row { flex-wrap: wrap; gap: 6px; }

  /* ── Sign modal (3-pane) — stack vertically on phone ───────────────── */
  .ncsc-sign-modal {
    width: 100% !important;
    grid-template-areas: "head" "doc" "side" "foot" !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto auto auto !important;
    height: 100vh !important;
    max-height: 100vh !important;
  }
  .ncsc-sign-modal .smd { padding: 12px; max-height: 40vh; }
  .ncsc-sign-modal .sms { max-height: 40vh; }
  .ncsc-sign-modal .smh { padding: 10px 14px; flex-wrap: wrap; gap: 6px; }
  .ncsc-sign-modal .smh .title { font-size: 13px; flex: 1 1 100%; }

  /* ── Forms — full-width fields, larger touch targets ───────────────── */
  .ncsc-field input, .ncsc-field select, .ncsc-field textarea { width: 100%; }
  .ncsc-field-row { grid-template-columns: 1fr; gap: 10px; }
  .ncsc-btn { padding: 10px 16px; font-size: 14px; min-height: 40px; }
  .ncsc-btn--sm { min-height: 34px; padding: 8px 12px; font-size: 12.5px; }

  /* ── Audit ledger — tighter rail + wrapped hash row ────────────────── */
  .ledger-row { padding: 10px 12px; gap: 10px; }
  .ledger-row__head { flex-direction: column; align-items: flex-start; gap: 2px; }
  .ledger-row__hash { flex-wrap: wrap; font-size: 10.5px; }
  .ledger-row__hash-arrow { display: none; }

  /* ── Footer — single column ────────────────────────────────────────── */
  .ncsc-footer__strip { flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; }

  /* ── Auth pages — full-width cards ─────────────────────────────────── */
  .ncsc-auth-card { padding: 22px 18px; border-radius: 0; border-top: 0; min-height: 100vh; }
  .ncsc-auth-page { padding: 0; }
}

/* Tablet pass — slightly relax phone clamp at 641-880px */
@media (min-width: 641px) and (max-width: 880px) {
  .mbx { grid-template-columns: 1fr 1fr; height: calc(100vh - 100px); }
  .mbx__sidebar { display: none; }
  .ncsc-doc-card { padding: 16px; }
}

/* ── Phone overrides for inline grids set via style="..." ───────────────
   Inline style="grid-template-columns" beats class-based CSS specificity
   regardless of media queries, but selecting on the id [id="kpiRow"] +
   !important is enough to win. The KPI strip appears on every page. */
@media (max-width: 640px) {
  [id="kpiRow"] { grid-template-columns: repeat(2, 1fr) !important; gap: 8px !important; }
  [id="kpiRow"] .ncsc-stat__value { font-size: 18px !important; }
  [id="kpiRow"] .ncsc-stat__label { font-size: 10.5px; }
  [id="kpiRow"] .ncsc-stat__delta { font-size: 10.5px; }
  /* Two-column card grid on the mandate page stacks on phones */
  .ncsc-grid--2 { grid-template-columns: 1fr !important; }
  /* Toast hugs the bottom edge with side gutters so it never goes off-screen */
  .ncsc-toast { right: 12px; left: 12px; bottom: 12px; font-size: 14px; padding: 10px 14px; }
  /* Secure-progress card */
  .ncsc-secure-back { padding: 16px; }
  .ncsc-secure-card { padding: 22px 18px; }
}
