/* Kalkulatory ORIP_XXI — style specyficzne dla aplikacji.
   Style bazowe (typografia, nagłówek, stopka, nawigacja) ładowane z /assets/style.css. */

/* ── MAIN (szerszy niż atomowa .layout) ── */
.site-main {
    max-width: 1380px; margin: 0 auto; padding: 28px 28px 60px;
}

/* ── TYTUŁ STRONY ── */
.page-title {
    font-size: 1.7rem; font-weight: 700; letter-spacing: -0.03em;
    margin: 0 0 24px;
}

/* ── FORMULARZ ── */
.search-form { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 32px; }
.search-form input[type="text"],
.search-form input[type="number"],
.search-form select {
    padding: 8px 12px; border: 1px solid #d6dce3; border-radius: 4px;
    font: inherit; font-size: 0.95rem; outline: none;
    transition: border-color .15s;
}
.search-form input:focus, .search-form select:focus { border-color: #111; }
.search-form button, .btn {
    padding: 8px 18px; background: #111; color: #fff; border: none;
    border-radius: 4px; font: inherit; font-size: 0.95rem; font-weight: 600;
    cursor: pointer; transition: background .15s; text-decoration: none; display: inline-block;
}
.search-form button:hover, .btn:hover { background: #333; }
.btn-secondary {
    background: #fff; color: #111; border: 1px solid #d6dce3;
}
.btn-secondary:hover { background: #f5f7f9; }

/* ── KARTY ── */
.card {
    border: 1px solid #e5eaef; border-radius: 8px; padding: 20px 24px;
    margin-bottom: 20px;
}
.card-title { font-size: 1.1rem; font-weight: 700; margin: 0 0 12px; }

/* ── TABELE ── */
.data-table {
    width: 100%; border-collapse: collapse; font-size: 0.9rem;
    margin-bottom: 20px;
}
.data-table th {
    text-align: left; padding: 8px 12px; border-bottom: 2px solid #d6dce3;
    font-weight: 600; white-space: nowrap; color: #56606b;
}
.data-table td {
    padding: 7px 12px; border-bottom: 1px solid #edf1f4;
    vertical-align: top;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f9fafb; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table th.num { text-align: right; }

/* ── WYNIKI KALKULATORÓW ── */
.site-main > div[style*="max-width:900px"][style*="margin-top:32px"],
.site-main > div[style*="max-width:1080px"][style*="margin-top:32px"] {
    max-width: 1220px !important;
}
.results-table[style*="max-width"],
.data-table[style*="max-width"],
.card[style*="max-width"],
.alert[style*="max-width"] {
    max-width: min(100%, 1120px) !important;
}
.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    line-height: 1.45;
}
.results-table th,
.results-table td {
    padding: 7px 10px;
    border-bottom: 1px solid #edf1f4;
    vertical-align: top;
}
.results-table th {
    color: #56606b;
    font-weight: 600;
}
.results-table td {
    overflow-wrap: anywhere;
}
.results-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.calc-reference-panels .calc-reference-note {
    margin: 8px 0 0;
    font-size: 0.82rem;
    line-height: 1.45;
    color: #374151;
}

/* ── KARTA NUKLIDU ── */
.nuclide-header { display: flex; align-items: baseline; gap: 16px; margin-bottom: 16px; }
.nuclide-symbol { font-size: 2.5rem; font-weight: 700; letter-spacing: -0.04em; }
.nuclide-details { color: #56606b; }

/* ── WYKRES NKE ── */
.nke-cell {
    width: 42px; height: 42px;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 600; border-radius: 3px;
    text-decoration: none; color: #111; transition: transform .1s;
}
.nke-cell:hover { transform: scale(1.15); z-index: 1; position: relative; }
.nke-cell.stable   { background: #dbeafe; }
.nke-cell.alpha    { background: #fde68a; }
.nke-cell.beta-    { background: #bbf7d0; }
.nke-cell.ec       { background: #fbcfe8; }
.nke-cell.sf       { background: #f5d0fe; }
.nke-cell.it       { background: #e0e7ff; }
.nke-cell.unknown  { background: #f3f4f6; }

/* ── LEGENDA ── */
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 20px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; }
.legend-box { width: 16px; height: 16px; border-radius: 3px; flex-shrink: 0; }

/* ── SOLVER ── */
.solver-chart { width: 100%; height: 340px; }

.chainsolver-form-inner {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 60%;
    max-width: none;
}

.chainsolver-form .help-text {
    max-width: 100%;
}

.methodology-card p:not(.methodology-formula),
.methodology-card ul {
    font-size: 0.88rem !important;
    line-height: 1.45;
}

.rotor-mechanics-result {
    font-size: 0.88rem;
    line-height: 1.45;
}

.rotor-mechanics-result h2 {
    font-size: 1rem;
    margin: 0 0 12px;
}

.rotor-mechanics-result .calc-table {
    font-size: 0.88rem;
}

.compact-result-block {
    font-size: 0.88rem;
    line-height: 1.45;
}

.compact-result-block h2 {
    font-size: 1rem;
    margin: 0 0 12px;
}

.compact-result-block .calc-table {
    font-size: 0.88rem;
}

.uncertainty-budget-title {
    font-size: 1rem;
    margin-bottom: 10px;
}

.uncertainty-budget-table {
    width: 100%;
    min-width: 860px;
    font-size: 0.88rem;
    line-height: 1.45;
    border-collapse: collapse;
}

.uncertainty-budget-table th,
.uncertainty-budget-table td {
    padding: 8px 18px 8px 0;
    border-bottom: 1px solid #edf1f4;
    vertical-align: top;
}

.uncertainty-budget-table th:not(:first-child),
.uncertainty-budget-table td:not(:first-child) {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.uncertainty-budget-table th {
    white-space: nowrap;
}

.emp-infra-wide-grid,
.emp-infra-wide-card {
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box;
}

.emp-infra-table-scroll {
    overflow-x: visible;
}

.emp-infra-sector-table {
    width: 100%;
    min-width: 0;
    table-layout: auto;
}

.emp-infra-sector-table th,
.emp-infra-sector-table td {
    padding-right: 18px;
    vertical-align: top;
}

.emp-infra-sector-table th:nth-child(-n+6),
.emp-infra-sector-table td:nth-child(-n+6) {
    white-space: nowrap;
}

.emp-infra-sector-table th:last-child,
.emp-infra-sector-table td:last-child {
    white-space: normal;
}

.emp-infra-sector-table th:nth-child(7),
.emp-infra-sector-table td:nth-child(7) {
    min-width: 320px;
}

.jwl-comparison-card {
    width: 100% !important;
    max-width: none !important;
}

/* ── KOMUNIKATY ── */
.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 20px; font-size: 0.93rem; }
.alert-info  { background: #eff6ff; border: 1px solid #bfdbfe; }
.alert-warn  { background: #fffbeb; border: 1px solid #fde68a; }
.alert-error { background: #fef2f2; border: 1px solid #fecaca; }

/* ── AUDYT MODELU ── */
.calc-model-notes {
    margin-top: 36px;
    padding-top: 20px;
    border-top: 1px solid #e5eaef;
    max-width: 1120px;
    font-size: 0.84rem;
}
.calc-model-notes h2 {
    font-size: 1rem;
    margin: 0 0 10px;
}
.calc-model-notes h3 {
    font-size: 0.84rem;
    margin: 0 0 8px;
}
.calc-model-notes__intro {
    color: #374151;
    font-size: 0.84rem;
    line-height: 1.52;
    max-width: 860px;
}
.calc-model-notes__intro p {
    margin: 0 0 12px;
}
.calc-model-notes__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 14px;
}
.calc-model-notes__grid > div {
    border: 1px solid #e5eaef;
    border-radius: 6px;
    padding: 12px 14px;
    background: #fbfcfd;
}
.calc-model-notes ul {
    margin: 0;
    padding-left: 18px;
    color: #374151;
    font-size: 0.8rem;
    line-height: 1.48;
}
.calc-model-notes li + li {
    margin-top: 6px;
}

/* ── TAGI ── */
.tag { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 0.78rem; font-weight: 600; }
.tag-alpha  { background: #fde68a; color: #78350f; }
.tag-betam  { background: #bbf7d0; color: #065f46; }
.tag-ec     { background: #fbcfe8; color: #831843; }
.tag-it     { background: #e0e7ff; color: #3730a3; }
.tag-sf     { background: #f5d0fe; color: #6b21a8; }
.tag-n      { background: #fed7aa; color: #7c2d12; }
.tag-stable { background: #dbeafe; color: #1e3a8a; }

/* ── SIATKA ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* W sekcjach wynikowych pierwsza kolumna zwykle zawiera tabelę Parametr/Wartość,
   a druga krótszą interpretację. Proporcja 60:40 daje więcej miejsca wartościom. */
.site-main > div[style*="margin-top:32px"] > .grid-2 {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
}

.delivery-result-cards {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}
.delivery-result-cards--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.delivery-result-cards--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.delivery-result-cards .result-card {
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid #e5eaef;
    border-radius: 6px;
    background: #fff;
}
.delivery-result-cards .result-card--primary {
    background: #f8fafc;
    border-color: #dbe3ea;
}
.delivery-result-cards .result-label {
    color: #56606b;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.25;
}
.delivery-result-cards .result-value {
    margin-top: 4px;
    font-size: 0.95rem !important;
    font-weight: 700;
    line-height: 1.35;
}
.delivery-result-cards .result-sub {
    margin-top: 4px;
    color: #56606b;
    font-size: 0.78rem;
    line-height: 1.35;
}

/* ── POLA FORMULARZA Z OPISEM ── */
.form-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 32px; }
.form-field label { font-size: 0.85rem; font-weight: 600; color: #111; }
.help-text { margin: 0; font-size: 0.78rem; color: #56606b; line-height: 1.55; max-width: 460px; }
.help-text code { background: #f1f3f5; padding: 1px 4px; border-radius: 3px; font-size: 0.88em; }

/* ── SPINNER ── */
.spinner {
    display: inline-block; width: 20px; height: 20px;
    border: 2px solid #e5eaef; border-top-color: #111;
    border-radius: 50%; animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── TRANSMUTER LANDING ── */
.transmuter-cards {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 8px;
}
.transmuter-landing-card {
    display: flex; flex-direction: column; gap: 6px;
    padding: 18px 16px; border: 2px solid #e5eaef; border-radius: 10px;
    text-decoration: none; color: #111; transition: box-shadow .15s, transform .1s;
    cursor: pointer;
}
.transmuter-landing-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.10); transform: translateY(-2px); }
.tl-icon  { font-size: 2rem; line-height: 1; }
.tl-title { font-size: 1.05rem; font-weight: 700; }
.tl-sub   { font-size: 0.82rem; color: #56606b; }
.tl-desc  { font-size: 0.83rem; color: #374151; line-height: 1.5; margin: 4px 0 0; flex: 1; }
.tl-src   { font-size: 0.75rem; color: #6b7280; margin-top: 6px; }
.tl-src span { color: #2563eb; }

/* ── CALC-HEADER (podstrony transmuter) ── */
.calc-header {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 8px;
    padding: 8px 0 16px; border-bottom: 1px solid #e5eaef; margin-bottom: 20px;
    font-size: 0.85rem;
}
.calc-breadcrumb a { color: #56606b; text-decoration: none; }
.calc-breadcrumb a:hover { color: #111; text-decoration: underline; }
.calc-source-link { color: #6b7280; }
.calc-source-link a { color: #2563eb; }

/* ── TRANSMUTER FORMULARZ ── */
.scenario-grid {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 4px;
}
.scenario-card {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 10px 6px; border: 2px solid #e5eaef; border-radius: 8px; cursor: pointer;
    text-align: center; transition: border-color .15s, background .15s; user-select: none;
}
.scenario-card:hover   { border-color: #94a3b8; background: #f8fafc; }
.scenario-card.active  { border-color: #111; background: #f0f9ff; }
.scenario-card input   { display: none; }
.scenario-icon   { font-size: 1.5rem; line-height: 1; }
.scenario-name   { font-size: 0.82rem; font-weight: 700; line-height: 1.2; }
.scenario-sub    { font-size: 0.72rem; color: #56606b; line-height: 1.2; }
.transmuter-form { max-width: 720px; }

/* Skala logarytmiczna wzbogacania */
.enr-logscale { margin: 10px 0 6px; }
.enr-logscale-bar { position: relative; height: 10px; background: #e5e7eb; border-radius: 5px; overflow: visible; }
.enr-logscale-fill { position: absolute; left: 0; top: 0; height: 100%; background: #3b82f6; border-radius: 5px; transition: width .15s, background .15s; }
.enr-logscale-cursor { position: absolute; top: -3px; width: 4px; height: 16px; background: #3b82f6; border-radius: 2px; transform: translateX(-50%); transition: left .15s, background .15s; box-shadow: 0 0 0 2px #fff, 0 0 0 3px currentColor; }
.enr-logscale-labels { position: relative; height: 40px; margin-top: 6px; }
.enr-log-mark { position: absolute; transform: translateX(-50%); font-size: 0.72rem; color: #374151; text-align: center; line-height: 1.25; white-space: nowrap; }
.enr-log-mark strong { display: block; font-weight: 700; }
.enr-log-tick { position: absolute; top: -8px; width: 0; border-left: 1px dashed #d1d5db; height: 6px; }

/* Wskaźnik jakości Pu-240 */
.pu-grade-bar { position: relative; height: 24px; background: #e5e7eb; border-radius: 6px; overflow: hidden; margin: 12px 0 4px; }
.pu-grade-fill { height: 100%; border-radius: 6px; transition: width .4s; }
.pu-grade-labels { position: relative; height: 36px; }
.pu-grade-label { position: absolute; top: 4px; font-size: 0.72rem; color: #56606b; transform: translateX(-50%); line-height: 1.2; text-align: center; }

.chain-result { margin-top: 24px; }

/* ── RESPONSIVE (kalkulatory-specific) ── */
@media (max-width: 900px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .delivery-result-cards--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .calc-model-notes__grid { grid-template-columns: 1fr; }
    .chainsolver-form-inner { width: 100%; }
    .emp-infra-wide-grid,
    .emp-infra-wide-card {
        width: 100% !important;
        max-width: none !important;
    }
    .transmuter-cards { grid-template-columns: 1fr 1fr; }
    .nke-cell { width: 36px; height: 36px; font-size: 10px; }
    .scenario-grid { grid-template-columns: repeat(3, 1fr); }
    .site-main { padding: 20px 18px 48px; }
}
@media (max-width: 560px) {
    .delivery-result-cards--3,
    .delivery-result-cards--4 { grid-template-columns: 1fr; }
    .transmuter-cards { grid-template-columns: 1fr; }
    .scenario-grid { grid-template-columns: 1fr 1fr; }
}
