:root {
  --ink: #0A0A0A;
  --ink-2: #3A3A3A;
  --ink-3: #6E6E6E;
  --page: #F4F3F0;
  --surface: #FFFFFF;
  --rule: #E3E1DC;
  --orange: #FF4E00;
  --orange-ink: #C23B00;
  --orange-wash: #FFF0E8;
  --good: #1F6B3E;
  --good-wash: #E5F3EA;
  --bad: #B3261E;
  --radius: 6px;
  --head: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --body: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--page); color: var(--ink); font-family: var(--body); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--orange-ink); }
button { font: inherit; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }

/* Top bar */
.top { background: var(--ink); color: #fff; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; }
.brand img { height: 26px; width: auto; display: block; }
.brand span { font-family: var(--head); font-weight: 600; font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: #BDBDBD; border-left: 1px solid #3A3A3A; padding-left: 12px; }
.top .who { display: flex; align-items: center; gap: 14px; font-size: 13px; color: #BDBDBD; }
.top .who b { color: #fff; font-weight: 600; }
.linkbtn { background: none; border: 1px solid #3A3A3A; color: #fff; border-radius: var(--radius); padding: 6px 12px; cursor: pointer; font-size: 13px; }
.linkbtn:hover { border-color: var(--orange); }

main { padding: 28px 0 64px; }
h1, h2, h3 { font-family: var(--head); letter-spacing: -0.02em; margin: 0; }
h1 { font-size: clamp(26px, 4vw, 34px); font-weight: 700; line-height: 1.1; }
h2 { font-size: 19px; font-weight: 700; margin-bottom: 12px; }
.sub { color: var(--ink-3); margin-top: 6px; }
.eyebrow { font-family: var(--head); font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--orange-ink); }

/* Cards */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 24px 0 32px; }
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 18px; min-width: 0; }
.stat .label { font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; }
.stat .value { font-family: var(--head); font-size: 28px; font-weight: 800; margin-top: 4px; line-height: 1.1; }
.stat .value small { font-size: 15px; font-weight: 600; color: var(--ink-3); }
.stat .note { font-size: 13px; color: var(--ink-2); margin-top: 6px; overflow-wrap: anywhere; }
.bar { height: 6px; background: var(--rule); border-radius: 3px; margin-top: 10px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--orange); }

/* Assignment list */
.list { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
.row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--rule); cursor: pointer; }
.row:first-child { border-top: none; }
.row:hover { background: #FAFAF8; }
.row .t { font-family: var(--head); font-weight: 600; font-size: 15px; }
.row .m { font-size: 13px; color: var(--ink-3); margin-top: 2px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.row .right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; border: 1px solid transparent; }
.chip.Assigned { border-color: var(--ink); color: var(--ink); }
.chip.Submitted { background: #EDEDEA; color: var(--ink-2); }
.chip.In-Review { background: var(--orange-wash); color: var(--orange-ink); }
.chip.Cleared { background: var(--ink); color: #fff; }
.chip.new { background: var(--orange); color: #fff; }
.chip.late { background: #FCE8E6; color: var(--bad); }
.empty { padding: 28px 18px; color: var(--ink-3); text-align: center; }

/* Buttons and forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--orange); color: #fff; border: none; border-radius: var(--radius); padding: 10px 18px; font-family: var(--head); font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--orange-ink); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.ghost { background: none; color: var(--ink); border: 1px solid var(--rule); }
.btn.ghost:hover { border-color: var(--ink); }
.btn.small { padding: 6px 12px; font-size: 13px; }
label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 6px; }
input, textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--rule); border-radius: var(--radius); background: #fff; color: var(--ink); }
input:focus, textarea:focus { outline: 2px solid var(--orange); outline-offset: -1px; border-color: var(--orange); }
textarea { min-height: 110px; resize: vertical; }
.msg { margin-top: 14px; padding: 10px 12px; border-radius: var(--radius); font-size: 14px; }
.msg.err { background: #FCE8E6; color: var(--bad); }
.msg.ok { background: var(--good-wash); color: var(--good); }

/* Auth */
.auth { min-height: 100vh; display: grid; place-items: center; background: var(--ink); padding: 24px 16px; }
.auth .box { width: 100%; max-width: 400px; }
.auth img { width: 100%; max-width: 340px; display: block; margin: 0 auto 8px; }
.auth .card { padding: 24px; }
.auth h2 { margin-bottom: 4px; }
.auth .btn { width: 100%; margin-top: 18px; }
.auth .foot { text-align: center; color: #8A8A8A; font-size: 13px; margin-top: 16px; }

/* Detail */
.back { background: none; border: none; color: var(--ink-3); cursor: pointer; padding: 0; font-size: 14px; margin-bottom: 14px; }
.back:hover { color: var(--ink); }
.detail-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 20px; }
.section { margin-top: 24px; }
.instructions { white-space: pre-wrap; }
.qa { border-top: 1px solid var(--rule); padding: 12px 0; }
.qa:first-child { border-top: none; padding-top: 0; }
.qa .q { font-weight: 600; font-size: 13px; color: var(--ink-2); }
.qa .a { white-space: pre-wrap; margin-top: 4px; overflow-wrap: anywhere; }
.thread { display: grid; gap: 12px; }
.bubble { padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--rule); background: var(--surface); }
.bubble.coach { border-left: 3px solid var(--orange); }
.bubble.you { background: #FAFAF8; }
.bubble .by { font-size: 12px; font-weight: 600; color: var(--ink-3); margin-bottom: 6px; }
.bubble .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.closed { font-size: 14px; color: var(--good); background: var(--good-wash); padding: 10px 12px; border-radius: var(--radius); }

.loading { padding: 80px 0; text-align: center; color: var(--ink-3); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--rule); border-top-color: var(--orange); border-radius: 50%; margin: 0 auto 12px; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 720px) {
  .stats { grid-template-columns: minmax(0, 1fr); }
  .brand span { display: none; }
  .top .who .name { display: none; }
  .row { grid-template-columns: minmax(0, 1fr); }
  .row .right { justify-content: flex-start; }
}
