:root {
  color-scheme: light;
  --ink: #24231f;
  --ink-soft: #68655c;
  --paper: #f2efe7;
  --paper-deep: #e7e1d4;
  --card: #fbf9f3;
  --line: #d6cfc0;
  --red: #b84832;
  --red-dark: #863424;
  --green: #376b62;
  --gold: #80652f;
  --shadow: 0 18px 45px rgba(49, 42, 29, 0.11);
  font-family: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    linear-gradient(rgba(60, 53, 39, 0.025) 1px, transparent 1px),
    var(--paper);
  background-size: 100% 28px;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

.serif {
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", Georgia, serif;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--red);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.muted {
  color: var(--ink-soft);
}

.lobby {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1.15fr) minmax(410px, 0.85fr);
}

.lobby-hero {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(36px, 7vw, 96px);
  color: #f8f3e8;
  background:
    radial-gradient(circle at 75% 20%, rgba(221, 181, 123, 0.18), transparent 30%),
    linear-gradient(145deg, #242825 0%, #1d2927 50%, #17201e 100%);
}

.lobby-hero::after {
  position: absolute;
  right: -120px;
  bottom: -170px;
  width: 520px;
  height: 520px;
  border: 1px solid rgba(248, 243, 232, 0.18);
  border-radius: 50%;
  box-shadow:
    0 0 0 55px rgba(248, 243, 232, 0.025),
    0 0 0 110px rgba(248, 243, 232, 0.018);
  content: "";
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.wordmark-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: 1rem;
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.hero-copy h1 {
  max-width: 700px;
  margin: 0;
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", Georgia, serif;
  font-size: clamp(4.1rem, 9vw, 8.2rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.82;
}

.hero-copy h1 span {
  display: block;
  margin-left: 0.55em;
  color: #d9b16e;
  font-style: italic;
}

.hero-copy > p {
  max-width: 590px;
  margin: 34px 0 0;
  color: rgba(248, 243, 232, 0.76);
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  line-height: 1.7;
}

.hero-foot {
  position: relative;
  z-index: 1;
  display: flex;
  max-width: 700px;
  justify-content: space-between;
  gap: 24px;
  color: rgba(248, 243, 232, 0.55);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lobby-panel {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: center;
  padding: clamp(32px, 6vw, 88px);
  background: var(--paper);
}

.lobby-panel h2 {
  margin: 0;
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", Georgia, serif;
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  font-weight: 500;
  letter-spacing: -0.03em;
}

.lobby-panel > p {
  margin: 12px 0 30px;
  color: var(--ink-soft);
  line-height: 1.6;
}

.room-list {
  display: grid;
  gap: 12px;
}

.room-choice {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(251, 249, 243, 0.7);
  text-align: left;
  cursor: pointer;
  transition: 160ms ease;
}

.room-choice:hover {
  transform: translateY(-2px);
  border-color: var(--role-accent, var(--red));
  background: var(--card);
  box-shadow: 0 10px 24px rgba(49, 42, 29, 0.08);
}

.room-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--role-accent, var(--red));
  border-radius: 50%;
  color: var(--role-accent, var(--red));
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: 1.15rem;
}

.room-choice strong,
.room-choice small {
  display: block;
}

.room-choice strong {
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: 1.25rem;
  font-weight: 600;
}

.room-choice small {
  margin-top: 3px;
  color: var(--ink-soft);
}

.arrow {
  color: var(--role-accent, var(--red));
  font-size: 1.3rem;
}

.facilitator-link {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.text-button {
  padding: 0;
  border: 0;
  color: var(--red-dark);
  background: transparent;
  font-weight: 700;
  cursor: pointer;
}

.content-note {
  margin-top: 32px;
  padding: 16px;
  border-left: 3px solid var(--gold);
  color: var(--ink-soft);
  background: rgba(128, 101, 47, 0.07);
  font-size: 0.78rem;
  line-height: 1.55;
}

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

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 68px;
  padding: 0 26px;
  border-bottom: 1px solid var(--line);
  background: rgba(242, 239, 231, 0.94);
  backdrop-filter: blur(12px);
}

.topbar .wordmark {
  color: var(--ink);
}

.topbar .wordmark-mark {
  border-color: var(--ink);
}

.phase-clock {
  display: flex;
  align-items: center;
  gap: 12px;
}

.clock {
  min-width: 74px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(184, 72, 50, 0.1);
}

.top-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.chip-button,
.secondary-button,
.primary-button,
.danger-button {
  border-radius: 2px;
  font-weight: 700;
  cursor: pointer;
  transition: 150ms ease;
}

.chip-button {
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: transparent;
  font-size: 0.75rem;
}

.chip-button:hover,
.secondary-button:hover {
  border-color: var(--ink);
  background: var(--card);
}

.workspace {
  display: grid;
  min-height: calc(100vh - 68px);
  grid-template-columns: 248px minmax(0, 1fr) 310px;
}

.left-rail,
.context-rail {
  padding: 28px 22px;
  background: rgba(231, 225, 212, 0.42);
}

.left-rail {
  border-right: 1px solid var(--line);
}

.context-rail {
  border-left: 1px solid var(--line);
}

.role-lockup {
  padding-bottom: 25px;
  border-bottom: 1px solid var(--line);
}

.role-lockup .room-mark {
  margin-bottom: 15px;
}

.role-lockup h2 {
  margin: 0;
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: 1.7rem;
  font-weight: 600;
}

.role-lockup p {
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.5;
}

.phase-nav {
  margin-top: 28px;
}

.phase-nav-title,
.rail-title {
  margin: 0 0 12px;
  color: var(--ink-soft);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.phase-step {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  min-height: 52px;
  color: #999386;
}

.phase-step::before {
  position: absolute;
  top: 25px;
  bottom: -5px;
  left: 11px;
  width: 1px;
  background: var(--line);
  content: "";
}

.phase-step:last-child::before {
  display: none;
}

.step-dot {
  position: relative;
  z-index: 1;
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper-deep);
  font-size: 0.6rem;
}

.phase-step span:last-child {
  padding-top: 3px;
  font-size: 0.77rem;
}

.phase-step.complete {
  color: var(--ink-soft);
}

.phase-step.complete .step-dot {
  border-color: var(--green);
  color: white;
  background: var(--green);
}

.phase-step.active {
  color: var(--ink);
  font-weight: 700;
}

.phase-step.active .step-dot {
  border-color: var(--red);
  color: white;
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(184, 72, 50, 0.1);
}

.room-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 36px clamp(24px, 5vw, 72px) 54px;
}

.phase-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 30px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.phase-header h1 {
  margin: 0;
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: clamp(2.5rem, 5vw, 4.4rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 0.98;
}

.phase-index {
  color: rgba(36, 35, 31, 0.14);
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: 4.2rem;
  line-height: 1;
}

.scene-card {
  margin: 25px 0;
  padding: 22px 24px;
  border-left: 3px solid var(--role-accent);
  background: rgba(251, 249, 243, 0.72);
  box-shadow: 0 8px 24px rgba(49, 42, 29, 0.05);
}

.scene-card p {
  margin: 0;
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: 1.15rem;
  line-height: 1.55;
}

.linkage-card {
  margin: -10px 0 24px;
  padding: 15px 18px;
  border: 1px dashed color-mix(in srgb, var(--role-accent), white 48%);
  background: color-mix(in srgb, var(--role-accent), white 94%);
}

.linkage-card span,
.capture-mark {
  color: var(--role-accent);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.linkage-card p {
  margin: 6px 0 0;
  color: #565148;
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  line-height: 1.55;
}

.reveal-card {
  position: relative;
  margin-bottom: 22px;
  padding: 17px 20px;
  border: 1px solid #c5b27f;
  background: #f3ead3;
}

.reveal-card::before {
  position: absolute;
  top: -7px;
  left: 18px;
  padding: 1px 7px;
  color: #6e5725;
  background: #f3ead3;
  content: "限閱";
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.reveal-card strong {
  display: block;
  margin-bottom: 5px;
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
}

.reveal-card p {
  margin: 0;
  color: #5e512f;
  font-size: 0.84rem;
  line-height: 1.55;
}

.conversation {
  min-height: 320px;
}

.message {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  max-width: 780px;
  margin: 0 0 18px;
}

.message.participant {
  margin-left: auto;
}

.avatar {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-soft);
  background: var(--card);
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: 0.75rem;
}

.message.participant .avatar {
  color: white;
  background: var(--role-accent);
}

.message-meta {
  margin-bottom: 5px;
  color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.message-body {
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--card);
  line-height: 1.55;
}

.message.participant .message-body {
  border-color: color-mix(in srgb, var(--role-accent), white 60%);
  background: color-mix(in srgb, var(--role-accent), white 90%);
}

.message-body p {
  margin: 0;
}

.capture-mark {
  display: block;
  margin-top: 9px;
}

.composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.composer input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 2px;
  outline: none;
  background: var(--card);
}

.composer input:focus,
textarea:focus {
  border-color: var(--role-accent, var(--red));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--role-accent, var(--red)), transparent 88%);
}

.primary-button {
  padding: 12px 18px;
  border: 1px solid var(--red-dark);
  color: white;
  background: var(--red);
}

.primary-button:hover {
  background: var(--red-dark);
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.secondary-button {
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: transparent;
}

.danger-button {
  padding: 10px 14px;
  border: 1px solid #a84231;
  color: #8a2f22;
  background: transparent;
}

.rail-section {
  margin-bottom: 28px;
}

.knowledge-list {
  display: grid;
  gap: 11px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.knowledge-list li {
  position: relative;
  padding-left: 17px;
  color: #57544c;
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: 0.94rem;
  line-height: 1.45;
}

.knowledge-list li::before {
  position: absolute;
  top: 0.57em;
  left: 1px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--role-accent);
  content: "";
}

.objective {
  padding: 14px;
  border: 1px solid var(--line);
  background: rgba(251, 249, 243, 0.65);
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: 0.9rem;
  line-height: 1.5;
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.suggestion {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 0.68rem;
  cursor: pointer;
}

.suggestion:hover {
  border-color: var(--role-accent);
  color: var(--role-accent);
  background: var(--card);
}

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

.submission-card h3 {
  margin: 0 0 8px;
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: 1.5rem;
}

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

.capture-card h3 {
  margin: 0 0 8px;
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: 1.45rem;
}

.capture-card > p {
  color: var(--ink-soft);
  font-size: 0.76rem;
  line-height: 1.55;
}

.captured-list {
  display: grid;
  gap: 8px;
  max-height: 230px;
  margin-top: 16px;
  overflow-y: auto;
}

.captured-list > div {
  padding: 10px 11px;
  border-left: 2px solid var(--role-accent);
  background: rgba(251, 249, 243, 0.72);
}

.captured-list span {
  color: var(--role-accent);
  font-size: 0.62rem;
  font-weight: 700;
}

.captured-list p {
  margin: 4px 0 0;
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: 0.82rem;
  line-height: 1.45;
}

.submission-card > p {
  margin: 0 0 16px;
  color: var(--ink-soft);
  font-size: 0.76rem;
  line-height: 1.5;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 11px;
}

.field label {
  color: var(--ink-soft);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field textarea {
  min-height: 82px;
  resize: vertical;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
  outline: none;
  background: var(--card);
  font-size: 0.78rem;
  line-height: 1.45;
}

.field textarea.short {
  min-height: 64px;
}

.submission-card .primary-button {
  width: 100%;
}

.submitted-state {
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--green), white 55%);
  background: color-mix(in srgb, var(--green), white 91%);
}

.submitted-state strong {
  display: block;
  margin-bottom: 6px;
  color: var(--green);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.submitted-state p {
  margin: 0;
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  line-height: 1.45;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 24px;
  bottom: 24px;
  max-width: 340px;
  padding: 13px 16px;
  border-left: 3px solid var(--green);
  background: #242825;
  color: white;
  box-shadow: var(--shadow);
  font-size: 0.8rem;
}

.facilitator {
  min-height: calc(100vh - 68px);
  padding: 34px clamp(24px, 5vw, 72px) 72px;
}

.dashboard-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 30px;
}

.dashboard-header h1 {
  margin: 0;
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: clamp(2.8rem, 6vw, 5.4rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.9;
}

.dashboard-header p:last-child {
  max-width: 530px;
  margin: 10px 0 0;
  color: var(--ink-soft);
  line-height: 1.55;
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.facilitator-note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  margin-bottom: 24px;
  padding: 17px 20px;
  border: 1px solid #c9ba91;
  background: #f3ead3;
}

.note-label {
  color: #735c28;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.facilitator-note p {
  margin: 0;
  color: #574a2d;
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
}

.agent-runtime-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  padding: 15px 19px;
  border: 1px solid color-mix(in srgb, var(--green), white 55%);
  background: color-mix(in srgb, var(--green), white 92%);
}

.agent-runtime-card.fallback {
  border-color: #c9ba91;
  background: #f3ead3;
}

.agent-runtime-card strong {
  display: block;
  margin-top: 3px;
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: 1.15rem;
}

.agent-runtime-card > div:last-child {
  text-align: right;
}

.agent-runtime-card p {
  max-width: 620px;
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: 0.72rem;
  line-height: 1.45;
}

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

.metric-card {
  padding: 17px;
  border: 1px solid var(--line);
  background: rgba(251, 249, 243, 0.74);
}

.metric-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}

.metric-head span:first-child {
  color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.metric-head strong {
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: 1.7rem;
}

.meter {
  height: 4px;
  overflow: hidden;
  background: var(--paper-deep);
}

.meter span {
  display: block;
  height: 100%;
  background: var(--red);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 20px;
}

.panel {
  border: 1px solid var(--line);
  background: rgba(251, 249, 243, 0.76);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px 19px;
  border-bottom: 1px solid var(--line);
}

.panel-header h2 {
  margin: 0;
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: 1.45rem;
}

.panel-header span {
  color: var(--ink-soft);
  font-size: 0.7rem;
}

.role-status {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 13px;
  padding: 18px 19px;
  border-bottom: 1px solid var(--line);
}

.role-status:last-child {
  border-bottom: 0;
}

.role-status h3 {
  margin: 0 0 4px;
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: 1.15rem;
}

.role-status p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.4;
}

.status-pill {
  align-self: start;
  padding: 5px 8px;
  border-radius: 99px;
  color: #8c6721;
  background: #f1e4c4;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.status-pill.ready {
  color: #2f6359;
  background: #dcebe5;
}

.ledger {
  max-height: 560px;
  overflow-y: auto;
}

.ledger-entry {
  padding: 16px 19px;
  border-bottom: 1px solid var(--line);
}

.ledger-entry:last-child {
  border-bottom: 0;
}

.ledger-entry .eyebrow {
  margin-bottom: 5px;
}

.ledger-entry p {
  margin: 0;
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: 0.93rem;
  line-height: 1.45;
}

.ledger-entry small {
  display: block;
  margin-top: 8px;
  color: var(--red-dark);
  line-height: 1.45;
}

.empty-state {
  padding: 36px 22px;
  color: var(--ink-soft);
  text-align: center;
}

.debrief {
  min-height: calc(100vh - 68px);
}

.debrief-hero {
  padding: clamp(48px, 8vw, 110px);
  color: #f7f1e5;
  background:
    radial-gradient(circle at 80% 10%, rgba(184, 72, 50, 0.24), transparent 27%),
    #1d2927;
}

.debrief-hero h1 {
  max-width: 800px;
  margin: 0;
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: clamp(3rem, 6.4vw, 6rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.9;
}

.debrief-hero h1 em {
  color: #d9b16e;
  font-weight: 400;
}

.debrief-hero > p:last-child {
  max-width: 690px;
  margin: 30px 0 0;
  color: rgba(247, 241, 229, 0.72);
  font-size: 1.05rem;
  line-height: 1.7;
}

.debrief-body {
  padding: 54px clamp(24px, 7vw, 100px) 90px;
}

.ending-card {
  display: grid;
  grid-template-columns: minmax(150px, 0.28fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 70px);
  margin: -96px 0 58px;
  padding: clamp(30px, 5vw, 58px);
  border-top: 5px solid var(--red);
  color: #f7f1e5;
  background: #2b211f;
  box-shadow: var(--shadow);
}

.ending-date {
  color: #d9b16e;
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: clamp(1.9rem, 3vw, 3rem);
  line-height: 1;
}

.ending-card h2 {
  max-width: 760px;
  margin: 0 0 20px;
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 0.98;
}

.ending-card p {
  max-width: 820px;
  color: rgba(247, 241, 229, 0.7);
  line-height: 1.68;
}

.ending-card .ending-lead {
  color: #f7f1e5;
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: clamp(1.18rem, 2vw, 1.48rem);
}

.historical-note {
  display: grid;
  grid-template-columns: minmax(160px, 0.3fr) 1fr;
  gap: 32px;
  margin-bottom: 55px;
  padding-bottom: 38px;
  border-bottom: 1px solid var(--line);
}

.historical-note h2,
.reflection-section h2 {
  margin: 0;
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: 2rem;
  font-weight: 500;
}

.historical-note p {
  max-width: 780px;
  margin: 0;
  color: var(--ink-soft);
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: 1.18rem;
  line-height: 1.65;
}

.timeline-title {
  margin-bottom: 22px;
}

.timeline-title h2 {
  margin: 0;
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: 2.5rem;
  font-weight: 500;
}

.timeline-title p {
  color: var(--ink-soft);
}

.section-space {
  margin-top: 68px;
}

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

.case-chain {
  position: relative;
  display: grid;
  gap: 14px;
}

.case-chain::before {
  position: absolute;
  top: 28px;
  bottom: 28px;
  left: 31px;
  width: 1px;
  background: var(--line);
  content: "";
}

.case-chain-step {
  position: relative;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 22px;
  padding: 25px 28px 25px 0;
  border: 1px solid var(--line);
  background: rgba(251, 249, 243, 0.82);
}

.case-chain-step.fatal {
  border-color: #8c382a;
  color: #f7f1e5;
  background: #3a201c;
}

.chain-number {
  z-index: 1;
  display: grid;
  width: 62px;
  min-height: 62px;
  place-items: center;
  align-self: start;
  color: white;
  background: var(--red);
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: 1.35rem;
}

.case-chain-step h3 {
  margin: 2px 0 18px;
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: 1.65rem;
  font-weight: 600;
}

.chain-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.chain-columns > div {
  padding: 16px;
  background: var(--card);
}

.fatal .chain-columns {
  background: rgba(255, 255, 255, 0.16);
}

.fatal .chain-columns > div {
  background: rgba(255, 255, 255, 0.06);
}

.chain-columns span,
.source-record > span,
.power-note span {
  color: var(--red-dark);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.07em;
}

.fatal .chain-columns span {
  color: #d9b16e;
}

.chain-columns p {
  margin: 7px 0 0;
  color: var(--ink-soft);
  line-height: 1.55;
}

.fatal .chain-columns p {
  color: rgba(247, 241, 229, 0.82);
}

.evidence-links {
  margin: 16px 0 0;
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.evidence-links a {
  display: inline-block;
  margin-left: 5px;
  color: var(--red);
  font-weight: 700;
  text-decoration: none;
}

.fatal .evidence-links,
.fatal .evidence-links a {
  color: #d9b16e;
}

.structural-card {
  min-height: 270px;
  padding: 22px;
  border-top: 3px solid var(--red);
  background: var(--card);
  box-shadow: 0 10px 30px rgba(49, 42, 29, 0.07);
}

.structural-card > span,
.reconstruction-number {
  color: var(--red);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.11em;
}

.structural-card h3 {
  margin: 38px 0 14px;
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: 1.55rem;
  font-weight: 600;
  line-height: 1.15;
}

.structural-card p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.62;
}

.phase-reconstruction {
  display: grid;
  gap: 20px;
}

.reconstruction-card {
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(251, 249, 243, 0.76);
}

.reconstruction-card > header {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 18px;
  align-items: start;
  padding: 24px;
  border-bottom: 1px solid var(--line);
}

.reconstruction-number {
  color: rgba(36, 35, 31, 0.22);
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: 3.4rem;
  letter-spacing: -0.04em;
  line-height: 0.9;
}

.reconstruction-card h3 {
  margin: 0;
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: 2rem;
  font-weight: 500;
}

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

.reconstruction-actions > div {
  padding: 22px 24px;
  border-right: 1px solid var(--line);
}

.reconstruction-actions > div:last-child {
  border-right: 0;
}

.reconstruction-actions strong {
  color: var(--green);
  font-size: 0.73rem;
  letter-spacing: 0.04em;
}

.reconstruction-actions p {
  margin: 8px 0 0;
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  line-height: 1.55;
}

.reconstruction-analysis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: #e9e2d5;
}

.reconstruction-analysis > div {
  padding: 19px 24px;
  border-right: 1px solid #d3c8b7;
}

.reconstruction-analysis > div:last-child {
  border-right: 0;
}

.reconstruction-analysis span,
.transformation-body span {
  color: var(--red-dark);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.reconstruction-analysis p {
  margin: 7px 0 0;
  color: #514b41;
  font-size: 0.84rem;
  line-height: 1.55;
}

.transformation-list {
  border-top: 1px solid var(--line);
}

.transformation-card {
  border-bottom: 1px solid var(--line);
}

.transformation-card summary {
  display: grid;
  grid-template-columns: minmax(120px, 0.25fr) 1fr auto;
  gap: 24px;
  align-items: baseline;
  padding: 20px 4px;
  cursor: pointer;
  list-style: none;
}

.transformation-card summary::-webkit-details-marker {
  display: none;
}

.transformation-card summary::after {
  grid-column: 3;
  color: var(--red);
  content: "+";
  font-size: 1.35rem;
}

.transformation-card[open] summary::after {
  content: "−";
}

.transformation-card summary span {
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.transformation-card summary strong {
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: 1.12rem;
  font-weight: 600;
}

.transformation-body {
  display: block;
  padding: 0 0 22px;
}

.transformation-body p {
  margin: 7px 0 0;
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  line-height: 1.5;
}

.source-record {
  padding: 22px;
  border-left: 3px solid var(--green);
  background: rgba(55, 107, 98, 0.07);
}

.source-record blockquote {
  margin: 8px 0 18px;
  padding: 14px 17px;
  border-left: 3px solid var(--green);
  background: var(--card);
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: 1.12rem;
  line-height: 1.55;
}

.distortion-ladder {
  display: grid;
  grid-template-columns: repeat(7, minmax(160px, 1fr));
  overflow-x: auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.distortion-ladder > div {
  position: relative;
  min-height: 230px;
  padding: 19px;
  border-right: 1px solid var(--line);
  background: rgba(251, 249, 243, 0.78);
}

.distortion-ladder > div::after {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: -8px;
  color: var(--red);
  content: "→";
  font-weight: 700;
}

.distortion-ladder > div:last-child::after {
  display: none;
}

.distortion-ladder > .fatal-step {
  color: #f7f1e5;
  background: #3a201c;
}

.distortion-ladder span {
  color: var(--red-dark);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.distortion-ladder .fatal-step span {
  color: #d9b16e;
}

.power-note {
  padding: 17px 22px;
  background: #e9e2d5;
}

.transformation-body > p {
  padding: 0 22px;
}

.grounding-section {
  display: grid;
  grid-template-columns: minmax(250px, 0.65fr) 1fr;
  gap: clamp(36px, 7vw, 90px);
  margin-top: 68px;
  padding: clamp(32px, 5vw, 56px);
  color: #f7f1e5;
  background: #1d2927;
}

.grounding-section h2 {
  margin: 0;
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: clamp(2rem, 4vw, 3.6rem);
  font-weight: 500;
  line-height: 1.05;
}

.grounding-summary {
  color: rgba(247, 241, 229, 0.72);
  line-height: 1.65;
}

.grounding-section ul {
  margin: 0;
  padding-left: 1.15rem;
}

.grounding-section li {
  margin-bottom: 15px;
  color: rgba(247, 241, 229, 0.82);
  line-height: 1.58;
}

.source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.source-links a {
  padding: 9px 12px;
  border: 1px solid rgba(217, 177, 110, 0.55);
  color: #d9b16e;
  text-decoration: none;
  font-size: 0.76rem;
  font-weight: 700;
}

.source-links a:hover {
  color: #1d2927;
  background: #d9b16e;
}

.comparison {
  display: grid;
  grid-template-columns: 90px 1fr 1fr;
  border-top: 1px solid var(--line);
}

.comparison > div {
  padding: 20px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.comparison > div:nth-child(3n) {
  border-right: 0;
}

.comparison-head {
  color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.comparison-meta {
  color: var(--ink-soft);
  font-size: 0.7rem;
}

.comparison-copy {
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  line-height: 1.55;
}

.comparison-copy.case {
  color: #71372c;
  background: rgba(184, 72, 50, 0.045);
}

.reflection-section {
  display: grid;
  grid-template-columns: minmax(230px, 0.5fr) 1fr;
  gap: 45px;
  margin-top: 65px;
}

.reflection-list {
  counter-reset: reflections;
  margin: 0;
  padding: 0;
  list-style: none;
}

.reflection-list li {
  counter-increment: reflections;
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 15px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: 1.15rem;
  line-height: 1.45;
}

.reflection-list li::before {
  color: var(--red);
  content: "0" counter(reflections);
  font-family: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
}

.principle-card {
  margin-top: 36px;
  padding: 22px;
  border-left: 3px solid var(--green);
  background: rgba(55, 107, 98, 0.08);
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: 1.15rem;
  line-height: 1.6;
}

.ambient-line {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: baseline;
  max-width: 720px;
  margin: 14px auto;
  padding: 11px 16px;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
  background: rgba(231, 225, 212, 0.32);
}

.ambient-tag {
  color: var(--ink-soft);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ambient-line p {
  margin: 0;
  color: #6b665b;
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: 0.92rem;
  font-style: italic;
  line-height: 1.55;
}

.ambient-line em {
  color: var(--ink);
  font-style: normal;
  font-weight: 600;
}

.ambient-line.ripple {
  border-color: color-mix(in srgb, var(--gold), white 35%);
  background: rgba(128, 101, 47, 0.08);
}

.ambient-line.ripple .ambient-tag {
  color: var(--gold);
}

.ambient-line.whisper {
  border-color: #9aa6b0;
  background: rgba(92, 104, 116, 0.08);
}

.ambient-line.whisper .ambient-tag {
  color: #5d6b78;
}

.ambient-line.whisper p {
  color: #54606b;
  font-style: normal;
  letter-spacing: 0.02em;
}

/* 隨案情升溫，房間逐漸轉冷（由 role_state 的 chill 控制不透明度） */
.chill-veil {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  background: linear-gradient(160deg, #4a5a6e, #2b3540);
  mix-blend-mode: multiply;
  transition: opacity 1.2s ease;
}

.last-ordinary {
  position: relative;
  z-index: 1;
  margin: -70px 0 44px;
  padding: clamp(26px, 4vw, 44px);
  border-top: 4px solid var(--gold);
  background: #f5ecd8;
  box-shadow: var(--shadow);
}

.last-ordinary + .ending-card {
  margin-top: 0;
}

.last-ordinary h2 {
  margin: 6px 0 14px;
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 500;
}

.last-ordinary-intro {
  max-width: 760px;
  margin: 0 0 22px;
  color: #6a5a36;
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: 1.1rem;
  line-height: 1.7;
}

.ordinary-lines {
  display: grid;
  gap: 12px;
  margin-bottom: 22px;
}

.ordinary-line {
  padding: 12px 16px;
  border-left: 3px solid color-mix(in srgb, var(--gold), white 30%);
  background: rgba(251, 249, 243, 0.7);
}

.ordinary-line strong {
  color: var(--gold);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
}

.ordinary-line p {
  margin: 5px 0 0;
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: 1.02rem;
  line-height: 1.5;
}

.last-ordinary-closing {
  max-width: 760px;
  margin: 0;
  color: #6e3c2c;
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: 1.12rem;
  line-height: 1.7;
}

.scene-closed {
  margin-top: auto;
  padding: 18px 20px;
  border-top: 3px solid var(--green);
  background: color-mix(in srgb, var(--green), white 90%);
}

.scene-closed strong {
  display: block;
  margin-bottom: 6px;
  color: var(--green);
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: 1.1rem;
}

.scene-closed p {
  margin: 0;
  color: #4b5650;
  font-size: 0.86rem;
  line-height: 1.55;
}

.converge-button {
  display: block;
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.converge-button:hover {
  color: var(--red-dark);
}

.world-card {
  margin-bottom: 26px;
  padding: 16px 19px;
  border: 1px solid var(--line);
  background: rgba(251, 249, 243, 0.74);
}

.world-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 12px;
}

.world-grid span {
  color: var(--ink-soft);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.world-grid p {
  margin: 6px 0 0;
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: 1.05rem;
}

.world-meter {
  color: var(--red);
  letter-spacing: 0.12em;
}

.scene-chip {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 99px;
  font-family: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  vertical-align: middle;
}

.scene-chip.open {
  color: var(--ink-soft);
  background: var(--paper-deep);
}

.scene-chip.closing {
  color: #8c6721;
  background: #f1e4c4;
}

.scene-chip.closed {
  color: #2f6359;
  background: #dcebe5;
}

.briefing {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: clamp(24px, 5vw, 60px);
  background:
    radial-gradient(circle at 78% 12%, color-mix(in srgb, var(--role-accent), transparent 86%), transparent 34%),
    var(--paper);
}

.briefing-card {
  width: 100%;
  max-width: 640px;
  padding: clamp(26px, 4vw, 46px);
  border: 1px solid var(--line);
  border-top: 4px solid var(--role-accent);
  background: var(--card);
  box-shadow: var(--shadow);
}

.briefing-back {
  margin-bottom: 22px;
  font-size: 0.78rem;
}

.briefing-lockup {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
  margin: 6px 0 26px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.briefing-lockup h1 {
  margin: 0;
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: clamp(2.4rem, 6vw, 3.4rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
}

.briefing-lockup p {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 0.84rem;
  letter-spacing: 0.04em;
}

.briefing-body {
  display: grid;
  gap: 20px;
}

.briefing-body section span {
  color: var(--role-accent);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.briefing-body section p {
  margin: 7px 0 0;
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: 1.05rem;
  line-height: 1.65;
}

.briefing-objective {
  padding: 15px 17px;
  border-left: 3px solid var(--role-accent);
  background: color-mix(in srgb, var(--role-accent), white 92%);
}

.briefing-objective p {
  font-size: 0.96rem !important;
}

.briefing-setting {
  margin: 26px 0 0;
  color: var(--ink-soft);
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  line-height: 1.6;
}

.briefing-note {
  margin: 14px 0 0;
  padding: 14px 16px;
  border-left: 3px solid var(--gold);
  background: rgba(128, 101, 47, 0.07);
  color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1.55;
}

.briefing-enter {
  width: 100%;
  margin-top: 30px;
  padding: 15px 18px;
  border-color: var(--role-accent);
  background: var(--role-accent);
}

.briefing-enter:hover {
  filter: brightness(0.92);
  background: var(--role-accent);
}

.facilitator-login {
  --role-accent: var(--ink);
}

.facilitator-login h1 {
  margin: 14px 0 10px;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 600;
}

.facilitator-login > .muted {
  margin: 0 0 24px;
  font-size: 0.86rem;
  line-height: 1.6;
}

.login-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.login-form input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 2px;
  outline: none;
  background: var(--card);
}

.login-form input:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(36, 35, 31, 0.08);
}

.login-form .primary-button {
  padding: 12px 18px;
}

.login-error {
  margin: 14px 0 0;
  color: var(--red-dark);
  font-size: 0.82rem;
  font-weight: 700;
}

.resolving-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 75% 20%, rgba(221, 181, 123, 0.16), transparent 32%),
    linear-gradient(145deg, #242825 0%, #1d2927 55%, #17201e 100%);
}

.resolving-card {
  max-width: 520px;
  text-align: center;
  color: #f7f1e5;
}

.resolving-card .eyebrow {
  color: #d9b16e;
}

.resolving-card h1 {
  margin: 0 0 16px;
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-weight: 500;
  letter-spacing: -0.03em;
}

.resolving-card p:last-child {
  margin: 0;
  color: rgba(247, 241, 229, 0.74);
  line-height: 1.7;
}

.resolving-spinner {
  width: 42px;
  height: 42px;
  margin: 0 auto 28px;
  border: 2px solid rgba(247, 241, 229, 0.18);
  border-top-color: #d9b16e;
  border-radius: 50%;
  animation: resolving-spin 0.9s linear infinite;
}

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

.pdf-button {
  margin-top: 30px;
  padding: 11px 18px;
  border: 1px solid rgba(217, 177, 110, 0.6);
  border-radius: 2px;
  color: #d9b16e;
  background: transparent;
  font-weight: 700;
  cursor: pointer;
  transition: 150ms ease;
}

.pdf-button:hover {
  color: #1d2927;
  background: #d9b16e;
}

.ledger-table {
  overflow: hidden;
  border: 1px solid var(--line);
}

.ledger-row {
  display: grid;
  grid-template-columns: 130px repeat(3, minmax(0, 1fr));
}

.ledger-row + .ledger-row {
  border-top: 1px solid var(--line);
}

.ledger-head {
  background: #e9e2d5;
}

.ledger-head span {
  padding: 14px 16px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.ledger-c-happened {
  color: var(--green);
}

.ledger-c-recorded {
  color: var(--red-dark);
}

.ledger-c-remembered {
  color: var(--gold);
}

.ledger-beat {
  display: flex;
  align-items: center;
  padding: 16px;
  border-right: 1px solid var(--line);
  background: rgba(231, 225, 212, 0.5);
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: 0.98rem;
  font-weight: 600;
}

.ledger-cell {
  padding: 16px;
  border-right: 1px solid var(--line);
}

.ledger-cell:last-child {
  border-right: 0;
}

.ledger-cell.recorded {
  background: rgba(184, 72, 50, 0.05);
}

.ledger-cell.remembered {
  background: rgba(128, 101, 47, 0.05);
}

.ledger-cell p {
  margin: 0;
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: 0.92rem;
  line-height: 1.55;
}

@media (max-width: 900px) {
  .ledger-head {
    display: none;
  }

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

  .ledger-beat {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: var(--paper-deep);
    font-size: 1.05rem;
  }

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

  .ledger-cell::before {
    display: block;
    margin-bottom: 5px;
    content: attr(data-col);
    color: var(--ink-soft);
    font-family: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
  }
}

.transformation-groups {
  display: grid;
  gap: 34px;
}

.transformation-group {
  border: 1px solid var(--line);
  background: rgba(251, 249, 243, 0.7);
}

.transformation-group-head {
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}

.transformation-group-head span {
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.transformation-group-head strong {
  display: block;
  margin: 6px 0 10px;
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: 1.45rem;
  font-weight: 600;
}

.transformation-group-head p {
  margin: 0;
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  line-height: 1.5;
}

.transformation-group .transformation-card {
  border-bottom: 1px solid var(--line);
}

.transformation-group .transformation-card summary {
  grid-template-columns: minmax(90px, 0.2fr) 1fr auto;
  padding: 16px 24px;
}

.quote-track {
  padding: 20px 24px 24px;
}

.quote-track-title {
  margin: 0 0 14px;
  color: var(--ink-soft);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.quote-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.24fr) minmax(0, 1fr);
  gap: 8px 22px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.quote-row:first-of-type {
  border-top: 0;
}

.quote-period {
  color: var(--red-dark);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.quote-row blockquote {
  margin: 0;
  padding: 11px 15px;
  border-left: 3px solid var(--green);
  background: var(--card);
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: 1.05rem;
  line-height: 1.55;
}

.quote-row.defaulted blockquote {
  border-left-color: var(--line);
  color: var(--ink-soft);
  font-style: italic;
}

.quote-power {
  grid-column: 2;
  margin: 2px 0 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.5;
}

.quote-power span {
  margin-right: 8px;
  color: var(--red-dark);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

@media print {
  .topbar,
  .composer,
  .converge-button,
  .pdf-button,
  .dashboard-actions,
  .danger-button,
  [data-action] {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .debrief-hero,
  .ending-card,
  .grounding-section {
    color: #1d2927 !important;
    background: #fff !important;
  }

  .debrief-hero h1,
  .debrief-hero h1 em,
  .ending-date,
  .ending-card h2 {
    color: #1d2927 !important;
  }

  .debrief-hero > p:last-child,
  .ending-card p,
  .grounding-summary,
  .grounding-section li {
    color: #333 !important;
  }

  .case-chain-step.fatal,
  .distortion-ladder > .fatal-step {
    color: #1d2927 !important;
    background: #f3ead3 !important;
  }

  .transformation-card[open] .transformation-body,
  .distortion-ladder {
    display: grid !important;
  }

  .distortion-ladder {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    overflow: visible;
  }

  .transformation-group,
  .case-chain-step,
  .reconstruction-card,
  .quote-row {
    break-inside: avoid;
  }
}

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

  .context-rail {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .submission-card,
  .capture-card {
    padding-top: 0;
    border-top: 0;
  }

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

  .lobby-hero,
  .lobby-panel {
    min-height: auto;
  }

  .lobby-hero {
    gap: 100px;
  }

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

  .transformation-body {
    display: block;
  }
}

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: 1fr auto;
    padding: 0 15px;
  }

  .phase-clock {
    grid-row: 2;
    grid-column: 1 / -1;
    justify-content: center;
    padding: 8px;
    border-top: 1px solid var(--line);
  }

  .workspace {
    display: block;
  }

  .left-rail {
    padding: 18px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .role-lockup {
    display: grid;
    grid-template-columns: 50px 1fr;
    align-items: center;
    padding: 0;
    border: 0;
  }

  .role-lockup .room-mark {
    grid-row: 1 / 3;
    margin: 0;
  }

  .phase-nav {
    display: none;
  }

  .room-main {
    padding: 28px 18px 40px;
  }

  .phase-header {
    gap: 12px;
  }

  .phase-index {
    font-size: 2.8rem;
  }

  .context-rail {
    display: block;
    padding: 24px 18px;
  }

  .dashboard-header,
  .historical-note,
  .reflection-section,
  .ending-card,
  .grounding-section {
    display: block;
  }

  .ending-card {
    margin-top: -74px;
    padding: 26px 22px;
  }

  .ending-date {
    margin-bottom: 28px;
  }

  .structural-grid,
  .reconstruction-actions,
  .reconstruction-analysis {
    grid-template-columns: 1fr;
  }

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

  .case-chain-step {
    grid-template-columns: 50px 1fr;
    gap: 14px;
    padding-right: 16px;
  }

  .chain-number {
    width: 50px;
    min-height: 50px;
  }

  .structural-card {
    min-height: auto;
  }

  .structural-card h3 {
    margin-top: 22px;
  }

  .reconstruction-card > header {
    grid-template-columns: 52px 1fr;
    padding: 20px 18px;
  }

  .reconstruction-number {
    font-size: 2.5rem;
  }

  .reconstruction-actions > div,
  .reconstruction-analysis > div,
  .transformation-body > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .transformation-card summary {
    grid-template-columns: 1fr auto;
    gap: 8px;
  }

  .transformation-card summary span,
  .transformation-card summary strong {
    grid-column: 1;
  }

  .transformation-card summary::after {
    grid-row: 1 / 3;
    grid-column: 2;
  }

  .dashboard-actions {
    justify-content: flex-start;
    margin-top: 22px;
  }

  .metric-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

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

  .comparison > div {
    border-right: 0;
  }

  .comparison-head:nth-child(2),
  .comparison-head:nth-child(3) {
    display: none;
  }

  .comparison-meta {
    padding-bottom: 5px !important;
    border-bottom: 0 !important;
  }

  .comparison-copy {
    padding-top: 5px !important;
  }

  .comparison-copy.case::before,
  .comparison-copy:not(.case)::before {
    display: block;
    margin-bottom: 7px;
    color: var(--ink-soft);
    font-family: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  .comparison-copy:not(.case)::before {
    content: "生活中的說法";
  }

  .comparison-copy.case::before {
    content: "案卷裡的說法";
  }

  .reflection-list {
    margin-top: 22px;
  }
}
