/* ───────────────────────────────────────────────────────────────────────────
   decision-methodology · shell styles — the shared cockpit scaffolding CSS.

   Pairs with shell.js. Holds ONLY the generic, cross-engagement chrome and
   components both cockpits were duplicating: page chrome (.header/.controls/
   .tabs/.view-toggle/.help-*/.content/#error), mode badges, the fork + shape-rail
   component set, the walkthrough (.pr-*) frame, the viewport-fixed tooltip
   (.mx-tip), and the responsive breakpoints for all of the above.

   Brand TOKENS (colours, radii, fonts) come from the _brand submodule:
   tokens.css + brand components/utilities are linked BEFORE this file; this sheet
   never redefines token VALUES. Per-engagement content (cockpit tables, coverage
   explorer, tools browser, authored station content) stays in each consumer's
   app.css, linked AFTER this file so an instance can still override.

   THE ONE RULE: pin via the _methodology submodule; never edit in the consumer.
   ─────────────────────────────────────────────────────────────────────────── */

/* ─── Base resets (shared) ───────────────────────────────────────────────────
   Instances may keep their own @font-face block in app.css (the woff2 set differs
   per engagement). The shell only normalises the box model + brand faces. */
* { box-sizing: border-box; margin: 0; padding: 0; }
input, select, textarea, button { font-family: var(--font-ui); font-size: inherit; }
body { font-family: var(--font-body); background: var(--color-cream); color: var(--color-text); line-height: 1.5; }
h1, h2, h3 { font-family: var(--font-headline); }
code, pre, .mono { font-family: var(--font-mono); }

/* ─── Chrome ─────────────────────────────────────────────────────────────── */
.header { background: #fff; border-bottom: 1px solid var(--color-doc-border); padding: 16px 24px; }
.header h1 { font-size: 20px; font-weight: 600; }
.header p { font-size: 13px; color: var(--color-body); margin-top: 2px; }
.tabs { display: flex; gap: 0; background: #fff; border-bottom: 2px solid var(--color-doc-border); padding: 0 24px; flex-wrap: wrap; }
.tab { padding: 12px 20px; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--color-body); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all .15s; }
.tab:hover { color: var(--color-terracotta); }
.tab.active { color: var(--color-terracotta); border-bottom-color: var(--color-terracotta); }
.controls { display: flex; align-items: center; gap: 16px; padding: 12px 24px; background: #fff; border-bottom: 1px solid var(--color-doc-border); flex-wrap: wrap; }
.controls-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--color-terracotta); }
/* View toggle — pill-in-tray (the newer Ehimare style; the cleaner of the two). */
.view-toggle { display: inline-flex; gap: 4px; background: var(--color-light); border-radius: var(--radius-button); padding: 3px; }
.view-btn { font-size: 13px; font-weight: 600; padding: 6px 14px; border: none; background: transparent; color: var(--color-subtle);
  border-radius: calc(var(--radius-button) - 3px); cursor: pointer; transition: all .15s; }
.view-btn:hover { color: var(--color-text); }
.view-btn.is-active, .view-btn.active { background: #fff; color: var(--color-terracotta); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.filter-toggles { display: flex; gap: 10px; margin-left: 16px; }
.filter-toggles label { font-size: 13px; color: var(--color-body); cursor: pointer; display: flex; align-items: center; gap: 4px; }
.filter-toggles input { cursor: pointer; accent-color: var(--color-terracotta); }
.help-toggle { font-size: 12px; color: var(--color-subtle); cursor: pointer; margin-left: auto; }
.help-toggle:hover { color: var(--color-text); }
.help-panel { display: none; background: #fff; border: 1px solid var(--color-doc-border); border-radius: 8px; padding: 16px 20px; margin-bottom: 16px; font-size: 13px; color: var(--color-body); }
.help-panel.visible { display: block; }
.help-panel h4 { font-size: 14px; color: var(--color-text); margin-bottom: 8px; }
.help-panel ul { margin-left: 18px; margin-top: 4px; }
.help-panel li { margin-bottom: 6px; line-height: 1.5; }
.content { padding: 24px; max-width: 1180px; margin: 0 auto; }
#error:not(:empty) { background: #fff3cd; border: 1px solid #ffc107; border-radius: 8px; padding: 16px 20px; margin: 20px 0; color: #856404; font-size: 13px; }
#error code { background: #f8f0d0; padding: 2px 6px; border-radius: 3px; }
.error-box h3 { font-size: 14px; color: #856404; }
.error-box p { font-size: 13px; color: #856404; margin-top: 4px; }
.error-box code { background: #f8f0d0; padding: 2px 6px; border-radius: 3px; font-size: 12px; }
.empty-state { text-align: center; padding: 40px; color: var(--color-muted); }
.empty-state p { margin-top: 8px; font-size: 14px; }
.section-h { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  color: var(--color-subtle); margin: 28px 0 12px; }
.section-h:first-child { margin-top: 4px; }
.sh-note { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--color-subtle); font-size: 12px; }

/* ─── Mode badges (🎯 Wert / 📊 Rating / 🔍 Fakt) ──────────────────────────── */
.mode-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600;
  padding: 2px 10px; border-radius: 20px; line-height: 1.6; white-space: nowrap; }
.mode-wert   { background: rgba(212,120,74,0.14); color: var(--color-terracotta); }
.mode-rating { background: rgba(37,99,235,0.12);  color: #2563eb; }
.mode-fakt   { background: rgba(176,128,0,0.14);  color: #946800; }
.mode-legend { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.mode-legend .mode-badge { cursor: default; }

/* ─── Fork card ──────────────────────────────────────────────────────────── */
.fork { background: #fff; border: 1px solid var(--color-doc-border); border-radius: var(--radius-card);
  padding: 18px 20px; margin-bottom: 16px; }
.fork-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.fork-id { font-family: var(--font-mono); font-size: 13px; color: var(--color-subtle); }
.fork-title { font-size: 18px; font-weight: 700; color: var(--color-text); }
.fork-q { font-size: 15px; color: var(--color-body); margin-top: 8px; line-height: 1.55; }
.fork-scope { font-size: 12px; color: var(--color-subtle); margin-top: 6px; }
.fork-scope.hinge { color: var(--color-terracotta); font-weight: 600; }
.fork-opts { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.fork-opt { flex: 1 1 240px; text-align: left; background: var(--color-light); border: 1.5px solid var(--color-doc-border);
  border-radius: var(--radius-button); padding: 13px 15px; cursor: pointer; transition: all .15s; }
.fork-opt:hover { border-color: var(--color-terracotta); background: rgba(212,120,74,0.05); }
.fork-opt.active { border-color: var(--color-terracotta); background: rgba(212,120,74,0.10); box-shadow: 0 0 0 1px var(--color-terracotta); }
.fork-opt-label { font-size: 15px; font-weight: 600; color: var(--color-text); }
.fork-opt-note { font-size: 12.5px; color: var(--color-subtle); margin-top: 4px; line-height: 1.45; }
.fork-lean { font-size: 12px; color: var(--color-terracotta); margin-top: 10px; font-style: italic; }
.fork-resolve { margin-top: 12px; font-size: 13px; color: var(--color-body);
  background: var(--color-light); border-radius: var(--radius-code); padding: 11px 13px; line-height: 1.5; }
.fork-resolve .mode-badge { margin-right: 6px; }
.fork-delegated { opacity: 0.97; }
.fork-closed { border-left: 4px solid #4caf50; }
.closed-tag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  padding: 2px 9px; border-radius: 12px; background: #e8f6e8; color: #1a7a1a; margin-right: 6px; }
.closedby b { color: var(--color-text); }

/* ─── Shape rail (live narrowing) ──────────────────────────────────────────── */
.shapes-rail { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 6px 0 8px; }
.shape-card { background: #fff; border: 1px solid var(--color-doc-border); border-radius: var(--radius-card);
  padding: 14px 16px; transition: opacity .25s, filter .25s, border-color .15s; position: relative; }
.shape-card.dimmed { opacity: 0.32; filter: grayscale(0.6); }
.shape-card.fav { border-color: var(--color-terracotta); box-shadow: 0 0 0 1px var(--color-terracotta); }
.shape-card.anchor { border-style: dashed; }
.shape-key { font-family: var(--font-mono); font-size: 11px; color: var(--color-subtle); }
.shape-name { font-size: 15px; font-weight: 700; color: var(--color-text); margin-top: 2px; line-height: 1.3; }
.shape-sum { font-size: 12.5px; color: var(--color-body); margin-top: 7px; line-height: 1.45; }
.shape-flag { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--color-terracotta); margin-top: 8px; }
.shapes-note { font-size: 13px; color: var(--color-subtle); margin-top: 6px; }

/* ─── Walkthrough (Entscheidungsreise) frame ───────────────────────────────────
   Superset: Ehimare's sticky bottom nav + min-height stage (so the nav lands at
   the same spot on every step and pins while scrolling) + Skischule's "Details ↗"
   exit link and larger title. Per-station CONTENT classes live in instance CSS. */
.pr-stage { min-height: calc(100vh - 200px); display: flex; flex-direction: column; position: relative; }
.pr-details { position: absolute; top: 16px; right: 22px; font-size: 14px; color: var(--color-subtle);
  cursor: pointer; text-decoration: none; z-index: 10; }
.pr-details:hover { color: var(--color-terracotta); }
.pr-body { flex: 1; max-width: 1040px; width: 100%; margin: 0 auto; padding: 16px 4px 24px;
  display: flex; flex-direction: column; }
.pr-content { flex: 1 0 auto; }
.pr-head { margin-bottom: 28px; }
.pr-step { font-family: var(--font-mono); font-size: 13px; color: var(--color-terracotta); letter-spacing: .08em; text-transform: uppercase; }
.pr-title { font-size: 38px; line-height: 1.15; font-weight: 700; color: var(--color-text); letter-spacing: -.5px; margin-top: 6px; }
.pr-sub { font-size: 19px; color: var(--color-body); margin-top: 12px; max-width: 800px; line-height: 1.55; }
.pr-nav { position: sticky; bottom: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 16px 0; border-top: 1px solid var(--color-doc-border); margin-top: 24px;
  background: var(--color-cream); box-shadow: 0 -12px 16px -8px var(--color-cream); }
.pr-btn { padding: 11px 22px; font-size: 16px; font-weight: 600; cursor: pointer;
  background: #fff; color: var(--color-text); border: 1px solid var(--color-muted); border-radius: var(--radius-button); }
.pr-btn:hover:not(:disabled) { border-color: var(--color-terracotta); color: var(--color-terracotta); }
.pr-btn:disabled { opacity: .35; cursor: default; }
.pr-btn-primary { background: var(--color-terracotta); color: #fff; border-color: var(--color-terracotta); }
.pr-btn-primary:hover:not(:disabled) { background: var(--color-terracotta-hover, #c06a3f); color: #fff; }
.pr-dots { display: flex; gap: 10px; }
.pr-dot { width: 11px; height: 11px; border-radius: 50%; border: none; background: var(--color-muted);
  cursor: pointer; padding: 0; transition: background .15s, transform .15s; }
.pr-dot:hover { transform: scale(1.25); }
.pr-dot.is-active { background: var(--color-terracotta); }

/* ─── Tooltip overlay ──────────────────────────────────────────────────────────
   The inline `.tooltip` holders stay display:none — content read by shell.js's
   viewport-fixed `.mx-tip` so tips escape any scrollable/overflow container. */
.tooltip { display: none; }
.mx-tip { position: fixed; display: none; background: var(--color-text); color: #fff; padding: 8px 12px;
  border-radius: 6px; font-size: 12px; white-space: normal; width: 300px; max-width: 40vw; text-align: left;
  z-index: 9999; box-shadow: 0 4px 12px rgba(0,0,0,0.3); pointer-events: none; line-height: 1.4; }

/* ─── Full-bleed view mode (e.g. a spreadsheet matrix) ─────────────────────────
   When a view sets fullBleed:true the shell adds body.view-fullbleed. The chrome
   stays fixed and #app becomes the single scroll context filling the viewport.
   The instance's own scroll container (its app.css) takes flex:1 1 auto inside. */
@media (min-width: 769px) {
  body.view-fullbleed { height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
  body.view-fullbleed .header, body.view-fullbleed .tabs, body.view-fullbleed .controls { flex: 0 0 auto; }
  body.view-fullbleed .content { flex: 1 1 auto; min-height: 0; max-width: none; margin: 0; padding: 12px 16px; display: flex; flex-direction: column; }
  body.view-fullbleed #app { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
}

/* ─── Responsive (EV brand breakpoints: lg 1024 · md 768 · sm 640) ───────────── */
@media (max-width: 768px) {
  .content { padding: 16px; }
  .header, .tabs, .controls { padding-left: 16px; padding-right: 16px; }
  .filter-toggles { margin-left: 0; flex-wrap: wrap; }
  .fork-opt { flex-basis: 100%; }
  .pr-body { padding: 16px 16px 20px; }
  .pr-title { font-size: 28px; }
  .pr-sub { font-size: 16px; }
}
@media (max-width: 640px) {
  .header h1 { font-size: 18px; }
  .tab { padding: 10px 14px; font-size: 13px; }
}
