html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

:root {
    color-scheme: dark;
    --ink: #e7edf5;
    --muted: #9aa6b5;
    --line: #29323e;
    --paper: #0c1015;
    --accent: #f1a675;
    --accent-dark: #e08b58;
}

/* Match the document canvas and native controls to the rendered layout. */
:root:has(.report-light) {
    color-scheme: light;
    --ink: #202a29;
    --muted: #77807d;
    --line: #e9e8e3;
    --paper: #f8f8f5;
    --accent: #b94f32;
    --accent-dark: #963b25;
}

html, body { min-height: 100%; background: var(--paper); color: var(--ink); }
body { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: inherit; }
h1, h2, p { margin-top: 0; }

.dashboard {
    width: min(920px, calc(100% - 48px));
    margin: 0 auto;
    padding: 62px 0 90px;
}

.welcome-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 38px; }
.eyebrow { margin-bottom: 11px; color: var(--accent); font-size: 13px; font-weight: 750; letter-spacing: 1.6px; }
.welcome-row h1, .report-hero h1 { margin-bottom: 11px; color: #1d2928; font-family: Georgia, "Times New Roman", serif; font-size: clamp(34px, 4vw, 44px); font-weight: 500; letter-spacing: -1.3px; }
.page-intro { margin-bottom: 0; color: var(--muted); font-size: 17px; }

.upload-card { padding: 27px 29px 25px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: 0 5px 20px rgba(30, 40, 37, .035); }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.section-heading .eyebrow { margin-bottom: 7px; }
.section-heading h2 { margin-bottom: 0; color: var(--ink); font-family: Georgia, "Times New Roman", serif; font-size: 26px; font-weight: 500; letter-spacing: -.3px; }
.file-hint, .report-count { color: #939995; font-size: 14px; }
.upload-dropzone { position: relative; display: flex; min-height: 140px; margin-top: 22px; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; border: 1px dashed #d7d7cf; border-radius: 9px; background: #fcfcfa; cursor: pointer; transition: background .15s, border-color .15s; }
.upload-dropzone:hover { border-color: #c37b65; background: #fdf9f6; }
.upload-dropzone input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload-icon { display: grid; width: 32px; height: 32px; margin-bottom: 9px; place-items: center; border-radius: 9px; background: #f6eae4; color: var(--accent); font-size: 22px; }
.dropzone-title { color: #39413f; font-size: 16px; font-weight: 650; }
.dropzone-subtitle { margin-top: 4px; color: #9a9e9b; font-size: 14px; }
.selected-file { display: flex; align-items: center; gap: 12px; margin-top: 17px; padding-top: 16px; border-top: 1px solid #f0efeb; }
.file-badge { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 8px; background: #eef1ed; color: #58665d; font-size: 11px; font-weight: 800; letter-spacing: .5px; }
.selected-file-name { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 3px; }
.selected-file-name strong { overflow: hidden; color: #3a4240; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.selected-file-name span { color: #939995; font-size: 13px; }
.button-primary { padding: 10px 15px; border: 0; border-radius: 7px; background: var(--accent); color: #fff; font-size: 14px; font-weight: 700; transition: background .15s; }
.button-primary:hover:not(:disabled) { background: var(--accent-dark); }
.button-primary:disabled { cursor: wait; opacity: .65; }
.notice { margin-top: 14px; padding: 11px 13px; border-radius: 7px; font-size: 15px; }
.notice-error { background: #fff1ed; color: #a23d2b; }
.notice-success { background: #edf5ef; color: #3c704c; }
.processing-status { display: flex; align-items: center; gap: 11px; margin-top: 18px; padding: 12px 14px; border-radius: 8px; background: #f7f4ee; }
.processing-status > div { display: flex; flex-direction: column; gap: 3px; }
.processing-status strong { color: #454d49; font-size: 14px; }
.processing-status span:last-child { color: #868e89; font-size: 13px; }
.status-pulse { width: 8px; height: 8px; border-radius: 50%; background: #c88145; box-shadow: 0 0 0 4px #f1e4d5; }

.reports-section { margin-top: 47px; }
.reports-heading { margin-bottom: 17px; }
.report-list { overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.report-row { display: flex; min-height: 76px; align-items: center; gap: 14px; padding: 12px 18px; color: inherit; text-decoration: none; transition: background .15s; }
.report-row + .report-row { border-top: 1px solid #f0efeb; }
.report-entry + .report-entry { border-top: 1px solid var(--line); }
.report-management { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 10px; padding: 0 18px 12px; color: var(--muted); font-size: 14px; }
.report-management button { padding: 7px 12px; border: 1px solid var(--line); border-radius: 7px; font-weight: 650; }
.report-management .button-secondary { background: transparent; color: var(--ink); }
.report-management .button-danger { background: #a23d2b; color: #fff; border-color: #a23d2b; }
.report-management button:disabled { cursor: wait; opacity: .65; }
.report-management button:hover:not(:disabled) { filter: brightness(.9); }
.report-row:hover { background: #fcfaf8; }
.report-file-icon { display: grid; width: 35px; height: 35px; flex: 0 0 35px; place-items: center; border-radius: 8px; background: #f7f0eb; color: #a8583c; font-size: 21px; }
.report-main { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 5px; }
.report-main strong { overflow: hidden; color: #343c3a; font-size: 15px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.report-main span { color: #969c98; font-size: 13px; }
.encounter-count { color: #8b928f; font-size: 13px; white-space: nowrap; }
.encounter-count strong { color: #4d5853; font-size: 15px; }
.report-arrow { margin-left: 8px; color: #a5aaa7; font-size: 18px; }
.empty-state { display: flex; min-height: 150px; flex-direction: column; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: #919894; font-size: 14px; text-align: center; }
.empty-state strong { color: #555e5a; font-size: 15px; }
.empty-icon { margin-bottom: 1px; color: #bb8c77; font-size: 24px; }
.empty-error { color: #a23d2b; }

.report-page { padding-top: 34px; }
.back-link { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 27px; color: #8a928e; font-size: 14px; text-decoration: none; }
.back-link:hover { color: var(--accent); }
.report-hero { padding: 29px 31px 26px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.report-actions { display: flex; justify-content: flex-end; margin: -4px 0 15px; }
.analysis-link { padding: 8px 11px; border: 1px solid #303945; border-radius: 7px; background: #17202a; color: #e8edf4; font-size: 13px; font-weight: 650; text-decoration: none; }
.analysis-link:hover { border-color: #b7734e; background: #211f1e; color: #f1a675; }
.report-hero h1 { overflow-wrap: anywhere; font-size: clamp(28px, 3vw, 36px); }
.report-dates { color: var(--muted); font-size: 15px; }
.report-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 26px; }
.stat-card { display: flex; min-height: 75px; flex-direction: column; justify-content: center; gap: 5px; padding: 12px 15px; border: 1px solid #efeee9; border-radius: 8px; background: #fcfcfa; }
.stat-card strong { color: #2f3936; font-family: Georgia, serif; font-size: 23px; font-weight: 500; }
.stat-card span { color: #8a928d; font-size: 13px; }
.encounters-section { margin-top: 36px; }
.encounter-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.encounter-table { width: 100%; border-collapse: collapse; font-size: 14px; white-space: nowrap; }
.encounter-table th { padding: 13px 16px; background: #fafaf8; color: #929995; font-size: 12px; font-weight: 700; letter-spacing: .8px; text-align: left; text-transform: uppercase; }
.encounter-table td { padding: 14px 16px; border-top: 1px solid #f0efeb; color: #737c77; }
.encounter-table td strong { color: #343d39; font-size: 14px; }
.encounter-table .damage-breakdown-row td { padding: 0; background: #fdfdfb; }
.damage-breakdown { padding: 13px 16px 16px; }
.damage-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.damage-heading > strong { color: #48514c; font-size: 13px; }
.damage-heading > span, .no-damage { color: #969c98; font-size: 13px; }
.no-damage { margin: 0; }
.actor-damage-table-wrap { overflow-x: auto; }
.actor-damage-table { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
.actor-damage-table th { padding: 7px 9px; color: #9a9f9b; font-size: 11px; font-weight: 700; letter-spacing: .6px; text-align: left; text-transform: uppercase; }
.actor-damage-table td { padding: 8px 9px; border-top: 1px solid #f0efeb; color: #7e8681; }
.actor-damage-table td strong { color: #424b46; font-size: 13px; }
.spell-breakdown-heading { margin: 16px 0 5px; }
.spell-id { margin-left: 5px; color: #a0a5a1; font-size: 12px; }
.timeline-breakdown { padding-top: 17px; }
.timeline-legend { display: flex; flex-wrap: wrap; gap: 13px; margin: 11px 0 3px; color: #858d88; font-size: 12px; }
.timeline-legend span { display: inline-flex; align-items: center; gap: 5px; }
.timeline-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.timeline-damage { background: #bd6045; }
.timeline-healing { background: #4e9471; }
.timeline-taken { background: #7485a0; }
.timeline-death { background: #392f31; }
.timeline-chart-wrap { overflow-x: auto; }
.timeline-chart { display: block; width: 100%; min-width: 500px; height: auto; overflow: visible; }
.timeline-gridline { stroke: #ecece7; stroke-width: 1; }
.timeline-line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.timeline-damage-line { stroke: #bd6045; }
.timeline-healing-line { stroke: #4e9471; }
.timeline-taken-line { stroke: #7485a0; }
.timeline-death-dot { fill: #392f31; stroke: #fff; stroke-width: 2; vector-effect: non-scaling-stroke; }
.timeline-axis-label { fill: #929995; font-size: 13px; }
.pull-badge, .result-badge { display: inline-block; padding: 4px 7px; border-radius: 5px; font-size: 12px; font-weight: 700; }
.pull-badge { background: #f1f1ed; color: #68716c; }
.result-win { background: #eaf3ec; color: #438057; }
.result-wipe { background: #fbefea; color: #b2563c; }
.result-unknown { background: #f0f1ef; color: #78807b; }

@media (max-width: 600px) {
    .dashboard { width: calc(100% - 32px); padding-top: 37px; }
    .welcome-row { margin-bottom: 27px; }
    .page-intro { max-width: 290px; line-height: 1.55; }
    .upload-card { padding: 20px 17px; }
    .file-hint { max-width: 90px; text-align: right; }
    .report-row { gap: 10px; padding-inline: 12px; }
    .encounter-count { display: none; }
    .report-stats { gap: 7px; }
    .stat-card { min-height: 68px; padding: 9px; }
    .stat-card strong { font-size: 18px; }
    .report-hero { padding: 22px 18px; }
}

.report-dark { --ink: #e7edf5; --muted: #9aa6b5; --line: #29323e; --paper: #0c1015; --accent: #f1a675; --accent-dark: #e08b58; color-scheme: dark; }
.report-dark .dashboard { color: #e7edf5; }
.report-dark .report-page { color: #e7edf5; }
.report-dark .report-hero,
.report-dark .encounter-table-wrap { border-color: #29323e; background: #141a22; }
.report-dark .report-list,
.report-dark .upload-card { border-color: #29323e; background: #141a22; }
.report-dark .section-heading h2,
.report-dark .welcome-row h1 { color: #f2f5f9; }
.report-dark .page-intro,
.report-dark .file-hint,
.report-dark .report-count { color: #98a4b1; }
.report-dark .upload-dropzone { border-color: #394655; background: #11171e; }
.report-dark .upload-dropzone:hover { border-color: #a76c49; background: #171b20; }
.report-dark .dropzone-title,
.report-dark .selected-file-name strong,
.report-dark .report-main strong { color: #dce5ee; }
.report-dark .dropzone-subtitle,
.report-dark .selected-file-name span,
.report-dark .report-main span { color: #929eac; }
.report-dark .selected-file,
.report-dark .report-row + .report-row { border-color: #252e39; }
.report-dark .report-row:hover { background: #19212b; }
.report-dark .report-file-icon { background: #29231f; color: #e5ad7f; }
.report-dark .encounter-count strong { color: #dce5ee; }
.report-dark .report-arrow { color: #8290a0; }
.report-dark .processing-status { background: #1c2229; }
.report-dark .processing-status strong { color: #dce5ee; }
.report-dark .processing-status span:last-child { color: #98a4b1; }
.report-dark .status-pulse { box-shadow: 0 0 0 4px #3a3025; }
.report-dark .notice-error { background: #38251f; color: #e29a79; }
.report-dark .notice-success { background: #193229; color: #80c7a2; }
.report-dark .report-hero h1,
.report-dark .section-heading h2 { color: #f2f5f9; }
.report-dark .report-metadata,
.report-dark .report-dates { color: #98a4b1; }
.report-dark .stat-card { border-color: #29323e; background: #11171e; }
.report-dark .stat-card strong { color: #e7edf5; }
.report-dark .stat-card span { color: #98a4b1; }
.report-dark .encounter-table th { background: #11171e; color: #8390a0; }
.report-dark .encounter-table td { border-color: #252e39; color: #adb7c4; }
.report-dark .encounter-table td strong { color: #e5ebf3; }
.report-dark .encounter-table .damage-breakdown-row td { background: #11171e; }
.report-dark .damage-heading > strong,
.report-dark .actor-damage-table td strong { color: #dce5ee; }
.report-dark .damage-heading > span,
.report-dark .no-damage,
.report-dark .actor-damage-table td { color: #98a4b1; }
.report-dark .actor-damage-table td,
.report-dark .actor-damage-table th { border-color: #252e39; }
.report-dark .actor-damage-table th { color: #8390a0; }
.report-dark .back-link { color: #9aa6b5; }
.report-dark .empty-state { border-color: #29323e; background: #141a22; color: #98a4b1; }
.report-dark .empty-state strong { color: #e7edf5; }
.report-dark .pull-badge { background: #252c35; color: #c1cad4; }
.report-dark .result-win { background: #193229; color: #80c7a2; }
.report-dark .result-wipe { background: #38251f; color: #e29a79; }
.report-dark .result-unknown { background: #252c35; color: #9aa6b5; }
.report-dark .spell-id,
.report-dark .timeline-legend,
.report-dark .timeline-axis-label { color: #98a4b1; fill: #98a4b1; }
.report-dark .timeline-gridline { stroke: #29323e; }
.report-dark .timeline-death-dot { stroke: #141a22; }
.report-dark .location-history { border-color: #29323e; background: #11171e; color: #adb7c4; }
