:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  --ink: #18211f;
  --muted: #68716f;
  --line: #dce2e0;
  --surface: #ffffff;
  --canvas: #f3f6f5;
  --brand: #215ce5;
  --brand-dark: #092b78;
  --brand-soft: #eaf0ff;
  --green: #087a57;
  --green-dark: #075e45;
  --green-soft: #e5f3ed;
  --orange: #bd5a18;
  --orange-soft: #fff0e4;
  --red: #b42318;
  --red-soft: #fff0ef;
  --blue: #2f5f8f;
  --shadow: 0 10px 30px rgba(23, 37, 33, 0.08);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-size: 14px; letter-spacing: 0; }
button, input, textarea, select { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.loading-view {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: var(--muted);
}

.brand-symbol, .brand-logo { position: relative; display: block; overflow: hidden; background: white; border-radius: 6px; }
.brand-symbol { width: 56px; height: 60px; box-shadow: 0 8px 22px rgba(9, 43, 120, .12); }
.brand-symbol img { position: absolute; top: -79px; left: -16px; width: 220px; max-width: none; }
.brand-logo { width: 280px; height: 88px; }
.brand-logo img { position: absolute; top: 50%; left: 50%; width: 290px; max-width: none; transform: translate(-50%, -50%); }
.eyebrow { margin: 0 0 8px; color: var(--brand); font-size: 11px; font-weight: 800; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(28px, 4vw, 46px); line-height: 1.05; }
h2 { margin-bottom: 8px; font-size: 19px; line-height: 1.25; }
p { line-height: 1.55; }

.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(380px, 0.92fr); }
.auth-product { min-height: 100vh; padding: clamp(28px, 6vw, 84px); background: #071b4f; color: white; display: flex; flex-direction: column; }
.auth-logo { box-shadow: 0 12px 32px rgba(0, 0, 0, .18); }
.auth-product .auth-copy { max-width: 680px; margin: auto 0 56px; }
.auth-product .eyebrow { color: #8eb0ff; }
.auth-product h1 { max-width: 660px; }
.auth-product p { max-width: 560px; color: #c8d8d3; font-size: 17px; }
.connect-steps { list-style: none; margin: 0; padding: 28px 0 0; border-top: 1px solid rgba(255,255,255,.16); display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.connect-steps li { display: flex; gap: 12px; min-width: 0; }
.connect-steps li > span { flex: 0 0 auto; display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid #6f94f4; border-radius: 50%; color: #b7caff; font-weight: 800; }
.connect-steps strong, .connect-steps small { display: block; }
.connect-steps strong { margin: 3px 0 5px; }
.connect-steps small { color: #aebfba; line-height: 1.45; }
.auth-panel { display: grid; align-content: center; padding: clamp(28px, 7vw, 110px); background: white; }
.auth-tabs { display: flex; gap: 4px; margin-bottom: 34px; padding: 4px; background: var(--canvas); border-radius: 6px; }
.auth-tabs button { flex: 1; padding: 10px; border: 0; background: transparent; color: var(--muted); border-radius: 4px; }
.auth-tabs button.active { background: white; color: var(--ink); box-shadow: 0 1px 5px rgba(0,0,0,.08); font-weight: 700; }
.auth-form { display: grid; gap: 18px; max-width: 480px; width: 100%; margin: 0 auto; }
.auth-form h2 { font-size: 28px; }
.auth-form > div > p:not(.eyebrow) { color: var(--muted); }
.auth-link { justify-self: center; border: 0; padding: 2px; background: transparent; color: var(--brand); }
.auth-link:hover { border-color: transparent; color: var(--brand-dark); text-decoration: underline; }
.form-field { display: grid; gap: 7px; }
.password-control { position: relative; }
.password-control input { padding-right: 86px; }
.password-control button { position: absolute; top: 5px; right: 5px; min-width: 72px; padding: 6px 8px; border: 0; background: var(--canvas); color: var(--brand-dark); font-size: 11px; }
.form-grid.compact { gap: 12px; }
.verification-panel p { margin-bottom: 0; color: var(--muted); }
.verification-panel p strong { color: var(--ink); }
.auth-status { max-width: 480px; margin: 22px auto 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 5px; font-size: 12px; line-height: 1.5; }
.auth-status.success { border-color: #a9d7c7; background: var(--green-soft); color: var(--green-dark); }
.auth-status.error { border-color: #efb4ae; background: var(--red-soft); color: var(--red); }

label { display: grid; gap: 7px; color: #303b38; font-size: 12px; font-weight: 700; }
input, textarea, select {
  width: 100%;
  border: 1px solid #cbd3d1;
  border-radius: 5px;
  background: white;
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
}
textarea { resize: vertical; min-height: 78px; }
input:focus, textarea:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(33, 92, 229, .12); }
.field-help, label small { color: var(--muted); font-weight: 400; font-size: 11px; }
.form-message { min-height: 20px; margin: 0; font-size: 12px; }
.form-message.error { color: var(--red); }
.form-message.success { color: var(--green-dark); }
.consent-option { display: flex; align-items: flex-start; gap: 11px; padding: 12px; border: 1px solid var(--line); border-radius: 5px; background: #f8faf9; cursor: pointer; }
.consent-option input { flex: 0 0 auto; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--brand); }
.consent-option span, .consent-option strong, .consent-option small { display: block; }
.consent-option strong { color: var(--ink); font-size: 12px; }
.consent-option small { margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 400; line-height: 1.45; }
.settings-consent { max-width: 760px; }
.user-invite-form { display: grid; grid-template-columns: minmax(240px, 1fr) 190px auto; align-items: end; gap: 12px; max-width: 820px; }
.user-invite-form button { min-height: 40px; }
.user-access-table-wrap { margin-top: 20px; }
.user-access-table { min-width: 760px; }
.user-access-table td:first-child strong, .user-access-table td:first-child small { display: block; }
.user-access-table td:first-child small { margin-top: 4px; color: var(--muted); }
.user-access-table select { min-width: 150px; padding: 8px 10px; }
.user-row-actions { display: flex; align-items: center; gap: 8px; }
.user-row-actions button, .user-access-table td:last-child > button { padding: 7px 9px; font-size: 11px; }
.role-badge { display: inline-flex; padding: 5px 8px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font-size: 11px; font-weight: 700; }
.role-badge.owner { border-color: #b9c9f5; background: var(--brand-soft); color: var(--brand-dark); }
.muted-text { color: var(--muted); font-size: 11px; }
.pending-user-row { background: #fafbfb; }

button, .button {
  border: 1px solid #cbd3d1;
  border-radius: 5px;
  background: white;
  color: var(--ink);
  padding: 10px 14px;
  font-weight: 700;
}
button:hover { border-color: #95a29e; }
button:disabled { cursor: not-allowed; opacity: .52; }
button.primary { border-color: var(--brand); background: var(--brand); color: white; }
button.primary:hover { background: var(--brand-dark); }
button.wide { width: 100%; min-height: 44px; }
button.quiet { padding: 7px 10px; background: transparent; }
button.danger-text { border-color: #f0c2bd; background: var(--red-soft); color: var(--red); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 230px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 22px 16px; background: #071b4f; color: white; display: flex; flex-direction: column; }
.sidebar-brand { padding: 0 6px 22px; border-bottom: 1px solid rgba(255,255,255,.12); }
.sidebar-logo { width: 186px; height: 62px; }
.sidebar-logo img { width: 190px; }
.side-nav { display: grid; gap: 5px; margin-top: 22px; }
.side-nav button { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; padding: 11px 12px; background: transparent; color: #c7d6d1; text-align: left; }
.side-nav button span { color: #6f8c83; font-size: 10px; }
.side-nav button.active { background: rgba(255,255,255,.1); color: white; }
.read-only-note { margin-top: auto; padding: 14px 12px; border-top: 1px solid rgba(255,255,255,.12); }
.read-only-note strong, .read-only-note span { display: block; }
.read-only-note span { margin-top: 5px; color: #9fb2ac; font-size: 11px; line-height: 1.45; }

.workspace { min-width: 0; }
.topbar { min-height: 66px; padding: 13px clamp(18px, 3vw, 42px); display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); background: white; }
.topbar > div { display: flex; align-items: center; gap: 16px; min-width: 0; }
.organization-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }
.status-dot { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.status-dot i { width: 8px; height: 8px; border-radius: 50%; background: #a4aeab; }
.status-dot.connected i { background: #0b9e6e; }
.status-dot.error i { background: var(--red); }
.account-area { justify-content: flex-end; }
.feedback-button { padding: 7px 10px; border-color: #b9c9f5; background: var(--brand-soft); color: var(--brand-dark); font-size: 11px; }
.version-label { padding: 4px 7px; background: var(--canvas); border-radius: 4px; color: var(--muted); font-size: 10px; }

.notice { position: fixed; z-index: 20; top: 78px; right: 28px; max-width: 420px; padding: 12px 15px; border: 1px solid #b9d9ce; border-radius: 6px; background: #f0faf6; color: var(--green-dark); box-shadow: var(--shadow); }
.notice.error { border-color: #efb4ae; background: var(--red-soft); color: var(--red); }

.setup-strip { padding: 17px clamp(18px, 3vw, 42px); display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); background: #edf2f0; }
.setup-step { position: relative; display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--muted); font-size: 12px; }
.setup-step:not(:last-child)::after { content: ""; position: absolute; left: 36px; right: 10px; bottom: -7px; height: 2px; background: #ccd5d2; }
.setup-step.complete:not(:last-child)::after { background: var(--brand); }
.setup-step span { z-index: 1; flex: 0 0 auto; display: grid; place-items: center; width: 25px; height: 25px; border: 1px solid #c3cdca; border-radius: 50%; background: #edf2f0; font-size: 10px; font-weight: 800; }
.setup-step.complete { color: var(--ink); }
.setup-step.complete span { border-color: var(--brand); background: var(--brand); color: white; }
.setup-step.current { color: var(--brand-dark); font-weight: 800; }

.content { width: 100%; max-width: 1600px; margin: 0 auto; padding: 34px clamp(18px, 3vw, 42px) 70px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 30px; }
.page-heading h1 { font-size: 34px; }
.subtitle { margin: 0; color: var(--muted); }
.page-actions { display: flex; align-items: end; gap: 10px; }
.period-field { width: 170px; }

.empty-state { min-height: 320px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 26px; padding: 44px; border: 1px solid var(--line); background: white; }
.empty-index { color: #b6c3bf; font-size: 56px; font-weight: 300; }
.empty-state p { max-width: 650px; margin: 0; color: var(--muted); }

.metric-band { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); background: white; }
.metric-band article { min-width: 0; padding: 21px; border-right: 1px solid var(--line); }
.metric-band article:last-child { border-right: 0; }
.metric-band span, .metric-band small, .status-grid span { display: block; color: var(--muted); font-size: 11px; }
.metric-band strong { display: block; overflow-wrap: anywhere; margin: 8px 0 5px; font-size: 24px; }
.metric-band article.receivable strong, .metric-band article.receivable small { color: var(--green); }
.metric-band article.payable strong, .metric-band article.payable small { color: var(--orange); }

.data-band, .administration-breakdown, .connection-band, .config-band, .manual-callback, .demo-band { margin-top: 24px; padding: 24px; border: 1px solid var(--line); background: white; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 18px; }
.section-heading h2 { margin: 0; }
.pill { display: inline-flex; align-items: center; min-height: 24px; padding: 4px 8px; border: 1px solid #ccd5d2; border-radius: 12px; color: var(--muted); font-size: 10px; font-weight: 800; }
.pill.connected { border-color: #a9d7c7; background: var(--green-soft); color: var(--green-dark); }
.pill.warning { border-color: #efc19f; background: var(--orange-soft); color: var(--orange); }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; border-bottom: 1px solid #e6ebe9; text-align: left; vertical-align: middle; }
th { background: #f7f9f8; color: #5f6966; font-size: 10px; text-transform: uppercase; }
.vat-table th:nth-child(n+2), .vat-table td:nth-child(n+2) { text-align: right; }
.vat-table tr.section-row td { padding-top: 18px; background: #f7f9f8; color: #43504c; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.vat-table tr.total-row td { font-weight: 800; }
.balance-footer { display: flex; justify-content: flex-end; align-items: baseline; gap: 18px; padding: 18px 12px 0; }
.balance-footer strong { font-size: 22px; }
.balance-footer.receivable { color: var(--green); }
.balance-footer.payable { color: var(--orange); }

.accordions { display: grid; gap: 8px; }
.accordion { border: 1px solid var(--line); }
.accordion summary { list-style: none; display: grid; grid-template-columns: minmax(160px, 1fr) auto auto; align-items: center; gap: 18px; padding: 14px 16px; cursor: pointer; }
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary strong { overflow-wrap: anywhere; }
.accordion summary span { color: var(--muted); font-size: 12px; }
.accordion[open] summary { border-bottom: 1px solid var(--line); background: #f7f9f8; }
.accordion .table-wrap { padding: 0 14px 14px; }

.report-details { padding: 0; }
.report-details > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 24px; cursor: pointer; }
.report-details > summary::-webkit-details-marker { display: none; }
.report-details > summary h2 { margin: 0; }
.report-details[open] > summary { border-bottom: 1px solid var(--line); background: #f7f9f8; }
.report-details > .field-help { margin: 16px 24px 4px; }
.report-details > .table-wrap { padding: 8px 24px 24px; }
.summary-total { display: grid; justify-items: end; gap: 4px; }
.summary-total span { color: var(--muted); font-size: 11px; }
.summary-total strong { color: var(--brand-dark); font-size: 20px; }
.compact-table th:nth-child(n+2), .compact-table td:nth-child(n+2),
.icp-table th:nth-child(n+4), .icp-table td:nth-child(n+4) { text-align: right; }
.icp-table-wrap { margin-top: 18px; }
.icp-table tfoot th { border-top: 2px solid var(--line); background: #f7f9f8; color: var(--ink); font-size: 11px; }
.missing-value { color: var(--red); font-weight: 800; }

.connection-band, .demo-band { display: flex; align-items: center; justify-content: space-between; gap: 26px; }
.connection-band p, .demo-band p, .manual-callback p { margin: 0; color: var(--muted); }
.connection-actions { display: flex; gap: 8px; }
.manual-callback { display: grid; grid-template-columns: minmax(200px, .7fr) minmax(280px, 1fr) auto; align-items: end; gap: 18px; border-color: #c4d7e8; background: #f3f8fc; }
.configuration-table th:first-child, .configuration-table td:first-child,
.configuration-table th:nth-child(3), .configuration-table td:nth-child(3) { width: 140px; text-align: center; }
.configuration-table input[type="checkbox"] { width: 18px; height: 18px; margin: 0 auto; accent-color: var(--brand); }
.configuration-table input[type="text"] { min-width: 180px; }
.form-grid { display: grid; gap: 18px; }
.form-grid.two { grid-template-columns: repeat(2, 1fr); }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
.ledger-mode-fieldset { margin: 0; padding: 0; border: 0; }
.ledger-mode-fieldset legend { margin-bottom: 9px; color: var(--muted); font-size: 11px; font-weight: 800; }
.ledger-mode-control { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 760px; border: 1px solid var(--line); }
.ledger-mode-control label { min-width: 0; cursor: pointer; }
.ledger-mode-control label + label { border-left: 1px solid var(--line); }
.ledger-mode-control input { position: absolute; opacity: 0; pointer-events: none; }
.ledger-mode-control span { display: block; min-height: 76px; padding: 15px 17px; background: #fff; }
.ledger-mode-control strong, .ledger-mode-control small { display: block; }
.ledger-mode-control small { margin-top: 5px; color: var(--muted); font-weight: 400; line-height: 1.45; }
.ledger-mode-control input:checked + span { background: #eef5ff; box-shadow: inset 0 -3px 0 var(--blue); }
.ledger-mode-control input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: -3px; }
.ledger-mode-note { max-width: 760px; margin: 12px 0 0; color: var(--muted); }
#custom-ledger-fields { margin-top: 18px; }
.warning-note { border-left-color: var(--orange); background: var(--orange-soft); color: var(--orange); }
.rubric-mapping-panel { margin-top: 18px; border: 1px solid var(--line); }
.rubric-mapping-panel .field-help { margin: 0; padding: 14px 16px; background: #f7f9f8; }
.rubric-mapping-table td:first-child { width: 45%; min-width: 280px; }
.rubric-mapping-table td:first-child strong { display: inline-block; width: 30px; color: var(--brand-dark); }
.rubric-mapping-table input { min-width: 320px; }
.rubric-mapping-table .section-row td { padding: 9px 12px; background: #f3f6f5; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.rubric-mapping-table .calculated-row td { background: #fafbfb; color: var(--muted); }
.integrity-note { display: flex; gap: 16px; margin-top: 20px; padding: 13px 15px; border-left: 3px solid var(--blue); background: #f3f7fb; color: #3c5165; }
.integrity-note span { color: #627180; }
.status-grid { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 24px; border: 1px solid var(--line); background: white; }
.status-grid article { min-width: 0; padding: 20px; border-right: 1px solid var(--line); }
.status-grid article:last-child { border-right: 0; }
.status-grid strong { display: block; margin-top: 8px; overflow-wrap: anywhere; font-size: 13px; }

.monitoring-updated { color: var(--muted); font-size: 11px; }
.monitoring-status-grid article:nth-child(3) strong { color: var(--orange); }
.monitoring-band { padding-bottom: 10px; }
.monitoring-table th:nth-child(4), .monitoring-table td:nth-child(4),
.monitoring-table th:nth-child(5), .monitoring-table td:nth-child(5) { text-align: center; }
.monitoring-table td { white-space: nowrap; }
.monitoring-table td:first-child { min-width: 220px; white-space: normal; }
.monitoring-table td:first-child strong, .monitoring-table td:first-child small { display: block; }
.monitoring-table td:first-child small { margin-top: 4px; color: var(--muted); }
.monitoring-empty { padding: 30px 12px; color: var(--muted); text-align: center !important; }
.platform-state { display: inline-flex; align-items: center; gap: 7px; min-height: 26px; padding: 4px 9px; border: 1px solid var(--line); border-radius: 13px; color: var(--muted); font-size: 10px; font-weight: 800; }
.platform-state i { width: 7px; height: 7px; border-radius: 50%; background: #9ba6a2; }
.platform-state.healthy { border-color: #a9d7c7; background: var(--green-soft); color: var(--green-dark); }
.platform-state.healthy i { background: var(--green); }
.platform-state.attention { border-color: #efc19f; background: var(--orange-soft); color: var(--orange); }
.platform-state.attention i { background: var(--orange); }
.platform-state.info { border-color: #b9c9f5; background: var(--brand-soft); color: var(--brand-dark); }
.platform-state.info i { background: var(--blue); }
.monitoring-toggle-cell { min-width: 150px; }
.switch-control { display: inline-grid; grid-template-columns: 36px auto; align-items: center; gap: 8px; cursor: pointer; }
.switch-control input { position: absolute; opacity: 0; pointer-events: none; }
.switch-control span { position: relative; width: 36px; height: 20px; border: 1px solid #b7c1be; border-radius: 10px; background: #dce2e0; transition: background .16s ease; }
.switch-control span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: white; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .16s ease; }
.switch-control input:checked + span { border-color: var(--green); background: var(--green); }
.switch-control input:checked + span::after { transform: translateX(16px); }
.switch-control input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.switch-control input:disabled + span { opacity: .55; }
.switch-control b { min-width: 22px; color: var(--muted); font-size: 10px; }

.billing-hero { display: grid; grid-template-columns: minmax(280px, 1fr) auto auto; align-items: center; gap: 34px; padding: 28px; border: 1px solid var(--line); background: white; }
.billing-hero h2 { margin: 12px 0 6px; font-size: 24px; }
.billing-hero p { max-width: 660px; margin: 0; color: var(--muted); }
.billing-plan-field { max-width: 430px; margin-top: 18px; }
.billing-price { min-width: 210px; padding-left: 28px; border-left: 1px solid var(--line); }
.billing-price strong, .billing-price span { display: block; }
.billing-price strong { color: var(--brand-dark); font-size: 26px; }
.billing-price span { margin-top: 5px; color: var(--muted); font-size: 11px; }
.billing-actions { display: grid; gap: 8px; min-width: 175px; }
.billing-grid { margin-top: 24px; }

.modal-open { overflow: hidden; }
.modal-backdrop { position: fixed; z-index: 50; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(7, 27, 79, .58); }
.modal { width: min(680px, 100%); max-height: calc(100vh - 48px); overflow-y: auto; padding: 26px; border: 1px solid var(--line); border-radius: 6px; background: white; box-shadow: 0 20px 60px rgba(7, 27, 79, .22); }
.modal-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.modal-heading h2 { font-size: 25px; }
.modal-heading p:not(.eyebrow) { margin: 0; color: var(--muted); }
.icon-button { flex: 0 0 auto; width: 36px; height: 36px; padding: 0; display: grid; place-items: center; font-size: 18px; }
.export-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 24px; }
.export-options button { min-height: 116px; padding: 18px; text-align: left; }
.export-options strong, .export-options span { display: block; }
.export-options strong { color: var(--brand-dark); font-size: 17px; }
.export-options span { margin-top: 9px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.support-modal { width: min(720px, 100%); }
.support-modal form { display: grid; gap: 22px; }
.support-form-fields { display: grid; gap: 16px; }
.support-form-fields textarea { min-height: 170px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

@media (max-width: 1050px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-product { min-height: auto; }
  .auth-product .auth-copy { margin: 70px 0 45px; }
  .auth-panel { min-height: 620px; }
  .metric-band, .status-grid { grid-template-columns: repeat(2, 1fr); }
  .metric-band article:nth-child(2), .status-grid article:nth-child(2) { border-right: 0; }
  .metric-band article:nth-child(-n+2), .status-grid article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .form-grid.three { grid-template-columns: 1fr; }
  .manual-callback { grid-template-columns: 1fr; align-items: stretch; }
  .billing-hero { grid-template-columns: 1fr; }
  .billing-price { padding: 20px 0 0; border-top: 1px solid var(--line); border-left: 0; }
}

@media (max-width: 760px) {
  .user-invite-form { grid-template-columns: 1fr; }
  .ledger-mode-control { grid-template-columns: 1fr; }
  .ledger-mode-control label + label { border-top: 1px solid var(--line); border-left: 0; }
  .connect-steps { grid-template-columns: 1fr; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 12px; flex-direction: row; align-items: center; gap: 12px; overflow-x: auto; }
  .sidebar-brand { padding: 0 12px 0 0; border: 0; border-right: 1px solid rgba(255,255,255,.12); }
  .sidebar-logo { width: 146px; height: 48px; }
  .sidebar-logo img { width: 152px; }
  .side-nav { display: flex; margin: 0; }
  .side-nav button { white-space: nowrap; }
  .read-only-note { display: none; }
  .topbar { align-items: flex-start; }
  .topbar > div { flex-wrap: wrap; }
  .account-area { font-size: 11px; }
  .feedback-button { order: 3; }
  .setup-strip { grid-template-columns: repeat(4, minmax(130px, 1fr)); overflow-x: auto; }
  .page-heading, .connection-band, .demo-band { align-items: stretch; flex-direction: column; }
  .page-actions { align-items: stretch; }
  .period-field { width: 100%; }
  .empty-state { grid-template-columns: 1fr; padding: 28px; }
  .metric-band, .status-grid { grid-template-columns: 1fr; }
  .metric-band article, .status-grid article { border-right: 0; border-bottom: 1px solid var(--line); }
  .metric-band article:last-child, .status-grid article:last-child { border-bottom: 0; }
  .form-grid.two { grid-template-columns: 1fr; }
  .accordion summary { grid-template-columns: 1fr; gap: 5px; }
  .report-details > summary { align-items: flex-start; }
  .export-options { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .auth-product, .auth-panel { padding: 24px; }
  .auth-logo { width: 238px; height: 76px; }
  .auth-logo img { width: 246px; }
  .side-nav button span { display: none; }
  .topbar { padding: 12px; }
  .content { padding: 26px 12px 54px; }
  .data-band, .administration-breakdown, .connection-band, .config-band, .manual-callback, .demo-band { padding: 17px; }
  .page-actions { flex-direction: column; }
  .modal-backdrop { padding: 12px; }
  .modal { padding: 20px; }
}
