:root {
  --paper: #f4f1e9;
  --surface: #fbfaf6;
  --ink: #18201e;
  --muted: #6e7771;
  --line: #d7d6cd;
  --teal: #176c62;
  --coral: #d65e47;
  --amber: #b68028;
  --shadow: 0 18px 50px rgba(28, 38, 34, .08);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Inter, "Hiragino Sans", "Yu Gothic", sans-serif; }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .28; background-image: radial-gradient(#89928c 0.55px, transparent 0.55px); background-size: 7px 7px; }
.masthead { min-height: 164px; padding: 38px max(5vw, 28px); display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; color: #f8f6ef; background: #172b27; border-bottom: 5px solid var(--coral); }
.eyebrow, .section-number, .role-card header p { margin: 0 0 8px; font: 700 11px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .16em; }
h1 { margin: 0; font-size: clamp(30px, 4vw, 50px); line-height: 1; letter-spacing: -.04em; }
.status-block { display: flex; align-items: center; gap: 12px; min-width: 210px; padding: 14px 16px; border: 1px solid rgba(255,255,255,.2); }
.status-block div { display: grid; gap: 3px; }
.status-block small { color: #aabbb5; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: #87918d; box-shadow: 0 0 0 5px rgba(255,255,255,.06); }
.canvas-link { color: #d2e5df; border-bottom: 1px solid #66877e; padding: 8px 0; text-decoration: none; font: 700 11px/1 ui-monospace, monospace; letter-spacing: .08em; }
.status-dot.running { background: #f0bd56; animation: pulse 1.4s infinite; }
.status-dot.completed { background: #67d0ad; }
.status-dot.error, .status-dot.stopped, .status-dot.interrupted { background: #ef765f; }
@keyframes pulse { 50% { box-shadow: 0 0 0 9px rgba(240,189,86,0); } }
main { width: min(1420px, 92vw); margin: 42px auto 60px; position: relative; }
.topic-panel, .role-card, .conclusion { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.topic-panel { padding: clamp(24px, 4vw, 48px); }
.section-heading { display: flex; justify-content: space-between; gap: 30px; align-items: flex-end; margin-bottom: 24px; }
.section-heading h2, .conclusion h2 { margin: 0; font-size: 26px; letter-spacing: -.03em; }
.section-heading > p { margin: 0; max-width: 530px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.section-number { color: var(--coral); }
textarea { width: 100%; min-height: 150px; resize: vertical; border: 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); padding: 22px 2px; font: 500 17px/1.8 inherit; outline: none; }
textarea:focus { border-top-color: var(--teal); box-shadow: inset 0 2px 0 var(--teal); }
textarea::placeholder { color: #a2a79f; }
.reserved-outcome { margin-bottom:14px; padding:10px 12px; color:var(--teal); background:#e3f1ed; border-left:3px solid var(--teal); font:700 10px/1.4 ui-monospace,monospace; letter-spacing:.08em; }
.reserved-outcome strong { margin-left:8px; color:var(--ink); }
.form-footer { margin-top: 20px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; }
button { font: inherit; }
#startButton { border: 0; background: var(--coral); color: white; min-width: 210px; padding: 15px 18px; display: flex; justify-content: space-between; cursor: pointer; font-weight: 700; transition: transform .15s, background .15s; }
#startButton:hover { transform: translateY(-2px); background: #bd4b37; }
#startButton:disabled { cursor: not-allowed; opacity: .45; transform: none; }
.form-message { min-height: 20px; margin: 14px 0 -20px; color: #a23b2d; font-size: 13px; }
.council { margin-top: 54px; }
.council-heading { margin-bottom: 16px; }
.round-nav { display: flex; gap: 7px; flex-wrap: wrap; }
.round-button { border: 1px solid var(--line); background: transparent; color: var(--muted); padding: 7px 11px; cursor: pointer; font: 700 11px/1 ui-monospace, monospace; }
.round-button.active { background: var(--ink); border-color: var(--ink); color: white; }
.role-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.role-card { min-height: 430px; display: flex; flex-direction: column; box-shadow: none; }
.role-card > header { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 12px; min-height: 86px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.role-card header p { margin-bottom: 3px; color: var(--muted); }
.role-card h3 { margin: 0; font-size: 17px; }
.role-index { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid currentColor; border-radius: 50%; font: 800 15px/1 ui-monospace, monospace; }
.proposal-card .role-index { color: var(--teal); }
.critic-card .role-index { color: var(--coral); }
.mediator-card .role-index { color: var(--amber); }
.role-state { font: 700 9px/1 ui-monospace, monospace; letter-spacing: .08em; color: var(--muted); }
.role-state.done { color: var(--teal); }
.role-state.working { color: var(--amber); }
.role-content { padding: 22px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.75; flex: 1; max-height: 640px; overflow-y: auto; }
.empty { color: #989e98; }
.mediation-summary { margin: 0 0 18px; font-size: 15px; font-weight: 700; }
.decision-chip { display: inline-block; margin-bottom: 16px; padding: 6px 8px; color: white; background: var(--amber); font: 800 10px/1 ui-monospace, monospace; text-transform: uppercase; }
.detail-group { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.detail-group b { font-size: 11px; letter-spacing: .08em; }
.detail-group ul { padding-left: 18px; margin-bottom: 0; }
.conclusion { margin-top: 18px; display: grid; grid-template-columns: 280px 1fr; min-height: 210px; }
.conclusion-label { padding: 30px; color: white; background: var(--teal); }
.conclusion-label .section-number { color: #b7ddd5; }
.conclusion-content { padding: 30px clamp(30px, 5vw, 70px); display: flex; flex-direction: column; justify-content: center; line-height: 1.8; }
.conclusion-content h3 { margin: 0 0 10px; font-size: 22px; }
.conclusion-content p { margin: 0; }
.outcome-candidate{white-space:pre-wrap;overflow-wrap:anywhere}
.verdict-mark { font: 600 42px/1 ui-monospace, monospace; color: var(--teal); }
.decision-actions { margin-top: 18px; padding: 30px; display: grid; grid-template-columns: minmax(240px, .8fr) minmax(420px, 1.4fr); gap: 40px; background: #202925; color: white; border: 1px solid #202925; box-shadow: var(--shadow); }
.decision-actions[hidden], .outcome-notice[hidden] { display: none; }
.decision-meta h2 { margin: 0 0 12px; font-size: 20px; }
.decision-meta h2 span { color: #8cd8c7; font: 700 13px/1.4 ui-monospace, monospace; }
.decision-meta > p:last-child { color: #b7c2bd; font-size: 12px; line-height: 1.7; }
.decision-controls { display: grid; gap: 18px; }
.approve-button, .continue-button { border: 0; display: flex; justify-content: space-between; padding: 15px 18px; cursor: pointer; font-weight: 750; }
.approve-button { color: #12211d; background: #7cd3bc; }
.continue-button { width: 100%; color: white; background: var(--coral); }
.approve-button:disabled, .continue-button:disabled { cursor: not-allowed; opacity: .45; }
.continue-control { display: grid; gap: 8px; }
.continue-control label { color: #b7c2bd; font: 700 10px/1.2 ui-monospace, monospace; letter-spacing: .1em; }
.continue-control textarea { min-height: 90px; padding: 12px; border: 1px solid #52615b; background: #16201d; color: white; font-size: 13px; line-height: 1.6; }
.outcome-notice { margin-top: 18px; padding: 18px 22px; display: flex; justify-content: space-between; gap: 20px; color: #0e2821; background: #a5dfd0; font: 700 11px/1.4 ui-monospace, monospace; letter-spacing: .08em; }
.outcome-notice a { color:#0e2821; text-underline-offset:3px; }
.run-meta { display: flex; flex-wrap: wrap; gap: 25px; margin-top: 18px; color: var(--muted); font: 10px/1.4 ui-monospace, monospace; letter-spacing: .06em; }
.run-meta b { color: var(--ink); font-weight: 600; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 980px) { .role-grid { grid-template-columns: 1fr; } .role-card { min-height: 280px; } .conclusion, .decision-actions { grid-template-columns: 1fr; } .conclusion-label { min-height: 120px; } }
@media (max-width: 680px) { .masthead { align-items: flex-start; flex-direction: column; } main { width: min(94vw, 620px); } .section-heading { align-items: flex-start; flex-direction: column; } .form-footer { align-items: stretch; flex-direction: column; gap: 15px; } #startButton { width: 100%; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
