/* Stół technika — oprawa Ostatniego Światła: ciemny warsztat, ciepłe światło lampy, metal. */
:root { --bg: #12110e; --panel: #1b1914; --panel2: #24211b; --line: rgba(190, 160, 105, 0.24); --text: #eae2cf; --dim: #a99d83; --gold: #e2c27e;
  --amber: #f0b45a; --ok: #9fd39b; --bad: #f2a08a; --info: #8fc3d8; --focus: #ffd27a; --r: 10px; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: radial-gradient(ellipse at 50% -10%, #2a2318 0%, var(--bg) 55%) fixed, var(--bg); color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif; overflow-x: hidden; }
a { color: var(--gold); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.st-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.st-skip { position: absolute; left: 8px; top: -60px; background: var(--gold); color: #1a150c; padding: 8px 12px; border-radius: 6px; z-index: 10; }
.st-skip:focus { top: 8px; }
.st-dim { color: var(--dim); }
.st-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.st-wordmark { display: flex; flex-direction: column; text-decoration: none; font-family: Georgia, 'Times New Roman', serif; text-transform: uppercase; color: #eee3c7; line-height: 1.05; text-shadow: 0 2px 4px #000b; }
.st-w1 { font-size: 11px; letter-spacing: .32em; color: #bdad86; } .st-w2 { font-size: 22px; letter-spacing: .1em; font-weight: 700; }
.st-sub { font-family: system-ui, sans-serif; font-size: 12px; letter-spacing: .16em; color: var(--amber); margin-top: 3px; }
.st-exits { display: flex; gap: 14px; flex-wrap: wrap; justify-content: flex-end; font-size: 14px; }
.st-main { max-width: 980px; margin: 0 auto; padding: 20px 20px 10px; outline: none; }
.st-main h1 { font-family: Georgia, 'Times New Roman', serif; font-size: 30px; line-height: 1.2; margin: 6px 0 8px; color: #f3e8cc; overflow-wrap: anywhere; }
.st-main h1:focus { outline: none; }
.st-lead { color: #d8ceb6; font-size: 17px; margin-top: 0; }
.st-crumbs { font-size: 14px; color: var(--dim); }
.st-badge { display: inline-block; margin: 0 0 10px; padding: 2px 10px; border: 1px dashed var(--amber); border-radius: 999px; color: var(--amber); font-size: 12px; letter-spacing: .14em; }
.st-warn { border: 1px solid #a8743a; background: #2b2013; color: #f6d39a; border-radius: var(--r); padding: 8px 12px; }
.st-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-top: 14px; }
.st-card { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; min-height: 44px; }
.st-card:hover { border-color: rgba(226, 194, 126, .6); background: var(--panel2); }
.st-card-icon { font-size: 26px; color: var(--gold); } .st-card b { font-size: 17px; color: #f3e8cc; } .st-card span:not(.st-card-icon) { color: var(--dim); font-size: 14px; } .st-card small { color: var(--amber); }
.st-list { list-style: none; padding: 0; display: grid; gap: 10px; }
.st-ex { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; text-decoration: none; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; min-height: 44px; }
.st-ex b { color: #f3e8cc; } .st-ex > span { color: var(--amber); letter-spacing: .1em; } .st-ex small { grid-column: 1 / -1; color: var(--dim); }
a.st-ex:hover { border-color: rgba(226, 194, 126, .6); }
.st-locked { opacity: .6; }
.st-card-serv { border: 1px solid var(--line); border-left: 4px solid var(--gold); background: var(--panel); border-radius: var(--r); padding: 10px 14px; margin: 6px 0 14px; }
.st-card-serv b { color: var(--gold); font-size: 14px; letter-spacing: .04em; } .st-card-serv p { margin: 4px 0 0; overflow-wrap: anywhere; }
.st-tool { margin: 6px 0 12px; }
.st-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.st-btn { font: inherit; font-size: 15px; color: var(--text); background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; min-height: 44px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.st-btn:hover { border-color: rgba(226, 194, 126, .7); }
.st-btn[aria-pressed="true"] { background: #3a2f1d; border-color: var(--gold); }
.st-primary { background: linear-gradient(#e9cd8d, #c9a55c); color: #1a150c; border: 0; font-weight: 600; }
.st-small { min-height: 36px; padding: 4px 10px; font-size: 14px; }
.st-status { min-height: 1.5em; margin: 6px 0; font-weight: 600; overflow-wrap: anywhere; }
.st-status.st-ok { color: var(--ok); } .st-status.st-bad { color: var(--bad); }
.st-hintbox { color: #d8ceb6; overflow-wrap: anywhere; } .st-hintbox b { color: var(--info); margin-right: 6px; }
.st-exp { display: block; font-size: 14px; color: var(--dim); } .st-exp textarea { display: block; width: 100%; margin-top: 4px; font: 13px/1.4 ui-monospace, Consolas, monospace; background: #0d0c0a; color: #d8ceb6; border: 1px solid var(--line); border-radius: 6px; padding: 8px; resize: vertical; }
.st-nav-ex { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-top: 18px; }
.st-footer { max-width: 980px; margin: 30px auto 0; padding: 12px 20px 30px; border-top: 1px solid var(--line); font-size: 13px; color: var(--dim); }
/* C2 — instalacja */
.st-pipes-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: 14px; }
.st-pipes { display: grid; gap: 4px; width: min(100%, calc(var(--cols) * 92px)); }
.st-row { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 4px; }
.st-cell { aspect-ratio: 1; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: #1d1a15; cursor: pointer; min-width: 44px; min-height: 44px; }
.st-cell svg { display: block; width: 100%; height: 100%; border-radius: 5px; }
.st-cell.st-fixed { cursor: default; border-style: dashed; }
.st-cell.st-problem { box-shadow: inset 0 0 0 3px var(--bad); }
.st-cell:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; z-index: 1; }
.st-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--dim); }
.st-legend b { color: var(--gold); } .st-wet { display: inline-block; width: 14px; height: 6px; background: #6fc3e8; vertical-align: middle; margin-right: 4px; }
@media (max-width: 640px) {
  .st-header { padding: 10px 16px; } .st-exits { flex-direction: column; align-items: flex-end; gap: 6px; }
  .st-main { padding: 14px 16px 6px; } .st-main h1 { font-size: 24px; }
  .st-cards { grid-template-columns: minmax(0, 1fr); }
  .st-actions .st-btn { flex: 1 1 calc(50% - 8px); justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media (forced-colors: active) { .st-cell.st-problem { outline: 3px solid CanvasText; } }
/* C3 — dziennik */
.st-h2 { font-family: Georgia, 'Times New Roman', serif; font-size: 20px; color: #f3e8cc; margin: 18px 0 6px; }
.st-log { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 8px; }
.st-frag { background: #efe6cf; color: #2a2316; border-radius: 6px; padding: 10px 12px; box-shadow: 0 2px 0 #0006; border-left: 4px solid #b89a5e; }
.st-log-aside .st-frag { opacity: .85; border-left-color: #8a7c62; background: #ddd3bb; }
.st-frag-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.st-grip { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: -8px 0 -8px -8px; cursor: grab; color: #7a6a48; font-size: 22px; touch-action: none; user-select: none; }
.st-mark { font-family: Georgia, 'Times New Roman', serif; color: #4a3714; overflow-wrap: anywhere; }
.st-pos { margin-left: auto; font-size: 13px; color: #6d5f45; }
.st-frag-text { margin: 6px 0 8px; font-family: Georgia, 'Times New Roman', serif; font-size: 16px; overflow-wrap: anywhere; }
.st-slot select { font: inherit; font-size: 15px; min-height: 36px; max-width: 100%; background: #fffaf0; color: #2a2316; border: 2px dashed #9b7a3a; border-radius: 4px; padding: 2px 4px; }
.st-frag-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.st-frag .st-btn { background: #3a3122; color: #f3e8cc; }
.st-frag .st-btn[hidden] { display: none; }
.st-frag:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.sortable-ghost { opacity: .4; }
/* C4 — zamek */
.st-plate { display: inline-block; max-width: 100%; margin: 0 0 10px; padding: 8px 14px; background: linear-gradient(#b9b2a3, #8f887a); color: #1f1c16; border: 2px solid #5e584c; border-radius: 4px; font: 700 14px/1.4 ui-monospace, Consolas, monospace; letter-spacing: .08em; overflow-wrap: anywhere; box-shadow: inset 0 1px 0 #fff6, 0 2px 0 #0007; }
.st-pins { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 14px; margin-bottom: 12px; }
.st-pins li { display: grid; grid-template-columns: 2.2em 1fr; }
.st-pins b { color: var(--gold); } .st-pins ol { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 4px; }
.st-roman { display: inline-block; min-width: 2.2em; color: var(--amber); font-family: Georgia, serif; font-weight: 700; }
.st-dials { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.st-dial { display: flex; flex-direction: column; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; text-align: center; }
.st-dial-name { color: #f3e8cc; }
.st-wheel { width: 120px; height: 120px; border-radius: 50%; } .st-wheel svg { width: 100%; height: 100%; display: block; }
.st-wheel:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.st-dial-btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.st-dial .st-btn { min-height: 44px; }
.st-gear { color: var(--dim); font-size: 13px; }
.st-small-print { font-size: 13px; }
@media (max-width: 640px) { .st-dials { grid-template-columns: repeat(2, minmax(0, 1fr)); } .st-dial-btns .st-btn { flex: 1 1 100%; justify-content: center; } }
/* C5 — okaz */
.st-specimen { border: 1px solid var(--line); border-left: 4px solid var(--info); background: var(--panel); border-radius: var(--r); padding: 10px 14px; margin-bottom: 8px; }
.st-specimen b { color: var(--info); } .st-specimen p { margin: 4px 0 0; overflow-wrap: anywhere; }
.st-okaz-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.st-sil { position: relative; width: 100%; max-width: 460px; aspect-ratio: 200 / 120; background: #1d1a15; border: 1px solid var(--line); border-radius: var(--r); margin: 18px 0 8px; }
.st-sil svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.st-pt { position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; border: 3px solid var(--gold); background: rgba(18, 17, 14, .75); color: #ffe2a0; font: 700 13px system-ui, sans-serif; cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center; }
.st-pt[aria-pressed="true"] { background: var(--gold); color: #1a150c; box-shadow: 0 0 0 4px rgba(226, 194, 126, .35); }
.st-traces { list-style: none; padding: 0; display: grid; gap: 8px; }
.st-traces li { display: grid; grid-template-columns: 2em 1fr; gap: 4px 8px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 10px; }
.st-traces li > :not(.st-tnum) { grid-column: 2; } .st-traces p { margin: 0; overflow-wrap: anywhere; }
.st-tnum { grid-row: 1 / span 3; font: 700 18px Georgia, serif; color: var(--gold); }
.st-traces select { display: block; width: 100%; font: inherit; min-height: 40px; margin-top: 2px; background: #0d0c0a; color: var(--text); border: 1px solid var(--line); border-radius: 6px; }
.st-traces .st-btn { justify-self: start; }
.st-stmts { display: grid; gap: 8px; }
.st-stmt, .st-scope { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); padding: 8px 12px; margin: 0; min-width: 0; }
.st-stmt legend { padding: 0 4px; overflow-wrap: anywhere; }
.st-stmt label, .st-scope label { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-right: 18px; cursor: pointer; }
.st-scope label { display: flex; margin-right: 0; overflow-wrap: anywhere; }
.st-stmt input, .st-scope input { width: 20px; height: 20px; accent-color: var(--gold); flex: none; }
@media (max-width: 760px) { .st-okaz-grid { grid-template-columns: minmax(0, 1fr); } }
