/* ASDLC — pulpit nastawni: tor etapów, sygnalizatory faz, pasy Confluence / Jira. */
:root {
  --enamel: #e4e8e2;
  --plate: #f5f6f2;
  --ink: #1c2a28;
  --ink-2: #4d5c58;
  --rule: #c3cbc4;
  --conf: #4357c9;
  --jira: #1c6e80;
  --goal: #6d3b6b;
  --amber: #d8951c;
  --green: #2d8650;
  --red: #c23b2a;

  --display: 'Archivo', 'Arial Narrow', system-ui, sans-serif;
  --body: 'Atkinson Hyperlegible', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --r: 6px;
}

* { box-sizing: border-box; }
html { background: var(--enamel); color: var(--ink); }
body { margin: 0; font: 15px/1.5 var(--body); min-height: 100vh; }
h1, h2, h3 { font-family: var(--display); font-stretch: 112%; letter-spacing: -0.01em; margin: 0; }
code { font-family: var(--mono); font-size: 0.86em; background: rgb(28 42 40 / 0.07); padding: 0.05em 0.35em; border-radius: 3px; }
.muted { color: var(--ink-2); font-weight: 400; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

/* ---------- nagłówek ---------- */
.top {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  padding: 14px 24px; background: var(--ink); color: var(--plate);
}
.brand { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, var(--amber) 0 7px, transparent 8px), var(--ink);
  box-shadow: inset 0 0 0 3px var(--plate);
}
.brand-name { margin: 0; font: 800 20px/1 var(--display); font-stretch: 125%; letter-spacing: 0.06em; }
.brand-sub { margin: 2px 0 0; font-size: 13px; color: #b8c4bf; }
.controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn {
  font: 600 14px/1 var(--body); padding: 9px 14px; border-radius: var(--r); cursor: pointer;
  border: 1px solid currentColor; background: transparent; color: inherit;
}
.btn:hover { background: rgb(255 255 255 / 0.08); }
.btn.primary { background: var(--amber); border-color: var(--amber); color: var(--ink); }
.btn.primary:hover { background: #e7a634; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.small { padding: 4px 8px; font-size: 12px; }
.speed, .follow { font-size: 13px; display: flex; align-items: center; gap: 6px; color: #d6ded9; }
.speed select { font: inherit; padding: 6px; border-radius: var(--r); border: 1px solid #6b7a75; background: var(--ink); color: var(--plate); }
.sim-badge {
  margin: 0; font: 600 11px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.08em;
  padding: 6px 9px; border: 1px dashed #8a9893; border-radius: 3px; color: #d6ded9;
}

.btn.danger { border-color: #e0806f; color: #ffd9d1; }
.btn.danger:hover { background: rgb(194 59 42 / 0.35); }
body[data-mode="live"] .demo-only { display: none; }

/* przełącznik trybu: dwie pozycje jak dźwignia nastawni */
.mode-switch { display: inline-flex; border: 1px solid #6b7a75; border-radius: var(--r); padding: 2px; gap: 2px; }
.mode-btn {
  font: 700 12px/1 var(--display); font-stretch: 112%; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 8px 12px; border: 0; border-radius: 4px; background: transparent; color: #b8c4bf; cursor: pointer;
}
.mode-btn:hover:not(:disabled) { color: var(--plate); background: rgb(255 255 255 / 0.08); }
.mode-btn[aria-pressed="true"] { background: var(--plate); color: var(--ink); }
.mode-btn[data-mode="live"][aria-pressed="true"]::before {
  content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%;
  background: var(--green); vertical-align: 1px;
}
.mode-btn:disabled { opacity: 0.45; cursor: not-allowed; }
body[data-mode="live"] .sim-badge { border-style: solid; border-color: var(--amber); color: #f3d08d; }

.notice { padding: 12px 24px; background: #fbeed3; border-bottom: 1px solid var(--amber); font-size: 14px; }
.notice p { margin: 0; }
.notice ul { margin: 6px 0 0; padding-left: 20px; }
.notice li { overflow-wrap: anywhere; }

/* ---------- tor etapów (sygnatura) ---------- */
.track { background: var(--plate); border-bottom: 1px solid var(--rule); padding: 18px 24px 12px; position: relative; }
.track ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); position: relative; }
.track ol::before { /* szyna */
  content: ''; position: absolute; left: 7%; right: 7%; top: 9px; height: 4px;
  background: repeating-linear-gradient(90deg, var(--ink) 0 14px, transparent 14px 20px);
  opacity: 0.25;
}
.station button {
  all: unset; cursor: pointer; display: grid; justify-items: center; text-align: center; gap: 4px; width: 100%;
  position: relative;
}
.station button:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 4px; }
.station-dot {
  width: 22px; height: 22px; border-radius: 50%; background: var(--plate);
  border: 3px solid var(--rule); position: relative; z-index: 1;
}
.station.past .station-dot { background: var(--ink); border-color: var(--ink); }
.station.now .station-dot { background: var(--amber); border-color: var(--ink); box-shadow: 0 0 0 6px rgb(216 149 28 / 0.25); animation: pulse 1.4s ease-in-out infinite; }
.station-name { font: 700 13px/1.2 var(--display); font-stretch: 118%; text-transform: uppercase; letter-spacing: 0.04em; }
.station.future .station-name { color: var(--ink-2); }
.station-hint { font-size: 12px; color: var(--ink-2); line-height: 1.3; max-width: 17ch; }
.track-counter { margin: 8px 0 0; text-align: right; font: 12px var(--mono); color: var(--ink-2); }
@keyframes pulse { 50% { box-shadow: 0 0 0 11px rgb(216 149 28 / 0.05); } }

/* ---------- układ ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 0; align-items: start; }
.main { padding: 20px 24px 60px; min-width: 0; }
.side {
  position: sticky; top: 0; height: 100vh; display: grid; grid-template-rows: minmax(0, 1.4fr) minmax(0, 1fr);
  border-left: 1px solid var(--rule); background: var(--plate);
}
.panel-title { font: 700 12px/1 var(--display); font-stretch: 118%; text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 10px; }
.side .panel { padding: 16px 18px; min-height: 0; display: flex; flex-direction: column; }
.side .panel + .panel { border-top: 1px solid var(--rule); }

.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--ink); margin-bottom: 22px; overflow-x: auto; }
.tab {
  font: 700 13px/1 var(--display); font-stretch: 110%; padding: 11px 14px; cursor: pointer;
  border: 0; background: transparent; color: var(--ink-2); border-radius: var(--r) var(--r) 0 0; white-space: nowrap;
}
.tab:hover { color: var(--ink); background: rgb(28 42 40 / 0.05); }
.tab.on { background: var(--ink); color: var(--plate); }

.view-head { margin-bottom: 18px; max-width: 78ch; }
.view-head h1 { font-size: 30px; font-weight: 800; margin-bottom: 6px; }
.lede { margin: 0 0 8px; color: var(--ink-2); }
.empty { padding: 40px; border: 2px dashed var(--rule); border-radius: var(--r); text-align: center; color: var(--ink-2); }
.empty h2 { color: var(--ink); margin-bottom: 6px; }
.sub { font-size: 18px; margin: 26px 0 8px; }
.file-path { font-size: 13px; color: var(--ink-2); margin: 4px 0 16px; }

/* ---------- identyfikatory i ślad ---------- */
.ref {
  font: 600 12px/1 var(--mono); padding: 3px 6px; border-radius: 3px; cursor: pointer;
  border: 1px solid var(--rule); background: var(--plate); color: var(--ink); vertical-align: 1px;
}
.ref:hover { border-color: var(--ink); }
.ref[data-ref^="G-"] { color: var(--goal); border-color: rgb(109 59 107 / 0.4); }
.ref[data-ref^="REQ-"], .ref[data-ref^="BRD-"] { color: var(--conf); border-color: rgb(67 87 201 / 0.4); }
.ref[data-ref^="ASD-"] { color: var(--jira); border-color: rgb(28 110 128 / 0.4); }
.ref[data-ref^="F-"] { color: var(--green); border-color: rgb(45 134 80 / 0.4); }
.ref[data-ref^="X-"], .ref.warn { color: var(--red); border-color: rgb(194 59 42 / 0.45); }
.ref.hl { background: var(--amber); color: var(--ink); border-color: var(--ink); }
[data-node] { transition: opacity 0.15s; }
[data-node].dim { opacity: 0.28; }
tr[data-node].hl, .card.hl, .goal-card.hl, li[data-node].hl, .task-head.hl { box-shadow: inset 4px 0 0 var(--amber); }
.trace-bar {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin-bottom: 14px;
  background: rgb(216 149 28 / 0.15); border: 1px solid var(--amber); border-radius: var(--r); font-size: 14px;
}
.trace-bar button { margin-left: auto; }

/* ---------- sygnalizatory faz ---------- */
.lights { display: inline-flex; gap: 4px; vertical-align: middle; }
.light {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  font: 700 11px/1 var(--mono); border: 2px solid var(--ink); background: var(--plate); color: var(--ink-2);
}
.light.running { background: var(--amber); color: var(--ink); animation: blink 0.9s steps(2) infinite; }
.light.passed { background: var(--green); color: #fff; }
.light.failed { background: var(--red); color: #fff; }
.light.retried { box-shadow: 0 0 0 2px var(--plate), 0 0 0 4px var(--red); }
.light.interrupted { border-style: dashed; background: #f3d08d; color: var(--ink); }
.light.error { background: var(--ink); color: #ff9c8c; }
@keyframes blink { 50% { background: #f3d08d; } }

/* ---------- przepływ ---------- */
.goal-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 20px; }
.goal-card { background: var(--plate); border: 1px solid var(--rule); border-top: 4px solid var(--goal); border-radius: var(--r); padding: 12px 14px; }
.goal-card p { margin: 8px 0; font-size: 14px; }
.goal-card.met { border-top-color: var(--green); }
.gstat { font: 600 12px/1 var(--mono); color: var(--ink-2); }
.gstat.met { color: var(--green); }
.gstat.met::before { content: '● '; }

.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--r); background: var(--plate); }
.flow-table, .plain { border-collapse: collapse; width: 100%; font-size: 14px; }
.flow-table th, .plain th { text-align: left; font: 700 12px/1.2 var(--display); font-stretch: 110%; padding: 10px 12px; border-bottom: 2px solid var(--ink); vertical-align: bottom; }
.flow-table td, .plain td { padding: 10px 12px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.flow-table tr:last-child td, .plain tr:last-child td { border-bottom: 0; }
.lane-tag { display: block; font: 600 10px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 6px; }
.lane-tag.c { color: var(--conf); } .lane-tag.g { color: var(--goal); } .lane-tag.j { color: var(--jira); }
.lane-tag.s { color: #9a6a10; } .lane-tag.f { color: var(--green); } .lane-tag.p { color: var(--ink); }
td.lane-c { box-shadow: inset 3px 0 0 rgb(67 87 201 / 0.5); }
.issue-link { all: unset; cursor: pointer; display: block; margin-bottom: 4px; }
.issue-link:hover { text-decoration: underline; }
.issue-link:focus-visible { outline: 3px solid var(--amber); }
.key { font: 600 12px var(--mono); color: var(--jira); margin-right: 4px; }
.lozenge { display: inline-block; font: 700 11px/1 var(--body); text-transform: uppercase; letter-spacing: 0.04em; padding: 4px 6px; border-radius: 3px; background: #dfe3e6; color: #42526e; }
.lozenge.doing { background: #d6e4f7; color: #0b4fa8; }
.lozenge.review { background: #f4e6c4; color: #7a5200; }
.lozenge.done { background: #d3ecdc; color: #1c6338; }
.lozenge.blocked { background: #f6dcd7; color: #8f2a1d; }
.proof { font: 700 13px var(--mono); color: var(--green); }
.legend { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; margin-top: 26px; font-size: 14px; color: var(--ink-2); }
.legend h3 { font-size: 14px; color: var(--ink); margin-bottom: 6px; }
.legend p { margin: 0 0 8px; }
.legend-lights { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }

/* ---------- Confluence ---------- */
.cf { background: #fff; border: 1px solid var(--rule); border-radius: var(--r); padding: 28px 40px 36px; max-width: 900px; box-shadow: inset 0 4px 0 var(--conf); }
.cf-crumbs { margin: 0 0 14px; font-size: 13px; color: var(--ink-2); }
.cf-title { font-size: 30px; font-weight: 750; font-stretch: 100%; }
.cf-byline { margin: 8px 0 2px; font-size: 13px; color: var(--ink-2); }
.cf-status { margin-left: 8px; font: 700 11px/1 var(--body); text-transform: uppercase; padding: 4px 6px; border-radius: 3px; background: #d3ecdc; color: #1c6338; }
.md h2 { font-size: 19px; margin: 24px 0 8px; font-stretch: 105%; }
.md h3 { font-size: 16px; margin: 18px 0 6px; }
.md p, .md li { max-width: 75ch; }
.md ul { padding-left: 20px; }
.md li { margin: 4px 0; }
.md table { border-collapse: collapse; margin: 8px 0 16px; font-size: 13px; }
.md th, .md td { border: 1px solid var(--rule); padding: 6px 8px; text-align: left; }
.checklist { list-style: none; padding: 0; }
.checklist li { display: flex; gap: 8px; align-items: baseline; margin: 6px 0; }
.box { flex: none; width: 16px; height: 16px; border: 2px solid var(--ink-2); border-radius: 3px; display: inline-grid; place-items: center; font-size: 11px; transform: translateY(2px); }
.checklist li.done .box { background: var(--green); border-color: var(--green); color: #fff; }

/* ---------- graf ---------- */
.counts { display: flex; gap: 14px; flex-wrap: wrap; margin: 8px 0 0; font: 13px var(--mono); }
.counts .k::before { content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 5px; border-radius: 2px; background: currentColor; vertical-align: -1px; }
.k.goal { color: var(--goal); } .k.constraint { color: var(--ink-2); } .k.intent { color: var(--jira); } .k.fact { color: var(--green); } .k.finding { color: var(--red); }
.graph-wrap { overflow: auto; max-height: 72vh; border: 1px solid var(--rule); border-radius: var(--r); background: var(--plate) radial-gradient(rgb(28 42 40 / 0.12) 1px, transparent 1.2px) 0 0 / 18px 18px; }
.graph { display: block; margin: 0 auto; }
.gcol { font: 700 11px var(--display); font-stretch: 115%; letter-spacing: 0.08em; fill: var(--ink-2); }
.edge { fill: none; stroke: var(--ink-2); stroke-width: 1.5; opacity: 0.55; }
.edge.spawns { stroke: var(--goal); }
.edge.yields { stroke: var(--jira); }
.edge.derived_from { stroke-dasharray: 3 4; }
.edge.proves { stroke: var(--green); stroke-width: 2.5; opacity: 0.9; }
.edge.hl { opacity: 1; stroke-width: 3; }
.gnode { cursor: pointer; }
.gnode rect { fill: #fff; stroke: var(--ink); stroke-width: 1.5; }
.gnode.goal rect { stroke: var(--goal); stroke-width: 2.5; }
.gnode.goal.met rect { fill: #e4f2e8; stroke: var(--green); }
.gnode.constraint rect { fill: #eceee9; stroke-dasharray: 5 3; }
.gnode.intent rect { stroke: var(--jira); }
.gnode.fact rect { stroke: var(--green); }
.gnode.finding rect { fill: #fbe9e6; stroke: var(--red); stroke-width: 2; }
.gnode.hl rect { stroke: var(--amber); stroke-width: 3.5; }
.gnode:focus-visible rect { stroke: var(--amber); stroke-width: 4; }
.gnode.fresh rect { animation: born 0.6s ease-out; }
@keyframes born { from { fill: #f3d08d; } }
.nid { font: 600 11px var(--mono); fill: var(--ink-2); }
.nlabel { font: 13px var(--body); fill: var(--ink); }
.edge-legend { display: flex; gap: 18px; flex-wrap: wrap; font: 12px var(--mono); color: var(--ink-2); }
.edge-legend .e::before { content: ''; display: inline-block; width: 26px; height: 0; border-top: 2px solid; margin-right: 6px; vertical-align: middle; }
.e.spawns { color: var(--goal); } .e.yields { color: var(--jira); } .e.proves { color: var(--green); } .e.derived_from::before { border-top-style: dashed; }

/* ---------- Jira ---------- */
.board { display: grid; grid-template-columns: repeat(5, minmax(210px, 1fr)); gap: 12px; overflow-x: auto; }
.col { background: #ebeeea; border-radius: var(--r); padding: 10px; min-height: 260px; box-shadow: inset 0 3px 0 var(--jira); }
.col h2 { font: 700 12px/1 var(--display); font-stretch: 112%; text-transform: uppercase; letter-spacing: 0.06em; padding: 6px 4px 12px; color: var(--ink-2); }
.col-empty { color: var(--ink-2); text-align: center; }
.card { position: relative; background: #fff; border-radius: 4px; padding: 10px 12px; margin-bottom: 8px; box-shadow: 0 1px 2px rgb(28 42 40 / 0.2); }
.card-hit { position: absolute; inset: 0; border: 0; background: transparent; cursor: pointer; border-radius: 4px; }
.card-hit:focus-visible { outline: 3px solid var(--amber); }
.card .ref, .card .lights { position: relative; z-index: 1; }
.card-sum { margin: 0 0 8px; font-size: 14px; }
.card-meta { margin: 0 0 8px; display: flex; gap: 8px; font-size: 12px; color: var(--ink-2); }
.card-meta .pts { margin-left: auto; background: #dfe3e6; border-radius: 10px; padding: 0 7px; font-weight: 700; }
.card-foot { margin: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.card-foot .lights { margin-left: auto; }
.card-foot .light { width: 18px; height: 18px; font-size: 9px; border-width: 1.5px; }

/* ---------- task / SPARC ---------- */
.picker { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.pick { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid var(--rule); background: var(--plate); border-radius: var(--r); cursor: pointer; font: inherit; }
.pick.on { border-color: var(--ink); box-shadow: inset 0 -3px 0 var(--amber); }
.pick .light { width: 16px; height: 16px; font-size: 8px; border-width: 1.5px; }
.eyebrow { margin: 0 0 4px; font-size: 12px; color: var(--ink-2); }
.task-head h1 { font-size: 26px; font-weight: 800; }
.task-meta { margin: 8px 0 18px; font-size: 14px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.phases { list-style: none; padding: 0; margin: 0 0 20px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; position: relative; }
.phase { background: var(--plate); border: 1px solid var(--rule); border-radius: var(--r); padding: 12px; min-width: 0; }
.phase.running { border-color: var(--amber); box-shadow: inset 0 3px 0 var(--amber); }
.phase.passed { box-shadow: inset 0 3px 0 var(--green); }
.phase.failed { border-color: var(--red); box-shadow: inset 0 3px 0 var(--red); }
.phase header { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.phase h3 { font-size: 15px; }
.role { margin: 2px 0 0; font-size: 12px; color: var(--ink-2); overflow-wrap: anywhere; }
.attempt + .attempt { border-top: 1px dashed var(--rule); margin-top: 8px; padding-top: 8px; }
.attempt-no { margin: 0 0 4px; font: 600 11px var(--mono); color: var(--ink-2); text-transform: uppercase; }
.gate { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.gate li { margin: 3px 0; }
.gate .ok { color: var(--ink); } .gate .ok::first-letter { color: var(--green); }
.gate .bad { color: var(--red); font-weight: 700; }
.working { margin: 0; font-size: 13px; color: #9a6a10; }
.task-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.task-cols .panel { background: var(--plate); border: 1px solid var(--rule); border-radius: var(--r); padding: 16px; }
.task-cols .panel-title + * { margin-top: 0; }
.task-cols .panel > * + .panel-title { margin-top: 18px; }
.comments { list-style: none; padding: 0; margin: 0; }
.comments li { display: flex; gap: 8px; margin: 0 0 10px; font-size: 14px; }
.avatar { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--amber); font: 700 10px/26px var(--mono); text-align: center; }
.facts { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.facts li { padding: 6px 8px; border-left: 3px solid var(--green); margin-bottom: 6px; background: #fff; border-radius: 0 4px 4px 0; }
.facts li.finding { border-left-color: var(--red); background: #fdf1ef; }
.phase.error { border-color: var(--ink); box-shadow: inset 0 3px 0 var(--ink); }
.phase.interrupted { border-style: dashed; }
.artifact-links { margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; }
.artifact-link { color: var(--conf); font-weight: 700; text-underline-offset: 2px; }
.artifact-link.on { color: var(--ink); text-decoration-color: var(--amber); text-decoration-thickness: 3px; }
.artifact-view { background: #fff; border: 1px solid var(--rule); border-radius: var(--r); padding: 16px 22px; margin: 0 0 20px; box-shadow: inset 4px 0 0 var(--conf); min-width: 0; }
.artifact-view header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.artifact-view header .panel-title { margin: 0 auto 0 0; }
.artifact-view .btn { color: var(--ink); }
.artifact-view .btn:hover { background: rgb(28 42 40 / 0.06); }
.artifact-body { overflow-wrap: anywhere; }
.artifact-body table { display: block; max-width: 100%; overflow-x: auto; }
.cli { list-style: none; margin: 0; padding: 0; font-size: 12px; max-height: 240px; overflow-y: auto; }
.cli li { display: flex; gap: 8px; align-items: baseline; padding: 3px 0; border-bottom: 1px dashed var(--rule); min-width: 0; }
.cli code { background: none; padding: 0; overflow-wrap: anywhere; min-width: 0; }
.cli-phase { flex: none; font: 700 10px/16px var(--mono); width: 16px; height: 16px; text-align: center; border-radius: 50%; border: 1.5px solid var(--ink); }
.cost { font: 600 12px var(--mono); color: var(--ink); background: rgb(216 149 28 / 0.18); padding: 2px 6px; border-radius: 3px; }
.delivery-facts { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 4px 0 0; font-size: 14px; }

/* ---------- repozytorium ---------- */
.hint {
  margin: 0 0 16px; padding: 10px 14px; border: 1px solid var(--amber); border-left-width: 5px;
  border-radius: var(--r); background: rgb(216 149 28 / 0.12); font-size: 14px; max-width: 78ch;
}
.repo-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 14px; }
.repo-panel { background: var(--plate); border: 1px solid var(--rule); border-radius: var(--r); padding: 16px; min-width: 0; box-shadow: inset 0 3px 0 var(--ink); }
.facts-grid { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: 14px; }
.facts-grid dt { font: 700 12px/1.6 var(--display); font-stretch: 110%; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-2); }
.facts-grid dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.facts-grid code { overflow-wrap: anywhere; }
.repo-mode { font: 700 13px/1 var(--display); font-stretch: 110%; padding: 4px 8px; border-radius: 3px; background: #d6e4f7; color: #0b4fa8; }
.repo-mode.new { background: #e7dcef; color: var(--goal); }
.repo-mode.blocked { background: #f6dcd7; color: #8f2a1d; }
.yes { color: var(--green); font-weight: 700; }
.no { color: var(--red); font-weight: 700; }
.problems { margin: 0; padding-left: 18px; color: var(--red); }
.empty .problems { text-align: left; display: inline-block; }
.report { margin-top: 26px; background: #fff; border: 1px solid var(--rule); border-radius: var(--r); padding: 18px 26px; }

/* ---------- panel boczny ---------- */
.log { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; font-size: 13px; }
.log li { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 8px; padding: 5px 0; border-bottom: 1px solid rgb(195 203 196 / 0.6); }
.log li.last { background: rgb(216 149 28 / 0.14); }
.log li.muted { display: block; }
.log .msg { overflow-wrap: anywhere; }
.actor { font: 600 11px/1.6 var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-orch { color: var(--ink); } .a-goals { color: var(--goal); } .a-plan { color: var(--conf); } .a-worker { color: var(--jira); } .a-role { color: #9a6a10; }
.memory { overflow-y: auto; flex: 1; font-size: 12px; }
.memory details { margin-bottom: 8px; }
.memory summary { cursor: pointer; font-size: 13px; }
.memory dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 10px; margin: 6px 0 0 12px; }
.memory dt { font: 600 11px var(--mono); color: var(--ink-2); }
.memory dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- Strażnik: pasek stanu, łańcuch wznowień, czekanie na limit ---------- */
.guard-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
  padding: 8px 24px; background: #26383a; color: var(--plate); font-size: 14px;
  border-bottom: 3px solid var(--green);
}
.guard-bar[data-tone="wait"] { border-bottom-color: var(--amber); }
.guard-bar[data-tone="halt"] { border-bottom-color: var(--red); }
.guard-bar[data-tone="idle"] { border-bottom-color: #6b7a75; }
.guard-label { font: 700 11px/1 var(--display); font-stretch: 118%; text-transform: uppercase; letter-spacing: 0.08em; color: #b8c4bf; }
.guard-part { overflow-wrap: anywhere; min-width: 0; }
.guard-cancel {
  margin-left: auto; padding: 4px 10px; font: inherit; font-size: 13px; font-weight: 600; color: var(--plate);
  background: transparent; border: 1px solid rgb(255 255 255 / 0.35); border-radius: 4px; cursor: pointer;
}
.guard-cancel:hover { background: rgb(255 255 255 / 0.08); }
.guard-cancel:disabled { opacity: 0.45; cursor: not-allowed; }
.guard-part.run::before, .guard-part.wait::before, .guard-part.halt::before, .guard-part.idle::before {
  content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; vertical-align: 1px;
  background: var(--green);
}
.guard-part.wait::before { background: var(--amber); }
.guard-part.halt::before { background: var(--red); }
.guard-part.idle::before { background: #8a9893; }
.guard-part.info { font: 600 12px/1.4 var(--mono); color: #f3d08d; }
.guard-part.warn { font-size: 13px; color: #ffd9d1; }

.chain-panel { margin-top: 14px; }
.chain-table code.path { overflow-wrap: anywhere; }
.chain-table td { overflow-wrap: break-word; }
.chain-error { margin: 4px 0 0; font-size: 13px; color: var(--red); }

.station-wait {
  display: inline-block; margin-left: 4px; padding: 2px 5px; border-radius: 3px;
  background: var(--amber); color: var(--ink); font: 700 10px/1 var(--mono); text-transform: none; letter-spacing: 0;
}
.station.waiting .station-dot { animation: none; background: var(--plate); border-color: var(--amber); }
.wait-tag { display: inline-block; margin-left: 6px; padding: 1px 5px; border-radius: 3px; background: var(--amber); color: var(--ink); font: 700 10px/1.4 var(--mono); }

/* ---------- ekran tokenu dostępu ---------- */
body.locked { overflow: hidden; }
.login {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px;
  background: var(--ink); overflow-y: auto;
}
.login[hidden] { display: none; }
.login-card {
  width: min(100%, 420px); display: grid; gap: 10px; padding: 28px; border-radius: var(--r);
  background: var(--plate); color: var(--ink); box-shadow: inset 0 4px 0 var(--amber);
}
.login-card h1 { font-size: 24px; }
.login-card p { margin: 0; }
.login-card label { font: 700 12px/1 var(--display); font-stretch: 118%; text-transform: uppercase; letter-spacing: 0.08em; margin-top: 6px; }
.login-card input {
  font: 15px var(--mono); padding: 10px 12px; border: 1px solid var(--ink-2); border-radius: var(--r);
  background: #fff; color: var(--ink); min-width: 0;
}
.login-card .btn.primary { justify-self: start; }
.login-error { min-height: 1.5em; color: var(--red); font-size: 14px; overflow-wrap: anywhere; }

/* ---------- responsywność ---------- */
@media (max-width: 1180px) {
  .phases { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
}
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; height: auto; grid-template-rows: auto auto; border-left: 0; border-top: 1px solid var(--rule); }
  .log, .memory { max-height: 320px; }
  .task-cols, .legend { grid-template-columns: 1fr; }
  .track { overflow-x: auto; }
  .track ol { grid-template-columns: repeat(8, minmax(112px, 1fr)); min-width: 896px; }
  .station-name { font-size: 11px; }
  .station-hint { display: none; }
}
@media (max-width: 640px) {
  .top, .main, .track, .notice, .guard-bar { padding-left: 14px; padding-right: 14px; }
  .cf { padding: 20px; }
  .view-head h1 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
