/* Advargo Partner Portal — white-label */
:root {
  --ink: #141634;
  --indigo: #3E4097;
  --indigo-deep: #262A6B;
  --mist: #EDEFF7;
  --mist-2: #F7F8FC;
  --paper: #FFFFFF;
  --signal: #FFC642;
  --muted: #5C5F7E;
  --line: #DDE0EE;
  --field: #C9CCE0;
  --ok: #1F8A5B;
  --warn: #B8541A;
  --err: #B42318;
  --brand: #3E4097;
  --on-brand: #FFFFFF;
  --display: 'Figtree', system-ui, sans-serif;
  --body: 'IBM Plex Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --r: 12px;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--body); color: var(--ink); background: var(--mist-2); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); }
a:hover { color: var(--indigo-deep); }
h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -0.3px; }
h1 { font-weight: 800; font-size: clamp(26px, 3vw, 34px); }
h2 { font-weight: 700; font-size: 22px; }
h3 { font-weight: 700; font-size: 17px; }
p { margin: 0; }
img { max-width: 100%; }
.mono { font-family: var(--mono); }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: 1.5px; color: var(--muted); text-transform: uppercase; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Buttons & fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 8px; border: 1px solid transparent; font: 700 15px var(--display); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { filter: brightness(0.92); color: var(--on-brand); }
.btn-ghost { background: var(--paper); color: var(--ink); border-color: var(--field); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn-outline { background: var(--paper); color: var(--brand); border-color: var(--brand); }
.btn-sm { min-height: 38px; padding: 0 12px; font-size: 14px; }
.btn-block { width: 100%; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; }
.field input, .field select, .field textarea {
  min-height: 46px; border: 1px solid var(--field); border-radius: 8px; padding: 10px 14px;
  font: 400 15px var(--body); color: var(--ink); background: var(--paper); width: 100%;
}
.field textarea { min-height: 96px; resize: vertical; }
.field input[type=color] { padding: 4px; width: 64px; }
.field input[type=file] { padding: 9px 10px; }
.field input:focus, .field select:focus, .field textarea:focus, .btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.field .hint { font-weight: 400; font-size: 13px; color: var(--muted); }
.field .err, .err-text { font-weight: 500; font-size: 13px; color: var(--err); }
.field.has-err input, .field.has-err select { border-color: var(--err); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check input { width: 18px; height: 18px; margin-top: 2px; }
.input-group { display: flex; align-items: stretch; }
.input-group input { border-radius: 8px 0 0 8px; }
.input-group span { display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--field); border-left: 0; border-radius: 0 8px 8px 0; background: var(--mist-2); font-family: var(--mono); font-size: 13px; color: var(--muted); white-space: nowrap; }

/* ---------- Alerts ---------- */
.alert { padding: 12px 16px; border-radius: 10px; font-size: 14px; border: 1px solid; }
.alert-ok { background: #E3F4EC; border-color: #B6E0CB; color: #145C3D; }
.alert-warn { background: #FFF4DC; border-color: #F4D58A; color: #6B4A00; }
.alert-error { background: #FDECEA; border-color: #F5C2BC; color: #8A1C12; }

/* ---------- Cards, tables, chips ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.card-flush { padding: 0; overflow: hidden; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 500; color: var(--muted); background: var(--mist-2); padding: 12px 20px; }
.tbl td { padding: 14px 20px; border-top: 1px solid var(--mist); vertical-align: middle; }
.tbl td.strong { font-weight: 600; }
.tbl tr.link-row:hover td { background: var(--mist-2); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 500; background: var(--mist); color: #3A3D5C; white-space: nowrap; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.kpi { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.kpi .v { font: 800 36px var(--display); line-height: 1.1; }
.pipe { display: flex; height: 14px; border-radius: 7px; overflow: hidden; gap: 2px; background: var(--mist); }
.legend { display: flex; flex-wrap: wrap; gap: 18px; font-size: 13px; color: #3A3D5C; }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; }
.empty { padding: 32px 20px; text-align: center; color: var(--muted); }
.pager { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); }

/* ---------- Top bar (plain pages) ---------- */
.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 18px clamp(16px, 4vw, 56px); border-bottom: 1px solid var(--line); background: var(--paper); }
.wordmark { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.wordmark b { font: 800 26px var(--display); letter-spacing: -0.5px; }
.wordmark .tag { font-family: var(--mono); font-size: 11px; letter-spacing: 1.5px; padding: 4px 8px; border: 1px solid var(--indigo); color: var(--indigo); border-radius: 4px; }
.wordmark img { max-height: 40px; width: auto; }
.topnav { display: flex; flex-wrap: wrap; gap: 24px; font-size: 15px; }
.topnav a { text-decoration: none; }

/* ---------- Sign-in split ---------- */
.split { display: flex; flex-wrap: wrap; flex: 1; align-items: stretch; }
.split-dark { flex: 1 1 520px; background: var(--ink); color: #FFF; padding: clamp(32px, 5vw, 72px) clamp(16px, 5vw, 72px); display: flex; flex-direction: column; gap: 40px; }
.split-dark.branded { background: var(--brand); color: var(--on-brand); }
.split-dark .kicker { font-family: var(--mono); font-size: 12px; letter-spacing: 2px; color: var(--signal); }
.split-dark.branded .kicker { color: inherit; opacity: .8; }
.split-dark h1 { font-size: clamp(34px, 4.4vw, 56px); line-height: 1.05; letter-spacing: -1px; max-width: 560px; }
.split-dark .lede { font-size: 17px; line-height: 1.6; color: #C9CBE4; max-width: 520px; }
.split-dark.branded .lede { color: inherit; opacity: .85; }
.track { list-style: none; margin: 0; padding: 0; max-width: 460px; }
.track li { display: flex; gap: 16px; }
.track .rail { display: flex; flex-direction: column; align-items: center; width: 20px; }
.track .node { width: 14px; height: 14px; border-radius: 50%; margin-top: 4px; border: 2px solid #6A6DA6; }
.track .node.done { background: var(--signal); border-color: var(--signal); }
.track .node.now { background: var(--ink); border: 3px solid var(--signal); }
.track .line { flex: 1; width: 2px; min-height: 28px; background: #34376E; }
.track .line.done { background: var(--signal); }
.track .txt { padding-bottom: 18px; display: flex; flex-direction: column; gap: 2px; }
.track .txt b { font: 600 16px var(--display); }
.track .txt span { font-size: 13px; color: #A9ACCF; }
.split-dark.branded .track .node { border-color: currentColor; opacity: .7; }
.split-dark.branded .track .line { background: currentColor; opacity: .3; }
.split-dark.branded .track .txt span { color: inherit; opacity: .75; }
.split-form { flex: 1 1 440px; display: flex; align-items: center; justify-content: center; padding: clamp(32px, 5vw, 72px) 16px; }
.auth-card { width: 100%; max-width: 440px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 32px; display: flex; flex-direction: column; gap: 22px; }
.auth-card.wide { max-width: 640px; }
.tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; background: var(--mist); border-radius: 10px; }
.tabs a { display: flex; align-items: center; justify-content: center; height: 44px; border-radius: 8px; font: 600 15px var(--display); text-decoration: none; color: var(--muted); }
.tabs a.on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(20,22,52,.12); }
.foot-note { border-top: 1px solid var(--line); padding-top: 18px; font-size: 14px; color: var(--muted); }

/* ---------- Footer ---------- */
.site-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 20px clamp(16px, 4vw, 56px); font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); background: var(--paper); }

/* ---------- Agent shell ---------- */
.shell { min-height: 100vh; display: flex; flex-wrap: wrap; }
.side { flex: 1 1 240px; max-width: 100%; background: var(--ink); color: #FFF; padding: 24px 16px; display: flex; flex-direction: column; gap: 28px; }
.side .who { display: flex; align-items: center; gap: 12px; padding: 0 8px; }
.side .badge { width: 40px; height: 40px; border-radius: 10px; background: var(--signal); color: var(--ink); display: flex; align-items: center; justify-content: center; font: 800 15px var(--display); overflow: hidden; flex: none; }
.side .badge img { width: 100%; height: 100%; object-fit: contain; background: #FFF; }
.side .who b { font: 700 16px var(--display); display: block; }
.side .who span { font-size: 12px; color: #A9ACCF; }
.side nav { display: flex; flex-direction: column; gap: 4px; }
.side nav a { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 12px; border-radius: 8px; text-decoration: none; font-size: 15px; color: #C9CBE4; }
.side nav a:hover { background: #22255A; color: #FFF; }
.side nav a.on { background: #2C2F66; color: #FFF; font-weight: 600; }
.side .bottom { margin-top: auto; padding: 0 8px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.side .bottom a { color: #C9CBE4; }
.main { flex: 999 1 640px; min-width: 0; padding: clamp(20px, 3vw, 40px); display: flex; flex-direction: column; gap: 28px; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.addr { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; background: var(--mist-2); border-radius: 8px; flex-wrap: wrap; }
.addr .mono { font-size: 14px; word-break: break-all; }
.state-live { font-size: 13px; font-weight: 600; color: var(--ok); }
.state-wait { font-size: 13px; font-weight: 600; color: var(--warn); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.money { font: 800 24px var(--display); }
details.drawer > summary { list-style: none; cursor: pointer; }
details.drawer > summary::-webkit-details-marker { display: none; }

/* ---------- Student shell (agent-branded) ---------- */
.s-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 16px clamp(16px, 4vw, 56px); background: var(--brand); color: var(--on-brand); }
.s-head .logo { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.s-head .logo .mark { width: 40px; height: 40px; border-radius: 50%; background: #FFF; color: var(--brand); display: flex; align-items: center; justify-content: center; font: 800 15px var(--display); overflow: hidden; flex: none; }
.s-head .logo .mark img { width: 100%; height: 100%; object-fit: contain; }
.s-head .logo b { font: 700 20px var(--display); }
.s-head nav { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; font-size: 15px; }
.s-head nav a { color: inherit; text-decoration: none; }
.s-head nav a:hover { text-decoration: underline; color: inherit; }
.s-head .avatar { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.22); display: flex; align-items: center; justify-content: center; font: 600 13px var(--display); }
.s-main { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: clamp(20px, 3vw, 40px) 16px; display: flex; flex-direction: column; gap: 24px; }
.progress { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.progress .step { display: flex; flex-direction: column; gap: 8px; }
.progress .bar { height: 6px; border-radius: 3px; background: #E2E2DE; }
.progress .step.done .bar { background: var(--brand); }
.progress .step.now .bar { background: var(--brand); opacity: .5; }
.progress .step b { font: 600 15px var(--display); }
.progress .step span { font-size: 13px; color: var(--muted); }
.panes { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.panes > * { flex: 1 1 380px; min-width: 0; }
.doclist { list-style: none; margin: 0; padding: 0; }
.doclist li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid #EFEFEC; }
.doclist .files { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.doclist .received { font-size: 13px; font-weight: 600; color: var(--ok); }
.upload-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.upload-form input[type=file] { font-size: 13px; max-width: 230px; color: var(--muted); }
input[type=file]::file-selector-button { font: 600 13px var(--display); border: 1px solid var(--field); background: var(--mist-2); color: var(--ink); border-radius: 6px; padding: 7px 10px; margin-right: 8px; cursor: pointer; }
.thread { display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow-y: auto; padding-right: 4px; }
.bubble { max-width: 85%; border-radius: 12px; padding: 10px 14px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.bubble.them { align-self: flex-start; background: #F1F1EE; }
.bubble.me { align-self: flex-end; background: var(--brand); color: var(--on-brand); }
.bubble .meta { display: block; font-size: 11px; opacity: .75; margin-top: 4px; }

@media (max-width: 640px) {
  .auth-card { padding: 24px 18px; }
  .side { flex-basis: 100%; }
  .side nav { flex-direction: row; flex-wrap: wrap; }
}

/* 1.0.6 — application tabs, application tags */
[hidden] { display: none !important; }
.apptabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.apptabs a { display: inline-flex; align-items: center; gap: 8px; padding: 12px 16px; font: 600 15px var(--display); color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.apptabs a:hover { color: var(--ink); }
.apptabs a[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--brand); }
.apptabs .n { font: 600 12px var(--body); background: var(--mist); color: #3A3D5C; border-radius: 999px; padding: 1px 8px; }
.ref-tag { font: 500 12px var(--mono); background: var(--mist); color: #3A3D5C; border-radius: 4px; padding: 1px 6px; text-decoration: none; white-space: nowrap; }
a.ref-tag:hover { background: var(--line); }

/* 1.0.7 — student profile */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px 16px; }
.form-grid .span-2 { grid-column: span 2; }
@media (max-width: 560px) { .form-grid .span-2 { grid-column: auto; } }
.rep-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: end; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--mist-2); }
.meter { width: 160px; height: 8px; border-radius: 999px; background: var(--mist); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.save-bar { position: sticky; bottom: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 20px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 -4px 16px rgba(20,22,52,.06); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 16px; margin: 0; }
.facts div { display: flex; flex-direction: column; gap: 2px; }
.facts dt { font-size: 13px; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }

/* 1.0.8 — enquiries */
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check { display: inline-flex; align-items: center; gap: 8px; }
.checks .check { padding: 6px 12px; border: 1px solid var(--field); border-radius: 999px; background: var(--paper); font-size: 14px; }
.checks .check:has(input:checked) { border-color: var(--brand); background: var(--mist); }
.check input { width: 16px; height: 16px; accent-color: var(--brand); margin: 0; }
.check label { cursor: pointer; }
.callout { border-left: 4px solid var(--brand); background: var(--mist-2); padding: 14px 16px; border-radius: 8px; white-space: pre-line; }

/* 1.0.8 — seven dashboard tiles fit one row on a laptop; linked tiles */
.kpis { grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 12px; }
.kpi { padding: 18px; }
.kpi .v { font-size: 32px; }
a.kpi { color: inherit; text-decoration: none; transition: border-color .15s; }
a.kpi:hover { border-color: var(--brand); }

/* Sign out: always visible near the account name, highlighted */
.side .signout { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; margin: -12px 8px 0; padding: 0 14px; border-radius: 8px; background: var(--signal); color: var(--ink); font: 700 14px var(--display); text-decoration: none; }
.side .signout:hover { background: #FFD46E; }
.side .signout:focus-visible { outline: 2px solid #FFF; outline-offset: 2px; }
.s-head .signout-top { padding: 8px 14px; border-radius: 8px; background: var(--brand); color: var(--on-brand); font-weight: 700; text-decoration: none; }
@media (min-width: 641px) {
  .side { position: sticky; top: 0; align-self: flex-start; height: 100vh; overflow-y: auto; }
}

/* 1.1.0 — university rows with catalogue search */
.uni-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: end; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--mist-2); }
.uni-row .uni-hint { grid-column: 1 / -1; margin-top: -2px; }
.uni-row .uni-hint:empty { display: none; }
.uni-row.in-list [data-uni-name] { border-color: var(--ok); }
.cred-card { border-color: var(--ok); background: #F3FBF7; }

/* 1.1.1 — notification bar */
.notif-bar { position: sticky; top: 0; z-index: 20; display: flex; justify-content: flex-end; margin: -8px 0 4px; pointer-events: none; }
.notif-bar > * { pointer-events: auto; }
.notif-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font: 600 14px var(--display); cursor: pointer; box-shadow: 0 2px 8px rgba(20,22,52,.06); }
.notif-btn:hover { border-color: var(--brand); }
.notif-btn.has { border-color: var(--brand); }
.notif-btn.has svg { color: var(--brand); }
.notif-count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: #D92D20; color: #FFF; font: 700 12px var(--body); display: inline-flex; align-items: center; justify-content: center; }
.notif-panel { position: absolute; top: 48px; right: 0; width: min(440px, calc(100vw - 32px)); max-height: min(70vh, 640px); display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 16px 40px rgba(20,22,52,.18); overflow: hidden; }
.notif-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.notif-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.notif-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-bottom: 1px solid var(--line); transition: opacity .18s, transform .18s; }
.notif-item.gone { opacity: 0; transform: translateX(24px); }
.notif-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.notif-title { font-weight: 600; color: var(--ink); text-decoration: none; line-height: 1.35; }
.notif-title:hover { text-decoration: underline; }
.notif-body { margin: 0; font-size: 13px; color: #3A3D5C; white-space: pre-line; }
.notif-item form { flex: none; }
.notif-empty { margin: 0; padding: 28px 16px; text-align: center; }
.notif-foot { padding: 10px 16px; border-top: 1px solid var(--line); background: var(--mist-2); font-size: 13px; }

/* 1.2.0 — course finder */
.cf-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; font-weight: 400; }
.ref-tag.ok { background: rgba(31,138,91,.12); color: var(--ok); }
.ref-tag.gold { background: #FFF4E5; color: #9A5B00; }
.ref-tag.closed { opacity: .55; text-decoration: line-through; }

/* 1.2.0 — AI University Finder */
.ai-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.ai-card { display: flex; flex-direction: column; gap: 8px; padding: 16px; }
.ai-course { font: 700 16px var(--display); color: var(--ink); text-decoration: none; }
.ai-course:hover { text-decoration: underline; }
.ai-match { font: 800 22px var(--display); color: var(--brand); display: flex; flex-direction: column; align-items: flex-end; line-height: 1; }
.ai-match small { font: 500 11px var(--body); color: var(--muted); }
.ai-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin: 4px 0; }
.ai-facts dt { font-size: 12px; color: var(--muted); }
.ai-facts dd { margin: 0; font-weight: 600; font-size: 14px; }
.ai-chip { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.ai-chip.ok { background: rgba(31,138,91,.12); color: var(--ok); }
.ai-chip.mid { background: #FFF4E5; color: #9A5B00; }
.ai-chip.err { background: #FDECEA; color: var(--err); }
.ai-group { font: 700 20px var(--display); margin: 8px 0 0; padding-left: 12px; border-left: 4px solid var(--brand); }
.ai-group.ambitious { border-color: #B8541A; }
.ai-group.safe { border-color: var(--ok); }
@media print { .side, .notif-bar, .no-print, .page-head .btn, .page-head a.small { display: none !important; } .main { padding: 0; } .ai-card { break-inside: avoid; } }

/* 1.2.1 — student status chip + pop-up */
.status-chip { margin-top: 6px; border: 0; cursor: pointer; font-family: var(--body); }
.status-chip:hover { box-shadow: 0 0 0 2px var(--brand) inset; }
.status-pop { width: min(760px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: 0 24px 60px rgba(20,22,52,.25); }
.status-pop::backdrop { background: rgba(20,22,52,.45); }
.status-pop h3 { margin: 0; }
.status-pop .table-wrap { margin: 14px -20px -20px; }

/* Master mode (Perfex admin running every agency from one address) */
.side .master-box { display: flex; flex-direction: column; gap: 8px; margin: 0 8px; padding: 12px; border-radius: 10px; background: #22255A; border: 1px solid #3E4097; color: #FFF; }
.side .master-box .master-tag { align-self: flex-start; font: 800 11px var(--display); letter-spacing: .12em; padding: 2px 8px; border-radius: 999px; background: var(--signal); color: var(--ink); }
.side .master-box b { font: 700 15px var(--display); }
.side .master-box .field { gap: 4px; color: #C9CBE4; }
.side .master-box select { width: 100%; min-height: 40px; background: #FFF; color: var(--ink); }
.side .master-box a { color: #C9CBE4; font-size: 14px; text-decoration: none; padding: 6px 2px; }
.side .master-box a:hover, .side .master-box a.on { color: #FFF; text-decoration: underline; }
.shell.is-master .side .signout { margin-top: 0; }
.master-strip { background: #FFF6DB; border: 1px solid #F3D27A; color: var(--ink); border-radius: 10px; padding: 10px 14px; font-size: 14px; }
.side .master-out { margin: -18px 8px 0; text-align: center; color: #C9CBE4; font-size: 13px; text-decoration: underline; padding: 6px 0; }
.side .master-out:hover { color: #FFF; }
.master-login .kicker-pill { align-self: flex-start; font: 800 11px var(--display); letter-spacing: .12em; padding: 3px 10px; border-radius: 999px; background: var(--signal); color: var(--ink); }

/* Support tickets */
.tk-facts { display: flex; flex-wrap: wrap; gap: 18px 36px; }
.tk-facts > div { display: flex; flex-direction: column; gap: 4px; }
.tk-thread { max-height: 520px; }
.bubble .tk-file { display: block; margin-top: 6px; font-weight: 600; color: inherit; }
.tk-pri.high { color: #B8541A; }
.tk-pri.urgent { color: var(--err); }
.side nav a .nav-n { background: var(--signal); color: var(--ink); border-radius: 999px; font: 700 11px var(--display); padding: 2px 8px; }

/* Getting-started guide */
.guide { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.guide-toc { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 2px; padding: 16px; }
.guide-toc b { margin-bottom: 6px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; font-size: 11px; }
.guide-toc a { padding: 6px 8px; border-radius: 6px; text-decoration: none; font-size: 14px; color: var(--ink); }
.guide-toc a:hover { background: var(--mist); }
.guide-body { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.guide-body section { scroll-margin-top: 16px; }
.guide-body h2 { font-size: 22px; display: flex; align-items: center; gap: 10px; }
.guide-body p, .guide-body li { max-width: 72ch; }
.guide-n { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: var(--on-brand); font: 800 15px var(--display); flex: none; }
.guide-flow { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.guide-flow li { background: var(--mist-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 2px; position: relative; }
.guide-flow li span { font: 800 13px var(--display); color: var(--brand); }
.guide-flow li small { color: var(--muted); }
.guide-steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.guide-steps ul { margin: 8px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.guide-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.guide-tip { background: #FFF6DB; border-left: 3px solid var(--signal); padding: 10px 14px; border-radius: 6px; margin: 0; }
.guide-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.guide-filters div { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.guide-filters span { font-size: 13px; color: var(--muted); }
.guide-stages { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; border-left: 2px solid var(--line); margin-left: 6px; }
.guide-stages li { position: relative; padding: 6px 0 6px 20px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.guide-stages .dot { position: absolute; left: -7px; top: 12px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--paper); }
.guide-stages small { color: var(--muted); }
@media (max-width: 860px) { .guide { grid-template-columns: 1fr; } .guide-toc { position: static; flex-direction: row; flex-wrap: wrap; } .guide-toc b { width: 100%; } }

/* Welcome panel on the dashboard (first sign-in) */
.welcome-card { background: linear-gradient(135deg, var(--brand), #262A6B); color: #FFF; border: 0; }
.welcome-card h2 { font-size: 24px; color: #FFF; }
.welcome-card p { color: #E4E5F5; margin: 0; max-width: 70ch; }
.welcome-card .guide-flow li { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); }
.welcome-card .guide-flow li span { color: var(--signal); }
.welcome-card .guide-flow li small { color: #C9CBE4; }
.welcome-card .btn-ghost { background: transparent; color: #FFF; border-color: rgba(255,255,255,.5); }
.welcome-card .btn-primary { background: var(--signal); color: var(--ink); }

/* Bulk upload + sorting */
.doc-shared { background: var(--mist-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.bulk-drop { display: flex; flex-direction: column; gap: 10px; }
.bulk-zone { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; border: 2px dashed var(--field); border-radius: 12px; padding: 18px; cursor: pointer; background: var(--paper); }
.bulk-zone.over { border-color: var(--brand); background: var(--mist); }
.bulk-zone input[type=file] { margin-top: 6px; }
.bulk-picked { color: var(--brand); font-weight: 600; }
.bulk-sort { background: #FFF6DB; border: 1px solid #F3D27A; border-radius: 12px; padding: 14px; }
.sort-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid #F3D27A; }
.sort-row:first-of-type { border-top: 0; }

/* Next step after documents + partner ZIP download */
.next-step { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; border: 2px solid var(--brand); background: var(--mist); border-radius: 12px; padding: 14px 16px; }
.next-step.done { border: 1px solid var(--line); background: var(--mist-2); }
.next-n { background: var(--brand); color: var(--on-brand); border-radius: 999px; padding: 4px 12px; font: 800 12px var(--display); letter-spacing: .06em; text-transform: uppercase; }
.zip-bar { gap: 8px; align-items: center; }
.zip-pick { width: 16px; height: 16px; vertical-align: middle; margin-right: 4px; }

/* Student information card */
.facts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px 24px; }
.facts-grid .fact { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.facts-grid .fact b { font-weight: 600; overflow-wrap: anywhere; }
.facts-grid .fact.wide { grid-column: span 2; }
.edit-details { border-top: 1px solid var(--line); padding-top: 16px; }
.cred-card .facts { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.cred-card .facts dd { overflow-wrap: anywhere; min-width: 0; }

/* 1.9.2 — deadlines, next step, missing, offers, pre-departure, parent view, search, mobile */
.dl { display: inline-block; font: 600 12px var(--body); border-radius: 999px; padding: 2px 9px; white-space: nowrap; margin-top: 2px; }
.dl-ok { background: var(--mist); color: #3A3D5C; }
.dl-soon { background: #FFF1CC; color: #7A4B00; }
.dl-urgent { background: #FDE7E4; color: var(--err); }
.dl-past { background: #EFEFEC; color: var(--muted); }
.team-action { margin: 14px 0 0; padding: 10px 14px; background: var(--mist-2); border-left: 3px solid var(--brand); border-radius: 6px; }
.notice-ok { border-color: #BFE5D2; background: #F3FBF7; color: #165E3F; }
.chosen-tag { display: inline-block; font: 700 12px var(--body); color: #165E3F; background: #E3F5EC; border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.linklike { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; text-decoration: underline; cursor: pointer; }
.pill { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--field); background: var(--paper); color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 500; }
.pill.on { background: var(--ink); border-color: var(--ink); color: #FFF; }
.need-tag { color: var(--warn); font-weight: 600; }
.qwarn { color: var(--warn); font-size: 12px; font-weight: 500; }

.next-card { border-left: 5px solid var(--brand); gap: 8px; display: flex; flex-direction: column; }
.next-card.tone-wait { border-left-color: var(--field); }
.next-card.tone-done { border-left-color: var(--ok); }
.next-title { font: 700 20px var(--display); }

.missing-card { border-color: #F3D27A; background: #FFFCF2; }
.missing-list, .need-list { list-style: none; margin: 0; padding: 0; }
.missing-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0 9px 22px; border-top: 1px solid #F4E7BF; position: relative; }
.missing-list li::before { content: ''; position: absolute; left: 4px; top: 16px; width: 8px; height: 8px; border-radius: 50%; background: var(--signal); }
.missing-list li.urgent::before { background: var(--err); }
.missing-list li.urgent span { font-weight: 600; }
.missing-list a { white-space: nowrap; font-weight: 600; }
.need-list li { display: flex; flex-direction: column; gap: 2px; padding: 10px 0 10px 14px; border-top: 1px solid var(--mist); border-left: 3px solid var(--signal); margin-top: -1px; }
.need-list li.urgent { border-left-color: var(--err); }
.tile-warn { display: flex; align-items: center; gap: 16px; text-decoration: none; color: inherit; border-color: #F3D27A; background: #FFFCF2; }
.tile-warn .v { font: 800 34px var(--display); color: var(--warn); }
.tile-warn:hover { border-color: var(--warn); color: inherit; }

.offer-tbl th[scope=row] { width: 150px; white-space: nowrap; }
.offer-tbl thead th { vertical-align: bottom; min-width: 200px; color: var(--ink); }
.offer-tbl th.is-chosen, .offer-tbl td.is-chosen { background: #F3FBF7; }
.cond-mini { margin: 0; padding-left: 18px; font-size: 13px; }
.cond-mini li { margin: 2px 0; }
.cond-mini li.met { color: var(--muted); }

.predep .meter { width: 100%; }
.predep-list { list-style: none; margin: 0; padding: 0; }
.predep-list li { border-top: 1px solid var(--mist); }
.predep-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; flex-wrap: wrap; }
.predep-tick { width: 28px; height: 28px; flex: none; border-radius: 8px; border: 2px solid var(--field); background: var(--paper); color: #FFF; font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.predep-tick:hover { border-color: var(--brand); }
.is-done .predep-tick { background: var(--ok); border-color: var(--ok); }
.is-done b { color: var(--muted); }
.predep-note input { min-width: 180px; }

.top-search { align-self: stretch; }
.top-search input { width: 100%; max-width: 520px; min-height: 42px; border: 1px solid var(--field); border-radius: 10px; padding: 0 14px; font: inherit; background: var(--paper); }
.top-search input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }

.lang-switch { display: flex; gap: 6px; flex-wrap: wrap; }
.lang-switch a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--field); text-decoration: none; color: var(--ink); font-size: 14px; }
.lang-switch a.on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.parent-page { width: 100%; max-width: 980px; margin: 0 auto; padding: clamp(20px, 3vw, 40px) 16px; display: flex; flex-direction: column; gap: 22px; flex: 1; }
.parent-app > .card { border: 0; padding: 0; box-shadow: none; background: transparent; }
.parent-docs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px; }
.parent-docs li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 8px; background: #FFF6E5; font-size: 14px; }
.parent-docs li.ok { background: #F3FBF7; }
.parent-docs li b { font-size: 13px; white-space: nowrap; color: var(--warn); }
.parent-docs li.ok b { color: var(--ok); }

.menu-toggle { display: none; }

/* Phones and small tablets */
@media (max-width: 640px) {
  body { font-size: 16px; }
  input, select, textarea { font-size: 16px !important; } /* no zoom-on-focus on iPhone */
  .shell { flex-direction: column; flex-wrap: nowrap; }
  .main { width: 100%; max-width: 100vw; flex: 1 1 auto; }
  .side { position: sticky; top: 0; z-index: 20; padding: 10px 12px; gap: 10px; flex-basis: auto; }
  .side .who { display: none; }
  .menu-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 8px; border: 1px solid #3A3D74; background: #22255A; color: #FFF; font: 700 15px var(--display); cursor: pointer; }
  .side nav, .side .master-box, .side .master-out { display: none; }
  .side.nav-open nav, .side.nav-open .master-box, .side.nav-open .master-out { display: flex; }
  .side nav { flex-direction: column; }
  .side .signout { margin: 0; position: absolute; right: 12px; top: 10px; min-height: 44px; }
  .main { padding: 16px 14px 32px; gap: 18px; }
  .page-head { align-items: stretch; }
  .page-head > .row { width: 100%; }
  .page-head > .row .btn { flex: 1 1 auto; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi .v { font-size: 26px; }
  .card { padding: 16px; }
  table.tbl { min-width: 560px; font-size: 14px; }
  .tbl th, .tbl td { padding: 10px 12px; }
  .apptabs a { padding: 12px 12px; }
  .s-head { padding: 12px 14px; }
  .s-head nav { width: 100%; overflow-x: auto; flex-wrap: nowrap; gap: 16px; padding-bottom: 4px; white-space: nowrap; }
  .s-head .avatar { display: none; }
  .bubble { max-width: 92%; }
  .missing-list li { flex-wrap: wrap; }
  .predep-note, .predep-note input { width: 100%; min-width: 0; }
  .offer-tbl th[scope=row] { width: 110px; white-space: normal; }
  .notif-panel { left: 8px; right: 8px; width: auto; }
  .facts-grid { grid-template-columns: 1fr 1fr; }
  .uni-row, .rep-row { grid-template-columns: 1fr; }
}

.topline { display: flex; align-items: center; gap: 12px; }
.topline .top-search { flex: 1 1 auto; min-width: 0; }
.topline .notif-bar { margin: 0 0 0 auto; position: relative; flex: none; }
.topline:empty { display: none; }
@media (max-width: 640px) { .topline .notif-bar span:not(.notif-count) { display: none; } }

.ut-line { font-size: 13px; color: var(--muted); }
.ut-line b { color: var(--ink); font-weight: 600; }
.ut-line.ut-block { display: block; margin-top: 4px; }
.ut-since { color: var(--muted); font-size: 12px; }
.team-action .ut-line { font-size: 14px; }

/* 1.9.8 — commission payments */
.pay-bar { height: 5px; border-radius: 3px; background: var(--mist); margin-top: 4px; width: 110px; overflow: hidden; }
.pay-bar span { display: block; height: 100%; background: var(--ok); }
.pay-hist summary { cursor: pointer; color: var(--brand); font-size: 13px; font-weight: 600; }
.pay-hist ul { margin: 6px 0 0; padding-left: 16px; font-size: 13px; }

/* 2.0.1 — fees, interviews, CAS, mock interviews */
.chip.chip-ok { background: #E3F5EC; color: #165E3F; }
.chip.chip-warn { background: #FFF3D6; color: #7A5300; }
.chip.chip-bad { background: #FDECEC; color: #9B1C1C; }
.aotrack { display: grid; gap: 0; width: 100%; }
#after-offer > .row { width: 100%; }
.ao-step { display: grid; grid-template-columns: 30px 1fr; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line, #E6E8F2); }
.ao-step:first-child { border-top: 0; padding-top: 4px; }
.ao-step .n { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; background: var(--mist); color: #3A3D5C; }
.ao-step.done .n { background: #1F8A5B; color: #fff; }
.ao-step.locked { opacity: .6; }
.ao-step h4 { margin: 2px 0 4px; font-size: 15px; }
.ao-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-top: 8px; }
.ao-form .field { margin: 0; }
.ao-form input, .ao-form select { min-width: 0; }
.iv-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 8px 0; border-top: 1px dashed var(--line, #E6E8F2); }
.iv-row:first-child { border-top: 0; }
.mock-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border-radius: 10px; background: var(--mist); margin-top: 6px; }
details.ao-more > summary { cursor: pointer; font-weight: 600; font-size: 14px; margin-top: 6px; }
.stage-doc { display: grid; gap: 4px; padding: 10px 12px; margin-top: 8px; border: 1px dashed #E3B341; border-radius: 10px; background: #FFFBEF; }
.stage-doc.has { border: 1px solid var(--line, #E6E8F2); background: #fff; }

/* 2.0.6 — phones: tables become cards, menu bar no longer stretches, full-width filters */
@media (max-width: 640px) {
  .side { flex: none; height: auto; }
  .shell { min-height: 100vh; }
  .main { flex: 1 0 auto; }
  .table-wrap { overflow: visible; }
  main form[method=get].row, main form[method=get].row > .field { width: 100%; }
  main form[method=get].row > input, main form[method=get].row > select, main form[method=get].row > .field, main form[method=get].row > label { flex: 1 1 100%; min-width: 0; }
  main form[method=get].row > .field input, main form[method=get].row > .field select, main form[method=get].row > label select, main form[method=get].row > label input { width: 100%; }
  main form[method=get].row > .btn, main form[method=get].row > button { flex: 1 1 auto; }
  .apptabs { flex-wrap: wrap; overflow: visible; }
  .apptabs a { padding: 10px 10px; font-size: 14px; }
  .page-head h1 { font-size: 26px; }
  .s-head nav { flex-wrap: wrap; overflow: visible; white-space: normal; gap: 8px 16px; padding-bottom: 0; }
  .s-head nav a { display: inline-flex; align-items: center; min-height: 36px; }
}

/* 2.0.8 click-to-reveal contact details */
.reveal { white-space: nowrap; }
.reveal-v { letter-spacing: .02em; }
.reveal-btn { font: inherit; font-size: 12px; font-weight: 600; line-height: 1; padding: 3px 8px; margin-left: 2px; border: 1px solid var(--line, #d0d5dd); border-radius: 999px; background: transparent; color: var(--brand, #1d4ed8); cursor: pointer; vertical-align: 1px; }
.reveal-btn:hover { background: rgba(0,0,0,.04); }
.reveal-btn:disabled { opacity: .6; cursor: default; }
.reveal.revealed { white-space: normal; overflow-wrap: anywhere; }

/* 2.0.8 Action Centre (master / staff mode) */
.ac-panel { border-left: 4px solid var(--brand); }
.ac-panel .ac-new > summary { list-style: none; display: inline-flex; cursor: pointer; }
.ac-panel .ac-new > summary::-webkit-details-marker { display: none; }
.ac-panel .ac-new[open] > summary { opacity: .7; }
.ac-pri { border: 0; padding: 0; margin: 0; min-width: 0; }
.ac-pri legend { padding: 0; margin-bottom: 6px; font-weight: 600; }
.ac-late { color: #9B1C1C; font-weight: 600; }
.side .master-box a .nav-n { background: var(--signal); color: var(--ink); border-radius: 999px; font: 700 11px var(--display); padding: 2px 8px; margin-left: 4px; }
.ac-about { background: var(--mist, #F2F3FA); border-radius: 10px; padding: 12px 14px; }
.ac-about .ac-about-h { display: block; margin-bottom: 6px; }
.ac-about dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px 16px; margin: 0; }
.ac-about dt { font-size: 12px; color: var(--muted); }
.ac-about dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
/* 2.0.9 reopen + autocorrect */
.ac-reopen > summary { list-style: none; display: inline-flex; cursor: pointer; white-space: nowrap; }
.ac-reopen > summary::-webkit-details-marker { display: none; }
.ac-reopen[open] { min-width: 240px; }
.ac-reopen form { margin-top: 8px; }
.ac-autocorrect-note a { font-weight: 600; }
/* 2.0.9 dashboard numbers: click to reveal */
.kpi .v.kpi-hidden { color: var(--muted); letter-spacing: .12em; cursor: pointer; }
.kpi:has(.kpi-hidden) { cursor: pointer; }
.kpi:has(.kpi-hidden)::after { content: 'Tap to show'; font-size: 12px; color: var(--muted); }

/* 2.1.0 mobile pass: nothing wider than the screen, finger-sized controls, readable small text */
img, video, iframe, canvas, svg { max-width: 100%; }
input[type=file] { max-width: 100%; }
.reveal { white-space: normal; overflow-wrap: anywhere; }
.reveal-v { white-space: nowrap; }
@media (pointer: coarse), (max-width: 640px) {
  .reveal-btn { min-height: 32px; padding: 6px 12px; font-size: 13px; }
  .chip.status-chip, button.chip { min-height: 32px; }
  .btn-sm { min-height: 36px; }
  .afc-chips button { min-height: 34px; padding: 6px 14px; font-size: 13px; }
  input[type=checkbox], input[type=radio] { width: 20px; height: 20px; }
}
@media (max-width: 640px) {
  .small, small { font-size: 13px; }
  .page-head .row { width: 100%; }
  .page-head .row > .btn, .page-head .row > a.btn, .page-head .row > button.btn { flex: 1 1 calc(50% - 8px); justify-content: center; text-align: center; }
  .kpi-toggle { flex-basis: 100% !important; }
  .card { padding: 16px; }
  .form-grid { grid-template-columns: 1fr !important; }
  .ac-panel .ac-about dl { grid-template-columns: 1fr 1fr; }
  .ac-reopen[open] { min-width: 0; }
  .facts-grid .fact b { overflow-wrap: anywhere; }
  /* Action Centre lists: the first 3, the rest behind "Show all" */
  .ac-list-more:not(.open) tbody tr:nth-child(n+4) { display: none; }
  table, .table-wrap { max-width: 100%; }
}
.ac-more-btn { margin-top: 6px; }
.ac-more-btn { display: none; }
@media (max-width: 640px) { .ac-more-btn { display: inline-flex; } }

/* 2.1.0 — a table that doesn't fit its box (phone or tablet) shows as cards; layout.php decides per table */
.table-wrap.has-cards { overflow: visible; }
  table.tbl.tbl-cards.cardmode { min-width: 0; width: 100%; border: 0; }
table.tbl.tbl-cards.cardmode thead { display: none; }
table.tbl.tbl-cards.cardmode, table.tbl.tbl-cards.cardmode tbody, table.tbl.tbl-cards.cardmode tr, table.tbl.tbl-cards.cardmode td { display: block; width: 100%; }
table.tbl.tbl-cards.cardmode tr { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin: 0 0 10px; background: var(--paper); }
table.tbl.tbl-cards.cardmode td { border: 0; padding: 6px 0 6px 38%; text-align: left; overflow-wrap: anywhere; display: flow-root; }
table.tbl.tbl-cards.cardmode td::before { content: attr(data-label); float: left; width: 58%; margin-left: -61.3%; padding-right: 8px; box-sizing: border-box; overflow-wrap: normal; word-break: normal; font: 500 13px/1.35 var(--body); color: var(--muted); letter-spacing: 0; text-transform: none; }
table.tbl.tbl-cards.cardmode td[data-label=""] { padding-left: 0; }
table.tbl.tbl-cards.cardmode td[data-label=""]::before { display: none; }
table.tbl.tbl-cards.cardmode td:first-child { font-weight: 600; }
table.tbl.tbl-cards.cardmode td .chip { white-space: normal; margin: 2px 4px 2px 0; }
table.tbl.tbl-cards.cardmode td .btn { margin-top: 4px; }
table.tbl.tbl-cards.cardmode td.tbl-empty { text-align: center; padding-left: 0; }
table.tbl.tbl-cards.cardmode td.tbl-empty::before { display: none; }

/* 2.1.0 — tablets (iPad portrait, small laptops): collapsible menu like phones instead of the whole menu stacked on top */
@media (min-width: 641px) and (max-width: 900px) {
  .shell { flex-direction: column; flex-wrap: nowrap; }
  .main { width: 100%; max-width: 100vw; flex: 1 1 auto; }
  .side { position: sticky; top: 0; z-index: 20; height: auto; align-self: stretch; overflow: visible; padding: 10px 16px; gap: 10px; flex: none; }
  .side .who { display: none; }
  .menu-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 8px; border: 1px solid #3A3D74; background: #22255A; color: #FFF; font: 700 15px var(--display); cursor: pointer; align-self: flex-start; }
  .side nav, .side .master-box, .side .master-out { display: none; }
  .side.nav-open nav, .side.nav-open .master-box, .side.nav-open .master-out { display: flex; }
  .side.nav-open nav { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
  .side .signout { margin: 0; position: absolute; right: 16px; top: 10px; min-height: 44px; }
}
@media (max-width: 900px) {
  .side.nav-open { max-height: 100vh; overflow-y: auto; }
}
/* Desktop: menu column keeps its width, the page uses the rest (no wrapping under the menu) */
@media (min-width: 901px) {
  .shell { flex-wrap: nowrap; }
  .side { flex: 0 0 248px; }
}

/* 2.1.2 — Students list: compact like Applications, with filters */
.filters { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; }
.filters .field { margin: 0; }
.filters-main { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters-main .field { flex: 1 1 118px; min-width: 108px; }
.filters-main .f-search { flex: 2 1 190px; }
.filters-main > .btn { flex: none; }
.f-more-m { display: none; }
.filters-main select, .filters-main input:not([type=checkbox]), .filters-more select { width: 100%; min-height: 42px; }
.filters-main .check input { width: 18px; height: 18px; }
.filters-more { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.filters-more .field { gap: 4px; }
.filters-chips { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.fchip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: 999px; background: #EEF0FB; color: var(--brand); font-size: 13px; font-weight: 600; text-decoration: none; }
.fchip:hover { background: #E1E4F7; }
.fchip span { font-size: 15px; line-height: 1; }
.tbl-students td { vertical-align: middle; }
.st-name { font-weight: 700; color: var(--ink); text-decoration: none; }
.st-name:hover { text-decoration: underline; }
.st-sub { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.tbl-students .st-contact .reveal { display: block; }
.tbl-students .st-contact .reveal + .reveal { margin-top: 4px; }
@media (max-width: 640px) {
  .f-more-d { display: none; } .f-more-m { display: inline; }
  .filters:not(.f-open) .filters-main .field:not(.f-search) { display: none; }
  .filters-main .field, .filters-main .f-search { flex: 1 1 100%; }
  .filters-main .btn { flex: 1 1 calc(50% - 8px); }
  .filters-more { grid-template-columns: 1fr 1fr; }
}

/* Students as compact cards when the table doesn't fit: name, stage and contact on 3 short lines */
table.tbl-students.cardmode tr { padding: 12px 14px; }
table.tbl-students.cardmode td { padding: 3px 0 !important; }
table.tbl-students.cardmode td::before { display: none; }
table.tbl-students.cardmode td.st-contact .reveal { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0 12px 0 0; }
table.tbl-students.cardmode td:nth-child(4), table.tbl-students.cardmode td:nth-child(5) { display: inline-block; width: auto; margin-right: 14px; font-size: 12px; }
table.tbl-students.cardmode td:nth-child(4)::before, table.tbl-students.cardmode td:nth-child(5)::before { display: inline; content: attr(data-label) ': '; float: none; width: auto; margin: 0; padding: 0; font-size: 12px; }
table.tbl-students.cardmode td:nth-child(5) br { display: none; }
table.tbl-students.cardmode td:nth-child(5) .need-tag { margin-left: 6px; }
/* 2.1.2 — Students: second in the menu and highlighted */
.side nav a.nav-hi { justify-content: flex-start; gap: 10px; background: rgba(255, 199, 64, .14); color: #FFF; font-weight: 700; border: 1px solid rgba(255, 199, 64, .45); }
.side nav a.nav-hi:hover { background: rgba(255, 199, 64, .24); }
.side nav a.nav-hi.on { background: var(--signal); color: var(--ink); border-color: var(--signal); }
.side nav a .nav-ico { font-size: 16px; line-height: 1; }
.tbl-students .st-sub a { color: inherit; }

/* 2.2.0 — Pipeline watch, letters checklist, offer confirmation */
.tbl-watch td { vertical-align: top; }
.tbl-watch .chip { white-space: normal; }
.tbl-watch tr.w-red td:first-child { box-shadow: inset 4px 0 0 #D92D20; }
.tbl-watch tr.w-amber td:first-child { box-shadow: inset 4px 0 0 #F0B429; }
.tbl-watch .w-owner select { min-height: 36px; max-width: 190px; font-size: 13px; }
.tbl-watch .w-act { display: flex; flex-wrap: wrap; gap: 6px; }
.tbl-watch .w-act form { margin: 0; }
table.tbl-watch.cardmode tr.w-red { border-left: 4px solid #D92D20; }
table.tbl-watch.cardmode tr.w-amber { border-left: 4px solid #F0B429; }
table.tbl-watch.cardmode td:first-child { box-shadow: none; }
.watch-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.letters-check .lc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.letters-check li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 8px 10px; border-radius: 8px; background: var(--mist); }
.letters-check li > span:first-child { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-weight: 800; font-size: 13px; color: #fff; background: #8d99ae; }
.letters-check li.ok > span:first-child { background: #1F7A4D; }
.letters-check li.miss { background: #FDECEC; } .letters-check li.miss > span:first-child { background: #D92D20; }
.letters-check li.wait { background: #FFF6E0; } .letters-check li.wait > span:first-child { background: #E09F3E; }
.letters-check form { margin: 0; }
.offer-ok { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--mist); }
.offer-ok .auth-card { max-width: 520px; width: 100%; }
.offer-file { display: flex; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.offer-ico { font-size: 28px; }

.tbl-watch .chip + .st-sub { margin-top: 4px; }
@media (max-width: 640px) { #watch-filters .filters-main .field { display: flex !important; } }
/* Pipeline watch as compact cards on phones */
table.tbl-watch.cardmode td { padding: 3px 0 !important; }
table.tbl-watch.cardmode td::before { display: none; }
table.tbl-watch.cardmode td:nth-child(3), table.tbl-watch.cardmode td:nth-child(4) { display: inline-flex; align-items: center; gap: 6px; width: auto; margin: 4px 12px 0 0; }
table.tbl-watch.cardmode td:nth-child(3)::before, table.tbl-watch.cardmode td:nth-child(4)::before { display: inline; content: attr(data-label); float: none; width: auto; margin: 0; padding: 0; font-size: 12px; }
table.tbl-watch.cardmode td.w-act { margin-top: 6px; }

/* 2.2.1 — Action Centre delete / multi-select delete */
.ac-sel { width: 34px; }
.ac-sel input { width: 18px; height: 18px; }
.ac-row-act { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; }
.ac-del { color: #B42318; }
.ac-bulk { display: none; position: sticky; bottom: 12px; z-index: 15; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; padding: 10px 14px; border-radius: 12px; background: var(--ink); color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.ac-bulk.on { display: flex; }
.ac-bulk .btn-ghost { color: #fff; border-color: rgba(255,255,255,.4); background: transparent; }
.btn-danger { background: #D92D20; color: #fff; border-color: #D92D20; }
.btn-danger:hover { background: #B42318; }
table.tbl.cardmode td.ac-sel { position: absolute; right: 14px; top: 12px; width: auto; padding: 0 !important; }
table.tbl.cardmode td.ac-sel::before { display: none; }
table.tbl.cardmode tr { position: relative; }

/* ===================== Student portal (2.3.2) — journey & tickets ===================== */
body:has(.sp-shell) { background: #F3F5F9; font-family: var(--display); color: #12213A; }
body.sp-locked { overflow: hidden; }
.sp-shell { --s-ink: #12213A; --s-muted: #5D6B82; --s-line: #E2E7EF; --s-amber: #F2B544; --s-canvas: #F3F5F9;
  --brand-soft: color-mix(in srgb, var(--brand) 9%, #fff); --brand-mid: color-mix(in srgb, var(--brand) 22%, #fff);
  display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; font-family: var(--display); }
.sp-shell .btn { font-family: var(--display); }
.sp-ico { flex: none; }

/* Sidebar */
.sp-side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: #fff; border-right: 1px solid var(--s-line); display: flex; flex-direction: column; padding: 22px 16px 18px; gap: 18px; }
.sp-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--s-ink); padding: 0 6px; }
.sp-logo { width: 38px; height: 38px; border-radius: 10px; background: var(--brand); color: var(--on-brand); display: grid; place-items: center; font-weight: 800; font-size: 14px; overflow: hidden; flex: none; }
.sp-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.sp-brand-name { font-weight: 700; font-size: 15px; line-height: 1.25; }
.sp-me { display: flex; align-items: center; gap: 11px; padding: 12px; border-radius: 14px; background: var(--brand-soft); }
.sp-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--brand); color: var(--on-brand); display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; border: 0; font-family: var(--display); }
.sp-me-txt { display: flex; flex-direction: column; min-width: 0; }
.sp-me-txt b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-me-txt span { font-size: 12.5px; color: var(--s-muted); }
.sp-nav { display: flex; flex-direction: column; gap: 2px; }
.sp-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--s-muted); text-decoration: none; font-weight: 600; font-size: 14.5px; position: relative; }
.sp-nav a:hover { background: var(--s-canvas); color: var(--s-ink); }
.sp-nav a.on { background: var(--brand); color: var(--on-brand); }
.sp-nav a span { flex: 1; }
.sp-nav em { font-style: normal; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: var(--s-canvas); color: var(--s-ink); }
.sp-nav a.on em { background: rgba(255,255,255,.2); color: inherit; }
.sp-side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--s-line); padding-top: 14px; }
.sp-lang select { width: 100%; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--s-line); background: #fff; font: 500 14px var(--display); color: var(--s-ink); margin-bottom: 4px; }
.sp-link { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: var(--s-muted); text-decoration: none; font: 600 14px var(--display); background: none; border: 0; cursor: pointer; text-align: left; width: 100%; }
.sp-link:hover { background: var(--s-canvas); color: var(--s-ink); }
.sp-top, .sp-tabs { display: none; }

/* Main column */
.sp-main { padding: 34px clamp(18px, 4vw, 48px) 40px; max-width: 1080px; width: 100%; min-width: 0; }
.sp-main > .alert { margin-bottom: 18px; }
.sp-main h1, .sp-main h2, .sp-main h3 { font-family: var(--display); color: var(--s-ink); }
.sp-main :focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.sp-page-head { margin-bottom: 22px; }
.sp-page-head h1 { font-size: clamp(26px, 3vw, 32px); font-weight: 800; letter-spacing: -.02em; margin: 0 0 6px; }
.sp-page-head p { margin: 0; color: var(--s-muted); max-width: 62ch; font-size: 15.5px; }
.sp-block { background: #fff; border: 1px solid var(--s-line); border-radius: 18px; padding: 20px 22px; margin-bottom: 18px; }
.sp-block-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sp-block-head h2 { font-size: 18px; font-weight: 700; margin: 0; }
.sp-block-head a { font-weight: 600; font-size: 14px; text-decoration: none; }
.sp-quiet { color: var(--s-muted); margin: 0; font-size: 14.5px; }
.sp-empty { background: #fff; border: 1.5px dashed var(--s-line); border-radius: 18px; padding: 28px; text-align: center; }
.sp-empty b { font-size: 17px; display: block; margin-bottom: 6px; }
.sp-empty p { color: var(--s-muted); margin: 0 auto 16px; max-width: 46ch; }

/* Home hero */
.sp-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 22px; align-items: stretch; background: var(--brand); color: var(--on-brand); border-radius: 22px; padding: 28px; margin-bottom: 16px; position: relative; overflow: hidden; }
.sp-hero::before { content: ""; position: absolute; right: -120px; top: -140px; width: 380px; height: 380px; border-radius: 50%; border: 56px solid rgba(255,255,255,.06); pointer-events: none; }
.sp-hero-txt { position: relative; display: flex; flex-direction: column; justify-content: center; }
.sp-hello { margin: 0 0 8px; font-weight: 500; opacity: .85; font-size: 15px; }
.sp-hero h1 { color: inherit; font-size: clamp(26px, 3.4vw, 36px); line-height: 1.12; letter-spacing: -.025em; font-weight: 800; margin: 0 0 10px; }
.sp-hero-sub { margin: 0 0 18px; opacity: .88; max-width: 48ch; font-size: 15.5px; }
.sp-cta { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; background: #fff; color: var(--brand); font-weight: 700; padding: 11px 20px; border-radius: 99px; text-decoration: none; font-size: 15px; }
.sp-cta:hover { box-shadow: 0 0 0 4px rgba(255,255,255,.25); }
.sp-hero.tone-warn .sp-cta, .sp-hero.tone-action .sp-cta { background: var(--s-amber); color: #2A1E00; }
.sp-hero-trip { position: relative; background: #fff; color: var(--s-ink); border-radius: 16px; padding: 18px 20px 16px; text-decoration: none; display: flex; flex-direction: column; gap: 2px; }
.sp-hero-trip:hover { box-shadow: 0 10px 30px rgba(10,20,50,.18); }
.sp-trip-to { font-weight: 700; font-size: 17px; line-height: 1.25; }
.sp-trip-sub { color: var(--s-muted); font-size: 13.5px; margin-bottom: 4px; }
.sp-trip-now { font-size: 13.5px; color: var(--s-muted); margin-top: 2px; }
.sp-trip-now b { color: var(--s-ink); }

.sp-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.sp-facts a { background: #fff; border: 1px solid var(--s-line); border-radius: 16px; padding: 14px 16px; text-decoration: none; color: var(--s-ink); display: flex; flex-direction: column; }
.sp-facts a:hover { border-color: var(--brand-mid); }
.sp-facts b { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.sp-facts b small { font-size: 15px; font-weight: 600; color: var(--s-muted); }
.sp-facts span { color: var(--s-muted); font-size: 13.5px; }

/* Route (journey line with stops and the plane) */
.sp-route { position: relative; height: 26px; margin: 10px 8px 6px; }
.sp-line { position: absolute; left: 0; right: 0; top: 50%; height: 0; border-top: 2px dashed var(--s-line); }
.sp-line-done { position: absolute; left: 0; top: -2px; height: 2px; width: var(--done); background: var(--brand); }
.sp-stop { position: absolute; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: #fff; border: 2px solid var(--s-line); }
.sp-stop.done { background: var(--brand); border-color: var(--brand); }
.sp-stop.now { width: 30px; height: 30px; margin: -15px 0 0 -15px; background: var(--brand); border-color: #fff; box-shadow: 0 0 0 2px var(--brand); display: grid; place-items: center; color: var(--on-brand); z-index: 1; }
.sp-plane { transform: rotate(90deg); }
.sp-route.is-closed .sp-line-done { background: var(--s-muted); }
.sp-route.is-closed { opacity: .55; }

/* Tickets */
.sp-tickets { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.sp-ticket { --notch: 11px; display: grid; grid-template-columns: 74px minmax(0, 1fr); background: #fff; border: 1px solid var(--s-line); border-radius: 16px; text-decoration: none; color: var(--s-ink); position: relative; transition: transform .15s ease, box-shadow .15s ease; }
.sp-ticket:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(18,33,58,.09); }
.sp-ticket[hidden] { display: none; }
.sp-stub { border-right: 2px dashed var(--s-line); display: grid; place-items: center; position: relative; background: var(--brand-soft); border-radius: 15px 0 0 15px; }
.sp-stub::before, .sp-stub::after { content: ""; position: absolute; right: calc(var(--notch) * -1 - 1px); width: calc(var(--notch) * 2); height: calc(var(--notch) * 2); border-radius: 50%; background: var(--s-canvas); border: 1px solid var(--s-line); }
.sp-stub::before { top: calc(var(--notch) * -1 - 1px); clip-path: inset(50% 0 0 0); }
.sp-stub::after { bottom: calc(var(--notch) * -1 - 1px); clip-path: inset(0 0 50% 0); }
.sp-mark { width: 44px; height: 44px; border-radius: 12px; background: hsl(var(--h) 55% 42%); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 14px; letter-spacing: .02em; }
.sp-tk-body { padding: 14px 16px 12px 18px; display: flex; flex-direction: column; min-width: 0; }
.sp-tk-uni { font-weight: 700; font-size: 16px; line-height: 1.25; }
.sp-tk-course { color: var(--s-muted); font-size: 13.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-tk-meta { color: var(--s-muted); font-size: 12.5px; margin-top: 2px; }
.sp-tk-meta:empty { display: none; }
.sp-tk-stage, .sp-stage { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 13.5px; flex-wrap: wrap; }
.sp-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.sp-chosen { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: #E3F4EC; color: var(--ok); }
.sp-ticket.tone-good .sp-stub { background: #E9F6F0; }
.sp-ticket.tone-closed { opacity: .72; }
.sp-ticket.tone-closed .sp-stub { background: var(--s-canvas); }
.sp-ticket.tone-closed .sp-mark { filter: grayscale(1); }

.sp-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.sp-two .sp-block { margin-bottom: 0; }
.sp-agenda, .sp-feed, .sp-files, .sp-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.sp-agenda a { display: flex; gap: 14px; align-items: center; padding: 8px 0; text-decoration: none; color: var(--s-ink); }
.sp-agenda li + li a { border-top: 1px solid var(--s-line); }
.sp-agenda a > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.sp-agenda small { color: var(--s-muted); font-size: 13px; }
.sp-cal { width: 48px; flex: none; border: 1px solid var(--s-line); border-radius: 10px; text-align: center; font-size: 11.5px; font-weight: 600; color: var(--brand); padding: 4px 0 5px; line-height: 1.1; overflow: hidden; }
.sp-cal b { display: block; font-size: 19px; color: var(--s-ink); font-weight: 800; }
.sp-feed li { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 9px 0; position: relative; }
.sp-feed li + li { border-top: 1px solid var(--s-line); }
.sp-feed-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); margin-top: 6px; }
.sp-feed li:not(:first-child) .sp-feed-dot { background: var(--brand-mid); }
.sp-feed b { display: block; font-size: 14.5px; font-weight: 600; }
.sp-feed small { display: block; color: var(--s-muted); font-size: 13px; overflow-wrap: anywhere; }
.sp-feed time { color: var(--s-muted); font-size: 12.5px; white-space: nowrap; }

/* Universities page */
.sp-banner { display: flex; flex-direction: column; gap: 2px; padding: 14px 18px; border-radius: 16px; background: #FFF6E2; border: 1px solid #F5DDA2; color: #4A3500; text-decoration: none; margin-bottom: 18px; }
.sp-banner b { font-size: 16px; }
.sp-banner:hover { border-color: var(--s-amber); }
.sp-filter { display: inline-flex; gap: 4px; padding: 4px; border-radius: 99px; background: #fff; border: 1px solid var(--s-line); margin-bottom: 16px; max-width: 100%; overflow-x: auto; }
.sp-filter button { border: 0; background: none; padding: 7px 14px; border-radius: 99px; font: 600 14px var(--display); color: var(--s-muted); cursor: pointer; white-space: nowrap; }
.sp-filter button span { font-weight: 700; opacity: .7; margin-left: 2px; }
.sp-filter button[aria-selected="true"] { background: var(--s-ink); color: #fff; }

/* One university */
.sp-back { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; text-decoration: none; color: var(--s-muted); margin-bottom: 14px; }
.sp-back::before { content: ""; width: 8px; height: 8px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }
.sp-back:hover { color: var(--brand); }
.sp-uni-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; align-items: flex-end; margin-bottom: 18px; }
.sp-uni-head h1 { font-size: clamp(26px, 3vw, 34px); font-weight: 800; letter-spacing: -.02em; margin: 0 0 4px; line-height: 1.15; }
.sp-uni-course { margin: 0; color: var(--s-muted); font-size: 16px; }
.sp-uni-facts { display: flex; flex-wrap: wrap; gap: 0; margin: 0; background: #fff; border: 1px solid var(--s-line); border-radius: 14px; }
.sp-uni-facts div { padding: 9px 16px; }
.sp-uni-facts div + div { border-left: 1px solid var(--s-line); }
.sp-uni-facts dt { font-size: 12px; color: var(--s-muted); }
.sp-uni-facts dd { margin: 0; font-weight: 700; font-size: 14.5px; }
.sp-note { margin: 8px 0 0; padding: 12px 14px; background: var(--brand-soft); border-radius: 12px; font-size: 14.5px; }
.sp-files li, .sp-checks li { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.sp-files li + li, .sp-checks li + li { border-top: 1px solid var(--s-line); }
.sp-files li > span:nth-child(2), .sp-checks li > span:last-child { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sp-files small, .sp-checks small { color: var(--s-muted); font-size: 13px; overflow-wrap: anywhere; }
.sp-file-ico { width: 40px; height: 46px; flex: none; border-radius: 6px 12px 6px 6px; background: #FDECEC; color: #B42318; font-size: 11px; font-weight: 800; display: grid; place-items: end center; padding-bottom: 7px; }
.sp-tick { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--s-line); flex: none; display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #fff; }
.sp-checks li.ok .sp-tick { background: var(--ok); border-color: var(--ok); }
.sp-checks li.wait .sp-tick { border-color: var(--s-amber); background: #FFF6E2; }
.sp-ask { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; background: var(--brand-soft); border-color: transparent; }
.sp-ask b { font-size: 16px; }
#interview > .card, #predeparture > .card, .sp-wrap-partial .card { border-radius: 18px; border-color: var(--s-line); }
#interview, #predeparture { margin-bottom: 18px; scroll-margin-top: 20px; }
.sp-family .addr { margin-bottom: 14px; }

/* Tour */
.sp-tour { position: fixed; inset: 0; z-index: 200; background: rgba(12,20,40,.55); display: grid; place-items: center; padding: 18px; }
.sp-tour[hidden] { display: none; }
.sp-tour-card { background: #fff; border-radius: 24px; width: min(440px, 100%); padding: 30px 28px 20px; text-align: center; font-family: var(--display); color: #12213A; box-shadow: 0 30px 80px rgba(0,0,0,.3); animation: sp-pop .28s ease-out; }
.sp-slide h2 { font-size: 23px; font-weight: 800; letter-spacing: -.02em; margin: 18px 0 8px; }
.sp-slide p { color: #5D6B82; margin: 0 auto; max-width: 34ch; font-size: 15.5px; min-height: 4.6em; }
.sp-slide-art { width: 96px; height: 96px; margin: 0 auto; border-radius: 28px; background: var(--brand); color: var(--on-brand); display: grid; place-items: center; }
.sp-slide-art .sp-ico { width: 44px; height: 44px; stroke-width: 1.6; }
.sp-art-unis { border-radius: 50%; }
.sp-art-docs { transform: rotate(-6deg); }
.sp-art-msgs { border-radius: 28px 28px 28px 6px; }
.sp-tour-foot { display: flex; align-items: center; gap: 8px; margin-top: 22px; }
.sp-dots { display: flex; gap: 6px; margin-right: auto; }
.sp-dots i { width: 8px; height: 8px; border-radius: 99px; background: #E2E7EF; transition: width .2s; }
.sp-dots i.on { width: 22px; background: var(--brand); }
@keyframes sp-pop { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .sp-tour-card { animation: none; } .sp-ticket { transition: none; } .sp-ticket:hover { transform: none; } }

/* Tablet & phone: top bar + bottom tabs */
@media (max-width: 900px) {
  .sp-shell { display: block; padding-bottom: 76px; }
  .sp-side { display: none; }
  .sp-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--s-line); padding: 10px 16px; }
  .sp-top .sp-brand { padding: 0; min-width: 0; }
  .sp-top .sp-brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sp-top .sp-logo { width: 34px; height: 34px; }
  .sp-more { cursor: pointer; width: 38px; height: 38px; }
  .sp-sheet { position: absolute; right: 12px; top: calc(100% + 6px); background: #fff; border: 1px solid var(--s-line); border-radius: 16px; box-shadow: 0 18px 40px rgba(18,33,58,.16); padding: 14px; width: min(280px, calc(100vw - 24px)); display: flex; flex-direction: column; gap: 2px; }
  .sp-sheet[hidden] { display: none; }
  .sp-sheet > b { font-size: 15px; }
  .sp-sheet > .small { margin-bottom: 8px; }
  .sp-sheet a, .sp-sheet button { display: flex; align-items: center; gap: 10px; padding: 11px 6px; border: 0; background: none; border-top: 1px solid var(--s-line); color: var(--s-ink); text-decoration: none; font: 600 15px var(--display); text-align: left; cursor: pointer; }
  .sp-tabs { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: #fff; border-top: 1px solid var(--s-line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .sp-tabs a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 5px 2px; font-size: 11.5px; font-weight: 600; color: var(--s-muted); text-decoration: none; border-radius: 10px; }
  .sp-tabs a.on { color: var(--brand); }
  .sp-tabs a.on .sp-ico { background: var(--brand-soft); border-radius: 99px; padding: 2px 12px; width: 46px; box-sizing: content-box; height: 22px; margin: -2px 0; }
  .sp-main { padding: 20px 16px 28px; }
  .sp-hero { grid-template-columns: 1fr; padding: 22px 20px; border-radius: 20px; }
  .sp-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .sp-two { grid-template-columns: 1fr; }
  .sp-block { padding: 16px; border-radius: 16px; }
  .sp-uni-facts { width: 100%; }
  .sp-uni-facts div { flex: 1 1 40%; }
  .sp-uni-facts div:nth-child(odd) { border-left: 0; }
  .sp-uni-facts div:nth-child(n+3) { border-top: 1px solid var(--s-line); }
}
@media (max-width: 420px) {
  .sp-tickets { grid-template-columns: 1fr; }
  .sp-ticket { grid-template-columns: 60px minmax(0, 1fr); }
  .sp-mark { width: 38px; height: 38px; font-size: 13px; }
  .sp-facts b { font-size: 22px; }
  .sp-ask .btn { width: 100%; }
}
.sp-two { align-items: start; }
.sp-main .site-foot { background: none; padding: 22px 0 0; margin-top: 26px; border-color: var(--s-line); color: var(--s-muted); }
/* Sidebar background runs the full height */
@media (min-width: 901px) { .sp-shell { background: linear-gradient(90deg, #fff 259px, var(--s-line) 259px, var(--s-line) 260px, transparent 260px); } }

/* Full route: labels alternate below / above the line so long stage names never collide */
.sp-route-full { height: 150px; margin: 0 18px; }
.sp-route-full .sp-line, .sp-route-full .sp-stop { top: 75px; }
.sp-lbl { position: absolute; left: 50%; transform: translateX(-50%); width: max-content; max-width: 140px; text-align: center; display: flex; flex-direction: column; line-height: 1.25; }
.sp-lbl b { font-size: 12.5px; font-weight: 600; color: var(--s-muted); }
.sp-lbl small { font-size: 11.5px; color: var(--s-muted); white-space: nowrap; }
.sp-route-full .sp-stop:nth-child(even) .sp-lbl { top: 18px; }
.sp-route-full .sp-stop:nth-child(odd) .sp-lbl { bottom: 18px; flex-direction: column; }
.sp-route-full .sp-stop.now .sp-lbl b { color: var(--s-ink); font-weight: 700; font-size: 13.5px; }
.sp-route-full .sp-stop.now .sp-lbl small { color: var(--brand); font-weight: 600; }
.sp-route-full .sp-stop.now:nth-child(even) .sp-lbl { top: 34px; }
.sp-route-full .sp-stop.now:nth-child(odd) .sp-lbl { bottom: 34px; }
.sp-route-full .sp-stop:nth-child(2) .sp-lbl { left: -4px; transform: none; text-align: left; }
.sp-route-full .sp-stop:last-child .sp-lbl { left: auto; right: -4px; transform: none; text-align: right; }
.sp-route-full .sp-stop.done .sp-lbl b { color: var(--s-ink); }
@media (max-width: 1100px) {
  .sp-route-full { height: 96px; }
  .sp-route-full .sp-line, .sp-route-full .sp-stop { top: 22px; }
  .sp-route-full .sp-stop:not(.now) .sp-lbl { display: none; }
  .sp-route-full .sp-stop.now .sp-lbl, .sp-route-full .sp-stop.now:nth-child(odd) .sp-lbl { top: 34px; bottom: auto; }
}
.sp-progress { display: flex; align-items: center; gap: 16px; background: #fff; border: 1px solid var(--s-line); border-radius: 16px; padding: 14px 18px; margin-bottom: 16px; flex-wrap: wrap; }
.sp-progress b { font-size: 24px; font-weight: 800; }
.sp-progress b small { font-size: 14px; font-weight: 600; color: var(--s-muted); }
.sp-progress > span:last-child { color: var(--s-muted); font-size: 14px; }
.sp-bar { flex: 1 1 160px; height: 10px; border-radius: 99px; background: var(--s-canvas); overflow: hidden; }
.sp-bar i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.sp-wrap-partial > .card > .row:first-child h3 { font-size: 18px; }
