:root {
  color-scheme: dark;
  --ink-950: #040a09;
  --ink-900: #07100e;
  --ink-850: #0a1512;
  --ink-800: #0e1c18;
  --ink-750: #12231e;
  --ink-700: #172b25;
  --paper: #f2ead8;
  --paper-muted: #b8b09f;
  --paper-dim: #7f8279;
  --gold-100: #f0dca5;
  --gold-300: #d4b56b;
  --gold-500: #9e7a38;
  --gold-700: #57401f;
  --emerald-300: #68d9b5;
  --emerald-500: #2a9f7b;
  --emerald-700: #145b49;
  --ruby-300: #f08b91;
  --ruby-500: #b8434e;
  --ruby-700: #6e222d;
  --amber-400: #d2a04f;
  --line: rgba(218, 188, 116, 0.17);
  --line-strong: rgba(218, 188, 116, 0.34);
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Baskerville, Georgia, serif;
  --sans: "Avenir Next", Avenir, "Segoe UI", Helvetica, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sidebar-width: 248px;
  --radius-small: 8px;
  --radius-medium: 14px;
  --radius-large: 20px;
  --focus: 0 0 0 3px rgba(104, 217, 181, 0.28);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--ink-950);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--paper);
  background:
    radial-gradient(circle at 73% -12%, rgba(30, 111, 86, 0.18), transparent 33rem),
    linear-gradient(145deg, var(--ink-950), #06110e 46%, #030706);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.01) 1px, transparent 1px);
  background-size: 42px 42px;
  content: "";
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 85%);
  pointer-events: none;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button,
input,
textarea,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

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

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  color: var(--ink-950);
  background: var(--gold-100);
  border-radius: var(--radius-small);
  font-weight: 700;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 34rem;
  height: 34rem;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.16;
  pointer-events: none;
}

.ambient-one {
  top: -18rem;
  right: -12rem;
  background: var(--emerald-500);
}

.ambient-two {
  bottom: -24rem;
  left: 8%;
  background: var(--gold-500);
  opacity: 0.08;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--gold-300);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  line-height: 1.4;
  text-transform: uppercase;
}

.button {
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-small);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.015em;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease,
    opacity 160ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:active:not(:disabled) {
  transform: translateY(0);
}

.button:disabled,
.icon-button:disabled,
.number-stepper button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.button-primary {
  color: #07100e;
  background: linear-gradient(135deg, #ead391, #b89148);
  border-color: rgba(255, 234, 174, 0.5);
  box-shadow: 0 10px 28px rgba(106, 75, 25, 0.22);
}

.button-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #f2dda0, #c7a259);
}

.button-secondary {
  color: var(--paper);
  background: rgba(255, 255, 255, 0.035);
  border-color: var(--line-strong);
}

.button-secondary:hover:not(:disabled),
.button-quiet:hover:not(:disabled) {
  background: rgba(212, 181, 107, 0.08);
  border-color: rgba(212, 181, 107, 0.42);
}

.button-quiet {
  color: var(--paper-muted);
  background: transparent;
  border-color: var(--line);
}

.button-danger-quiet {
  color: var(--ruby-300);
  background: rgba(184, 67, 78, 0.06);
  border-color: rgba(184, 67, 78, 0.32);
}

.button-danger-quiet:hover:not(:disabled) {
  color: #ffd1d4;
  background: rgba(184, 67, 78, 0.13);
  border-color: rgba(240, 139, 145, 0.48);
}

.field-group {
  display: grid;
  gap: 7px;
}

.field-group label,
.field-label,
.target-control > label {
  color: var(--paper-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.035em;
}

input,
textarea {
  width: 100%;
  color: var(--paper);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(205, 182, 125, 0.22);
  border-radius: var(--radius-small);
  caret-color: var(--gold-300);
  transition: border-color 160ms ease, background-color 160ms ease;
}

input {
  min-height: 46px;
  padding: 10px 12px;
}

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

input:hover:not(:disabled),
textarea:hover:not(:disabled) {
  border-color: rgba(205, 182, 125, 0.36);
}

input:focus,
textarea:focus {
  background: rgba(0, 0, 0, 0.31);
  border-color: var(--gold-300);
  outline: none;
}

input:disabled,
textarea:disabled {
  color: var(--paper-dim);
  background: rgba(255, 255, 255, 0.018);
}

.field-hint {
  color: var(--paper-dim);
  font-size: 11px;
  line-height: 1.45;
}

.form-error {
  margin: 0;
  padding: 10px 12px;
  color: #ffc4c8;
  background: rgba(184, 67, 78, 0.1);
  border: 1px solid rgba(184, 67, 78, 0.26);
  border-radius: var(--radius-small);
  font-size: 12px;
}

/* Login */

.login-shell {
  display: grid;
  min-height: 100vh;
  padding: 32px 20px;
  place-items: center;
}

.login-panel {
  position: relative;
  width: min(100%, 410px);
  padding: 44px 42px 34px;
  overflow: hidden;
  background:
    linear-gradient(150deg, rgba(20, 43, 36, 0.92), rgba(7, 15, 13, 0.98) 68%),
    var(--ink-850);
  border: 1px solid var(--line-strong);
  border-radius: 3px 3px var(--radius-large) var(--radius-large);
  box-shadow: var(--shadow);
}

.login-panel::before,
.login-panel::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.login-panel::before {
  inset: 8px;
  border: 1px solid rgba(212, 181, 107, 0.08);
  border-radius: 1px 1px 14px 14px;
}

.login-panel::after {
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold-300), var(--ruby-500), var(--gold-300), transparent);
}

.login-brand {
  display: flex;
  margin-bottom: 22px;
}

.brand-mark {
  position: relative;
  display: inline-grid;
  width: 38px;
  height: 44px;
  flex: 0 0 auto;
  color: #121817;
  background: linear-gradient(145deg, #f0d996, #8f682c);
  border: 1px solid #f0dca5;
  border-radius: 48% 48% 44% 44% / 39% 39% 61% 61%;
  box-shadow:
    inset 0 0 0 3px rgba(7, 16, 14, 0.28),
    0 8px 24px rgba(0, 0, 0, 0.28);
  font-family: Georgia, serif;
  font-size: 25px;
  line-height: 1;
  place-items: center;
}

.brand-mark::after {
  position: absolute;
  bottom: 6px;
  width: 6px;
  height: 8px;
  background: linear-gradient(145deg, #ee8890, #831e2c);
  border: 1px solid #f3b3a9;
  border-radius: 55% 55% 65% 65%;
  box-shadow: 0 0 9px rgba(184, 67, 78, 0.65);
  content: "";
}

.brand-mark-large {
  width: 52px;
  height: 60px;
  font-size: 35px;
}

.brand-mark-large::after {
  bottom: 7px;
  width: 8px;
  height: 10px;
}

.login-panel h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(38px, 9vw, 50px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1;
}

.login-subtitle {
  max-width: 30ch;
  margin: 13px 0 28px;
  color: var(--paper-muted);
  font-size: 13px;
}

.login-form {
  display: grid;
  gap: 17px;
}

.login-submit {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.login-security-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 25px;
  color: var(--paper-dim);
  font-size: 10px;
  letter-spacing: 0.03em;
}

.security-pulse {
  width: 6px;
  height: 6px;
  background: var(--emerald-300);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(104, 217, 181, 0.08);
}

/* Console shell */

.console-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
  position: fixed;
  z-index: 20;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  padding: 27px 18px 20px;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(14, 29, 24, 0.97), rgba(5, 11, 10, 0.99)),
    var(--ink-900);
  border-right: 1px solid var(--line);
  box-shadow: 12px 0 40px rgba(0, 0, 0, 0.14);
}

.sidebar::after {
  position: absolute;
  top: 24px;
  right: -1px;
  width: 1px;
  height: 104px;
  background: linear-gradient(to bottom, transparent, var(--gold-300), transparent);
  content: "";
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 27px;
  border-bottom: 1px solid var(--line);
}

.sidebar-brand div {
  display: grid;
  min-width: 0;
}

.sidebar-brand strong {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.sidebar-brand div span {
  color: var(--paper-dim);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.primary-nav {
  display: grid;
  gap: 7px;
  margin-top: 26px;
}

.nav-item {
  position: relative;
  display: grid;
  min-height: 48px;
  padding: 0 12px;
  color: var(--paper-dim);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-small);
  cursor: pointer;
  font-size: 13px;
  grid-template-columns: 28px 1fr;
  align-items: center;
  text-align: left;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.nav-item:hover {
  color: var(--paper);
  background: rgba(255, 255, 255, 0.025);
}

.nav-item.is-active {
  color: var(--paper);
  background: linear-gradient(90deg, rgba(212, 181, 107, 0.11), rgba(212, 181, 107, 0.025));
  border-color: rgba(212, 181, 107, 0.15);
}

.nav-item.is-active::before {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: -19px;
  width: 2px;
  background: var(--gold-300);
  box-shadow: 0 0 12px rgba(212, 181, 107, 0.6);
  content: "";
}

.nav-index {
  color: var(--gold-500);
  font-family: var(--mono);
  font-size: 9px;
}

.sidebar-foot {
  display: grid;
  gap: 12px;
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.operator-card {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 0 7px;
}

.operator-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  color: var(--gold-100);
  background: linear-gradient(145deg, var(--ink-700), var(--ink-900));
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-family: var(--serif);
  place-items: center;
}

.operator-card div {
  display: grid;
  min-width: 0;
}

.operator-card span:not(.operator-avatar) {
  color: var(--paper-dim);
  font-size: 9px;
  text-transform: uppercase;
}

.operator-card strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-button {
  width: 100%;
}

.workspace {
  display: flex;
  min-width: 0;
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  flex-direction: column;
  grid-column: 2;
}

.topbar {
  position: sticky;
  z-index: 15;
  top: 0;
  display: flex;
  min-height: 88px;
  padding: 18px clamp(20px, 3vw, 44px);
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  background: rgba(4, 10, 9, 0.84);
  border-bottom: 1px solid rgba(212, 181, 107, 0.12);
  backdrop-filter: blur(18px);
}

.topbar-title h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(23px, 3vw, 31px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.connection-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--paper-dim);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.connection-dot {
  width: 7px;
  height: 7px;
  background: var(--amber-400);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(210, 160, 79, 0.08);
}

.connection-state.is-online .connection-dot {
  background: var(--emerald-300);
  box-shadow: 0 0 0 4px rgba(104, 217, 181, 0.08), 0 0 10px rgba(104, 217, 181, 0.36);
}

.connection-state.is-error .connection-dot {
  background: var(--ruby-300);
  box-shadow: 0 0 0 4px rgba(240, 139, 145, 0.08);
}

.environment-badge,
.state-chip,
.panel-meta {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.environment-badge {
  padding: 5px 9px;
  color: var(--gold-100);
  background: rgba(212, 181, 107, 0.08);
  border: 1px solid rgba(212, 181, 107, 0.28);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.environment-badge.is-production {
  color: #ffd5d8;
  background: rgba(184, 67, 78, 0.12);
  border-color: rgba(240, 139, 145, 0.38);
}

.environment-badge.is-development {
  color: #bdf3df;
  background: rgba(42, 159, 123, 0.1);
  border-color: rgba(104, 217, 181, 0.3);
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  color: var(--paper-muted);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  place-items: center;
  transition: transform 180ms ease, border-color 180ms ease, color 180ms ease;
}

.icon-button:hover:not(:disabled) {
  color: var(--gold-100);
  border-color: var(--line-strong);
  transform: rotate(22deg);
}

.execution-lock {
  display: flex;
  margin: 18px clamp(20px, 3vw, 44px) 0;
  padding: 13px 16px;
  align-items: flex-start;
  gap: 12px;
  color: #e7d5ac;
  background: linear-gradient(90deg, rgba(158, 122, 56, 0.12), rgba(158, 122, 56, 0.045));
  border: 1px solid rgba(212, 181, 107, 0.23);
  border-radius: var(--radius-small);
}

.execution-lock.is-production-lock {
  color: #f2c8ca;
  background: linear-gradient(90deg, rgba(184, 67, 78, 0.13), rgba(184, 67, 78, 0.04));
  border-color: rgba(184, 67, 78, 0.3);
}

.lock-glyph {
  margin-top: 2px;
  color: var(--gold-300);
  font-size: 10px;
}

.execution-lock strong {
  display: block;
  font-size: 12px;
}

.execution-lock p {
  margin: 2px 0 0;
  color: currentColor;
  font-size: 11px;
  opacity: 0.72;
}

.content {
  width: 100%;
  max-width: 1540px;
  padding: 26px clamp(20px, 3vw, 44px) 42px;
}

.view-section {
  animation: section-enter 280ms ease both;
}

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

.panel,
.metric-card {
  background:
    linear-gradient(145deg, rgba(16, 34, 29, 0.86), rgba(8, 17, 15, 0.92)),
    var(--ink-850);
  border: 1px solid var(--line);
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.15);
}

.panel {
  border-radius: var(--radius-medium);
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.panel-heading h2,
.panel-heading h3,
.policy-card h3 {
  margin: 0;
  color: var(--paper);
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.018em;
}

.panel-heading h2 {
  font-size: 22px;
}

.panel-heading h3,
.policy-card h3 {
  font-size: 19px;
}

.panel-meta {
  padding: 4px 9px;
  color: var(--paper-dim);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 9px;
}

.state-chip {
  padding: 4px 9px;
  color: var(--paper-dim);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.state-chip.is-running,
.room-status.is-running {
  color: #a7efd5;
  background: rgba(42, 159, 123, 0.09);
  border-color: rgba(104, 217, 181, 0.21);
}

.state-chip.is-stopped,
.room-status.is-waiting {
  color: #d5c8a8;
  background: rgba(158, 122, 56, 0.08);
  border-color: rgba(212, 181, 107, 0.16);
}

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

.metric-card {
  position: relative;
  min-height: 159px;
  padding: 19px 20px;
  overflow: hidden;
  border-radius: var(--radius-medium);
}

.metric-card::after {
  position: absolute;
  right: -30px;
  bottom: -60px;
  width: 120px;
  height: 120px;
  background: var(--gold-500);
  border-radius: 50%;
  content: "";
  filter: blur(55px);
  opacity: 0.07;
}

.metric-card-human::after {
  background: var(--emerald-500);
  opacity: 0.14;
}

.metric-card-bot::after {
  background: var(--gold-300);
  opacity: 0.11;
}

.metric-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--paper-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.metric-sigil {
  color: var(--gold-500);
  font-size: 9px;
}

.metric-card-human .metric-sigil {
  color: var(--emerald-300);
}

.metric-value {
  display: block;
  margin-top: 18px;
  font-family: var(--serif);
  font-size: clamp(32px, 4vw, 45px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.95;
}

.metric-card p {
  max-width: 30ch;
  margin: 14px 0 0;
  color: var(--paper-dim);
  font-size: 10px;
  line-height: 1.45;
}

.overview-grid {
  display: grid;
  gap: 13px;
  margin-top: 13px;
  grid-template-columns: minmax(0, 1.8fr) minmax(260px, 0.72fr);
}

.rooms-panel,
.fleet-pulse-panel,
.audit-preview-panel,
.audit-page-panel,
.fleet-form,
.live-fleet-card,
.policy-card {
  padding: 21px;
}

.table-scroll {
  margin: 18px -8px 0;
  overflow-x: auto;
  scrollbar-color: var(--gold-700) transparent;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(212, 181, 107, 0.09);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--paper-dim);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

tbody tr {
  transition: background-color 140ms ease;
}

tbody tr:hover {
  background: rgba(212, 181, 107, 0.035);
}

td {
  color: var(--paper-muted);
}

.room-name {
  display: grid;
  color: var(--paper);
  font-weight: 700;
}

.room-name small {
  color: var(--paper-dim);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 400;
}

.human-count {
  color: var(--emerald-300);
  font-family: var(--mono);
  font-weight: 700;
}

.bot-count {
  color: var(--gold-300);
  font-family: var(--mono);
  font-weight: 700;
}

.room-status {
  display: inline-flex;
  padding: 3px 7px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.empty-state {
  display: grid;
  min-height: 120px;
  color: var(--paper-dim);
  place-items: center;
  align-content: center;
  text-align: center;
}

.empty-state span {
  color: var(--gold-500);
}

.empty-state p {
  margin: 6px 0 0;
  font-size: 11px;
}

.fleet-pulse-panel {
  display: flex;
  flex-direction: column;
}

.fleet-gauge {
  --progress: 0%;
  position: relative;
  display: grid;
  width: 146px;
  height: 146px;
  margin: 22px auto 18px;
  background:
    radial-gradient(circle, var(--ink-850) 57%, transparent 59%),
    conic-gradient(var(--gold-300) var(--progress), rgba(212, 181, 107, 0.1) 0);
  border-radius: 50%;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.3);
  place-items: center;
}

.fleet-gauge[data-progress="10"] { --progress: 10%; }
.fleet-gauge[data-progress="20"] { --progress: 20%; }
.fleet-gauge[data-progress="30"] { --progress: 30%; }
.fleet-gauge[data-progress="40"] { --progress: 40%; }
.fleet-gauge[data-progress="50"] { --progress: 50%; }
.fleet-gauge[data-progress="60"] { --progress: 60%; }
.fleet-gauge[data-progress="70"] { --progress: 70%; }
.fleet-gauge[data-progress="80"] { --progress: 80%; }
.fleet-gauge[data-progress="90"] { --progress: 90%; }
.fleet-gauge[data-progress="100"] { --progress: 100%; }

.fleet-gauge::after {
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(212, 181, 107, 0.11);
  border-radius: 50%;
  content: "";
}

.gauge-center {
  display: grid;
  z-index: 1;
  place-items: center;
}

.gauge-center strong {
  font-family: var(--serif);
  font-size: 39px;
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 1;
}

.gauge-center span {
  margin-top: 4px;
  color: var(--paper-dim);
  font-size: 9px;
}

.gauge-center b {
  color: var(--paper-muted);
}

.compact-definition-list {
  display: grid;
  margin: 0;
}

.compact-definition-list > div {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid rgba(212, 181, 107, 0.08);
}

.compact-definition-list dt {
  color: var(--paper-dim);
  font-size: 10px;
}

.compact-definition-list dd {
  margin: 0;
  color: var(--paper);
  font-family: var(--mono);
  font-size: 10px;
}

.panel-action {
  width: 100%;
  margin-top: auto;
}

.audit-preview-panel {
  margin-top: 13px;
}

.text-button {
  padding: 6px 0;
  color: var(--gold-300);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
}

.text-button:hover {
  color: var(--gold-100);
}

.audit-list {
  padding: 0;
  margin: 18px 0 0;
  list-style: none;
}

.audit-entry {
  position: relative;
  display: grid;
  min-height: 60px;
  padding: 11px 0 11px 29px;
  border-bottom: 1px solid rgba(212, 181, 107, 0.08);
  grid-template-columns: minmax(120px, 0.65fr) minmax(190px, 1.45fr) auto;
  align-items: center;
  gap: 14px;
}

.audit-entry::before {
  position: absolute;
  left: 7px;
  width: 7px;
  height: 7px;
  background: var(--gold-500);
  border: 1px solid var(--gold-300);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(212, 181, 107, 0.05);
  content: "";
}

.audit-entry.is-success::before {
  background: var(--emerald-500);
  border-color: var(--emerald-300);
}

.audit-entry.is-rejected::before,
.audit-entry.is-failed::before {
  background: var(--ruby-500);
  border-color: var(--ruby-300);
}

.audit-actor,
.audit-copy {
  display: grid;
  min-width: 0;
}

.audit-actor strong,
.audit-copy strong {
  overflow: hidden;
  color: var(--paper);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-actor span,
.audit-copy span {
  overflow: hidden;
  color: var(--paper-dim);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-time {
  color: var(--paper-dim);
  font-family: var(--mono);
  font-size: 8px;
  text-align: right;
}

/* Fleet */

.section-intro {
  display: flex;
  min-height: 92px;
  margin-bottom: 19px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.section-intro h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(29px, 4vw, 40px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1;
}

.section-intro p:not(.eyebrow) {
  max-width: 67ch;
  margin: 10px 0 0;
  color: var(--paper-dim);
  font-size: 11px;
}

.revision-plaque {
  display: grid;
  min-width: 126px;
  padding: 11px 14px;
  background: rgba(212, 181, 107, 0.05);
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  text-align: right;
}

.revision-plaque span {
  color: var(--paper-dim);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.revision-plaque strong {
  margin-top: 2px;
  color: var(--gold-100);
  font-family: var(--mono);
  font-size: 14px;
}

.fleet-layout {
  display: grid;
  gap: 13px;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.68fr);
  align-items: start;
}

.fleet-form {
  display: grid;
  gap: 24px;
}

.fleet-master-row {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.fleet-master-row p {
  margin: 3px 0 0;
  color: var(--paper-dim);
  font-size: 10px;
}

.switch-control {
  flex: 0 0 auto;
  cursor: pointer;
}

.switch-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch-track {
  display: flex;
  width: 48px;
  height: 26px;
  padding: 3px;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 999px;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.switch-track span {
  width: 18px;
  height: 18px;
  background: var(--paper-dim);
  border-radius: 50%;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
  transition: transform 180ms ease, background-color 180ms ease;
}

.switch-control input:checked + .switch-track {
  background: rgba(42, 159, 123, 0.18);
  border-color: rgba(104, 217, 181, 0.36);
}

.switch-control input:checked + .switch-track span {
  background: var(--emerald-300);
  transform: translateX(22px);
}

.switch-control input:focus-visible + .switch-track {
  box-shadow: var(--focus);
}

.switch-control input:disabled + .switch-track {
  cursor: not-allowed;
  opacity: 0.45;
}

.target-control {
  display: grid;
  gap: 10px;
}

.number-stepper {
  display: grid;
  max-width: 356px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  grid-template-columns: 54px minmax(100px, 1fr) 54px;
}

.number-stepper button {
  min-height: 58px;
  padding: 0;
  color: var(--gold-300);
  background: rgba(212, 181, 107, 0.035);
  border: 0;
  cursor: pointer;
  font-size: 20px;
}

.number-stepper button:hover:not(:disabled) {
  color: var(--gold-100);
  background: rgba(212, 181, 107, 0.1);
}

.number-stepper input {
  height: 58px;
  color: var(--paper);
  background: transparent;
  border: 0;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
  border-radius: 0;
  font-family: var(--serif);
  font-size: 31px;
  font-weight: 500;
  text-align: center;
  -moz-appearance: textfield;
}

.number-stepper input::-webkit-inner-spin-button,
.number-stepper input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.target-readout {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--paper-dim);
  font-size: 10px;
}

.target-readout strong {
  color: var(--paper);
  font-family: var(--mono);
}

.target-arrow {
  color: var(--gold-500);
}

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

.reason-field {
  padding-top: 3px;
}

.fleet-form-actions {
  display: flex;
  padding-top: 19px;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
}

.fleet-aside {
  display: grid;
  gap: 13px;
}

.fleet-current-hero {
  display: grid;
  min-height: 132px;
  place-items: center;
  align-content: center;
}

.fleet-current-hero strong {
  font-family: var(--serif);
  font-size: 56px;
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 1;
}

.fleet-current-hero span {
  margin-top: 5px;
  color: var(--paper-dim);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.policy-card {
  position: relative;
  overflow: hidden;
}

.policy-card::after {
  position: absolute;
  top: -32px;
  right: -32px;
  width: 90px;
  height: 90px;
  border: 1px solid rgba(212, 181, 107, 0.12);
  border-radius: 50%;
  content: "";
}

.policy-card > p:not(.eyebrow) {
  margin: 10px 0 18px;
  color: var(--paper-dim);
  font-size: 10px;
}

.policy-row {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid rgba(212, 181, 107, 0.08);
  font-size: 9px;
}

.policy-row span {
  color: var(--paper-dim);
}

.policy-row strong {
  color: var(--paper-muted);
  font-size: 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Audit */

.audit-page-panel {
  min-height: 300px;
}

.empty-state-large {
  min-height: 260px;
}

.empty-state-large h3 {
  margin: 12px 0 0;
  color: var(--paper-muted);
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
}

/* Footer and feedback */

.workspace-footer {
  display: flex;
  margin-top: auto;
  padding: 14px clamp(20px, 3vw, 44px) 20px;
  justify-content: space-between;
  gap: 18px;
  color: var(--paper-dim);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.04em;
}

.confirmation-dialog {
  width: min(calc(100% - 32px), 480px);
  padding: 0;
  color: var(--paper);
  background: transparent;
  border: 0;
}

.confirmation-dialog::backdrop {
  background: rgba(1, 5, 4, 0.78);
  backdrop-filter: blur(8px);
}

.dialog-card {
  position: relative;
  padding: 27px;
  background:
    linear-gradient(145deg, rgba(18, 39, 32, 0.98), rgba(6, 14, 12, 0.99)),
    var(--ink-850);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-medium);
  box-shadow: var(--shadow);
}

.dialog-card h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.dialog-card > p:not(.eyebrow) {
  margin: 10px 0 19px;
  color: var(--paper-dim);
  font-size: 11px;
}

.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--paper-dim);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  place-items: center;
}

.confirmation-summary {
  display: grid;
  margin: 0;
  border-top: 1px solid var(--line);
}

.confirmation-summary > div {
  display: flex;
  min-height: 39px;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  border-bottom: 1px solid var(--line);
}

.confirmation-summary dt {
  color: var(--paper-dim);
  font-size: 10px;
}

.confirmation-summary dd {
  margin: 0;
  color: var(--paper);
  font-family: var(--mono);
  font-size: 10px;
}

.dialog-actions {
  display: flex;
  margin-top: 23px;
  justify-content: flex-end;
  gap: 9px;
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 18px;
  bottom: 18px;
  display: grid;
  width: min(calc(100% - 36px), 360px);
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 13px 15px;
  color: var(--paper);
  background: rgba(14, 29, 24, 0.97);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--emerald-300);
  border-radius: var(--radius-small);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.32);
  font-size: 11px;
  animation: toast-enter 200ms ease both;
}

.toast.is-error {
  border-left-color: var(--ruby-300);
}

@keyframes toast-enter {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
}

.noscript-message {
  position: fixed;
  z-index: 2000;
  right: 16px;
  bottom: 16px;
  left: 16px;
  padding: 14px;
  color: #ffd5d8;
  background: #32151a;
  border: 1px solid var(--ruby-500);
  border-radius: var(--radius-small);
  text-align: center;
}

/* Responsive */

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

  .overview-grid,
  .fleet-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .fleet-pulse-panel {
    display: grid;
    grid-template-columns: 1fr 170px 1fr;
    align-items: center;
    gap: 18px;
  }

  .fleet-pulse-panel .panel-heading {
    align-self: start;
  }

  .fleet-pulse-panel .panel-action {
    margin-top: 12px;
  }

  .fleet-gauge {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .fleet-pulse-panel .compact-definition-list,
  .fleet-pulse-panel .panel-action {
    grid-column: 3;
  }

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

@media (max-width: 820px) {
  :root {
    --sidebar-width: 100%;
  }

  .console-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    display: grid;
    width: 100%;
    height: auto;
    padding: 11px 16px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar::after {
    display: none;
  }

  .sidebar-brand {
    padding: 0;
    border: 0;
  }

  .sidebar-brand .brand-mark {
    width: 30px;
    height: 34px;
    font-size: 20px;
  }

  .sidebar-brand .brand-mark::after {
    bottom: 4px;
    width: 5px;
    height: 6px;
  }

  .sidebar-brand div {
    display: none;
  }

  .primary-nav {
    display: flex;
    margin: 0;
    justify-content: center;
    gap: 4px;
  }

  .nav-item {
    min-height: 38px;
    padding: 0 11px;
    grid-template-columns: auto;
    font-size: 11px;
    text-align: center;
  }

  .nav-index,
  .nav-item.is-active::before {
    display: none;
  }

  .sidebar-foot {
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
  }

  .operator-card {
    display: none;
  }

  .logout-button {
    min-height: 36px;
    padding: 6px 10px;
  }

  .workspace {
    min-height: calc(100vh - 61px);
    margin-left: 0;
  }

  .topbar {
    top: 61px;
    min-height: 76px;
  }

  .connection-state span:last-child {
    display: none;
  }

  .audit-entry {
    grid-template-columns: minmax(100px, 0.75fr) minmax(160px, 1.25fr) auto;
  }
}

@media (max-width: 620px) {
  .login-panel {
    padding: 38px 27px 29px;
  }

  .sidebar {
    padding-inline: 10px;
  }

  .nav-item {
    padding-inline: 8px;
  }

  .topbar {
    padding: 14px 16px;
  }

  .topbar-title .eyebrow {
    display: none;
  }

  .topbar-title h1 {
    font-size: 21px;
  }

  .environment-badge {
    max-width: 86px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .execution-lock {
    margin-inline: 14px;
  }

  .content {
    padding: 18px 14px 32px;
  }

  .metric-grid {
    gap: 9px;
  }

  .metric-card {
    min-height: 141px;
    padding: 16px;
  }

  .metric-head {
    font-size: 9px;
  }

  .metric-value {
    margin-top: 15px;
    font-size: 34px;
  }

  .metric-card p {
    font-size: 9px;
  }

  .rooms-panel,
  .fleet-pulse-panel,
  .audit-preview-panel,
  .audit-page-panel,
  .fleet-form,
  .live-fleet-card,
  .policy-card {
    padding: 17px;
  }

  .fleet-pulse-panel {
    display: flex;
  }

  .fleet-gauge {
    grid-column: auto;
    grid-row: auto;
  }

  .fleet-pulse-panel .compact-definition-list,
  .fleet-pulse-panel .panel-action {
    width: 100%;
  }

  .section-intro {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .revision-plaque {
    min-width: 0;
    text-align: left;
  }

  .constraint-grid,
  .fleet-aside {
    grid-template-columns: minmax(0, 1fr);
  }

  .target-readout {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .target-arrow {
    display: none;
  }

  .fleet-form-actions,
  .dialog-actions {
    flex-direction: column-reverse;
  }

  .fleet-form-actions .button,
  .dialog-actions .button {
    width: 100%;
  }

  .audit-entry {
    padding: 13px 0 13px 27px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px 12px;
  }

  .audit-copy {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .audit-time {
    grid-column: 2;
    grid-row: 1;
  }

  .workspace-footer {
    padding-inline: 16px;
    flex-direction: column;
    gap: 4px;
  }

  .dialog-card {
    padding: 24px 20px 20px;
  }
}

@media (max-width: 430px) {
  .nav-item {
    font-size: 10px;
  }

  .nav-item span:last-child {
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .metric-card p {
    display: none;
  }

  .metric-card {
    min-height: 116px;
  }

  .number-stepper {
    max-width: none;
  }
}

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

@media (prefers-contrast: more) {
  :root {
    --line: rgba(242, 220, 165, 0.34);
    --line-strong: rgba(242, 220, 165, 0.62);
    --paper-muted: #ded6c5;
    --paper-dim: #b8baaf;
  }
}
