/* Podręcznik Ocalałego — oprawa Ostatniego Światła: ciemna dolina, ciepłe światło lampy, metalowe liternictwo. */
:root {
  --bg: #12110e; --panel: #1b1914; --panel2: #23201a; --line: rgba(190, 160, 105, 0.22);
  --text: #eae2cf; --dim: #a99d83; --gold: #e2c27e; --amber: #f0b45a; --ok: #9fd39b; --info: #8fc3d8;
  --focus: #ffd27a; --radius: 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.6 system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif; overflow-x: hidden; }
a { color: var(--gold); text-underline-offset: 3px; }
a:hover { color: #fff1c9; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.pd-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pd-skip { position: absolute; left: 8px; top: -60px; background: var(--gold); color: #1a150c; padding: 8px 12px; border-radius: 6px; z-index: 10; }
.pd-skip:focus { top: 8px; }
.pd-dim { color: var(--dim); }
kbd { border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; font-size: 0.85em; color: var(--gold); }

.pd-header { display: grid; grid-template-columns: auto 1fr auto; gap: 10px 20px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line);
  background: rgba(18, 17, 14, 0.92); position: sticky; top: 0; z-index: 5; backdrop-filter: blur(6px); }
.pd-brand { display: flex; flex-direction: column; align-items: flex-start; }
.pd-wordmark { display: flex; flex-direction: column; text-decoration: none; font-family: Georgia, 'Palatino Linotype', 'Times New Roman', serif; font-weight: 700;
  text-transform: uppercase; color: #eee3c7; text-shadow: 0 1px 0 #423c2d, 0 3px 4px #000b; line-height: 1.05; }
.pd-w1 { font-size: 11px; letter-spacing: 0.32em; color: #bdad86; }
.pd-w2 { font-size: 22px; letter-spacing: 0.1em; }
.pd-sub { margin: 2px 0 0; font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--amber); }
.pd-exits { display: flex; gap: 14px; justify-self: end; grid-column: 3; grid-row: 1; flex-wrap: wrap; }
.pd-exits a { font-size: 14px; white-space: nowrap; }
.pd-search { grid-column: 2; grid-row: 1; display: flex; gap: 8px; max-width: 620px; width: 100%; justify-self: center; }
.pd-search input { flex: 1; min-width: 0; font: inherit; font-size: 16px; color: var(--text); background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; }
.pd-search input::placeholder { color: #8a806b; }
.pd-search button { font: inherit; font-size: 15px; color: #1a150c; background: linear-gradient(#e9cd8d, #c9a55c); border: 0; border-radius: 8px; padding: 0 16px; cursor: pointer; min-height: 44px; }

.pd-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 26px; max-width: 1180px; margin: 0 auto; padding: 22px 20px 10px; }
.pd-toc-wrap { position: sticky; top: 92px; align-self: start; max-height: calc(100dvh - 110px); overflow: auto; }
.pd-toc-box summary { cursor: pointer; font-weight: 600; color: var(--gold); padding: 6px 0; list-style-position: inside; }
.pd-toc, .pd-toc ul { list-style: none; margin: 0; padding: 0; }
.pd-toc > li { margin: 10px 0 4px; }
.pd-toc-cat { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--dim); margin-bottom: 2px; }
.pd-toc a { display: block; padding: 5px 8px; border-radius: 6px; text-decoration: none; color: var(--text); font-size: 14px; line-height: 1.35; }
.pd-toc a:hover { background: var(--panel2); }
.pd-toc a[aria-current="page"] { background: rgba(226, 194, 126, 0.14); color: var(--gold); box-shadow: inset 3px 0 0 var(--gold); }

.pd-main { min-width: 0; outline: none; }
.pd-main h1 { font-family: Georgia, 'Times New Roman', serif; font-size: 30px; line-height: 1.2; margin: 4px 0 8px; color: #f3e8cc; overflow-wrap: anywhere; }
.pd-main h1:focus { outline: none; }
.pd-main h2 { font-size: 18px; margin: 26px 0 10px; color: var(--gold); }
.pd-lead { font-size: 17px; color: #d8ceb6; margin-top: 0; }
.pd-crumbs { font-size: 14px; color: var(--dim); }
.pd-q { font-size: 14px; color: var(--dim); }
.pd-q i { display: inline-block; font-style: normal; background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; padding: 1px 10px; margin: 3px 4px 0 0; color: var(--text); }
.pd-article { max-width: 760px; }
.pd-article p, .pd-article li { overflow-wrap: anywhere; }
.pd-article ul, .pd-article ol { padding-left: 1.3em; }
.pd-article li { margin: 6px 0; }
.pd-steps { counter-reset: s; list-style: none; padding-left: 0 !important; }
.pd-steps li { counter-increment: s; position: relative; padding-left: 40px; min-height: 28px; }
.pd-steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: rgba(226, 194, 126, 0.16);
  border: 1px solid var(--gold); color: var(--gold); display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.pd-box { border: 1px solid var(--line); border-left-width: 4px; border-radius: var(--radius); padding: 10px 14px; margin: 16px 0; background: var(--panel); }
.pd-box b { display: block; font-size: 14px; letter-spacing: 0.02em; }
.pd-box p { margin: 4px 0 0; }
.pd-note { border-left-color: var(--info); } .pd-note b { color: var(--info); }
.pd-check { border-left-color: var(--ok); } .pd-check b { color: var(--ok); }
.pd-example { border-left-color: var(--amber); border-style: dashed; border-left-style: solid; } .pd-example b { color: var(--amber); }
.pd-table { overflow-x: auto; margin: 14px 0; border: 1px solid var(--line); border-radius: var(--radius); }
.pd-table table { border-collapse: collapse; width: 100%; font-size: 15px; }
.pd-table th, .pd-table td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.pd-table thead th { background: var(--panel2); color: var(--gold); font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; }
.pd-table tbody th { font-weight: 600; color: #f3e8cc; }
.pd-table tr:last-child > * { border-bottom: 0; }

.pd-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.pd-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(--radius); padding: 12px 14px; min-height: 44px; transition: border-color .15s, background .15s; }
.pd-card:hover { border-color: rgba(226, 194, 126, 0.6); background: var(--panel2); color: var(--text); }
.pd-card b { color: #f3e8cc; font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; }
.pd-card span:last-child { color: var(--dim); font-size: 14px; line-height: 1.45; }
.pd-card-cat { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--amber) !important; }
.pd-cat { margin-bottom: 8px; }
.pd-see { border-top: 1px solid var(--line); margin-top: 28px; }
.pd-back { margin-top: 24px; }
.pd-empty { max-width: 640px; }
.pd-footer { max-width: 1180px; margin: 30px auto 0; padding: 14px 20px 30px; border-top: 1px solid var(--line); font-size: 13px; color: var(--dim); }
.pd-footer p { margin: 4px 0; overflow-wrap: anywhere; }

@media (max-width: 960px) {
  .pd-header { grid-template-columns: 1fr auto; }
  .pd-search { grid-column: 1 / -1; grid-row: 2; max-width: none; }
  .pd-exits { grid-column: 2; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .pd-header { padding: 10px 16px; gap: 8px 12px; position: static; }
  .pd-exits { gap: 10px; flex-direction: column; align-items: flex-end; }
  .pd-exits a { font-size: 13px; padding: 4px 0; }
  .pd-layout { grid-template-columns: minmax(0, 1fr); padding: 14px 16px 6px; gap: 10px; }
  .pd-toc-wrap { position: static; max-height: none; overflow: visible; border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 12px; background: var(--panel); }
  .pd-toc-box summary { padding: 10px 0; min-height: 44px; }
  .pd-toc a { padding: 9px 8px; font-size: 15px; }
  .pd-main h1 { font-size: 24px; }
  .pd-cards { grid-template-columns: minmax(0, 1fr); }
  .pd-table table, .pd-table thead, .pd-table tbody, .pd-table tr, .pd-table th, .pd-table td { display: block; }
  .pd-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .pd-table tr { border-bottom: 1px solid var(--line); padding: 6px 0; }
  .pd-table th, .pd-table td { border: 0; padding: 4px 12px; }
  .pd-table td::before { content: attr(data-label) ": "; color: var(--dim); font-size: 13px; }
  .pd-footer { padding: 12px 16px 24px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media (forced-colors: active) { .pd-wordmark, .pd-w1, .pd-w2 { color: CanvasText; text-shadow: none; } .pd-box { border-color: CanvasText; } }
