/* Review console (#47), in "Clear water". Builds on styles.css. */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1.5rem; }
.gate[hidden], .shell[hidden] { display: none; }
.gate-card { width: 100%; max-width: 28rem; display: grid; gap: 1rem; background: var(--surface); padding: 2.25rem; border-radius: 24px; box-shadow: var(--shadow); }
.gate-card .wordmark { margin-bottom: 0.5rem; }
.gate-card .lede { margin-top: 0; font-size: 1.05rem; }
.gate-card button { justify-self: start; }

.shell { display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); min-height: 100vh; }
.sidebar { padding: 1.75rem 1rem; display: flex; flex-direction: column; gap: 0.35rem; position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--line); background: rgba(255, 255, 255, 0.6); backdrop-filter: blur(8px); }
.sidebar .wordmark { padding: 0 0.75rem; }
.console-label { padding: 0 0.75rem; color: var(--soft); font-size: 0.9rem; margin-bottom: 1.5rem; }
.sidebar ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.15rem; }
.sidebar a { display: block; color: var(--ink); text-decoration: none; padding: 0.6rem 0.8rem; border-radius: 12px; font-weight: 600; }
.sidebar a:hover { background: var(--mist); }
.sidebar a[aria-current="page"] { background: var(--sky); color: var(--teal-deep); }
.who { margin-top: auto; font-size: 0.93rem; display: grid; gap: 0.6rem; padding: 0 0.75rem; color: var(--soft); }
.who strong { color: var(--ink); }
.who button { justify-self: start; }

.pane { padding: 2.5rem 2.75rem 5rem; max-width: 76rem; outline: none; }
.pane > .lede { max-width: 48rem; }
.crumb { color: var(--teal-deep); font-weight: 600; text-decoration: none; display: inline-block; margin-bottom: 1rem; }
.crumb:hover { text-decoration: underline; }
.banner { margin-top: 1.25rem; padding: 0.85rem 1.1rem; border-radius: 14px; background: var(--mist); max-width: 48rem; }
.pill { display: inline-block; padding: 0.2rem 0.7rem; border-radius: 999px; font-size: 0.86rem; font-weight: 600; background: var(--mist); color: var(--soft); white-space: nowrap; }
.pill.waiting { background: #fff1ed; color: #c4442a; }
.pill.done { background: var(--sky); color: var(--teal-deep); }
.critical-text { color: #d24a2b; font-weight: 800; }
.empty-state { margin-top: 2rem; padding: 2rem; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); max-width: 48rem; }
.toolbar { display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap; margin-top: 1.5rem; }

/* Tables */
.table { width: 100%; border-collapse: separate; border-spacing: 0; margin-top: 1.75rem; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.table th, .table td { text-align: left; padding: 0.9rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table th { font-size: 0.88rem; color: var(--soft); font-weight: 600; background: #fbfdfd; }
.table tbody tr { cursor: pointer; transition: background 120ms; }
.table tbody tr:hover { background: var(--mist); }
.table a { color: var(--ink); font-weight: 800; text-decoration: none; }
.strip { display: inline-flex; gap: 4px; }
.strip span { width: 22px; height: 7px; border-radius: 99px; background: var(--sky); }
.strip span[data-l="1"] { background: #8fd1c8; }
.strip span[data-l="2"] { background: #3fae9f; }
.strip span[data-l="3"] { background: var(--teal-deep); }
.strip span[data-l="none"] { background: transparent; box-shadow: inset 0 0 0 1px var(--soft); }

/* Session detail */
.detail { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 2rem; margin-top: 1.5rem; align-items: start; }
@media (max-width: 1180px) { .detail { grid-template-columns: 1fr; } }
.disputed-tag { display: inline-block; vertical-align: 0.15em; margin-left: 0.4rem; font-size: 0.75rem; font-weight: 800; color: #c4442a; background: #ffe6de; padding: 0.1rem 0.55rem; border-radius: 999px; }
.dimensions .dimension.disputed { margin: 0 -1.5rem; padding-left: 1.5rem; padding-right: 1.5rem; background: #fff8f5; box-shadow: inset 4px 0 0 var(--coral); }
.confirm { padding: 1.4rem 1.5rem; background: var(--surface); border-radius: var(--radius); box-shadow: inset 0 0 0 2px var(--teal), var(--shadow); display: grid; gap: 0.75rem; margin-top: 1.5rem; max-width: 48rem; }
.confirm h2 { margin: 0; }
.confirm button { justify-self: start; }
.confirmed { margin-top: 1.5rem; padding: 1rem 1.25rem; border-radius: 16px; background: var(--sky); max-width: 48rem; }
.panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.4rem 1.5rem; }
.panel h2 { margin-top: 1.25rem; font-size: 1.05rem; }
.panel h2:first-child { margin-top: 0; }
.transcript { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: 0.75rem; font-size: 0.97rem; }
.transcript li { display: grid; grid-template-columns: 1.75rem 4.5rem 1fr; gap: 0.5rem; }
.transcript .n { color: var(--soft); font-variant-numeric: tabular-nums; font-size: 0.85rem; padding-top: 0.1rem; }
.transcript .who { color: var(--soft); font-weight: 600; font-size: 0.9rem; display: block; padding: 0; margin: 0; }
.transcript mark { background: #ffe6de; color: inherit; border-radius: 4px; padding: 0 2px; box-shadow: inset 0 -2px 0 var(--coral); }
.side-list { list-style: none; padding: 0; margin: 0.6rem 0 0; display: grid; gap: 0.4rem; }
.cite { color: var(--soft); font-size: 0.85rem; margin-left: 0.5rem; font-style: normal; font-weight: 600; }

/* Progress */
.metric-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); gap: 1.25rem; margin-top: 1.75rem; }
.metric { margin: 0; background: var(--surface); padding: 1.1rem 1.2rem 0.7rem; border-radius: var(--radius); box-shadow: var(--shadow); }
.metric figcaption { font-weight: 800; }
.metric figcaption span { font-weight: 400; color: var(--soft); font-size: 0.9rem; display: block; }
.metric svg { width: 100%; height: auto; overflow: visible; }
.metric .grid { stroke: var(--line); stroke-dasharray: 2 4; }
.metric .axis { font: 600 10.5px var(--font); fill: var(--soft); }
.metric .area { fill: url(#teal-fade); }
.metric .area.mark { fill: url(#coral-fade); }
.metric .line { fill: none; stroke: var(--teal); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.metric .line.mark { stroke: var(--coral); }
.metric .dot { fill: var(--teal); stroke: #fff; stroke-width: 2; }
.metric .dot.mark { fill: var(--coral); }
.metric .value { font: 800 11px var(--font); fill: var(--ink); text-anchor: middle; }

/* Rubric editor */
.rubric { width: 100%; border-collapse: separate; border-spacing: 0; margin-top: 1.5rem; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.rubric th, .rubric td { padding: 0.7rem; vertical-align: top; text-align: left; border-bottom: 1px solid var(--line); }
.rubric tr:last-child th, .rubric tr:last-child td { border-bottom: 0; }
.rubric thead th { font-size: 0.88rem; color: var(--soft); background: #fbfdfd; }
.rubric tbody th { width: 12rem; padding: 1rem; }
.rubric tbody th .small { font-weight: 400; margin-top: 0.3rem; }
.rubric textarea { width: 100%; min-height: 6rem; resize: none; overflow: hidden; font-size: 0.93rem; line-height: 1.45; padding: 0.6rem 0.7rem; background: #fbfdfd; }
.rubric textarea.changed { box-shadow: inset 0 0 0 2px var(--teal); background: #f2fbf9; }
.rubric textarea.empty { box-shadow: inset 0 0 0 2px var(--coral); background: #fff6f3; }
.versions-list { display: grid; gap: 0.6rem; margin-top: 1rem; max-width: 48rem; }
.version { display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--surface); border-radius: 14px; padding: 0.8rem 1.1rem; box-shadow: var(--shadow); }
.version strong { display: block; }

/* Cases */
.case-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.case-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem 1.35rem; text-decoration: none; color: var(--ink); display: grid; gap: 0.5rem; transition: transform 160ms ease, box-shadow 160ms ease; }
.case-card:hover { transform: translateY(-2px); box-shadow: 0 24px 50px -28px rgba(15, 43, 58, 0.55); }
.case-card h3 { font-size: 1.1rem; }
.case-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; margin-top: 1.5rem; align-items: start; }
.card { background: var(--surface); padding: 1.3rem 1.5rem; border-radius: var(--radius); box-shadow: var(--shadow); }
.card h2 { margin-top: 0; font-size: 1.1rem; }
.card + .card { margin-top: 1.25rem; }
.card dl { display: grid; grid-template-columns: 8.5rem 1fr; gap: 0.5rem 1rem; margin: 0.75rem 0 0; }
.card dt { font-weight: 800; }
.card dd { margin: 0; }
.card ol, .card ul { padding-left: 1.2rem; margin: 0.75rem 0 0; display: grid; gap: 0.45rem; }
.facts li { list-style: none; margin-left: -1.2rem; padding: 0.6rem 0.8rem; border-radius: 12px; background: #fffaf8; box-shadow: inset 3px 0 0 var(--coral); }
.facts .topic { font-weight: 800; display: block; color: #d24a2b; font-size: 0.9rem; }
.draft-body { max-width: 52rem; }

/* Drafting assistant: a messages thread. The thread scrolls inside its card; the
   composer stays pinned to the bottom, clear of the screen edge. */
.chat { display: flex; flex-direction: column; margin-top: 1.25rem; max-width: 54rem; height: max(26rem, calc(100dvh - 17rem));
  background: var(--surface); border-radius: 26px; box-shadow: var(--shadow); overflow: hidden; }
.messages { flex: 1 1 0; overflow-y: auto; overscroll-behavior: contain; padding: 1.25rem 1.1rem 0.75rem; display: flex; flex-direction: column; gap: 0.75rem; scroll-behavior: smooth; }
.messages > :first-child { margin-top: auto; }
.msg { display: flex; flex-direction: column; max-width: min(86%, 40rem); animation: bubble 240ms cubic-bezier(.2, .9, .3, 1.2); }
@keyframes bubble { from { opacity: 0; transform: translateY(8px) scale(0.97); } }
.msg.user { align-self: flex-end; align-items: flex-end; }
.msg.assistant { align-self: flex-start; align-items: flex-start; }
.bubble { padding: 0.65rem 1rem 0.7rem; border-radius: 22px; line-height: 1.45; overflow-wrap: anywhere; }
.msg.user .bubble { background: var(--teal-deep); color: #fff; border-bottom-right-radius: 6px; white-space: pre-wrap; }
.msg.assistant .bubble { background: var(--mist); color: var(--ink); border-bottom-left-radius: 6px; }
.markdown h3 { font-size: 1.04rem; margin: 0.9rem 0 0.3rem; }
.markdown h3:first-child { margin-top: 0.1rem; }
.markdown p, .markdown ul, .markdown ol { margin: 0.4rem 0; }
.markdown ul, .markdown ol { padding-left: 1.25rem; }
.msg-actions { margin: 0.35rem 0.6rem 0; }
.link-button { background: none; box-shadow: none; padding: 0.2rem 0.3rem; color: var(--teal-deep); font-weight: 700; font-size: 0.9rem; border-radius: 8px; }
.link-button:hover { text-decoration: underline; background: none; }
.typing { display: inline-flex; gap: 0.3rem; padding: 0.85rem 1rem; }
.typing span { width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--soft); opacity: 0.4; animation: typing 1.2s ease-in-out infinite; }
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing { 0%, 60%, 100% { opacity: 0.35; transform: translateY(0); } 30% { opacity: 0.9; transform: translateY(-3px); } }
.chat-empty { color: var(--soft); }
.starters { display: grid; gap: 0.6rem; margin-top: 0.8rem; }
.starters button { text-align: left; font-weight: 400; background: var(--bg); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); border-radius: 18px; padding: 0.8rem 1rem; }
.starters button:hover { box-shadow: inset 0 0 0 1.5px var(--teal); }
.composer { display: flex; gap: 0.55rem; align-items: flex-end; padding: 0.65rem 0.75rem calc(0.75rem + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--surface); }
.composer textarea { flex: 1; resize: none; font: 400 1rem/1.4 var(--font); padding: 0.6rem 1rem; border: 0; border-radius: 22px; background: var(--bg); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); max-height: 180px; }
.composer textarea:focus { outline: none; box-shadow: inset 0 0 0 2px var(--teal); }
.send { flex: none; width: 2.6rem; height: 2.6rem; padding: 0; border-radius: 50%; display: grid; place-items: center; background: var(--teal-deep); }
.send svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.send:disabled { background: var(--line); cursor: default; }
.chat-note { margin-top: 0.6rem; max-width: 54rem; }
.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; }

.toast { position: fixed; left: 50%; bottom: 1.75rem; transform: translate(-50%, 1rem); background: var(--ink); color: #fff; padding: 0.8rem 1.25rem; border-radius: 999px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: all 260ms cubic-bezier(.2, .9, .3, 1.3); font-weight: 600; display: flex; gap: 0.6rem; align-items: center; z-index: 20; }
.toast::before { content: ""; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--glow); box-shadow: 0 0 10px 2px rgba(63, 217, 194, 0.7); }
.toast.shown { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .detail, .case-grid { grid-template-columns: 1fr; }
  .pane { padding: 1.5rem 1rem 3rem; }
}

/* Case editor */
.edit-grid { display: grid; gap: 0.9rem; margin-top: 0.75rem; }
.edit-field { display: grid; gap: 0.3rem; }
.edit-field > span { font-weight: 800; font-size: 0.93rem; }
.edit-field em { font-style: normal; font-size: 0.85rem; color: var(--teal-deep); }
.edit-field input, .edit-field textarea, .situation, .save-bar input { width: 100%; font: 400 0.97rem/1.5 var(--font); padding: 0.6rem 0.75rem; border: 0; border-radius: 12px; background: #fbfdfd; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); resize: none; overflow: hidden; }
.edit-field input:focus, .edit-field textarea:focus, .situation:focus, .save-bar input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--teal); }
#case-form .changed { box-shadow: inset 0 0 0 2px var(--teal); background: #f2fbf9; }
#case-form .empty { box-shadow: inset 0 0 0 2px var(--coral); background: #fff6f3; }
.field-error { color: #c4442a; font-size: 0.85rem; font-weight: 600; }
.save-bar { grid-column: 1 / -1; position: sticky; bottom: 0.75rem; background: var(--surface); padding: 0.75rem; border-radius: 999px; box-shadow: var(--shadow); margin-top: 0.5rem; }
.save-bar input { flex: 1; min-width: 14rem; border-radius: 999px; }
.persona-card { display: grid; grid-template-columns: auto 1fr auto; gap: 1.25rem; align-items: center; margin-top: 1.5rem; max-width: 60rem; }
.persona-card h2 { margin: 0 0 0.35rem; }
.persona-card p + p { margin-top: 0.4rem; }
.persona-avatar { width: 3.5rem; height: 3.5rem; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #c6f3ec, #4cc3b5 55%, var(--teal)); box-shadow: 0 10px 24px -12px rgba(14, 140, 127, 0.8); }
.quiet-link { font-weight: 700; color: var(--teal-deep); text-decoration: none; padding: 0.6rem 1rem; border-radius: 999px; box-shadow: inset 0 0 0 1.5px var(--line); white-space: nowrap; }
.quiet-link:hover { box-shadow: inset 0 0 0 1.5px var(--teal); }
@media (max-width: 960px) { .persona-card { grid-template-columns: 1fr; } }

.confirm select { font: 600 0.97rem var(--font); padding: 0.55rem 0.7rem; border: 0; border-radius: 12px; box-shadow: inset 0 0 0 1.5px var(--line); background: #fbfdfd; color: var(--ink); max-width: 18rem; }
.check { display: flex; gap: 0.6rem; align-items: center; font-weight: 600; }
.check input { accent-color: var(--teal); width: 1rem; height: 1rem; }

/* ---- Organisation side (note 005): roles, tasks as stories, calibrate, oversee, monitor ---- */
.role-pick { border: 0; padding: 0; margin: 0; display: grid; gap: 0.45rem; }
.role-pick legend { font-weight: 800; margin-bottom: 0.45rem; }
.role-pick label { display: flex; gap: 0.7rem; align-items: flex-start; padding: 0.6rem 0.8rem; border-radius: 14px; box-shadow: inset 0 0 0 1.5px var(--line); cursor: pointer; }
.role-pick label:has(input:checked) { box-shadow: inset 0 0 0 2px var(--teal); background: #f2fbf9; }
.role-pick input { accent-color: var(--teal); margin-top: 0.25rem; }
.role-pick span { display: grid; font-size: 0.9rem; color: var(--soft); }
.role-pick b { color: var(--ink); font-size: 0.97rem; }
.home-link { text-decoration: none; padding: 0 0.75rem; }
.role-switch { display: grid; gap: 0.3rem; margin: 0.6rem 0.75rem 1.1rem; font-size: 0.82rem; font-weight: 700; color: var(--soft); }
.role-switch[hidden] { display: none; }
.role-switch select { font: 700 0.95rem var(--font); color: var(--ink); padding: 0.5rem 0.7rem; border: 0; border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); }
.nav-group + .nav-group { margin-top: 0.9rem; }
.nav-title { padding: 0 0.8rem; margin: 0 0 0.25rem; font-size: 0.78rem; font-weight: 800; color: var(--soft); letter-spacing: 0.03em; }
.small-link { font-size: 0.88rem; padding: 0.45rem 0.8rem; justify-self: start; }

.story-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); gap: 1rem; margin-top: 1.75rem; }
.story-card { display: grid; gap: 0.7rem; align-content: start; padding: 1.3rem 1.4rem; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; transition: transform 160ms ease, box-shadow 160ms ease; }
.story-card:hover, .story-card:focus-visible { transform: translateY(-2px); box-shadow: 0 24px 50px -28px rgba(15, 43, 58, 0.55), inset 0 0 0 2px var(--teal); }
.story-tag { font-size: 0.8rem; font-weight: 800; color: var(--teal-deep); }
.story-text { font-size: 1.02rem; line-height: 1.5; }
.story-go { font-weight: 800; color: var(--teal-deep); }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0.8rem; margin-top: 1.5rem; max-width: 60rem; }
.stat { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); padding: 0.85rem 1rem; display: grid; gap: 0.2rem; }
.stat span { font-size: 0.82rem; color: var(--soft); font-weight: 700; }
.stat strong { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.card-head { display: grid; gap: 0.25rem; }
.card-head h2 { margin: 0; }
.card-foot { display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.accuracy, .overturns { margin-top: 1.25rem; max-width: 60rem; }
.acc-list, .case-rates { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: 0.7rem; }
.acc-list li { display: grid; grid-template-columns: minmax(9rem, 13rem) minmax(6rem, 1fr) auto auto; gap: 0.9rem; align-items: center; }
.acc-name { font-weight: 700; }
.acc-bar { position: relative; height: 0.6rem; border-radius: 99px; background: var(--mist); }
.acc-bar > span { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--teal); }
.acc-bar > i { position: absolute; top: -0.3rem; bottom: -0.3rem; width: 2px; background: var(--ink); opacity: 0.55; }
.acc-list li.below .acc-bar > span, .case-rates li.flag .acc-bar > span { background: var(--coral); }
.acc-num { font-size: 0.85rem; color: var(--soft); font-variant-numeric: tabular-nums; white-space: nowrap; }

.level-area { margin-top: 2rem; max-width: 60rem; }
.ex-nav { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 0.9rem 0; }
.ex-nav button { width: 2.3rem; height: 2.3rem; padding: 0; border-radius: 50%; font-weight: 800; background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.ex-nav button.done { background: var(--sky); color: var(--teal-deep); box-shadow: none; }
.ex-nav button.on { box-shadow: inset 0 0 0 2.5px var(--teal); }
.example header { display: flex; gap: 0.75rem; align-items: center; }
.example h3 { margin: 0.6rem 0 0.4rem; font-size: 1.15rem; }
.ex-lines { display: grid; gap: 0.4rem; margin-bottom: 1rem; }
.ex-line { margin: 0; padding: 0.55rem 0.9rem; border-radius: 18px; max-width: 85%; line-height: 1.45; }
.ex-line span { display: block; font-size: 0.75rem; font-weight: 700; opacity: 0.75; }
.ex-line.them { background: var(--mist); justify-self: start; border-bottom-left-radius: 6px; }
.ex-line.you { background: var(--teal-deep); color: #fff; justify-self: end; border-bottom-right-radius: 6px; }
.level-grid { display: grid; gap: 0.85rem; }
.seg { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.seg legend { width: 100%; font-weight: 700; font-size: 0.93rem; margin-bottom: 0.3rem; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg label span { display: inline-block; padding: 0.4rem 0.8rem; border-radius: 999px; font-size: 0.88rem; font-weight: 600; box-shadow: inset 0 0 0 1.5px var(--line); background: var(--surface); }
.seg input:checked + span { background: var(--teal-deep); color: #fff; box-shadow: none; }
.seg input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: 2px; }
.others { width: 100%; margin: 0.15rem 0 0; display: flex; gap: 0.5rem; flex-wrap: wrap; font-size: 0.82rem; color: var(--soft); }
.others span { padding: 0.1rem 0.55rem; border-radius: 999px; background: var(--mist); }
.others span.diff { background: #fff1ed; color: #c4442a; font-weight: 700; }
.level-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.4rem; }

.oversee-table tr.open { background: var(--mist); }
.oversee-table .detail-row { cursor: default; background: #fbfdfd; }
.oversee-table .detail-row:hover { background: #fbfdfd; }
.person-detail { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 1.5rem; padding: 0.5rem 0; cursor: default; }
.reason-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.reason-list li { display: grid; grid-template-columns: 1fr auto; gap: 0.15rem 1rem; }
.reason-list span { font-weight: 700; }
.reason-list p { grid-column: 1 / -1; margin: 0; color: var(--soft); font-size: 0.93rem; }
.set-aside-form { display: grid; gap: 0.6rem; align-content: start; padding: 1rem 1.1rem; border-radius: 16px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); }
.set-aside-form h3 { margin: 0; }
.set-aside-form textarea { font: 400 0.97rem/1.45 var(--font); padding: 0.6rem 0.75rem; border: 0; border-radius: 12px; background: #fbfdfd; box-shadow: inset 0 0 0 1.5px var(--line); resize: vertical; }
.set-aside-form button { justify-self: start; }

.case-rates li { display: grid; grid-template-columns: minmax(10rem, 15rem) minmax(5rem, 1fr) 3rem auto; gap: 0.5rem 0.9rem; align-items: center; }
.cr-title { font-weight: 700; display: grid; }
.spread { grid-column: 1 / -1; display: flex; height: 0.5rem; border-radius: 99px; overflow: hidden; gap: 2px; }
.spread span, .legend-row i { background: var(--sky); }
.spread span[data-l="1"], .legend-row i[data-l="1"] { background: #8fd1c8; }
.spread span[data-l="2"], .legend-row i[data-l="2"] { background: #3fae9f; }
.spread span[data-l="3"], .legend-row i[data-l="3"] { background: var(--teal-deep); }
.legend-row { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 0.9rem; }
.legend-row i { display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 3px; margin-right: 0.35rem; vertical-align: -0.05em; }
.metric .threshold { stroke: var(--coral); stroke-width: 1.5; stroke-dasharray: 5 4; }

@media (max-width: 960px) {
  .acc-list li { grid-template-columns: 1fr auto; }
  .acc-list .acc-bar { grid-column: 1 / -1; grid-row: 2; }
  .person-detail { grid-template-columns: 1fr; }
  .case-rates li { grid-template-columns: 1fr auto auto; }
  .case-rates .acc-bar { grid-column: 1 / -1; }
  .oversee-table th:nth-child(4), .oversee-table td:nth-child(4) { display: none; }
}
.gate-card:has(.role-pick) { max-width: 36rem; }
.gate-card .name-field { display: grid; gap: 0.4rem; }
.gate-card .name-field input { width: 100%; }
@media (min-width: 640px) { .role-pick { grid-template-columns: 1fr 1fr; } .role-pick legend { grid-column: 1 / -1; } }
.sidebar a.home-link { display: inline-flex; padding: 0.2rem 0.75rem; font-weight: 800; }
.sidebar a.home-link:hover { background: none; }
.stat em { font-style: normal; font-size: 0.8rem; color: var(--soft); }
.acc-list li, .case-rates li { grid-template-columns: minmax(9rem, 13rem) minmax(6rem, 1fr) 12.5rem 6rem; }
.case-rates li { grid-template-columns: minmax(10rem, 15rem) minmax(5rem, 1fr) 3.5rem 6.5rem; }
.acc-num { text-align: right; }
.acc-list .pill, .case-rates .pill { justify-self: end; }
@media (max-width: 960px) {
  .acc-list li { grid-template-columns: 1fr auto; }
  .case-rates li { grid-template-columns: 1fr auto auto; }
  .acc-num { text-align: left; }
}
.set-aside-form { align-self: start; }
.oversee-table tr.open .pill { background: var(--surface); }

/* On narrow screens a wide table scrolls inside itself; the page never scrolls sideways. */
@media (max-width: 960px) {
  .table, .rubric { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .rubric tbody th { min-width: 9rem; }
  .rubric td { min-width: 12rem; }
}

/* The sidebar's parts: the brand row (with a menu button on phones) and the menu itself. */
.side-top { display: flex; align-items: center; justify-content: space-between; }
.side-menu { display: flex; flex-direction: column; gap: 0.35rem; flex: 1; min-height: 0; }
.menu-toggle { display: none; }
@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .pane { min-width: 0; }
  .sidebar { position: sticky; top: 0; z-index: 10; padding: 0.7rem 1rem; gap: 0; background: rgba(246, 250, 251, 0.92); }
  .menu-toggle { display: inline-flex; padding: 0.45rem 0.95rem; }
  .side-menu { display: none; padding-top: 0.8rem; max-height: calc(100dvh - 4rem); overflow-y: auto; }
  .sidebar.open .side-menu { display: flex; }
  .who { margin-top: 1rem; padding-bottom: 0.5rem; }
}

.role-chips { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.role-chips legend { font-weight: 800; margin-bottom: 0.45rem; }
.role-chips label { position: relative; }
.role-chips input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.role-chips span { display: inline-block; padding: 0.42rem 0.85rem; border-radius: 999px; font-weight: 600; font-size: 0.92rem; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); }
.role-chips input:checked + span { background: var(--teal-deep); color: #fff; box-shadow: none; }
.role-chips input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: 2px; }
.role-hint { margin: -0.2rem 0 0.2rem; font-size: 0.9rem; color: var(--teal-deep); font-weight: 600; min-height: 1.4em; }

/* ---- Home: a greeting and a calm list of the role's tasks ---- */
.home { max-width: 40rem; margin: 3rem 0 0; }
.home h1 { font-size: clamp(2rem, 4vw, 2.8rem); letter-spacing: -0.02em; }
.home-sub { color: var(--soft); font-size: 1.1rem; margin: 0.6rem 0 2rem; }
.task-list { list-style: none; padding: 0; margin: 0; display: grid; border-top: 1px solid var(--line); }
.task-list li { border-bottom: 1px solid var(--line); }
.task-list a { display: grid; grid-template-columns: 11rem 1fr 1.25rem; gap: 1rem; align-items: center; padding: 1.05rem 0.4rem; color: var(--ink); text-decoration: none; border-radius: 12px; transition: background 140ms ease, padding 140ms ease; }
.task-list a:hover, .task-list a:focus-visible { background: var(--surface); padding-left: 0.9rem; padding-right: 0.9rem; box-shadow: var(--shadow); }
.task-name { font-weight: 800; }
.task-what { color: var(--soft); font-size: 0.97rem; }
.task-go { width: 1.1rem; height: 1.1rem; fill: none; stroke: var(--teal-deep); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; opacity: 0.55; }
.task-list a:hover .task-go { opacity: 1; }
.home-foot { margin-top: 1.75rem; font-size: 0.93rem; }
.home-foot a { color: var(--teal-deep); font-weight: 700; }
@media (max-width: 640px) {
  .home { margin-top: 1rem; }
  .task-list a { grid-template-columns: 1fr 1.25rem; gap: 0.2rem 0.8rem; }
  .task-what { grid-column: 1; }
  .task-go { grid-row: 1 / span 2; grid-column: 2; }
}
.glass .name-field, .glass .name-field input { max-width: none; width: 100%; }

/* Group readiness: one row per measure, like the participant's Over time tab. */
.readiness { max-width: 60rem; margin-top: 1.5rem; }
.trend-sub { display: block; font-weight: 400; font-size: 0.82rem; color: var(--soft); }
.trend-row .trend.mark { stroke: var(--coral); }
.trend-now .good { color: var(--teal-deep); }
.trend-now .worse { color: #c4442a; }
.readiness .trend-row svg { max-width: 280px; }
.older summary { cursor: pointer; font-weight: 700; color: var(--teal-deep); padding: 0.3rem 0.2rem; font-size: 0.93rem; }
.older .versions-list { margin-top: 0.5rem; }

/* In the console the guide sits top right, clear of sticky save bars and the sign-out button. */
body.console .guide-bar { top: 1rem; bottom: auto; }
@media (max-width: 960px) { body.console .guide-bar { top: auto; bottom: 1rem; } }

/* GitHub set-up */
.github-card { max-width: 44rem; margin-top: 1.5rem; display: grid; gap: 0.6rem; }
.github-card h2 { margin: 0.2rem 0 0; }
.github-card .pill { justify-self: start; }
.primary-link { display: inline-block; padding: 0.75rem 1.4rem; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 800; text-decoration: none; }
.primary-link:hover { background: var(--teal-deep); }
/* The console pane flows top to bottom; the participant page's full-height grid on <main> must not stretch it. */
main.pane { display: block; min-height: 0; }
.github-card { align-content: start; }
@media (min-width: 961px) { .sidebar { overflow-y: auto; overscroll-behavior: contain; } }

/* A mentor in a training programme (#70) */
.mentor-person { margin-top: 1.25rem; max-width: 60rem; }
.mentor-person .table { margin-top: 0.75rem; }

/* About Soundings, for organisations (#82) */
.about-org { max-width: 52rem; }
.about-org .card { margin-top: 1.25rem; }
.about-org h2 { margin: 0 0 0.6rem; }
.about-org p, .about-org li { line-height: 1.6; text-wrap: pretty; }
.about-org p + p { margin-top: 0.6rem; }
.about-org ul, .about-org ol { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.5rem; }
.home-why { margin-top: 0.6rem; color: var(--soft); }
.home-why a { font-weight: 700; color: var(--teal-deep); }

/* ---- the HR lead's dashboard (#106) ---- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 1rem; margin: 1.5rem 0 1.25rem; max-width: 60rem; }
.tile { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.2rem; }
.tile p { margin: 0; }
.tile-label { font-size: 0.82rem; font-weight: 700; color: var(--soft); }
.tile-value { font-size: 2.4rem; font-weight: 800; line-height: 1.1; margin-top: 0.3rem !important; color: var(--ink); font-variant-numeric: tabular-nums; }
.tile-lens { display: flex; align-items: center; gap: 0.5rem; font-weight: 800; font-size: 1.05rem; margin-top: 0.45rem !important; color: var(--ink); }
.tile-sub { font-size: 0.85rem; color: var(--soft); margin-top: 0.25rem !important; }
.tile .icon, .lens-bars .icon { width: 1.6rem; height: 1.6rem; padding: 0.3rem; box-sizing: border-box; border-radius: 8px; color: var(--lens); background: var(--lens-tint); flex: none; }
.pane .card { max-width: 60rem; }
.lens-bars { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: 0.7rem; }
.lens-bars li { display: grid; grid-template-columns: minmax(11rem, 15rem) 1fr 3.2rem; align-items: center; gap: 0.9rem; }
.lens-name { display: flex; align-items: center; gap: 0.55rem; font-weight: 700; font-size: 0.92rem; }
.bar-track { height: 12px; border-radius: 0 4px 4px 0; background: var(--mist); overflow: hidden; }
.bar { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--teal); }
.bar-value { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; color: var(--ink); }
.participation { width: 100%; max-width: 32rem; border-collapse: collapse; margin-top: 0.8rem; font-size: 0.92rem; }
.participation th, .participation td { text-align: left; padding: 0.5rem 0.75rem 0.5rem 0; border-bottom: 1px solid var(--line); }
.participation th { font-size: 0.8rem; color: var(--soft); }
.participation td + td, .participation th + th { font-variant-numeric: tabular-nums; width: 6rem; }
@media (max-width: 640px) {
  .lens-bars li { grid-template-columns: 1fr 3rem; }
  .lens-bars .bar-track { grid-column: 1 / -1; grid-row: 2; }
}
.card .trends { box-shadow: none; background: none; padding: 0; margin-top: 0.6rem; }

/* Programmes, for the admin (#427) */
.programme .table.plain { margin-top: 1rem; box-shadow: inset 0 0 0 1px var(--line); }
.programme .table.plain tbody tr { cursor: default; }
.programme .table.plain tbody tr:hover { background: none; }
.programme code { font-size: 0.9rem; padding: 0.1rem 0.4rem; border-radius: 6px; background: var(--mist); }
.programme-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1rem; }
.move-form { display: flex; gap: 0.5rem; align-items: center; }
.move-form select, .programme-form select { font: 600 0.95rem var(--font); padding: 0.5rem 0.7rem; border: 0; border-radius: 12px; box-shadow: inset 0 0 0 1.5px var(--line); background: #fbfdfd; }
.programme-form { display: grid; gap: 0.9rem; margin-top: 1.25rem; max-width: 44rem; box-shadow: inset 0 0 0 1.5px var(--line); }
.programme-form h3 { margin: 0; }
.programme-form .edit-field { display: grid; gap: 0.3rem; }
.programme-form .edit-field > span:first-child { font-weight: 700; }
.mentor-rows { border: 0; padding: 0; margin: 0; display: grid; gap: 0.6rem; justify-items: start; }
.mentor-rows legend { font-weight: 700; padding: 0; margin-bottom: 0.4rem; }
#mentor-rows { display: grid; gap: 0.5rem; width: 100%; }
.mentor-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 0.5rem; }
.mentor-row input { font: 400 0.97rem/1.5 var(--font); padding: 0.6rem 0.75rem; border: 0; border-radius: 12px; background: #fbfdfd; box-shadow: inset 0 0 0 1.5px var(--line); min-width: 0; }
.mentor-row input:focus, .move-form select:focus, .programme-form select:focus { outline: none; box-shadow: inset 0 0 0 2px var(--teal); }
@media (max-width: 640px) { .mentor-row { grid-template-columns: 1fr; } .move-form { flex-wrap: wrap; } }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.pane > .programme, .pane > .programme-form { margin-top: 1.5rem; }
.pane > p:has(#new-programme) { margin-top: 1.5rem; }
@media (max-width: 640px) { .programme .table.plain { display: block; overflow-x: auto; } .programme .pill { white-space: normal; } }

/* ---- One look for the console (#458): the participant's dark ground and contour lines carry the navigation
   and each screen's heading; below, the light ground with white, finely bordered cards (#428, #440). ---- */
body.console { background: var(--bg); }
.sidebar { border-right: 0; background: var(--ink) url("/static/contours.svg") center / cover; backdrop-filter: none; color: var(--sky); }
.sidebar .wordmark { color: var(--surface); }
.sidebar .wordmark::before { background: #3fd9c2; box-shadow: 0 0 0 4px rgba(63, 217, 194, 0.2); }
.sidebar a { color: var(--sky); }
.sidebar a:hover { background: rgba(255, 255, 255, 0.08); color: var(--surface); }
.sidebar a[aria-current="page"] { background: rgba(255, 255, 255, 0.1); color: var(--surface); box-shadow: inset 3px 0 0 #3fd9c2; }
.sidebar a.home-link:hover { background: none; }
.sidebar :focus-visible { outline-color: var(--surface); }
.nav-title { color: #9dbcc6; }
.role-switch span { color: #9dbcc6; }
.role-switch select { background: rgba(255, 255, 255, 0.08); color: var(--surface); box-shadow: inset 0 0 0 1px #5b7f8c; }
.role-switch select option { color: var(--ink); background: var(--surface); }
.who { color: var(--sky); }
.who strong { color: var(--surface); }
.sidebar .quiet, .sidebar .quiet-link { background: none; color: var(--surface); box-shadow: inset 0 0 0 1px #5b7f8c; }
.sidebar .quiet:hover, .sidebar .quiet-link:hover { box-shadow: inset 0 0 0 1px var(--surface); }
@media (max-width: 960px) { .sidebar { background: var(--ink) url("/static/contours.svg") center / cover; border-bottom: 0; } }

/* Each screen's heading and lede sit in a band of the same ground, edge to edge (console.js: bandHeading). */
.pane { --pad-x: 2.75rem; --pad-top: 2.5rem; max-width: none; padding: 0 var(--pad-x) 5rem; }
.pane > :first-child:not(.pane-band) { margin-top: var(--pad-top); }
:where(.pane) > :where(:not(.pane-band)) { max-width: 70.5rem; }
.pane-band { margin: 0 calc(-1 * var(--pad-x)) 2rem; padding: var(--pad-top) var(--pad-x) 2.25rem; background: var(--ink) url("/static/contours.svg") center / cover; color: var(--surface); }
.pane-band > * { max-width: 48rem; }
.pane-band h1 { color: var(--surface); }
.pane-band .lede, .pane-band .home-sub { color: var(--sky); }
.pane-band .crumb, .pane-band a { color: var(--sky); }
.pane-band .crumb:hover, .pane-band a:hover { color: var(--surface); }
.pane-band .pill { background: rgba(255, 255, 255, 0.12); color: var(--surface); }
.pane-band :focus-visible { outline-color: var(--surface); }
.pane-band + * { margin-top: 0; }
@media (max-width: 960px) { .pane { --pad-x: 1rem; --pad-top: 1.5rem; padding: 0 var(--pad-x) 3rem; } }

/* White cards with a fine border, as on the participant's home and set-up. */
.card, .table, .empty-state, .panel, .metric, .rubric, .version, .case-card, .story-card, .stat, .tile, .chat { box-shadow: inset 0 0 0 1px var(--line); }
.table th { background: var(--bg); }
.banner { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }

/* The console's sign-in opens on the same ground as the landing page: ink and contour lines, the scope sweeping over them. */
body.console .gate.splash { background: var(--ink) url("/static/contours.svg") center / cover; }
body.console .gate .splash-scope .ring { border-color: rgba(220, 240, 242, 0.14); }
body.console .gate .org-link { background: none; color: var(--surface); box-shadow: inset 0 0 0 1px #5b7f8c; }
body.console .gate .org-link:hover { box-shadow: inset 0 0 0 1px var(--surface); }
body.console .gate .gate-card { box-shadow: var(--shadow); background: var(--surface); }
.programme-name { margin: 1.25rem 0 0.5rem; font-size: 1rem; }
