@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@600;700;800&display=swap');

:root {
  --ink: #111827;
  --muted: #667085;
  --line: #e5e7eb;
  --surface: #ffffff;
  --canvas: #f4f5f7;
  --navy: #101828;
  --navy-soft: #1d2939;
  --red: #d92d20;
  --red-dark: #b42318;
  --red-soft: #fef3f2;
  --green: #067647;
  --green-soft: #ecfdf3;
  --amber: #b54708;
  --amber-soft: #fffaeb;
  --radius: 14px;
  --shadow: 0 8px 28px rgba(16, 24, 40, .07);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: "DM Sans", system-ui, sans-serif; font-size: 14px; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
body.public-mode [data-admin-only] { display: none !important; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; display: flex; width: 248px; flex-direction: column; padding: 24px 18px; color: #d0d5dd; background: var(--navy); }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 28px; color: #fff; }
.brand-mark { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid rgba(255,255,255,.25); border-radius: 11px; background: var(--red); font-family: Manrope, sans-serif; font-weight: 800; letter-spacing: -.5px; }
.brand strong, .brand small { display: block; }
.brand strong { font-family: Manrope, sans-serif; font-size: 15px; }
.brand small { margin-top: 2px; color: #98a2b3; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.main-nav { display: grid; gap: 5px; }
.nav-item { display: flex; width: 100%; align-items: center; gap: 12px; padding: 11px 12px; border: 0; border-radius: 9px; color: #98a2b3; background: transparent; cursor: pointer; text-align: left; transition: .15s ease; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.05); }
.nav-item.active { color: #fff; background: var(--navy-soft); box-shadow: inset 3px 0 var(--red); }
.nav-item .icon { display: grid; width: 22px; place-items: center; color: #d0d5dd; font-size: 18px; }
.sidebar-foot { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 16px 10px 2px; border-top: 1px solid #344054; }
.sidebar-foot strong, .sidebar-foot small { display: block; }
.sidebar-foot strong { color: #eaecf0; font-size: 12px; }
.sidebar-foot small { margin-top: 2px; color: #667085; font-size: 10px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #12b76a; box-shadow: 0 0 0 4px rgba(18,183,106,.12); }

.main { min-height: 100vh; margin-left: 248px; }
.topbar { position: sticky; top: 0; z-index: 15; display: flex; min-height: 82px; align-items: center; justify-content: space-between; padding: 14px 34px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.95); backdrop-filter: blur(10px); }
.topbar h1 { margin: 2px 0 0; font-family: Manrope, sans-serif; font-size: 23px; letter-spacing: -.03em; }
.eyebrow, .kicker { margin: 0; color: var(--red); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.top-actions { display: flex; align-items: center; gap: 16px; }
.mode-badge { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.mode-link { white-space: nowrap; }
.save-state { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.save-state > span { width: 7px; height: 7px; border-radius: 50%; background: #12b76a; }
.save-state.saving > span { background: #f79009; }
.mobile-menu { display: none; border: 0; background: transparent; font-size: 22px; cursor: pointer; }
.content { max-width: 1500px; margin: 0 auto; padding: 30px 34px 60px; }
.view { display: none; animation: fade-in .18s ease; }
.view.active { display: block; }
@keyframes fade-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

.button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; border: 1px solid transparent; border-radius: 9px; font-weight: 600; cursor: pointer; transition: .15s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: #fff; background: var(--red); box-shadow: 0 2px 5px rgba(217,45,32,.2); }
.button.primary:hover { background: var(--red-dark); }
.button.secondary { border-color: #d0d5dd; background: #fff; }
.button.secondary:hover { border-color: #98a2b3; }
.button.white { color: var(--navy); background: #fff; }
.button.ghost-light { border-color: rgba(255,255,255,.25); color: #fff; background: transparent; }
.button.full { width: 100%; }
.button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.text-button { padding: 0; border: 0; color: var(--red); background: transparent; font-weight: 600; cursor: pointer; }

.hero-panel { display: grid; min-height: 245px; grid-template-columns: minmax(0, 1fr) 240px; align-items: center; gap: 40px; padding: 34px 38px; overflow: hidden; border-radius: 18px; color: #fff; background-color: #1d2939; background-image: linear-gradient(110deg, rgba(16,24,40,.15), rgba(16,24,40,.86)), radial-gradient(circle at 86% 18%, rgba(217,45,32,.55), transparent 31%); box-shadow: var(--shadow); }
.hero-panel h2 { max-width: 660px; margin: 13px 0 9px; font-family: Manrope, sans-serif; font-size: clamp(29px, 4vw, 44px); line-height: 1.08; letter-spacing: -.045em; }
.hero-panel p { max-width: 620px; margin: 0; color: #d0d5dd; font-size: 15px; line-height: 1.65; }
.tag { display: inline-flex; padding: 5px 9px; border-radius: 99px; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.tag.light { border: 1px solid rgba(255,255,255,.2); color: #fef3f2; background: rgba(217,45,32,.22); }
.hero-actions { display: flex; gap: 9px; margin-top: 24px; }
.hero-score { padding: 24px; border: 1px solid rgba(255,255,255,.14); border-radius: 14px; background: rgba(255,255,255,.06); }
.hero-score span, .hero-score small { display: block; color: #98a2b3; }
.hero-score strong { display: block; margin: 6px 0; font-family: Manrope, sans-serif; font-size: 24px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 18px 0; }
.metric-card { padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 2px 8px rgba(16,24,40,.025); }
.metric-card span, .metric-card small { display: block; color: var(--muted); }
.metric-card span { font-size: 12px; font-weight: 600; }
.metric-card strong { display: block; margin: 7px 0 2px; font-family: Manrope, sans-serif; font-size: 28px; letter-spacing: -.04em; }
.metric-card small { font-size: 11px; }
.dashboard-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 18px; }

.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 2px 10px rgba(16,24,40,.025); }
.panel.compact { padding: 14px 16px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.panel h3, .panel-heading h3 { margin: 4px 0 0; font-family: Manrope, sans-serif; font-size: 17px; letter-spacing: -.025em; }
.workflow-panel, .recent-panel { padding: 24px; }
.workflow { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 24px; margin: 22px 0 0; padding: 0; list-style: none; }
.workflow li { display: flex; align-items: flex-start; gap: 12px; }
.workflow li > span { display: grid; flex: 0 0 30px; height: 30px; place-items: center; border-radius: 9px; color: var(--red); background: var(--red-soft); font-weight: 700; }
.workflow strong, .workflow small { display: block; }
.workflow small { margin-top: 4px; color: var(--muted); line-height: 1.4; }
.recent-list { display: grid; }
.recent-item { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid #f0f1f3; }
.recent-item:first-child { border-top: 0; }
.source-logo { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 10px; color: #fff; background: #344054; font-size: 11px; font-weight: 800; }
.source-logo.smoothcomp { background: #1570ef; }
.source-logo.tapology { background: #d92d20; }
.recent-item strong, .recent-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-item small { margin-top: 3px; color: var(--muted); }
.status-pill { padding: 4px 8px; border-radius: 99px; color: var(--green); background: var(--green-soft); font-size: 10px; font-weight: 700; }
.status-pill.neutral { color: var(--muted); background: #f2f4f7; }

.section-lead { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 22px; }
.section-lead h2 { margin: 5px 0 7px; font-family: Manrope, sans-serif; font-size: 28px; letter-spacing: -.04em; }
.section-lead p { max-width: 700px; margin: 0; color: var(--muted); line-height: 1.55; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.toolbar-right, .source-filters { display: flex; align-items: flex-end; gap: 10px; }
.segmented { display: inline-flex; gap: 4px; padding: 4px; border-radius: 10px; background: #f2f4f7; }
.segmented button { min-height: 34px; padding: 0 13px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 600; cursor: pointer; }
.segmented button.active { color: var(--ink); background: #fff; box-shadow: 0 1px 3px rgba(16,24,40,.12); }
.search { display: flex; height: 40px; min-width: 250px; align-items: center; gap: 7px; padding: 0 12px; border: 1px solid #d0d5dd; border-radius: 9px; background: #fff; }
.search span { color: var(--muted); font-size: 18px; }
.search input { width: 100%; border: 0; outline: 0; background: transparent; }
.search.wide { flex: 1; max-width: 470px; }
.select-wrap > span { display: block; margin: 0 0 4px; color: var(--muted); font-size: 10px; font-weight: 600; }
select, input, textarea { border: 1px solid #d0d5dd; border-radius: 9px; color: var(--ink); background: #fff; outline: 0; transition: .15s ease; }
select { min-height: 40px; padding: 0 34px 0 11px; }
input { min-height: 40px; padding: 0 11px; }
textarea { width: 100%; padding: 10px 11px; resize: vertical; line-height: 1.45; }
select:focus, input:focus, textarea:focus { border-color: #f04438; box-shadow: 0 0 0 3px rgba(240,68,56,.11); }
.ranking-summary { display: flex; gap: 10px; margin: 0 0 14px; overflow-x: auto; }
.weight-chip { min-width: 118px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.weight-chip strong, .weight-chip span { display: block; }
.weight-chip strong { font-size: 12px; }
.weight-chip span { margin-top: 2px; color: var(--muted); font-size: 10px; }
.weight-chip.active { border-color: var(--red); box-shadow: inset 0 -2px var(--red); }
.table-panel { overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 12px 18px; color: var(--muted); background: #f9fafb; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-align: left; text-transform: uppercase; }
.data-table td { padding: 14px 18px; border-top: 1px solid #eaecf0; vertical-align: middle; }
.data-table tbody tr:hover { background: #fcfcfd; }
.data-table .weight-header:hover { background: #f2f4f7; }
.weight-header td { padding: 9px 18px; color: #344054; background: #f2f4f7; text-align: left !important; }
.weight-header strong { font-family: Manrope, sans-serif; font-size: 12px; }
.weight-header span { margin-left: 8px; color: var(--muted); font-size: 10px; font-weight: 500; }
.data-table th:first-child, .data-table td:first-child { width: 66px; text-align: center; }
.unmatched-table th:first-child, .unmatched-table td:first-child { width: auto; text-align: left; }
.data-table th:nth-last-child(-n+2), .data-table td:nth-last-child(-n+2) { text-align: right; }
.fighter-cell { display: flex; align-items: center; gap: 11px; }
.avatar { display: grid; flex: 0 0 34px; height: 34px; place-items: center; border-radius: 50%; color: #344054; background: #eaecf0; font-size: 10px; font-weight: 700; }
.fighter-cell strong, .fighter-cell small { display: block; }
.fighter-cell small { margin-top: 2px; color: var(--muted); }
.fighter-link { text-align: left; }
.points { font-family: Manrope, sans-serif; font-weight: 800; }
.position { color: var(--muted); font-weight: 700; }
.position.podium { color: var(--red); }
.empty-state { padding: 60px 20px; color: var(--muted); text-align: center; }
.empty-state strong, .empty-state span { display: block; }
.empty-state strong { color: var(--ink); }
.empty-state span { margin-top: 5px; }

.source-notice { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 16px; padding: 14px 16px; border: 1px solid #fedf89; border-radius: 12px; color: #7a2e0e; background: var(--amber-soft); }
.source-notice > span { display: grid; flex: 0 0 24px; height: 24px; place-items: center; border-radius: 50%; color: #fff; background: #f79009; font-weight: 700; }
.source-notice p { margin: 3px 0 0; color: #93370d; font-size: 12px; }
.source-filters { margin-bottom: 16px; }
.source-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.source-card { display: flex; min-height: 190px; flex-direction: column; padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: #fff; transition: .15s ease; }
.source-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.source-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.source-card h3 { margin: 15px 0 5px; font-family: Manrope, sans-serif; font-size: 16px; }
.source-card p { margin: 0; color: var(--muted); font-size: 12px; }
.source-meta { display: flex; gap: 12px; margin-top: 12px; color: var(--muted); font-size: 11px; }
.source-card-actions { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 16px; }
.source-card-actions button { min-height: 34px; }
.icon-button { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: #fff; cursor: pointer; }
.provider-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 7px; color: #175cd3; background: #eff8ff; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.provider-badge.tapology { color: var(--red-dark); background: var(--red-soft); }
.provider-badge.manual { color: #475467; background: #f2f4f7; }

.table-footer { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.pagination { display: flex; align-items: center; gap: 9px; }
.pagination button { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 7px; background: #fff; cursor: pointer; }
.result-win { color: var(--green); font-weight: 700; }
.result-loss { color: var(--red); font-weight: 700; }

.profile-summary { display: grid; grid-template-columns: minmax(260px, 1.5fr) repeat(3, minmax(130px, .7fr)); gap: 14px; margin-bottom: 18px; }
.profile-identity, .profile-stat { min-height: 104px; padding: 18px 20px; }
.profile-identity { display: flex; align-items: center; gap: 14px; }
.profile-avatar { display: grid; flex: 0 0 58px; height: 58px; place-items: center; border-radius: 17px; color: #fff; background: var(--red); font-family: Manrope, sans-serif; font-size: 17px; font-weight: 800; }
.profile-identity h3 { margin: 4px 0 2px; font-family: Manrope, sans-serif; font-size: 18px; }
.profile-identity p { margin: 0; color: var(--muted); font-size: 12px; }
.profile-stat span, .profile-stat small { display: block; color: var(--muted); }
.profile-stat strong { display: block; margin: 8px 0 2px; font-family: Manrope, sans-serif; font-size: 25px; }
.profile-stat small { font-size: 11px; }
.profile-heading { margin: 0; padding: 18px 18px 0; }
.profile-table { min-width: 860px; }

.split-layout { display: grid; grid-template-columns: minmax(300px, .75fr) minmax(380px, 1.25fr); gap: 18px; }
.form-panel, .split-layout > .panel, .rules-form, .multiplier-panel { padding: 24px; }
.form-panel h3 { margin: 5px 0 20px; }
.stack-form, #foreign-form { display: grid; gap: 15px; }
label > span { display: block; margin-bottom: 6px; color: #344054; font-size: 12px; font-weight: 600; }
label input, label select { width: 100%; }
.form-help { margin: 17px 0 0; padding-top: 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.5; }
.count-badge { display: grid; min-width: 30px; height: 30px; place-items: center; border-radius: 8px; color: var(--red); background: var(--red-soft); font-weight: 700; }
.foreign-list { display: grid; gap: 8px; }
.foreign-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 9px; }
.foreign-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.foreign-row button { border: 0; color: var(--red); background: transparent; cursor: pointer; }

.rules-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(310px, .75fr); gap: 18px; }
.rules-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.rule-input { display: grid; grid-template-columns: minmax(0, 1fr) 110px; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; }
.rule-input label { min-width: 0; font-size: 12px; font-weight: 600; }
.rule-input input { min-width: 0; text-align: right; }
.form-actions { display: flex; gap: 9px; margin-top: 18px; }
.multiplier-panel p { color: var(--muted); }
.multiplier-list { display: grid; gap: 8px; margin: 18px 0; }
.multiplier-row { display: grid; grid-template-columns: 66px 1fr 46px; align-items: center; gap: 9px; font-size: 11px; }
.multiplier-bar { height: 7px; overflow: hidden; border-radius: 99px; background: #f2f4f7; }
.multiplier-bar i { display: block; height: 100%; border-radius: inherit; background: var(--red); }
.multiplier-row strong { text-align: right; }
.multiplier-panel > small { color: var(--muted); }

.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; background: rgba(16,24,40,.62); backdrop-filter: blur(3px); }
.modal { position: relative; width: min(1100px, 100%); max-height: calc(100vh - 48px); padding: 28px; overflow: auto; border-radius: 16px; background: #fff; box-shadow: 0 24px 60px rgba(16,24,40,.25); }
.modal.small { width: min(620px, 100%); }
.modal h2 { margin: 5px 0 7px; font-family: Manrope, sans-serif; font-size: 24px; letter-spacing: -.035em; }
.modal > div > p { margin: 0 0 20px; color: var(--muted); }
.modal-close { position: absolute; top: 17px; right: 17px; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: #fff; font-size: 20px; cursor: pointer; }
.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.divider { display: flex; align-items: center; gap: 10px; color: #98a2b3; font-size: 10px; text-transform: uppercase; }
.divider::before, .divider::after { height: 1px; flex: 1; background: var(--line); content: ""; }
.check-row { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.check-row input { width: 16px; min-height: 16px; margin: 2px 0 0; }
.check-row strong, .check-row small { display: block; }
.check-row small { margin-top: 3px; color: var(--muted); }
.review-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.review-heading p { margin: 5px 0 0; color: var(--muted); }
.warnings { display: grid; gap: 6px; margin-bottom: 12px; }
.warning { padding: 9px 11px; border-radius: 8px; color: var(--amber); background: var(--amber-soft); font-size: 11px; }
.review-list { display: grid; gap: 10px; }
.review-card { padding: 14px; border: 1px solid var(--line); border-radius: 11px; }
.review-card.review { border-color: #fedf89; background: #fffdf7; }
.review-card-head { display: grid; grid-template-columns: 28px 70px minmax(150px, 1.2fr) minmax(110px, .75fr) minmax(125px, .85fr); align-items: end; gap: 9px; margin-bottom: 11px; }
.review-card-head input[type="checkbox"] { width: 16px; min-height: 16px; margin-bottom: 11px; }
.review-card-head label > span { font-size: 9px; text-transform: uppercase; }
.fighter-review { display: grid; grid-template-columns: 52px 1fr 1fr 100px; align-items: end; gap: 9px; padding: 8px 10px; border-top: 1px solid #f0f1f3; }
.fighter-review > span { padding-bottom: 11px; font-size: 11px; font-weight: 700; }
.fighter-review select { width: 100%; }
.review-actions { position: sticky; bottom: -28px; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 18px -28px -28px; padding: 15px 28px; border-top: 1px solid var(--line); background: #fff; }
.review-actions span { color: var(--muted); font-size: 12px; }
.loading-state { display: grid; min-height: 350px; place-items: center; align-content: center; gap: 9px; text-align: center; }
.loading-state span { color: var(--muted); }
.spinner { width: 38px; height: 38px; margin-bottom: 7px; border: 3px solid #fee4e2; border-top-color: var(--red); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.toast-stack { position: fixed; z-index: 100; right: 20px; bottom: 20px; display: grid; gap: 9px; }
.toast { min-width: 280px; max-width: 420px; padding: 13px 15px; border: 1px solid #abefc6; border-radius: 10px; color: #05603a; background: #ecfdf3; box-shadow: var(--shadow); animation: toast-in .2s ease; }
.toast.error { border-color: #fecdca; color: #912018; background: #fef3f2; }
.toast strong, .toast span { display: block; }
.toast span { margin-top: 2px; font-size: 11px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1120px) {
  .source-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rules-grid { grid-template-columns: 1fr; }
  .review-card-head { grid-template-columns: 28px 60px 1fr 1fr; }
  .review-card-head label:last-child { grid-column: 3 / 5; }
}

@media (max-width: 850px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  body.menu-open .sidebar { transform: none; box-shadow: 20px 0 50px rgba(16,24,40,.25); }
  .main { margin-left: 0; }
  .mobile-menu { display: block; }
  .topbar { justify-content: flex-start; gap: 14px; padding: 12px 18px; }
  .top-actions { margin-left: auto; }
  .save-state { display: none; }
  .content { padding: 22px 18px 50px; }
  .hero-panel { grid-template-columns: 1fr; }
  .hero-score { display: none; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-grid, .split-layout, .rules-layout { grid-template-columns: 1fr; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-right { align-items: stretch; }
  .search { flex: 1; min-width: 0; }
  .workflow { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .topbar .button { min-height: 36px; padding: 0 10px; font-size: 11px; }
  .topbar h1 { font-size: 19px; }
  .eyebrow { display: none; }
  .hero-panel { padding: 27px 23px; }
  .hero-actions, .section-lead, .source-filters, .toolbar-right, .form-actions { align-items: stretch; flex-direction: column; }
  .section-lead { align-items: stretch; }
  .metric-grid, .source-grid, .two-cols, .profile-summary { grid-template-columns: 1fr; }
  .segmented { max-width: 100%; overflow-x: auto; }
  .segmented button { white-space: nowrap; }
  .data-table { min-width: 660px; }
  .table-panel { overflow-x: auto; }
  .review-card-head, .fighter-review { grid-template-columns: 1fr 1fr; }
  .review-card-head input[type="checkbox"] { grid-column: 1 / 3; }
  .review-card-head label:last-child { grid-column: auto; }
  .fighter-review > span { grid-column: 1 / 3; padding-bottom: 0; }
  .modal-backdrop { padding: 10px; }
  .modal { max-height: calc(100vh - 20px); padding: 22px 18px; }
  .review-actions { bottom: -22px; margin: 18px -18px -22px; padding: 13px 18px; }
}
