:root {
  color-scheme: light;
  --ink: #16213a;
  --muted: #4a5873;
  --accent: #27468a;
  --accent-dark: #1b336a;
  --navy: #1d3566;
  --navy-deep: #13254b;
  --laurel: #2343b0;
  --gold: #f1ea8f;
  --gold-deep: #c8b445;
  --surface: #fff;
  --border: #dbe2ee;
  --soft: #edf1fa;
  --background: #f4f6fb;
  --shadow: 0 1px 2px #13254b0f, 0 6px 22px -10px #13254b2e;
  font-family: 'Segoe UI', system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--ink); font-size: 14px; line-height: 1.5; }
button, input, select { font: inherit; color: inherit; }
button, select { cursor: pointer; }
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid #29789f; outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
.skip { position: fixed; left: 12px; top: -100px; z-index: 10; padding: 10px; background: white; }
.skip:focus { top: 12px; }
.frame { width: min(1240px, calc(100% - 64px)); margin-inline: auto; }
.topbar { background: white; border-bottom: 1px solid var(--border); }
.header-inner { min-height: 62px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.brand { color: var(--ink); display: inline-flex; gap: 9px; align-items: center; white-space: nowrap; font-size: 17px; line-height: 1.1; font-weight: 720; letter-spacing: -.3px; }
.brand:hover { text-decoration: none; }
.navigation { display: flex; align-items: center; gap: 4px; }
.navigation a { display: inline-flex; gap: 6px; align-items: center; padding: 9px 13px; border-radius: 4px; white-space: nowrap; color: var(--muted); font-size: 13px; font-weight: 650; }
.navigation a[aria-current], .navigation a:hover { color: var(--accent-dark); background: var(--soft); text-decoration: none; }
.mini-count { color: var(--muted); font-size: 11px; font-weight: 650; }
.header-source { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; color: var(--muted); font-size: 12px; font-weight: 650; }
main.frame { min-height: calc(100vh - 160px); padding-bottom: 54px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; }
.predict-form { padding: 16px; }
.icon-square { display: inline-grid; place-items: center; width: 30px; height: 30px; color: var(--accent); background: var(--soft); flex: none; }
[data-icon] svg { display: block; }
.fields { display: grid; grid-template-columns: 1fr 1fr 1fr 1.26fr auto; align-items: end; gap: 13px; }
label { display: block; min-width: 0; font-size: 12px; font-weight: 690; }
.required { color: var(--accent); }
input, select { width: 100%; min-height: 40px; border: 1px solid #b9c7d2; border-radius: 4px; background: white; margin-top: 5px; padding: 8px 10px; font-size: 13px; }
select { padding-right: 24px; }
input::placeholder { color: #596b7a; }
.button { min-height: 38px; border: 1px solid #becbd5; border-radius: 4px; background: white; padding: 8px 12px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-weight: 650; font-size: 12px; white-space: nowrap; color: var(--ink); }
.button:hover { background: var(--soft); border-color: #9eb4c4; text-decoration: none; }
.button.primary { color: white; background: var(--accent); border-color: var(--accent); }
.button.primary:hover { background: var(--accent-dark); }
.predict-button { min-height: 40px; padding-inline: 15px; font-size: 13px; }
.notice { display: flex; gap: 9px; align-items: start; color: var(--muted); background: var(--soft); border-left: 3px solid #b4c9d7; padding: 10px 13px; margin-top: 14px; font-size: 12px; }
.notice [data-icon] { color: var(--accent); margin-top: 1px; flex: none; }
.notice a { font-weight: 700; }
.result-head { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin: 25px 0 13px; }
.result-head h2 { font-size: 23px; line-height: 1.2; letter-spacing: -.4px; }
.result-head p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.actions { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.table-tools { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.table-tools select, .table-tools input { min-height: 37px; margin: 0; }
.table-tools input { width: min(225px, 100%); }
.table-tools select { width: auto; max-width: 245px; }
.page-size label { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.page-size select { width: auto; min-height: 34px; margin: 0; padding: 5px 8px; }
.tabs { display: flex; gap: 4px 12px; flex-wrap: wrap; padding: 0 13px; border-bottom: 1px solid var(--border); }
.tab { padding: 11px 3px 9px; border: 0; border-bottom: 2px solid transparent; background: white; color: var(--muted); font-weight: 650; font-size: 13px; white-space: nowrap; }
.tab:hover, .tab[aria-pressed="true"] { color: var(--accent-dark); border-bottom-color: var(--accent); }
.tab-count { margin-left: 3px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.result-guide { color: var(--muted); margin: 10px 14px 0; font-size: 12px; }
.result-guide a { text-decoration: underline; text-underline-offset: 2px; }
.rank-legend { display: inline-flex; align-items: center; gap: 5px; margin-left: 12px; white-space: nowrap; }
.legend-band { width: 13px; height: 6px; border-radius: 1px; background: #8eb7cf; }
.legend-marker { width: 2px; height: 10px; margin-left: 6px; background: #173247; }
.rank-rail, .cutoff-track { position: relative; display: block; height: 10px; background: linear-gradient(#d5e0e7, #d5e0e7) center / 100% 2px no-repeat; }
.prediction-range .rank-rail { width: 108px; margin-top: 3px; }
.rank-band { position: absolute; left: var(--band-start); right: calc(100% - var(--band-end)); top: 2px; height: 6px; min-width: 2px; border-radius: 1px; background: #8eb7cf; }
.rank-marker { position: absolute; left: var(--your-air); top: 0; width: 2px; height: 10px; background: #173247; }
.scroll-table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
th { font-size: 12px; white-space: nowrap; font-weight: 680; color: var(--muted); background: #f1f5f8; }
th, td { padding: 10px 13px; border-bottom: 1px solid var(--border); }
td { vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f8fafb; }
.number { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 730; }
.college-cell { min-width: 135px; }
.college-cell b, .branch-cell b { display: block; line-height: 1.35; }
.branch-cell { min-width: 145px; }
.branch-cell small, td small { display: block; color: var(--muted); font-size: 11px; font-weight: 500; margin-top: 2px; }
.row-actions { display: flex; justify-content: end; gap: 3px; }
.icon-button { display: inline-grid; place-items: center; min-width: 34px; min-height: 34px; background: white; border: 1px solid var(--border); border-radius: 4px; color: var(--accent); }
.icon-button:hover, .icon-button[aria-pressed="true"] { color: var(--accent-dark); background: var(--soft); border-color: #b2c6d5; }
.icon-button[aria-pressed="true"] svg { fill: #c0d9e7; }
.icon-button:disabled { cursor: default; opacity: .35; }
.badge { display: inline-flex; border-radius: 3px; padding: 3px 6px; color: #4b5a66; background: #edf1f4; font-size: 11px; font-weight: 680; white-space: nowrap; }
.badge.strong { color: #176146; background: #e7f4ed; }
.badge.possible { color: #174f70; background: #e9f2f8; }
.badge.reach { color: #744809; background: #fff2dc; }
.pagination { border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: 11px 13px; gap: 10px; color: var(--muted); font-size: 12px; }
.pagination .button { min-height: 34px; }
.pagination button:disabled { opacity: .42; cursor: default; }
.subpage-heading { margin: 30px 0 18px; }
.subpage-heading h1 { font-size: clamp(29px, 3.4vw, 44px); line-height: 1.12; letter-spacing: -.035em; }
.subpage-heading p { margin-top: 7px; color: var(--muted); font-size: 14px; }
.subpage-heading .session-label { margin: 0 0 7px; color: var(--accent-dark); font-size: 13px; font-weight: 650; }
.subpage-heading .data-summary { font-size: 12px; }
.filter-panel { padding: 16px; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 12px; }
.empty { text-align: center; padding: 33px 18px; }
.empty .icon-square { margin-inline: auto; margin-bottom: 9px; }
.empty h3 { font-size: 17px; }
.empty p { color: var(--muted); max-width: 480px; margin: 5px auto 12px; }
.method-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; }
.method-card { padding: 19px; }
.method-card h2 { font-size: 20px; margin-bottom: 8px; }
.method-card h3 { font-size: 15px; margin-top: 15px; }
.method-card p, .method-card li { color: var(--muted); margin-top: 6px; }
.method-card ul { padding-left: 20px; margin-bottom: 0; }
.site-footer { border-top: 1px solid var(--border); background: white; }
.footer-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.footer-inner .brand { font-size: 16px; }
.footer-inner > a:last-child { font-weight: 700; white-space: nowrap; }
.details-dialog { border: 1px solid var(--border); border-radius: 6px; width: min(730px, calc(100% - 30px)); max-height: calc(100% - 30px); color: var(--ink); box-shadow: 0 14px 50px #192c4340; padding: 0; }
.details-dialog::backdrop { background: #17243180; }
.dialog-inner { padding: 23px; position: relative; }
.close-dialog { position: absolute; top: 12px; right: 12px; }
.dialog-inner h2 { font-size: 25px; letter-spacing: -.55px; margin: 3px 37px 1px 0; }
.dialog-inner p { color: var(--muted); }
.dialog-inner h3 { font-size: 16px; margin: 17px 0 7px; }
.seat-grid { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.seat-box { padding: 6px 9px; min-width: 44px; border: 1px solid var(--border); border-radius: 4px; text-align: center; background: var(--background); }
.seat-box span { display: block; color: var(--muted); font-size: 10px; }
.detail-table { border: 1px solid var(--border); border-radius: 4px; }
.dialog-inner select { max-width: 240px; margin-bottom: 8px; }
.detail-note { margin-top: 8px; font-size: 12px; color: var(--muted); }
.cutoff-chart { margin: 9px 0; border: 1px solid var(--border); border-radius: 4px; padding: 10px 12px; background: var(--background); }
.cutoff-chart figcaption { margin-bottom: 6px; font-size: 12px; font-weight: 700; }
.cutoff-chart-row { display: grid; grid-template-columns: 65px minmax(35px, 1fr) 105px; align-items: center; gap: 8px; min-height: 23px; font-size: 12px; }
.cutoff-chart-row strong { text-align: right; font-variant-numeric: tabular-nums; }
.cutoff-dot { position: absolute; top: 2px; width: 6px; height: 6px; border-radius: 50%; transform: translateX(-50%); background: var(--accent); }
.detail-table table th, .detail-table table td { padding: 7px 10px; }
.toast { position: fixed; z-index: 5; bottom: 20px; right: 20px; padding: 10px 15px; border-radius: 4px; color: white; background: var(--ink); }

/* Allotments, seat matrix and mock allotment */
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 18px 0 12px; }
.stat-strip > div { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 11px 14px; }
.stat-strip strong { display: block; font-size: 20px; line-height: 1.2; font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.stat-strip span { color: var(--muted); font-size: 12px; }
.tabs-end { margin-left: auto; display: flex; align-items: center; padding: 5px 0; }
.tabs-end .button { min-height: 32px; }
.up { color: #176146; }
.down { color: #a33b2b; }
.muted-note { color: var(--muted); font-size: 11px; white-space: nowrap; }
td .badge { margin-top: 4px; }
.matrix-grid { max-height: 70vh; overflow: auto; }
.matrix-grid table { font-size: 12px; width: auto; min-width: 100%; }
.matrix-grid th, .matrix-grid td { padding: 5px 6px; text-align: center; }
.matrix-grid thead th { position: sticky; top: 0; z-index: 2; font-size: 11px; white-space: normal; min-width: 54px; line-height: 1.2; vertical-align: bottom; }
.matrix-grid .grid-branch { position: sticky; left: 0; z-index: 1; text-align: left; background: #f1f5f8; min-width: 190px; max-width: 230px; white-space: normal; font-size: 12px; color: var(--ink); }
.matrix-grid thead .grid-branch { z-index: 3; }
.grid-total td, .grid-total th { border-top: 2px solid var(--border); background: #f1f5f8; }
.seat-chip { width: 40px; height: 28px; border: 0; border-radius: 3px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); background: color-mix(in srgb, var(--accent) var(--fill), white); }
.seat-chip.dark { color: white; }
.seat-chip:hover { outline: 2px solid var(--accent-dark); outline-offset: 1px; }
.grid-guide { margin-bottom: 12px; }

@media (max-width: 1180px) {
  .header-inner { flex-wrap: wrap; padding-top: 12px; gap: 9px; }
  .navigation { order: 3; width: 100%; overflow-x: auto; padding-bottom: 8px; }
}

@media (max-width: 1000px) {
  .frame { width: calc(100% - 36px); }
  .fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .frame { width: calc(100% - 24px); }
  .header-inner { flex-wrap: wrap; padding-top: 12px; gap: 9px; }
  .navigation { order: 3; width: 100%; overflow-x: auto; padding-bottom: 8px; }
  .navigation a { font-size: 12px; padding: 7px 8px; }
  .subpage-heading { margin: 21px 0 14px; }
  .predict-form { margin-top: 13px; padding: 13px; }
  .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .predict-button { grid-column: span 2; justify-self: stretch; }
  .result-head { align-items: start; flex-wrap: wrap; }
  .tabs { gap: 0 12px; }
  .tab { padding-block: 9px; }
  .table-tools { align-items: start; flex-direction: column; }
  .table-tools input { width: 100%; }
  .rank-legend { display: flex; margin: 5px 0 0; }
  #prediction-table table, #prediction-table tbody { display: block; }
  #prediction-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  #prediction-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
  #prediction-table tbody tr:last-child { border-bottom: 0; }
  #prediction-table td { display: block; padding: 0; border: 0; }
  #prediction-table .college-cell, #prediction-table .branch-cell { min-width: 0; }
  .prediction-institute, .prediction-branch { grid-column: 1; }
  .prediction-grade { grid-column: 1 / -1; }
  .prediction-actions { grid-column: 2; grid-row: 1 / span 2; }
  .prediction-seats { text-align: right; }
  #prediction-table [data-label]::before { content: attr(data-label); display: block; color: var(--muted); font-size: 11px; font-weight: 550; }
  .method-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-wrap: wrap; padding-block: 10px; }
  .footer-inner p { order: 3; width: 100%; }
  .stat-strip { grid-template-columns: 1fr 1fr; }
  .matrix-grid .grid-branch { min-width: 130px; }
}
.chance { display: block; font-size: 20px; line-height: 1.1; letter-spacing: -.3px; }
.chance-strong { color: #176146; }
.chance-possible { color: #174f70; }
.chance-reach { color: #744809; }
td.picked { background: #eef4f8; color: var(--accent-dark); }
.badge.outlook { font-size: 12px; padding: 4px 8px; }
