:root {
  color-scheme: light;
  font-family: "Inter", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  color: #27343c;
  background: #fff;
  --ink: #27343c;
  --muted: #6d7c86;
  --line: #e7ecef;
  --line-strong: #d8e1e6;
  --blue: #487e96;
  --ice: #eff7fa;
  --radius: 11px;
}
* { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { outline-offset: 4px; }
button, a { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea, a { transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid #7ca9bc; outline-offset: 4px; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: #2e667f; text-decoration: underline; text-underline-offset: 4px; }
button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 9px 16px; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; color: #394b56; font-size: 13px; font-weight: 550; line-height: 1.5; cursor: pointer; }
button:hover { background: #f7f9fa; border-color: #bdccd4; }
button:disabled { opacity: .48; cursor: not-allowed; }
.primary { background: #293b46; border-color: #293b46; color: #fff; }
.primary:hover { background: #3b505d; border-color: #3b505d; color: #fff; }
.primary:disabled:hover { background: #293b46; border-color: #293b46; }
.danger { background: #fff; border-color: #ead7d8; color: #a24548; }
.danger:hover { background: #fff7f7; border-color: #d7aeb1; color: #97373c; }
.quiet { background: transparent; border-color: transparent; color: var(--muted); }
.quiet:hover { background: #f5f8fa; border-color: transparent; color: #34444e; }
.quiet.danger { color: #a24548; }
.quiet.danger:hover { color: #97373c; background: #fff7f7; }
.small { min-height: 32px; padding: 5px 11px; font-size: 12px; }
.icon { display: block; width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; }
.boot { padding: 18vh 9vw; color: var(--muted); font-size: 14px; }

/* White navigation and fine separators keep the workspace visually quiet. */
.shell { display: grid; grid-template-columns: 242px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; padding: 34px 20px 25px; border-right: 1px solid var(--line); background: #fff; color: var(--ink); }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 9px; color: var(--ink); }
.brand img { display: block; width: 34px; height: 34px; border-radius: 8px; }
.brand strong { display: block; color: #25343d; font-size: 17px; font-weight: 620; letter-spacing: -.35px; line-height: 1.35; }
.brand small { display: block; margin-top: 3px; color: #87969f; font-size: 9px; letter-spacing: 1.85px; }
.nav-label { margin: 51px 13px 14px; color: #8898a1; font-size: 10px; letter-spacing: 1.3px; }
.nav { display: grid; gap: 7px; }
.nav button { position: relative; justify-content: flex-start; gap: 12px; min-height: 46px; padding: 11px 14px; border-color: transparent; background: transparent; color: #6f808c; text-align: left; font-size: 13px; font-weight: 500; }
.nav button:hover { color: #3b5665; border-color: transparent; background: #f7f9fa; }
.nav button.active { color: #375e70; border-color: #e6eff3; background: #eef5f8; font-weight: 600; }
.nav button.active::after { content: ""; position: absolute; right: 13px; width: 4px; height: 4px; border-radius: 50%; background: #7fa8b9; }
.nav .glyph { display: grid; place-items: center; width: 20px; height: 20px; flex-shrink: 0; color: #8195a1; font-size: 18px; }
.nav button.active .glyph { color: #5c91a6; }
.sidebar-foot { margin-top: auto; padding: 25px 11px 0; border-top: 1px solid var(--line); color: #81929e; font-size: 11px; line-height: 1.85; }
.sidebar-foot strong { display: block; margin-bottom: 7px; color: #627985; font-size: 12px; font-weight: 550; }
.sidebar-foot p { margin: 9px 0 14px; }
.sidebar-foot button { min-height: 28px; padding-left: 0; font-size: 11px; }
.system-status { display: inline-flex; align-items: center; gap: 7px; padding: 4px 9px; border: 1px solid #e6ecef; border-radius: 5px; background: #fcfdfe; color: #7c909d; font-size: 10px; font-weight: 500; white-space: nowrap; }
.system-status i { display: block; width: 5px; height: 5px; flex-shrink: 0; border-radius: 50%; background: #92b4c2; }
.sidebar-foot .system-status { padding: 0; border: 0; background: transparent; color: #708793; }
.main { min-width: 0; background: #fff; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 76px; padding: 0 42px; border-bottom: 1px solid var(--line); background: #fff; }
.crumb { color: #8e9da7; font-size: 12px; }
.crumb span { padding-left: 12px; color: #607481; }
.topbar > .system-status { margin-left: auto; }
.profile { display: flex; align-items: center; gap: 10px; font-size: 11px; }
.profile .quiet { min-height: 30px; font-size: 11px; }
.avatar { display: grid; place-items: center; width: 29px; height: 29px; border: 1px solid #e6edf0; border-radius: 50%; background: #f4f8fa; color: #668391; font-size: 11px; font-weight: 600; }
.workspace { max-width: 1560px; margin: 0 auto; padding: 41px 42px 36px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 30px; }
.eyebrow { margin-bottom: 8px; color: #8096a2; font-size: 9px; font-weight: 600; letter-spacing: 2.3px; }
h1 { margin: 0 0 10px; color: #243842; font-size: 29px; font-weight: 580; letter-spacing: -.8px; line-height: 1.35; }
h2 { margin: 0; font-size: 17px; font-weight: 580; letter-spacing: -.2px; }
p { margin: 8px 0; }
.muted { color: var(--muted); }
.page-head p { margin: 0; color: #7f909c; font-size: 12px; line-height: 1.8; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.page-head > .actions { padding-bottom: 3px; }

/* One metrics strip makes the four figures easy to compare. */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 25px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.stat { position: relative; min-width: 0; padding: 22px 25px 21px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #748995; font-size: 12px; }
.stat-label > span { color: #a2b1b9; font-family: "SFMono-Regular", Consolas, monospace; font-size: 9px; letter-spacing: .5px; }
.stat strong { display: block; margin: 11px 0 4px; color: #2b424f; font-size: 33px; font-weight: 480; line-height: 1.35; letter-spacing: -1.25px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat small { color: #8395a1; font-size: 11px; line-height: 1.7; }
.stat.primary-stat { background: linear-gradient(115deg, #f8fcfe 0%, #fff 75%); }
.stat.primary-stat .stat-label { color: #638597; }
.stat.primary-stat strong { color: #3a6376; }
.notice { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 25px; padding: 17px 20px; border: 1px solid #e0ecf1; border-radius: 8px; background: #f8fcfd; color: #587381; font-size: 12px; line-height: 1.85; }
.notice > div { min-width: 0; }
.notice .symbol { display: grid; place-items: center; width: 18px; flex-shrink: 0; margin-top: 1px; color: #77a4b7; font-weight: 650; }
.notice strong { color: #496675; font-size: 12px; font-weight: 600; }
.notice p { margin: 3px 0 0; color: #758b99; }
.notice button { align-self: center; flex-shrink: 0; margin-left: auto; border-color: #dce7ed; background: #fff; color: #608397; white-space: nowrap; }
.notice ul { margin: 9px 0 1px; padding-left: 18px; }
.notice li { margin: 4px 0; overflow-wrap: anywhere; }
.warning { border-color: #e8e1d7; background: #fffefd; color: #85724f; }
.warning strong { color: #75623f; }
.warning p { color: #8d806c; }
.warning .symbol { color: #b4986a; }
.notice-mark { display: grid; place-items: center; width: 26px; height: 26px; min-width: 26px; margin-top: 2px; border: 1px solid #eee4d4; border-radius: 50%; background: #fffaf2; color: #b29464; font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; }
.blocker-details { margin-top: 10px; color: #8a8173; font-size: 11px; }
.blocker-details summary { width: fit-content; color: #8e877b; cursor: pointer; font-size: 11px; }
.blocker-details summary:hover { color: #665b46; }
.blocker-details[open] summary { margin-bottom: 8px; }
.blocker-details ul { margin: 0; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 74px; padding: 20px 25px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 14px; font-weight: 600; }
.panel-head small { color: #8a9da8; font-size: 11px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 15px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; flex-wrap: wrap; gap: 3px; }
.tabs button { min-height: 32px; padding: 6px 11px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: #7c909d; font-size: 12px; font-weight: 500; }
.tabs button:hover { color: #506675; background: #f8fafb; }
.tabs button.active { color: #4c7183; border-color: #e5eef2; background: #f2f8fa; }
.search { width: 240px; min-height: 35px; padding: 8px 12px; border-color: #e4eaee; border-radius: 6px; font-size: 12px; background: #fcfdfe; }
.table-wrap { width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
table { width: 100%; min-width: 730px; border-collapse: collapse; text-align: left; font-size: 13px; }
th { color: #8397a3; background: #fafcfd; font-size: 11px; font-weight: 500; letter-spacing: .2px; white-space: nowrap; }
th, td { padding: 17px 24px; border-bottom: 1px solid #eef1f3; }
th { padding-top: 12px; padding-bottom: 12px; }
td { color: #536c7b; line-height: 1.7; vertical-align: middle; }
tbody tr { transition: background-color .16s ease; }
tbody tr:hover { background: #fcfdfe; }
tbody tr:last-child td { border-bottom: 0; }
td:first-child { min-width: 190px; max-width: 350px; overflow-wrap: anywhere; }
td:last-child { white-space: nowrap; }
td strong { color: #435f70; font-size: 12px; font-weight: 500; }
td small { display: block; margin-top: 3px; color: #879ba8; font-size: 11px; }
td .small { min-height: 30px; padding: 4px 10px; font-size: 11px; }
.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-variant-numeric: tabular-nums; letter-spacing: -.1px; }
.money { color: #344f60; font-size: 15px; font-weight: 560; font-variant-numeric: tabular-nums; }
.badge { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 3px 7px; border: 1px solid #e9edf0; border-radius: 4px; color: #748b99; background: #f9fbfc; font-size: 11px; font-weight: 500; line-height: 1.6; white-space: nowrap; }
.badge.needs_review { color: #896b3b; background: #fffaf1; border-color: #efe5d4; }
.badge.ready { color: #537c92; background: #f2f8fb; border-color: #e0edf3; }
.badge.awaiting_receipt { color: #79728e; background: #f7f6fb; border-color: #eae7f2; }
.badge.confirmed_manual { color: #557d69; background: #f2f9f5; border-color: #e0eee7; }
.badge.cancelled { color: #86969f; background: #f9fafb; border-color: #e9edf0; }
.provider { display: inline-flex; align-items: center; gap: 7px; color: #718b9b; font-size: 12px; white-space: nowrap; }
.provider b { display: grid; place-items: center; width: 20px; height: 20px; border: 1px solid #dfeaf0; border-radius: 5px; color: #6b8ca0; background: #f5f9fc; font-size: 10px; font-weight: 600; }
.provider.stripe b { color: #918caa; background: #f9f8fc; border-color: #eae7f2; }
.source-tag { display: inline-block; margin-left: 7px; padding: 0 4px; border: 1px solid #e8edf0; border-radius: 3px; color: #8fa5b3; font-size: 9px; line-height: 1.6; vertical-align: 1px; }
.inline-count { display: inline-block; min-width: 21px; margin-left: 7px; padding: 1px 6px; border: 1px solid #e6ecef; border-radius: 4px; color: #8198a7; background: #f9fbfc; font-size: 10px; font-weight: 500; line-height: 1.5; text-align: center; }
.empty { padding: 64px 24px 70px; text-align: center; color: var(--muted); }
.empty-icon { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 21px; border: 1px solid #e1eaf0; border-radius: 13px; background: #fbfdfe; color: #9cb4c0; font-size: 25px; }
.empty-icon .icon { width: 24px; height: 24px; }
.empty h3 { margin: 0 0 9px; color: #576f7e; font-size: 15px; font-weight: 550; }
.empty p { max-width: 435px; margin: 0 auto 23px; color: #839baa; font-size: 12px; line-height: 1.85; }
.empty .primary { min-height: 36px; padding: 8px 14px; font-size: 12px; }
.footnote { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px 20px; padding: 15px 24px; border-top: 1px solid var(--line); color: #8da3b0; font-size: 10px; }
.footer-line { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px 20px; margin-top: 22px; color: #90a7b4; font-size: 10px; }

.grid-two { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(280px, 1fr); align-items: start; gap: 24px; }
.grid-two > * { min-width: 0; }
.card-body { padding: 26px; }
.field { display: grid; gap: 8px; min-width: 0; margin-bottom: 21px; }
.field > span, .field > label { color: #5c7585; font-size: 12px; font-weight: 550; }
.field small, .help { color: #7f97a6; font-size: 12px; line-height: 1.85; }
input, select, textarea { width: 100%; min-width: 0; min-height: 43px; padding: 10px 12px; border: 1px solid #dfe7ec; border-radius: 6px; background: #fff; color: #405b6c; font-size: 13px; line-height: 1.6; }
input::placeholder, textarea::placeholder { color: #a1b2bd; opacity: 1; }
input:hover, select:hover, textarea:hover { border-color: #cbd9e0; }
input:focus, textarea:focus, select:focus { outline: none; border-color: #8bb0c2; box-shadow: 0 0 0 3px #edf5f9; }
input[readonly] { background: #f7f9fa; color: #839ba9; }
input:disabled, select:disabled, textarea:disabled { opacity: .6; cursor: not-allowed; background: #f7f9fa; }
textarea { min-height: 96px; resize: vertical; overflow-wrap: anywhere; }
.row-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.check { display: flex; align-items: flex-start; gap: 9px; margin: 17px 0; color: #6c8595; font-size: 12px; line-height: 1.85; cursor: pointer; }
.check input { width: 15px; height: 15px; min-height: 0; flex-shrink: 0; margin: 4px 0 0; padding: 0; accent-color: #6894a9; cursor: pointer; }
.form-error { margin-bottom: 20px; padding: 12px 14px; border: 1px solid #eddcde; border-radius: 6px; color: #9a555b; background: #fff8f8; font-size: 12px; line-height: 1.75; overflow-wrap: anywhere; }
.form-error:empty { display: none; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { position: relative; padding: 0 0 27px 39px; color: #7c96a6; font-size: 12px; line-height: 1.9; }
.steps li::before { content: counter(step, decimal-leading-zero); counter-increment: step; position: absolute; left: 0; top: 2px; display: grid; place-items: center; width: 25px; height: 25px; border: 1px solid #e5edf1; border-radius: 6px; background: #fbfdfe; color: #8da9b8; font-family: "SFMono-Regular", Consolas, monospace; font-size: 9px; line-height: 1; }
.steps strong { display: block; margin-bottom: 5px; color: #5b788a; font-size: 12px; font-weight: 550; }
.steps li:last-child { padding-bottom: 0; }
.settings-note { margin-top: 19px; color: #7f98a7; font-size: 12px; line-height: 1.95; }
.card-body > .settings-note:first-child { margin-top: 0; }
.settings-note a { display: block; margin-top: 10px; color: #6e94a9; font-size: 12px; }
.spacer { height: 20px; }
.wrap { overflow-wrap: anywhere; }
.warn-text { color: #9b8055 !important; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; }
.product-card { padding: 25px; }
.product-card h3 { margin: 20px 0 12px; color: #496c81; font-size: 16px; font-weight: 550; }
.product-card .money { font-size: 29px; font-weight: 480; letter-spacing: -.7px; }
.product-card .actions { margin-top: 23px; }
.product-card .actions:first-child { margin-top: 0; justify-content: space-between; }
.product-card .help { margin: 12px 0 0; }
.desktop-only { display: block; }

/* Dialogs stay legible and independently scroll on smaller screens. */
dialog { width: min(680px, calc(100% - 40px)); max-height: min(90vh, 960px); max-height: min(90dvh, 960px); margin: auto; padding: 0; border: 1px solid #e0e8ed; border-radius: 14px; background: #fff; color: var(--ink); box-shadow: 0 24px 90px #243b4921, 0 3px 16px #243b4909; }
dialog::backdrop { background: #c5d0d873; backdrop-filter: blur(5px); }
.modal-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 27px; border-bottom: 1px solid var(--line); background: #fff; }
.modal-head h2 { font-size: 17px; font-weight: 560; overflow-wrap: anywhere; }
.modal-head button { min-width: 29px; min-height: 29px; padding: 0 6px; font-size: 23px; font-weight: 350; line-height: 1; }
.modal-body { padding: 27px; }
.modal-body > .help { margin-bottom: 20px; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 27px; padding-top: 18px; border-top: 1px solid #edf1f4; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 25px; margin: 0 0 26px; }
.detail-grid > div { min-width: 0; }
.detail-grid dt { margin-bottom: 6px; color: #8ea5b4; font-size: 11px; }
.detail-grid dd { margin: 0; color: #527387; font-size: 13px; overflow-wrap: anywhere; }
.detail-grid > div > strong { color: #52778d; font-size: 13px; font-weight: 550; }
.link-box { display: block; margin: 8px 0 17px; padding: 13px 14px; border: 1px solid #e5edf1; border-radius: 6px; background: #fafcfd; color: #658da4; font-size: 12px; line-height: 1.85; overflow-wrap: anywhere; }
.audit { margin: 17px 0; padding: 1px 0 1px 16px; border-left: 1px solid #dfe9ee; }
.audit p { margin: 3px 0; color: #6d8ea3; font-size: 12px; overflow-wrap: anywhere; }
.audit small { display: block; margin-top: 4px; color: #8ea7b7; font-size: 11px; line-height: 1.85; overflow-wrap: anywhere; }
.section-label { margin: 25px 0 13px; color: #567b91; font-size: 12px; font-weight: 550; }

/* A subtle technical grid gives the login screen depth without a dark panel. */
.login-page { display: grid; grid-template-columns: 1.06fr 1fr; min-height: 100vh; }
.login-story { position: relative; display: flex; flex-direction: column; overflow: hidden; padding: clamp(42px, 7vh, 84px) clamp(45px, 6.8vw, 116px); border-right: 1px solid #e9eff2; background-color: #fbfdfe; background-image: linear-gradient(#d3e2ea25 1px, transparent 1px), linear-gradient(90deg, #d3e2ea25 1px, transparent 1px); background-size: 48px 48px; }
.login-story::after { content: ""; position: absolute; right: -160px; bottom: -185px; width: 570px; height: 570px; border: 1px solid #e5eef3; border-radius: 50%; box-shadow: 0 0 0 55px #f4f9fb, 0 0 0 56px #eaf1f5; pointer-events: none; }
.login-story > * { position: relative; z-index: 1; }
.login-story .brand { margin-bottom: clamp(55px, 10vh, 100px); padding: 0; }
.login-story h1 { max-width: 470px; margin: 0 0 15px; color: #3e5b6b; font-size: clamp(31px, 2.8vw, 43px); font-weight: 480; line-height: 1.5; letter-spacing: -1.25px; }
.login-story > p { max-width: 360px; margin: 0; color: #7d9bac; font-size: 13px; line-height: 2.1; }
.flow { display: grid; gap: 0; max-width: 390px; margin-top: 38px; }
.flow div { display: flex; align-items: center; gap: 20px; padding: 17px 0; border-top: 1px solid #e5eef3; color: #7294a9; font-size: 12px; }
.flow span { color: #a0b7c4; font-family: "SFMono-Regular", Consolas, monospace; font-size: 10px; letter-spacing: 1px; }
.story-foot { margin-top: auto; padding-top: 40px; color: #96afbe; font-size: 9px; letter-spacing: 2px; }
.login-form-wrap { display: flex; align-items: center; justify-content: center; padding: 55px 44px; background: #fff; }
.login-form { width: 100%; max-width: 350px; }
.login-label { margin-bottom: 14px; color: #81a5b8; font-size: 9px; font-weight: 550; letter-spacing: 2.4px; }
.login-form h2 { color: #3b596b; font-size: 25px; font-weight: 520; letter-spacing: -.6px; }
.login-form > p { margin: 10px 0 32px; color: #869faf; font-size: 12px; }
.login-form .field { margin-bottom: 20px; }
.login-form .field > span { color: #6e8fa4; font-size: 12px; font-weight: 500; }
.login-form input { min-height: 45px; }
.login-form .primary { width: 100%; min-height: 44px; margin-top: 7px; padding: 11px 18px; }
.login-form > .help { margin-top: 20px; margin-bottom: 0; color: #8da8b9; font-size: 11px; line-height: 1.95; }
#toast { position: fixed; left: 50%; bottom: 27px; z-index: 99; max-width: calc(100% - 40px); padding: 14px 22px; border: 1px solid #dfe8ed; border-radius: 9px; background: #fff; color: #577d94; box-shadow: 0 8px 36px #2947571a; transform: translateX(-50%); font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
#toast.error { border-color: #e8cfd3; background: #fffafa; color: #a25963; }

@media (min-width: 1600px) {
  .workspace { padding-top: 48px; }
  .page-head { margin-bottom: 35px; }
  .stat { padding-top: 27px; padding-bottom: 25px; }
  .stat strong { font-size: 38px; }
  .empty { padding-top: 80px; padding-bottom: 84px; }
}
@media (max-width: 1200px) {
  .shell { grid-template-columns: 218px minmax(0, 1fr); }
  .sidebar { padding-right: 14px; padding-left: 14px; }
  .topbar { padding-right: 29px; padding-left: 29px; }
  .workspace { padding: 32px 29px; }
  .stat { padding: 20px; }
  .stat strong { font-size: 30px; }
  .page-head { flex-wrap: wrap; align-items: flex-start; gap: 18px; }
  .grid-two { grid-template-columns: minmax(0, 1.2fr) minmax(260px, 1fr); gap: 19px; }
  .card-body { padding: 22px; }
  th, td { padding-right: 19px; padding-left: 19px; }
  .topbar .system-status { font-size: 9px; }
  .login-story { padding-right: 48px; padding-left: 48px; }
}
@media (max-width: 1000px) {
  .grid-two { grid-template-columns: minmax(0, 1fr); }
  .stat { padding: 18px 16px; }
  .stat strong { font-size: 27px; }
  .stat-label { font-size: 11px; }
  .stat-label > span { display: none; }
  .topbar { gap: 12px; }
  .topbar > .system-status { display: none; }
  .login-story { padding-right: 35px; padding-left: 35px; }
  .login-form-wrap { padding-right: 32px; padding-left: 32px; }
}
@media (max-width: 760px) {
  .shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; padding: 23px 20px 17px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar .brand { padding: 0 2px; }
  .sidebar .brand strong { font-size: 16px; }
  .sidebar .brand small { font-size: 8px; letter-spacing: 1.65px; }
  .sidebar .brand img { width: 31px; height: 31px; }
  .nav-label, .sidebar-foot { display: none; }
  .nav { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 23px; }
  .nav button { min-height: 40px; gap: 9px; padding: 9px 12px; font-size: 12px; }
  .nav button.active::after { right: 10px; width: 3px; height: 3px; }
  .nav .glyph { width: 17px; height: 17px; }
  .nav .glyph .icon { width: 16px; height: 16px; }
  .topbar { height: 58px; padding: 0 22px; gap: 12px; }
  .topbar .system-status { display: none; }
  .crumb { font-size: 10px; }
  .crumb span { padding-left: 7px; }
  .profile { gap: 6px; font-size: 10px; }
  .profile > .muted { display: none; }
  .profile .quiet { padding-right: 0; padding-left: 5px; }
  .avatar { width: 26px; height: 26px; font-size: 10px; }
  .workspace { padding: 29px 20px 28px; }
  .page-head { margin-bottom: 23px; gap: 17px; }
  h1 { font-size: 26px; letter-spacing: -.6px; }
  .eyebrow { margin-bottom: 7px; font-size: 8px; letter-spacing: 2px; }
  .page-head p { font-size: 12px; }
  .page-head > .actions { padding: 0; }
  button { min-height: 40px; font-size: 12px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 20px; }
  .stat { padding: 20px 18px; }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .stat strong { font-size: 29px; }
  .stat-label > span { display: inline; }
  .stat small { font-size: 10px; }
  .notice { flex-wrap: wrap; gap: 10px; margin-bottom: 21px; padding: 16px; font-size: 12px; }
  .notice strong { font-size: 12px; }
  .notice button { margin-left: 27px; }
  .notice-mark { width: 23px; height: 23px; min-width: 23px; }
  .notice:has(.notice-mark) { flex-wrap: nowrap; }
  .notice li { margin: 4px 0; }
  .panel-head { min-height: 66px; padding: 18px; gap: 10px; }
  .panel-head h2 { font-size: 13px; }
  .panel-head .actions { gap: 4px; }
  .toolbar { gap: 14px; padding: 14px 16px; }
  .tabs { width: 100%; gap: 3px; }
  .tabs button { padding: 6px 8px; min-height: 31px; font-size: 11px; }
  .search { width: 100%; min-height: 39px; }
  .desktop-only { display: none; }
  .card-body { padding: 22px 19px; }
  .footnote { padding: 14px 18px; font-size: 10px; }
  .footer-line { margin-top: 17px; gap: 6px; font-size: 10px; line-height: 1.9; }
  .row-two { gap: 13px; }
  input, select, textarea { font-size: 16px; }
  .field small, .help { font-size: 12px; }
  .grid-two { gap: 19px; }
  .product-grid { grid-template-columns: minmax(0, 1fr); gap: 17px; }
  .product-card { padding: 23px; }
  .product-card .money { font-size: 28px; }
  .empty { padding: 48px 22px 53px; }
  .empty p { font-size: 12px; }
  dialog { width: calc(100% - 24px); max-height: 92vh; max-height: 92dvh; border-radius: 11px; }
  .modal-head { padding: 19px 20px; }
  .modal-head h2 { font-size: 16px; }
  .modal-body { padding: 23px 20px; }
  .modal-foot { margin-top: 22px; padding-top: 17px; }
  .detail-grid { gap: 18px; }
  .detail-grid dd { font-size: 13px; }
  .detail-grid dt { font-size: 11px; }
  .login-page { display: block; }
  .login-story { padding: 26px; border-right: 0; border-bottom: 1px solid var(--line); background: #fff; }
  .login-story::after { display: none; }
  .login-story .brand { margin: 0; }
  .login-story h1, .login-story > p, .flow, .story-foot { display: none; }
  .login-form-wrap { min-height: calc(100dvh - 93px); padding: 42px 27px 52px; }
  .login-form { max-width: 370px; }
  .login-form h2 { font-size: 25px; }
  .login-form .field { margin-bottom: 20px; }
  .login-form .primary { min-height: 46px; }
  #toast { bottom: 20px; max-width: calc(100% - 28px); padding: 12px 17px; font-size: 12px; }
}
@media (max-width: 390px) {
  .sidebar { padding-right: 16px; padding-left: 16px; }
  .workspace { padding-right: 15px; padding-left: 15px; }
  .topbar { padding-right: 17px; padding-left: 17px; }
  .nav button { padding-right: 9px; padding-left: 9px; gap: 7px; font-size: 11px; }
  .nav button.active::after { display: none; }
  .stat { padding-right: 15px; padding-left: 15px; }
  .stat-label > span { display: none; }
  .stat strong { font-size: 27px; }
  .row-two { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .detail-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .panel-head { flex-wrap: wrap; }
  .modal-foot > button { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

/* Readability is maintained at every breakpoint; only decorative lines stay pale. */
:root { --muted: #5e7280; --blue: #386d87; }
button { font-size: 13px; }
.brand small, .nav-label, .eyebrow, .login-label, .story-foot {
  color: #5e7280;
  font-size: 12px;
}
.nav button { color: #5e7280; font-size: 14px; }
.nav button.active { color: #375e70; }
.sidebar-foot, .sidebar-foot p, .sidebar-foot strong { color: #5e7280; font-size: 13px; }
.sidebar-foot button { font-size: 12px; }
.system-status, .sidebar-foot .system-status, .topbar .system-status,
.profile, .profile .quiet, .crumb, .source-tag, .inline-count, .footer-line, .footnote {
  color: #5e7280;
  font-size: 12px;
}
.crumb span { color: #4d6574; }
.avatar { color: #4a6d81; font-size: 12px; }
.page-head p, .stat-label, .stat small { color: #5e7280; font-size: 13px; }
.stat-label > span { color: #5e7280; font-size: 12px; }
.stat.primary-stat .stat-label { color: #476b80; }
.notice, .notice strong, .notice p { color: #4d6574; font-size: 13px; }
.notice strong { color: #3d5868; }
.notice p { color: #5e7280; }
.notice button { color: #476b80; font-size: 13px; }
.warning, .warning p, .blocker-details, .blocker-details summary { color: #7a6750; font-size: 13px; }
.warning strong { color: #6c5738; font-size: 14px; }
.notice-mark { color: #8b6a32; font-size: 13px; }
.panel-head small, .tabs button, .badge, th, .provider, td small, td .small {
  color: #5e7280;
  font-size: 12px;
}
.tabs button.active { color: #476b80; }
td { color: #4d6574; }
td strong { color: #3e596d; font-size: 13px; }
.badge.needs_review { color: #7a622e; }
.badge.ready { color: #476b80; }
.badge.awaiting_receipt { color: #655e79; }
.badge.confirmed_manual { color: #48745d; }
.badge.cancelled { color: #5e7280; }
.provider b { color: #4d6e81; font-size: 12px; }
.provider.stripe b { color: #655e79; }
.empty h3 { color: #4d6574; }
.empty p { color: #5e7280; font-size: 13px; }
.empty .primary { font-size: 13px; }
.field > span, .field > label, .field small, .help, .check,
.steps li, .steps strong, .settings-note, .settings-note a,
.link-box, .audit p, .audit small, .section-label,
.detail-grid dt, .detail-grid dd, .detail-grid > div > strong {
  color: #5e7280;
  font-size: 13px;
}
.field > span, .field > label, .steps strong, .section-label,
.detail-grid dd, .detail-grid > div > strong { color: #4d6574; }
.settings-note a, .link-box { color: #426d85; }
.steps li::before { color: #5e7280; font-size: 12px; }
.form-error { font-size: 13px; }
.search { font-size: 13px; }
input, select, textarea { color: #405b6c; }
input::placeholder, textarea::placeholder { color: #5e7280; }
input[readonly] { color: #5e7280; }
.warn-text { color: #846831 !important; }
.login-story > p, .flow div, .login-form > p,
.login-form .field > span, .login-form > .help {
  color: #5e7280;
  font-size: 13px;
}
.flow span { color: #5e7280; font-size: 12px; }
.login-form .field > span { color: #4d6574; }
#toast { color: #4d6574; font-size: 13px; }
#toast.error { color: #974c56; }
