:root {
  --ink: #112520;
  --muted: #61736c;
  --line: #d7e5df;
  --paper: #f4fbf8;
  --panel: #ffffff;
  --accent: #0f766e;
  --accent-dark: #0f4f4a;
  --aqua: #1db8c3;
  --leaf: #70c77d;
  --gold: #b7791f;
  --sun: #f3b64a;
  --red: #b42318;
  --blue: #2563eb;
  --shadow: 0 18px 45px rgba(27, 50, 42, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 11% 16%, rgba(112, 199, 125, 0.22), transparent 28rem),
    radial-gradient(circle at 87% 12%, rgba(29, 184, 195, 0.2), transparent 30rem),
    linear-gradient(160deg, rgba(255, 255, 255, 0.9), rgba(228, 247, 239, 0.54) 45%, rgba(237, 248, 255, 0.72)),
    var(--paper);
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-text-size-adjust: 100%;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(15, 79, 74, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 79, 74, 0.06) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 72%);
}

button,
input,
select {
  font: inherit;
}

[hidden] {
  display: none !important;
}

.icon-button,
select,
input {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  width: min(1480px, calc(100vw - 32px));
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) 0 max(32px, env(safe-area-inset-bottom));
}

.calculator-only .app-shell {
  width: min(1280px, calc(100vw - 32px));
}

.calculator-only .topbar {
  padding-top: 16px;
}

.hero {
  position: relative;
  min-height: min(760px, calc(100vh - 120px));
  padding: 18px 0 28px;
  isolation: isolate;
}

.hero::after {
  position: absolute;
  right: 2%;
  bottom: 5%;
  z-index: -1;
  width: min(520px, 42vw);
  aspect-ratio: 1;
  border: 1px solid rgba(15, 118, 110, 0.1);
  border-radius: 50%;
  content: "";
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.72) 0 24%, transparent 25%),
    conic-gradient(from 120deg, rgba(29, 184, 195, 0.16), rgba(243, 182, 74, 0.15), rgba(112, 199, 125, 0.18), rgba(29, 184, 195, 0.16));
  filter: blur(2px);
}

.hero-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 2px 34px;
}

.brand-lockup,
.nav-cta,
.primary-action,
.secondary-action {
  color: inherit;
  text-decoration: none;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(15, 118, 110, 0.26);
  border-radius: 10px;
  color: #063f3a;
  background: linear-gradient(145deg, #ffffff, #dff9ef);
  box-shadow: 0 12px 24px rgba(15, 79, 74, 0.12);
  font-size: 13px;
  letter-spacing: 0;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: 8px;
  color: var(--accent-dark);
  background: rgba(255, 255, 255, 0.72);
  font-weight: 750;
  box-shadow: 0 10px 22px rgba(27, 50, 42, 0.08);
}

.hero-content {
  display: grid;
  grid-template-columns: minmax(0, 0.96fr) minmax(420px, 0.78fr);
  gap: clamp(28px, 5vw, 78px);
  align-items: center;
  min-height: 510px;
}

.hero-copy {
  max-width: 760px;
}

.hero h1 {
  max-width: 880px;
  font-size: clamp(44px, 5.6vw, 72px);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero h1 span {
  display: block;
}

.hero-lede {
  max-width: 680px;
  margin: 24px 0 0;
  color: #36534b;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.62;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 8px;
  font-weight: 800;
}

.primary-action {
  padding: 0 22px;
  color: #ffffff;
  background: linear-gradient(135deg, #0f766e, #1796a0);
  box-shadow: 0 16px 34px rgba(15, 118, 110, 0.24);
}

.secondary-action {
  padding: 0 18px;
  border: 1px solid rgba(15, 118, 110, 0.24);
  color: var(--accent-dark);
  background: rgba(255, 255, 255, 0.66);
}

.hero-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.hero-proof span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-radius: 999px;
  color: #2f5149;
  background: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  font-weight: 850;
  box-shadow: 0 10px 22px rgba(27, 50, 42, 0.06);
}

.signal-board {
  position: relative;
  min-height: 520px;
}

.orbit-ring {
  position: absolute;
  inset: 42px 26px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 49.5%, rgba(15, 118, 110, 0.13) 50%, transparent 50.5%),
    linear-gradient(0deg, transparent 49.5%, rgba(15, 118, 110, 0.13) 50%, transparent 50.5%),
    radial-gradient(circle, rgba(255, 255, 255, 0.8), rgba(224, 246, 238, 0.54) 48%, rgba(255, 255, 255, 0.15) 49%, transparent 70%);
  box-shadow: inset 0 0 60px rgba(29, 184, 195, 0.08);
}

.orbit-ring::before,
.orbit-ring::after {
  position: absolute;
  inset: 14%;
  border: 1px dashed rgba(15, 118, 110, 0.24);
  border-radius: 50%;
  content: "";
}

.orbit-ring::after {
  inset: 32%;
  border-style: solid;
  border-color: rgba(243, 182, 74, 0.38);
}

.signal-node,
.signal-card {
  position: absolute;
  box-shadow: 0 18px 38px rgba(27, 50, 42, 0.12);
}

.signal-node {
  display: grid;
  place-items: center;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.78);
  color: var(--accent-dark);
  font-weight: 900;
  backdrop-filter: blur(14px);
}

.node-main {
  top: 214px;
  left: 50%;
  width: 86px;
  height: 86px;
  transform: translateX(-50%);
  color: #ffffff;
  background: linear-gradient(145deg, #0f766e, #1db8c3);
  font-size: 24px;
}

.node-hku,
.node-cuhk,
.node-hkust {
  width: 68px;
  height: 68px;
  font-size: 12px;
}

.node-hku {
  top: 64px;
  left: 16%;
}

.node-cuhk {
  right: 14%;
  top: 142px;
}

.node-hkust {
  right: 10%;
  bottom: 118px;
}

.signal-card {
  width: min(280px, 56%);
  padding: 16px;
  border: 1px solid rgba(215, 229, 223, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px);
}

.signal-card span {
  display: block;
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.signal-card strong {
  display: block;
  margin-top: 8px;
  font-size: 18px;
  line-height: 1.25;
}

.signal-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.42;
}

.score-card {
  top: 18px;
  right: 0;
}

.match-card {
  left: 0;
  bottom: 82px;
}

.insight-card {
  right: 4%;
  bottom: 8px;
}

.advantage-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.advantage-strip article {
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(215, 229, 223, 0.88);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 14px 30px rgba(27, 50, 42, 0.08);
  backdrop-filter: blur(14px);
}

.advantage-strip span {
  color: var(--sun);
  font-size: 12px;
  font-weight: 900;
}

.advantage-strip h2 {
  margin-top: 8px;
  font-size: 18px;
}

.advantage-strip p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.product-preview {
  display: grid;
  grid-template-columns: minmax(280px, 0.34fr) minmax(0, 1fr);
  gap: clamp(18px, 3vw, 44px);
  align-items: stretch;
  scroll-margin-top: 24px;
  padding: 28px 0 52px;
}

.preview-copy {
  min-width: 0;
  align-self: stretch;
  padding: clamp(18px, 2.4vw, 28px);
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 16px 42px rgba(27, 50, 42, 0.08);
  backdrop-filter: blur(14px);
}

.preview-copy h2 {
  font-size: clamp(24px, 2.5vw, 34px);
  line-height: 1.14;
}

.preview-copy p {
  max-width: 520px;
  margin: 16px 0 0;
  color: #426058;
  font-size: 16px;
  line-height: 1.7;
}

.preview-note {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.preview-note span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 6px;
  color: var(--accent-dark);
  background: rgba(223, 247, 237, 0.72);
  font-size: 13px;
  font-weight: 850;
}

.preview-frame {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 14px;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.94), rgba(226, 249, 241, 0.88)),
    var(--panel);
  box-shadow: 0 24px 70px rgba(27, 50, 42, 0.15);
}

.preview-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(15, 118, 110, 0.12);
  background: rgba(255, 255, 255, 0.64);
}

.preview-toolbar span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #8dd9c1;
}

.preview-toolbar span:nth-child(2) {
  background: #f3d36f;
}

.preview-toolbar span:nth-child(3) {
  background: #7ac9d1;
}

.preview-toolbar strong {
  margin-left: 8px;
  color: var(--accent-dark);
  font-size: 12px;
}

.preview-dashboard {
  display: grid;
  grid-template-columns: 0.94fr 1.22fr;
  gap: 12px;
  padding: clamp(14px, 2.4vw, 22px);
  background: linear-gradient(180deg, rgba(244, 251, 248, 0.92), rgba(255, 255, 255, 0.58));
}

.preview-overview-card,
.preview-filter-bar,
.preview-table {
  min-width: 0;
  border: 1px solid rgba(215, 229, 223, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
}

.preview-overview-card {
  padding: 14px;
}

.preview-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.preview-card-head span {
  color: var(--accent);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.02em;
}

.preview-card-head strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 19px;
  line-height: 1.18;
}

.preview-card-head em {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 999px;
  color: #0f4f4a;
  background: #dff7ed;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.preview-score-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 11px;
}

.preview-score-chips b {
  display: inline-grid;
  grid-template-columns: auto auto;
  gap: 6px;
  align-items: center;
  min-height: 31px;
  padding: 5px 8px;
  border: 1px solid rgba(215, 229, 223, 0.92);
  border-radius: 8px;
  color: var(--accent-dark);
  background: #f8fcfa;
  font-size: 13px;
}

.preview-score-chips small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}

.preview-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.preview-metrics article {
  min-width: 0;
  padding: 10px;
  border-radius: 8px;
  background: #edf9f5;
}

.preview-metrics span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.preview-metrics strong {
  display: block;
  margin-top: 5px;
  color: var(--accent-dark);
  font-size: 22px;
  line-height: 1;
}

.preview-prefs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 10px;
}

.preview-prefs span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, #0f766e, #1db8c3);
  font-size: 11px;
  font-weight: 900;
}

.preview-band-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.preview-band-grid article {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(215, 229, 223, 0.92);
  border-radius: 8px;
  background: #fafdfe;
}

.preview-band-label {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: var(--accent);
  font-size: 12px;
  font-weight: 950;
}

.preview-band-grid strong {
  display: block;
  min-height: 36px;
  margin-top: 8px;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
}

.preview-band-grid p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.preview-filter-bar {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px;
}

.preview-filter-bar span {
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.preview-filter-bar strong {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.preview-table {
  grid-column: 1 / -1;
  overflow: hidden;
}

.preview-table-head,
.preview-table-row {
  display: grid;
  grid-template-columns: 64px 76px minmax(0, 1fr) 72px 80px;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  padding: 9px 12px;
  color: #234039;
}

.preview-table-head {
  min-height: 38px;
  color: var(--muted);
  background: #f7f6ef;
  font-size: 11px;
  font-weight: 900;
}

.preview-table-row + .preview-table-row {
  border-top: 1px solid rgba(215, 229, 223, 0.78);
}

.preview-table-row b,
.preview-table-row strong {
  color: var(--accent-dark);
}

.preview-table-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-table-row em {
  justify-self: end;
  padding: 5px 10px;
  border-radius: 999px;
  color: #075e54;
  background: #dff7ed;
  font-style: normal;
  font-weight: 800;
  font-size: 12px;
}

.preview-table-row.strong {
  background: rgba(223, 247, 237, 0.58);
}

.site-disclaimer {
  margin: 0 0 34px;
  padding: 18px 20px;
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-radius: 10px;
  color: #48645c;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 12px 32px rgba(27, 50, 42, 0.07);
  backdrop-filter: blur(14px);
}

.site-disclaimer strong {
  display: block;
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 900;
}

.site-disclaimer p {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.68;
}

.service-ops {
  display: grid;
  grid-template-columns: minmax(280px, 0.36fr) minmax(0, 1fr);
  gap: clamp(18px, 3vw, 36px);
  align-items: start;
  padding: 4px 0 44px;
}

.service-ops-copy {
  min-width: 0;
  padding: clamp(18px, 2.4vw, 28px);
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-left: 4px solid var(--sun);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 16px 42px rgba(27, 50, 42, 0.08);
  backdrop-filter: blur(14px);
}

.service-ops-copy h2 {
  font-size: clamp(25px, 2.7vw, 38px);
  line-height: 1.14;
}

.service-ops-copy p {
  margin: 16px 0 0;
  color: #426058;
  font-size: 16px;
  line-height: 1.72;
}

.ops-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ops-grid article {
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(215, 229, 223, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 14px 30px rgba(27, 50, 42, 0.08);
  backdrop-filter: blur(14px);
}

.ops-grid span {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--aqua));
  font-size: 12px;
  font-weight: 950;
}

.ops-grid h3 {
  margin: 12px 0 0;
  font-size: 19px;
}

.ops-grid p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  scroll-margin-top: 16px;
  padding: 42px 2px 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

h2 {
  font-size: 17px;
}

.scale-chip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar > div,
.score-panel,
.result-panel,
.toolbar,
.table-wrap,
.subject-field,
.subject-section,
.confirm-panel {
  min-width: 0;
}

.scale-chip span {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.76);
  padding: 7px 10px;
  border-radius: 6px;
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 13px;
}

.workspace {
  display: grid;
  grid-template-columns: 336px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.flow-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}

.flow-step {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 850;
  text-align: center;
}

.flow-step.active {
  border-color: rgba(15, 118, 110, 0.45);
  color: #ffffff;
  background: linear-gradient(135deg, #0f766e, #1796a0);
  box-shadow: 0 14px 28px rgba(15, 118, 110, 0.18);
}

.flow-step.complete {
  border-color: rgba(112, 199, 125, 0.48);
  color: #0f4f4a;
  background: #e4f8eb;
}

.workspace.input-mode,
.workspace.confirm-mode,
.workspace.loading-mode,
.workspace.results-mode {
  grid-template-columns: 1fr;
}

.workspace.input-mode .score-panel,
.workspace.confirm-mode .confirm-panel,
.workspace.loading-mode .loading-panel,
.workspace.results-mode .result-panel {
  grid-column: 1 / -1;
}

.score-panel,
.confirm-panel,
.result-panel,
.loading-panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.score-panel {
  position: sticky;
  top: 16px;
  padding: 18px;
}

.workspace.input-mode .score-panel {
  position: static;
}

.panel-head,
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--accent-dark);
  background: #fff;
  cursor: pointer;
}

.subject-grid {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.subject-section {
  padding: 14px;
  border: 1px solid rgba(215, 229, 223, 0.86);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(242, 250, 246, 0.9));
}

.subject-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.subject-section h3 {
  margin: 0;
  color: var(--accent-dark);
  font-size: 15px;
  line-height: 1.2;
}

.subject-section p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  text-align: right;
}

.subject-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(156px, 1fr));
  gap: 10px;
}

.subject-field {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: stretch;
  min-height: 112px;
  padding: 12px;
  border: 1px solid rgba(215, 229, 223, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 8px 18px rgba(27, 50, 42, 0.06);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background 160ms ease;
}

.subject-field.has-grade {
  border-color: rgba(15, 118, 110, 0.42);
  background: linear-gradient(145deg, #ffffff, #edf9f5);
  box-shadow: 0 12px 24px rgba(15, 118, 110, 0.12);
}

.subject-field:focus-within {
  border-color: rgba(15, 118, 110, 0.5);
  box-shadow: 0 12px 24px rgba(15, 118, 110, 0.12);
}

.subject-label {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  line-height: 1.2;
}

.subject-label span {
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.subject-label small {
  flex: 0 0 auto;
  padding: 3px 6px;
  border: 1px solid rgba(15, 118, 110, 0.14);
  border-radius: 999px;
  color: var(--accent-dark);
  background: #eef9f4;
  font-size: 11px;
  font-weight: 800;
}

.grade-select-wrap {
  margin-top: auto;
}

.subject-grade-select {
  width: 100%;
  min-width: 0;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 36px 0 12px;
  color: var(--accent-dark);
  background:
    linear-gradient(45deg, transparent 50%, var(--accent-dark) 50%) calc(100% - 18px) 18px / 6px 6px no-repeat,
    linear-gradient(135deg, var(--accent-dark) 50%, transparent 50%) calc(100% - 13px) 18px / 6px 6px no-repeat,
    #fbfdfb;
  appearance: none;
  cursor: pointer;
  font-weight: 900;
}

.subject-grade-select:disabled,
.preference-chip input:disabled + span {
  cursor: not-allowed;
  opacity: 0.72;
}

.preference-panel {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.preference-panel p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.preference-block {
  display: grid;
  gap: 8px;
}

.preference-block h3 {
  margin: 0;
  color: #24453d;
  font-size: 13px;
  font-weight: 900;
}

.preference-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preference-chip {
  cursor: pointer;
}

.preference-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.preference-chip span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent-dark);
  background: #f8fcfa;
  font-size: 13px;
  font-weight: 800;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.preference-chip input:checked + span {
  border-color: rgba(15, 118, 110, 0.56);
  color: #ffffff;
  background: linear-gradient(135deg, #0f766e, #1db8c3);
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.16);
}

.analysis-button {
  width: 100%;
  min-height: 48px;
  margin-top: 18px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(135deg, #0f766e, #1796a0);
  box-shadow: 0 16px 34px rgba(15, 118, 110, 0.22);
  cursor: pointer;
  font-weight: 900;
}

.analysis-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.secondary-button {
  min-height: 48px;
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: 8px;
  color: var(--accent-dark);
  background: #ffffff;
  cursor: pointer;
  font-weight: 900;
}

.confirm-panel {
  padding: clamp(14px, 2.4vw, 22px);
}

.confirm-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 16px;
  align-items: start;
}

.confirm-card,
.best5-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(215, 229, 223, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
}

.confirm-note {
  margin: 10px 0 14px;
  color: var(--muted);
  line-height: 1.55;
}

.confirmed-subjects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 10px;
}

.confirmed-subject {
  display: grid;
  gap: 7px;
  min-height: 92px;
  padding: 12px;
  border: 1px solid rgba(215, 229, 223, 0.9);
  border-radius: 8px;
  background: #fafdfe;
}

.confirmed-subject span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.confirmed-subject strong {
  color: var(--accent-dark);
  font-size: 18px;
  line-height: 1.1;
}

.confirmed-subject small {
  color: var(--muted);
  font-size: 12px;
}

.confirmed-subject.not-taken {
  background: #f4f7f6;
}

.confirmed-subject.not-taken strong {
  color: #7a8782;
  font-size: 14px;
}

.best5-card {
  position: sticky;
  top: 16px;
}

.best5-list {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  padding: 0;
  list-style: none;
}

.best5-list li,
.best5-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f4fbf8;
}

.best5-list span,
.best5-total span {
  color: var(--muted);
  font-weight: 800;
}

.best5-list strong,
.best5-total strong {
  color: var(--accent-dark);
  font-size: 18px;
}

.best5-total {
  border: 1px solid rgba(15, 118, 110, 0.22);
  background: #e9f9f5;
}

.confirm-error {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--red);
  background: #ffe0dc;
  font-size: 13px;
  font-weight: 800;
}

.confirm-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 14px;
}

.subject-grade-select:focus,
select:focus,
.toolbar input:focus {
  outline: 2px solid rgba(15, 118, 110, 0.22);
  border-color: var(--accent);
}

.result-panel {
  min-width: 0;
  overflow: visible;
}

.result-overview {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(244, 251, 248, 0.92), rgba(255, 255, 255, 0.72));
}

.overview-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(215, 229, 223, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
}

.overview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.overview-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: #0f4f4a;
  background: #dff7ed;
  font-size: 12px;
  font-weight: 900;
}

.raw-score-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.raw-score-chip {
  display: inline-grid;
  grid-template-columns: auto auto;
  gap: 7px;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid rgba(215, 229, 223, 0.92);
  border-radius: 8px;
  background: #f8fcfa;
}

.raw-score-chip small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.raw-score-chip strong {
  color: var(--accent-dark);
  font-size: 15px;
}

.score-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.score-metric {
  min-width: 0;
  padding: 10px;
  border-radius: 8px;
  background: #edf9f5;
}

.score-metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.score-metric strong {
  display: block;
  margin-top: 5px;
  color: var(--accent-dark);
  font-size: 22px;
  line-height: 1.1;
}

.score-metric small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.result-preferences {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.result-preferences span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, #0f766e, #1db8c3);
  font-size: 12px;
  font-weight: 900;
}

.banda-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.banda-card {
  position: relative;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(215, 229, 223, 0.92);
  border-radius: 8px;
  background: #fafdfe;
  overflow: visible;
}

.banda-label {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: var(--accent);
  font-weight: 950;
}

.banda-card strong {
  display: block;
  margin-top: 10px;
  min-height: 42px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
}

.banda-card p {
  margin: 8px 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.banda-card .banda-meta {
  margin-bottom: 6px;
  color: var(--accent-dark);
  font-weight: 850;
}

.banda-description-wrap {
  position: relative;
  margin: 8px 0 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(215, 229, 223, 0.9);
}

.banda-card .banda-description {
  min-height: 64px;
  margin: 0;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.banda-description-popover {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 30;
  display: none;
  width: min(520px, 68vw);
  padding: 12px;
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: 8px;
  color: var(--ink);
  background: #ffffff;
  box-shadow: 0 18px 38px rgba(27, 50, 42, 0.18);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.55;
}

.banda-description-wrap:hover,
.banda-description-wrap:focus {
  outline: none;
}

.banda-description-wrap:hover .banda-description-popover,
.banda-description-wrap:focus .banda-description-popover,
.banda-description-wrap:focus-within .banda-description-popover {
  display: block;
}

.banda-score-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.banda-card em {
  color: var(--accent-dark);
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.banda-faculty {
  margin: -4px 0 10px;
  color: #4f7567;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
}

.banda-reference {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 0;
  padding: 10px;
  border: 1px solid rgba(215, 229, 223, 0.92);
  border-radius: 8px;
  background: #f3fbf8;
}

.banda-reference div {
  min-width: 0;
  text-align: center;
}

.banda-reference dt,
.banda-reference dd {
  margin: 0;
}

.banda-reference dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.banda-reference dd {
  margin-top: 4px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 950;
  white-space: nowrap;
}

.banda-places-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.banda-formula {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(215, 229, 223, 0.92);
}

.banda-formula span {
  display: block;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 950;
}

.banda-formula p {
  margin: 6px 0 0;
  color: #405d55;
  font-size: 12px;
  line-height: 1.45;
}

.admission-note {
  margin-top: 12px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(183, 121, 31, 0.28);
  background: #fff8e8;
}

.admission-note span {
  display: block;
  color: #7a4c00;
  font-size: 11px;
  font-weight: 950;
}

.admission-note p {
  margin: 6px 0 0;
  color: #604616;
  font-size: 12px;
  line-height: 1.45;
}

.admission-note.unmet {
  border-color: rgba(180, 35, 24, 0.28);
  background: #ffecea;
}

.admission-note.unmet span,
.admission-note.unmet p {
  color: var(--red);
}

.loading-panel {
  min-height: 430px;
  display: grid;
  place-items: center;
  padding: clamp(24px, 5vw, 56px);
  overflow: hidden;
}

.ai-loader {
  width: min(680px, 100%);
  text-align: center;
}

.loader-core {
  position: relative;
  width: 128px;
  height: 128px;
  margin: 0 auto 24px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(29, 184, 195, 0.18), transparent 58%),
    rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 36px rgba(15, 118, 110, 0.08), 0 20px 46px rgba(27, 50, 42, 0.12);
}

.loader-core::before,
.loader-core::after {
  position: absolute;
  inset: 14px;
  border: 2px solid transparent;
  border-top-color: var(--accent);
  border-radius: 50%;
  content: "";
  animation: spin 1.25s linear infinite;
}

.loader-core::after {
  inset: 30px;
  border-top-color: var(--sun);
  animation-duration: 1.9s;
  animation-direction: reverse;
}

.loader-core span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--leaf);
  transform-origin: -34px -34px;
  animation: pulse-node 1.8s ease-in-out infinite;
}

.loader-core span:nth-child(2) {
  background: var(--aqua);
  transform-origin: 38px -24px;
  animation-delay: 0.2s;
}

.loader-core span:nth-child(3) {
  background: var(--sun);
  transform-origin: -12px 42px;
  animation-delay: 0.4s;
}

.ai-loader h2 {
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.15;
}

.ai-loader > p:not(.eyebrow) {
  min-height: 28px;
  margin: 14px 0 24px;
  color: var(--muted);
  line-height: 1.55;
}

.progress-track {
  height: 12px;
  overflow: hidden;
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-radius: 999px;
  background: #e6f2ee;
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f766e, #1db8c3, #70c77d);
  transition: width 120ms linear;
}

.progress-text {
  margin-top: 10px;
  color: var(--accent-dark);
  font-weight: 900;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse-node {
  0%,
  100% {
    opacity: 0.62;
    transform: translate(-50%, -50%) scale(0.82);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
  }
}

.toolbar {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

select,
.toolbar input {
  height: 36px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 0 10px;
  color: var(--ink);
}

.toolbar input {
  width: 220px;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
  flex-wrap: wrap;
}

.export-report-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(135deg, #0f766e, #1796a0);
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.16);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.export-report-button svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex: 0 0 auto;
}

.export-report-button:hover {
  background: linear-gradient(135deg, #0d625c, #137e86);
}

.export-report-button:focus-visible {
  outline: 2px solid rgba(15, 118, 110, 0.28);
  outline-offset: 2px;
}

.summary {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.table-wrap {
  overflow: auto;
  max-height: calc(100vh - 150px);
  -webkit-overflow-scrolling: touch;
}

table {
  width: 1560px;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.col-school,
th:nth-child(1),
td:nth-child(1) {
  width: 68px;
}

.col-code,
th:nth-child(2),
td:nth-child(2) {
  width: 76px;
}

.col-program,
th:nth-child(3),
td:nth-child(3) {
  width: 220px;
}

.col-faculty,
th:nth-child(4),
td:nth-child(4) {
  width: 130px;
}

.col-score,
th:nth-child(5),
td:nth-child(5) {
  width: 82px;
}

.col-ref,
th:nth-child(6),
td:nth-child(6),
th:nth-child(7),
td:nth-child(7),
th:nth-child(8),
td:nth-child(8) {
  width: 62px;
}

.col-places,
th:nth-child(9),
td:nth-child(9) {
  width: 90px;
}

.col-chance,
th:nth-child(10),
td:nth-child(10) {
  width: 100px;
}

.col-description,
.col-requirements,
th:nth-child(11),
td:nth-child(11),
th:nth-child(12),
td:nth-child(12) {
  width: 116px;
}

.col-method,
th:nth-child(13),
td:nth-child(13) {
  width: 376px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f1f7f4;
  color: var(--muted);
  font-size: 12px;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid rgba(215, 229, 223, 0.72);
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid #edf2ef;
  border-right: 1px solid rgba(237, 242, 239, 0.7);
  vertical-align: top;
  font-size: 13px;
}

tbody tr:hover {
  background: #f8fbf9;
}

.code {
  font-weight: 700;
  color: var(--accent-dark);
}

.program {
  font-weight: 650;
  overflow-wrap: anywhere;
}

.method {
  color: var(--muted);
  line-height: 1.38;
  overflow-wrap: anywhere;
}

.description-cell {
  width: 180px;
  position: relative;
  overflow: visible;
}

.program-description {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 999px;
  background: #f4fbf8;
  cursor: pointer;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.program-description-popover {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 20;
  display: none;
  width: min(420px, 62vw);
  padding: 12px;
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: 8px;
  color: var(--ink);
  background: #ffffff;
  box-shadow: 0 18px 38px rgba(27, 50, 42, 0.18);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.55;
  white-space: normal;
}

.program-description:hover .program-description-popover,
.program-description:focus .program-description-popover,
.program-description:focus-within .program-description-popover {
  display: block;
}

.score {
  font-weight: 800;
  font-size: 15px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  border-radius: 6px;
  padding: 5px 8px;
  font-weight: 800;
  font-size: 12px;
}

.very-high {
  color: #075e54;
  background: #dff7ed;
}

.high {
  color: #125a25;
  background: #e7f8dc;
}

.medium {
  color: #7a4c00;
  background: #fff0c7;
}

.reach {
  color: #8a3a0a;
  background: #ffe3ca;
}

.low {
  color: var(--red);
  background: #ffe0dc;
}

.ineligible {
  color: var(--red);
  background: #ffe0dc;
}

.requirement-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-top: 4px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.requirement-status.met {
  color: #0f4f4a;
  background: #dff7ed;
}

.requirement-status.review {
  color: #7a4c00;
  background: #fff0c7;
}

.requirement-status.unmet {
  color: var(--red);
  background: #ffe0dc;
}

.requirement-unmet-row {
  background: rgba(255, 236, 234, 0.48);
}

.unknown {
  color: #4b5563;
  background: #e9edf1;
}

@media (max-width: 980px) {
  .app-shell {
    width: min(100% - 24px, 920px);
  }

  .hero {
    min-height: auto;
    padding-bottom: 18px;
  }

  .hero-content {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .hero-copy {
    max-width: 820px;
  }

  .signal-board {
    min-height: 420px;
  }

  .orbit-ring {
    inset: 22px 11%;
  }

  .score-card {
    right: 5%;
  }

  .match-card {
    left: 6%;
    bottom: 42px;
  }

  .insight-card {
    right: 10%;
    bottom: 0;
  }

  .advantage-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-preview {
    grid-template-columns: 1fr;
    padding: 28px 0 44px;
  }

  .service-ops {
    grid-template-columns: 1fr;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .flow-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .confirm-layout {
    grid-template-columns: 1fr;
  }

  .result-overview {
    grid-template-columns: 1fr;
  }

  .score-metrics,
  .banda-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .best5-card {
    position: static;
  }

  .score-panel {
    position: static;
  }

  .subject-cards {
    grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  }

  .subject-section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .subject-section p {
    max-width: none;
    text-align: left;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .summary {
    white-space: normal;
  }

  .toolbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .toolbar input {
    width: min(100%, 320px);
  }
}

@media (max-width: 900px) {
  .result-panel {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .toolbar {
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(247, 250, 247, 0.96);
    box-shadow: 0 10px 26px rgba(27, 50, 42, 0.1);
    backdrop-filter: blur(10px);
  }

  .filters {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  select,
  .toolbar input {
    width: 100%;
    min-width: 0;
    height: 44px;
    border-radius: 7px;
    font-size: 15px;
  }

  .toolbar input {
    grid-column: 1 / -1;
  }

  .summary {
    width: 100%;
    font-size: 12px;
  }

  .toolbar-actions {
    align-items: stretch;
  }

  .export-report-button {
    width: 100%;
    min-height: 44px;
  }

  .table-wrap {
    max-height: none;
    overflow: visible;
    margin-top: 10px;
  }

  table,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  table {
    width: 100%;
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: auto;
  }

  thead {
    display: none;
  }

  tbody tr {
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 10px 24px rgba(27, 50, 42, 0.08);
  }

  tbody tr:hover {
    background: var(--panel);
  }

  td {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 10px;
    padding: 6px 2px;
    border: 0;
    font-size: 13px;
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 700;
  }

  .program {
    min-width: 0;
    font-size: 15px;
    line-height: 1.35;
  }

  .score {
    font-size: 18px;
  }

  .method {
    max-width: none;
    line-height: 1.45;
  }

  .description-cell {
    width: auto;
  }

  .program-description-popover {
    left: auto;
    right: 0;
    width: min(420px, calc(100vw - 44px));
  }

  .badge {
    min-height: 30px;
  }
}

@media (max-width: 760px) {
  body {
    background:
      linear-gradient(180deg, rgba(225, 248, 240, 0.92), rgba(246, 251, 248, 0.98) 34%),
      var(--paper);
  }

  .app-shell {
    width: 100%;
    padding: max(14px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  }

  .hero {
    padding-top: 0;
  }

  .hero::after {
    display: none;
  }

  .hero-nav {
    padding-bottom: 28px;
  }

  .brand-lockup {
    gap: 8px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 8px;
  }

  .nav-cta {
    display: none;
  }

  .hero h1 {
    max-width: 100%;
    font-size: clamp(34px, 9vw, 40px);
    line-height: 1.08;
    overflow-wrap: anywhere;
  }

  .hero-lede {
    margin-top: 18px;
    font-size: 17px;
    line-height: 1.58;
    word-break: break-all;
  }

  .hero-actions {
    margin-top: 24px;
  }

  .primary-action,
  .secondary-action {
    width: 100%;
    min-height: 46px;
  }

  .signal-board {
    display: grid;
    gap: 10px;
    min-height: 0;
    margin-top: 4px;
    overflow: visible;
  }

  .orbit-ring,
  .signal-node {
    display: none;
  }

  .signal-card {
    position: static;
    width: 100%;
    padding: 14px;
  }

  .advantage-strip {
    grid-template-columns: 1fr;
    margin-top: 18px;
  }

  .advantage-strip article {
    padding: 16px;
  }

  .product-preview {
    padding: 22px 0 24px;
  }

  .preview-copy {
    padding: 16px;
    border-left-width: 3px;
  }

  .preview-copy h2 {
    font-size: 25px;
  }

  .preview-copy p {
    font-size: 15px;
    line-height: 1.62;
    word-break: break-all;
  }

  .preview-dashboard {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .preview-overview-card,
  .preview-filter-bar,
  .preview-table {
    border-radius: 8px;
  }

  .preview-band-grid {
    grid-template-columns: 1fr;
  }

  .preview-filter-bar strong {
    width: 100%;
    margin-left: 0;
  }

  .preview-table-head {
    display: none;
  }

  .preview-table-row {
    grid-template-columns: 58px minmax(0, 1fr);
    min-height: 58px;
  }

  .preview-table-row span:nth-of-type(1),
  .preview-table-row strong {
    display: none;
  }

  .preview-table-row em {
    justify-self: start;
    grid-column: 2;
  }

  .site-disclaimer {
    margin: 0 0 20px;
    padding: 14px;
  }

  .service-ops {
    padding: 0 0 24px;
  }

  .service-ops-copy {
    padding: 16px;
    border-left-width: 3px;
  }

  .service-ops-copy h2 {
    font-size: 25px;
  }

  .service-ops-copy p {
    font-size: 15px;
    line-height: 1.62;
    word-break: break-all;
  }

  .ops-grid {
    grid-template-columns: 1fr;
  }

  .site-disclaimer p,
  .advantage-strip p {
    word-break: break-all;
  }

  .topbar {
    gap: 14px;
    padding: 28px 2px 16px;
  }

  .topbar h1 {
    font-size: 25px;
    line-height: 1.18;
  }

  .scale-chip {
    width: 100%;
    justify-content: flex-start;
  }

  .scale-chip span {
    padding: 7px 9px;
  }

  .workspace {
    gap: 12px;
  }

  .score-panel {
    padding: 13px;
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(27, 50, 42, 0.1);
  }

  .icon-button {
    width: 42px;
    height: 42px;
    font-size: 18px;
  }

  .subject-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .confirmed-subjects {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-overview {
    padding: 10px;
  }

  .score-metrics,
  .banda-grid {
    grid-template-columns: 1fr;
  }

  .subject-field {
    min-width: 0;
    min-height: 112px;
    padding: 11px;
  }

  .subject-section {
    padding: 11px;
  }

  .subject-label {
    min-height: 34px;
  }

  .subject-label span {
    font-size: 13px;
  }

  .subject-grade-select {
    height: 44px;
    padding: 0 36px 0 10px;
    font-size: 16px;
    border-radius: 7px;
  }
}

@media (max-width: 430px) {
  .ai-powered-admissions .app-shell {
    padding-left: 16px;
    padding-right: 16px;
  }

  .app-shell {
    padding-left: 8px;
    padding-right: 8px;
  }

  .subject-grid {
    gap: 8px;
  }

  .subject-cards {
    grid-template-columns: 1fr;
  }

  .confirmed-subjects {
    grid-template-columns: 1fr;
  }

  .filters {
    grid-template-columns: 1fr;
  }

  .toolbar input {
    grid-column: auto;
  }
}
