:root {
    color-scheme: light;
    --blue: #283593;
    --blue-deep: #17236d;
    --ink: #172033;
    --muted: #687083;
    --line: #d9deea;
    --surface: #ffffff;
    --page: #f4f6fb;
    --accent: #0f8b8d;
    font-family: Arial, Helvetica, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--page);
    color: var(--ink);
}

.shell {
    width: min(1500px, calc(100% - 32px));
    margin: 36px auto;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 12px 28px rgba(33, 41, 67, 0.08);
}

.upload-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
    gap: 28px;
    align-items: end;
    margin-bottom: 20px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1,
h2 {
    margin: 0;
    line-height: 1.15;
    letter-spacing: 0;
}

h1 {
    font-size: clamp(2rem, 6vw, 3.5rem);
}

h2 {
    font-size: 1.35rem;
}

.lede {
    max-width: 620px;
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 1.02rem;
    line-height: 1.55;
}

.upload-form {
    display: grid;
    gap: 14px;
}

.stored-file {
    margin: -4px 0 0;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.4;
}

.date-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

input,
select,
button {
    width: 100%;
    min-height: 44px;
    border-radius: 6px;
    font: inherit;
}

.secondary-button {
    max-width: 180px;
}

input,
select {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    padding: 10px 12px;
}

button {
    border: 0;
    background: var(--blue);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

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

.notice {
    border-radius: 8px;
    padding: 14px 16px;
    margin: 0 0 20px;
    font-weight: 700;
}

.error {
    border: 1px solid #f2b8b5;
    background: #fff1f0;
    color: #8c1d18;
}

.result-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.download-note,
.assumption {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.45;
}

.download-note {
    margin: 0;
    max-width: 260px;
    text-align: right;
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 18px;
}

.meta-grid div {
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 10px;
    min-width: 0;
}

dt {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    margin-bottom: 4px;
}

dd {
    margin: 0;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.usage-table {
    min-width: 680px;
}

th {
    background: var(--blue);
    color: #fff;
    text-align: left;
    font-size: 0.9rem;
}

th,
td {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 8px 9px;
}

th:nth-child(2),
th:nth-child(3),
td:nth-child(2),
td:nth-child(3) {
    text-align: right;
}

#advisor-panel th:nth-child(2),
#advisor-panel th:nth-child(3),
#advisor-panel td:nth-child(2),
#advisor-panel td:nth-child(3),
#advisor-panel th:nth-child(4),
#advisor-panel th:nth-child(5),
#advisor-panel td:nth-child(4),
#advisor-panel td:nth-child(5) {
    text-align: left;
}

#advisor-panel th:nth-child(1),
#advisor-panel td:nth-child(1),
#advisor-panel th:nth-child(n+6),
#advisor-panel td:nth-child(n+6) {
    text-align: right;
}

tr.total-row td {
    font-weight: 700;
}

.spacer-row td {
    padding-top: 18px;
    color: var(--ink);
    font-weight: 400;
}

.section-row td {
    border-top: 3px solid #d92027;
    color: var(--ink);
    font-weight: 700;
    padding-top: 10px;
}

.assumption {
    margin: 14px 0 0;
}

#advisor-panel {
    margin-top: 20px;
}

.advisor-table {
    table-layout: fixed;
    min-width: 0;
}

#advisor-panel th,
#advisor-panel td {
    font-size: 0.86rem;
    overflow-wrap: anywhere;
}

#advisor-panel th:nth-child(1),
#advisor-panel td:nth-child(1) {
    width: 4.5%;
}

#advisor-panel th:nth-child(2),
#advisor-panel td:nth-child(2) {
    width: 8%;
}

#advisor-panel th:nth-child(3),
#advisor-panel td:nth-child(3) {
    width: 16%;
}

#advisor-panel th:nth-child(4),
#advisor-panel td:nth-child(4),
#advisor-panel th:nth-child(5),
#advisor-panel td:nth-child(5) {
    width: 6%;
}

#advisor-panel th:nth-child(n+6),
#advisor-panel td:nth-child(n+6) {
    width: 7%;
}

@media (max-width: 780px) {
    .shell {
        width: min(100% - 20px, 1500px);
        margin: 18px auto;
    }

    .panel {
        padding: 18px;
    }

    .upload-panel,
    .meta-grid,
    .date-grid {
        grid-template-columns: 1fr;
    }

    .result-head {
        display: block;
    }

    .download-note {
        max-width: none;
        text-align: left;
        margin-top: 8px;
    }
}
