/* Principles of Management Science: course SPA styles.
   Presenter: fixed 1280x720 stage, scaled to the window. Handout: A4 document, print to PDF. */
:root {
  --navy: #1d3557; --blue: #2f6690; --sky: #e9f1f8; --accent: #e07a1f; --accent-dark: #b85c0c; --accent-soft: #fdf1e4;
  --ink: #1f2933; --muted: #5f6b7a; --line: #d5dde6; --ok: #2e7d32; --ok-soft: #e7f4ea; --warn: #b71c1c;
  --mp-c0: #a9cbe8; --mp-c1: #f7c08a; --mp-c2: #a8d5a2; /* map categories (HDB-73) */
  --note: #fff6d6; --note-line: #d4a017;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--ink); background: #f4f6f9; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
a { color: var(--blue); }
code { background: var(--sky); padding: 1px 5px; border-radius: 4px; }
.warn { color: var(--warn); font-weight: 600; }

/* ---------------- presenter ---------------- */
body.presenter { background: #0f1720; overflow: hidden; height: 100vh; }
.stage {
  position: absolute; top: 50%; left: 50%; width: 1280px; height: 720px; transform-origin: center center;
  background: #fff; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 10px 40px rgba(0,0,0,.4);
}
.frame { flex: 1; display: flex; flex-direction: column; padding: 34px 60px 14px; min-height: 0; position: relative; }
.frame::before { content: ""; position: absolute; left: 0; top: 34px; width: 12px; height: 66px; background: var(--accent); }
.fhead .kicker { color: var(--accent-dark); font-size: 16px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.fhead h1 { font-size: 38px; line-height: 1.15; color: var(--navy); margin: 6px 0 18px; font-weight: 750; }
.fbody { flex: 1; min-height: 0; overflow: hidden; font-size: calc(24px * var(--fs, 1)); line-height: 1.42; }
.fbody p { margin: 0 0 .55em; }
.fbody ul, .fbody ol { margin: .2em 0 .6em; padding-left: 1.2em; }
.fbody li { margin: .18em 0; }
.fbody strong { color: var(--navy); }
.bar {
  height: 44px; flex: 0 0 44px; background: var(--navy); color: #dbe6f2; display: flex; align-items: center;
  justify-content: space-between; padding: 0 22px; font-size: 15px;
}
.bar button { background: none; border: 0; color: #fff; font-size: 26px; cursor: pointer; padding: 0 10px; line-height: 1; }
.bar .ctr { display: flex; align-items: center; gap: 6px; }
.timer { min-width: 90px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.timer.set { border: 2px solid var(--accent); color: #fff; padding: 2px 10px; border-radius: 6px; cursor: pointer; user-select: none; }
.timer.on { background: var(--accent); }
.timer.on.late, .timer.done { background: var(--warn); border-color: var(--warn); }
.bar .rt { display: flex; align-items: center; gap: 14px; }
.bar .spk-open { font-size: 20px; opacity: .7; padding: 0 4px; }
.bar .spk-open:hover { opacity: 1; }
.toast {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%); max-width: 80vw; background: var(--navy); color: #fff;
  padding: 10px 18px; border-radius: 8px; font-size: 16px; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.toast.show { opacity: 1; }
.help { position: fixed; bottom: 8px; left: 50%; transform: translateX(-50%); color: #9fb3c8; font-size: 13px; opacity: 0; transition: opacity .2s; }
.help.show { opacity: 1; }
.reveal-only { display: none; }
.stage.revealed .reveal-only { display: block; }
.stage.revealed .opt.correct { background: var(--ok-soft); border-color: var(--ok); }
.stage.revealed .opt.correct .letter { background: var(--ok); }
/* Reveal = solution view: the task stays, long material and the checklist give way to the solution. */
.stage.revealed .f-activity .material, .stage.revealed .f-activity .visual,
.stage.revealed .f-case-task .checklist, .stage.revealed .f-case-task .special, .stage.revealed .f-case-task ol.tasks { display: none; }
.stage.revealed .fbody { overflow-y: auto; }

/* ---------------- speaker view (second window on the laptop screen) ---------------- */
body.speaker { background: #0f1720; color: #dbe6f2; height: 100vh; overflow: hidden; }
.spk {
  display: grid; height: 100vh; padding: 14px; gap: 12px 16px;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "now side" "notes side" "bar bar";
}
.spk-now { grid-area: now; }
.spk-notes {
  grid-area: notes; overflow: auto; background: var(--note); color: var(--ink); border-radius: 8px;
  padding: 14px 20px; font-size: 24px; line-height: 1.45;
}
.spk-notes p { margin: 0 0 .5em; }
/* Same screen as the presentation: the Drehbuch stays covered (see speaker() in app.js). */
.spk-veil { display: none; }
.spk-veiled .spk-veil {
  display: flex; align-items: center; justify-content: center; text-align: center; height: 100%; min-height: 120px;
  font-size: 20px; color: var(--muted); border: 2px dashed var(--note-line); border-radius: 8px; padding: 20px; cursor: pointer;
}
.spk-veiled #notes { display: none; }
.spk-notes .spk-none { color: var(--muted); font-style: italic; }
.spk-sol { margin-top: 14px; padding-top: 10px; border-top: 2px dashed var(--note-line); font-size: .85em; }
.spk-sol h4 { margin: 0 0 6px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.spk-side { grid-area: side; display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.spk-bar { grid-area: bar; display: flex; align-items: center; gap: 10px; }
.spk-label { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #9fb3c8; margin-bottom: 6px; }
/* color: the speaker page is light-on-dark, the previews must keep the slide's own text colour */
.spk-slide { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #fff; color: var(--ink); border-radius: 4px; }
.spk-slide .stage { top: 0; left: 0; transform-origin: 0 0; box-shadow: none; }
.spk-clock { font-size: 22px; font-variant-numeric: tabular-nums; color: #9fb3c8; }
.spk-timer { background: #16212d; border-radius: 10px; padding: 12px 16px; }
.spk-time { font-size: 88px; line-height: 1; font-weight: 800; font-variant-numeric: tabular-nums; color: #fff; cursor: pointer; user-select: none; }
.spk-time.on { color: var(--accent); }
.spk-time.on.late, .spk-time.done { color: #ff6b6b; }
.spk-time.unset { color: #3c4d60; }
.spk-tbtns { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 6px; }
.spk button { background: var(--navy); color: #fff; border: 1px solid #2f4a6e; border-radius: 6px; font: inherit; font-size: 18px; padding: 6px 14px; cursor: pointer; }
.spk button:hover { background: var(--blue); }
.spk-min { color: #9fb3c8; font-size: 16px; }
.spk-conn { color: #7bd389; font-size: 14px; margin-left: 12px; }
.spk-conn.off { color: #ff6b6b; }
.spk-full { color: #ffb74d; font-size: 14px; }
.spk-offline .spk-slide { opacity: .45; }
.spk-keys { margin-left: auto; color: #6b7f95; font-size: 13px; }
.spk-alone { color: #dbe6f2; font-size: 20px; padding: 40px; }
@media (max-width: 900px) {
  body.speaker { height: auto; overflow: auto; }
  .spk { height: auto; grid-template-columns: 1fr; grid-template-rows: auto auto minmax(240px, auto) auto; grid-template-areas: "now" "side" "notes" "bar"; }
}

/* frame types */
.f-title .fhead h1 { font-size: 50px; margin-bottom: 26px; }
.f-title .obj h3 { font-size: .8em; color: var(--muted); margin: 0 0 .3em; text-transform: uppercase; letter-spacing: .06em; }
.map { display: flex; gap: 10px; margin-top: 26px; flex-wrap: wrap; }
.map-ch { flex: 1; min-width: 150px; background: var(--sky); border-radius: 10px; padding: 10px 12px; font-size: 15px; color: var(--muted); }
.map-ch span { display: block; font-weight: 700; margin-bottom: 3px; }
.map-ch.on { background: var(--navy); color: #fff; }
.map-ch.on b { color: var(--accent); }
.big-prompt { font-size: 1.32em; font-weight: 650; color: var(--navy); line-height: 1.32; margin: .2em 0 .6em; }
.big-prompt p { margin: 0 0 .4em; }
ul.big { font-size: 1.12em; }
ul.big li { margin: .35em 0; }
.lay-split { display: grid; grid-template-columns: 1fr 1.15fr; gap: 38px; align-items: center; }
.lay-split.flip, .lay-visual-left { grid-template-columns: 1.15fr 1fr; }
.lay-stack .visual { margin-top: 14px; }
.lay-visual { display: flex; justify-content: center; align-items: center; height: 100%; }
.lay-visual .visual { width: 100%; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.badge { display: inline-block; font-size: 14px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--sky); color: var(--navy); letter-spacing: .02em; }
.badge.part { background: var(--navy); color: #fff; }
.task { font-weight: 600; color: var(--navy); }
.material { margin-top: 10px; font-size: .9em; }
.solution { margin-top: 14px; background: var(--ok-soft); border-left: 6px solid var(--ok); padding: 10px 16px; font-size: .82em; border-radius: 0 8px 8px 0; }
.solution > strong:first-child, .h-solution > strong:first-child { display: block; color: var(--ok); margin-bottom: 4px; }
.special { font-weight: 650; color: var(--accent-dark); margin: 0 0 .6em; }
.checklist { margin-top: 10px; background: var(--accent-soft); border-left: 6px solid var(--accent); padding: 8px 14px; font-size: .82em; border-radius: 0 8px 8px 0; }
.checklist ul { margin: 4px 0 0; }
ol.tasks li { margin: .3em 0; }
.f-case-read .case-text { font-size: .9em; column-count: 2; column-gap: 40px; line-height: 1.45; }
.f-case-read .case-text p { margin: 0 0 .6em; }
.source { font-size: 13px; color: var(--muted); margin-top: 10px; }
.q { font-size: 1.12em; font-weight: 650; color: var(--navy); margin: 0 0 .7em; }
.opts { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.opt { display: flex; gap: 14px; align-items: center; border: 2px solid var(--line); border-radius: 12px; padding: 12px 16px; font-size: .92em; }
.opt .letter { flex: 0 0 38px; height: 38px; border-radius: 50%; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.explain { margin-top: 16px; font-size: .8em; background: var(--ok-soft); padding: 10px 14px; border-radius: 8px; }
.f-exit .big-prompt { font-size: 1.6em; margin-top: 1em; }

/* ---------------- visuals ---------------- */
.visual { width: 100%; }
.visual svg { width: 100%; height: auto; display: block; }
.v-pyramid { max-height: 430px; }
.v-pyramid .pl { fill: #fff; font-weight: 700; font-size: 21px; font-family: var(--font); }
.v-pyramid .pn { fill: var(--ink); font-size: 20px; font-family: var(--font); }
.v-cycle { max-height: 440px; }
.v-cycle .cl { fill: #fff; font-size: 17px; font-weight: 650; font-family: var(--font); }
.v-cycle .cc { fill: var(--navy); font-size: 21px; font-weight: 800; font-family: var(--font); }
.v-steps { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 22px; font-size: .84em; }
.v-steps .step { background: var(--sky); border-top: 5px solid var(--blue); border-radius: 10px; padding: 12px 14px; position: relative; }
.v-steps .step:not(:last-child)::after { content: "›"; position: absolute; right: -18px; top: 30%; font-size: 30px; color: var(--accent); font-weight: 800; }
.v-steps .num { display: inline-flex; width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; margin-bottom: 6px; }
.v-steps strong { display: block; color: var(--navy); line-height: 1.2; }
.v-steps small { display: block; color: var(--muted); margin-top: 4px; font-size: .86em; line-height: 1.3; }
.v-matrix { display: grid; grid-template-columns: auto 1fr 1fr; gap: 8px; font-size: .76em; }
.v-matrix .ax { text-align: center; font-weight: 800; color: var(--muted); font-size: .85em; text-transform: uppercase; letter-spacing: .05em; align-self: center; }
.v-matrix .ax.side { writing-mode: vertical-rl; transform: rotate(180deg); }
.v-matrix .cell { border-radius: 10px; padding: 10px 14px; min-height: 90px; }
.v-matrix .cell ul { margin: 4px 0 0; padding-left: 1.1em; }
.v-matrix .t1 { background: #e3f0e6; } .v-matrix .t2 { background: #fbe4e1; } .v-matrix .t3 { background: #e3eef8; } .v-matrix .t4 { background: #fdf0de; }
.v-vc { display: grid; grid-template-columns: 1fr 74px; grid-template-rows: auto auto auto auto; font-size: .7em; }
.v-vc .vc-cap { grid-column: 1; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-size: .8em; margin: 4px 0; }
.v-vc .vc-support { grid-column: 1; display: grid; gap: 4px; }
.v-vc .vc-support div { background: #d7e3f0; color: var(--navy); padding: 6px 12px; font-weight: 650; }
.v-vc .vc-primary { grid-column: 1; display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 4px; margin-top: 4px; }
.v-vc .vc-primary div { background: var(--accent-soft); border: 2px solid #f1c08f; color: var(--accent-dark); padding: 18px 8px; text-align: center; font-weight: 700; display: flex; align-items: center; justify-content: center; min-height: 92px; }
.v-vc .vc-margin { grid-column: 2; grid-row: 1 / span 4; background: var(--accent); clip-path: polygon(0 0, 45% 0, 100% 50%, 45% 100%, 0 100%); display: flex; align-items: center; justify-content: flex-start; }
.v-vc .vc-margin span { writing-mode: vertical-rl; transform: rotate(180deg); color: #fff; font-weight: 800; margin-left: 6px; }
.v-cards { display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 14px; font-size: .84em; }
.v-cards .card { background: var(--sky); border-radius: 10px; padding: 12px 14px; }
.v-cards .card.accent { background: var(--accent-soft); }
.v-cards .card.dark { background: var(--navy); color: #fff; }
.v-cards .card.dark strong { color: #fff; }
.v-cards .card strong { display: block; color: var(--navy); line-height: 1.2; }
.v-cards .card p { margin: 6px 0 0; font-size: .9em; color: inherit; line-height: 1.35; }
.v-cards .num { display: inline-flex; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; margin-bottom: 6px; }
.v-eq { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; font-size: .95em; }
.v-eq .term { background: var(--navy); color: #fff; padding: 12px 20px; border-radius: 10px; font-weight: 700; }
.v-eq .op { font-size: 1.6em; color: var(--accent); font-weight: 800; }
.v-note { font-size: .7em; color: var(--muted); margin-top: 8px; text-align: center; }
.v-compare { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 14px; font-size: .78em; }
.v-compare .col { border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.v-compare h4 { margin: 0; padding: 8px 14px; color: #fff; font-size: 1em; }
.v-compare ul { margin: 0; padding: 10px 14px 10px 30px; }
.v-compare .tone0 h4 { background: var(--navy); } .v-compare .tone1 h4 { background: var(--accent); }
.v-compare .tone2 h4 { background: var(--blue); } .v-compare .tone3 h4 { background: #5b7f3a; }
.v-table { border-collapse: collapse; width: 100%; font-size: .72em; }
.v-table th { background: var(--navy); color: #fff; text-align: left; padding: 7px 10px; }
.v-table td { border-bottom: 1px solid var(--line); padding: 6px 10px; vertical-align: top; }
.v-table tr:nth-child(even) td { background: #f6f9fc; }
.v-stat { text-align: center; }
.v-stat .big { font-size: 3.2em; font-weight: 800; color: var(--accent); line-height: 1; }
.v-stat .lbl { font-size: 1em; color: var(--navy); font-weight: 700; margin-top: 8px; }
.v-quote { margin: 0; border-left: 8px solid var(--accent); padding: 8px 20px; font-style: italic; color: var(--navy); }
.v-quote cite { display: block; font-style: normal; font-size: .7em; color: var(--muted); margin-top: 8px; }
.v-bars { font-size: .72em; display: grid; gap: 8px; }
.v-bars .brow { display: grid; grid-template-columns: 210px 1fr 90px; align-items: center; gap: 10px; }
.v-bars .bt { background: #e8eef5; height: 22px; border-radius: 4px; overflow: hidden; display: block; }
.v-bars .bf { background: var(--blue); height: 100%; display: block; }
.v-bars .bv { font-weight: 700; color: var(--navy); }

/* ---------------- handout ---------------- */
body.handout { background: #e9edf2; font-size: 10.5pt; line-height: 1.45; }
body.handout #app { max-width: 210mm; margin: 0 auto; background: #fff; padding: 16mm 17mm; }
.h-cover { min-height: 250mm; display: flex; flex-direction: column; justify-content: center; border-left: 10px solid var(--accent); padding-left: 14mm; }
.h-cover .inst { color: var(--muted); font-size: 10pt; text-transform: uppercase; letter-spacing: .06em; }
.h-cover h1 { font-size: 28pt; color: var(--navy); margin: 6mm 0 2mm; }
.h-cover .sub { font-size: 13pt; color: var(--muted); }
.h-cover .sess { font-size: 18pt; font-weight: 700; color: var(--accent-dark); margin-top: 12mm; }
.h-cover .lect { margin-top: 3mm; }
.h-cover .toc { margin-top: 10mm; }
.h-cover .toc ol { margin: 2mm 0 0; }
.h-cover .use { margin-top: 12mm; color: var(--muted); max-width: 140mm; }
.h-block { break-before: page; page-break-before: always; }
.h-block-head { border-bottom: 3px solid var(--navy); margin-bottom: 4mm; }
.h-block-head .kicker { color: var(--accent-dark); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: 9pt; }
.h-block-head h1 { font-size: 20pt; color: var(--navy); margin: 1mm 0 2mm; }
.h-objectives { background: var(--sky); border-radius: 6px; padding: 3mm 5mm; margin-bottom: 4mm; }
.h-objectives ul { margin: 1mm 0 0; }
.h-screen { margin: 5mm 0; }
.h-content { break-inside: avoid; }
.h-screen h2 { font-size: 13.5pt; color: var(--navy); margin: 0 0 2mm; border-left: 4px solid var(--accent); padding-left: 3mm; }
.h-screen h3 { font-size: 12pt; color: var(--navy); margin: 1mm 0 2mm; }
.h-screen h4 { font-size: 10.5pt; margin: 3mm 0 1mm; }
.h-box { border: 1px solid var(--line); border-radius: 6px; padding: 3mm 5mm; break-inside: avoid; }
.h-case, .h-check { break-inside: auto; }
.h-label { font-size: 8.5pt; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-dark); }
.handout .meta { margin: 1mm 0 1mm; }
.handout .badge { font-size: 8pt; padding: 1px 7px; }
.handout .task { font-size: 10.5pt; }
.handout .material { font-size: 10pt; }
.h-solution { background: var(--ok-soft); border-left: 4px solid var(--ok); padding: 2mm 4mm; margin-top: 3mm; border-radius: 0 4px 4px 0; }
.h-notes { background: var(--note); border-left: 4px solid var(--note-line); padding: 2mm 4mm; margin: 3mm 0; font-size: 9.5pt; }
.h-notes .deckref { color: var(--muted); }
.handout .case-text { column-count: 1; }
.handout .checklist { font-size: 9.5pt; }
.handout .visual { font-size: 11pt; margin: 3mm 0; break-inside: avoid; }
.handout .v-pyramid { max-height: 70mm; }
.handout .v-cycle { max-height: 72mm; }
.handout .v-steps .step:not(:last-child)::after { right: -15px; font-size: 22px; }
.handout .source { font-size: 8.5pt; }
.quiz-h > li { margin-bottom: 3mm; break-inside: avoid; }
.quiz-h .q { font-size: 10.5pt; margin: 0 0 1mm; }
.opts-h { list-style: none; padding-left: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1mm 6mm; margin: 0; }
.opts-h .letter { font-weight: 800; color: var(--blue); }
.key ol { margin: 1mm 0 0; }
.timing { border-collapse: collapse; margin-top: 2mm; font-size: 9pt; }
.timing td, .timing th { border-bottom: 1px solid #e3d59a; padding: 1mm 3mm; text-align: left; }
.timing td:last-child, .timing th:last-child { text-align: right; }
.timing tfoot td { font-weight: 800; }
.h-placeholder p { font-size: 11pt; }

@page { size: A4; margin: 15mm 16mm 17mm; @bottom-right { content: counter(page); font-size: 8pt; color: #8a96a3; } }
@media print {
  body.handout { background: #fff; }
  body.handout #app { max-width: none; padding: 0; margin: 0; }
  .h-cover { min-height: 255mm; }
}

/* instructor version: A4 landscape for the second screen, Drehbuch in its own column (HDB-63).
   The @page size is set in app.js handout(), only for role=instructor. */
body.handout.instructor #app { max-width: 287mm; }
.handout.instructor .h-screen { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); column-gap: 7mm; align-items: start; }
.handout.instructor .h-screen > * { grid-column: 1; }
.handout.instructor .h-screen > .h-notes { grid-column: 2; grid-row: 1 / span 40; margin: 0; font-size: 14pt; line-height: 1.4; }
.handout.instructor .h-block-head + .h-objectives + .h-notes { font-size: 11pt; }
@media print { .handout.instructor .h-cover { min-height: 170mm; } }

/* ---------------- home ---------------- */
body.home { background: #f4f6f9; }
.home-main { max-width: 1100px; margin: 0 auto; padding: 32px 24px 60px; }
.home-main header .inst { color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: 13px; }
.home-main h1 { color: var(--navy); font-size: 34px; margin: 6px 0; }
.home-main h2 { color: var(--navy); margin-top: 34px; border-bottom: 2px solid var(--line); padding-bottom: 6px; }
.home-main h3 { color: var(--accent-dark); margin: 20px 0 6px; font-size: 16px; }
.plans { color: var(--muted); }
.sessions { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; }
.sessions td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.sessions ul { margin: 0; padding-left: 18px; }
.sessions li.ph { color: var(--muted); font-style: italic; }
.sessions li.missing { color: #a0a8b2; }
.sessions td.act { white-space: nowrap; text-align: right; }
.btn { display: inline-block; background: var(--navy); color: #fff; text-decoration: none; padding: 6px 12px; border-radius: 6px; font-size: 14px; margin: 2px 0 2px 4px; }
.btn.ghost { background: #fff; color: var(--navy); border: 1px solid var(--navy); }
ul.blocks { list-style: none; padding: 0; margin: 0; }
ul.blocks li { padding: 4px 0; }
.mini { font-size: 12px; color: var(--muted); margin-left: 8px; }
.keys p { color: var(--muted); }

/* ---------------- widgets: interactive worksheets (PSD WS 26/27) ---------------- */
.widget { margin-top: 10px; }
.w-fields { display: grid; grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr)); gap: 10px 16px; }
.wf { display: flex; flex-direction: column; gap: 3px; }
.wl { font-weight: 700; color: var(--navy); font-size: .7em; text-transform: uppercase; letter-spacing: .04em; }
.wf small, .w-list small { color: var(--muted); font-size: .62em; line-height: 1.3; }
.widget input[type=text], .widget textarea {
  font: inherit; font-size: .7em; color: var(--ink); border: 1.5px solid var(--line); border-radius: 8px;
  padding: 6px 10px; background: #fff; width: 100%; resize: vertical;
}
.widget input:focus, .widget textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--sky); }
.w-ladder .wf:not(:first-child):not(:last-child) { padding-left: 1.2em; border-left: 3px solid var(--sky); }
.w-out { margin-top: 10px; display: grid; gap: 8px; }
.wo { background: var(--accent-soft); border-left: 6px solid var(--accent); border-radius: 0 8px 8px 0; padding: 8px 14px; }
.wo p { margin: 2px 0 0; font-size: .78em; }
.w-table { width: 100%; border-collapse: collapse; font-size: .7em; }
.w-table th { text-align: left; color: var(--navy); background: var(--sky); padding: 5px 8px; font-size: .9em; }
.w-table td { padding: 3px; vertical-align: top; }
.w-table textarea { font-size: 1em !important; }
.w-add { display: flex; gap: 8px; }
.w-chips { list-style: none; padding: 0 !important; margin: 10px 0 0 !important; display: flex; flex-wrap: wrap; gap: 8px; }
.w-chips li { background: var(--sky); border-radius: 999px; padding: 4px 6px 4px 14px; font-size: .75em; display: flex; align-items: center; gap: 6px; margin: 0 !important; }
.w-chips button { border: 0; background: none; color: var(--muted); font-size: 1.1em; cursor: pointer; line-height: 1; }
.w-cards { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.w-card { background: var(--navy); color: #fff; border-radius: 12px; padding: 14px 16px; min-height: 110px; display: flex; flex-direction: column; gap: 8px; }
.w-card .wl { color: #dbe6f2; }
.w-card strong { color: #fff !important; font-size: 1em; line-height: 1.25; }
.w-btn { font: inherit; font-size: 13px; border: 1.5px solid var(--blue); color: var(--blue); background: #fff; border-radius: 8px; padding: 5px 12px; cursor: pointer; }
.w-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-size: 16px; padding: 8px 18px; }
.w-btn.ghost { border-color: var(--line); color: var(--muted); }
.w-btn:hover { filter: brightness(.95); }
.w-bar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.w-status { margin-right: auto; color: var(--ok); font-size: 13px; opacity: 0; transition: opacity .3s; }
.w-status.on { opacity: 1; }
.f-widget .fbody { overflow-y: auto; }

/* canvas worksheets (HDB-58): SVG lines on top of the HTML fields, region keys map to grid areas */
.w-canvas { position: relative; display: grid; grid-template-columns: 1fr 1fr; border: 2px solid var(--navy); border-radius: 10px; background: #fff; }
/* The SVG is a regular grid item that overlaps the cells (not position: absolute: Chrome drops absolutely
   positioned grid children when printing). contain: size keeps it from adding height to the rows. */
.cv-svg { position: relative; z-index: 2; width: 100%; height: 100%; contain: size; pointer-events: none; overflow: visible; }
.cv-svg line { stroke: var(--navy); stroke-width: 1.5; }
.cv-svg circle { fill: #fff; stroke: var(--navy); stroke-width: 2; }
.cv-svg text { fill: var(--navy); font-weight: 800; font-size: 15px; }
.cv-cell { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 3px; padding: 10px 16px; min-width: 0; }
.cv-cell small { color: var(--muted); font-size: .62em; line-height: 1.3; }
.w-canvas textarea { border-style: dashed; }
.cv-empathy-map { grid-template-areas: "who who" "says thinks" "does feels"; }
.cv-empathy-map .cv-svg { grid-area: 2 / 1 / 4 / 3; }
.cv-who { grid-area: who; border-bottom: 2px solid var(--navy); }
.cv-says { grid-area: says; } .cv-thinks { grid-area: thinks; } .cv-does { grid-area: does; } .cv-feels { grid-area: feels; }
/* keep the centre free for the "User" circle: inner padding, labels of the right column mirrored outwards */
.cv-says, .cv-does { padding-right: 34px; }
.cv-thinks, .cv-feels { padding-left: 34px; align-items: flex-end; text-align: right; }
.cv-thinks textarea, .cv-feels textarea { text-align: left; }
.cv-proto-persona { grid-template-areas: "name background" "needs pains" "quote quote"; }
.cv-proto-persona .cv-svg { grid-area: 1 / 1 / 3 / 3; }
.cv-name { grid-area: name; } .cv-background { grid-area: background; } .cv-needs { grid-area: needs; } .cv-pains { grid-area: pains; }
.cv-quote { grid-area: quote; border-top: 2px solid var(--navy); }
.cv-sketch { width: 46px; height: 46px; fill: none; stroke: var(--muted); stroke-width: 2.5; }
/* printed canvas: empty, black and white, large enough to write in by hand */
.cv-print { margin: 2mm 0; font-size: 9pt; break-inside: avoid; }
.cv-print .cv-cell { min-height: calc(var(--rows, 3) * 9mm + 8mm); padding: 2mm 3.5mm; }
.cv-print .wl { font-size: 8.5pt; }
.cv-print small { font-size: 8pt; }
.cv-print .cv-svg text { font-size: 11pt; }
.cv-print .cv-sketch { width: 22mm; height: 22mm; }

/* lean canvas (HDB-73): five columns on top, costs and revenue below; the cells draw the lines themselves */
.cv-lean-canvas { grid-template-columns: repeat(10, minmax(0, 1fr)); overflow: hidden;
  grid-template-areas: "problem problem solution solution uvp uvp unfair unfair segments segments"
                       "problem problem metrics metrics uvp uvp channels channels segments segments"
                       "cost cost cost cost cost revenue revenue revenue revenue revenue"; }
.cv-lean-canvas .cv-cell { border-right: 1.5px solid var(--navy); border-bottom: 1.5px solid var(--navy); padding: 8px 10px; }
.cv-lean-canvas .cv-segments, .cv-lean-canvas .cv-revenue { border-right: 0; }
.cv-lean-canvas .cv-cost, .cv-lean-canvas .cv-revenue { border-bottom: 0; }
.cv-lean-canvas .cv-problem { grid-area: problem; } .cv-lean-canvas .cv-solution { grid-area: solution; } .cv-lean-canvas .cv-uvp { grid-area: uvp; }
.cv-lean-canvas .cv-unfair { grid-area: unfair; } .cv-lean-canvas .cv-segments { grid-area: segments; } .cv-lean-canvas .cv-metrics { grid-area: metrics; }
.cv-lean-canvas .cv-channels { grid-area: channels; } .cv-lean-canvas .cv-cost { grid-area: cost; } .cv-lean-canvas .cv-revenue { grid-area: revenue; }
.cv-lean-canvas .cv-uvp { background: var(--accent-soft); }
.cv-lean-canvas .wl { overflow-wrap: anywhere; hyphens: auto; letter-spacing: .02em; }
@media (max-width: 760px) {
  .cv-lean-canvas:not(.cv-print) { grid-template-columns: 1fr; grid-template-areas: "problem" "solution" "uvp" "unfair" "segments" "metrics" "channels" "cost" "revenue"; }
  .cv-lean-canvas:not(.cv-print) .cv-cell { border-right: 0; border-bottom: 1.5px solid var(--navy); }
}
.cv-print.cv-lean-canvas .cv-uvp { background: none; }

/* table column hints */
.w-table th small, .wp-table th small { display: block; font-weight: 400; color: var(--muted); font-size: .85em; }

/* map worksheets (HDB-73): rated rows, the 2x2 map drawn from the ratings, the top N with their fields */
.w-map { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px 22px; }
.mp-rows { grid-column: 1 / -1; }
.mp-table td.mp-n { color: var(--muted); font-weight: 700; text-align: right; padding-top: 10px; width: 1.6em; }
.mp-table select { font: inherit; font-size: 1em; padding: 6px 4px; border: 1px solid var(--line); border-radius: 6px; background: #fff; max-width: 100%; }
.mp-table td.mp-flag { text-align: center; vertical-align: middle; }
.mp-table input[type=checkbox] { width: 20px; height: 20px; }
.mp-svg { width: 100%; height: auto; display: block; }
.mp-frame { fill: none; stroke: var(--navy); stroke-width: 2; }
.mp-focus { fill: var(--accent-soft); }
.mp-mid { stroke: var(--navy); stroke-width: 1; stroke-dasharray: 4 4; }
.mp-fl { fill: var(--accent-dark); font-weight: 800; font-size: 14px; }
.mp-end { fill: var(--muted); font-size: 12px; }
.mp-ax { fill: var(--navy); font-weight: 700; font-size: 14px; }
.mp-dot circle { fill: #fff; stroke: var(--navy); stroke-width: 2; }
.mp-dot text { fill: var(--navy); font-size: 11px; font-weight: 700; }
.mp-dot.top circle { stroke: var(--accent); stroke-width: 4; }
.mp-dot.mp-c0 circle { fill: var(--mp-c0); } .mp-dot.mp-c1 circle { fill: var(--mp-c1); } .mp-dot.mp-c2 circle { fill: var(--mp-c2); }
.mp-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); margin-top: 4px; }
.mp-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--navy); margin-right: 5px; vertical-align: -1px; }
.mp-legend .mp-c0 i { background: var(--mp-c0); } .mp-legend .mp-c1 i { background: var(--mp-c1); } .mp-legend .mp-c2 i { background: var(--mp-c2); }
.mp-top h4 { margin: 0 0 6px; color: var(--navy); }
.mp-toplist { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 10px; }
.mp-toplist li { border-left: 4px solid var(--accent); padding-left: 10px; }
.mp-toplist .wf { margin-top: 4px; }
.mp-empty { color: var(--muted); font-size: .8em; }
@media (max-width: 760px) {
  .w-map { grid-template-columns: 1fr; }
  /* phones: one card per row, the text on top, the ratings below with their own labels */
  .mp-table thead { display: none; }
  .mp-table tbody tr { display: grid; grid-template-columns: 1.8em repeat(var(--mc, 2), minmax(0, 1fr)); gap: 4px 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .mp-table tbody td { padding: 0; }
  .mp-table td.mp-t, .mp-table td.mp-cat { grid-column: 2 / -1; }
  .mp-table td.mp-n { grid-row: span 3; padding-top: 6px; } /* text, type, ratings */
  /* iOS zooms into controls under 16px */
  .mp-table select, .mp-table textarea { font-size: 16px !important; }
  .mp-table td[data-l]::before { content: attr(data-l); display: block; color: var(--muted); font-size: 12px; margin-bottom: 2px; }
  .mp-table select { width: 100%; }
  .mp-table td.mp-flag { text-align: left; }
}
.mp-beamer { max-width: 760px; margin-top: 10px; }
/* em, not vh: the stage scales the frame with --fs, the window size must not shrink the task text */
.mp-beamer .mp-svg { height: 12em; width: auto; max-width: 100%; }
.wp-mapchart { width: 120mm; margin: 2mm 0; break-inside: avoid; }
.wp-mapchart .mp-focus { fill: none; }
.wp-map td { height: 9mm; }
/* the text column gets the room, the ratings stay narrow (screen and print; phones stack, see above) */
@media (min-width: 761px) { .mp-table td.mp-t { width: 52%; } }
.wp-map th:nth-child(2) { width: 52%; }
.wp-map th:first-child { width: 6mm; }

/* print worksheets */
.wp-fields { display: grid; grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr)); gap: 3mm; margin: 2mm 0; }
.wp-box { border: 1px solid var(--line); border-radius: 4px; padding: 1.5mm 2.5mm; min-height: calc(var(--rows, 1) * 8mm + 6mm); font-size: 9pt; }
.wp-box .wl { font-size: 8pt; }
.wp-box small { display: block; color: var(--muted); font-size: 8pt; }
.wp-tpl { font-size: 10pt; }
.wp-table { width: 100%; border-collapse: collapse; font-size: 9pt; margin: 2mm 0; }
.wp-table th, .wp-table td { border: 1px solid var(--line); padding: 1.5mm 2mm; text-align: left; vertical-align: top; }
.wp-table td { height: 14mm; }
.wp-decks { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 4mm; font-size: 9pt; }

/* workbook view */
body.workbook { background: #f4f6f9; }
.wb-main { max-width: 980px; margin: 0 auto; padding: 28px 24px 70px; font-size: 18px; line-height: 1.45; }
.wb-head h1 { color: var(--navy); font-size: 30px; margin: 10px 0 4px; }
.wb-head p { color: var(--muted); }
.wb-block { margin-top: 28px; }
.wb-block .kicker { color: var(--accent-dark); font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.wb-block h2 { color: var(--navy); margin: 4px 0 10px; }
.wb-item { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px 22px; margin: 14px 0; }
.wb-item h3 { color: var(--navy); margin: 0 0 6px; }
.wb-item .widget input[type=text], .wb-item .widget textarea { font-size: 16px; }
.wb-item .wl { font-size: 13px; }
.wb-item .wf small { font-size: 13px; }
@media print { .w-bar, .w-btn { display: none !important; } }
