:root {
  /* TEP visual system — neutral warm grounds + blue accents + coral highlight */
  --stone:  #f6f3ed;   /* warm page background            */
  --paper:  #f0ede6;   /* second warm ground (insets)     */
  --mist:   #e8ebef;
  --fog:    #dce2e8;
  --graphite:#1a1d21;

  --deep:   #1e3a8a;   /* Deep Blue   — brand, headings   */
  --ocean:  #2563eb;   /* Ocean Blue  — primary action    */
  --sky:    #7db2eb;
  --violet: #8b5cf6;
  --coral:  #ff7a59;   /* the accent  — highlight         */
  --sand:   #f2b36b;

  /* semantic */
  --bg: var(--stone);
  --surface: #ffffff;     /* lifted cards sit crisp on the warm ground */
  --ink: #1a1d21;
  --ink-soft: #64748b;
  --line: #e7e1d4;        /* warm hairline, sits on stone  */
  --line-cool: #e5e9ef;   /* hairline on white cards       */
  --hover: #efeadf;       /* warm hover on stone           */
  --accent: var(--ocean);
  --accent-soft: #e9f0fd;
  --coral-soft: #ffede6;
  --ok: #10b981;  --ok-soft: #e7f7f1;
  --warn: #f59e0b; --warn-soft: #fdf3e0;
  --err: #ef4444; --err-soft: #fceaea;
  --info: #2563eb;

  /* Soft palette gradient meshes — a faint blue→violet→coral→sky wash that sits behind the
     fields you type into and behind dashboard cards/tables (like the Stripe input grounds).
     Kept very low-alpha over white so text stays crisp. */
  --field-mesh:
    radial-gradient(120% 150% at 0% 0%,   rgba(37,99,235,.08),  transparent 55%),
    radial-gradient(120% 150% at 100% 0%, rgba(139,92,246,.07), transparent 55%),
    radial-gradient(150% 170% at 100% 100%, rgba(255,122,89,.06), transparent 60%),
    radial-gradient(150% 170% at 0% 100%, rgba(125,178,235,.08), transparent 60%),
    #ffffff;
  --panel-mesh:
    radial-gradient(120% 150% at 0% 0%,   rgba(37,99,235,.07),  transparent 58%),
    radial-gradient(130% 160% at 100% 100%, rgba(139,92,246,.06), transparent 60%),
    radial-gradient(150% 170% at 90% 8%,  rgba(255,122,89,.05), transparent 55%),
    radial-gradient(140% 160% at 8% 100%, rgba(125,178,235,.06), transparent 60%),
    #ffffff;

  /* Soft coloured frames + outer glow to match the meshes (like the Stripe colour glow).
     A faint blue→violet hairline plus a low-alpha coloured halo — subtle but visible. */
  --field-border: rgba(99,102,241,.32);
  --panel-border: rgba(99,102,241,.20);
  --glow-field: 0 1px 2px rgba(20,30,60,.04), 0 8px 22px rgba(99,102,241,.12), 0 6px 18px rgba(255,122,89,.06);
  --glow-panel: 0 1px 2px rgba(20,30,60,.04), 0 12px 30px rgba(99,102,241,.10), 0 8px 22px rgba(255,122,89,.05);

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(20,30,60,.04), 0 10px 30px rgba(20,30,60,.06);
  --shadow-sm: 0 1px 2px rgba(20,30,60,.04), 0 4px 14px rgba(20,30,60,.05);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
               "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.005em;
}
.screen { min-height: 100vh; }
[hidden] { display: none !important; }

.icon { vertical-align: -5px; }

/* Brand — clean wordmark in Deep Blue */
.brand { display: inline-flex; flex-direction: column; }
.brand-mark { font-weight: 700; letter-spacing: .02em; color: var(--deep); display: inline-block; }
.brand-mark.sm { font-size: 15px; }
.brand-sub { display: block; color: var(--ink-soft); font-size: 12px; margin-top: 4px; letter-spacing: .01em; line-height: 1.3; }

/* ── Invite gate ─────────────────────────────────────────── */
.gate { display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden; }
.gate-card {
  position: relative; z-index: 1;
  background: var(--panel-mesh);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--glow-panel);
  padding: 40px;
  width: 100%; max-width: 420px;
}
.brand .brand-mark { font-size: 28px; }
/* full wordmark on the gate (instead of "TEP") — scaled to fit the card */
.brand .brand-mark.wordmark-full {
  font-size: 22px; line-height: 1.18; letter-spacing: .03em;
}
.lede { color: var(--ink-soft); margin: 20px 0 28px; }

.field { display: block; margin-bottom: 16px; }
.field-label { display: flex; align-items: center; gap: 7px; font-weight: 500; font-size: 13px; margin-bottom: 7px; color: var(--ink); }
.field-label .icon { width: 16px; height: 16px; color: var(--deep); flex: none; }
.field input, .field textarea, .field select {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--field-border); border-radius: var(--radius-sm);
  font: inherit; color: var(--ink); background: var(--field-mesh);
  box-shadow: var(--glow-field);
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field textarea { resize: vertical; min-height: 64px; }

/* Buttons */
.btn {
  font: inherit; font-weight: 500; cursor: pointer;
  padding: 10px 18px; border-radius: 10px; border: 1px solid transparent;
  transition: background .15s, border-color .15s, opacity .15s;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(37,99,235,.25), 0 6px 16px rgba(37,99,235,.20); }
.btn-primary:hover { background: var(--deep); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--hover); }
/* Coral solid — the warm secondary action (e.g. invite code, PDF download). */
.btn-coral { background: var(--coral); color: #fff; box-shadow: 0 1px 2px rgba(255,122,89,.25), 0 6px 16px rgba(255,122,89,.20); }
.btn-coral:hover { background: #f0633e; }
/* Soft pastel — a quiet, distinct accent (the platform-guide button). */
.btn-guide { background: #f1ecfe; color: #6d4fd0; border-color: #e4daf9; }
.btn-guide:hover { background: #e8e0fc; }
/* Smaller button footprint. */
.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 9px; }
.btn-sm[data-icon] .icon { width: 15px; height: 15px; margin-right: 5px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn[data-icon] .icon { width: 18px; height: 18px; margin-right: 6px; }

.msg { font-size: 13px; margin-top: 12px; }
.msg-error { color: var(--err); }
.msg-ok { color: var(--ok); }
.msg-warn { color: var(--warn); }

/* #3 — the early data-structure verdict: a coloured callout under the question. */
.data-verdict {
  margin-top: 18px; padding: 14px 16px; border-radius: 10px;
  font-size: 13px; line-height: 1.5; border: 1px solid var(--line-cool);
  background: var(--surface);
}
.data-verdict.msg-ok { background: var(--ok-soft); border-color: var(--ok); }
.data-verdict.msg-warn { background: var(--warn-soft); border-color: var(--warn); }
.data-verdict.msg-error { background: var(--err-soft); border-color: var(--err); }

/* ── App shell ───────────────────────────────────────────── */
/* the flowing particle fabric drifts behind the whole workspace too, not only Explore */
.app { position: relative; }
.app-flow { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.app-flow svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.view { position: relative; z-index: 1; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; border-bottom: 1px solid var(--line); background: var(--surface);
  position: sticky; top: 0; z-index: 5;
}
.brand-row { display: flex; align-items: center; gap: 10px; }
.topbar-title { color: var(--ink-soft); font-size: 14px; }
/* dashboards: single wordmark instead of "TEP / TEP Platform" */
.topbar-wordmark {
  text-transform: uppercase; letter-spacing: .16em; font-size: 13px; font-weight: 600;
  color: var(--deep);
}
/* clickable wordmark + home button → back to the start of the workspace */
.topbar-wordmark.as-link {
  background: none; border: none; cursor: pointer; padding: 0; font-family: inherit;
}
.topbar-wordmark.as-link:hover { color: var(--ocean); }
.home-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0; border-radius: 8px;
  background: none; border: 1px solid var(--field-border, rgba(99,102,241,.32));
  color: var(--deep); cursor: pointer;
}
.home-btn:hover { background: var(--hover); color: var(--ocean); }
.home-btn .icon { width: 18px; height: 18px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
/* save state indicator */
.save-status { font-size: 12px; color: var(--ink-soft); }
.save-status.dirty { color: var(--coral); }
.save-status.saved { color: var(--ok); }
.pill { font-size: 12px; padding: 5px 10px; border-radius: 999px; }
.pill .icon { width: 14px; height: 14px; }
.pill-muted { background: var(--hover); color: var(--ink-soft); }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-err { background: var(--err-soft); color: var(--err); }

.layout {
  display: grid;
  grid-template-columns: 240px 1fr 340px;
  gap: 24px; padding: 24px; max-width: 1280px; margin: 0 auto; align-items: start;
}

/* Steps nav — sidebar card (TEP visual system) */
.steps {
  display: flex; flex-direction: column; gap: 2px; position: sticky; top: 88px;
  background: var(--surface); border: 1px solid var(--line-cool);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 10px;
}
.step-item {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 12px; border-radius: var(--radius-sm); cursor: pointer; color: var(--ink-soft);
  border: 1px solid transparent; font-size: 14px; text-align: left; background: none; font-family: inherit;
  transition: background .15s, color .15s;
}
.step-item:hover { background: var(--stone); }
.step-item.active { background: var(--accent-soft); color: var(--deep); font-weight: 600; }
.step-item.done { color: var(--ink); }
.step-item .icon { width: 19px; height: 19px; flex: none; color: var(--deep); }
.step-item.active .icon { color: var(--accent); }
.step-num {
  margin-left: auto; font-size: 11px; font-weight: 600; color: var(--ink-soft);
  background: var(--stone); width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center;
}
.step-item.active .step-num { background: #fff; color: var(--accent); }

/* Content */
.content {
  background: var(--surface); border: 1px solid var(--line-cool);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px;
}
.step-head { display: flex; align-items: center; gap: 11px; margin: 0 0 14px; flex-wrap: wrap; }
.step-head .icon { color: var(--accent); width: 26px; height: 26px; align-self: center; }
.step-title { flex: 1 1 100%; order: 3; font-size: 26px; font-weight: 700; color: var(--deep); margin: 6px 0 0; line-height: 1.18; letter-spacing: -0.02em; }
.step-tag { font-size: 11px; font-weight: 600; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.06em; }
.step-desc { color: var(--ink-soft); margin: 0 0 22px; font-size: 14px; line-height: 1.55; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.nav-buttons { display: flex; justify-content: space-between; margin-top: 24px; }

/* Threshold / action rows */
.row-list { display: flex; flex-direction: column; gap: 12px; }
.row-card { border: 1px solid var(--line-cool); border-radius: 10px; padding: 14px; }
.row-card .grid-2 { gap: 12px; }
.row-actions { display: flex; gap: 8px; margin-top: 4px; }
.link-btn { background: none; border: none; color: var(--accent); cursor: pointer; font: inherit; padding: 0; }
.link-btn.danger { color: var(--err); }

/* Asystent AI */
.assist { margin-top: 14px; }
.assist-btn { display: inline-flex; align-items: center; gap: 6px; }
.assist-btn svg { width: 18px; height: 18px; }
.assist-out {
  margin-top: 10px; padding: 12px 14px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line);
  white-space: pre-wrap; font-size: 14px; line-height: 1.5;
}
.assist-out.assist-stub { color: var(--ink-soft); font-style: italic; }
.assist-out.assist-err { color: var(--err); border-color: var(--err); }

/* Helper agent — the quiet "ask the assistant" link at the bottom of a step */
.helper { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.helper-link {
  background: none; border: none; cursor: pointer; font: inherit;
  color: var(--ink-soft); font-size: 13px; padding: 0;
}
.helper-link:hover { color: var(--accent); }
.helper-link.helper-handoff { display: block; margin-top: 8px; color: var(--accent); }
.helper-link.helper-handoff:hover { color: var(--deep); text-decoration: underline; }
.helper-out {
  margin-top: 12px; padding: 14px 16px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line);
  white-space: pre-wrap; font-size: 14px; line-height: 1.55;
}
.helper-out.helper-stub { color: var(--ink-soft); font-style: italic; }
.helper-out.helper-err { color: var(--err); border-color: var(--err); }

/* Inspector */
.inspector {
  background: var(--surface); border: 1px solid var(--line-cool);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 22px; position: sticky; top: 88px;
}
.inspector-title { font-size: 14px; font-weight: 600; color: var(--deep); margin: 0 0 4px; }
.inspector-hint { font-size: 12px; color: var(--ink-soft); margin: 0 0 14px; }
.cir-preview {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 12px; line-height: 1.55; white-space: pre-wrap; word-break: break-word;
  background: var(--stone); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px; max-height: 60vh; overflow: auto; color: var(--ink);
}

/* Review / gates */
.review { max-width: 1280px; margin: 0 auto; padding: 0 24px 48px; }
.section-title { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 700; color: var(--deep); }
.section-title .icon { color: var(--accent); width: 20px; height: 20px; }
.gates-result { display: flex; flex-direction: column; gap: 10px; }
.gate-group-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--ink-soft); margin: 8px 0 -2px;
}
.gate-group-label:first-child { margin-top: 0; }
.gate-row {
  border: 1px solid var(--line-cool); border-radius: var(--radius-sm); padding: 14px 16px; background: var(--surface);
}
.gate-row.pass { border-left: 3px solid var(--ok); }
.gate-row.fail { border-left: 3px solid var(--err); }
.gate-row-head { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.gate-row-head .icon { width: 18px; height: 18px; }
.gate-row.pass .gate-row-head .icon { color: var(--ok); }
.gate-row.fail .gate-row-head .icon { color: var(--err); }
.gate-msgs { margin: 8px 0 0; padding-left: 26px; }
.gate-msgs li { font-size: 13px; margin: 2px 0; }
.gate-msgs li.err { color: var(--err); }
.gate-msgs li.warn { color: var(--warn); }
.export-row { display: flex; gap: 12px; margin: 22px 0; flex-wrap: wrap; }
.export-out { margin-top: 18px; }

@media (max-width: 1080px) {
  .layout { grid-template-columns: 1fr; }
  .steps, .inspector { position: static; }
  .steps { flex-direction: row; flex-wrap: wrap; }
}

/* ── Dashboard nav ───────────────────────────────────────── */
.dash-nav { display: flex; gap: 4px; }
.dash-tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 10px; border: 1px solid transparent;
  background: none; font: inherit; font-size: 14px; color: var(--ink-soft); cursor: pointer;
}
.dash-tab .icon { width: 16px; height: 16px; }
.dash-tab:hover { background: var(--hover); }
.dash-tab.active { background: var(--accent-soft); color: var(--deep); font-weight: 600; }
.dash-tab.active .icon { color: var(--accent); }

.view { display: block; }
.dash { max-width: 1100px; margin: 0 auto; padding: 28px 24px; }
.dash-head { margin-bottom: 22px; }
.dash-title { display: flex; align-items: center; gap: 10px; font-size: 26px; font-weight: 700; color: var(--deep); letter-spacing: -0.02em; margin: 0; }
.dash-title .icon { width: 26px; height: 26px; color: var(--accent); }
.dash-sub { color: var(--ink-soft); margin: 6px 0 0; }
.dash-empty { color: var(--ink-soft); padding: 24px 0; }
.dash-toolbar { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 24px; flex-wrap: wrap; }
.field.inline { flex-direction: column; gap: 6px; }
.field.inline select { min-width: 220px; }

.proof-tag { font-size: 12px; padding: 6px 12px; border-radius: 999px; font-weight: 600; }
.proof-tag.proven { background: var(--ok-soft); color: var(--ok); }
.proof-tag.hypothesis { background: var(--warn-soft); color: var(--warn); }
.proof-note { font-size: 13px; line-height: 1.5; margin: 4px 0 8px; padding: 10px 14px; border-radius: 10px; }
.proof-note.proven { background: var(--ok-soft); color: var(--ok); }
.proof-note.hypothesis { background: var(--warn-soft); color: var(--warn); }

/* Three reading levels on the results screen */
.res-level { margin: 30px 0 14px; }
.res-level:first-of-type { margin-top: 18px; }
.res-level-title { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; color: var(--deep); margin: 0; }
.res-level-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 999px; flex: none;
  background: var(--accent); color: #fff; font-size: 13px; font-weight: 700;
}
.res-level-sub { color: var(--ink-soft); font-size: 13px; margin: 6px 0 0; line-height: 1.5; }

/* Summary stat cards */
.dash-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card { display: flex; gap: 14px; align-items: center; padding: 20px;
  border: 1px solid var(--panel-border); border-radius: var(--radius); background: var(--panel-mesh); box-shadow: var(--glow-panel); }
.stat-ic { color: var(--accent); }
.stat-ic .icon { width: 28px; height: 28px; }
.stat-value { font-size: 28px; font-weight: 700; line-height: 1; }
.stat-label { font-size: 14px; font-weight: 500; margin-top: 4px; }
.stat-sub { font-size: 12px; color: var(--ink-soft); }

/* ── Results visualizations ──────────────────────────────── */
.res-charts { display: flex; flex-direction: column; gap: 20px; margin-bottom: 28px; }
.chart-panel {
  background: var(--panel-mesh); border: 1px solid var(--panel-border);
  border-radius: var(--radius); box-shadow: var(--glow-panel); padding: 22px 24px;
}
.chart-head { margin-bottom: 12px; }
.chart-title { display: flex; align-items: center; gap: 9px; font-size: 16px; font-weight: 700; color: var(--deep); margin: 0; }
.chart-title .icon { width: 20px; height: 20px; color: var(--accent); }
.chart-sub { color: var(--ink-soft); font-size: 13px; margin: 4px 0 0; }
.chart-body { width: 100%; }
.risk-chart { width: 100%; height: auto; display: block; }
.grid-line { stroke: var(--line-cool); stroke-width: 1; }
.axis-label { fill: var(--ink-soft); font-size: 11px; font-family: inherit; }
.fc-band { fill: rgba(255,122,89,.14); }
.thr-line { stroke: var(--ink-soft); stroke-width: 1.4; stroke-dasharray: 5 5; opacity: .65; }
.thr-label { fill: var(--ink-soft); }
.ig-line { stroke: var(--coral); stroke-width: 1.6; stroke-dasharray: 4 4; opacity: .9; }
.ig-label { fill: var(--coral); font-weight: 600; }
.risk-line { stroke: var(--ocean); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.pt { stroke: #fff; stroke-width: 2; }
.pt-ok { fill: var(--ok); } .pt-warn { fill: var(--warn); } .pt-err { fill: var(--err); }
.lead-bar { fill: var(--accent); opacity: .85; }

/* #2 — the "this is one case, not the population" banner above Level 3. */
.example-banner {
  display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap;
  margin: 4px 0 18px; padding: 12px 14px; border-radius: 10px;
  background: var(--accent-soft); border: 1px solid var(--line-cool);
}
.example-badge {
  flex: none; font-size: 11px; font-weight: 700; letter-spacing: .05em;
  padding: 4px 10px; border-radius: 999px; background: var(--accent); color: #fff;
}
.example-text { font-size: 13px; color: var(--ink); line-height: 1.5; }

.chart-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 14px; font-size: 12px; color: var(--ink-soft); }
.lg { display: inline-flex; align-items: center; gap: 7px; }
.lg::before { content: ""; width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.lg-ok::before { background: var(--ok); }
.lg-warn::before { background: var(--warn); }
.lg-err::before { background: var(--err); }
.lg-fc::before { background: rgba(255,122,89,.45); border-radius: 3px; }
.lg-line::before { background: var(--ocean); width: 16px; height: 3px; border-radius: 2px; }
.lg-thr::before { width: 16px; height: 0; border-top: 2px dashed var(--ink-soft); background: none; border-radius: 0; }

.chart-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.donut-panel .chart-head { margin-bottom: 6px; }
.donut-wrap { display: flex; align-items: center; gap: 20px; }
.donut-svg { flex: none; width: 132px; }
.donut { width: 132px; height: 132px; display: block; }
.donut-big { font-size: 22px; font-weight: 700; fill: var(--ink); font-family: inherit; }
.donut-small { font-size: 9px; fill: var(--ink-soft); font-family: inherit; text-transform: uppercase; letter-spacing: .05em; }
.donut-legend { list-style: none; margin: 0; padding: 0; flex: 1; display: flex; flex-direction: column; gap: 9px; }
.donut-legend li { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.lg-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.lg-label { color: var(--ink); }
.lg-val { margin-left: auto; font-weight: 600; color: var(--ink); }

.section-gap { margin: 4px 0 16px; }

@media (max-width: 760px) { .chart-row { grid-template-columns: 1fr; } }

/* Window cards: ODPOWIEDŹ → DLACZEGO → DANE */
.window-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.window-list { display: block; }
.window-card { border: 1px solid var(--panel-border); border-left-width: 4px; border-radius: var(--radius);
  background: var(--panel-mesh); padding: 20px; box-shadow: var(--glow-panel); }
.window-card.adm-ok { border-left-color: var(--ok); }
.window-card.adm-warn { border-left-color: var(--warn); }
.window-card.adm-err { border-left-color: var(--err); }
.wc-answer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.wc-when { font-size: 12px; color: var(--ink-soft); }
.badge { font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 999px; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-err { background: var(--err-soft); color: var(--err); }
.badge-neutral { background: var(--hover); color: var(--ink-soft); }
.wc-why-head { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); margin-bottom: 8px; }
.risk-meter { height: 8px; border-radius: 999px; background: var(--mist); overflow: hidden; }
.risk-fill { height: 100%; background: linear-gradient(90deg, var(--ok), var(--warn), var(--err)); }
.wc-r { font-size: 13px; font-weight: 600; margin: 6px 0 8px; }
.wc-reasons { margin: 0 0 16px; padding-left: 18px; font-size: 13px; color: var(--ink); }
.wc-reasons li { margin: 3px 0; }
.wc-data { border-top: 1px solid var(--line); padding-top: 14px; }
.data-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.data-cell { text-align: center; }
.dc-value { font-size: 16px; font-weight: 600; }
.dc-label { font-size: 12px; font-weight: 500; margin-top: 2px; }
.dc-sub { font-size: 11px; color: var(--ink-soft); }

/* Admin cards */
.admin-card { border: 1px solid var(--line-cool); border-radius: var(--radius); background: var(--surface); padding: 20px; box-shadow: var(--shadow-sm); }
.admin-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.admin-head .icon { width: 22px; height: 22px; color: var(--accent); }
.admin-title { font-weight: 600; flex: 1; color: var(--deep); }
.admin-rows { margin: 0; }
.admin-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; }
.admin-row dt { color: var(--ink-soft); }
.admin-row dd { margin: 0; text-align: right; font-weight: 500; }

/* Enterprise workspace card (#9) — opt-in encrypted, resumable session */
.ent-note { font-size: 13px; color: var(--ink-soft); line-height: 1.5; margin: 0 0 14px; }
.ent-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ent-out { margin-top: 14px; font-size: 13px; }
.ent-out.ent-ok { color: var(--deep); }
.ent-out.ent-err { color: var(--err); }
.ent-ok { color: var(--ok); font-weight: 500; margin: 0 0 8px; }
.ent-blob { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px;
  border: 1px solid var(--line-cool); border-radius: 8px; padding: 8px; resize: vertical;
  background: var(--hover); color: var(--ink); margin-bottom: 8px; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ── Explore Your System (free funnel + §9 landing) ─────────────────────────── */
.explore {
  display: grid; place-items: center; padding: 56px 24px; position: relative; overflow: hidden;
}
/* signature "aberracje TEP" — a live blue→coral particle flow-field, rendered as
   SVG streamlines (see renderFlowField in app.js) drifting behind the card. */
.explore-flow {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
}
.explore-flow svg { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 1; }

/* Stripe-style motion — the flow-field stays alive: each layer drifts slowly on its own
   rhythm while the gradient (animated in the SVG) flows the colours along the diagonal.
   Subtle, GPU-cheap (transform only), and disabled for prefers-reduced-motion. */
.flow-animated .flow-threads { animation: flowDriftA 15s ease-in-out infinite; will-change: transform; }
.flow-animated .flow-dots    { animation: flowDriftB 19s ease-in-out infinite; will-change: transform; }
.flow-animated .flow-orbits  { animation: flowBreath 17s ease-in-out infinite;
  transform-box: fill-box; transform-origin: center; will-change: transform; }
/* amplitudes are in viewBox units (1600×900) — sizeable so the drift reads clearly on screen */
@keyframes flowDriftA { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-110px, 70px); } }
@keyframes flowDriftB { 0%,100% { transform: translate(0,0); } 50% { transform: translate(85px, -60px); } }
@keyframes flowBreath { 0%,100% { transform: scale(1) rotate(0deg); } 50% { transform: scale(1.07) rotate(2.2deg); } }

/* Behind the workspace and the invite gate the motion is more DELICATE — smaller amplitude,
   slower — so it never competes with the content the user is reading. */
.app-flow .flow-animated .flow-threads,
.gate-flow.flow-animated .flow-threads,
.gate-flow .flow-animated .flow-threads { animation: flowDriftAsoft 22s ease-in-out infinite; }
.app-flow .flow-animated .flow-dots,
.gate-flow.flow-animated .flow-dots,
.gate-flow .flow-animated .flow-dots { animation: flowDriftBsoft 27s ease-in-out infinite; }
.app-flow .flow-animated .flow-orbits,
.gate-flow.flow-animated .flow-orbits,
.gate-flow .flow-animated .flow-orbits { animation: flowBreathSoft 24s ease-in-out infinite; }
@keyframes flowDriftAsoft { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-44px, 28px); } }
@keyframes flowDriftBsoft { 0%,100% { transform: translate(0,0); } 50% { transform: translate(34px, -24px); } }
@keyframes flowBreathSoft { 0%,100% { transform: scale(1) rotate(0deg); } 50% { transform: scale(1.03) rotate(1deg); } }

/* Administrator page: freeze the background motion entirely. */
.flow-paused .flow-threads,
.flow-paused .flow-dots,
.flow-paused .flow-orbits { animation: none !important; }

@media (prefers-reduced-motion: reduce) {
  .flow-animated .flow-threads,
  .flow-animated .flow-dots,
  .flow-animated .flow-orbits { animation: none; }
}
/* a soft veil only behind the card centre — the field stays vivid at the edges */
.explore::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(34% 30% at 50% 48%, rgba(246,243,237,.30), transparent 70%);
}
.explore-card {
  position: relative; z-index: 1;
  /* faint palette wash layered over the translucent card (keeps the blur-through to the flow) */
  background:
    radial-gradient(120% 150% at 0% 0%,   rgba(37,99,235,.06),  transparent 55%),
    radial-gradient(130% 160% at 100% 100%, rgba(139,92,246,.05), transparent 60%),
    radial-gradient(150% 170% at 95% 6%,  rgba(255,122,89,.045), transparent 55%),
    rgba(255,255,255,.9);
  backdrop-filter: saturate(150%) blur(16px);
  -webkit-backdrop-filter: saturate(150%) blur(16px);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  box-shadow: var(--glow-panel);
  padding: 48px;
  width: 100%; max-width: 660px;
}
/* Exactly three type levels — nothing else competes:
   1) wordmark (eyebrow)   2) title (one size, one colour)   3) body (one size). */
.explore-wordmark {
  text-transform: uppercase; letter-spacing: .16em; font-size: 13px; font-weight: 600;
  color: var(--deep); margin-bottom: 22px;
}
.landing { margin: 0 0 14px; font-weight: 700; }
.landing-line {
  display: block; font-size: 25px; font-weight: 700; line-height: 1.25;
  letter-spacing: -0.01em; color: var(--deep); margin: 0;
  text-transform: uppercase; white-space: nowrap;
}
/* System label in the coral accent (a colour from the icon set). */
.explore-eyebrow { color: var(--coral); font-size: 15px; font-weight: 600; margin: 0 0 20px; }
/* The conversation — both lines identical, stacked directly under each other. */
.explore-say { color: var(--ink); font-size: 15px; font-weight: 400; line-height: 1.5; margin: 0 0 2px; }
.explore-say + .explore-say { margin-bottom: 16px; }
.explore-textarea {
  width: 100%; padding: 12px 14px; min-height: 56px; resize: vertical;
  border: 1px solid var(--field-border); border-radius: var(--radius-sm);
  font: inherit; color: var(--ink); background: var(--field-mesh);
  box-shadow: var(--glow-field);
  transition: border-color .15s, box-shadow .15s;
}
.explore-textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.explore-intro .btn { margin-top: 14px; }

.explore-thread { display: flex; flex-direction: column; gap: 14px; max-height: 420px; overflow-y: auto; margin: 8px 0 4px; }
.bubble { max-width: 88%; }
.bubble-user { align-self: flex-end; text-align: right; }
.bubble-assistant { align-self: flex-start; }
.bubble-who { display: block; font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--ink-soft); margin-bottom: 4px; }
.bubble-text {
  display: inline-block; padding: 12px 16px; border-radius: 14px; font-size: 15px; line-height: 1.5;
  white-space: pre-wrap; text-align: left;
}
.bubble-user .bubble-text { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.bubble-assistant .bubble-text { background: var(--stone); border: 1px solid var(--line); color: var(--ink); border-bottom-left-radius: 4px; }
.bubble-thinking .bubble-text { color: var(--ink-soft); font-style: italic; }
.bubble-stub .bubble-text { background: var(--warn-soft); color: var(--warn); }
.bubble-err .bubble-text { background: var(--err-soft); color: var(--err); }

.explore-compose { display: flex; gap: 10px; align-items: flex-end; margin-top: 14px; }
.explore-compose textarea {
  flex: 1; resize: vertical; min-height: 48px; padding: 12px 14px;
  border: 1px solid var(--field-border); border-radius: 12px; font: inherit; background: var(--field-mesh);
  box-shadow: var(--glow-field);
}
.explore-compose textarea:focus { outline: none; border-color: var(--accent); background: var(--surface); }

.explore-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.explore-foot { margin: 18px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* The expert's own free-text box on each interview step. */
.your-thoughts { margin-top: 10px; padding-top: 14px; border-top: 1px dashed var(--line); }
.your-thoughts .field-label::before { content: "✎ "; color: var(--coral); }

/* TEP Match card */
.match-box { margin-top: 24px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--stone); }
.match-head { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; margin-bottom: 16px; color: var(--deep); }
.match-head .icon { width: 20px; height: 20px; color: var(--coral); }
.match-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.match-item { display: flex; gap: 12px; align-items: flex-start; }
.match-mark { flex: 0 0 22px; height: 22px; width: 22px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.match-item.yes .match-mark { background: var(--ok-soft); color: var(--ok); }
.match-item.no .match-mark { background: var(--hover); color: var(--ink-soft); }
.match-cond { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.match-note { color: var(--ink-soft); font-size: 13px; }
.match-verdict { margin-top: 16px; padding: 14px 16px; border-radius: 12px; font-size: 15px; line-height: 1.5; }
.match-verdict.fit { background: var(--ok-soft); color: var(--ok); }
.match-verdict.nofit { background: var(--warn-soft); color: var(--warn); }
.match-verdict.stub { background: var(--warn-soft); color: var(--warn); }

/* ── Global footer (every screen) ────────────────────────── */
.site-foot {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  padding: 10px 22px 11px; font-size: 12px;
  pointer-events: none;   /* let clicks pass through, except on the links */
  background: linear-gradient(to top, rgba(246,243,237,.94) 35%, rgba(246,243,237,0));
}
.foot-left { display: flex; flex-direction: column; line-height: 1.35; }
.foot-sdk { color: var(--deep); font-weight: 600; }
.foot-patent { color: var(--ink-soft); font-size: 11px; }
.foot-right { display: flex; gap: 18px; pointer-events: auto; }
.foot-right a { color: var(--ocean); text-decoration: none; white-space: nowrap; }
.foot-right a:hover { text-decoration: underline; }
/* keep content clear of the fixed footer */
.dash { padding-bottom: 64px; }
.layout { padding-bottom: 64px; }
@media (max-width: 640px) {
  .site-foot { flex-direction: column; align-items: flex-start; gap: 6px; }
  .foot-right { flex-wrap: wrap; gap: 12px; }
}

/* ── Calibrate-from-data step ─────────────────────────────────────────── */
.data-upload { margin-bottom: 16px; }
.data-csv {
  width: 100%; box-sizing: border-box; resize: vertical;
  padding: 12px 14px; border: 1px solid var(--field-border);
  border-radius: var(--radius-sm); font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink); background: var(--field-mesh);
}
.data-csv:focus { outline: none; border-color: var(--accent); box-shadow: var(--glow-field); }
.data-upload-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.data-upload-row input[type=file] { font-size: 13px; color: var(--ink-soft); }
.data-privacy { color: var(--ink-soft); font-size: 12px; margin: 10px 0 0; line-height: 1.5; }
.data-status { font-size: 13px; margin: 12px 0; color: var(--ink-soft); }
.data-status.warn { color: var(--warn); }
.data-status.saved { color: var(--ok); }

.calib-proposal { display: flex; flex-direction: column; gap: 16px; margin: 8px 0 4px; }
.calib-card {
  border: 1px solid var(--line-cool); border-radius: var(--radius-sm);
  padding: 18px; background: var(--surface);
}
.calib-card .section-title { font-size: 16px; margin: 0 0 4px; }
.calib-card .step-desc { margin: 8px 0 14px; }
.calib-summary { font-size: 14px; line-height: 1.6; margin: 8px 0; }
.calib-card p { font-size: 14px; line-height: 1.55; margin: 6px 0; }
.calib-sci { border-left: 3px solid var(--accent-soft); padding-left: 12px; }
.calib-weight { border-top: 1px solid var(--line-cool); padding-top: 14px; margin-top: 14px; }
.calib-weight:first-of-type { border-top: none; padding-top: 0; margin-top: 8px; }
.calib-weight-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.calib-weight-name { font-weight: 600; color: var(--deep); }
.calib-rationale { font-size: 12px; margin: 6px 0 0; line-height: 1.5; }

/* validation conversation */
.validate-conv { margin: 22px 0 8px; }
.validate-thread {
  display: flex; flex-direction: column; gap: 10px;
  max-height: 340px; overflow-y: auto; padding: 4px 2px; margin: 12px 0;
}
.vmsg {
  max-width: 86%; padding: 10px 14px; border-radius: 14px;
  font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word;
}
.vmsg-ai { align-self: flex-start; background: var(--paper); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.vmsg-me { align-self: flex-end; background: var(--accent-soft); border: 1px solid var(--panel-border); border-bottom-right-radius: 4px; }
.validate-compose { display: flex; gap: 10px; align-items: flex-end; }
.validate-compose textarea {
  flex: 1; box-sizing: border-box; resize: vertical;
  padding: 10px 14px; border: 1px solid var(--field-border);
  border-radius: var(--radius-sm); font: inherit; font-size: 14px;
  color: var(--ink); background: var(--field-mesh);
}
.validate-compose textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--glow-field); }

/* ── In-app platform guide modal ─────────────────────────────────────────── */
.explore-foot-sep { color: var(--ink-soft); margin: 0 8px; }
body.guide-open { overflow: hidden; }
.guide-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 24px; }
.guide-modal[hidden] { display: none; }
.guide-backdrop { position: absolute; inset: 0; background: rgba(20, 24, 31, .55); backdrop-filter: blur(2px); }
.guide-panel {
  position: relative; z-index: 1; width: min(760px, 100%); max-height: 88vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line-cool); border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(20, 24, 31, .28); padding: 36px 40px;
}
.guide-close {
  position: sticky; top: 0; float: right; margin: -12px -12px 0 0; width: 36px; height: 36px;
  border: none; background: var(--hover); color: var(--ink); border-radius: 50%;
  font-size: 22px; line-height: 1; cursor: pointer;
}
.guide-close:hover { background: var(--fog); }
.guide-eyebrow { color: var(--accent); font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.guide-title { color: var(--deep); font-size: 24px; margin: 6px 0 10px; }
.guide-lede { color: var(--ink-soft); margin: 0 0 22px; line-height: 1.55; }
.guide-h { color: var(--deep); font-size: 17px; margin: 22px 0 8px; }
.guide-body p { line-height: 1.6; margin: 0 0 12px; color: var(--ink); }
.guide-quote {
  border-left: 3px solid var(--coral); background: var(--coral-soft);
  padding: 12px 16px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-style: italic;
}
.guide-flow {
  background: var(--accent-soft); color: var(--deep); font-weight: 600;
  padding: 12px 16px; border-radius: var(--radius-sm); text-align: center;
}
.guide-list { margin: 0 0 14px; padding-left: 20px; }
.guide-list li { line-height: 1.6; margin-bottom: 8px; }
.guide-download { margin-top: 24px; text-align: center; }
.guide-download .btn { display: inline-flex; align-items: center; text-decoration: none; }
.guide-foot { color: var(--ink-soft); font-size: 12px; margin-top: 20px; border-top: 1px solid var(--line-cool); padding-top: 14px; }
