/* Circle One — system fonts only, so every screen still renders offline. */

:root {
  --paper: #EEF2F3;
  --surface: #FFFFFF;
  --surface-2: #F6F8F9;
  --ink: #161F23;
  --ink-2: #3D4E55;
  --muted: #6B7C83;
  --rule: #D2DBDE;
  --accent: #0C7F97;
  --accent-wash: #E2F1F5;
  --ok: #2C7A57;
  --warn: #9A6512;
  --crit: #B23B25;
  --grey: #6B7C83;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0F1518;
    --surface: #182126;
    --surface-2: #1E282D;
    --ink: #E8EFF1;
    --ink-2: #B4C4CA;
    --muted: #8598A0;
    --rule: #2C3A41;
    --accent: #3FC3DE;
    --accent-wash: #12333D;
    --ok: #5DBE90;
    --warn: #D9A441;
    --crit: #E27A62;
    --grey: #8598A0;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------------------------------------------------------------- chrome */

.topbar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 10px 16px; background: var(--surface);
  border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; z-index: 10;
}
.brand {
  font-weight: 700; letter-spacing: -.02em; text-decoration: none; color: var(--ink);
}
.brand span { color: var(--accent); }
.brand.big { font-size: 28px; margin: 0 0 4px; }
.topbar nav { display: flex; gap: 14px; flex: 1; flex-wrap: wrap; }
.topbar nav a { text-decoration: none; color: var(--ink-2); font-size: 15px; }
.topbar nav a:hover { color: var(--accent); }
.linkish {
  background: none; border: 0; color: var(--muted); font: inherit; font-size: 15px;
  cursor: pointer; padding: 0;
}

main { padding-bottom: 64px; }
.wrap { max-width: 720px; margin: 0 auto; padding: 20px 16px; }

.pagehead {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin-bottom: 18px;
}
h1 { font-size: 24px; margin: 0; letter-spacing: -.02em; }
h2 { font-size: 17px; margin: 24px 0 10px; }
.muted { color: var(--muted); font-size: 14px; }
.hint { color: var(--muted); font-size: 13.5px; margin: 4px 0 12px; }
.empty { color: var(--muted); }
.error { color: var(--crit); margin: 0 0 12px; }
.ok { color: var(--ok); margin: 0 0 12px; }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: .9em; }

/* ----------------------------------------------------------------- forms */

.card {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 16px; display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px;
}
.card h2 { margin: 0; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 14px; color: var(--ink-2); }
label.check { flex-direction: row; align-items: center; gap: 9px; }
input[type=text], input[type=email], input[type=password], input[type=date], textarea {
  font: inherit; color: var(--ink); background: var(--surface-2);
  border: 1px solid var(--rule); border-radius: 8px; padding: 11px 12px; width: 100%;
}
textarea { resize: vertical; line-height: 1.6; }
button.primary, .primary.btn {
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; text-align: center;
  background: var(--accent); color: var(--paper);
  border: 0; border-radius: 8px; padding: 12px 18px;
}
@media (prefers-color-scheme: dark) { button.primary, .primary.btn { color: #0F1518; } }

.centered { display: grid; place-items: center; min-height: 100dvh; padding: 20px; }
.login { width: min(380px, 100%); }

.newassignment { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.newassignment .grow, .newassignment button { grid-column: 1 / -1; }

/* ----------------------------------------------------------------- lists */

.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.list li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 12px 14px;
}
.list li > a, .list li > span:first-child {
  text-decoration: none; color: var(--ink); display: flex; flex-direction: column; min-width: 0;
}
.ttl { font-weight: 600; }
.sub { color: var(--muted); font-size: 13px; }
.pill {
  font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap;
  background: var(--surface-2); border: 1px solid var(--rule);
  border-radius: 999px; padding: 3px 10px; font-variant-numeric: tabular-nums;
}
.pill.done { color: var(--ok); border-color: var(--ok); background: transparent; }

.rowactions { display: flex; align-items: center; gap: 10px; flex: none; }
.headactions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.sheetlink {
  font-size: 12.5px; font-weight: 600; text-decoration: none; white-space: nowrap;
  color: var(--accent); border: 1px solid var(--accent);
  border-radius: 999px; padding: 3px 11px;
}

.stats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.stat {
  flex: 1 1 120px; background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: 12px 14px;
}
.stat b { display: block; font-size: 26px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 13px; }
.stat.warn b { color: var(--warn); }

.roster { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 1px;
  background: var(--rule); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.roster li { background: var(--surface); padding: 9px 14px; display: flex; gap: 12px; }
.roster .num { color: var(--muted); min-width: 22px; font-variant-numeric: tabular-nums; }

.cards { display: flex; flex-direction: column; gap: 14px; }
.card.student { gap: 8px; }
.card.student header { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.card.student h2 { margin: 0; font-size: 16px; }
.tally { display: flex; gap: 10px; font-size: 12.5px; }
.card.student ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.card.student li { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.tag {
  font-size: 11px; font-weight: 700; color: #fff; width: 20px; height: 20px;
  border-radius: 50%; display: grid; place-items: center; flex: none;
}

.mC, .tag.mC { background: var(--ok); }
.mI, .tag.mI { background: var(--warn); }
.mM, .tag.mM { background: var(--crit); }
.mA, .tag.mA { background: var(--grey); }
b.mM, b.mI { background: none; color: var(--crit); }
b.mI { color: var(--warn); }

/* --------------------------------------------------------------- capture */

.capture { max-width: 720px; margin: 0 auto; padding: 0 12px 40px; }
.capturehead {
  position: sticky; top: 49px; z-index: 5;
  background: var(--paper); padding: 14px 4px 10px;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  border-bottom: 1px solid var(--rule); margin-bottom: 10px;
}
.capturehead h1 { font-size: 19px; }
.capturehead .sub { display: block; margin-top: 2px; }
.status {
  font-size: 12px; font-weight: 600; white-space: nowrap;
  border-radius: 999px; padding: 4px 11px; border: 1px solid var(--rule); color: var(--muted);
}
.status.saved { color: var(--ok); border-color: var(--ok); }
.status.pending { color: var(--muted); }
.status.offline { color: var(--warn); border-color: var(--warn); }

.marklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.markrow {
  display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: 7px 10px;
}
.markrow .num { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.markrow .name { font-size: 15px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.marks { display: flex; gap: 6px; }
.mark {
  width: 44px; height: 44px; border-radius: 10px; cursor: pointer;
  font: inherit; font-weight: 700; font-size: 15px;
  background: var(--surface-2); color: var(--muted); border: 1.5px solid var(--rule);
  -webkit-tap-highlight-color: transparent;
}
.mark.on { color: #fff; border-color: transparent; }
.mark.mC.on { background: var(--ok); }
.mark.mI.on { background: var(--warn); }
.mark.mM.on { background: var(--crit); }
.mark.mA.on { background: var(--grey); }

.legend { color: var(--muted); font-size: 13px; margin-top: 18px; text-align: center; }

@media (max-width: 420px) {
  .mark { width: 42px; height: 44px; }
  .markrow { gap: 7px; padding: 6px 8px; }
  .newassignment { grid-template-columns: 1fr; }
}
