:root {
    --blue: #17365d;
    --blue-hover: #244d7a;

    --bg: #f4f3ef;
    --surface: #fbfbf8;
    --white: #ffffff;

    --text: #202326;
    --muted: #6b7074;

    --line: #cfd2d2;
    --line-light: #e4e5e3;

    --warn-bg: #f2edda;
    --warn-text: #554f37;

    --red: #9e3030;
    --green: #2f7047;
}


/* ============================================================
   GRUND
============================================================ */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;

    background: var(--bg);
    color: var(--text);

    font-family:
        "Helvetica Neue",
        "Segoe UI",
        Arial,
        sans-serif;

    font-size: 15px;
    line-height: 1.55;

    -webkit-font-smoothing: antialiased;
}

.page {
    width: min(1450px, calc(100% - 64px));

    margin: 36px auto 0;
    padding-bottom: 80px;
}


/* ============================================================
   LEGAL
============================================================ */

.legal {
    margin-bottom: 20px;

    color: var(--muted);

    font-size: 11px;
    font-weight: 500;

    letter-spacing: 0.08em;
    text-transform: uppercase;
}


/* ============================================================
   HUVUDRUBRIK
============================================================ */

.hero {
    position: relative;

    padding: 4px 0 34px;

    background: transparent;
    color: var(--text);

    border-bottom: 0;
}

.hero::after {
    content: "";
    display: block;
    width: min(1050px, 85%);
    height: 3px;
    margin-top: 26px;
    background: var(--text);
}

.hero h1 {
    margin: 0;

    color: var(--text);

    font-size: clamp(38px, 4.1vw, 58px);
    font-weight: 500;
    line-height: 1.05;

    letter-spacing: -0.045em;
}


/* ============================================================
   INFORMATION
============================================================ */

.notice {
    padding: 15px 0 34px;

    background: transparent;
    color: var(--warn-text);

    border-bottom: 1px solid var(--line);

    font-size: 13px;
}

.notice strong {
    font-weight: 700;
}

/* ============================================================
   NAVIGATION BAR
============================================================ */

.main-nav {
    display: flex;
    gap: 30px;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}

.main-nav a {
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.main-nav a:hover {
    color: var(--muted);
}

.main-nav a.active {
    text-decoration: underline;
    text-underline-offset: 5px;
}

/* ============================================================
   INTRODUKTION
============================================================ */

.introduction {
    margin: 0;

    padding: 112px 0 100px;

    border-bottom: 1px solid var(--line);
}

.intro-title {
    max-width: 900px;

    margin: 0;

    color: var(--text);

    font-size: clamp(34px, 4vw, 52px);
    font-weight: 500;
    line-height: 1.1;

    letter-spacing: -0.04em;
}

.intro-text {
    max-width: 780px;

    margin: 20px 0 0;

    color: #454b50;

    font-size: 20px;
    line-height: 1.55;
}


/* ============================================================
   TRE STEG - HORISONTELLT FLÖDE
============================================================ */

.steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));

    gap: 64px;

    max-width: 1200px;

    margin-top: 68px;
}

.step {
    position: relative;

    min-height: 165px;

    padding: 19px 0 0;

    border-top: 2px solid var(--text);
}


/* Pilar mellan steg 1 → 2 och 2 → 3 */

.step:not(:last-child)::after {
    content: "→";
    position: absolute;
    top: 4px;
    right: -43px;
    color: var(--text);
    font-size: 32px;
    font-weight: 400;
}


.step-number {
    display: block;
    margin-bottom: 20px;
    color: var(--text);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.10em;
}


.step h3 {
    margin: 0 0 10px;

    color: var(--text);

    font-size: 21px;
    font-weight: 600;

    letter-spacing: -0.02em;
}


.step p {
    max-width: 315px;

    margin: 0;

    color: #555c61;

    font-size: 16px;
    line-height: 1.6;
}


/* ============================================================
   SEKTIONER
============================================================ */

section {
    margin-top: 46px;
}

.introduction {
    margin-top: 0;
}

.tool-section {
    margin-top: 64px;
}

section > h2:not(.intro-title) {
    margin: 0 0 18px;
    padding-bottom: 9px;

    color: var(--text);

    border-bottom: 2px solid var(--text);

    font-size: 19px;
    font-weight: 600;

    letter-spacing: -0.01em;
}

.explanation {
    max-width: 900px;

    margin: -3px 0 18px;

    color: var(--muted);

    font-size: 13px;
    line-height: 1.6;
}


/* ============================================================
   VERKTYGET
============================================================ */

.controls {
    display: grid;

    grid-template-columns:
        minmax(220px, 1fr)
        minmax(280px, 1.2fr)
        auto;

    gap: 22px;

    align-items: end;

    padding: 26px;

    background: var(--surface);

    border: 1px solid var(--line);
}

label {
    color: var(--text);

    font-size: 13px;
    font-weight: 600;
}

select,
input[type=file] {
    display: block;

    width: 100%;
    height: 45px;

    margin-top: 8px;
    padding: 0 11px;

    background: var(--white);
    color: var(--text);

    border: 1px solid #aeb4b6;
    border-radius: 0;

    font: inherit;
    font-size: 14px;
}

input[type=file] {
    padding: 7px 8px;
}

input[type=file]::file-selector-button {
    height: 29px;

    margin-right: 10px;
    padding: 0 13px;

    background: #eceeec;
    color: var(--text);

    border: 0;

    font: inherit;
    font-size: 12px;
    font-weight: 600;

    cursor: pointer;
}

select:hover,
input[type=file]:hover {
    border-color: #757e83;
}

select:focus,
input[type=file]:focus {
    outline: 2px solid rgba(23, 54, 93, 0.16);
    outline-offset: 0;

    border-color: var(--blue);
}

select:disabled {
    background: #eceeec;
    color: #858b8e;
}


/* ============================================================
   KNAPP
============================================================ */

button {
    min-height: 45px;

    padding: 0 25px;

    border: 1px solid var(--blue);
    border-radius: 0;

    background: var(--blue);
    color: #ffffff;

    font: inherit;
    font-size: 13px;
    font-weight: 700;

    cursor: pointer;

    transition:
        background 120ms ease,
        color 120ms ease;
}

button:hover {
    background: var(--blue-hover);
}

button:active {
    background: #102b4a;
}

.status {
    margin: 10px 1px 0;

    color: var(--muted);

    font-size: 12px;
}


/* ============================================================
   SUMMARY
============================================================ */

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
}

.summary-card strong {
    display: block;
    margin-top: 6px;
    color: var(--text);
    font-size: 29px;
    font-weight: 600;
    letter-spacing: -0.025em;
}

.summary-card span {
    display: block;

    color: var(--muted);

    font-size: 12px;
}

.summary-card strong {
    display: block;

    margin-top: 6px;

    color: var(--blue);

    font-size: 29px;
    font-weight: 600;

    letter-spacing: -0.025em;
}


/* ============================================================
   TABELLER
============================================================ */

.table-wrap,
.small-table-wrap {
    overflow: auto;

    background: var(--surface);

    border: 1px solid var(--line);
}

table {
    width: 100%;

    border-collapse: collapse;
}

.table-wrap table {
    min-width: 1120px;
}


/* ============================================================
   TABELLHUVUD
============================================================ */

th {
    padding: 12px 13px;

    background: #e8eae8;
    color: var(--text);

    border-right: 1px solid #c8ccca;
    border-bottom: 2px solid #8d9699;

    text-align: right;
    white-space: nowrap;

    font-size: 12px;
    font-weight: 700;

    cursor: pointer;
}

th:first-child {
    text-align: left;
}

th:last-child {
    border-right: 0;
}

th small {
    color: var(--muted);

    font-size: 10px;
    font-weight: 400;
}


/* ============================================================
   TABELLRADER
============================================================ */

td {
    padding: 10px 13px;

    background: var(--surface);

    border-bottom: 1px solid var(--line-light);

    color: #303538;

    text-align: right;

    font-size: 13px;
    font-weight: 400;
}

td:first-child {
    text-align: left;
    font-weight: 400;
}

tbody tr:nth-child(even) td {
    background: #f4f5f2;
}

tbody tr:hover td {
    background: #e9eef1;
}

tbody tr:last-child td {
    border-bottom: 0;
}

.empty {
    padding: 32px !important;

    background: var(--surface) !important;
    color: #7e8588 !important;

    text-align: center !important;
    font-weight: 400 !important;
}


/* ============================================================
   DIFFERENSER
============================================================ */

.negative {
    color: var(--red);
}

.positive {
    color: var(--green);
}


/* ============================================================
   ÖVRIGA INNEHAV
============================================================ */

.unmatched-section {
    margin-top: 54px;
    padding-top: 4px;
}

.small-table-wrap th {
    cursor: default;
}

.small-table-wrap td,
.small-table-wrap th {
    font-size: 12px;
}


/* ============================================================
   SYNLIGHET
============================================================ */

.hidden {
    display: none;
}


/* ============================================================
   HUVUDTABELLENS FETSTIL

   Grundläge:
   alla rader är normal text.

   target-holding:
   hela raden blir fet.
============================================================ */

#comparisonTable tbody tr td {
    font-weight: 400 !important;
}

#comparisonTable tbody tr td:first-child {
    font-weight: 400 !important;
}

#comparisonTable tbody tr.target-holding td {
    font-weight: 700 !important;
}

#comparisonTable tbody tr.target-holding td:first-child {
    font-weight: 700 !important;
}


/* Tomraden ska aldrig bli fet */

#comparisonTable tbody tr td.empty {
    font-weight: 400 !important;
}


/* ============================================================
   MELLANSTORA SKÄRMAR
============================================================ */

@media (max-width: 1000px) {

    .page {
        width: calc(100% - 40px);
    }

    .steps {
        gap: 46px;
    }

    .controls {
        grid-template-columns: 1fr 1fr;
    }

    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

}


@media (max-width: 700px) {

    .summary-grid {
        grid-template-columns: 1fr;
    }

}


/* ============================================================
   STEGEN BLIR VERTIKALA PÅ MINDRE SKÄRM
============================================================ */

@media (max-width: 800px) {

    .steps {
        grid-template-columns: 1fr;

        gap: 42px;

        margin-top: 48px;
    }

    .step {
        min-height: auto;
    }

    .step:not(:last-child)::after {
        content: "→";
        position: absolute;
        top: 4px;
        right: -43px;
        color: var(--text);
        font-size: 32px;
        font-weight: 400;
    }
}


/* ============================================================
   MOBIL
============================================================ */

@media (max-width: 700px) {

    .page {
        width: calc(100% - 24px);

        margin-top: 20px;
    }

    .hero {
        padding-bottom: 26px;
    }

    .hero::after {
        width: 88%;
        height: 2px;

        margin-top: 21px;
    }

    .hero h1 {
        font-size: 36px;
    }

    .introduction {
        padding: 60px 0 66px;
    }

    .intro-title {
        font-size: 32px;
    }

    .intro-text {
        font-size: 18px;
    }

    .step-number {
        display: block;
        margin-bottom: 20px;
        color: var(--text);
        font-size: 18px;
        font-weight: 700;
        letter-spacing: 0.10em;
    }

    .step h3 {
        font-size: 20px;
    }

    .step p {
        max-width: none;

        font-size: 16px;
    }

    .controls {
        grid-template-columns: 1fr;

        padding: 18px;
    }
 
    button {
        width: 100%;
    }
}

#holdingsFile {
    display: none !important;
}

.file-picker {
    display: flex;
    align-items: center;
    width: 100%;
    height: 45px;
    margin-top: 8px;
    padding: 7px 8px;
    background: var(--white);
    border: 1px solid #aeb4b6;
    border-radius: 0;
}

.file-picker:hover {
    border-color: #757e83;
}

.file-picker-button {
    display: flex;
    align-items: center;
    height: 29px;
    margin-right: 10px;
    padding: 0 13px;
    background: #eceeec;
    color: var(--text);
    border: 0;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.file-picker-button:hover {
    background: #e2e2e2;
}

#fileName {
    color: var(--text);
    font-size: 14px;
    font-weight: 400;
}