:root {
  --canvas: #eff1ec;
  --surface: #fafbf7;
  --surface-muted: #e5e8e1;
  --ink: #111512;
  --muted: #687069;
  --line: #cbd0c8;
  --line-strong: #aeb5ac;
  --accent: #d7ff3f;
  --accent-strong: #b9e900;
  --success: #18794e;
  --warning: #9a6700;
  --danger: #c9372c;
  --console: #151a17;
  --console-line: #2b332e;
  --console-text: #d7ddd8;
  --radius: 6px;
  --font-sans: "Avenir Next", "Segoe UI Variable", "Segoe UI", sans-serif;
  --font-mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  background-color: var(--canvas);
  background-image:
    linear-gradient(rgba(17, 21, 18, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 21, 18, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
  font-family: var(--font-sans);
  letter-spacing: 0;
}

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

button,
select,
input[type="checkbox"],
input[type="radio"] {
  cursor: pointer;
}

button:disabled,
select:disabled,
input:disabled {
  cursor: not-allowed;
}

textarea:disabled {
  cursor: not-allowed;
}

[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;
}

.boot-screen {
  min-height: 100dvh;
  display: grid;
  place-content: center;
  gap: 18px;
}

.boot-mark,
.brand-mark {
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--accent);
  border: 1px solid var(--ink);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-weight: 800;
}

.boot-mark {
  width: 58px;
  height: 58px;
  margin: 0 auto;
  font-size: 18px;
}

.boot-lines {
  display: grid;
  gap: 7px;
  width: 150px;
}

.boot-lines span {
  height: 6px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
  position: relative;
}

.boot-lines span::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 45%;
  background: var(--ink);
  animation: boot-scan 1.1s ease-in-out infinite alternate;
}

.boot-lines span:last-child::after {
  animation-delay: 180ms;
}

@keyframes boot-scan {
  from { transform: translateX(-30%); }
  to { transform: translateX(150%); }
}

.app-shell {
  min-height: 100dvh;
  animation: shell-in 360ms ease-out both;
}

@keyframes shell-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.topbar {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 3vw, 44px);
  border-bottom: 1px solid var(--line-strong);
  background: rgba(250, 251, 247, 0.94);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand-lockup,
.topbar-meta,
.connection-state {
  display: flex;
  align-items: center;
}

.brand-lockup {
  gap: 13px;
  min-width: 0;
}

.brand-mark {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  font-size: 13px;
}

.eyebrow,
.section-index {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1 {
  margin: 2px 0 0;
  font-size: 22px;
  line-height: 1.1;
  font-weight: 750;
}

h2 {
  margin: 4px 0 0;
  font-size: 23px;
  line-height: 1.15;
  font-weight: 750;
}

h3 {
  margin: 0;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 750;
}

.topbar-meta {
  gap: 18px;
  flex: 0 0 auto;
}

.logout-command {
  min-width: 54px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--ink);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}

.logout-command:hover:not(:disabled) {
  border-color: var(--ink);
  background: var(--surface-muted);
}

.connection-state {
  gap: 7px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

.connection-state code {
  color: var(--ink);
  font-family: inherit;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-strong);
}

.status-dot.is-online {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(24, 121, 78, 0.12);
}

.clock {
  min-width: 70px;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 13px;
  text-align: right;
}

.page-content {
  width: min(1540px, 100%);
  margin: 0 auto;
  padding: 22px clamp(14px, 2.5vw, 36px) 46px;
}

.metrics-band {
  display: grid;
  grid-template-columns: 1.2fr 0.7fr 0.7fr 1.25fr 0.9fr;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  background: rgba(250, 251, 247, 0.68);
  animation: section-in 420ms 50ms ease-out both;
}

@keyframes section-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.metric {
  min-width: 0;
  min-height: 92px;
  padding: 16px 18px;
  border-right: 1px solid var(--line);
  display: grid;
  align-content: center;
  gap: 3px;
}

.metric:last-child {
  border-right: 0;
}

.metric-label,
.metric-note {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.metric-label {
  font-family: var(--font-mono);
  font-weight: 650;
  text-transform: uppercase;
}

.metric-value {
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: var(--font-mono);
  font-size: 24px;
  line-height: 1.05;
  font-weight: 780;
}

.metric-state .metric-value {
  font-family: var(--font-sans);
  font-size: 20px;
}

.metric-time {
  font-size: 21px;
}

.progress-track {
  width: 100%;
  height: 5px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--surface-muted);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--ink);
  transition: width 280ms ease;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr);
  gap: 18px;
  margin-top: 18px;
  align-items: stretch;
}

.config-surface,
.ops-surface,
.accounts-surface {
  min-width: 0;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  animation: section-in 440ms ease-out both;
}

.config-surface {
  animation-delay: 90ms;
}

.ops-surface {
  animation-delay: 140ms;
}

.surface-header {
  min-height: 77px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}

.save-state,
.live-badge {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--muted);
  background: var(--canvas);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
}

.save-state.is-dirty {
  color: var(--ink);
  border-color: var(--ink);
  background: var(--accent);
}

.live-badge {
  gap: 6px;
}

.live-badge i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line-strong);
}

.live-badge.is-running i {
  background: var(--success);
  animation: live-pulse 1.2s ease-out infinite;
}

.live-badge.is-stopping i {
  background: var(--warning);
}

.live-badge.is-failed i {
  background: var(--danger);
}

@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(24, 121, 78, 0.35); }
  70% { box-shadow: 0 0 0 6px rgba(24, 121, 78, 0); }
  100% { box-shadow: 0 0 0 0 rgba(24, 121, 78, 0); }
}

.tab-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.tab-button {
  min-height: 43px;
  padding: 8px 12px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  color: var(--muted);
  background: var(--surface-muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.tab-button:last-child {
  border-right: 0;
}

.tab-button:hover {
  color: var(--ink);
  background: #f0f2ed;
}

.tab-button.is-active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: inset 0 -3px 0 var(--accent-strong);
}

.tab-button:focus-visible,
.button:focus-visible,
.icon-command:focus-visible,
.text-command:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.tab-panel {
  min-height: 470px;
  padding: 20px 18px 22px;
}

.tab-panel.is-active {
  animation: panel-in 200ms ease-out both;
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.field {
  min-width: 0;
  grid-column: span 1;
  display: grid;
  align-content: start;
  gap: 6px;
}

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

.field-full {
  grid-column: 1 / -1;
}

.field > span:first-child,
.mode-fieldset legend {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
}

.field input,
.field select,
.field textarea,
.compact-select select {
  width: 100%;
  min-width: 0;
  height: 39px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink);
  background: #ffffff;
  padding: 0 10px;
  font-size: 13px;
}

.field textarea {
  min-height: 72px;
  height: auto;
  padding: 9px 10px;
  resize: vertical;
  font-family: var(--font-mono);
  line-height: 1.45;
}

.field input:hover,
.field select:hover,
.field textarea:hover,
.compact-select select:hover {
  border-color: var(--ink);
}

.field input:disabled,
.field select:disabled,
.field textarea:disabled {
  color: #8c928d;
  background: var(--surface-muted);
  border-color: var(--line);
}

.cpa-pool-card {
  margin-top: 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #f3f5ef;
  overflow: hidden;
}

.cpa-pool-heading {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.cpa-pool-toggle {
  flex: 1;
  justify-content: space-between;
}

.cpa-pool-toggle > span:first-child {
  display: grid;
  gap: 2px;
}

.cpa-pool-toggle small {
  color: var(--muted);
  font-size: 10px;
}

.cpa-pool-status {
  display: grid;
  grid-template-columns: 84px 84px minmax(0, 1fr);
  border-bottom: 1px solid var(--line);
  background: var(--console);
  color: var(--console-text);
}

.cpa-pool-status > span {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 10px 13px;
  border-right: 1px solid var(--console-line);
}

.cpa-pool-status > span:last-child {
  border-right: 0;
}

.cpa-pool-status small {
  color: #89958c;
  font-size: 9px;
  font-weight: 750;
  text-transform: uppercase;
}

.cpa-pool-status strong {
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cpa-pool-error {
  margin: 0;
  padding: 9px 14px;
  border-bottom: 1px solid #e3b5b0;
  color: var(--danger);
  background: #fff1ef;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.45;
}

.cpa-proxy-pool-fields {
  padding: 14px;
}

.cpa-liveness-toggle {
  min-height: 39px;
  align-self: end;
}

.cpa-pool-note {
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.cpa-pool-note code {
  color: var(--ink);
  font-family: var(--font-mono);
}

.secret-input {
  position: relative;
  display: block;
}

.secret-input input {
  padding-right: 58px;
}

.secret-toggle {
  position: absolute;
  right: 5px;
  top: 5px;
  min-width: 46px;
  height: 29px;
  border: 0;
  border-left: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 700;
}

.secret-toggle:hover {
  color: var(--ink);
}

.toggle-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.toggle-control,
.master-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.toggle-control input,
.master-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-ui {
  width: 34px;
  height: 19px;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-muted);
  position: relative;
  transition: background 160ms ease, border-color 160ms ease;
}

.toggle-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 160ms ease, background 160ms ease;
}

.toggle-control input:checked + .toggle-ui,
.master-toggle input:checked + .toggle-ui {
  border-color: var(--ink);
  background: var(--accent);
}

.toggle-control input:checked + .toggle-ui::after,
.master-toggle input:checked + .toggle-ui::after {
  transform: translateX(15px);
  background: var(--ink);
}

.toggle-control input:focus-visible + .toggle-ui,
.master-toggle input:focus-visible + .toggle-ui {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.provider-heading {
  min-height: 49px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}

.provider-code {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 8px;
  border: 1px solid var(--ink);
  border-radius: 3px;
  background: var(--accent);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
}

.provider-heading strong {
  font-size: 15px;
}

.master-toggle {
  justify-content: space-between;
  min-height: 60px;
  margin-bottom: 18px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--canvas);
}

.master-toggle > span:first-child {
  display: grid;
  gap: 2px;
  margin-right: auto;
}

.master-toggle small {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
}

.cpa-fields.is-disabled {
  opacity: 0.58;
}

.mode-fieldset {
  min-width: 0;
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}

.mode-fieldset legend {
  margin-bottom: 7px;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
}

.segmented-control label {
  min-width: 0;
}

.segmented-control input {
  position: absolute;
  opacity: 0;
}

.segmented-control span {
  min-height: 39px;
  padding: 7px 8px;
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line);
  color: var(--muted);
  background: #ffffff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.segmented-control label:last-child span {
  border-right: 0;
}

.segmented-control input:checked + span {
  color: var(--ink);
  background: var(--accent);
}

.segmented-control input:focus-visible + span {
  box-shadow: inset 0 0 0 2px var(--ink);
}

.action-bar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 13px 18px;
  border-top: 1px solid var(--line);
  background: var(--canvas);
}

.button {
  min-height: 39px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
  transition: transform 120ms ease, background 120ms ease, color 120ms ease;
}

.button:active:not(:disabled),
.icon-command:active,
.text-command:active {
  transform: translateY(1px);
}

.button-secondary {
  color: var(--ink);
  background: #ffffff;
}

.button-secondary:hover:not(:disabled) {
  background: var(--surface-muted);
}

.button-primary {
  color: var(--ink);
  background: var(--accent);
}

.button-primary:hover:not(:disabled) {
  background: var(--accent-strong);
}

.button-stop {
  color: #ffffff;
  border-color: var(--danger);
  background: var(--danger);
}

.button-stop:disabled,
.button:disabled {
  color: #8a908b;
  border-color: var(--line);
  background: var(--surface-muted);
}

.ops-surface {
  display: grid;
  grid-template-rows: auto auto minmax(380px, 1fr);
}

.check-strip {
  padding: 14px 16px 16px;
  border-bottom: 1px solid var(--line);
}

.subsection-heading,
.log-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.subsection-heading {
  margin-bottom: 10px;
}

.subsection-heading span,
.log-toolbar > div:first-child span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
}

.check-item {
  min-width: 0;
  min-height: 53px;
  padding: 9px 10px;
  display: grid;
  align-content: center;
  gap: 4px;
  border-right: 1px solid var(--line);
}

.check-item:last-child {
  border-right: 0;
}

.check-item span {
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.check-item strong {
  font-family: var(--font-mono);
  font-size: 11px;
}

.check-item.is-ok strong {
  color: var(--success);
}

.check-item.is-fail strong {
  color: var(--danger);
}

.check-item.is-running strong {
  color: var(--warning);
}

.log-console {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--console);
}

.log-toolbar {
  min-height: 55px;
  padding: 9px 12px 9px 15px;
  border-bottom: 1px solid var(--console-line);
  color: #ffffff;
}

.log-toolbar > div:first-child {
  display: grid;
  gap: 3px;
}

.log-toolbar > div:first-child span {
  color: #859087;
}

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

.compact-select select {
  width: 74px;
  height: 31px;
  color: var(--console-text);
  border-color: var(--console-line);
  background: #202722;
  font-size: 11px;
}

.auto-scroll-toggle {
  min-height: 31px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 7px;
  border: 1px solid var(--console-line);
  border-radius: var(--radius);
  color: #9ba49d;
  font-size: 10px;
  cursor: pointer;
}

.auto-scroll-toggle input {
  accent-color: var(--accent-strong);
}

.icon-command {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--console-line);
  border-radius: var(--radius);
  color: #a9b1ab;
  background: #202722;
  font-family: var(--font-mono);
  font-size: 17px;
}

.icon-command:hover {
  color: #ffffff;
  border-color: #59635c;
}

.log-viewport {
  min-height: 380px;
  max-height: 590px;
  overflow: auto;
  padding: 10px 0 18px;
  scrollbar-color: #4a554d var(--console);
}

.log-empty {
  height: 100%;
  min-height: 300px;
  display: grid;
  place-items: center;
  color: #667069;
  font-family: var(--font-mono);
  font-size: 11px;
}

.log-line {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 7px;
  min-height: 26px;
  padding: 4px 12px;
  color: var(--console-text);
  border-left: 2px solid transparent;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.55;
}

.log-line:hover {
  background: rgba(255, 255, 255, 0.035);
}

.log-seq {
  color: #5f6962;
  text-align: right;
  user-select: none;
}

.log-message {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.log-line[data-level="success"] {
  color: #7edda9;
  border-left-color: var(--success);
}

.log-line[data-level="warning"] {
  color: #f0c674;
  border-left-color: var(--warning);
}

.log-line[data-level="error"] {
  color: #ff8f87;
  border-left-color: var(--danger);
}

.log-line[data-level="debug"] {
  color: #7c8a80;
}

.log-line[data-level="system"] {
  color: #b8c4bb;
  background: rgba(215, 255, 63, 0.035);
}

.accounts-surface {
  min-width: 0;
  margin-top: 18px;
  overflow: hidden;
  animation-delay: 190ms;
}

.accounts-header {
  min-height: 70px;
}

.text-command {
  min-height: 32px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  font-size: 11px;
  font-weight: 750;
}

.accounts-table-wrap {
  min-height: 112px;
  overflow-x: auto;
}

.accounts-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.accounts-table th,
.accounts-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.accounts-table th {
  color: var(--muted);
  background: var(--canvas);
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
}

.accounts-table td {
  min-width: 0;
  font-size: 12px;
}

.accounts-table th:nth-child(1) { width: 46%; }
.accounts-table th:nth-child(2) { width: 24%; }
.accounts-table th:nth-child(3) { width: 16%; }
.accounts-table th:nth-child(4) { width: 14%; text-align: right; }
.accounts-table td:last-child { text-align: right; }

.account-email {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font-mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.download-link {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  color: var(--ink);
  background: #ffffff;
  font-size: 11px;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.download-link:hover {
  background: var(--accent);
}

.table-empty {
  min-height: 110px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  max-width: min(420px, calc(100vw - 32px));
  padding: 11px 14px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--accent);
  box-shadow: 6px 6px 0 rgba(17, 21, 18, 0.14);
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.is-error {
  color: #ffffff;
  border-color: var(--danger);
  background: var(--danger);
}

.login-body {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: 24px;
}

.login-shell {
  width: min(100%, 420px);
}

.login-panel {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 10px 10px 0 rgba(17, 21, 18, 0.12);
  overflow: hidden;
  animation: shell-in 280ms ease-out both;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.login-heading {
  padding: 28px 28px 0;
}

.login-form {
  display: grid;
  gap: 18px;
  padding: 22px 28px 30px;
}

.login-form .field {
  grid-column: 1;
}

.login-form input {
  min-height: 44px;
}

.login-submit {
  width: 100%;
  min-height: 44px;
  margin-top: 4px;
}

.login-error {
  margin: -4px 0 0;
  padding: 10px 12px;
  border-left: 3px solid var(--danger);
  color: var(--danger);
  background: rgba(201, 55, 44, 0.08);
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 1180px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .ops-surface {
    grid-template-rows: auto auto 520px;
  }

  .log-viewport {
    max-height: none;
  }
}

@media (max-width: 840px) {
  .metrics-band {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .metric:nth-child(2n) {
    border-right: 0;
  }

  .metric:last-child {
    grid-column: 1 / -1;
    border-bottom: 0;
  }

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

  .field,
  .field-wide {
    grid-column: span 1;
  }

  .field-full {
    grid-column: 1 / -1;
  }

  .toggle-grid {
    grid-template-columns: 1fr;
  }

  .action-bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .topbar {
    position: static;
    align-items: flex-start;
    padding: 13px 14px;
  }

  .topbar-meta {
    gap: 8px;
  }

  .logout-command {
    min-width: 48px;
    padding: 0 9px;
  }

  .connection-state {
    padding: 0 8px;
  }

  .connection-state code,
  .clock {
    display: none;
  }

  .page-content {
    padding: 12px 10px 32px;
  }

  .metrics-band {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric {
    min-height: 82px;
    padding: 13px 12px;
  }

  .metric-value {
    font-size: 20px;
  }

  .workspace-grid,
  .accounts-surface {
    margin-top: 12px;
  }

  .workspace-grid {
    gap: 12px;
  }

  .surface-header {
    min-height: 69px;
    padding: 13px 12px;
  }

  h2 {
    font-size: 20px;
  }

  .tab-button {
    padding: 7px 5px;
    font-size: 11px;
  }

  .tab-panel {
    min-height: 0;
    padding: 16px 12px 18px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .field,
  .field-wide,
  .field-full {
    grid-column: 1;
  }

  .segmented-control {
    grid-template-columns: 1fr;
  }

  .segmented-control span {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .segmented-control label:last-child span {
    border-bottom: 0;
  }

  .action-bar {
    grid-template-columns: 1fr 1fr;
    padding: 10px 12px;
  }

  .button {
    padding: 0 8px;
    font-size: 11px;
  }

  .check-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .check-item:nth-child(2) {
    border-right: 0;
  }

  .check-item:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .log-toolbar {
    align-items: flex-start;
  }

  .auto-scroll-toggle {
    display: none;
  }

  .log-viewport {
    min-height: 430px;
  }

  .accounts-table {
    min-width: 620px;
  }

  .toast {
    right: 16px;
    bottom: 16px;
  }

  .login-body {
    padding: 14px;
  }

  .login-heading {
    padding: 22px 20px 0;
  }

  .login-form {
    padding: 18px 20px 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
