﻿

:root {
    --bg: #000;
    --bg-2: #111;
    --elev-1: #0d0d0d;
    --elev-2: #141414;
    --text: #ffffff;
    --muted: #cccccc;
    --hairline: rgba(255,255,255,.1);
    --hairline-2: rgba(255,255,255,.06);
    --accent: #8ab4ff;
    --accent-2: #b6e3ff;
    --focus: rgba(138,180,255,.55);
    --ok: #34c759;
    --warn: #ffd60a;
    --danger: #ff453a;
    --radius-outer: 18px;
    --radius: 14px;
    --radius-sm: 12px;
    --shadow-sm: 0 2px 6px rgba(0,0,0,.28);
    --shadow-md: 0 12px 32px rgba(0,0,0,.40);
    --shadow-lg: 0 24px 60px rgba(0,0,0,.50);
    --glass: rgba(255,255,255,.06);
    --blur: 14px;
    --font: ui-sans-serif, system-ui, -apple-system, "SF Pro Text","SF Pro Display","Segoe UI",Roboto,"Helvetica Neue",Arial;
    --fs-xs: 12px;
    --fs-sm: 13px;
    --fs: 15.5px;
    --fs-lg: clamp(18px, 4.6vw, 26px);
    --fw-bold: 700;
    --container: 1160px;
    --pad: clamp(16px, 3vw, 28px);
    --shadow: 0 20px 40px rgba(0,0,0,.6);
}

html, body {
    height: 100%;
    margin: 0;
    color: var(--text);
    background: #000 !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-family: var(--font);
    text-rendering: optimizeLegibility;
}

::selection {
    background: rgba(138,180,255,.28);
    color: #fff;
}

.wrap {
    max-width: var(--container);
    margin: 5vh auto;
    padding: var(--pad);
}

header.header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 0 14px;
    margin-top: 10vh;
}

.logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(145deg, #2a6bff, #67a1ff);
    display: grid;
    place-items: center;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

    .logo::after {
        content: "";
        position: absolute;
        inset: 0;
        background: radial-gradient(28px 22px at 18% 18%, rgba(255,255,255,.55), transparent 55%), linear-gradient(transparent, rgba(0,0,0,.15));
        mix-blend-mode: screen;
        pointer-events: none;
    }

    .logo svg {
        width: 24px;
        height: 24px;
        filter: drop-shadow(0 4px 10px rgba(0,0,0,.45));
    }

.brand h1 {
    margin: 0;
    font-size: clamp(20px, 4.2vw, 32px);
    letter-spacing: .2px;
    font-weight: var(--fw-bold);
    background: linear-gradient(180deg, #fff, #cfd7e6 55%, #a6b1c6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.brand p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: var(--fs-sm);
}

.hero {
    margin: 14px 0 18px;
    padding: clamp(14px,2.6vw,24px);
    border-radius: var(--radius-outer);
    background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.02));
    border: 0.5px solid var(--hairline);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(var(--blur));
}

    .hero h2 {
        margin: 0 0 6px;
        font-size: var(--fs-lg);
    }

    .hero p {
        margin: 0;
        color: var(--muted);
        font-size: var(--fs);
    }

.grid {
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr;
    justify-content: center;
}

@media (min-width: 880px) {
    .grid {
        grid-template-columns: 1.08fr .92fr;

    }
}

.panel {
    background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02)), radial-gradient(600px 300px at 120% -20%, rgba(138,180,255,.08), transparent 60%), var(--elev-1);
    border: 0.5px solid var(--hairline-2);
    border-radius: var(--radius-outer);
    box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, var(--shadow-md);
    padding: clamp(14px, 2.8vw, 24px);
    backdrop-filter: blur(calc(var(--blur) * .75));
    color: #000;
}

    .panel h3 {
        margin: 0 0 12px;
        font-size: clamp(16px, 3.6vw, 20px);
        letter-spacing: .15px;
        color: #000;
    }

.row {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr;
    margin-bottom: 12px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(0,0,0,.08));
    border: 0.5px solid var(--hairline-2);
    border-radius: var(--radius);
    padding: 12px 14px;
    box-shadow: 0 1px 0 rgba(255,255,255,.05) inset, 0 12px 24px rgba(0,0,0,.28);

}

    .field label {
        font-size: var(--fs-xs);
        color: var(--muted);
        letter-spacing: .25px;
        }

    .field input, .field select {
        background: transparent;
        border: none;
        outline: none;
        color: var(--text);
        font-size: clamp(15px, 1.6vw, 16px);
        padding: 3px 0;
    }

    .field select {
        cursor: pointer;
    }

    .field .inline {
        display: flex;
        align-items: center;
        gap: 10px;
        flex-wrap: wrap;
        padding-top: 2px;
    }

.suffix {
    margin-left: auto;
    font-size: var(--fs-xs);
    letter-spacing: .3px;
    color: var(--muted);
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,.06);
    border: 0.5px solid var(--hairline);
}

.help {
    font-size: var(--fs-xs);
    color: var(--muted);
    margin-top: 4px;
}

.field:focus-within {
    box-shadow: 0 0 0 1px var(--focus) inset, 0 0 0 6px rgba(138,180,255,.12), var(--shadow-md);
    border-color: rgba(138,180,255,.55);
    transition: box-shadow .18s ease, border-color .18s ease;
}

.seg {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 6px 0 8px;
}
    .seg h4 {
        width: 100%;
        margin-bottom: 14px;  
        font-size: clamp(18px, 4vw, 22px);
        font-weight: 700;
    }

.chip {
    appearance: none;
    border: 0.5px solid var(--hairline);
    background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03));
    padding: 2px 8px;
    border-radius: 999px;
    font-size: var(--fs-sm);
    color: var(--text);
    cursor: pointer;
    user-select: none;
    box-shadow: 0 1px 0 rgba(255,255,255,.05) inset, var(--shadow-sm);
    transition: transform .12s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}

    .chip:hover {
        transform: translateY(-1px);
    }

    .chip:active {
        transform: translateY(0);
        box-shadow: var(--shadow-sm);
    }

    .chip[aria-pressed="true"] {
        border-color: rgba(138,180,255,.65);
        background: linear-gradient(180deg, rgba(138,180,255,.32), rgba(138,180,255,.12));
        box-shadow: 0 0 0 3px rgba(138,180,255,.12) inset, var(--shadow-sm);
    }

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.btn {
    appearance: none;
    border: none;
    cursor: pointer;
    user-select: none;
    border-radius: 14px;
    font-weight: 600;
    padding: 2px 8px;
    color: #fff;
    background: linear-gradient(180deg, #3c82ff, #2e6af0 70%), linear-gradient(0deg, rgba(255,255,255,.18), rgba(255,255,255,0));
    box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 14px 32px rgba(20,60,150,.45), var(--shadow-sm);
    transition: transform .12s ease, box-shadow .25s ease, filter .2s ease;
}

    .btn:hover {
        transform: translateY(-1px);
        filter: saturate(1.05);
    }

    .btn:active {
        transform: translateY(0);
        box-shadow: 0 8px 22px rgba(20,60,150,.45), var(--shadow-sm);
    }

    .btn.sec {
        color: var(--text);
        background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.05)), var(--elev-2);
        border: 0.5px solid var(--hairline);
        box-shadow: 0 1px 0 rgba(255,255,255,.05) inset, var(--shadow-sm);
    }

.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: var(--fs-xs);
    font-weight: 600;
    line-height: 1.4;
    color: #111; 
    margin-top: 10px;
    background: #f4f5f6; 
    border: 1px solid #d0d3d7; 
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    white-space: nowrap;
    user-select: none;
}


    .badge.b-ok {
        background: #e7f7ec;
        border-color: #b4e2c1;
        color: #196d3b;
    }

    .badge.b-warn {
        background: #fff8e1;
        border-color: #ffe082;
        color: #7a5c00;
    }

    .badge.b-danger {
        background: #fdecea;
        border-color: #f5c6cb;
        color: #8a1c1c;
    }

.table-wrap {
    margin-top: 8px;
    border: 0.5px solid var(--hairline);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(0,0,0,.10)), var(--elev-2);
    overflow: auto;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(calc(var(--blur) * .6));
    max-height: 56vh; 
    overflow-y: auto; 
    overflow-x: auto; 
    scrollbar-gutter: stable;
    overscroll-behavior: contain; 
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 560px;
}

thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    text-align: left;
    font-size: var(--fs-xs);
    letter-spacing: .2px;
    color: var(--muted);
    padding: 12px 14px;
    background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.04)), var(--elev-2);
    border-bottom: 0.5px solid var(--hairline);
    box-shadow: 0 6px 18px rgba(0,0,0,.25);
}

tbody td {
    padding: 12px 14px;
    font-size: var(--fs);
    border-top: 0.5px solid var(--hairline-2);
}

tbody tr:hover {
    background: rgba(138,180,255,.08);
}

.table-wrap::after {
    content: "";
    position: sticky;
    top: 0;
    display: block;
    height: 1px;
    width: 100%;
    box-shadow: 0 8px 18px rgba(0,0,0,.35);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}

@media print {
    body {
        background: #fff !important;
        color: #000 !important;
    }

    .hero, .actions .btn.sec {
        display: none !important;
    }

    .panel {
        background: #fff !important;
        color: #000 !important;
        border: 1px solid #ddd !important;
        box-shadow: none !important;
    }

    thead th {
        background: #f2f2f2 !important;
        color: #000 !important;
    }

    .footer, .footer-note {
        color: #444 !important;
    }
}

@media (prefers-color-scheme: light) {
    :root {
        --bg: #f7f8fb;
        --bg-2: #f0f3f8;
        --elev-1: #ffffff;
        --elev-2: #f7f9fe;
        --text: #0b0c0f;
        --muted: #5c6678;
        --hairline: rgba(0,0,0,.08);
        --hairline-2: rgba(0,0,0,.06);
        --glass: rgba(255,255,255,.75);
    }

    body {
        background: radial-gradient(1200px 600px at 110% -10%, rgba(138,180,255,.18), transparent 60%), radial-gradient(900px 500px at -10% -10%, rgba(124,247,207,.16), transparent 60%), linear-gradient(var(--bg), var(--bg-2));
    }

    .panel, .table-wrap, .field {
        box-shadow: 0 1px 0 rgba(255,255,255,.75) inset, 0 12px 30px rgba(0,0,0,.06);
    }

    .chip {
        box-shadow: 0 1px 0 rgba(255,255,255,.8) inset, 0 6px 16px rgba(0,0,0,.06);
    }

    .btn {
        box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 14px 28px rgba(39,84,204,.28), 0 8px 20px rgba(0,0,0,.06);
    }

        .chip[aria-pressed="true"] {
            outline: 2px solid Highlight;
        }

    .btn {
        outline: 2px solid Highlight;
        background: ButtonFace;
        color: ButtonText;
    }
}
body.calculator-page {
    background: #000 !important;
    color: #fff !important;
}

    body.calculator-page .hero,
    body.calculator-page .hero h1,
    body.calculator-page .hero h2,
    body.calculator-page .hero p,
    body.calculator-page header.header,
    body.calculator-page header.header *:not(svg):not(.logo),
    body.calculator-page .footer,
    body.calculator-page .footer-note {
        color: #fff !important;
    }

@media (min-width:960px) {
    .row.two {
        grid-template-columns: 1fr 1fr;
    }

    .row.three {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .table-wrap {
        margin-left: -8px;
        margin-right: -8px;
        border-radius: 12px;
    }

    table {
        min-width: 360px;
    }

    thead th, tbody td {
        padding: 8px 10px;
        font-size: 12.5px;
    }

    #pikets th:nth-child(1), #pikets td:nth-child(1) {
        width: 42%;
    }

    #pikets th:nth-child(2), #pikets td:nth-child(2) {
        width: 58%;
    }

    #grid th:nth-child(1), #grid td:nth-child(1) {
        width: 34%;
    }

    #grid th:nth-child(2), #grid td:nth-child(2) {
        width: 34%;
    }

    #grid th:nth-child(3), #grid td:nth-child(3) {
        width: 32%;
    }
}
@media (max-width: 768px) {
    .calculator-page {
        --fs-xs: 14px;
        --fs-sm: 15px;
        --fs: 18px; 
        --fs-lg: clamp(22px, 6vw, 30px);
    }

        .calculator-page .field input,
        .calculator-page .field select,
        .calculator-page tbody td {
            font-size: 18px;
        }
}
@media (max-width: 990px) {
    .wrap {
        padding-left: 12px;
        padding-right: 12px;
        max-width: 100%;
        overflow-x: hidden;
    }

    .actions {
        justify-content: center; 
    }

        .actions .btn {
            flex: 1 1 auto; 
            min-width: 140px;
            text-align: center;
        }

    .hero, .hero h2, .hero p {
        text-align: center; 
    }


    .row.three,
    .row.two {
        grid-template-columns: 1fr !important;
    }

    .field {
        width: 100%;
        min-width: 0;
    }

        .field input,
        .field select {
            width: 100%;
            min-width: 0;
            box-sizing: border-box;
        }

    .inline {
        display: flex;
        align-items: center;
        gap: 10px;
        flex-wrap: nowrap;
        overflow: hidden;
    }

    .suffix {
        flex-shrink: 0;
        margin-left: auto;
    }

    .table-wrap {
        max-height: 58vh;
        overflow: auto;
        border-radius: 12px;
        margin-left: -4px;
        margin-right: -4px;
    }

    table {
        min-width: 420px; 
        table-layout: fixed;
        width: 100%;
    }

    thead th,
    tbody td {
        padding: 10px 12px;
        font-size: 13px;
        white-space: nowrap;
    }

    .panel h3 {
        font-size: 18px;
    }

    .hero h2 {
        font-size: clamp(20px, 6vw, 26px);
    }

    .hero p {
        font-size: 15px;
    }
    .row {
        width: 100%;
        justify-content: stretch;
    }

    .field {
        flex: 1 1 100%;
        width: 100%;
    }

        .field .inline {
            width: 100%;
        }

    .grid {
        display: flex;
        flex-direction: column;
        align-items: center; 
        justify-content: flex-start;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .panel {
        width: min(100%, 560px); 
        max-width: 560px;
        margin: 0 auto 20px; 
        align-self: center; 
        padding-left: 8%;
    }

    .badge {
        display: inline-block;
        width: 95%;
        text-align: center;
        margin: 5px auto;
        align-self: center;
        white-space: normal;
    }

    .table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-height: 58vh;
        border-radius: 12px;
        margin-left: -4px;
        margin-right: -4px;
    }

    #tblTop {
        width: 100%;
        min-width: 680px; 
        table-layout: auto; 
        border-collapse: collapse;
    }

        #tblTop thead th,
        #tblTop tbody td {
            padding: 10px 12px;
            font-size: 13px;
            white-space: nowrap; 
        }

        #tblTop td:nth-child(2),
        #tblTop td:nth-child(3),
        #tblTop td:nth-child(4),
        #tblTop td:nth-child(5),
        #tblTop td:nth-child(6) {
            text-align: right;
        }
}
.summary {
    display: flex;
    flex-direction: column; 
    gap: 4px; 
    font-size: var(--fs);
    color: var(--muted);
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed var(--hairline);
    line-height: 1.5;
}

    .summary b,
    .summary strong {
        color: #000;
    }

    .summary span {
        display: block;
    }

#totals .totals {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed var(--hairline);
    line-height: 1.5;
}

#totals .total-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: var(--fs);
}

    #totals .total-row strong {
        font-weight: 700;
        color: #000; 
        flex-shrink: 0;
    }

    #totals .total-row span {
        color: var(--text);
        text-align: right;
        margin-left: 6px;
        flex-grow: 1;
    }

    #totals .total-row.is-strong strong,
    #totals .total-row.is-strong span {
        color: #000;
        font-weight: 700;
    }

@media (max-width: 600px) {
    #totals .total-row {
        font-size: 14px;
    }
}
