/* DivePlaner — docs.css. Strony dokumentacji: /instrukcja (instrukcja obsługi) i /nowosci („Co nowego”).
   Tylko dodatki do portal.css (szablon Velzon, te same tokeny i komponenty). Mobile-first; treść ~760 px na komputerze; wydruk. */

/* ---------- układ: spis treści + treść ---------- */
.doc-layout { display: block; padding-bottom: 32px; }
.doc-main, .doc-layout > .doc-hero { min-width: 0; max-width: 760px; margin-left: auto; margin-right: auto; }
.doc-aside { max-width: 760px; margin: 16px auto 4px; }
@media (min-width: 1024px) {
  .doc-layout { display: grid; grid-template-columns: 250px minmax(0, 760px); grid-template-areas: "aside hero" "aside main"; column-gap: 40px; justify-content: center; align-items: start; }
  .doc-layout > .doc-hero { grid-area: hero; margin: 0; }
  .doc-layout > .doc-main { grid-area: main; margin: 0; }
  .doc-aside { grid-area: aside; align-self: start; position: sticky; top: calc(var(--header-h) + 16px); margin: 28px 0 0; max-height: calc(100vh - var(--header-h) - 32px); overflow-y: auto; overscroll-behavior: contain; padding: 2px 4px 16px 2px; }
}
.doc-hero { padding: 28px 0 4px; }
@media (min-width: 768px) { .doc-hero { padding: 40px 0 8px; } }
.doc-hero h1 { font-size: var(--t-h1); font-weight: 700; letter-spacing: -.02em; line-height: 1.2; margin-top: 8px; }
.doc-hero p { color: var(--fg-2); margin-top: 10px; line-height: 1.6; font-size: 1.0625rem; }
.doc-hero .chips { margin-top: 14px; }


/* ---------- wyszukiwarka ---------- */
.doc-search .input { min-height: 48px; }
.doc-search-info { font-size: var(--t-xs); color: var(--fg-2); margin: 8px 4px 0; min-height: 1.2em; }
.doc-empty { margin-top: 16px; }

/* ---------- spis treści ---------- */
.doc-toc { margin-top: 12px; background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); box-shadow: var(--sh-1); }
.doc-toc > summary { list-style: none; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 16px; font-weight: 600; cursor: pointer; border-radius: var(--radius); }
.doc-toc > summary::-webkit-details-marker { display: none; }
.doc-toc > summary .ico:last-child { margin-left: auto; color: var(--fg-2); transition: transform .15s; }
.doc-toc[open] > summary .ico:last-child { transform: rotate(180deg); }
.doc-toc ol { list-style: none; padding: 0 8px 10px; margin: 0; counter-reset: none; }
.doc-toc li { margin: 0; }
.doc-toc a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 10px; border-radius: 12px; color: var(--fg-2); text-decoration: none; font-size: var(--t-sm); font-weight: 500; line-height: 1.3; }
.doc-toc a:hover { background: var(--card-2); color: var(--fg); }
.doc-toc a[aria-current="true"] { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.doc-toc .n { flex: none; min-width: 24px; height: 24px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: var(--card-2); color: var(--fg-2); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.doc-toc a[aria-current="true"] .n { background: var(--brand-strong); color: var(--brand-fg); }
@media (min-width: 1024px) {
  .doc-toc { background: transparent; border: 0; box-shadow: none; }
  .doc-toc > summary { pointer-events: none; min-height: 32px; padding: 0 10px; }
  .doc-toc > summary .ico { display: none; }
  .doc-toc ol { padding: 4px 0 0; }
}

/* ---------- rozdziały ---------- */
.doc-sec { margin-top: 20px; scroll-margin-top: calc(var(--header-h) + 12px); }
.doc-sec .sec-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.doc-sec .sec-head h2 { font-size: 1.375rem; font-weight: 700; letter-spacing: -.015em; line-height: 1.3; margin: 0; }
.doc-sec .sec-num { flex: none; width: 40px; height: 40px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.doc-sub { scroll-margin-top: calc(var(--header-h) + 12px); }
.doc .prose h3, .doc-sub > h3 { font-size: var(--t-h3); font-weight: 700; line-height: 1.35; margin: 26px 0 6px; }
.doc .prose ol { padding-left: 24px; margin: 10px 0; }
.doc .prose ol > li::marker { color: var(--brand-ink); font-weight: 700; }
.doc .prose li > ul, .doc .prose li > ol { margin: 6px 0; }
.doc .prose .note, .doc .prose .disclaimer { margin: 14px 0; }
.doc .prose .note p { margin: 0; color: inherit; }
.doc .prose a { overflow-wrap: anywhere; }
.doc .back-top { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-top: 10px; font-size: var(--t-sm); font-weight: 600; color: var(--brand-ink); text-decoration: none; }
.doc .back-top:hover { text-decoration: underline; }

/* nazwy przycisków i pól z aplikacji */
.ui { display: inline; padding: 1px 7px; border-radius: 8px; background: var(--card-2); border: 1px solid var(--line); font-weight: 600; font-size: .92em; white-space: normal; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.soon { display: inline-flex; align-items: center; min-height: 22px; padding: 0 9px; border-radius: 999px; background: var(--info-bg); color: var(--info-fg); font-size: 12px; font-weight: 600; letter-spacing: .02em; vertical-align: 2px; white-space: nowrap; }
.soon.amber { background: var(--warn-bg); color: var(--warn-fg); }

/* tabela (rozwiązywanie problemów) */
.doc-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: var(--t-sm); line-height: 1.5; }
.doc-table th, .doc-table td { text-align: left; vertical-align: top; padding: 10px 8px; border-top: 1px solid var(--line); }
.doc-table th { font-weight: 600; }
@media (max-width: 599px) {
  .doc-table, .doc-table tbody, .doc-table tr, .doc-table th, .doc-table td { display: block; width: 100%; }
  .doc-table thead { display: none; }
  .doc-table tr { padding: 10px 0; border-top: 1px solid var(--line); }
  .doc-table th, .doc-table td { border: 0; padding: 2px 0; }
}

/* słowniczek */
.gloss { margin: 12px 0 0; }
.gloss > div { padding: 12px 0; border-top: 1px solid var(--line); }
.gloss > div:first-child { border-top: 0; padding-top: 0; }
.gloss dt { font-weight: 700; color: var(--brand-ink); }
.gloss dd { margin: 4px 0 0; }

/* przycisk „do spisu treści” (telefon) */
.doc-fab { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 40; width: 52px; height: 52px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-btn); color: var(--brand-fg); box-shadow: var(--sh-brand), var(--sh-2); text-decoration: none; }
.doc-fab .ico { transform: rotate(-90deg); }
.has-sw-update .doc-fab { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 1024px) { .doc-fab { display: none !important; } }

/* ---------- „Co nowego” ---------- */
.rel { margin-top: 20px; }
.rel-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.rel-head h2 { font-size: 1.375rem; font-weight: 700; letter-spacing: -.015em; line-height: 1.25; margin: 0; }
.rel-head .rel-date { color: var(--fg-2); font-size: var(--t-sm); font-weight: 500; }
.rel-head .pill { margin-left: auto; }
@media (max-width: 479px) { .rel-head .pill { margin-left: 0; } }
.rel .rel-lead { margin-top: 8px; color: var(--fg-2); }
.rel h3 { font-size: var(--t-label); font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--brand-ink); margin: 16px 0 6px; }
.rel ul { padding-left: 22px; margin: 0; }
.rel li { margin: 7px 0; line-height: 1.6; }
.rel li::marker { color: var(--brand-ink); }
.rel.next { border: 1.5px dashed var(--line-2); box-shadow: none; background: var(--card-2); }
.rel.next h3 { color: var(--info-fg); }
.rel.old h3 { color: var(--fg-2); }
.rel-foot { margin-top: 14px; font-size: var(--t-sm); }

/* ---------- wydruk ---------- */
@media print {
  .doc-aside, .doc-fab, .back-top, .skip-link, .mobile-menu, .doc-empty { display: none !important; }
  .doc-layout { display: block; }
  .doc-main { max-width: none; }
  .doc-sec[hidden], .doc-sub[hidden], .rel[hidden] { display: block !important; }
  .doc-sec, .rel { break-inside: auto; margin-top: 12px; }
  .doc-sec .sec-head, .doc .prose h3, .rel-head { break-after: avoid; }
  .note, .disclaimer, .gloss > div, .doc-table tr { break-inside: avoid; }
  .card { padding: 12px 0; border: 0 !important; box-shadow: none !important; background: none !important; }
  body { font-size: 11pt; color: #000; }
  a { color: #000; }
  .doc .prose a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #444; }
  .ui { border-color: #999; background: none; }
}
@media (min-width: 1024px) { .doc .back-top { display: none; } }
