:root {
  color-scheme: dark;
  background-color: #080b0c;
  --bg: #080b0c;
  --surface: #101516;
  --surface-2: #151b1c;
  --line: rgba(232, 238, 230, 0.11);
  --line-strong: rgba(232, 238, 230, 0.2);
  --text: #edf1eb;
  --muted: #929b95;
  --accent: #c8ff73;
  --accent-soft: rgba(200, 255, 115, 0.12);
  --gold: #e7c979;
  --red: #ff867d;
  --simulation: #c59aff;
  --simulation-soft: rgba(197, 154, 255, 0.12);
  --mood: #7edfc0;
  --mood-rgb: 126, 223, 192;
  --mood-secondary-rgb: 200, 255, 115;
  --mood-soft: rgba(var(--mood-rgb), 0.1);
  --mood-line: rgba(var(--mood-rgb), 0.25);
  --radius: 22px;
  --mono: "Cascadia Code", "SFMono-Regular", "Roboto Mono", Consolas, monospace;
  --sans:
    "Segoe UI Variable Text", "SF Pro Text", Inter, Roboto, "Segoe UI",
    Arial, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --glass-shadow:
    0 24px 70px rgba(0, 0, 0, 0.2),
    inset 0 1px rgba(255, 255, 255, 0.035);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background-color: #080b0c;
  background-color: var(--bg);
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--text);
  font-family: var(--sans);
  font-feature-settings: "kern" 1, "liga" 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #080b0c;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 8% -10%, rgba(200, 255, 115, 0.12), transparent 30rem),
    radial-gradient(circle at 96% 15%, rgba(70, 113, 96, 0.12), transparent 28rem);
  background-repeat: no-repeat;
}

.atmosphere {
  position: fixed;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.atmosphere::before {
  position: absolute;
  inset: 0;
  content: "";
  opacity: 0.34;
  background:
    linear-gradient(115deg, transparent 14%, rgba(var(--mood-rgb), 0.035) 44%, transparent 70%),
    radial-gradient(circle at 50% 110%, rgba(var(--mood-secondary-rgb), 0.08), transparent 48%);
  transition: opacity 0.8s ease, background 0.8s ease;
}

.atmosphere-orb,
.atmosphere-ring,
.atmosphere-sweep {
  position: absolute;
  display: block;
  will-change: opacity, transform;
}

.atmosphere-orb {
  width: min(54rem, 75vw);
  aspect-ratio: 1;
  border-radius: 50%;
  opacity: 0.15;
  filter: blur(75px);
  transition:
    background 0.8s ease,
    opacity 0.8s ease,
    transform 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.atmosphere-orb-primary {
  top: -36rem;
  left: -16rem;
  background: rgba(var(--mood-rgb), 0.78);
}

.atmosphere-orb-secondary {
  right: -22rem;
  bottom: -39rem;
  background: rgba(var(--mood-secondary-rgb), 0.62);
}

.atmosphere-ring {
  top: 8%;
  right: 4%;
  width: min(34rem, 48vw);
  aspect-ratio: 1;
  border: 1px solid rgba(var(--mood-rgb), 0.09);
  border-radius: 50%;
  opacity: 0.5;
  box-shadow:
    0 0 0 80px rgba(var(--mood-rgb), 0.018),
    0 0 0 160px rgba(var(--mood-rgb), 0.012);
  transition: border-color 0.8s ease, opacity 0.8s ease;
}

.atmosphere-sweep {
  top: -40%;
  left: 44%;
  width: 1px;
  height: 180%;
  opacity: 0.25;
  background: linear-gradient(transparent, rgba(var(--mood-rgb), 0.42), transparent);
  box-shadow: 0 0 28px rgba(var(--mood-rgb), 0.16);
  transform: rotate(26deg);
}

body[data-stage="registration"] {
  --mood: #e7c979;
  --mood-rgb: 231, 201, 121;
  --mood-secondary-rgb: 126, 223, 192;
}

body[data-stage="voting"],
body[data-stage="finalizing"] {
  --mood: #70d9ff;
  --mood-rgb: 112, 217, 255;
  --mood-secondary-rgb: 200, 255, 115;
}

body[data-stage="discussion"],
body[data-stage="discussion-type"] {
  --mood: #c59aff;
  --mood-rgb: 197, 154, 255;
  --mood-secondary-rgb: 112, 217, 255;
}

body[data-stage="paused"] {
  --mood: #e7c979;
  --mood-rgb: 231, 201, 121;
  --mood-secondary-rgb: 255, 134, 125;
}

body[data-mode="simulation"][data-outcome="pending"] {
  --mood: var(--simulation);
  --mood-rgb: 197, 154, 255;
  --mood-secondary-rgb: 112, 217, 255;
}

body[data-outcome="accepted"] {
  --mood: #c8ff73;
  --mood-rgb: 200, 255, 115;
  --mood-secondary-rgb: 231, 201, 121;
}

body[data-outcome="rejected"] {
  --mood: #ff867d;
  --mood-rgb: 255, 134, 125;
  --mood-secondary-rgb: 204, 72, 84;
}

body[data-outcome="vetoed"] {
  --mood: #ffad67;
  --mood-rgb: 255, 173, 103;
  --mood-secondary-rgb: 255, 86, 102;
}

body[data-outcome="oral"] {
  --mood: #70d9ff;
  --mood-rgb: 112, 217, 255;
  --mood-secondary-rgb: 231, 201, 121;
}

body[data-outcome="accepted"] .atmosphere-orb,
body[data-outcome="rejected"] .atmosphere-orb,
body[data-outcome="vetoed"] .atmosphere-orb,
body[data-outcome="oral"] .atmosphere-orb {
  opacity: 0.23;
}

.noise {
  position: fixed;
  z-index: 1;
  inset: 0;
  opacity: 0.025;
  pointer-events: none;
  background-image: repeating-radial-gradient(
    circle at 20% 20%,
    rgba(255, 255, 255, 0.7) 0 0.4px,
    transparent 0.5px 4px
  );
}

.shell {
  position: relative;
  z-index: 2;
  width: min(1480px, calc(100% - 48px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  margin-bottom: 48px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 12px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--bg);
  background: var(--accent);
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 0.9rem;
  letter-spacing: 0.16em;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
}

.connection {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
}

.topbar-tools {
  display: flex;
  align-items: center;
  gap: 18px;
}

.panel-switch {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 9px;
  padding: 0 14px;
  border: 1px solid rgba(200, 255, 115, 0.28);
  border-radius: 12px;
  color: var(--text);
  background: rgba(200, 255, 115, 0.075);
  font-size: 0.72rem;
  text-decoration: none;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.panel-switch:hover {
  border-color: rgba(200, 255, 115, 0.54);
  background: rgba(200, 255, 115, 0.13);
  transform: translateY(-1px);
}

.panel-switch > span {
  color: var(--accent);
  font-size: 1rem;
}

.viewer-chip {
  display: grid;
  grid-template-columns: auto auto;
  gap: 2px 9px;
  align-items: center;
  padding: 8px 10px 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(16, 21, 22, 0.82);
}

.viewer-chip span {
  grid-column: 1;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.viewer-chip strong {
  grid-column: 1;
  max-width: 180px;
  overflow: hidden;
  font-size: 0.73rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-chip a {
  grid-column: 2;
  grid-row: 1 / 3;
  color: var(--muted);
  font-size: 0.66rem;
  text-decoration: none;
}

.connection time {
  margin-left: 14px;
  color: var(--text);
}

.connection-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(231, 201, 121, 0.08);
}

.connection-dot.online {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.connection-dot.offline {
  background: var(--red);
}

.public-data-loading {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  background: rgba(8, 11, 12, 0.88);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.public-data-loading[hidden] {
  display: none;
}

.public-data-loading > span:last-child {
  display: grid;
  gap: 3px;
}

.public-data-loading strong {
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 800;
}

.public-data-loading small {
  color: var(--muted);
  font-size: 0.72rem;
}

.public-data-spinner {
  width: 38px;
  height: 38px;
  border: 2px solid rgba(200, 255, 115, 0.18);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: public-data-spin 0.8s linear infinite;
}

@keyframes public-data-spin {
  to { transform: rotate(360deg); }
}

.login-card {
  width: min(620px, 100%);
  margin: 12vh auto 0;
  padding: clamp(28px, 5vw, 54px);
  border: 1px solid var(--line);
  border-radius: 30px;
  background: linear-gradient(145deg, rgba(21, 27, 28, 0.96), rgba(12, 16, 17, 0.96));
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.35);
}

.login-card h1,
.hero h1 {
  margin: 10px 0 14px;
  font-size: clamp(2.1rem, 5vw, 4rem);
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.login-card p,
.hero p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

.login-card form {
  margin-top: 32px;
}

.login-card p strong {
  color: var(--text);
}

.account-login-button {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  margin-top: 26px;
  padding: 0 17px;
  border: 1px solid rgba(200, 255, 115, 0.42);
  border-radius: 14px;
  color: #0b1009;
  background: var(--accent);
  font-size: 0.82rem;
  font-weight: 850;
  text-decoration: none;
}

.login-guide {
  display: grid;
  grid-template-columns: 34px 120px minmax(0, 1fr);
  gap: 10px 12px;
  align-items: center;
  margin-top: 30px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(8, 11, 12, 0.5);
}

.login-guide span {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.68rem;
}

.login-guide b {
  font-size: 0.78rem;
}

.login-guide i {
  color: var(--muted);
  font-size: 0.74rem;
  font-style: normal;
}

.legacy-login {
  margin-top: 22px;
  color: var(--muted);
}

.legacy-login summary {
  cursor: pointer;
  font-size: 0.74rem;
}

.legacy-login form {
  margin-top: 16px;
}

label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-row {
  display: flex;
  gap: 10px;
}

input,
button {
  min-height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  font: inherit;
  transition:
    color 0.18s ease,
    border-color 0.18s ease,
    background-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

input {
  min-width: 0;
  flex: 1;
  padding: 0 15px;
  color: var(--text);
  outline: none;
  background: #0a0e0f;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

button {
  padding: 0 20px;
  color: #0a0d0b;
  background: var(--accent);
  cursor: pointer;
  font-weight: 800;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button:active:not(:disabled) {
  transform: translateY(0);
}

:where(a, button, input, summary):focus-visible {
  outline: 2px solid var(--mood);
  outline-offset: 3px;
}

.sr-only {
  position: fixed;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.form-error {
  display: block;
  min-height: 20px;
  margin-top: 10px;
  color: var(--red);
  font-size: 0.85rem;
}

.dashboard {
  display: grid;
  gap: 20px;
}

.mode-toolbar {
  display: flex;
  min-height: 66px;
  padding: 10px 12px 10px 18px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(16, 21, 22, 0.78);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.mode-toolbar span,
.mode-toolbar small {
  display: block;
}

.mode-toolbar span {
  font-size: 0.78rem;
  font-weight: 800;
}

.mode-toolbar small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.7rem;
}

.mode-switch {
  display: flex;
  gap: 5px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #090d0e;
}

.mode-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.library-button {
  min-height: 44px;
  padding: 0 14px;
  border-color: var(--line);
  color: var(--text);
  background: var(--surface-2);
  font-size: 0.72rem;
}

.library-button:hover {
  border-color: rgba(200, 255, 115, 0.32);
  color: var(--accent);
}

.mode-switch button {
  min-height: 36px;
  padding: 0 15px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font-size: 0.74rem;
}

.mode-switch button.active {
  color: var(--bg);
  background: var(--accent);
}

.mode-switch button[data-mode="simulation"].active {
  background: var(--simulation);
}

.mode-switch button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.simulation-banner {
  display: flex;
  padding: 15px 18px;
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(197, 154, 255, 0.28);
  border-radius: 16px;
  color: #eadcff;
  background: var(--simulation-soft);
  font-size: 0.78rem;
}

.simulation-banner strong {
  flex: 0 0 auto;
  color: var(--simulation);
}

.simulation-mode .eyebrow,
.simulation-mode .text-link,
.simulation-mode .privacy-note span,
.simulation-mode .counter,
.simulation-mode .vote-state.done {
  color: var(--simulation);
}

.simulation-mode .stage-badge {
  border-color: rgba(197, 154, 255, 0.28);
  color: var(--simulation);
  background: var(--simulation-soft);
}

.operator-panel {
  position: relative;
  overflow: hidden;
  border-color: rgba(200, 255, 115, 0.18);
}

.operator-panel::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  content: "";
  background: var(--accent);
}

.simulation-mode .operator-panel {
  border-color: rgba(197, 154, 255, 0.24);
}

.simulation-mode .operator-panel::before {
  background: var(--simulation);
}

.operator-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.operator-heading h2 {
  margin: 7px 0 5px;
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
}

.operator-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.operator-lock {
  flex: 0 0 auto;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.62rem;
}

.operator-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.control-group {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(8, 11, 12, 0.42);
}

.control-group strong,
.control-group small {
  display: block;
}

.control-group strong {
  font-size: 0.8rem;
}

.control-group small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.67rem;
  line-height: 1.45;
}

.control-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.control-button {
  min-height: 38px;
  padding: 0 13px;
  border-radius: 10px;
  color: var(--text);
  background: var(--surface-2);
  font-size: 0.7rem;
  font-weight: 750;
}

.control-button:hover:not(:disabled) {
  border-color: var(--line-strong);
  filter: brightness(1.12);
}

.control-button.primary {
  border-color: rgba(200, 255, 115, 0.34);
  color: #10140d;
  background: var(--accent);
}

.simulation-mode .control-button.primary {
  border-color: rgba(197, 154, 255, 0.38);
  background: var(--simulation);
}

.control-button.positive {
  border-color: rgba(200, 255, 115, 0.32);
  color: var(--accent);
  background: var(--accent-soft);
}

.control-button.danger {
  border-color: rgba(255, 134, 125, 0.32);
  color: var(--red);
  background: rgba(255, 134, 125, 0.08);
}

.observer-note {
  grid-column: 1 / -1;
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  color: var(--muted);
  font-size: 0.76rem;
}

.observer-screen {
  min-height: 0;
}

.observer-session {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.observer-session-line {
  display: flex;
  align-items: center;
  gap: 14px;
}

.observer-session h1 {
  margin: 5px 0 0;
  font-size: clamp(1.45rem, 3vw, 2.25rem);
  letter-spacing: -0.045em;
  line-height: 1;
}

.observer-session p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.observer-session .stage-badge {
  padding: 7px 11px;
  font-size: 0.68rem;
}

.observer-live {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.observer-card,
.metric,
.panel {
  transition:
    border-color 0.6s ease,
    box-shadow 0.6s ease,
    background 0.6s ease;
}

body[data-stage="voting"] .observer-bill,
body[data-stage="finalizing"] .observer-bill,
body[data-outcome="accepted"] .observer-bill,
body[data-outcome="rejected"] .observer-bill,
body[data-outcome="vetoed"] .observer-bill,
body[data-outcome="oral"] .observer-bill {
  border-color: var(--mood-line);
  box-shadow:
    0 20px 70px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(var(--mood-rgb), 0.08);
}

.observer-grid {
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(0, 1.8fr) minmax(330px, 0.72fr);
  gap: 12px;
}

.observer-card {
  min-width: 0;
  min-height: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(17, 22, 23, 0.98), rgba(10, 14, 15, 0.98));
}

.observer-bill {
  display: grid;
  grid-template-rows: auto auto minmax(54px, 1fr) auto auto auto;
  gap: 12px;
  overflow: hidden;
}

.observer-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.observer-card-head h2 {
  max-width: 900px;
  margin: 6px 0 0;
  font-size: clamp(1.25rem, 2.25vw, 2rem);
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.result-status {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(8, 11, 12, 0.55);
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
}

.result-status.accepted {
  border-color: rgba(200, 255, 115, 0.32);
  color: var(--accent);
  background: var(--accent-soft);
}

.result-status.rejected,
.result-status.vetoed {
  border-color: rgba(255, 134, 125, 0.32);
  color: var(--red);
  background: rgba(255, 134, 125, 0.08);
}

.result-status.vetoed {
  border-color: rgba(255, 173, 103, 0.34);
  color: #ffad67;
  background: rgba(255, 173, 103, 0.09);
}

.result-status.oral {
  border-color: rgba(112, 217, 255, 0.34);
  color: #70d9ff;
  background: rgba(112, 217, 255, 0.09);
}

.bill-meta,
.dialog-meta {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) repeat(2, minmax(0, 0.7fr));
  gap: 8px;
}

.bill-meta > span,
.dialog-meta > span {
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(8, 11, 12, 0.42);
}

.bill-meta small,
.bill-meta strong,
.dialog-meta small,
.dialog-meta strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bill-meta small,
.dialog-meta small {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.57rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.bill-meta strong,
.dialog-meta strong {
  font-size: 0.72rem;
}

.bill-reading {
  min-height: 0;
  padding: 4px 2px;
  overflow: hidden;
}

.bill-reading > small {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bill-reading p {
  display: -webkit-box;
  margin: 7px 0 0;
  overflow: hidden;
  color: #dbe1db;
  font-size: clamp(0.78rem, 1.1vw, 0.9rem);
  line-height: 1.5;
  white-space: pre-line;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}

.bill-actions {
  display: flex;
  min-height: 34px;
  align-items: center;
  gap: 14px;
}

.subtle-button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  color: var(--text);
  background: var(--surface-2);
  font-size: 0.68rem;
}

.subtle-button:hover:not(:disabled) {
  border-color: rgba(200, 255, 115, 0.32);
  color: var(--accent);
}

.consensus-result {
  display: grid;
  grid-template-columns: minmax(160px, 0.55fr) minmax(220px, 1.45fr);
  gap: 8px 18px;
  align-items: end;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(8, 11, 12, 0.54);
  transition:
    border-color 0.6s ease,
    background-color 0.6s ease,
    box-shadow 0.6s ease;
}

.observer-screen-mode .topbar {
  min-height: 46px;
  padding: 5px 10px;
  border-radius: 14px;
}

body[data-outcome="accepted"] .consensus-result,
body[data-outcome="rejected"] .consensus-result,
body[data-outcome="vetoed"] .consensus-result,
body[data-outcome="oral"] .consensus-result {
  border-color: var(--mood-line);
  background: linear-gradient(120deg, rgba(var(--mood-rgb), 0.09), rgba(8, 11, 12, 0.56));
  box-shadow: inset 0 1px 0 rgba(var(--mood-rgb), 0.08);
}

.consensus-result-main {
  grid-row: 1 / 3;
}

.consensus-result-main span,
.consensus-result-main small {
  display: block;
  color: var(--muted);
}

.consensus-result-main span {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.consensus-result-main strong {
  display: block;
  margin: 4px 0 1px;
  color: var(--mood);
  font-family: var(--mono);
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  letter-spacing: -0.07em;
  line-height: 1;
}

.consensus-result-main small {
  max-width: 250px;
  margin-top: 5px;
  font-size: 0.59rem;
  line-height: 1.35;
}

.result-track {
  position: relative;
  height: 9px;
  overflow: visible;
  border-radius: 999px;
  background: #252c29;
}

.result-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(var(--mood-rgb), 0.65), var(--mood));
  box-shadow: 0 0 18px rgba(var(--mood-rgb), 0.2);
  transition: width 0.55s cubic-bezier(0.2, 0.75, 0.2, 1), background 0.6s ease;
}

.result-track i {
  position: absolute;
  top: -4px;
  width: 2px;
  height: 17px;
  background: var(--gold);
  transform: translateX(-1px);
}

.result-numbers {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.6rem;
}

.result-numbers b {
  margin-left: 3px;
  color: var(--text);
  font-family: var(--mono);
}

.observer-blocks {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.observer-blocks > span {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1px 7px;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(8, 11, 12, 0.48);
}

.observer-blocks i {
  grid-row: 1 / 3;
  align-self: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.56rem;
  font-style: normal;
}

.observer-blocks b,
.observer-blocks em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.observer-blocks b {
  font-size: 0.62rem;
}

.observer-blocks em {
  color: var(--muted);
  font-size: 0.56rem;
  font-style: normal;
  text-transform: uppercase;
}

.observer-blocks > span.yes {
  border-color: rgba(200, 255, 115, 0.34);
  background: var(--accent-soft);
}

.observer-blocks > span.yes em {
  color: var(--accent);
}

.observer-blocks > span.no {
  border-color: rgba(255, 134, 125, 0.34);
}

.observer-blocks > span.no em {
  color: var(--red);
}

.observer-blocks > span.abstain {
  border-color: rgba(231, 201, 121, 0.3);
  background: rgba(231, 201, 121, 0.06);
}

.observer-blocks > span.abstain em {
  color: var(--gold);
}

.observer-blocks > span.hidden,
.observer-blocks > span.inactive {
  opacity: 0.68;
}

.observer-rail {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
  overflow: hidden;
}

.observer-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.observer-metrics > div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(8, 11, 12, 0.45);
}

.observer-metrics small,
.observer-metrics strong,
.observer-metrics span {
  display: block;
}

.observer-metrics small {
  color: var(--muted);
  font-size: 0.56rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.observer-metrics strong {
  margin: 3px 0 1px;
  font-family: var(--mono);
  font-size: 1.2rem;
  letter-spacing: -0.06em;
}

.observer-metrics span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.56rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.observer-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(8, 11, 12, 0.55);
}

.observer-tabs button {
  min-width: 0;
  min-height: 32px;
  padding: 0 7px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 0.61rem;
}

.observer-tabs button.active {
  color: var(--bg);
  background: var(--accent);
}

.observer-tabs span {
  margin-left: 3px;
  font-family: var(--mono);
}

.observer-feed {
  min-height: 0;
  padding-right: 4px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-width: thin;
}

.observer-feed-row {
  display: block;
  width: 100%;
  min-height: 0;
  padding: 10px 7px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
  text-decoration: none;
}

button.observer-feed-row {
  cursor: pointer;
}

button.observer-feed-row:hover {
  color: var(--accent);
  background: rgba(200, 255, 115, 0.04);
}

.observer-feed-row strong,
.observer-feed-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.observer-feed-row strong {
  font-size: 0.7rem;
}

.observer-feed-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.58rem;
}

.observer-feed-row.ready strong::before {
  margin-right: 7px;
  color: var(--accent);
  content: "●";
  font-size: 0.55rem;
}

.observer-feed-row.waiting strong::before {
  margin-right: 7px;
  color: #59605c;
  content: "●";
  font-size: 0.55rem;
}

.observer-feed-row.accepted span {
  color: var(--accent);
}

.observer-feed-row.rejected span,
.observer-feed-row.vetoed span {
  color: var(--red);
}

.observer-feed-empty {
  display: grid;
  height: 100%;
  min-height: 90px;
  place-items: center;
  color: var(--muted);
  font-size: 0.7rem;
  text-align: center;
}

.bill-dialog {
  width: min(820px, calc(100% - 32px));
  max-height: min(86dvh, 900px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  color: var(--text);
  background: #0d1213;
  box-shadow: 0 35px 120px rgba(0, 0, 0, 0.65);
}

.bill-dialog[open],
.bill-library-dialog[open] {
  transform-origin: 50% 45%;
}

.bill-dialog::backdrop {
  background: rgba(2, 4, 5, 0.78);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.bill-dialog > article {
  display: flex;
  max-height: min(86dvh, 900px);
  flex-direction: column;
  gap: 18px;
  padding: 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.bill-dialog header,
.bill-dialog footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.bill-dialog h2 {
  margin: 6px 0 0;
  font-size: clamp(1.35rem, 3vw, 2.15rem);
  letter-spacing: -0.04em;
}

.dialog-close {
  width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 50%;
  color: var(--muted);
  background: var(--surface);
  font-size: 1.25rem;
}

.bill-dialog section {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(8, 11, 12, 0.48);
}

.bill-dialog h3 {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.bill-dialog p {
  margin: 0;
  color: #dde3dc;
  font-size: 0.88rem;
  line-height: 1.65;
  white-space: pre-wrap;
}

.bill-dialog footer {
  align-items: center;
  padding: 0;
}

.bill-dialog-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dialog-result {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.dialog-result > div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(8, 11, 12, 0.48);
}

.dialog-result small,
.dialog-result strong {
  display: block;
}

.dialog-result small {
  color: var(--muted);
  font-size: 0.56rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dialog-result strong {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 0.8rem;
}

.dialog-result strong.accepted {
  color: var(--accent);
}

.dialog-result strong.rejected,
.dialog-result strong.vetoed {
  color: var(--red);
}

.dialog-result strong.oral {
  color: #70d9ff;
}

.bill-library-dialog {
  width: min(980px, calc(100% - 28px));
  height: min(86dvh, 820px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  color: var(--text);
  background: #0d1213;
  box-shadow: 0 35px 120px rgba(0, 0, 0, 0.65);
}

.bill-library-dialog::backdrop {
  background: rgba(2, 4, 5, 0.78);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.bill-library-dialog > article {
  display: grid;
  height: 100%;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 16px;
  padding: 24px;
}

.bill-library-dialog header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.bill-library-dialog h2 {
  margin: 6px 0 0;
  font-size: clamp(1.45rem, 3vw, 2.3rem);
  letter-spacing: -0.045em;
}

.bill-library-dialog header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.74rem;
}

.library-tools {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.library-search {
  margin: 0;
}

.library-search span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.6rem;
}

.library-search input {
  width: 100%;
  min-height: 42px;
}

.library-filters {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #090d0e;
}

.library-filters button {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 0.65rem;
}

.library-filters button.active {
  color: var(--bg);
  background: var(--accent);
}

.library-summary {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.62rem;
}

.bill-library-list {
  min-height: 0;
  padding-right: 5px;
  overflow-y: auto;
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-width: thin;
}

.library-row {
  display: grid;
  width: 100%;
  min-height: 72px;
  padding: 10px 8px;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.library-row:hover {
  color: var(--accent);
  background: rgba(200, 255, 115, 0.035);
}

.library-number {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.7rem;
}

.library-content {
  min-width: 0;
}

.library-content strong,
.library-content small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-content strong {
  color: inherit;
  font-size: 0.78rem;
}

.library-content small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.61rem;
}

.library-status {
  color: var(--muted);
  font-size: 0.64rem;
}

.library-status.accepted {
  color: var(--accent);
}

.library-status.rejected,
.library-status.vetoed {
  color: var(--red);
}

.library-status.oral {
  color: #70d9ff;
}

.library-empty {
  display: grid;
  height: 100%;
  min-height: 180px;
  place-items: center;
  color: var(--muted);
  font-size: 0.76rem;
  text-align: center;
}

.observer-screen-mode {
  height: 100dvh;
  overflow: hidden;
}

.observer-screen-mode .shell {
  display: flex;
  width: min(1540px, calc(100% - 24px));
  height: 100dvh;
  padding: 10px 0;
  flex-direction: column;
}

.observer-screen-mode .topbar {
  min-height: 46px;
  margin-bottom: 8px;
}

.observer-screen-mode .brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.observer-screen-mode .dashboard {
  display: flex;
  min-height: 0;
  flex: 1;
  gap: 8px;
  flex-direction: column;
}

.observer-screen-mode .mode-toolbar {
  min-height: 48px;
  padding-top: 6px;
  padding-bottom: 6px;
}

.observer-screen-mode .simulation-banner {
  padding: 9px 14px;
}

.observer-screen-mode .observer-screen {
  display: grid;
  min-height: 0;
  flex: 1;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
}

.observer-screen-mode .operator-panel,
.observer-screen-mode .hero,
.observer-screen-mode .metrics,
.observer-screen-mode .layout-main,
.observer-screen-mode .layout-secondary,
.observer-screen-mode .dashboard > footer {
  display: none !important;
}

.command-message {
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid rgba(200, 255, 115, 0.25);
  border-radius: 12px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 0.76rem;
}

.command-message.error {
  border-color: rgba(255, 134, 125, 0.28);
  color: var(--red);
  background: rgba(255, 134, 125, 0.08);
}

.simulation-mode .participant-dot.ready {
  background: var(--simulation);
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  padding: 18px 0 28px;
}

.eyebrow {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.stage-badge {
  flex: 0 0 auto;
  padding: 11px 16px;
  border: 1px solid rgba(200, 255, 115, 0.24);
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 0.82rem;
  font-weight: 800;
  transition:
    color 0.5s ease,
    border-color 0.5s ease,
    background-color 0.5s ease,
    box-shadow 0.5s ease;
}

.stage-badge.idle {
  border-color: var(--line);
  color: var(--muted);
  background: var(--surface);
}

body:not([data-stage="idle"]) .stage-badge:not(.idle) {
  border-color: var(--mood-line);
  color: var(--mood);
  background: var(--mood-soft);
  box-shadow: 0 0 24px rgba(var(--mood-rgb), 0.08);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric,
.panel {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(17, 22, 23, 0.98), rgba(12, 16, 17, 0.98));
}

.metric {
  min-height: 150px;
  padding: 22px;
  border-radius: 18px;
}

.metric span,
.metric small {
  display: block;
  color: var(--muted);
}

.metric span {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin: 17px 0 6px;
  font-family: var(--mono);
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  letter-spacing: -0.06em;
}

.metric small {
  font-size: 0.76rem;
}

.layout-main,
.layout-secondary {
  display: grid;
  gap: 20px;
}

.layout-main {
  grid-template-columns: minmax(0, 1.8fr) minmax(300px, 0.7fr);
}

.layout-secondary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel {
  min-width: 0;
  padding: clamp(20px, 3vw, 30px);
  border-radius: var(--radius);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.panel h2 {
  margin: 7px 0 0;
  font-size: 1.25rem;
  letter-spacing: -0.025em;
}

.text-link {
  color: var(--accent);
  font-size: 0.8rem;
  text-decoration: none;
}

.panel-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 14px;
}

.bill-number {
  margin: 32px 0 14px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
}

.blocks {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.block-card {
  display: flex;
  min-height: 190px;
  padding: 16px;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
}

.block-card > span,
.block-card em {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-style: normal;
}

.block-card strong {
  margin: 22px 0 10px;
  font-size: 0.84rem;
  line-height: 1.35;
}

.block-card em {
  margin-top: auto;
  font-size: 1.3rem;
}

.block-state {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}

.block-card.yes {
  border-color: rgba(200, 255, 115, 0.45);
  background: var(--accent-soft);
}

.block-card.yes .block-state {
  color: var(--accent);
}

.block-card.no {
  border-color: rgba(255, 134, 125, 0.4);
}

.block-card.no .block-state {
  color: var(--red);
}

.block-card.abstain {
  border-color: rgba(231, 201, 121, 0.34);
  background: rgba(231, 201, 121, 0.055);
}

.block-card.abstain .block-state {
  color: var(--gold);
}

.block-card.hidden,
.block-card.inactive {
  opacity: 0.66;
}

.block-card.accent {
  background: linear-gradient(155deg, rgba(200, 255, 115, 0.08), var(--surface));
}

.privacy-note {
  display: flex;
  gap: 9px;
  align-items: center;
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.76rem;
}

.privacy-note span {
  color: var(--accent);
}

.counter {
  display: grid;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  place-items: center;
  border-radius: 10px;
  color: var(--accent);
  background: var(--accent-soft);
  font-family: var(--mono);
  font-size: 0.8rem;
}

.participants {
  display: grid;
  gap: 8px;
  margin-top: 24px;
}

.participant {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.participant:last-child {
  border-bottom: 0;
}

.participant-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #59605c;
}

.participant-dot.ready {
  background: var(--accent);
}

.participant strong,
.participant small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.participant strong {
  font-size: 0.82rem;
}

.participant small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.68rem;
}

.vote-state {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.66rem;
}

.vote-state.done {
  color: var(--accent);
}

.stack-list {
  display: grid;
  margin-top: 20px;
}

.list-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  min-height: 63px;
  border-bottom: 1px solid var(--line);
}

.list-row:last-child {
  border-bottom: 0;
}

.list-number {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.74rem;
}

.list-title {
  overflow: hidden;
  color: var(--text);
  font-size: 0.83rem;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-title-button {
  min-height: 42px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  text-overflow: ellipsis;
}

.list-title-button:hover {
  color: var(--accent);
}

.list-meta {
  color: var(--muted);
  font-size: 0.69rem;
}

.list-meta.accepted {
  color: var(--accent);
}

.list-meta.rejected {
  color: var(--red);
}

.list-meta.vetoed {
  color: #ffad67;
}

.list-meta.oral {
  color: #70d9ff;
}

.empty-state {
  padding: 28px 0;
  color: var(--muted);
  font-size: 0.82rem;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 4px 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.65rem;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1080px) {
  .metrics,
  .blocks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .layout-main {
    grid-template-columns: 1fr;
  }

  .block-card {
    min-height: 150px;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 28px, 1480px);
    padding-top: 12px;
  }

  .topbar {
    margin-bottom: 26px;
  }

  .brand small,
  .connection #connection-text {
    display: none;
  }

  .topbar-tools {
    gap: 8px;
  }

  .panel-switch {
    width: 42px;
    justify-content: center;
    padding: 0;
  }

  .panel-switch strong {
    display: none;
  }

  .viewer-chip {
    display: flex;
    padding: 7px 9px;
  }

  .viewer-chip span,
  .viewer-chip strong {
    display: none;
  }

  .viewer-chip a {
    grid-column: auto;
    grid-row: auto;
  }

  .connection time {
    margin-left: 5px;
  }

  .hero,
  .mode-toolbar,
  .simulation-banner,
  .operator-heading,
  footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .mode-switch {
    width: 100%;
  }

  .mode-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .library-button {
    flex: 1 0 100%;
  }

  .mode-switch button {
    flex: 1;
  }

  .metrics,
  .operator-controls,
  .layout-secondary {
    grid-template-columns: 1fr;
  }

  .metric {
    min-height: 125px;
  }

  .login-row {
    flex-direction: column;
  }

  .login-guide {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .login-guide i {
    display: none;
  }

  .observer-screen-mode .shell {
    width: min(100% - 16px, 1480px);
    padding-top: 6px;
  }

  .observer-screen-mode .topbar {
    min-height: 42px;
    margin-bottom: 5px;
  }

  .observer-screen-mode .mode-toolbar {
    min-height: 0;
    padding: 8px;
    gap: 8px;
  }

  .observer-session {
    min-height: 58px;
  }

  .observer-live,
  .observer-session p {
    display: none;
  }

  .observer-grid {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .observer-card {
    padding: 14px;
  }

  .observer-bill {
    min-height: 520px;
  }

  .observer-rail {
    min-height: 360px;
  }

  .bill-meta,
  .dialog-meta {
    grid-template-columns: 1fr;
  }

  .dialog-result {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .library-tools {
    grid-template-columns: 1fr;
  }

  .library-filters button {
    flex: 1;
  }

  .library-row {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .library-status {
    grid-column: 2;
  }

  .consensus-result {
    grid-template-columns: 1fr;
  }

  .consensus-result-main {
    grid-row: auto;
  }

  .observer-blocks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-numbers,
  .bill-actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .connection time {
    display: none;
  }

  .brand {
    gap: 9px;
  }

  .brand strong {
    font-size: 0.78rem;
  }

  .blocks {
    grid-template-columns: 1fr;
  }

  .block-card {
    min-height: 135px;
  }

  .observer-session-line {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .observer-session h1 {
    font-size: 1.25rem;
  }

  .observer-card-head {
    flex-direction: column;
    gap: 9px;
  }
}

@media (max-height: 720px) and (min-width: 721px) {
  .observer-screen-mode .mode-toolbar small,
  .observer-session p {
    display: none;
  }

  .observer-session {
    min-height: 50px;
  }

  .observer-card {
    padding: 14px;
  }

  .observer-bill,
  .observer-rail {
    gap: 8px;
  }

  .bill-reading p {
    -webkit-line-clamp: 3;
  }

  .observer-blocks > span {
    padding-top: 6px;
    padding-bottom: 6px;
  }
}

/* Unified T-Mod visual layer. */
.atmosphere::after {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(var(--mood-rgb), 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--mood-rgb), 0.025) 1px, transparent 1px);
  background-size: 72px 72px;
  content: "";
  opacity: 0.32;
  -webkit-mask-image: radial-gradient(circle at 50% 30%, black, transparent 72%);
  mask-image: radial-gradient(circle at 50% 30%, black, transparent 72%);
  transition: background-image 0.8s ease;
}

.noise {
  -webkit-mask-image: radial-gradient(circle at center, black, transparent 88%);
  mask-image: radial-gradient(circle at center, black, transparent 88%);
}

.topbar {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(115deg, rgba(var(--mood-rgb), 0.035), transparent 45%),
    rgba(12, 17, 18, 0.82);
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
  box-shadow: var(--glass-shadow);
  transition:
    border-color 0.6s ease,
    background 0.6s ease,
    box-shadow 0.6s ease;
}

.brand-mark {
  position: relative;
  overflow: hidden;
  border-color: rgba(var(--mood-rgb), 0.32);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.42), transparent 38%),
    var(--mood);
  box-shadow:
    0 10px 30px rgba(var(--mood-rgb), 0.14),
    inset 0 1px rgba(255, 255, 255, 0.55);
  transition:
    background 0.6s ease,
    border-color 0.6s ease,
    box-shadow 0.6s ease;
}

.brand-mark::after {
  position: absolute;
  top: -35%;
  left: -75%;
  width: 40%;
  height: 170%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.48), transparent);
  content: "";
  transform: rotate(18deg);
}

.connection-dot.online {
  background: var(--mood);
  box-shadow: 0 0 0 4px var(--mood-soft), 0 0 20px rgba(var(--mood-rgb), 0.26);
  transition:
    background 0.6s ease,
    box-shadow 0.6s ease;
}

.login-card,
.mode-toolbar,
.simulation-banner,
.metric,
.panel,
.observer-card,
.control-group,
.block-card,
.list-row,
.participant-row,
.bill-meta > span,
.dialog-meta > span,
.consensus-result,
.observer-blocks > span,
.observer-metrics > div {
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
}

.login-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(var(--mood-rgb), 0.14);
  background:
    radial-gradient(circle at 10% 0, rgba(var(--mood-rgb), 0.12), transparent 38%),
    linear-gradient(145deg, rgba(21, 27, 28, 0.97), rgba(10, 14, 15, 0.98));
  box-shadow:
    0 38px 120px rgba(0, 0, 0, 0.42),
    inset 0 1px rgba(255, 255, 255, 0.045);
}

.mode-toolbar,
.simulation-banner {
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow: var(--glass-shadow);
}

.mode-toolbar {
  border-color: rgba(var(--mood-rgb), 0.1);
  background:
    linear-gradient(105deg, rgba(var(--mood-rgb), 0.045), transparent 48%),
    rgba(16, 21, 22, 0.82);
  transition:
    border-color 0.6s ease,
    background 0.6s ease;
}

.mode-switch,
.library-filters {
  box-shadow:
    inset 0 1px 4px rgba(0, 0, 0, 0.34),
    0 1px rgba(255, 255, 255, 0.025);
}

.mode-switch button.active,
.library-filters button.active {
  box-shadow:
    0 7px 22px rgba(var(--mood-rgb), 0.12),
    inset 0 1px rgba(255, 255, 255, 0.34);
}

.hero h1,
.observer-session h1 {
  text-shadow: 0 14px 48px rgba(var(--mood-rgb), 0.1);
}

.stage-badge,
.result-status,
.operator-lock {
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.035),
    0 8px 26px rgba(var(--mood-rgb), 0.035);
}

.metric,
.panel,
.observer-card {
  position: relative;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.026), transparent 45%),
    linear-gradient(145deg, rgba(17, 22, 23, 0.98), rgba(10, 14, 15, 0.985));
  box-shadow: var(--glass-shadow);
  transition:
    border-color 0.6s ease,
    box-shadow 260ms ease,
    background 0.6s ease,
    transform 260ms var(--ease-out);
}

.metric {
  overflow: hidden;
}

.metric::before,
.observer-card::before {
  position: absolute;
  top: 0;
  right: 18px;
  left: 18px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--mood-rgb), 0.34), transparent);
  content: "";
  opacity: 0.42;
}

.metric::after {
  position: absolute;
  right: -48px;
  bottom: -70px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: rgba(var(--mood-rgb), 0.08);
  content: "";
  filter: blur(48px);
}

.operator-panel {
  background:
    radial-gradient(circle at 0 0, rgba(var(--mood-rgb), 0.08), transparent 36%),
    linear-gradient(145deg, rgba(17, 22, 23, 0.98), rgba(10, 14, 15, 0.985));
}

.operator-panel::before {
  box-shadow: 0 0 22px rgba(var(--mood-rgb), 0.3);
}

.control-group,
.block-card,
.bill-meta > span,
.dialog-meta > span,
.observer-blocks > span,
.observer-metrics > div {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.018), transparent 50%),
    rgba(8, 11, 12, 0.5);
}

.control-button,
.subtle-button,
.library-button,
.mode-switch button,
.library-filters button {
  position: relative;
  overflow: hidden;
}

.control-button.primary,
.mode-switch button.active,
.library-filters button.active,
button:not(.dialog-close):not(.list-title-button):not(.library-row):not(.observer-feed-row) {
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.16);
}

.control-button.primary {
  box-shadow:
    0 10px 28px rgba(var(--mood-rgb), 0.12),
    inset 0 1px rgba(255, 255, 255, 0.38);
}

.current-bill,
.observer-bill {
  isolation: isolate;
  overflow: hidden;
}

.current-bill::after,
.observer-bill::after {
  position: absolute;
  z-index: 0;
  top: -110px;
  right: -90px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(var(--mood-rgb), 0.055);
  content: "";
  filter: blur(55px);
  pointer-events: none;
  transition:
    background 0.6s ease,
    transform 0.8s var(--ease-out);
}

.current-bill > *,
.observer-bill > * {
  position: relative;
  z-index: 1;
}

.bill-reading {
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(var(--mood-rgb), 0.018), transparent);
}

.result-track {
  box-shadow:
    inset 0 2px 5px rgba(0, 0, 0, 0.44),
    0 1px rgba(255, 255, 255, 0.025);
}

.result-track span {
  position: relative;
  overflow: hidden;
}

.result-track span::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.38), transparent 80%);
  content: "";
  transform: translateX(-120%);
}

.list-row,
.participant-row,
.observer-feed-row,
.library-row {
  transition:
    color 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease,
    transform 220ms var(--ease-out);
}

.bill-dialog,
.bill-library-dialog {
  border-color: var(--mood-line);
  background:
    radial-gradient(circle at 8% 0, rgba(var(--mood-rgb), 0.11), transparent 35%),
    linear-gradient(145deg, #111718, #0a0f10);
  box-shadow:
    0 38px 130px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(var(--mood-rgb), 0.035),
    0 0 80px rgba(var(--mood-rgb), 0.07);
  transition:
    border-color 0.6s ease,
    background 0.6s ease;
}

.bill-dialog header,
.bill-library-dialog header {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.bill-dialog section {
  background:
    linear-gradient(115deg, rgba(var(--mood-rgb), 0.035), transparent 48%),
    rgba(8, 11, 12, 0.5);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
}

.dialog-close {
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.035);
  transition:
    color 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

.command-message {
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.2);
}

* {
  scrollbar-color: rgba(var(--mood-rgb), 0.26) transparent;
}

*::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(var(--mood-rgb), 0.2);
  background-clip: padding-box;
}

@media (hover: hover) and (pointer: fine) {
  .metric:hover,
  .panel:hover,
  .observer-card:hover {
    border-color: rgba(var(--mood-rgb), 0.2);
    box-shadow:
      0 30px 82px rgba(0, 0, 0, 0.24),
      0 0 45px rgba(var(--mood-rgb), 0.035),
      inset 0 1px rgba(255, 255, 255, 0.05);
  }

  .metric:hover,
  .observer-card:hover {
    transform: translateY(-2px);
  }

  .control-group:hover,
  .block-card:hover {
    border-color: rgba(var(--mood-rgb), 0.18);
    background-color: rgba(var(--mood-rgb), 0.025);
  }

  .list-row:hover,
  .participant-row:hover,
  .observer-feed-row:hover,
  .library-row:hover {
    background: rgba(var(--mood-rgb), 0.04);
    box-shadow: inset 2px 0 var(--mood);
    transform: translateX(3px);
  }

  .dialog-close:hover {
    border-color: var(--mood-line);
    color: var(--mood);
    background: var(--mood-soft);
    transform: rotate(4deg);
  }

  .current-bill:hover::after,
  .observer-bill:hover::after {
    transform: scale(1.12) translate3d(-8px, 7px, 0);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .atmosphere-orb-primary {
    animation: ambientDriftPrimary 18s ease-in-out infinite alternate;
  }

  .atmosphere-orb-secondary {
    animation: ambientDriftSecondary 22s ease-in-out infinite alternate;
  }

  .brand-mark::after {
    animation: consensusMarkShine 7s ease-in-out infinite;
  }

  .mode-toolbar,
  .hero,
  .metrics,
  .layout-main,
  .layout-secondary,
  .observer-screen {
    animation: surfaceRise 480ms var(--ease-out) both;
  }

  .hero,
  .metrics {
    animation-delay: 45ms;
  }

  .layout-main,
  .observer-screen {
    animation-delay: 90ms;
  }

  .layout-secondary {
    animation-delay: 130ms;
  }

  body[data-stage="voting"] .result-track span::after,
  body[data-stage="finalizing"] .result-track span::after,
  body[data-outcome="accepted"] .result-track span::after,
  body[data-outcome="rejected"] .result-track span::after,
  body[data-outcome="vetoed"] .result-track span::after {
    animation: resultGlimmer 2.8s ease-in-out infinite;
  }

  .dashboard {
    animation: reveal 0.35s ease-out both;
  }

  .pulse {
    animation: livePulse 2.1s ease-in-out infinite;
  }

  body[data-stage="voting"] .atmosphere-sweep,
  body[data-stage="finalizing"] .atmosphere-sweep {
    animation: votingSweep 8s linear infinite;
  }

  body[data-stage="discussion"] .atmosphere-ring,
  body[data-stage="discussion-type"] .atmosphere-ring {
    animation: discussionOrbit 12s ease-in-out infinite alternate;
  }

  body.verdict-transition .atmosphere-orb-primary {
    animation: verdictBloom 1.7s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  body.verdict-transition .observer-bill {
    animation: verdictCard 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  body.verdict-transition .current-bill {
    animation: verdictCard 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .bill-dialog[open],
  .bill-library-dialog[open] {
    animation: dialogIn 0.22s ease-out both;
  }

  @keyframes reveal {
    from {
      opacity: 0;
      transform: translateY(8px);
    }
  }

  @keyframes livePulse {
    0%,
    100% {
      box-shadow: 0 0 0 4px var(--accent-soft);
    }
    50% {
      box-shadow: 0 0 0 8px transparent;
    }
  }

  @keyframes votingSweep {
    from {
      opacity: 0;
      transform: translateX(-38vw) rotate(26deg);
    }
    18%,
    76% {
      opacity: 0.3;
    }
    to {
      opacity: 0;
      transform: translateX(48vw) rotate(26deg);
    }
  }

  @keyframes discussionOrbit {
    from {
      transform: translate3d(0, 0, 0) scale(0.94);
    }
    to {
      transform: translate3d(-4vw, 3vh, 0) scale(1.05);
    }
  }

  @keyframes verdictBloom {
    0% {
      opacity: 0.06;
      transform: scale(0.78);
    }
    38% {
      opacity: 0.42;
      transform: scale(1.08);
    }
    100% {
      opacity: 0.23;
      transform: scale(1);
    }
  }

  @keyframes verdictCard {
    0% {
      transform: translateY(7px);
    }
    45% {
      border-color: rgba(var(--mood-rgb), 0.48);
      box-shadow: 0 20px 90px rgba(var(--mood-rgb), 0.11);
    }
  }

  @keyframes dialogIn {
    from {
      opacity: 0;
      transform: translateY(8px) scale(0.985);
    }
  }

  @keyframes ambientDriftPrimary {
    from {
      transform: translate3d(-2vw, -1vh, 0) scale(0.94);
    }
    to {
      transform: translate3d(4vw, 3vh, 0) scale(1.08);
    }
  }

  @keyframes ambientDriftSecondary {
    from {
      transform: translate3d(2vw, 2vh, 0) scale(1.06);
    }
    to {
      transform: translate3d(-4vw, -2vh, 0) scale(0.93);
    }
  }

  @keyframes consensusMarkShine {
    0%,
    72% {
      left: -75%;
      opacity: 0;
    }
    82% {
      opacity: 0.75;
    }
    100% {
      left: 135%;
      opacity: 0;
    }
  }

  @keyframes surfaceRise {
    from {
      opacity: 0;
      transform: translateY(12px);
    }
  }

  @keyframes resultGlimmer {
    0%,
    55% {
      transform: translateX(-120%);
    }
    100% {
      transform: translateX(120%);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
