:root {
    --bg: #f5f8fc;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --border: #dfe7f1;
    --text: #14213d;
    --muted: #64748b;
    --navy: #172554;
    --blue: #1d4ed8;
    --blue-soft: #eaf1ff;
    --track: #c2410c;
    --track-2: #ea580c;
    --track-soft: #fff1e8;
    --green: #15803d;
    --green-soft: #eaf8ef;
    --yellow: #d6a600;
    --yellow-soft: #fff9d9;
    --red: #ce1126;
    --red-soft: #fff0f2;
    --shadow: 0 12px 32px rgba(30, 41, 59, .07);
    --radius: 18px;
    --radius-sm: 12px;
    --sidebar: 254px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; display: block; }

.ro-stripe {
    position: fixed;
    z-index: 200;
    inset: 0 0 auto 0;
    height: 4px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}
.ro-stripe span:nth-child(1) { background: #002b7f; }
.ro-stripe span:nth-child(2) { background: #fcd116; }
.ro-stripe span:nth-child(3) { background: #ce1126; }

.app-shell { min-height: 100vh; }
.sidebar { display: none; }
.main-content { padding: 74px 14px 96px; max-width: 1500px; margin: 0 auto; width: 100%; }
.mobile-header {
    position: fixed;
    z-index: 100;
    top: 4px;
    left: 0;
    right: 0;
    height: 58px;
    padding: 7px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
}
.mobile-brand img { width: 190px; height: 44px; object-fit: contain; object-position: left center; }
.mobile-live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px var(--green-soft); }

.bottom-nav {
    position: fixed;
    z-index: 120;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    min-height: 72px;
    background: rgba(255, 255, 255, .98);
    border-top: 1px solid var(--border);
    box-shadow: 0 -10px 30px rgba(15, 23, 42, .07);
}
.bottom-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #64748b; font-weight: 700; min-width: 0; }
.bottom-item > span { font-size: 22px; line-height: 1; }
.bottom-item small { font-size: 10px; white-space: nowrap; }
.bottom-item.active { color: var(--blue); }
.bottom-item.capture > span { width: 43px; height: 43px; margin-top: -17px; display: grid; place-items: center; color: white; background: var(--track); border-radius: 50%; border: 4px solid #fff; box-shadow: 0 7px 18px rgba(194, 65, 12, .25); }
.bottom-item.capture small { color: var(--track); }

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 6px; font-size: clamp(1.55rem, 5vw, 2.35rem); line-height: 1.06; letter-spacing: -.035em; color: var(--navy); }
h2 { margin-bottom: 5px; font-size: 1.08rem; line-height: 1.2; color: var(--navy); }
h3 { margin-bottom: 5px; color: var(--navy); }
p { color: var(--muted); line-height: 1.55; }
.eyebrow { display: inline-block; margin-bottom: 8px; color: var(--blue); font-size: .69rem; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }

.page-head { display: flex; flex-direction: column; gap: 16px; margin: 4px 0 20px; }
.page-head p { margin-bottom: 0; max-width: 760px; }
.page-head.compact { margin-bottom: 18px; }
.head-actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }

.btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 15px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-weight: 800;
    font-size: .88rem;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn.primary { color: #fff; background: var(--blue); box-shadow: 0 7px 18px rgba(29, 78, 216, .18); }
.btn.secondary { color: var(--blue); background: var(--blue-soft); border-color: #cfddff; }
.btn.track { color: #fff; background: linear-gradient(135deg, var(--track), var(--track-2)); box-shadow: 0 7px 18px rgba(194, 65, 12, .2); }
.btn.ghost { color: var(--text); background: #fff; border-color: var(--border); }
.btn.danger { color: var(--red); background: var(--red-soft); border-color: #ffd3d9; }
.btn.full { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.icon-button { border: 0; background: transparent; width: 36px; height: 36px; border-radius: 9px; cursor: pointer; color: var(--muted); }

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
}
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.panel-head p { margin: 0; font-size: .84rem; }
.panel-head > a { color: var(--blue); font-weight: 800; font-size: .82rem; }
.dashboard-grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 16px; }

.metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin: 0 0 16px; }
.metric-card { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: 15px; padding: 14px; min-height: 114px; box-shadow: 0 8px 24px rgba(15,23,42,.045); }
.metric-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: #cbd5e1; }
.metric-card.accent-blue::before { background: var(--blue); }
.metric-card.accent-red::before { background: var(--track); }
.metric-card.accent-green::before { background: var(--green); }
.metric-card.accent-yellow::before { background: #eab308; }
.metric-card > span { display: block; color: var(--muted); font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.metric-card strong { display: block; margin: 7px 0 1px; font-size: 1.82rem; line-height: 1; color: var(--navy); }
.metric-card small { color: var(--muted); font-size: .72rem; }

.quick-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 9px; }
.quick-grid a { min-height: 88px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-soft); }
.quick-grid a span { font-size: 1.6rem; color: var(--track); }
.quick-grid a b { color: var(--navy); font-size: .74rem; letter-spacing: .03em; }

.empty-state { min-height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; padding: 24px; text-align: center; color: var(--muted); background: linear-gradient(180deg,#fff,#f9fbfd); border-radius: 13px; }
.empty-state strong { color: var(--navy); }
.empty-state.compact { min-height: 105px; }

.list-rows { display: grid; gap: 8px; }
.list-row { display: flex; flex-direction: column; gap: 8px; padding: 11px 0; border-bottom: 1px solid #edf2f7; }
.list-row:last-child { border-bottom: 0; }
.list-row > div:first-child { display: flex; flex-direction: column; gap: 2px; }
.list-row span, .list-row time { color: var(--muted); font-size: .78rem; }
.row-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.status-pill { display: inline-flex; width: fit-content; align-items: center; padding: 4px 8px; border-radius: 999px; background: #eef2f7; color: #475569 !important; font-size: .68rem !important; font-weight: 900; letter-spacing: .03em; }
.status-completed { background: var(--green-soft); color: var(--green)!important; }
.status-processing { background: var(--blue-soft); color: var(--blue)!important; }
.status-queued { background: var(--yellow-soft); color: #8a6900!important; }
.status-failed { background: var(--red-soft); color: var(--red)!important; }

.bar-chart { height: 260px; display: flex; align-items: flex-end; gap: 8px; padding: 28px 4px 4px; overflow-x: auto; }
.bar-col { flex: 1 0 44px; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 5px; min-width: 44px; }
.bar { width: min(30px,70%); min-height: 4px; border-radius: 8px 8px 2px 2px; background: linear-gradient(180deg,var(--track-2),var(--track)); }
.bar-value { font-size: .66rem; color: var(--muted); white-space: nowrap; }
.bar-col small { color: var(--muted); }

.athlete-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.athlete-card { display: grid; grid-template-columns: auto 1fr; gap: 11px; align-items: center; background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 13px; box-shadow: 0 8px 22px rgba(15,23,42,.04); }
.athlete-avatar { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; font-weight: 900; color: var(--blue); background: linear-gradient(145deg,#edf4ff,#fff); border: 2px solid #d8e5ff; }
.athlete-avatar.large { width: 74px; height: 74px; font-size: 1.25rem; }
.athlete-avatar.small { width: 42px; height: 42px; font-size: .8rem; }
.athlete-main { min-width: 0; }
.athlete-main h2 { margin: 0 0 2px; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.athlete-main p { margin: 0 0 2px; font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.athlete-main small { color: var(--muted); font-size: .7rem; }
.athlete-state { grid-column: 2; font-size: .72rem; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; }
.dot.online { background: var(--green); }
.dot.offline { background: #94a3b8; }

.athlete-hero { display: grid; grid-template-columns: auto 1fr; gap: 13px; align-items: center; margin-bottom: 14px; background: linear-gradient(135deg,#fff,#f5f9ff); border: 1px solid var(--border); border-radius: var(--radius); padding: 15px; box-shadow: var(--shadow); }
.athlete-hero-copy { min-width: 0; }
.athlete-hero-copy h1 { font-size: 1.45rem; }
.athlete-hero-copy p { margin: 0 0 7px; font-size: .8rem; }
.athlete-hero .head-actions { grid-column: 1/-1; }
.inline-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 999px; background: #eef2f7; color: var(--muted); font-size: .66rem; font-weight: 800; }
.badge.live-ready { background: var(--green-soft); color: var(--green); }
.badge.live-ready i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.profile-metrics { display: grid; grid-template-columns: repeat(2,1fr); gap: 9px; margin-bottom: 13px; }
.profile-metrics article { padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.profile-metrics span, .profile-metrics small { display: block; color: var(--muted); font-size: .68rem; }
.profile-metrics strong { display: block; margin: 4px 0 2px; color: var(--navy); font-size: 1.05rem; }
.profile-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 9px; margin-bottom: 8px; scrollbar-width: thin; }
.profile-tab { flex: 0 0 auto; border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 8px 11px; color: var(--muted); font-size: .74rem; font-weight: 800; cursor: pointer; }
.profile-tab.active { color: #fff; background: var(--blue); border-color: var(--blue); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.danger-zone { margin-top: 18px; padding: 14px; border-top: 1px solid var(--border); }

label { display: flex; flex-direction: column; gap: 6px; color: #334155; font-size: .79rem; font-weight: 800; }
input, select, textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 11px;
    color: var(--text);
    background: #fff;
    border: 1px solid #cfd9e7;
    border-radius: 10px;
    outline: none;
    transition: border .15s ease, box-shadow .15s ease;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus { border-color: #89aaf5; box-shadow: 0 0 0 3px rgba(29,78,216,.1); }
.stack-form { display: grid; gap: 12px; }
.form-panel { max-width: 980px; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
.event-fieldset { margin: 18px 0; border: 1px solid var(--border); border-radius: 14px; padding: 13px; }
.event-fieldset legend { padding: 0 7px; color: var(--navy); font-weight: 900; }
.check-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.check-pill { position: relative; display: inline-flex; width: auto; }
.check-pill input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.check-pill span { display: inline-flex; min-height: 38px; align-items: center; padding: 8px 11px; border: 1px solid var(--border); border-radius: 999px; background: #fff; color: var(--muted); font-size: .73rem; font-weight: 800; cursor: pointer; }
.check-pill input:checked + span { color: var(--blue); background: var(--blue-soft); border-color: #a9c0f8; }

.toast, .form-alert { border-radius: 12px; padding: 11px 13px; margin-bottom: 12px; font-size: .82rem; line-height: 1.5; }
.toast.success { background: var(--green-soft); color: #126331; border: 1px solid #bde6ca; }
.toast.error, .form-alert.error { background: var(--red-soft); color: #a10f23; border: 1px solid #ffd0d6; }
.form-alert.info { background: var(--blue-soft); color: #21489b; border: 1px solid #cfddff; }

.responsive-table { width: 100%; overflow-x: auto; border-radius: 12px; }
table { width: 100%; border-collapse: collapse; min-width: 650px; }
th, td { padding: 10px 9px; text-align: left; border-bottom: 1px solid #e8eef5; vertical-align: middle; }
th { color: #64748b; font-size: .67rem; text-transform: uppercase; letter-spacing: .06em; background: #f8fafc; }
td { font-size: .78rem; color: #334155; }
td small { color: var(--muted); }
.catalog-note { margin: 12px 0; display: flex; flex-wrap: wrap; gap: 7px; align-items: center; color: var(--muted); font-size: .78rem; }
.catalog-note span { padding: 5px 8px; border-radius: 999px; background: #fff; border: 1px solid var(--border); }

.upload-panel { margin-bottom: 14px; border-top: 4px solid var(--track); }
.upload-copy { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.upload-copy h2 { margin-bottom: 4px; }
.upload-copy p { margin: 0; font-size: .8rem; }
.upload-icon { flex: 0 0 auto; width: 44px; height: 44px; display: grid; place-items: center; color: #fff; background: var(--track); border-radius: 50%; box-shadow: 0 5px 13px rgba(194,65,12,.2); }
.upload-controls { display: grid; gap: 12px; }
.camera-buttons { display: grid; gap: 8px; }
.file-button { cursor: pointer; }
.upload-status { margin-top: 16px; padding: 12px; border-radius: 12px; background: #f8fafc; border: 1px solid var(--border); }
.progress-track { height: 9px; overflow: hidden; border-radius: 999px; background: #e7edf5; }
.progress-bar { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--blue),var(--track)); transition: width .15s ease; }
.progress-copy { display: flex; justify-content: space-between; gap: 8px; margin-top: 7px; font-size: .75rem; }
.progress-copy span { color: var(--muted); text-align: right; }
.upload-result { margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--green-soft); color: #126331; }

.analysis-grid { display: grid; grid-template-columns: 1fr; gap: 11px; }
.analysis-card { border: 1px solid var(--border); border-radius: 15px; padding: 13px; background: #fff; }
.analysis-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.analysis-top h2 { margin-bottom: 2px; }
.analysis-top p { margin: 0; font-size: .75rem; overflow-wrap: anywhere; }
.analysis-stats { display: grid; grid-template-columns: repeat(2,1fr); gap: 7px; margin-top: 12px; }
.analysis-stats > div { padding: 9px; border-radius: 10px; background: #f8fafc; }
.analysis-stats span { display: block; color: var(--muted); font-size: .66rem; }
.analysis-stats strong { display: block; margin-top: 3px; color: var(--navy); }
.quality-warning { margin-top: 9px; padding: 9px; border-radius: 9px; color: #8a5a00; background: var(--yellow-soft); font-size: .76rem; font-weight: 800; }

.provider-state { display: inline-flex; align-items: center; width: fit-content; padding: 7px 10px; border-radius: 999px; font-size: .68rem; font-weight: 900; }
.provider-state.pending { background: var(--yellow-soft); color: #846500; }
.provider-state.configured { background: var(--green-soft); color: var(--green); }
.integration-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 14px 0; }
.integration-flow span { padding: 8px 10px; border: 1px solid #cbd8ea; background: #f8fafc; border-radius: 9px; color: var(--navy); font-size: .72rem; font-weight: 800; }
.integration-flow i { color: var(--track); font-style: normal; font-weight: 900; }
.integration-flow.vertical { flex-direction: column; align-items: stretch; text-align: center; }
.integration-flow.vertical i { text-align: center; }
.source-note { margin: 9px 0 0; padding: 10px 12px; border-left: 3px solid var(--blue); background: #f8fbff; border-radius: 0 9px 9px 0; color: var(--muted); font-size: .75rem; }
.device-model-card { display: grid; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.device-model-card:last-child { border-bottom: 0; }
.device-model-card p { margin: 0; font-size: .78rem; }
.capability-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.cap { display: inline-flex; flex-direction: column; gap: 1px; padding: 6px 8px; border-radius: 9px; background: #f1f5f9; color: var(--muted); font-size: .62rem; }
.cap b { font-size: .68rem; color: #334155; text-transform: capitalize; }
.cap-yes { background: var(--green-soft); color: var(--green); }
.cap-no { background: var(--red-soft); color: var(--red); }
.cap-phone_required, .cap-sdk_required { background: var(--blue-soft); color: var(--blue); }

.live-master { display: inline-flex; align-items: center; gap: 7px; width: fit-content; padding: 8px 11px; border-radius: 999px; background: var(--red-soft); color: var(--red); font-size: .72rem; font-weight: 900; }
.live-master i { width: 7px; height: 7px; border-radius: 50%; background: var(--red); animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.45;transform:scale(.7)} }
.live-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.live-athlete { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 13px; box-shadow: 0 8px 24px rgba(15,23,42,.04); }
.live-athlete-head { display: flex; gap: 9px; align-items: center; }
.live-athlete-head h2 { margin-bottom: 2px; font-size: .96rem; }
.connection-state { font-size: .64rem; font-weight: 900; }
.connection-state.offline { color: #94a3b8; }
.connection-state.online { color: var(--green); }
.live-values { display: grid; grid-template-columns: repeat(2,1fr); gap: 6px; margin: 12px 0 9px; }
.live-values > div { padding: 9px; border-radius: 10px; background: #f8fafc; }
.live-values span, .live-values small { display: block; color: var(--muted); font-size: .6rem; }
.live-values strong { display: inline-block; margin: 2px 3px 1px 0; color: var(--navy); font-size: 1.06rem; }
.unavailable-live { padding: 8px 9px; border-radius: 9px; color: #64748b; background: #f1f5f9; font-size: .67rem; }
.mini-chart { height: 55px; margin-top: 8px; border-radius: 9px; background: linear-gradient(180deg,#fbfdff,#f5f8fc); overflow: hidden; }
.live-athlete footer { margin-top: 7px; color: var(--muted); font-size: .65rem; }

.comparison-tool { display: grid; gap: 15px; }
.compare-selector { display: flex; flex-direction: column; gap: 10px; }
.compare-selector p { margin: 0; font-size: .8rem; }
.check-grid.athletes { max-height: 260px; overflow-y: auto; }
.compare-message { padding: 12px; border-radius: 10px; background: #f8fafc; color: var(--muted); font-size: .78rem; }
.compare-chart { width: 100%; height: auto; max-height: 320px; margin-top: 14px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }

.report-builder { max-width: 1000px; }
.form-grid.report { align-items: end; }
.report-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.auth-page { background: #f8fafc; min-height: 100vh; }
.auth-wrap { position: relative; min-height: 100vh; display: grid; place-items: center; padding: 28px 15px; overflow: hidden; }
.auth-card { position: relative; z-index: 2; width: min(100%,460px); background: rgba(255,255,255,.97); border: 1px solid var(--border); border-radius: 24px; padding: 20px; box-shadow: 0 30px 80px rgba(30,41,59,.13); }
.auth-logo { width: 250px; margin: 0 auto 15px; }
.auth-heading { text-align: center; }
.auth-heading h1 { font-size: 1.55rem; }
.auth-heading p { font-size: .8rem; }
.auth-note { margin: 14px 0 0; text-align: center; font-size: .67rem; }
.track-art { position: absolute; inset: 0; opacity: .14; transform: rotate(-13deg) scale(1.4); }
.lane { position: absolute; border: 6px solid var(--track); border-radius: 50%; width: 760px; height: 340px; left: 50%; top: 50%; transform: translate(-50%,-50%); }
.lane-2 { width: 680px; height: 280px; }
.lane-3 { width: 600px; height: 220px; }
.lane-4 { width: 520px; height: 160px; }

.error-page { min-height: 65vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.error-page > strong { font-size: 5rem; color: #dbe5f2; line-height: 1; }
.error-page p { max-width: 450px; }

@media (min-width: 620px) {
    .main-content { padding-left: 20px; padding-right: 20px; }
    .metric-grid { grid-template-columns: repeat(4,1fr); }
    .athlete-grid { grid-template-columns: repeat(2,1fr); }
    .form-grid.two { grid-template-columns: repeat(2,1fr); }
    .camera-buttons { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .analysis-grid { grid-template-columns: repeat(2,1fr); }
    .live-grid { grid-template-columns: repeat(2,1fr); }
    .profile-metrics { grid-template-columns: repeat(3,1fr); }
    .list-row { flex-direction: row; align-items: center; justify-content: space-between; }
    .row-meta { justify-content: flex-end; }
    .form-grid.report { grid-template-columns: 2fr 1fr 1fr; }
    .report-actions { grid-column: 1/-1; }
}

@media (min-width: 900px) {
    .app-shell { display: grid; grid-template-columns: var(--sidebar) minmax(0,1fr); }
    .sidebar {
        position: fixed;
        z-index: 80;
        top: 4px;
        bottom: 0;
        left: 0;
        width: var(--sidebar);
        display: flex;
        flex-direction: column;
        background: #fff;
        border-right: 1px solid var(--border);
        padding: 14px 12px 12px;
    }
    .brand { display: block; padding: 3px 5px 12px; }
    .brand img { width: 218px; }
    .nav-list { flex: 1; overflow-y: auto; display: grid; align-content: start; gap: 3px; padding-top: 6px; }
    .nav-item { min-height: 42px; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: #526078; font-size: .8rem; font-weight: 750; }
    .nav-item:hover { background: #f8fafc; color: var(--navy); }
    .nav-item.active { background: var(--blue-soft); color: var(--blue); }
    .nav-icon { width: 24px; text-align: center; font-size: 1rem; }
    .sidebar-user { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; border-top: 1px solid var(--border); padding: 12px 5px 0; }
    .sidebar-user .avatar { width: 35px; height: 35px; font-size: .67rem; }
    .user-copy { min-width: 0; }
    .user-copy strong, .user-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .user-copy strong { font-size: .72rem; }
    .user-copy small { color: var(--muted); font-size: .62rem; }
    .main-content { grid-column: 2; max-width: none; padding: 30px 28px 50px; }
    .mobile-header, .bottom-nav { display: none; }
    .page-head { flex-direction: row; align-items: flex-end; justify-content: space-between; margin-top: 0; }
    .metric-grid { grid-template-columns: repeat(7, minmax(0,1fr)); }
    .metric-card { min-height: 120px; }
    .dashboard-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .dashboard-grid .wide { grid-column: span 2; }
    .panel { padding: 18px; }
    .athlete-grid { grid-template-columns: repeat(3,1fr); }
    .athlete-card { grid-template-columns: auto 1fr auto; }
    .athlete-state { grid-column: auto; }
    .athlete-hero { grid-template-columns: auto 1fr auto; padding: 20px; }
    .athlete-hero .head-actions { grid-column: auto; }
    .profile-metrics { grid-template-columns: repeat(6,1fr); }
    .device-model-card { grid-template-columns: 1.1fr 2fr; align-items: start; }
    .live-grid { grid-template-columns: repeat(3,1fr); }
    .compare-selector { flex-direction: row; align-items: center; justify-content: space-between; }
    .analysis-grid { grid-template-columns: repeat(3,1fr); }
    .form-grid.report { grid-template-columns: 2fr 1fr 1fr auto; }
    .report-actions { grid-column: auto; }
}

@media (min-width: 1280px) {
    .athlete-grid { grid-template-columns: repeat(4,1fr); }
    .live-grid { grid-template-columns: repeat(4,1fr); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto!important; transition: none!important; animation: none!important; }
}

/* ATLETISM-AI — logo oficial */
.brand img,
.mobile-brand img,
.auth-logo {
    object-fit: contain;
    object-position: center;
    max-width: 100%;
    height: auto;
}

.brand img {
    width: 220px;
    max-height: 82px;
}

.mobile-brand img {
    width: 180px;
    max-height: 54px;
}

.auth-logo {
    display: block;
    width: min(320px, 82vw);
    max-height: 180px;
    margin: 0 auto 22px;
}

/* ATLETISM-AI video AI actions v1 */
.video-actions{display:flex;gap:.45rem;align-items:center;flex-wrap:wrap}.video-actions form{margin:0}.btn.small{padding:.5rem .7rem;font-size:.82rem}.head-actions form{margin:0}

/* athlete-event-analysis-v2 */
.event-category-block{margin:1rem 0;padding:1rem;border:1px solid #e2e8f0;border-radius:16px;background:#fbfdff}.event-category-block h3{margin:0 0 .75rem;color:#183b65}.event-choice{display:flex;align-items:center;gap:.4rem;flex-wrap:wrap}.primary-event-radio{font-size:.76rem;color:#64748b;display:flex;align-items:center;gap:.25rem}.profile-video-event{display:grid;gap:.35rem;min-width:220px}.event-analysis-form{display:flex;gap:.5rem;flex-wrap:wrap;align-items:center}.event-analysis-form select{min-width:220px}.phase-timeline{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:.75rem}.phase-timeline article{padding:1rem;border-radius:14px;background:#f8fafc;border-left:4px solid #2563eb;display:grid;gap:.3rem}.phase-timeline span,.phase-timeline small{color:#64748b}.finding-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:.85rem}.finding-card{padding:1rem;border:1px solid #e2e8f0;border-radius:16px;background:#fff}.finding-card h3{margin:.65rem 0 .4rem}.finding-head{display:flex;justify-content:space-between;gap:.5rem}.finding-possible_deviation{border-left:4px solid #d97706}.finding-quality_limitation{border-left:4px solid #dc2626}.finding-observation{border-left:4px solid #2563eb}.finding-strength{border-left:4px solid #059669}.recommendation{margin-top:.75rem;padding:.65rem;border-radius:10px;background:#f8fafc}.technique-chart{display:block;width:100%;height:360px}.capture-details summary{font-weight:800;cursor:pointer}.profile-metrics.compact{margin-top:1rem}.compare-filters{margin-bottom:1rem}.report-chart-grid{display:grid;grid-template-columns:1fr;gap:1rem;margin:1rem 0}.report-chart-card{border:1px solid #e2e8f0;border-radius:16px;padding:1rem;background:#fff}.report-chart-card h3{margin:0 0 .25rem}.report-chart-card p{margin:0 0 .75rem;color:#64748b}
@media(max-width:720px){.event-analysis-form{width:100%}.event-analysis-form select,.event-analysis-form button{width:100%}.technique-chart{height:300px}.event-choice{align-items:flex-start;flex-direction:column}}
/* BEGIN ATLETISM-AI UNIFIED PROFILE V1 */
/* ATLETISM-AI — profil unificat / rapoarte grafice */
.athlete-profile-unified { margin-bottom: 14px; }
.athlete-profile-unified .athlete-hero { margin-bottom: 9px; }
.athlete-profile-unified.compact .athlete-hero { padding: 13px; box-shadow: none; }
.athlete-profile-unified.compact .athlete-avatar.large { width: 56px; height: 56px; font-size: 1rem; }
.athlete-profile-unified.compact .athlete-hero-copy h1 { font-size: 1.08rem; }
.athlete-profile-unified.compact .profile-metrics { margin-bottom: 0; }
.profile-context-note { margin-top: 8px; color: var(--muted); font-size: .72rem; }
.profile-metrics.unified { grid-template-columns: repeat(2,minmax(0,1fr)); }
.profile-metrics.unified article { min-width: 0; }
.profile-metrics.unified strong { overflow-wrap: anywhere; }
.ai-profile-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.ai-profile-card { border: 1px solid var(--border); background: #fff; border-radius: 14px; padding: 13px; }
.ai-profile-card header { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.ai-profile-card h3 { margin: 0 0 3px; color: var(--navy); font-size: .95rem; }
.ai-profile-card p { margin: 0; color: var(--muted); font-size: .75rem; }
.ai-profile-card .ai-card-metrics { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; margin-top: 10px; }
.ai-profile-card .ai-card-metrics div { background: #f8fafc; border-radius: 9px; padding: 8px; }
.ai-profile-card .ai-card-metrics span { display:block; color:var(--muted); font-size:.64rem; }
.ai-profile-card .ai-card-metrics strong { display:block; margin-top:2px; color:var(--navy); }
.ai-profile-card footer { display:flex; flex-wrap:wrap; gap:7px; margin-top:10px; }
.unified-profile-cards { display:grid; grid-template-columns:1fr; gap:10px; margin:12px 0; }
.unified-profile-card { border:1px solid var(--border); border-radius:14px; background:#fff; padding:12px; display:grid; grid-template-columns:auto 1fr; gap:10px; align-items:center; }
.unified-profile-card .athlete-avatar { grid-row:1 / span 2; }
.unified-profile-card h3 { margin:0 0 2px; font-size:.92rem; color:var(--navy); }
.unified-profile-card p { margin:0; font-size:.71rem; color:var(--muted); }
.unified-profile-card .mini-metrics { grid-column:1/-1; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; }
.unified-profile-card .mini-metrics span { padding:7px 8px; border-radius:8px; background:#f8fafc; color:var(--muted); font-size:.64rem; }
.unified-profile-card .mini-metrics b { color:var(--navy); }
.report-chart-grid { display:grid; grid-template-columns:1fr; gap:12px; margin:14px 0; }
.report-chart-card { min-width:0; border:1px solid var(--border); border-radius:14px; background:#fff; padding:12px; }
.report-chart-card h3 { margin:0 0 3px; font-size:.9rem; color:var(--navy); }
.report-chart-card p { margin:0 0 8px; font-size:.7rem; color:var(--muted); }
.report-chart-card canvas, .compare-chart { width:100%; min-height:260px; display:block; }
.profile-report-wrap { margin-top: 10px; }
.profile-report-wrap .form-grid.report { grid-template-columns:1fr; }
.compare-chart-legend { display:flex; flex-wrap:wrap; gap:10px; margin:8px 0 0; color:var(--muted); font-size:.68rem; }
.compare-chart-legend span::before { content:""; display:inline-block; width:10px; height:10px; margin-right:5px; border-radius:2px; vertical-align:-1px; background:var(--blue); }
.compare-chart-legend span:nth-child(2)::before { background:var(--track); }
@media (min-width:620px) {
  .profile-metrics.unified { grid-template-columns:repeat(4,minmax(0,1fr)); }
  .ai-profile-grid, .unified-profile-cards { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .ai-profile-card .ai-card-metrics, .unified-profile-card .mini-metrics { grid-template-columns:repeat(4,minmax(0,1fr)); }
}
@media (min-width:900px) {
  .profile-metrics.unified { grid-template-columns:repeat(7,minmax(0,1fr)); }
  .report-chart-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .report-chart-card.wide { grid-column:1/-1; }
  .profile-report-wrap .form-grid.report { grid-template-columns:2fr 1fr 1fr auto; }
  .unified-profile-cards { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
/* END ATLETISM-AI UNIFIED PROFILE V1 */
