:root {
  color-scheme: dark;
  --bg: #111620;
  --panel: #181f2c;
  --panel-inset: #141b27;
  --line: #313c50;
  --text: #edf1f7;
  --muted: #a9b5c9;
  --soft: #8392aa;
  --mint: #8ce1bb;
  --amber: #ffd38a;
  --mono: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background: radial-gradient(ellipse 950px 430px at 54% 0%, #1b2434, transparent), var(--bg);
  line-height: 1.5;
}
button, select, input { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--mint); }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 4px; }
section, aside { scroll-margin-top: 18px; }
.shell { width: min(1192px, calc(100% - 64px)); margin-inline: auto; }
.topbar { border-bottom: 1px solid var(--line); background: #131a25; }
.topbar-inner { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.brand { display: flex; align-items: center; gap: 11px; font-size: 15px; font-weight: 750; line-height: 1.2; }
.brand small { display: block; color: var(--soft); font: 10px var(--mono); letter-spacing: .13em; margin-top: 5px; }
nav { display: flex; gap: 29px; font-size: 14px; color: var(--muted); }
.repo-link { color: var(--muted); font-size: 13px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 7px; white-space: nowrap; }
.repo-link span { margin-left: 4px; }

.intro { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-block: 41px 22px; }
.eyebrow { margin: 0 0 8px; color: var(--soft); font: 600 11px var(--mono); letter-spacing: .14em; }
.intro .eyebrow { color: var(--mint); display: flex; align-items: center; gap: 8px; }
.square { width: 7px; height: 7px; background: var(--mint); border-radius: 2px; }
h1 { margin: 0; font-size: clamp(39px, 6.2vw, 65px); letter-spacing: -.065em; line-height: 1.06; font-weight: 760; }
.subtitle { margin: 10px 0 0; color: var(--muted); font-size: 15px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; padding: 10px 15px; border-radius: 7px; font-size: 14px; font-weight: 720; white-space: nowrap; }
.primary { background: var(--mint); color: #112c23; }
.primary:hover { background: #b1f3d2; color: #112c23; }

.source-bar, .source-info { display: flex; align-items: center; gap: 11px; }
.source-bar { justify-content: space-between; min-height: 48px; padding: 6px 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-inset); margin-bottom: 16px; }
.source-info { flex-wrap: wrap; gap: 5px 11px; }
#source-commit { color: var(--mint); font: 12px var(--mono); }
#source-commit:hover { text-decoration: underline; }
#source-status { color: var(--muted); font-size: 12px; }
.badge { display: inline-block; border: 1px solid #3b4960; border-radius: 5px; padding: 3px 7px; background: #222d40; color: #bcc9df; font: 600 11px var(--mono); white-space: nowrap; }
.badge[data-tone="mint"] { background: #213a35; border-color: #365a50; color: var(--mint); }
.badge[data-tone="amber"] { background: #3b3227; border-color: #665136; color: var(--amber); }
.refresh { display: flex; align-items: center; gap: 6px; background: transparent; border: 1px solid transparent; border-radius: 5px; padding: 6px; font-size: 12px; color: var(--muted); cursor: pointer; }
.refresh:not(:disabled):hover { color: var(--mint); border-color: var(--line); }

.summary-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; }
.card { min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 20px 22px; }
h2 { font-size: 21px; margin: 0; line-height: 1.2; letter-spacing: -.025em; }
.count-row { display: flex; align-items: center; gap: 12px; margin-block: 10px 9px; }
.count { margin: 0; font-size: 49px; font-weight: 730; line-height: 1; letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.total { color: var(--soft); font-size: 25px; font-weight: 570; letter-spacing: -.04em; }
progress { display: block; width: 100%; height: 11px; accent-color: var(--mint); border: 0; border-radius: 4px; background: #303b4f; overflow: hidden; }
progress::-webkit-progress-bar { background: #303b4f; }
progress::-webkit-progress-value { background: var(--mint); }
progress::-moz-progress-bar { background: var(--mint); }
.scale { display: flex; justify-content: space-between; margin-top: 6px; color: var(--soft); font: 10px var(--mono); }
.card-foot { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.evidence { margin: 10px 0 0; }
.evidence div { padding: 9px 0; display: flex; align-items: center; justify-content: space-between; gap: 6px 10px; border-bottom: 1px solid var(--line); }
.evidence dt { font-size: 13px; font-weight: 640; }
.evidence dd { margin: 0; }
.tiny-link { color: var(--mint); font-size: 12px; font-weight: 600; white-space: nowrap; }
.tiny-link:hover { text-decoration: underline; }
.evidence .tiny-link { margin-left: 5px; }
.evidence-note { color: var(--muted); font-size: 12px; margin: 10px 0 0; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(244px, .41fr); gap: 16px; margin-top: 16px; align-items: start; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 8px; }
.filters { display: flex; gap: 8px; margin-block: 16px 10px; }
.search { flex: 1; position: relative; display: flex; min-width: 0; }
.search svg { pointer-events: none; position: absolute; left: 10px; top: 11px; color: var(--soft); }
input, select { border: 1px solid var(--line); background: var(--panel-inset); border-radius: 6px; min-height: 38px; font-size: 13px; }
input { padding: 6px 8px 6px 34px; width: 100%; }
input::placeholder { color: var(--soft); opacity: 1; }
select { padding: 6px 8px; }
button:disabled { opacity: .5; cursor: default; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; text-align: left; }
th { color: var(--soft); text-transform: uppercase; letter-spacing: .08em; font: 600 10px var(--mono); }
th, td { padding: 10px 7px; border-bottom: 1px solid var(--line); vertical-align: top; }
th:first-child { width: 70px; }
th:last-child { width: 89px; }
.task-id { font: 600 12px var(--mono); color: var(--muted); padding-top: 13px; }
summary { cursor: pointer; font-size: 13px; font-weight: 620; overflow-wrap: anywhere; }
summary::marker { color: var(--soft); }
summary:hover { color: var(--mint); }
.task-info { color: var(--muted); margin: 6px 0 0 13px; font-size: 12px; white-space: pre-line; overflow-wrap: anywhere; }
.empty { color: var(--muted); padding: 18px 7px; font-size: 13px; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; color: var(--muted); font: 11px var(--mono); }
.pagination div { display: flex; gap: 5px; }
.pagination button { display: grid; place-items: center; width: 34px; height: 32px; border-radius: 5px; border: 1px solid var(--line); background: var(--panel-inset); cursor: pointer; font-size: 15px; }
.pagination button:not(:disabled):hover { color: var(--mint); border-color: var(--mint); }

.aside-text { color: var(--muted); font-size: 13px; margin: 9px 0 10px; }
.source-list { list-style: none; margin: 0; padding: 0; counter-reset: sources; }
.source-list li { counter-increment: sources; border-bottom: 1px solid var(--line); }
.source-list a { display: flex; align-items: center; gap: 8px; padding: 10px 0; font-size: 13px; }
.source-list a::before { content: "0" counter(sources); color: var(--mint); font: 11px var(--mono); }
.source-list a > span:last-child { margin-left: auto; color: var(--mint); }
.source-list small { display: block; color: var(--soft); font-size: 11px; }
.priorities { margin-top: 16px; }
.priorities h3 { margin: 0 0 8px; font-size: 13px; }
.priorities ul { list-style: none; display: grid; gap: 6px; padding: 0; margin: 0; }
.priorities li { color: var(--muted); font-size: 12px; }
.priorities code { color: var(--mint); font: 600 11px var(--mono); margin-right: 6px; }
footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; margin: 23px 0 18px; padding: 13px 0; border-top: 1px solid var(--line); color: var(--soft); font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; left: 15px; top: -80px; z-index: 1; background: var(--panel); padding: 8px 12px; }
.skip-link:focus { top: 10px; }

@media (max-width: 820px) {
  .shell { width: calc(100% - 38px); }
  .card { padding: 17px; }
  .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 625px) {
  .topbar-inner { min-height: 0; flex-wrap: wrap; gap: 0 12px; padding-top: 12px; }
  nav { order: 3; flex-basis: 100%; gap: 23px; padding-block: 11px; }
  .intro { display: block; margin-top: 28px; }
  .intro .button { margin-top: 13px; }
  .summary-grid { grid-template-columns: 1fr; }
}
@media (max-width: 385px) {
  .shell { width: calc(100% - 26px); }
  .card { padding-inline: 12px; }
  .evidence div { align-items: start; }
  .evidence dd { text-align: right; }
  th:first-child { width: 57px; }
  th:last-child { width: 77px; }
  th, td { padding-inline: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
.external-icon {
  display: inline-block;
  width: 9px;
  height: 9px;
  position: relative;
  vertical-align: 1px;
}
.external-icon::before {
  content: "";
  width: 6px;
  height: 6px;
  position: absolute;
  top: 0;
  right: 0;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
}
.external-icon::after {
  content: "";
  width: 11px;
  border-top: 1px solid currentColor;
  position: absolute;
  top: 4px;
  right: -1px;
  transform: rotate(-45deg);
}
.pagination button { width: 45px; font: 600 11px var(--mono); }
.task-info a { color: var(--mint); text-decoration: underline; }

/* Read-only restricted-task visibility and capability catalog. */
.restriction-toggle { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-size: 13px; color: var(--muted); cursor: pointer; }
.restriction-toggle input { accent-color: var(--mint); width: 16px; height: 16px; }
.access-power { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; max-width: 270px; white-space: normal; }
.tool-table-scroll { overflow-x: auto; }
#tool-power table { width: 100%; }
#tool-power td { vertical-align: top; }
#restriction-summary { margin: 4px 0 10px; }

/* Local-only runtime evidence import controls. */
.runtime-inputs { display: flex; flex-wrap: wrap; gap: 12px 24px; margin: 18px 0; }
.runtime-inputs label { display: grid; gap: 7px; min-width: min(280px, 100%); color: var(--muted); font-size: 13px; }
.runtime-inputs input[type="file"] { max-width: 100%; font-size: 12px; color: var(--text); }
.runtime-inputs input[type="file"]::file-selector-button { padding: 7px 9px; margin-right: 7px; border-radius: 5px; border: 1px solid var(--line); background: var(--panel-inset); color: var(--text); cursor: pointer; }
#clear-local-evidence { margin: 8px 0; border-color: var(--line); }
#runtime-evidence strong { font-weight: 700; }

/* Automation center control inventory: no false operational status or enabled remote actions. */
.topbar nav { flex-wrap: wrap; gap: 9px 18px; }
.control-center { margin: 18px 0 24px; padding: 22px; }
.control-heading { align-items: start; gap: 10px 20px; flex-wrap: wrap; }
.control-center h2 .badge { vertical-align: middle; margin-left: 8px; }
.control-center h3 { margin: 0; font-size: 16px; line-height: 1.35; }
.control-master-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin: 19px 0 9px; padding: 15px; border: 1px solid #3c4c65;
  border-radius: 9px; background: #121c2b;
}
.control-master-label { display: grid; grid-template-columns: auto auto; gap: 4px 9px; margin-right: auto; }
.control-master-label > strong { font-size: 14px; }
.control-master-label > small { grid-column: 1 / -1; max-width: 480px; color: var(--muted); font-size: 11px; }
.control-master-label .badge { justify-self: start; }
.control-master-switch input { width: 23px; min-height: 23px; height: 23px; margin: 0 8px; padding: 0; cursor: not-allowed; }
.control-master-bar .control-action { margin: 0; }
.control-action { border: 1px solid var(--line); color: #9cadc5; border-radius: 6px; padding: 6px 10px; min-height: 32px; background: #1b293d; font: 600 11px var(--mono); }
.control-action:disabled { opacity: .55; cursor: not-allowed; }
.control-note { color: var(--soft); font-size: 12px; margin: 10px 0; }
.control-group-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; margin: 20px 0; align-items: start; }
.control-group { min-width: 0; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-inset); padding: 16px; }
.control-group-heading { display: flex; align-items: start; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; }
.control-meta { color: #99c6e3; font: 10px var(--mono); }
.control-group > .aside-text { min-height: 50px; }
.control-import { display: flex; align-items: end; flex-wrap: wrap; gap: 7px 14px; margin: 10px 0; }
.control-import label { display: grid; gap: 6px; font-size: 12px; color: var(--muted); }
.control-import input[type="file"] { padding: 6px; max-width: min(360px,100%); font-size: 11px; }
.control-import input[type="file"]::file-selector-button { background: #21344e; color: var(--text); padding: 5px; border: 1px solid var(--line); border-radius: 4px; }
.control-import .refresh { border-color: var(--line); }
.control-rows { display: grid; gap: 6px; margin-top: 9px; }
.control-row { display: grid; gap: 10px; padding: 11px; border-radius: 7px; border: 1px solid #334159; background: #1a2535; }
.control-description { display: grid; gap: 5px; justify-items: start; min-width: 0; }
.control-title { font-size: 13px; overflow-wrap: anywhere; }
.control-detail { color: var(--muted); font-size: 11px; }
.control-row-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 12px; }
.control-row-actions > .tiny-link { margin-right: auto; }
.control-stage { display: inline-flex; align-items: center; gap: 5px; color: #d0dbed; white-space: nowrap; font-size: 11px; cursor: pointer; }
.control-stage input { min-height: 16px; width: 16px; height: 16px; margin: 0; padding: 0; accent-color: #88c9ed; }
.control-shutdown { border-top: 1px solid var(--line); padding-top: 17px; }
.control-planner-actions { display: flex; flex-wrap: wrap; gap: 9px; margin: 12px 0; }
.control-planner-actions button { border: 1px solid #476484; background: #1b3049; border-radius: 6px; padding: 8px 12px; color: #e5f1ff; cursor: pointer; font-size: 12px; }
.control-planner-actions button:hover { border-color: #89cfff; }
#control-plan-preview { white-space: pre-wrap; overflow-wrap: anywhere; background: #111824; color: #bfcfe5; font: 11px/1.65 var(--mono); padding: 14px; border: 1px solid var(--line); border-radius: 7px; max-height: 250px; overflow-y: auto; }
@media (max-width: 900px) { .control-group-grid { grid-template-columns: 1fr; } }
@media (max-width: 625px) {
  .control-center { padding: 14px; }
  .control-master-bar { align-items: start; }
  .control-master-label { width: 100%; }
  .control-center h2 .badge { display: table; margin: 6px 0 0; }
  .topbar nav { gap: 10px 16px; }
}


/* CF-EXP-GAME-LEARN-001: additive, optional learning layer */
.gameful-lab { margin-block: 16px; border-color: #41556b; background: linear-gradient(115deg, #172531, #1b202f 85%); }
.gameful-lab .section-heading { align-items: center; }
.gameful-action, .gameful-choices button {
  border: 1px solid #6b9cb7; background: #243f54; border-radius: 7px;
  color: #e8f9ff; padding: 10px 14px; cursor: pointer; font-size: 13px; font-weight: 700;
}
.gameful-action:hover, .gameful-choices button:not(:disabled):hover { background: #355872; border-color: #a2ddec; }
.gameful-choices button:disabled { cursor: not-allowed; opacity: .55; }
#gameful-content { margin-top: 15px; padding: 18px; background: #101a27; border: 1px solid #48657b; border-radius: 9px; }
#gameful-content[hidden], #gameful-next[hidden], #gameful-source[hidden] { display: none; }
#gameful-content h3 { font-size: clamp(19px, 3.5vw, 29px); margin: 5px 0 8px; color: #b5e9ff; letter-spacing: -.025em; }
#gameful-claim { font-size: 15px; line-height: 1.6; }
.gameful-choices { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
#gameful-result { margin-top: 14px; font-weight: 700; color: #dceaf6; }
#gameful-result[data-tone="pass"] { color: #8ce1bb; }
#gameful-result[data-tone="retry"] { color: #ffd38a; }
#gameful-explanation { color: #bccde0; }
#gameful-source, .gameful-note a { color: #91d5ee; text-decoration: underline; text-underline-offset: 3px; }
#gameful-next { margin-top: 12px; }
.gameful-note { color: #a9b5c9; font-size: 12px; margin-bottom: 0; }
@media (max-width: 625px) {
  .gameful-lab { padding: 14px; }
  .gameful-lab .section-heading { align-items: start; flex-direction: column; }
}


/* Optional plain/playful selector; classroom mode changes only presentation. */
.gameful-mode-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 12px 0 16px; }
.gameful-mode-line label { font-size: 13px; font-weight: 650; }
#gameful-mode { background: #142b3c; color: #eff7ff; border-color: #56758b; padding: 6px 10px; width: auto; max-width: 100%; }
#gameful-mode:disabled { opacity: .6; cursor: not-allowed; }
.gameful-mode-note { width: 100%; font-size: 12px; color: #a9b5c9; margin: 0; }
/* Neutral presentation retains legibility and evidence, reduces game decorations. */
.gameful-lab[data-learning-mode="plain"] { background: var(--panel); border-color: var(--line); }
.gameful-lab[data-learning-mode="plain"] #gameful-content { background: var(--panel-inset); border-color: var(--line); }
.gameful-lab[data-learning-mode="plain"] #gameful-content h3 { color: var(--text); font-size: clamp(19px, 2.4vw, 24px); }
.gameful-lab[data-learning-mode="plain"] .gameful-action,
.gameful-lab[data-learning-mode="plain"] .gameful-choices button { background: #253143; border-color: #64748b; }
@media (max-width: 625px) { .gameful-mode-line { align-items: stretch; } #gameful-mode { width: 100%; } }


/* CF-EXP-GAME-LEARN-001 v0.4: phone-size and assistive input hardening.
   Scoped to the optional learning lab. Does not affect owner controls. */
.gameful-lab .gameful-action,
.gameful-lab .gameful-choices button {
  min-width: 44px;
  min-height: 44px;
  padding: 12px 16px;
  line-height: 1.25;
  touch-action: manipulation;
}
.gameful-lab #gameful-mode {
  min-height: 44px;
  min-width: 44px;
  font-size: 16px; /* Avoid Safari zooming a select whose text is smaller than 16px. */
  line-height: 1.25;
}
.gameful-lab #gameful-source,
.gameful-lab .gameful-note a {
  display: inline-flex;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
  padding-block: 9px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  touch-action: manipulation;
}
.gameful-lab :is(button,select,a):focus-visible,
.gameful-lab #gameful-title:focus,
.gameful-lab #gameful-explanation:focus {
  outline: 3px solid #a8e8ff;
  outline-offset: 3px;
}
.gameful-lab #gameful-title:focus,
.gameful-lab #gameful-explanation:focus {
  scroll-margin-top: 24px;
}
@media (max-width: 390px) {
  .gameful-lab #gameful-content { padding: 12px; }
  .gameful-lab .gameful-choices { gap: 10px; }
  .gameful-lab .gameful-choices button { flex: 1 1 92px; }
  .gameful-lab .gameful-action { max-width: 100%; white-space: normal; }
}


/* v0.4 companion: permit existing automation source-status text to wrap on
   narrow phones. Visual layout only; disabled/connected state is unchanged. */
@media (max-width: 480px) {
  .control-description { justify-items: stretch; }
  .control-description :is(.control-title,.control-detail,.badge) {
    display: block;
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}


/* Avoid single-line evidence badges widening other intact dashboard sections at
   mid-size phone widths (e.g., 430px). Preserve all badges and their text. */
@media (max-width: 480px) {
  .badge {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}


/* CF-EXP-GAME-LEARN-001 v0.5: optional, no-storage larger lesson text.
   Only presentation changes; never alters grading, research data or controls. */
.gameful-lab .gameful-accessibility {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 4px 0 14px;
}
.gameful-lab .gameful-accessibility label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
}
.gameful-lab #gameful-large-text {
  margin: 0;
  width: 22px;
  min-width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  accent-color: #92d9ef;
}
.gameful-lab .gameful-accessibility .gameful-mode-note { flex-basis: 100%; }
.gameful-lab[data-large-text="true"] #gameful-content h3 {
  font-size: clamp(25px, 5vw, 34px);
  line-height: 1.22;
  overflow-wrap: anywhere;
}
.gameful-lab[data-large-text="true"] #gameful-claim {
  font-size: 21px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.gameful-lab[data-large-text="true"] #gameful-result {
  font-size: 18px;
  line-height: 1.5;
}
.gameful-lab[data-large-text="true"] #gameful-explanation {
  font-size: 19px;
  line-height: 1.58;
  overflow-wrap: anywhere;
}
.gameful-lab[data-large-text="true"] #gameful-source,
.gameful-lab[data-large-text="true"] .gameful-choices button,
.gameful-lab[data-large-text="true"] #gameful-next {
  font-size: 17px;
}
.gameful-lab[data-large-text="true"] .gameful-choices button {
  flex: 1 1 100px;
}
.gameful-lab #gameful-large-text:focus-visible + span { outline: 2px solid #a8e8ff; }
@media (prefers-contrast: more) {
  .gameful-lab #gameful-content { background: #060b12; border-color: #e7f4ff; }
  .gameful-lab #gameful-claim,
  .gameful-lab #gameful-explanation { color: #ffffff; }
  .gameful-lab #gameful-result { color: #ffffff; }
  .gameful-lab .gameful-choices button:not(:disabled),
  .gameful-lab .gameful-action:not(:disabled) { border: 2px solid #ffffff; }
  .gameful-lab #gameful-source,
  .gameful-lab .gameful-note a { color: #b7edff; text-decoration-thickness: 2px; }
}
@media (forced-colors: active) {
  .gameful-lab .gameful-choices button,
  .gameful-lab .gameful-action,
  .gameful-lab #gameful-mode { border: 2px solid ButtonText; }
  .gameful-lab #gameful-content { border: 1px solid CanvasText; }
}


/* CF-EXP-GAME-LEARN-001: progressive on-device acceptance guide.
   Details remain closed by default; no telemetry, persistence or app claim. */
.gameful-lab .gameful-device-check {
  margin-top: 14px;
  padding: 3px 12px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
}
.gameful-lab .gameful-device-check summary {
  display: list-item;
  min-height: 44px;
  padding: 12px 0;
  color: var(--text);
  cursor: pointer;
  font-weight: 650;
}
.gameful-lab .gameful-device-check :is(p, li) {
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.gameful-lab .gameful-device-check ol {
  padding-inline-start: 23px;
  margin: 8px 0;
}
.gameful-lab .gameful-device-check summary:focus-visible {
  outline: 3px solid #a8e8ff;
  outline-offset: 3px;
}

/* CF-EXP-GAME-LEARN-001 v0.6: evidence-gated, read-only field brief. */
#gameful-field-brief[hidden] { display: none; }
.gameful-field-brief {
  margin-top: 18px;
  padding: 16px;
  background: #142b31;
  border: 1px solid #6599a4;
  border-left: 4px solid #b5e9ff;
  border-radius: 9px;
  overflow-wrap: anywhere;
}
.gameful-field-brief h4 {
  margin: 0 0 8px;
  color: #d5f7ff;
  font-size: clamp(1.02rem, 3vw, 1.2rem);
}
.gameful-field-brief p { margin: 8px 0; line-height: 1.6; }
.gameful-field-brief #gameful-field-evidence { color: #c2e5d4; }
.gameful-field-brief #gameful-field-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-block: 6px;
  color: #a9e5ff;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.gameful-field-brief .gameful-field-limit { color: #b8c7d9; font-size: .84rem; }
@media (max-width: 625px) {
  .gameful-field-brief { padding: 12px; }
  .gameful-field-brief #gameful-field-link { max-width: 100%; }
}


/* Hidden is authoritative inside the optional learning lab.
   An authored inline-flex selector previously overrode [hidden] on the source link,
   showing an evidence link before the learner answered. Scope to this lab only. */
.gameful-lab [hidden] { display: none !important; }

/* Signed-in Scheduled link is the real task-control entrypoint; fit iPhone widths. */
#open-live-chatgpt-tasks { max-width:100%; white-space:normal; overflow-wrap:anywhere; text-align:center; }
