:root {
  --color-primary: #8600bb;
  --color-secondary: #560078;
  --color-accent: #faeefe;
  --color-accent-fg: #560078;
  --color-bg: #f6f8fa;
  --color-fg: #1b222a;
  --color-card: #ffffff;
  --color-muted: #edf1f4;
  --color-muted-fg: #47535f;
  --color-border: #dce2e8;
  --color-input: #bfc8d1;
  --color-danger: #bf2b23;
  --color-ring: #a81fe0;
  --shadow-soft: 0 18px 50px rgba(27, 34, 42, 0.08);
  --serif: "Google Sans Flex", "Google Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --sans: "Google Sans Flex", "Google Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "Google Sans Code", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --max-width: 1180px;
  --radius: 0.625rem;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0;
}

.splash-page {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 247, 248, 1)),
    linear-gradient(115deg, rgba(238, 230, 248, 0.94), rgba(255, 255, 255, 0) 44%);
  min-height: 100dvh;
  overflow: hidden;
}

body,
button,
input,
select {
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--color-ring);
  outline-offset: 3px;
}

.skip-link {
  background: var(--color-fg);
  color: var(--color-card);
  left: 16px;
  padding: 10px 14px;
  position: absolute;
  top: -100px;
  z-index: 10;
}

.skip-link:focus {
  top: 16px;
}

.site-header {
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 5;
}

.splash-page .site-header {
  position: relative;
}

.header-inner,
.hero-inner,
.section-inner,
.footer-inner {
  margin: 0 auto;
  max-width: var(--max-width);
  padding-left: 24px;
  padding-right: 24px;
}

.header-inner {
  align-items: center;
  display: flex;
  justify-content: space-between;
  min-height: 76px;
  gap: 24px;
}

.brand {
  align-items: center;
  display: inline-flex;
  gap: 12px;
  min-height: 44px;
  text-decoration: none;
}

.brand-mark {
  align-items: center;
  background: var(--color-primary);
  border-radius: 6px;
  color: var(--color-card);
  display: inline-flex;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  height: 38px;
  justify-content: center;
  width: 38px;
}

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

.brand strong {
  font-size: 16px;
  line-height: 1.1;
}

.brand small {
  color: var(--color-muted-fg);
  font-size: 13px;
  line-height: 1.2;
}

.header-note {
  color: var(--color-muted-fg);
  font-size: 14px;
  font-weight: 700;
  margin: 0;
}

.splash-main {
  align-items: center;
  display: flex;
  height: calc(100dvh - 77px);
  overflow: hidden;
}

.splash-shell {
  align-items: center;
  display: grid;
  gap: 56px;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.78fr);
  margin: 0 auto;
  max-width: var(--max-width);
  padding: 24px;
  width: 100%;
}

.splash-copy {
  max-width: 710px;
}

.splash-copy h1 {
  font-size: clamp(46px, 6.6vw, 68px);
  margin-bottom: 18px;
}

.splash-copy .hero-lede {
  font-size: clamp(18px, 2vw, 22px);
  margin-bottom: 24px;
}

.proof-list {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 20px;
}

.proof-list div {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-primary);
  border-radius: var(--radius);
  min-height: 110px;
  padding: 12px 14px;
}

.proof-list dt {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 4px;
}

.proof-list dd {
  color: var(--color-muted-fg);
  font-size: 14px;
  margin: 0;
}

.legal-links {
  color: var(--color-muted-fg);
  font-size: 14px;
  margin: 0;
}

.legal-links a {
  color: var(--color-primary);
  font-weight: 800;
  text-decoration: none;
}

.legal-links a:hover {
  text-decoration: underline;
}

.splash-page .access-panel {
  align-self: center;
}

.splash-page .access-form {
  background: transparent;
  border: 0;
  padding: 0;
}

.nav-links {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.nav-links a,
.button {
  align-items: center;
  border-radius: var(--radius);
  display: inline-flex;
  font-weight: 700;
  justify-content: center;
  min-height: 44px;
  padding: 10px 14px;
  text-decoration: none;
}

.nav-links a {
  color: var(--color-muted-fg);
  font-size: 14px;
}

.nav-links a:hover {
  color: var(--color-fg);
}

.nav-links .nav-cta {
  border: 1px solid var(--color-border);
  color: var(--color-primary);
}

.hero-section {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 247, 248, 1)),
    linear-gradient(90deg, rgba(238, 230, 248, 0.9), rgba(255, 255, 255, 0) 42%);
  border-bottom: 1px solid var(--color-border);
}

.hero-inner {
  display: grid;
  gap: 42px;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  padding-bottom: 78px;
  padding-top: 78px;
}

.hero-copy {
  align-self: center;
}

.eyebrow {
  color: var(--color-accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 12px;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.08;
}

h1 {
  font-size: clamp(40px, 7vw, 64px);
  letter-spacing: 0;
  margin-bottom: 24px;
  max-width: 780px;
}

h2 {
  font-size: clamp(30px, 5vw, 48px);
  margin-bottom: 18px;
}

h3 {
  font-size: 18px;
  line-height: 1.25;
  margin-bottom: 8px;
}

.hero-lede {
  color: var(--color-muted-fg);
  font-size: 20px;
  max-width: 690px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 15px;
}

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

.button.primary:hover {
  background: var(--color-secondary);
}

.button.secondary {
  background: var(--color-card);
  border-color: var(--color-border);
  color: var(--color-primary);
}

.hero-proof {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, 1fr);
  margin: 34px 0 0;
  max-width: 780px;
}

.hero-proof div {
  border-left: 2px solid var(--color-primary);
  padding-left: 14px;
}

.hero-proof dt {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 4px;
}

.hero-proof dd {
  color: var(--color-muted-fg);
  font-size: 14px;
  margin: 0;
}

.access-panel {
  align-self: center;
  background:
    linear-gradient(var(--color-card), var(--color-card)) padding-box,
    linear-gradient(135deg, rgba(111, 45, 189, 0.9), rgba(222, 223, 227, 0.9)) border-box;
  border: 1px solid transparent;
  border-radius: var(--radius);
  box-shadow: 0 24px 70px rgba(111, 45, 189, 0.14);
  padding: 24px;
}

.panel-heading h2 {
  font-size: clamp(30px, 4vw, 38px);
  margin-bottom: 10px;
}

.panel-heading p:not(.eyebrow) {
  color: var(--color-muted-fg);
  margin-bottom: 20px;
}

.access-panel .access-form {
  background: transparent;
  border: 0;
  padding: 0;
}

.access-note {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  display: grid;
  gap: 4px;
  margin-top: 18px;
  padding: 14px;
}

.access-note span {
  color: var(--color-muted-fg);
  font-size: 14px;
}

.governance-list div {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.status-band {
  background: var(--color-card);
  border-bottom: 1px solid var(--color-border);
  padding: 44px 0;
}

.status-inner {
  align-items: start;
  display: grid;
  gap: 32px;
  grid-template-columns: minmax(240px, 0.7fr) minmax(0, 1.3fr);
}

.status-copy h2 {
  font-size: clamp(24px, 3vw, 34px);
  margin-bottom: 0;
}

.status-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, 1fr);
}

.status-grid article {
  border-left: 2px solid var(--color-primary);
  padding: 2px 0 2px 16px;
}

.status-grid strong,
.status-grid span {
  display: block;
}

.status-grid span {
  color: var(--color-muted-fg);
  margin-top: 6px;
}

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

.packet-list article {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
}

.packet-list span {
  color: var(--color-primary);
  display: block;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 18px;
}

.packet-list p {
  color: var(--color-muted-fg);
  margin-bottom: 0;
}

.content-band {
  padding: 86px 0;
}

.content-band.muted {
  background: var(--color-muted);
}

.two-column,
.boundary-grid {
  align-items: start;
  display: grid;
  gap: 42px;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
}

.section-heading {
  max-width: 780px;
}

.document-grid {
  display: grid;
  gap: 16px;
}

.document-grid article,
.boundary-panel,
.access-form {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 22px;
}

.boundary-panel ul {
  margin: 0;
  padding-left: 22px;
}

.boundary-panel li + li {
  margin-top: 10px;
}

.document-grid {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 28px;
}

.document-grid p,
.governance-list span {
  color: var(--color-muted-fg);
}

.governance-list {
  display: grid;
  gap: 14px;
}

.governance-list div {
  background: var(--color-card);
  display: grid;
  gap: 4px;
  padding: 18px;
}

.access-form {
  color: var(--color-fg);
}

.form-row {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.splash-page .form-row {
  margin-bottom: 12px;
}

.form-row.split {
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

label {
  font-weight: 800;
}

input,
select {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-fg);
  font: inherit;
  min-height: 48px;
  padding: 10px 12px;
  width: 100%;
}

input[aria-invalid="true"],
select[aria-invalid="true"] {
  border-color: var(--color-danger);
}

.field-error,
.form-status {
  font-size: 14px;
  margin: 0;
  min-height: 22px;
}

.field-error {
  color: var(--color-danger);
}

.form-status {
  color: var(--color-primary);
  font-weight: 700;
}

.submit-button {
  width: 100%;
}

.submit-button[disabled] {
  cursor: wait;
  opacity: 0.72;
}

.hidden-field {
  height: 0;
  overflow: hidden;
  position: absolute;
  width: 0;
}

.site-footer {
  background: var(--color-card);
  border-top: 1px solid var(--color-border);
}

.footer-inner {
  align-items: center;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  padding-bottom: 26px;
  padding-top: 26px;
}

.footer-inner p {
  color: var(--color-muted-fg);
  margin: 0;
  max-width: 620px;
}

.footer-inner nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-inner a {
  color: var(--color-primary);
  font-weight: 700;
  min-height: 44px;
}

.room-session {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.room-session span {
  color: var(--color-muted-fg);
  font-weight: 700;
}

.room-main {
  background: var(--color-bg);
  min-height: calc(100dvh - 77px);
}

.room-shell {
  display: grid;
  gap: 28px;
  grid-template-columns: 260px minmax(0, 1fr) 300px;
  margin: 0 auto;
  max-width: 1640px;
  padding: 36px 24px 64px;
}

.room-sidebar {
  align-self: start;
  display: grid;
  gap: 22px;
  position: sticky;
  top: 100px;
}

.room-sidebar h1 {
  font-size: 34px;
  margin-bottom: 12px;
}

.room-sidebar p:not(.eyebrow) {
  color: var(--color-muted-fg);
  margin-bottom: 0;
}

.room-tabs {
  border-left: 1px solid var(--color-border);
  display: grid;
  gap: 2px;
  padding-left: 8px;
}

.room-tabs:empty {
  display: none;
}

.room-tabs a {
  border-radius: calc(var(--radius) * 0.8);
  color: var(--color-muted-fg);
  font-weight: 700;
  min-height: 42px;
  padding: 9px 12px;
  text-decoration: none;
}

.room-tabs a:hover,
.room-tabs a:focus-visible {
  background: var(--color-accent);
  color: var(--color-accent-fg);
}

.review-pack-rail {
  align-self: start;
  min-width: 0;
  position: sticky;
  top: 100px;
}

.review-pack {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 18px 46px rgba(27, 34, 42, 0.08);
  display: grid;
  grid-template-rows: auto auto minmax(96px, auto) auto;
  max-height: calc(100dvh - 128px);
  min-height: 280px;
  overflow: hidden;
}

.review-pack-heading {
  border-bottom: 1px solid var(--color-border);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 16px;
}

.review-pack-heading span,
.review-pack-status {
  color: var(--color-muted-fg);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.review-pack-heading strong {
  font-size: 16px;
  line-height: 1.25;
  white-space: nowrap;
}

.review-pack-empty,
.review-pack-list {
  color: var(--color-muted-fg);
  font-size: 14px;
}

.review-pack-empty {
  padding: 16px;
}

.review-pack-list {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  max-height: min(42dvh, 440px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 12px 16px 4px;
}

.review-pack-list li {
  align-items: center;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: calc(var(--radius) * 0.8);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 10px;
}

.review-pack-list span {
  color: var(--color-fg);
  font-weight: 700;
  line-height: 1.35;
}

.review-pack-list button {
  background: transparent;
  border: 0;
  color: var(--color-primary);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  min-height: 32px;
  padding: 0;
  text-align: left;
}

.review-pack-actions {
  border-top: 1px solid var(--color-border);
  display: grid;
  gap: 10px;
  padding: 16px;
}

.review-pack-download {
  width: 100%;
}

.review-pack-download[disabled] {
  cursor: not-allowed;
  opacity: 0.55;
}

.review-pack-status {
  margin: 0;
  min-height: 18px;
  text-transform: none;
}

.room-audit-note {
  border-left: 2px solid var(--color-primary);
  padding-left: 14px;
}

.room-audit-note span,
.artifact-status,
.artifact-meta,
.artifact-group-heading span {
  color: var(--color-muted-fg);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.room-audit-note strong {
  display: block;
  font-size: 14px;
  line-height: 1.45;
  margin-top: 4px;
}

.artifact-surface {
  min-width: 0;
}

.artifact-toolbar {
  align-items: start;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 20px;
}

.artifact-toolbar h2 {
  font-size: 28px;
  margin: 0;
}

.artifact-status {
  background: var(--color-muted);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-muted-fg);
  line-height: 1;
  padding: 9px 12px;
  white-space: nowrap;
}

.artifact-groups {
  display: grid;
  gap: 30px;
}

.artifact-group {
  display: grid;
  gap: 14px;
  scroll-margin-top: 110px;
}

.artifact-group-heading {
  align-items: baseline;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.artifact-group h3 {
  color: var(--color-fg);
  font-size: 19px;
  margin: 0;
}

.artifact-list {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.artifact-tile {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(27, 34, 42, 0.04);
  display: grid;
  gap: 14px;
  min-height: 100%;
  padding: 18px;
}

.artifact-tile-header {
  display: grid;
  gap: 6px;
}

.artifact-tile h4 {
  font-size: 17px;
  line-height: 1.3;
  margin: 0;
}

.artifact-description {
  color: var(--color-muted-fg);
  margin: 0;
}

.artifact-actions {
  align-self: end;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 2px;
}

@media (max-width: 920px) {
  .splash-page {
    overflow: auto;
  }

  .splash-main {
    align-items: start;
    min-height: auto;
  }

  .splash-shell {
    gap: 28px;
    grid-template-columns: 1fr;
    padding-top: 42px;
  }

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

  .hero-inner,
  .two-column,
  .boundary-grid,
  .status-inner {
    grid-template-columns: 1fr;
  }

  .hero-inner {
    min-height: auto;
    padding-top: 56px;
  }

  .document-grid,
  .packet-list,
  .status-grid,
  .hero-proof {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .room-shell {
    grid-template-columns: 1fr;
  }

  .room-sidebar {
    position: static;
  }

  .review-pack-rail {
    order: -1;
    position: sticky;
    top: 77px;
    z-index: 4;
  }

  .review-pack {
    max-height: none;
    min-height: 0;
  }

  .review-pack-list {
    max-height: 220px;
  }

  .artifact-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .artifact-status {
    white-space: normal;
  }
}

@media (max-width: 640px) {
  .header-inner,
  .splash-shell,
  .hero-inner,
  .section-inner,
  .footer-inner {
    padding-left: 18px;
    padding-right: 18px;
  }

  .header-inner {
    align-items: center;
    flex-direction: row;
    min-height: 60px;
    padding-bottom: 14px;
    padding-top: 14px;
  }

  .header-note {
    display: none;
  }

  .splash-copy h1 {
    font-size: clamp(30px, 9vw, 38px);
    margin-bottom: 8px;
  }

  .splash-copy .hero-lede {
    font-size: 14px;
    line-height: 1.35;
    margin-bottom: 10px;
  }

  .splash-shell {
    gap: 8px;
    padding-bottom: 10px;
    padding-top: 12px;
  }

  .proof-list {
    gap: 6px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 8px;
  }

  .proof-list div {
    min-height: auto;
    padding: 6px 7px;
  }

  .proof-list dt {
    font-size: 11px;
    line-height: 1.3;
    margin-bottom: 0;
  }

  .proof-list dd {
    display: none;
  }

  .legal-links {
    font-size: 13px;
    margin-bottom: 0;
  }

  .access-panel {
    padding: 14px;
  }

  .panel-heading h2 {
    font-size: 26px;
    margin-bottom: 4px;
  }

  .panel-heading p:not(.eyebrow) {
    display: none;
  }

  .splash-page .form-row {
    gap: 5px;
    margin-bottom: 8px;
  }

  label,
  .button {
    font-size: 12px;
  }

  input,
  select {
    min-height: 44px;
    padding: 8px 10px;
  }

  .access-note {
    display: none;
  }

  .field-error,
  .form-status {
    min-height: 16px;
  }

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

  .nav-links a {
    padding-left: 0;
    padding-right: 10px;
  }

  .nav-links .nav-cta {
    padding-left: 12px;
  }

  .content-band {
    padding: 62px 0;
  }

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Evidence room (private site)
   ========================================================================== */

[hidden] {
  display: none !important;
}

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

.icon-button {
  align-items: center;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: calc(var(--radius) * 0.8);
  color: var(--color-fg);
  cursor: pointer;
  display: inline-flex;
  font-size: 20px;
  height: 40px;
  justify-content: center;
  line-height: 1;
  width: 40px;
}

.room-page .button {
  align-items: center;
  border-radius: calc(var(--radius) * 0.8);
  display: inline-flex;
  font-family: var(--sans);
  font-weight: 700;
  gap: 6px;
  justify-content: center;
  min-height: 40px;
  padding: 8px 14px;
  text-decoration: none;
}

.room-page .button[disabled] {
  cursor: not-allowed;
  opacity: 0.5;
}

.room-page .button.text {
  background: transparent;
  border: 0;
  color: var(--color-primary);
  min-height: 32px;
  padding: 4px 6px;
}

.room-page .button.text.is-selected {
  background: var(--color-accent);
}

.room-header-inner {
  max-width: 1640px;
}

.room-menu-button {
  display: none;
}

.room-identity {
  display: grid;
  line-height: 1.2;
  text-align: right;
}

.room-identity strong {
  font-size: 14px;
}

.room-identity small {
  color: var(--color-muted-fg);
  font-size: 12px;
}

.mnda-pill {
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  padding: 6px 12px;
  text-decoration: none;
  white-space: nowrap;
}

.mnda-pill.is-on {
  background: #e7f6ee;
  border: 1px solid #b5e2c8;
  color: #12623a;
}

.mnda-pill.is-needed {
  background: #fff4e0;
  border: 1px solid #f2d39a;
  color: #8a4b00;
}

.room-page .room-shell {
  display: grid;
  gap: 28px;
  grid-template-columns: 236px minmax(0, 1fr) 340px;
  margin: 0 auto;
  max-width: 1640px;
  padding: 28px 24px 72px;
}

.room-page .room-sidebar {
  align-self: start;
  display: grid;
  gap: 24px;
  max-height: calc(100dvh - 110px);
  overflow: auto;
  position: sticky;
  top: 96px;
}

.room-nav {
  display: grid;
  gap: 4px;
}

.room-nav-label {
  color: var(--color-muted-fg);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 14px 0 4px 12px;
  text-transform: uppercase;
}

.room-nav-label:first-child {
  margin-top: 0;
}

.room-nav-group {
  display: grid;
  gap: 2px;
}

.room-nav a {
  align-items: center;
  border-radius: calc(var(--radius) * 0.8);
  color: var(--color-fg);
  display: flex;
  font-size: 14px;
  font-weight: 600;
  gap: 8px;
  justify-content: space-between;
  min-height: 36px;
  padding: 7px 12px;
  text-decoration: none;
}

.room-nav a:hover,
.room-nav a:focus-visible {
  background: var(--color-muted);
}

.room-nav a[aria-current] {
  background: var(--color-accent);
  color: var(--color-accent-fg);
}

.nav-lock {
  background: #fff4e0;
  border-radius: 999px;
  color: #8a4b00;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 2px 6px;
}

.room-view {
  min-width: 0;
  outline: none;
}

.room-loading {
  color: var(--color-muted-fg);
  padding: 40px 0;
}

.eyebrow-dark {
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin: 0 0 8px;
  text-transform: uppercase;
}

.room-view h1 {
  font-size: clamp(28px, 3.2vw, 40px);
  margin-bottom: 12px;
}

.room-view .lede {
  color: var(--color-muted-fg);
  font-size: 17px;
  max-width: 760px;
}

.section-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  margin: 0 0 14px;
}

.group-title {
  font-size: 19px;
  margin: 0;
}

.muted {
  color: var(--color-muted-fg);
}

.small {
  font-size: 12px;
}

.button-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.room-hero {
  margin-bottom: 24px;
}

.posture-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 32px;
}

.posture-tile {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-fg);
  display: grid;
  gap: 6px;
  padding: 16px;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.posture-tile:hover {
  border-color: var(--color-primary);
  box-shadow: 0 10px 28px rgba(134, 0, 187, 0.08);
}

.posture-tile strong {
  font-size: 15px;
  line-height: 1.3;
}

.posture-tile span {
  color: var(--color-muted-fg);
  font-size: 13px;
}

.ask-entry {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: 32px;
  padding: 20px;
}

.ask-entry-form {
  display: flex;
  gap: 10px;
}

.ask-entry-form input {
  border: 1px solid var(--color-input);
  border-radius: calc(var(--radius) * 0.8);
  flex: 1;
  font: inherit;
  min-height: 44px;
  padding: 10px 12px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.chip {
  background: var(--color-muted);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-fg);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  padding: 6px 12px;
  text-align: left;
}

.chip:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.role-section,
.changes,
.after-signing {
  margin-bottom: 32px;
}

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

.role-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  display: grid;
  gap: 8px;
  grid-template-rows: auto auto 1fr auto;
  padding: 18px;
}

.role-card h3 {
  margin: 0;
}

.role-card p {
  font-size: 13px;
  margin: 0;
}

.role-card ul {
  display: grid;
  gap: 6px;
  list-style: none;
  margin: 6px 0;
  padding: 0;
}

.role-card li a {
  color: var(--color-fg);
  font-size: 14px;
}

.role-card .button {
  justify-self: start;
}

.change-list,
.after-list {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.change-list li {
  align-items: baseline;
  border-bottom: 1px solid var(--color-border);
  display: grid;
  gap: 12px;
  grid-template-columns: 110px 1fr auto;
  padding: 8px 0;
}

.change-list span,
.change-list em {
  color: var(--color-muted-fg);
  font-size: 13px;
  font-style: normal;
}

.after-list li {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: calc(var(--radius) * 0.8);
  display: grid;
  gap: 2px;
  padding: 12px 14px;
}

.after-list span {
  color: var(--color-muted-fg);
  font-size: 13px;
}

.mnda-banner {
  background: linear-gradient(120deg, #fbf3ff, #ffffff 65%);
  border: 1px solid #e6d2f2;
  border-radius: var(--radius);
  margin-bottom: 32px;
  padding: 28px;
}

.mnda-banner p {
  max-width: 720px;
}

.notice {
  align-items: center;
  background: #fff8ec;
  border: 1px solid #f2d39a;
  border-radius: var(--radius);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 12px 16px;
}

.inline-form {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  max-width: 560px;
}

.inline-form label {
  font-size: 13px;
  font-weight: 700;
}

.inline-form-row {
  display: flex;
  gap: 8px;
}

.inline-form input,
.inline-form textarea,
.sign-form input,
.ask-form textarea,
.doc-header select {
  border: 1px solid var(--color-input);
  border-radius: calc(var(--radius) * 0.8);
  font: inherit;
  min-height: 42px;
  padding: 9px 11px;
  width: 100%;
}

.room-page .artifact-tile.is-locked {
  background: repeating-linear-gradient(135deg, #fafbfc, #fafbfc 10px, #f4f6f8 10px, #f4f6f8 20px);
  border-style: dashed;
}

.tile-title {
  font-size: 16px;
  line-height: 1.3;
  margin: 0;
}

.tile-title a {
  color: var(--color-fg);
  text-decoration: none;
}

.tile-title a:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

.artifact-proves {
  color: var(--color-muted-fg);
  font-size: 13px;
  margin: 0;
}

.page-title {
  margin: 0;
}

.back-link {
  color: var(--color-muted-fg);
  display: inline-block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
  text-decoration: none;
}

.doc-view {
  max-width: 920px;
}

.doc-header {
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 22px;
  padding-bottom: 18px;
}

.doc-meta {
  color: var(--color-muted-fg);
  font-family: var(--mono);
  font-size: 12px;
}

.doc-toc {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: 24px;
  padding: 14px 18px;
}

.doc-toc p {
  color: var(--color-muted-fg);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.doc-toc ol {
  columns: 2;
  margin: 0;
  padding-left: 18px;
}

.doc-toc a {
  color: var(--color-fg);
  font-size: 14px;
}

.doc-body {
  font-size: 15.5px;
  line-height: 1.65;
}

.doc-body h2 {
  border-top: 1px solid var(--color-border);
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 500;
  margin: 32px 0 12px;
  padding-top: 20px;
  scroll-margin-top: 96px;
}

.doc-body h3,
.doc-body h4 {
  font-size: 17px;
  margin: 22px 0 8px;
  scroll-margin-top: 96px;
}

.doc-body p,
.doc-body ul,
.doc-body ol {
  margin: 0 0 12px;
}

.doc-body a {
  color: var(--color-primary);
}

.doc-body code {
  background: var(--color-muted);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.9em;
  padding: 1px 5px;
}

.doc-table {
  margin: 12px 0 18px;
  overflow-x: auto;
}

.doc-table table,
.activity-table {
  border-collapse: collapse;
  font-size: 14px;
  width: 100%;
}

.doc-table th,
.doc-table td,
.activity-table th,
.activity-table td {
  border-bottom: 1px solid var(--color-border);
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
}

.doc-table th,
.activity-table th {
  background: var(--color-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.flash {
  animation: flash 1.6s ease;
}

@keyframes flash {
  0% {
    background: #f3e3fb;
  }
  100% {
    background: transparent;
  }
}

.proves-box {
  background: var(--color-muted);
  border-radius: calc(var(--radius) * 0.8);
  display: grid;
  font-size: 13px;
  gap: 4px 14px;
  grid-template-columns: max-content 1fr;
  margin: 14px 0 0;
  padding: 12px 14px;
}

.proves-box dt {
  font-weight: 800;
}

.proves-box dd {
  color: var(--color-muted-fg);
  margin: 0;
}

.pdf-frame {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  height: min(80dvh, 1100px);
  width: 100%;
}

.switch {
  align-items: center;
  cursor: pointer;
  display: inline-flex;
  font-size: 14px;
  font-weight: 600;
  gap: 10px;
  margin-top: 14px;
  position: relative;
}

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

.switch-track {
  background: var(--color-input);
  border-radius: 999px;
  flex: none;
  height: 22px;
  position: relative;
  transition: background 0.15s ease;
  width: 38px;
}

.switch-track::after {
  background: #fff;
  border-radius: 50%;
  content: "";
  height: 16px;
  left: 3px;
  position: absolute;
  top: 3px;
  transition: transform 0.15s ease;
  width: 16px;
}

.switch input:checked + .switch-track {
  background: var(--color-primary);
}

.switch input:checked + .switch-track::after {
  transform: translateX(16px);
}

.switch input:focus-visible + .switch-track {
  outline: 3px solid var(--color-ring);
  outline-offset: 2px;
}

/* Data flow */

.df-view {
  max-width: none;
}

.df-controls {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
}

.df-controls .switch {
  margin-top: 0;
}

.segmented {
  border: 1px solid var(--color-border);
  border-radius: calc(var(--radius) * 0.8);
  display: inline-flex;
  overflow: hidden;
}

.segmented button {
  background: var(--color-card);
  border: 0;
  border-right: 1px solid var(--color-border);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 8px 14px;
}

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

.segmented button[aria-pressed="true"] {
  background: var(--color-primary);
  color: #fff;
}

.stepper {
  display: flex;
  gap: 8px;
}

.df-step-text {
  background: var(--color-card);
  border-left: 3px solid var(--color-primary);
  margin: 14px 0;
  min-height: 46px;
  padding: 10px 14px;
}

.df-layout {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) 280px;
  margin-bottom: 28px;
}

.df-canvas {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 8px;
}

.df-canvas svg {
  display: block;
  height: auto;
  width: 100%;
}

.df-stacked {
  display: none;
}

.df-detail {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px;
  position: sticky;
  top: 96px;
}

.df-detail-title {
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 800;
  margin: 0 0 6px;
}

.df-detail-close {
  display: none;
  float: right;
}

.df-detail-list {
  display: grid;
  gap: 4px;
  margin: 10px 0 0;
}

.df-detail-list dt {
  color: var(--color-muted-fg);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  margin-top: 8px;
  text-transform: uppercase;
}

.df-detail-list dd {
  font-size: 14px;
  margin: 0;
}

.df-legend {
  display: grid;
  gap: 6px;
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
}

.df-legend li {
  align-items: center;
  display: flex;
  font-size: 13px;
  gap: 10px;
}

.df-zone-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  padding: 14px;
}

.df-zone-card-whiteboxx {
  background: #faf5fd;
  border-color: #e6d2f2;
}

.df-zone-card h3 {
  margin: 0;
}

.df-zone-card p {
  font-size: 13px;
  margin: 2px 0 10px;
}

.df-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.df-chip {
  background: #fff;
  border: 1px solid var(--color-input);
  border-radius: calc(var(--radius) * 0.8);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 10px;
}

.df-chip.is-active,
.df-chip.is-selected {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px #f0dcf9;
}

/* Agreements, activity, signing */

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

.agreement-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
}

.status-badge {
  background: var(--color-muted);
  border-radius: 999px;
  display: inline-block;
  font-size: 13px;
  font-weight: 800;
  margin: 10px 0;
  padding: 4px 10px;
}

.tone-ok .status-badge {
  background: #e7f6ee;
  color: #12623a;
}

.tone-pending .status-badge {
  background: #fff4e0;
  color: #8a4b00;
}

.agreement-rows {
  display: grid;
  font-size: 14px;
  gap: 4px 14px;
  grid-template-columns: max-content 1fr;
  margin: 0;
}

.agreement-rows dt {
  color: var(--color-muted-fg);
}

.agreement-rows dd {
  margin: 0;
}

.activity-table-wrap {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow-x: auto;
}

.doc-header select {
  margin-top: 12px;
  max-width: 260px;
}

.sign-flow {
  max-width: 820px;
}

.sign-progress {
  counter-reset: step;
  display: flex;
  gap: 8px;
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
}

.sign-progress li {
  align-items: center;
  color: var(--color-muted-fg);
  counter-increment: step;
  display: flex;
  font-size: 14px;
  font-weight: 700;
  gap: 8px;
}

.sign-progress li::before {
  align-items: center;
  border: 1px solid var(--color-input);
  border-radius: 50%;
  content: counter(step);
  display: inline-flex;
  font-size: 12px;
  height: 24px;
  justify-content: center;
  width: 24px;
}

.sign-progress li + li::after {
  display: none;
}

.sign-progress li.is-current {
  color: var(--color-primary);
}

.sign-progress li.is-current::before {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.sign-progress li.is-done::before {
  background: #e7f6ee;
  border-color: #b5e2c8;
  color: #12623a;
  content: "✓";
}

.doc-scroll {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 14.5px;
  line-height: 1.6;
  max-height: 52dvh;
  overflow: auto;
  padding: 18px 22px;
}

.doc-scroll h2 {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 800;
  margin: 18px 0 6px;
}

.sign-form {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  display: grid;
  gap: 4px;
  padding: 22px;
}

.form-grid {
  display: grid;
  gap: 0 14px;
  grid-template-columns: 1fr 1fr;
}

.sign-form .form-row {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.sign-form label,
.sign-form .label {
  font-size: 13px;
  font-weight: 700;
}

.locked-field {
  background: var(--color-muted);
  border-radius: calc(var(--radius) * 0.8);
  margin: 0;
  padding: 9px 11px;
}

.check-row {
  align-items: start;
  display: flex;
  font-size: 14px;
  gap: 10px;
  margin: 6px 0;
}

.check-row input {
  height: 18px;
  margin-top: 2px;
  width: 18px;
}

.signature-box {
  border-bottom: 1px solid var(--color-fg);
  margin: 12px 0 6px;
  padding-bottom: 6px;
}

.signature-preview {
  font-family: "Brush Script MT", "Segoe Script", cursive;
  font-size: 30px;
  margin: 4px 0 0;
  min-height: 40px;
}

.form-error {
  color: var(--color-danger);
  font-size: 14px;
  margin: 6px 0;
  min-height: 0;
}

.done-mark {
  align-items: center;
  background: #e7f6ee;
  border-radius: 50%;
  color: #12623a;
  display: inline-flex;
  font-size: 28px;
  height: 56px;
  justify-content: center;
  width: 56px;
}

.empty-state,
.locked-view {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  max-width: 720px;
  padding: 32px;
}

/* Right rail */

.room-rail {
  align-self: start;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 18px 46px rgba(27, 34, 42, 0.08);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  max-height: calc(100dvh - 112px);
  min-height: 320px;
  overflow: hidden;
  position: sticky;
  top: 96px;
}

.rail-tabs {
  border-bottom: 1px solid var(--color-border);
  display: flex;
}

.rail-tabs [role="tab"] {
  align-items: center;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--color-muted-fg);
  cursor: pointer;
  display: inline-flex;
  flex: 1;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  gap: 6px;
  justify-content: center;
  padding: 13px 10px;
}

.rail-tabs [role="tab"][aria-selected="true"] {
  border-bottom-color: var(--color-primary);
  color: var(--color-fg);
}

.rail-count {
  background: var(--color-muted);
  border-radius: 999px;
  font-size: 11px;
  padding: 1px 7px;
}

.rail-lock {
  background: #fff4e0;
  border-radius: 999px;
  color: #8a4b00;
  font-size: 10px;
  padding: 1px 6px;
}

.rail-close {
  display: none;
  margin: 6px;
}

.rail-panel {
  display: grid;
  min-height: 0;
  overflow: hidden;
}

.rail-panel[hidden] {
  display: none;
}

#rail-pack {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

#rail-ask {
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}

.rail-title {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 800;
  margin: 0;
}

.ask-head {
  align-items: center;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
}

.ask-history {
  display: grid;
  gap: 16px;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 14px;
}

.ask-item {
  border-bottom: 1px solid var(--color-border);
  display: grid;
  gap: 8px;
  padding-bottom: 14px;
}

.ask-q {
  background: var(--color-accent);
  border-radius: calc(var(--radius) * 0.8);
  color: var(--color-accent-fg);
  font-weight: 700;
  justify-self: end;
  margin: 0;
  max-width: 92%;
  padding: 8px 12px;
}

.ask-a {
  font-size: 14.5px;
  line-height: 1.6;
}

.ask-a p,
.ask-a ul {
  margin: 0 0 8px;
}

.cite {
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  vertical-align: super;
}

.ask-sources-label {
  color: var(--color-muted-fg);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  margin: 0;
  text-transform: uppercase;
}

.ask-sources {
  display: grid;
  font-size: 13px;
  gap: 4px;
  margin: 0;
  padding-left: 20px;
}

.ask-sources a {
  color: var(--color-fg);
}

.ask-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.ask-actions .button.text {
  font-size: 12px;
}

.ask-sent {
  color: #12623a;
  font-weight: 700;
  margin: 0;
}

.ask-skeleton {
  display: grid;
  gap: 6px;
}

.ask-skeleton span {
  animation: shimmer 1.2s ease-in-out infinite;
  background: linear-gradient(90deg, #eef1f4, #f7f8fa, #eef1f4);
  background-size: 200% 100%;
  border-radius: 4px;
  height: 12px;
}

.ask-skeleton span:nth-child(2) {
  width: 85%;
}

.ask-skeleton span:nth-child(3) {
  width: 60%;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.ask-form {
  border-top: 1px solid var(--color-border);
  display: grid;
  gap: 8px;
  padding: 12px 14px 6px;
}

.ask-form textarea {
  min-height: 70px;
  resize: vertical;
}

.ask-form-row {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.scope-chip {
  align-items: center;
  background: var(--color-muted);
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  gap: 6px;
  justify-self: start;
  margin: 0;
  padding: 3px 4px 3px 10px;
}

.scope-chip button {
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.ask-note {
  color: var(--color-muted-fg);
  font-size: 11.5px;
  line-height: 1.4;
  margin: 0;
  padding: 0 14px 12px;
}

.ask-locked,
.ask-empty {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.ask-locked .button {
  justify-self: start;
}

.mobile-dock,
.sheet-backdrop {
  display: none;
}

.sheet-backdrop:not([hidden]) {
  background: rgba(15, 20, 25, 0.38);
  display: block;
  inset: 0;
  position: fixed;
  z-index: 30;
}

body.ask-expanded .room-rail {
  height: min(86dvh, 900px);
  left: 50%;
  max-height: none;
  position: fixed;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(780px, 94vw);
  z-index: 40;
}

.toast-region {
  bottom: 20px;
  display: grid;
  gap: 8px;
  left: 50%;
  position: fixed;
  transform: translateX(-50%);
  z-index: 60;
}

.toast {
  background: var(--color-fg);
  border-radius: calc(var(--radius) * 0.8);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
  color: #fff;
  font-size: 14px;
  max-width: min(520px, 92vw);
  padding: 10px 16px;
  transition: opacity 0.4s ease;
}

.toast-success {
  background: #12623a;
}

.toast-error {
  background: var(--color-danger);
}

.toast.is-leaving {
  opacity: 0;
}

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

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

@media (max-width: 1100px) {
  .room-page .room-shell {
    grid-template-columns: 220px minmax(0, 1fr);
    padding-bottom: 96px;
  }

  .room-rail {
    border-radius: 16px 16px 0 0;
    bottom: 0;
    display: none;
    height: min(78dvh, 720px);
    left: 0;
    max-height: none;
    position: fixed;
    right: 0;
    top: auto;
    z-index: 40;
  }

  body.rail-open .room-rail,
  body.ask-expanded .room-rail {
    display: grid;
  }

  body.ask-expanded .room-rail {
    border-radius: var(--radius);
  }

  .rail-close {
    display: inline-flex;
  }

  .mobile-dock {
    background: var(--color-card);
    border-top: 1px solid var(--color-border);
    bottom: 0;
    display: flex;
    gap: 8px;
    left: 0;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    position: fixed;
    right: 0;
    z-index: 20;
  }

  .mobile-dock button {
    align-items: center;
    background: var(--color-muted);
    border: 1px solid var(--color-border);
    border-radius: calc(var(--radius) * 0.8);
    cursor: pointer;
    display: inline-flex;
    flex: 1;
    font: inherit;
    font-weight: 800;
    gap: 6px;
    justify-content: center;
    min-height: 44px;
  }

  .df-layout {
    grid-template-columns: 1fr;
  }

  .df-detail {
    position: static;
  }
}

@media (max-width: 920px) {
  .room-page .room-shell {
    grid-template-columns: minmax(0, 1fr);
    padding: 20px 16px 96px;
  }

  .room-menu-button {
    display: inline-flex;
  }

  .room-page .room-sidebar {
    background: var(--color-card);
    bottom: 0;
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.12);
    display: none;
    left: 0;
    max-height: none;
    padding: 20px 16px;
    position: fixed;
    top: 0;
    width: min(300px, 84vw);
    z-index: 40;
  }

  body.menu-open .room-sidebar {
    display: grid;
    align-content: start;
  }

  .room-identity {
    display: none;
  }

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

  .doc-toc ol {
    columns: 1;
  }
}

@media (max-width: 760px) {
  .df-canvas {
    display: none;
  }

  .df-stacked {
    display: block;
  }

  .df-detail {
    border-radius: 16px 16px 0 0;
    bottom: 0;
    display: none;
    left: 0;
    max-height: 70dvh;
    overflow: auto;
    position: fixed;
    right: 0;
    z-index: 45;
  }

  .df-detail.is-open {
    display: block;
  }

  .df-detail-close {
    display: inline-flex;
  }

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

  .ask-entry-form,
  .inline-form-row,
  .notice {
    flex-direction: column;
    align-items: stretch;
  }

  .change-list li {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .room-session .button {
    padding: 6px 10px;
  }

  .mnda-banner,
  .empty-state,
  .locked-view {
    padding: 20px;
  }
}

/* Wide views (data flow): the rail becomes a slide-over. */
body.view-wide .room-view {
  grid-column: 2 / 4;
}

body.view-wide .room-rail {
  display: none;
}

body.view-wide.rail-open .room-rail {
  display: grid;
  height: calc(100dvh - 120px);
  position: fixed;
  right: 24px;
  top: 96px;
  width: 360px;
  z-index: 40;
}

@media (max-width: 1100px) {
  body.view-wide .room-view {
    grid-column: auto;
  }

  body.view-wide.rail-open .room-rail {
    border-radius: 16px 16px 0 0;
    bottom: 0;
    height: min(78dvh, 720px);
    left: 0;
    right: 0;
    top: auto;
    width: auto;
  }
}

@media (max-width: 640px) {
  .room-header .brand > span:not(.brand-mark) {
    display: none;
  }

  .room-header-inner {
    gap: 10px;
  }

  .room-session {
    flex-wrap: nowrap;
    gap: 8px;
  }
}

.sso-entry { margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--color-border, #e2e5e9); }
.sso-entry h2 { margin: 0 0 .5rem; }
.sso-entry > p { font-size: .9rem; line-height: 1.5; }
.sso-button { display: flex; width: 100%; margin-top: 1rem; text-align: center; overflow-wrap: anywhere; }
/* Both entry methods remain reachable on short desktop and mobile screens. */
.splash-page { overflow: auto; }
.splash-main { height: auto; min-height: calc(100dvh - 77px); overflow: visible; }
.sso-entry .form-status:empty { display: none; }
.sso-entry .access-note { margin-bottom: 0; }
.splash-shell { align-items: start; }
.sso-entry h2 { font-size: 24px; line-height: 1.25; }
@media (min-width: 901px) { .splash-copy { padding-top: 24px; } }

.access-fallback summary { cursor: pointer; color: var(--muted); font-size: .9rem; padding: 12px 0; }
.access-fallback[open] summary { margin-bottom: 20px; }

.sso-entry[hidden], .access-fallback summary[hidden] { display: none; }
.access-fallback:not(:has(summary:not([hidden]))) .panel-heading { margin-top: 0; }

.download-menu { position: relative; }
.download-menu summary { list-style: none; cursor: pointer; }
.download-menu summary::-webkit-details-marker { display: none; }
.download-chevron { font-size: 12px; margin-left: 8px; }
.download-options {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 50;
  min-width: 190px; padding: 6px; border: 1px solid var(--color-border);
  border-radius: 10px; background: var(--color-card); box-shadow: 0 8px 24px rgba(27,34,42,.15);
}
.download-options a { display: block; padding: 10px 12px; border-radius: 6px; color: var(--color-fg); text-decoration: none; white-space: nowrap; }
.download-options a:hover, .download-options a:focus-visible { background: var(--color-muted); outline: 2px solid var(--color-primary); outline-offset: -2px; }
