:root {
  --bg: #f4f7f7;
  --surface: #ffffff;
  --surface-subtle: #eef3f3;
  --ink: #172226;
  --muted: #607078;
  --line: #d9e2e3;
  --line-strong: #bdcbcd;
  --primary: #0b766e;
  --primary-dark: #075c56;
  --primary-soft: #dcefed;
  --blue: #356ca5;
  --blue-soft: #e4edf7;
  --amber: #a96912;
  --amber-soft: #f8ecd8;
  --danger: #b83b43;
  --danger-soft: #fae7e8;
  --shadow: 0 14px 36px rgba(24, 47, 51, 0.09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
}

button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: 0;
}

button,
select {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

[hidden] {
  display: none !important;
}

.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.brand-lockup,
.account-block,
.title-row,
.form-heading,
.workspace-heading,
.target-status,
.session-line,
.pagination-bar,
.pagination-actions,
.dialog-header,
.dialog-footer {
  display: flex;
  align-items: center;
}

.brand-lockup {
  gap: 11px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--ink);
  color: #ffffff;
  font-size: 19px;
  font-weight: 800;
}

.brand-name {
  font-size: 15px;
  line-height: 1.1;
  font-weight: 750;
}

.brand-product {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.target-status {
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.status-dot {
  width: 7px;
  height: 7px;
  display: inline-block;
  border-radius: 50%;
  background: #1a9d67;
  box-shadow: 0 0 0 3px rgba(26, 157, 103, 0.12);
}

.target-status:not(.connected) .status-dot {
  background: #8b989d;
  box-shadow: 0 0 0 3px rgba(96, 112, 120, 0.1);
}

.loading-view {
  min-height: calc(100vh - 64px);
  display: grid;
  place-items: center;
  padding: 40px 20px;
}

.loading-panel {
  width: min(420px, 100%);
  text-align: center;
}

.loading-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin: 0 auto 24px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow);
}

.loading-mark svg {
  width: 21px;
  height: 21px;
}

.loading-panel h1 {
  margin: 10px 0 0;
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: 0;
}

.loading-panel p {
  margin: 12px 0 20px;
  color: var(--muted);
  font-size: 14px;
}

.loading-panel .inline-error {
  margin: 0 0 16px;
  text-align: left;
}

.loading-panel .secondary-button {
  margin: 0 auto;
}

.auth-view {
  min-height: calc(100vh - 64px);
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(400px, 620px);
  justify-content: center;
  align-items: center;
  gap: 88px;
  padding: 28px 40px;
}

.auth-summary h1,
.workspace-heading h1,
.dialog-header h2,
.form-heading h2 {
  margin: 0;
  letter-spacing: 0;
}

.auth-summary h1 {
  max-width: 330px;
  margin-top: 12px;
  font-size: 42px;
  line-height: 1.16;
}

.eyebrow,
.dialog-kicker,
.form-kicker {
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.connection-facts {
  margin: 44px 0 0;
  border-top: 1px solid var(--line-strong);
}

.connection-facts > div {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 18px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.connection-facts dt,
.connection-facts dd {
  margin: 0;
  font-size: 13px;
}

.connection-facts dt {
  color: var(--muted);
}

.connection-facts dd {
  font-weight: 700;
}

.auth-form {
  padding: 24px 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.form-heading {
  justify-content: space-between;
  margin-bottom: 20px;
}

.form-heading h2 {
  margin-bottom: 5px;
  font-size: 20px;
}

.form-heading > svg {
  width: 24px;
  height: 24px;
  color: var(--primary);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.field {
  display: grid;
  gap: 8px;
}

.field > span,
.field > label {
  font-size: 13px;
  font-weight: 700;
}

.field-label-row {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.field-label-row > label {
  font-size: 13px;
  font-weight: 700;
}

.segmented-control {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(48px, 1fr));
  padding: 2px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface-subtle);
}

.segment-button {
  min-width: 48px;
  height: 26px;
  padding: 0 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.segment-button.active {
  background: var(--surface);
  color: var(--primary-dark);
  box-shadow: 0 1px 3px rgba(24, 47, 51, 0.12);
}

.segment-button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.batch-key-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
}

.batch-key-meta .has-warning {
  color: var(--danger);
  font-weight: 700;
}

.field small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.field-span-2 {
  grid-column: 1 / -1;
}

.auth-form > .field {
  margin-bottom: 14px;
}

.auth-method-control {
  width: 100%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.auth-method-control .segment-button {
  height: 34px;
}

.auth-fields {
  display: grid;
  gap: 14px;
  margin-bottom: 4px;
}

input,
textarea,
select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

input,
select {
  height: 42px;
  padding: 0 12px;
}

textarea {
  padding: 11px 12px;
  line-height: 1.5;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(11, 118, 110, 0.11);
}

input::placeholder,
textarea::placeholder {
  color: #8b989d;
}

.secret-field {
  position: relative;
}

.secret-field textarea {
  padding-right: 48px;
  -webkit-text-security: disc;
}

.secret-field.revealed textarea {
  -webkit-text-security: none;
}

.secret-toggle {
  position: absolute;
  top: 8px;
  right: 8px;
}

.primary-button,
.secondary-button,
.icon-button,
.nav-item {
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.primary-button,
.secondary-button {
  padding: 0 15px;
}

.primary-button {
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.primary-button:hover {
  border-color: var(--primary-dark);
  background: var(--primary-dark);
}

.secondary-button {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.secondary-button:hover,
.icon-button:hover {
  border-color: #9babad;
  background: var(--surface-subtle);
}

.icon-button {
  width: 38px;
  flex: 0 0 38px;
  padding: 0;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--muted);
}

.primary-button svg,
.secondary-button svg,
.icon-button svg,
.nav-item svg,
.search-field svg,
.select-field svg,
.page-size svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

.wide-button {
  width: 100%;
}

.auth-form .wide-button {
  height: 44px;
  margin-top: 18px;
}

.inline-error,
.list-error {
  border: 1px solid #edc7ca;
  border-radius: 6px;
  background: var(--danger-soft);
  color: #8f2830;
  font-size: 12px;
}

.inline-error {
  margin-top: 16px;
  padding: 10px 12px;
}

.console-view {
  min-height: calc(100vh - 64px);
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
}

.account-rail {
  min-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: var(--surface-subtle);
}

.account-block {
  gap: 11px;
  padding: 0 8px 22px;
  border-bottom: 1px solid var(--line);
}

.account-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  flex: 0 0 38px;
  place-items: center;
  border-radius: 7px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 14px;
  font-weight: 800;
}

.account-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.account-copy strong,
.account-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-copy strong {
  font-size: 14px;
}

.account-copy span {
  color: var(--muted);
  font-size: 11px;
}

.side-nav {
  display: grid;
  gap: 6px;
  margin-top: 18px;
}

.nav-item {
  width: 100%;
  justify-content: flex-start;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.nav-item.active {
  background: var(--surface);
  color: var(--primary-dark);
  box-shadow: inset 3px 0 0 var(--primary);
}

.session-panel {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.mapping-editor {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-subtle);
}

.mapping-heading {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mapping-heading strong {
  font-size: 13px;
}

.compact-button {
  height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.mapping-rows {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.mapping-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 8px;
}

.mapping-row > svg {
  width: 16px;
  height: 16px;
  justify-self: center;
  color: var(--muted);
}

.mapping-row .icon-button {
  background: var(--surface);
  color: var(--danger);
}

.mapping-empty {
  padding: 16px 0 5px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.session-line {
  justify-content: space-between;
  margin-bottom: 11px;
  font-size: 11px;
}

.session-line > span {
  color: var(--muted);
}

.session-line strong {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
}

.session-panel .wide-button {
  margin-top: 9px;
}

.workspace {
  min-width: 0;
  padding: 30px clamp(20px, 3vw, 44px);
  overflow: hidden;
}

.workspace-heading {
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 24px;
}

.workspace-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.workspace-heading h1 {
  font-size: 26px;
}

.provision-form {
  min-height: 0;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.provision-form-scroll {
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  overscroll-behavior: contain;
}

.provision-section {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.provision-base-grid,
.provision-options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.provision-key-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.provision-key-meta .has-warning {
  color: var(--danger);
  font-weight: 700;
}

.provision-section-heading {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.provision-section-heading h2 {
  margin: 3px 0 0;
  font-size: 16px;
  letter-spacing: 0;
}

.section-kicker {
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
}

.provision-route-head,
.provision-route-row {
  display: grid;
  grid-template-columns: 44px minmax(150px, 0.65fr) minmax(260px, 1.35fr) 38px;
  align-items: center;
  gap: 10px;
}

.provision-route-head {
  min-height: 30px;
  padding: 0 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.provision-route-rows {
  display: grid;
}

.provision-route-row {
  min-height: 58px;
  padding: 8px 4px;
  border-top: 1px solid var(--line);
}

.provision-route-number {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 800;
}

.provision-route-remove {
  color: var(--danger);
}

.provision-options-grid .switch-row {
  grid-column: 1 / -1;
}

.provision-form .batch-create-result,
.provision-form .inline-error {
  margin: 18px;
}

.provision-footer {
  min-height: 68px;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.provision-total {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.provision-total span {
  color: var(--muted);
  font-size: 10px;
}

.provision-total strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.title-row {
  gap: 10px;
  margin-top: 5px;
}

.count-badge {
  min-width: 28px;
  height: 23px;
  display: inline-grid;
  place-items: center;
  padding: 0 8px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 800;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(210px, 1.4fr) minmax(150px, 0.8fr) 150px 140px auto 38px;
  gap: 10px;
  margin-bottom: 16px;
}

.search-field,
.select-field,
.page-size {
  position: relative;
}

.search-field svg {
  position: absolute;
  top: 13px;
  left: 12px;
  color: var(--muted);
  pointer-events: none;
}

.search-field input {
  padding-left: 36px;
}

.select-field svg,
.page-size svg {
  position: absolute;
  top: 13px;
  right: 10px;
  color: var(--muted);
  pointer-events: none;
}

.select-field select,
.page-size select {
  appearance: none;
  padding-right: 34px;
}

.list-error {
  margin-bottom: 14px;
  padding: 11px 13px;
}

.table-wrap {
  position: relative;
  max-width: 100%;
  min-height: 390px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  height: 48px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 42px;
  background: #f8fafa;
  box-shadow: 0 1px 0 var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.col-id { width: 82px; }
.col-name { width: 210px; }
.col-type { width: 160px; }
.col-group { width: 110px; }
.col-status { width: 105px; }
.col-usage { width: 150px; }
.col-models { width: 250px; }
.col-priority,
.col-weight { width: 90px; }

table.usage-visible {
  min-width: 1130px;
}

.managed-table-wrap {
  min-height: 330px;
}

.managed-batch-toolbar {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.managed-selected-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.managed-batch-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.managed-row-checkbox {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.managed-row-checkbox:disabled {
  cursor: not-allowed;
}

.managed-selection-cell {
  display: grid;
  place-items: center;
}

.managed-table tbody tr.is-selected {
  background: var(--primary-soft);
}

.managed-usage-overview {
  min-height: 94px;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) 1px minmax(190px, 1fr) auto;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.managed-usage-metric {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.managed-metric-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.managed-metric-label svg {
  width: 15px;
  height: 15px;
}

.managed-metric-value {
  overflow: hidden;
  color: var(--primary-dark);
  font-size: 24px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.snapshot-usage-metric .managed-metric-value {
  color: var(--blue);
}

.managed-metric-meta {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.managed-usage-divider {
  width: 1px;
  height: 56px;
  background: var(--line);
}

.snapshot-button {
  align-self: center;
}

.managed-table {
  min-width: 1000px;
}

.managed-table th,
.managed-table td {
  padding-right: 10px;
  padding-left: 10px;
}

.managed-col-select { width: 42px; text-align: center; }
.managed-col-id { width: 65px; }
.managed-col-name { width: 185px; }
.managed-col-type { width: 110px; }
.managed-col-group { width: 180px; }
.managed-col-status { width: 85px; }
.managed-col-usage { width: 135px; }
.managed-col-actions { width: 200px; }

.managed-select-cell {
  text-align: center;
}

.managed-group-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  align-items: center;
  gap: 6px;
}

.managed-group-control select {
  height: 32px;
  padding: 0 9px;
  font-size: 11px;
}

.managed-apply-button {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
}

.managed-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.managed-actions .compact-button {
  min-width: 78px;
}

.managed-status-button.disable-action {
  border-color: #e3b9bc;
  color: var(--danger);
}

.managed-status-button.disable-action:hover {
  border-color: #d89599;
  background: var(--danger-soft);
}

.managed-summary-bar {
  min-height: 56px;
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

tbody tr:hover {
  background: #fafcfc;
}

.cell-name {
  font-weight: 700;
}

.usage-values {
  display: flex;
  align-items: center;
  gap: 5px;
}

.usage-amount {
  min-width: 54px;
  height: 25px;
  display: inline-grid;
  place-items: center;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.usage-amount.remaining {
  color: var(--muted);
}

.tag,
.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  height: 24px;
  padding: 0 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
}

.tag {
  background: var(--blue-soft);
  color: #2d5d8c;
}

.status-tag.enabled {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.status-tag.disabled {
  background: var(--surface-subtle);
  color: var(--muted);
}

.status-tag.auto-disabled {
  background: var(--amber-soft);
  color: var(--amber);
}

.table-state {
  position: absolute;
  inset: 42px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--muted);
  font-size: 13px;
}

.table-state svg {
  width: 18px;
  height: 18px;
}

.spin {
  animation: spin 0.85s linear infinite;
}

.icon-button.is-loading svg {
  animation: spin 0.85s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.pagination-bar {
  min-height: 56px;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
  font-size: 12px;
}

.pagination-actions {
  gap: 7px;
}

.page-size select {
  width: 100px;
  height: 38px;
  font-size: 12px;
}

.page-indicator {
  min-width: 74px;
  text-align: center;
  color: var(--ink);
  font-weight: 700;
}

.channel-dialog {
  width: min(720px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(18, 34, 38, 0.24);
}

.channel-dialog::backdrop {
  background: rgba(21, 34, 38, 0.48);
}

.channel-dialog form {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: calc(100vh - 30px);
}

.dialog-header,
.dialog-footer {
  justify-content: space-between;
  padding: 18px 22px;
}

.dialog-header {
  border-bottom: 1px solid var(--line);
}

.dialog-header h2 {
  margin-top: 4px;
  font-size: 19px;
}

.dialog-body {
  padding: 22px;
  overflow: auto;
}

.dialog-footer {
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
}

.switch-row {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.switch-row > span {
  display: grid;
  gap: 4px;
}

.switch-row strong {
  font-size: 13px;
}

.switch-row small {
  color: var(--muted);
  font-size: 11px;
}

.switch-row input {
  width: 36px;
  height: 20px;
  accent-color: var(--primary);
}

.batch-create-result {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-subtle);
}

.batch-create-result > strong {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
}

.batch-create-result ul {
  max-height: 170px;
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.batch-create-result li {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: start;
  gap: 7px;
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.batch-create-result li svg {
  width: 15px;
  height: 15px;
  margin-top: 1px;
}

.batch-result-success {
  color: var(--primary-dark);
}

.batch-result-failure {
  color: var(--danger);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 32px));
  padding: 12px 15px;
  border: 1px solid #a9cfc9;
  border-radius: 6px;
  background: #e5f4f1;
  color: var(--primary-dark);
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 700;
}

.toast.error {
  border-color: #edc7ca;
  background: var(--danger-soft);
  color: #8f2830;
}

@media (min-width: 821px) {
  html,
  body,
  #app {
    height: 100%;
  }

  body {
    overflow: hidden;
  }

  #app {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
  }

  .topbar {
    flex: 0 0 64px;
  }

  .console-view {
    height: calc(100vh - 64px);
    height: calc(100dvh - 64px);
    min-height: 0;
    flex: 1 1 auto;
    overflow: hidden;
  }

  .auth-view,
  .loading-view {
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
  }

  .account-rail {
    height: 100%;
    min-height: 0;
    overflow-y: auto;
  }

  .workspace {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  .workspace-heading,
  .filter-bar,
  .managed-usage-overview,
  .list-error,
  .pagination-bar,
  .managed-summary-bar {
    flex: 0 0 auto;
  }

  .table-wrap,
  .managed-table-wrap {
    min-height: 0;
    flex: 1 1 auto;
  }
}

@media (max-width: 1100px) {
  .filter-bar {
    grid-template-columns: 1fr 1fr 150px 140px;
  }

  .filter-bar .secondary-button {
    grid-column: 3;
  }
}

@media (max-width: 820px) {
  .topbar {
    height: 58px;
    padding: 0 16px;
  }

  .brand-product {
    display: none;
  }

  .loading-view {
    min-height: calc(100vh - 58px);
  }

  .auth-view {
    min-height: calc(100vh - 58px);
    grid-template-columns: 1fr;
    align-content: start;
    gap: 28px;
    padding: 36px 18px;
  }

  .auth-summary h1 {
    font-size: 32px;
  }

  .connection-facts {
    margin-top: 25px;
  }

  .auth-form {
    padding: 22px;
  }

  .console-view {
    min-height: calc(100vh - 58px);
    grid-template-columns: 1fr;
  }

  .account-rail {
    min-height: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .account-block {
    padding: 0;
    border: 0;
  }

  .session-line {
    display: none;
  }

  .side-nav {
    grid-column: 1 / -1;
    display: flex;
    gap: 6px;
    margin-top: 2px;
  }

  .side-nav .nav-item {
    flex: 1 1 0;
    justify-content: center;
  }

  .session-panel {
    margin: 0;
    padding: 0;
    border: 0;
  }

  .session-panel .wide-button {
    width: 38px;
    margin: 0;
    padding: 0;
  }

  .session-panel .wide-button span {
    display: none;
  }

  .workspace {
    padding: 24px 16px;
  }

  .table-wrap,
  .managed-table-wrap {
    height: min(58dvh, 520px);
    min-height: 280px;
  }

  .filter-bar {
    grid-template-columns: 1fr 1fr;
  }

  .managed-batch-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .managed-batch-actions {
    overflow-x: auto;
  }

  .provision-form {
    overflow: visible;
  }

  .provision-form-scroll {
    overflow: visible;
  }

  .filter-bar .secondary-button {
    grid-column: auto;
  }
}

@media (max-width: 560px) {
  .target-status span:last-child {
    display: block;
    max-width: 156px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .auth-summary {
    display: none;
  }

  .auth-view {
    padding-top: 28px;
  }

  .form-grid,
  .dialog-body.form-grid,
  .filter-bar {
    grid-template-columns: 1fr;
  }

  .field-span-2 {
    grid-column: auto;
  }

  .provision-base-grid,
  .provision-options-grid {
    grid-template-columns: 1fr;
  }

  .provision-route-head {
    display: none;
  }

  .provision-route-row {
    grid-template-columns: 30px minmax(0, 1fr) 38px;
    gap: 8px;
    padding: 11px 0;
  }

  .provision-route-number {
    grid-column: 1;
    grid-row: 1;
  }

  .provision-route-group {
    grid-column: 2;
    grid-row: 1;
  }

  .provision-route-models {
    grid-column: 2 / 4;
    grid-row: 2;
  }

  .provision-route-remove {
    grid-column: 3;
    grid-row: 1;
  }

  .provision-options-grid .switch-row {
    grid-column: auto;
  }

  .provision-section,
  .provision-footer {
    padding-right: 14px;
    padding-left: 14px;
  }

  .mapping-row {
    grid-template-columns: minmax(0, 1fr) 38px;
  }

  .mapping-row > svg {
    grid-column: 2;
    grid-row: 1;
    transform: rotate(90deg);
  }

  .mapping-target-input {
    grid-column: 1;
    grid-row: 2;
  }

  .mapping-remove-button {
    grid-column: 2;
    grid-row: 2;
  }

  .workspace-heading {
    align-items: flex-end;
  }

  .workspace-heading h1 {
    font-size: 22px;
  }

  .workspace-heading .primary-button {
    width: 38px;
    padding: 0;
  }

  .workspace-heading .primary-button span {
    display: none;
  }

  .managed-usage-overview {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px 12px;
    padding: 14px;
  }

  .live-usage-metric {
    grid-column: 1 / -1;
    padding-bottom: 13px;
    border-bottom: 1px solid var(--line);
  }

  .managed-usage-divider {
    display: none;
  }

  .managed-metric-value {
    font-size: 22px;
  }

  .snapshot-button {
    padding: 0 11px;
  }

  .filter-bar .secondary-button {
    grid-column: 1;
  }

  #reset-filter-button {
    position: absolute;
    right: 16px;
    margin-top: 208px;
  }

  .pagination-bar {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 0;
  }

  .pagination-actions {
    width: 100%;
  }

  .page-size {
    margin-right: auto;
  }

  .dialog-body {
    padding: 18px;
  }

  .dialog-header,
  .dialog-footer {
    padding: 16px 18px;
  }
}
