/* Agenda (web/js/pages/agenda.js): the week by day. Five day columns on wide screens, a day per row on tablets,
   stacked days on phones. Brand colors come from the tokens; the class dots use a fixed, quiet palette. */
.ag-head { align-items: flex-end; }
.ag-range { margin-top: 4px; }
.ag-range b { color: var(--maroon-text); font-weight: 600; }
.ag-weeknav { display: inline-flex; align-items: center; gap: 6px; }
.ag-weeknav .jb-iconbtn { width: 36px; height: 36px; }
.ag-weeknav .jb-btn[disabled] { opacity: 1; color: var(--ink-4); border-color: var(--line); background: var(--chip-soft); }

.ag-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin: 18px 0 16px; }
.ag-bar > .ag-kids { flex: 1 1 100%; }   /* the children picker (web/js/kid-pick.js) gets its own row */
.ag-bar-end { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.ag-select select { min-height: 40px; padding: 0 36px 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); font: inherit; font-size: 14px; font-weight: 600; color: var(--ink-2); max-width: 260px; cursor: pointer; }
.ag-progress { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-3); white-space: nowrap; }
.ag-progress b { color: var(--ink); }
.ag-ring { --p: 0; width: 22px; height: 22px; border-radius: 50%; background: conic-gradient(var(--sage) calc(var(--p) * 1%), var(--sage-tint) 0); position: relative; flex: none; }
.ag-ring::after { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: var(--paper); }

/* ---- the week */
.ag-week { container-type: inline-size; }
.ag-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
.ag-day { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); min-width: 0; display: flex; flex-direction: column; }
.ag-day.is-weekend { grid-column: 1 / -1; background: var(--chip-soft); }
.ag-day.is-today { border-color: var(--maroon); box-shadow: 0 0 0 1px var(--maroon), var(--shadow); }
.ag-dhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 12px 10px 14px; border-bottom: 1px solid var(--line-soft); min-height: 58px; }
.ag-day.is-today .ag-dhead { background: var(--maroon-wash); border-radius: calc(var(--r) - 1px) calc(var(--r) - 1px) 0 0; border-bottom-color: var(--maroon-line); }
.ag-dname { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.ag-dow { font-weight: 700; font-size: 15px; color: var(--ink); }
.ag-date { font-size: 13px; color: var(--ink-3); }
.ag-day.is-past .ag-dow { color: var(--ink-3); }
.ag-dside { display: flex; align-items: center; gap: 6px; flex: none; }
.ag-today { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--on-maroon); background: var(--maroon); padding: 4px 8px; border-radius: 99px; }
.ag-count { font-size: 12px; font-weight: 600; color: var(--ink-3); white-space: nowrap; display: inline-flex; align-items: center; gap: 3px; }
.ag-count.done { color: var(--sage-text); }
.ag-count .jb-ico { width: 14px; height: 14px; stroke-width: 2.6; }
.ag-addday { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); color: var(--ink-3); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.ag-addday:hover { color: var(--maroon-text); border-color: var(--maroon-line); background: var(--maroon-wash); }
.ag-addday .jb-ico { width: 16px; height: 16px; }
.ag-items { display: flex; flex-direction: column; gap: 2px; padding: 6px; }
.ag-none { color: var(--ink-4); font-size: 13.5px; padding: 14px 8px 16px; text-align: center; }
.ag-quiet { margin-top: 14px; text-align: center; }

/* school events at the top of a day */
.ag-event { display: flex; align-items: flex-start; gap: 8px; margin: 2px 2px 4px; padding: 8px 10px; border-radius: 9px; background: var(--sage-mist); border: 1px solid var(--sage-line); font-size: 13px; line-height: 1.35; color: var(--ink-2); }
.ag-event .jb-ico { width: 15px; height: 15px; flex: none; margin-top: 1px; color: var(--sage-text); }
.ag-event.k-holiday { background: var(--accent-tint); border-color: transparent; }
.ag-event.k-holiday .jb-ico { color: var(--amber-ink); }

/* a child's name (parents viewing every child) */
.ag-kid { display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: 13px; color: var(--ink-2); padding: 10px 8px 4px; }
.ag-kid:first-child { padding-top: 4px; }
.ag-kid .jb-muted { font-weight: 500; font-size: 12px; }
.ag-kav { width: 26px; height: 26px; border-radius: 50%; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }

/* ---- one item */
.ag-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 8px; border-radius: 10px; position: relative; transition: background .15s; }
.ag-item:hover { background: var(--chip-soft); }
.ag-item + .ag-item::before { content: ''; position: absolute; top: 0; left: 8px; right: 8px; border-top: 1px solid var(--line-soft); }
.ag-item:hover::before, .ag-item:hover + .ag-item::before { border-color: transparent; }
.ag-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.ag-title { font-weight: 600; font-size: 14.5px; line-height: 1.3; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
a.ag-title:hover { color: var(--maroon-text); text-decoration: underline; text-underline-offset: 2px; }
.ag-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12px; }
.ag-meta .jb-pill { font-size: 11px; padding: 4px 7px; }
.ag-class { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-3); font-weight: 600; text-decoration: none; min-width: 0; max-width: 100%; }
.ag-class i { width: 8px; height: 8px; border-radius: 50%; background: var(--ag-c); flex: none; }
a.ag-class:hover { color: var(--maroon-text); text-decoration: underline; text-underline-offset: 2px; }
.ag-kind { font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-4); }
.ag-kind.k-test, .ag-kind.k-quiz { color: var(--maroon-text); }
.ag-time { display: inline-flex; align-items: center; gap: 3px; color: var(--ink-3); font-weight: 600; }
.ag-time .jb-ico { width: 13px; height: 13px; }
.ag-details { margin: 0; font-size: 13px; line-height: 1.45; color: var(--ink-3); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.ag-link { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; max-width: 100%; font-size: 12.5px; font-weight: 600; color: var(--maroon-text); text-decoration: none; padding: 5px 10px 5px 8px; border-radius: 99px; background: var(--maroon-wash); border: 1px solid var(--maroon-line); }
.ag-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-link .jb-ico { width: 14px; height: 14px; flex: none; }
.ag-link:hover { background: var(--maroon-tint); }

/* the check box: big enough to tap */
.ag-check { flex: none; width: 26px; height: 26px; margin: -2px 0 0; border-radius: 8px; border: 2px solid #C9C9CF; background: var(--paper); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; color: transparent; position: relative; transition: background .15s, border-color .15s, transform .15s; }
.ag-check::after { content: ''; position: absolute; inset: -9px; }                 /* 44px touch target */
.ag-check .jb-ico { width: 16px; height: 16px; stroke-width: 3; }
.ag-check:hover { border-color: var(--sage); }
.ag-check:focus-visible { outline: 3px solid var(--maroon-line); outline-offset: 2px; }
.ag-item.done .ag-check { background: var(--sage); border-color: var(--sage); color: var(--on-sage); }
.ag-check[aria-disabled="true"] { cursor: default; }
.ag-item.done .ag-title { color: var(--ink-4); text-decoration: line-through; text-decoration-color: var(--ink-4); }
.ag-item.done .ag-details, .ag-item.done .ag-link { opacity: .55; }
.ag-item.done .ag-class i { opacity: .5; }
.ag-pop .ag-check { animation: ag-pop .35s ease-out; }
@keyframes ag-pop { 0% { transform: scale(1); } 40% { transform: scale(1.22); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .ag-pop .ag-check { animation: none; } }
/* what's happening in class (from a lesson plan): information, so a book where the check box would be */
.ag-infoic { flex: none; width: 26px; height: 26px; margin: -2px 0 0; border-radius: 8px; background: var(--sage-mist); color: var(--sage-text); display: inline-flex; align-items: center; justify-content: center; }
.ag-infoic .jb-ico { width: 15px; height: 15px; }

/* teachers: a colored rail, how many checked it off, and an edit button */
.ag-item.staff { padding-left: 14px; }
.ag-item.staff::after { content: ''; position: absolute; left: 4px; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--ag-c); }
.ag-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.ag-done-n { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; color: var(--ink-3); white-space: nowrap; }
.ag-mini { width: 28px; height: 5px; border-radius: 99px; background: var(--chip); overflow: hidden; display: inline-block; }
.ag-mini span { display: block; height: 100%; background: var(--sage); border-radius: 99px; }
.ag-edit { flex: none; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); color: var(--ink-3); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.ag-edit:hover { color: var(--maroon-text); border-color: var(--maroon-line); background: var(--maroon-wash); }
.ag-edit .jb-ico, .ag-src .jb-ico { width: 15px; height: 15px; }
.ag-src { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-4); }

/* class colors */
.c0 { --ag-c: #4F6BD8; } .c1 { --ag-c: #D9822B; } .c2 { --ag-c: #2E9E7A; } .c3 { --ag-c: #B8508E; }
.c4 { --ag-c: #7A5BC7; } .c5 { --ag-c: #C2A12A; } .c6 { --ag-c: #3B97B8; } .c7 { --ag-c: #C2553F; }

/* ---- editor panel */
.ag-form .fk-grid { margin-top: 2px; }
.ag-who { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.ag-who legend { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; padding: 0; }
.ag-people { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.ag-people-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; padding: 2px 2px 6px; border-bottom: 1px solid var(--line-soft); }
.ag-people-head .jb-link { border: 0; background: none; cursor: pointer; font: inherit; font-size: 13px; }
.ag-people-list { max-height: 280px; overflow: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; padding-top: 4px; }
.ag-person { display: flex; align-items: center; gap: 8px; min-height: 38px; font-size: 14px; cursor: pointer; }
.ag-person input { width: 18px; height: 18px; accent-color: var(--maroon); }

/* ---- narrower: a day per row (label on the left), then stacked days on phones */
@container (max-width: 980px) {
  .ag-grid { grid-template-columns: 1fr; gap: 10px; }
  .ag-day { flex-direction: row; }
  .ag-dhead { flex: 0 0 150px; flex-direction: column; align-items: flex-start; justify-content: flex-start; border-bottom: 0; border-right: 1px solid var(--line-soft); padding: 14px; gap: 8px; }
  .ag-day.is-today .ag-dhead { border-radius: calc(var(--r) - 1px) 0 0 calc(var(--r) - 1px); border-right-color: var(--maroon-line); }
  .ag-items { flex: 1 1 auto; min-width: 0; padding: 6px 8px; }
  .ag-dside { flex-wrap: wrap; }
  .ag-none { text-align: left; padding: 12px 8px; }
}
@container (max-width: 600px) {
  .ag-day { flex-direction: column; }
  .ag-dhead { flex: none; flex-direction: row; align-items: center; justify-content: space-between; border-right: 0; border-bottom: 1px solid var(--line-soft); padding: 12px 12px 10px 14px; }
  .ag-day.is-today .ag-dhead { border-radius: calc(var(--r) - 1px) calc(var(--r) - 1px) 0 0; border-right: 0; border-bottom-color: var(--maroon-line); }
  .ag-dname { flex-direction: row; align-items: baseline; gap: 8px; }
  .ag-items { padding: 4px 6px 6px; }
}
@media (max-width: 640px) {
  .ag-head { align-items: flex-start; }
  .ag-bar { margin: 12px 0; }
  .ag-bar > .jb-seg { flex: 1 1 100%; display: flex; }
  .ag-bar > .jb-seg button { flex: 1 1 0; }
  .ag-select { flex: 1 1 auto; } .ag-select select { width: 100%; max-width: none; }
  .ag-bar-end { margin-left: 0; }
  .ag-people-list { grid-template-columns: 1fr; }
  .ag-scroll-pad { scroll-margin-top: calc(var(--jb-head, 0px) + 12px); }
}
.ag-day { scroll-margin-top: calc(var(--jb-head, 0px) + 12px); }

/* Today's agenda widget (web/js/pages/today.js) */
.jb-todo { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); }
.jb-todo:last-child { border-bottom: 0; }
.jb-todo .t { display: block; font-weight: 600; font-size: 14px; }
.jb-todo-box { flex: none; width: 20px; height: 20px; border-radius: 6px; border: 2px solid #C9C9CF; display: inline-flex; align-items: center; justify-content: center; color: var(--on-sage); }
.jb-todo-box .jb-ico { width: 13px; height: 13px; stroke-width: 3; }
.jb-todo.done .jb-todo-box { background: var(--sage); border-color: var(--sage); }
.jb-todo.done .t { color: var(--ink-4); text-decoration: line-through; }
.jb-todo-n { flex: none; min-width: 38px; font-size: 12px; font-weight: 700; color: var(--ink-3); }
/* the weekend block spreads its items across the width */
@container (min-width: 981px) {
  .ag-day.is-weekend .ag-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); column-gap: 8px; }
  .ag-day.is-weekend .ag-item + .ag-item::before { display: none; }
}
.ag-headside { display: flex; align-items: center; gap: 16px; }
.ag-fold { display: none; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); color: var(--ink-3); align-items: center; justify-content: center; cursor: pointer; }
.ag-fold .jb-ico { width: 16px; height: 16px; transition: transform .2s; }
@container (max-width: 600px) {
  .ag-day.fold .ag-fold { display: inline-flex; }
  .ag-day.fold .ag-dhead { cursor: pointer; }
  .ag-day.fold:not(.open) .ag-items { display: none; }
  .ag-day.fold:not(.open) .ag-dhead { border-bottom: 0; }
  .ag-day.fold.open .ag-fold .jb-ico { transform: rotate(180deg); }
}
@media (max-width: 640px) {
  .ag-head > :first-child { flex-basis: 100%; }
  .ag-headside { width: 100%; justify-content: space-between; flex-direction: row-reverse; }
  .ag-bar > .jb-seg[aria-label="Show"] { flex: 0 0 auto; }
  .ag-bar > .jb-seg[aria-label="Show"] button { padding: 0 12px; }
}
@media (max-width: 640px) {
  .ag-select { flex: 1 1 0; min-width: 0; }
  .ag-bar .jb-seg button { white-space: nowrap; }
}
@container (min-width: 981px) { .ag-day.is-weekend .ag-kid, .ag-day.is-weekend .ag-event { grid-column: 1 / -1; } }
.ag-who .jb-seg { align-self: flex-start; }
.jb-sheet footer .ag-remove { margin-right: auto; color: var(--maroon-text); }
