:root {
  --ink: #0A2854;
  --muted: #65718b;
  --subtle: #8993a9;
  --line: #e4e8f0;
  --surface: #ffffff;
  --canvas: #f6f8fc;
  --primary: #0296FD;
  --primary-dark: #0A2854;
  --primary-soft: #e8f5ff;
  --success: #147d64;
  --success-soft: #e8f7f1;
  --warning: #a45c0a;
  --warning-soft: #fff5df;
  --danger: #b4233d;
  --danger-soft: #fff0f2;
  --info: #176b9d;
  --info-soft: #e9f6ff;
  --shadow-sm: 0 1px 2px rgba(26, 37, 64, .05), 0 4px 12px rgba(26, 37, 64, .04);
  --shadow-lg: 0 24px 70px rgba(26, 37, 64, .15);
  --radius: 14px;
  --radius-sm: 9px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body { min-height: 100vh; margin: 0; background: var(--canvas); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
img, video { max-width: 100%; }
:focus-visible { outline: 3px solid rgba(2, 150, 253, .32); outline-offset: 2px; }

.skip-link {
  position: fixed; top: .75rem; left: .75rem; z-index: 1000; padding: .7rem 1rem;
  transform: translateY(-180%); border-radius: var(--radius-sm); background: var(--ink); color: #fff;
}
.skip-link:focus { transform: translateY(0); }

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 50; display: flex; width: 260px; flex-direction: column;
  border-right: 1px solid var(--line); background: rgba(255, 255, 255, .97); padding: 1.35rem 1rem;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: .2rem .55rem 1.65rem; }
.brand { display: inline-flex; align-items: center; gap: .75rem; color: var(--ink); line-height: 1.15; }
.brand:hover { text-decoration: none; }
.brand strong { display: block; font-size: 1rem; letter-spacing: -.02em; }
.brand small { display: block; margin-top: .23rem; color: var(--muted); font-size: .68rem; font-weight: 600; letter-spacing: .02em; }
.brand-mark {
  display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border-radius: 11px;
  background: linear-gradient(145deg, #0296FD, #0A2854); color: #fff; font-weight: 800; box-shadow: 0 7px 18px rgba(2, 150, 253, .28);
}
.primary-nav { display: grid; gap: .28rem; overflow-y: auto; }
.nav-link {
  display: flex; min-height: 43px; align-items: center; gap: .8rem; border-radius: 10px; padding: .62rem .72rem;
  color: #536079; font-size: .88rem; font-weight: 650; transition: background .16s ease, color .16s ease, transform .16s ease;
}
.nav-link:hover { background: #f4f5fa; color: var(--ink); text-decoration: none; transform: translateX(1px); }
.nav-link.is-active { background: var(--primary-soft); color: var(--primary-dark); }
.nav-icon { display: grid; width: 23px; height: 23px; place-items: center; color: currentColor; font-size: .92rem; font-weight: 760; }
.sidebar-foot { display: grid; gap: .75rem; margin-top: auto; border-top: 1px solid var(--line); padding: 1rem .55rem 0; }
.signed-in { display: flex; min-width: 0; align-items: center; gap: .7rem; }
.signed-in > span:last-child { min-width: 0; }
.signed-in strong, .signed-in small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.signed-in strong { font-size: .76rem; }
.signed-in small { margin-top: .15rem; color: var(--muted); font-size: .68rem; }
.avatar { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: #e8ecf8; color: #46516d; font-size: .78rem; font-weight: 800; }
.main-content { min-height: 100vh; margin-left: 260px; padding: 2.4rem clamp(1.5rem, 3vw, 3.3rem) 4rem; }
.mobile-header { display: none; }
.sidebar-close { display: none; }
.nav-scrim { display: none; }

.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.7rem; }
.page-title h1 { margin: 0; color: var(--ink); font-size: clamp(1.65rem, 3vw, 2.05rem); font-weight: 760; letter-spacing: -.045em; }
.page-title p { max-width: 44rem; margin: .45rem 0 0; color: var(--muted); font-size: .92rem; line-height: 1.55; }
.eyebrow { margin: 0 0 .45rem; color: var(--primary-dark); font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }

.button {
  display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: .45rem; border: 1px solid transparent;
  border-radius: 9px; padding: .55rem .9rem; background: var(--primary-dark); color: #fff; cursor: pointer; font-size: .82rem; font-weight: 720;
  line-height: 1.2; transition: background .15s ease, border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.button:hover { background: var(--primary-dark); color: #fff; text-decoration: none; box-shadow: 0 5px 14px rgba(2, 150, 253, .2); transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .5; box-shadow: none; transform: none; }
.button.disabled { pointer-events: none; opacity: .5; box-shadow: none; transform: none; }
.button-secondary { border-color: var(--line); background: #fff; color: #44506b; }
.button-secondary:hover { border-color: #cad1df; background: #f9fafc; color: var(--ink); box-shadow: none; }
.button-danger { border-color: #f0c7ce; background: #fff; color: var(--danger); }
.button-danger:hover { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); box-shadow: none; }
.button-warning { background: #bd6d12; }
.button-quiet { min-height: 34px; border-color: var(--line); background: transparent; color: var(--muted); }
.button-quiet:hover { background: #f5f6f9; color: var(--ink); box-shadow: none; }
.button-small { min-height: 32px; padding: .38rem .66rem; font-size: .74rem; }
.button-full { width: 100%; }
.button-row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }

.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.metrics-grid-six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric-card { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 1.15rem; box-shadow: var(--shadow-sm); }
.metric-card::after { position: absolute; right: -18px; bottom: -26px; width: 76px; height: 76px; border-radius: 50%; background: var(--primary-soft); content: ""; opacity: .75; }
.metric-label { display: flex; align-items: center; justify-content: space-between; gap: .5rem; color: var(--muted); font-size: .73rem; font-weight: 680; }
.metric-value { position: relative; z-index: 1; margin-top: .55rem; font-size: 1.65rem; font-weight: 770; letter-spacing: -.04em; }
.metric-note { position: relative; z-index: 1; margin-top: .25rem; color: var(--subtle); font-size: .7rem; }
.metric-symbol { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; background: var(--primary-soft); color: var(--primary-dark); font-size: .78rem; font-weight: 800; }
.metric-card.warning::after, .metric-card.warning .metric-symbol { background: var(--warning-soft); }
.metric-card.warning .metric-symbol { color: var(--warning); }
.metric-card.danger::after, .metric-card.danger .metric-symbol { background: var(--danger-soft); }
.metric-card.danger .metric-symbol { color: var(--danger); }
.metric-card.success::after, .metric-card.success .metric-symbol { background: var(--success-soft); }
.metric-card.success .metric-symbol { color: var(--success); }

.content-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(260px, .75fr); gap: 1.2rem; align-items: start; }
.content-grid.equal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack { display: grid; gap: 1rem; }
.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); padding: 1rem 1.15rem; }
.card-header h2, .card-header h3 { margin: 0; font-size: .95rem; font-weight: 740; letter-spacing: -.018em; }
.card-header p { margin: .25rem 0 0; color: var(--muted); font-size: .76rem; }
.card-body { padding: 1.15rem; }
.card-body.flush { padding: 0; }
.section-title { margin: 0 0 .8rem; font-size: 1rem; letter-spacing: -.02em; }
.muted { color: var(--muted); }
.subtle { color: var(--subtle); }
.small { font-size: .76rem; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82em; }

.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .79rem; }
.data-table th { padding: .72rem 1rem; background: #fafbfc; color: var(--muted); font-size: .65rem; font-weight: 780; letter-spacing: .055em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { border-top: 1px solid var(--line); padding: .82rem 1rem; color: #35405a; vertical-align: middle; }
.data-table tbody tr:hover { background: #fbfcff; }
.data-table a.row-link { color: var(--ink); font-weight: 680; }
.data-table .cell-main { display: block; color: var(--ink); font-weight: 650; }
.data-table .cell-sub { display: block; max-width: 300px; margin-top: .16rem; overflow: hidden; color: var(--muted); font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.empty-state { padding: 3.5rem 1.5rem; text-align: center; }
.empty-mark { display: grid; width: 48px; height: 48px; margin: 0 auto .9rem; place-items: center; border-radius: 14px; background: var(--primary-soft); color: var(--primary); font-weight: 800; }
.empty-state h3 { margin: 0 0 .35rem; font-size: .95rem; }
.empty-state p { max-width: 420px; margin: 0 auto; color: var(--muted); font-size: .8rem; line-height: 1.55; }

.status { display: inline-flex; align-items: center; gap: .35rem; border-radius: 999px; padding: .27rem .55rem; background: #eef1f6; color: #536079; font-size: .66rem; font-weight: 760; text-transform: capitalize; white-space: nowrap; }
.status::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
.status[data-status="sent"], .status[data-status="received"], .status[data-status="completed"], .status[data-status="succeeded"], .status[data-status="active"], .status[data-status="online"] { background: var(--success-soft); color: var(--success); }
.status[data-status="failed"], .status[data-status="rejected"], .status[data-status="offline"], .status[data-status="disabled"], .status[data-status="cancelled"] { background: var(--danger-soft); color: var(--danger); }
.status[data-status="queued"], .status[data-status="pending"], .status[data-status="reconciliation_required"], .status[data-status="reconciliationrequired"], .status[data-status="assigned"], .status[data-status="processing"], .status[data-status="transferring"] { background: var(--warning-soft); color: var(--warning); }
.status[data-status="degraded"], .status[data-status="sending"], .status[data-status="accepted"] { background: var(--info-soft); color: var(--info); }

.alert { display: flex; align-items: flex-start; gap: .75rem; margin: 0 0 1.15rem; border: 1px solid; border-radius: 11px; padding: .85rem 1rem; font-size: .8rem; line-height: 1.45; }
.alert-mark { display: grid; width: 21px; height: 21px; flex: 0 0 auto; place-items: center; border-radius: 50%; font-size: .72rem; font-weight: 850; }
.alert-success { border-color: #bee7d8; background: var(--success-soft); color: #106750; }
.alert-success .alert-mark { background: #c5eadc; }
.alert-danger { border-color: #f0c9cf; background: var(--danger-soft); color: #962039; }
.alert-danger .alert-mark { background: #f5d4da; }
.alert-warning { border-color: #f0d9a8; background: var(--warning-soft); color: #81500d; }
.alert-warning .alert-mark { background: #f5e2b7; }
.alert-info { border-color: #c2dfef; background: var(--info-soft); color: #165f87; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.form-field { display: grid; gap: .38rem; }
.form-field.full { grid-column: 1 / -1; }
.form-label, .form-field > label { color: #39455e; font-size: .73rem; font-weight: 720; }
.form-hint { color: var(--muted); font-size: .68rem; line-height: 1.45; }
.form-control, .form-select {
  width: 100%; min-height: 42px; border: 1px solid #d9deea; border-radius: 9px; background: #fff; padding: .62rem .72rem;
  color: var(--ink); font-size: .82rem; outline: none; transition: border .15s ease, box-shadow .15s ease;
}
textarea.form-control { min-height: 125px; resize: vertical; line-height: 1.5; }
.form-control:hover, .form-select:hover { border-color: #c4cada; }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(2, 150, 253, .11); }
.form-control[readonly] { background: #f7f8fb; }
.input-group { display: flex; }
.input-group .form-control { border-radius: 9px 0 0 9px; }
.input-group .button { border-radius: 0 9px 9px 0; }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.check-option { display: flex; align-items: flex-start; gap: .55rem; border: 1px solid var(--line); border-radius: 9px; padding: .65rem; color: #3e4a64; font-size: .75rem; cursor: pointer; }
.check-option:has(input:checked) { border-color: #bfc7ff; background: var(--primary-soft); }
.check-option input { margin-top: .1rem; accent-color: var(--primary); }
.validation-summary-valid, .field-validation-valid { display: none; }
.validation-summary-errors { margin-bottom: .9rem; border: 1px solid #f0c9cf; border-radius: 9px; background: var(--danger-soft); padding: .75rem .9rem; color: var(--danger); font-size: .75rem; }
.validation-summary-errors ul { margin: 0; padding-left: 1.15rem; }
.field-validation-error { color: var(--danger); font-size: .68rem; }
.input-validation-error { border-color: #d85870; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .65rem; border-top: 1px solid var(--line); margin-top: 1.1rem; padding-top: 1rem; }
.file-drop { display: grid; min-height: 100px; place-items: center; border: 1px dashed #bfc7d8; border-radius: 10px; background: #fafbfe; padding: 1rem; text-align: center; }
.file-drop input { max-width: 100%; }

.filter-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .7rem; padding: 1rem; }
.filter-bar .form-field { min-width: 145px; flex: 0 1 190px; }
.filter-bar .search-field { min-width: 230px; flex: 1 1 300px; }
.pagination { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding: .8rem 1rem; color: var(--muted); font-size: .72rem; }

.definition-list { display: grid; grid-template-columns: minmax(110px, .45fr) minmax(0, 1fr); gap: .8rem 1rem; margin: 0; }
.definition-list dt { color: var(--muted); font-size: .7rem; }
.definition-list dd { margin: 0; color: var(--ink); font-size: .78rem; font-weight: 620; overflow-wrap: anywhere; }
.message-body { border-radius: 10px; background: #f7f8fb; padding: 1rem; color: #313c55; font-size: .83rem; line-height: 1.65; white-space: pre-wrap; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .8rem; }
.media-item { overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: #fafbfc; }
.media-preview { display: grid; aspect-ratio: 4 / 3; place-items: center; overflow: hidden; background: #eef1f6; }
.media-preview img, .media-preview video { width: 100%; height: 100%; object-fit: cover; }
.media-meta { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .7rem; font-size: .7rem; }
.timeline { position: relative; display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; }
.timeline::before { position: absolute; top: 7px; bottom: 7px; left: 6px; width: 1px; background: #d9deea; content: ""; }
.timeline-item { position: relative; padding-left: 1.65rem; }
.timeline-dot { position: absolute; top: .25rem; left: 1px; width: 11px; height: 11px; border: 3px solid #fff; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 1px #aeb8d2; }
.timeline-item strong { display: block; font-size: .77rem; text-transform: capitalize; }
.timeline-item p { margin: .18rem 0 0; color: var(--muted); font-size: .72rem; line-height: 1.45; }
.timeline-time { color: var(--subtle); font-size: .66rem; }

.balance-panel { overflow: hidden; background: linear-gradient(145deg, #0A2854, #0296FD); color: #fff; }
.balance-panel .card-body { padding: 1.4rem; }
.balance-panel .metric-label { color: rgba(255, 255, 255, .72); }
.balance-panel .balance-value { margin: .35rem 0 .2rem; font-size: 2rem; font-weight: 780; letter-spacing: -.05em; }
.balance-panel .balance-meta { color: rgba(255, 255, 255, .76); font-size: .73rem; }
.balance-details { display: grid; grid-template-columns: repeat(2, 1fr); gap: .65rem; margin-top: 1.1rem; border-top: 1px solid rgba(255, 255, 255, .2); padding-top: 1rem; }
.balance-details span { display: block; color: rgba(255, 255, 255, .66); font-size: .65rem; }
.balance-details strong { display: block; margin-top: .18rem; font-size: .84rem; }
.secret-box { border: 1px solid #f0d9a8; border-radius: var(--radius); background: #fffaf0; padding: 1.2rem; }
.secret-box h2 { margin: 0 0 .35rem; font-size: 1rem; }
.secret-box p { margin: 0 0 .85rem; color: #715119; font-size: .76rem; line-height: 1.5; }
.code-block { overflow-x: auto; border: 1px solid #222b41; border-radius: 10px; background: #172037; padding: .9rem 1rem; color: #eaf0ff; font: .73rem/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre; }
.code-inline { border-radius: 5px; background: #edf0f6; padding: .12rem .32rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82em; }
.docs-nav { position: sticky; top: 1rem; display: grid; gap: .25rem; }
.docs-nav a { border-left: 2px solid var(--line); padding: .35rem .65rem; color: var(--muted); font-size: .73rem; }
.docs-nav a:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.docs-section { scroll-margin-top: 1rem; }
.docs-section h2 { margin: 0 0 .6rem; font-size: 1.08rem; }
.docs-section h3 { margin: 1.15rem 0 .45rem; font-size: .86rem; }
.docs-section p, .docs-section li { color: #58647d; font-size: .78rem; line-height: 1.65; }

.auth-shell { background: #f6f7fb; }
.auth-main { display: grid; min-height: 100vh; grid-template-columns: minmax(370px, .9fr) minmax(440px, 1.1fr); }
.auth-brand { position: relative; display: flex; overflow: hidden; flex-direction: column; justify-content: space-between; background: linear-gradient(150deg, #0A2854, #0A2854 58%, #0296FD); padding: clamp(2rem, 5vw, 4.5rem); color: #fff; }
.auth-brand::before, .auth-brand::after { position: absolute; border: 1px solid rgba(255, 255, 255, .1); border-radius: 50%; content: ""; }
.auth-brand::before { right: -20%; bottom: -8%; width: 430px; height: 430px; }
.auth-brand::after { right: 5%; bottom: 8%; width: 230px; height: 230px; }
.auth-brand .brand { position: relative; z-index: 1; color: #fff; }
.auth-brand .brand small { color: rgba(255, 255, 255, .65); }
.auth-message { position: relative; z-index: 1; max-width: 520px; padding-bottom: 7vh; }
.auth-message .eyebrow { color: #aab5ff; }
.auth-message h1 { margin: 0; font-size: clamp(2.35rem, 5vw, 4.6rem); line-height: 1.02; letter-spacing: -.065em; }
.auth-message > p:last-child { max-width: 420px; margin: 1.4rem 0 0; color: rgba(255, 255, 255, .73); font-size: 1rem; line-height: 1.65; }
.auth-panel { display: grid; place-items: center; padding: 2rem; }
.auth-card { width: min(100%, 420px); }
.auth-card h1 { margin: 0; font-size: 1.8rem; letter-spacing: -.045em; }
.auth-card > p { margin: .55rem 0 1.5rem; color: var(--muted); font-size: .82rem; line-height: 1.55; }
.auth-card .form-field { margin-bottom: .95rem; }
.auth-footer { margin-top: 1.15rem; color: var(--muted); font-size: .73rem; text-align: center; }
.inline-check { display: flex; align-items: center; gap: .45rem; color: var(--muted); font-size: .74rem; }
.inline-check input { accent-color: var(--primary); }
.auth-options { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin: .15rem 0 1rem; }

.admin-sidebar { border-right-color: #24304e; background: #0A2854; color: #fff; }
.admin-sidebar .brand { color: #fff; }
.admin-sidebar .brand small, .admin-sidebar .signed-in small { color: #8d9ab7; }
.admin-sidebar .nav-link { color: #aab4ca; }
.admin-sidebar .nav-link:hover { background: #1e2944; color: #fff; }
.admin-sidebar .nav-link.is-active { background: #2a3760; color: #fff; }
.admin-sidebar .sidebar-foot { border-top-color: #2a3551; }
.admin-sidebar .avatar { background: #2b385d; color: #dce2f3; }
.admin-sidebar .button-quiet { border-color: #35415f; color: #abb5ca; }
.admin-sidebar .button-quiet:hover { background: #212c48; color: #fff; }
.internal-label { margin: -.55rem .55rem 1rem; border: 1px solid #554633; border-radius: 7px; background: #29283a; padding: .42rem .55rem; color: #e6be75; font-size: .62rem; font-weight: 800; letter-spacing: .08em; text-align: center; text-transform: uppercase; }
.admin-shell .brand-mark { background: linear-gradient(145deg, #737f9d, #4b5879); box-shadow: none; }
.admin-banner { margin-bottom: 1.1rem; border: 1px solid #eadbbd; border-radius: 10px; background: #fffaf0; padding: .65rem .8rem; color: #795b24; font-size: .7rem; }

.detail-actions { display: flex; flex-wrap: wrap; gap: .55rem; }
.split-stat { display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); padding: .7rem 0; font-size: .76rem; }
.split-stat:last-child { border-bottom: 0; }
.split-stat span { color: var(--muted); }
.split-stat strong { text-align: right; }
.summary-strip { display: flex; flex-wrap: wrap; gap: 1.2rem; }
.summary-item span { display: block; color: var(--muted); font-size: .66rem; }
.summary-item strong { display: block; margin-top: .2rem; font-size: .9rem; }
.danger-zone { border-color: #efc9cf; }
.danger-zone .card-header { border-color: #f2d8dc; background: #fff8f9; }

@media (max-width: 1180px) {
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-grid { grid-template-columns: minmax(0, 1.35fr) minmax(250px, .75fr); }
}

@media (max-width: 900px) {
  .mobile-header { position: sticky; top: 0; z-index: 40; display: flex; height: 62px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .94); padding: 0 1rem; backdrop-filter: blur(12px); }
  .brand-mobile { font-size: .9rem; font-weight: 760; }
  .brand-mobile .brand-mark { width: 32px; height: 32px; border-radius: 9px; }
  .icon-button { display: grid; width: 38px; height: 38px; place-items: center; border: 0; border-radius: 9px; background: transparent; color: inherit; cursor: pointer; }
  .nav-toggle { gap: 4px; align-content: center; }
  .nav-toggle span { display: block; width: 19px; height: 2px; border-radius: 2px; background: currentColor; }
  .sidebar { width: min(290px, 88vw); transform: translateX(-105%); box-shadow: var(--shadow-lg); transition: transform .2s ease; }
  .sidebar-close { display: grid; font-size: 1.7rem; }
  .nav-open .sidebar { transform: translateX(0); }
  .nav-scrim { position: fixed; inset: 0; z-index: 45; background: rgba(16, 24, 43, .38); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  .nav-open .nav-scrim { display: block; opacity: 1; pointer-events: auto; }
  .nav-open { overflow: hidden; }
  .main-content { min-height: calc(100vh - 62px); margin-left: 0; padding: 1.5rem 1rem 3rem; }
  .content-grid, .content-grid.equal { grid-template-columns: 1fr; }
  .docs-nav { position: static; display: flex; overflow-x: auto; }
  .docs-nav a { flex: 0 0 auto; border-bottom: 2px solid var(--line); border-left: 0; }
  .auth-main { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-panel { min-height: 100vh; padding: 1.25rem; }
  .admin-mobile-header { background: #0A2854; color: #fff; border-bottom-color: #2a3551; }
}

@media (max-width: 620px) {
  .page-header { align-items: stretch; flex-direction: column; }
  .page-header .button-row, .page-header > .button { align-self: flex-start; }
  .metrics-grid, .form-grid { grid-template-columns: 1fr; }
  .form-field.full { grid-column: auto; }
  .metric-card { padding: 1rem; }
  .check-grid { grid-template-columns: 1fr; }
  .filter-bar .form-field, .filter-bar .search-field { min-width: 100%; flex-basis: 100%; }
  .filter-bar .button { width: 100%; }
  .definition-list { grid-template-columns: 1fr; gap: .22rem; }
  .definition-list dd { margin-bottom: .55rem; }
  .card-header { align-items: flex-start; flex-direction: column; }
  .balance-details { grid-template-columns: 1fr 1fr; }
  .data-table.mobile-cards thead { display: none; }
  .data-table.mobile-cards, .data-table.mobile-cards tbody, .data-table.mobile-cards tr, .data-table.mobile-cards td { display: block; width: 100%; }
  .data-table.mobile-cards tr { border-top: 1px solid var(--line); padding: .6rem .9rem; }
  .data-table.mobile-cards tr:first-child { border-top: 0; }
  .data-table.mobile-cards td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: .32rem 0; text-align: right; }
  .data-table.mobile-cards td::before { flex: 0 0 40%; color: var(--muted); content: attr(data-label); font-size: .65rem; font-weight: 760; text-align: left; text-transform: uppercase; }
  .data-table.mobile-cards td[data-label=""]::before { display: none; }
  .data-table.mobile-cards td[data-label=""] { justify-content: flex-end; }
  .auth-options { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* Official wordmark is displayed intact, including on dark navigation. */
[hidden] { display: none !important; }
.brand-logo, .brand-wordmark img { display: block; width: 200px; height: auto; }
.brand-wordmark { display: block; }
.admin-sidebar .brand-wordmark img, .admin-mobile-header .brand-logo, .auth-brand .brand-wordmark img { border-radius: 7px; background: white; padding: 8px; }
.admin-mobile-header .brand-logo { width: 158px; }
.auth-mobile-brand { display: block; margin-bottom: 2rem; }
.auth-mobile-brand img { max-width: 100%; height: auto; }
.install-admin { margin-bottom: 1rem; }
.character-counter { text-align: right; color: var(--muted); font-size: .8rem; }
.character-counter.over-limit { color: var(--danger); font-weight: 750; }
.attachment-order { list-style: none; padding: 0; margin: .4rem 0; }
.attachment-order li { display: flex; align-items: center; gap: .45rem; border-bottom: 1px solid var(--line); padding: .55rem 0; font-size: .76rem; }
.attachment-order .attachment-name { flex: 1; overflow-wrap: anywhere; }
.attachment-order .button { min-width: 40px; }
.conversation-list { display: grid; }
.conversation-row { display: flex; gap: 1rem; align-items: center; padding: 1.1rem; color: var(--ink); border-bottom: 1px solid var(--line); }
.conversation-row:hover { background: var(--primary-soft); text-decoration: none; }
.conversation-preview { flex: 1; min-width: 0; display: grid; gap: .35rem; }
.conversation-preview span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: .82rem; }
.conversation-preview small, .conversation-row time { font-size: .69rem; color: var(--muted); }
.conversation-thread { display: grid; gap: 1.2rem; max-width: 1100px; margin: auto; }
.conversation-message { width: min(86%, 740px); border: 1px solid var(--line); border-radius: 16px; padding: 1rem; background: white; box-shadow: var(--shadow-sm); }
.conversation-message.outgoing { justify-self: end; background: #eef8ff; border-color: #cce8fa; }
.conversation-message header, .conversation-message footer { display: flex; align-items: center; justify-content: space-between; gap: .7rem; font-size: .75rem; }
.conversation-message footer { color: var(--muted); margin-top: 1rem; flex-wrap: wrap; }
.conversation-message .message-body { background: transparent; padding: .9rem 0; }
.conversation-media { display: grid; gap: .7rem; }
.conversation-media img { display: block; width: auto; max-height: 400px; object-fit: contain; background: white; }
.conversation-media span { display: block; margin-top: .3rem; font-size: .73rem; overflow-wrap: anywhere; }
.operations-health { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.2rem 1.4rem; border-radius: 14px; border: 1px solid #bee7d8; background: var(--success-soft); margin-bottom: 1.4rem; }
.operations-health h2 { margin: 0 0 .35rem; font-size: 1.2rem; }
.operations-health p { margin: 0; font-size: .8rem; }
.operations-health.warning { background: var(--warning-soft); border-color: #f0d9a8; }
.operations-health.critical { background: var(--danger-soft); border-color: #efc9cf; }
.fleet-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(270px,1fr)); gap: 1rem; margin-bottom: 1.4rem; }
.fleet-card .definition-list { grid-template-columns: 1fr 1.2fr; gap: .55rem; }
.fleet-card h3 { margin: 0; }
.fleet-card .card-body { display: grid; gap: 1rem; }
.resource-summary { padding: .8rem; background: var(--canvas); border-radius: 10px; font-size: .78rem; }
.resource-summary p { margin: .4rem 0; }
.release-card { margin-bottom: 1.2rem; }
.release-card .mono { word-break: break-all; }
.public-shell { background: #fff; }
.public-nav, .public-main, .public-footer { width: min(1180px, 100% - 3rem); margin: auto; }
.public-nav { display: flex; justify-content: space-between; align-items: center; padding: 1.5rem 0; }
.public-hero { padding: 5rem 0 4rem; max-width: 900px; }
.public-hero h1 { font-size: clamp(2.8rem, 6vw, 5.6rem); letter-spacing: -.06em; line-height: 1.03; margin: 1rem 0 1.6rem; }
.public-hero p { max-width: 690px; font-size: 1.15rem; color: var(--muted); line-height: 1.65; }
.public-hero .eyebrow { font-size: .85rem; }
.public-benefits { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.5rem; padding-bottom: 4rem; }
.public-benefits article { background: #f3f9fe; border: 1px solid #d8ebf8; border-radius: 18px; padding: 1.7rem; }
.public-benefits h2 { font-size: 1.15rem; margin: 0 0 .7rem; }
.public-benefits p { color: var(--muted); font-size: .9rem; line-height: 1.6; margin: 0; }
.public-footer { border-top: 1px solid var(--line); padding: 1.5rem 0; color: var(--muted); font-size: .8rem; }
@media (max-width: 620px) {
  .brand-logo { width: 180px; }
  .button { min-height: 44px; }
  .form-control, .form-select { font-size: 16px; }
  .operations-health { align-items: flex-start; flex-direction: column; }
  .conversation-row { flex-wrap: wrap; }
  .conversation-row time { margin-left: 3rem; }
  .conversation-message { width: 95%; }
  .conversation-message header { align-items: flex-start; flex-direction: column; }
  .fleet-grid, .public-benefits { grid-template-columns: 1fr; }
  .public-hero { padding: 2.5rem 0; }
  .public-nav .brand-logo { width: 160px; }
}

.preserve-message-text { white-space: pre-wrap; overflow-wrap: anywhere; }
