/*
 * Foresight UI prototype — styles + design tokens
 * ------------------------------------------------
 * The :root block is the "one-line change" surface for the walkthrough:
 * palette, spacing, radii, and the four domain colors all live here.
 */

:root {
  /* --- Four-domain palette (warm four + VU-gold brand anchor) --- */
  --d-strengths: #E0A83E; /* personal  */
  --d-crew:      #E86A5C; /* social    */
  --d-future:    #4A6FA5; /* professional */
  --d-vu:        #4C9A6E; /* academic  */
  --brand-gold:  #866D4B; /* Vanderbilt gold anchor */

  /* tint versions for backgrounds */
  --d-strengths-soft: #FBF1DC;
  --d-crew-soft:      #FBE4E1;
  --d-future-soft:    #E4EBF4;
  --d-vu-soft:        #E2F0E8;

  /* --- Neutral base --- */
  --bg:        #FAF8F4;
  --surface:   #FFFFFF;
  --surface-2: #F3F0E9;
  --ink:       #2C2A26;
  --ink-soft:  #6B655C;
  --line:      #E7E2D8;

  /* --- Shape & rhythm --- */
  --radius:    16px;
  --radius-sm: 10px;
  --gap:       20px;
  --shadow:    0 1px 2px rgba(44,42,38,.04), 0 6px 20px rgba(44,42,38,.06);
  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.5;
}

button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0 0 .35em; line-height: 1.25; }
p { margin: 0 0 .6em; }

/* ============================ App shell ============================ */
#app { display: flex; min-height: 100vh; }

/* ---- Sidebar ---- */
.sidebar {
  width: 232px;
  flex: 0 0 232px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 20px; color: var(--brand-gold);
  padding: 4px 8px 16px;
}
.brand .vmark {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--brand-gold); color: #fff;
  display: grid; place-items: center;
  font-family: Georgia, "Times New Roman", serif; font-weight: 800; font-size: 19px;
  line-height: 1; box-shadow: var(--shadow);
}
.nav-group-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--ink-soft); padding: 14px 10px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--ink); text-decoration: none; font-size: 14.5px;
  border: none; background: none; width: 100%; text-align: left;
}
.nav-item:hover { background: var(--surface-2); }
.nav-item.active { background: var(--surface-2); font-weight: 600; }
.nav-item .glyph { width: 20px; text-align: center; font-size: 15px; }
.nav-label { display: flex; flex-direction: column; line-height: 1.15; }
.nav-label .nav-name { font-size: 14.5px; }
.nav-label .nav-facet { font-size: 11px; color: var(--ink-soft); text-transform: capitalize; }
.nav-item.domain.active { box-shadow: inset 3px 0 0 var(--accent); }
.nav-sep { height: 1px; background: var(--line); margin: 10px 6px; }

/* ---- Main column ---- */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: 60px; flex: 0 0 60px;
  display: flex; align-items: center; gap: 16px;
  padding: 0 28px;
  background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.topbar .affirm-dock {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 10px;
  color: var(--ink-soft); font-size: 13.5px; font-style: italic;
}
.topbar .affirm-dock .spark { color: var(--brand-gold); font-style: normal; }
.topbar .affirm-dock span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .icons { display: flex; gap: 8px; align-items: center; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 15px; display: grid; place-items: center;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn { position: relative; text-decoration: none; color: var(--ink); }
/* the sign-out control is a real <button>; match the anchor-based icons */
button.icon-btn { cursor: pointer; font-family: inherit; }
.badge-count {
  position: absolute; top: -4px; right: -4px; min-width: 17px; height: 17px;
  background: var(--d-crew); color: #fff; border-radius: 999px;
  font-size: 10.5px; font-weight: 700; display: grid; place-items: center; padding: 0 4px;
  border: 2px solid var(--surface);
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--brand-gold); color: #fff;
  display: grid; place-items: center; font-weight: 600;
  /* it's a <button> now (opens the account menu), so reset button chrome */
  border: 0; padding: 0; font-family: inherit; font-size: 13px;
  letter-spacing: .02em; cursor: pointer;
}
.avatar:hover { filter: brightness(1.08); }

/* account menu — the only real session control in the shell */
.account { position: relative; }
.account-menu {
  position: absolute; top: 44px; right: 0; z-index: 40; min-width: 190px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 6px;
}
.account-menu.hidden { display: none; }
.account-menu .am-who { padding: 8px 10px 0; font-weight: 600; font-size: 14px; }
.account-menu .am-sub { padding: 0 10px 8px; font-size: 12px; color: var(--ink-soft); }
.account-menu .am-item {
  display: block; width: 100%; text-align: left; padding: 9px 10px; border: 0;
  border-top: 1px solid var(--line); background: none; font: inherit;
  font-size: 14px; color: var(--ink); cursor: pointer; border-radius: 6px;
}
.account-menu .am-item:hover { background: var(--surface-2); }

.content { padding: 28px; max-width: 1080px; width: 100%; margin: 0 auto; }

/* ============================ Reusable bits ============================ */
.page-head { margin-bottom: 20px; }
.page-head h1 { font-size: 26px; }
.page-head p { color: var(--ink-soft); max-width: 60ch; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.card h3 { font-size: 16px; }
.card.accent-l { border-left: 4px solid var(--accent, var(--brand-gold)); }

.grid { display: grid; gap: var(--gap); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
}

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; padding: 3px 10px;
  border-radius: 999px; background: var(--chip-bg, var(--surface-2));
  color: var(--chip-ink, var(--ink-soft));
}
.chip .swatch { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface);
  font-size: 14px; font-weight: 600; color: var(--ink);
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--brand-gold); color: #fff; border-color: var(--brand-gold); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.small { padding: 5px 12px; font-size: 12.5px; }

.muted { color: var(--ink-soft); }
.mock-tag {
  font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase;
  color: var(--brand-gold); background: #F1EADF;
  padding: 2px 7px; border-radius: 6px; font-weight: 700;
}
.stack > * + * { margin-top: 14px; }

/* ============================ Today / dashboard ============================ */
.affirm-hero {
  background: linear-gradient(120deg, #FFF9EC, #FDF3F1 60%, #EEF3F8);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 28px; margin-bottom: var(--gap);
}
.affirm-hero .label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--brand-gold); font-weight: 700; }
.affirm-hero .quote { font-size: 21px; line-height: 1.35; margin: 8px 0 0; max-width: 46ch; }

.list-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: none; }
.list-row .time { width: 58px; flex: 0 0 58px; font-weight: 600; font-size: 13.5px; color: var(--ink-soft); }
.list-row .body { flex: 1; min-width: 0; }
.list-row .body .t { font-weight: 600; }
.list-row .body .s { font-size: 13px; color: var(--ink-soft); }
.dot-domain { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: 0 0 10px; }

.badge-urgent { font-size: 11px; font-weight: 700; color: #B4432F; background: #FBE4E1; padding: 2px 8px; border-radius: 999px; }

.rec-card { display: flex; flex-direction: column; gap: 8px; }
.rec-card .when { font-size: 12.5px; font-weight: 600; color: var(--accent); }

.nudge { display: flex; gap: 14px; align-items: flex-start; }
.nudge .bar { width: 4px; align-self: stretch; border-radius: 4px; background: var(--accent); }
.nudge .cta { margin-top: 6px; }

.tile {
  display: flex; flex-direction: column; gap: 6px;
  padding: 18px; border-radius: var(--radius); text-decoration: none; color: var(--ink);
  background: var(--tile-bg); border: 1px solid var(--line);
}
.tile:hover { transform: translateY(-2px); transition: transform .12s; }
.tile .icon { font-size: 22px; color: var(--accent); }
.tile .name { font-weight: 700; }
.tile .facet { font-size: 12px; color: var(--ink-soft); text-transform: capitalize; }

.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); margin: 26px 0 12px; font-weight: 700; }

/* "syncs from X in the real app" banner + source chip */
.sync-banner {
  background: #F1EADF; border: 1px dashed var(--brand-gold); color: #6b5836;
  border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13px; margin-bottom: 14px;
}
.src-chip {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700;
  color: var(--d-crew); background: var(--d-crew-soft); padding: 2px 8px; border-radius: 6px;
}

/* Weekly schedule (My VU) */
.sched-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
@media (max-width: 720px) { .sched-grid { grid-template-columns: repeat(2, 1fr); } }
.sched-col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px; min-height: 120px; }
.sched-day { font-weight: 700; font-size: 12.5px; text-align: center; color: var(--ink-soft); padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.sched-item { display: flex; flex-direction: column; border-left: 3px solid var(--accent); padding: 4px 8px; margin-bottom: 6px; background: var(--surface-2); border-radius: 6px; }
.sched-item .s-time { font-size: 11px; color: var(--ink-soft); }
.sched-item .s-course { font-size: 12.5px; font-weight: 600; }

/* 4-year plan */
.plan-grid { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .plan-grid { grid-template-columns: repeat(2, 1fr); } }
.plan-term h4 { font-size: 13.5px; color: var(--d-vu); margin-bottom: 8px; }
.plan-courses { list-style: none; padding: 0; margin: 0; }
.plan-courses li { font-size: 12.5px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.plan-courses li:last-child { border-bottom: none; }
.plan-note { margin-top: 8px; font-size: 11.5px; color: var(--ink-soft); font-style: italic; }

/* ============================ Inbox ============================ */
.mail-list { padding: 0; }
.mail-row { padding: 14px 18px; border-bottom: 1px solid var(--line); cursor: pointer; }
.mail-row:last-child { border-bottom: none; }
.mail-row:hover { background: var(--surface-2); }
.mail-head { display: flex; gap: 12px; align-items: flex-start; }
.mail-dot { width: 9px; height: 9px; border-radius: 50%; background: transparent; flex: 0 0 9px; margin-top: 6px; }
.mail-row.unread .mail-dot { background: var(--d-crew); }
.mail-row.unread .mail-subject { font-weight: 700; }
.mail-main { flex: 1; min-width: 0; }
.mail-top { display: flex; align-items: center; gap: 8px; }
.mail-subject { font-size: 15px; }
.mail-meta { font-size: 12.5px; color: var(--ink-soft); margin: 2px 0 4px; }
.mail-preview { font-size: 13.5px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-row.open .mail-preview { white-space: normal; }
.mail-body { margin: 12px 0 2px 21px; padding: 14px 16px; background: var(--surface-2); border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent); font-size: 14px; line-height: 1.55; }

/* ============================ Chat ============================ */
.chat-wrap { max-width: 720px; margin: 0 auto; }
.msg { display: flex; margin-bottom: 14px; }
.msg .bubble { padding: 12px 16px; border-radius: 16px; max-width: 80%; }
.msg.companion .bubble { background: var(--surface); border: 1px solid var(--line); border-top-left-radius: 4px; }
.msg.student { justify-content: flex-end; }
.msg.student .bubble { background: var(--brand-gold); color: #fff; border-top-right-radius: 4px; }
.sources { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.source-chip { font-size: 11px; background: var(--surface-2); color: var(--ink-soft); padding: 2px 8px; border-radius: 6px; }
.suggested { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.chat-input { display: flex; gap: 10px; margin-top: 20px; }
.chat-input input { flex: 1; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); font-size: 14px; }

/* Markdown inside a bubble. The renderer in chat.js emits only these tags. */
.bubble-text p { margin: 0 0 8px; }
.bubble-text p:last-child { margin-bottom: 0; }
.bubble-text ul { margin: 6px 0 8px; padding-left: 20px; }
.bubble-text li { margin-bottom: 4px; }
.bubble-text code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }
.msg.student .bubble-text code { background: rgba(255,255,255,.22); }
.bubble-text a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
a.source-chip { text-decoration: none; }
a.source-chip:hover { background: var(--line); }
.source-chip.web { font-style: italic; }
.ask-suggest { margin-top: 10px; }
.ask-error { color: var(--d-crew); margin: 0; }
.ask-dim { color: var(--ink-soft); margin: 0; }

/* Tool status: the wait is several seconds of real lookups, so say which one. */
.ask-status { display: flex; align-items: center; gap: 8px; font-size: 13px;
  color: var(--ink-soft); padding: 4px 2px 10px; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--brand-gold);
  animation: askpulse 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes askpulse { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .dots i { animation: none; opacity: .6; } }

/* ==================== Ask Foresight — Today card ==================== */
.ask-card { margin-bottom: var(--gap); border: 1px solid var(--line); }
.ask-card-row { display: flex; align-items: center; gap: 10px; }
.ask-card-row .spark { color: var(--brand-gold); font-size: 18px; }
.ask-card-row input { flex: 1; padding: 12px 14px; font-size: 15px;
  border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); }
.ask-card-row input:focus { outline: 2px solid var(--brand-gold); outline-offset: 1px; }
.ask-card .suggested { margin-top: 12px; }

/* ==================== Ask Foresight — floating dock ==================== */
/* Sits above page content but below the onboarding overlay, which must stay
   modal. The dock is outside #view so navigation never destroys a live answer. */
#ask-dock { position: fixed; right: 22px; bottom: 22px; z-index: 60; }
#ask-dock.hidden { display: none; }

.ask-fab { width: 56px; height: 56px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--brand-gold); color: #fff; box-shadow: var(--shadow);
  font-size: 22px; line-height: 1; display: grid; place-items: center;
  transition: transform .15s ease; }
.ask-fab:hover { transform: scale(1.05); }
.ask-fab.open { opacity: 0; pointer-events: none; }

.ask-panel { position: absolute; right: 0; bottom: 0; width: 380px; height: 560px;
  max-height: calc(100vh - 44px); display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.ask-panel.hidden { display: none; }

.ask-head { display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.ask-title { font-weight: 600; font-size: 14.5px; }
.ask-title .spark { color: var(--brand-gold); }
.ask-head-actions { display: flex; gap: 2px; }
.ask-icon { border: none; background: none; cursor: pointer; font-size: 15px;
  color: var(--ink-soft); padding: 4px 7px; border-radius: 6px; text-decoration: none; }
.ask-icon:hover { background: var(--line); color: var(--ink); }

.ask-body { flex: 1; overflow-y: auto; padding: 14px; }
.ask-body .msg .bubble { max-width: 92%; font-size: 14px; }
.ask-empty { color: var(--ink-soft); font-size: 14px; }
.ask-empty p { margin: 0 0 4px; }
.ask-empty .suggested { margin-top: 12px; flex-direction: column; align-items: stretch; }

.ask-foot { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.ask-foot input { flex: 1; min-width: 0; padding: 9px 12px; font-size: 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--line); }

/* Mobile is deferred for the app as a whole (see docs/ui-design-plan.md), but the
   dock must not overflow a narrow screen — it goes full-width instead. */
@media (max-width: 480px) {
  #ask-dock { right: 12px; bottom: 12px; left: 12px; }
  .ask-panel { width: auto; left: 0; right: 0; height: min(560px, calc(100vh - 24px)); }
}

/* ============================ Calendar ============================ */
.cal-layout { display: grid; grid-template-columns: 250px 1fr; gap: var(--gap); align-items: start; }
@media (max-width: 820px) { .cal-layout { grid-template-columns: 1fr; } }
.layer-toggle { display: flex; align-items: center; gap: 10px; padding: 8px 6px; cursor: pointer; border-radius: 8px; }
.layer-toggle:hover { background: var(--surface-2); }
.layer-toggle input { accent-color: var(--accent); width: 16px; height: 16px; }
.layer-swatch { width: 10px; height: 10px; border-radius: 3px; background: var(--accent); }
.cal-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin-bottom: 12px; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-viewswitch { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.cal-viewswitch button { border: none; background: var(--surface); padding: 6px 12px; font-size: 12.5px;
  font-weight: 600; color: var(--ink-soft); border-left: 1px solid var(--line); }
.cal-viewswitch button:first-child { border-left: none; }
.cal-viewswitch button:hover { background: var(--surface-2); }
.cal-viewswitch button.on { background: var(--brand-gold); color: #fff; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { text-align: center; font-size: 12px; font-weight: 700; color: var(--ink-soft); padding-bottom: 4px; }
.cal-cell { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; min-height: 84px; padding: 6px; font-size: 12px; min-width: 0; }
.cal-cell.out { background: transparent; }
.cal-cell.out .num { opacity: .45; }
.cal-cell.today { border-color: var(--brand-gold); box-shadow: inset 0 0 0 1px var(--brand-gold); }
.cal-cell.today .num { color: var(--brand-gold); }
.cal-cell .num { font-weight: 700; color: var(--ink-soft); font-size: 11px; }
/* Event chips are buttons now (click → details + the official link). */
.cal-ev { display: block; width: 100%; text-align: left; border: none; margin-top: 4px; padding: 2px 6px;
  border-radius: 5px; color: #fff; font-size: 10.5px; line-height: 1.25; font-family: inherit;
  background: var(--accent); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-ev:hover { filter: brightness(1.08); }
.cal-ev.explain { text-decoration: underline dotted; }
.cal-ev.mine { box-shadow: 0 0 0 2px rgba(255,255,255,.6), 0 0 0 3px var(--accent); }
.cal-ev-t { opacity: .85; font-weight: 600; }
.cal-more { display: block; border: none; background: none; padding: 2px 6px; margin-top: 2px;
  font-size: 10.5px; font-weight: 700; color: var(--ink-soft); cursor: pointer; font-family: inherit; }
.cal-more:hover { color: var(--ink); }
.cal-empty { margin-top: 14px; padding: 16px 18px; border: 1px dashed var(--line);
  border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink-soft); font-size: 13.5px; }

/* Day view — a plannable list rather than a grid */
.cal-day-list { display: flex; flex-direction: column; gap: 6px; }
.cal-day-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); cursor: pointer; font-family: inherit; }
.cal-day-row:hover { background: var(--surface-2); }
.cal-day-row .time { width: 70px; flex: 0 0 70px; font-weight: 600; font-size: 12.5px; color: var(--ink-soft); }
.cal-day-row .bar { width: 4px; align-self: stretch; border-radius: 4px; background: var(--accent); }
.cal-day-row .body { display: flex; flex-direction: column; min-width: 0; }
.cal-day-row .t { font-weight: 600; font-size: 14px; }
.cal-day-row .s { font-size: 12.5px; color: var(--ink-soft); }

/* Sidebar: upcoming rows + the undated deadlines panel */
.cal-up-row { display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left;
  border: none; background: none; padding: 8px 4px; border-bottom: 1px solid var(--line);
  cursor: pointer; font-family: inherit; }
.cal-up-row:last-child { border-bottom: none; }
.cal-up-row:hover { background: var(--surface-2); border-radius: 8px; }
.cal-up-row .dot-domain { margin-top: 5px; }
.cal-up-row .body { display: flex; flex-direction: column; min-width: 0; }
.cal-up-row .t { font-weight: 600; font-size: 13px; line-height: 1.3; }
.cal-up-row .s { font-size: 12px; color: var(--ink-soft); }
/* Deadlines panel: full width under the grid, rows flowing into columns —
   77 undated rows in the 250px sidebar column left a page of blank space. */
.cal-deadlines { margin-top: var(--gap); }
.dl-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); column-gap: 28px; }
.dl-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.dl-row .body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dl-row .t { font-weight: 600; font-size: 13px; line-height: 1.3; }
.dl-row .s { font-size: 12px; color: var(--ink-soft); }
.dl-group summary { cursor: pointer; font-weight: 600; font-size: 13px; padding: 8px 0; }
.dl-group summary:hover { color: var(--brand-gold); }

/* Event detail popover */
.cal-pop { position: fixed; z-index: 60; width: 340px; max-width: calc(100vw - 24px);
  display: flex; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 10px 30px rgba(44,42,38,.22); overflow: hidden; }
.cal-pop .pop-accent { width: 5px; flex: 0 0 5px; }
.cal-pop .pop-body { padding: 14px 16px; min-width: 0; max-height: 70vh; overflow-y: auto; }
.cal-pop .pop-layer { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.cal-pop h4 { margin: 2px 0 4px; font-size: 15.5px; }
.cal-pop .pop-when { font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 8px; }
.cal-pop .pop-fact { font-size: 12.5px; color: var(--ink-soft); margin: 3px 0; }
.cal-pop .pop-desc { font-size: 13px; margin: 8px 0 0; }
.cal-pop .pop-gloss { margin-top: 10px; padding: 9px 11px; border-radius: var(--radius-sm);
  background: var(--d-strengths-soft); border-left: 3px solid var(--brand-gold); font-size: 12.5px; }
.cal-pop .pop-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* ============================ Campus map ============================ */
.map-canvas {
  position: relative; width: 100%; aspect-ratio: 16/9;
  border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden;
  background:
    radial-gradient(circle at 30% 30%, #E9F0E6, transparent 45%),
    radial-gradient(circle at 70% 60%, #EAF0F6, transparent 45%),
    linear-gradient(135deg, #F1EFE7, #E9EDE6);
}
.map-canvas .path { position: absolute; background: #DAD4C6; }
.pin {
  position: absolute; transform: translate(-50%, -100%);
  display: flex; flex-direction: column; align-items: center; cursor: pointer;
}
.pin .head { width: 22px; height: 22px; border-radius: 50% 50% 50% 0; transform: rotate(45deg);
  background: var(--accent); border: 2px solid #fff; box-shadow: var(--shadow); }
.pin .lbl { margin-top: 4px; font-size: 11px; font-weight: 700; background: rgba(255,255,255,.85); padding: 1px 6px; border-radius: 5px; }
.pin:hover .head { transform: rotate(45deg) scale(1.15); }
.pin-detail { margin-top: var(--gap); }

/* ============================ Prep ============================ */
.prep-layout { display: grid; grid-template-columns: 260px 1fr; gap: var(--gap); align-items: start; }
@media (max-width: 820px) { .prep-layout { grid-template-columns: 1fr; } }
.scenario-btn { display: block; width: 100%; text-align: left; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); margin-bottom: 8px; }
.scenario-btn:hover { background: var(--surface-2); }
.scenario-btn.active { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); font-weight: 600; }
.draft-box { background: var(--surface-2); border-radius: var(--radius-sm); padding: 16px; white-space: pre-wrap;
  font-size: 14px; margin: 12px 0; border: 1px dashed var(--line); }
.tips li { margin-bottom: 6px; }

/* ============================ My Story ============================ */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding-bottom: 22px; }
.tl-item::before { content: ""; position: absolute; left: -23px; top: 4px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--surface); }
.tl-item .when { font-size: 12px; font-weight: 700; color: var(--ink-soft); }

/* ============================ Onboarding overlay ============================ */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(44,42,38,.5); display: grid; place-items: center; padding: 24px;
}
.overlay.hidden { display: none; }
.wizard {
  background: var(--surface); border-radius: 20px; width: 560px; max-width: 100%;
  max-height: 90vh; overflow-y: auto; padding: 30px 32px; box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.wizard .steps { display: flex; gap: 6px; margin-bottom: 18px; }
.wizard .steps .s { flex: 1; height: 4px; border-radius: 3px; background: var(--line); }
.wizard .steps .s.done { background: var(--brand-gold); }
.wizard h2 { font-size: 21px; }
.field { margin: 14px 0; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; }
.field input[type=text], .field textarea, .field select {
  width: 100%; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); font-size: 14px; font-family: inherit;
}
.likert { display: flex; justify-content: space-between; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.likert button { flex: 1; padding: 8px 0; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-size: 12px; }
.likert button.sel { background: var(--brand-gold); color: #fff; border-color: var(--brand-gold); }
/* "Prefer not to say" is an answer, not a non-answer — it closes the completeness
   gate. Kept visually quieter than the scale so it doesn't compete with it. */
.likert button.skip { flex: 0 0 auto; padding: 8px 10px; color: var(--ink-soft); border-style: dashed; }
.likert button.skip.sel { background: var(--ink-soft); color: #fff; border-style: solid; border-color: var(--ink-soft); }
.likert-row { margin: 12px 0; }
.likert-row .q { font-size: 13.5px; margin-bottom: 2px; }

/* Multi-select chips (the background question, in the wizard and in My Story) */
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.chip-toggle {
  padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); font-size: 13px; font-family: inherit; cursor: pointer;
}
.chip-toggle:hover { border-color: var(--brand-gold); }
.chip-toggle.sel { background: var(--brand-gold); color: #fff; border-color: var(--brand-gold); }
/* A chosen major/minor is a chip you can take off again, so its × needs to read as
   removable rather than decorative. */
.chip-row[data-wpicked] , .chip-row[data-ppicked] { margin-bottom: 8px; }
.chip-row[data-wpicked]:empty, .chip-row[data-ppicked]:empty { margin-bottom: 0; }
.chip-toggle[data-pick] span { margin-left: 5px; opacity: .75; font-weight: 700; }
.chip-toggle[data-pick]:hover { background: var(--d-crew); border-color: var(--d-crew); }
.dropzone { border: 2px dashed var(--line); border-radius: var(--radius-sm); padding: 24px; text-align: center; color: var(--ink-soft);
  background: var(--surface-2); }
.chips-input { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.wizard-nav { display: flex; justify-content: space-between; margin-top: 22px; }
/* The permanent escape hatch. Nothing in the wizard is required for the app to work,
   so every step offers a way to never see it again — see app.js. */
.wizard-optout { display: flex; align-items: center; gap: 7px; justify-content: flex-end;
  margin-top: 12px; font-size: 12.5px; color: var(--ink-soft); }
.wizard-optout input { width: auto; }

/* ---------- My Story: the editable profile ---------- */
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.card-head h3 { margin: 0; }
.save-state { font-size: 12px; color: var(--ink-soft); }
.small { font-size: 12.5px; }
.prof-grid { display: flex; gap: 12px; flex-wrap: wrap; margin: 10px 0; }
.prof-grid > * { flex: 1 1 240px; }
.prof-field { display: block; margin: 10px 0; }
.prof-field .lbl { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 5px; }
.prof-field input[type=text], .prof-field input[type=password],
.prof-field textarea, .prof-field select {
  width: 100%; padding: 9px 11px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  font-size: 14px; font-family: inherit; background: var(--surface); }
.prof-field.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.prof-field.check input { width: auto; }
.row-tight { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
/* Closing an account is the one irreversible thing a student can do here, so it does
   not look like the buttons next to it. */
.danger-zone { border-color: #E4C4BC; }
.btn.danger { color: #B4432F; border-color: #E4C4BC; }
.btn.danger:hover { background: #FBEFEC; }

/* ---------- Syllabus upload + review ---------- */
.syl-drop { display: block; cursor: pointer; }
.syl-drop:hover { border-color: var(--brand-gold); }
.syl-privacy { margin: 6px 0 12px; }
.syl-warn { background: var(--d-strengths-soft); border-left: 3px solid var(--brand-gold);
  padding: 9px 12px; border-radius: var(--radius-sm); font-size: 13px; margin: 10px 0; }

.syl-file { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  margin: 8px 0; font-size: 13.5px; background: var(--surface); }
.syl-file .name { font-weight: 600; }
.syl-file .why { color: var(--ink-soft); font-size: 12.5px; flex: 1 1 100%; }
.syl-file .acts { margin-left: auto; display: flex; gap: 6px; }

.syl-status { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-soft); white-space: nowrap; }
.syl-status.parsing, .syl-status.saving { background: var(--d-vu-soft); color: var(--d-vu); }
.syl-status.review { background: var(--d-strengths-soft); color: var(--brand-gold); }
.syl-status.saved { background: var(--d-crew-soft); color: var(--d-crew); }
.syl-status.failed { background: #fdecec; color: #a3312b; }

.syl-review { border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin: 12px 0; background: var(--surface); }
.syl-review-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.syl-review-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.syl-section { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.syl-section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.syl-section-head h4 { margin: 0; font-size: 13.5px; }
.syl-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.syl-grid > * { flex: 1 1 160px; }
.syl-row { border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 12px; margin: 8px 0; background: var(--surface-2); }
.syl-row-head { display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; margin-bottom: 6px; }

.syl-field { display: block; margin: 6px 0; }
.syl-field .lbl { display: block; font-size: 12px; color: var(--ink-soft); margin-bottom: 3px; }
.syl-field input { width: 100%; padding: 8px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); font-size: 13.5px; font-family: inherit; background: var(--surface); }
/* Flagged fields are what the review screen exists for: the reader wasn't sure,
   so draw the eye rather than hiding it behind a "looks good!" summary. */
.syl-field.flagged input { border-color: var(--brand-gold); background: #fffdf6; }
.syl-field .note { display: block; font-size: 11.5px; color: #8a6d1f; margin-top: 3px; }

.syl-days { display: flex; gap: 4px; flex-wrap: wrap; margin: 4px 0 8px; }
.syl-days .day { padding: 5px 9px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); font-size: 12px; cursor: pointer; }
.syl-days .day.on { background: var(--brand-gold); color: #fff; border-color: var(--brand-gold); }

.syl-conf { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; margin-left: 6px; }
.syl-conf.high { background: var(--d-crew-soft); color: var(--d-crew); }
.syl-conf.mid { background: var(--surface-2); color: var(--ink-soft); }
.syl-conf.low { background: var(--d-strengths-soft); color: #8a6d1f; }
.syl-pin { font-size: 11.5px; color: var(--ink-soft); }
/* Sub-heading inside a review section (office hours under Instructor). */
.syl-section h5 { margin: 0; font-size: 13px; }

.syl-saved-head { margin: 20px 0 6px; font-size: 13.5px; }
.syl-saved { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  margin: 8px 0; background: var(--surface); }
.syl-saved .acts { display: flex; gap: 6px; }
.btn.small { padding: 5px 9px; font-size: 12px; }
