/* =====================================================================
   Sterling: the School Portals design (Nov 2026).
   Warm stone page, ivory cards, graphite "display case" heroes and
   muted gold. One material, one radius, one shadow everywhere, so every
   page looks like it belongs to the same product.
   Loaded after style.css (see base.html). Deleting this file and its
   <link> brings the previous look back.
   ===================================================================== */
:root {
  --st-bg: #f3f1ec;
  --st-card: #fbfaf7;
  --st-card-2: #f5f3ee;
  --st-ink: #14161b;
  --st-mute: #6e7079;
  --st-faint: #a3a5ac;
  --st-hair: rgba(20,22,27,.08);
  --st-gold: #b2915a;
  --st-gold-2: #d9bd86;
  --st-gold-ink: #8e6d3a;
  --st-graphite: #1c1e24;
  --st-r: 26px;
  --st-r-sm: 16px;
  --st-shadow: 0 1px 1px rgba(20,22,27,.04), 0 8px 24px -8px rgba(20,22,27,.10), 0 30px 60px -30px rgba(20,22,27,.18);
  --st-shadow-lift: 0 2px 2px rgba(20,22,27,.05), 0 14px 30px -10px rgba(20,22,27,.16), 0 40px 70px -30px rgba(20,22,27,.24);
  --st-studio: radial-gradient(70% 90% at 72% 35%, #3a3e49 0%, #1c1e24 48%, #0e0f13 100%);
  --st-gold-line: linear-gradient(90deg, #8e6d3a, #d9bd86);
  --st-ease: cubic-bezier(.2,.8,.2,1);

  /* Old token names, pointed at Sterling so every older rule follows. */
  --ink: var(--st-ink);
  --ink-soft: var(--st-mute);
  --parchment: var(--st-card);
  --parchment-deep: #e6e2d9;
  --page-bg: var(--st-bg);
  --gold: var(--st-gold);
  --gold-bright: var(--st-gold-2);
  --gold-ink: #2a2117;
  --accent-text: var(--st-gold-ink);
  --accent-soft: rgba(178,145,90,.14);
  --green: #2f6f4f;
  --hero-bg: #16181d;
  --hero-bg-2: #2a2d35;
  --card-radius: var(--st-r);
  --card-shadow: var(--st-shadow);
  --lift-shadow: var(--st-shadow-lift);
  --gold-metal: linear-gradient(180deg, #ecd7aa, #b2915a 60%, #8e6d3a);
  --brand-ink: var(--st-ink); --brand-navy: #2a2d35; --brand-royal: var(--st-gold-ink);
  --brand-gold: var(--st-gold); --brand-gold-soft: var(--st-gold-2); --brand-cream: var(--st-bg);
  --brand-radius: var(--st-r); --brand-card: var(--st-card); --brand-card-shadow: var(--st-shadow);
}

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { background: var(--st-bg) !important; color: var(--st-ink); }
::selection { background: rgba(178,145,90,.28); }
a { text-decoration-color: rgba(142,109,58,.4); text-underline-offset: 3px; }
h1, h2, h3 { letter-spacing: -.02em; }

/* ---------- Header: frosted stone bar ---------- */
.site-header {
  --ink: var(--st-ink); --ink-soft: var(--st-mute); --parchment: var(--st-card); --parchment-deep: #e6e2d9;
  --accent-text: var(--st-gold-ink); --accent-soft: rgba(178,145,90,.14);
  position: sticky; top: 0; z-index: 40;
  background: rgba(243,241,236,.82) !important;
  -webkit-backdrop-filter: saturate(1.4) blur(18px); backdrop-filter: saturate(1.4) blur(18px);
  border-bottom: 1px solid var(--st-hair) !important; box-shadow: none !important; color: var(--st-ink);
}
.header-inner { max-width: 1320px; padding: .8rem 1.5rem; }
.crest-mark {
  background: linear-gradient(145deg, #2a2d35, #0d0e12) !important; color: var(--st-gold-2) !important;
  border-radius: 11px !important; font-family: var(--display); font-weight: 600; letter-spacing: .04em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 6px 14px -8px rgba(14,15,19,.6) !important;
}
.crest-name { color: var(--st-ink) !important; font-weight: 600; letter-spacing: -.01em; }
.site-nav a { color: #3a3d45 !important; opacity: 1 !important; font-weight: 500; font-size: .92rem; border: 0 !important; padding: .45rem .8rem; border-radius: 12px; transition: background .2s, color .2s; }
.site-nav a:hover { background: var(--st-card); color: var(--st-ink) !important; box-shadow: var(--st-shadow); }
.notif-bell-btn { background: var(--st-card) !important; color: #4a4d55 !important; border: 0 !important; border-radius: 13px !important; box-shadow: var(--st-shadow); }
.notif-bell-btn:hover { color: var(--st-ink) !important; }
.notif-panel { border-radius: 20px !important; border: 1px solid var(--st-hair) !important; background: var(--st-card) !important; box-shadow: var(--st-shadow-lift) !important; color: var(--st-ink); }
.profile-chip { background: var(--st-card) !important; border: 0 !important; box-shadow: var(--st-shadow); color: var(--st-ink) !important; border-radius: 99px !important; }
.profile-chip-avatar { border: 0 !important; }

/* GPA ribbon: a quiet line under the header, not a second dark band. */
.gpa-ribbon {
  --ink: var(--st-ink); --ink-soft: var(--st-mute); --accent-text: var(--st-gold-ink);
  background: transparent !important; border: 0 !important; box-shadow: none !important; color: var(--st-ink);
}
.gpa-ribbon::before, .gpa-ribbon::after { display: none !important; }
.gpa-ribbon-inner { max-width: 1320px; padding: .25rem 1.5rem .55rem !important; border: 0 !important; }
.gpa-ribbon .gpa-label { color: var(--st-mute) !important; font-size: .72rem; letter-spacing: .14em; }
.gpa-ribbon .gpa-value { background: none !important; -webkit-text-fill-color: currentColor; color: var(--st-ink) !important; font-family: var(--display); font-weight: 600; font-size: 1.15rem; letter-spacing: -.02em; filter: none !important; text-shadow: none !important; }
.gpa-ribbon .gpa-track { color: var(--st-mute) !important; }
.ap-tier-badge { background: var(--st-card) !important; color: var(--st-gold-ink) !important; border: 1px solid var(--st-hair) !important; box-shadow: none !important; }

.site-main { max-width: 1320px; }

/* ---------- Buttons ---------- */
.btn { border-radius: 99px !important; font-weight: 600; letter-spacing: -.005em; transition: transform .2s var(--st-ease), box-shadow .2s, background .2s; }
.btn:active { transform: scale(.98); }
.btn-primary { background: linear-gradient(145deg, #2a2d35, #0d0e12) !important; color: #f4f2ee !important; border: 0 !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 10px 22px -12px rgba(14,15,19,.7) !important; }
.btn-primary:hover { background: linear-gradient(145deg, #353943, #16181d) !important; transform: translateY(-1px); }
.btn-ghost { background: var(--st-card) !important; color: var(--st-ink) !important; border: 1px solid var(--st-hair) !important; box-shadow: var(--st-shadow); }
.btn-ghost:hover { border-color: rgba(178,145,90,.5) !important; }
.btn-danger, .btn-red { border-radius: 99px !important; }

/* ---------- Cards and surfaces ---------- */
.card, .panel, .form-card, .settings-card, .profile-card, .ec-card, .sat-card, .resource-card, .feed-post, .admin-card,
.stat-card, .quest-board, .pace-activity, .tick-credit-item, .ap-card, .pace-box, .sb-tile, .notif-card, .report-card {
  background: var(--st-card) !important; border: 0 !important;
  border-radius: var(--st-r) !important; box-shadow: var(--st-shadow) !important;
}
.pace-box:hover, .ap-card:hover, .tick-credit-item:hover, .sb-tile:hover { box-shadow: var(--st-shadow-lift) !important; transform: translateY(-2px); }
.form-card h1, .dash-panel h1, .container > h1 { font-family: var(--display); font-weight: 600; letter-spacing: -.03em; }
.dash-panel > h1::after, .container > h1::after, .page-header h1::after, .dash-page-title::after { background: var(--st-gold-line) !important; height: 2px !important; width: 36px !important; }
.eyebrow { color: var(--st-gold-ink) !important; letter-spacing: .16em; }

/* Inputs: soft wells, gold focus */
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=date], input[type=url], input[type=tel], select, textarea {
  border-radius: 14px !important; border: 1px solid rgba(20,22,27,.1) !important; background: #fff !important; color: var(--st-ink) !important;
}
input:focus, select:focus, textarea:focus { border-color: var(--st-gold) !important; box-shadow: 0 0 0 4px rgba(178,145,90,.16) !important; }

/* Tables: hairlines instead of a dark header strip */
table thead th { background: var(--st-card-2) !important; color: var(--st-mute) !important; font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; border-bottom: 1px solid var(--st-hair) !important; }
table tbody tr:hover { background: rgba(178,145,90,.07) !important; }
table td { border-color: var(--st-hair) !important; }

/* Pills and tabs */
.subject-tabs a, .filter-pill, .tab, .pill-tab { border: 1px solid var(--st-hair) !important; background: var(--st-card) !important; color: #3a3d45 !important; box-shadow: none !important; }
.subject-tabs a.active, .filter-pill.active, .tab.active { background: var(--st-ink) !important; color: #f4f2ee !important; border-color: transparent !important; }

/* Flash messages */
.flash { border-radius: var(--st-r-sm) !important; border: 0 !important; background: var(--st-card) !important; color: var(--st-ink) !important; box-shadow: var(--st-shadow); position: relative; padding-left: 1.2rem !important; }
.flash::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--st-gold); }
.flash-error::before { background: #c2453f; }
.flash-success::before { background: #2f6f4f; }

/* Empty states: a small graphite tile, no stripes */
.empty-state { background: var(--st-card) !important; border: 1px dashed rgba(20,22,27,.14) !important; border-radius: var(--st-r) !important; }
.empty-state::before { display: none !important; }
.empty-state .empty-state-icon, .empty-state > i.ti:first-child { background: linear-gradient(145deg, #2a2d35, #0d0e12) !important; color: var(--st-gold-2) !important; transform: none !important; border-radius: 16px !important; }

/* ---------- Dashboard shell: side rail ---------- */
.dash-rail { background: transparent !important; border-right: 0 !important; padding-top: 1rem !important; }
.dash-rail-btn { color: #5a5d66 !important; border-radius: 16px !important; transition: background .2s, color .2s, box-shadow .2s; }
.dash-rail-btn i { color: #8a8c94; transition: color .2s; }
.dash-rail-btn:hover { background: rgba(251,250,247,.7) !important; color: var(--st-ink) !important; }
.dash-rail-btn.active { background: var(--st-card) !important; color: var(--st-ink) !important; box-shadow: var(--st-shadow) !important; }
.dash-rail-btn.active i { color: var(--st-gold) !important; }
.dash-rail-btn.active::before { display: none !important; }
.dash-rail-badge { background: var(--st-ink) !important; color: #f4f2ee !important; border-color: var(--st-bg) !important; }
.dash-panel { background: transparent !important; }

/* ---------- Dashboard hero: the display case ---------- */
.st-hero {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: 1fr 1fr; min-height: 440px; margin-bottom: 1.1rem;
  border-radius: 30px; background: var(--st-studio); color: #f4f2ee;
  box-shadow: 0 40px 80px -40px rgba(14,15,19,.6);
  animation: stIn .7s var(--st-ease) both;
}
.st-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(115deg, rgba(255,255,255,.07), transparent 38%); }
.st-hero::after { content: ""; position: absolute; left: 50%; right: -10%; bottom: 0; height: 45%; z-index: -1; pointer-events: none;
  background: radial-gradient(50% 40% at 50% 70%, rgba(217,189,134,.16), transparent 70%); }
@keyframes stIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.st-hero-copy { position: relative; z-index: 2; display: flex; flex-direction: column; padding: 2.6rem 0 2.4rem 2.8rem; }
.st-eyebrow { margin: 0; font-size: .74rem; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--st-gold-2); }
.st-hero-title { margin: .9rem 0 0; font-family: var(--display); font-weight: 600; font-size: clamp(2.2rem, 3.8vw, 3.4rem); line-height: 1.02; letter-spacing: -.035em; color: #f4f2ee; }
.st-hero-title span { display: block; margin-top: .45rem; font-weight: 300; font-size: .5em; letter-spacing: -.01em; color: #9fa1a9; }
.st-hero-sub { margin: 1rem 0 0; max-width: 380px; font-size: .95rem; line-height: 1.6; color: #a7a9b0; }
.st-moves { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.4rem; }
.st-btn { display: inline-flex; align-items: center; gap: .45rem; padding: .7rem 1.05rem; border-radius: 99px; font-size: .86rem; font-weight: 600; text-decoration: none;
  color: #e8e6e1; background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: transform .2s var(--st-ease), background .2s; }
.st-btn i { font-size: 1.05rem; }
.st-btn:hover { background: rgba(255,255,255,.14); transform: translateY(-1px); }
.st-btn-light { background: #f4f2ee; color: #14161b; box-shadow: none; }
.st-btn-light:hover { background: #fff; }
.st-rank { margin-top: auto; padding-top: 1.8rem; max-width: 430px; }
.st-rank-row { display: flex; justify-content: space-between; gap: 1rem; font-size: .76rem; color: #8e9098; margin-bottom: .8rem; }
.st-rank-row b { color: #f4f2ee; font-weight: 600; }
.st-track { position: relative; height: 2px; border-radius: 2px; background: rgba(255,255,255,.14); margin: 0 6px; }
.st-track > i { position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--fill) * 100%); border-radius: 2px; background: var(--st-gold-line); }
.st-track u { position: absolute; top: 50%; width: 9px; height: 9px; border-radius: 50%; transform: translate(-50%, -50%); background: #2a2d35; box-shadow: 0 0 0 1px rgba(255,255,255,.25); }
.st-track u.d { background: var(--st-gold-2); box-shadow: none; }
.st-track u.c { width: 15px; height: 15px; background: #f4f2ee; box-shadow: 0 0 0 4px rgba(217,189,134,.3); }
.st-ticks { display: flex; justify-content: space-between; list-style: none; margin: .8rem 0 0; padding: 0; font-size: .7rem; color: #7d7f87; }
.st-ticks li.c { color: #f4f2ee; }
.st-case { position: relative; z-index: 1; min-height: 100%; }
.st-case-helm { position: absolute; left: 6%; right: 6%; top: 6%; height: 68%; display: grid; place-items: center; }
.st-case-helm .armor-svg { width: auto; height: 82%; filter: drop-shadow(0 24px 30px rgba(0,0,0,.5)); }
.st-case-sword { position: absolute; left: 0; right: 4%; bottom: 6%; height: 20%; display: grid; place-items: center; }
.st-case-sword svg { width: 90%; height: auto; }
.st-hero .armor-3d { display: none; }
.st-hero .is-3d > .armor-3d { display: block; position: absolute; inset: 0; width: 100% !important; height: 100% !important; max-width: none !important; margin: 0 !important; }
.st-hero .is-3d > svg { display: none; }
.st-hero .armor-3d-sword { filter: drop-shadow(0 10px 12px rgba(0,0,0,.5)); }
/* Old hero pieces are gone from the page; keep them hidden if cached HTML shows them. */
.armor-hero, .quick-moves { display: none !important; }

/* ---------- Dashboard: stats, quests, activity ---------- */
.stat-strip { grid-template-columns: repeat(4, 1fr) !important; gap: 0 !important; background: var(--st-card); border-radius: var(--st-r); box-shadow: var(--st-shadow); overflow: hidden; margin-bottom: 1rem !important; }
.stat-strip .stat-card { background: transparent !important; box-shadow: none !important; border-radius: 0 !important; color: var(--st-ink) !important; padding: 1.4rem 1.5rem !important; animation: none; }
.stat-strip .stat-card + .stat-card::before { content: ""; position: absolute; left: 0; top: 1.4rem; bottom: 1.4rem; width: 1px; background: var(--st-hair); }
.stat-strip .stat-card::after { display: none !important; }
.stat-eyebrow { color: var(--st-mute) !important; font-weight: 500 !important; font-size: .74rem !important; letter-spacing: .02em !important; text-transform: none !important; }
.stat-big { font-weight: 600 !important; color: var(--st-ink) !important; letter-spacing: -.035em !important; font-size: 2.1rem !important; }
.stat-big small { color: var(--st-faint) !important; font-weight: 400 !important; }
.stat-sub { color: var(--st-mute) !important; }
.stat-grad .stat-ring-track { stroke: #ebe8e1 !important; }
.stat-grad .stat-ring-fill { stroke: var(--st-gold) !important; filter: none !important; }
.stat-grad .stat-ring i { color: var(--st-gold) !important; }
.stat-segbar { background: #ebe8e1 !important; border-radius: 3px; height: 3px !important; }
.stat-segbar i { background: var(--st-gold-line) !important; border-radius: 3px; height: 3px !important; -webkit-mask: none !important; mask: none !important; }
.stat-flame { background: var(--st-card-2) !important; color: var(--st-gold) !important; box-shadow: none !important; border-radius: 14px !important; transform: none !important; }
.stat-streak.cold .stat-flame { color: var(--st-faint) !important; }
.stat-gpa .stat-up { color: #2f6f4f; }
.track-chip { background: var(--st-card) !important; border: 0 !important; box-shadow: var(--st-shadow) !important; color: #3a3d45 !important; }
.track-chip i { color: var(--st-gold) !important; }
.track-chip-link { color: var(--st-gold-ink) !important; }
.quest-board { color: var(--st-ink) !important; }
.quest-crest { background: linear-gradient(145deg, #2a2d35, #0d0e12) !important; color: var(--st-gold-2) !important; transform: none !important; border-radius: 13px !important; box-shadow: none !important; }
.quest-eyebrow { color: var(--st-mute) !important; letter-spacing: .02em !important; text-transform: none !important; font-weight: 500 !important; }
.quest-title { font-weight: 600 !important; color: var(--st-ink) !important; }
.quest { background: var(--st-card-2) !important; border: 0 !important; border-radius: 18px !important; box-shadow: none !important; color: var(--st-ink) !important; }
.quest:hover { background: #efece5 !important; }
.quest-icon { background: var(--st-card) !important; color: var(--st-gold-ink) !important; box-shadow: var(--st-shadow) !important; border-radius: 12px !important; }
.quest-xp { background: transparent !important; color: var(--st-mute) !important; font-weight: 600; }
.pace-activity { color: var(--st-ink) !important; }
.pace-activity * { --pa-accent: var(--st-gold); }
.secondary-view-banner { background: var(--st-card) !important; border: 0 !important; border-radius: var(--st-r) !important; box-shadow: var(--st-shadow); }

/* Subject tiles: one ivory material, gold for progress */
.sb-tile, .sb-c0, .sb-c1, .sb-c2, .sb-c3, .sb-c4, .sb-c5 {
  --tile-bg: var(--st-card) !important; --tile-ink: var(--st-ink) !important; --tile-soft: var(--st-mute) !important;
  --tile-accent: var(--st-gold) !important; --tile-track: #ebe8e1 !important;
  background: var(--st-card) !important; color: var(--st-ink) !important;
}
.sb-c0 { background: var(--st-studio) !important; --tile-ink: #f4f2ee !important; --tile-soft: #9fa1a9 !important; --tile-accent: var(--st-gold-2) !important; --tile-track: rgba(255,255,255,.12) !important; color: #f4f2ee !important; }
.sb-icon { background: var(--st-card-2) !important; color: #55585f !important; border-radius: 12px !important; }
.sb-c0 .sb-icon { background: rgba(255,255,255,.08) !important; color: var(--st-gold-2) !important; }
.sb-name { font-weight: 600 !important; letter-spacing: -.015em; }
.sb-ring-fill { filter: none !important; }
.sb-tower i, .sb-bar i { background: var(--st-gold-line) !important; }
.sb-tower.done i, .sb-courses li.done .sb-bar i { background: linear-gradient(180deg, #ecd7aa, #b2915a) !important; }
.sb-avg b { font-weight: 600; }
.sb-mini { background: var(--st-card-2) !important; color: var(--st-ink) !important; border: 0 !important; box-shadow: none !important; }
.sb-mini-bar i { background: var(--st-gold-line) !important; }

/* Other Credits */
.pace-subject-group-header h2 { font-family: var(--display); font-weight: 600 !important; }
.pace-subject-group-header h2 i { background: linear-gradient(145deg, #2a2d35, #0d0e12) !important; color: var(--st-gold-2) !important; box-shadow: none !important; }
.tick-credit-item { color: var(--st-ink) !important; }
.tick-credit-box { border-color: rgba(20,22,27,.18) !important; border-radius: 8px !important; background: #fff !important; }
.tick-credit-item-checked { background: var(--st-card) !important; }
.tick-credit-item-checked .tick-credit-box { background: var(--st-ink) !important; color: var(--st-gold-2) !important; border-color: transparent !important; }
.tick-credit-icon { color: var(--st-gold) !important; }

/* ---------- Page hero on inner pages: the same studio card ---------- */
.ph, .ph-royal, .ph-gold, .ph-sky, .ph-cream {
  --ph-bg: var(--st-studio); --ph-ink: #f4f2ee; --ph-soft: #a7a9b0; --ph-accent: var(--st-gold-2);
  --ph-tile: linear-gradient(145deg, #f4f2ee, #d8d4cb); --ph-tile-ink: #14161b;
  --ph-ring: rgba(217,189,134,.25); --ph-stat-bg: rgba(255,255,255,.07); --ph-stat-line: rgba(255,255,255,.1);
  border-radius: 30px !important; box-shadow: 0 40px 80px -44px rgba(14,15,19,.6) !important;
}
.ph-pattern { display: none; }
.ph-title { font-weight: 600 !important; letter-spacing: -.035em !important; }
.ph-tile { transform: none !important; animation: none !important; border-radius: 22px !important; color: var(--st-gold-ink) !important;
  background: linear-gradient(145deg, #3a3e49, #16181d) !important; box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 20px 34px -16px rgba(0,0,0,.7) !important; color: var(--st-gold-2) !important; }
.ph-ring { border-width: 1px !important; }
.ph-ring-2 { border-style: solid !important; opacity: .5; }
.ph-ghost { opacity: .04 !important; }
.ph-btn { background: #f4f2ee !important; color: #14161b !important; box-shadow: none !important; }
.ph-btn-ghost { background: rgba(255,255,255,.08) !important; color: #e8e6e1 !important; border: 1px solid rgba(255,255,255,.1) !important; }

/* Graduate hero and other dark bands */
.grad-hero { background: var(--st-studio) !important; border-radius: 30px; }

/* ---------- Sign-in pages ---------- */
.auth-shell { max-width: 980px !important; border-radius: 30px !important; overflow: hidden; background: var(--st-card); box-shadow: var(--st-shadow-lift) !important; margin: 2rem auto 3rem !important; }
.auth-brand-panel { background: var(--st-studio) !important; position: relative; overflow: hidden; isolation: isolate; padding: 2.8rem 2.6rem !important; justify-content: flex-end !important; min-height: 520px; }
.auth-brand-panel::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(115deg, rgba(255,255,255,.07), transparent 40%); }
.auth-brand-crest { display: none !important; }
.auth-brand-eyebrow { color: var(--st-gold-2) !important; font-family: var(--body) !important; font-weight: 500 !important; letter-spacing: .18em !important; }
.auth-brand-title { font-weight: 600 !important; font-size: 2rem !important; letter-spacing: -.03em; line-height: 1.08; }
.auth-brand-sub { color: #a7a9b0 !important; max-width: 320px; }
.auth-helm { position: absolute; left: 0; right: 0; top: 0; height: 62%; z-index: -1; display: grid; place-items: center; }
.auth-helm .armor-3d { display: none; }
.auth-helm.is-3d .armor-3d { display: block; position: absolute; inset: 0; }
.auth-helm.is-3d .auth-helm-fallback { display: none; }
.auth-helm-fallback { width: 120px; height: 120px; border-radius: 34px; display: grid; place-items: center; font-size: 3rem; color: var(--st-gold-2);
  background: linear-gradient(145deg, #3a3e49, #16181d); box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 30px 40px -20px rgba(0,0,0,.7); }
.auth-form-card { background: var(--st-card) !important; box-shadow: none !important; border-radius: 0 !important; padding: 3rem 2.8rem !important; }
.auth-form-card h1 { font-size: 2rem; }
.btn-google { border-radius: 99px !important; border: 1px solid var(--st-hair) !important; box-shadow: var(--st-shadow); }
@media (max-width: 760px) {
  .auth-shell { border-radius: 26px !important; margin: 1rem auto 2rem !important; }
  .auth-brand-panel { min-height: 300px; padding: 1.6rem 1.5rem !important; }
  .auth-brand-title { font-size: 1.5rem !important; }
  .auth-form-card { padding: 1.8rem 1.4rem !important; }
}

/* ---------- Chat: graphite roster, ivory conversation ---------- */
.dash-panel-flush .chat-shell { background: var(--st-bg) !important; border-radius: var(--st-r); overflow: hidden; box-shadow: var(--st-shadow); }
.chat-roster { background: var(--st-studio) !important; }
.chat-roster::after { background: linear-gradient(115deg, rgba(255,255,255,.05), transparent 40%) !important; }
.chat-roster-crest { background: linear-gradient(145deg, #f4f2ee, #d8d4cb) !important; color: #14161b !important; transform: none !important; }
.chat-roster-item.active { background: rgba(255,255,255,.09) !important; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08) !important; }
.chat-roster-item.active .chat-roster-name { color: var(--st-gold-2) !important; }
.chat-unread-dot { background: var(--st-gold-2) !important; box-shadow: none !important; }
.chat-roster-item.unread .chat-avatar-ring, .chat-roster-item.active .chat-avatar-ring, .chat-avatar-lg { background: linear-gradient(160deg, #ecd7aa, #8e6d3a) !important; }
.chat-avatar-ring img { border-color: #1c1e24 !important; }
.chat-window { background: var(--st-bg) !important; }
.chat-window-header { background: rgba(251,250,247,.85) !important; box-shadow: 0 1px 0 var(--st-hair) !important; }
.chat-messages { background: var(--st-bg) !important; }
.bubble-row.mine .bubble { background: linear-gradient(145deg, #2a2d35, #14161b) !important; box-shadow: 0 10px 22px -14px rgba(14,15,19,.7) !important; }
.bubble-row.theirs .bubble { background: var(--st-card) !important; box-shadow: var(--st-shadow) !important; }
.bubble-row.mine .bubble-quote { border-left-color: var(--st-gold-2) !important; }
.bubble-row.theirs .bubble-quote { background: var(--st-card-2) !important; border-left-color: var(--st-gold) !important; }
.bubble-row.mine .bubble-file, .bubble-row.mine .chat-shared-card-cta { color: var(--st-gold-2) !important; }
.chat-composer { background: var(--st-card) !important; box-shadow: var(--st-shadow-lift) !important; }
.chat-attach-btn { color: var(--st-gold-ink) !important; }
.chat-attach-btn:hover { background: var(--st-card-2) !important; }
.chat-send-btn { background: linear-gradient(145deg, #2a2d35, #0d0e12) !important; color: var(--st-gold-2) !important; box-shadow: 0 8px 16px -8px rgba(14,15,19,.8) !important; }
.chat-send-btn:hover { transform: translateY(-1px) !important; }
.chat-empty-state { background: var(--st-bg) !important; }
.chat-empty-bubble.b2 { background: linear-gradient(145deg, #2a2d35, #14161b) !important; }
.chat-empty-bubble.b3 { background: linear-gradient(145deg, #ecd7aa, #b2915a) !important; transform: none !important; }

/* ---------- Enter Grades ---------- */
.save-dock, .grades-save-dock { background: rgba(251,250,247,.85) !important; -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); border: 0 !important; box-shadow: var(--st-shadow-lift) !important; border-radius: 99px !important; }

/* ---------- App mode (iPhone app / installed app) ---------- */
html.app-mode .site-header { background: rgba(243,241,236,.86) !important; }
html.app-mode .app-tabbar {
  background: rgba(251,250,247,.82) !important; border: 0 !important;
  -webkit-backdrop-filter: saturate(1.4) blur(22px); backdrop-filter: saturate(1.4) blur(22px);
  box-shadow: var(--st-shadow-lift), inset 0 0 0 1px rgba(255,255,255,.6) !important;
}
html.app-mode .app-tab { color: #8a8c94 !important; }
html.app-mode .app-tab.active { color: var(--st-ink) !important; background: transparent !important; }
html.app-mode .app-tab.active .app-tab-icon i { color: var(--st-ink) !important; }
html.app-mode .app-tab-badge { background: var(--st-ink) !important; color: #f4f2ee !important; border-color: var(--st-card) !important; }
html.app-mode .app-menu-btn { color: var(--st-ink) !important; background: var(--st-card) !important; box-shadow: var(--st-shadow); border-radius: 13px !important; }
.app-drawer-panel { background: var(--st-bg) !important; color: var(--st-ink) !important; }
.app-drawer-head, .app-drawer-profile { background: var(--st-studio) !important; color: #f4f2ee !important; }
.app-drawer-link { color: #3a3d45 !important; border-radius: 14px !important; }
.app-drawer-link.active { background: var(--st-card) !important; color: var(--st-ink) !important; box-shadow: var(--st-shadow); }
.app-drawer-link.active i { color: var(--st-gold) !important; }
.app-auth-hero { background: var(--st-studio) !important; color: #f4f2ee; }

/* ---------- Phone layout ---------- */
@media (max-width: 760px) {
  .st-hero { grid-template-columns: 1fr; min-height: 0; border-radius: 26px; }
  .st-case { order: -1; height: 330px; min-height: 0; }
  .st-case-helm { left: 4%; right: 4%; top: 2%; height: 72%; }
  .st-case-sword { left: 2%; right: 2%; bottom: 0; height: 18%; }
  .st-hero-copy { padding: .6rem 1.4rem 1.6rem; }
  .st-hero-title { font-size: 2.1rem; margin-top: .6rem; }
  .st-hero-sub { display: none; }
  .st-moves { margin-top: 1rem; }
  .st-moves .st-btn { flex: 1; justify-content: center; padding: .7rem .6rem; }
  .st-rank { padding-top: 1.4rem; }
  .st-ticks { font-size: .62rem; }
  .stat-strip { grid-template-columns: 1fr 1fr !important; }
  .stat-strip .stat-card { padding: 1.1rem !important; gap: .7rem !important; }
  .stat-strip .stat-card:nth-child(3)::before { display: none; }
  .stat-strip .stat-card:nth-child(n+3) { border-top: 1px solid var(--st-hair) !important; }
  .stat-strip .stat-ring, .stat-strip .stat-flame { display: none !important; }
  .stat-big { font-size: 1.7rem !important; }
}
@media (prefers-reduced-motion: reduce) { .st-hero { animation: none; } }

/* GPA ribbon details: no dashed rule; the dashboard shows GPA in its own card. */
.gpa-ribbon-inner::after { display: none !important; }
body:has(.st-hero) .gpa-ribbon { display: none; }
html:not(.app-mode) .gpa-ribbon { border-bottom: 1px solid var(--st-hair) !important; }

/* Phone browser (not the app): header on two rows, nav scrolls sideways,
   and the dashboard rail becomes a strip of chips above the page. */
@media (max-width: 760px) {
  html:not(.app-mode) .header-inner { flex-wrap: wrap; row-gap: .5rem; padding: .7rem 1rem .5rem; }
  html:not(.app-mode) .crest-name { font-size: .95rem; }
  html:not(.app-mode) .header-right { display: contents; }
  html:not(.app-mode) .site-nav { order: 10; width: 100%; overflow-x: auto; gap: .2rem; margin: 0 -1rem; padding: 0 1rem .2rem; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  html:not(.app-mode) .site-nav::-webkit-scrollbar { display: none; }
  html:not(.app-mode) .site-nav a { padding: .4rem .75rem; font-size: .85rem; background: var(--st-card); box-shadow: none; border: 1px solid var(--st-hair) !important; border-radius: 99px; }
  html:not(.app-mode) .crest { margin-right: auto; min-width: 0; }
  html:not(.app-mode) .profile-chip-name { display: none; }
  html:not(.app-mode) .profile-chip { padding: 3px !important; }
  html:not(.app-mode) .gpa-ribbon-inner { padding: .1rem 1rem .5rem !important; }
  html:not(.app-mode) .dash-shell { flex-direction: column; }
  html:not(.app-mode) .dash-shell:not(:has(.chat-shell)) { height: auto !important; }
  html:not(.app-mode) .dash-rail { width: auto !important; flex-direction: row !important; overflow-x: auto; gap: .35rem; padding: .7rem 1rem .2rem !important; height: auto !important; position: static !important; scrollbar-width: none; }
  html:not(.app-mode) .dash-rail::-webkit-scrollbar { display: none; }
  html:not(.app-mode) .dash-rail-btn { flex: 0 0 auto; flex-direction: row !important; gap: .4rem; padding: .5rem .8rem !important; width: auto !important; min-height: 0 !important; }
  html:not(.app-mode) .dash-rail-btn span { display: inline !important; font-size: .8rem; }
  html:not(.app-mode) .dash-rail-btn i { font-size: 1.05rem !important; }
  html:not(.app-mode) .dash-shell:not(:has(.chat-shell)) .dash-panel { overflow: visible !important; height: auto !important; padding: .8rem 1rem 2rem !important; }
}

/* Weekly activity chart: graphite studio card, silver bars, gold for this week */
.activity-card { background: var(--st-studio) !important; box-shadow: 0 30px 60px -36px rgba(14,15,19,.6) !important; border-radius: var(--st-r) !important; }
.activity-eyebrow { color: var(--st-gold-2) !important; font-weight: 500; letter-spacing: .16em !important; }
.activity-big span { font-weight: 600 !important; letter-spacing: -.035em !important; }
.activity-now { background: rgba(255,255,255,.07) !important; }
.activity-now strong { background: none !important; -webkit-text-fill-color: currentColor; color: var(--st-gold-2) !important; font-weight: 600; }
.activity-bar { background: linear-gradient(180deg, #8d9099, #4a4d55) !important; box-shadow: none !important; }
.activity-col:not(.now) .activity-bar { opacity: .75 !important; }
.activity-col.now .activity-bar { background: linear-gradient(180deg, #ecd7aa, #b2915a) !important; box-shadow: 0 0 24px -6px rgba(217,189,134,.7) !important; }
.activity-col.now .activity-n { color: var(--st-gold-2) !important; }

/* Admin stat tiles */
.admin-stat-card { background: var(--st-card) !important; border: 0 !important; border-top: 0 !important; border-radius: var(--st-r) !important; box-shadow: var(--st-shadow) !important; }
.admin-stat-value { font-weight: 600 !important; letter-spacing: -.035em !important; color: var(--st-ink); }
.admin-stat-hero { background: var(--st-studio) !important; }
.admin-stat-hero .admin-stat-value { background: none !important; -webkit-text-fill-color: currentColor; color: #f4f2ee !important; }
.admin-stat-card.admin-stat-warn .admin-stat-value { color: var(--st-gold-ink) !important; }

/* ---------- Leftover colors from the old palette ---------- */
/* SAT: first card graphite studio, second ivory */
.sat-subject-card { background: var(--st-studio) !important; color: #f4f2ee !important; border-radius: var(--st-r) !important; box-shadow: 0 30px 60px -36px rgba(14,15,19,.6) !important; }
.sat-subject-card + .sat-subject-card { background: var(--st-card) !important; color: var(--st-ink) !important; box-shadow: var(--st-shadow) !important; }
.sat-subject-card::after { border-color: rgba(178,145,90,.12) !important; }
.sat-subject-card-icon { background: rgba(255,255,255,.08) !important; color: var(--st-gold-2) !important; box-shadow: none !important; }
.sat-subject-card + .sat-subject-card .sat-subject-card-icon { background: var(--st-card-2) !important; color: var(--st-gold-ink) !important; }
/* Enter Grades: score tiles in one calm material; strong = ivory gold, ok = stone, low = rose */
.course-card { background: var(--st-card) !important; border: 0 !important; border-radius: var(--st-r) !important; box-shadow: var(--st-shadow) !important; }
.course-card.open { box-shadow: var(--st-shadow-lift) !important; }
.cr-track { stroke: #ebe8e1 !important; }
.cr-fill { stroke: var(--st-gold) !important; }
.course-done .course-ring { background: linear-gradient(145deg, #2a2d35, #0d0e12) !important; box-shadow: none !important; }
.course-done .course-ring i { color: var(--st-gold-2) !important; }
.course-card .score-field { border-radius: 14px !important; border-color: rgba(20,22,27,.12) !important; background: #fff !important; }
.course-card .score-field:focus-within { border-color: var(--st-gold) !important; box-shadow: 0 8px 18px -10px rgba(142,109,58,.6) !important; }
.course-card .score-field:has(.score-input-strong) { background: linear-gradient(160deg, #f6ecd6, #ead7ae) !important; }
.course-card .score-field:has(.score-input-ok) { background: #efece5 !important; }
.course-card .score-field:has(.score-input-low) { background: #f6dedb !important; }
.subject-header-icon { background: var(--st-card) !important; border: 0 !important; box-shadow: var(--st-shadow); color: var(--st-gold-ink) !important; }
.subject-progress-track { background: #ebe8e1 !important; height: 4px !important; }
.subject-progress-fill { background: var(--st-gold-line) !important; }
.category-average strong, .four-target strong { color: var(--st-ink) !important; }
.subject-tabs { background: var(--st-card) !important; border: 0 !important; box-shadow: var(--st-shadow) !important; border-radius: 99px !important; }
.subject-tabs a, .subject-tab { border: 0 !important; background: transparent !important; }
.subject-tabs a.active, .subject-tab.active { background: var(--st-ink) !important; color: #f4f2ee !important; }
/* Gold top borders on cards (profile, forms) become plain ivory cards */
.profile-section, .form-card { border-top: 0 !important; }
.profile-photo-large, .profile-chip-avatar { background: #2a2d35 !important; }
/* Numbered steps (Service Internship) */
.step-card { background: var(--st-card) !important; box-shadow: var(--st-shadow) !important; }
.step-card::before { background: linear-gradient(145deg, #2a2d35, #0d0e12) !important; color: var(--st-gold-2) !important; font-weight: 600 !important; }
.step-card:not(:last-of-type)::after { background: linear-gradient(180deg, rgba(178,145,90,.5), rgba(178,145,90,.1)) !important; width: 1px !important; }
.internship-checklist-item { background: #fff !important; border: 1px solid var(--st-hair) !important; }
.internship-checklist-item:hover { border-color: rgba(178,145,90,.5) !important; }
.internship-checklist-item:has(input:checked) { background: #f6ecd6 !important; border-color: transparent !important; }
.ec-ring-fill { stroke: var(--st-gold) !important; }
/* Other Credits icon blobs */
.tick-credit-item::before, .tick-credit-item::after { background: none !important; }
.tick-credit-icon { background: var(--st-card-2) !important; }
.sb-mini::before, .sb-mini::after { opacity: .5; }
.tick-credit-icon { color: var(--st-gold-ink) !important; }
.tick-credit-item-checked { background: linear-gradient(160deg, #f6ecd6, #e6cf9f) !important; color: var(--st-ink) !important; }
.tick-credit-item-checked .tick-credit-icon { background: rgba(255,255,255,.55) !important; }
.tick-credit-value { background: rgba(20,22,27,.05) !important; color: var(--st-mute) !important; }

/* =====================================================================
   Sterling layout on computers: side menu + greeting/search top bar
   (templates/_side_nav.html, base.html). Only when signed in, wider
   than 900px and not in app mode. Phones keep their own navigation.
   ===================================================================== */
.side-nav, .top-greet, .top-search { display: none; }
@media (min-width: 901px) {
  html:not(.app-mode) body.has-side { --side-w: 252px; padding-left: var(--side-w); transition: padding-left .3s var(--st-ease); }
  html.side-folded:not(.app-mode) body.has-side { --side-w: 84px; }
  html:not(.side-animating) body.has-side, html:not(.side-animating) .side-nav { transition: none; }

  html:not(.app-mode) .has-side .side-nav {
    position: fixed; z-index: 50; left: 0; top: 0; bottom: 0; width: var(--side-w);
    display: flex; flex-direction: column; gap: .2rem; padding: 1.3rem .9rem 1rem; box-sizing: border-box;
    background: var(--st-bg); border-right: 1px solid var(--st-hair); overflow: hidden auto; scrollbar-width: none;
    transition: width .3s var(--st-ease);
  }
  .side-nav::-webkit-scrollbar { display: none; }
  .side-top { display: flex; align-items: center; gap: .5rem; padding: 0 .3rem 1.4rem; }
  .side-brand { display: flex; align-items: center; gap: .7rem; min-width: 0; flex: 1; text-decoration: none; color: var(--st-ink); }
  .side-mark { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
    background: linear-gradient(145deg, #2a2d35, #0d0e12); color: var(--st-gold-2); font: 600 .72rem var(--display); letter-spacing: .04em;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 6px 14px -8px rgba(14,15,19,.6); }
  .side-brand-text { min-width: 0; }
  .side-brand-text b { display: block; font: 600 .95rem var(--display); letter-spacing: -.01em; white-space: nowrap; }
  .side-brand-text small { display: block; font-size: .74rem; color: var(--st-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .side-fold { flex: none; width: 34px; height: 34px; border: 0; border-radius: 11px; background: transparent; color: #8a8c94; cursor: pointer;
    display: grid; place-items: center; font-size: 1.2rem; transition: background .2s, color .2s; }
  .side-fold:hover { background: var(--st-card); color: var(--st-ink); box-shadow: var(--st-shadow); }
  .side-list { display: flex; flex-direction: column; gap: 2px; }
  .side-link { position: relative; display: flex; align-items: center; gap: .8rem; padding: .66rem .8rem; border-radius: 14px;
    color: #3a3d45; text-decoration: none; font-size: .92rem; font-weight: 500; white-space: nowrap; transition: background .2s, color .2s, box-shadow .2s; }
  .side-link i { flex: none; font-size: 1.22rem; color: #8a8c94; transition: color .2s; }
  .side-link:hover { background: rgba(251,250,247,.75); color: var(--st-ink); }
  .side-link.active { background: var(--st-card); color: var(--st-ink); font-weight: 600; box-shadow: var(--st-shadow); }
  .side-link.active i { color: var(--st-gold); }
  .side-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--st-ink); color: #f4f2ee; font-size: .68rem; font-weight: 700; display: grid; place-items: center; box-sizing: border-box; }
  .side-group { margin: 1.2rem 0 .35rem; padding: 0 .8rem; font-size: .68rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #a3a5ac; white-space: nowrap; }
  .side-bottom { margin-top: auto; padding-top: 1rem; display: flex; flex-direction: column; gap: 2px; }
  .side-gpa { display: flex; align-items: center; gap: .75rem; padding: .7rem .75rem; margin-bottom: .5rem; border-radius: 16px; background: var(--st-studio); color: #f4f2ee; white-space: nowrap; overflow: hidden; }
  .side-gpa-num { flex: none; min-width: 2.6rem; font: 600 1.15rem var(--display); letter-spacing: -.03em; }
  .side-gpa b { display: block; font-size: .7rem; font-weight: 500; letter-spacing: .14em; color: var(--st-gold-2); }
  .side-gpa small { display: block; font-size: .72rem; color: #9fa1a9; overflow: hidden; text-overflow: ellipsis; }

  /* Folded: icons only, labels as tooltips. */
  html.side-folded .side-text, html.side-folded .side-group, html.side-folded .side-badge { display: none; }
  html.side-folded .side-top { flex-direction: column; padding-inline: 0; gap: .7rem; }
  html.side-folded .side-brand { flex: none; }
  html.side-folded .side-link { justify-content: center; padding: .7rem 0; }
  html.side-folded .side-link::after { content: attr(data-label); position: fixed; left: calc(var(--side-w) - 6px); transform: translateY(0);
    padding: .4rem .7rem; border-radius: 10px; background: var(--st-ink); color: #f4f2ee; font-size: .8rem; font-weight: 500;
    opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 70; }
  html.side-folded .side-link:hover::after { opacity: 1; }
  html.side-folded .side-list > .side-link + .side-link[href*="chat"] { margin-top: .8rem; }
  html.side-folded .side-gpa { justify-content: center; padding: .7rem 0; }
  html.side-folded .side-gpa-num { min-width: 0; font-size: .95rem; }
  html.side-folded .side-link[data-label="Chat"] .side-badge { display: grid; position: absolute; top: 2px; right: 8px; min-width: 16px; height: 16px; font-size: .6rem; padding: 0 4px; }

  /* Top bar: greeting left; search, alerts and profile right. */
  html:not(.app-mode) .has-side .site-header { background: rgba(243,241,236,.8) !important; }
  html:not(.app-mode) .has-side .header-inner { max-width: 1320px; padding: .95rem 2rem; gap: .8rem; }
  html:not(.app-mode) .has-side .crest, html:not(.app-mode) .has-side .site-nav { display: none !important; }
  html:not(.app-mode) .has-side .top-greet { display: block; margin: 0 auto 0 0; font-size: .98rem; color: var(--st-mute); font-weight: 500; white-space: nowrap; }
  html:not(.app-mode) .has-side .top-greet b { color: var(--st-ink); font-weight: 600; }
  html:not(.app-mode) .has-side .top-search { display: flex; align-items: center; gap: .6rem; position: relative; width: min(320px, 30vw); padding: 0 .8rem 0 1rem;
    border-radius: 14px; background: var(--st-card); box-shadow: var(--st-shadow); color: #9a9ca3; }
  html:not(.app-mode) .has-side .top-search input { flex: 1; min-width: 0; border: 0 !important; background: transparent !important; box-shadow: none !important; padding: .66rem 0 !important; font-size: .9rem; color: var(--st-ink) !important; outline: none; }
  html:not(.app-mode) .has-side .top-search input::-webkit-search-cancel-button { display: none; }
  .top-search kbd { font: 500 .7rem var(--body); border: 1px solid var(--st-hair); border-radius: 6px; padding: 1px 6px; color: #9a9ca3; }
  .top-search-results { position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 80; padding: .4rem; border-radius: 18px; background: var(--st-card); box-shadow: var(--st-shadow-lift); }
  .top-search-results[hidden] { display: none; }
  .top-search-item { display: flex; align-items: center; gap: .7rem; padding: .6rem .7rem; border-radius: 12px; color: var(--st-ink); text-decoration: none; font-size: .9rem; }
  .top-search-item i { color: #8a8c94; font-size: 1.1rem; }
  .top-search-item:hover, .top-search-item.on { background: var(--st-card-2); }
  .top-search-item.on i { color: var(--st-gold); }
  .top-search-empty { margin: 0; padding: .7rem; color: var(--st-mute); font-size: .88rem; }
  html:not(.app-mode) .has-side .header-right { gap: .6rem; }
  html:not(.app-mode) .has-side .notif-bell-btn { width: 42px; height: 42px; }
  html:not(.app-mode) .has-side .profile-chip { padding: 3px 12px 3px 3px !important; }

  /* The side menu now does the rail's job, and holds the GPA. */
  html:not(.app-mode) .has-side .dash-rail { display: none !important; }
  html:not(.app-mode) .has-side .gpa-ribbon { display: none !important; }
  html:not(.app-mode) .has-side .site-main { padding-left: 2rem; padding-right: 2rem; }
  html:not(.app-mode) .has-side .dash-panel { padding-left: 0 !important; padding-right: 0 !important; }
  html:not(.app-mode) .has-side .site-footer { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { body.has-side, .side-nav { transition: none !important; } }

/* Nov 4 fixes: helm only (sword comes later), lower login helm, chat search */
.st-case-helm { left: 4% !important; right: 4% !important; top: 5% !important; height: 90% !important; }
.auth-helm { top: 9% !important; height: 58% !important; }
.chat-roster-search { background: rgba(255,255,255,.07) !important; border: 1px solid rgba(255,255,255,.1) !important; border-radius: 14px !important; }
.chat-roster-search:focus-within { border-color: rgba(217,189,134,.55) !important; background: rgba(255,255,255,.1) !important; }
.chat-roster-search input[type=text], .chat-roster-search input[type=search], .chat-roster-search input {
  background: transparent !important; border: 0 !important; box-shadow: none !important; color: #f4f2ee !important; border-radius: 0 !important;
}
.chat-roster-search input::placeholder { color: #8e9098 !important; }
@media (max-width: 760px) {
  .st-case { height: 300px !important; }
  .st-case-helm { top: 4% !important; height: 92% !important; }
}

/* Subject tab bar: always one clean row. When the window is too narrow
   for every tab it scrolls sideways instead of wrapping, so the rounded
   bar never turns into a lumpy two-row shape. */
.subject-tabs {
  display: flex !important; flex-wrap: nowrap !important; align-items: center; gap: 4px !important;
  padding: 6px !important; overflow-x: auto; overscroll-behavior-x: contain;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-padding: 0 6px;
  border-radius: 18px !important;
}
.subject-tabs::-webkit-scrollbar { display: none; }
.subject-tabs a, .subject-tab {
  flex: none !important; white-space: nowrap; padding: .55rem 1rem !important;
  border-radius: 12px !important; line-height: 1.2; transition: background .2s, color .2s;
}
.subject-tabs a:not(.active):hover, .subject-tab:not(.active):hover { background: var(--st-card-2) !important; color: var(--st-ink) !important; }
/* A soft fade on the right edge hints that more tabs scroll into view. */
.subject-tabs { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
.subject-tabs.at-end { -webkit-mask-image: none; mask-image: none; }

/* AP tier gem: a small cut stone set on the display case (and on the
   phone GPA ribbon). The grade rank stays the one title on screen. */
.st-gem { position: absolute; top: 18px; right: 18px; z-index: 3; display: inline-flex; align-items: center; gap: .45rem;
  padding: 6px 12px 6px 6px; border-radius: 99px; text-decoration: none;
  background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: background .2s; }
.st-gem:hover { background: rgba(255,255,255,.12); }
.st-gem .ap-gem-svg { width: 26px; height: 26px; filter: drop-shadow(0 3px 6px rgba(0,0,0,.5)); }
.st-gem span { font-size: .72rem; font-weight: 600; letter-spacing: .04em; color: rgba(244,241,234,.6); }
.st-gem.tier-4 .ap-gem-svg { filter: drop-shadow(0 0 8px rgba(255,255,255,.45)) drop-shadow(0 3px 6px rgba(0,0,0,.5)); }
@media (max-width: 640px) { .st-gem span { display: none; } .st-gem { padding: 6px; top: 12px; right: 12px; } }
.ribbon-gem { display: inline-flex; margin-left: .4rem; vertical-align: middle; }
.ribbon-gem .ap-gem-svg { width: 20px; height: 20px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.35)); }

/* Graduate home: the finished display case. */
.gr-hero::after { background: radial-gradient(60% 80% at 60% 100%, rgba(217,189,134,.28), transparent 70%) !important; }
.gr-title { background: linear-gradient(180deg, #f6e6c2 0%, #d9bd86 45%, #a88648 100%); -webkit-background-clip: text; background-clip: text; color: transparent !important; }
.gr-title span { -webkit-text-fill-color: #9fa1a9; color: #9fa1a9; }
.gr-laurel { position: absolute; left: 50%; top: 50%; width: min(88%, 440px); aspect-ratio: 1; transform: translate(-50%, -50%); opacity: .5; pointer-events: none; filter: drop-shadow(0 0 14px rgba(217,189,134,.2)); }
.gr-rank .st-track u.gr-crown { background: var(--st-gold-2); box-shadow: 0 0 0 4px rgba(217,189,134,.35), 0 0 18px rgba(217,189,134,.6); }
.gr-rank .st-ticks li.c { color: var(--st-gold-2); font-weight: 600; }
.gr-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 18px 0 0; }
.gr-stat { border-radius: 22px; background: var(--st-card); box-shadow: var(--st-shadow); padding: 18px 20px; min-width: 0; }
.gr-stat small { display: block; font-size: .76rem; color: var(--st-mute); }
.gr-stat b { display: block; margin-top: 6px; font: 600 1.9rem/1.1 var(--display); letter-spacing: -.02em; color: var(--st-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gr-stat b em { font-style: normal; font-size: .9rem; font-weight: 500; color: var(--st-mute); letter-spacing: 0; }
.gr-stat b.gr-college { font-size: 1.15rem; line-height: 1.35; margin-top: 10px; }
.gr-stat span { display: block; margin-top: 6px; font-size: .8rem; color: var(--st-mute); }
.gr-stat-dark { background: var(--st-studio); }
.gr-stat-dark small, .gr-stat-dark span { color: rgba(244,241,234,.55); }
.gr-stat-dark b { color: var(--st-gold-2); }
.gr-section { margin: 30px 0 14px; font: 600 1.15rem var(--display); letter-spacing: -.01em; color: var(--st-ink); }
.gr-tiles { display: grid !important; grid-template-columns: repeat(3, 1fr) !important; gap: 14px !important; }
.gr-tiles .grad-tile { display: flex; flex-direction: column; gap: 4px; border-radius: 22px !important; background: var(--st-card) !important; border: 0 !important; box-shadow: var(--st-shadow) !important; padding: 20px !important; text-decoration: none; color: var(--st-ink) !important; transition: transform .3s, box-shadow .3s; }
.gr-tiles .grad-tile:hover { transform: translateY(-3px); box-shadow: var(--st-shadow-lift) !important; }
.gr-tiles .grad-tile-icon { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: rgba(178,145,90,.12) !important; color: var(--st-gold-ink) !important; font-size: 1.25rem; margin-bottom: 12px; }
.gr-tiles .grad-tile-title { font: 600 1rem var(--display); }
.gr-tiles .grad-tile-desc { margin: 0; font-size: .86rem; color: var(--st-mute) !important; }
.gr-tiles .grad-tile-highlight { background: var(--st-studio) !important; color: #f4f2ee !important; }
.gr-tiles .grad-tile-highlight .grad-tile-icon { background: rgba(217,189,134,.16) !important; color: var(--st-gold-2) !important; }
.gr-tiles .grad-tile-highlight .grad-tile-desc { color: rgba(244,241,234,.6) !important; }
@media (max-width: 900px) { .gr-stats { grid-template-columns: repeat(2, 1fr); } .gr-tiles { grid-template-columns: repeat(2, 1fr) !important; } }
@media (max-width: 520px) { .gr-tiles { grid-template-columns: 1fr !important; } .gr-stat b { font-size: 1.6rem; } }

/* Graduates hall: the graduated rank as a small gold badge by the name. */
.grad-rank-badge { display: inline-flex; align-items: center; gap: .3rem; margin-left: .4rem; padding: .18rem .55rem; border-radius: 99px; vertical-align: middle;
  font-size: .7rem; font-weight: 600; letter-spacing: .02em; color: #2a1f0c; background: linear-gradient(180deg, #ecd7aa, #c4a465); }
.grad-rank-badge i { font-size: .8rem; }
.gr-stat b.gr-college { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
@media (max-width: 640px) {
  .gr-rank .st-ticks li:not(.c) { visibility: hidden; }
  .gr-rank .st-ticks li.c { position: absolute; right: 0; }
  .gr-rank .st-ticks { position: relative; min-height: 1.2em; }
  .gr-rank .st-ticks li:first-child { visibility: visible; position: absolute; left: 0; }
}
@media (max-width: 520px) {
  .gr-tiles { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
  .gr-tiles .grad-tile { padding: 16px !important; }
  .gr-tiles .grad-tile-desc { display: none; }
  .gr-tiles .grad-tile-icon { margin-bottom: 8px; }
}
.grad-card-college { color: var(--st-gold-ink) !important; }
