/* Narzędzia (/narzedzia/…, renderowane przez api/tools.mjs). Ładowany po
   sub.css — te same tokeny (--bg, --bg2, --fg, --muted, --line, --accent,
   --card, --chip), więc jasny i ciemny motyw działają same.

   Klasy poniżej to wspólny zestaw dla wszystkich narzędzi (opis:
   homepage/CLAUDE.md → „Narzędzia”). Narzędzie dokłada własny tool.css tylko
   na to, czego tu nie ma. */

/* ── lista narzędzi ── */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.tool-card { display: flex; flex-direction: column; gap: 14px; padding: 28px; transition: border-color .2s ease, transform .2s ease; }
a.tool-card:hover { color: var(--fg); border-color: var(--accent); transform: translateY(-2px); }
.tool-card .idx { font-size: 13px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.tool-card h2, .tool-card h3 { font-family: var(--display); font-weight: 600; font-size: 23px; line-height: 1.25; letter-spacing: -0.015em; }
.tool-card p { font-size: 16px; line-height: 1.6; color: var(--muted); }
.tool-card .more { margin-top: auto; padding-top: 6px; font-weight: 600; color: var(--accent); }
.empty-note { font-size: 19px; line-height: 1.55; color: var(--muted); }
.section-head-row { flex-direction: row; flex-wrap: wrap; align-items: baseline; justify-content: space-between; max-width: none; }
.more-link { font-weight: 600; color: var(--accent); }
.tool-draft { align-self: flex-start; padding: 6px 12px; border: 1px dashed var(--accent); border-radius: 999px; font-size: 14px; color: var(--accent); }

/* okruszki: długa nazwa narzędzia nie rozpycha wiersza */
.crumbs, .crumbs li { min-width: 0; }
.crumbs li:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

/* ── strona narzędzia ── */
.tool-hero { padding-bottom: 40px; }
.tool-hero h1 { font-size: clamp(34px, 4.6vw, 64px); line-height: 1.04; overflow-wrap: break-word; }
.tool-page { display: flex; flex-direction: column; gap: 72px; padding-bottom: 88px; }
.tool-page > * { min-width: 0; }

/* widżet: formularz i wynik obok siebie, na telefonie jeden pod drugim */
.tool { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; padding: clamp(20px, 3vw, 40px); background: var(--card); border: 1px solid var(--line); border-radius: 18px; scroll-margin-top: 96px; }
.tool-single { grid-template-columns: minmax(0, 1fr); }
.tool-form { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.tool-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tool-field > label, .tool-label { font-size: 15px; font-weight: 600; color: var(--fg); }
.tool-hint { font-size: 14px; line-height: 1.5; color: var(--muted); }
.tool-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.tool-input, .tool-select, .tool-textarea { box-sizing: border-box; width: 100%; min-height: 50px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg2); color: var(--fg); font: inherit; font-size: 17px; }
.tool-textarea { min-height: 120px; line-height: 1.5; resize: vertical; }
.tool-input:hover, .tool-select:hover, .tool-textarea:hover { border-color: color-mix(in srgb, var(--fg) 30%, transparent); }
.tool-input:focus-visible, .tool-select:focus-visible, .tool-textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--accent); }
.tool-input[aria-invalid="true"] { border-color: #e5484d; }
.tool-suffix { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.tool-suffix span { font-size: 16px; color: var(--muted); white-space: nowrap; }
.tool-check { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; font-size: 16px; line-height: 1.5; cursor: pointer; }
.tool-check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); }
.tool-range { width: 100%; min-height: 44px; accent-color: var(--accent); }
.tool-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.tool-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 22px; border: 0; border-radius: 999px; background: var(--btn-bg); color: var(--btn-fg); font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; transition: transform .2s ease; }
.tool-btn:hover { transform: translateY(-1px); }
.tool-btn-ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); }
.tool-btn-ghost:hover { border-color: var(--accent); }
.tool-error { font-size: 15px; color: #e5484d; }

/* wynik */
.tool-result { display: flex; flex-direction: column; gap: 20px; min-width: 0; padding: clamp(20px, 2.4vw, 32px); border: 1px solid var(--line); border-radius: 14px; background: var(--bg2); }
.tool-result-label { font-size: 13px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.tool-number { font-family: var(--display); font-weight: 600; font-size: clamp(38px, 5vw, 68px); line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tool-number small { font-size: .4em; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.tool-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0 24px; margin: 0; }
.tool-stats div { display: flex; flex-direction: column; gap: 4px; padding: 14px 0; border-top: 1px solid var(--line); }
.tool-stats dt { font-size: 14px; color: var(--muted); }
.tool-stats dd { margin: 0; font-family: var(--display); font-size: 21px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tool-output { box-sizing: border-box; width: 100%; margin: 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--fg); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 15px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.tool-output-text { font-family: inherit; font-size: 17px; }
.tool-note { font-size: 14px; line-height: 1.55; color: var(--muted); }
.tool-next { padding-top: 16px; border-top: 1px solid var(--line); font-size: 16px; line-height: 1.55; color: var(--muted); }
.tool-next a { color: var(--fg); font-weight: 600; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }

/* ── tekst pod narzędziem ── */
.tool-content { display: flex; flex-direction: column; gap: 56px; }
.tool-content section { display: flex; flex-direction: column; gap: 18px; max-width: 760px; }
.tool-content h2 { font-family: var(--display); font-weight: 600; font-size: clamp(26px, 2.8vw, 38px); line-height: 1.15; letter-spacing: -0.02em; scroll-margin-top: 96px; }
.tool-content h3 { font-family: var(--display); font-weight: 600; font-size: 22px; line-height: 1.3; }
.tool-content p, .tool-content li { font-size: 18px; line-height: 1.7; color: var(--muted); }
.tool-content strong { color: var(--fg); font-weight: 600; }
.tool-content a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.tool-content a:hover { color: var(--accent); }
.tool-content ul, .tool-content ol { display: flex; flex-direction: column; gap: 10px; padding-left: 1.3em; }
.tool-content ul { list-style: disc; }
.tool-content ol { list-style: decimal; }
.tool-content li::marker { color: var(--accent); }
.tool-formula { padding: 16px 20px; border-left: 3px solid var(--accent); border-radius: 0 12px 12px 0; background: var(--chip); color: var(--fg); font-size: 18px; line-height: 1.6; overflow-wrap: anywhere; }
.tool-table { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.tool-table table { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.5; }
.tool-table th, .tool-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tool-table th { background: var(--chip); color: var(--fg); font-weight: 600; }
.tool-table tr:last-child td { border-bottom: 0; }

/* ── FAQ ── */
.faq { display: flex; flex-direction: column; gap: 12px; max-width: 900px; }
.faq-item { padding: 0; }
.faq-item summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; padding: 20px 24px; font-family: var(--display); font-size: 20px; font-weight: 600; line-height: 1.3; cursor: pointer; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; flex: none; font-size: 26px; font-weight: 400; color: var(--accent); }
.faq-item[open] summary::after { content: "–"; }
.faq-item p { padding: 0 24px 24px; font-size: 17px; line-height: 1.7; color: var(--muted); max-width: 760px; }

@media (max-width: 900px) {
  .tools-grid { grid-template-columns: 1fr; }
  .tool { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .tool-page { gap: 56px; padding-bottom: 64px; }
  .tool-content { gap: 44px; }
  .tool-content p, .tool-content li { font-size: 17px; }
  .faq-item summary { padding: 16px 18px; font-size: 18px; }
  .faq-item p { padding: 0 18px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  a.tool-card:hover, .tool-btn:hover { transform: none; }
}
@media print {
  .site-header, .site-footer, .theme-toggle, .cta, .tool-actions { display: none !important; }
}
