/* hua: Apple-style layout, Harvard crimson accent */
:root {
  --bg: #ffffff;
  --light: #f5f5f7;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #86868b;
  --line: #d2d2d7;
  --line-soft: #e8e8ed;
  --dark: #000000;
  --dark-2: #161617;
  --dark-text-2: #a1a1a6;
  --crimson: #a51c30;
  --crimson-hover: #8c1728;
  --crimson-bright: #e0485e; /* crimson that reads on black */
  --crimson-tint: #fbeef0;
  --good: #1f7a4d;
  --radius: 18px;
  --shadow: 0 2px 6px rgba(0,0,0,.04), 0 10px 30px rgba(0,0,0,.07);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", Inter, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 17px; line-height: 1.47; letter-spacing: -0.022em; -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; letter-spacing: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Global nav (apple.com) ---------- */
.globalnav {
  position: sticky; top: 0; z-index: 30; height: 48px;
  background: rgba(22,22,23,.8); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  color: #e8e8ed;
}
.gn-inner { max-width: 1024px; height: 100%; margin: 0 auto; padding: 0 22px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.brand { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; }
.shield { width: 22px; height: 25px; display: grid; place-items: center; background: var(--crimson); color: #fff; font-weight: 700; font-size: 13px; border-radius: 4px 4px 11px 11px; }
.wordmark { font-weight: 600; font-size: 17px; letter-spacing: 0; }
.gn-links { display: flex; gap: 4px; }
.gn-link { background: none; border: 0; color: #e8e8ed; opacity: .8; font-size: 12px; padding: 6px 14px; transition: opacity .2s; letter-spacing: -0.01em; }
.gn-link:hover { opacity: 1; }
.gn-icons { display: flex; justify-content: flex-end; align-items: center; gap: 4px; }
.iconbtn { position: relative; width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: inherit; opacity: .85; transition: opacity .2s, background .2s; }
.iconbtn:hover { opacity: 1; }
.iconbtn.plain { color: var(--text-2); opacity: 1; }
.iconbtn.plain:hover { background: var(--light); color: var(--text); }
.badge { position: absolute; top: 2px; right: 0; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--crimson); color: #fff; font-size: 10px; font-weight: 600; display: grid; place-items: center; }
.avatar-btn { width: 28px; height: 28px; margin-left: 6px; border-radius: 50%; border: 0; background: #3a3a3c; color: #fff; font-size: 11px; font-weight: 600; background-size: cover; background-position: center; }
.account-menu { position: fixed; top: 54px; right: max(16px, calc((100vw - 1024px) / 2 + 16px)); min-width: 250px; padding: 14px; gap: 2px; }
.acct-name { font-weight: 600; font-size: 15px; padding: 0 8px; }
.acct-email, .acct-quota { color: var(--text-2); font-size: 13px; padding: 0 8px; }
.acct-quota { margin: 6px 0 8px; }

/* ---------- Tiles (apple.com sections) ---------- */
.tile { text-align: center; padding: 96px 24px; }
.tile-dark { background: var(--dark); color: #f5f5f7; }
.tile-light { background: var(--light); }
.tile-white { background: var(--bg); }
.hero { padding: 120px 24px 110px; }
.eyebrow { color: var(--crimson-bright); font-weight: 600; font-size: 21px; margin: 0 0 6px; letter-spacing: .01em; }
.tile h1 { font-size: clamp(48px, 8vw, 96px); line-height: 1.04; letter-spacing: -0.045em; font-weight: 700; margin: 0; }
.tile h2 { font-size: clamp(32px, 4.5vw, 48px); line-height: 1.08; letter-spacing: -0.035em; font-weight: 700; margin: 0; }
.tile-head { margin-bottom: 48px !important; }
.tagline { font-size: clamp(19px, 2.2vw, 24px); line-height: 1.35; color: var(--dark-text-2); max-width: 680px; margin: 18px auto 0; font-weight: 400; letter-spacing: -0.01em; }
.tagline.dark { color: var(--text-2); }
.cta-row { display: flex; justify-content: center; gap: 14px; margin-top: 34px; flex-wrap: wrap; }

.pill { border-radius: 980px; padding: 12px 24px; font-size: 17px; font-weight: 400; border: 1px solid transparent; transition: background .2s, color .2s, border-color .2s; }
.pill-fill { background: var(--crimson); color: #fff; }
.pill-fill:hover { background: var(--crimson-hover); }
.pill-ghost { background: none; color: var(--crimson-bright); border-color: var(--crimson-bright); }
.pill-ghost:hover { background: var(--crimson-bright); color: #000; }
.pill-soft { background: var(--light); color: var(--text); }
.pill-soft:hover { background: var(--line-soft); }
.pill:disabled { opacity: .45; cursor: default; }
.pill.full { width: 100%; }

.bigstats { display: flex; justify-content: center; gap: clamp(32px, 8vw, 120px); flex-wrap: wrap; }
.bigstats > div { display: flex; flex-direction: column; align-items: center; }
.big { font-size: clamp(48px, 7vw, 80px); font-weight: 700; letter-spacing: -0.04em; line-height: 1;
  background: linear-gradient(180deg, #1d1d1f 30%, #6e6e73); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cap { color: var(--text-2); font-size: 17px; margin-top: 10px; }

.tile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px; background: var(--bg); }
.tile.small { padding: 72px 40px; display: flex; flex-direction: column; align-items: center; }
.tile-grid .tile-white { background: var(--light); }
.links { display: flex; flex-direction: column; gap: 10px; margin-top: 30px; }
.link { background: none; border: 0; color: var(--crimson-bright); font-size: 19px; padding: 0; }
.tile-white .link, .tile-light .link { color: var(--crimson); }
.link:hover { text-decoration: underline; }

.footer { background: var(--light); color: var(--text-2); font-size: 12px; line-height: 1.5; padding: 22px; border-top: 1px solid var(--line-soft); }
.footer p { max-width: 980px; margin: 0 auto; }

/* ---------- Login page ---------- */
.login-hero { padding-top: 110px; }
.login-box { margin: 40px auto 0; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.gsi-slot { min-height: 44px; }
.fine { color: var(--dark-text-2); font-size: 14px; margin: 0; }
.privacy { max-width: 440px; margin: 28px auto 0; color: #6e6e73; font-size: 13px; }
.login-error { color: #ff8a9b; background: rgba(224,72,94,.12); border-radius: 12px; padding: 10px 16px; font-size: 14px; margin: 0; max-width: 460px; }
.feature-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; max-width: 980px; margin: 0 auto; }
.feature { background: var(--bg); border-radius: var(--radius); padding: 34px 28px; text-align: left; }
.feature-icon { font-size: 28px; color: var(--crimson); margin-bottom: 14px; }
.feature h3 { font-size: 21px; margin: 0 0 8px; letter-spacing: -0.02em; }
.feature p { margin: 0; color: var(--text-2); font-size: 16px; }

/* ---------- Composer ---------- */
.composer-wrap { position: relative; max-width: 760px; margin: 0 auto; padding: 0 22px; z-index: 5; }
.hero .composer-wrap { margin-top: 44px; padding: 0; text-align: left; }
body.chatting .composer-wrap {
  position: fixed; left: 0; right: 0; bottom: 0; max-width: none; margin: 0; z-index: 20;
  padding: 16px 22px 22px; background: linear-gradient(to top, var(--bg) 65%, rgba(255,255,255,0));
}
body.chatting .composer { max-width: 760px; margin: 0 auto; }
.composer {
  display: flex; align-items: center; gap: 2px; background: rgba(255,255,255,.94);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--line-soft); border-radius: 980px; padding: 6px 6px 6px 8px; box-shadow: var(--shadow);
}
.seg { display: flex; align-items: center; gap: 4px; white-space: nowrap; background: none; border: 0; border-right: 1px solid var(--line-soft); padding: 10px 14px; color: var(--text); font-size: 15px; }
.seg .chev { width: 14px; height: 14px; color: var(--text-2); }
.composer input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; font-size: 17px; padding: 10px 12px; color: var(--text); }
.composer input::placeholder { color: var(--text-3); }
.ask { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--crimson); color: #fff; transition: background .2s, transform .1s; }
.ask:hover { background: var(--crimson-hover); }
.ask:active { transform: scale(.94); }
.ask:disabled { opacity: .45; cursor: default; }

.menu { position: absolute; z-index: 40; background: rgba(255,255,255,.96); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-radius: 14px; box-shadow: var(--shadow); border: 1px solid var(--line-soft); padding: 6px; display: flex; flex-direction: column; min-width: 230px; }
.menu button { text-align: left; background: none; border: 0; padding: 9px 12px; border-radius: 9px; font-size: 15px; }
.menu button:hover { background: var(--light); }

/* ---------- Conversation ---------- */
body.home main { display: none; }
body.chatting #home { display: none; }
main { max-width: 1024px; margin: 0 auto; padding: 0 22px 170px; }
.thread { padding-top: 48px; }
.turn { margin: 0 auto 44px; animation: rise .5s cubic-bezier(.2,.8,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.turn.user { display: flex; justify-content: flex-end; max-width: 760px; }
.bubble { background: var(--light); color: var(--text); padding: 11px 18px; border-radius: 22px; max-width: 75%; }
.turn.bot { max-width: 1024px; }
.bot-text { font-size: 17px; max-width: 700px; }
.bot-text p { margin: 0 0 12px; }
.bot-text ul { margin: 0 0 12px; padding-left: 22px; }
.status { display: inline-flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 15px; margin: 4px 0 14px; }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--crimson); animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1); } }
.usage { color: var(--text-3); font-size: 12px; margin-top: 4px; }
.error { color: var(--crimson); background: var(--crimson-tint); padding: 12px 16px; border-radius: 12px; font-size: 15px; max-width: 700px; }

/* ---------- Course cards (apple.com "lineup" cards) ---------- */
.section-head { margin: 18px 0 20px; }
.section-head h2 { font-size: 32px; letter-spacing: -0.03em; margin: 0; font-weight: 700; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; margin-bottom: 26px; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 14px; background: var(--light);
  border-radius: 22px; padding: 30px 28px 24px; cursor: pointer;
  transition: transform .4s cubic-bezier(.2,.8,.2,1), box-shadow .4s; animation: rise .55s cubic-bezier(.2,.8,.2,1) both;
}
.card:nth-child(2) { animation-delay: .06s; } .card:nth-child(3) { animation-delay: .12s; }
.card:nth-child(4) { animation-delay: .18s; } .card:nth-child(5) { animation-delay: .24s; } .card:nth-child(6) { animation-delay: .3s; }
.card:hover { transform: scale(1.015); box-shadow: var(--shadow); }
.card .code { font-size: 12px; font-weight: 600; color: var(--crimson); letter-spacing: .02em; text-transform: uppercase; }
.card h3 { font-size: 24px; line-height: 1.15; letter-spacing: -0.03em; margin: -6px 0 0; font-weight: 700; padding-right: 34px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { background: var(--bg); border-radius: 980px; padding: 4px 11px; font-size: 13px; color: #3a3a3c; }
.tag.pos::before { content: "＋ "; color: var(--good); font-weight: 700; font-size: 11px; }
.tag.neg::before { content: "－ "; color: var(--crimson); font-weight: 700; font-size: 11px; }
.reason { color: #3a3a3c; font-size: 16px; margin: 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.stat .n { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.stat .n small { font-size: 13px; font-weight: 500; color: var(--text-2); margin-left: 2px; letter-spacing: 0; }
.stat .l { font-size: 12px; color: var(--text-2); }
.stat .n.hi { color: var(--good); }
.quote { margin: 0; font-size: 15px; color: var(--text-2); }
.card-foot { margin-top: auto; display: flex; gap: 12px; justify-content: space-between; align-items: center; font-size: 14px; color: #3a3a3c; }
.who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.who span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--bg); display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.term { display: flex; align-items: center; gap: 5px; white-space: nowrap; color: var(--text-2); }
.term svg { width: 15px; height: 15px; }
.fav { position: absolute; top: 22px; right: 18px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--bg); display: grid; place-items: center; color: var(--text-3); transition: color .2s, transform .15s; }
.fav:hover { color: var(--crimson); }
.fav.on { color: var(--crimson); }
.fav.on svg { fill: var(--crimson); }
.fav:active { transform: scale(.85); }

/* ---------- Sheets / drawers ---------- */
.scrim { position: fixed; inset: 48px 0 0 0; background: rgba(0,0,0,.3); z-index: 50; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; } }
.sheet { position: fixed; z-index: 60; top: 48px; bottom: 0; left: 0; width: min(420px, 100vw); background: var(--bg); padding: 26px 28px; overflow-y: auto; box-shadow: 0 0 40px rgba(0,0,0,.15); display: flex; flex-direction: column; gap: 16px; animation: slide-l .4s cubic-bezier(.2,.8,.2,1); }
.sheet.right { left: auto; right: 0; animation-name: slide-r; }
@keyframes slide-l { from { transform: translateX(-100%); } }
@keyframes slide-r { from { transform: translateX(100%); } }
.sheet header { display: flex; justify-content: space-between; align-items: center; }
.sheet h2 { margin: 0; font-size: 28px; letter-spacing: -0.03em; }
.hint { color: var(--text-2); font-size: 14px; margin: -8px 0 4px; }
.sheet label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; color: #3a3a3c; }
.sheet input:not([type=range]), .sheet select, .sheet textarea { font: inherit; font-size: 16px; font-weight: 400; color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; background: var(--bg); outline: 0; resize: vertical; }
.sheet input:focus, .sheet select:focus, .sheet textarea:focus { border-color: var(--crimson); box-shadow: 0 0 0 4px var(--crimson-tint); }
.sheet input[type=range] { accent-color: var(--crimson); }
.val { font-weight: 400; color: var(--text-2); }
.fav-item { display: flex; gap: 12px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.fav-item .t { flex: 1; cursor: pointer; }
.fav-item .t b { display: block; font-size: 16px; }
.fav-item .t span { font-size: 13px; color: var(--text-2); }
.empty { color: var(--text-2); font-size: 15px; text-align: center; padding: 40px 10px; }

/* ---------- Detail modal ---------- */
.modal { position: fixed; inset: 48px 0 0 0; z-index: 70; background: rgba(0,0,0,.4); display: grid; place-items: center; padding: 24px; animation: fade .25s; }
.modal-card { position: relative; background: var(--bg); border-radius: 28px; width: min(840px, 100%); max-height: 88vh; overflow-y: auto; padding: 48px 52px; animation: pop .4s cubic-bezier(.2,.8,.2,1); }
@keyframes pop { from { opacity: 0; transform: scale(.96); } }
.modal-card .close { position: absolute; top: 18px; right: 18px; }
.modal-card .code { font-size: 13px; font-weight: 600; color: var(--crimson); text-transform: uppercase; letter-spacing: .02em; }
.modal-card h2 { font-size: 40px; letter-spacing: -0.035em; margin: 4px 0 6px; line-height: 1.1; }
.modal-card .meta { color: var(--text-2); margin: 0 0 18px; }
.modal-card .tags { margin-bottom: 26px; }
.modal-card .tag { background: var(--light); }
.offerings { width: 100%; border-collapse: collapse; font-size: 15px; margin-bottom: 30px; }
.offerings th { text-align: left; font-size: 12px; color: var(--text-2); font-weight: 600; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.offerings td { padding: 11px 6px; border-bottom: 1px solid var(--line-soft); }
.comments h3 { font-size: 24px; letter-spacing: -0.02em; margin: 0 0 14px; }
.comment { background: var(--light); border-radius: 16px; padding: 16px 20px; margin-bottom: 10px; font-size: 15px; }
.comment .ct { font-size: 12px; color: var(--text-2); margin-top: 6px; }

/* ---------- Small screens ---------- */
@media (max-width: 760px) {
  .gn-links { display: none; }
  .gn-inner { grid-template-columns: 1fr auto; }
  .tile { padding: 72px 20px; }
  .hero { padding: 84px 20px 110px; }
  .tile-grid { grid-template-columns: 1fr; padding: 0; gap: 0; }
  .tile.small { padding: 64px 22px; }
  .feature-row { grid-template-columns: 1fr; }
  .seg { display: none; }
  main { padding: 0 16px 160px; }
  body.chatting .composer-wrap { padding: 12px 14px 16px; }
  .bubble { max-width: 88%; }
  .modal-card { padding: 34px 22px; }
  .cards { grid-template-columns: 1fr; }
}

/* ---------- Feedback ---------- */
.fb-card { width: min(520px, 100%); display: flex; flex-direction: column; gap: 16px; padding: 40px 40px 34px; }
.fb-card h2 { font-size: 32px; margin: 0; }
.fb-card .meta { margin: -8px 0 0; }
.fb-kinds { display: flex; flex-wrap: wrap; gap: 8px; }
.fb-kinds input { position: absolute; opacity: 0; pointer-events: none; }
.fb-kinds span { display: inline-block; padding: 8px 16px; border-radius: 980px; background: var(--light); font-size: 15px; cursor: pointer; transition: background .2s, color .2s; }
.fb-kinds input:checked + span { background: var(--text); color: #fff; }
.fb-kinds input:focus-visible + span { outline: 2px solid var(--crimson); outline-offset: 2px; }
.fb-card textarea { font: inherit; font-size: 16px; border: 1px solid var(--line); border-radius: 14px; padding: 13px 15px; resize: vertical; outline: 0; }
.fb-card textarea:focus { border-color: var(--crimson); box-shadow: 0 0 0 4px var(--crimson-tint); }
.fb-email { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); }
.fb-email input { accent-color: var(--crimson); }
.fb-status { margin: 0; font-size: 14px; color: var(--text-2); }
.fb-status.err { color: var(--crimson); }
.fb-card .pill { align-self: flex-end; }

/* ---------- Courses taken ---------- */
.taken-btn { align-self: flex-start; background: none; border: 0; padding: 0; font-size: 13px; color: var(--text-2); }
.taken-btn:hover { color: var(--text); text-decoration: underline; }
.taken-btn.on { color: var(--good); font-weight: 600; }
.taken-search { position: relative; }
.taken-search input { width: 100%; font: inherit; font-size: 16px; border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; outline: 0; }
.taken-search input:focus { border-color: var(--crimson); box-shadow: 0 0 0 4px var(--crimson-tint); }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 5; background: var(--bg); border: 1px solid var(--line-soft); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column; }
.suggest button { text-align: left; background: none; border: 0; padding: 9px 10px; border-radius: 9px; font-size: 14px; }
.suggest button:hover:not([disabled]) { background: var(--light); }
.suggest button[disabled] { color: var(--text-3); cursor: default; }
.suggest .none { padding: 9px 10px; font-size: 14px; color: var(--text-2); }
.chips-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-x { display: inline-flex; align-items: center; gap: 6px; background: var(--light); border-radius: 980px; padding: 6px 6px 6px 13px; font-size: 14px; max-width: 100%; }
.chip-x button { border: 0; background: none; width: 22px; height: 22px; border-radius: 50%; color: var(--text-2); font-size: 12px; }
.chip-x button:hover { background: var(--line-soft); color: var(--text); }
.detail-actions { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.detail-actions .pill { font-size: 15px; padding: 9px 18px; }
.account-menu > button { margin-top: 2px; }

/* ---------- Catalog info ---------- */
.gened { display: inline-block; margin-left: 6px; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--text-2); }
.meets { display: flex; align-items: center; gap: 6px; font-size: 14px; color: #3a3a3c; margin-top: -4px; }
.meets svg { width: 15px; height: 15px; color: var(--text-2); }
.no-q { font-size: 14px; color: var(--text-2); padding: 12px 0 4px; border-top: 1px solid var(--line); }
.modal-card .desc { font-size: 16px; line-height: 1.55; color: #3a3a3c; margin: 0 0 18px; }
.offers { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 18px; }
.offer { background: var(--light); border-radius: 14px; padding: 12px 16px; font-size: 14px; display: flex; flex-direction: column; gap: 3px; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 18px; margin: 0 0 18px; }
.facts dt { font-size: 12px; color: var(--text-2); }
.facts dd { margin: 0; font-size: 15px; }
.modal-card h3.sub { font-size: 20px; margin: 26px 0 8px; letter-spacing: -0.02em; }

/* ---------- Progress cues ---------- */
.progress { display: flex; align-items: flex-start; gap: 14px; margin: 6px 0 18px; color: var(--text-2); font-size: 15px; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.steps li { display: flex; align-items: center; gap: 10px; animation: rise .35s ease both; }
.steps li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--crimson); animation: pulse 1.1s ease-in-out infinite; flex: none; }
.steps li.done { color: var(--text-3); }
.steps li.done::before { content: "✓"; width: auto; height: auto; background: none; color: var(--good); font-size: 13px; font-weight: 700; animation: none; }
.elapsed { font-variant-numeric: tabular-nums; color: var(--text-3); font-size: 13px; margin-top: 1px; }
.card.skeleton { cursor: default; gap: 12px; min-height: 260px; animation: none; }
.card.skeleton:hover { transform: none; box-shadow: none; }
.card.skeleton i { display: block; height: 14px; border-radius: 7px;
  background: linear-gradient(90deg, #e8e8ed 0%, #f5f5f7 50%, #e8e8ed 100%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.card.skeleton i:nth-child(1) { width: 30%; height: 11px; }
.card.skeleton i:nth-child(2) { width: 80%; height: 22px; }
.card.skeleton i:nth-child(3) { width: 95%; }
.card.skeleton i:nth-child(4) { width: 60%; margin-top: auto; height: 30px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .card.skeleton i, .steps li::before { animation: none; } }

/* ---------- Grading-policy notice ---------- */
.notice { position: relative; background: #fff8e6; border-bottom: 1px solid #f1e2b8; color: #4a3b12; font-size: 13px; line-height: 1.45; }
.notice p { max-width: 1024px; margin: 0 auto; padding: 10px 52px 10px 22px; text-align: center; }
.notice a { color: var(--crimson); font-weight: 500; text-decoration: none; white-space: nowrap; }
.notice a:hover { text-decoration: underline; }
.notice-close { position: absolute; top: 50%; right: 12px; transform: translateY(-50%); border: 0; background: none; color: #8a7340; width: 28px; height: 28px; border-radius: 50%; font-size: 12px; }
.notice-close:hover { background: rgba(0,0,0,.06); }
@media (max-width: 760px) { .notice p { text-align: left; padding-right: 44px; } }

/* ---------- Filters panel ---------- */
.seg { gap: 6px; }
.seg svg { width: 16px; height: 16px; color: var(--text-2); }
.fcount { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--crimson); color: #fff; font-size: 11px; font-weight: 600; display: inline-grid; place-items: center; }
.filters { position: fixed; z-index: 25; top: 48px; left: 0; bottom: 0; width: 300px; overflow-y: auto; background: var(--bg);
  border-right: 1px solid var(--line-soft); padding: 22px 20px 120px; display: flex; flex-direction: column; gap: 16px; animation: slide-l .35s cubic-bezier(.2,.8,.2,1); }
.filters header { display: flex; justify-content: space-between; align-items: center; }
.filters header > div { display: flex; align-items: center; gap: 4px; }
.filters h2 { margin: 0; font-size: 24px; letter-spacing: -0.03em; }
.link-btn { background: none; border: 0; color: var(--crimson); font-size: 14px; padding: 4px 6px; }
.f-field { display: flex; flex-direction: column; gap: 7px; font-size: 13px; font-weight: 600; color: #3a3a3c; }
.f-field input:not([type=range]), .f-field select { font: inherit; font-size: 14px; font-weight: 400; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; background: var(--bg); color: var(--text); outline: 0; }
.f-field input:focus, .f-field select:focus { border-color: var(--crimson); box-shadow: 0 0 0 3px var(--crimson-tint); }
.f-field input[type=range] { accent-color: var(--crimson); }
.f-field .val { font-weight: 400; color: var(--text-2); }
.segctl { display: flex; background: var(--light); border-radius: 10px; padding: 3px; gap: 2px; }
.segctl button { flex: 1; border: 0; background: none; border-radius: 8px; padding: 6px 4px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.segctl button.on { background: var(--bg); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.daychips { display: flex; gap: 6px; }
.daychips button { width: 38px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); font-size: 13px; color: var(--text-2); }
.daychips button.on { background: var(--text); border-color: var(--text); color: #fff; text-decoration: line-through; }
.f-toggles { display: flex; flex-direction: column; gap: 9px; font-size: 14px; }
.f-toggles label { display: flex; align-items: center; gap: 8px; }
.f-toggles input { accent-color: var(--crimson); width: 16px; height: 16px; }
.filters .hint { margin: 0; font-size: 12px; }
@media (min-width: 1100px) {
  body.filters-open main, body.filters-open.chatting .composer-wrap { padding-left: 322px; }
}
@media (max-width: 1099px) {
  .filters { top: 48px; z-index: 65; width: min(340px, 100vw); box-shadow: 0 0 40px rgba(0,0,0,.18); }
}
.results-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 6px 0 2px; }
.results-head h2 { margin: 0; font-size: 28px; letter-spacing: -0.03em; }
.results-head select { font: inherit; font-size: 14px; border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; background: var(--bg); }
.results-sub { color: var(--text-2); font-size: 14px; margin: 4px 0 18px; }
.results .more { display: block; margin: 0 auto 10px; }
@media (max-width: 760px) { .seg { display: flex; padding: 10px; } .seg span:not(.fcount) { display: none; } }

/* ---------- Top bar + account menu always reachable ---------- */
.globalnav { z-index: 80; }  /* above sheets (60), filters (65) and modals (70) */
/* .menu sets position:absolute later in this file; this more specific rule keeps the account menu pinned to the
   window, so it opens where you can see it even after scrolling down a long chat. */
.menu.account-menu { position: fixed; z-index: 90; }
.modal-card { max-height: calc(100vh - 48px - 48px); }

/* ---------- Navigation clarity ---------- */
.gn-link { font-size: 13px; opacity: .85; position: relative; }
.gn-link.active { opacity: 1; }
.gn-link.active::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 2px; border-radius: 1px; background: var(--crimson-bright); }
.navbtn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 0; border-radius: 980px;
  background: rgba(255,255,255,.08); color: #e8e8ed; font-size: 12px; transition: background .2s; }
.navbtn:hover { background: rgba(255,255,255,.16); }
.navbtn svg { width: 15px; height: 15px; }
@media (max-width: 900px) { .navbtn span { display: none; } .navbtn { width: 34px; padding: 0; justify-content: center; } }
.seg-right { border-right: 0; border-left: 1px solid var(--line-soft); }
@media (max-width: 760px) { .seg-right span { display: none; } }

/* Cards: make "open me" and actions obvious */
.card-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.taken-btn { align-self: auto; border: 1px solid var(--line); border-radius: 980px; padding: 5px 12px; background: var(--bg); font-size: 13px; color: #3a3a3c; }
.taken-btn:hover { border-color: var(--good); color: var(--good); text-decoration: none; }
.taken-btn.on { border-color: var(--good); background: #eaf6ef; color: var(--good); }
.details-link { font-size: 14px; color: var(--crimson); font-weight: 500; }
.card:hover .details-link { text-decoration: underline; }

/* Follow-up suggestions */
.followups { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 4px; }
.followups > span { font-size: 13px; color: var(--text-2); margin-right: 2px; }
.chip-btn { border: 1px solid var(--line); background: var(--bg); border-radius: 980px; padding: 7px 14px; font-size: 14px; color: var(--text); transition: border-color .2s, color .2s; }
.chip-btn:hover { border-color: var(--crimson); color: var(--crimson); }
.chip-btn.ghost { border-style: dashed; color: var(--text-2); }

/* Visible keyboard focus everywhere */
:focus-visible { outline: 3px solid rgba(165, 28, 48, .45); outline-offset: 2px; border-radius: 8px; }
.globalnav :focus-visible { outline-color: rgba(224, 72, 94, .8); }
