/* ============================================================
   DREAMSTATES — STYLES  ·  "Instagram look-alike, stars & stripes edition"
   Flat white cards, hairline borders, story rings — but in
   American colors. All colors live in :root below.
   ============================================================ */
:root {
  --bg: #fafafa;             /* page background (IG gray-white) */
  --paper: #ffffff;          /* cards */
  --ink: #1f2328;            /* main text */
  --ink-soft: #8e8e8e;       /* muted text (IG gray) */
  --line: #dbdbdb;           /* hairline borders */
  --red: #e0162b;            /* Old Glory red */
  --navy: #0a3161;           /* Old Glory blue (deep) */
  --blue: #1e5bc6;           /* action blue (links & buttons) */
  --gold: #f4b942;           /* star gold (small accents) */
  --green: #2a9d5c;
  --red-deep: #8f0d1b;       /* crisis banner gradient */
  --red-tint: rgba(224, 22, 43, .08);
  --green-deep: #17603a;     /* payday banner gradient */
  --green-tint: rgba(42, 157, 92, .08);
  /* income tiers in the class debrief — a validated categorical palette
     (dataviz validator, light mode: CVD + normal-vision separation pass) */
  --tier-lower: #2a78d6;
  --tier-middle: #eb6834;
  --tier-upper: #1baf7a;
  --ring: conic-gradient(from 210deg, #e0162b, #f4b942 30%, #1e5bc6 60%, #0a3161 80%, #e0162b);
  --radius: 12px;
  --font: -apple-system, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-script: "Segoe Script", "Brush Script MT", "Snell Roundhand", cursive;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.5;
  font-size: 14px;
}

h1, h2, h3 { line-height: 1.25; letter-spacing: -.01em; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1rem; margin-bottom: 8px; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { padding-left: 20px; }
li { margin: 6px 0; }

.muted { color: var(--ink-soft); }
.small { font-size: .8rem; }

/* ---------- monochrome inline icons ---------- */
.ico { display: inline-flex; vertical-align: -.18em; }
.ico svg { display: block; }
h2 .ico, h3 .ico { vertical-align: -.15em; margin-right: 2px; }
.btn .ico { vertical-align: -.2em; }
.center { text-align: center; }
.spacer { flex: 1; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }

/* ---------- buttons (IG style: small, semibold, flat) ---------- */
.btn {
  font-family: inherit; font-size: .85rem; font-weight: 600;
  border: none; border-radius: 8px; padding: 8px 16px;
  cursor: pointer; transition: background .12s ease, opacity .12s ease;
}
.btn:active { opacity: .7; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: #17499e; }
.btn-gold { background: var(--red); color: #fff; }
.btn-gold:hover { background: #b91224; }
.btn-danger { background: var(--red); color: #fff; }
.btn-ghost { background: transparent; color: var(--blue); }
.btn-ghost:hover { background: rgba(30, 91, 198, .07); }
.btn-ghost.active { background: var(--navy); color: #fff; }
.btn-wide { width: 100%; }
.btn-x { background: none; border: none; cursor: pointer; font-size: 1rem; opacity: .4; }
.btn-x:hover { opacity: 1; }

/* ---------- cards: flat, hairline border, no shadow ---------- */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}

/* ---------- avatars ---------- */
.avatar {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  font-size: 1.25rem; flex-shrink: 0; overflow: hidden;
  border: 1px solid rgba(0, 0, 0, .06); box-sizing: border-box;
}
.avatar img, .avatar svg { width: 100%; height: 100%; display: block; object-fit: cover; }
.avatar-sm { width: 30px; height: 30px; font-size: .95rem; }
.avatar-lg { width: 86px; height: 86px; font-size: 2.6rem; }
.lottery-photo { width: 100%; height: 100%; border-radius: 50%; display: block; object-fit: cover; }

/* Style Shop: avatar frames (js/data/cosmetics.js) */
.avatar-frame-silver { border: 3px solid #c7cdd6; }
.avatar-frame-gold { border: 3px solid #f4b942; }
.avatar-frame-flag { border: 3px solid transparent; background: var(--ring) border-box, var(--paper) padding-box; }

/* Style Shop: jewelry overlays — plain DOM spans appended by U.avatar(),
   clipped by .avatar's overflow:hidden so they stay inside the circle at
   any avatar size (sm/default/lg all use the same % positioning). */
.jewel { position: absolute; inset: 0; pointer-events: none; }
.jewel-earrings::before, .jewel-earrings::after {
  content: ""; position: absolute; top: 58%; width: 11%; height: 11%; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff6d8, #cda232); box-shadow: 0 0 0 1px rgba(0, 0, 0, .3);
}
.jewel-earrings::before { left: 14%; }
.jewel-earrings::after { right: 14%; }
.jewel-necklace::before {
  content: ""; position: absolute; left: 23%; right: 23%; bottom: 5%; height: 20%;
  border: 2px solid #cda232; border-top: none; border-radius: 0 0 50% 50%;
}
/* accessories: one inline SVG in the portraits' 100×100 geometry (U.avatar) */
.avatar-accessories { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.jewel { z-index: 2; }
.avatar-accessories svg { width: 100%; height: 100%; }
/* scenes: the SVG's #bg turns transparent, the scene shows behind it */
.avatar-scene { border-color: transparent; }
.avatar-scene > img, .avatar-scene > svg { position: relative; z-index: 1; }
.scene-emoji { position: absolute; left: 6%; top: 8%; font-size: 30%; line-height: 1; z-index: 0; }
.avatar-lg .scene-emoji { font-size: 1.3rem; }
.avatar-scene-skyline, .shop-scene-skyline { background: linear-gradient(180deg, #1b2a4e 0%, #3d5a8a 60%, #f4b942 100%); }
.avatar-scene-beach, .shop-scene-beach { background: linear-gradient(180deg, #7fd1f5 0%, #bfe9fb 55%, #f6dfa4 100%); }
.avatar-scene-yacht, .shop-scene-yacht { background: linear-gradient(180deg, #9ed8ff 0%, #2f7fc2 65%, #0a3161 100%); }

/* status possessions next to a name (U.statusRow) */
.status-row { display: inline-flex; gap: 2px; vertical-align: middle; font-size: .85em; line-height: 1; }
.status-item { display: inline-block; }
.hero-status { margin: 2px 0 4px; font-size: 1.15rem; }
.peek-card .status-row { font-size: 1.2rem; margin: 2px 0 6px; }

/* ============================================================
   LOGIN
   ============================================================ */
.login-mode {
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(700px 420px at 15% 0%, rgba(224, 22, 43, .10), transparent 60%),
    radial-gradient(800px 500px at 90% 100%, rgba(10, 49, 97, .12), transparent 60%),
    var(--bg);
  padding: 24px;
}
.login-wrap { width: 100%; max-width: 400px; }
.login-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 16px;
  padding: 40px 36px; text-align: center; animation: pop .35s ease;
}
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.login-logo {
  width: 88px; height: 88px; margin: 0 auto 14px; display: block;
  border-radius: 24px; object-fit: cover;
}
.login-title {
  font-family: var(--font-script); font-weight: 400;
  font-size: 2.3rem; letter-spacing: 0; color: var(--ink);
}
.login-tagline { color: var(--ink-soft); margin: 8px 0 26px; font-size: .88rem; }
.login-form { text-align: left; display: flex; flex-direction: column; gap: 8px; }
/* the input groups (student fields / admin field) stack full-width so every
   field matches the width of the Continue button below them */
.login-form > div { display: flex; flex-direction: column; gap: 8px; }
.login-input {
  width: 100%; display: block;
  font-family: inherit; font-size: 1rem; text-align: center; letter-spacing: .12em;
  text-transform: uppercase; padding: 11px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg); outline: none; transition: border .15s;
}
.login-input:focus { border-color: var(--ink-soft); background: #fff; }
.login-error { color: var(--red); font-size: .82rem; min-height: 1.2em; text-align: center; }
.login-divider {
  color: var(--ink-soft); font-size: .78rem; font-weight: 600; margin: 20px 0 14px;
  display: flex; align-items: center; gap: 14px;
}
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.shake { animation: shake .4s; }
@keyframes shake { 20%,60% { transform: translateX(-6px); } 40%,80% { transform: translateX(6px); } }

.lottery-stage { margin-top: 16px; min-height: 20px; }
.lottery-avatar {
  font-size: 3.2rem; width: 96px; height: 96px; margin: 8px auto;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); border-radius: 50%; border: 3px dashed var(--red);
}
.lottery-avatar.lottery-winner { border: 3px solid transparent; background: var(--ring) border-box, var(--bg) padding-box; animation: winner .6s ease; }
@keyframes winner { 0% { transform: scale(.7) rotate(-8deg); } 60% { transform: scale(1.15) rotate(4deg); } 100% { transform: scale(1); } }
.lottery-name { font-size: 1rem; margin-top: 4px; }
.lottery-name .btn { margin-top: 12px; }
.lottery-code {
  background: var(--bg); border: 1.5px dashed var(--ink-soft);
  border-radius: 8px; padding: 6px 10px; margin: 10px auto 0;
  font-weight: 700; letter-spacing: .08em; display: inline-block;
}

/* ============================================================
   HEADER & TABS  (IG: white bar, script wordmark, icon nav)
   ============================================================ */
.topbar {
  background: var(--paper); color: var(--ink);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
}
.topbar-inner {
  max-width: 940px; margin: 0 auto; padding: 8px 18px;
  display: flex; align-items: center; gap: 14px; min-height: 52px;
}
.brand { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.brand-logo {
  width: 32px; height: 32px; border-radius: 9px; object-fit: cover; display: block;
}
.brand-name {
  font-family: var(--font-script); font-weight: 400;
  font-size: 1.5rem; letter-spacing: 0; color: var(--ink);
}
.class-label { color: var(--ink-soft) !important; }
.whoami { display: flex; align-items: center; gap: 10px; }
.whoami-name { font-weight: 600; font-size: .85rem; }
.btn-logout { background: transparent; color: var(--blue); padding: 6px 10px; font-size: .8rem; }
.btn-logout:hover { background: rgba(30, 91, 198, .07); }

.tabs {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 53px; z-index: 39;
}
.tabs-inner {
  max-width: 940px; margin: 0 auto; display: flex; justify-content: center; gap: 6px;
  overflow-x: auto; padding: 4px 12px;
}
.tab {
  font-family: inherit; background: none; border: none; cursor: pointer;
  display: flex; align-items: center; gap: 7px;
  padding: 9px 14px; border-radius: 8px; font-size: .85rem; font-weight: 600;
  color: var(--ink); white-space: nowrap; position: relative;
  border-bottom: 2px solid transparent; border-radius: 0;
  transition: color .12s;
}
.tab:hover { color: var(--navy); }
.tab { color: var(--ink-soft); }
.tab-active { color: var(--navy) !important; border-bottom-color: var(--navy); }
.tab-icon { display: inline-flex; }
.tab-badge {
  background: var(--red); color: #fff; font-size: .68rem; font-weight: 700;
  border-radius: 999px; padding: 1px 6px; margin-left: 2px;
}
/* notification: the tab icon glows red until the tab is opened */
.tab-alert { color: var(--red) !important; }
.tab-alert .tab-icon { color: var(--red); animation: tab-pulse 1.4s ease-in-out infinite; }
.tab-alert .tab-icon svg { filter: drop-shadow(0 0 4px rgba(224, 22, 43, .6)); }
@keyframes tab-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

.view { max-width: 620px; margin: 0 auto; padding: 24px 16px 90px; }
.page-head { margin-bottom: 18px; }
.page-head p { margin-top: 4px; }
.section-title { margin: 22px 0 12px; }

/* ============================================================
   STORIES ROW (Home)
   ============================================================ */
.stories {
  display: flex; gap: 14px; overflow-x: auto;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 14px 10px; margin-bottom: 16px;
  scrollbar-width: thin;
}
.story {
  font-family: inherit; background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  flex-shrink: 0; width: 66px; padding: 0;
}
.story-name {
  font-size: .72rem; color: var(--ink); max-width: 66px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.story .avatar { width: 54px; height: 54px; font-size: 1.6rem; }

/* profile peek modal */
.peek-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(20, 24, 34, .6);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadeIn .15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.peek-card {
  background: var(--paper); border-radius: 16px; max-width: 420px; width: 100%;
  max-height: 86vh; overflow-y: auto; padding: 26px; text-align: center;
  animation: pop .2s ease;
}
.peek-card .avatar { margin-bottom: 10px; }
.peek-tags { justify-content: center; }

/* ---------- life-event popup ---------- */
.event-emoji {
  width: 76px; height: 76px; margin: 0 auto 12px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 2.5rem;
  background: radial-gradient(circle at 50% 38%, #fff, var(--bg));
  border: 1px solid var(--line);
}
.event-choice {
  display: block; width: 100%; text-align: left; cursor: pointer;
  font-family: inherit; color: var(--ink);
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 12px;
  padding: 13px 14px; margin-bottom: 10px; transition: border-color .12s, background .12s;
}
.event-choice:hover { border-color: var(--blue); background: rgba(30, 91, 198, .05); }
.event-choice:disabled { opacity: .6; cursor: not-allowed; }
.event-choice:disabled:hover { border-color: var(--line); background: var(--paper); }
.event-choice-label { font-weight: 600; }
.event-choice-blocked { font-size: .78rem; color: var(--red); margin-top: 7px; }
.stat-delta-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.stat-delta {
  font-size: .72rem; font-weight: 700; border-radius: 999px;
  padding: 2px 9px; border: 1.5px solid currentColor; background: transparent;
  font-variant-numeric: tabular-nums;
}
/* green when the change helps the character, red when it hurts */
.delta-good { color: var(--green); }
.delta-bad { color: var(--red); }

/* ============================================================
   HOME / POSTS  (IG anatomy: header · media · actions · likes · caption)
   ============================================================ */
.composer-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.composer-text, .eval-text {
  width: 100%; font-family: inherit; font-size: .9rem; resize: vertical;
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; outline: none;
  transition: border .15s; background: var(--bg);
}
.composer-text:focus, .eval-text:focus { border-color: var(--ink-soft); background: #fff; }
.composer-actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.composer-preview { margin-top: 10px; }

/* ---------- emoji picker popover (composer + post reactions) ---------- */
.emoji-anchor { position: relative; display: inline-block; }
.emoji-popover {
  position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 40;
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  padding: 8px; box-shadow: 0 6px 20px rgba(0, 0, 0, .12);
  grid-template-columns: repeat(8, 1fr); gap: 2px; width: 260px;
}
.emoji-opt {
  background: none; border: none; cursor: pointer; font-size: 1.15rem;
  border-radius: 6px; padding: 4px; line-height: 1.4;
}
.emoji-opt:hover { background: var(--bg); }
/* the quick-reaction row is a shorter, single-line variant of the same popover */
.reaction-popover { grid-template-columns: repeat(8, 1fr); width: auto; }
.reaction-popover .emoji-opt { font-size: 1.3rem; }
.preview-chip { position: relative; display: inline-block; }
.preview-chip img { max-height: 120px; border-radius: 8px; display: block; }
.chip-x {
  position: absolute; top: -8px; right: -8px; width: 24px; height: 24px;
  border-radius: 50%; border: none; background: var(--ink); color: #fff; cursor: pointer; font-size: .7rem;
}

.post { padding: 0; overflow: hidden; animation: fadeUp .25s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.post-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.post-head strong { font-size: .88rem; }
.post-location { font-size: .74rem; color: var(--ink-soft); line-height: 1.2; }
.post-text { white-space: pre-wrap; padding: 0 14px 4px; font-size: .92rem; }
.post-image { width: 100%; display: block; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.meme-card {
  padding: 34px 20px; text-align: center;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.meme-line { font-size: 1.3rem; font-weight: 800; letter-spacing: .01em; text-transform: uppercase; margin: 4px 0; }

.post-actions { display: flex; align-items: center; gap: 4px; padding: 6px 8px 0; }
.icon-btn {
  font-family: inherit; font-size: 1.3rem; background: none; border: none; cursor: pointer;
  line-height: 1; padding: 6px; border-radius: 8px; color: var(--ink);
  transition: transform .1s ease;
}
.icon-btn:hover { opacity: .6; }
.icon-btn:active { transform: scale(1.2); }
.icon-btn.liked { color: var(--red); animation: heartPop .3s ease; }
@keyframes heartPop { 0% { transform: scale(.7); } 60% { transform: scale(1.3); } 100% { transform: scale(1); } }
.likes-line { padding: 2px 14px; font-weight: 700; font-size: .85rem; }
.caption { padding: 2px 14px; font-size: .9rem; white-space: pre-wrap; }
.caption strong { margin-right: 6px; }
.post-time {
  padding: 6px 14px 0; font-size: .68rem; letter-spacing: .04em;
  color: var(--ink-soft); text-transform: uppercase;
}

.comments { padding: 6px 14px 0; display: flex; flex-direction: column; gap: 5px; }
.comment { font-size: .88rem; display: flex; gap: 6px; align-items: baseline; }
.comment strong { font-size: .85rem; }
.comment .muted { font-size: .72rem; }
.new-comment {
  display: flex; align-items: center; gap: 8px;
  border-top: 1px solid var(--line); margin-top: 10px; padding: 8px 14px;
}
.comment-input {
  flex: 1; font-family: inherit; font-size: .88rem;
  border: none; outline: none; background: transparent; padding: 6px 0;
}
.comment-input::placeholder { color: var(--ink-soft); }

/* ============================================================
   NEWS
   ============================================================ */
.chip-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip {
  font-family: inherit; border: 1px solid var(--line); background: #fff;
  border-radius: 8px; padding: 6px 14px; font-size: .82rem; font-weight: 600;
  cursor: pointer; color: var(--ink-soft);
}
.chip-active { background: var(--navy); color: #fff; border-color: var(--navy); }
.chip-red { border-color: rgba(224,22,43,.4); color: #b01221; background: rgba(224,22,43,.05); cursor: default; }
.chip-blue { border-color: rgba(30,91,198,.4); color: #17499e; background: rgba(30,91,198,.05); cursor: default; }
.chip-gold { border-color: rgba(212,152,20,.5); color: #8a6510; background: rgba(244,185,66,.1); cursor: default; }
.chip-green { border-color: rgba(42,157,92,.4); color: #1d7343; background: rgba(42,157,92,.06); cursor: default; }

/* stable reference number, shared look across Research + Submissions —
   see Materials.number in js/materials.js */
.material-number {
  display: inline-flex; align-items: center; justify-content: center;
  flex: none; width: 24px; height: 24px; border-radius: 50%;
  background: var(--navy); color: #fff; font-weight: 800; font-size: .72rem;
}
.badge {
  font-size: .64rem; font-weight: 800; letter-spacing: .1em;
  padding: 4px 10px; border-radius: 6px; color: #fff;
}
.badge-article { background: var(--blue); }
.badge-study { background: var(--navy); }
.badge-admin { background: var(--red); }
.think-box {
  background: rgba(224, 22, 43, .05); border-left: 3px solid var(--red);
  border-radius: 0 8px 8px 0; padding: 10px 14px; margin-top: 12px; font-size: .86rem;
}
.news-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.tag-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.tag {
  font-size: .72rem; font-weight: 600; color: var(--blue);
  background: rgba(30, 91, 198, .06); border-radius: 6px; padding: 3px 9px;
}

/* ============================================================
   RESEARCH MATERIALS (shared by Research + Submissions, js/materials.js)
   ============================================================ */
.badge-video { background: var(--red); }
.material-number-empty { background: var(--line); color: var(--ink-soft); }
.mat-group { padding: 14px 14px 6px; }
.mat-group-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.mat-group-head h3 { margin: 0; font-size: 1rem; }
.mat-rows { display: flex; flex-direction: column; }
.mat-row {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: none; border: none; border-top: 1px solid var(--line); padding: 10px 2px;
  font-family: inherit; color: var(--ink); cursor: pointer;
}
.mat-row:hover { background: var(--bg); }
.mat-row-icon { color: var(--navy); display: inline-flex; flex: none; }
.mat-row-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.mat-row-title { font-weight: 700; font-size: .9rem; line-height: 1.3; }
.mat-row-status { color: var(--green); display: inline-flex; flex: none; }
.mat-row-chevron { font-size: 1.3rem; flex: none; }
.mat-row-done .mat-row-title { color: var(--ink-soft); }
.mat-detail { max-width: 560px; width: 100%; max-height: 90vh; overflow-y: auto; }
.mat-detail-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.mat-detail-title { margin-bottom: 2px; }
.mat-detail .video-frame, .mat-detail .video-placeholder { margin-top: 12px; border-radius: 8px; overflow: hidden; }
.mat-detail-summary { margin-top: 10px; font-size: .9rem; }
.mat-answer { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.mat-answer-label { display: flex; align-items: center; gap: 5px; font-weight: 700; font-size: .88rem; }
.mat-answer .eval-text { width: 100%; }
.mat-prev { background: rgba(42, 157, 92, .06); border-left: 3px solid var(--green); border-radius: 0 8px 8px 0; padding: 8px 12px; font-size: .88rem; white-space: pre-wrap; }
.mat-prev .muted { display: flex; align-items: center; gap: 4px; color: var(--green); }
.mat-confirm { color: var(--green); font-weight: 700; }

.video-frame { aspect-ratio: 16 / 9; background: #10152e; }
.video-frame iframe { width: 100%; height: 100%; border: none; display: block; }
.video-placeholder {
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(420px 220px at 25% 15%, rgba(224, 22, 43, .35), transparent 60%),
    linear-gradient(140deg, #0a3161, #1e5bc6);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px;
}
.video-placeholder .btn-primary { background: #fff; color: var(--navy); }
.video-placeholder-icon { color: #fff; display: inline-flex; }
.video-placeholder .muted { color: rgba(255,255,255,.8); }

/* ============================================================
   MESSAGES  (IG DM look)
   ============================================================ */
.messenger {
  display: grid; grid-template-columns: 220px 1fr; gap: 0;
  min-height: 480px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.contact-list {
  border-right: 1px solid var(--line);
  padding: 8px; overflow-y: auto; max-height: 620px;
}
.contact {
  font-family: inherit; width: 100%; display: flex; gap: 9px; align-items: center;
  background: none; border: none; border-radius: 8px; padding: 8px; cursor: pointer;
  text-align: left; transition: background .12s;
}
.contact:hover { background: var(--bg); }
.contact-active { background: #efefef !important; }
.contact-meta { min-width: 0; }
.contact-meta strong { font-size: .84rem; }

.thread-box { display: flex; flex-direction: column; overflow: hidden; max-height: 620px; }
.thread-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.thread-head strong { font-size: .9rem; }
.thread-scroll { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.thread-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.big-emoji { color: var(--ink-soft); display: inline-flex; }

.bubble-row { display: flex; }
.bubble-row.mine { justify-content: flex-end; }
.bubble {
  max-width: 78%; background: #efefef; border-radius: 18px;
  padding: 8px 13px; font-size: .88rem;
}
.bubble-mine { background: var(--blue); color: #fff; }
.bubble-broadcast { background: rgba(224, 22, 43, .06); border: 1px solid rgba(224, 22, 43, .3); }
.bubble-tag { font-size: .7rem; font-weight: 700; color: var(--red); margin-bottom: 4px; }
.bubble-time { font-size: .66rem; opacity: .6; margin-top: 3px; text-align: right; }
.bubble-image { max-width: 100%; border-radius: 10px; margin-top: 6px; }
.bubble-file {
  display: inline-block; margin-top: 6px; background: rgba(0,0,0,.06);
  border-radius: 10px; padding: 6px 10px; font-size: .82rem; color: inherit;
}
.bubble-mine .bubble-file { background: rgba(255,255,255,.2); color: #fff; }

.thread-composer {
  display: flex; gap: 8px; align-items: center;
  padding: 10px 12px; border-top: 1px solid var(--line);
}
.thread-input {
  flex: 1; font-family: inherit; font-size: .88rem;
  border: 1px solid var(--line); border-radius: 999px; padding: 9px 15px; outline: none;
}
.thread-input:focus { border-color: var(--ink-soft); }

/* ============================================================
   ME / PROFILE
   ============================================================ */
.profile-hero { position: relative; }
.profile-hero::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 5px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(90deg, var(--red), #fff 45%, var(--navy));
}
.profile-hero-top { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; padding-top: 6px; }
.profile-name { font-size: 1.45rem; }
.dream-quote {
  margin-top: 16px; background: var(--bg);
  border: 1px dashed var(--line); border-radius: 10px; padding: 13px 16px;
}
.dream-label { font-size: .66rem; font-weight: 800; letter-spacing: .12em; color: var(--red); }
.dream-quote p { font-size: 1.02rem; font-weight: 600; margin-top: 4px; }

.statbar { margin-top: 16px; }
.statbar-head { display: flex; justify-content: space-between; font-size: .88rem; margin-bottom: 5px; }
.statbar-label { font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.statbar-value { font-weight: 800; }
.statbar-track { height: 10px; background: var(--bg); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.statbar-fill { height: 100%; border-radius: 999px; transition: width .6s cubic-bezier(.2, .8, .3, 1); }
.statbar-red .statbar-fill { background: var(--red); }
.statbar-red .statbar-value { color: var(--red); }
.statbar-blue .statbar-fill { background: var(--blue); }
.statbar-blue .statbar-value { color: var(--blue); }
.statbar-gold .statbar-fill { background: var(--gold); }
.statbar-gold .statbar-value { color: #b07f10; }
.statbar-green .statbar-fill { background: var(--green); }
.statbar-green .statbar-value { color: var(--green); }
.statbar-note { font-size: .76rem; color: var(--ink-soft); margin-top: 3px; }

.fact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fact { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: .88rem; }
.fact-label { font-size: .7rem; font-weight: 800; letter-spacing: .06em; color: var(--ink-soft); margin-bottom: 2px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.list-card ul { padding-left: 18px; font-size: .88rem; }
.list-up { border-top: 3px solid var(--blue); }
.list-down { border-top: 3px solid var(--red); }

/* ============================================================
   SLIDERS & FORMS (Final Reflection ratings, admin overrides)
   ============================================================ */
.slider-block { margin: 18px 0; }
.slider-head { display: flex; justify-content: space-between; align-items: baseline; }
.slider-value {
  font-weight: 800; font-size: 1.05rem; background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 2px 12px;
}
.slider { width: 100%; margin-top: 8px; accent-color: var(--blue); height: 22px; }
.slider-red { accent-color: var(--red); }
.slider-gold { accent-color: var(--gold); }
.slider-green { accent-color: var(--green); }
.slider-ends { display: flex; justify-content: space-between; font-size: .74rem; color: var(--ink-soft); }
.check-row { display: flex; align-items: center; gap: 8px; margin: 14px 0; font-size: .88rem; cursor: pointer; }

/* Final Reflection (Submissions tab) */
.final-card { border-top: 3px solid var(--gold); }
.final-status { margin-bottom: 6px; }
.final-h { margin: 18px 0 4px; font-size: .95rem; color: var(--navy); }
.final-details { margin: 12px 0; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: var(--bg); }
.final-details summary { cursor: pointer; font-weight: 700; font-size: .88rem; }
.final-details[open] summary { margin-bottom: 8px; }
.final-text { width: 100%; min-height: 280px; line-height: 1.5; }
.report-entry { border-bottom: 1px solid var(--line); padding: 8px 0; font-size: .88rem; white-space: pre-wrap; }
.report-entry:last-child { border-bottom: none; }

/* dream job */
.career-outcome { border-radius: 8px; padding: 10px 12px; margin: 8px 0; border-left: 3px solid var(--ink-soft); background: var(--bg); }
.career-outcome strong { display: block; margin: 2px 0; }
.career-made { border-left-color: var(--green); background: rgba(42, 157, 92, .06); }
.career-close { border-left-color: var(--gold); background: rgba(244, 185, 66, .1); }
.career-out { border-left-color: var(--red); background: var(--red-tint); }
.career-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 10px 0; }
.career-card {
  display: flex; flex-direction: column; gap: 3px; text-align: left; font-family: inherit; color: var(--ink);
  background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 10px 12px; cursor: pointer;
}
.career-card:hover { border-color: var(--blue); }
.career-card.selected { border-color: var(--blue); background: rgba(30, 91, 198, .06); }
.career-card-top { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.career-emoji { font-size: 1.3rem; }
.career-match { font-size: .68rem; font-weight: 800; letter-spacing: .06em; color: var(--green); }
.career-facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; font-size: .86rem; margin: 8px 0; }
.career-facts dt { color: var(--ink-soft); font-weight: 700; font-size: .74rem; letter-spacing: .04em; padding-top: 2px; }
.career-tag { display: inline-block; font-size: .66rem; font-weight: 800; letter-spacing: .05em; color: var(--blue); background: rgba(30, 91, 198, .08); border-radius: 999px; padding: 2px 8px; margin-top: 4px; }

/* "My story so far" (Me tab) */
.story-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.story-item:last-child { border-bottom: none; }
.story-emoji { font-size: 1.2rem; width: 26px; text-align: center; flex: none; }
.story-main { flex: 1; min-width: 0; font-size: .88rem; }
.story-kind { font-size: .66rem; font-weight: 800; letter-spacing: .08em; color: var(--ink-soft); }
.story-kind-crisis { color: var(--red); }
.story-kind-life { color: var(--blue); }

/* ============================================================
   ADMIN
   ============================================================ */
.form-input {
  font-family: inherit; font-size: .88rem; width: 100%;
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
  outline: none; background: var(--bg); margin-bottom: 10px;
}
.form-input:focus { border-color: var(--ink-soft); background: #fff; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.danger-zone { border: 1px solid rgba(224, 22, 43, .4); }
.locked-card { border-style: dashed; background: var(--bg); text-align: center; }

/* per-user stats menu in the Dashboard roster */
.roster-row { border-top: 1px solid var(--line); padding: 10px 0; }
.roster-row:first-of-type { border-top: none; }
.user-stats-panel {
  grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 10px 0 2px;
}
.mini-stat { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; text-align: center; }
.mini-stat-num { font-weight: 800; font-size: .95rem; letter-spacing: -.01em; }
.mini-stat-lbl { color: var(--ink-soft); font-size: .68rem; text-transform: uppercase; letter-spacing: .03em; }
@media (max-width: 560px) { .user-stats-panel { grid-template-columns: 1fr 1fr; } }

/* ============================================================
   RESPONSIVE  (IG app: bottom tab bar on mobile)
   ============================================================ */
@media (max-width: 720px) {
  .class-label { display: none; }
  .whoami-name { display: none; }
  .tab-label { display: none; }
  .tab { padding: 10px 8px; border-bottom: none; }
  .tab-icon { font-size: 1.35rem; }
  .tabs {
    top: auto; bottom: 0; position: fixed; left: 0; right: 0;
    border-top: 1px solid var(--line); border-bottom: none;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tabs-inner { justify-content: space-around; gap: 0; padding: 4px 6px; }
  .view { padding-top: 16px; }
  .messenger { grid-template-columns: 1fr; }
  .contact-list { max-height: 150px; display: flex; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--line); }
  .contact { width: auto; flex-shrink: 0; }
  .contact-meta div { display: none; }
  .fact-grid, .two-col, .trend-grid, .form-grid { grid-template-columns: 1fr; }
  .goal-grid { grid-template-columns: 1fr 1fr; }
  .stat-tiles { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   ONBOARDING — choose your dream goals
   ============================================================ */
.onboard-mode { align-items: flex-start; }
.onboard-wrap { width: 100%; max-width: 720px; margin: 24px auto; }
.onboard-card { padding: 24px; }
.intro-hero { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin: 18px 0 14px; }
.onboard-card .list-card { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); margin-top: 14px; }
.goal-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0 4px;
}
.goal-card {
  display: flex; flex-direction: column; gap: 4px; text-align: left;
  background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 14px; cursor: pointer; font-family: inherit; color: var(--ink);
  transition: border-color .12s ease, background .12s ease, transform .06s ease;
}
.goal-card:hover { border-color: var(--blue); }
.goal-card:active { transform: scale(.99); }
.goal-card.selected { border-color: var(--blue); background: rgba(30, 91, 198, .06); }
.goal-card.selected .goal-icon { color: var(--blue); }
.goal-icon { color: var(--navy); }
.goal-label { font-weight: 700; }
.goal-desc { line-height: 1.35; }

/* chosen-goal chips on the Me page */
.goal-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.goal-chip {
  display: inline-flex; align-items: center; gap: 2px;
  background: rgba(10, 49, 97, .07); color: var(--navy);
  border-radius: 999px; padding: 6px 12px; font-size: .82rem; font-weight: 600;
}

/* ============================================================
   ADMIN STATISTICS
   ============================================================ */
.stat-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat-tile { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stat-tile .num { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.stat-tile .lbl { color: var(--ink-soft); font-size: .78rem; }
.online-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--ink-soft); margin-right: 6px; vertical-align: middle; }
.online-dot.on { background: var(--green); box-shadow: 0 0 0 3px rgba(42, 157, 92, .18); }
.stat-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.stat-table th, .stat-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.stat-table th { color: var(--ink-soft); font-weight: 600; font-size: .76rem; text-transform: uppercase; letter-spacing: .03em; }
.stat-table tbody tr:hover { background: rgba(0,0,0,.02); }
.stat-scroll { overflow-x: auto; }
.bar-row { display: grid; grid-template-columns: 120px 1fr 64px; align-items: center; gap: 10px; margin: 7px 0; }
.bar-track { background: rgba(0,0,0,.06); border-radius: 6px; height: 12px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--blue); border-radius: 6px; }
.bar-num { font-variant-numeric: tabular-nums; color: var(--ink-soft); font-size: .8rem; text-align: right; }

/* ============================================================
   SELF-STUDY ADDITIONS — reachability, lever, chances,
   insights, compare-note, class-at-a-glance overlay
   ============================================================ */
/* dream-goal reachability bars (Me) */
.reach-row { margin: 10px 0; }
.reach-head { display: flex; justify-content: space-between; align-items: center; font-size: .88rem; font-weight: 600; margin-bottom: 4px; }
.reach-pct { font-variant-numeric: tabular-nums; color: var(--ink-soft); }
.reach-track { background: rgba(0,0,0,.06); border-radius: 6px; height: 12px; overflow: hidden; }
.reach-fill { height: 100%; border-radius: 6px; transition: width .4s ease; }

/* "What would help most?" lever card */
.lever-card { border-left: 3px solid var(--blue); }
.lever-label { font-weight: 700; margin: 4px 0 6px; }

/* Chances / loaded dice (Me) */
.chance-row { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin: 10px 0; }
.chance-top { display: flex; gap: 10px; align-items: flex-start; }
.chance-emoji { font-size: 1.6rem; line-height: 1; }
.chance-main { flex: 1; }
.chance-odds { margin-top: 10px; display: flex; align-items: center; gap: 10px; }
.odds-track { flex: 1; background: rgba(0,0,0,.06); border-radius: 6px; height: 10px; overflow: hidden; }
.odds-fill { height: 100%; border-radius: 6px; transition: width .4s ease; }
.chance-result { margin-top: 10px; padding: 8px 10px; border-radius: 8px; font-size: .88rem; }
.chance-result.win { background: rgba(42,157,92,.10); border: 1px solid var(--green); }
.chance-result.lose { background: rgba(224,22,43,.06); border: 1px solid var(--line); color: var(--ink-soft); }

/* My Insights log (Me) + compare-note (Home peek) */
.insight-list { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.insight-item { padding: 8px 0; border-bottom: 1px solid var(--line); }
.insight-item:last-child { border-bottom: none; }
.compare-note { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; text-align: left; }
.compare-note .eval-text { width: 100%; }

/* class-at-a-glance overlay */
.class-view-card { max-width: 560px; width: 100%; text-align: left; max-height: 86vh; overflow-y: auto; }
.startline { margin-top: 6px; }
.startline-row { display: grid; grid-template-columns: 84px 1fr 34px; align-items: center; gap: 8px; margin: 5px 0; }
.startline-row.startline-me { background: rgba(30,91,198,.08); border-radius: 8px; padding: 3px 6px; margin-left: -6px; margin-right: -6px; }
.startline-name { font-size: .82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.startline-track { background: rgba(0,0,0,.06); border-radius: 5px; height: 11px; overflow: hidden; }
.startline-fill { height: 100%; border-radius: 5px; }
.startline-score { text-align: right; font-variant-numeric: tabular-nums; }
.today-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.today-row:last-child { border-bottom: none; }
.today-emoji { font-size: 1.3rem; line-height: 1; }
.today-main { flex: 1; min-width: 120px; }

/* "Where I'm from" hometown info card */
.hometown-line { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.hometown-info-btn { font-size: 1rem; padding: 2px; }
.hometown-card { max-width: 480px; width: 100%; text-align: left; max-height: 86vh; overflow-y: auto; }
.hometown-map { width: 100%; height: 200px; border: 1px solid var(--line); border-radius: 10px; margin-top: 6px; }
.hometown-maplink { display: inline-block; margin-top: 5px; }
.hometown-context { margin-top: 12px; font-size: .92rem; line-height: 1.45; }
.hometown-stats { margin-top: 12px; display: grid; gap: 8px; }
.hometown-stat { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.hometown-stat-label { font-size: .72rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .03em; }
.hometown-stat-value { font-weight: 700; font-size: 1.02rem; }
.hometown-stat-note { margin-top: 1px; }
.hometown-sources-h { margin-top: 14px; font-size: .78rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; }
.hometown-sources { margin-top: 4px; padding-left: 18px; font-size: .85rem; }
.hometown-sources li { margin: 3px 0; }

/* Style Shop — avatar customization (js/data/cosmetics.js) */
.avatar-edit-wrap { position: relative; display: inline-block; }
.avatar-edit-btn {
  position: absolute; right: -4px; bottom: -4px; width: 26px; height: 26px;
  border-radius: 50%; background: var(--navy); color: #fff;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--paper); cursor: pointer; padding: 0;
}
.avatar-edit-btn:hover { background: var(--blue); }
.style-shop-card { max-width: 460px; width: 100%; text-align: left; max-height: 88vh; overflow-y: auto; }
.shop-preview { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 10px; }
.shop-preview .status-row { font-size: 1.3rem; }
.shop-item-emoji { background: var(--paper); font-size: 1rem; }
.shop-swatch:disabled { cursor: default; opacity: .75; }

/* money on the Me status card */
.money-box { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 14px; }
.money-cell { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.money-cell strong { font-size: 1.02rem; }
.money-pos { color: var(--green); }
.money-neg { color: var(--red); }
.shop-section-h { margin-top: 16px; font-size: .78rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; }
.shop-swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.shop-swatch {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 82px; padding: 8px 6px; font-family: inherit; cursor: pointer;
  background: var(--bg); border: 1.5px solid var(--line); border-radius: 10px;
}
.shop-swatch-active { border-color: var(--navy); background: rgba(10, 49, 97, .06); }
.shop-swatch-disabled { opacity: .4; cursor: not-allowed; }
.shop-swatch-color {
  width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; font-size: .85rem;
}
.shop-swatch-color-none { background: repeating-linear-gradient(45deg, var(--bg), var(--bg) 3px, var(--line) 3px, var(--line) 4px); }
.shop-swatch-color-silver { background: #c7cdd6; }
.shop-swatch-color-gold { background: #f4b942; }
.shop-swatch-color-flag { background: var(--ring); }
.shop-swatch-jewel { background: var(--paper); font-weight: 700; }
.shop-swatch-label { font-size: .72rem; text-align: center; line-height: 1.2; }
.shop-swatch-cost { font-size: .68rem; font-weight: 700; color: var(--red); }
.shop-swatch-cost.free { color: var(--green); }
.shop-msg { min-height: 1.2em; color: var(--blue); }
.shop-confirm-bar { display: flex; gap: 8px; justify-content: center; margin-top: 10px; }
.shop-confirm-bar .btn { flex: 1; max-width: 220px; }

/* ============================================================
   LIFE RUN — phase modal, timeline, finale report, print
   ============================================================ */
.phase-stage { font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--blue); margin-bottom: 4px; }
.phase-card .event-choice-blocked { color: var(--ink-soft); }

/* phase modal — deliberately grander than the small event pop-ups: a big
   navy banner with a flag stripe, chapter marker and large emoji, so a
   student sees at a glance that this is a major life moment. */
/* max-height + scroll: long choice lists and follow-ups must stay reachable
   on small screens (life stage, crisis and payday modals all use this) */
.phase-card { padding: 0; overflow-x: hidden; overflow-y: auto; max-height: 92vh; max-height: 92dvh; max-width: 480px; width: 100%; border: 2px solid var(--navy); box-shadow: 0 12px 40px rgba(10, 49, 97, .3); }
.phase-banner { position: relative; background: linear-gradient(135deg, var(--navy), var(--blue)); color: #fff; text-align: center; padding: 22px 20px 18px; }
.phase-banner::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px; background: linear-gradient(90deg, var(--red), #fff 45%, var(--navy)); }
.phase-chapter { font-size: .64rem; font-weight: 800; letter-spacing: .18em; opacity: .85; }
.phase-emoji { font-size: 2.7rem; line-height: 1; margin: 8px 0 4px; }
.phase-stage-big { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .9; }
.phase-title { color: #fff; margin-top: 5px; font-size: 1.15rem; }
.phase-body { padding: 16px 18px 18px; }
.phase-body .event-choice { width: 100%; }
.phase-followup { background: rgba(30, 91, 198, .07); border-left: 3px solid var(--blue); border-radius: 0 8px 8px 0; padding: 10px 12px; margin-bottom: 12px; font-size: .9rem; }
.phase-followup strong { display: flex; align-items: center; gap: 5px; margin-bottom: 4px; }

/* payday — the monthly budget modal, in money green */
.payday-card { border-color: var(--green); box-shadow: 0 12px 40px rgba(23, 96, 58, .25); }
.payday-banner { background: linear-gradient(135deg, var(--green-deep), var(--green)); }
.payday-card .phase-followup { background: var(--green-tint); border-left-color: var(--green); }
.budget-table { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.budget-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 12px; font-size: .88rem; border-bottom: 1px solid var(--line); }
.budget-table .budget-row:last-child { border-bottom: none; }
.budget-income { background: var(--green-tint); }
.budget-left { margin-top: 8px; border: 1px solid var(--line); border-radius: 8px; font-size: .95rem; }
.budget-ok { color: var(--green); background: var(--green-tint); }
.budget-savings { display: flex; justify-content: space-between; padding: 6px 12px; font-size: .9rem; }
.payday-kind .event-choice-label { display: flex; align-items: center; gap: 6px; color: var(--navy); }
.payday-kind .muted { margin-top: 2px; }
.today-effect { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.budget-short { color: var(--red); background: var(--red-tint); border-color: var(--red); }

/* NPC contacts in Messages */
.npc-tag { margin-left: 6px; font-size: .6rem; font-weight: 800; letter-spacing: .08em; color: var(--green); background: var(--green-tint); border-radius: 999px; padding: 1px 6px; vertical-align: middle; }
.npc-note { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-top: 1px solid var(--line); }

/* "At 30" epilogues (Life tab + reports) */
.epilogue-card { border-top: 1px solid var(--line); padding: 12px 0; }
.epilogue-own .epilogue-card { border-top: none; padding-top: 4px; }
.epilogue-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.epilogue-headline { font-weight: 700; font-size: 1rem; margin: 4px 0 6px; }
.epilogue-lines { margin: 0 0 0 18px; font-size: .88rem; }
.epilogue-lines li { margin: 3px 0; }

/* crises — same grand modal as a life stage, in alarm red */
.crisis-card { border-color: var(--red); box-shadow: 0 12px 40px rgba(143, 13, 27, .3); }
.crisis-banner { background: linear-gradient(135deg, var(--red-deep), var(--red)); }
.crisis-banner::before { background: repeating-linear-gradient(90deg, #fff 0 14px, var(--red) 14px 28px); }
.crisis-card .phase-followup { background: var(--red-tint); border-left-color: var(--red); }
.crisis-trigger { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 700; color: var(--red); background: var(--red-tint); border-radius: 999px; padding: 3px 10px; margin-bottom: 10px; }
.crisis-alert, .crisis-warning { margin-top: 12px; border-radius: 8px; padding: 9px 12px; font-size: .86rem; }
.crisis-alert { background: var(--red-tint); border: 1px solid var(--red); color: var(--ink); }
.crisis-alert strong { display: flex; align-items: center; gap: 5px; color: var(--red); margin-bottom: 2px; }
.crisis-warning { display: flex; align-items: center; gap: 6px; background: var(--red-tint); color: var(--red); font-weight: 600; }

/* Chances: show the stakes before you roll */
.chance-stakes { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.chance-stake { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chance-locked { opacity: .55; border-style: dashed; }

/* timeline + report steps */
.life-step { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.life-step:last-child { border-bottom: none; }
.life-step-emoji { font-size: 1.5rem; line-height: 1; flex: none; width: 28px; text-align: center; }
.life-step-locked { opacity: .5; }
.life-step-current > div > strong { color: var(--blue); }

/* finale report layout (shared by student view + admin PDF) */
.life-report-head { display: flex; gap: 14px; align-items: center; padding-bottom: 12px; border-bottom: 2px solid var(--line); margin-bottom: 8px; }
.life-section { margin: 18px 0 8px; font-size: 1rem; }
.life-statline { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid var(--line); }
.life-verdict { white-space: pre-wrap; background: var(--bg); border-radius: 8px; padding: 12px; font-size: .92rem; }
.guide-questions { margin: 6px 0 12px 18px; }
.guide-questions li { margin: 6px 0; font-size: .9rem; }
.print-actions { display: flex; align-items: center; margin-bottom: 14px; }

/* ---------- factors (js/data/factors.js) ---------- */
.factor-tag { display: inline-block; font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink); background: var(--bg); line-height: 1.5; }
.factor-for { border-color: rgba(42,157,92,.45); color: var(--green-deep); background: var(--green-tint); }
.factor-against { border-color: rgba(224,22,43,.35); color: var(--red-deep); background: var(--red-tint); }
.factor-line { margin-top: 6px; }
.factor-row { padding: 9px 0; border-top: 1px solid var(--line); cursor: pointer; }
.factor-row:first-of-type { border-top: none; }
.factor-row-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .9rem; }
.factor-pts { min-width: 34px; text-align: center; font-size: .84rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--bg); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.factor-pts-plus { color: var(--green-deep); background: var(--green-tint); }
.factor-pts-minus { color: var(--red-deep); background: var(--red-tint); }
.factor-row-built { cursor: default; border-top: 2px solid var(--line); }
.opp-sum { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; margin: 4px 0 8px; }
.opp-sum-total { font-size: 1.6rem; font-weight: 800; color: var(--navy); }
.opp-sum-part { font-size: .78rem; font-weight: 600; padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; }

/* ---------- choices vs. circumstances (buildLedgerTable) ---------- */
.ledger { margin-top: 6px; }
.ledger-row { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr; gap: 6px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); font-size: .86rem; }
.ledger-head { border-top: none; font-size: .7rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .03em; }
.ledger-label { display: flex; flex-direction: column; }
.ledger-cell { font-variant-numeric: tabular-nums; font-weight: 600; }
.ledger-good { color: var(--green); }
.ledger-bad { color: var(--red); }

/* ---------- belief curve + check-ins ---------- */
.belief-curve { margin: 8px 0 12px; }
.belief-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.belief-pt { display: inline-flex; flex-direction: column; align-items: center; min-width: 52px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 10px; font-size: .68rem; color: var(--ink-soft); }
.belief-pt strong { font-size: 1rem; color: hsl(calc(var(--b) * 12), 65%, 38%); }
.belief-arrow { color: var(--ink-soft); font-size: .8rem; }
.insight-checkin { border-left: 3px solid var(--gold); padding-left: 8px; }
.checkin-banner { background: linear-gradient(135deg, var(--navy), var(--blue)); }
.checkin-doors { display: flex; flex-direction: column; gap: 4px; margin: 6px 0 4px; }
.checkin-q { display: block; margin: 12px 0 6px; font-size: .92rem; }
.checkin-factors { display: flex; flex-wrap: wrap; gap: 6px; }
.checkin-factor { cursor: pointer; }

/* ---------- class debrief (js/views/debrief.js) ---------- */
.debrief-card { max-width: 880px; }
.debrief-card h2 { margin-bottom: 4px; }
.debrief-panel { border-top: 1px solid var(--line); padding: 16px 0 6px; margin-top: 12px; }
.debrief-panel h3 { margin-bottom: 8px; }
.debrief-q { margin-top: 10px; padding: 8px 10px; border-radius: 8px; background: var(--bg); font-size: .9rem; font-weight: 600; color: var(--navy); }
.debrief-row { display: grid; grid-template-columns: 1.4fr repeat(5, 1fr); gap: 8px; padding: 7px 0; border-top: 1px solid var(--line); font-size: .86rem; align-items: center; font-variant-numeric: tabular-nums; }
.debrief-panel:last-child .debrief-row { grid-template-columns: 1.4fr repeat(3, 1fr); }
.debrief-row-head { border-top: none; font-size: .7rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .03em; }
.debrief-people { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.debrief-person { font-size: .76rem; padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px; }
.dv-legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 8px 0 4px; font-size: .82rem; }
.dv-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.debrief-svg { width: 100%; height: auto; display: block; }
.dv-grid { stroke: var(--line); stroke-width: 1; }
.dv-axis { fill: var(--ink-soft); font-size: 11px; }
.dv-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.dv-dot { stroke: var(--paper); stroke-width: 2; }
.dv-label { fill: var(--ink); font-size: 11px; font-weight: 600; }
.dv-bars { display: flex; flex-direction: column; gap: 10px; }
.dv-bar-group { display: grid; grid-template-columns: 170px 1fr; gap: 10px; align-items: center; }
.dv-bar-name { font-size: .84rem; font-weight: 600; }
.dv-bar-line { display: flex; align-items: center; gap: 6px; height: 12px; margin: 2px 0; }
.dv-bar { height: 8px; border-radius: 0 4px 4px 0; }
.dv-bar-val { font-size: .72rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
@media (max-width: 600px) {
  .debrief-panel:not(:last-child) .debrief-row { grid-template-columns: repeat(4, 1fr); font-size: .76rem; }
  .debrief-panel:last-child .debrief-row { grid-template-columns: repeat(4, 1fr); font-size: .76rem; }
  .debrief-panel:not(:last-child) .debrief-row > span:nth-child(n+5) { display: none; }
  .dv-bar-group { grid-template-columns: 1fr; gap: 2px; }
  .ledger-row { font-size: .78rem; }
}

/* print: show only the report card, cleanly */
@media print {
  body * { visibility: hidden; }
  .print-report, .print-report * { visibility: visible; }
  .print-overlay { position: absolute; inset: 0; background: #fff; overflow: visible; display: block; }
  .print-report { position: absolute; left: 0; top: 0; width: 100%; max-width: none; max-height: none; overflow: visible; box-shadow: none; border: none; }
  .print-actions { display: none; }
}

.danger-divider { border-top: 1px dashed var(--line); margin: 14px 0; }
