/* Elocution: a sticker book. Chunky ink outlines, hard offset shadows, and one bright colour per section
   so you always know where you are: attendance mint, pieces pink, notes sunshine, questions sky, fees coral,
   students violet, batches teal. Bricolage Grotesque shouts the headings; Literata is for reading poems aloud. */
:root {
  --ink: #1d1a33;
  --muted: #5f5b78;
  --paper: #f4f1ff;
  --surface: #ffffff;
  --line: #1d1a33;
  --soft-line: #e3def5;
  --violet: #7b4dff;
  --pink: #ff4f9a;
  --sun: #ffc22e;
  --mint: #19c093;
  --sky: #2f95ff;
  --coral: #ff6a3d;
  --teal: #10b6c4;
  --present: #0f9e72;
  --late: #e0900b;
  --absent: #ef4444;
  --excused: #6d7bb0;
  --sec: var(--violet);
  --shadow: 4px 4px 0 var(--ink);
  --shadow-sm: 2px 2px 0 var(--ink);
  --radius: 16px;
  --display: 'Bricolage Grotesque', 'Figtree', system-ui, sans-serif;
  --serif: 'Literata', Georgia, serif;
  --sans: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
[data-sec=home], [data-sec=students], [data-sec=account] { --sec: var(--violet); --sec-soft: #ece5ff; }
[data-sec=today], [data-sec=attendance] { --sec: var(--mint); --sec-soft: #dcf7ee; }
[data-sec=pieces], [data-sec=library] { --sec: var(--pink); --sec-soft: #ffe3ef; }
[data-sec=notes] { --sec: var(--sun); --sec-soft: #fff3cf; }
[data-sec=ask], [data-sec=questions] { --sec: var(--sky); --sec-soft: #dfeeff; }
[data-sec=fees] { --sec: var(--coral); --sec-soft: #ffe6dc; }
[data-sec=batches] { --sec: var(--teal); --sec-soft: #d9f6f8; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 var(--sans); }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.1; margin: 0 0 .5em; letter-spacing: -.02em; }
h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; margin-top: 1.2em; }
p { margin: 0 0 .6em; }
a { color: var(--ink); text-decoration-color: var(--sec); text-decoration-thickness: 2px; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.pad { padding: 1rem 0; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: .5rem; z-index: 50; background: var(--surface); padding: .4rem .8rem; }
.ico { display: inline-flex; width: 1.3em; height: 1.3em; flex: none; }
.ico svg { width: 100%; height: 100%; }

/* ---------- sign-in: the word itself, syllable by syllable ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; align-items: center; gap: 3.5rem; max-width: 1120px; margin: 0 auto; padding: 3rem 1.5rem; position: relative; }
.syllables { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; margin: 1.5rem 0 1rem; }
.syl { font-family: var(--display); font-weight: 800; font-size: clamp(2.6rem, 8vw, 5.2rem); line-height: 1; padding: .12em .26em .16em; border: 3px solid var(--ink); border-radius: 18px; box-shadow: var(--shadow); background: var(--c); color: var(--ink); transform: rotate(var(--r)); animation: pop .5s cubic-bezier(.3,1.6,.5,1) backwards; animation-delay: var(--d); }
.syl.stress { position: relative; font-size: clamp(3.1rem, 9.5vw, 6.2rem); color: #fff; }
.syl.stress::after { content: 'say it loud!'; position: absolute; top: -2.1rem; left: 50%; transform: translateX(-50%) rotate(-4deg); font: 700 .85rem var(--sans); background: var(--ink); color: #fff; padding: .2rem .6rem; border-radius: 99px; white-space: nowrap; }
@keyframes pop { from { transform: scale(.3) rotate(0); opacity: 0; } }
.pron { font-size: 1.3rem; color: var(--muted); margin: 0 0 1.2rem; font-family: var(--serif); }
.pron b { color: var(--pink); }
.bubble { position: relative; background: var(--surface); border: 3px solid var(--ink); border-radius: 22px; box-shadow: var(--shadow); padding: 1.1rem 1.3rem; max-width: 30rem; }
.bubble::before { content: ''; position: absolute; left: 2.2rem; top: -15px; width: 24px; height: 24px; background: var(--surface); border-left: 3px solid var(--ink); border-top: 3px solid var(--ink); transform: rotate(45deg); }
.bubble p { margin: 0 0 .4em; font-size: 1.05rem; }
.bubble p:last-child { margin: 0; }
.bubble .pos { font-family: var(--serif); font-style: italic; color: var(--violet); }
.login-form { background: var(--surface); border: 3px solid var(--ink); border-radius: 24px; box-shadow: 8px 8px 0 var(--ink); padding: 2rem; display: flex; flex-direction: column; gap: 1rem; position: relative; }
.login-form h2 { font-size: 1.9rem; margin: 0; }
.login-form .tagline { margin: -.6rem 0 .2rem; color: var(--muted); }
.who-chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.who-chips span { font-size: .8rem; font-weight: 700; border: 2px solid var(--ink); border-radius: 99px; padding: .15rem .6rem; background: var(--c); }
.form-error { color: var(--absent); margin: 0; min-height: 1.2em; font-size: .92rem; font-weight: 600; }
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: -1; }
.confetti i { position: absolute; display: block; border: 3px solid var(--ink); }
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; gap: 2.2rem; padding: 2.5rem 1rem 2rem; align-content: start; }
  .syllables { margin-top: 2.2rem; }
}

/* ---------- shell ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 1.25rem; background: var(--surface); border-bottom: 3px solid var(--ink); }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); font-family: var(--display); font-weight: 800; font-size: 1.35rem; letter-spacing: -.02em; }
.brand-mark { width: 2.2rem; height: 2.2rem; flex: none; }
.who { display: flex; align-items: center; gap: .4rem; min-width: 0; }
.who-name { font-weight: 700; margin-right: .3rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--sec-soft, #ece5ff); border: 2px solid var(--ink); border-radius: 99px; padding: .15rem .7rem; font-size: .9rem; }
.tabs { display: flex; gap: .5rem; padding: .7rem 1.25rem; background: var(--paper); overflow-x: auto; scrollbar-width: none; position: sticky; top: 0; z-index: 20; max-width: 1120px; margin: 0 auto; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { --c: var(--violet); flex: none; padding: .45rem .9rem; text-decoration: none; color: var(--ink); font-weight: 700; border: 2px solid transparent; border-radius: 99px; display: flex; align-items: center; gap: .45rem; }
.tabs a:hover { border-color: var(--ink); background: var(--surface); }
.tabs a.on { background: var(--c); border-color: var(--ink); box-shadow: var(--shadow-sm); }
.tabs a[data-sec=today], .tabs a[data-sec=attendance] { --c: var(--mint); }
.tabs a[data-sec=pieces], .tabs a[data-sec=library] { --c: var(--pink); }
.tabs a[data-sec=notes] { --c: var(--sun); }
.tabs a[data-sec=ask], .tabs a[data-sec=questions] { --c: var(--sky); }
.tabs a[data-sec=fees] { --c: var(--coral); }
.tabs a[data-sec=batches] { --c: var(--teal); }
.tabs a.on[data-sec=pieces], .tabs a.on[data-sec=library], .tabs a.on[data-sec=home], .tabs a.on[data-sec=students], .tabs a.on[data-sec=fees], .tabs a.on[data-sec=ask], .tabs a.on[data-sec=questions] { color: #fff; }
.count { background: var(--ink); color: #fff; font-size: .72rem; border-radius: 99px; padding: .05rem .45rem; font-weight: 800; }
.content { max-width: 1120px; margin: 0 auto; padding: 1rem 1.25rem 5rem; outline: none; }
/* phones: tabs become a thumb-friendly bar at the bottom */
@media (max-width: 700px) {
  .topbar { padding: .55rem 1rem; }
  .who-name { display: none; }
  .tabs { position: fixed; bottom: 0; left: 0; right: 0; top: auto; margin: 0; max-width: none; padding: .4rem .3rem calc(.4rem + env(safe-area-inset-bottom)); background: var(--surface); border-top: 3px solid var(--ink); gap: 0; justify-content: space-around; }
  .tabs a { flex-direction: column; gap: .1rem; font-size: .68rem; padding: .3rem .35rem; border-radius: 12px; min-width: 3.3rem; position: relative; }
  .tabs a .ico { width: 1.45rem; height: 1.45rem; }
  .tabs a .count { position: absolute; top: 0; right: .2rem; }
  .tabs a.on { box-shadow: none; }
  .content { padding: 1.1rem 1rem 6.5rem; }
}

/* ---------- controls: they press down like real buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .55rem 1.05rem; border: 2px solid var(--ink); background: var(--surface); border-radius: 12px; cursor: pointer; font-weight: 700; text-decoration: none; color: var(--ink); min-height: 2.75rem; white-space: nowrap; box-shadow: var(--shadow-sm); transition: transform .08s, box-shadow .08s; }
.btn:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
.btn.primary { background: var(--sec); color: #fff; }
[data-sec=notes] .btn.primary, [data-sec=today] .btn.primary, [data-sec=attendance] .btn.primary, [data-sec=batches] .btn.primary { color: var(--ink); }
.btn.danger { color: var(--absent); }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover { border-color: var(--ink); background: var(--surface); }
.btn.small { padding: .3rem .75rem; min-height: 2.2rem; font-size: .88rem; border-radius: 10px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .6; cursor: progress; transform: none; }
.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.link { background: none; border: 0; padding: 0; color: var(--ink); cursor: pointer; text-decoration: underline; text-decoration-color: var(--sec); text-decoration-thickness: 2px; text-underline-offset: 3px; font-weight: 600; }
.link.danger { color: var(--absent); text-decoration-color: var(--absent); }
.icon-btn { border: 2px solid transparent; background: none; font-size: 1.35rem; line-height: 1; width: 2.2rem; height: 2.2rem; border-radius: 10px; cursor: pointer; color: var(--muted); flex: none; }
.icon-btn:hover { border-color: var(--ink); color: var(--ink); background: var(--surface); }
input, select, textarea { width: 100%; padding: .6rem .75rem; border: 2px solid var(--ink); border-radius: 12px; background: var(--surface); min-height: 2.75rem; }
input:focus, select:focus, textarea:focus { outline: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--sec) 35%, transparent); }
textarea { resize: vertical; line-height: 1.5; }
input[type=checkbox] { width: 1.25rem; height: 1.25rem; min-height: 0; accent-color: var(--violet); margin: 0; flex: none; }
input[type=file] { border-style: dashed; }
.field { display: flex; flex-direction: column; gap: .3rem; }
.field-label { font-weight: 700; font-size: .9rem; }
.field-hint { color: var(--muted); font-size: .8rem; }
.check { display: inline-flex; gap: .5rem; align-items: center; cursor: pointer; white-space: nowrap; font-weight: 600; }
.stack { display: flex; flex-direction: column; gap: .9rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }
.inline-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: .9rem; align-items: end; }
@media (max-width: 640px) { .inline-form { grid-template-columns: 1fr; } }
.toolbar { display: flex; gap: .6rem; margin-bottom: 1rem; flex-wrap: wrap; align-items: center; }
.toolbar .search { flex: 1 1 240px; }
.toolbar select { width: auto; }
.chips { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.chip { border: 2px solid var(--ink); background: var(--surface); padding: .45rem 1rem; border-radius: 99px; cursor: pointer; font-weight: 700; }
.chip[aria-checked=true] { background: var(--sec); box-shadow: var(--shadow-sm); }
.chip-done { font-weight: 800; }

/* ---------- layout pieces ---------- */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin: .6rem 0 1.1rem; }
.page-head h1 { margin: 0; }
h1 { position: relative; display: inline-block; isolation: isolate; }
.content h1::after { content: ''; display: block; height: .32em; margin-top: -.3em; margin-left: -.15em; margin-right: -.15em; background: var(--sec); border-radius: 6px; position: relative; z-index: -1; opacity: .75; }
.page-head input[type=date] { width: auto; }
.panel { background: var(--surface); border: 2px solid var(--ink); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.1rem; box-shadow: var(--shadow); }
.panel.narrow { max-width: 460px; }
.panel.attention { background: #fff6d8; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .8rem; flex-wrap: wrap; }
.panel-head h2 { margin: 0; }
.panel-head select { width: auto; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; align-items: start; }
.two-col.wide-left { grid-template-columns: 1.5fr 1fr; }
@media (max-width: 860px) { .two-col, .two-col.wide-left { grid-template-columns: 1fr; } }
.back { display: inline-flex; margin: .3rem 0 .4rem; text-decoration: none; font-weight: 700; color: var(--muted); }
.back:hover { color: var(--ink); }
.empty { border: 2px dashed var(--ink); border-radius: var(--radius); padding: 1.8rem 1.2rem; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: .8rem; background: color-mix(in srgb, var(--surface) 60%, transparent); font-weight: 500; }
.empty p { margin: 0; }
.hint-strip { background: var(--sun); border: 2px solid var(--ink); border-radius: 12px; padding: .6rem .9rem; font-weight: 600; box-shadow: var(--shadow-sm); }
.private-note { background: #fff6d8; border: 2px dashed var(--ink); padding: .6rem .9rem; border-radius: 12px; white-space: pre-wrap; }

/* home */
.hello { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin: .6rem 0 1.3rem; }
.hello h1 { margin: 0; }
.hello .tag { font-size: .9rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; margin-bottom: 1.4rem; }
.cards.small { margin-top: 1.6rem; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.card { --c: var(--violet); background: var(--c); border: 2px solid var(--ink); border-radius: var(--radius); padding: 1rem 1.1rem 1.1rem; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: .35rem; box-shadow: var(--shadow); transition: transform .1s, box-shadow .1s; position: relative; overflow: hidden; }
.card:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.card:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.card[data-sec=attendance], .card[data-sec=today] { --c: var(--mint); }
.card[data-sec=fees] { --c: var(--coral); color: #fff; }
.card[data-sec=ask], .card[data-sec=questions] { --c: var(--sky); color: #fff; }
.card[data-sec=notes] { --c: var(--sun); }
.card[data-sec=pieces] { --c: var(--pink); color: #fff; }
.card[data-sec=students] { --c: var(--violet); color: #fff; }
.card .ico { position: absolute; right: .8rem; top: .8rem; width: 2rem; height: 2rem; opacity: .9; }
.card-label { font-weight: 700; font-size: .9rem; }
.card-big { font-family: var(--display); font-size: 1.85rem; font-weight: 800; line-height: 1.05; letter-spacing: -.02em; }
.card .small { font-weight: 600; }
.card .muted { color: inherit; opacity: .85; }
.streak { display: inline-flex; align-items: center; gap: .3rem; background: var(--ink); color: #fff; border-radius: 99px; padding: .1rem .6rem; font-size: .8rem; font-weight: 700; align-self: flex-start; }

.stat-row { display: flex; gap: .9rem; flex-wrap: wrap; margin-bottom: 1.3rem; }
.stat { background: var(--surface); border: 2px solid var(--ink); border-radius: 14px; padding: .75rem 1.1rem; min-width: 120px; display: flex; flex-direction: column; box-shadow: var(--shadow-sm); }
.stat:first-child { background: var(--sec-soft, #ece5ff); }
.stat-num { font-family: var(--display); font-size: 1.75rem; font-weight: 800; letter-spacing: -.02em; }
.stat-label { color: var(--muted); font-size: .86rem; font-weight: 600; display: flex; align-items: center; gap: .35rem; }

/* attendance colours, used for dots, marks and the register */
.m-P { --m: var(--present); } .m-L { --m: var(--late); } .m-A { --m: var(--absent); } .m-E { --m: var(--excused); }
.dots { display: flex; gap: 5px; flex-wrap: wrap; margin-top: .3rem; }
.dot { width: 14px; height: 14px; border-radius: 50%; background: var(--m, #ccc); border: 2px solid var(--ink); display: inline-block; flex: none; }
.dot.m-A { background: var(--surface); }
.card .dot.m-P { background: var(--surface); } /* white on mint reads better than green on green */
.card .dot.m-A { background: var(--ink); }
.att-list { list-style: none; margin: 0; padding: 0; }
.att-list li { display: flex; justify-content: space-between; align-items: center; padding: .55rem 0; border-bottom: 2px dashed var(--soft-line); }
.att-list li:last-child { border-bottom: 0; }
.mark { color: #fff; background: var(--m); font-weight: 700; border: 2px solid var(--ink); border-radius: 99px; padding: .05rem .65rem; font-size: .85rem; }

/* attendance marking: big tap targets, one row per child */
.mark-tools { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .7rem; }
.tally { margin: 0; font-weight: 800; font-family: var(--display); font-size: 1.15rem; }
.mark-list { list-style: none; margin: 0 0 .8rem; padding: 0; background: var(--surface); border: 2px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.mark-row { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .6rem .85rem; border-bottom: 2px solid var(--soft-line); flex-wrap: wrap; }
.mark-row:last-child { border-bottom: 0; }
.mark-name { font-weight: 700; color: var(--ink); text-decoration: none; min-width: 8rem; }
.marks { display: flex; gap: .35rem; }
.mark-btn { border: 2px solid var(--ink); background: var(--surface); color: var(--ink); border-radius: 10px; padding: .5rem .75rem; min-height: 2.75rem; cursor: pointer; font-weight: 700; font-size: .88rem; transition: transform .08s; }
.mark-btn:active { transform: scale(.94); }
.mark-btn[aria-checked=true] { background: var(--m); color: #fff; box-shadow: var(--shadow-sm); }
@media (max-width: 560px) {
  .mark-row { padding: .75rem .8rem; }
  .marks { width: 100%; }
  .mark-btn { flex: 1; padding: .5rem .2rem; }
}

/* register */
.register-wrap { overflow-x: auto; }
.register { border-collapse: collapse; font-size: .88rem; min-width: 100%; }
.register th, .register td { border: 2px solid var(--soft-line); padding: .35rem .45rem; text-align: center; }
.register thead th { background: var(--sec-soft, #ece5ff); }
.register tbody th { text-align: left; white-space: nowrap; font-weight: 700; }
.register td[class^=m-] { color: var(--m); font-weight: 800; }

/* people lists */
.people { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 2px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.people > li { border-bottom: 2px solid var(--soft-line); }
.people > li:last-child { border-bottom: 0; }
.person, .batch-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem 1rem; text-decoration: none; color: var(--ink); flex-wrap: wrap; flex: 1; min-width: 0; }
a.person:hover { background: var(--sec-soft, #ece5ff); }
.person-row { display: flex; align-items: center; padding-left: 1rem; }
.person-row.picked { background: #fff3cf; }
.person-main { display: flex; flex-direction: column; min-width: 0; }
.person-name { font-weight: 700; }
.person-side { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

/* grades: each Trinity grade has its own colour so a class sorts itself at a glance */
.grade-group { margin-bottom: 1.4rem; }
.grade-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 0 0 .55rem .2rem; }
.grade-badge { --g: #c9c2e6; display: inline-flex; align-items: center; font-family: var(--display); font-weight: 800; font-size: .95rem; padding: .15rem .7rem; border: 2px solid var(--ink); border-radius: 10px; background: var(--g); box-shadow: var(--shadow-sm); white-space: nowrap; }
p .grade-badge { font-size: .8rem; padding: .05rem .5rem; box-shadow: none; margin-right: .2rem; }
.grade-badge[data-grade=i] { --g: #ffd6ec; }
.grade-badge[data-grade="1"] { --g: #ffe08a; }
.grade-badge[data-grade="2"] { --g: #b9f2dc; }
.grade-badge[data-grade="3"] { --g: #bfe0ff; }
.grade-badge[data-grade="4"] { --g: #ffc9b5; }
.grade-badge[data-grade="5"] { --g: #d9c8ff; }
.grade-badge[data-grade="6"] { --g: #a8ecf1; }
.grade-badge[data-grade="7"] { --g: #ffb3d0; }
.grade-badge[data-grade="8"] { --g: #c6f08f; }
.select-bar { position: sticky; bottom: 1rem; z-index: 15; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; background: var(--ink); color: #fff; border-radius: 16px; padding: .7rem .9rem; box-shadow: 4px 4px 0 var(--violet); margin-top: 1rem; }
.select-bar[hidden] { display: none; }
.select-bar select { width: auto; flex: 1 1 160px; color: var(--ink); }
.select-count { font-weight: 800; font-family: var(--display); font-size: 1.1rem; }
.select-bar .btn.ghost { color: #fff; }
@media (max-width: 700px) { .select-bar { bottom: 5.4rem; } }
.bulk-rows { display: flex; flex-direction: column; gap: .5rem; }
.bulk-row { display: grid; grid-template-columns: 1.4fr .8fr 1.2fr auto; gap: .4rem; align-items: center; }
@media (max-width: 560px) { .bulk-row { grid-template-columns: 1fr 1fr auto; } .bulk-row input[type=tel] { grid-column: 1 / 3; grid-row: 2; } .bulk-row .icon-btn { grid-row: 1; grid-column: 3; } }
.cred-list { list-style: none; margin: 0; padding: 0; border: 2px solid var(--ink); border-radius: 12px; overflow: hidden; }
.cred-list li { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .55rem .8rem; border-bottom: 2px solid var(--soft-line); }
.cred-list li:last-child { border-bottom: 0; }

/* statuses */
.status { font-size: .8rem; font-weight: 700; padding: .15rem .6rem; border-radius: 99px; border: 2px solid var(--ink); background: var(--surface); color: var(--ink); white-space: nowrap; }
.s-paid, .s-confirmed { background: #b9f2dc; }
.s-claimed { background: var(--sun); }
.s-overdue, .s-rejected { background: var(--absent); color: #fff; }
.s-due, .s-part { background: #ffd9c9; }
.tag { display: inline-block; font-size: .8rem; font-weight: 700; padding: .1rem .6rem; border-radius: 99px; background: var(--surface); border: 2px solid var(--ink); color: var(--ink); margin: 0; white-space: nowrap; }
.tag.accent { background: var(--sec); color: #fff; }
.tag.batch { background: #d9f6f8; }
.tag.warn { background: var(--sun); }
.tags { display: flex; gap: .4rem; flex-wrap: wrap; }

/* fees */
.fee-list { list-style: none; margin: .4rem 0 0; padding: 0; }
.fee { display: grid; grid-template-columns: 1fr auto auto auto; gap: .4rem .8rem; align-items: center; padding: .75rem 0; border-bottom: 2px dashed var(--soft-line); }
.fee:last-child { border-bottom: 0; }
.fee-main { display: flex; flex-direction: column; min-width: 0; align-items: flex-start; }
.fee-title { font-weight: 700; }
.fee-amt { font-variant-numeric: tabular-nums; font-weight: 800; font-family: var(--display); font-size: 1.1rem; }
@media (max-width: 560px) {
  .fee { grid-template-columns: 1fr auto; }
  .fee > :nth-child(3), .fee > :nth-child(4) { justify-self: start; }
}
.creds { background: var(--paper); border: 2px solid var(--ink); border-radius: 12px; padding: .9rem; white-space: pre-wrap; font: .95rem/1.5 var(--sans); margin: 0; }

/* notes & questions: notes are sticky notes, questions are chat bubbles */
.notes { display: flex; flex-direction: column; gap: 1rem; margin-top: .8rem; }
.note { background: #fff3b8; border: 2px solid var(--ink); border-radius: 4px 18px 18px 18px; padding: 1rem 1.15rem; box-shadow: var(--shadow-sm); }
.notes .note:nth-child(3n+2) { background: #ffe0ee; }
.notes .note:nth-child(3n+3) { background: #d7f5ea; }
.note-body, .qa-q { white-space: pre-wrap; font-family: var(--serif); font-size: 1.06rem; line-height: 1.65; margin-bottom: .4rem; }
.note-to { font-weight: 800; margin-bottom: .3rem; }
.note-foot { display: flex; justify-content: space-between; gap: 1rem; align-items: center; flex-wrap: wrap; }
.qa { background: var(--surface); border: 2px solid var(--ink); border-radius: 18px 18px 18px 4px; padding: 1rem 1.15rem; box-shadow: var(--shadow-sm); }
.qa.open { background: #dfeeff; }
.qa-a { background: var(--sky); color: #fff; border: 2px solid var(--ink); border-radius: 18px 18px 4px 18px; padding: .7rem .95rem; margin: .7rem 0 0 1.5rem; }
.qa-a .muted { color: #fff; opacity: .85; }
.qa-a p:first-child { white-space: pre-wrap; margin-bottom: .2rem; font-weight: 600; }
.qa form { margin-top: .6rem; }
.qa > .tag { background: var(--sun); }

/* library */
.piece-list { display: flex; flex-direction: column; background: var(--surface); border: 2px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.piece-row { display: flex; align-items: center; gap: .9rem; padding: .8rem 1rem; border: 0; border-bottom: 2px solid var(--soft-line); background: none; text-align: left; cursor: pointer; text-decoration: none; color: var(--ink); width: 100%; }
.piece-row:last-child { border-bottom: 0; }
.piece-row:hover { background: var(--sec-soft, #ffe3ef); }
.piece-cover { width: 56px; height: 56px; object-fit: cover; border-radius: 12px; flex: none; border: 2px solid var(--ink); background: var(--pink); }
.piece-cover.blank { display: grid; place-items: center; font-family: var(--display); font-size: 1.6rem; font-weight: 800; color: var(--ink); }
.piece-row:nth-child(5n+2) .piece-cover.blank { background: var(--sun); }
.piece-row:nth-child(5n+3) .piece-cover.blank { background: var(--mint); }
.piece-row:nth-child(5n+4) .piece-cover.blank { background: var(--sky); }
.piece-row:nth-child(5n+5) .piece-cover.blank { background: var(--coral); }
.piece-row-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.piece-row-title { font-family: var(--display); font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em; }
.piece-row-meta, .piece-row-has { color: var(--muted); font-size: .86rem; }
.piece-row-has { font-weight: 600; }

/* a piece, as read: a recitation card */
.piece { max-width: 46rem; }
.piece-head { margin-bottom: 1.2rem; }
.piece-title { font-size: clamp(2rem, 6vw, 3rem); margin-bottom: .15em; }
.piece-title::after { display: none; }
.piece-author { font-family: var(--serif); font-style: italic; color: var(--muted); font-size: 1.2rem; }
.piece-audio { display: flex; flex-direction: column; gap: .7rem; margin-bottom: 1.3rem; }
.audio { display: flex; flex-direction: column; gap: .35rem; background: var(--sun); border: 2px solid var(--ink); border-radius: 16px; padding: .7rem .9rem; box-shadow: var(--shadow-sm); }
.audio-name { font-weight: 800; font-size: .92rem; }
.audio audio { width: 100%; }
.piece-text { position: relative; background: var(--surface); border: 2px solid var(--ink); border-radius: 20px; padding: 2.3rem 2.2rem 2.2rem; margin-bottom: 1.4rem; box-shadow: 6px 6px 0 var(--pink); }
.text-size { position: absolute; top: .6rem; right: .6rem; display: flex; gap: .3rem; }
.recitation { --base: 1.22rem; font-family: var(--serif); font-size: calc(var(--base) * var(--scale, 1)); line-height: 1.75; max-width: 36em; padding-top: .4rem; }
.recitation .line { margin: 0 0 .25em; padding-left: 1.2em; text-indent: -1.2em; white-space: pre-wrap; }
.stanza-break { height: 1.1em; }
@media (max-width: 600px) { .piece-text { padding: 2.8rem 1.1rem 1.4rem; } .recitation { --base: 1.08rem; } }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .7rem; margin-bottom: 1.4rem; }
.thumb { padding: 0; border: 2px solid var(--ink); border-radius: 12px; overflow: hidden; cursor: zoom-in; background: var(--paper); aspect-ratio: 3 / 4; display: block; width: 100%; box-shadow: var(--shadow-sm); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-edit { margin: 0; display: flex; flex-direction: column; gap: .3rem; }
.thumb-edit figcaption { display: flex; justify-content: space-between; align-items: center; }
.pdfs, .file-list { display: flex; flex-direction: column; gap: .55rem; list-style: none; padding: 0; margin: 0 0 1rem; }
.file-list li { display: flex; flex-direction: column; gap: .3rem; }
.pdf-link { display: flex; align-items: center; gap: .7rem; padding: .7rem .9rem; border: 2px solid var(--ink); border-radius: 12px; background: var(--surface); text-decoration: none; color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm); }
.pdf-link:hover { background: #ffe6dc; }
.pdf-badge { background: var(--coral); color: #fff; font-size: .72rem; font-weight: 800; padding: .2rem .45rem; border-radius: 6px; border: 2px solid var(--ink); }
.recite-input { font-family: var(--serif); font-size: 1.05rem; line-height: 1.8; }

/* modal, toast, lightbox */
.modal { border: 3px solid var(--ink); border-radius: 22px; padding: 0; width: min(600px, calc(100vw - 1.5rem)); max-height: calc(100vh - 1.5rem); color: var(--ink); box-shadow: 8px 8px 0 var(--ink); }
.modal::backdrop { background: rgb(29 26 51 / .5); }
.modal-inner { display: flex; flex-direction: column; max-height: calc(100vh - 2rem); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.2rem .4rem; }
.modal-head h2 { margin: 0; font-size: 1.45rem; }
.modal-body { padding: .6rem 1.2rem 1rem; overflow-y: auto; }
.modal-body .piece-text { padding: 2.6rem 1.2rem 1.2rem; }
.modal-foot { display: flex; justify-content: flex-end; gap: .5rem; padding: .8rem 1.2rem 1rem; border-top: 2px solid var(--soft-line); flex-wrap: wrap; }
.modal-foot .danger { margin-right: auto; }
.modal .btn.primary { background: var(--violet); color: #fff; }
.toast { position: fixed; left: 50%; bottom: 1.4rem; transform: translateX(-50%); background: var(--mint); color: var(--ink); border: 2px solid var(--ink); box-shadow: var(--shadow-sm); padding: .65rem 1.1rem; border-radius: 12px; z-index: 100; max-width: calc(100vw - 2rem); transition: opacity .3s; font-weight: 700; animation: toast-in .25s cubic-bezier(.3,1.5,.5,1); }
@keyframes toast-in { from { transform: translate(-50%, 1rem); opacity: 0; } }
@media (max-width: 700px) { .toast { bottom: 5.6rem; } }
.toast.err { background: var(--absent); color: #fff; }
.toast.gone { opacity: 0; }
.lightbox { position: fixed; inset: 0; background: rgb(20 18 36 / .94); z-index: 200; display: grid; place-items: center; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 94vw; max-height: 90vh; object-fit: contain; background: #fff; border-radius: 8px; }
.lightbox button { position: absolute; background: var(--surface); color: var(--ink); border: 2px solid var(--ink); width: 3rem; height: 3rem; border-radius: 50%; font-size: 1.7rem; cursor: pointer; }
.lb-close { top: 1rem; right: 1rem; }
.lb-prev { left: 1rem; top: 50%; }
.lb-next { right: 1rem; top: 50%; }
.lightbox.single .lb-prev, .lightbox.single .lb-next { display: none; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
