:root {
  --bg: #eef2f3;
  --panel: #ffffff;
  --ink: #172126;
  --muted: #69777d;
  --line: #d5dfe3;
  --line-dark: #b8c6cc;
  --black: #1d282e;
  --charcoal: #233139;
  --gray-50: #f8fafb;
  --gray-100: #eef2f4;
  --gray-200: #e2e8eb;
  --gray-300: #cfd9dd;
  --gray-500: #76858b;
  --accent: #718896;
  --accent-dark: #4f6876;
  --accent-soft: #e7eef1;
  --sage: #7d8d82;
  --sand: #9b8f80;
  --shadow: 0 18px 44px rgba(24, 45, 55, .09);
  --shadow-soft: 0 10px 26px rgba(24, 45, 55, .06);
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Segoe UI", "Microsoft YaHei UI", "PingFang SC", sans-serif;
  background:
    radial-gradient(circle at 78% 8%, rgba(255,255,255,.92), transparent 30%),
    radial-gradient(circle at 12% 74%, rgba(177, 198, 205, .16), transparent 26%),
    linear-gradient(180deg, #f7f9f9 0%, var(--bg) 100%);
  color: var(--ink);
  font-size: 14px;
}
body.modal-open { overflow: hidden; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 246px minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 25px 18px;
  color: #f2f6f7; background: linear-gradient(180deg, #223038 0%, #11191d 100%);
  display: flex; flex-direction: column; overflow: hidden; border-right: 1px solid #050505;
}
.sidebar::before {
  content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.08); right: -145px; top: -90px;
}
.sidebar::after {
  content: ""; position: absolute; width: 160px; height: 160px; border-radius: 50%;
  background: rgba(255,255,255,.035); left: -105px; bottom: -55px;
}
.brand { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.brand > div:last-child { min-width: 0; }
.brand-mark {
  width: 43px; height: 43px; border-radius: 13px; background: #eef3f5; color: #26363e;
  display: grid; place-items: center; flex: 0 0 auto; font-weight: 900; font-size: 20px; letter-spacing: -.05em;
}
.brand strong { display: block; font-size: 15px; letter-spacing: .02em; line-height: 1.35; overflow-wrap: anywhere; }
.brand span { display: block; margin-top: 4px; color: #a7a7a2; font-size: 11px; letter-spacing: .08em; }
.nav { margin-top: 42px; display: grid; gap: 8px; position: relative; z-index: 1; }
.nav-item {
  border: 1px solid transparent; color: #bcbcb7; background: transparent; padding: 12px 13px; border-radius: 11px;
  display: flex; align-items: center; gap: 11px; cursor: pointer; text-align: left;
  transition: .18s ease; letter-spacing: .02em;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: white; }
.nav-item.active { background: #eef3f5; color: #26363e; box-shadow: 0 10px 24px rgba(0,0,0,.22); font-weight: 750; }
.nav-icon { width: 20px; text-align: center; font-size: 16px; }
.sidebar-status {
  margin-top: auto; border-top: 1px solid rgba(255,255,255,.12); padding: 18px 3px 2px;
  display: flex; gap: 10px; align-items: flex-start; position: relative; z-index: 1;
}
.status-dot { width: 8px; height: 8px; background: #9eb7c2; border-radius: 50%; margin-top: 5px; box-shadow: 0 0 0 5px rgba(255,255,255,.09); }
.sidebar-status strong { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }
.sidebar-status span:last-child { display: block; color: #93938e; font-size: 11px; margin-top: 5px; line-height: 1.55; }

.main { min-width: 0; padding: 28px 30px 52px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 25px; }
.eyebrow { display: block; color: var(--accent-dark); font-size: 9px; letter-spacing: .2em; font-weight: 800; }
h1 { margin: 6px 0 4px; font-size: 29px; line-height: 1.15; letter-spacing: -.035em; font-weight: 760; }
h2 { margin: 5px 0 0; font-size: 17px; letter-spacing: -.02em; }
.topbar p, .source-hero p { margin: 0; color: var(--muted); }
.top-actions { display: flex; gap: 10px; align-items: center; }
.recommendation-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border: 1px solid #d7e0e3; border-radius: 11px; background: rgba(255,255,255,.86); color: #4f6876; cursor: pointer; font-size: 12px; font-weight: 800; white-space: nowrap; box-shadow: var(--shadow-soft); }
.recommendation-toggle.prediction-hidden { display: none; }
.recommendation-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-track { width: 34px; height: 19px; border-radius: 99px; background: #c9d5da; position: relative; transition: .2s; flex: 0 0 auto; }
.toggle-track::after { content: ""; position: absolute; width: 15px; height: 15px; border-radius: 50%; background: white; top: 2px; left: 2px; box-shadow: 0 2px 5px rgba(0,0,0,.18); transition: .2s; }
.recommendation-toggle input:checked + .toggle-track { background: #3f8a62; }
.recommendation-toggle input:checked + .toggle-track::after { transform: translateX(15px); }
.recommendation-toggle input:focus-visible + .toggle-track { outline: 3px solid rgba(63,138,98,.22); outline-offset: 2px; }
.ranking-mode-control { display: inline-flex; align-items: center; gap: 9px; min-height: 40px; padding: 0 12px; border: 1px solid #d7e0e3; border-radius: 11px; background: rgba(255,255,255,.88); box-shadow: var(--shadow-soft); white-space: nowrap; }
.ranking-mode-control span { color: #607681; font-size: 10px; font-weight: 850; letter-spacing: .04em; }
.ranking-mode-control select { border: 0; outline: 0; background: transparent; color: #344b57; font-weight: 800; cursor: pointer; max-width: 230px; }
.score-mode-switch { display: inline-flex; gap: 3px; padding: 4px; border: 1px solid #d7e0e3; border-radius: 11px; background: rgba(255,255,255,.82); }
.score-mode-switch button { border: 0; border-radius: 8px; padding: 8px 12px; background: transparent; color: #6d7c83; cursor: pointer; font-weight: 750; white-space: nowrap; }
.score-mode-switch button.active { background: #4f6876; color: white; box-shadow: 0 5px 12px rgba(79,104,118,.18); }
.global-search {
  display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.88); border: 1px solid var(--line);
  border-radius: 11px; padding: 0 12px; width: 238px; box-shadow: var(--shadow-soft); backdrop-filter: blur(12px);
}
.global-search span { color: #8a8a85; font-size: 18px; }
.global-search input, .field input, .field select { border: 0; outline: 0; background: transparent; width: 100%; color: var(--ink); }
.global-search input { height: 40px; }
.button {
  border: 1px solid transparent; border-radius: 11px; min-height: 40px; padding: 0 15px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer;
  font-weight: 750; transition: .18s ease; white-space: nowrap; letter-spacing: .01em;
}
.button.primary { background: #3f5865; color: #fff; box-shadow: 0 10px 22px rgba(63,88,101,.20); }
.button.primary:hover { background: #304a57; transform: translateY(-1px); }
.button.ghost { color: var(--accent-dark); background: var(--accent-soft); border-color: #d3e0e5; }
.button.ghost:hover { background: #dce8ec; }
.text-button { border: 0; background: transparent; color: #222; font-weight: 750; cursor: pointer; }
.view { display: none; animation: fadeIn .22s ease; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.panel {
  background: rgba(255,255,255,.92); border: 1px solid rgba(216,216,212,.92); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 21px; backdrop-filter: blur(14px);
}
.panel.tight { padding: 15px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 19px; }
.panel-note { color: #757570; font-size: 11px; background: #f4f4f1; padding: 6px 10px; border-radius: 99px; border: 1px solid #e5e5e2; }
.mechanical-stat-grid { margin-bottom: 15px; }
.prediction-summary { margin-bottom: 18px; }
.prediction-summary-heading p { margin: 6px 0 14px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.prediction-scenarios { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.prediction-scenario {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  min-width: 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: 11px;
  background: #fff; color: var(--accent-dark); font: inherit; text-align: left; cursor: pointer;
}
.prediction-scenario:hover { border-color: var(--accent-dark); }
.prediction-scenario:focus-visible { outline: 2px solid var(--accent-dark); outline-offset: 3px; }
.prediction-scenario[aria-pressed="true"] { border-color: var(--accent-dark); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-dark); }
.prediction-scenario > strong { font-size: clamp(21px, 3vw, 32px); line-height: 1.2; }
.prediction-scenario > span { font-size: 12px; }
.prediction-scenario b { font-variant-numeric: tabular-nums; }
.prediction-population-title { margin: 16px 0 9px; font-size: 13px; }
.prediction-population { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0; }
.prediction-population > div { padding: 9px 11px; border-radius: 9px; background: var(--accent-soft); }
.prediction-population dt { font-size: 12px; font-weight: 700; }
.prediction-population dd { margin: 2px 0 0; }
.prediction-population dd strong { font-size: 19px; font-variant-numeric: tabular-nums; }
.prediction-population dd span { margin-left: 4px; font-size: 11px; }
.prediction-population-note { color: var(--muted); font-size: 11px; line-height: 1.5; }
.prediction-explainer { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; background: linear-gradient(135deg, #fff, #eef5f1); }
.prediction-explainer p { margin: 9px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.prediction-panel { margin-bottom: 18px; }
.prediction-section-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 20px 13px; }
.prediction-section-head h2 { margin-top: 5px; }
.prediction-tools { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px; }
.prediction-tools .field { min-width: 190px; }
.prediction-count { padding: 0 20px 12px; color: var(--muted); font-size: 11px; }
.prediction-pool-wrap { max-height: 420px; }
.prediction-pool-wrap tbody tr { cursor: default; }
.prediction-pool-stage, .prediction-next-note { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }
.prediction-score { margin-left: 8px; color: #3f7d5b; font-weight: 850; }
.prediction-list-wrap { max-height: calc(100vh - 370px); }
.competition-panel { margin-top: 18px; }
.competition-table-wrap { max-height: none; }
.competition-table-wrap table { min-width: 960px; width: 100%; }
.competition-table-wrap tbody tr { cursor: default; }
.competition-table-wrap td { vertical-align: top; white-space: normal; }
.competition-table-wrap th:last-child { width: 48%; }
.competition-student-meta { display: block; color: var(--muted); font-size: 11px; line-height: 1.6; margin-top: 5px; }
.competition-detail { padding: 0; margin-top: 12px; color: var(--accent-dark); font-size: 11px; }
.competition-detail:hover { text-decoration: underline; }
.competition-score { display: block; color: #3f7d5b; font-size: 23px; }
.competition-award { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fafcfc; }
.competition-award + .competition-award { margin-top: 10px; }
.competition-award.selected { border-color: #c3d8ca; background: #f5faf6; }
.competition-award-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.competition-award p { margin: 8px 0; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.competition-award-meta { display: flex; flex-wrap: wrap; gap: 5px 12px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.competition-award-links { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 8px; }
.competition-award-location { display: block; margin-top: 6px; color: var(--muted); font-size: 10px; line-height: 1.6; overflow-wrap: anywhere; }
.mechanical-multi-field { min-width: 360px; }
.multi-toggle-group { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-height: 43px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.direction-chip { border: 1px solid #d6e0e4; border-radius: 99px; padding: 6px 9px; background: #f6f9fa; color: #5b707a; cursor: pointer; font-size: 10px; font-weight: 800; white-space: nowrap; }
.direction-chip:hover { border-color: #9fb4bf; color: #334c58; }
.direction-chip.active { border-color: #4f6876; background: #4f6876; color: white; box-shadow: 0 4px 10px rgba(79,104,118,.16); }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 18px; }
.stat-card {
  position: relative; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow-soft);
}
.stat-card::after { content: ""; position: absolute; width: 92px; height: 92px; border-radius: 50%; background: var(--stat-soft, #f2f2ef); right: -34px; bottom: -46px; }
.stat-top { color: var(--muted); font-size: 11px; display: flex; align-items: center; justify-content: space-between; text-transform: uppercase; letter-spacing: .08em; }
.stat-icon { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; background: var(--stat-soft, #f1f1ee); color: var(--stat-color, #111); font-weight: 850; }
.stat-value { font-size: 32px; font-weight: 850; letter-spacing: -.055em; margin-top: 15px; position: relative; z-index: 1; }
.stat-foot { color: var(--muted); font-size: 11px; margin-top: 7px; position: relative; z-index: 1; }
.content-grid { display: grid; gap: 18px; margin-bottom: 18px; }
.two-one { grid-template-columns: minmax(0, 1.6fr) minmax(280px, .8fr); }
.bar-chart { display: grid; gap: 17px; }
.bar-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) 56px; align-items: center; gap: 12px; }
.bar-label { font-weight: 750; font-size: 12px; }
.bar-track { background: #ececea; border-radius: 99px; overflow: hidden; height: 12px; }
.bar-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #587485, #94adba); min-width: 8px; }
.bar-value { text-align: right; font-weight: 850; font-size: 13px; }
.health-list { display: grid; gap: 9px; }
.health-item { padding: 12px 13px; background: #f7f7f5; border: 1px solid #ecece9; border-radius: 11px; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.health-item strong { display: block; font-size: 12px; }
.health-item span { color: var(--muted); font-size: 10px; }
.health-value { font-weight: 850; color: #171717; font-size: 18px; }

.toolbar { margin-bottom: 15px; }
.toolbar-row { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.toolbar-row + .toolbar-row { margin-top: 12px; padding-top: 12px; border-top: 1px solid #ecece9; }
.field { display: grid; gap: 6px; min-width: 150px; }
.field > span { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.field input, .field select { height: 38px; border: 1px solid var(--line); border-radius: 10px; padding: 0 11px; background: #fafaf8; }
.field input:focus, .field select:focus { border-color: #8c8c87; box-shadow: 0 0 0 3px rgba(0,0,0,.055); background: white; }
.field.grow { min-width: 260px; flex: 1; }
.compact { justify-content: space-between; }
.column-toggles { display: flex; gap: 7px; flex-wrap: wrap; }
.column-toggle { border: 1px solid var(--line); background: white; color: #777772; border-radius: 99px; padding: 7px 11px; cursor: pointer; font-size: 10px; font-weight: 800; letter-spacing: .03em; }
.column-toggle.active { color: white; background: #171717; border-color: #171717; }
.result-count { font-size: 11px; color: var(--muted); }
.table-panel { padding: 0; overflow: hidden; }
.table-wrap { overflow: auto; max-height: calc(100vh - 280px); }
table { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; }
th, td { border-bottom: 1px solid #ecece9; padding: 10px 11px; white-space: nowrap; text-align: left; font-size: 12px; }
th { position: sticky; top: 0; z-index: 3; background: #f0f0ed; color: #4f4f4b; font-size: 10px; font-weight: 850; letter-spacing: .04em; }
tbody tr { background: white; transition: background .15s; }
tbody tr:nth-child(even) { background: #fbfbfa; }
tbody tr:hover { background: #edf3f5; }
tbody tr { cursor: pointer; }
td.sticky, th.sticky { position: sticky; background: inherit; z-index: 2; }
th.sticky { z-index: 4; background: #e9e9e6; }
td.sticky.seq { left: 0; width: 52px; }
td.sticky.sid { left: 52px; width: 125px; }
td.sticky.name { left: 177px; width: 100px; }
th.sticky.seq { left: 0; }
th.sticky.sid { left: 52px; }
th.sticky.name { left: 177px; }
.group-base { background: #e7ecef !important; }
.group-first { background: #e0eaee !important; }
.group-second { background: #dfeae3 !important; }
.group-third { background: #e8e4ef !important; }
.group-calc { background: #ece6dd !important; }
tbody tr.eligible-row, tbody tr.eligible-row td { background: #e4f3e9 !important; }
tbody tr.eligible-row { box-shadow: inset 4px 0 0 #3f8a62; }
tbody tr.eligible-row:hover, tbody tr.eligible-row:hover td { background: #d4ebdc !important; }
.eligible-badge { display: inline-block; margin-left: 7px; padding: 3px 7px; border-radius: 99px; background: #2f7d55; color: #fff; font-size: 9px; font-weight: 850; letter-spacing: .02em; vertical-align: middle; }
.score-focus-badge { display: inline-block; margin-left: 7px; padding: 3px 7px; border-radius: 99px; background: #b97822; color: #fff; font-size: 9px; font-weight: 850; letter-spacing: .02em; vertical-align: middle; }
.missing { color: #3c3c39; background: #ededeb; border: 1px solid #d8d8d4; border-radius: 6px; padding: 3px 6px; font-size: 9px; font-weight: 800; }
.status-pill { display: inline-block; border-radius: 99px; padding: 4px 8px; font-size: 9px; font-weight: 850; border: 1px solid #d4d4d0; color: #333; background: #f3f3f1; }
.status-warning { background: #222; color: #fff; border-color: #222; }
.status-first { background: #fff; color: #222; }
.status-second { background: #d9d9d5; color: #191919; }
.pagination { padding: 12px 15px; display: flex; align-items: center; justify-content: flex-end; gap: 7px; border-top: 1px solid var(--line); background: white; }
.page-button { min-width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: white; cursor: pointer; }
.page-button.active { background: #111; color: white; border-color: #111; font-weight: 850; }
.page-button:disabled { opacity: .3; cursor: default; }
.page-info { color: var(--muted); font-size: 11px; margin-right: auto; }

.raw-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 15px; }
.segmented { display: inline-flex; gap: 4px; background: #e9e9e6; padding: 5px; border-radius: 12px; flex-wrap: wrap; }
.segment { border: 0; background: transparent; padding: 9px 13px; border-radius: 9px; cursor: pointer; color: #666; font-weight: 750; }
.segment.active { color: #111; background: #fff; box-shadow: 0 5px 14px rgba(0,0,0,.08); }
.raw-tools { display: flex; align-items: flex-end; gap: 9px; }
.search-field { min-width: 260px; }
.raw-major-field { min-width: 190px; }
.raw-summary { padding: 15px 17px 4px; color: var(--muted); font-size: 11px; }
.source-hero { display: flex; justify-content: space-between; align-items: center; margin-bottom: 17px; background: linear-gradient(135deg, #fff, #e8eff2); }
.source-hero-icon { width: 58px; height: 58px; border-radius: 17px; display: grid; place-items: center; background: #4f6876; color: white; font-size: 25px; }
.source-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.source-card { background: #fff; border: 1px solid var(--line); border-radius: 15px; padding: 18px; box-shadow: var(--shadow-soft); display: flex; flex-direction: column; min-height: 174px; }
.source-category { color: #666; font-size: 9px; font-weight: 900; letter-spacing: .14em; }
.source-card h3 { margin: 9px 0 7px; font-size: 15px; }
.source-card p { color: var(--muted); line-height: 1.67; font-size: 12px; margin: 0 0 15px; }
.source-meta { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 10px; }
.rules-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.rule-card.accent { background: linear-gradient(145deg, #344b57, #1f3039); color: white; border: 0; }
.rule-card.accent .eyebrow { color: #aaa; }
.rule-card.accent p { color: #c8c8c4; line-height: 1.7; }
.formula { margin-top: 17px; padding: 17px; background: #f2f2ef; color: #181818; border: 1px solid #e3e3df; border-radius: 12px; font-weight: 800; line-height: 1.65; }
.accent .formula { background: rgba(255,255,255,.08); color: white; border-color: rgba(255,255,255,.12); }
.mapping-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.mapping-card { border: 1px solid var(--line); border-radius: 13px; padding: 16px; background: #fafaf8; }
.mapping-card strong { display: block; margin-bottom: 7px; }
.mapping-card span { color: var(--muted); font-size: 12px; line-height: 1.6; }
.field-guide { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.guide-card { border-radius: 13px; padding: 15px; background: #f5f5f3; border: 1px solid #ecece9; }
.guide-card strong { display: block; margin-bottom: 7px; }
.guide-card p { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 0; }

.statement-panel { max-width: 900px; }
.statement-list { display: grid; gap: 0; margin: 0; padding-left: 1.65em; }
.statement-list li { padding: 12px 0 12px 8px; }
.statement-list li + li { border-top: 1px solid #e0e8eb; }
.statement-list li::marker { color: var(--accent-dark); font-weight: 700; }
.statement-list p { color: var(--muted); margin: 0; line-height: 1.75; }


.overview-lower { grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); margin-top: 0; }
.soft-panel { background: linear-gradient(145deg, #ffffff, #f4f8f9); }
.coverage-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.coverage-card { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 14px; border: 1px solid #e0e8eb; border-radius: 12px; background: #fafcfc; }
.coverage-dot { width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 4px rgba(113,136,150,.10); }
.coverage-card strong { display: block; font-size: 12px; margin-bottom: 3px; }
.coverage-card span { display: block; color: var(--muted); font-size: 10px; }
.coverage-card b { font-size: 20px; color: var(--accent-dark); }
.note-stack { display: grid; gap: 10px; }
.overview-note-card { padding: 13px 14px; border: 1px solid #e1e8eb; border-radius: 12px; background: rgba(255,255,255,.8); }
.overview-note-card strong { display: block; font-size: 12px; margin-bottom: 5px; color: #344b57; }
.overview-note-card span { color: var(--muted); font-size: 11px; line-height: 1.65; }
.transfer-card { width: min(510px, 100%); }
.recommendation-rule-card { width: min(760px, 100%); max-height: min(86vh, 820px); overflow: auto; }
.recommendation-rule-card .notice-mark { background: #3f8a62; }
.transfer-card .notice-mark { background: #5d7786; }

.notice-backdrop {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px;
  background: rgba(0,0,0,.72); backdrop-filter: blur(8px); opacity: 0; pointer-events: none; transition: opacity .24s ease;
}
.notice-backdrop.open { opacity: 1; pointer-events: auto; }
.notice-card {
  width: min(650px, 100%); background: #f8f8f6; color: #111; border: 1px solid rgba(255,255,255,.18);
  border-radius: 20px; padding: 28px; box-shadow: 0 30px 90px rgba(0,0,0,.42); transform: translateY(10px) scale(.985);
  transition: transform .24s ease;
}
.notice-backdrop.open .notice-card { transform: none; }
.notice-topline { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.notice-kicker, .notice-version { font-size: 9px; letter-spacing: .18em; font-weight: 900; color: #6e6e69; }
.notice-version { border: 1px solid #d7d7d3; border-radius: 99px; padding: 6px 9px; }
.notice-mark { width: 54px; height: 54px; border-radius: 16px; background: #111; color: #fff; display: grid; place-items: center; font-size: 24px; font-weight: 900; margin: 24px 0 16px; }
.notice-card h2 { font-size: 25px; margin: 0 0 16px; letter-spacing: -.035em; }
.notice-copy { display: grid; gap: 10px; }
.notice-copy p { margin: 0; padding: 13px 14px; background: #fff; border: 1px solid #e4e4e0; border-radius: 11px; color: #51514d; line-height: 1.75; }
.notice-footer { margin-top: 22px; padding-top: 17px; border-top: 1px solid #ddddda; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.notice-footer-stack { align-items: stretch; flex-direction: column; }
.notice-agreement { display: flex; align-items: center; gap: 9px; padding: 12px 13px; border: 1px solid #dce4e7; border-radius: 11px; background: #fff; color: #43565f; font-size: 12px; line-height: 1.55; cursor: pointer; }
.notice-agreement input { width: 17px; height: 17px; accent-color: #4f6876; flex: 0 0 auto; }
#noticeAccept:disabled { opacity: .42; cursor: not-allowed; box-shadow: none; }
.notice-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.notice-user strong { font-size: 13px; letter-spacing: .01em; line-height: 1.45; }
.notice-avatar { width: 40px; height: 40px; border-radius: 12px; overflow: hidden; flex: 0 0 40px; background: #e6e6e2; border: 1px solid #d7d7d3; }
.notice-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: center 24%; transform: scale(1.28); display: block; }

.drawer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.46); opacity: 0; pointer-events: none; transition: .2s; z-index: 30; }
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; height: 100vh; width: min(620px, 94vw); background: #f3f3f1; z-index: 31; transform: translateX(105%); transition: .25s ease; overflow: auto; box-shadow: -24px 0 60px rgba(0,0,0,.22); }
.drawer.open { transform: none; }
.drawer-close { position: fixed; right: 18px; top: 13px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid #ddd; background: white; box-shadow: var(--shadow); font-size: 22px; cursor: pointer; z-index: 2; }
.drawer-hero { padding: 36px 28px 27px; background: linear-gradient(135deg, #2d424d, #17242b); color: white; }
.drawer-hero h2 { font-size: 27px; margin: 13px 0 6px; }
.drawer-hero p { color: #bdbdb8; margin: 0; }
.drawer-body { padding: 20px 22px 40px; }
.detail-section { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 13px; }
.detail-section h3 { margin: 0 0 13px; font-size: 14px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.detail-item { background: #f8f8f6; border: 1px solid #ededeb; border-radius: 10px; padding: 10px; }
.detail-item span { display: block; color: var(--muted); font-size: 10px; margin-bottom: 4px; }
.detail-item strong { font-size: 13px; overflow-wrap: anywhere; }
.trace-intro { margin: -4px 0 14px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.trace-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.trace-card { border: 1px solid #e1e9e9; border-radius: 11px; padding: 12px; background: #fbfcfc; min-width: 0; }
.trace-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; font-size: 12px; }
.trace-head strong { line-height: 1.4; }
.trace-status { flex: none; border-radius: 999px; padding: 3px 7px; font-size: 10px; font-weight: 750; background: #fff0d8; color: #805b20; }
.trace-status.ok { background: #e5f3e9; color: #246946; }
.trace-status.muted { background: #eceff0; color: #62737b; }
.trace-value { margin: 9px 0 4px; font-size: 20px; font-weight: 850; color: #2b4654; }
.trace-note, .trace-discrepancy { margin: 5px 0; color: #60727b; font-size: 11px; line-height: 1.55; overflow-wrap: anywhere; }
.trace-discrepancy { color: #9a4f29; }
.trace-source, .trace-evidence { display: grid; gap: 3px; margin-top: 9px; padding-top: 8px; border-top: 1px solid #e5ecec; font-size: 11px; overflow-wrap: anywhere; }
.trace-source span, .trace-source small, .trace-evidence small { color: #71838b; }
.trace-source strong, .trace-evidence strong { font-weight: 700; }
.trace-evidence p { margin: 3px 0; color: #60727b; font-size: 11px; line-height: 1.5; }
.trace-link { width: fit-content; margin-top: 3px; color: #246886; font-weight: 750; text-decoration: underline; text-underline-offset: 2px; }
.trace-derived { margin-top: 12px; border-radius: 10px; background: #eef4f5; padding: 12px; font-size: 11px; line-height: 1.65; }
.trace-derived strong { font-size: 12px; }
.trace-derived p { margin: 5px 0 0; }
.raw-json { margin: 0; background: #17242b; color: #ececeb; border-radius: 12px; padding: 14px; overflow: auto; font-size: 11px; line-height: 1.55; max-height: 320px; }
.empty-state { padding: 40px; text-align: center; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: #2f4652; color: white; padding: 11px 16px; border-radius: 11px; box-shadow: var(--shadow); transition: .2s; z-index: 120; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.class-toolbar { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 15px; }
.class-rank-note { flex: 1; min-width: 260px; color: #607681; font-size: 11px; line-height: 1.6; padding: 8px 10px; border-radius: 10px; background: #eef4f6; }
.class-rank-groups { display: grid; gap: 16px; }
.class-rank-card { padding: 0; overflow: hidden; }
.class-rank-head { padding: 18px 20px 0; margin-bottom: 13px; }
.class-rank-summary { display: grid; grid-template-columns: auto auto; gap: 3px 9px; align-items: baseline; color: var(--muted); font-size: 10px; text-align: right; }
.class-rank-summary b { color: #344b57; font-size: 15px; }
.class-table-wrap { max-height: none; }
.class-rank-badge { display: inline-grid; place-items: center; min-width: 27px; height: 27px; padding: 0 7px; border-radius: 8px; background: #e7eef1; color: #405b68; font-weight: 850; }
.class-rank-card tbody tr:hover .class-rank-badge { background: #4f6876; color: white; }

/* Authentication and binding */
.auth-shell {
  position: fixed; inset: 0; z-index: 180; padding: 24px; display: grid; place-items: center;
  background:
    radial-gradient(circle at 18% 20%, rgba(177, 199, 208, .28), transparent 28%),
    radial-gradient(circle at 82% 75%, rgba(203, 192, 174, .20), transparent 30%),
    linear-gradient(145deg, #edf2f3, #f8faf9 48%, #eef1ef);
}
.auth-card {
  width: min(900px, 100%); min-height: 520px; display: grid; grid-template-columns: 1.05fr .95fr;
  background: rgba(255,255,255,.94); border: 1px solid #d9e1e4; border-radius: 24px; overflow: hidden;
  box-shadow: 0 28px 80px rgba(31, 55, 66, .16); backdrop-filter: blur(18px);
}
.auth-side {
  padding: 48px; color: #f6fafb; background:
    radial-gradient(circle at 80% 10%, rgba(255,255,255,.12), transparent 30%),
    linear-gradient(145deg, #344b57, #1d2b32);
  display: flex; flex-direction: column; justify-content: center;
}
.auth-brand-mark { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: #eef3f5; color: #26373f; font-size: 25px; font-weight: 900; margin-bottom: 28px; }
.auth-kicker { display: block; color: #93aeb9; font-size: 9px; font-weight: 900; letter-spacing: .2em; }
.auth-side h1 { font-size: 32px; line-height: 1.18; letter-spacing: -.045em; margin: 10px 0 13px; }
.auth-side p { color: #cbd9de; line-height: 1.75; margin: 0; }
.auth-points { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.auth-points span { border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.08); border-radius: 99px; padding: 7px 10px; font-size: 10px; color: #dce7ea; }
.auth-form-side { padding: 46px 44px; display: flex; flex-direction: column; justify-content: center; }
.auth-tabs { display: inline-flex; align-self: flex-start; gap: 4px; padding: 4px; background: #edf2f4; border-radius: 11px; margin-bottom: 24px; }
.auth-tabs button { border: 0; background: transparent; color: #75858c; padding: 8px 17px; border-radius: 8px; cursor: pointer; font-weight: 750; }
.auth-tabs button.active { background: white; color: #304b58; box-shadow: 0 5px 12px rgba(30,55,66,.08); }
.auth-form-side h2 { font-size: 23px; margin: 0 0 7px; }
.auth-form-side > p { color: var(--muted); margin: 0 0 22px; font-size: 12px; }
.auth-form-side form { display: grid; gap: 14px; }
.auth-form-side label, .bind-search { display: grid; gap: 7px; }
.auth-form-side label span, .bind-search span { color: #62737b; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.auth-form-side input, .bind-search input { height: 43px; border: 1px solid #d4dfe3; border-radius: 10px; background: #f9fbfb; padding: 0 12px; outline: 0; }
.auth-form-side input:focus, .bind-search input:focus { border-color: #8da7b4; box-shadow: 0 0 0 3px rgba(113,136,150,.11); background: white; }
.auth-submit { width: 100%; min-height: 44px; margin-top: 4px; }
.auth-message { min-height: 22px; margin-top: 12px; color: #a33d32; font-size: 12px; }
.auth-form-side small { color: #8a989e; line-height: 1.6; }
.bind-card { width: min(760px, 100%); background: #fff; border: 1px solid #d8e1e4; border-radius: 22px; padding: 30px; box-shadow: 0 28px 80px rgba(31,55,66,.16); }
.bind-head { display: flex; justify-content: space-between; gap: 22px; align-items: flex-start; margin-bottom: 22px; }
.bind-head h1 { margin: 7px 0 7px; font-size: 27px; }
.bind-head p { margin: 0; color: var(--muted); }
.bind-search-row { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 14px; }
.bind-search { flex: 1; margin-bottom: 0; }
.bind-search-row .button { min-width: 88px; height: 43px; }
.bind-results { min-height: 116px; max-height: 250px; overflow: auto; display: grid; gap: 8px; padding: 3px; }
.bind-result { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; border: 1px solid #dfe7ea; border-radius: 11px; padding: 11px 12px; background: #fafcfc; cursor: pointer; }
.bind-result:hover { border-color: #9fb4bf; background: #f2f7f8; }
.bind-result strong { display: block; font-size: 13px; }
.bind-result span { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }
.bind-results-hint { color: #607681; font-size: 11px; font-weight: 750; padding: 3px 2px 6px; }
.bind-result-main strong { display: block; font-size: 13px; }
.bind-result-main span { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }
.bind-result b { color: #587181; font-size: 11px; }
.bind-result.selected { border-color: #5f7f90; background: #e7eff2; box-shadow: 0 0 0 2px rgba(95,127,144,.12); }
.bind-selected { margin-top: 14px; padding: 13px 14px; border-radius: 11px; background: #edf3f5; color: #4f6876; font-weight: 750; }
.bind-actions { margin-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.bind-actions span { color: #a33d32; font-size: 12px; }
.user-chip { display: flex; align-items: center; gap: 7px; height: 40px; padding: 0 6px 0 12px; border-radius: 11px; border: 1px solid #d7e0e3; background: #f8fafb; color: #4b616c; font-size: 11px; font-weight: 750; }
.user-chip button { border: 0; border-radius: 8px; padding: 6px 8px; background: #e7eef1; color: #4f6876; cursor: pointer; }

@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .source-grid { grid-template-columns: repeat(2, 1fr); }
  .mapping-grid, .field-guide { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .auth-card { grid-template-columns: 1fr; min-height: auto; }
  .auth-side { padding: 30px; }
  .auth-form-side { padding: 32px 28px; }

  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 14px; }
  .nav { grid-template-columns: repeat(5, 1fr); margin-top: 12px; }
  .nav-item { justify-content: center; }
  .nav-item span:last-child { display: none; }
  .sidebar-status { display: none; }
  .main { padding: 18px 14px 40px; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .top-actions { width: 100%; flex-wrap: wrap; }
  .ranking-mode-control { order: 1; width: 100%; }
  .global-search { flex: 1; width: auto; }
  .prediction-list-head, .prediction-explainer { align-items: flex-start; flex-direction: column; }
  .two-one, .overview-lower, .rules-grid { grid-template-columns: 1fr; }
  .raw-toolbar { align-items: stretch; flex-direction: column; }
  .raw-tools { width: 100%; }
}
@media (max-width: 620px) {
  .auth-shell { padding: 12px; }
  .auth-side { display: none; }
  .bind-card { padding: 22px; }
  .bind-head { flex-direction: column; }
  .bind-search-row { align-items: stretch; flex-direction: column; }
  .bind-actions { align-items: stretch; flex-direction: column; }

  .stat-grid, .source-grid, .mapping-grid, .field-guide, .coverage-grid { grid-template-columns: 1fr; }
  .nav { grid-template-columns: repeat(4, 1fr); }
  .prediction-section-head .panel-note { display: none; }
  .prediction-scenarios { gap: 6px; }
  .prediction-scenario { padding: 9px 6px; }
  .prediction-population { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prediction-tools, .prediction-tools .field { width: 100%; }
  .toolbar-row { align-items: stretch; }
  .field, .field.grow, .search-field { min-width: 100%; width: 100%; }
  .top-actions { flex-direction: column; }
  .button { justify-content: center; }
  .detail-grid { grid-template-columns: 1fr; }
  .trace-grid { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 100px 1fr 44px; }
  .notice-card { padding: 22px; }
  .notice-footer { align-items: stretch; flex-direction: column; }
  .notice-avatar { width: 36px; height: 36px; flex-basis: 36px; }
}

