:root {
  --ink: #0b0e0b;
  --ink-soft: #10140f;
  --panel: #171b16;
  --panel-raised: #1e241c;
  --line: rgba(236, 239, 225, 0.12);
  --line-strong: rgba(236, 239, 225, 0.22);
  --paper: #f1efe6;
  --muted: #9aa092;
  --muted-dark: #697064;
  --acid: #c8ff4d;
  --acid-deep: #9bd521;
  --orange: #ff7a3d;
  --red: #ff5f56;
  --cyan: #4ee4d0;
  --amber: #ffc857;
  --font-display: "Syne", sans-serif;
  --font-body: "Manrope", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
  --radius-sm: 0.55rem;
  --radius-md: 0.9rem;
  --radius-lg: 1.3rem;
  --shadow: 0 1.5rem 5rem rgba(0, 0, 0, 0.3);
  --sidebar-width: 16.5rem;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  min-width: 20rem;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
}

button,
input,
textarea,
select {
  color: inherit;
  font: inherit;
}

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

button,
a {
  touch-action: manipulation;
}

button {
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

textarea {
  resize: vertical;
}

code,
kbd {
  font-family: var(--font-mono);
}

::selection {
  background: var(--acid);
  color: var(--ink);
}

.hidden {
  display: none !important;
}

.ambient-grid {
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 2.75rem 2.75rem;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

.ambient-glow {
  position: fixed;
  z-index: -2;
  width: 34rem;
  height: 34rem;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(7rem);
  opacity: 0.12;
}

.glow-one {
  top: -12rem;
  right: -10rem;
  background: var(--acid);
}

.glow-two {
  bottom: -16rem;
  left: 22%;
  background: var(--orange);
}

.eyebrow,
.panel-index,
.micro-label {
  color: var(--acid);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.button {
  min-height: 2.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 700;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease, opacity 160ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

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

.button:disabled {
  cursor: wait;
  opacity: 0.55;
  transform: none;
}

.button-primary {
  background: var(--acid);
  color: var(--ink);
  box-shadow: 0 0.75rem 2rem rgba(200, 255, 77, 0.12);
}

.button-primary:hover {
  background: #dcff89;
}

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

.button-accent {
  background: var(--orange);
  color: #1a0c06;
}

.button-danger {
  background: rgba(255, 95, 86, 0.1);
  border-color: rgba(255, 95, 86, 0.35);
  color: #ff8d87;
}

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

.button-ghost:hover {
  border-color: var(--line-strong);
  color: var(--paper);
}

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

.button-wide {
  width: 100%;
}

.button-small {
  min-height: 2.6rem;
  padding: 0.6rem 0.85rem;
}

.icon-button {
  width: 2.9rem;
  min-width: 2.9rem;
  height: 2.9rem;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.icon-button:hover {
  border-color: var(--acid);
  color: var(--acid);
  transform: rotate(-5deg);
}

/* Authentication */
.auth-gate {
  min-height: 100vh;
  display: grid;
  background: rgba(11, 14, 11, 0.82);
}

.auth-poster {
  position: relative;
  min-height: 18rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem;
  background:
    linear-gradient(135deg, rgba(200, 255, 77, 0.15), transparent 45%),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 0.7rem),
    #141912;
  border-bottom: 1px solid var(--line);
}

.auth-poster::before {
  content: "ROOM\A CTRL";
  white-space: pre;
  position: absolute;
  top: -1.3rem;
  right: -0.75rem;
  color: rgba(255, 255, 255, 0.025);
  font-family: var(--font-display);
  font-size: clamp(7rem, 28vw, 13rem);
  font-weight: 800;
  line-height: 0.72;
  letter-spacing: -0.08em;
  text-align: right;
}

.brand-mark {
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  transform: rotate(8deg);
  border-radius: 0.55rem 0.1rem 0.55rem 0.1rem;
  background: var(--acid);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
}

.brand-mark span {
  transform: rotate(-8deg);
}

.brand-mark-large {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  width: 3.6rem;
  height: 3.6rem;
  font-size: 1.8rem;
}

.auth-poster h1 {
  position: relative;
  max-width: 13ch;
  margin-top: 0.8rem;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 9vw, 5.6rem);
  line-height: 0.94;
  letter-spacing: -0.055em;
}

.auth-poster h1 em {
  color: var(--acid);
  font-style: normal;
}

.auth-copy {
  position: relative;
  max-width: 38rem;
  margin-top: 1rem;
  color: var(--muted);
}

.poster-readout {
  position: relative;
  display: none;
  gap: 1rem;
  margin-top: 2rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.poster-readout span {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.poster-readout i {
  color: var(--acid);
}

.auth-panel {
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}

.auth-card {
  width: min(100%, 29rem);
  padding: 1.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(23, 27, 22, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(1.5rem);
}

.auth-card-head h2 {
  margin-top: 0.45rem;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 7vw, 2.7rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.auth-card-head p {
  margin-top: 0.7rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.auth-form {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.auth-form label,
.field-group label,
.credential-form label,
.label-row label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field-shell {
  min-height: 3.2rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0 0.95rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.18);
}

.field-shell:focus-within {
  border-color: var(--acid);
}

.field-shell i {
  color: var(--muted);
}

.field-shell input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 1.25rem 0;
  color: var(--muted-dark);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.auth-status {
  min-height: 1.5rem;
  margin-top: 1rem;
  color: var(--acid);
  font-size: 0.82rem;
  text-align: center;
}

.auth-footnote {
  margin-top: 1rem;
  color: var(--muted-dark);
  font-size: 0.73rem;
  text-align: center;
}

.setup-notice {
  display: flex;
  gap: 0.8rem;
  margin-top: 1.2rem;
  padding: 0.85rem;
  border: 1px solid rgba(255, 200, 87, 0.3);
  border-radius: var(--radius-sm);
  background: rgba(255, 200, 87, 0.08);
  color: var(--amber);
}

.setup-notice p {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.8rem;
}

/* Application shell */
.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  width: min(86vw, var(--sidebar-width));
  display: flex;
  flex-direction: column;
  padding: 1.2rem;
  border-right: 1px solid var(--line);
  background: rgba(12, 15, 12, 0.98);
  transform: translateX(-102%);
  transition: transform 220ms ease;
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-height: 3.5rem;
}

.sidebar-brand strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: -0.025em;
}

.sidebar-brand small {
  display: block;
  color: var(--muted-dark);
  font-family: var(--font-mono);
  font-size: 0.59rem;
  letter-spacing: 0.16em;
}

.sidebar-nav {
  display: grid;
  gap: 0.4rem;
  margin-top: 3rem;
}

.nav-link {
  min-height: 3.2rem;
  display: grid;
  grid-template-columns: 1.5rem 1fr auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0 0.85rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.86rem;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.nav-link i {
  text-align: center;
}

.nav-link b {
  color: var(--muted-dark);
  font-family: var(--font-mono);
  font-size: 0.62rem;
}

.nav-link:hover,
.nav-link.active {
  border-color: var(--line);
  background: var(--panel);
  color: var(--paper);
}

.nav-link.active i {
  color: var(--acid);
}

.sidebar-foot {
  margin-top: auto;
}

.server-pulse {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
}

.pulse-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 0 0.35rem rgba(200, 255, 77, 0.08), 0 0 1rem rgba(200, 255, 77, 0.45);
}

.server-pulse small,
.server-pulse strong {
  display: block;
}

.server-pulse small {
  color: var(--muted-dark);
  font-family: var(--font-mono);
  font-size: 0.58rem;
}

.server-pulse strong {
  font-size: 0.78rem;
}

.build-tag {
  display: block;
  margin-top: 1rem;
  color: var(--muted-dark);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-align: center;
}

.sidebar-scrim {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(0.25rem);
}

.sidebar-scrim.visible {
  display: block;
}

.main-stage {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 4.7rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 14, 11, 0.86);
  backdrop-filter: blur(1.1rem);
}

.breadcrumb {
  display: none;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
}

.breadcrumb span,
.breadcrumb i {
  color: var(--muted-dark);
}

.topbar-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.mode-chip {
  min-height: 2.2rem;
  display: none;
  align-items: center;
  gap: 0.4rem;
  padding: 0 0.7rem;
  border: 1px solid var(--line);
  border-radius: 99rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 600;
}

.mode-chip i {
  color: var(--acid);
}

.admin-profile {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.admin-avatar {
  width: 2.7rem;
  min-width: 2.7rem;
  height: 2.7rem;
  display: grid;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--panel-raised);
  color: var(--acid);
  font-family: var(--font-display);
  font-weight: 700;
  background-position: center;
  background-size: cover;
}

.admin-copy {
  display: none;
}

.admin-copy strong,
.admin-copy small {
  display: block;
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-copy strong {
  font-size: 0.78rem;
}

.admin-copy small {
  color: var(--muted-dark);
  font-size: 0.66rem;
}

.content-wrap {
  width: min(100%, 98rem);
  margin: 0 auto;
  padding: 2rem 1rem 1.5rem;
}

.hero-section {
  display: grid;
  gap: 1.5rem;
  align-items: end;
  padding: 0.5rem 0 2.2rem;
}

.hero-copy h1 {
  max-width: 13ch;
  margin-top: 0.65rem;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 12vw, 6.5rem);
  line-height: 0.9;
  letter-spacing: -0.065em;
}

.hero-copy h1 span {
  color: transparent;
  -webkit-text-stroke: 1px rgba(241, 239, 230, 0.46);
}

.hero-copy p {
  max-width: 42rem;
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.hero-actions .button {
  flex: 1 1 12rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.metric-card {
  position: relative;
  min-height: 10.3rem;
  overflow: hidden;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.035), transparent 60%), var(--panel);
}

.metric-card::after {
  content: "";
  position: absolute;
  right: -2rem;
  bottom: -2rem;
  width: 6rem;
  height: 6rem;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.metric-featured {
  border-color: rgba(200, 255, 77, 0.26);
  background: linear-gradient(145deg, rgba(200, 255, 77, 0.12), transparent 58%), var(--panel);
}

.metric-icon {
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  margin-bottom: 1rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--acid);
}

.metric-card > span {
  display: block;
  color: var(--muted-dark);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
}

.metric-card > strong {
  display: block;
  margin-top: 0.18rem;
  font-family: var(--font-display);
  font-size: 1.55rem;
  line-height: 1;
}

.metric-card > small {
  display: block;
  margin-top: 0.4rem;
  color: var(--muted);
  font-size: 0.7rem;
}

.workspace-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.024), transparent 48%), var(--panel);
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.12);
}

.panel-head {
  min-height: 5.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  margin-top: 0.2rem;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 5vw, 1.75rem);
  letter-spacing: -0.035em;
}

.health-badge,
.connection-led {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 99rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
}

.health-badge span,
.connection-led i {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--muted-dark);
}

.health-badge.live {
  border-color: rgba(200, 255, 77, 0.32);
  color: var(--acid);
}

.health-badge.live span,
.connection-led.online i {
  background: var(--acid);
  box-shadow: 0 0 0.7rem rgba(200, 255, 77, 0.7);
}

.health-badge.die {
  border-color: rgba(255, 95, 86, 0.32);
  color: var(--red);
}

.health-badge.die span {
  background: var(--red);
  box-shadow: 0 0 0.7rem rgba(255, 95, 86, 0.6);
}

.health-badge.offline {
  color: var(--amber);
}

.account-readout {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  padding: 1.15rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.12);
}

.account-orb {
  position: relative;
  width: 4.7rem;
  height: 4.7rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.12), transparent 45%), #222820;
}

.account-orb::before,
.account-orb::after {
  content: "";
  position: absolute;
  inset: 0.45rem;
  border: 1px dashed var(--line-strong);
  border-radius: 50%;
  animation: spin 12s linear infinite;
}

.account-orb::after {
  inset: 1.2rem;
  border-style: solid;
  animation-direction: reverse;
  animation-duration: 7s;
}

.account-orb span {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: var(--muted-dark);
}

.account-orb-avatar {
  position: relative;
  z-index: 1;
  width: 3rem;
  height: 3rem;
  display: none;
  border: 2px solid rgba(241, 239, 230, 0.72);
  border-radius: 50%;
  background: var(--panel-raised);
  object-fit: cover;
  box-shadow: 0 0 0 0.28rem rgba(11, 14, 11, 0.75), 0 0 1.4rem rgba(200, 255, 77, 0.2);
}

.account-orb.has-avatar .account-orb-avatar {
  display: block;
}

.account-orb.has-avatar > span {
  display: none;
}

.account-orb.live span {
  background: var(--acid);
  box-shadow: 0 0 1.2rem var(--acid);
}

.account-orb.die span {
  background: var(--red);
  box-shadow: 0 0 1.2rem var(--red);
}

.account-orb.offline span {
  background: var(--amber);
  box-shadow: 0 0 1.2rem var(--amber);
}

.account-identity {
  min-width: 0;
}

.account-identity small {
  color: var(--muted-dark);
  font-family: var(--font-mono);
  font-size: 0.61rem;
  letter-spacing: 0.1em;
}

.account-identity h3 {
  overflow: hidden;
  margin-top: 0.15rem;
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 5vw, 1.55rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-identity p {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.account-identity code {
  display: block;
  overflow: hidden;
  margin-top: 0.45rem;
  color: var(--muted-dark);
  font-size: 0.66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.credential-form {
  padding: 1rem;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.label-row span {
  color: var(--muted-dark);
  font-size: 0.63rem;
  text-align: right;
}

.credential-shell {
  position: relative;
}

.credential-shell textarea,
.field-group input,
.field-group textarea,
.field-group select,
.inline-field input {
  width: 100%;
  min-height: 3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: 0;
  background: rgba(0, 0, 0, 0.2);
  color: var(--paper);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.credential-shell textarea {
  min-height: 9rem;
  padding: 0.85rem;
  padding-bottom: 2.7rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  line-height: 1.65;
}

.credential-shell textarea:focus,
.field-group input:focus,
.field-group textarea:focus,
.field-group select:focus,
.inline-field input:focus {
  border-color: rgba(200, 255, 77, 0.65);
  box-shadow: 0 0 0 0.2rem rgba(200, 255, 77, 0.07);
}

::placeholder {
  color: #596056;
}

.paste-hint {
  position: absolute;
  right: 0.65rem;
  bottom: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--muted-dark);
  font-size: 0.6rem;
}

.paste-hint kbd {
  padding: 0.18rem 0.35rem;
  border: 1px solid var(--line);
  border-bottom-color: var(--line-strong);
  border-radius: 0.25rem;
  background: var(--panel-raised);
  color: var(--muted);
}

.paste-hint span {
  margin-left: 0.25rem;
  color: var(--acid);
  font-family: var(--font-mono);
  text-transform: uppercase;
}

.check-row {
  min-height: 2.8rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  color: var(--muted);
  font-family: var(--font-body) !important;
  font-size: 0.76rem !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

.check-row input {
  position: absolute;
  opacity: 0;
}

.custom-check {
  width: 1.25rem;
  height: 1.25rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 0.25rem;
  color: transparent;
  font-size: 0.62rem;
}

.check-row input:checked + .custom-check {
  border-color: var(--acid);
  background: var(--acid);
  color: var(--ink);
}

.button-row {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.5rem;
}

.voice-panel {
  padding-bottom: 1rem;
}

.voice-panel > :not(.panel-head) {
  margin-right: 1rem;
  margin-left: 1rem;
}

.voice-visual {
  min-height: 9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at 50% 120%, rgba(78, 228, 208, 0.16), transparent 55%),
    rgba(0, 0, 0, 0.17);
}

.voice-visual span {
  max-width: 90%;
  overflow: hidden;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wave-bars {
  height: 3.7rem;
  display: flex;
  align-items: center;
  gap: 0.28rem;
}

.wave-bars i {
  width: 0.28rem;
  height: 18%;
  border-radius: 99rem;
  background: var(--muted-dark);
}

.voice-panel.connected .wave-bars i {
  background: var(--cyan);
  animation: wave 850ms ease-in-out infinite alternate;
}

.voice-panel.connected .wave-bars i:nth-child(2n) { animation-delay: -320ms; }
.voice-panel.connected .wave-bars i:nth-child(3n) { animation-delay: -520ms; }
.voice-panel.connected .wave-bars i:nth-child(4n) { animation-delay: -120ms; }

.voice-panel .field-group {
  margin-top: 1rem;
}

.field-group {
  display: grid;
  gap: 0.45rem;
}

.field-group label {
  color: var(--muted);
}

.field-group input,
.field-group textarea,
.field-group select,
.inline-field input {
  padding: 0.75rem 0.85rem;
}

.field-group select {
  cursor: pointer;
}

.inline-field {
  display: grid;
  gap: 0.55rem;
}

.toggle-stack {
  display: grid;
  margin-top: 1rem;
  border-top: 1px solid var(--line);
}

.toggle-row {
  min-height: 4.3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.toggle-row span b,
.toggle-row span small {
  display: block;
}

.toggle-row span b {
  font-size: 0.82rem;
}

.toggle-row span small {
  margin-top: 0.15rem;
  color: var(--muted-dark);
  font-size: 0.68rem;
}

.toggle-row input,
.command-switch input {
  position: absolute;
  opacity: 0;
}

.toggle-row > i,
.command-switch i {
  position: relative;
  width: 2.7rem;
  min-width: 2.7rem;
  height: 1.5rem;
  border: 1px solid var(--line-strong);
  border-radius: 99rem;
  background: #0c0f0c;
  transition: background 160ms ease, border-color 160ms ease;
}

.toggle-row > i::after,
.command-switch i::after {
  content: "";
  position: absolute;
  top: 0.2rem;
  left: 0.22rem;
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 50%;
  background: var(--muted-dark);
  transition: transform 160ms ease, background 160ms ease;
}

.toggle-row input:checked + i,
.command-switch input:checked + i {
  border-color: var(--acid);
  background: rgba(200, 255, 77, 0.12);
}

.toggle-row input:checked + i::after,
.command-switch input:checked + i::after {
  transform: translateX(1.15rem);
  background: var(--acid);
}

.voice-panel > .button-wide {
  margin-top: 1rem;
  width: calc(100% - 2rem);
}

/* Command studio */
.command-panel,
.log-panel {
  margin-top: 1rem;
}

.command-head {
  align-items: flex-end;
}

.command-head .button {
  flex: 0 0 auto;
}

.command-layout {
  display: grid;
}

.command-settings,
.command-catalog {
  min-width: 0;
  padding: 1rem;
}

.command-settings {
  display: grid;
  align-content: start;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
}

.prefix-display {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
  border: 1px solid rgba(200, 255, 77, 0.26);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(200, 255, 77, 0.09), transparent 65%);
}

.prefix-display > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.prefix-display span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
}

.prefix-display input {
  width: 4.2rem;
  height: 3.6rem;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--acid);
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  text-align: right;
}

.prefix-display code {
  overflow: hidden;
  padding: 0.7rem;
  border-radius: 0.4rem;
  background: rgba(0, 0, 0, 0.22);
  color: var(--muted);
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 0.8rem;
}

.catalog-head span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.catalog-head small {
  color: var(--muted-dark);
  font-size: 0.65rem;
  text-align: right;
}

.command-grid {
  display: grid;
  gap: 0.55rem;
}

.command-card {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.13);
  transition: border-color 160ms ease, background 160ms ease;
}

.command-card.enabled {
  border-color: rgba(200, 255, 77, 0.2);
  background: rgba(200, 255, 77, 0.035);
}

.command-symbol {
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  color: var(--acid);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.command-copy {
  min-width: 0;
}

.command-copy strong,
.command-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.command-copy strong {
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.command-copy small {
  margin-top: 0.12rem;
  color: var(--muted-dark);
  font-size: 0.65rem;
}

.command-switch {
  min-width: 2.9rem;
  min-height: 2.9rem;
  display: grid;
  place-items: center;
  cursor: pointer;
}

/* Console */
.console-toolbar {
  min-height: 2.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: #090b09;
}

.console-toolbar > span {
  display: flex;
  gap: 0.35rem;
}

.console-dot {
  width: 0.55rem;
  height: 0.55rem;
  display: block;
  border-radius: 50%;
}

.console-dot.red { background: var(--red); }
.console-dot.amber { background: var(--amber); }
.console-dot.green { background: var(--acid); }

.console-toolbar code,
.console-toolbar b {
  color: var(--muted-dark);
  font-family: var(--font-mono);
  font-size: 0.6rem;
}

.console-toolbar code {
  display: none;
}

.console-box {
  height: 19rem;
  overflow: auto;
  padding: 0.55rem 0;
  background:
    linear-gradient(90deg, rgba(200, 255, 77, 0.03), transparent 15%),
    #090b09;
  font-family: var(--font-mono);
}

.log-entry {
  display: grid;
  grid-template-columns: 4.8rem 4rem minmax(0, 1fr);
  gap: 0.55rem;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.035);
  font-size: 0.68rem;
  line-height: 1.55;
}

.log-entry time {
  color: #4e554c;
}

.log-entry p {
  min-width: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.log-type {
  color: #6e756a;
  font-weight: 600;
}

.log-entry.success .log-type,
.log-entry.success p { color: var(--acid); }
.log-entry.error .log-type,
.log-entry.error p { color: #ff8d87; }
.log-entry.warn .log-type,
.log-entry.warn p { color: var(--amber); }
.log-entry.system .log-type { color: var(--cyan); }

.page-footer {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 2rem 0 0.5rem;
  color: var(--muted-dark);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
}

/* Feedback */
.toast-stack {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 100;
  width: min(calc(100% - 2rem), 23rem);
  display: grid;
  gap: 0.6rem;
}

.toast {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(23, 27, 22, 0.96);
  box-shadow: var(--shadow);
  animation: toast-in 220ms ease both;
  backdrop-filter: blur(1rem);
}

.toast > i {
  color: var(--acid);
}

.toast.error > i { color: var(--red); }
.toast.warn > i { color: var(--amber); }

.toast strong,
.toast small {
  display: block;
}

.toast strong {
  font-size: 0.8rem;
}

.toast small {
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.68rem;
}

.toast button {
  width: 2.5rem;
  height: 2.5rem;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.is-spinning {
  animation: spin 700ms linear infinite;
}

.reveal {
  animation: reveal-up 600ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.delay-1 { animation-delay: 70ms; }
.delay-2 { animation-delay: 140ms; }
.delay-3 { animation-delay: 210ms; }

@keyframes reveal-up {
  from { opacity: 0; transform: translateY(1.25rem); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(1rem); }
  to { opacity: 1; transform: translateX(0); }
}

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

@keyframes wave {
  from { height: 16%; opacity: 0.55; }
  to { height: 100%; opacity: 1; }
}

@media (min-width: 640px) {
  .auth-poster,
  .auth-panel,
  .content-wrap {
    padding-right: 1.5rem;
    padding-left: 1.5rem;
  }

  .poster-readout {
    display: flex;
    flex-wrap: wrap;
  }

  .auth-card {
    padding: 1.8rem;
  }

  .breadcrumb,
  .mode-chip,
  .admin-copy {
    display: flex;
  }

  .mobile-menu-button {
    margin-right: 0.35rem;
  }

  .topbar {
    padding-right: 1.5rem;
    padding-left: 1.5rem;
  }

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

  .button-row {
    grid-template-columns: 1.35fr 1fr 0.8fr;
  }

  .inline-field {
    grid-template-columns: minmax(0, 1fr) auto;
  }

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

  .console-toolbar code {
    display: block;
  }

  .page-footer {
    flex-direction: row;
    justify-content: space-between;
  }
}

@media (min-width: 768px) {
  .auth-poster,
  .auth-panel,
  .content-wrap {
    padding-right: 2rem;
    padding-left: 2rem;
  }

  .hero-section {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .hero-actions {
    max-width: 19rem;
    justify-content: flex-end;
  }

  .hero-actions .button {
    flex-basis: auto;
  }

  .account-readout,
  .credential-form,
  .command-settings,
  .command-catalog {
    padding: 1.3rem;
  }

  .panel-head {
    padding: 1.15rem 1.3rem;
  }

  .voice-panel > :not(.panel-head) {
    margin-right: 1.3rem;
    margin-left: 1.3rem;
  }

  .voice-panel > .button-wide {
    width: calc(100% - 2.6rem);
  }
}

@media (min-width: 1024px) {
  .auth-gate {
    grid-template-columns: minmax(0, 1.25fr) minmax(25rem, 0.75fr);
  }

  .auth-poster {
    min-height: 100vh;
    padding: 3rem;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .brand-mark-large {
    top: 3rem;
    left: 3rem;
  }

  .auth-panel {
    padding: 3rem;
  }

  .app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  }

  .sidebar {
    position: sticky;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    transform: none;
  }

  .sidebar-scrim,
  .mobile-menu-button {
    display: none !important;
  }

  .content-wrap {
    padding-top: 2.5rem;
  }

  .command-layout {
    grid-template-columns: minmax(17rem, 0.78fr) minmax(0, 1.22fr);
  }

  .command-settings {
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }
}

@media (min-width: 1280px) {
  .content-wrap {
    padding-right: 2.5rem;
    padding-left: 2.5rem;
  }

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

  .workspace-grid {
    grid-template-columns: minmax(0, 1.55fr) minmax(22rem, 0.85fr);
  }

  .account-panel,
  .voice-panel {
    min-height: 39rem;
  }
}

@media (min-width: 1536px) {
  .metric-card {
    min-height: 11rem;
    padding: 1.2rem;
  }

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

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

::-webkit-scrollbar {
  width: 0.55rem;
  height: 0.55rem;
}

::-webkit-scrollbar-track {
  background: #090b09;
}

::-webkit-scrollbar-thumb {
  border: 2px solid #090b09;
  border-radius: 99rem;
  background: #3c4339;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--muted-dark);
}
