/* Owner-approved Portal visual system. Business behavior stays in Django/app.js.
   Loaded after app.css so rollback needs no database or business-code change. */
@font-face {
  font-family: Manrope;
  src: url("fonts/Manrope-Variable.ttf") format("truetype");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
:root {
  --canvas: #f5f6f8;
  --surface: #fff;
  --ink: #20232a;
  --muted: #667080;
  --line: #e9ebef;
  --line-strong: #dce1e9;
  --primary: #2459dc;
  --primary-dark: #1949c0;
  --primary-soft: #eaf0ff;
  --positive: #237149;
  --positive-soft: #edf7f1;
  --warning: #875719;
  --warning-soft: #fff5e5;
  --negative: #a03e38;
  --negative-soft: #fff0ef;
  --danger: var(--negative);
  --border: var(--line);
  --shadow: 0 2px 12px #1c315007;
  --radius: 16px;
  --radius-small: 10px;
  --ease: cubic-bezier(.23, 1, .32, 1);
}
body { font-family: Manrope, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 14px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { text-underline-offset: 4px; }
button, a, summary, input, select { touch-action: manipulation; }
button, input, select, textarea { accent-color: var(--primary); caret-color: var(--primary); }
input::placeholder, textarea::placeholder { color: #6b7482; opacity: 1; }
::selection { color: #153677; background: #dce7ff; }
* { scrollbar-width: thin; scrollbar-color: #bcc7d9 transparent; }
:is(button, a, summary, input, select, textarea):focus-visible { outline: 3px solid #3b6feb; outline-offset: 3px; }
#main:focus { outline: none; }
h1 { font-size: 31px; font-weight: 750; line-height: 1.25; letter-spacing: -.035em; overflow-wrap: anywhere; text-wrap: balance; }
h2 { font-size: 17px; font-weight: 750; line-height: 1.5; letter-spacing: -.018em; }
h3 { font-size: 15px; font-weight: 700; }
/* Dynamic request/account identities stay visible as metadata, never decorative kickers. */
.context-label { margin: 8px 0; color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.page-heading > div:first-child, .multi-agent-heading > div:first-child { display: flex; flex-direction: column; }
.page-heading h1, .multi-agent-heading h1 { order: -1; }
.result-icon { color: #357956; background: #edf7f1; }
.result-icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.app-layout { grid-template-columns: 238px minmax(0, 1fr); background: var(--canvas); }
.app-content { grid-template-columns: minmax(0, 1fr); }
.app-sidebar { padding: 28px 20px 18px; background: #fafbfc; border-right-color: #e4e7ec; }
.brand { font-size: 18px; font-weight: 800; letter-spacing: -.035em; }
.brand-mark { width: 38px; height: 38px; flex-basis: 38px; }
.sidebar-brand { margin: 0 8px 34px; min-height: 40px; gap: 8px; }
.sidebar-nav { gap: 6px; }
.sidebar-nav a, .sidebar-logout-button { min-height: 46px; gap: 12px; padding: 12px 14px; border-radius: 10px; color: #626b7a; font-size: 13px; font-weight: 600; }
.sidebar-nav a.is-active { color: #2452bc; background: #e9effc; box-shadow: none; }
.nav-icon { width: 20px; height: 20px; flex-basis: 20px; }
.nav-icon svg { width: 19px; height: 19px; }
.sidebar-support { min-height: 174px; margin-top: auto; padding: 20px 13px 58px; border: 0; border-radius: 14px; background: #eff2f8; box-shadow: none; flex-shrink: 0; }
.sidebar-support-copy { width: 112px; }
.sidebar-support-copy strong { max-width: 100px; font-size: 14px; line-height: 1.4; font-weight: 750; }
.sidebar-support-copy span, .sidebar-support-copy small { color: #576377; font-size: 11px; line-height: 1.5; }
.sidebar-support-copy span { margin-top: 4px; }
.sidebar-support-assistant { right: 10px; top: 20px; width: 56px; height: 56px; object-fit: cover; object-position: center 12%; border-radius: 50%; box-shadow: none; }
.sidebar-support-actions { display: flex; gap: 6px; }
.sidebar-support-link { flex: 1; min-width: 0; min-height: 36px; padding: 9px 6px; gap: 5px; color: #424c5d; font-size: 11px; font-weight: 650; border: 0; border-radius: 8px; box-shadow: none; }
.sidebar-support-link img, .sidebar-support-max img { width: 17px; height: 17px; flex-basis: 17px; }
.sidebar-logout { margin: 17px 0 0; }
.app-topbar { min-height: 80px; padding: 12px 44px; border-bottom-color: #e7e9ee; background: #fff; backdrop-filter: none; }
.topbar-workspace-label { color: #636d7c; font-size: 12px; }
.topbar-client-number { margin-right: auto; padding: 0 0 0 17px; border-left: 1px solid #d9dde5; border-radius: 0; color: #636d7c; background: none; font-size: 11px; font-weight: 500; letter-spacing: .04em; }
.topbar-avatar { width: 35px; height: 35px; color: #4163a7; background: #e4ebfb; font-size: 14px; font-weight: 650; }
.topbar-profile strong { font-size: 12px; font-weight: 650; }
.topbar-profile small { margin-top: 3px; font-size: 11px; }
.nav-toggle svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.app-main { width: 100%; min-width: 0; max-width: 1440px; padding-inline: 44px; }
.app-main.page { padding-block: 34px 36px; }
.page-heading, .multi-agent-heading { margin-bottom: 26px; align-items: flex-start; gap: 20px; }
.page-heading > div, .multi-agent-heading > div { min-width: 0; }
.page-heading p:not(.eyebrow), .multi-agent-heading p:not(.eyebrow) { font-size: 13px; line-height: 1.7; }
.page-heading h1, .multi-agent-heading h1, .operator-heading h1, .compact-page-heading h1 { font-size: 31px; }
.heading-actions, .multi-agent-heading-actions { flex-wrap: wrap; }
.button { min-height: 42px; padding: 11px 18px; border-radius: 10px; font-size: 12px; font-weight: 650; line-height: 1.4; transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease; }
.button:hover, .button:active { transform: none; }
.button-primary { box-shadow: inset 0 1px 0 #ffffff20, 0 2px 4px #2052bc12; }
.button-secondary { color: #424c5d; border-color: transparent; background: #f0f2f6; }
.compact-status-table .compact-row-actions > a.button-primary,
.compact-agent-plans .compact-section-heading > a.button-primary { color: #424c5d; border-color: var(--line-strong); background: #fff; box-shadow: none; }
.compact-status-table .compact-row-actions > a.button-primary:hover,
.compact-agent-plans .compact-section-heading > a.button-primary:hover { background: #f0f2f6; }
.button-small { min-height: 36px; padding: 8px 12px; font-size: 12px; }
.button-quiet { color: #52617b; }
.button:disabled { cursor: not-allowed; opacity: .6; }
.panel, .metric-card, .multi-agent-account-summary, .compact-account-summary,
.balance-overview, .checkout-summary, .payment-choice, .auth-card, .result-card {
  border-color: var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow);
}
.panel { min-width: 0; margin-bottom: 22px; padding: 26px; }
.panel-heading { margin-bottom: 24px; gap: 16px; }
.panel-heading p { font-size: 12px; line-height: 1.7; }
.panel-heading > div { min-width: 0; }
.panel-narrow { max-width: 740px; }
.panel-form { max-width: 820px; }
.split-grid, .split-grid-wide { gap: 22px; align-items: start; }
.split-grid > *, .audit-grid > * { min-width: 0; }
.metric-grid { gap: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); margin-bottom: 22px; }
.metric-card { min-width: 0; min-height: 125px; padding: 22px 24px; border: 0; border-right: 1px solid var(--line); border-radius: 0; box-shadow: none; }
.metric-card:last-child { border-right: 0; }
.metric-card > span { font-size: 12px; font-weight: 500; text-transform: none; letter-spacing: 0; }
.metric-card strong { font-size: 25px; font-weight: 700; font-variant-numeric: tabular-nums; }
.metric-card small { font-size: 11px; }
.resource-metric-list strong { font-size: 12px; }
.resource-metric-card small { font-size: 11px; }
.table-wrap { position: relative; min-width: 0; overscroll-behavior-inline: contain; }
th { font-size: 11px; font-weight: 650; letter-spacing: .025em; }
th, td { padding: 17px 12px; border-color: var(--line); }
td { font-size: 12px; line-height: 1.65; font-variant-numeric: tabular-nums; }
td strong { font-weight: 700; }
tbody tr:hover { background: #fafbfc; }
td small { font-size: 11px; }
td details { max-width: 300px; overflow-wrap: anywhere; }
td details summary { color: #647188; font-size: 11px; cursor: pointer; padding: 5px 0; }
.status { min-height: 25px; padding: 4px 9px; font-size: 11px; font-weight: 600; }
.status-neutral { color: #596677; background: #eef1f5; }
.monitor-date { white-space: normal; }
.request-row { padding-block: 18px; font-size: 13px; }
.request-row div { min-width: 0; overflow-wrap: anywhere; }
.request-row span:not(.status) { font-size: 11px; }
.definition-list > div { grid-template-columns: minmax(120px, 1fr) minmax(0, 1.25fr); gap: 20px; font-size: 12px; }
.definition-list dd { font-weight: 500; font-variant-numeric: tabular-nums; }
.long-text { max-width: 72ch; color: #525f72; line-height: 1.85; overflow-wrap: anywhere; }
.form-stack { gap: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field { min-width: 0; }
.field > label:not(.check-row) { color: #3d495c; font-size: 12px; font-weight: 600; }
.field input:not([type="checkbox"]), .field textarea, .field select, .search-bar input, .filter-bar input, .filter-bar select { min-height: 44px; font-size: 13px; line-height: 1.6; border-color: var(--line-strong); }
.field input[readonly] { background: #f6f7fa; color: #596777; }
.field input:focus, .field textarea:focus, .field select:focus, .search-bar input:focus { box-shadow: none; outline: 2px solid #3b6feb; outline-offset: 2px; }
.field:has(.field-error-text) :is(input, textarea, select) { border-color: #cd655e; }
.field-help { font-size: 12px; line-height: 1.7; }
.check-row { font-size: 12px; font-weight: 500; line-height: 1.7; }
.check-row input { flex: 0 0 18px; }
.filter-bar { grid-template-columns: minmax(170px, 2fr) repeat(3, minmax(100px, 1fr)) auto; padding: 20px 24px; gap: 14px; margin-bottom: 22px; border-radius: 16px; }
.user-monitor-filters { grid-template-columns: minmax(190px, 1.6fr) repeat(4, minmax(110px, 1fr)); }
.user-monitor-filters .filter-actions { grid-column: 1 / -1; justify-content: flex-end; }
.search-bar { padding: 20px; border-radius: 16px; }
.notice { padding: 16px 18px; margin-bottom: 20px; border-radius: 11px; font-size: 13px; line-height: 1.75; overflow-wrap: anywhere; }
.messages .notice { margin: 0; }
.notice-info { color: #365580; background: #eef3fd; border-color: #dce6f7; }
.notice strong { font-weight: 700; }
.confirmation-box, .telegram-binding, .telegram-owner-field, .agent-entry { background: #f3f6fb; border-color: var(--line); box-shadow: none; border-radius: 12px; }
.confirmation-box p { font-size: 14px; }
.confirmation-dialog { width: min(620px, calc(100% - 32px)); max-height: calc(100dvh - 40px); overflow-y: auto; border-radius: 16px; box-shadow: 0 24px 80px #15243b38; }
.confirmation-dialog::backdrop { background: #18223570; }
.confirmation-dialog-card { padding: 30px; }
.confirmation-dialog-card h2 { font-size: 23px; }
.confirmation-dialog-list { font-size: 13px; line-height: 1.8; }
.confirmation-dialog-actions { margin-top: 24px; }
.panel-disclosure { padding: 0; }
.top-up-disclosure-summary { padding: 22px 26px; gap: 16px; }
.top-up-disclosure-copy > strong { font-size: 16px; font-weight: 650; }
.top-up-disclosure-copy > small { font-size: 12px; }
.top-up-disclosure-action { font-size: 12px; }
.top-up-disclosure-content { padding: 0 26px 24px; }
.operator-disclosure-content { padding-top: 24px; }
.empty-state { padding: 40px 20px; font-size: 13px; }
.compact-finance-page { gap: 24px; }
.compact-page-heading { min-height: auto; margin-bottom: 0; }
.multi-agent-account-summary, .compact-account-summary { margin-bottom: 24px; }
.compact-finance-page .compact-account-summary { margin-bottom: 0; }
.multi-agent-account-summary > div, .compact-account-summary > div { min-height: 112px; padding: 24px 28px; gap: 5px; }
.multi-agent-account-summary span, .compact-account-summary span { font-size: 12px; font-weight: 500; }
.multi-agent-account-summary strong, .compact-account-summary strong { font-size: 25px; font-weight: 700; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.compact-account-summary small, .multi-agent-account-summary small { font-size: 11px; }
.compact-summary-action { margin-top: 10px; }
.compact-account-summary:has(.compact-summary-action) { grid-template-columns: 1fr 1.65fr; }
.compact-account-summary > div:has(.compact-summary-action) { grid-template-columns: minmax(0, 1fr) auto; column-gap: 20px; }
.compact-account-summary > div:has(.compact-summary-action) > :not(form) { grid-column: 1; }
.compact-account-summary .compact-summary-action { grid-column: 2; grid-row: 1 / span 3; align-self: center; margin: 0; }
.multi-agent-panel, .compact-agent-plans, .compact-ledger-panel { padding: 24px 26px; border-radius: 16px; }
.compact-agent-plans, .compact-ledger-panel { margin: 0; }
.multi-agent-panel .panel-heading, .compact-section-heading { margin-bottom: 22px; }
.compact-section-heading h2 { font-size: 17px; }
.compact-agent-table-head, .compact-agent-row { grid-template-columns: minmax(140px, 1.4fr) minmax(100px, .9fr) minmax(70px, .6fr) minmax(90px, .8fr) minmax(90px, .8fr) minmax(138px, 1fr); gap: 12px; }
.compact-plan-row { grid-template-columns: minmax(180px, 1.7fr) minmax(85px, .7fr) minmax(110px, .9fr) minmax(125px, 1fr) minmax(92px, .7fr); }
.compact-agent-table-head { padding: 0 0 14px; font-size: 11px; font-weight: 600; }
.compact-agent-row { min-height: 82px; padding: 20px 0; font-size: 13px; }
.compact-agent-row small { font-size: 11px; line-height: 1.6; }
.compact-agent-name a { font-weight: 700; }
.compact-agent-name .status { margin-top: 5px; }
.compact-agent-row [data-label="AI-баланс"], .compact-agent-row [data-label="К оплате"] { text-align: right; font-variant-numeric: tabular-nums; }
.compact-status-table .compact-agent-table-head > :nth-child(4), .compact-status-table .compact-agent-table-head > :nth-child(5),
.compact-plan-row.compact-agent-table-head > :nth-child(3), .compact-plan-row.compact-agent-table-head > :nth-child(4) { text-align: right; }
.compact-agent-table-head > :last-child { text-align: right; }
.compact-agent-row .button { min-height: 36px; padding: 8px 11px; font-size: 12px; }
.compact-ledger-grid { gap: 22px; }
.balance-table { table-layout: auto; }
.balance-table th, .balance-table td { padding: 14px 8px; font-size: 11px; line-height: 1.6; overflow-wrap: normal; }
.balance-table th { font-size: 11px; }
.balance-table .status { min-height: 24px; font-size: 10px; }
.balance-document-link, .balance-receipt-link { min-width: 32px; min-height: 32px; margin: 5px 0 0 4px; font-size: 11px; }
.balance-ledger-dialog { width: min(960px, calc(100% - 32px)); }
.compact-topup-panel { margin: 0; }
.compact-topup-panel .top-up-disclosure-summary { padding: 22px 26px; }
.compact-topup-panel .top-up-disclosure-content { padding: 0 26px 24px; }
.compact-plan-option { padding: 14px; gap: 14px; }
.compact-setting-row { margin: 0; padding: 20px 26px; }
.balance-page-heading { min-height: auto; margin: 0 0 16px; }
.balance-page-heading h1 { font-size: 31px; }
.balance-page-heading > img, .client-hero-visual, .balance-plan-progress { display: none; }
.client-hero { display: block; min-height: 0; margin: 0 0 24px; }
.client-hero-copy h1 { font-size: 31px; }
.balance-overview-copy > strong { white-space: normal; font-size: 25px; overflow-wrap: anywhere; }
.balance-tariff-main strong, .balance-tariff-card .tariff-action small { white-space: normal; }
.balance-tariff-main .tariff-name { color: var(--ink); letter-spacing: 0; text-transform: none; font-size: 14px; }
.tariff-option { border-color: var(--line); }
.balance-tariff-selected { color: var(--positive); background: var(--positive-soft); }
.checkout-summary { margin-bottom: 24px; padding: 24px 28px; }
.checkout-summary strong { font-size: 28px; font-variant-numeric: tabular-nums; }
.checkout-summary-meta strong { font-size: 14px; }
.payment-choice { padding: 26px; }
.payment-choice-header { gap: 12px; }
.payment-choice-header h2 { font-size: 17px; }
.payment-choice-icon { background: none; width: 30px; height: 30px; flex-basis: 30px; }
.payment-choice-icon svg { width: 26px; height: 26px; }
.payment-choice-primary:hover, .payment-choice-sbp:hover, .payment-choice-invoice:hover { transform: none; box-shadow: var(--shadow); }
.button-sbp { background: var(--primary); border-color: transparent; }
.button-sbp:hover { background: var(--primary-dark); }
.payment-consent { font-size: 12px; background: #f5f7fb; border-color: var(--line); border-radius: 10px; }
.receipt-task { padding: 20px; border-radius: 12px; gap: 18px; }
.receipt-task > input { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); font: inherit; }
.balance-document-link svg, .balance-receipt-link svg, .inline-icon { width: 16px; height: 16px; vertical-align: middle; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.invoice-confirmation { border-radius: 10px; }
.auth-page { min-height: calc(100dvh - 70px); padding: 42px 20px; background: var(--canvas); }
.auth-card, .result-card { width: min(460px, 100%); padding: 34px; }
.auth-card-wide { width: min(560px, 100%); }
.auth-brand { margin-bottom: 28px; }
.auth-heading { margin-bottom: 25px; }
.auth-heading h1, .result-card h1 { font-size: 27px; }
.auth-heading p:last-child { margin-bottom: 0; font-size: 13px; }
.auth-card .form-stack { gap: 18px; }
.auth-card-register .field { gap: 7px; }
.auth-card-register .field input:not([type="checkbox"]), .auth-card-register .field select { min-height: 44px; padding: 10px 12px; }
.auth-card-register .check-row { gap: 10px; font-size: 12px; line-height: 1.7; }
.auth-card-register .check-row input { width: 18px; height: 18px; flex-basis: 18px; margin-top: 3px; }
.auth-card-register .field-help { font-size: 12px; }
.auth-card-register .button { min-height: 42px; }
.auth-card-register .auth-brand { margin-bottom: 26px; }
.auth-card-register .auth-heading { margin-bottom: 24px; }
.auth-card-register .auth-heading h1 { font-size: 27px; }
.auth-links { font-size: 12px; margin-top: 22px; }
.auth-note, .auth-card-register .auth-note { margin-top: 22px; font-size: 12px; }
.social-auth { gap: 8px; }
.button-social { min-height: 42px; padding: 9px 10px; color: #424c5d; background: #f3f5f8; border: 0; font-size: 12px; }
.auth-divider { font-size: 11px; margin: 20px 0; }
.support-dock { position: static; display: flex; justify-content: center; gap: 10px; margin: 0 auto 24px; }
.support-widget { width: auto; height: auto; min-height: 40px; padding: 9px 12px; gap: 7px; border: 1px solid var(--line); border-radius: 10px; background: white; color: #424c5d; box-shadow: none; }
.support-widget img, .support-widget-max img { width: 20px; height: 20px; }
.support-widget-label { position: static; width: auto; padding: 0; color: inherit; background: none; opacity: 1; transform: none; font-size: 11px; font-weight: 600; }
.footer, .app-footer { background: transparent; border-top: 0; font-size: 11px; }
.app-footer .footer-inner { min-height: 54px; padding: 12px 44px 25px; gap: 16px; flex-wrap: wrap; }
.footer a { color: #486596; }
@media (hover: hover) and (pointer: fine) {
  .sidebar-nav a:not(.is-active):hover, .sidebar-logout-button:hover { background: #eef1f6; color: var(--ink); }
  .button-secondary:hover, .button-social:hover { background: #e9edf5; border-color: transparent; box-shadow: none; }
  .sidebar-support-link:hover, .support-widget:hover { color: #2d4f87; background: #e9edf5; box-shadow: none; transform: none; }
}
@media (max-width: 1250px) {
  .app-main { padding-inline: 26px; }
  .app-topbar, .app-footer .footer-inner { padding-inline: 26px; }
  .metric-grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metric-grid-5 .metric-card { border-bottom: 1px solid var(--line); }
  .filter-bar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filter-search { grid-column: 1 / -1; }
  .filter-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .compact-ledger-grid, .balance-ledger-grid { grid-template-columns: 1fr; }
  .compact-agent-table-head, .compact-agent-row { gap: 9px; }
  .compact-status-table .compact-agent-table-head { display: none; }
  .compact-status-table .compact-agent-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .compact-status-table .compact-agent-row > div::before { content: attr(data-label); display: block; color: var(--muted); font-size: 11px; margin-bottom: 5px; }
  .compact-status-table .compact-agent-name { grid-column: 1 / -1; }
  .compact-status-table .compact-row-actions { grid-column: auto; }
  .compact-status-table .compact-agent-row [data-label="AI-баланс"], .compact-status-table .compact-agent-row [data-label="К оплате"] { text-align: left; }
  .compact-plan-row { grid-template-columns: minmax(150px, 1.5fr) minmax(70px, .7fr) minmax(95px, .9fr) minmax(115px, 1fr) 90px; }
}
@media (max-width: 1100px) {
  .split-grid, .split-grid-wide { grid-template-columns: 1fr; }
  .compact-agent-table-head { display: none; }
  .compact-agent-row, .compact-status-table .compact-agent-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
  .compact-agent-row > div::before { content: attr(data-label); display: block; color: var(--muted); font-size: 11px; text-transform: none; letter-spacing: 0; font-weight: 500; margin-bottom: 5px; }
  .compact-agent-name, .compact-row-actions, .compact-status-table .compact-row-actions { grid-column: 1 / -1; }
  .compact-row-actions { justify-content: flex-start; }
  .compact-agent-row [data-label="AI-баланс"], .compact-agent-row [data-label="К оплате"] { text-align: left; }
}
/* Keep the existing app.js navigation breakpoint in sync. */
@media (max-width: 820px) {
  .app-layout { display: block; }
  .app-sidebar { width: min(300px, calc(100vw - 48px)); height: 100dvh; visibility: hidden; }
  .app-sidebar.is-open { visibility: visible; }
  .app-topbar { min-height: 64px; padding-inline: 16px; gap: 12px; }
  .topbar-workspace-label { display: none; }
  .topbar-client-number { padding-left: 0; border: 0; }
  .nav-toggle { width: 40px; height: 40px; border-color: transparent; background: #f0f2f6; color: #5b6473; }
  .sidebar-support { margin-top: auto; }
  .app-main { padding-inline: 20px; }
  .app-main.page { padding-block: 26px 30px; }
  .app-footer .footer-inner { padding-inline: 20px; }
  .metric-grid-3, .metric-grid-4, .metric-grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-card { padding: 20px; border-bottom: 1px solid var(--line); }
  .panel { padding: 22px; }
  .panel-disclosure { padding: 0; }
  .balance-overview, .balance-tariff-grid { display: grid; grid-template-columns: 1fr; }
  .balance-overview-item, .balance-tariff-card { min-width: 0; }
  .balance-overview-item + .balance-overview-item { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 660px) {
  body { font-size: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .receipt-task > input { font-size: 16px; }
  .app-main { padding-inline: 18px; }
  .page-heading, .multi-agent-heading, .compact-page-heading { flex-direction: column; align-items: stretch; }
  h1, .page-heading h1, .multi-agent-heading h1, .compact-page-heading h1, .balance-page-heading h1, .client-hero-copy h1 { font-size: 25px; }
  .page-heading p:not(.eyebrow), .multi-agent-heading p:not(.eyebrow), .panel-heading p, .field-help, .check-row { font-size: 14px; }
  .panel { padding: 20px; margin-bottom: 18px; }
  .panel-disclosure { padding: 0; }
  .compact-finance-page { gap: 18px; }
  .compact-agent-plans, .compact-ledger-panel, .compact-topup-panel, .compact-setting-row { margin: 0; }
  .panel-heading, .compact-section-heading { flex-wrap: wrap; align-items: flex-start; gap: 14px; }
  .panel-heading h2, .compact-section-heading h2 { font-size: 16px; }
  .button, .button-small, .compact-agent-row .button { min-height: 44px; font-size: 13px; }
  .field input:not([type="checkbox"]), .field textarea, .field select, .search-bar input, .filter-bar input, .filter-bar select, .invoice-form input { font-size: 16px; min-height: 46px; }
  .field > label:not(.check-row), .auth-card-register .field > label:not(.check-row) { font-size: 14px; }
  .filter-bar, .user-monitor-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 18px; gap: 12px; }
  .filter-actions .button { flex: 1; }
  .table-wrap table { min-width: 570px; }
  .table-wrap .balance-table { min-width: 470px; }
  .balance-table th:nth-child(2), .balance-table td:nth-child(2) { display: table-cell; }
  .table-wrap { padding-bottom: 8px; }
  .balance-document-link, .balance-receipt-link { min-height: 40px; min-width: 40px; }
  .compact-account-summary, .multi-agent-account-summary { grid-template-columns: 1fr; }
  .compact-account-summary:has(.compact-summary-action) { grid-template-columns: 1fr; }
  .compact-account-summary > div:has(.compact-summary-action) { grid-template-columns: 1fr; }
  .compact-account-summary .compact-summary-action { grid-column: 1; grid-row: auto; margin-top: 12px; }
  .compact-account-summary > div, .multi-agent-account-summary > div { min-height: 90px; padding: 20px 22px; border-right: 0; border-bottom: 1px solid var(--line); }
  .compact-account-summary > div:last-child, .multi-agent-account-summary > div:last-child { border-bottom: 0; }
  .compact-agent-row, .compact-status-table .compact-agent-row { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-block: 22px; font-size: 14px; }
  .compact-agent-name, .compact-row-actions { grid-column: 1 / -1; }
  .compact-row-actions { flex-direction: row; flex-wrap: wrap; }
  .compact-row-actions .button { width: auto; }
  .compact-agent-row > div::before, .compact-status-table .compact-agent-row > div::before { font-size: 12px; }
  .compact-section-heading .button { width: auto; }
  .compact-topup-panel .top-up-disclosure-summary, .top-up-disclosure-summary { padding: 20px; }
  .compact-topup-panel .top-up-disclosure-content, .top-up-disclosure-content { padding: 0 20px 20px; }
  .operator-disclosure-content { padding-top: 20px; }
  .top-up-disclosure-copy > small, .balance-topup-panel .top-up-disclosure-copy > small { display: block; font-size: 13px; }
  .confirmation-dialog-card { padding: 24px; }
  .confirmation-dialog-actions { flex-direction: column-reverse; align-items: stretch; }
  .confirmation-dialog-actions .button { width: 100%; }
  .checkout-grid, .checkout-grid-three { grid-template-columns: 1fr; }
  .auth-page { padding: 28px 16px; }
  .auth-card, .result-card, .auth-card-register { padding: 26px; }
  .brand > span:last-child, .auth-card .brand > span:last-child { display: inline; }
  .auth-card-register .check-row, .auth-card-register .field-help { font-size: 14px; }
  .auth-card-register .field input:not([type="checkbox"]) { min-height: 46px; }
  .social-auth { grid-template-columns: repeat(auto-fit, minmax(85px, 1fr)); }
  .button-social { justify-content: center; font-size: 11px; padding-inline: 6px; }
  .auth-links { flex-direction: column; gap: 14px; font-size: 14px; }
  .support-widget-label { display: inline; }
  .notice { font-size: 14px; padding: 15px; }
  .definition-list > div { grid-template-columns: 1fr; gap: 6px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
