/* AstroMaths portal theme
   Light, white surfaces. Colours and type come from the AstroMinds logo:
   violet #623BD2 is the primary colour, yellow #FDCE06 the secondary,
   Unbounded SemiBold for the wordmark and headings.
   Load after w3-data.css. All portal styling lives here, so the per-student
   pages only carry markup and script. */

:root {
  --bg:           #F6F4FE;  /* page */
  --surface:      #FFFFFF;  /* cards */

  --violet:       #623BD2;  /* logo violet: primary */
  --violet-text:  #4C28BC;  /* violet for text and links */
  --violet-deep:  #2D1879;  /* text on yellow */
  --violet-50:    #F5F2FF;
  --violet-100:   #EDE7FF;
  --violet-200:   #DED4FF;

  --yellow:       #FDCE06;  /* logo yellow: secondary */
  --yellow-hover: #FFD938;
  --yellow-50:    #FFF9E0;
  --yellow-100:   #FFF0B3;
  --due-text:     #A34A06;  /* readable "due" text (deep orange) */

  --ink:          #1E1645;
  --ink-2:        #575080;
  --ink-3:        #8A84A8;
  --line:         #ECE8F8;
  --line-2:       #DCD5F4;

  --green:        #13875A;
  --green-50:     #E5F6ED;
  --red:          #CF3550;

  --shadow: 0 1px 2px rgba(45, 24, 121, .05), 0 12px 28px -14px rgba(45, 24, 121, .18);

  --font-display: "Unbounded", "Geologica", system-ui, sans-serif;
  --font-text:    "Geologica", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --r-xl: 24px;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 12px;
  --nav-h: 64px;
}

/* ── Base ─────────────────────────────────────────────────────── */
html, body {
  font-family: var(--font-text);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
}
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-text);
  font-weight: 600;
  margin: 0;
  color: var(--ink);
  line-height: 1.25;
}
p { margin: 0; }
a { color: var(--violet-text); font-weight: 500; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
button { font: inherit; }
::selection { background: var(--yellow); color: var(--violet-deep); }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; border-radius: 8px; }

.page { display: none; }
.page.active { display: block; }

/* ── Wordmark (as in the AstroMinds logo) ─────────────────────── */
.wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.01em;
  color: var(--violet);
  white-space: nowrap;
}
.wordmark span { color: var(--yellow); }

/* ── Icons ────────────────────────────────────────────────────── */
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.badge-icon {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--violet-100);
  color: var(--violet);
}
.badge-icon.yellow { background: var(--yellow-100); color: var(--violet-deep); }
.badge-icon.white { background: var(--surface); }
.badge-icon.sm { flex-basis: 32px; width: 32px; height: 32px; border-radius: 10px; }
.badge-icon.sm .ico { width: 17px; height: 17px; }
.spark { fill: currentColor; }

/* ── Top bar ──────────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 16px 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 18px -14px rgba(45, 24, 121, .35);
}
.topbar .wordmark { margin-right: 22px; }
.nav-link {
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 14.5px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.nav-link:hover { background: var(--violet-50); color: var(--violet-text); text-decoration: none; }
.nav-link.nav-active { background: var(--violet-100); color: var(--violet-text); font-weight: 600; }
.nav-logout { margin-left: auto; }
.nav-burger {
  margin-left: auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--violet-text);
}
.nav-burger:hover { background: var(--violet-50); }
.nav-burger .ico { width: 24px; height: 24px; }

.mobile-menu {
  position: fixed;
  top: var(--nav-h); left: 0; right: 0;
  z-index: 49;
  padding: 8px 12px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 18px 30px -20px rgba(45, 24, 121, .4);
}
.mobile-menu a {
  display: block;
  padding: 13px 14px;
  border-radius: 12px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
}
.mobile-menu a:hover { background: var(--violet-50); }
.mobile-menu a:last-child { color: var(--ink-2); }

/* ── Page frame ───────────────────────────────────────────────── */
.portal-main {
  flex: 1;
  width: 100%;
  max-width: 1180px;
  margin: calc(var(--nav-h) + 28px) auto 0;
  padding: 0 24px 40px;
}
.home-grid {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.narrow { max-width: 800px; }

/* ── Cards ────────────────────────────────────────────────────── */
.panel {
  position: relative;
  min-width: 0;
  padding: 22px 24px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.title-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.panel > .title-row { margin-bottom: 16px; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.panel-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.panel-aside { color: var(--ink-2); font-size: 14px; white-space: nowrap; }
.panel-meta { margin: -4px 0 8px; color: var(--ink-2); font-size: 15px; }
.page-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.panel > .btn:last-child { margin-top: 18px; }

/* Key / value rows */
.info-list { margin: 0; }
.info-row {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}
.info-row:first-child { border-top: 0; }
.info-key { flex: 0 0 96px; color: var(--ink-3); font-size: 14px; }
.info-val { min-width: 0; color: var(--ink); font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: 1.5px solid transparent;
  border-radius: var(--r-sm);
  font-family: var(--font-text);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .6; cursor: default; }
.btn-primary { background: var(--yellow); color: var(--violet-deep); }
.btn-primary:hover { background: var(--yellow-hover); }
.btn-secondary { background: var(--violet-100); color: var(--violet-text); }
.btn-secondary:hover { background: var(--violet-200); }
.btn-outline { background: var(--surface); color: var(--violet-text); border-color: var(--violet-200); }
.btn-outline:hover { background: var(--violet-50); border-color: var(--violet); }
.btn-block { width: 100%; }

/* ── Notice from the tutor ────────────────────────────────────── */
#notice-banner { display: none; }
#notice-banner.visible { display: flex; }
.notice {
  align-items: flex-start;
  gap: 12px;
  padding: 14px 12px 14px 14px;
  border-radius: var(--r-lg);
  background: var(--yellow-50);
  border: 1px solid #F6E39A;
}
.notice .badge-icon { background: var(--yellow); color: var(--violet-deep); }
.notice-text { flex: 1; padding-top: 7px; color: var(--ink); font-size: 15px; font-weight: 500; line-height: 1.5; }
.notice-close {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-2);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.notice-close:hover { background: var(--yellow-100); color: var(--ink); }

/* ── Next class (hero card) ───────────────────────────────────── */
.hero {
  overflow: hidden;
  padding: 24px 26px 26px;
  background: var(--violet-100);
  border: 0;
  border-radius: var(--r-xl);
  box-shadow: none;
}
.hero::before {               /* the yellow planet */
  content: "";
  position: absolute;
  top: -46px;
  right: -40px;
  width: 168px;
  height: 168px;
  border-radius: 50%;
  background: var(--yellow);
}
.hero::after {                /* its small violet moon */
  content: "";
  position: absolute;
  top: 120px;
  right: 136px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--violet-200);
}
.hero > * { position: relative; z-index: 1; }
.hero-spark { position: absolute; z-index: 1; color: var(--violet); pointer-events: none; }
.hero-spark.s1 { top: 26px; right: 168px; width: 30px; height: 30px; }
.hero-spark.s2 { top: 72px; right: 196px; width: 14px; height: 14px; }
.hero-spark.s3 { top: 150px; right: 44px; width: 18px; height: 18px; color: #E7B800; }
.time-big {
  margin: 18px 0 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(54px, 7.4vw, 78px);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--violet);
  font-variant-numeric: tabular-nums;
}
.hero-when { color: var(--ink); font-size: 17px; font-weight: 600; }
.hero-when .time-range { margin-left: 6px; color: var(--ink-2); font-weight: 500; white-space: nowrap; }
.hero-details {
  margin-top: 18px;
  padding: 4px 16px;
  background: var(--surface);
  border-radius: var(--r-md);
}
.hero .btn { margin-top: 20px; }

/* ── Reschedule strip ─────────────────────────────────────────── */
.resched {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 20px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.resched-title { color: var(--ink); font-size: 16px; font-weight: 600; }
.resched-sub { margin-top: 1px; color: var(--ink-2); font-size: 14.5px; }

/* ── Profile ──────────────────────────────────────────────────── */
.profile { padding: 0 0 22px; overflow: hidden; text-align: center; }
.profile-band {
  position: relative;
  height: 86px;
  background: var(--violet-100);
}
.profile-band .spark { position: absolute; color: var(--violet); }
.profile-band .b1 { top: 18px; left: 28px; width: 22px; height: 22px; }
.profile-band .b2 { top: 46px; left: 58px; width: 11px; height: 11px; }
.profile-band .b3 { top: 22px; right: 34px; width: 16px; height: 16px; color: var(--yellow); }
.profile .avatar-wrap { margin-top: -54px; }
.profile-name {
  margin: 16px 20px 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.01em;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.profile-sub { margin-top: 2px; color: var(--ink-2); font-size: 14px; }
.profile .info-list { margin: 16px 22px 0; text-align: left; }
.profile .info-row:first-child { border-top: 1px solid var(--line); }
.initials {
  position: relative;
  width: 96px;
  height: 96px;
  margin: -50px auto 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  color: var(--violet);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 28px;
  letter-spacing: -0.02em;
  box-shadow: 0 0 0 4px var(--surface), 0 0 0 7px var(--yellow);
}

/* ── Contact list (accordion) ─────────────────────────────────── */
.panel.acc { padding: 8px; }
.acc-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 12px 8px 8px;
  border: 0;
  border-radius: var(--r-md);
  background: none;
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.acc-btn:hover, .acc-btn.w3-theme-d1 { background: var(--violet-50); }
.acc-btn::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-left: auto;
  border-right: 2px solid var(--ink-3);
  border-bottom: 2px solid var(--ink-3);
  transform: translateY(-2px) rotate(45deg);
  transition: transform .2s;
}
.acc-btn.w3-theme-d1::after { transform: translateY(2px) rotate(-135deg); }
.acc-panel { padding: 4px 12px 12px 52px; color: var(--ink-2); font-size: 15px; overflow-wrap: anywhere; }

/* ── Stat tiles (parent month cards) ──────────────────────────── */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat { min-width: 0; padding: 14px 14px 12px; border-radius: var(--r-md); background: var(--violet-50); }
.stat-val {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 21px;
  letter-spacing: -0.02em;
  color: var(--violet);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.stat-lbl { display: block; margin-top: 3px; color: var(--ink-2); font-size: 13.5px; }
.stat.is-due { background: var(--yellow-50); }
.stat.is-surplus { background: var(--green-50); }
.stat.is-surplus .stat-val { color: var(--green); }

/* ── Balance (parent) ─────────────────────────────────────────── */
.status-chip {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.status-chip:empty { display: none; }
.status-chip.is-surplus { background: var(--green-50); color: var(--green); }
.status-chip.is-settled { background: var(--violet-100); color: var(--violet-text); }
.status-chip.is-due     { background: var(--yellow); color: var(--violet-deep); }
.bal-value {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(38px, 5.2vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--violet);
  font-variant-numeric: tabular-nums;
}
.balance-hero.state-surplus .bal-value { color: var(--green); }
.bal-note {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: var(--violet-50);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
}
.bal-note:empty { display: none; }
.balance-hero.state-due .bal-note { background: var(--yellow-50); }
.balance-hero.state-surplus .bal-note { background: var(--green-50); }
.bal-sub { margin-top: 10px; color: var(--ink-3); font-size: 13.5px; }

/* Tutor's monthly note */
.message-box {
  display: none;
  margin-top: 16px;
  padding: 14px 16px 16px;
  border-radius: var(--r-md);
  background: var(--yellow-50);
}
.message-from {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}
.message-from .spark { width: 14px; height: 14px; color: #E7B800; }
.message-box p:last-child { color: var(--ink); font-size: 15px; line-height: 1.6; }

/* ── Tables ───────────────────────────────────────────────────── */
.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
table.classes-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.classes-table th {
  padding: 11px 16px;
  background: var(--violet-50);
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
}
.classes-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 14.5px;
  vertical-align: middle;
}
.classes-table td:first-child { font-weight: 600; }
.classes-table tr:last-child td { border-bottom: 0; }
.classes-table tbody tr:hover td { background: #FBFAFF; }
.classes-table td.empty-state { padding: 28px 12px; font-weight: 400; }
.presence-yes { color: var(--green) !important; font-weight: 700; }
.presence-no  { color: var(--red) !important; font-weight: 700; }
.classes-table .bal-surplus { color: var(--green); font-weight: 600; }
.classes-table .bal-settled { color: var(--ink-2); font-weight: 600; }
.classes-table .bal-due     { color: var(--due-text); font-weight: 600; }
.chip-btn {
  padding: 6px 13px;
  border: 0;
  border-radius: 999px;
  background: var(--violet-100);
  color: var(--violet-text);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
.chip-btn:hover { background: var(--violet-200); }
.empty-state { padding: 24px 12px; color: var(--ink-3); font-size: 14.5px; text-align: center; white-space: normal; }

/* ── Materials ────────────────────────────────────────────────── */
.materials { margin: 0 -10px; }
.material-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 10px;
  border-radius: var(--r-md);
  color: var(--ink);
  text-decoration: none;
}
.material-card:hover { background: var(--violet-50); text-decoration: none; }
.material-body { flex: 1; min-width: 0; }
.material-name { margin: 0 0 1px; color: var(--ink); font-size: 15.5px; font-weight: 600; }
.material-desc { margin: 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.5; }
.material-card:hover .material-name { color: var(--violet-text); }

/* ── Dialogs ──────────────────────────────────────────────────── */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 8888;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(30, 22, 69, .4);
}
.dialog {
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 26px;
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: 0 30px 60px -24px rgba(30, 22, 69, .5);
}
.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.dialog-title {
  margin-bottom: 20px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.dialog-head .dialog-title { margin: 0; }
.dialog-body { max-height: 340px; overflow-y: auto; }
.dialog-body p { color: var(--ink); font-size: 15.5px; line-height: 1.7; }
.icon-btn {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  margin: -6px -8px 0 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-2);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.icon-btn:hover { background: var(--violet-50); color: var(--ink); }

.field-label { display: block; margin: 0 0 8px; color: var(--ink); font-size: 14px; font-weight: 600; }
.optional { color: var(--ink-3); font-weight: 400; }
.field {
  display: block;
  width: 100%;
  padding: 12px 14px;
  background: var(--surface);
  border: 1.5px solid var(--line-2);
  border-radius: var(--r-sm);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.5;
  resize: none;
}
.field::placeholder { color: var(--ink-3); }
.field:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 4px rgba(98, 59, 210, .14); }

.req-list {
  max-height: 214px;
  overflow-y: auto;
  margin-bottom: 18px;
  padding: 4px;
  border: 1.5px solid var(--line-2);
  border-radius: var(--r-md);
}
.req-item { padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.req-item + .req-item { margin-top: 2px; }
.req-item:hover { background: var(--violet-50); }
.req-item.is-selected { background: var(--violet-100); }
.req-item.is-selected .req-date { color: var(--violet-text); }
.req-date { color: var(--ink); font-weight: 600; }
.req-meta { margin-top: 1px; color: var(--ink-2); font-size: 13.5px; }
.req-empty { padding: 12px; color: var(--ink-3); font-size: 14px; }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 18px; }
.seg-btn {
  min-height: 46px;
  border: 1.5px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}
.seg-btn:hover { border-color: var(--violet); }
.seg-btn.w3-theme-l2 { background: var(--yellow); border-color: var(--yellow); color: var(--violet-deep); font-weight: 600; }

.dialog-actions { display: flex; gap: 8px; margin-top: 18px; }
.dialog-actions .btn-primary { flex: 2; }
.dialog-actions .btn-outline { flex: 1; }
.form-status { margin-top: 12px; font-size: 14px; font-weight: 500; text-align: center; }
.form-status:empty { display: none; }

/* ── Footer ───────────────────────────────────────────────────── */
.site-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-top: 8px;
  padding: 22px 24px 28px;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 14px;
}
.site-foot .wordmark { font-size: 15px; }
.site-foot a { color: var(--ink-2); }
.site-foot .foot-note { margin-left: auto; }

/* ── Scrollbars ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--violet-200); border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #C6B8FB; }

/* ── Small screens ────────────────────────────────────────────── */
@media (max-width: 860px) {
  .home-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .topbar { padding: 0 6px 0 16px; }
  .portal-main { padding: 0 14px 32px; margin-top: calc(var(--nav-h) + 16px); }
  .panel { padding: 18px 18px 20px; }
  .panel.acc { padding: 6px; }
  .profile { padding: 0 0 20px; }
  .hero { padding: 20px 20px 22px; }
  .hero::before { top: -52px; right: -56px; width: 130px; height: 130px; }
  .hero::after { top: 86px; right: 70px; width: 16px; height: 16px; }
  .hero-spark.s1 { top: 18px; right: 96px; width: 22px; height: 22px; }
  .hero-spark.s2 { top: 52px; right: 118px; width: 11px; height: 11px; }
  .hero-spark.s3 { top: 112px; right: 24px; width: 14px; height: 14px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .stats.three .stat { padding: 12px 10px 10px; }
  .stat-val { font-size: 18px; }
  .resched .btn { width: 100%; }
  .site-foot { padding: 20px 16px 26px; }
  .site-foot .foot-note { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
