:root {
    color-scheme: light;
    --bg: #f3f1ec;
    --surface: #ffffff;
    --surface-soft: #ebe8e1;
    --ink: #191c1d;
    --muted: #656b6d;
    --line: #d4d1c9;
    --line-strong: #aaa79f;
    --header: #202426;
    --header-muted: #b8bec0;
    --teal: #0b756a;
    --teal-soft: #dcece8;
    --red: #b53a32;
    --red-soft: #f4dfdc;
    --amber: #b86d0a;
    --amber-soft: #f3e5ce;
    --blue: #246f9d;
    --blue-soft: #ddebf3;
    --shadow: 0 8px 24px rgba(25, 28, 29, 0.08);
    --content: 1180px;
}

* {
    box-sizing: border-box;
    letter-spacing: 0;
}

html {
    min-width: 320px;
    scroll-behavior: smooth;
    background: var(--bg);
}

body {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    color: var(--ink);
    background: var(--bg);
    font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif;
    font-size: 15px;
    line-height: 1.55;
}

button,
a,
input,
summary {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

button:focus-visible,
a:focus-visible,
summary:focus-visible {
    outline: 3px solid #58a9d3;
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    z-index: 100;
    top: 8px;
    left: 8px;
    padding: 10px 14px;
    color: #fff;
    background: var(--teal);
    border-radius: 4px;
    transform: translateY(-160%);
}

.skip-link:focus {
    transform: translateY(0);
}

.app-header {
    position: sticky;
    z-index: 20;
    top: 0;
    display: flex;
    min-height: 64px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 0 max(24px, calc((100vw - var(--content)) / 2));
    color: #fff;
    background: var(--header);
    border-bottom: 1px solid #383d3f;
}

.brand {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    color: #fff;
    background: var(--red);
    border: 1px solid #d06a62;
    border-radius: 4px;
    font-family: Consolas, monospace;
    font-size: 13px;
    font-weight: 800;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-copy strong {
    font-size: 15px;
}

.brand-copy small,
.header-state {
    color: var(--header-muted);
    font-size: 12px;
}

.header-state {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.header-state > span {
    width: 7px;
    height: 7px;
    background: #58b89f;
    border-radius: 50%;
}

.back-link {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    gap: 8px;
    color: #e4e7e8;
    font-size: 13px;
}

.back-link svg {
    width: 17px;
    height: 17px;
}

.page-shell,
.match-page {
    width: min(var(--content), calc(100% - 48px));
    margin: 0 auto;
}

.page-shell {
    padding: 42px 0 64px;
}

.match-page {
    padding: 24px 0 72px;
}

.page-command {
    display: flex;
    min-height: 108px;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--line-strong);
}

.eyebrow {
    margin: 0 0 5px;
    color: var(--teal);
    font-family: Consolas, "SFMono-Regular", monospace;
    font-size: 11px;
    font-weight: 700;
}

h1,
h2,
h3,
h4,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 7px;
    font-size: 46px;
    line-height: 1.08;
}

h2 {
    margin-bottom: 0;
    font-size: 22px;
    line-height: 1.25;
}

h3 {
    margin-bottom: 0;
    font-size: 18px;
}

h4 {
    margin-bottom: 5px;
    font-size: 15px;
}

.sync-line,
.muted-copy {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 13px;
}

.command-button {
    display: inline-flex;
    min-height: 44px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 0 17px;
    color: #fff;
    background: var(--teal);
    border: 1px solid #075e56;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(11, 117, 106, 0.18);
}

.command-button:hover:not(:disabled) {
    background: #08675e;
}

.command-button:disabled {
    cursor: wait;
    opacity: 0.58;
}

.command-button svg {
    width: 18px;
    height: 18px;
}

.operation-status {
    min-height: 30px;
    padding: 7px 0;
    color: var(--muted);
    font-size: 13px;
}

.operation-status:empty {
    visibility: hidden;
}

.operation-status[data-tone="success"] { color: var(--teal); }
.operation-status[data-tone="warning"] { color: var(--amber); }
.operation-status[data-tone="error"] { color: var(--red); }
.operation-status[data-tone="loading"] { color: var(--blue); }

.summary-strip,
.fact-strip,
.timeline-keyfacts {
    display: grid;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.summary-strip {
    grid-template-columns: repeat(4, 1fr);
    margin: 18px 0 34px;
}

.summary-strip > div,
.timeline-keyfacts > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
    padding: 15px 18px;
    border-right: 1px solid var(--line);
}

.summary-strip > div:last-child,
.timeline-keyfacts > div:last-child {
    border-right: 0;
}

.summary-strip span,
.fact-item span,
.timeline-keyfacts span {
    color: var(--muted);
    font-size: 11px;
}

.summary-strip strong {
    overflow: hidden;
    font-size: 18px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 14px;
}

.section-heading .eyebrow {
    margin-bottom: 3px;
}

.section-count,
.section-heading > span {
    color: var(--muted);
    font-family: Consolas, monospace;
    font-size: 12px;
}

.match-list-header,
.match-row {
    display: grid;
    grid-template-columns: minmax(220px, 2.1fr) 74px minmax(130px, 1.25fr) 78px 100px minmax(98px, 1fr) 24px;
    align-items: center;
    column-gap: 14px;
}

.match-list-header {
    padding: 8px 15px;
    color: var(--muted);
    font-size: 11px;
    border-top: 1px solid var(--line-strong);
    border-bottom: 1px solid var(--line);
}

.match-list {
    min-height: 180px;
    background: var(--surface);
    border-bottom: 1px solid var(--line-strong);
}

.match-row {
    position: relative;
    min-height: 78px;
    padding: 7px 15px;
    border-bottom: 1px solid var(--line);
    transition: background-color 140ms ease, transform 140ms ease;
}

.match-row:last-child {
    border-bottom: 0;
}

.match-row:hover {
    z-index: 1;
    background: #f7faf9;
    transform: translateX(2px);
}

.match-row[data-result="loss"] {
    box-shadow: inset 3px 0 0 var(--red);
}

.match-row[data-result="win"] {
    box-shadow: inset 3px 0 0 var(--teal);
}

.match-row > span:not(.match-hero-cell),
.match-row time {
    min-width: 0;
    color: #3f4547;
    font-size: 13px;
}

.match-hero-cell {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 13px;
}

.match-thumb {
    display: block;
    width: 96px;
    aspect-ratio: 16 / 9;
    flex: 0 0 auto;
    overflow: hidden;
    background: #d5d2ca;
    border-radius: 4px;
}

.match-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.match-thumb.image-missing::after,
.participant-image.image-missing::after,
.item-image.image-missing::after {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    color: #777;
    content: "—";
}

.match-hero-cell > span:last-child {
    min-width: 0;
}

.match-hero-cell strong,
.match-hero-cell small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.match-hero-cell strong {
    font-size: 15px;
}

.match-hero-cell small {
    color: var(--muted);
    font-family: Consolas, monospace;
    font-size: 11px;
}

.result-badge {
    display: inline-flex;
    width: fit-content;
    min-height: 25px;
    align-items: center;
    justify-content: center;
    padding: 2px 7px;
    border: 1px solid;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 800;
}

.result-badge.win { color: #075d55; background: var(--teal-soft); border-color: #93c8bd; }
.result-badge.loss { color: #8d2b25; background: var(--red-soft); border-color: #d8a39e; }
.result-badge.unknown { color: #6d5b3a; background: var(--amber-soft); border-color: #d9bb8d; }

.mono,
.kda-line,
.participant-kda,
.participant-net,
.event-time {
    font-family: Consolas, "SFMono-Regular", monospace;
}

.kda-line {
    display: inline-flex;
    gap: 4px;
}

.kda-line i {
    color: #a0a3a4;
    font-style: normal;
}

.kda-line .deaths {
    color: var(--red);
}

.row-arrow {
    width: 18px;
    height: 18px;
    color: #8a8f91;
}

.list-loading {
    display: grid;
    gap: 1px;
}

.list-loading span {
    display: block;
    height: 78px;
    background: #eeece7;
    animation: loading 1.3s ease-in-out infinite alternate;
}

.empty-state {
    display: grid;
    min-height: 220px;
    place-items: center;
    align-content: center;
    gap: 5px;
    color: var(--muted);
    text-align: center;
}

.empty-state svg {
    width: 28px;
    height: 28px;
    margin-bottom: 4px;
}

.empty-state strong {
    color: var(--ink);
}

.empty-state span {
    font-size: 13px;
}

.match-status {
    margin-bottom: 8px;
}

.match-hero-band {
    display: grid;
    grid-template-columns: 224px minmax(0, 1fr) auto;
    min-height: 156px;
    align-items: center;
    gap: 28px;
    padding: 20px 0 26px;
    border-bottom: 1px solid var(--line-strong);
}

.hero-portrait-wrap {
    width: 224px;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #d6d3cb;
    border-radius: 6px;
    box-shadow: var(--shadow);
}

.hero-portrait-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.portrait-placeholder {
    display: block;
    width: 100%;
    height: 100%;
    background: #cbc8c1;
}

.match-identity {
    min-width: 0;
}

.match-identity h1 {
    overflow-wrap: anywhere;
}

.match-identity-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px 16px;
    color: var(--muted);
    font-size: 13px;
}

.analyze-button {
    background: var(--blue);
    border-color: #1b5c82;
    box-shadow: 0 4px 12px rgba(36, 111, 157, 0.2);
}

.analyze-button:hover:not(:disabled) {
    background: #1c638f;
}

.fact-strip {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    margin: 20px 0 36px;
}

.fact-item {
    min-width: 0;
    padding: 14px 13px;
    border-right: 1px solid var(--line);
}

.fact-item:last-child {
    border-right: 0;
}

.fact-item strong {
    display: block;
    overflow: hidden;
    margin-top: 3px;
    font-family: Consolas, monospace;
    font-size: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fact-item.emphasis strong {
    color: var(--teal);
}

.detail-band,
.review-band {
    margin: 0 0 40px;
}

.lineup-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.team-lineup {
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.team-lineup > header,
.event-group > header {
    display: flex;
    min-height: 40px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
}

.team-lineup.radiant > header { box-shadow: inset 3px 0 0 var(--teal); }
.team-lineup.dire > header { box-shadow: inset 3px 0 0 var(--red); }

.team-lineup header span,
.event-group header h4 {
    margin: 0;
    font-weight: 800;
}

.team-lineup header small,
.event-group header span {
    color: var(--muted);
    font-size: 11px;
}

.participant {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) 82px 116px 66px;
    min-height: 55px;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-bottom: 1px solid #e5e2dc;
}

.participant:last-child {
    border-bottom: 0;
}

.participant.is-self {
    background: var(--blue-soft);
    box-shadow: inset 3px 0 0 var(--blue);
}

.participant-image {
    display: block;
    width: 72px;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #ddd9d2;
    border-radius: 3px;
}

.participant-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.participant-name {
    min-width: 0;
}

.participant-name strong,
.participant-name small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.participant-name strong {
    font-size: 13px;
}

.participant-name small {
    color: var(--muted);
    font-size: 10px;
}

.participant-kda,
.participant-stats,
.participant-net {
    color: #4b5052;
    font-size: 11px;
    text-align: right;
}

.participant-stats {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.participant-stats small {
    overflow: hidden;
    color: var(--muted);
    font: 9px Consolas, "SFMono-Regular", monospace;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.participant-kda b {
    color: var(--red);
}

.final-items {
    display: grid;
    grid-template-columns: repeat(6, minmax(120px, 1fr));
    gap: 10px;
}

.item-slot {
    display: flex;
    min-width: 0;
    min-height: 66px;
    align-items: center;
    gap: 9px;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 5px;
}

.item-image {
    display: block;
    width: 54px;
    aspect-ratio: 64 / 47;
    flex: 0 0 auto;
    overflow: hidden;
    background: #d9d6cf;
    border-radius: 3px;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-slot > span:last-child {
    min-width: 0;
}

.item-slot strong,
.item-slot small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-slot strong {
    font-size: 11px;
    white-space: normal;
}

.item-slot small {
    color: var(--muted);
    font-size: 9px;
    white-space: nowrap;
}

.review-output {
    margin-top: 54px;
    scroll-margin-top: 80px;
    border-top: 4px solid var(--header);
}

.review-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    padding: 24px 0 16px;
    border-bottom: 1px solid var(--line-strong);
}

.review-mode {
    padding: 4px 7px;
    color: #185b82;
    background: var(--blue-soft);
    border: 1px solid #9fc3d8;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 800;
}

.coach-conclusion {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 24px;
    margin: 20px 0 38px;
    padding: 20px;
    color: #fff;
    background: var(--header);
    border-left: 5px solid var(--amber);
    border-radius: 4px;
}

.coach-conclusion span {
    color: #e8bf83;
    font-size: 12px;
    font-weight: 800;
}

.coach-conclusion p {
    margin: 0;
    font-size: 17px;
    font-weight: 650;
}

.action-list {
    display: grid;
    gap: 10px;
}

.action-item {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 16px;
    padding: 17px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.action-index {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    color: #fff;
    background: var(--teal);
    border-radius: 4px;
    font-family: Consolas, monospace;
    font-weight: 800;
}

.action-item p {
    margin-bottom: 12px;
}

.action-item dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
}

.action-item dl > div {
    padding: 9px 11px;
    background: var(--surface-soft);
    border-left: 3px solid var(--line-strong);
}

.action-item dt {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
}

.action-item dd {
    margin: 3px 0 0;
    font-size: 12px;
}

.role-context-strip {
    display: grid;
    grid-template-columns: minmax(150px, 0.8fr) minmax(130px, 0.6fr) minmax(0, 2fr);
    gap: 1px;
    overflow: hidden;
    margin-bottom: 12px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: 5px;
}

.role-context-strip > div {
    min-width: 0;
    padding: 13px 14px;
    background: var(--surface);
}

.role-context-strip span,
.role-context-strip strong {
    display: block;
}

.role-context-strip span {
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
}

.role-context-strip strong {
    overflow-wrap: anywhere;
    font-size: 14px;
}

.role-context-strip ul {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 12px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 12px;
}

.role-context-strip li::before {
    color: var(--teal);
    content: "• ";
}

.performance-context-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 18px;
}

.formula-overall {
    display: grid;
    grid-template-columns: minmax(150px, 0.5fr) auto minmax(240px, 1.5fr);
    align-items: center;
    gap: 20px;
    min-height: 84px;
    margin-bottom: 14px;
    padding: 14px 18px;
    color: #f5f6f3;
    background: #252b2d;
    border-radius: 5px;
}

.formula-overall > span {
    font-size: 12px;
    font-weight: 800;
}

.formula-overall > strong {
    font: 30px Consolas, "SFMono-Regular", monospace;
}

.formula-overall > strong small {
    color: #aeb6b4;
    font-size: 12px;
}

.formula-overall p {
    margin: 0;
    color: #c8cdcb;
    font-size: 11px;
}

.formula-overall > code {
    grid-column: 1 / -1;
    max-width: 100%;
    padding-top: 8px;
    overflow-wrap: anywhere;
    color: #d9e8e2;
    border-top: 1px solid #485052;
    font: 10px Consolas, "SFMono-Regular", monospace;
    white-space: normal;
}

.formula-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.formula-card {
    min-width: 0;
    padding: 15px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: 4px solid var(--blue);
    border-radius: 5px;
}

.formula-card.status-strong { border-top-color: var(--teal); }
.formula-card.status-attention { border-top-color: var(--red); }

.formula-card > header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
}

.formula-card > header span,
.formula-card > header h4 {
    display: block;
}

.formula-card > header span {
    color: var(--muted);
    font: 9px Consolas, "SFMono-Regular", monospace;
    overflow-wrap: anywhere;
}

.formula-card > header h4 {
    margin: 3px 0 0;
}

.formula-card > header > strong {
    color: var(--ink);
    font: 24px Consolas, "SFMono-Regular", monospace;
    white-space: nowrap;
}

.formula-card > header > strong small {
    color: var(--muted);
    font-size: 9px;
}

.formula-card > p {
    min-height: 34px;
    margin: 9px 0;
    color: #4f5556;
    font-size: 11px;
}

.formula-card > code,
.finding-item details code {
    display: block;
    overflow-x: auto;
    padding: 8px 9px;
    color: #d9e8e2;
    background: #303739;
    border-radius: 3px;
    font: 10px Consolas, "SFMono-Regular", monospace;
    white-space: nowrap;
}

.formula-card > ul,
.finding-item details ul {
    display: grid;
    gap: 5px;
    margin: 10px 0;
    padding: 0;
    list-style: none;
}

.formula-card > ul li,
.finding-item details li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(95px, 0.8fr);
    gap: 8px;
    color: var(--muted);
    font-size: 9px;
}

.formula-card > ul strong,
.finding-item details li strong {
    color: var(--ink);
    font-family: Consolas, "SFMono-Regular", monospace;
}

.formula-card > footer {
    display: grid;
    gap: 3px;
    padding-top: 9px;
    color: var(--muted);
    border-top: 1px solid var(--line);
    font-size: 9px;
}

.formula-card > footer strong {
    color: var(--ink);
}

.unscored-list {
    margin-top: 12px;
    padding: 10px 12px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 4px;
    font-size: 11px;
}

.unscored-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-top: 7px;
}

.extended-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.extended-grid > section {
    min-width: 0;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 5px;
}

.extended-grid h4 {
    margin-bottom: 9px;
}

.extended-grid dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    margin: 0;
    background: var(--line);
}

.extended-grid dl > div {
    min-width: 0;
    padding: 9px;
    background: var(--surface);
}

.extended-grid dt {
    color: var(--muted);
    font-size: 9px;
}

.extended-grid dd {
    overflow-wrap: anywhere;
    margin: 3px 0 0;
    font: 13px Consolas, "SFMono-Regular", monospace;
}

.usage-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.usage-columns ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

.usage-columns li {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 5px 0;
    border-bottom: 1px solid var(--line);
    font-size: 10px;
}

.usage-columns li span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.performance-context-grid > section {
    min-width: 0;
    border-top: 3px solid var(--line-strong);
}

.performance-context-grid h4 {
    padding: 11px 0 8px;
}

.performance-context-grid dl {
    margin: 0;
}

.context-metric,
.benchmark-row {
    display: grid;
    align-items: baseline;
    gap: 8px;
    min-height: 45px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
}

.context-metric {
    grid-template-columns: minmax(100px, 0.7fr) minmax(0, 1.3fr);
}

.context-metric dt {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.context-metric dd {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    margin: 0;
}

.context-metric strong,
.benchmark-row strong {
    color: var(--ink);
    font-family: Consolas, "SFMono-Regular", monospace;
    font-size: 12px;
}

.context-metric small,
.benchmark-row small {
    color: var(--muted);
    font-size: 10px;
}

.benchmark-row {
    grid-template-columns: minmax(0, 1fr) auto minmax(70px, auto);
}

.benchmark-row > span {
    min-width: 0;
    font-size: 11px;
    font-weight: 700;
}

.benchmark-row.status-strong strong { color: var(--teal); }
.benchmark-row.status-weak strong { color: var(--red); }

.timeline-keyfacts {
    grid-template-columns: 160px 160px minmax(0, 1fr);
    margin-bottom: 12px;
}

.timeline-keyfacts strong {
    overflow-wrap: anywhere;
}

.phase-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: 5px;
}

.phase-cell {
    min-width: 0;
    padding: 14px;
    background: var(--surface);
}

.phase-cell span,
.phase-cell strong,
.phase-cell small {
    display: block;
}

.phase-cell span,
.phase-cell small {
    color: var(--muted);
    font-size: 11px;
}

.phase-cell strong {
    margin: 4px 0;
    font-family: Consolas, monospace;
}

.timeline-alerts {
    margin-top: 12px;
    padding: 12px 14px;
    background: var(--amber-soft);
    border: 1px solid #d9bd90;
    border-radius: 5px;
}

.timeline-alerts h4 {
    margin-bottom: 7px;
}

.timeline-alerts ul {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.timeline-alerts li {
    display: flex;
    align-items: center;
    gap: 8px;
}

.timeline-alerts svg {
    width: 17px;
    color: var(--amber);
}

.timeline-alerts span strong,
.timeline-alerts span small {
    display: block;
    font-size: 11px;
}

.timeline-impact-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 16px;
}

.timeline-impact-grid section {
    min-width: 0;
    border-top: 3px solid var(--blue);
}

.timeline-impact-grid section:last-child {
    border-top-color: var(--teal);
}

.timeline-impact-grid h4 {
    padding: 10px 0 7px;
}

.timeline-impact-grid ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

.timeline-impact-grid li {
    display: flex;
    min-height: 34px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid var(--line);
    font-size: 11px;
}

.timeline-impact-grid li span {
    color: var(--muted);
}

.timeline-impact-grid li strong {
    text-align: right;
}

.event-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 20px;
}

.event-columns.single-column {
    grid-template-columns: 1fr;
}

.event-group {
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.event-group ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

.event-group li {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid #e5e2dc;
}

.event-group li:last-child {
    border-bottom: 0;
}

.event-time {
    color: var(--teal);
    font-size: 11px;
    font-weight: 800;
}

.event-group li strong,
.event-group li small {
    display: block;
}

.event-group li strong {
    font-size: 12px;
}

.event-group li small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
}

.death-coordinate-panel {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    gap: 16px 22px;
    padding: 16px;
    background: #272b2d;
    color: #f4f1ea;
    border: 1px solid #3c4245;
    border-radius: 6px;
}

.death-coordinate-panel > header {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.death-coordinate-panel h4,
.death-coordinate-panel small {
    display: block;
    margin: 0;
}

.death-coordinate-panel h4 { font-size: 14px; }
.death-coordinate-panel small,
.death-coordinate-panel > header > span { color: #b9bec0; font-size: 11px; }

.death-coordinate-plot {
    width: 100%;
    max-width: 280px;
    aspect-ratio: 1;
    justify-self: center;
}

.death-coordinate-bg { fill: #151819; stroke: #596164; stroke-width: 1; }
.death-coordinate-axis { stroke: #454c4f; stroke-width: 1; }
.death-coordinate-ring { fill: rgba(230, 83, 60, 0.12); stroke: #e6533c; stroke-width: 2; stroke-dasharray: 5 4; }
.death-coordinate-dot { fill: #e6533c; stroke: #ffffff; stroke-width: 2; }
.death-coordinate-number { fill: #ffffff; font: 700 7px Consolas, monospace; text-anchor: middle; pointer-events: none; }

.death-coordinate-list {
    display: grid;
    align-content: start;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.death-coordinate-list li {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    min-height: 32px;
    padding: 5px 8px;
    background: #32383a;
    border-radius: 4px;
    font: 11px Consolas, "SFMono-Regular", monospace;
}

.death-coordinate-list b {
    display: grid;
    width: 22px;
    height: 22px;
    place-items: center;
    background: #e6533c;
    border-radius: 50%;
    color: #ffffff;
}

.finding-list {
    display: grid;
    gap: 10px;
}

.finding-item {
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-left-width: 5px;
    border-radius: 5px;
}

.finding-item.priority-high { border-left-color: var(--red); }
.finding-item.priority-medium { border-left-color: var(--amber); }
.finding-item.priority-low { border-left-color: var(--teal); }

.finding-item header {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.finding-item header span {
    color: var(--muted);
    font-size: 10px;
}

.finding-item header b {
    margin-left: auto;
    color: var(--blue);
    font: 13px Consolas, "SFMono-Regular", monospace;
}

.finding-item h4 {
    margin-bottom: 0;
}

.finding-item p {
    margin: 8px 0;
    color: #494e50;
    font-size: 13px;
}

.finding-item .finding-evidence {
    color: var(--ink);
    font-weight: 700;
}

.finding-item > div {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr);
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
    font-size: 12px;
}

.finding-item > div strong {
    color: var(--teal);
}

.finding-item details {
    margin-top: 10px;
    padding-top: 9px;
    border-top: 1px solid var(--line);
    font-size: 10px;
}

.finding-item details summary {
    margin-bottom: 7px;
    cursor: pointer;
    font-weight: 700;
}

.data-limits {
    margin-top: 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 5px;
}

.data-limits summary {
    display: flex;
    min-height: 48px;
    align-items: center;
    gap: 9px;
    padding: 8px 14px;
    cursor: pointer;
    font-weight: 700;
    list-style: none;
}

.data-limits summary::-webkit-details-marker {
    display: none;
}

.data-limits summary svg {
    width: 17px;
    color: var(--blue);
}

.data-limits summary strong {
    display: grid;
    min-width: 34px;
    height: 24px;
    margin-left: auto;
    padding: 0 5px;
    place-items: center;
    color: var(--muted);
    background: var(--surface-soft);
    border-radius: 3px;
    font-family: Consolas, monospace;
    font-size: 11px;
}

.data-limits > div {
    padding: 0 16px 16px;
    color: var(--muted);
    font-size: 12px;
}

.data-limits ul {
    margin: 0;
    padding-left: 18px;
}

.data-limits p {
    margin: 0;
}

.evidence-coverage h4,
.limitation-list h4 {
    margin: 0 0 8px;
    color: var(--ink);
}

.evidence-source-row {
    display: grid;
    grid-template-columns: minmax(145px, 0.8fr) minmax(0, 1.8fr) 44px;
    gap: 12px;
    align-items: center;
    min-height: 48px;
    padding: 7px 0;
    border-top: 1px solid var(--line);
}

.evidence-source-row > span:first-child strong,
.evidence-source-row > span:first-child small {
    display: block;
}

.evidence-source-row > span:first-child strong {
    color: var(--ink);
    font-size: 12px;
}

.evidence-source-row > span:first-child small {
    margin-top: 2px;
    font-size: 9px;
}

.evidence-source-row > span:nth-child(2) {
    overflow-wrap: anywhere;
}

.evidence-source-row b {
    color: var(--teal);
    font-size: 10px;
    text-align: right;
}

.evidence-source-row.status-partial b { color: #8a651f; }
.evidence-source-row.status-missing b { color: var(--red); }
.evidence-source-row.status-not_applicable b { color: var(--muted); }

.limitation-list {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 2px solid var(--line-strong);
}

.app-footer {
    display: flex;
    width: min(var(--content), calc(100% - 48px));
    min-height: 64px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 0 auto;
    color: var(--muted);
    border-top: 1px solid var(--line);
    font-size: 11px;
}

.spin {
    animation: spin 900ms linear infinite;
}

.pulse {
    animation: pulse 900ms ease-in-out infinite alternate;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { to { opacity: 0.45; } }
@keyframes loading { from { opacity: 0.65; } to { opacity: 1; } }

@media (max-width: 1020px) {
    .fact-strip {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .fact-item:nth-child(4) {
        border-right: 0;
    }

    .fact-item:nth-child(-n + 4) {
        border-bottom: 1px solid var(--line);
    }

    .final-items {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .match-list-header,
    .match-row {
        grid-template-columns: minmax(205px, 2fr) 68px minmax(120px, 1fr) 70px 92px 22px;
    }

    .match-list-header > span:nth-child(6),
    .match-row > span:nth-child(6) {
        display: none;
    }
}

@media (max-width: 820px) {
    .match-hero-band {
        grid-template-columns: 180px minmax(0, 1fr);
    }

    .hero-portrait-wrap {
        width: 180px;
    }

    .analyze-button {
        grid-column: 1 / -1;
        width: 100%;
    }

    .lineup-grid,
    .event-columns,
    .performance-context-grid {
        grid-template-columns: 1fr;
    }

    .death-coordinate-panel {
        grid-template-columns: 1fr;
    }

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

    .role-context-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .role-context-strip > div:last-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 720px) {
    .app-header {
        min-height: 58px;
        padding: 0 16px;
    }

    .header-state {
        display: none;
    }

    .brand-copy small {
        display: none;
    }

    .page-shell,
    .match-page,
    .app-footer {
        width: min(100% - 28px, var(--content));
    }

    .page-shell {
        padding-top: 28px;
    }

    .match-page {
        padding-top: 14px;
    }

    .page-command {
        min-height: 0;
        align-items: center;
        padding-bottom: 18px;
    }

    h1 {
        font-size: 30px;
    }

    .command-button {
        padding: 0 13px;
    }

    .summary-strip {
        grid-template-columns: repeat(2, 1fr);
        margin-bottom: 28px;
    }

    .summary-strip > div:nth-child(2) {
        border-right: 0;
    }

    .summary-strip > div:nth-child(-n + 2) {
        border-bottom: 1px solid var(--line);
    }

    .match-list-header {
        display: none;
    }

    .match-list {
        display: grid;
        gap: 10px;
        background: transparent;
        border: 0;
    }

    .match-row {
        grid-template-columns: minmax(0, 1fr) auto 18px;
        min-height: 118px;
        gap: 7px 12px;
        padding: 10px;
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: 6px;
        box-shadow: none;
    }

    .match-row[data-result="loss"] { border-left: 4px solid var(--red); box-shadow: none; }
    .match-row[data-result="win"] { border-left: 4px solid var(--teal); box-shadow: none; }

    .match-row:hover {
        transform: none;
    }

    .match-hero-cell {
        grid-column: 1 / 2;
        grid-row: 1 / 4;
        align-self: stretch;
    }

    .match-thumb {
        width: 94px;
    }

    .match-row .result-badge {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
    }

    .match-row time {
        grid-column: 2;
        grid-row: 2;
        justify-self: end;
        font-size: 11px;
    }

    .match-row > .mono {
        display: none;
    }

    .match-row .kda-line {
        grid-column: 2;
        grid-row: 3;
        justify-self: end;
        font-size: 12px;
    }

    .match-row > span:nth-child(6) {
        display: none;
    }

    .row-arrow {
        grid-column: 3;
        grid-row: 1 / 4;
        align-self: center;
    }

    .match-hero-band {
        grid-template-columns: 118px minmax(0, 1fr);
        gap: 14px;
        padding-top: 10px;
    }

    .hero-portrait-wrap {
        width: 118px;
    }

    .match-identity-meta {
        gap: 5px 9px;
        font-size: 11px;
    }

    .fact-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .fact-item:nth-child(2n) {
        border-right: 0;
    }

    .fact-item:nth-child(-n + 6) {
        border-bottom: 1px solid var(--line);
    }

    .participant {
        grid-template-columns: 62px minmax(0, 1fr) 82px;
    }

    .participant-image {
        width: 62px;
    }

    .participant-net {
        display: none;
    }

    .participant-stats {
        display: none;
    }

    .formula-overall {
        grid-template-columns: 1fr auto;
        gap: 8px 16px;
    }

    .formula-overall p {
        grid-column: 1 / -1;
    }

    .formula-grid,
    .extended-grid {
        grid-template-columns: 1fr;
    }

    .formula-card > ul li,
    .finding-item details li {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .formula-card > ul li small,
    .finding-item details li small {
        grid-column: 1 / -1;
    }

    .fact-item {
        border-bottom: 1px solid var(--line);
    }

    .fact-item:nth-last-child(-n + 2) {
        border-bottom: 0;
    }

    .final-items {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .coach-conclusion {
        grid-template-columns: 1fr;
        gap: 7px;
        padding: 16px;
    }

    .coach-conclusion p {
        font-size: 15px;
    }

    .action-item {
        grid-template-columns: 40px minmax(0, 1fr);
        gap: 11px;
        padding: 13px;
    }

    .action-index {
        width: 36px;
        height: 36px;
    }

    .action-item dl {
        grid-template-columns: 1fr;
    }

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

    .timeline-keyfacts > div:nth-child(2) {
        border-right: 0;
    }

    .timeline-keyfacts > div:last-child {
        grid-column: 1 / -1;
        border-top: 1px solid var(--line);
    }

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

    .timeline-impact-grid {
        grid-template-columns: 1fr;
    }

    .evidence-source-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .evidence-source-row > span:nth-child(2) {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .finding-item > div {
        grid-template-columns: 1fr;
    }

    .app-footer {
        flex-direction: column;
        justify-content: center;
        gap: 1px;
        text-align: center;
    }
}

@media (max-width: 430px) {
    .page-command {
        align-items: flex-start;
    }

    .command-button span {
        max-width: 92px;
        white-space: normal;
    }

    .match-thumb {
        width: 78px;
    }

    .match-hero-cell {
        gap: 9px;
    }

    .match-row time {
        max-width: 96px;
        text-align: right;
    }

    .final-items {
        grid-template-columns: 1fr;
    }

    .review-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
