/* University of Johannesburg - Student Hub (demo).
 * Palette from the University's own site tokens (news.uj.ac.za Elementor kit, 10 Oct 2026):
 * primary #F26522 (UJ orange), secondary #4F2652, black #000000, white #FFFFFF, text grey #7A7A7A.
 * Text on orange is black (contrast 6.6:1); orange TEXT on white uses the darker #B8460B (4.9:1). */
:root {
  --uj-orange: #F26522; --uj-orange-dark: #B8460B; --uj-orange-soft: #FDEBE1; --uj-plum: #4F2652;
  --black: #000000; --charcoal: #1A1A1A; --grey: #7A7A7A; --muted: #555555; --line: #E3E3E3;
  --bg: #F6F6F6; --surface: #FFFFFF; --ink: #1A1A1A;
  --good: #1D7A3A; --bad: #B3261E; --warn-bg: #FFF4D6; --warn-ink: #6B4E00;
  --radius: 4px; --shadow: 0 1px 3px rgba(0, 0, 0, .10);
  --bottomnav-h: 64px;
  /* The chat's theme (lane uxt, 13 Oct 2026; owner: "make sure theme of mouji chat is completely aligned with uj
     chatbot"). UJ's own MoUJi is a LiveChat "smooth" widget: a light grey canvas, white cards with 20px corners,
     12px buttons, round grey head controls, near-black text, the system font, a white tab launcher with an orange
     label, light only. The same values as the web chat widget's soft look (Nova --grey-300/400/500/600/900), so
     the Hub's chat and the widget read as one product. Measured: ink on the canvas 15.1:1, on a card 19.5:1;
     muted 5.5:1 on the canvas; control text 10.9:1 (hover 5.3:1); field edge 7.1:1 on white, 5.5:1 on the
     canvas; the tab's #B8460B label 5.4:1 on white. MoUJi's white text on #F26522 is 3.15:1 (fails AA), so the visitor's line stays black on
     orange (6.6:1). */
  --chat-canvas: #E1E2E5; --chat-card: #FFFFFF; --chat-ink: #040D17; --chat-muted: #535862;
  --chat-control: #C0C2C5; --chat-control-hover: #81858A; --chat-field-edge: #535862;
  --chat-font: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --chat-radius-panel: 24px; --chat-radius-card: 20px; --chat-radius-button: 12px; --chat-radius-field: 6px;
  --chat-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 8px 28px rgba(0, 0, 0, .2);
  --chat-tab-shadow: 0 0 1px rgba(0, 0, 0, .2), 0 3px 8px -2px rgba(0, 0, 0, .18), 0 -2px 10px rgba(0, 0, 0, .08);
  font-family: "Helvetica Neue", Helvetica, Arial, "Noto Sans", sans-serif;
  color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
/* `hidden` must win over every display rule below (.chat-start is a grid, .chat-log a flex box...):
   without this the start form stayed on screen above an open chat (UJ stack, 11 Oct). */
[hidden] { display: none !important; }
html, body { margin: 0; }
body { min-height: 100vh; line-height: 1.5; background: var(--bg); }
a { color: var(--uj-orange-dark); }
h1 { font-size: 2rem; line-height: 1.15; margin: .2rem 0 .6rem; font-weight: 700; }
h2 { font-size: 1.15rem; margin: 0 0 .6rem; font-weight: 700; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px; z-index: 100; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.inline { display: inline; margin: 0; }
.inline-h { display: inline; font-size: 1.15rem; }
ul.plain { list-style: none; padding: 0; margin: 0; }

/* A thin, discreet ribbon. */
.demo-banner { background: var(--charcoal); color: #FFD9C4; text-align: center; font-size: .75rem;
  letter-spacing: .03em; padding: 3px 12px; }

/* Top bar: wordmark, Student Hub links, account. */
.topbar { display: flex; align-items: center; gap: 28px; padding: 14px 32px; background: var(--surface);
  border-bottom: 4px solid var(--uj-orange); position: sticky; top: 0; z-index: 30; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--black); }
.brand-logo { height: 52px; width: auto; }
.wordmark { display: flex; flex-direction: column; line-height: 1.02; font-weight: 800; letter-spacing: .06em;
  font-size: .82rem; color: var(--black); border-left: 6px solid var(--uj-orange); padding-left: 10px; }
.wordmark span:nth-child(2) { font-weight: 400; font-size: .7rem; }
.wordmark span:nth-child(3) { font-size: 1.05rem; letter-spacing: .04em; }
.brand-sub { font-size: .95rem; color: var(--muted); border-left: 1px solid var(--line); padding-left: 14px; }
.brand-sub em { font-style: normal; color: var(--grey); }
.utilnav { display: flex; gap: 20px; flex: 1; justify-content: flex-end; }
.utilnav a { color: var(--black); text-decoration: none; font-weight: 600; padding: 4px 0; border-bottom: 3px solid transparent; }
.utilnav a[aria-current="page"], .utilnav a:hover { border-color: var(--uj-orange); }
.account { display: flex; align-items: center; gap: 12px; }
.who { font-size: .88rem; color: var(--muted); }
.who strong { color: var(--black); }

/* The University's primary navigation labels (demo placeholders). */
.mainnav { display: flex; gap: 4px; padding: 0 24px; background: var(--black); overflow-x: auto; }
.mainnav a { color: #FFFFFF; text-decoration: none; font-weight: 600; font-size: .92rem; padding: 12px 14px;
  border-bottom: 3px solid transparent; white-space: nowrap; }
.mainnav a:hover, .mainnav a:focus-visible { border-color: var(--uj-orange); color: #FFD9C4; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 2px;
  padding: 10px 18px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
  border: 2px solid transparent; letter-spacing: .01em; }
.btn-primary { background: var(--uj-orange); color: var(--black); }
.btn-primary:hover { background: #E0561A; }
.btn-dark { background: var(--black); color: #FFFFFF; }
.btn-ghost { background: transparent; color: var(--black); border-color: var(--black); }
.link-btn { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; }
.icon-btn { background: none; border: 0; font-size: 1.7rem; line-height: 1; cursor: pointer; color: #FFFFFF; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--uj-plum); outline-offset: 2px; }

.page { max-width: 1200px; margin: 0 auto; padding: 0 32px 96px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px; margin-bottom: 22px; }
.card h2 { border-left: 4px solid var(--uj-orange); padding-left: 10px; }
.grid { display: grid; gap: 22px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 22px; }
.grid.tiles { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 22px; }
.grid .card { margin-bottom: 0; }
.tile { border-top: 4px solid var(--uj-orange); }
.tile h2 { border: 0; padding: 0; }
.tile .big { font-size: 1.7rem; font-weight: 800; margin: 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; color: var(--uj-orange-dark); font-weight: 700; margin: 0; }
.tag { display: inline-block; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  background: var(--uj-orange); color: var(--black); border-radius: 2px; padding: 2px 6px; vertical-align: middle; }
.tag.warn { background: var(--warn-bg); color: var(--warn-ink); }
.status { font-weight: 700; margin: .2rem 0; }
.status-outstanding, .status-overdue, .status-blocked, .status-waitlisted { color: var(--bad); }
.status-settled, .status-registered, .status-accepted, .status-allocated, .status-provisionally_eligible { color: var(--good); }
.alert { background: #FDECEC; color: var(--bad); border: 1px solid #F3C2C4; border-radius: 2px; padding: 8px 12px; }

/* Hero banner: black with an orange band, as the University's banners do. */
.hero { display: grid; grid-template-columns: 3fr 2fr; gap: 32px; align-items: center; color: #FFFFFF;
  background: linear-gradient(90deg, var(--black) 0%, var(--black) 62%, var(--charcoal) 100%);
  border-bottom: 8px solid var(--uj-orange); padding: 40px 36px; margin: 0 -32px 26px; }
.hero h1 { font-size: 2.6rem; }
.hero .eyebrow { color: var(--uj-orange); }
.hero .lead { color: #E6E6E6; font-size: 1.05rem; max-width: 60ch; }
.hero .btn-ghost { color: #FFFFFF; border-color: #FFFFFF; }
.hero-points { margin: 0; padding: 20px 22px 20px 38px; background: rgba(255,255,255,.06); border-left: 4px solid var(--uj-orange); color: #EDEDED; }
.hero-points li { margin-bottom: 10px; }
.hero-points strong { color: var(--uj-orange); }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.welcome { background: var(--black); color: #FFFFFF; border-bottom: 6px solid var(--uj-orange); padding: 26px 36px; margin: 0 -32px 24px; }
.welcome .muted { color: #D0D0D0; }
.welcome strong { color: var(--uj-orange); }

.explore { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; margin-bottom: 22px; }
.explore-card { display: block; background: var(--uj-orange); color: var(--black); text-decoration: none; padding: 22px;
  border-radius: var(--radius); }
.explore-card:nth-child(2) { background: var(--black); color: #FFFFFF; }
.explore-card:nth-child(3) { background: var(--uj-plum); color: #FFFFFF; }
.explore-card h2 { margin: 0 0 6px; }
.explore-card p { margin: 0; }

.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table thead th { border-bottom: 2px solid var(--black); }
.table .num { text-align: right; white-space: nowrap; }
.links li { margin-bottom: 8px; }
code { background: #F0F0F0; padding: 1px 5px; border-radius: 3px; font-size: .88em; }

.auth { display: grid; place-items: center; padding-top: 28px; }
.auth-card { width: min(460px, 100%); border-top: 6px solid var(--uj-orange); }
.auth-card h1 { font-size: 1.6rem; }
.stack { display: grid; gap: 8px; }
.stack input, .chat-start textarea, .chat-start select, .chat-send input, .aps-form input, .aps-form select {
  font: inherit; padding: 10px 12px; border: 1px solid #BDBDBD; border-radius: 2px; background: #fff; width: 100%; }
.stack .btn { margin-top: 8px; }
.demo-students ul { margin: .4rem 0; }

.aps-rows { display: grid; gap: 8px; margin-bottom: 10px; }
.aps-row { display: grid; grid-template-columns: 1fr 90px 36px; gap: 6px; }
.aps-row button { border: 1px solid var(--line); background: #fff; border-radius: 2px; cursor: pointer; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row select { width: auto; flex: 1; min-width: 160px; }
.aps-result { display: block; margin-top: 12px; }
.aps-score { font-size: 1.6rem; font-weight: 800; }

.footer { background: var(--black); color: #D0D0D0; padding: 34px 32px 110px; border-top: 6px solid var(--uj-orange); }
.footer-cols { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 28px; }
.footer h2 { color: #FFFFFF; font-size: .95rem; text-transform: uppercase; letter-spacing: .08em; }
.footer a { color: var(--uj-orange); }
.footer-mark { color: #FFFFFF; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; margin-top: 0; }
.footer-legal { max-width: 1200px; margin: 22px auto 0; color: var(--grey); }
.social { display: flex; gap: 10px; list-style: none; padding: 0; margin: 0; }
.social span { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: #2A2A2A; color: #FFFFFF; font-weight: 700; font-size: .8rem; }

/* The Chat entry point (desktop) and the phone's bottom navigation. */
.chat-fab { position: fixed; right: 16px; bottom: 0; z-index: 40; display: flex; flex-direction: column;
  align-items: flex-start; min-width: 220px; border: 0; border-radius: 8px 8px 0 0; padding: 12px 18px; cursor: pointer;
  background: var(--chat-card); color: var(--uj-orange-dark); box-shadow: var(--chat-tab-shadow);
  font: inherit; font-family: var(--chat-font); }
.chat-fab-title { font-weight: 800; }
.chat-fab-sub { font-size: .75rem; color: var(--chat-muted); }
.bottomnav { display: none; }
/* The Kairo widget's own launcher is hidden: our Chat entry opens it (signed out). */
button[aria-controls="kairo-chat-frame"] { display: none !important; }

.chat-panel { position: fixed; right: 22px; bottom: 92px; width: min(420px, calc(100vw - 44px));
  height: min(640px, calc(100vh - 120px)); z-index: 50; display: flex; flex-direction: column;
  background: var(--chat-canvas); color: var(--chat-ink); font-family: var(--chat-font);
  border-radius: var(--chat-radius-panel); box-shadow: var(--chat-shadow); overflow: hidden; }
.chat-panel[hidden] { display: none; }
.chat-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 14px 16px;
  background: var(--chat-canvas); color: var(--chat-ink); }
.chat-head h2 { margin: 0; font-size: 1.05rem; }
.chat-sub { margin: 2px 0 0; font-size: .8rem; color: var(--chat-muted); }
/* MoUJi (owner, 11 Oct): the UJ logo as a small rounded avatar, the name as the title, Minimise beside Close. */
.chat-head-main { flex: 1; min-width: 0; }
.chat-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none; background: #FFFFFF; }
.chat-title { font-weight: 800; }
.chat-org { font-size: .78rem; font-weight: 400; color: var(--chat-muted); white-space: nowrap; }
.chat-head-actions { display: flex; gap: 2px; flex: none; }
.chat-head .icon-btn { min-width: 40px; min-height: 40px; border-radius: 999px; border: 0;
  background: var(--chat-control); color: var(--chat-ink); }
.chat-head .icon-btn:hover { background: var(--chat-control-hover); }
/* A short window (a phone on its side) has no room for it either, as the widget's loader decides (900x500 there). */
@media (max-height: 499px) { .chat-expand, .chat-scrim { display: none !important; } }
/* Maximise (lane ujux, owner 12 Oct): the icon shows what a press does; on a desktop-sized window the panel goes large
   and centred over a scrim, and the chat reads in one 48rem column (the panel's own edges and scrollbar stay put). */
.chat-expand { display: inline-flex; align-items: center; justify-content: center; }
.chat-expand svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round;
  stroke-linejoin: round; }
.chat-expand .chat-expand-restore, .chat-panel-max .chat-expand .chat-expand-max { display: none; }
.chat-panel-max .chat-expand .chat-expand-restore { display: inline; }
.chat-scrim { position: fixed; inset: 0; z-index: 49; background: rgba(0, 0, 0, .45); }
@media (min-width: 861px) and (min-height: 500px) {
  .chat-panel.chat-panel-max { top: 24px; bottom: 24px; left: 0; right: 0; margin: 0 auto;
    width: min(960px, calc(100vw - 48px)); height: auto; }
  .chat-panel-max .chat-body, .chat-panel-max .chat-foot { padding-inline: max(16px, calc((100% - 48rem) / 2)); }
}
.msg-bot.msg-has-avatar { position: relative; padding-left: 44px; }
.msg-avatar { position: absolute; left: 10px; top: 10px; width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
/* The unread count on the Chat entries while the chat is minimised. */
.chat-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px;
  padding: 0 6px; border-radius: 999px; background: #FFFFFF; color: var(--black); font-size: .72rem; font-weight: 800;
  border: 2px solid var(--black); }
.chat-fab .chat-badge { position: absolute; top: -8px; right: -8px; }
.bottomnav button[data-chat-open] { position: relative; }
.bottomnav .chat-badge { position: absolute; top: 4px; left: calc(50% + 6px); background: var(--uj-orange); border-color: var(--uj-orange); }
/* The language selector in the chat header (owner, 11 Oct): a 40px target, a white field on the grey head (uxt). */
.chat-head-lang { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: .8rem; flex-wrap: wrap; }
.chat-head-lang label { color: var(--chat-muted); }
.chat-head-lang select { min-height: 40px; max-width: 100%; padding: 6px 10px; font: inherit; font-size: .9rem;
  color: var(--chat-ink); background: var(--chat-card); border: 1px solid var(--chat-field-edge);
  border-radius: var(--chat-radius-field); cursor: pointer; }
.chat-head-lang[aria-busy="true"] select { opacity: .6; cursor: progress; }
.chat-body { flex: 1; overflow-y: auto; padding: 14px 16px; }
.chat-start { display: grid; gap: 8px; }
.chat-start .consent { font-size: .85rem; display: flex; gap: 8px; align-items: flex-start; }
.chat-start .consent input { width: auto; margin-top: 4px; }
.chat-error { color: var(--bad); min-height: 1em; margin: 0; }
.chat-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 85%; padding: 9px 12px; border-radius: var(--chat-radius-card); white-space: pre-wrap; word-wrap: break-word; }
.msg .who { display: block; font-size: .72rem; font-weight: 800; color: var(--chat-muted); margin-bottom: 2px; }
.msg-visitor { align-self: flex-end; background: var(--uj-orange); color: var(--black); }
.msg-visitor .who { color: #3A1A08; }
.msg-desk { align-self: flex-start; background: var(--chat-card); }
.msg a { color: inherit; text-decoration: underline; }
.msg-advisor { background: #EFE7F0; border-left: 3px solid var(--uj-plum); }
.msg-signal { align-self: center; font-size: .8rem; color: var(--chat-muted); background: none; padding: 2px 8px; }
/* Lane uxh (Q2, F04): web addresses in a desk line are links - the bubble's own ink, underlined (colours are lane
   uxt's); a long one wraps anywhere rather than overflow. */
.msg-desk .msg-text a { color: inherit; text-decoration: underline; overflow-wrap: anywhere; }
/* Lane uxh (Q3, F05): a message not sent yet stays as a bubble - "Sending..." under it, or, when it could not be
   sent, the reason and Try again (a plain bubble with a dashed edge, so it never reads as delivered). Existing tokens
   only: the chat's colours are lane uxt's. */
.chat-pending { margin-top: 10px; }
.msg-state { display: block; font-size: .75rem; margin-top: 2px; }
.msg-pending.msg-failed { background: var(--surface); border: 1px dashed var(--uj-orange-dark); }
.msg-failed .msg-state { color: var(--bad); }
.msg-retry { display: block; margin-left: auto; padding: 0 4px; color: var(--black); font-weight: 700; }

.chat-typing { font-size: .8rem; color: var(--chat-muted); margin: 6px 0 0; }
.chat-foot { padding: 10px 12px; display: grid; gap: 8px; background: var(--chat-canvas); }
/* uxt: the chat's fields and buttons in MoUJi's corners, a field's edge at 3:1 or more on both sides. */
.chat-panel .chat-start textarea, .chat-panel .chat-start select, .chat-panel .chat-send input {
  border-color: var(--chat-field-edge); border-radius: var(--chat-radius-field); }
.chat-panel .btn { border-radius: var(--chat-radius-button); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
/* Lane uxh (Q8, F18): 44 px targets - the topic chips, MoUJi's options, End chat and every text button in the chat. */
.chip { border: 1px solid var(--black); color: var(--black); background: #fff; border-radius: 999px;
  min-height: 44px; padding: 8px 14px; font: inherit; font-size: .82rem; line-height: 1.25; cursor: pointer; }
.chat-panel .link-btn { min-height: 44px; padding: 0 12px; }
.chat-foot [data-chat-end] { justify-self: center; }
.chip:hover { background: var(--uj-orange-soft); }
.chip-advisor { background: var(--black); color: #FFFFFF; font-weight: 700; }
.chat-send { display: flex; gap: 8px; }
/* UJ quick actions (owner, 12 Oct): MoUJi's options under its line, as the web chat widget draws them - pills that
   wrap, so ten topics fold onto as many lines as a phone needs and a long label (or translation) wraps inside its
   pill. 40 px targets. The tapped one stays orange once they are all used; the rest fade. */
.msg-options { align-self: flex-start; max-width: 100%; list-style: none; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.quick-btn { min-height: 44px; padding: 8px 14px; font: inherit; font-size: .88rem; line-height: 1.25; cursor: pointer;
  background: #FFFFFF; color: var(--black); border: 1px solid var(--uj-orange-dark); border-radius: 999px;
  text-align: start; white-space: normal; overflow-wrap: anywhere; max-width: 100%; }
@media (hover: hover) { .quick-btn:hover:not(:disabled) { background: var(--uj-orange-soft); } }
.quick-btn:disabled { cursor: default; }
.quick-btn:disabled:not(.quick-btn-chosen) { opacity: .5; }
.quick-btn-chosen { background: var(--uj-orange); border-color: var(--uj-orange); font-weight: 700; }
/* UJ chat CSAT: the desk's rating request. 44 px targets; the chosen answer is UJ orange. */
.msg.rating { align-self: stretch; max-width: 100%; background: var(--chat-card); border: 1px solid var(--line);
  border-top: 4px solid var(--uj-orange); border-radius: var(--chat-radius-card); white-space: normal; }
.rating-lead { font-weight: 700; margin: 0 0 8px; }
.rating-scale, .rating-reason-group { display: grid; gap: 6px; }
.rate-btn { min-height: 44px; width: 100%; text-align: left; padding: 8px 12px; font: inherit; cursor: pointer;
  background: #FFFFFF; color: var(--black); border: 1px solid var(--chat-field-edge); border-radius: var(--chat-radius-button); }
.rate-btn:hover:not(:disabled) { background: var(--uj-orange-soft); }
.rate-btn[aria-pressed="true"], .rate-reason[aria-pressed="true"] { background: var(--uj-orange); color: var(--black);
  border-color: var(--uj-orange); font-weight: 700; }
.rate-btn:disabled, .rate-reason:disabled { cursor: default; }
.rate-btn:disabled:not([aria-pressed="true"]), .rate-reason:disabled:not([aria-pressed="true"]) { opacity: .55; }
.rating-reasons { margin-top: 10px; }
.rate-reason { min-height: 44px; }
.rating-thanks { margin: 10px 0 0; font-weight: 700; color: var(--good); }
.chat-send input { flex: 1; }

.public-chat-bar { display: none; }

@media (max-width: 860px) {
  .topbar { padding: 10px 16px; gap: 10px; }
  .utilnav, .account .btn, .account form, .brand-sub, .mainnav { display: none; }
  .account { margin-left: auto; }
  .who { font-size: .76rem; text-align: right; max-width: 45vw; }
  .page { padding: 0 max(16px, env(safe-area-inset-right)) calc(var(--bottomnav-h) + env(safe-area-inset-bottom) + 24px)
    max(16px, env(safe-area-inset-left)); }
  .topbar { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .grid.two, .hero, .explore, .footer-cols { grid-template-columns: 1fr; }
  .hero, .welcome { margin: 0 -16px 18px; padding: 24px 18px; }
  .hero h1 { font-size: 1.8rem; }
  h1 { font-size: 1.5rem; }
  .chat-fab { display: none; }
  .footer { padding: 24px 18px calc(var(--bottomnav-h) + env(safe-area-inset-bottom) + 24px); }
  /* Lane uxh (L10, F24): the bar keeps its full height above a gesture bar or a rounded corner. */
  .bottomnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom));
    background: var(--black); border-top: 3px solid var(--uj-orange); padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
  /* Lane uxh (Q8, F12): while the chat is open the bottom bar hides, so the chat has the whole screen. */
  body.chat-open .bottomnav { display: none; }
  .bottomnav > a, .bottomnav > button, .bottomnav > form { flex: 1; }
  .bottomnav a, .bottomnav button { display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; height: 100%; width: 100%; font: inherit; font-size: .74rem; color: #D0D0D0; text-decoration: none;
    background: none; border: 0; cursor: pointer; }
  .bottomnav span { font-size: 1.25rem; line-height: 1; }
  .bottomnav [aria-current="page"], .bottomnav [aria-expanded="true"] { color: var(--uj-orange); font-weight: 700; }
  /* Maximise is for a desktop-sized window: the phone's chat already fills the screen. */
  .chat-expand, .chat-scrim { display: none !important; }
  /* The full-screen chat (the bottom bar hides while it is open), clear of the notch, the status bar and the
     gesture bar (lane uxh L10, F24): each edge is padded by the screen's own safe area. */
  .chat-panel { inset: 0; width: auto; height: auto; border-radius: 0; z-index: 60; }
  /* A compact head (lane uxh Q8, F12): the identity on one line, the language beside its label, 44 px buttons. */
  .chat-head { gap: 10px; padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px
    max(12px, env(safe-area-inset-left)); }
  .chat-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* uxt: the name and the organisation on ONE line too, cut with an ellipsis - the soft look's system font is wider
     than Arial, and at 390 px "MoUJi University of Johannesburg" would wrap and push the head past 120 px. */
  .chat-head h2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .chat-head-lang { margin-top: 6px; flex-wrap: nowrap; }
  .chat-head-lang select { min-height: 44px; min-width: 0; flex: 1; max-width: 16rem; }
  .chat-head .icon-btn { min-width: 44px; min-height: 44px; }
  .chat-body { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .chat-foot { padding: 10px max(12px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left)); }
  #kairo-chat-frame { left: env(safe-area-inset-left) !important; right: env(safe-area-inset-right) !important;
    top: calc(44px + env(safe-area-inset-top)) !important; bottom: env(safe-area-inset-bottom) !important;
    width: calc(100vw - env(safe-area-inset-left) - env(safe-area-inset-right)) !important;
    height: calc(100vh - 44px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
    height: calc(100dvh - 44px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
    border-radius: 0 !important; }
  .public-chat-bar:not([hidden]) { display: flex; position: fixed; top: 0; left: 0; right: 0; z-index: 2147483001;
    height: calc(44px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) max(12px, env(safe-area-inset-right)) 0
    max(12px, env(safe-area-inset-left));
    align-items: center; gap: 12px; background: var(--black); color: #FFFFFF; font-size: .85rem;
    border-bottom: 3px solid var(--uj-orange); }
  .public-chat-bar span { flex: 1; }
  .public-chat-bar a { display: inline-flex; align-items: center; min-height: 44px; color: var(--uj-orange); font-weight: 700; }
}
/* A phone on its side (lane uxh Q8, F12): the head keeps the name, the language and the buttons. */
@media (max-width: 860px) and (max-height: 499px) {
  .chat-sub, .chat-org { display: none; }
}
