html,
body {
    margin: 0;
    min-height: 100%;
    background: #f7f8fa;
    color: #17191f;
    font-family: Inter, "Segoe UI", system-ui, sans-serif;
}

button,
input,
textarea {
    font: inherit;
}

button {
    border: 1px solid #17191f;
    background: #17191f;
    color: #fff;
    padding: 0.6rem 0.85rem;
    border-radius: 6px;
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.app-shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 2rem;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    border-bottom: 1px solid #d8dce3;
    padding-bottom: 1.25rem;
}

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

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 1.1rem;
    margin-bottom: 0.85rem;
}

.tagline {
    margin: 0.3rem 0 0;
    font-size: 1.1rem;
    color: #4b5565;
}

.short-note,
.muted {
    color: #687386;
}

.privacy-notice,
.analyze-surface,
.report-summary,
.narrative-cards,
.charts,
.comparison-table,
.lists,
.downloads,
.feedback-panel {
    margin-top: 1.25rem;
    padding: 1rem 0;
    border-bottom: 1px solid #e0e3e8;
}

.privacy-notice {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.privacy-notice p {
    margin: 0;
    padding-right: 1rem;
}

.upload-row,
.downloads {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.file-input {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    border: 1px dashed #929aaa;
    border-radius: 6px;
    padding: 0.75rem;
    background: #fff;
}

.selected-file {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.error-box {
    border-left: 4px solid #b91c1c;
    background: #fff1f1;
    padding: 0.85rem 1rem;
    margin-top: 1rem;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
}

.metric-grid div,
.durability-result,
.chart-panel {
    background: #fff;
    border: 1px solid #dfe3ea;
    border-radius: 6px;
    padding: 0.85rem;
}

.metric-grid span,
.durability-result span {
    display: block;
    color: #687386;
    font-size: 0.86rem;
}

.metric-grid strong,
.durability-result strong {
    display: block;
    margin-top: 0.25rem;
    font-size: 1.15rem;
}

.durability-result {
    margin-top: 1rem;
}

.unavailable {
    border-color: #d6b24d;
}

.narrative-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.narrative-card {
    background: #fff;
    border: 1px solid #dfe3ea;
    border-radius: 6px;
    padding: 0.95rem;
}

.narrative-card p {
    margin: 0;
}

.narrative-card ul {
    margin: 0;
    padding-left: 1.1rem;
}

.narrative-card-wide {
    grid-column: 1 / -1;
}

.charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
}

.chart-title {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.chart-empty {
    min-height: 180px;
    display: grid;
    place-items: center;
    color: #687386;
}

.time-chart {
    width: 100%;
    height: auto;
}

.time-chart line {
    stroke: #c9ced8;
}

.time-chart polyline {
    fill: none;
    stroke: #1f766f;
    stroke-width: 2.25;
}

.time-chart text {
    fill: #687386;
    font-size: 13px;
}

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

th,
td {
    text-align: left;
    padding: 0.65rem;
    border-bottom: 1px solid #e0e3e8;
}

textarea,
input[type="email"] {
    width: min(100%, 680px);
    display: block;
    margin-bottom: 0.7rem;
    border: 1px solid #c9ced8;
    border-radius: 6px;
    padding: 0.65rem;
}

.feedback-panel label {
    display: block;
    margin-bottom: 0.4rem;
}

#blazor-error-ui {
    background: #fff3cd;
    bottom: 0;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto;
}

.loading-progress circle {
    fill: none;
    stroke: #d0d5dd;
    stroke-width: 0.6rem;
}

.loading-progress circle:last-child {
    stroke: #1f766f;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    inset: calc(20vh + 3.25rem) 0 auto 0;
}

.loading-progress-text:after {
    content: "Loading";
}

@media (max-width: 720px) {
    .app-shell {
        padding: 1rem;
    }

    .privacy-notice {
        grid-template-columns: 1fr;
    }

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