:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-muted: #f8fafb;
  --border: #dfe4e8;
  --border-strong: #c8d0d7;
  --text: #18212b;
  --text-muted: #65717d;
  --nav: #1c252f;
  --nav-muted: #aab4be;
  --primary: #1769c2;
  --primary-hover: #1259a6;
  --green: #1b7f5a;
  --green-bg: #e8f6ef;
  --orange: #a85c08;
  --orange-bg: #fff3df;
  --red: #b42318;
  --red-bg: #ffebe9;
  --blue-bg: #eaf3fc;
  --shadow: 0 8px 24px rgba(24, 33, 43, 0.07);
  --radius: 6px;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  background: var(--nav);
  color: #fff;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 8px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  border-radius: 6px;
  background: #fff;
  color: var(--nav);
  font-size: 19px;
  font-weight: 800;
}

.brand-block strong, .brand-block span { display: block; }
.brand-block strong { font-size: 14px; }
.brand-block span { margin-top: 3px; color: var(--nav-muted); font-size: 11px; }

.primary-nav {
  display: grid;
  gap: 5px;
  margin-top: 20px;
}

.nav-item {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--nav-muted);
  cursor: pointer;
  text-align: left;
}

.nav-item svg { width: 17px; height: 17px; }
.nav-item:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.nav-item.active { background: #fff; color: var(--nav); font-weight: 700; }

.sidebar-status {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: auto;
  padding: 14px 10px 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-status strong, .sidebar-status span { display: block; }
.sidebar-status strong { font-size: 12px; }
.sidebar-status span { margin-top: 3px; color: var(--nav-muted); font-size: 11px; }

.status-dot {
  width: 8px;
  height: 8px;
  display: inline-block;
  flex: 0 0 8px;
  margin-top: 4px;
  border-radius: 50%;
  background: #32b77a;
  box-shadow: 0 0 0 3px rgba(50, 183, 122, 0.16);
}

.status-dot.neutral {
  margin-top: 0;
  background: #7c8894;
  box-shadow: none;
}

.main-content {
  min-width: 0;
  padding: 24px clamp(18px, 3vw, 42px) 56px;
}

.topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

h1, h2, p { letter-spacing: 0; }
h1 { margin: 0; font-size: 24px; line-height: 1.2; }
h2 { margin: 0; font-size: 16px; line-height: 1.3; }

.topbar-actions, .toolbar-group, .inline-actions, .settings-footer {
  display: flex;
  align-items: center;
  gap: 10px;
}

.source-badge {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px;
}

.button, .text-button, .icon-button {
  border: 0;
  cursor: pointer;
  text-decoration: none;
}

.button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
}

.button svg { width: 15px; height: 15px; }
.button.primary { background: var(--primary); color: #fff; }
.button.primary:hover { background: var(--primary-hover); }
.button.secondary { border-color: var(--border-strong); background: var(--surface); color: var(--text); }
.button.secondary:hover { border-color: #9ba7b2; background: #f8fafc; }
.button:disabled { cursor: not-allowed; opacity: 0.45; }

.view { display: none; }
.view.active { display: block; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 30px;
}

.metric-card {
  min-width: 0;
  min-height: 128px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 2px 10px rgba(24, 33, 43, 0.03);
}

.metric-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-muted);
  font-size: 12px;
}

.metric-icon {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: var(--blue-bg);
  color: var(--primary);
}

.metric-icon.green { background: var(--green-bg); color: var(--green); }
.metric-icon.orange { background: var(--orange-bg); color: var(--orange); }
.metric-icon.red { background: var(--red-bg); color: var(--red); }
.metric-icon svg { width: 16px; height: 16px; }

.metric-value {
  display: block;
  margin-top: 14px;
  font-size: 25px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.metric-value.metric-pending { color: var(--text-muted); font-size: 20px; }

.metric-meta { margin-top: 9px; color: var(--text-muted); font-size: 11px; }

.sync-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 64px;
  margin: 0 0 28px;
  padding: 12px 15px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.55);
}
.sync-band-leading { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.sync-band-leading strong, .sync-band-leading span { display: block; }
.sync-band-leading strong { font-size: 12px; }
.sync-band-leading span { margin-top: 4px; color: var(--text-muted); font-size: 11px; }
.sync-band-meta { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; color: var(--text-muted); font-size: 11px; white-space: nowrap; }
.sync-band-meta span:first-child { color: var(--primary); font-weight: 800; }

.live-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 26px;
}
.live-summary-grid > div {
  min-width: 0;
  min-height: 78px;
  padding: 14px 15px;
  border-left: 3px solid var(--primary);
  background: var(--surface);
}
.live-summary-grid strong, .live-summary-grid span { display: block; }
.live-summary-grid strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 20px; }
.live-summary-grid span { margin-top: 5px; color: var(--text-muted); font-size: 11px; }

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 12px;
}

.section-heading.compact { align-items: center; margin-top: 26px; }
.section-heading p, .settings-label p { margin: 5px 0 0; color: var(--text-muted); font-size: 12px; }

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: transparent;
  color: var(--primary);
  font-weight: 700;
}

.text-button svg { width: 14px; height: 14px; }

.table-surface {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 15px; border-bottom: 1px solid #e8ecef; text-align: left; vertical-align: middle; white-space: nowrap; }
th { background: var(--surface-muted); color: var(--text-muted); font-size: 11px; font-weight: 700; }
td { font-size: 12px; font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fbfcfd; }
.align-right { text-align: right; }

.sku-cell strong, .sku-cell span { display: block; }
.sku-cell strong { max-width: 260px; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.sku-cell span { max-width: 260px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; color: var(--text-muted); font-size: 11px; }

.money-positive { color: var(--green); font-weight: 700; }
.money-negative { color: var(--red); font-weight: 700; }

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--green-bg);
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
}

.pill.warning { background: var(--orange-bg); color: var(--orange); }
.pill.critical { background: var(--red-bg); color: var(--red); }
.pill.info { background: var(--blue-bg); color: var(--primary); }
.pill.neutral { background: #edf0f2; color: var(--text-muted); }
.label-list { display: flex; flex-wrap: wrap; gap: 5px; min-width: 240px; max-width: 420px; }

.view-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.search-box {
  width: min(320px, 100%);
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: var(--surface);
}

.search-box svg { width: 15px; height: 15px; color: var(--text-muted); }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--text); }

.row-actions { display: flex; justify-content: flex-end; gap: 5px; }
.icon-button {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text-muted);
}
.icon-button:hover { border-color: #9ba7b2; color: var(--text); }
.icon-button.danger:hover { border-color: #e1aaa5; background: var(--red-bg); color: var(--red); }
.icon-button svg { width: 14px; height: 14px; }

.empty-state {
  min-height: 220px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  color: var(--text-muted);
}
.empty-state svg { width: 30px; height: 30px; }

.inspection-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.inspection-stat {
  min-height: 82px;
  padding: 15px;
  border-left: 3px solid var(--border-strong);
  background: var(--surface);
}
.inspection-stat.critical { border-color: var(--red); }
.inspection-stat.warning { border-color: var(--orange); }
.inspection-stat.info { border-color: var(--primary); }
.inspection-stat strong, .inspection-stat span { display: block; }
.inspection-stat strong { font-size: 22px; }
.inspection-stat span { margin-top: 5px; color: var(--text-muted); font-size: 11px; }

.finance-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}
.period-control {
  display: grid;
  grid-template-columns: repeat(3, 68px);
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #e9eef2;
}
.period-control button {
  min-height: 32px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
}
.period-control button.selected {
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
  box-shadow: 0 1px 3px rgba(24, 33, 43, 0.12);
}
.finance-metrics { margin-bottom: 18px; }
.formula-band {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(480px, 1.4fr);
  gap: 28px;
  align-items: center;
  padding: 18px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.formula-band p:last-child { margin: 6px 0 0; color: var(--text-muted); font-size: 11px; }
.formula-breakdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-width: 0;
  border-left: 1px solid var(--border);
}
.formula-breakdown > div { min-width: 0; padding: 6px 14px; border-right: 1px solid var(--border); }
.formula-breakdown span, .formula-breakdown strong { display: block; }
.formula-breakdown span { color: var(--text-muted); font-size: 10px; }
.formula-breakdown strong { margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.trend-surface {
  min-height: 198px;
  padding: 12px 14px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.trend-legend { display: flex; justify-content: flex-end; gap: 14px; color: var(--text-muted); font-size: 10px; }
.trend-legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-swatch { width: 8px; height: 8px; display: inline-block; border-radius: 2px; }
.legend-swatch.income, .trend-bar.income { background: var(--green); }
.legend-swatch.expense, .trend-bar.expense { background: var(--red); }
.trend-scroll { overflow-x: auto; }
.trend-chart {
  min-width: max(720px, calc(var(--trend-days, 30) * 22px));
  height: 160px;
  display: grid;
  grid-template-columns: repeat(var(--trend-days, 30), minmax(16px, 1fr));
  gap: 4px;
  align-items: end;
  padding-top: 12px;
  border-bottom: 1px solid var(--border);
}
.trend-day { height: 146px; display: grid; grid-template-rows: 124px 18px; align-items: end; min-width: 0; }
.trend-bar-pair { height: 124px; display: flex; align-items: end; justify-content: center; gap: 2px; }
.trend-bar { width: min(7px, 42%); min-height: 1px; display: block; border-radius: 2px 2px 0 0; opacity: 0.82; }
.trend-day small { min-height: 16px; overflow: visible; color: var(--text-muted); font-size: 9px; white-space: nowrap; }
.note-cell { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.activity-heading { align-items: center; }
.activity-metrics { margin-top: 18px; margin-bottom: 4px; }
.activity-metrics + .section-heading { margin-top: 22px; }
.commerce-heading { align-items: center; }
.commerce-metrics { margin-top: 18px; margin-bottom: 4px; }
.commerce-table-heading { align-items: center; }
.commerce-period { grid-template-columns: repeat(2, 82px); }
.data-pending { color: var(--text-muted); font-size: 11px; }
.share-cell {
  width: 160px;
  display: grid;
  grid-template-columns: minmax(72px, 1fr) 45px;
  align-items: center;
  gap: 8px;
}
.share-cell strong { text-align: right; font-size: 11px; }
.share-track {
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: #e8ecef;
}
.share-track i {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--primary);
}

.account-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.account-heading h2 { margin: 4px 0 0; font-size: 20px; }
.account-heading > div > p:last-child { margin: 7px 0 0; color: var(--text-muted); font-size: 12px; }
.account-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.account-summary-grid > div {
  min-width: 0;
  min-height: 104px;
  padding: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.account-summary-grid span, .account-summary-grid strong, .account-summary-grid small { display: block; }
.account-summary-grid span { color: var(--text-muted); font-size: 11px; }
.account-summary-grid strong { margin-top: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 22px; }
.account-summary-grid small { margin-top: 5px; color: var(--text-muted); font-size: 11px; }
.billing-status {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 54px;
  margin: 0 0 25px;
  padding: 12px 14px;
  border-left: 3px solid var(--border-strong);
  background: var(--surface);
}
.billing-status.success { border-color: var(--green); background: var(--green-bg); }
.billing-status.warning { border-color: var(--orange); background: var(--orange-bg); }
.billing-status.error { border-color: var(--red); background: var(--red-bg); }
.billing-status svg { width: 18px; height: 18px; flex: 0 0 18px; }
.billing-status strong, .billing-status span { display: block; }
.billing-status strong { font-size: 12px; }
.billing-status span { margin-top: 4px; color: var(--text-muted); font-size: 11px; }
.billing-packages {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 26px;
}
.billing-package {
  min-width: 0;
  display: flex;
  min-height: 188px;
  flex-direction: column;
  padding: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.billing-package.draft { opacity: 0.72; }
.billing-package-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.billing-package-header strong { font-size: 21px; }
.billing-package-credits { margin-top: 22px; font-size: 18px; font-weight: 800; }
.billing-package-meta { margin-top: 5px; color: var(--text-muted); font-size: 11px; }
.billing-package .button { width: 100%; margin-top: auto; }
.order-id { max-width: 230px; overflow: hidden; text-overflow: ellipsis; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; }
.table-link { color: var(--primary); font-weight: 700; text-decoration: none; }
.table-link:hover { text-decoration: underline; }

.settings-form { border-top: 1px solid var(--border); }
.settings-band {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(320px, 1.5fr);
  gap: 48px;
  padding: 26px 0;
  border-bottom: 1px solid var(--border);
}
.settings-fields { display: grid; gap: 16px; }
.settings-fields label, .form-grid label { display: grid; gap: 7px; }
.settings-fields label > span, .form-grid label > span { color: var(--text-muted); font-size: 11px; font-weight: 700; }

input[type="url"], input[type="text"], input[type="number"], input[type="search"], input[type="date"], select, textarea {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: #fff;
  color: var(--text);
  outline: 0;
}
textarea { min-height: 82px; padding-top: 9px; padding-bottom: 9px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(23, 105, 194, 0.1); }

.connection-result { color: var(--text-muted); font-size: 11px; }
.connection-result.success { color: var(--green); }
.connection-result.error { color: var(--red); }

.segmented-control {
  width: fit-content;
  display: grid;
  grid-template-columns: repeat(2, 90px);
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #edf1f4;
}
.segmented-control button { min-height: 32px; border: 0; border-radius: 4px; background: transparent; color: var(--text-muted); }
.segmented-control button.selected { background: #fff; color: var(--text); font-weight: 800; box-shadow: 0 1px 3px rgba(24, 33, 43, 0.12); }

.security-row { display: flex; align-items: flex-start; gap: 11px; color: var(--green); }
.security-row svg { width: 19px; height: 19px; flex: 0 0 19px; }
.security-row strong, .security-row span { display: block; }
.security-row strong { color: var(--text); font-size: 12px; }
.security-row span { margin-top: 4px; color: var(--text-muted); font-size: 11px; }
.settings-footer { justify-content: flex-end; padding-top: 20px; }

dialog {
  width: min(760px, calc(100vw - 28px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 20px 60px rgba(24, 33, 43, 0.24);
}
dialog::backdrop { background: rgba(19, 27, 35, 0.52); }
dialog form { display: flex; max-height: calc(100vh - 32px); flex-direction: column; }
.dialog-header, .dialog-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; }
.dialog-header { border-bottom: 1px solid var(--border); }
.dialog-footer { justify-content: flex-end; border-top: 1px solid var(--border); }
.dialog-body { overflow-y: auto; padding: 20px; }
.form-grid { display: grid; gap: 14px; }
.form-grid.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full-span { grid-column: 1 / -1; }
.checkbox-row { display: flex; align-items: flex-start; gap: 9px; margin-top: 18px; color: var(--text-muted); font-size: 12px; }
.checkbox-row input { margin-top: 2px; }
.checkbox-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  max-width: min(360px, calc(100vw - 32px));
  padding: 11px 14px;
  border-radius: 5px;
  background: #1c252f;
  color: #fff;
  font-size: 12px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1080px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inspection-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .live-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .billing-packages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .formula-band { grid-template-columns: 1fr; gap: 14px; }
  .formula-breakdown { border-top: 1px solid var(--border); }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; padding: 12px; }
  .brand-block { padding: 2px 4px 12px; }
  .primary-nav { display: flex; gap: 6px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; }
  .nav-item { min-height: 52px; flex: 0 0 84px; justify-content: center; flex-direction: column; gap: 4px; padding: 6px; font-size: 10px; }
  .sidebar-status { display: none; }
  .main-content { padding: 18px 14px 40px; }
  .topbar { align-items: flex-start; flex-direction: column; margin-bottom: 18px; }
  .topbar-actions { width: 100%; flex-wrap: wrap; }
  .source-badge { margin-right: auto; }
  .metric-grid, .inspection-summary { grid-template-columns: 1fr; }
  .live-summary-grid { grid-template-columns: 1fr; }
  .account-heading { align-items: flex-start; flex-direction: column; }
  .finance-toolbar { align-items: stretch; flex-direction: column; }
  .finance-toolbar .toolbar-group { width: 100%; flex-wrap: wrap; }
  .finance-toolbar .button { flex: 1; }
  .period-control { width: 100%; grid-template-columns: repeat(3, 1fr); }
  .commerce-table-heading { align-items: stretch; flex-direction: column; }
  .commerce-period { grid-template-columns: repeat(2, 1fr); }
  .formula-breakdown { grid-template-columns: repeat(2, minmax(0, 1fr)); border-left: 0; }
  .formula-breakdown > div { border-top: 1px solid var(--border); }
  .account-summary-grid, .billing-packages { grid-template-columns: 1fr; }
  .metric-card { min-height: 112px; }
  .view-toolbar { align-items: stretch; flex-direction: column; }
  .search-box { width: 100%; }
  .settings-band { grid-template-columns: 1fr; gap: 18px; }
  .form-grid.two-columns { grid-template-columns: 1fr; }
  .form-grid .full-span { grid-column: auto; }
  .checkbox-grid { grid-template-columns: 1fr; }
  .section-heading { align-items: flex-start; }
  .sync-band { align-items: flex-start; flex-direction: column; }
  .sync-band-meta { width: 100%; justify-content: space-between; }
  .settings-footer { flex-wrap: wrap; }
}
