/* Royal Coast Innovations palette, from the Brand Bible.
   Gold is an accent and stays under about 5% of any layout. */
:root {
  --deep-sea: #0F2A3D;
  --tide-slate: #5B7385;
  --crown-gold: #C9A24A;
  /* The brand gold reaches 6.17:1 on navy and only 2.20:1 on paper, which is
     below the 3.0:1 that non-text UI needs to be distinguishable. This is the
     same hue darkened until it clears, for indicators on light backgrounds. */
  --crown-gold-ink: #A8883E;
  --sand: #E9E1D1;
  --foam: #F7F5F0;
  --ink: #141210;
  --white: #FFFFFF;
  --line: #DFD9CC;
  --good: #1F4D2B;
  --warn: #8A5A00;
  --bad: #8C2F20;
  --vault: #0F4B53;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 42, 61, .06), 0 4px 16px rgba(15, 42, 61, .05);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--foam);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .serif {
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--deep-sea);
  margin: 0;
}

h1 { font-size: 34px; line-height: 1.15; }
h2 { font-size: 21px; }
h3 { font-size: 16px; }

code, .mono { font-family: "JetBrains Mono", ui-monospace, Menlo, monospace; font-size: 12.5px; }

a { color: var(--deep-sea); }

/* ---------------------------------------------------------------- layout */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--deep-sea);
  color: #CFDCE4;
  padding: 22px 0 18px;
  display: flex;
  flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand { padding: 0 20px 4px; }
.brand .name { font-family: Fraunces, Georgia, serif; font-size: 18px; color: #fff; font-weight: 600; }
.brand .sub { font-size: 11px; color: #7E97A6; letter-spacing: .04em; text-transform: uppercase; }

.nav-label {
  font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase;
  color: #6E8998; padding: 20px 20px 7px;
}
.nav a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 20px; color: #CFDCE4; text-decoration: none; font-size: 14px;
  border-left: 3px solid transparent; cursor: pointer;
}
.nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav a.active { background: rgba(255,255,255,.09); color: #fff; border-left-color: var(--crown-gold); }
.nav .pill {
  background: var(--crown-gold); color: #29200B; font-size: 11px; font-weight: 700;
  border-radius: 20px; padding: 1px 8px; min-width: 20px; text-align: center;
}
.sidebar-foot { margin-top: auto; padding: 14px 20px 0; font-size: 11px; color: #5F7887; }

.main { padding: 30px 36px 70px; max-width: 1180px; }
.crumb { font-size: 12.5px; color: var(--tide-slate); margin-bottom: 5px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.lede { color: #48566180; }
.sub { color: var(--tide-slate); font-size: 13.5px; margin-top: 5px; }

/* ----------------------------------------------------------------- bits */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 18px 20px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.row { display: flex; align-items: center; gap: 10px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.muted { color: var(--tide-slate); }
.tiny { font-size: 12px; }
.mt { margin-top: 16px; }

button, .btn {
  font: inherit; font-size: 13.5px; font-weight: 500;
  border-radius: 7px; border: 1px solid var(--line); background: var(--white);
  color: var(--deep-sea); padding: 7px 14px; cursor: pointer;
}
button:hover { border-color: var(--tide-slate); }
button:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--deep-sea); color: #fff; border-color: var(--deep-sea); }
.btn-primary:hover { background: #163a52; }
.btn-sm { padding: 4px 10px; font-size: 12.5px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; padding: 2px 9px; border-radius: 20px;
  background: var(--sand); color: #4A4234; white-space: nowrap;
}
.chip.vault { background: #DCEBED; color: var(--vault); }
.chip.good { background: #DFEBE1; color: var(--good); }
.chip.warn { background: #F6E8CC; color: var(--warn); }
.chip.bad  { background: #F2DCD7; color: var(--bad); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; font-weight: 500; font-size: 11.5px; letter-spacing: .05em;
  text-transform: uppercase; color: var(--tide-slate);
  padding: 10px 16px; border-bottom: 1px solid var(--line);
}
td { padding: 12px 16px; border-bottom: 1px solid #EDE8DD; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #FBF9F5; }

.stat-bar { display: flex; height: 7px; border-radius: 4px; overflow: hidden; background: #EEE9DE; }
.stat-bar i { display: block; }
.stat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 14px; }
.stat b { font-family: Fraunces, Georgia, serif; font-size: 26px; color: var(--deep-sea); display: block; line-height: 1.1; }
.stat span { font-size: 12.5px; color: var(--tide-slate); display: flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* -------------------------------------------------------- reading views */
.toggle { display: inline-flex; background: var(--sand); border-radius: 8px; padding: 3px; }
.toggle button { border: none; background: transparent; padding: 5px 14px; border-radius: 6px; font-size: 13px; }
.toggle button.on { background: var(--white); box-shadow: 0 1px 2px rgba(0,0,0,.09); font-weight: 600; }

.essay {
  font-family: Fraunces, Georgia, serif; font-size: 16.5px; line-height: 1.72;
  white-space: pre-wrap; color: #231F1A;
}
.essay mark { background: #FBEFCF; padding: 1px 0; border-radius: 2px; }
.redacted {
  border-bottom: 2px dotted var(--vault);
  background: rgba(15, 75, 83, .05);
  cursor: help;
}
.tok { font-family: "JetBrains Mono", monospace; font-size: .86em; background: #DCEBED; color: var(--vault); padding: 0 4px; border-radius: 3px; }

.legend { background: #F2F7F7; border: 1px solid #D5E6E8; border-radius: 8px; padding: 10px 13px; font-size: 12.5px; color: #2E4F55; display: flex; gap: 9px; }

.criterion { border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 17px; background: var(--white); }
.criterion.flagged { border-color: #E4CE9A; box-shadow: 0 0 0 1px #F0E0BD inset; }
.criterion.done { background: #FAFCFA; border-color: #CFE0D2; }
.pips { display: inline-flex; gap: 3px; }
.pips i { width: 15px; height: 7px; border-radius: 2px; background: #DFD9CC; display: block; }
.pips i.on { background: var(--deep-sea); }
.caveat { background: #FBF3E0; border: 1px solid #EBD9AE; border-radius: 7px; padding: 9px 11px; font-size: 12.5px; color: #6A4E12; margin: 9px 0; }
.evidence-link { background: none; border: none; padding: 0; color: var(--deep-sea); text-decoration: underline; cursor: pointer; font-size: 12.5px; }

.option { border: 1px solid var(--line); border-radius: 8px; padding: 10px 13px; cursor: pointer; display: block; margin-bottom: 8px; }
.option.sel { border-color: var(--vault); box-shadow: 0 0 0 1px var(--vault) inset; background: #F5FAFA; }
.option b { font-size: 13.5px; }
.option .d { font-size: 12.5px; color: var(--tide-slate); }

.audit-line { border-bottom: 1px solid #EDE8DD; padding: 8px 0; font-size: 12.5px; }
.audit-line:last-child { border: none; }

.spin { display: inline-block; width: 13px; height: 13px; border: 2px solid var(--line); border-top-color: var(--deep-sea); border-radius: 50%; animation: s .7s linear infinite; }
@keyframes s { to { transform: rotate(360deg); } }

.hidden { display: none !important; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .main { padding: 20px 16px 60px; }
}

/* ------------------------------------------------------------- top bar */
.topbar {
  background: var(--deep-sea); color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 24px; position: sticky; top: 0; z-index: 20;
}
.topbrand { font-family: Fraunces, Georgia, serif; font-size: 17px; font-weight: 600; color: #fff; text-decoration: none; cursor: pointer; }
.topright { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--sand); color: #6B5A2E; display: grid; place-items: center;
  font-size: 12px; font-weight: 600;
}
.app { min-height: calc(100vh - 52px); }
.sidebar { top: 52px; height: calc(100vh - 52px); }

/* -------------------------------------------------------- landing page */
.landing { max-width: 1140px; margin: 0 auto; padding: 34px 28px 70px; }
.ws-row {
  display: grid; grid-template-columns: 150px 1fr 220px 24px;
  gap: 18px; align-items: center;
  padding: 20px 6px; border-bottom: 1px solid var(--line);
  cursor: pointer; text-decoration: none; color: inherit;
}
.ws-row:hover { background: #FBF9F5; }
.ws-code { font-family: Fraunces, Georgia, serif; font-size: 26px; color: var(--deep-sea); font-weight: 600; line-height: 1.1; }
.ws-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.ws-next { font-size: 13px; }
.ws-next .lbl { font-size: 11px; color: var(--tide-slate); display: block; }
.caret { color: var(--tide-slate); font-size: 18px; text-align: right; }
.attn-card { border: 1px solid var(--line); border-radius: 9px; padding: 11px 13px; background: var(--white); margin-bottom: 10px; cursor: pointer; }
.attn-card:hover { border-color: var(--tide-slate); }
.attn-card .c { font-size: 11px; color: var(--tide-slate); }
.attn-card .t { font-size: 13.5px; font-weight: 500; margin-top: 2px; }

/* ------------------------------------------------------------- wizard */
.steps { display: flex; gap: 26px; margin: 8px 0 22px; }
.step { font-size: 12.5px; color: var(--tide-slate); }
.step b { display: block; color: var(--deep-sea); font-size: 13.5px; }
.step.on b { color: var(--deep-sea); }
.step.on { border-bottom: 2px solid var(--crown-gold); padding-bottom: 6px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--tide-slate); margin-bottom: 4px; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 14px; padding: 8px 11px;
  border: 1px solid var(--line); border-radius: 7px; background: var(--white); color: var(--ink);
}
textarea { font-family: "JetBrains Mono", monospace; font-size: 12.5px; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 6px 14px; font-size: 13px; }
.kv .k { color: var(--tide-slate); }

/* 🛠️ Unbuilt. Visible on the roadmap, never mistakable for a feature. */
.chip.todo { background: #F3EEE3; color: #7A6534; border: 1px dashed #D8C9A6; }
.card.unbuilt {
  background: repeating-linear-gradient(135deg, #FBF9F5, #FBF9F5 9px, #F5F1E8 9px, #F5F1E8 18px);
  border-style: dashed; box-shadow: none; opacity: .82;
}
.card.unbuilt b { color: var(--tide-slate); }
.sidebar-foot { line-height: 1.5; }
.hm { margin-right: 6px; display: inline-block; }


/* ----------------------------------------------------------------- a11y

   Added after an audit found no focus styling anywhere. A keyboard user had
   no way to see where they were, which is the single most common way an
   otherwise careful interface becomes unusable. */

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--deep-sea);
  outline-offset: 2px;
  border-radius: 4px;
}
.topbar :where(a, button):focus-visible { outline-color: var(--sand); }

/* Visible only once focused, which is what makes it useful to the people who
   need it and invisible to everyone else. */
.skip {
  position: absolute; left: 8px; top: -48px; z-index: 50;
  background: var(--white); color: var(--deep-sea);
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px;
  transition: top .12s ease;
}
.skip:focus { top: 8px; }

/* A spinner that never stops is a problem for vestibular disorders, and this
   one runs for as long as a request takes. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .spin { animation: none; border-top-color: var(--deep-sea); opacity: .6; }
}

/* Touch targets. 24px is the WCAG 2.2 minimum for pointer inputs and several
   controls here were smaller. */
button, .btn, .btn-sm { min-height: 32px; }

/* Below the existing 900px breakpoint the sidebar grid still forced two
   columns, so the main column was squeezed rather than stacked. */
@media (max-width: 720px) {
  .app { grid-template-columns: 1fr !important; }
  .sidebar { position: static; border-right: none; border-bottom: 1px solid var(--line); }
  .grid { grid-template-columns: 1fr !important; }
  .main { padding: 18px 16px; }
  .topbar { padding: 0 16px; }
}

/* Present to assistive technology, absent from the page. */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* The hidden attribute only sets display:none through the UA stylesheet, so
   any explicit display in this file silently beat it. That left the signed-out
   avatar visible as an empty circle. */
[hidden] { display: none !important; }

/* Selects were falling back to the OS control while every other input was
   styled, so the assignment switcher looked like it belonged to another page. */
select {
  font: inherit; font-size: 13.5px; color: var(--deep-sea);
  background: var(--white); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 30px 6px 10px; min-height: 32px;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%230F2A3D' stroke-width='1.6'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center;
  background-size: 10px;
}
button[disabled], .btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ------------------------------------------------------------- landing page

   The signed-out front door. Deliberately quiet: the claim is unusual enough
   that it does not need help from the typography. */
.lp { max-width: 940px; margin: 0 auto; padding: 0 20px 64px; }

.lp-hero { text-align: center; padding: 64px 0 52px; }
.lp-logo { height: 40px; width: auto; margin-bottom: 30px; }
.lp-hero h1 {
  font-family: Fraunces, Georgia, serif; font-weight: 600;
  font-size: clamp(30px, 5vw, 46px); line-height: 1.1;
  margin: 0 0 16px; color: var(--deep-sea);
}
.lp-lede {
  max-width: 54ch; margin: 0 auto 28px; font-size: 16.5px;
  line-height: 1.6; color: #41586A;
}
.lp-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.lp-cta .btn { padding: 10px 20px; font-size: 14.5px; text-decoration: none; }
.lp-note { margin-top: 14px; font-size: 12.5px; color: var(--tide-slate); }

.lp-band {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 34px; margin-bottom: 26px;
}
.lp-band h2 {
  font-family: Fraunces, Georgia, serif; font-size: 24px;
  margin: 0 0 6px; color: var(--deep-sea);
}
.lp-sub { margin: 0 0 22px; color: var(--tide-slate); font-size: 14px; max-width: 62ch; }

.lp-swap { display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; align-items: center; }
.lp-swap figure { margin: 0; }
.lp-swap figcaption {
  font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--tide-slate); margin-bottom: 8px;
}
.lp-swap pre {
  margin: 0; padding: 16px; background: var(--foam);
  border: 1px solid var(--line); border-radius: 10px;
  font-family: "JetBrains Mono", monospace; font-size: 12.5px;
  line-height: 1.65; white-space: pre-wrap; color: var(--deep-sea);
}
.lp-arrow { font-size: 22px; color: var(--crown-gold-ink); }
.lp-fine { margin: 20px 0 0; font-size: 13px; color: var(--tide-slate); max-width: 66ch; }

.lp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-bottom: 26px; }
.lp-grid h3 { font-size: 15.5px; margin: 0 0 6px; color: var(--deep-sea); }
.lp-grid p { margin: 0; font-size: 13.5px; line-height: 1.6; color: #41586A; }

/* The limits get the same weight as the claims, on purpose. */
.lp-honest { background: var(--sand); border-color: #DDD2BC; }
.lp-honest p { margin: 0; max-width: 72ch; font-size: 14px; line-height: 1.65; color: #4A4234; }

.lp-foot {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  padding-top: 22px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--tide-slate);
}

@media (max-width: 760px) {
  .lp-swap { grid-template-columns: 1fr; }
  .lp-arrow { transform: rotate(90deg); text-align: center; }
  .lp-grid { grid-template-columns: 1fr; }
  .lp-hero { padding: 40px 0 34px; }
}

/* One drop zone, used by the roster, submissions and the syllabus. */
.drop {
  border: 2px dashed var(--line); border-radius: 10px;
  padding: 24px; text-align: center; cursor: pointer;
  background: var(--white); transition: background .15s, border-color .15s;
}
.drop:hover, .drop.over { background: rgba(20,58,82,.04); border-color: var(--deep-sea); }
.drop:focus-visible { outline: 2px solid var(--deep-sea); outline-offset: 2px; }

/* The top bar is navy and the global link colour is the same navy, so any
   link placed there renders at 1.00:1 against its own background. That is
   what happened when the account name became a link: present, and invisible.
   Scoped to the bar rather than to that one element, so the next link added
   here cannot repeat it. */
.topbar a { color: #C7D4DC; text-decoration: none; }
.topbar a:hover { color: var(--foam); text-decoration: underline; }
.topbar .topbrand, .topbar .topbrand:hover { color: var(--foam); text-decoration: none; }
