:root {
  color-scheme: light;
  --ink: #172820;
  --muted: #66746c;
  --green: #235e4b;
  --green-dark: #20382e;
  --line: #dce5df;
  --paper: #f4f7f4;
  --gold: #c38a35;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); }
.topbar { height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 max(24px, calc((100vw - 1120px) / 2)); color: #f7fbf8; background: var(--green-dark); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; font-size: 15px; letter-spacing: .06em; text-decoration: none; }
.brand b { font-weight: 800; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: var(--green-dark); background: #cde1d4; font-weight: 800; }
.topbar-right { display: flex; align-items: center; gap: 22px; font-size: 13px; }
.connection-state { color: #d0d9d3; }
.connection-state.connected { color: #a9dfb5; }
.quiet-link { color: #e0e9e3; text-decoration: none; }
.page { width: min(960px, calc(100% - 40px)); margin: 52px auto 30px; }
.page.gm-wide { width: min(1280px, calc(100% - 32px)); margin-top: 20px; }
.intro { margin-bottom: 27px; }
.eyebrow { margin: 0 0 9px; color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .12em; }
h1 { margin: 0; font-size: clamp(30px, 4vw, 42px); letter-spacing: -.04em; }
.lede { max-width: 650px; margin: 12px 0 0; color: var(--muted); font-size: 16px; line-height: 1.55; }
.panel { margin: 18px 0; padding: 26px 29px; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: 0 12px 30px #243a2a0b; }
.panel-copy { max-width: 640px; }
.panel h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.panel-copy p:not(.eyebrow) { color: var(--muted); line-height: 1.55; }
.button { min-height: 42px; padding: 0 17px; border: 1px solid transparent; border-radius: 8px; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.button:disabled { opacity: .45; cursor: not-allowed; }
.primary { color: white; background: var(--green); }
.secondary { color: var(--green); border-color: #b9cbbf; background: white; }
.select-row { display: grid; gap: 8px; max-width: 580px; margin: 21px 0 15px; }
.select-row label { font-size: 13px; font-weight: 700; }
select { width: 100%; height: 46px; padding: 0 13px; border: 1px solid #b7c7bc; border-radius: 8px; color: var(--ink); background: white; font: inherit; }
.module-accordion { border: 1px solid var(--line); border-radius: 10px; background: #fff; overflow: hidden; }
.module-accordion.is-expanded { border-color: var(--green); box-shadow: 0 0 0 1px var(--green); }
.module-accordion .module-row { width: 100%; border: none; border-radius: 0; background: #fff; }
.module-accordion.is-expanded .module-row { background: #f5faf6; border-bottom: 1px solid var(--line); }
.module-details { padding: 14px 16px 16px; background: #f8faf8; }
.module-details-meta { margin: 0 0 10px; font-size: 13px; line-height: 1.45; }
.module-details .status { display: inline-block; margin-bottom: 10px; }
.module-details p:last-child { margin: 0; font-size: 13px; line-height: 1.45; }
.module-menu { position: fixed; z-index: 40; min-width: 180px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 12px 28px #243a2a22; }
.module-menu-item { display: block; width: 100%; margin: 0; padding: 8px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--ink); font: inherit; font-size: 14px; font-weight: 650; text-align: left; cursor: pointer; }
.module-menu-item:hover, .module-menu-item:focus { background: #f5faf6; color: var(--green); outline: none; }
.panel-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }
.panel-actions--cluster { justify-content: flex-start; flex-wrap: wrap; }
a.button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
a.button.secondary { color: var(--green); }
a.button.primary { color: white; }
.overview-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 4px; }
.overview-heading h2 { margin: 0 0 6px; font-size: clamp(24px, 3vw, 28px); line-height: 1.15; letter-spacing: -.02em; }
#overview-subtitle { margin: 0; font-size: 15px; line-height: 1.45; max-width: 42rem; }
.muted { color: var(--muted); }
.overview-description { margin: 16px 0 0; color: #35473d; font-size: 16px; line-height: 1.65; }
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  gap: 14px 18px;
  margin: 22px 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8faf8;
}
.fact-item { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.facts dt { margin: 0; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; }
.facts dd { margin: 0; font-size: 15px; font-weight: 650; line-height: 1.35; word-break: break-word; }
.overview-actions { align-items: center; flex-wrap: wrap; }
.overview-actions__primary { margin-top: 0; flex: 1 1 auto; justify-content: flex-end; min-width: min(100%, 20rem); }
.status { flex: none; padding: 7px 10px; border-radius: 20px; color: #795922; background: #f8f0df; font-size: 12px; font-weight: 750; }
.status.published { color: #275a3e; background: #e7f3e9; }
.notice { padding: 12px 14px; border-left: 3px solid var(--gold); border-radius: 6px; color: #65552f; background: #faf7ef; font-size: 13px; line-height: 1.5; }
.message { min-height: 22px; color: var(--muted); font-size: 13px; }
.message[data-kind="error"] { color: #a13d35; }
.workspace-feedback { min-height: 1.25rem; margin: 0 0 12px; font-size: 14px; font-weight: 600; }
.workspace-feedback[data-kind="success"] { color: #275a3e; }
.workspace-feedback[data-kind="error"] { color: #a13d35; }
footer { margin: 37px 0 0; padding-top: 17px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.hidden { display: none !important; }
@media (max-width: 650px) {
  .topbar { padding: 0 18px; }
  .topbar-right { gap: 11px; font-size: 12px; }
  .page { margin-top: 30px; }
  .panel { padding: 21px; }
  .panel-actions { flex-direction: column-reverse; }
  .panel-actions .button { width: 100%; }
  .overview-heading { flex-direction: column; }
  .overview-actions { flex-direction: column; align-items: stretch; }
  .overview-actions__primary { justify-content: stretch; flex-direction: column; }
}

.module-list { display: grid; gap: 10px; margin: 18px 0 8px; }
.module-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px 14px;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.module-row strong { font-size: 14px; min-width: 0; }
.module-row-meta { font-size: 12px; white-space: nowrap; }
.module-row-chevron { color: var(--muted); font-size: 12px; line-height: 1; }
.chip { display:inline-block; margin:0 4px 4px 0; padding:3px 8px; border:1px solid var(--line); border-radius:12px; font-size:11px; color:#52645a; background:#fff }
.degree-btn { margin:0 }
.degree-row { display:grid; grid-template-columns:minmax(7.5rem,auto) 1fr; gap:.55rem; align-items:start; margin:.45rem 0 }
.degree-row p { margin:0; font-size:12px; color:var(--muted); line-height:1.4 }
.challenge-block { margin:.75rem 0 }
.accepted-result { padding:.45rem .6rem; border-radius:6px; background:#edf4ef; color:#305d45; font-size:12px }
.treetop { display:flex; justify-content:space-between; align-items:center; gap:.5rem; margin-bottom:.5rem }
.treetop input { width:9rem; min-width:0; padding:.25rem .4rem; border:1px solid var(--line); border-radius:6px; font:inherit; font-size:12px }
.gm-layout { display:grid; grid-template-columns:minmax(220px,32%) minmax(0,1fr); gap:1rem }
.gm-layout aside,.gm-layout article { padding:1rem; background:white; border-radius:.5rem; min-width:0 }
.gm-layout nav { max-height:70vh; overflow:auto }
.gm-layout ul { list-style:none; padding-left:.85rem }
.gm-layout summary { cursor:pointer }
.gm-layout button { cursor:pointer; margin:.15rem; padding:.35rem .55rem }
.gm-layout .button.primary { color:#fff; background:var(--green); border:0; padding:.5rem .8rem }
.gm-layout nav button { border:0; background:transparent; color:inherit; text-align:left }
.gm-layout [aria-current=page],.gm-layout [aria-pressed=true] { background:#205b46; color:white }
.gm-layout article img { max-width:100%; height:auto }
.gm-content { overflow-x:auto; line-height:1.55 }
.gm-content table { border-collapse:collapse }
.gm-content td,.gm-content th { border:1px solid #ced9d2; padding:.4rem }
@media(max-width:720px){.gm-layout{grid-template-columns:1fr}.gm-layout nav{max-height:32vh}}
.gm-tabs { display:flex; gap:.35rem; margin:0 0 .75rem }
.gm-tabs button { border:1px solid var(--line); border-radius:6px; background:#f8faf8 }
.gm-tabs button.active { background:var(--green); color:#fff; border-color:var(--green) }
.gm-node-panels { display:grid; grid-template-columns:1.05fr .95fr; gap:1rem }
.gm-node-panels section { padding:.75rem; border:1px solid var(--line); border-radius:8px }
.place-card { margin:.5rem 0; padding:.6rem .75rem; border:1px solid var(--line); border-radius:8px }
.session-list { margin:.35rem 0 .6rem }
.session-fold { margin:.35rem 0; padding:.35rem .7rem; border:1px solid var(--line); border-radius:8px; background:#f8faf8 }
.session-fold summary { cursor:pointer; font-weight:600 }
.session-fold p { margin:.35rem 0 .45rem; font-size:13px }
.party-setup .party-row { display:flex; gap:.6rem; align-items:center; margin:.45rem 0 }
.party-layout { display:grid; grid-template-columns:minmax(16rem,280px) 1fr; gap:1.25rem; margin-top:1rem }
.party-source { display:flex; gap:.7rem; align-items:flex-start; margin:.5rem 0; padding:.7rem .8rem; border:1px solid var(--line); border-radius:8px }
.party-source.active { border:2px solid var(--green); background:#f5faf6 }
.party-source.disabled { opacity:.55 }
.sourceicon { flex:none; width:28px; height:28px; border-radius:6px; display:grid; place-items:center; background:#eaf1ec; color:var(--green); font-size:12px; font-weight:800 }
.party-setup .label { font-size:11px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; color:var(--muted); margin:0 0 .35rem }
@media(max-width:720px){.party-layout{grid-template-columns:1fr}}
.row-actions { display:flex; gap:.75rem; margin-top:1rem }
@media(max-width:720px){.gm-node-panels{grid-template-columns:1fr}}

/* Contextual artifact reader. Only the outer workspace panes are cards. */
.page.gm-wide { width: min(1920px, calc(100% - 32px)); }
.gm-layout { grid-template-columns: minmax(210px,250px) minmax(0,1fr); gap:.75rem; }
.gm-node-panels { grid-template-columns:minmax(0,1.08fr) minmax(0,1fr); gap:.75rem; align-items:start; }
.gm-node-panels > section { min-width:0; }
.gm-node-panels .gm-content section, .gm-node-panels .gm-content article, .gm-node-panels .gm-content aside { padding:0; border:0; border-radius:0; background:transparent; }
.gm-content ul { list-style:disc; }
.gm-content ol { list-style:decimal; padding-left:1.5rem; }
.gm-artifact-tabs,.gm-artifact-choices { display:flex; flex-wrap:wrap; gap:.25rem; margin:0 0 .65rem; }
.gm-artifact-tabs button,.gm-artifact-choices button { max-width:100%; border:1px solid var(--line); border-radius:5px; text-align:left; overflow-wrap:anywhere; }
.gm-artifact-tabs { border-bottom:1px solid var(--line); padding-bottom:.45rem; }
.gm-artifact-body { min-width:0; overflow-wrap:anywhere; }
.gm-reference-row { display:flex; flex-direction:column; border-bottom:1px solid var(--line); padding:.35rem 0; }
.gm-reference-row button { text-align:left; align-self:flex-start; }
.gm-layout .gm-reference-link { display:inline; background:none; border:0; color:#205b46; text-decoration:underline; padding:0; margin:0; font:inherit; cursor:pointer; }
.gm-content .read-aloud,.gm-content .readaloud,.gm-content .boxed-text { background:#edf3ed; border-left:3px solid #6c9978; padding:.65rem; margin:.6rem 0; }
.gm-content .amba-checklist__item,.gm-content .prep-check { display:flex; gap:.5rem; align-items:flex-start; padding:.35rem 0; }
.gm-content input[type=checkbox] { flex:none; margin-top:.3rem; }
.gm-content .amba-checklist__section { border:1px solid var(--line); padding:.65rem; }
.gm-layout .degree-choice { display:grid; grid-template-columns:minmax(7rem,.35fr) minmax(0,1fr); gap:.5rem; text-align:left; width:100%; box-sizing:border-box; border:1px solid var(--line); border-radius:5px; padding:.55rem; background:#f8faf8; color:inherit; white-space:normal; }
.gm-layout .degree-choice:enabled:hover { border-color:var(--green); background:#e9f1eb; }
.gm-layout .degree-choice:disabled { opacity:1; cursor:default; }
.gm-map-frame { position:relative; width:fit-content; max-width:100%; }
.gm-map-frame img { display:block; }
.gm-map-current-pin { position:absolute; transform:translate(-50%,-50%); min-width:1.5rem; height:1.5rem; display:grid; place-items:center; border:2px solid white; border-radius:50%; color:white; background:#205b46; font-weight:bold; box-shadow:0 0 0 2px #205b46; }
.gm-local-roll { display:flex; align-items:flex-start; flex-wrap:wrap; gap:.4rem; margin:.5rem 0; }
@media(max-width:1000px){.gm-node-panels{grid-template-columns:minmax(0,1fr)}}
@media(max-width:720px){.gm-layout{grid-template-columns:minmax(0,1fr)}.gm-layout .degree-choice{grid-template-columns:minmax(0,1fr)}}

.gm-layout .gm-map-pin { position:absolute; transform:translate(-50%,-50%); min-width:1.4rem; height:1.4rem; display:grid; place-items:center; border:1px solid #205b46; border-radius:50%; color:#205b46; background:white; font-weight:bold; margin:0; padding:0 .2rem; line-height:1; }
.gm-map-current-pin { z-index:1; }

/* Compact navigation stays independent of session and actor controls. */
.gm-layout { grid-template-columns:minmax(0,var(--gm-tree-width,240px)) 8px minmax(0,1fr); gap:.35rem; }
.gm-layout.gm-tree-hidden { grid-template-columns:minmax(0,1fr); }
.gm-layout aside[hidden],.gm-tree-splitter[hidden] { display:none; }
.gm-tree-splitter { cursor:col-resize; touch-action:none; background:#d5ded8; border-radius:3px; }
.gm-tree-splitter:focus-visible { outline:2px solid var(--green); }
.gm-workspace-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:.65rem; margin:.5rem 0; }
.gm-workspace-toolbar fieldset { margin:0; min-width:0; }
.gm-workspace-toolbar button[aria-pressed=true] { background:#205b46; color:white; }
.gm-media-toolbar,.gm-voice-toolbar,.gm-read-aloud-controls { display:flex; flex-wrap:wrap; align-items:center; gap:.5rem; margin:.4rem 0; }
.gm-content .gm-read-aloud { background:#edf3ed; border-left:3px solid #6c9978; padding:.65rem; margin:.6rem 0; }
.gm-media-toolbar dialog { max-width:min(95vw,1200px); max-height:95vh; border:1px solid var(--line); border-radius:8px; }
.gm-media-toolbar dialog img { display:block; max-height:80vh; object-fit:contain; margin:.5rem auto; }
@media(max-width:720px){.gm-layout{grid-template-columns:minmax(0,1fr)}.gm-tree-splitter{display:none}}

/* Session chronicle and workspace finishing details. */
.campaign-card { border:1px solid var(--line); border-radius:8px; padding:1rem; margin:.75rem 0; }
.campaign-stats { display:grid; grid-template-columns:repeat(auto-fit,minmax(115px,1fr)); gap:.5rem; margin:.6rem 0; }
.campaign-stats div { padding:.6rem; border:1px solid var(--line); border-radius:5px; }
.campaign-stats dt { font-size:.8rem; color:var(--muted); }
.campaign-stats dd { margin:.25rem 0 0; font-weight:700; font-size:1.2rem; }
.campaign-actions { display:flex; flex-wrap:wrap; gap:.5rem; margin-top:.75rem; }
.campaign-chronicles,.chronicle-session,.session-chronicle { padding:.65rem; margin:.6rem 0; border:1px solid var(--line); border-radius:5px; }
.campaign-chronicles summary,.chronicle-session summary,.gm-check-history summary { cursor:pointer; font-weight:600; }
.chronicle-entries { padding-left:1.25rem; }
.chronicle-entry { padding:.6rem 0; border-bottom:1px solid var(--line); overflow-wrap:anywhere; }
.chronicle-entry:last-child { border-bottom:0; }
.chronicle-text { white-space:pre-wrap; }
.session-chronicle h4 { margin-top:0; }
.gm-layout > aside { padding:.65rem; }
.gm-narrative-pane .gm-content { font-size:14px; line-height:1.6; }
.gm-layout .degree-choice span { min-width:0; overflow-wrap:anywhere; font-weight:normal; }
.gm-layout .degree-choice:focus-visible { outline:2px solid var(--green); outline-offset:2px; }
.gm-check-history { margin-top:.75rem; }
@media(max-width:720px){.page.gm-wide{width:calc(100% - 16px)}}

/* Narrative navigation is a presentation-only projection of the authored text. */
.gm-narrative-navigation { display:flex; flex-wrap:wrap; align-items:center; gap:.35rem; margin:.55rem 0; }
.gm-narrative-navigation select { min-width:0; max-width:100%; flex:1 1 12rem; }
.gm-narrative-navigation button { font-size:.8rem; }
.gm-narrative-section { border:1px solid var(--line); border-radius:6px; margin:.5rem 0; padding:.1rem .6rem; scroll-margin-top:1rem; }
.gm-narrative-section > summary { cursor:pointer; padding:.4rem 0; }
.gm-narrative-section > summary > :is(h1,h2,h3,h4,h5,h6) { display:inline; font-size:1rem; margin:0; }
.gm-narrative-section > summary:focus-visible { outline:2px solid var(--green); outline-offset:2px; }
.gm-narrative-navigation button[aria-pressed=true] { border-color:var(--green); font-weight:600; }

/* Read-aloud presentation: compact inline controls, independent of GM notes. */
.gm-voice-toolbar { padding:.4rem .5rem; border:1px solid var(--line); border-radius:6px; }
.gm-voice-toolbar select { max-width:100%; min-width:0; }
.gm-read-aloud-controls { border-bottom:1px solid var(--line); padding-bottom:.4rem; }
.gm-read-aloud-title { flex:1 1 10rem; }
.gm-read-aloud-controls[data-narration-state=playing] { border-color:var(--green); }
.gm-read-aloud-controls [role=status],.gm-voice-toolbar [role=status] { font-size:.8rem; overflow-wrap:anywhere; }

/* EWR-04: compact contextual NPC and authored dialogue consultation. */
.gm-dialogue-toolbar { display:flex; align-items:center; justify-content:space-between; gap:.5rem; flex-wrap:wrap; margin:.35rem 0; }
.gm-dialogue-questions > details { border-bottom:1px solid var(--line); padding:.35rem 0; }
.gm-dialogue-questions summary { cursor:pointer; font-weight:600; }
.gm-dialogue-answer { padding:.35rem .7rem; overflow-wrap:anywhere; }
.gm-prepared-dialogue [hidden] { display:none !important; }
.gm-npc-list .gm-reference-row { margin:.35rem 0; }
.gm-reference-unavailable { font-style:italic; }

/* EWR-05: recording region stays beside the full authored challenge. */
.gm-integrated-checks { border-top:1px solid var(--line); margin-top:.8rem; padding-top:.6rem; min-width:0; }
.gm-integrated-checks .challenge-block { overflow-wrap:anywhere; }
