:root {
  color-scheme: dark;
  --bg: #07111f;
  --bg-deep: #040b14;
  --surface: #0c1a2b;
  --surface-raised: #112236;
  --surface-soft: #0a1726;
  --surface-hover: #172b40;
  --text: #edf7f4;
  --text-strong: #ffffff;
  --muted: #91a7aa;
  --muted-strong: #b8c8c8;
  --line: rgba(166, 207, 205, 0.14);
  --line-strong: rgba(166, 207, 205, 0.28);
  --accent: #54edc0;
  --accent-strong: #74f7d0;
  --accent-ink: #042019;
  --method-link: var(--accent);
  --cyan: #58c9f2;
  --danger: #ff8f9a;
  --warning: #ffd36a;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.34);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --page-width: 1240px;
  --header-height: 88px;
  font-family: "Segoe UI Variable", "Segoe UI", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f8f6;
  --bg-deep: #e9f1ee;
  --surface: #ffffff;
  --surface-raised: #f7fbf9;
  --surface-soft: #edf5f2;
  --surface-hover: #e6f1ed;
  --text: #182824;
  --text-strong: #091713;
  --muted: #5d726d;
  --muted-strong: #344f48;
  --line: rgba(24, 61, 52, 0.22);
  --line-strong: #78908a;
  --accent: #007a5e;
  --accent-strong: #00694f;
  --accent-ink: #ffffff;
  --method-link: #006c50;
  --cyan: #0d6f91;
  --danger: #b4273b;
  --warning: #865c00;
  --shadow: 0 30px 70px rgba(39, 69, 60, 0.13);
}

:root[data-theme="contrast"] {
  color-scheme: dark;
  --bg: #000000;
  --bg-deep: #000000;
  --surface: #050505;
  --surface-raised: #111111;
  --surface-soft: #080808;
  --surface-hover: #191919;
  --text: #ffffff;
  --text-strong: #ffffff;
  --muted: #f1f1f1;
  --muted-strong: #ffffff;
  --line: rgba(255, 255, 255, 0.42);
  --line-strong: #ffffff;
  --accent: #ffff00;
  --accent-strong: #ffff5c;
  --accent-ink: #000000;
  --cyan: #00ffff;
  --danger: #ff7690;
  --warning: #ffff00;
  --shadow: 0 0 0 1px #ffffff;
}

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

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 82% 8%, color-mix(in srgb, var(--cyan) 10%, transparent) 0, transparent 28rem),
    radial-gradient(circle at 16% 30%, color-mix(in srgb, var(--accent) 7%, transparent) 0, transparent 25rem),
    var(--bg);
  line-height: 1.5;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  opacity: 0.4;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, black, transparent 76%);
}

button,
input {
  font: inherit;
}

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

button {
  color: inherit;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: var(--radius-sm);
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

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

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.site-header,
.site-footer,
.landing-view,
.session-view,
.trust-view {
  width: min(calc(100% - 40px), var(--page-width));
  margin-inline: auto;
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  border-radius: 12px;
}

.brand-mark {
  position: relative;
  width: 38px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--accent-ink);
  background: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 75%, var(--text));
  border-radius: 8px;
  box-shadow: 7px 6px 0 color-mix(in srgb, var(--cyan) 22%, transparent);
  transform: rotate(-3deg);
}

.brand-mark::before {
  position: absolute;
  inset: 3px -5px -5px 3px;
  z-index: -1;
  content: "";
  border: 1px solid color-mix(in srgb, var(--cyan) 54%, transparent);
  border-radius: inherit;
}

.brand-mark span {
  font-size: 1rem;
  font-weight: 900;
}

.brand-copy {
  display: grid;
}

.brand-copy strong {
  color: var(--text-strong);
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.brand-copy small {
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.035em;
}

.theme-switcher {
  --theme-index: 1;
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 244px;
  margin: 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  isolation: isolate;
}

.theme-switcher:has(input[value="light"]:checked) { --theme-index: 0; }
.theme-switcher:has(input[value="dark"]:checked) { --theme-index: 1; }
.theme-switcher:has(input[value="contrast"]:checked) { --theme-index: 2; }

.theme-thumb {
  position: absolute;
  z-index: -1;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc((100% - 8px) / 3);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-hover);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  transform: translateX(calc(var(--theme-index) * 100%));
  transition: transform 200ms ease, background-color 200ms ease;
}

.theme-option {
  min-width: 0;
  cursor: pointer;
}

.theme-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.theme-option span {
  min-height: 30px;
  display: grid;
  place-items: center;
  padding-inline: 7px;
  color: var(--muted);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 750;
  transition: color 150ms ease;
}

.theme-option input:checked + span {
  color: var(--text-strong);
}

.theme-option input:focus-visible + span {
  outline: 3px solid var(--accent);
  outline-offset: 1px;
}

.landing-view {
  padding-block: clamp(44px, 8vw, 104px) 80px;
}

.hero-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.03fr) minmax(440px, 0.97fr);
  align-items: center;
  gap: clamp(48px, 7vw, 100px);
  min-height: 590px;
}

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

.eyebrow,
.section-kicker,
.demo-label {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  line-height: 1.3;
  text-transform: uppercase;
}

.eyebrow > span {
  width: 7px;
  height: 7px;
  display: inline-block;
  margin-right: 7px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 11%, transparent);
}

.hero-copy h1 {
  max-width: 760px;
  margin: 0;
  color: var(--text-strong);
  font-size: clamp(3.25rem, 6.2vw, 6.25rem);
  font-weight: 760;
  letter-spacing: -0.07em;
  line-height: 0.96;
}

.hero-copy h1 em {
  color: var(--accent);
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
  font-weight: 500;
}

.hero-lede {
  max-width: 610px;
  margin: 28px 0 0;
  color: var(--muted-strong);
  font-size: clamp(1.03rem, 1.7vw, 1.25rem);
  line-height: 1.68;
}

.scale-picker {
  min-width: 0;
  max-width: 610px;
  padding: 0;
  margin: 30px 0 0;
  border: 0;
}

.scale-picker legend {
  padding: 0;
  color: var(--text-strong);
  font-size: 0.78rem;
  font-weight: 850;
}

.scale-picker-help {
  margin: 5px 0 12px;
  color: var(--muted);
  font-size: 0.72rem;
}

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

.scale-option {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.scale-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.scale-option-face {
  min-height: 66px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 11px 14px;
  color: var(--muted-strong);
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.scale-option-face strong {
  color: var(--text-strong);
  font-size: 0.84rem;
}

.scale-option-face small {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
}

.scale-option:hover .scale-option-face {
  background: var(--surface-raised);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line-strong));
}

.scale-option input:focus-visible + .scale-option-face {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.scale-option input:checked + .scale-option-face {
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.scale-option input:disabled + .scale-option-face {
  cursor: not-allowed;
  opacity: 0.48;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 34px;
}

.action-note {
  color: var(--muted);
  font-size: 0.8rem;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  transition: transform 150ms ease, border-color 150ms ease, background-color 150ms ease, color 150ms ease, opacity 150ms ease;
}

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

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

.button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.button-primary {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 70%, var(--text));
  box-shadow: 0 12px 30px color-mix(in srgb, var(--accent) 17%, transparent);
}

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

.button-secondary {
  color: var(--text-strong);
  background: var(--surface-raised);
  border-color: var(--line-strong);
}

.button-secondary:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line-strong));
}

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

.button-quiet:hover:not(:disabled) {
  color: var(--text-strong);
  background: var(--surface-raised);
}

.button-large {
  min-height: 52px;
  padding: 14px 21px;
}

.button-compact {
  min-height: 40px;
  padding: 9px 14px;
  font-size: 0.83rem;
}

.button-full {
  width: 100%;
}

.inline-error,
.field-error {
  color: var(--danger);
  font-size: 0.84rem;
  font-weight: 700;
}

.inline-error {
  margin: 16px 0 0;
}

.hero-demo {
  position: relative;
  min-width: 0;
  transform: rotate(1.2deg);
}

.demo-glow {
  position: absolute;
  inset: 6% 8%;
  background: color-mix(in srgb, var(--accent) 17%, transparent);
  border-radius: 50%;
  filter: blur(70px);
}

.demo-window {
  position: relative;
  overflow: hidden;
  padding: clamp(24px, 3vw, 38px);
  border: 1px solid var(--line-strong);
  border-radius: 28px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface-raised) 96%, transparent), color-mix(in srgb, var(--surface) 90%, transparent));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.demo-window::before {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background: linear-gradient(120deg, transparent 30%, color-mix(in srgb, var(--cyan) 8%, transparent), transparent 70%);
}

.demo-topline,
.demo-team {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.demo-topline > div {
  display: grid;
}

.demo-label {
  margin-bottom: 5px;
}

.demo-topline strong {
  color: var(--text-strong);
  font-size: 1.18rem;
}

.demo-round,
.round-pill {
  flex: none;
  padding: 5px 9px;
  color: var(--cyan);
  background: color-mix(in srgb, var(--cyan) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--cyan) 22%, transparent);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
}

.demo-cards {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 9px;
  margin-block: 36px;
}

.demo-cards span {
  aspect-ratio: 0.72;
  display: grid;
  place-items: center;
  color: var(--muted-strong);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: clamp(0.9rem, 2.2vw, 1.4rem);
  font-weight: 850;
}

.demo-cards .demo-selected {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent-strong);
  box-shadow: 0 12px 28px color-mix(in srgb, var(--accent) 20%, transparent);
  transform: translateY(-9px) rotate(-2deg);
}

.demo-team {
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.demo-avatars {
  display: flex;
  padding-left: 8px;
}

.demo-avatars span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  margin-left: -8px;
  color: var(--text-strong);
  background: var(--surface-hover);
  border: 2px solid var(--surface);
  border-radius: 50%;
  font-size: 0.63rem;
  font-weight: 800;
}

.demo-avatars span:nth-child(2) { background: color-mix(in srgb, var(--cyan) 28%, var(--surface)); }
.demo-avatars span:nth-child(3) { background: color-mix(in srgb, var(--accent) 25%, var(--surface)); }

.demo-readiness {
  display: grid;
  text-align: right;
}

.demo-readiness strong {
  color: var(--text-strong);
  font-size: 0.84rem;
}

.demo-readiness i {
  width: 7px;
  height: 7px;
  display: inline-block;
  margin-right: 3px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent);
}

.demo-readiness span {
  color: var(--muted);
  font-size: 0.72rem;
}

.refinement-loop {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.3fr);
  gap: clamp(40px, 7vw, 100px);
  padding-top: 80px;
  margin-top: 64px;
  border-top: 1px solid var(--line);
}

.loop-intro h2 {
  max-width: 390px;
  margin: 0;
  color: var(--text-strong);
  font-size: clamp(2rem, 3.4vw, 3.1rem);
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.loop-note {
  max-width: 410px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.65;
}

.method-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 18px;
}

.method-links a {
  color: var(--method-link);
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration-color: color-mix(in srgb, var(--method-link) 45%, transparent);
  text-underline-offset: 4px;
}

.method-links a:hover {
  color: var(--method-link);
  text-decoration-color: currentColor;
}

.method-links a:focus-visible {
  border-radius: 3px;
  outline: 3px solid var(--method-link);
  outline-offset: 4px;
}

.loop-steps {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.loop-steps li {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 18px;
  padding: 25px 4px;
  border-bottom: 1px solid var(--line);
}

.step-number {
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 800;
}

.loop-steps h3 {
  margin: 0 0 5px;
  color: var(--text-strong);
  font-size: 1.04rem;
}

.loop-steps p {
  max-width: 500px;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.session-view {
  min-height: calc(100vh - var(--header-height) - 80px);
  padding-block: 44px 80px;
}

.session-loading {
  min-height: 55vh;
  display: grid;
  place-content: center;
  justify-items: center;
  color: var(--muted);
}

.loading-mark {
  display: flex;
  gap: 7px;
  height: 28px;
  align-items: end;
}

.loading-mark span {
  width: 9px;
  height: 12px;
  background: var(--accent);
  border-radius: 3px;
  animation: loading-bars 900ms ease-in-out infinite alternate;
}

.loading-mark span:nth-child(2) { height: 22px; animation-delay: 120ms; }
.loading-mark span:nth-child(3) { height: 16px; animation-delay: 240ms; }

@keyframes loading-bars {
  to { transform: translateY(-6px); opacity: 0.45; }
}

.fatal-card {
  max-width: 650px;
  padding: clamp(28px, 5vw, 54px);
  margin: 8vh auto;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.fatal-card h1 {
  margin: 0;
  color: var(--text-strong);
  font-size: clamp(2rem, 4vw, 3.3rem);
  letter-spacing: -0.045em;
}

.fatal-card > p:not(.eyebrow) {
  color: var(--muted-strong);
}

.fatal-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
}

.room-content {
  animation: room-enter 300ms ease-out both;
}

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

.room-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  padding-bottom: 32px;
}

.room-heading h1 {
  max-width: 760px;
  margin: 0;
  color: var(--text-strong);
  font-size: clamp(2.3rem, 4.6vw, 4.4rem);
  letter-spacing: -0.06em;
  line-height: 1.02;
}

.room-heading-copy > p:not(.eyebrow) {
  max-width: 720px;
  margin: 17px 0 0;
  color: var(--muted-strong);
  font-size: 1rem;
}

.room-heading-copy .room-link-note {
  max-width: 680px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.76rem;
}

#session-code-label {
  margin-left: 5px;
  color: var(--cyan);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 0.08em;
}

.room-heading-actions {
  flex: none;
  display: flex;
  gap: 6px;
}

.story-focus {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 16px;
  padding: 13px 14px;
  margin-bottom: 10px;
  background: color-mix(in srgb, var(--surface) 87%, transparent);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  backdrop-filter: blur(12px);
}

.story-focus-summary {
  min-width: 0;
}

.story-focus .section-kicker {
  margin-bottom: 2px;
  font-size: 0.6rem;
}

.story-label {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text-strong);
  font-size: 0.94rem;
  font-weight: 760;
}

.story-label.is-empty {
  color: var(--muted);
  font-weight: 650;
}

.story-edit-button {
  align-self: center;
}

.story-form {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

.story-field {
  position: relative;
  min-width: 0;
}

.story-field input {
  width: 100%;
  min-height: 42px;
  padding: 8px 72px 8px 12px;
  color: var(--text-strong);
  background: var(--surface-soft);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
}

.story-field input::placeholder {
  color: var(--muted);
}

.story-field input:focus {
  border-color: var(--accent);
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.story-field input:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.story-character-count {
  position: absolute;
  top: 21px;
  right: 11px;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 700;
  transform: translateY(-50%);
}

.story-safety-help {
  display: block;
  margin: 7px 2px 0;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.45;
}

.story-status {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.story-status.is-pending {
  color: var(--cyan);
}

.story-status.is-success {
  color: var(--accent);
}

.story-status.is-warning {
  color: var(--warning);
}

.story-status.is-error {
  color: var(--danger);
}

.room-statusbar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 14px;
  margin-bottom: 18px;
  background: color-mix(in srgb, var(--surface) 87%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  backdrop-filter: blur(12px);
}

.status-cluster {
  display: flex;
  align-items: center;
  gap: 9px;
}

.connection-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  color: var(--muted-strong);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
}

.connection-pill i {
  width: 7px;
  height: 7px;
  background: var(--muted);
  border-radius: 50%;
}

.connection-pill.is-live i {
  background: var(--accent);
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 70%, transparent);
}

.connection-pill.is-retrying i {
  background: var(--warning);
}

.phase-label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

#your-vote-summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: right;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.75fr);
  gap: 18px;
}

.vote-workspace,
.team-panel,
.discussion-panel {
  background: color-mix(in srgb, var(--surface) 95%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.08);
}

.vote-workspace {
  min-width: 0;
  padding: clamp(22px, 3vw, 36px);
}

.team-panel {
  min-width: 0;
  padding: 26px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.section-kicker {
  margin-bottom: 5px;
  font-size: 0.65rem;
}

.section-heading h2,
.discussion-panel h2 {
  margin: 0;
  color: var(--text-strong);
  font-size: clamp(1.35rem, 2.2vw, 1.8rem);
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.scale-note,
.readiness-count {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.vote-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.vote-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(64px, 1fr));
  gap: clamp(8px, 1.3vw, 14px);
}

.vote-grid[data-estimation-scale="tshirt"] {
  grid-template-columns: repeat(5, minmax(64px, 1fr));
}

.point-card {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.point-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.point-face {
  position: relative;
  aspect-ratio: 0.72;
  min-height: 112px;
  display: grid;
  place-content: center;
  justify-items: center;
  overflow: hidden;
  color: var(--text-strong);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--surface-raised) 98%, transparent), var(--surface-soft));
  border: 1px solid var(--line-strong);
  border-radius: clamp(12px, 1.5vw, 18px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.point-face::before,
.point-face::after {
  position: absolute;
  width: 5px;
  height: 5px;
  content: "";
  background: var(--line-strong);
  border-radius: 50%;
}

.point-face::before { top: 10px; left: 10px; }
.point-face::after { right: 10px; bottom: 10px; }

.point-face strong {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 740;
  letter-spacing: -0.06em;
  line-height: 1;
}

.point-face small {
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.point-card:hover .point-face {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line-strong));
  transform: translateY(-5px);
  box-shadow: 0 18px 34px color-mix(in srgb, var(--accent) 8%, transparent);
}

.point-card input:focus-visible + .point-face {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.point-card input:checked + .point-face {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent-strong);
  box-shadow: 0 18px 40px color-mix(in srgb, var(--accent) 22%, transparent);
  transform: translateY(-7px) rotate(-1deg);
}

.point-card input:checked + .point-face small {
  color: var(--accent-ink);
}

.point-card input:checked + .point-face::before,
.point-card input:checked + .point-face::after {
  background: color-mix(in srgb, var(--accent-ink) 30%, transparent);
}

.point-card input:disabled + .point-face {
  cursor: not-allowed;
  opacity: 0.52;
}

.vote-sync-status {
  min-height: 22px;
  margin-top: 19px;
  color: var(--muted);
  font-size: 0.76rem;
}

.vote-sync-status.is-pending {
  color: var(--cyan);
}

.vote-sync-status.is-error {
  color: var(--danger);
}

.team-heading-row {
  align-items: center;
  margin-bottom: 20px;
}

.member-list {
  display: grid;
  gap: 9px;
  max-height: 420px;
  margin: 0;
  padding: 0 3px 0 0;
  overflow-y: auto;
  list-style: none;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.member-card {
  min-height: 64px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 10px 11px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 13px;
  animation: member-enter 180ms ease-out both;
}

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

.member-card.is-you {
  border-color: color-mix(in srgb, var(--accent) 25%, var(--line));
}

.member-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--text-strong);
  background: color-mix(in srgb, var(--cyan) 17%, var(--surface-raised));
  border: 1px solid color-mix(in srgb, var(--cyan) 23%, var(--line));
  border-radius: 11px;
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.02em;
}

.member-card.avatar-1 .member-avatar { background: color-mix(in srgb, var(--accent) 17%, var(--surface-raised)); }
.member-card.avatar-2 .member-avatar { background: color-mix(in srgb, #c48cff 18%, var(--surface-raised)); }
.member-card.avatar-3 .member-avatar { background: color-mix(in srgb, #ffad68 17%, var(--surface-raised)); }
.member-card.avatar-4 .member-avatar { background: color-mix(in srgb, #ff8198 16%, var(--surface-raised)); }
.member-card.avatar-5 .member-avatar { background: color-mix(in srgb, #8fb3ff 17%, var(--surface-raised)); }

.member-name-wrap {
  min-width: 0;
  display: grid;
}

.member-name {
  overflow: hidden;
  color: var(--text-strong);
  font-size: 0.84rem;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-you {
  color: var(--accent);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.member-vote-state {
  min-width: 66px;
  display: grid;
  justify-items: end;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
}

.member-vote-state.is-ready {
  color: var(--accent);
}

.member-vote-state.is-ready::before {
  width: 7px;
  height: 7px;
  margin-bottom: 4px;
  content: "";
  background: var(--accent);
  border-radius: 50%;
}

.member-vote-state .revealed-vote {
  color: var(--text-strong);
  font-size: 1.55rem;
  font-weight: 850;
  letter-spacing: -0.04em;
  line-height: 1;
}

.member-vote-state .revealed-caption {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.empty-team-message {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.leave-session-button {
  margin: 18px auto -4px;
}

.discussion-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  align-items: center;
  gap: 30px;
  padding: 24px 28px;
  margin-top: 18px;
  border-color: color-mix(in srgb, var(--cyan) 25%, var(--line));
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--cyan) 6%, var(--surface)), var(--surface));
}

.discussion-panel p:not(.section-kicker) {
  max-width: 700px;
  margin: 9px 0 0;
  color: var(--muted-strong);
  font-size: 0.86rem;
}

.estimate-edges {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}

.edge-card {
  min-width: 112px;
  padding: 12px 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
}

.edge-card span {
  display: block;
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.edge-card strong {
  display: block;
  margin-top: 2px;
  color: var(--text-strong);
  font-size: 1.12rem;
}

.edge-card small {
  display: block;
  max-width: 130px;
  color: var(--muted-strong);
  font-size: 0.67rem;
  overflow-wrap: anywhere;
  white-space: normal;
}

.round-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 24px;
}

.round-actions > div {
  display: flex;
  gap: 10px;
}

.round-actions > p {
  max-width: 470px;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: right;
}

.join-dialog {
  width: min(calc(100% - 32px), 440px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 0;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.join-dialog::backdrop {
  background: rgba(2, 8, 15, 0.78);
  backdrop-filter: blur(9px);
}

.join-dialog form {
  padding: 32px;
}

.dialog-mark {
  width: 46px;
  height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: 10px;
  box-shadow: 7px 7px 0 color-mix(in srgb, var(--cyan) 18%, transparent);
  font-size: 1.35rem;
  font-weight: 900;
  transform: rotate(-3deg);
}

.join-dialog h2 {
  margin: 0;
  color: var(--text-strong);
  font-size: 2rem;
  letter-spacing: -0.045em;
}

.join-dialog #join-description {
  margin: 10px 0 25px;
  color: var(--muted-strong);
  font-size: 0.9rem;
}

.join-dialog label[for="member-name"] {
  display: block;
  margin-bottom: 7px;
  color: var(--text-strong);
  font-size: 0.78rem;
  font-weight: 800;
}

.join-dialog input[type="text"] {
  width: 100%;
  min-height: 50px;
  padding: 11px 13px;
  color: var(--text-strong);
  background: var(--surface-soft);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
}

.join-dialog input[type="text"]::placeholder {
  color: var(--muted);
}

.join-dialog input[type="text"]:focus {
  border-color: var(--accent);
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.field-error {
  margin: 7px 0 0;
}

.field-help {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.7rem;
}

.join-dialog .button {
  margin-top: 18px;
}

.dialog-exit {
  min-height: 42px;
  display: grid;
  place-items: center;
  margin-top: 8px;
  color: var(--muted-strong);
  border-radius: 9px;
  font-size: 0.76rem;
  font-weight: 750;
  text-underline-offset: 4px;
}

.dialog-exit:hover {
  color: var(--text-strong);
}

.dialog-note {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 0.7rem;
  text-align: center;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  max-width: min(390px, calc(100% - 40px));
  padding: 11px 15px;
  color: var(--text-strong);
  background: var(--surface-hover);
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  box-shadow: var(--shadow);
  font-size: 0.8rem;
  font-weight: 700;
  animation: toast-in 180ms ease-out both;
}

.analytics-consent {
  position: fixed;
  right: 20px;
  bottom: 20px;
  left: 20px;
  z-index: 95;
  width: min(960px, calc(100% - 40px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px 28px;
  padding: 22px;
  margin-inline: auto;
  background: color-mix(in srgb, var(--surface-raised) 96%, transparent);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
}

.analytics-consent-copy .section-kicker {
  margin-bottom: 5px;
}

.analytics-consent-copy h2 {
  margin: 0;
  color: var(--text-strong);
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.analytics-consent-copy p:not(.section-kicker) {
  max-width: 690px;
  margin: 7px 0 8px;
  color: var(--muted-strong);
  font-size: 0.78rem;
  line-height: 1.6;
}

.analytics-consent-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(126px, 1fr));
  gap: 9px;
}

.analytics-privacy-signal {
  grid-column: 1 / -1;
  margin: -5px 0 0;
  color: var(--muted-strong);
  font-size: 0.76rem;
  font-weight: 750;
}

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

.site-footer {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.7rem;
}

.footer-brand {
  color: var(--muted-strong);
  font-weight: 800;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px 15px;
}

.footer-links a,
.text-link {
  color: var(--method-link);
  font-weight: 750;
  text-decoration-color: color-mix(in srgb, var(--method-link) 50%, transparent);
  text-underline-offset: 4px;
}

.footer-links a:hover,
.text-link:hover {
  text-decoration-color: currentColor;
}

.footer-details {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px 14px;
}

.app-version {
  color: var(--muted-strong);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.trust-view {
  padding-block: clamp(52px, 8vw, 96px) 96px;
}

.trust-hero {
  max-width: 860px;
}

.trust-hero h1 {
  margin: 0;
  color: var(--text-strong);
  font-size: clamp(2.7rem, 7vw, 5.9rem);
  letter-spacing: -0.06em;
  line-height: 0.98;
}

.trust-hero > p:last-child {
  max-width: 760px;
  margin: 24px 0 0;
  color: var(--muted-strong);
  font-size: 1rem;
  line-height: 1.7;
}

.trust-layout {
  display: grid;
  grid-template-columns: minmax(190px, 0.28fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(32px, 6vw, 82px);
  margin-top: 72px;
}

.trust-navigation {
  position: sticky;
  top: 20px;
  display: grid;
  gap: 5px;
  padding: 18px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  backdrop-filter: blur(12px);
}

.trust-navigation p {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.trust-navigation a {
  padding: 8px 9px;
  color: var(--muted-strong);
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 750;
  text-decoration: none;
}

.trust-navigation a:hover {
  color: var(--text-strong);
  background: var(--surface-hover);
}

.trust-sections {
  display: grid;
  gap: 20px;
}

.trust-card {
  padding: clamp(24px, 4vw, 44px);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 55px color-mix(in srgb, var(--bg-deep) 35%, transparent);
  scroll-margin-top: 24px;
}

.trust-card h2 {
  max-width: 760px;
  margin: 0;
  color: var(--text-strong);
  font-size: clamp(1.65rem, 3vw, 2.45rem);
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.trust-card h3 {
  margin: 30px 0 8px;
  color: var(--text-strong);
  font-size: 1rem;
}

.trust-card p,
.trust-card li {
  color: var(--muted-strong);
  font-size: 0.88rem;
  line-height: 1.72;
}

.trust-card p {
  max-width: 820px;
  margin: 16px 0 0;
}

.trust-card ul {
  display: grid;
  gap: 8px;
  padding-left: 22px;
  margin: 14px 0 0;
}

.trust-card .trust-pending {
  padding: 13px 15px;
  color: var(--text-strong);
  background: color-mix(in srgb, var(--warning) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--warning) 55%, var(--line));
  border-radius: 10px;
}

@media (max-width: 1050px) {
  .hero-shell {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .hero-copy {
    max-width: 830px;
  }

  .hero-demo {
    width: min(100%, 650px);
    justify-self: center;
  }

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

  .member-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
  }

  .discussion-panel {
    grid-template-columns: 1fr;
  }

  .estimate-edges {
    justify-content: flex-start;
  }
}

@media (max-width: 900px) {
  .trust-layout {
    grid-template-columns: 1fr;
    margin-top: 52px;
  }

  .trust-navigation {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .trust-navigation p {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  :root {
    --header-height: 76px;
  }

  .site-header,
  .site-footer,
  .landing-view,
  .session-view,
  .trust-view {
    width: min(calc(100% - 28px), var(--page-width));
  }

  .brand-copy small {
    display: none;
  }

  .theme-switcher {
    width: 195px;
  }

  .theme-option span {
    font-size: 0.66rem;
  }

  .landing-view {
    padding-top: 52px;
  }

  .analytics-consent {
    right: 14px;
    bottom: 14px;
    left: 14px;
    width: calc(100% - 28px);
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 18px;
  }

  .analytics-consent-actions {
    width: 100%;
  }

  .hero-shell {
    gap: 55px;
  }

  .hero-copy h1 {
    font-size: clamp(3rem, 14vw, 5.4rem);
  }

  .refinement-loop {
    grid-template-columns: 1fr;
    padding-top: 55px;
  }

  .room-heading {
    display: grid;
  }

  .room-heading-actions {
    justify-self: start;
  }

  .room-statusbar {
    align-items: flex-start;
    flex-direction: column;
  }

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

  #your-vote-summary {
    text-align: left;
  }

  .vote-grid {
    grid-template-columns: repeat(3, minmax(70px, 1fr));
    row-gap: 16px;
  }

  .vote-grid[data-estimation-scale="tshirt"] {
    grid-template-columns: repeat(3, minmax(70px, 1fr));
  }

  .point-face {
    min-height: 128px;
  }

  .member-list {
    grid-template-columns: 1fr;
  }

  .round-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .round-actions > p {
    max-width: none;
    text-align: left;
  }
}

@media (max-width: 540px) {
  .site-header {
    gap: 10px;
  }

  .brand-mark {
    width: 34px;
    height: 40px;
  }

  .brand-copy {
    display: none;
  }

  .theme-switcher {
    width: min(220px, calc(100vw - 82px));
  }

  .hero-copy h1 {
    font-size: clamp(2.25rem, 11vw, 3rem);
  }

  .hero-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .scale-options {
    grid-template-columns: 1fr;
  }

  .hero-actions .button {
    width: 100%;
  }

  .demo-window {
    padding: 20px;
  }

  .demo-cards {
    gap: 5px;
    margin-block: 27px;
  }

  .demo-cards span {
    border-radius: 7px;
    font-size: 0.86rem;
  }

  .loop-steps li {
    grid-template-columns: 38px 1fr;
  }

  .session-view {
    padding-top: 30px;
  }

  .room-heading h1 {
    font-size: 2.55rem;
  }

  .room-heading-actions {
    width: 100%;
  }

  .room-heading-actions .button {
    flex: 1;
  }

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

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

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

  .story-form .button {
    width: 100%;
  }

  .status-cluster {
    flex-wrap: wrap;
  }

  .vote-workspace,
  .team-panel {
    padding: 20px;
    border-radius: 18px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
  }

  .team-heading-row {
    align-items: center;
    flex-direction: row;
  }

  .vote-grid {
    gap: 10px;
  }

  .point-face {
    min-height: 112px;
  }

  .discussion-panel {
    padding: 22px;
  }

  .estimate-edges {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .round-actions > div {
    display: grid;
  }

  .round-actions .button {
    width: 100%;
  }

  .fatal-actions {
    flex-direction: column;
  }

  .join-dialog form {
    padding: 26px 22px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
  }

  .footer-details {
    justify-content: flex-start;
  }

  .footer-links {
    justify-content: flex-start;
  }

  .trust-navigation {
    grid-template-columns: 1fr;
  }

  .trust-navigation p {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (forced-colors: active) {
  .brand-mark,
  .button-primary {
    border: 2px solid ButtonText;
  }

  .theme-option input:checked + span,
  .scale-option input:checked + .scale-option-face,
  .point-card input:checked + .point-face {
    outline: 3px solid Highlight;
    outline-offset: 2px;
  }

  .connection-pill i,
  .member-vote-state.is-ready::before {
    background: CanvasText;
  }
}
