@font-face {
  font-family: "Inter Variable";
  src: url("./fonts/InterVariable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --canvas: #f5f6f8;
  --surface: #fff;
  --surface-muted: #f7f8fa;
  --hover: #f0f2f5;
  --ink: #181d27;
  --muted: #576273;
  --line: #e0e4eb;
  --line-strong: #8994a5;
  --accent: #9d3710;
  --accent-soft: #fff0e7;
  --primary: #a93b0a;
  --primary-hover: #8c2e05;
  --good: #1a653e;
  --good-soft: #e8f6ed;
  --warn: #795000;
  --warn-soft: #fff2d8;
  --bad: #a32c26;
  --bad-soft: #fcecea;
  --radius: 12px;
  --bar-height: 64px;
  --rail-width: 228px;
  --font-ui: "Inter Variable", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-family: var(--font-ui);
  font-optical-sizing: auto;
  font-size: 15px;
  line-height: 1.5;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #12151a;
  --surface: #1a1f27;
  --surface-muted: #202630;
  --hover: #262d38;
  --ink: #eef0f5;
  --muted: #aeb8c7;
  --line: #333d4b;
  --line-strong: #778599;
  --accent: #ffad7b;
  --accent-soft: #35241d;
  --primary: #a93b0a;
  --primary-hover: #8c2e05;
  --good: #8ce3ad;
  --good-soft: #20362b;
  --warn: #f7cf7c;
  --warn-soft: #3b3020;
  --bad: #ffaaa4;
  --bad-soft: #3d2729;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); }
a { color: inherit; text-decoration: none; }
button, select, input { font: inherit; }
code { font-family: var(--font-mono); }
button, select { color: inherit; }
button:not(:disabled), select:not(:disabled) { cursor: pointer; }
button:disabled, select:disabled { cursor: not-allowed; opacity: .65; }
button[aria-disabled="true"] { cursor: progress; opacity: .75; }
h1, h2, p, dl, dd, ul { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[id][tabindex="-1"] { scroll-margin-top: calc(var(--bar-height) + 16px); }

.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; z-index: 10; top: 12px; left: 12px; transform: translateY(-200%); padding: 10px 14px; border-radius: 8px; background: var(--surface); }
.skip-link:focus { transform: none; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--rail-width) minmax(0, 1fr); grid-template-rows: var(--bar-height) 1fr; }
.sidebar { position: sticky; top: 0; height: 100dvh; grid-row: 1 / 3; display: flex; flex-direction: column; padding: 0 14px 16px; min-width: 0; background: var(--surface); border-inline-end: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; min-height: var(--bar-height); padding: 0 8px; }
.brand-mark { display: grid; width: 36px; height: 36px; flex: none; place-items: center; border-radius: 9px; background: var(--primary); color: #fff; }
.brand-mark .icon { width: 22px; height: 22px; }
.brand strong, .sidebar-foot strong { display: block; line-height: 1.3; letter-spacing: -.018em; }
.brand strong { font-size: 16px; }
.brand small, .sidebar-foot small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.nav { margin-top: 25px; display: grid; gap: 4px; }
.nav-caption { margin: 0 10px 6px; color: var(--muted); font-size: 12px; font-weight: 650; }
.nav-link { display: flex; align-items: center; gap: 11px; min-height: 44px; padding: 0 10px; border: 1px solid transparent; border-radius: 8px; color: var(--muted); font-size: 14px; font-weight: 550; }
.nav-link:hover { background: var(--hover); color: var(--ink); }
.nav-link[aria-current] { border-color: var(--accent-soft); background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.sidebar-foot { display: flex; align-items: center; gap: 9px; margin-top: auto; padding: 12px 9px; border-block-start: 1px solid var(--line); font-size: 13px; }
.sidebar-foot-icon { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 8px; border: 1px solid var(--line); color: var(--muted); }
.sidebar-foot small { font-size: 11px; }

.topbar { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 0 clamp(18px, 3vw, 40px); border-block-end: 1px solid var(--line); background: var(--surface); }
.breadcrumb, .top-actions { display: flex; align-items: center; gap: 12px; }
.breadcrumb { font-size: 13px; color: var(--muted); }
.breadcrumb .icon { width: 13px; height: 13px; }
.breadcrumb strong { color: var(--ink); font-weight: 650; }
.top-actions { gap: 10px; }

.workspace { min-width: 0; padding: 34px clamp(18px, 3vw, 40px) 24px; }
.workspace-inner { width: 100%; max-width: 1440px; margin: 0 auto; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 27px; }
.page-label { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 650; }
.page-label span { width: 7px; height: 7px; border-radius: 2px; background: var(--accent); }
h1 { margin-top: 4px; font-size: clamp(30px, 3.1vw, 40px); font-weight: 730; line-height: 1.12; letter-spacing: -.035em; }
.page-description { margin-top: 8px; color: var(--muted); }
.toolbar { display: flex; align-items: flex-end; gap: 9px; }
.scenario-control { display: grid; gap: 4px; color: var(--muted); font-size: 12px; font-weight: 650; }
.select-wrap { position: relative; display: block; color: var(--ink); }
.select-wrap > .icon { position: absolute; top: 50%; right: 11px; width: 15px; height: 15px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.select-wrap select { width: 100%; min-width: 132px; min-height: 44px; appearance: none; padding: 0 32px 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); font-size: 13px; font-weight: 600; }
.select-wrap select:hover:not(:disabled), .button-quiet:hover, .button-icon:hover { background: var(--hover); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 0 13px; border: 1px solid transparent; border-radius: 8px; font-size: 13px; font-weight: 650; white-space: nowrap; }
.button .icon { width: 16px; height: 16px; }
.button-primary { background: var(--primary); color: #fff; }
.button-primary:hover:not(:disabled) { background: var(--primary-hover); }
.button-quiet, .button-icon { border-color: var(--line-strong); background: var(--surface); }
.button-icon { width: 44px; padding: 0; }

.summary { margin-bottom: 20px; }
.summary-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 11px; }
h2 { font-size: 16px; font-weight: 700; line-height: 1.25; letter-spacing: -.014em; }
.summary-time { display: flex; align-items: center; gap: 6px; color: var(--muted); white-space: nowrap; font-size: 12px; font-variant-numeric: tabular-nums; }
.summary-time .icon { width: 14px; height: 14px; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.metric { min-width: 0; padding: 17px 19px; }
.metric + .metric { border-inline-start: 1px solid var(--line); }
.metric dt { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 660; }
.metric-icon { display: grid; flex: none; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--surface-muted); color: var(--muted); }
.metric-icon .icon { width: 17px; height: 17px; }
.metric-accent { background: var(--accent-soft); color: var(--accent); }
.metric-good { background: var(--good-soft); color: var(--good); }
.metric dd:not(.metric-detail) { display: flex; gap: 7px; align-items: baseline; min-height: 45px; margin: 6px 0 1px; font-variant-numeric: tabular-nums; }
.metric dd strong { line-height: 1.17; font-size: 35px; letter-spacing: -.045em; font-weight: 710; }
.metric-total, .metric-detail { color: var(--muted); font-size: 13px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 300px); align-items: start; gap: 16px; }
.dashboard-side { display: grid; gap: 16px; min-width: 0; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 75px; padding: 14px 18px; }
.panel-head p { margin-top: 5px; color: var(--muted); font-size: 13px; }
.panel-head.compact-head { min-height: 55px; padding-bottom: 10px; }
.panel-icon { color: var(--muted); }
.stream-table { width: 100%; border-collapse: collapse; text-align: left; }
.stream-table thead { color: var(--muted); background: var(--surface-muted); }
.stream-table th, .stream-table td { padding: 10px 11px; border-top: 1px solid var(--line); }
.stream-table th:first-child, .stream-table td:first-child { padding-inline-start: 18px; }
.stream-table th:last-child, .stream-table td:last-child { padding-inline-end: 18px; }
.stream-table th { font-size: 12px; font-weight: 650; white-space: nowrap; }
.stream-table td { height: 49px; font-size: 13px; }
.stream-table tbody tr:hover { background: var(--surface-muted); }
.stream-id { font-weight: 720; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stream-worker, .stream-duration { color: var(--muted); white-space: nowrap; }
.stream-duration { font-variant-numeric: tabular-nums; }
.stream-mobile-label { display: none; }
.status-pill { display: inline-flex; width: fit-content; align-items: center; gap: 5px; padding: 3px 8px; border: 1px solid transparent; border-radius: 99px; background: var(--surface-muted); color: var(--muted); font-size: 12px; line-height: 1.35; font-weight: 650; white-space: nowrap; }
.status-dot { display: inline-block; width: 6px; height: 6px; flex: none; border-radius: 50%; background: currentColor; }
.status-good { background: var(--good-soft); color: var(--good); }
.status-warn { background: var(--warn-soft); color: var(--warn); }
.status-bad { background: var(--bad-soft); color: var(--bad); }
.panel-foot { display: flex; align-items: center; min-height: 44px; padding: 8px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }

.connection-content { padding: 0 18px 17px; }
.connection-meter { display: flex; height: 8px; overflow: hidden; border-radius: 8px; background: var(--line); }
.connection-meter > span { background: var(--good); }
.connection-meter:not(.connection-meter-empty) { background: var(--bad); }
.legend { display: grid; gap: 7px; margin-top: 13px; }
.legend > div { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.legend dt { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.legend dd { font-weight: 700; font-variant-numeric: tabular-nums; }
.legend .status-dot { width: 7px; height: 7px; }
.tone-good { color: var(--good); }
.tone-warn { color: var(--warn); }
.tone-bad { color: var(--bad); }
.side-empty { color: var(--muted); font-size: 13px; }
.events-content { padding: 0 18px 5px; }
.events-content > .side-empty { padding-bottom: 12px; }
.events { list-style: none; padding: 0; }
.events li { position: relative; display: grid; grid-template-columns: 23px minmax(0, 1fr) auto; align-items: start; gap: 8px; min-height: 49px; padding: 6px 0 9px; }
.events li:not(:last-child)::after { position: absolute; top: 27px; bottom: -7px; left: 11px; width: 1px; content: ""; background: var(--line); }
.event-mark { position: relative; z-index: 1; display: grid; place-items: center; width: 23px; height: 23px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); }
.event-mark .icon { width: 14px; height: 14px; }
.events strong { display: block; font-size: 12px; line-height: 1.4; font-weight: 650; }
.events p, .events time { color: var(--muted); font-size: 11px; }
.events time { font-variant-numeric: tabular-nums; }
.workspace-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 15px; color: var(--muted); font-size: 12px; }

.notice { display: flex; align-items: center; gap: 11px; margin: 0 0 20px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--warn-soft); color: var(--warn); }
.notice.is-error { background: var(--bad-soft); color: var(--bad); }
.notice > div { flex: 1; }
.notice strong { display: block; font-size: 14px; }
.notice p { font-size: 13px; }
.stream-state { display: grid; place-items: center; align-content: center; gap: 7px; min-height: 242px; padding: 22px; border-top: 1px solid var(--line); text-align: center; }
.stream-state .metric-icon { width: 38px; height: 38px; }
.stream-state p { max-width: 32ch; color: var(--muted); font-size: 13px; }
.stream-state .button { margin-top: 6px; }
.skeleton-row { display: grid; grid-template-columns: 1fr 1.8fr 1fr; gap: 19px; align-items: center; min-height: 49px; padding: 0 18px; border-top: 1px solid var(--line); }
.skeleton-row span { display: block; height: 11px; border-radius: 6px; background: var(--line); }
.skeleton-row span:last-child { width: 62%; }

.theme-dialog { width: min(384px, calc(100% - 32px)); padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); box-shadow: 0 12px 50px #0003; }
.theme-dialog::backdrop { background: #10172077; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dialog-heading h2 { font-size: 19px; }
.theme-dialog p { margin: 4px 0 12px; color: var(--muted); font-size: 14px; }
.theme-options { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; }
.theme-options label { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.theme-options label:hover { background: var(--hover); }
.theme-options input { accent-color: var(--accent); }
.noscript { position: fixed; z-index: 8; inset: auto 12px 12px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }

.proxy-sources { margin-bottom: 18px; }
.proxy-source { padding: 18px; }
.proxy-source-head { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 16px; }
.proxy-source-head .metric-icon { width: 36px; height: 36px; }
.proxy-source-head p { margin-top: 4px; color: var(--muted); font-size: 13px; }
.proxy-drop { display: grid; justify-items: center; align-content: center; gap: 8px; min-height: 112px; padding: 12px; border: 1px dashed var(--line-strong); border-radius: 8px; background: var(--surface-muted); text-align: center; }
.proxy-drop.is-dragging { border-color: var(--accent); background: var(--accent-soft); }
.proxy-drop > span, .proxy-help { color: var(--muted); font-size: 12px; }
.proxy-help { margin-top: 11px; overflow-wrap: anywhere; }
.proxy-message { margin: 0 0 16px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--muted); font-size: 13px; }
.proxy-message[data-tone="good"] { background: var(--good-soft); color: var(--good); }
.proxy-message[data-tone="bad"] { background: var(--bad-soft); color: var(--bad); }
.proxy-preview { margin-bottom: 18px; }
.proxy-preview .panel-head p { overflow-wrap: anywhere; }
.proxy-preview-body { padding: 0 18px 16px; }
.proxy-preview-counts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 8px; background: var(--surface-muted); }
.proxy-preview-counts > div { display: grid; align-content: space-between; gap: 4px; padding: 8px 11px; }
.proxy-preview-counts > div + div { border-inline-start: 1px solid var(--line); }
.proxy-preview-counts dt { color: var(--muted); font-size: 12px; }
.proxy-preview-counts dd { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.proxy-preview-body h3 { margin: 15px 0 5px; font-size: 13px; }
.proxy-preview-body ul { padding-inline-start: 19px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.proxy-metadata { min-width: 0; margin: 14px 0 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.proxy-metadata legend { padding: 0 5px; font-size: 13px; font-weight: 650; }
.proxy-metadata p { color: var(--muted); font-size: 12px; }
.proxy-metadata-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 8px 0; }
#proxy-preview-sample li > span { margin-inline-start: 9px; }
#proxy-preview-errors { color: var(--bad); }
.proxy-footer-actions, .proxy-dialog-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.proxy-footer-actions { padding: 10px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.proxy-dialog-actions { justify-content: flex-end; }
.proxy-pool-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.proxy-pool .panel-head { flex-wrap: wrap; }
.proxy-pool .panel-head .button { flex: none; }
.proxy-pool .proxy-pool-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
#proxy-pool-count { font-weight: 700; font-variant-numeric: tabular-nums; }
#proxy-demo-count { margin-inline-start: 4px; }
.proxy-pool-note { padding: 0 18px 12px; color: var(--muted); font-size: 12px; }
.proxy-empty { min-height: 165px; }
.proxy-table { table-layout: fixed; }
.proxy-table th { white-space: normal; overflow-wrap: anywhere; }
.proxy-table th:nth-child(1) { width: 19%; }
.proxy-table th:nth-child(2) { width: 12%; }
.proxy-table th:nth-child(3) { width: 15%; }
.proxy-table th:nth-child(4) { width: 12%; }
.proxy-table th:nth-child(5) { width: 13%; }
.proxy-table th:nth-child(6) { width: 11%; }
.proxy-table th:nth-child(7) { width: 18%; }
.proxy-table td { overflow-wrap: anywhere; }
.proxy-address code { color: var(--ink); font-size: 13px; letter-spacing: 0; }
.proxy-address-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 3px; color: var(--muted); font-size: 11px; }
.proxy-demo-tag { padding-block: 1px; font-size: 10px; }
.proxy-date, .proxy-lifetime, .proxy-accounts { font-variant-numeric: tabular-nums; }
.proxy-account-count { font-weight: 700; }
.proxy-cell-note { color: var(--muted); }
.proxy-cell-label { display: none; }
.proxy-check-cell { display: grid; justify-items: start; gap: 5px; }
.proxy-check-cell .status-pill { max-width: 100%; white-space: normal; }
.proxy-check-cell .button { max-width: 100%; padding-inline: 9px; white-space: normal; }
.proxy-check-cell time { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.proxy-probe-address { font-family: var(--font-mono); overflow-wrap: anywhere; }
.iproyal-catalog { margin-bottom: 20px; }
.catalog-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.catalog-header p { margin-top: 4px; }
.catalog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; }
.api-check-results { margin-bottom: 12px; padding: 12px 14px; }
.api-check-results .proxy-help { margin-top: 8px; }
.api-check-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 245px), 1fr)); gap: 8px 16px; }
.api-check-list > div { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13px; }
.api-check-list dt { font-weight: 650; }
.api-check-list dd { font-variant-numeric: tabular-nums; white-space: normal; }
.catalog-mode { background: var(--good-soft); color: var(--good); }
.catalog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.catalog-card { --card-ink: #06626c; --card-soft: #e1f5f7; display: flex; flex-direction: column; gap: 14px; padding: 18px; }
.catalog-isp { --card-ink: #a32737; --card-soft: #fae9ee; }
.catalog-datacenter { --card-ink: var(--good); --card-soft: var(--good-soft); }
:root[data-theme="dark"] .catalog-residential { --card-ink: #80dfe9; --card-soft: #193139; }
:root[data-theme="dark"] .catalog-isp { --card-ink: #ff9aa8; --card-soft: #3a252d; }
.catalog-card-heading { display: flex; align-items: center; min-width: 0; gap: 10px; }
.catalog-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--card-soft); color: var(--card-ink); }
.catalog-icon .icon { width: 21px; height: 21px; }
.catalog-card h3 { margin: 0; font-size: 18px; line-height: 1.2; letter-spacing: -.02em; }
.catalog-card-heading p { margin-top: 3px; color: var(--card-ink); font-size: 12px; font-weight: 650; }
.catalog-features { display: grid; gap: 6px; list-style: none; padding: 0; font-size: 13px; }
.catalog-features li { display: flex; align-items: start; gap: 6px; }
.catalog-features .icon { width: 14px; height: 14px; margin-top: 3px; color: var(--card-ink); }
.catalog-card > .button { margin-top: auto; width: 100%; }
.catalog-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-height: 34px; margin-top: 6px; }
.catalog-footer .iproyal-result { margin: 0; }
.catalog-link { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; margin-inline-start: auto; color: var(--muted); font-size: 13px; }
.catalog-link:hover { color: var(--ink); text-decoration: underline; }
.catalog-link .icon { width: 14px; height: 14px; }
.iproyal-dialog { width: min(456px, calc(100% - 32px)); max-height: calc(100dvh - 32px); }
.iproyal-quote-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: start; width: 100%; }
.iproyal-field { display: grid; min-width: 0; gap: 4px; }
.iproyal-field label { color: var(--muted); font-size: 12px; font-weight: 650; }
.iproyal-field input, .iproyal-field select { width: 100%; min-width: 0; min-height: 44px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 13px; font-variant-numeric: tabular-nums; }
.iproyal-field small { font-size: 11px; color: var(--muted); }
.iproyal-form-note, .iproyal-dialog-actions { grid-column: 1 / -1; }
.iproyal-dialog .iproyal-form-note { margin: 0; font-size: 12px; }
.iproyal-dialog-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.quote-loading { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.quote-spinner { width: 14px; height: 14px; border: 2px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: quote-spin .8s linear infinite; }
@keyframes quote-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .quote-spinner { animation: none; } }
.iproyal-price { display: grid; gap: 3px; margin-top: 15px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-muted); font-size: 13px; }
.iproyal-price strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.iproyal-price small { color: var(--muted); }
.iproyal-dialog .iproyal-result { margin-block: 8px 0; font-size: 13px; }
.iproyal-result { min-width: 0; margin: 9px 0 12px; color: var(--muted); font-size: 13px; }
.iproyal-result:empty { display: none; }
.iproyal-result[data-tone="bad"] { color: var(--bad); }
.iproyal-result[data-tone="good"] { color: var(--good); }

@media (max-width: 1150px) {
  :root { --rail-width: 196px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr) minmax(220px, 250px); }
  .stream-worker-column { display: none; }
}

@media (max-width: 960px) {
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .dashboard-side { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .stream-worker-column { display: table-cell; }
  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .proxy-table, .proxy-table tbody { display: block; }
  .proxy-table thead { position: absolute; overflow: hidden; width: 1px; height: 1px; clip-path: inset(50%); }
  .proxy-table tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 8px 12px; padding: 12px 15px; border-top: 1px solid var(--line); }
  .proxy-table tbody td, .proxy-table tbody td:first-child, .proxy-table tbody td:last-child { display: block; min-width: 0; height: auto; padding: 0; border: 0; }
  .proxy-table .proxy-address { grid-column: 1 / -1; }
  .proxy-cell-label { display: block; margin-bottom: 2px; color: var(--muted); font-size: 11px; font-weight: 650; }
}

@media (max-width: 700px) {
  :root { --bar-height: 57px; }
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 3; inset: auto 0 0; padding: 4px 9px env(safe-area-inset-bottom, 0px); height: auto; border: 0; border-top: 1px solid var(--line); }
  .brand, .sidebar-foot, .nav-caption { display: none; }
  .nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; margin: 0; }
  .nav-link { flex-direction: column; justify-content: center; gap: 3px; min-height: 54px; padding: 4px 0; font-size: 11px; }
  .topbar { grid-row: 1; }
  .workspace { grid-row: 2; padding: 24px 15px calc(84px + env(safe-area-inset-bottom, 0px)); }
  .page-heading { flex-wrap: wrap; gap: 11px; margin-bottom: 20px; }
  .metric { padding: 11px 12px; }
  .metric dt { align-items: flex-start; flex-direction: column; gap: 5px; }
  .metric dd strong { font-size: 29px; }
  .metric dd:not(.metric-detail) { min-height: 36px; }
  .metric-total, .metric-detail { font-size: 12px; }
}

@media (max-width: 540px) {
  .topbar { padding: 0 15px; }
  .breadcrumb-root, .breadcrumb .icon { display: none; }
  .dashboard-side { grid-template-columns: minmax(0, 1fr); }
  .toolbar { width: 100%; }
  .scenario-control { flex: 1; }
  .select-wrap select { min-width: 0; }
  .metrics { grid-template-columns: minmax(0, 1fr); }
  .metric { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; padding: 11px 13px; }
  .metric + .metric { border-inline-start: 0; border-top: 1px solid var(--line); }
  .metric dt { align-items: center; flex-direction: row; gap: 8px; }
  .metric dd:not(.metric-detail) { justify-content: end; min-height: 0; margin: 0; }
  .metric-detail { grid-column: 1 / -1; padding-inline-start: 38px; }
  .panel-head { padding-inline: 13px; }
  .stream-table, .stream-table tbody { display: block; }
  .stream-table thead { position: absolute; overflow: hidden; width: 1px; height: 1px; clip-path: inset(50%); }
  .stream-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 10px 13px; border-top: 1px solid var(--line); }
  .stream-table td, .stream-table td:first-child, .stream-table td:last-child { display: block; min-width: 0; height: auto; padding: 0; border: 0; }
  .stream-table .stream-stage { grid-row: 2; grid-column: 1 / -1; }
  .stream-table .stream-status { grid-row: 1; grid-column: 2; }
  .stream-table .stream-worker { grid-row: 3; grid-column: 1; }
  .stream-table .stream-duration { grid-row: 3; grid-column: 2; }
  .stream-mobile-label { display: inline; }
  .notice { flex-wrap: wrap; }
  .proxy-source, .proxy-preview-body, .proxy-footer-actions { padding-inline: 13px; }
  .proxy-preview-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .proxy-preview-counts > div:nth-child(3) { border-inline-start: 0; }
  .proxy-preview-counts > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .proxy-pool-note { padding-inline: 13px; }
  .proxy-metadata-fields { grid-template-columns: minmax(0, 1fr); }
  .catalog-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .catalog-card { padding: 14px; }
}
.login-page { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: min(100%, 420px); padding: clamp(22px, 5vw, 34px); }
.login-card h1 { margin-top: 14px; font-size: 30px; }
.login-form { display: grid; gap: 16px; margin-top: 28px; }
.login-form .iproyal-field { gap: 6px; }
.login-form .iproyal-field input { font-size: 16px; }
.login-form .iproyal-field label { font-size: 14px; }
.login-form #show-password { justify-self: start; }
.login-form .iproyal-result { margin: 0; }
.auth-message { position: fixed; z-index: 5; bottom: 80px; right: 16px; max-width: min(380px, calc(100% - 32px)); padding: 12px; background: var(--bad-soft); color: var(--bad); border-radius: 8px; }
.auth-message:empty { display: none; }
@media (max-width: 540px) { .top-actions { gap: 6px; } .top-actions .button { padding-inline: 8px; } }

.pool-filters { display: grid; grid-template-columns: minmax(180px, 2fr) repeat(2, minmax(150px, 1fr)); gap: 12px; padding: 0 18px 14px; }
.pool-filters label > span { color: var(--muted); font-size: 12px; font-weight: 650; }
.pool-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 18px 12px; }
.pool-bulk > span { color: var(--muted); font-size: 12px; }
.proxy-select { display: flex; align-items: start; gap: 6px; min-height: 44px; cursor: pointer; }
.proxy-select input { width: 18px; height: 18px; flex: none; margin-top: 2px; accent-color: var(--primary); }
.proxy-country small, .proxy-exit-ip { display: block; margin-top: 5px; font-size: 11px; color: var(--muted); }
.proxy-availability small { display: block; margin-top: 4px; font-size: 11px; color: var(--muted); }
@media (max-width: 700px) { .pool-filters { grid-template-columns: 1fr; padding-inline: 13px; } .pool-bulk { padding-inline: 13px; } }

.more-button { display: none; }
.section-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 18px 0; }
.section-toolbar select { min-width: 180px; }
.stream-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.stream-grid > .stream-state { grid-column: 1 / -1; }
.stream-card { overflow: hidden; }
.stream-card-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 14px 16px; }
.frame-button { display: block; width: 100%; padding: 0; border: 0; text-align: left; color: var(--ink); background: var(--surface-muted); cursor: zoom-in; }
.demo-frame { aspect-ratio: 16 / 10; background: var(--canvas); border-block: 1px solid var(--line); display: flex; flex-direction: column; }
.demo-browser-bar { padding: 10px 14px; background: var(--surface-muted); color: var(--muted); border-bottom: 1px solid var(--line); font: 12px var(--font-mono); }
.demo-browser-body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 24px; }
.demo-browser-body strong { font-size: clamp(20px, 2vw, 28px); letter-spacing: -.02em; }
.demo-browser-body p { color: var(--muted); font-size: 13px; }
.demo-caption { font-size: 10px; letter-spacing: .1em; color: var(--muted); }
.demo-browser-body progress { width: 100%; height: 8px; accent-color: var(--accent); }
.stream-card-info { display: grid; gap: 5px; padding: 14px 16px; }
.stream-card-info p, .stream-card-info small { color: var(--muted); font-size: 12px; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.stream-card > .dialog-actions { padding: 0 16px 16px; margin: 0; }
.stream-viewer { width: min(960px, calc(100% - 32px)); max-height: calc(100dvh - 32px); }
.stream-viewer .demo-frame { max-height: 65dvh; }
.stream-viewer > .proxy-help { margin-bottom: 12px; }
.stream-start { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin: 0 0 18px; }
.stream-start .button { min-height: 44px; }
.stream-flag { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 13px; }
.stream-flag input { width: 18px; height: 18px; accent-color: var(--accent); }
.proxy-flag-tag { border-color: var(--warn, #b45309); color: var(--warn, #b45309); }
.frame-button { position: relative; }
.live-frame { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top center; background: var(--surface-muted); border-block: 1px solid var(--line); }
.stream-card .frame-hint { display: none; }
.stream-card.is-empty .frame-hint { position: absolute; inset: 0; display: grid; place-items: center; padding: 18px; color: var(--muted); font-size: 12px; text-align: center; }
.stream-card[data-tone="bad"] { border-color: var(--bad); }
.stream-viewer .live-frame { max-height: 65dvh; aspect-ratio: auto; object-fit: contain; }
.stream-viewer .live-frame.is-manual { cursor: crosshair; outline: 2px solid var(--accent); outline-offset: 2px; touch-action: none; }
.stream-number { margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-muted); }
.stream-number-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
.stream-number-head strong { font: 600 15px var(--font-mono); letter-spacing: .02em; }
.stream-number .dialog-actions { margin-top: 10px; }
.mail-list { display: grid; gap: 8px; padding: 0 16px 16px; }
.mail-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.mail-row-info code { display: block; font-size: 13px; }
.mail-row-info small { color: var(--muted); font-size: 11px; }
.mail-row-actions { display: flex; gap: 8px; }
.mail-ready-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.mail-ready-row .proxy-message { margin: 0; flex: 1 1 320px; }
.finalize-input { min-height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 13px; min-width: 190px; }
#finalize-line { margin: 8px 0 0; overflow-wrap: anywhere; cursor: copy; }
.steps-list { display: grid; gap: 12px; max-height: 64dvh; overflow: auto; }
.step-shot img { width: 100%; border: 1px solid var(--line); border-radius: 8px; }
.step-shot figcaption { margin-top: 4px; color: var(--muted); font-size: 12px; }
.overview-live-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); }
.live-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 0 16px 16px; }
.live-tile { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.live-tile-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; }
.live-tile-head h3 { font-size: 12px; font-weight: 650; letter-spacing: .04em; }
.live-tile .frame-button { cursor: zoom-in; }
.live-tile .live-frame { aspect-ratio: 16 / 10; }
.live-tile-caption { padding: 7px 10px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.live-tile .frame-hint { display: none; }
.live-tile.is-empty .frame-hint { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 11px; }
.live-tile[data-tone="bad"] { border-color: var(--bad); }
.account-dialog { width: min(600px, calc(100% - 32px)); max-height: calc(100dvh - 32px); }
.account-email { margin-top: 12px; font-weight: 650; overflow-wrap: anywhere; }
.account-history { padding-left: 22px; color: var(--muted); font-size: 13px; }
.account-history li + li { margin-top: 8px; }
.account-table td { overflow-wrap: anywhere; }
.account-table input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--primary); }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.setup-card { padding: 22px; }
.setup-card > p { color: var(--muted); margin-top: 12px; }
.setup-card > .button { margin-top: 18px; }
.settings-list { display: grid; gap: 12px; margin: 18px 0; }
.settings-list > div { display: grid; grid-template-columns: minmax(100px, 1fr) minmax(0, 1.4fr); gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
.settings-list dt { color: var(--muted); }
.settings-list dd { overflow-wrap: anywhere; font-weight: 550; }
.proxy-select { display: block; }
.proxy-select code { display: block; font-size: 12px; }
@media (max-width: 1000px) { .account-table { font-size: 12px; } .account-table th, .account-table td { padding: 8px; } }
@media (max-width: 700px) {
  .stream-start { align-items: stretch; }
  .stream-start label, .stream-start .button { flex: 1 1 100%; }
  .nav .nav-secondary { display: none; }
  .more-button { display: flex; background: transparent; }
  .stream-grid, .settings-grid { grid-template-columns: 1fr; }
  .setup-card { padding: 16px; }
  .section-toolbar { flex-wrap: wrap; }
}
@media (max-width: 540px) {
  .account-table td:nth-child(2) { grid-column: 1 / -1; font-weight: 650; }
  .account-table td:nth-child(4) { grid-column: 1 / -1; }
  .account-table td:nth-child(5)::before { content: 'Попытки: '; color: var(--muted); }
  .account-table td:nth-child(6)::before { content: 'Создан: '; color: var(--muted); }
}
.proxy-old-tag { border-color: var(--line); color: var(--muted); }
