/* SecureMessage Admin
   Trust-first public-sector interface. Self-contained and dependency-free. */

:root {
  --navy-950: #101d33;
  --navy-800: #1e3557;
  --navy-700: #29496f;
  --green-700: #176b50;
  --green-100: #e5f2ec;
  --green-50: #f2f8f5;
  --red-700: #a02f2f;
  --red-100: #f8e8e7;
  --amber-700: #775c13;
  --amber-100: #f7f0d8;
  --gray-950: #17202e;
  --gray-700: #4c5a6a;
  --gray-600: #5f6d7c;
  --gray-300: #cbd3dc;
  --gray-200: #dfe4ea;
  --gray-100: #edf1f4;
  --gray-50: #f6f8fa;
  --white: #ffffff;
  --surface-radius: 10px;
  --control-radius: 6px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --focus: 0 0 0 3px rgba(76, 90, 106, 0.2);
}

* { box-sizing: border-box; }
html { min-width: 320px; color-scheme: light; -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100dvh; background: var(--gray-50); color: var(--gray-950); font-family: var(--font-sans); font-size: 15px; line-height: 1.5; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--navy-700); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0.45rem; color: var(--navy-950); font-size: clamp(1.7rem, 2.5vw, 2.15rem); line-height: 1.2; letter-spacing: -0.025em; }
h2 { margin-bottom: 0.3rem; color: var(--navy-950); font-size: 1.08rem; line-height: 1.3; }
h3 { margin-bottom: 0.25rem; color: var(--navy-950); font-size: 0.98rem; }
p { margin-bottom: 0; color: var(--gray-600); }
:focus-visible { outline: none; box-shadow: var(--focus); }

.app-shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100dvh; }
.workspace { min-width: 0; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1rem 1rem;
  background: var(--white);
  border-right: 1px solid var(--gray-200);
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 0.75rem; color: var(--navy-950); text-decoration: none; }
.brand-mark { width: 38px; height: 38px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 8px; background: var(--green-700); color: var(--white); font-size: 1rem; font-weight: 750; }
.brand-copy { display: grid; line-height: 1.25; }
.brand-copy strong { font-size: 0.97rem; letter-spacing: -0.01em; }
.brand-copy small { margin-top: 2px; color: var(--gray-600); font-size: 0.74rem; font-weight: 500; }
.sidebar-close { display: none; }
.primary-nav { display: grid; gap: 0.3rem; margin-top: 2rem; }
.primary-nav a { position: relative; display: flex; align-items: center; min-height: 42px; padding: 0.62rem 0.75rem 0.62rem 1rem; border-radius: var(--control-radius); color: var(--gray-700); font-weight: 600; text-decoration: none; }
.primary-nav a:hover { background: var(--gray-50); color: var(--navy-950); }
.primary-nav a.active { background: var(--green-100); color: var(--green-700); }
.sidebar-assurance { margin-top: auto; padding: 1rem; border: 1px solid var(--gray-200); border-radius: var(--surface-radius); background: var(--green-50); }
.sidebar-assurance strong { color: var(--green-700); font-size: 0.82rem; }
.sidebar-assurance p { margin-top: 0.25rem; font-size: 0.78rem; line-height: 1.45; }
.account-menu { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0.65rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--gray-200); }
.account-copy { display: grid; min-width: 0; line-height: 1.3; }
.account-copy strong { overflow: hidden; color: var(--navy-950); font-size: 0.84rem; text-overflow: ellipsis; white-space: nowrap; }
.account-copy small { color: var(--gray-600); font-size: 0.72rem; }
.account-menu button, .sidebar-close { padding: 0.35rem 0.5rem; border: 0; background: transparent; color: var(--navy-700); cursor: pointer; font-size: 0.76rem; font-weight: 650; }
.avatar { width: 34px; height: 34px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 50%; background: var(--navy-800); color: var(--white); font-size: 0.78rem; font-weight: 700; }
.mobile-header, .sidebar-scrim { display: none; }
.main { width: min(100%, 1280px); margin: 0 auto; padding: 2.25rem clamp(1.25rem, 3.5vw, 3.5rem) 4rem; }

.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; margin-bottom: 1.75rem; }
.page-header > div { max-width: 680px; }
.page-header p { max-width: 64ch; }
.compact-header { align-items: flex-start; }
.back-link { display: inline-block; margin-bottom: 0.8rem; color: var(--navy-700); font-size: 0.86rem; font-weight: 650; text-decoration: none; }
.back-link:hover { text-decoration: underline; }
.meta-text, .record-count { color: var(--gray-600); font-size: 0.8rem; white-space: nowrap; }

.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; padding: 0.62rem 1rem; border: 1px solid transparent; border-radius: var(--control-radius); cursor: pointer; font-weight: 700; line-height: 1.2; text-align: center; text-decoration: none; white-space: nowrap; transition: background-color 120ms ease, border-color 120ms ease, transform 120ms ease; }
.button:active { transform: translateY(1px); }
.button.primary { background: var(--navy-950); color: var(--white); }
.button.primary:hover { background: var(--navy-800); }
.button.secondary { border-color: var(--gray-300); background: var(--white); color: var(--navy-950); }
.button.secondary:hover { border-color: var(--navy-700); background: var(--gray-50); }
.button.danger { border-color: var(--gray-300); background: var(--white); color: var(--red-700); }
.button.danger:hover { background: var(--red-100); }
.button.wide { width: 100%; }

.system-status, .state { display: inline-flex; align-items: center; gap: 0.42rem; border-radius: 999px; font-size: 0.79rem; font-weight: 700; white-space: nowrap; }
.system-status { padding: 0.4rem 0.7rem; }
.system-status::before, .state::before { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: currentColor; content: ""; }
.system-status.good, .state.ok { background: var(--green-100); color: var(--green-700); }
.system-status.bad, .state.error { background: var(--red-100); color: var(--red-700); }
.state { padding: 0.22rem 0.55rem; }
.state.neutral { background: var(--gray-100); color: var(--gray-700); }

.surface { border: 1px solid var(--gray-200); border-radius: var(--surface-radius); background: var(--white); }
.summary-strip { display: grid; grid-template-columns: 0.85fr 0.85fr 1.3fr; margin-bottom: 1.25rem; overflow: hidden; border: 1px solid var(--gray-200); border-radius: var(--surface-radius); background: var(--white); }
.summary-strip article { display: grid; align-content: start; min-height: 142px; padding: 1.25rem 1.4rem; border-right: 1px solid var(--gray-200); }
.summary-strip article:last-child { border-right: 0; }
.summary-strip span { color: var(--gray-600); font-size: 0.82rem; font-weight: 650; }
.summary-strip strong { margin-top: 0.35rem; color: var(--navy-950); font-size: 2rem; line-height: 1.2; letter-spacing: -0.03em; }
.summary-strip small { align-self: end; margin-top: 0.75rem; color: var(--gray-600); }
.summary-strip .summary-assurance { background: var(--green-50); }
.summary-strip .summary-assurance strong { color: var(--green-700); font-size: 1.3rem; }
.summary-strip a { align-self: end; margin-top: 0.75rem; color: var(--green-700); font-size: 0.84rem; font-weight: 700; }
.executive-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.executive-strip article { min-height: 176px; }
.executive-strip h2 { margin-bottom: 0.6rem; font-size: 1.02rem; }
.executive-strip p { font-size: 0.84rem; line-height: 1.55; }
.visibility-statement, .proof-conclusion { display: flex; gap: 0.55rem; margin-bottom: 1.25rem; padding: 1rem 1.15rem; border: 1px solid var(--gray-200); border-radius: var(--surface-radius); background: var(--white); }
.visibility-statement { align-items: flex-start; }
.visibility-statement h2 { min-width: 265px; margin: 0; font-size: 0.92rem; }
.visibility-statement p { font-size: 0.84rem; }
.proof-conclusion { align-items: baseline; background: var(--green-50); }
.proof-conclusion strong { flex: 0 0 auto; color: var(--green-700); }
.proof-conclusion span { color: var(--navy-950); }
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.dashboard-grid > .surface, .comparison-section, .security-boundary { padding: 1.35rem; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.section-heading.stacked { display: block; }
.section-heading p { font-size: 0.86rem; }
.section-heading a { color: var(--green-700); font-size: 0.84rem; font-weight: 700; }
.service-list, .activity-list { border-top: 1px solid var(--gray-200); }
.service-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.9rem 0; border-bottom: 1px solid var(--gray-200); }
.service-row:last-child, .activity-row:last-child { border-bottom: 0; }
.service-row div { display: grid; }
.service-row strong { color: var(--navy-950); font-size: 0.9rem; }
.service-row small { margin-top: 0.12rem; color: var(--gray-600); }
.activity-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr) auto; gap: 0.75rem; padding: 0.85rem 0; border-bottom: 1px solid var(--gray-200); font-size: 0.84rem; }
.activity-row strong { color: var(--navy-950); }
.activity-row span, .activity-row time { color: var(--gray-600); }
.activity-row time { text-align: right; white-space: nowrap; }
.empty-inline { display: grid; gap: 0.2rem; padding: 1.25rem 0 0.25rem; }
.empty-inline span { color: var(--gray-600); font-size: 0.84rem; }
.assurance-banner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; margin-top: 1.25rem; padding: 1.35rem; border: 1px solid var(--gray-200); border-radius: var(--surface-radius); background: var(--green-50); }
.assurance-banner div { max-width: 750px; }
.assurance-banner p { font-size: 0.88rem; }

.toast { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; padding: 0.85rem 1rem; border: 1px solid var(--gray-300); border-radius: var(--control-radius); background: var(--white); }
.toast.success { border-color: var(--gray-200); background: var(--green-50); color: var(--green-700); }
.toast.error, .inline-alert { border-color: var(--gray-200); background: var(--red-100); color: var(--red-700); }
.toast button { padding: 0.25rem; border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 0.78rem; font-weight: 700; }
.inline-alert { margin-bottom: 1rem; padding: 0.75rem 0.9rem; border-style: solid; border-width: 1px; border-radius: var(--control-radius); }

.table-surface { overflow: visible; }
.table-scroll-hint { display: none; }
.table-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--gray-200); }
.search-field { width: min(100%, 370px); }
.table-wrap { overflow-x: auto; border-radius: inherit; }
table { width: 100%; border-collapse: collapse; font-size: 0.87rem; }
th { padding: 0.75rem 1rem; border-bottom: 1px solid var(--gray-200); background: var(--gray-50); color: var(--gray-700); font-size: 0.72rem; font-weight: 750; letter-spacing: 0.04em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { position: relative; padding: 0.9rem 1rem; border-bottom: 1px solid var(--gray-200); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbfc; }
.identity { display: flex; min-width: 180px; align-items: center; gap: 0.7rem; }
.identity p { display: grid; margin: 0; }
.identity strong { color: var(--navy-950); }
.identity small { color: var(--gray-600); font-family: var(--font-mono); }
.check-text { font-weight: 650; white-space: nowrap; }
.check-text.yes { color: var(--green-700); }
.check-text.no { color: var(--gray-600); }
.device-count { color: var(--navy-700); font-weight: 650; white-space: nowrap; }
.action-cell { width: 1%; white-space: nowrap; }
.more { min-height: 34px; padding: 0.35rem 0.65rem; border: 1px solid var(--gray-300); border-radius: var(--control-radius); background: var(--white); color: var(--navy-700); cursor: pointer; font-size: 0.78rem; font-weight: 700; }
.more:hover { border-color: var(--navy-700); }
.popover { position: absolute; z-index: 20; top: calc(100% - 0.35rem); right: 1rem; display: none; min-width: 210px; padding: 0.35rem; border: 1px solid var(--gray-300); border-radius: var(--surface-radius); background: var(--white); box-shadow: 0 12px 28px rgba(16, 29, 51, 0.16); }
.popover.open { display: block; }
.popover form { margin: 0; }
.popover a, .popover button { display: block; width: 100%; padding: 0.55rem 0.65rem; border: 0; border-radius: var(--control-radius); background: transparent; color: var(--navy-950); cursor: pointer; font-size: 0.84rem; text-align: left; text-decoration: none; }
.popover a:hover, .popover button:hover { background: var(--gray-50); }
.popover .danger { color: var(--red-700); }
.empty-cell { padding: 2.5rem; color: var(--gray-600); text-align: center; }
.empty-cell strong, .empty-cell span { display: block; }
.empty-cell strong { margin-bottom: 0.25rem; color: var(--navy-950); }
.filter-empty { padding: 2rem; color: var(--gray-600); text-align: center; }
.time-cell { white-space: nowrap; }

dialog { width: min(440px, calc(100vw - 2rem)); padding: 0; border: 0; border-radius: var(--surface-radius); box-shadow: 0 24px 64px rgba(16, 29, 51, 0.24); }
dialog::backdrop { background: rgba(16, 29, 51, 0.55); }
.dialog-form { position: relative; display: grid; gap: 1.1rem; padding: 1.5rem; }
.dialog-form p { margin-bottom: 0; }
.dialog-close { position: absolute; top: 0.75rem; right: 0.75rem; padding: 0.35rem 0.45rem; border: 0; background: transparent; color: var(--gray-700); cursor: pointer; font-size: 0.76rem; font-weight: 700; }

.field { display: grid; gap: 0.38rem; }
.field label { color: var(--navy-950); font-size: 0.84rem; font-weight: 700; }
.field small { color: var(--gray-600); font-size: 0.76rem; line-height: 1.4; }
input[type="text"], input[type="password"], input[type="search"], select { width: 100%; min-height: 44px; padding: 0.65rem 0.75rem; border: 1px solid #aeb8c4; border-radius: var(--control-radius); background: var(--white); color: var(--gray-950); }
input::placeholder { color: #657382; opacity: 1; }
input:hover, select:hover { border-color: var(--gray-700); }
input:focus, select:focus { border-color: var(--gray-700); outline: none; box-shadow: var(--focus); }
.account-form { display: grid; max-width: 820px; gap: 1rem; }
.form-section { padding: 1.4rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.full-field { grid-column: 1 / -1; }
.input-prefix { display: grid; grid-template-columns: auto 1fr; }
.input-prefix span { display: grid; min-width: 44px; place-items: center; border: 1px solid #aeb8c4; border-right: 0; border-radius: var(--control-radius) 0 0 var(--control-radius); background: var(--gray-50); color: var(--gray-600); }
.input-prefix input { border-radius: 0 var(--control-radius) var(--control-radius) 0; }
.checkbox-row { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.9rem; border: 1px solid var(--gray-200); border-radius: var(--control-radius); background: var(--gray-50); cursor: pointer; }
.checkbox-row input { width: 18px; height: 18px; margin: 0.15rem 0 0; accent-color: var(--green-700); }
.checkbox-row span { display: grid; }
.checkbox-row strong { color: var(--navy-950); font-size: 0.88rem; }
.checkbox-row small { margin-top: 0.12rem; color: var(--gray-600); }
.assurance-note, .read-only-note { margin-top: 1rem; padding: 0.9rem 1rem; border: 1px solid var(--gray-200); border-radius: var(--control-radius); background: var(--green-50); }
.assurance-note strong, .read-only-note strong { color: var(--green-700); font-size: 0.85rem; }
.assurance-note p, .read-only-note p { margin-top: 0.15rem; font-size: 0.8rem; }
.form-actions { display: flex; justify-content: flex-end; gap: 0.65rem; padding-top: 0.25rem; }

.notice, .privacy-notice { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; padding: 1rem 1.1rem; border: 1px solid var(--gray-200); border-radius: var(--surface-radius); background: var(--green-50); }
.notice { display: block; }
.notice strong, .privacy-notice strong { color: var(--green-700); }
.notice p, .privacy-notice p { margin-top: 0.2rem; font-size: 0.84rem; }
.privacy-notice > span { color: var(--green-700); font-size: 0.8rem; font-weight: 700; white-space: nowrap; }
.device-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.device-card { display: grid; align-content: start; gap: 1rem; padding: 1.25rem; }
.device-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.device-id { overflow-wrap: anywhere; padding: 0.65rem 0.75rem; border-radius: var(--control-radius); background: var(--gray-50); color: var(--gray-700); font-family: var(--font-mono); font-size: 0.76rem; }
.device-card dl { display: grid; gap: 0; margin: 0; }
.device-card dl div { display: grid; grid-template-columns: 145px minmax(0, 1fr); gap: 1rem; padding: 0.65rem 0; border-bottom: 1px solid var(--gray-200); }
.device-card dt { color: var(--gray-600); font-size: 0.8rem; }
.device-card dd { margin: 0; color: var(--navy-950); font-size: 0.82rem; overflow-wrap: anywhere; }
.empty-state { grid-column: 1 / -1; padding: 3rem 1.5rem; text-align: center; }
.empty-state p { margin: 0 auto; max-width: 48ch; }

.proof-header { margin-bottom: 1.2rem; }
.message-path { display: grid; grid-template-columns: 1fr 28px 1fr 28px 1fr 28px 1fr; align-items: center; margin-bottom: 1.25rem; padding: 1rem 1.15rem; border: 1px solid var(--gray-200); border-radius: var(--surface-radius); background: var(--white); }
.message-path > div { display: flex; align-items: center; gap: 0.65rem; }
.message-path > div > span { width: 32px; height: 32px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 50%; background: var(--green-100); color: var(--green-700); font-weight: 750; }
.message-path p { display: grid; }
.message-path small { color: var(--gray-600); font-size: 0.72rem; }
.message-path strong { color: var(--navy-950); font-size: 0.84rem; }
.message-path i { height: 1px; background: var(--gray-300); }
.proof-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 1rem; align-items: start; }
.proof-control, .proof-result { padding: 1.25rem; }
.proof-control form { display: grid; gap: 0.9rem; }
.proof-result-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.verification-summary { display: grid; grid-template-columns: repeat(3, 1fr); margin: 1rem 0; border: 1px solid var(--gray-200); border-radius: var(--control-radius); background: var(--green-50); }
.verification-summary div { display: grid; padding: 0.85rem; border-right: 1px solid var(--gray-200); }
.verification-summary div:last-child { border-right: 0; }
.verification-summary strong { color: var(--green-700); font-size: 0.82rem; }
.verification-summary span { margin-top: 0.18rem; color: var(--gray-600); font-size: 0.75rem; }
.event-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--gray-200); }
.event-meta div { min-width: 0; padding: 0.75rem 0; border-bottom: 1px solid var(--gray-200); }
.event-meta div:nth-child(odd) { padding-right: 1rem; }
.event-meta dt { color: var(--gray-600); font-size: 0.72rem; }
.event-meta dd { margin: 0.15rem 0 0; overflow-wrap: anywhere; color: var(--navy-950); font-family: var(--font-mono); font-size: 0.75rem; }
.local-check { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.75rem; align-items: end; margin-top: 1rem; padding: 1rem; border: 1px solid var(--gray-200); border-radius: var(--control-radius); background: var(--gray-50); }
.local-check p { grid-column: 1 / -1; margin: 0; font-size: 0.75rem; }
.local-check p.verified { color: var(--green-700); font-weight: 700; }
.local-check p.warning { color: var(--red-700); font-weight: 700; }
.technical-details { margin-top: 1rem; }
.technical-details summary { color: var(--navy-700); cursor: pointer; font-size: 0.82rem; font-weight: 700; }
.raw-code { margin-top: 0.65rem; overflow: hidden; border: 1px solid var(--gray-300); border-radius: var(--control-radius); background: var(--gray-50); }
.code-toolbar { display: flex; justify-content: space-between; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--gray-300); color: var(--gray-600); font-size: 0.7rem; font-weight: 700; }
.raw-code pre { max-height: 340px; margin: 0; overflow: auto; padding: 0.9rem; color: var(--navy-950); font-family: var(--font-mono); font-size: 0.72rem; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.source-note { margin-top: 0.9rem; color: var(--green-700); font-size: 0.78rem; font-weight: 700; }
.comparison-section { margin-top: 1rem; }
.comparison-section .section-heading { max-width: 780px; }
.comparison-table { overflow: hidden; border: 1px solid var(--gray-200); border-radius: var(--control-radius); }
.comparison-row { display: grid; grid-template-columns: 120px minmax(240px, 1.4fr) minmax(190px, 1fr); align-items: center; gap: 1rem; padding: 0.7rem 0.85rem; border-bottom: 1px solid var(--gray-200); font-size: 0.8rem; }
.comparison-row:last-child { border-bottom: 0; }
.comparison-row b { font-weight: 650; }
.comparison-head { background: var(--gray-50); color: var(--gray-600); font-size: 0.7rem; font-weight: 750; text-transform: uppercase; }
.comparison-row.highlight { background: var(--green-50); color: var(--green-700); }
.one-line-explainer { display: flex; gap: 0.5rem; margin: 1rem 0; padding: 1rem 1.15rem; border: 1px solid var(--gray-200); border-radius: var(--control-radius); background: var(--green-50); }
.one-line-explainer strong { color: var(--green-700); white-space: nowrap; }
.one-line-explainer span { color: var(--navy-950); }
.security-boundary { margin-top: 1rem; }
.boundary-row { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 1.5rem; padding: 1rem 0; border-top: 1px solid var(--gray-200); }
.boundary-row > strong { color: var(--green-700); font-size: 0.8rem; }
.boundary-row p { font-size: 0.84rem; }

.login-body { display: grid; grid-template-rows: auto 1fr auto; overflow-x: hidden; background: var(--gray-50); }
.login-header { display: flex; width: min(100%, 1180px); margin: 0 auto; padding: 1.5rem clamp(1.25rem, 4vw, 2rem); }
.login-main { display: grid; min-width: 0; place-items: center; padding: 2rem 1.25rem; }
.login-card { width: min(100%, 440px); max-width: calc(100vw - 2.5rem); overflow: hidden; padding: 2rem; border: 1px solid var(--gray-200); border-radius: var(--surface-radius); background: var(--white); box-shadow: 0 16px 40px rgba(16, 29, 51, 0.09); }
.login-intro { padding-bottom: 1.5rem; border-bottom: 1px solid var(--gray-200); }
.login-intro h1 { font-size: 1.7rem; }
.login-intro p:last-child { font-size: 0.9rem; }
.login-form { display: grid; gap: 1rem; padding-top: 1.5rem; }
.login-support { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--gray-200); }
.login-support strong { color: var(--navy-950); font-size: 0.8rem; }
.login-support p { margin-top: 0.15rem; font-size: 0.8rem; }
.login-footer { padding: 1rem 1.25rem 1.5rem; overflow-wrap: anywhere; color: var(--gray-600); font-size: 0.78rem; text-align: center; }

@media (max-width: 1000px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 50; inset: 0 auto 0 0; width: min(300px, calc(100vw - 48px)); transform: translateX(-100%); transition: transform 180ms ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: inline-block; }
  .sidebar-scrim { position: fixed; z-index: 40; inset: 0; background: rgba(16, 29, 51, 0.45); }
  .sidebar-scrim.open { display: block; }
  .mobile-header { position: sticky; z-index: 30; top: 0; display: flex; min-height: 58px; align-items: center; gap: 1rem; padding: 0.7rem 1rem; border-bottom: 1px solid var(--gray-200); background: var(--white); }
  .mobile-header a { color: var(--navy-950); font-weight: 750; text-decoration: none; }
  .menu-button { min-height: 36px; padding: 0.35rem 0.65rem; border: 1px solid var(--gray-300); border-radius: var(--control-radius); background: var(--white); color: var(--navy-950); cursor: pointer; font-size: 0.8rem; font-weight: 700; }
  .main { padding-top: 1.5rem; }
  .proof-layout { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .main { padding: 1.25rem 1rem 3rem; }
  .page-header { display: grid; align-items: start; gap: 1rem; margin-bottom: 1.35rem; }
  .page-header .button, .page-header form, .page-header form .button { width: 100%; }
  .system-status { justify-self: start; white-space: normal; }
  .summary-strip { grid-template-columns: 1fr; }
  .summary-strip article { min-height: 0; border-right: 0; border-bottom: 1px solid var(--gray-200); }
  .summary-strip article:last-child { border-bottom: 0; }
  .executive-strip article { min-height: 0; }
  .visibility-statement, .proof-conclusion { display: grid; }
  .visibility-statement h2 { min-width: 0; }
  .dashboard-grid, .device-grid, .form-grid { grid-template-columns: 1fr; }
  .full-field { grid-column: auto; }
  .assurance-banner { display: grid; }
  .assurance-banner .button { width: 100%; }
  .activity-row { grid-template-columns: 1fr auto; }
  .activity-row span { grid-column: 1; grid-row: 2; }
  .activity-row time { grid-column: 2; grid-row: 1 / 3; align-self: center; }
  .privacy-notice { display: grid; }
  .message-path { grid-template-columns: 1fr; gap: 0.55rem; }
  .message-path i { width: 1px; height: 16px; margin-left: 16px; }
  .verification-summary { grid-template-columns: 1fr; }
  .verification-summary div { border-right: 0; border-bottom: 1px solid var(--gray-200); }
  .verification-summary div:last-child { border-bottom: 0; }
  .event-meta, .local-check { grid-template-columns: 1fr; }
  .local-check p { grid-column: auto; }
  .comparison-table { overflow-x: auto; }
  .comparison-row { min-width: 680px; }
  .one-line-explainer { display: grid; }
  .one-line-explainer strong { white-space: normal; }
  .boundary-row { grid-template-columns: 1fr; gap: 0.4rem; }
  .device-card dl div { grid-template-columns: 1fr; gap: 0.15rem; }
  .form-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .table-toolbar { align-items: stretch; flex-direction: column; }
  .search-field { width: 100%; }
  .table-scroll-hint { display: block; margin: 0; padding: 0.65rem 1rem; border-bottom: 1px solid var(--gray-200); background: var(--green-50); color: var(--green-700); font-size: 0.76rem; font-weight: 650; }
}

@media (max-width: 480px) {
  .login-header { padding: 1rem; }
  .login-main { align-items: start; padding: 1rem; }
  .login-card { width: 100%; max-width: calc(100vw - 2rem); padding: 1.35rem; }
  .login-footer { padding-bottom: 1rem; }
  .form-actions { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
