:root {
  --navy: #10263a;
  --navy-deep: #0a1b2b;
  --navy-soft: #19354c;
  --cream: #f7f5ef;
  --paper: #fffefa;
  --line: #e2e4e1;
  --ink: #172c3b;
  --muted: #6b7c85;
  --gold: #d9a653;
  --gold-light: #f8edda;
  --mint: #4cc8ad;
  --danger: #bd554d;
  --shadow: 0 20px 55px rgba(20, 38, 48, .08);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--cream); font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.topbar { position: relative; z-index: 4; min-height: 86px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 16px 32px; color: #fff; background: var(--navy); box-shadow: 0 6px 22px rgba(7, 27, 42, .12); }
.brand { display: flex; align-items: center; gap: 14px; flex: none; }
.brand-mark { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid rgba(255,255,255,.48); border-radius: 13px; color: var(--gold); font-size: 25px; font-weight: 800; }
.brand div { display: flex; flex-direction: column; gap: 2px; }
.brand strong { font-size: 22px; line-height: 1.2; letter-spacing: .05em; }
.brand div span { color: #b8c8d2; font-size: 12px; letter-spacing: .16em; }
.top-actions, .group-tools, .empty-actions, .modal-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.top-status { color: #c3d1d9; font-size: 13px; margin-right: 5px; }
.button { min-height: 42px; padding: 10px 17px; border-radius: 9px; border: 1px solid transparent; font-size: 14px; font-weight: 700; line-height: 1.25; transition: transform .16s ease, box-shadow .16s ease, background .16s ease; }
.button:not(:disabled):hover { transform: translateY(-1px); }
.button-primary { color: #13293b; background: var(--gold); border-color: var(--gold); }
.button-primary:not(:disabled):hover { background: #e7b45e; box-shadow: 0 8px 20px rgba(219, 167, 82, .22); }
.button-quiet { color: #e2eaf0; background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.18); }
.button-quiet:not(:disabled):hover { background: rgba(255,255,255,.17); }
.button-outline { color: var(--navy); background: var(--paper); border-color: #cdd6da; }
.button-outline:not(:disabled):hover { border-color: var(--navy); background: #f7f9f9; }
.button-large { min-height: 52px; padding: 14px 24px; font-size: 16px; }
.danger-outline { color: var(--danger); border-color: #e7c7c4; }
.danger-outline:not(:disabled):hover { border-color: var(--danger); background: #fff7f5; }
.layout { display: grid; grid-template-columns: 286px minmax(0, 1fr); min-height: calc(100vh - 132px); }
.sidebar { padding: 30px 20px; background: #fffefa; border-right: 1px solid var(--line); }
.sidebar-head { padding: 0 8px 24px; }
.eyebrow { display: inline-block; color: #a37b37; font-size: 11px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.sidebar h2 { margin: 8px 0; font-size: 21px; letter-spacing: -.02em; }
.sidebar p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.field-label { display: block; margin: 15px 0 7px; color: #405665; font-size: 13px; font-weight: 700; }
.field-control { width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid #d8e0e2; border-radius: 8px; background: #fff; color: var(--ink); outline: none; }
.field-control:focus { border-color: #a4b7bc; box-shadow: 0 0 0 3px rgba(76, 200, 173, .12); }
.group-list { display: flex; flex-direction: column; gap: 6px; margin-top: 25px; }
.group-list-empty { padding: 16px 8px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.group-list-head { margin: 13px 8px 7px; color: #7d9198; font-size: 11px; font-weight: 800; letter-spacing: .14em; }
.group-item { width: 100%; display: block; padding: 11px 12px; text-align: left; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--ink); }
.group-item:hover { background: #f2f5f3; }
.group-item.active { border-color: #b8d5ce; background: #eaf5f0; }
.group-item strong { display: block; font-size: 13px; font-weight: 800; line-height: 1.4; }
.group-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 4px; color: #7c8e96; font-size: 11px; }
.group-item .done-dot { float: right; color: #279c7f; font-size: 16px; }
.workspace { min-width: 0; padding: 32px clamp(20px, 3.5vw, 58px) 56px; }
.empty-state { max-width: 780px; margin: clamp(36px, 9vh, 120px) auto; text-align: center; }
.empty-emblem { display: grid; place-items: center; width: 134px; height: 134px; margin: 0 auto 28px; border: 1px solid #e6d4b7; border-radius: 32px; transform: rotate(-5deg); color: #c69950; background: #fffaf0; box-shadow: var(--shadow); font-family: Georgia, serif; font-size: 30px; font-weight: 700; }
.empty-state h1 { max-width: 670px; margin: 13px auto 17px; color: var(--navy); font-size: clamp(30px, 4vw, 52px); line-height: 1.25; letter-spacing: -.05em; }
.empty-state p { max-width: 585px; margin: 0 auto; color: var(--muted); font-size: 16px; line-height: 1.85; }
.empty-actions { justify-content: center; margin-top: 32px; }
.group-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 24px; }
.path-label { color: #a17b3b; font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.group-heading h1 { margin: 8px 0 4px; color: var(--navy); font-size: clamp(28px, 3vw, 43px); line-height: 1.2; letter-spacing: -.04em; }
.group-meta { margin: 0; color: var(--muted); font-size: 14px; }
.group-tools { justify-content: flex-end; }
.mode-row { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; margin: 0 0 18px; }
.mode-button { display: flex; align-items: baseline; gap: 10px; min-height: 58px; padding: 15px 19px; text-align: left; border: 1px solid #d8dfdf; border-radius: 12px; color: #506471; background: #fff; }
.mode-button span { flex: none; color: #99825d; font-size: 12px; font-weight: 800; }
.mode-button strong { font-size: 15px; }
.mode-button:hover { border-color: #9eb9b5; }
.mode-button.active { border-color: var(--navy); color: var(--navy); background: #eaf2ef; box-shadow: inset 0 0 0 1px var(--navy); }
.stage-layout { display: grid; grid-template-columns: minmax(0,1.7fr) minmax(250px,.8fr); gap: 16px; align-items: stretch; }
.stage-panel { position: relative; min-height: 372px; padding: clamp(24px, 3vw, 44px); overflow: hidden; border-radius: 18px; color: #fff; background: radial-gradient(circle at 80% 15%, #27516a 0, transparent 43%), linear-gradient(145deg, #0e273b, #112c42 65%, #0d2437); box-shadow: 0 18px 45px rgba(20, 46, 61, .15); }
.stage-panel::after { position: absolute; right: -68px; bottom: -175px; width: 360px; height: 360px; border: 1px solid rgba(219, 167, 82, .2); border-radius: 50%; content: ""; pointer-events: none; }
.stage-panel > * { position: relative; z-index: 1; }
.stage-kicker { color: #d5b474; font-size: 12px; font-weight: 800; letter-spacing: .16em; }
.stage-panel h2 { max-width: 700px; margin: 14px 0 14px; font-size: clamp(27px, 3.2vw, 45px); line-height: 1.25; letter-spacing: -.035em; }
.stage-panel p { max-width: 650px; color: #b9cbd3; font-size: 14px; line-height: 1.8; }
.stage-action { margin-top: 27px; min-height: 54px; padding: 13px 23px; border-radius: 9px; border: none; color: #10283b; background: var(--gold); font-size: 16px; font-weight: 800; }
.stage-action:not(:disabled):hover { background: #ebbc6d; }
.stage-outcome { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 18px; margin: 18px 0 8px; }
.stage-number { color: #edc77f; font-family: Georgia, serif; font-size: clamp(74px, 9vw, 132px); font-weight: 700; line-height: .95; letter-spacing: -.05em; }
.stage-number-label { padding-bottom: 10px; color: #dce8eb; font-size: 19px; font-weight: 700; }
.stage-school { color: #edc77f; font-size: clamp(26px, 3vw, 40px); font-weight: 800; line-height: 1.35; }
.stage-subline { margin-top: 9px; color: #dae7e9; font-size: 16px; }
.stage-step { margin-top: 28px; color: #98bbc5; font-size: 13px; }
.stage-progress { width: 100%; height: 7px; margin: 18px 0 3px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.12); }
.stage-progress span { display: block; height: 100%; border-radius: inherit; background: var(--mint); }
.stage-select { display: block; width: min(100%,430px); min-height: 47px; margin-top: 16px; padding: 10px 12px; border: 1px solid #7994a1; border-radius: 8px; color: #fff; background: #1b3b51; }
.stage-select option { color: #10263a; background: #fff; }
.draw-side-panel { min-height: 372px; padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: var(--shadow); }
.draw-side-panel h3 { margin: 0 0 13px; font-size: 18px; }
.draw-side-panel p { color: var(--muted); font-size: 13px; line-height: 1.7; }
.info-list { display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow: auto; }
.info-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid #edf0ef; font-size: 13px; line-height: 1.5; }
.info-row:last-child { border-bottom: 0; }
.info-row b { flex: none; color: #a47c39; }
.info-row.current { color: #087d63; font-weight: 800; }
.mini-stat { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid #e8eceb; color: #667984; font-size: 13px; }
.mini-stat strong { color: var(--navy); font-size: 17px; }
.results-panel { margin-top: 20px; padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: var(--shadow); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.section-heading h2 { margin: 5px 0 0; font-size: 21px; }
.count-pill { padding: 6px 11px; border-radius: 99px; color: #477064; background: #edf6f1; font-size: 12px; font-weight: 800; }
.results-empty { padding: 35px 0; color: #89989b; text-align: center; font-size: 14px; }
.result-table-wrap { width: 100%; overflow: auto; }
.result-table { width: 100%; border-collapse: collapse; text-align: left; }
.result-table th { padding: 12px 13px; color: #698088; background: #f4f7f5; font-size: 12px; font-weight: 800; }
.result-table td { padding: 14px 13px; border-bottom: 1px solid #edf0ef; font-size: 14px; }
.result-table tr:last-child td { border-bottom: 0; }
.result-table td:first-child { width: 85px; color: #b08138; font-family: Georgia, serif; font-size: 20px; font-weight: 800; }
.result-table td:nth-child(3) { color: #536c79; }
.footer { padding: 14px 24px; color: #8b989a; background: #fffefa; border-top: 1px solid var(--line); text-align: center; font-size: 12px; }
.modal { width: min(96vw, 590px); max-height: min(90vh, 900px); padding: 0; border: 1px solid #d9e0e0; border-radius: 16px; color: var(--ink); background: var(--paper); box-shadow: 0 30px 90px rgba(11, 30, 42, .25); }
.modal::backdrop { background: rgba(8, 25, 38, .65); }
.modal form { padding: 26px; }
.modal:not(:has(form)) { padding: 26px; }
.modal-wide { width: min(96vw, 1030px); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 17px; }
.modal-head h2 { margin: 5px 0 0; font-size: 25px; }
.icon-button { width: 35px; height: 35px; border: 0; border-radius: 8px; background: #f0f3f2; color: #536871; font-size: 25px; line-height: 1; }
.icon-button:hover { background: #e6ebea; }
.modal-actions { justify-content: flex-end; margin-top: 22px; }
.modal-copy { color: #667b83; font-size: 14px; line-height: 1.7; }
.form-error { min-height: 19px; margin: 12px 0 0; color: var(--danger); font-size: 13px; }
.import-warnings { max-height: 270px; overflow: auto; }
.import-warnings p { margin: 6px 0; padding: 9px 11px; border-radius: 8px; color: #8c6334; background: #fff4e7; font-size: 13px; line-height: 1.5; }
.editor-content { max-height: calc(90vh - 175px); overflow: auto; }
.editor-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.editor-columns { display: grid; grid-template-columns: minmax(0,.86fr) minmax(0,1.14fr); gap: 24px; margin-top: 23px; }
.editor-section-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.editor-section-head h3 { margin: 0 0 12px; font-size: 16px; }
.text-button { border: 0; color: #087d68; background: transparent; font-size: 13px; font-weight: 800; }
.text-button:hover { text-decoration: underline; }
.edit-row { display: flex; align-items: center; gap: 7px; margin: 8px 0; }
.edit-row .field-control { min-width: 0; }
.edit-row select { flex: 0 0 40%; }
.edit-row input { flex: 1; }
.small-delete { flex: none; width: 32px; height: 36px; border: 1px solid #e7d4d1; border-radius: 7px; color: var(--danger); background: #fff; font-size: 18px; }
.small-delete:hover { background: #fff1ef; }
.toast { position: fixed; z-index: 20; right: 24px; bottom: 25px; max-width: min(390px,calc(100vw - 48px)); padding: 13px 17px; border-radius: 10px; color: #fff; background: #183c50; box-shadow: 0 16px 40px rgba(12, 32, 45, .22); font-size: 13px; line-height: 1.55; opacity: 0; transform: translateY(16px); pointer-events: none; transition: .25s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.is-fullscreen .sidebar, .is-fullscreen .footer, .is-fullscreen .top-status, .is-fullscreen #importButton, .is-fullscreen #newGroupButton { display: none; }
.is-fullscreen .layout { grid-template-columns: 1fr; }
.is-fullscreen .workspace { padding: 28px 4vw; }
.is-fullscreen .stage-panel, .is-fullscreen .draw-side-panel { min-height: 48vh; }
@media (max-width: 1150px) {
  .topbar { padding: 15px 22px; }
  .top-status { display: none; }
  .layout { grid-template-columns: 240px minmax(0,1fr); }
  .stage-layout { grid-template-columns: 1fr; }
  .draw-side-panel { min-height: 0; }
}
@media (max-width: 760px) {
  .topbar { align-items: flex-start; flex-direction: column; gap: 14px; }
  .top-actions { width: 100%; }
  .layout { display: block; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); padding: 18px; }
  .sidebar-head { padding-bottom: 7px; }
  .sidebar-head p { display: none; }
  .group-list { flex-direction: row; overflow: auto; margin-top: 12px; }
  .group-list-head { display: none; }
  .group-item { flex: 0 0 190px; }
  .workspace { padding: 22px 16px 40px; }
  .mode-row, .editor-fields, .editor-columns { grid-template-columns: 1fr; }
  .group-tools { justify-content: flex-start; }
  .stage-panel { min-height: 320px; }
  .empty-state { margin: 45px auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Live draw stage */
.brand-mark { width: 44px; height: 44px; border: 0; color: var(--gold); background: rgba(255,255,255,.09); }
.brand-mark svg { width: 31px; height: 31px; }
.brand strong { font-size: 21px; }
.empty-state { max-width: none; margin: 0; padding: 28px 32px; text-align: left; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: var(--shadow); }
.empty-state h1 { max-width: none; margin: 0 0 8px; font-size: clamp(23px, 2.4vw, 31px); letter-spacing: -.03em; }
.empty-state p { max-width: none; margin: 0; font-size: 14px; line-height: 1.6; }
.empty-actions { justify-content: flex-start; margin-top: 22px; }
.group-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 10px; color: var(--muted); font-size: 14px; }
.status-badge { display: inline-flex; align-items: center; min-height: 27px; padding: 4px 11px; border-radius: 99px; background: #e8edf0; color: #455e6c; font-size: 12px; font-weight: 800; }
.status-badge::before { content: ""; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: currentColor; }
.status-badge.in-progress { color: #996626; background: #fff0d8; }
.status-badge.completed { color: #087b61; background: #dff5ea; }
.stage-panel { height: 530px; min-height: 530px; padding: 31px 34px; display: grid; grid-template-rows: 22px 88px 52px 42px minmax(0,1fr) 68px 40px; row-gap: 4px; }
.stage-kicker { align-self: center; }
.stage-panel .stage-title { display: block; min-width: 0; max-width: none; height: 88px; margin: 0; overflow: hidden; font-size: clamp(27px, 2.9vw, 36px); line-height: 1.2; overflow-wrap: anywhere; }
.stage-title-highlight { color: #f0c36f; font-weight: 900; }
.stage-panel .stage-title.compact { font-size: clamp(21px, 2.2vw, 27px); }
.stage-panel .stage-copy { max-width: none; height: 52px; margin: 0; overflow: auto; color: #b9cbd3; font-size: 13px; line-height: 1.55; }
.stage-previous { display: flex; align-items: center; gap: 10px; min-width: 0; height: 42px; padding: 7px 12px; border: 1px solid rgba(255,255,255,.13); border-radius: 8px; color: #cad9dd; background: rgba(255,255,255,.05); font-size: 12px; }
.stage-previous-label { flex: none; color: #90aeb8; }
.stage-previous-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #f3d395; font-size: 14px; font-weight: 800; }
.stage-previous-number { flex: none; margin-left: auto; color: #f3d395; font-size: 16px; }
.stage-previous-empty { color: #87a1aa; }
.stage-focus { display: grid; grid-template-rows: 42px minmax(0, 1fr); align-content: start; min-width: 0; min-height: 0; padding: 10px 0; }
.stage-focus-label { min-height: 42px; overflow: hidden; color: #a9c5ce; font-size: 13px; font-weight: 700; line-height: 1.45; overflow-wrap: anywhere; }
.stage-focus-school { margin-left: 4px; color: #f1c57a; font-size: 15px; font-weight: 900; }
.stage-focus-value { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; align-self: start; max-height: 70px; overflow: hidden; color: #f1c57a; font-size: 26px; font-weight: 800; line-height: 1.34; overflow-wrap: anywhere; }
.stage-focus-value.is-flashing { font-variant-numeric: tabular-nums; }
.is-rolling .stage-focus-value { animation: none; }
.stage-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; min-height: 68px; }
.stage-select-slot { min-width: 0; }
.stage-select { width: 100%; min-height: 48px; margin: 0; }
.stage-action { min-width: 200px; min-height: 50px; margin: 0; padding: 10px 16px; white-space: nowrap; }
.stage-progress-area { align-self: end; }
.stage-progress { height: 6px; margin: 0 0 8px; }
.stage-step { margin: 0; font-size: 12px; }
.draw-side-panel { min-height: 530px; }
@media (max-width: 1080px) {
  .stage-layout { grid-template-columns: minmax(0,1fr); }
  .draw-side-panel { min-height: 0; }
}
@media (max-width: 700px) {
  .empty-state { padding: 22px; }
  .stage-panel { height: 550px; min-height: 550px; padding: 24px; grid-template-rows: 22px 92px 58px 42px minmax(0,1fr) 108px 40px; }
  .stage-panel .stage-title { height: 92px; }
  .stage-panel .stage-copy { height: 58px; }
  .stage-controls { grid-template-columns: 1fr; grid-template-rows: 48px 50px; gap: 8px; }
  .stage-action { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .is-rolling .stage-focus-value { animation: none; }
}

/* Compact desktop draw screen */
@media (min-width: 1081px) {
  .stage-layout { grid-template-columns: minmax(0, 1.5fr) minmax(340px, .9fr); }
}
@media (min-width: 1081px) and (max-height: 900px) {
  .topbar { min-height: 62px; padding: 8px 22px; }
  .brand-mark { width: 38px; height: 38px; }
  .brand-mark svg { width: 27px; height: 27px; }
  .workspace { padding-top: 12px; padding-bottom: 24px; }
  .group-heading { margin-bottom: 10px; }
  .group-heading h1 { margin: 4px 0 2px; font-size: 28px; }
  .group-meta { margin-top: 4px; }
  .mode-row { margin-bottom: 10px; }
  .mode-button { min-height: 48px; padding: 10px 14px; }
  .stage-panel { height: 400px; min-height: 400px; padding: 20px 23px; grid-template-rows: 18px 58px 44px 34px minmax(0,1fr) 52px 28px; row-gap: 3px; }
  .stage-panel .stage-title { height: 58px; font-size: clamp(22px, 2.2vw, 28px); }
  .stage-panel .stage-title.compact { font-size: 22px; }
  .stage-panel .stage-copy { height: 44px; font-size: 12px; line-height: 1.45; }
  .stage-previous { height: 34px; padding: 4px 9px; }
  .stage-focus { grid-template-rows: 32px minmax(0,1fr); padding: 5px 0; }
  .stage-focus-label { min-height: 32px; font-size: 12px; }
  .stage-focus-value { max-height: 60px; font-size: 22px; }
  .stage-controls { min-height: 52px; }
  .stage-action { min-height: 44px; }
  .stage-progress-area .stage-step { font-size: 11px; }
  .draw-side-panel { height: 400px; min-height: 400px; padding: 15px 17px; }
  .draw-side-panel h3 { margin-bottom: 7px; font-size: 15px; }
  .draw-side-panel p { margin: 5px 0 8px; font-size: 11px; line-height: 1.35; }
  .draw-side-panel .info-list { max-height: none; overflow: visible; gap: 0; }
  .draw-side-panel .info-row { padding: 4px 0; font-size: 11.5px; line-height: 1.25; }
  .draw-side-panel .info-row b { font-size: 11px; }
  .school-order-list.many { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); column-gap: 10px; }
}
/* Result rows stay in the page below the draw stage. */
.results-panel { padding: 18px; scroll-margin-top: 14px; }
.final-results-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 6px; }
.final-results-grid.single { grid-template-columns: 1fr; }
.final-results-column { min-width: 0; }
.final-result-head, .final-result-row { display: grid; grid-template-columns: 32px minmax(0,1.1fr) minmax(116px,.9fr); align-items: center; gap: 5px; min-width: 0; }
.final-result-head { min-height: 31px; padding: 5px 6px; border-radius: 7px 7px 0 0; color: #698088; background: #f0f4f2; font-size: 11px; font-weight: 800; }
.final-result-row { min-height: 46px; padding: 4px 6px; border-bottom: 1px solid #e9eeeb; font-size: 14px; line-height: 1.18; }
.final-result-row:nth-child(odd) { background: #f8faf8; }
.final-result-number { color: #aa7b33; font-family: Georgia, serif; font-size: 20px; text-align: center; }
.final-result-program { min-width: 0; color: var(--navy); font-weight: 800; overflow-wrap: anywhere; }
.final-result-school { min-width: 0; color: #536e79; overflow-wrap: anywhere; }
.draw-side-panel:not(.preparation) { overflow: auto; }
.draw-side-panel:not(.preparation) .info-row { padding: 7px 0; font-size: 13px; line-height: 1.35; }
.draw-side-panel:not(.preparation) .info-row b { font-size: 12px; }
.draw-side-panel:not(.preparation) h3 { font-size: 17px; }
.draw-side-panel:not(.preparation) .school-order-list { display: flex; flex-direction: column; max-height: clamp(160px, 28dvh, 280px); overflow-y: auto; }
.draw-side-panel:not(.preparation) .info-list:not(.school-order-list) { max-height: 140px; overflow-y: auto; }
.draw-side-panel.preparation .school-order-list { max-height: none; overflow: visible; }
@media (max-width: 900px) {
  .final-results-grid { grid-template-columns: 1fr; }
}
/* Keep the school panel in place as the draw moves between programs. */
.draw-side-panel { display: flex; flex-direction: column; }
.draw-side-panel.school-overview { overflow: auto; }
.draw-side-panel.school-overview .school-order-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  grid-auto-rows: minmax(30px,1fr);
  column-gap: 8px;
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
}
.draw-side-panel.school-overview .info-row { min-width: 0; padding: 4px 0; font-size: 12.5px; line-height: 1.2; }
.draw-side-panel.school-overview .info-row span { min-width: 0; overflow-wrap: anywhere; }
.draw-side-panel:not(.preparation):not(.school-overview) { overflow: hidden; }
.draw-side-panel:not(.preparation):not(.school-overview) .school-order-list {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  justify-content: space-between;
}
.final-result-row.pending { background: #fafbf9; }
.final-result-row.pending .final-result-number { color: #b5bfba; }
.final-result-row.pending .final-result-program { color: #a2aea8; font-weight: 400; }