/* Obi — kids belts
 *
 * The belt is the one bold element: drawn like the real thing, with the black
 * rank tip and white tape stripes. Everything around it stays quiet: cool
 * mat-canvas paper, navy ink, and one tatami blue for actions.
 */

@font-face { font-family: "Poppins"; font-weight: 500; font-display: swap; src: url("fonts/poppins-latin-500-normal.a09f2fccfee3.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-display: swap; src: url("fonts/poppins-latin-600-normal.72993dddf88a.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-weight: 400; font-display: swap; src: url("fonts/public-sans-latin-400-normal.60715978fab2.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-weight: 600; font-display: swap; src: url("fonts/public-sans-latin-600-normal.6b1fe1f62892.woff2") format("woff2"); }

:root {
  --paper: #F4F6F5;      /* canvas */
  --surface: #FFFFFF;
  --ink: #1B2533;        /* navy ink */
  --ink-soft: #566170;
  --rule: #D7DCDF;
  --mat: #24508F;        /* tatami blue, actions */
  --mat-dark: #1A3B6B;
  --ok: #2E7048;
  --soon: #9A6408;
  --late: #B42318;
  --tip: #000000;

  --display: "Poppins", system-ui, sans-serif;
  --text: "Public Sans", system-ui, sans-serif;

  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.75rem;
  --step-3: 2.25rem;

  --radius: 6px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--step-0)/1.5 var(--text);
  font-variant-numeric: tabular-nums;
}
a { color: var(--mat); text-underline-offset: 0.15em; }
a:hover { color: var(--mat-dark); }
:focus-visible { outline: 3px solid var(--mat); outline-offset: 2px; border-radius: 2px; }

h1, h2 { font-family: var(--display); font-weight: 600; line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-1); margin: 2.5rem 0 1rem; }

.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: absolute; top: .5rem; left: .5rem; background: var(--surface); padding: .5rem 1rem; z-index: 10; }

/* Top bar */
.top {
  display: flex; align-items: center; gap: 2rem;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
  background: var(--ink); color: #fff;
  min-height: 3.5rem;
}
.brand { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; }
.brand__mark { display: block; height: 22px; width: auto; }
.brand:hover { color: #fff; }
.brand__name { font: 600 var(--step-0)/1 var(--display); }
.brand__app { font-size: var(--step--1); opacity: .7; }
.nav { display: flex; gap: .25rem; flex: 1; overflow-x: auto; }
.nav a {
  color: #fff; text-decoration: none; padding: 1rem .75rem; white-space: nowrap;
  border-bottom: 3px solid transparent; opacity: .8;
}
.nav a:hover { opacity: 1; color: #fff; }
.nav a[aria-current="page"] { opacity: 1; border-bottom-color: #fff; font-weight: 600; }

/* Group picker, phones only */
.nav__picker { display: none; position: relative; }
.nav__picker summary {
  list-style: none; cursor: pointer; color: #fff; opacity: .8; white-space: nowrap;
  padding: .6rem .6rem .75rem; border-bottom: 3px solid transparent;
}
.nav__picker summary::-webkit-details-marker { display: none; }
.nav__picker summary::after { content: ""; display: inline-block; margin-left: .4rem; border: 5px solid transparent; border-top-color: currentColor; transform: translateY(2px); }
.nav__picker[open] summary::after { transform: translateY(-3px) rotate(180deg); }
.nav__picker summary[aria-current="page"] { opacity: 1; font-weight: 600; border-bottom-color: #fff; }
.nav__menu {
  position: absolute; left: 0; top: 100%; z-index: 6; min-width: 11rem;
  display: grid; padding: .4rem; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
}
.nav .nav__menu a { color: var(--ink); opacity: 1; padding: .7rem .8rem; border: 0; border-radius: 4px; }
.nav .nav__menu a:hover { background: var(--paper); color: var(--ink); }
.nav .nav__menu a[aria-current="true"] { font-weight: 600; background: var(--paper); }
.nav .nav__menu a[aria-current="true"]::after { content: "✓"; float: right; color: var(--mat); }
.account { position: relative; }
.account summary { cursor: pointer; list-style: none; padding: .5rem 0; opacity: .85; }
.account summary::after { content: ""; display: inline-block; margin-left: .45rem; border: 5px solid transparent; border-top-color: currentColor; transform: translateY(2px); }
.account summary::-webkit-details-marker { display: none; }
.account__menu {
  position: absolute; right: 0; top: 100%; z-index: 5; min-width: 13rem;
  background: var(--surface); color: var(--ink); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: .5rem; display: grid;
}
.account__menu a, .account__menu button {
  display: block; padding: .5rem .75rem; text-align: left; font: inherit; color: var(--ink);
  background: none; border: 0; text-decoration: none; cursor: pointer; border-radius: 4px; width: 100%;
}
.account__menu a:hover, .account__menu button:hover { background: var(--paper); }
.account__narrow { display: none !important; }
.account__lang {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  margin: .25rem 0; padding: .5rem .75rem; border-block: 1px solid var(--rule); color: var(--ink-soft);
}
.account__menu .account__langs { display: inline-flex; padding: 2px; border: 1px solid var(--rule); border-radius: var(--radius); }
.account__menu .account__langs button { width: auto; padding: .2rem .6rem; font-size: var(--step--1); }
.account__menu .account__langs button[aria-pressed="true"] { background: var(--ink); color: #fff; font-weight: 600; }

/* Page */
.page { max-width: 72rem; margin: 0 auto; padding: 2rem clamp(1rem, 4vw, 2.5rem) 4rem; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.head__actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.lede { margin: .35rem 0 0; color: var(--ink-soft); }
.crumb { margin: 0 0 .5rem; font-size: var(--step--1); }

/* Buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 2.75rem; padding: 0 1.1rem;
  background: var(--mat); color: #fff; border: 1px solid var(--mat); border-radius: var(--radius);
  font: 600 var(--step-0)/1 var(--text); text-decoration: none; cursor: pointer;
}
.button:hover { background: var(--mat-dark); border-color: var(--mat-dark); color: #fff; }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button--quiet { background: var(--surface); color: var(--mat); border-color: var(--rule); }
.button--quiet:hover { background: var(--paper); color: var(--mat-dark); border-color: var(--mat); }
.button--small { min-height: 2.25rem; padding: 0 .8rem; font-size: var(--step--1); background: var(--surface); color: var(--mat); border-color: var(--rule); }
.button--small:hover { background: var(--mat); color: #fff; }
.link { background: none; border: 0; padding: .5rem 0; color: var(--mat); text-decoration: underline; font: inherit; cursor: pointer; }

/* Filters: segmented radios */
.filters { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: var(--radius); padding: 2px; margin: 0; background: var(--surface); }
.seg label { position: relative; padding: .45rem .85rem; border-radius: 4px; cursor: pointer; font-size: var(--step--1); color: var(--ink-soft); }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg label:has(input:checked) { background: var(--ink); color: #fff; font-weight: 600; }
.seg label:has(input:focus-visible) { outline: 3px solid var(--mat); outline-offset: 1px; }

.grading-note { margin: 0 0 1rem; padding: .75rem 1rem; border-left: 4px solid var(--mat); background: var(--surface); }

/* The belt */
.belt {
  --h: 1.1rem;
  --w: 8.5rem;
  position: relative; display: inline-flex; flex: none;
  width: var(--w); height: var(--h);
  border-radius: 2px;
  vertical-align: middle;
  box-shadow: 0 0 0 1px rgb(27 37 51 / .18);
}
.belt__cloth {
  flex: 1; border-radius: 2px 0 0 2px;
  background:
    repeating-linear-gradient(90deg, rgb(255 255 255 / .08) 0 1px, transparent 1px 4px),
    var(--belt);
}
.belt--bar-white .belt__cloth, .belt--bar-black .belt__cloth {
  background:
    linear-gradient(var(--belt) 0 33%, var(--bar) 33% 67%, var(--belt) 67%),
    var(--belt);
}
.belt--bar-white { --bar: #FFFFFF; }
.belt--bar-black { --bar: var(--tip); }
.belt__tip {
  display: flex; align-items: stretch; justify-content: flex-end; gap: 3px;
  width: 38%; padding: 0 6px;
  background: var(--tip); border-radius: 0 2px 2px 0;
}
.belt__stripe, .belt__slot { width: 4px; }
.belt__stripe { background: #FFFFFF; }
.belt--sm { --h: .8rem; --w: 5.5rem; }
.belt--sm .belt__tip { padding: 0 4px; gap: 2px; }
.belt--sm .belt__stripe, .belt--sm .belt__slot { width: 3px; }
.belt--lg { --h: 2.25rem; --w: min(26rem, 100%); }
.belt--lg .belt__tip { gap: 7px; padding: 0 12px; }
.belt--lg .belt__stripe, .belt--lg .belt__slot { width: 8px; }

.belt-name { margin-left: .6rem; color: var(--ink-soft); font-size: var(--step--1); }

/* Stripe check */
.check { display: inline-flex; align-items: center; gap: .4rem; font-size: var(--step--1); font-weight: 600; white-space: nowrap; }
.check::before { content: ""; width: .6rem; height: .6rem; border-radius: 50%; background: currentColor; }
.check--on_track { color: var(--ok); }
.check--check_soon { color: var(--soon); }
.check--overdue { color: var(--late); }
.check--overdue::before { border-radius: 1px; transform: rotate(45deg); }

/* Roster table */
.roster { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
.roster th, .roster td { padding: .7rem 1rem; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--rule); }
.roster thead th { font: 600 var(--step--1)/1.3 var(--text); color: var(--ink-soft); background: var(--paper); }
.roster tbody tr:last-child > * { border-bottom: 0; }
.roster tbody tr:hover { background: #FAFBFB; }
.roster__name { font-weight: 600; }
.roster__name a { color: var(--ink); text-decoration: none; }
.roster__name a:hover { color: var(--mat); text-decoration: underline; }
.age, .by { margin-left: .5rem; font-weight: 400; color: var(--ink-soft); font-size: var(--step--1); }
.roster__belt { white-space: nowrap; }
.num { white-space: nowrap; }
.is-inactive { color: var(--ink-soft); }
.is-inactive .belt { opacity: .5; }

.proposal { display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; font-size: var(--step--1); }
.proposal--proposed, .proposal-state.proposal--proposed { color: var(--soon); }
.proposal--approved { color: var(--ok); }
.proposal--rejected { color: var(--ink-soft); }
.note, .warning { display: block; font-size: var(--step--1); margin-top: .25rem; }
.note { color: var(--ink-soft); }
.warning { color: var(--late); }

.decide { display: inline-flex; border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.decide__btn { background: var(--surface); border: 0; padding: .5rem .8rem; font: inherit; font-size: var(--step--1); cursor: pointer; color: var(--ink); min-height: 2.5rem; }
.decide__btn + .decide__btn { border-left: 1px solid var(--rule); }
.decide__btn:hover { background: var(--paper); }
.decide__btn[value="approved"][aria-pressed="true"] { background: var(--ok); color: #fff; font-weight: 600; }
.decide__btn[value="rejected"][aria-pressed="true"] { background: var(--ink-soft); color: #fff; font-weight: 600; }

/* Grading tables line up across groups */
.roster--grading { table-layout: fixed; }
.roster--grading th:nth-child(1) { width: 30%; }
.roster--grading th:nth-child(2) { width: 14%; }
.roster--grading th:nth-child(4) { width: 13rem; }

/* Student page */
.rank { display: grid; gap: 1rem; padding: 1.5rem; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
.rank__name { font: 600 var(--step-2)/1.2 var(--display); margin: 0; }
.rank__text p { margin: .25rem 0 0; }
.panel { margin-top: 2rem; padding: 1.25rem 1.5rem; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
.panel h2 { margin-top: 0; }
.proposal-state { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }

.history { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--rule); }
.history li { display: grid; grid-template-columns: 7rem auto 1fr; gap: 1rem; align-items: center; padding: .6rem 0 .6rem 1rem; position: relative; }
.history li::before { content: ""; position: absolute; left: -6px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--ink); }
.history time { color: var(--ink-soft); font-size: var(--step--1); }
.notes { max-width: 65ch; }

/* Forms */
.form { max-width: 34rem; display: grid; gap: 1.1rem; }
.form--inline { max-width: none; display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem 1rem; }
.form--inline label { display: grid; gap: .3rem; font-size: var(--step--1); font-weight: 600; }
.form--inline .grow { flex: 1 1 16rem; }
.field { display: grid; gap: .35rem; }
.field label { font-weight: 600; }
.optional { font-weight: 400; color: var(--ink-soft); font-size: var(--step--1); }
input[type="text"], input[type="password"], input[type="date"], select, textarea {
  width: 100%; min-height: 2.75rem; padding: .55rem .75rem;
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid #B9C0C6; border-radius: var(--radius);
}
textarea { min-height: 5rem; }
.field--error input, .field--error select { border-color: var(--late); }
.help { margin: 0; font-size: var(--step--1); color: var(--ink-soft); }
.error, .errorlist { margin: 0; color: var(--late); font-size: var(--step--1); }
.errorlist { list-style: none; padding: 0; }
.actions { display: flex; align-items: center; gap: 1.25rem; }

.messages { margin-bottom: 1.5rem; display: grid; gap: .5rem; }

/* The public demo */
.demo-bar { margin: 0; padding: .45rem clamp(1rem, 4vw, 2.5rem); background: #F2C230; color: var(--ink); font-size: var(--step--1); font-weight: 600; text-align: center; }
.demo-logins { margin-top: 1.25rem; padding: .85rem 1rem; background: #FDF6DE; border-radius: var(--radius); font-size: var(--step--1); }
.demo-logins p, .demo-logins ul { margin: 0; }
.demo-logins ul { margin: .35rem 0; padding-left: 1.1rem; }
.message { margin: 0; padding: .75rem 1rem; border-radius: var(--radius); background: var(--surface); border-left: 4px solid var(--ok); }
.message--error { border-left-color: var(--late); }

.empty { padding: 2.5rem 1.5rem; text-align: center; background: var(--surface); border: 1px dashed var(--rule); border-radius: var(--radius); }
.empty p { margin: 0 0 1rem; }

.gradings { list-style: none; padding: 0; margin: 0 0 2rem; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
.gradings li { display: flex; justify-content: space-between; gap: 1rem; padding: .9rem 1rem; border-bottom: 1px solid var(--rule); }
.gradings li:last-child { border-bottom: 0; }
.gradings a { font-weight: 600; }
.gradings span { color: var(--ink-soft); }

/* Login: a belt laid across the top of the card */
.login { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login__card { width: min(24rem, 100%); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 2rem; position: relative; overflow: hidden; }
.login__card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 10px; background: linear-gradient(90deg, #F3F1EC 0 18%, #8D9095 18% 36%, #F2C230 36% 54%, #EA7C24 54% 72%, #3A8F4C 72% 90%, #000 90%); }
.login__brand { display: grid; justify-items: center; gap: .75rem; margin: .75rem 0 1.75rem; }
.login__brand img { width: 120px; height: 120px; }
.login__brand h1 { font-size: var(--step-1); color: var(--ink-soft); font-weight: 500; }
.login .button { width: 100%; }
.login .help { margin-top: 1.25rem; }

/* Phones: the table becomes a list of belts */
@media (max-width: 46rem) {
  .top { flex-wrap: wrap; gap: 0 1rem; padding-top: .5rem; }
  .nav { order: 3; flex-basis: 100%; overflow: visible; justify-content: space-between; }
  .nav__group { display: none; }
  .nav__picker { display: block; }
  .nav__wide { display: none; }
  .account__narrow { display: block !important; }
  .brand__app { display: none; }
  .account { margin-left: auto; }
  .nav a { padding: .6rem .6rem .75rem; }
  h1 { font-size: var(--step-2); }
  .roster, .roster tbody, .roster tr, .roster th, .roster td { display: block; }
  .roster thead { display: none; }
  .roster tr { padding: .9rem 1rem; border-bottom: 1px solid var(--rule); }
  .roster th, .roster td { padding: .2rem 0; border: 0; }
  .roster td[data-label] { display: flex; justify-content: space-between; gap: 1rem; font-size: var(--step--1); }
  .roster td[data-label]::before { content: attr(data-label); color: var(--ink-soft); }
  .roster__belt { padding: .5rem 0 !important; }
  .roster--grading, .roster--grading th { width: auto !important; }
  .history li { grid-template-columns: 1fr; gap: .3rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
.page > h1 { margin-bottom: 1.5rem; }

/* Quick proposals: one more stripe, two more, or the next belt */
.steps { display: inline-flex; border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.steps__btn { min-width: 3rem; min-height: 2.5rem; padding: 0 .7rem; border: 0; background: none; font: 600 var(--step--1)/1 var(--text); color: var(--mat); cursor: pointer; }
.steps__btn + .steps__btn { border-left: 1px solid var(--rule); }
.steps__btn:hover:not(:disabled) { background: var(--mat); color: #fff; }
.steps__btn:disabled { color: #A9B0B7; cursor: not-allowed; }

.count { display: inline-block; min-width: 1.4em; padding: 0 .35em; border-radius: 1em; background: #fff; color: var(--ink); font-size: var(--step--1); font-weight: 600; text-align: center; line-height: 1.4; }

.roster--proposals { table-layout: fixed; }
.roster--proposals th:nth-child(1) { width: 26%; }
.roster--proposals th:nth-child(2) { width: 18%; }
.roster--proposals th:nth-child(4) { width: 22rem; }
.roster--proposals .by { display: block; margin: .15rem 0 0; }
.decide-row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.decide-row input[type="date"] { width: auto; min-height: 2.5rem; padding: .3rem .5rem; }

.decided { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.decided li { display: flex; align-items: center; gap: .75rem; }

@media (max-width: 46rem) {
  .roster--proposals, .roster--proposals th { width: auto !important; }
  .roster td.roster__proposal { justify-content: space-between; align-items: center; }
}
.roster__name a { white-space: nowrap; }
.roster--proposals .belt-name { display: block; margin: .3rem 0 0; }
.roster--proposals th:nth-child(1) { width: 22%; }
.roster--proposals th:nth-child(2) { width: 15%; }
.roster--proposals th:nth-child(4) { width: 24rem; }
.decide__btn { white-space: nowrap; }
@media (min-width: 46.01rem) { .decide-row { flex-wrap: nowrap; } }

/* Location tags: three colours that take turns */
.tag { display: inline-block; margin-left: .5rem; padding: .05rem .45rem; border-radius: 3px; font: 600 .75rem/1.4 var(--text); vertical-align: 1px; }
.tag--loc1 { background: #E3EAF5; color: var(--mat-dark); }
.tag--loc2 { background: #E4F0E7; color: #24593A; }
.tag--loc3 { background: #F5ECDD; color: #6E4A0E; }

.locations__pick { text-align: center; }
.locations__pick label { display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; cursor: pointer; }
.locations__pick input { width: 1.2rem; height: 1.2rem; accent-color: var(--mat); }
.actions--sticky { position: sticky; bottom: 0; padding: 1rem 0; background: var(--paper); }
@media (max-width: 46rem) {
  .locations .roster thead { display: table-header-group; }
  .locations .roster { display: table; width: 100%; table-layout: fixed; }
  .locations .roster tbody { display: table-row-group; }
  .locations .roster thead th:not(:first-child) { width: 3.25rem; text-align: center; }
  .locations__pick label { width: 2.5rem; height: 2.5rem; }
  .locations .roster tr { display: table-row; padding: 0; }
  .locations .roster th, .locations .roster td { display: table-cell; padding: .4rem .5rem; border-bottom: 1px solid var(--rule); }
}

/* Activity log */
.filters--selects { gap: .75rem 1.25rem; }
.filters--selects label { display: grid; gap: .25rem; font-size: var(--step--1); font-weight: 600; color: var(--ink-soft); }
.filters--selects select { width: auto; min-width: 11rem; min-height: 2.5rem; }
.log { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
.log__item { display: grid; grid-template-columns: 9.5rem 1fr; gap: 1rem; padding: .8rem 1rem; border-bottom: 1px solid var(--rule); }
.log__item:last-child { border-bottom: 0; }
.log__item time { color: var(--ink-soft); font-size: var(--step--1); padding-top: .1rem; }
.log__line, .log__summary { margin: 0; }
.log__summary { color: var(--ink); }
.log__item--promoted .log__summary { color: var(--ok); font-weight: 600; }
.log__item--declined .log__summary, .log__item--withdrawn .log__summary { color: var(--ink-soft); }
.log__item--deleted .log__summary { color: var(--late); }
.log__changes { margin: .4rem 0 0; display: grid; gap: .2rem; font-size: var(--step--1); }
.log__changes div { display: flex; gap: .5rem; flex-wrap: wrap; }
.log__changes dt { color: var(--ink-soft); min-width: 7rem; }
.log__changes dd { margin: 0; }
.log__changes del { color: var(--ink-soft); }
.log__changes ins { text-decoration: none; font-weight: 600; }
.pager { display: flex; gap: 1.25rem; align-items: center; justify-content: center; margin-top: 1.25rem; }
@media (max-width: 46rem) {
  .log__item { grid-template-columns: 1fr; gap: .2rem; }
  .filters--selects label, .filters--selects select { width: 100%; }
}
