:root {
  color-scheme: light;
  --page: #f3f5f4;
  --surface: #ffffff;
  --surface-soft: #f7f9f8;
  --ink: #17201c;
  --muted: #67716c;
  --line: #d8dfdb;
  --line-strong: #b9c5bf;
  --sidebar: #161c19;
  --sidebar-soft: #242d28;
  --green: #158052;
  --green-dark: #0b633d;
  --green-soft: #e7f5ed;
  --cyan: #176f86;
  --cyan-soft: #e7f4f7;
  --amber: #a45b0a;
  --amber-soft: #fff3df;
  --red: #b52b22;
  --red-soft: #fff0ee;
  --shadow: 0 10px 30px rgba(19, 29, 24, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--page); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--page); }
button, input, textarea, select { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.55; }
img { display: block; }
h1, h2, h3, p { margin: 0; }

.app-layout { min-height: 100vh; display: grid; grid-template-columns: 228px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  color: #eef4f0;
  background: var(--sidebar);
  border-right: 1px solid #2a342f;
}
.brand { height: 48px; display: flex; align-items: center; gap: 11px; padding: 0 8px; }
.brand-mark { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 6px; }
.brand-copy { min-width: 0; }
.brand h1 { font-size: 16px; line-height: 1.25; font-weight: 730; white-space: nowrap; }
.brand p { margin-top: 2px; color: #93a29a; font-size: 11px; }
.primary-nav { display: grid; gap: 5px; margin-top: 34px; }
.nav-item {
  width: 100%;
  height: 42px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 0 11px;
  color: #aebbb4;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 650;
}
.nav-item img { width: 18px; height: 18px; opacity: 0.8; filter: invert(83%) sepia(9%) saturate(212%) hue-rotate(95deg); }
.nav-item:hover { color: #fff; background: #202923; }
.nav-item.active { color: #fff; background: var(--sidebar-soft); border-color: #334039; }
.nav-item.active img { opacity: 1; filter: brightness(0) invert(1); }
.nav-count { min-width: 21px; height: 20px; display: inline-grid; place-items: center; padding: 0 5px; color: #c5d0ca; background: #303b35; border-radius: 5px; font-size: 10px; }
.sidebar-foot { margin-top: auto; padding: 16px 8px 2px; border-top: 1px solid #2d3732; }
.sidebar-foot p { margin-top: 9px; color: #718078; font-size: 10px; }
.access-chip { display: flex; align-items: center; gap: 7px; color: #d8e1dc; font-size: 11px; }
.access-chip span { width: 7px; height: 7px; border-radius: 50%; background: #eea43b; }

.app-main { min-width: 0; overflow-x: hidden; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px clamp(18px, 3vw, 38px);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
}
.page-context { min-width: 0; }
.page-context h2 { font-size: 19px; line-height: 1.3; }
.page-context p { margin-top: 2px; color: var(--muted); font-size: 11px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.menu-button { display: none !important; }
.system-state {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  color: #555f5a;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 11px;
}
.system-state > img { width: 14px; height: 14px; opacity: 0.55; }
.state-dot { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: #e69a2f; }
.system-state.ready .state-dot { background: #2fab70; }
.system-state.error .state-dot { background: var(--red); }
.public-banner {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 18px;
  color: #80500b;
  background: var(--amber-soft);
  border-bottom: 1px solid #eed6ac;
  font-size: 11px;
}
.public-banner img { width: 15px; height: 15px; }
.public-banner button { padding: 0; color: #714405; background: transparent; border: 0; font-weight: 700; text-decoration: underline; }

.content { width: min(100%, 1460px); margin: 0 auto; padding: 26px clamp(18px, 3vw, 38px) 56px; }
.view { display: none; min-width: 0; max-width: 100%; }
.view.active { display: block; }
.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 4px 18px rgba(20, 30, 25, 0.04);
}
.metric-cell { min-width: 0; min-height: 112px; display: flex; flex-direction: column; justify-content: center; padding: 20px 24px; border-right: 1px solid var(--line); }
.metric-cell:last-child { border-right: 0; }
.metric-cell span { color: var(--muted); font-size: 12px; font-weight: 600; }
.metric-cell strong { margin: 4px 0 2px; font-size: 29px; line-height: 1.1; font-weight: 720; }
.metric-cell small { color: #87908b; font-size: 11px; }
.metric-cell.success { box-shadow: inset 0 3px var(--green); }
.metric-cell.info { box-shadow: inset 0 3px var(--cyan); }
.metric-cell.danger { box-shadow: inset 0 3px var(--red); }
.pool-metrics { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.pool-metrics .metric-cell { min-height: 94px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.75fr); gap: 18px; margin-top: 18px; }
.panel, .settings-section {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 4px 18px rgba(20, 30, 25, 0.04);
}
.panel-heading { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.eyebrow { color: var(--green); font-size: 9px; line-height: 1.2; font-weight: 800; text-transform: uppercase; }
.panel-heading h3 { margin-top: 3px; font-size: 15px; }
.compact-list { min-height: 242px; padding: 6px 18px; }
.compact-job { width: 100%; min-height: 58px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 12px; padding: 10px 0; color: inherit; text-align: left; background: transparent; border: 0; border-bottom: 1px solid #e7ebe9; }
.compact-job:hover { background: #fafcfb; }
.compact-job:last-child { border-bottom: 0; }
.compact-job strong { display: block; overflow: hidden; color: var(--ink); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.compact-job small { color: var(--muted); font-size: 10px; }
.empty-block { min-height: 230px; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.readiness-list { padding: 7px 18px; }
.readiness-row { width: 100%; min-height: 72px; display: grid; grid-template-columns: 34px minmax(0, 1fr) 10px; align-items: center; gap: 11px; padding: 9px 0; color: inherit; text-align: left; background: transparent; border: 0; border-bottom: 1px solid #e7ebe9; }
.readiness-row:last-child { border-bottom: 0; }
.readiness-row > img { width: 18px; height: 18px; margin-left: 4px; opacity: 0.72; }
.readiness-row strong, .readiness-row small { display: block; }
.readiness-row strong { font-size: 12px; }
.readiness-row small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.readiness-row i { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); }
.readiness-row i.ready { background: var(--green); }
.readiness-row i.neutral { background: var(--cyan); }
.action-band { min-height: 104px; display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 18px; padding: 20px 24px; color: #eaf3ee; background: #1d2923; border: 1px solid #2c3a33; border-radius: 6px; }
.action-band h3 { font-size: 16px; }
.action-band p { margin-top: 4px; color: #aebdb5; font-size: 11px; }
.action-band-buttons { display: flex; gap: 9px; }

.toolbar { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.filter-group, .toolbar-actions, .inline-actions, .bulk-actions { display: flex; align-items: center; gap: 8px; }
.filter-group { min-width: 0; }
.toolbar-actions { justify-content: flex-end; }
.search-field { width: min(320px, 40vw); min-height: 40px; display: flex; align-items: center; gap: 8px; padding: 0 11px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 5px; }
.search-field img { width: 16px; height: 16px; opacity: 0.55; }
.search-field input { width: 100%; min-width: 0; padding: 0; color: var(--ink); background: transparent; border: 0; outline: 0; font-size: 12px; }
select, input, textarea { color: var(--ink); background: #fff; border: 1px solid var(--line-strong); border-radius: 5px; outline: 0; }
select:focus, input:focus, textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(23, 111, 134, 0.12); }
.toolbar select { min-height: 40px; padding: 7px 28px 7px 10px; font-size: 12px; }
.primary-button, .secondary-button, .text-button, .icon-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
}
.primary-button, .secondary-button { padding: 8px 13px; }
.primary-button { color: #fff; background: var(--green); border: 1px solid var(--green); }
.primary-button:hover { background: var(--green-dark); border-color: var(--green-dark); }
.secondary-button { color: #35403a; background: #fff; border: 1px solid var(--line-strong); }
.secondary-button:hover { background: #f4f7f5; }
.text-button { min-height: 30px; padding: 4px 6px; color: var(--green-dark); background: transparent; border: 0; }
.text-button:hover { background: var(--green-soft); }
.danger-text { color: var(--red) !important; }
.primary-button img, .secondary-button img, .icon-button img { width: 16px; height: 16px; }
.primary-button img { filter: brightness(0) invert(1); }
.compact { min-height: 38px; }
.icon-button { width: 38px; height: 38px; flex: 0 0 38px; padding: 0; color: var(--ink); background: #fff; border: 1px solid var(--line); }
.icon-button:hover { background: #f1f5f3; border-color: var(--line-strong); }
.bulk-actions { min-height: 38px; padding: 3px 7px 3px 11px; background: var(--cyan-soft); border: 1px solid #c9e2e8; border-radius: 5px; }
.bulk-actions > span { color: var(--cyan); font-size: 11px; font-weight: 700; white-space: nowrap; }

.table-shell { width: 100%; min-width: 0; max-width: 100%; overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 4px 18px rgba(20, 30, 25, 0.04); }
.data-table { width: 100%; min-width: 850px; border-collapse: collapse; table-layout: fixed; font-size: 12px; }
.data-table th, .data-table td { min-width: 0; padding: 12px 14px; text-align: left; border-bottom: 1px solid #e6ebe8; }
.data-table th { height: 42px; color: #65706a; background: var(--surface-soft); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fafcfb; }
.data-table td { height: 58px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.data-table th:last-child, .data-table td:last-child { width: 60px; text-align: right; }
.data-table .check-column { width: 44px; padding-right: 4px; }
.data-table input[type="checkbox"] { width: 15px; height: 15px; margin: 0; accent-color: var(--green); }
.table-empty { height: 230px !important; color: var(--muted); text-align: center !important; white-space: normal !important; }
.cell-main { display: block; overflow: hidden; color: var(--ink); font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }
.cell-sub { display: block; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.row-action { width: 32px; height: 32px; display: inline-grid; place-items: center; padding: 0; background: transparent; border: 0; border-radius: 5px; }
.row-action:hover { background: #eaf0ed; }
.row-action img { width: 16px; height: 16px; }
.row-menu { max-width: 58px; min-height: 32px; padding: 4px; color: var(--muted); background: transparent; border: 0; font-size: 10px; }
.status-pill { min-width: 66px; display: inline-flex; justify-content: center; padding: 5px 8px; border-radius: 5px; font-size: 10px; font-weight: 800; }
.status-pill.queued, .status-pill.running, .status-pill.in_use { color: var(--amber); background: var(--amber-soft); }
.status-pill.succeeded, .status-pill.available { color: var(--green-dark); background: var(--green-soft); }
.status-pill.partial, .status-pill.failed, .status-pill.interrupted, .status-pill.disabled { color: var(--red); background: var(--red-soft); }
.status-pill.registered { color: var(--cyan); background: var(--cyan-soft); }
.progress-track { width: 86px; height: 5px; overflow: hidden; background: #e5ebe8; border-radius: 3px; }
.progress-track span { height: 100%; display: block; background: var(--green); }
.progress-label { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.account-summary { min-height: 52px; display: flex; align-items: baseline; gap: 7px; margin-bottom: 14px; padding: 10px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.account-summary strong { font-size: 20px; }
.account-summary span { color: var(--muted); font-size: 11px; }
.account-summary i { width: 1px; height: 22px; margin: 0 14px; background: var(--line); }

.warning-band { min-height: 68px; display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding: 14px 18px; color: #714405; background: var(--amber-soft); border: 1px solid #ecd19f; border-radius: 6px; }
.warning-band > img { width: 20px; height: 20px; }
.warning-band strong { font-size: 13px; }
.warning-band p { margin-top: 3px; font-size: 11px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.settings-section form { padding: 20px; }
.config-badge { padding: 5px 8px; color: var(--muted); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 5px; font-size: 10px; font-weight: 700; }
.config-badge.ready { color: var(--green-dark); background: var(--green-soft); border-color: #bee0cc; }
.field { display: block; min-width: 0; margin-top: 14px; }
.field:first-child { margin-top: 0; }
.field > span, .field-label { display: block; margin-bottom: 7px; color: #46514b; font-size: 11px; font-weight: 700; }
.field input, .field textarea, .field select { width: 100%; min-height: 42px; padding: 9px 11px; font-size: 12px; }
.field textarea { resize: vertical; line-height: 1.5; }
.secret-field { display: grid; grid-template-columns: minmax(0, 1fr) 42px; gap: 7px; }
.inline-actions { margin-top: 16px; }
.proxy-settings form { padding-bottom: 16px; }
.proxy-list-heading { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.proxy-list-heading .icon-button { width: 32px; height: 32px; min-height: 32px; flex-basis: 32px; }
.proxy-list { max-height: 240px; overflow-y: auto; padding: 0 18px; }
.proxy-empty { min-height: 92px; display: grid; place-items: center; color: var(--muted); font-size: 11px; }
.proxy-row { min-height: 62px; display: grid; grid-template-columns: 28px minmax(0, 1fr) minmax(96px, auto) auto; align-items: center; gap: 10px; border-bottom: 1px solid #e6ebe8; }
.proxy-row:last-child { border-bottom: 0; }
.proxy-index { width: 24px; height: 24px; display: inline-grid; place-items: center; color: var(--cyan); background: var(--cyan-soft); border-radius: 5px; font-size: 10px; font-weight: 800; }
.proxy-meta { min-width: 0; }
.proxy-meta strong, .proxy-meta small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proxy-meta strong { font: 11px/1.3 ui-monospace, SFMono-Regular, Consolas, monospace; }
.proxy-meta small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.proxy-test-state { color: var(--muted); font-size: 9px; text-align: right; white-space: nowrap; }
.proxy-actions { display: flex; gap: 5px; }
.proxy-actions .icon-button { width: 32px; height: 32px; min-height: 32px; flex-basis: 32px; }
.proxy-row.region-open { padding-block: 9px; }
.proxy-region-editor { grid-column: 2 / -1; display: grid; grid-template-columns: minmax(150px, 1fr) minmax(70px, 92px) 32px; align-items: center; gap: 7px; width: 100%; padding: 2px 0 4px; }
.proxy-region-editor select, .proxy-region-editor input { width: 100%; min-width: 0; height: 34px; padding: 6px 9px; font-size: 10px; }
.proxy-region-editor select { grid-column: 1; }
.proxy-region-editor input { grid-column: 2; text-transform: uppercase; }
.proxy-region-editor .region-save { grid-column: 3; width: 32px; height: 32px; min-height: 32px; }
.system-table { margin-top: 16px; }
.system-table dl { margin: 0; padding: 0 18px; }
.system-table dl > div { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid #e6ebe8; }
.system-table dl > div:last-child { border-bottom: 0; }
.system-table dt { color: var(--muted); font-size: 11px; }
.system-table dd { margin: 0; font-size: 11px; font-weight: 700; }

.dialog { width: min(620px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; overflow: hidden; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 6px; box-shadow: 0 22px 70px rgba(11, 20, 15, 0.24); }
.wide-dialog { width: min(760px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(12, 18, 15, 0.56); }
.dialog-form { max-height: calc(100vh - 34px); display: flex; flex-direction: column; }
.dialog-heading { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.dialog-heading h2 { margin-top: 3px; font-size: 18px; }
.dialog-body { overflow-y: auto; padding: 4px 20px 20px; }
.dialog-footer { min-height: 66px; display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding: 12px 20px; background: var(--surface-soft); border-top: 1px solid var(--line); }
.footer-spacer { flex: 1; }
.form-section { padding: 18px 0; border-top: 1px solid var(--line); }
.form-section.first { border-top: 0; }
.segmented { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 3px; background: #edf1ef; border: 1px solid var(--line); border-radius: 6px; }
.segment { min-height: 38px; padding: 7px 9px; color: #58625d; background: transparent; border: 0; border-radius: 4px; font-size: 11px; font-weight: 700; overflow-wrap: anywhere; }
.segment.active { color: var(--ink); background: #fff; box-shadow: 0 1px 4px rgba(19, 29, 24, 0.12); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 2px 0 18px; }
.pool-job-fields { display: grid; grid-template-columns: 140px minmax(0, 1fr); align-items: end; gap: 14px; margin-top: 16px; }
.availability-box { min-height: 42px; display: flex; align-items: baseline; gap: 7px; padding: 9px 12px; color: var(--green-dark); background: var(--green-soft); border-left: 3px solid var(--green); }
.availability-box strong { font-size: 19px; }
.availability-box span { font-size: 11px; font-weight: 700; }
.manual-fields { margin-top: 17px; padding-top: 17px; border-top: 1px solid var(--line); }
.manual-fields .field { margin-top: 13px; }
.field-note { margin-top: 8px; color: var(--muted); font-size: 10px; }
.form-feedback { margin-top: 10px; padding: 10px 12px; color: var(--red); background: var(--red-soft); border-left: 3px solid var(--red); font-size: 11px; }
.form-feedback.success { color: var(--green-dark); background: var(--green-soft); border-left-color: var(--green); }
.file-drop { width: 100%; min-height: 108px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; margin: 14px 0; color: var(--muted); background: var(--surface-soft); border: 1px dashed var(--line-strong); border-radius: 6px; }
.file-drop:hover, .file-drop.dragging { color: var(--cyan); background: var(--cyan-soft); border-color: var(--cyan); }
.file-drop img { width: 22px; height: 22px; }
.file-drop strong { color: inherit; font-size: 12px; }
.file-drop span { font-size: 10px; }

.detail-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 14px 0; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 5px; }
.detail-summary div { min-width: 0; padding: 12px; border-right: 1px solid var(--line); }
.detail-summary div:last-child { border-right: 0; }
.detail-summary span, .detail-field span { display: block; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.detail-summary strong { display: block; margin-top: 4px; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.detail-fields { display: grid; gap: 8px; margin: 14px 0; }
.detail-field { min-width: 0; padding: 11px 12px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 5px; }
.detail-field code { display: block; margin-top: 5px; overflow-wrap: anywhere; font: 11px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace; }
.raw-result { max-height: 310px; margin: 14px 0 0; padding: 14px; overflow: auto; color: #d9e6df; background: #18201c; border-radius: 5px; font: 11px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 60; max-width: min(380px, calc(100vw - 32px)); padding: 11px 14px; color: #fff; background: #1c2520; border: 1px solid #35423b; border-radius: 5px; box-shadow: var(--shadow); font-size: 11px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 1050px) {
  .app-layout { grid-template-columns: 196px minmax(0, 1fr); }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar-actions { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
}

@media (max-width: 760px) {
  body { padding-bottom: 67px; }
  .app-layout { display: block; }
  .sidebar { position: fixed; top: auto; right: 0; bottom: 0; left: 0; z-index: 40; width: 100%; height: 67px; padding: 5px 6px; border: 0; border-top: 1px solid #334039; }
  .brand, .sidebar-foot { display: none; }
  .primary-nav { height: 100%; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; margin: 0; }
  .nav-item { height: 56px; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 3px; text-align: center; font-size: 9px; }
  .nav-item img { width: 18px; height: 18px; }
  .nav-count { position: absolute; margin: -25px 0 0 22px; min-width: 17px; height: 17px; padding: 0 4px; }
  .topbar { min-height: 64px; padding: 10px 12px; }
  .page-context h2 { font-size: 16px; }
  .page-context p { display: none; }
  .system-state { max-width: 142px; }
  .system-state > img { display: none; }
  .topbar .primary-button.compact { width: 38px; padding: 0; }
  .topbar .primary-button.compact span { display: none; }
  .public-banner { justify-content: flex-start; padding-inline: 13px; }
  .public-banner button { margin-left: auto; }
  .content { padding: 16px 12px 32px; }
  .view, .toolbar, .table-shell { min-width: 0; max-width: calc(100vw - 24px); }
  .table-shell { width: calc(100vw - 24px); }
  .metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-cell { min-height: 88px; padding: 15px; border-bottom: 1px solid var(--line); }
  .metric-cell:nth-child(2n) { border-right: 0; }
  .metric-cell:nth-last-child(-n+2) { border-bottom: 0; }
  .metric-cell strong { font-size: 24px; }
  .pool-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pool-metrics .metric-cell { min-height: 78px; }
  .pool-metrics .metric-cell:last-child { border-top: 1px solid var(--line); border-right: 1px solid var(--line); border-bottom: 0; }
  .action-band { align-items: flex-start; flex-direction: column; padding: 18px; }
  .action-band-buttons { width: 100%; }
  .action-band-buttons button { flex: 1; }
  .filter-group { width: 100%; }
  .search-field { width: 100%; }
  .filter-group select { max-width: 132px; }
  .toolbar-actions { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .toolbar-actions > button { flex: 0 0 auto; }
  .bulk-actions { position: absolute; right: 12px; left: 12px; z-index: 3; overflow-x: auto; }
  .data-table { min-width: 760px; }
  .data-table:has(tbody .table-empty) { min-width: 100%; }
  .data-table:has(tbody .table-empty) thead { display: none; }
  .table-shell { box-shadow: none; }
  .account-summary { flex-wrap: wrap; }
  .dialog { width: 100%; max-width: none; max-height: calc(100vh - 12px); margin: auto 0 0; border-right: 0; border-bottom: 0; border-left: 0; border-radius: 6px 6px 0 0; }
  .dialog-form { max-height: calc(100vh - 12px); }
  .dialog-heading, .dialog-footer { padding-inline: 15px; }
  .dialog-body { padding-inline: 15px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .detail-summary { grid-template-columns: minmax(0, 1fr); }
  .detail-summary div { border-right: 0; border-bottom: 1px solid var(--line); }
  .detail-summary div:last-child { border-bottom: 0; }
  .toast { right: 12px; bottom: 79px; }
  .proxy-row { grid-template-columns: 26px minmax(0, 1fr) auto; }
  .proxy-test-state { grid-column: 2; text-align: left; }
  .proxy-actions { grid-column: 3; grid-row: 1 / span 2; }
  .proxy-region-editor { grid-column: 2 / -1; grid-template-columns: minmax(124px, 1fr) 64px 32px; }
}

@media (max-width: 420px) {
  .system-state { max-width: 118px; padding-inline: 8px; }
  .system-state span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .metric-cell { padding: 13px; }
  .toolbar-actions .secondary-button { padding-inline: 10px; }
  .dialog-footer .secondary-button, .dialog-footer .primary-button { min-width: 0; }
}
