/* weldtools.pl – arkusz stylów. Kolory i odstępy z zatwierdzonego systemu. */

@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/Inter-Regular.woff') format('woff'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/Inter-Medium.woff') format('woff'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/Inter-SemiBold.woff') format('woff'); }
@font-face { font-family: 'Inter'; font-style: italic; font-weight: 400; font-display: swap; src: url('../fonts/Inter-Italic.woff') format('woff'); }

:root {
  --ink: #14171C;
  --text2: #4F5662;
  --text3: #666E7A;
  --body: #2E333B;
  --border-input: #7D8591;
  --line: #E2E5E9;
  --canvas: #F5F6F8;
  --surface: #FFFFFF;
  --chip: #E9ECF0;
  --primary: #3346C4;
  --primary-hover: #2E40B8;
  --tint: #EEF1FD;
  --halo: #DDE2FA;
  --band-outer: #DDE2FA;
  --band-inner: #8E9DEB;
  --success: #177245;
  --success-bg: #E6F4EC;
  --success-text: #0F5132;
  --warn: #9A5B00;
  --warn-bg: #FDF3E3;
  --warn-line: #EBCB95;
  --warn-text: #6E4100;
  --error: #C0352B;
  --error-bg: #FBEAE8;
  --error-text: #8E2219;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --field-h: 50px;
  --shadow-card: 0 1px 2px rgba(20, 23, 28, .04), 0 12px 32px -20px rgba(20, 23, 28, .18);
  --shadow-pop: 0 16px 40px -12px rgba(20, 23, 28, .25);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  color-scheme: light;
}
@media (min-width: 900px) { :root { --field-h: 44px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--canvas); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 1.5;
  font-feature-settings: 'tnum' 1, 'case' 0;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; }
svg { flex: none; }
i { font-style: italic; }
a { color: var(--primary); text-underline-offset: 2px; }
a:hover { color: var(--primary-hover); }
h1, h2, h3 { margin: 0; line-height: 1.25; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
[hidden] { display: none !important; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; padding: 10px 14px; border-radius: var(--r-sm); background: var(--ink); color: #fff; font-weight: 600; text-decoration: none; }
.skip:focus { top: 10px; color: #fff; }
.muted { color: var(--text2); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.print-only { display: none; }

/* ---------- nagłówek ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.header-in { height: 60px; padding: 0 16px; display: flex; align-items: center; gap: 16px; }
.page-home .header-in, .page-method .header-in, .page-404 .header-in { max-width: 1280px; margin: 0 auto; }
@media (min-width: 900px) { .header-in { padding: 0 24px; gap: 24px; } .page-home .header-in, .page-method .header-in, .page-404 .header-in { padding: 0 32px; } }

.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; flex: none; min-height: 44px; }
.brand:hover { color: var(--ink); }
.wordmark { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.wordmark .dot { color: var(--primary); }
.wordmark .tld { font-weight: 400; color: var(--text2); }

.main-nav { display: none; gap: 4px; font-size: 15px; font-weight: 500; }
.main-nav a { padding: 8px 12px; border-radius: var(--r-sm); color: var(--text2); text-decoration: none; }
.main-nav a:hover { background: var(--canvas); color: var(--ink); }
.main-nav a[aria-current='page'] { background: var(--tint); color: var(--primary-hover); }
@media (min-width: 700px) { .main-nav { display: flex; } }

.lang { display: flex; padding: 3px; background: var(--canvas); border-radius: var(--r-sm); flex: none; margin-left: auto; }
.lang a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 36px; border-radius: 6px; font-size: 13px; font-weight: 500; color: var(--text2); text-decoration: none; }
.lang a[aria-current='true'] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(20, 23, 28, .12); }
.lang a:hover { color: var(--ink); }

.header-search { flex: 0 1 420px; margin: 0 auto; position: relative; display: none; }
@media (min-width: 900px) { .header-search { display: block; } .header-search + .lang { margin-left: 0; } }

/* nagłówek strony narzędzia na telefonie */
.tool-bar { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; }
.icon-btn { width: 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--ink); text-decoration: none; flex: none; }
.icon-btn:hover { background: var(--canvas); color: var(--ink); }
.tool-bar-title { flex: 1; min-width: 0; font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-tool .header-in { padding: 0 4px; gap: 4px; }
.page-tool .brand, .page-tool .header-in > .lang { display: none; }
@media (min-width: 900px) {
  .page-tool .header-in { padding: 0 24px; gap: 24px; }
  .page-tool .brand { display: flex; }
  .page-tool .header-in > .lang { display: flex; }
  .tool-bar { display: none; }
}

/* ---------- wyszukiwarka ---------- */
.search { position: relative; }
.search-box { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 8px 0 12px; background: var(--surface); border: 1px solid var(--border-input); border-radius: 10px; color: var(--text2); }
.search-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--halo); }
.search-box input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; font-size: 16px; color: var(--ink); outline: none; }
.search-box input::placeholder { color: var(--text3); opacity: 1; }
.search-box input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search kbd { flex: none; padding: 2px 7px; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: 12px; color: var(--text2); }
.search--lg .search-box { height: 52px; padding: 0 8px 0 16px; border-radius: var(--r-md); }
.search-pop { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-pop); overflow: hidden; }
.search-list { list-style: none; margin: 0; padding: 4px 0; max-height: min(60vh, 420px); overflow-y: auto; }
.search-opt a { display: flex; align-items: center; gap: 12px; padding: 10px 16px; color: var(--ink); text-decoration: none; }
.search-opt a:hover, .search-opt[aria-selected='true'] a { background: var(--tint); }
.search-opt .tile { width: 36px; height: 36px; border-radius: 9px; }
.search-opt-name { display: block; font-size: 15px; font-weight: 600; }
.search-opt-cat { display: block; font-size: 13px; color: var(--text3); }
.search-none { padding: 16px; font-size: 14px; color: var(--text2); }
.search-foot { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 8px 16px; border-top: 1px solid var(--line); background: var(--canvas); font-size: 12px; color: var(--text2); }
.search-foot .count { margin-left: auto; }
@media (hover: none) { .search kbd, .search-foot .keys { display: none; } }

.tile { flex: none; width: 44px; height: 44px; border-radius: 11px; background: var(--tint); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; }

/* ---------- układ strony narzędzia ---------- */
.app { display: flex; align-items: stretch; min-height: calc(100vh - 61px); }
.sidenav { display: none; }
@media (min-width: 900px) {
  .sidenav { display: flex; flex-direction: column; flex: none; width: 64px; background: var(--surface); border-right: 1px solid var(--line); padding: 12px 0; }
  .sidenav-in { position: sticky; top: 73px; display: flex; flex-direction: column; }
  html.nav-open .sidenav { width: 248px; }
}
.nav-group { padding: 14px 18px 4px; font-size: 12px; font-weight: 600; color: var(--text3); }
.nav-group:first-child { padding-top: 4px; }
.nav-link { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 1px 8px; padding: 0 10px; border-radius: var(--r-sm); color: var(--body); font-size: 14px; font-weight: 500; text-decoration: none; }
.nav-link:hover { background: var(--canvas); color: var(--ink); }
.nav-link[aria-current='page'] { background: var(--tint); color: var(--primary-hover); font-weight: 600; }
.nav-link span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-toggle { display: flex; align-items: center; gap: 8px; margin: 16px 8px 0; min-height: 44px; padding: 0 10px; border: 0; border-radius: var(--r-sm); background: transparent; font-size: 13px; color: var(--text2); }
.nav-toggle:hover { background: var(--canvas); color: var(--ink); }
html:not(.nav-open) .sidenav .nav-group { height: 1px; margin: 10px 16px; padding: 0; background: var(--line); overflow: hidden; color: transparent; font-size: 0; }
html:not(.nav-open) .sidenav .nav-group:first-child { background: transparent; margin-top: 0; }
html:not(.nav-open) .sidenav .nav-link { justify-content: center; padding: 0; }
html:not(.nav-open) .sidenav .nav-link span, html:not(.nav-open) .nav-toggle span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
html:not(.nav-open) .nav-toggle { justify-content: center; }
html:not(.nav-open) .nav-toggle svg { transform: scaleX(-1); }

.tool-main { flex: 1 1 auto; min-width: 0; padding: 14px 16px 120px; }
@media (min-width: 900px) { .tool-main { padding: 20px 32px 48px; } }
.tool-wrap { max-width: 1120px; }
.crumbs { display: none; font-size: 13px; color: var(--text3); margin-bottom: 6px; }
.crumbs a { color: var(--text2); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
@media (min-width: 900px) { .crumbs { display: block; } }
.tool-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 14px; }
.tool-head h1 { font-size: 20px; font-weight: 600; letter-spacing: -0.015em; }
@media (min-width: 900px) { .tool-head { margin-bottom: 18px; } .tool-head h1 { font-size: 26px; letter-spacing: -0.02em; } }
.scope { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 3px 10px; border-radius: 999px; background: var(--tint); color: var(--primary-hover); font-size: 13px; font-weight: 500; }
.tool-lead { margin: -6px 0 16px; max-width: 70ch; color: var(--text2); font-size: 15px; }

/* ---------- kalkulator ---------- */
.modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; padding: 3px; margin-bottom: 14px; background: var(--chip); border-radius: 10px; }
.modes.modes--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 640px) { .modes { display: inline-flex; flex-wrap: wrap; margin-bottom: 20px; } }
.tab { min-height: 40px; padding: 0 14px; border: 0; border-radius: var(--r-sm); background: transparent; font-size: 14px; font-weight: 500; color: var(--text2); }
.tab:hover { color: var(--ink); }
.tab[aria-selected='true'] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(20, 23, 28, .12); }

.tool-grid { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
@media (min-width: 900px) { .tool-grid { gap: 20px; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; min-width: 0; }
@media (min-width: 900px) { .card { border-radius: var(--r-lg); } }
.inputs { flex: 1 1 440px; max-width: 100%; padding: 14px; }
@media (min-width: 900px) { .inputs { max-width: 560px; padding: 18px 22px 22px; } }
.result { flex: 1 1 400px; box-shadow: var(--shadow-card); overflow: hidden; }
.inputs-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-title { font-size: 15px; font-weight: 600; }
.card-title:focus { outline: none; }
.card-title:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; border-radius: 4px; }
.link-btn { min-height: 36px; padding: 0 8px; margin-right: -8px; border: 0; border-radius: 6px; background: transparent; color: var(--primary); font-size: 14px; font-weight: 500; }
.link-btn:hover { background: var(--tint); color: var(--primary-hover); }

.stack { display: flex; flex-direction: column; gap: 18px; }
.group { display: flex; flex-direction: column; gap: 8px; }
.group-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.group-label { font-size: 14px; font-weight: 600; }
.group-note { font-size: 12px; color: var(--text3); }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
.fields--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fields--chem { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 12px 10px; }
@media (min-width: 900px) { .fields { gap: 14px 16px; } }
.field { min-width: 0; display: flex; flex-direction: column; }
.field--wide { grid-column: 1 / -1; }
.field-label { display: flex; justify-content: space-between; gap: 6px; font-size: 13px; font-weight: 500; color: var(--body); margin-bottom: 6px; }
.field-label .sym { font-weight: 400; color: var(--text2); }
.field-hint { margin: -2px 0 6px; font-size: 12px; color: var(--text3); }
.field-row { display: flex; gap: 8px; align-items: center; }
.input-box { flex: 1; min-width: 0; display: flex; align-items: center; height: var(--field-h); border: 1px solid var(--border-input); border-radius: 9px; background: var(--surface); }
.input-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), 0 0 0 4px var(--halo); }
.input { flex: 1; min-width: 0; width: 100%; height: 100%; padding: 0 4px 0 12px; border: 0; background: transparent; font-size: 18px; font-weight: 500; text-align: right; color: var(--ink); outline: none; }
@media (min-width: 900px) { .input { font-size: 17px; } }
.input::placeholder { color: var(--text3); font-weight: 400; opacity: 1; }
.unit { flex: none; min-width: 34px; padding: 0 12px 0 6px; font-size: 14px; color: var(--text2); white-space: nowrap; }
.input-box:not(:has(.unit)) .input { padding-right: 12px; }
.is-invalid .field-label { color: var(--error); font-weight: 600; }
.is-invalid .input-box, .bare:has(.field-err:not([hidden])) .input-box { border: 2px solid var(--error); }
.field-err { display: flex; gap: 6px; align-items: flex-start; margin-top: 6px; font-size: 13px; line-height: 1.35; color: var(--error); }
.field-err svg { margin-top: 2px; }
.field-err--compact { font-size: 12px; margin-top: 4px; }
.bare { min-width: 0; }
.input-box--sm { height: 44px; border-radius: var(--r-sm); }
.input-box--sm .input { font-size: 16px; padding-right: 10px; }

.seg { display: inline-flex; flex: none; padding: 3px; background: var(--canvas); border-radius: 9px; }
.seg-btn { min-width: 44px; min-height: 38px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; font-size: 13px; font-weight: 500; color: var(--text2); white-space: nowrap; }
.seg-btn:hover { color: var(--ink); }
.seg-btn[aria-checked='true'] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(20, 23, 28, .12); }
@media (max-width: 420px) { .field-row:has(.seg) { flex-wrap: wrap; } .field-row:has(.seg) .input-box { flex-basis: 100%; } }

.opt-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.opt-card { min-height: 52px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); text-align: left; color: var(--ink); }
.opt-card:hover { border-color: var(--border-input); }
.opt-card[aria-checked='true'] { border-color: var(--primary); background: var(--tint); box-shadow: inset 0 0 0 1px var(--primary); }
.opt-title { display: block; font-size: 14px; font-weight: 600; }
.opt-sub { display: block; margin-top: 2px; font-size: 12px; color: var(--text3); }
.opt-card[aria-checked='true'] .opt-sub { color: var(--primary-hover); }
@media (max-width: 520px) { .opt-cards { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }

.select-wrap { position: relative; display: flex; }
.select { appearance: none; -webkit-appearance: none; width: 100%; height: var(--field-h); padding: 0 40px 0 12px; border: 1px solid var(--border-input); border-radius: 9px; background: var(--surface); font-size: 16px; font-weight: 500; color: var(--ink); }
.select:focus-visible { outline: none; border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), 0 0 0 4px var(--halo); }
.select-wrap svg { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--text2); }

.switch { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 6px 0; border: 0; background: transparent; text-align: left; }
.switch-track { position: relative; flex: none; width: 44px; height: 26px; border-radius: 13px; background: var(--border-input); transition: background .15s; }
.switch-knob { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: left .15s; }
.switch[aria-checked='true'] .switch-track { background: var(--primary); }
.switch[aria-checked='true'] .switch-knob { left: 21px; }
.switch-label { display: block; font-size: 14px; font-weight: 600; }
.switch-desc { display: block; font-size: 13px; color: var(--text2); }

.range-table { display: grid; grid-template-columns: minmax(0, 1fr) minmax(84px, 112px) minmax(84px, 112px); gap: 8px 10px; align-items: start; }
.rt-head { font-size: 12px; font-weight: 600; color: var(--text3); text-align: right; padding-right: 10px; }
.rt-label { font-size: 14px; color: var(--body); padding-top: 11px; }
.rt-unit { font-size: 12px; color: var(--text3); }
.range-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px 12px; flex-wrap: wrap; margin-top: 4px; }

/* ---------- wynik ---------- */
.result-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 12px 0 16px; min-height: 52px; }
@media (min-width: 900px) { .result-head { padding: 14px 18px 0 22px; } }
.result-body { padding: 10px 16px 0; }
@media (min-width: 900px) { .result-body { padding: 12px 22px 0; } }
.result-body > * + * { margin-top: 16px; }
.result-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 16px; }
@media (min-width: 900px) { .result-actions { padding: 16px 22px 18px; } }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1px solid var(--border-input); border-radius: 10px; background: var(--surface); font-size: 14px; font-weight: 500; color: var(--ink); text-decoration: none; }
.btn:hover { background: var(--canvas); color: var(--ink); }
.btn:disabled { color: var(--text3); border-color: var(--line); cursor: not-allowed; background: var(--surface); }
@media (max-width: 899px) { .result-actions .btn { flex: 1 1 140px; min-height: 48px; font-size: 15px; } }
.copy-status { flex-basis: 100%; font-size: 13px; color: var(--success); overflow-wrap: anywhere; }
.copy-status:empty { display: none; }
.copy-status--err { color: var(--error); }

.big-label { font-size: 14px; color: var(--text2); }
.big-value { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; margin-top: 2px; }
.big-num { font-size: 44px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.08; }
@media (min-width: 900px) { .big-num { font-size: 52px; } }
.big-value--text .big-num { font-size: 28px; letter-spacing: -0.02em; line-height: 1.2; }
@media (min-width: 900px) { .big-value--text .big-num { font-size: 32px; } }
.big-unit { font-size: 17px; font-weight: 500; color: var(--text2); }
.big-sub { margin-top: 4px; font-size: 14px; color: var(--text2); }
.tone-ok .big-num { color: var(--success); }
.tone-bad .big-num { color: var(--error); }
.rows { margin: 0; }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.row:last-child { padding-bottom: 0; }
.row dt { color: var(--text2); }
.row dd { margin: 0; font-size: 16px; font-weight: 600; text-align: right; }
.row-unit { font-size: 14px; font-weight: 500; color: var(--text2); }
.row--strong dd { font-size: 18px; }

.band-title { font-size: 13px; font-weight: 600; color: var(--body); margin-bottom: 10px; }
.band-track { position: relative; height: 22px; }
.band-outer { position: absolute; left: 0; right: 0; top: 7px; height: 8px; border-radius: 4px; background: var(--band-outer); }
.band-inner { position: absolute; left: 20%; width: 60%; top: 7px; height: 8px; background: var(--band-inner); }
.band-mid { position: absolute; left: 50%; top: 0; width: 2px; height: 22px; margin-left: -1px; background: var(--ink); }
.band-marker { position: absolute; top: -3px; width: 4px; height: 28px; margin-left: -2px; border-radius: 2px; background: var(--primary-hover); box-shadow: 0 0 0 2px #fff; }
.band-ticks { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: 6px; font-size: 13px; }
.band-tick { text-align: center; }
.band-tick:first-child { text-align: left; }
.band-tick:last-child { text-align: right; }
.band-tick--mid { font-weight: 600; }
.band-tick-label { display: block; font-size: 11px; font-weight: 400; color: var(--text3); }

.assume { padding: 12px 14px; border-radius: 10px; background: var(--canvas); font-size: 13px; line-height: 1.6; color: var(--body); }
.assume-title { font-weight: 600; margin-bottom: 2px; }
.assume-formula { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 14px; overflow-wrap: anywhere; }

.notice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; font-size: 13px; line-height: 1.45; }
.notice svg { margin-top: 1px; }
.notice--info { background: var(--tint); color: #1F2C80; }
.notice--warn { background: var(--warn-bg); color: var(--warn-text); }

.empty { display: flex; gap: 12px; padding: 14px 16px; margin-bottom: 4px; border-radius: var(--r-md); background: var(--warn-bg); color: var(--warn-text); font-size: 14px; }
.empty svg { margin-top: 1px; }
.empty-title { font-size: 15px; font-weight: 600; }

.verdicts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.verdict { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.verdict-title { display: block; font-size: 12px; }
.verdict--ok { background: var(--success-bg); color: var(--success-text); }
.verdict--bad { background: var(--error-bg); color: var(--error-text); }

.table-wrap { overflow-x: auto; }
.table-wrap:focus-visible { outline-offset: 0; }
.table { width: 100%; min-width: 340px; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 9px 6px; text-align: right; }
.table th:first-child, .table td:first-child { padding-left: 0; text-align: left; }
.table th:last-child, .table td:last-child { padding-right: 0; }
.table thead th { font-size: 12px; font-weight: 500; color: var(--text3); padding-top: 4px; padding-bottom: 6px; }
.table tbody tr { border-top: 1px solid var(--line); }
.table tbody th { font-weight: 600; }
.table td { color: var(--text2); }
.table td.strong { color: var(--ink); font-weight: 600; }
.table .is-hit td, .table .is-hit th { background: var(--error-bg); }
.table--plain td { color: var(--ink); }

.badge { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge--ok { background: var(--success-bg); color: var(--success-text); }
.badge--bad { background: var(--error-bg); color: var(--error-text); }
.badge--muted { background: var(--chip); color: var(--body); }
.badge--primary { background: var(--tint); color: var(--primary-hover); }

.chart { width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--font); }
.figure { margin: 0; }
.figure figcaption { margin-top: 6px; font-size: 12px; color: var(--text3); }

.scale-track { position: relative; padding: 4px 0; }
.scale-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; }
.scale-bar span { flex: 1; }
.scale-pin { position: absolute; top: 0; width: 4px; height: 18px; margin-left: -2px; border-radius: 2px; background: var(--ink); box-shadow: 0 0 0 2px #fff; }
.scale-labels { display: grid; margin-top: 4px; font-size: 11px; line-height: 1.3; color: var(--text2); }
.scale-labels--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.scale-labels span { text-align: center; padding: 0 2px; }
.scale-edges { position: relative; height: 16px; font-size: 11px; color: var(--text3); }
.scale-edges span { position: absolute; top: 0; transform: translateX(-50%); }
.big-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.big-side { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding-bottom: 8px; }
.big-side .badge { height: 30px; padding: 0 12px; font-size: 14px; }
.weld-range-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.req { font-size: 11px; font-style: normal; color: var(--text3); }
.el-name { font-size: 11px; font-style: normal; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fields--chem .field-label { align-items: baseline; font-size: 15px; font-weight: 600; color: var(--ink); }
.fields--chem .field-label > span:first-child { flex: none; }
.fields--chem .input { font-size: 17px; padding-left: 8px; }
.fields--chem .unit { min-width: 0; padding: 0 10px 0 2px; }
.range-table--chem { grid-template-columns: minmax(0, 1fr) minmax(90px, 128px) minmax(90px, 128px); }
.range-table--chem .rt-label b { font-size: 15px; }
.badge--warn { background: var(--warn-bg); color: var(--warn-text); }

.stacked { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--chip); }
.stacked span { display: block; height: 100%; }
.legend { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.legend li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; }
.legend .sw { width: 12px; height: 12px; border-radius: 3px; }
.legend .num { font-weight: 600; text-align: right; }
.legend .pct { min-width: 52px; text-align: right; color: var(--text2); }

.quick-table { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 6px; }
.quick-cell { min-height: 52px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); text-align: left; font-size: 13px; color: var(--text2); }
.quick-cell b { display: block; font-size: 15px; color: var(--ink); }
.quick-cell:hover { border-color: var(--border-input); }
.quick-cell[aria-pressed='true'] { border-color: var(--primary); background: var(--tint); box-shadow: inset 0 0 0 1px var(--primary); }

.tool-info { margin-top: 28px; max-width: 1120px; display: grid; gap: 16px; }
@media (min-width: 900px) { .tool-info { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 32px; } }
.info-card { padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); font-size: 14px; line-height: 1.6; color: var(--body); }
.info-card h2 { font-size: 15px; margin-bottom: 8px; color: var(--ink); }
.info-card ul { margin: 0; padding-left: 18px; }
.info-card li + li { margin-top: 4px; }
.formula { font-size: 15px; overflow-wrap: anywhere; }
.formula + .formula { margin-top: 6px; }

/* pasek mobilny */
.mbar { position: fixed; z-index: 15; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; background: var(--ink); color: #fff; border-radius: 14px; box-shadow: 0 12px 28px -12px rgba(20, 23, 28, .5); transition: transform .2s, opacity .2s; }
.mbar--away { transform: translateY(140%); opacity: 0; pointer-events: none; }
.mbar-text { flex: 1; min-width: 0; }
.mbar-label { display: block; font-size: 12px; color: #B9BEC6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mbar-value { font-size: 22px; font-weight: 600; }
.mbar-unit { font-size: 14px; font-weight: 500; color: #B9BEC6; }
.mbar-sub { margin-left: 10px; font-size: 13px; font-weight: 400; color: #B9BEC6; }
.mbar-btn { flex: none; display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 10px; background: #fff; color: var(--ink); font-size: 14px; font-weight: 600; }
.mbar--warn { background: var(--warn-bg); color: var(--warn-text); border: 1px solid var(--warn-line); }
.mbar--warn .mbar-label { color: var(--warn-text); white-space: normal; font-size: 13px; }
.mbar-value--warn { display: block; font-size: 15px; }
@media (min-width: 900px) { .mbar { display: none; } }
@media (max-width: 899px) { .site-footer { padding-bottom: 96px; } }

/* szuflada nawigacji (telefon) */
.drawer { position: fixed; inset: 0; z-index: 40; width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 0; border: 0; background: var(--canvas); color: var(--ink); }
.drawer::backdrop { background: rgba(20, 23, 28, .4); }
.drawer-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; height: 56px; padding: 0 4px 0 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.drawer-title { flex: 1; font-size: 16px; font-weight: 600; }
.drawer-body { padding: 14px 16px 32px; }
.drawer-body .search { margin-bottom: 16px; }
.drawer-body .nav-group { padding: 16px 2px 6px; }
.drawer-body .nav-link { margin: 0 0 4px; min-height: 52px; padding: 0 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); font-size: 15px; }
.drawer-body .nav-link .tile { width: 36px; height: 36px; border-radius: 9px; }
.drawer-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; }
.drawer-foot .lang { margin-left: 0; }

/* ---------- strona główna ---------- */
.home { max-width: 1280px; margin: 0 auto; padding: 20px 16px 48px; }
@media (min-width: 900px) { .home { padding: 32px 32px 48px; } }
.home-top { display: flex; flex-wrap: wrap; gap: 14px 32px; align-items: center; margin-bottom: 24px; }
.home-top h1 { flex: 0 1 auto; font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
@media (min-width: 900px) { .home-top { margin-bottom: 28px; } .home-top h1 { font-size: 30px; letter-spacing: -0.025em; } }
.home-top .search { flex: 1 1 480px; max-width: 640px; }
.home-cols { display: flex; flex-wrap: wrap; gap: 28px 32px; align-items: flex-start; }
.home-cats { flex: 999 1 600px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.cat h2 { margin-bottom: 10px; font-size: 13px; font-weight: 600; color: var(--text2); }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 10px; }
.tool-card { display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); color: var(--ink); text-decoration: none; transition: border-color .12s, box-shadow .12s, background .12s; }
.tool-card:hover { color: var(--ink); border-color: var(--primary); box-shadow: 0 1px 0 var(--primary); }
.tool-card:active { background: var(--tint); }
.tool-card-name { display: block; font-size: 16px; font-weight: 600; line-height: 1.3; }
.tool-card-desc { display: block; margin-top: 2px; font-size: 13px; color: var(--text3); }

.quick { flex: 1 1 340px; min-width: 0; max-width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
@media (min-width: 900px) { .quick { max-width: 400px; position: sticky; top: 84px; } }
.quick-head { padding: 16px 18px 12px; }
.quick-head h2 { margin-bottom: 12px; font-size: 15px; font-weight: 600; }
.quick .modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 0; background: var(--canvas); }
.quick-body { padding: 0 18px 16px; display: flex; flex-direction: column; gap: 12px; }
.quick-body .opt-cards { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 4px; }
.quick-body .opt-card { min-height: 44px; padding: 3px; text-align: center; }
.quick-body .opt-title { font-size: 13px; }
.quick-body .opt-sub { font-size: 11px; margin-top: 0; }
.quick-body .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quick-body .fields .field:nth-child(3) { grid-column: 1 / -1; }
.field > .input-box { flex: none; }
.quick-body .field-label { font-size: 13px; }
.quick-body .input-box { height: 44px; }
.quick-body .input { font-size: 16px; padding-left: 8px; }
.quick-body .unit { padding: 0 8px 0 2px; font-size: 12px; min-width: 0; }
.quick-out { padding: 14px 18px 16px; background: var(--canvas); border-top: 1px solid var(--line); }
.quick-out-label { font-size: 13px; color: var(--text2); }
.quick-out-value { font-size: 36px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.quick-out-value .u { font-size: 16px; font-weight: 500; color: var(--text2); }
.quick-out-value.is-empty { font-size: 15px; font-weight: 500; letter-spacing: 0; line-height: 1.4; color: var(--warn-text); padding: 6px 0; }
.quick-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: 500; text-decoration: none; }
.quick-link:hover { text-decoration: underline; }

/* ---------- metodyka ---------- */
.doc { max-width: 1280px; margin: 0 auto; padding: 20px 16px 48px; display: grid; gap: 24px; }
@media (min-width: 1000px) { .doc { grid-template-columns: 240px minmax(0, 1fr); gap: 40px; padding: 32px 32px 64px; } }
.doc-toc { font-size: 14px; }
@media (min-width: 1000px) { .doc-toc { position: sticky; top: 84px; align-self: start; } }
.doc-toc h2 { margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--text2); }
.doc-toc ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.doc-toc a { display: block; padding: 7px 10px; border-radius: var(--r-sm); color: var(--body); text-decoration: none; }
.doc-toc a:hover { background: var(--surface); color: var(--ink); }
.doc-body { max-width: 820px; }
.doc-body h1 { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 10px; }
@media (min-width: 900px) { .doc-body h1 { font-size: 30px; } }
.doc-lead { color: var(--text2); font-size: 16px; margin-bottom: 24px; max-width: 70ch; }
.doc-sec { padding: 20px 22px; margin-bottom: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); scroll-margin-top: 80px; }
.doc-sec h2 { display: flex; align-items: center; gap: 12px; font-size: 19px; font-weight: 600; margin-bottom: 12px; }
.doc-sec h2 .tile { width: 36px; height: 36px; border-radius: 9px; }
.doc-sec h3 { font-size: 14px; font-weight: 600; margin: 16px 0 6px; }
.doc-sec p, .doc-sec li { font-size: 15px; line-height: 1.65; color: var(--body); }
.doc-sec ul { margin: 0; padding-left: 20px; }
.doc-sec li + li { margin-top: 4px; }
.doc-sec .formula { padding: 10px 12px; border-radius: 10px; background: var(--canvas); }
.doc-sec .more { display: inline-flex; align-items: center; min-height: 44px; margin-top: 8px; font-weight: 500; text-decoration: none; }
.doc-sec .more:hover { text-decoration: underline; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.doc-table th, .doc-table td { padding: 8px 10px 8px 0; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.doc-table thead th { border-top: 0; font-size: 12px; font-weight: 500; color: var(--text3); }

/* ---------- 404 ---------- */
.nf { max-width: 640px; margin: 0 auto; padding: 64px 16px; }
.nf h1 { font-size: 28px; margin-bottom: 10px; }
.nf p { color: var(--text2); margin-bottom: 20px; }
.nf-actions { margin-top: 20px; }
.nf-en { margin-top: 28px; }

/* ---------- stopka ---------- */
.site-footer { border-top: 1px solid var(--line); }
.footer-in { max-width: 1280px; margin: 0 auto; padding: 18px 16px; display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 13px; color: var(--text3); }
@media (min-width: 900px) { .footer-in { padding: 18px 32px; } }
.footer-in a { color: var(--text2); }
.footer-in nav { margin-left: auto; display: flex; gap: 16px; }
.page-tool .site-footer { display: none; }
.tool-foot { margin-top: 28px; max-width: 1120px; font-size: 13px; color: var(--text3); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

@media (forced-colors: active) {
  .seg-btn[aria-checked='true'], .tab[aria-selected='true'], .opt-card[aria-checked='true'], .quick-cell[aria-pressed='true'] { outline: 2px solid CanvasText; }
  .band-inner, .band-outer, .band-mid, .band-marker, .scale-pin, .switch-track { forced-color-adjust: none; }
}

/* ---------- wydruk ---------- */
@media print {
  @page { size: A4; margin: 14mm 14mm 16mm; }
  body { background: #fff; font-size: 11pt; }
  .site-header, .sidenav, .mbar, .modes, .result-actions, .link-btn, .skip, .drawer, .tool-info, .site-footer, .crumbs, .tool-head .btn { display: none !important; }
  .seg { background: none; padding: 0; }
  .seg-btn:not([aria-checked='true']) { display: none; }
  .seg-btn { box-shadow: none !important; padding: 0 4px; }
  .print-only { display: block; }
  .print-head { margin-bottom: 8mm; padding-bottom: 3mm; border-bottom: 1px solid #999; font-size: 9pt; color: #333; }
  .print-url { overflow-wrap: anywhere; }
  .app { display: block; min-height: 0; }
  .tool-main { padding: 0; }
  .tool-head h1 { font-size: 16pt; }
  .tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6mm; }
  .card, .result { box-shadow: none; border: 1px solid #999; break-inside: avoid; max-width: none; }
  .input-box, .select { border: 1px solid #999; box-shadow: none !important; }
  .opt-card:not([aria-checked='true']) { display: none; }
  .opt-cards { grid-template-columns: 1fr !important; }
  .big-num { font-size: 28pt; }
  .tool-foot { display: block; margin-top: 8mm; }
  a { color: inherit; text-decoration: none; }
}

/* ---------- elementy narzędzi ---------- */
.fields--1 { grid-template-columns: minmax(0, 220px); }
.btn--icon { width: 44px; min-height: 44px; padding: 0; flex: none; }
.gas-pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; align-items: end; }
.gas-pair .btn--icon { justify-self: center; transform: rotate(90deg); }
@media (min-width: 560px) { .gas-pair { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); } .gas-pair .btn--icon { transform: none; margin-bottom: calc((var(--field-h) - 44px) / 2); } }
.cell-sub { display: block; font-size: 12px; font-weight: 400; color: var(--text3); }
.table--gas tbody th { font-weight: 500; }
.table--gas tr.is-real th, .table--gas tr.is-real td { background: var(--tint); }
.table--gas tr.is-cal th, .table--gas tr.is-cal td { background: var(--canvas); }
.table--gas td:last-child { width: 1%; }

.rule-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 14px; }
.rule-list li { padding: 7px 10px; border-radius: var(--r-sm); color: var(--text2); background: var(--canvas); }
.rule-list li.is-on { color: var(--primary-hover); background: var(--tint); font-weight: 600; box-shadow: inset 3px 0 0 var(--primary); }

.qbar-track { position: relative; height: 46px; margin-top: 4px; }
.qbar-axis { position: absolute; left: 0; right: 0; top: 30px; height: 2px; background: var(--line); }
.qbar-band { position: absolute; top: 25px; height: 12px; border-radius: 3px; background: var(--band-inner); }
.qbar-band.is-open { border-radius: 3px 0 0 3px; background: linear-gradient(90deg, var(--band-inner) 70%, var(--band-outer)); }
.qbar-mark { position: absolute; top: 20px; width: 3px; height: 22px; margin-left: -1.5px; border-radius: 2px; background: var(--ink); box-shadow: 0 0 0 2px #fff; }
.qbar-mark-lab { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); font-size: 12px; font-weight: 600; white-space: nowrap; }
.qbar-mark-lab.is-end { left: auto; right: 0; transform: none; }
.qbar-ticks { display: flex; justify-content: space-between; font-size: 12px; color: var(--text3); }

.chart--sch { max-width: 520px; }
.ch-reg { fill: #F1F3F6; stroke: none; }
.ch-reg.is-on { fill: var(--halo); }
.ch-grid { stroke: #FFFFFF; stroke-width: 1; }
.ch-edge { fill: none; stroke: var(--text3); stroke-width: 1.25; stroke-linejoin: round; }
.ch-frame { fill: none; stroke: var(--border-input); stroke-width: 1; }
.ch-tick { font-size: 11px; fill: var(--text3); }
.ch-axis { font-size: 12px; fill: var(--text2); }
.ch-lab { font-size: 13px; font-weight: 500; fill: var(--text2); }
.ch-lab.is-on { font-weight: 700; fill: var(--primary-hover); }
.ch-pt { fill: var(--primary); stroke: #fff; stroke-width: 3; }
.ch-ptlab { font-size: 13px; font-weight: 600; fill: var(--ink); paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; }
.chart--sch polyline, .chart--sch .ch-line { fill: none; stroke: var(--text3); stroke-width: 1.5; }

.chart--fillet { max-width: 320px; }
.fl-plate { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: square; }
.fl-weld { fill: var(--halo); stroke: var(--primary); stroke-width: 2; stroke-linejoin: round; }
.fl-dim { stroke: var(--primary-hover); stroke-width: 1.5; }
.fl-lab { font-size: 15px; font-style: italic; fill: var(--primary-hover); font-weight: 600; }
.fl-val { font-size: 14px; fill: var(--ink); font-weight: 500; }

.sg-base { stroke: var(--border-input); stroke-width: 1; }
.sg-weld { fill: var(--primary); }
.sg-weld.is-hit { fill: var(--error); }
.sg-wlab { font-size: 11px; font-weight: 600; fill: #fff; }
.sg-obs { fill: var(--warn-bg); stroke: var(--warn); stroke-width: 1.5; stroke-dasharray: 4 3; }
.sg-obs-lab { font-size: 11px; fill: var(--warn-text); }
.sg-tick { stroke: var(--border-input); }
.sg-tlab { font-size: 12px; fill: var(--text3); }

.group > .seg { align-self: flex-start; }
