/* Shared look for every signed-in screen (admin desk, teacher and parent app, sign-in, invite): tokens,
   type, buttons, fields, rows, chips, states, colours per person, the toast. Layout lives in desk.css and app.css.
   Warm paper underneath, white rounded panels on top, soft shadows. Gold only marks what waits on the person. */
@font-face { font-family: "Alegreya"; src: url(../fonts/alegreya-500.woff2) format("woff2"); font-weight: 400 500; font-display: swap; }
@font-face { font-family: "Alegreya"; src: url(../fonts/alegreya-700.woff2) format("woff2"); font-weight: 600 700; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url(../fonts/alegreya-sans-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url(../fonts/alegreya-sans-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url(../fonts/alegreya-sans-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --ink: #0F2A33; --ink-2: #153842; --paper: #FBF8F1; --cream: #F1E9D8; --line: #E4DAC6;
  --text: #17333A; --soft: #5B6B68; --gold: #C9A24E; --gold-ink: #7A5C14;
  --green: #1B6B45; --lapis: #2A5F8F; --madder: #A8452F;
  --r: .75rem; --ease: cubic-bezier(.16, 1, .3, 1);
  --lift: 0 1px 2px rgb(15 42 51 / .05), 0 .75rem 2rem -1rem rgb(15 42 51 / .18);
  --hue: var(--ink);
  font: 500 1.0625rem/1.5 "Alegreya Sans", system-ui, "Segoe UI", sans-serif;
  color: var(--text); background: var(--paper);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100dvh; }
h1, h2, h3, h4, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--lapis); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 2px; }
.skip { position: absolute; left: -99rem; } .skip:focus { left: 1rem; top: 1rem; z-index: 9; background: #fff; padding: .5rem 1rem; }

/* headings and text */
.head { margin-bottom: 1.5rem; }
.head h1 { font: 500 2.25rem/1.15 "Alegreya", Georgia, serif; color: var(--ink); }
.head p, .fine, .empty { color: var(--soft); }
.fine { font-size: .95rem; }
.empty { padding: 1rem 0; }
.group > .empty { padding: 1rem 1.25rem; border: 1px dashed #D8CCB4; border-radius: 1.1rem; }
.warn-note { margin: -1.5rem 0 2.25rem .25rem; color: var(--gold-ink); }
.failed { display: grid; justify-items: start; gap: .75rem; padding: 1.1rem 1.25rem; border-radius: 1.1rem; background: #F8E6E0; color: var(--madder); font-weight: 500; }
.loading { animation: breathe 1.4s ease-in-out infinite alternate; }
@keyframes breathe { from { opacity: .45; } }
p.good, p.bad { font-weight: 700; } p.good { color: var(--green); } p.bad { color: var(--madder); }

/* groups of rows */
.group { margin-bottom: 2.25rem; }
.group h2 { font-size: 1.05rem; font-weight: 700; display: flex; align-items: center; gap: .5rem; padding: 0 .25rem .6rem; }
.group h2 b { font-size: .85rem; min-width: 1.5rem; text-align: center; padding: .05rem .4rem; border-radius: 1rem; background: var(--cream); color: var(--ink); font-variant-numeric: tabular-nums; }
.rows { background: #fff; border: 1px solid var(--line); border-radius: 1.1rem; padding: 0 1.1rem; box-shadow: var(--lift); }
.rows > li { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.rows > li:last-child { border-bottom: 0; }
.rows > li:has(> .empty) { padding: 0; }
.what { flex: 1 1 16rem; min-width: 0; display: grid; }
.what strong { font-weight: 700; }
.what span { color: var(--soft); }
.do { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.state { font-size: .95rem; padding: .15rem .6rem; border-radius: 1rem; background: var(--cream); color: var(--text); }
.state.good { background: #E3F0E7; color: var(--green); }
.state.warn { background: #F6E8C4; color: var(--gold-ink); }
.state.bad { background: #F5DDD6; color: var(--madder); }
.state.quiet { color: var(--soft); }

/* controls */
button, .btn, input, select, textarea { font: inherit; color: inherit; }
button, .btn { min-height: 2.75rem; padding: 0 1.1rem; border-radius: var(--r); border: 1px solid var(--line); background: #fff; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; transition: background .15s, transform .1s; }
button:hover, .btn:hover { background: var(--cream); }
button:active { transform: translateY(1px); }
.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.primary:hover { background: var(--ink-2); }
button:disabled { opacity: .55; cursor: progress; }
.danger { color: var(--madder); border-color: color-mix(in oklch, var(--madder) 35%, transparent); }
.danger:hover { background: #F8E6E0; }
button.danger:is(.ask.asking *) { background: var(--madder); border-color: var(--madder); color: #fff; }
/* a step that is hard to undo asks in place: the question, then go ahead or not now */
.ask { display: contents; }
.ask.asking { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .6rem; flex-basis: 100%; padding: .6rem .7rem .6rem 1rem; border-radius: var(--r); background: #FBF5E6; }
.ask.asking > span { flex: 1 1 14rem; font-weight: 500; }
.x { min-height: 2.25rem; padding: 0 .7rem; font-weight: 500; color: var(--soft); }
input:not([type=checkbox], [type=radio]), select, textarea { min-height: 2.75rem; padding: .35rem .7rem; border: 1px solid #CFC3AB; border-radius: var(--r); background: #fff; max-width: 100%; }
input[type=search] { flex: 1 1 16rem; }
input[type=number] { width: 5rem; }
textarea { width: 100%; resize: vertical; line-height: 1.45; }
input[type=checkbox], input[type=radio] { width: 1.15rem; height: 1.15rem; accent-color: var(--ink); }
label { display: grid; gap: .25rem; font-weight: 700; }
.line { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; font-weight: 500; }
.line small { color: var(--soft); }
.stack { display: grid; gap: .85rem; }
.pair { display: grid; gap: .85rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
fieldset { border: 1px solid var(--line); border-radius: var(--r); padding: .85rem; margin: 0; display: grid; gap: .6rem; }
legend { padding: 0 .35rem; font-weight: 700; }

/* one of a few: rows for people, chips for short lists */
.choices { display: grid; gap: .4rem; }
.choices label, .chips label { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .6rem; font-weight: 500; border: 1px solid var(--line); border-radius: var(--r); padding: .55rem .8rem; background: #fff; cursor: pointer; }
.choices label span { flex: 1 0 auto; font-weight: 700; }
.choices label small { margin-left: auto; } /* on a narrow screen the hint drops under the name instead of squeezing it */
.choices small { color: var(--soft); } .choices small.good { color: var(--green); } .choices small.warn { color: var(--gold-ink); } .choices small.bad { color: var(--madder); }
.choices label:has(:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: #F4F8F6; }
.chips label { transition: background-color .2s var(--ease), color .2s, border-color .2s; }
.chips label:has(:checked) { background: var(--ink); border-color: var(--ink); color: #fff; }
.field { display: grid; gap: .4rem; align-content: start; }
/* a small green pill for "add one more" */
.add-pill { justify-self: start; min-height: 2.25rem; padding: 0 .9rem; border-radius: 2rem; font-size: .92rem; color: var(--green); border-color: color-mix(in oklch, var(--green) 30%, transparent); }
.add-pill:hover { background: #EAF3EE; }
.lab { font-weight: 700; }
.choices label.off { opacity: .55; cursor: not-allowed; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chips label { padding: .35rem .8rem; border-radius: 2rem; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips label:has(:focus-visible) { outline: 3px solid var(--gold); outline-offset: 2px; }
.chips > button { min-height: 2.25rem; border-radius: 2rem; font-weight: 500; padding: 0 .9rem; }
.chips > button[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* one colour per person (kit.js hue()): a dot before their name, a tint behind their calendar block */
.hue-lapis { --hue: #2A5F8F; } .hue-green { --hue: #1B6B45; } .hue-madder { --hue: #A8452F; } .hue-gold { --hue: #8A6A1C; } .hue-sky { --hue: #3B6E7A; } .hue-leather { --hue: #6E4A2E; }
.who::before { content: ""; display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; background: var(--hue); margin-right: .5rem; vertical-align: .08em; }

/* initials badge: a person's colour, white letters */
.avatar { flex: none; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--hue); color: #fff; font: 700 .85rem/1 "Alegreya Sans", sans-serif; letter-spacing: .02em; }
.rows > li:has(> .avatar) { flex-wrap: nowrap; } .rows > li:has(> .avatar) .what { flex: 1; }
@media (max-width: 40rem) { .rows > li:has(> .avatar) { flex-wrap: wrap; } .rows > li:has(> .avatar) .do { width: 100%; padding-left: 3.4rem; } }

/* the next two weeks: a row of days that scrolls sideways on a phone */
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(3.4rem, 1fr); gap: .4rem; overflow-x: auto; margin: 0 -1rem 1.75rem; padding: .25rem 1rem .75rem; scroll-snap-type: x mandatory; scroll-padding-inline: 1rem; scrollbar-width: none; }
.strip > div { scroll-snap-align: start; }
.sday { width: 100%; min-height: 4.6rem; padding: .5rem .2rem; display: grid; justify-items: center; align-content: start; gap: .15rem; border-radius: 1rem; background: #fff; border: 1px solid var(--line); box-shadow: var(--lift); font-weight: 500; }
.sday small { font-size: .78rem; color: var(--soft); }
.sday b { font: 500 1.3rem/1.1 "Alegreya", Georgia, serif; color: var(--ink); }
.sday:disabled { opacity: 1; cursor: default; background: transparent; border-color: transparent; box-shadow: none; } .sday:disabled b { color: var(--soft); }
.sday.today, .sday.today:disabled { background: var(--ink); border-color: var(--ink); } .sday.today small { color: var(--gold); } .sday.today b { color: #fff; }
.sday:not(:disabled):hover { background: var(--cream); } .sday.today:not(:disabled):hover { background: var(--ink-2); }
.dots { display: flex; gap: .2rem; min-height: .45rem; }
.dots i { width: .45rem; height: .45rem; border-radius: 50%; background: var(--hue); }
.sday.today .dots i { box-shadow: 0 0 0 1.5px #fff; }

/* the message at the bottom */
#toast { position: fixed; left: 50%; bottom: 1.5rem; translate: -50% 0; z-index: 99; width: max-content; max-width: min(36rem, calc(100vw - 2rem)); background: var(--ink); color: #fff; padding: .85rem 1.3rem; border-radius: 1rem; box-shadow: 0 .5rem 1.5rem rgb(15 42 51 / .3); animation: rise .25s var(--ease); }
#toast.bad { background: var(--madder); cursor: pointer; }
@keyframes rise { from { transform: translateY(.75rem); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
