/* The librarian site, to match the teacher site: a white page, ink blue
   #22407A for words, numbers and selected things, light aqua for soft fills and the one band at the top of a
   page, tomato only for counts that need her and late things. Young Serif for big words, Nunito Sans for
   everything else. Design only: every rule here is scoped to html.staff (set by app.js on the librarian page,
   not in "See their view"), and dark mode keeps its own colours. */
html.staff {
  --pool: #C4E7E3;
  --water: #A5D8D2;
  --tomato: #C8432F;
  --font-display: "Young Serif", Georgia, serif;
  --font-body: "Nunito Sans", "Trebuchet MS", sans-serif;
  --r: 18px;
}
/* light colours (styles.css's dark-mode rules are more specific, so dark mode keeps its own) */
html.staff {
  --bg: #FFFFFF; --surface: #FFFFFF; --sunk: #EEF6F5; --ink: #22407A; --muted: #4A5755; --line: #D6DEEA;
  --accent: #22407A; --accent-soft: #E2F2F0; --sky: #C4E7E3; --accent-ink: #FFFFFF;
  --ok: #1E6B5E; --ok-soft: #E2F2F0; --warn: #8A5300; --warn-soft: #FBF0DC; --bad: #B5382A; --bad-soft: #FBE9E5;
  --shadow: 0 1px 2px rgba(34, 64, 122, .06), 0 8px 24px rgba(34, 64, 122, .08);
}

html.staff body { font-size: 1rem; line-height: 1.5; }
html.staff h1, html.staff h2, html.staff h3 { font-weight: 400; letter-spacing: 0; }
html.staff h1 { font-size: 2.25rem; line-height: 1.08; }
html.staff h2 { font-size: 1.375rem; }
html.staff h3 { font-size: 1.125rem; }
html.staff a { text-decoration-color: var(--tomato); text-decoration-thickness: 2px; text-underline-offset: 4px; }
html.staff :focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
html.staff b, html.staff strong { font-weight: 800; }

/* the side menu: white, pill links, the current page filled ink blue */
html.staff .rail { background: var(--surface); border-right: 1.5px solid var(--line); padding: 22px 14px; }
html.staff .brand { gap: 8px; padding: 0 6px 18px; }
html.staff .brand-mark.bird { width: 52px; height: 42px; border-radius: 0; background: none; }
html.staff .brand-mark.bird svg { width: 52px; height: 42px; }
html.staff .brand-mark.bird.sm, html.staff .topbar .brand-mark.bird { width: 40px; height: 32px; }
html.staff .brand-mark.bird.sm svg, html.staff .topbar .brand-mark.bird svg { width: 40px; height: 32px; }
html.staff .brand-name { font-weight: 400; font-size: 1.3125rem; }
html.staff .nav a { border-radius: 999px; padding: 0 14px; min-height: 42px; font-weight: 700; font-size: .9375rem; }
html.staff .nav a:hover { background: var(--sunk); }
html.staff .nav a.on { background: var(--accent); color: var(--accent-ink); }
html.staff .nav a.on svg { opacity: 1; }
html.staff .nav-topic { border-top: 0; margin-top: 6px; }
html.staff .nav-topic summary { font-family: var(--font-body); font-size: .8125rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border-radius: 999px; min-height: 44px; padding: 0 14px; }
html.staff .nav-topic summary > svg { display: none; }
html.staff .nav-topic .nav { padding-left: 12px; }
html.staff .nav-topic .nav a { font-weight: 600; min-height: 44px; }
html.staff .rail-foot { border-top: 1.5px solid var(--line); }

/* counts that need her: tomato, the only loud colour */
html.staff .badge { background: var(--tomato); color: #FFFFFF; min-width: 24px; height: 24px; border-radius: 12px; font-size: .8125rem; }
html.staff .nav a.on .badge { background: #FFFFFF; color: var(--accent); }

/* buttons: pills, ink outlines; the main one filled ink blue */
html.staff .btn { border-radius: 999px; border: 1.5px solid var(--accent); color: var(--accent); background: transparent; min-height: 44px; padding: 0 18px; font-weight: 800; }
html.staff .btn:hover { background: var(--sunk); }
html.staff .btn.primary { background: var(--accent); color: var(--accent-ink); }
html.staff .btn.primary:hover { filter: none; background: #1A3366; }
html.staff .btn.danger { border-color: var(--bad); color: var(--bad); }
html.staff .btn.ghost { border-color: transparent; }
html.staff .btn.sm { min-height: 36px; padding: 0 14px; }
html.staff .iconbtn { border-radius: 999px; }
html.staff .seg { background: var(--sunk); border-radius: 999px; padding: 4px; }
html.staff .seg button, html.staff .seg a { border-radius: 999px; color: var(--accent); min-height: 36px; padding: 0 16px; display: inline-flex; align-items: center; }
html.staff .seg .on { background: var(--accent); color: var(--accent-ink); box-shadow: none; }

/* cards: a thin ink-tinted line, round corners, no shadow */
html.staff .card, html.staff .sd-card { border: 1.5px solid var(--line); border-radius: 24px; box-shadow: none; }
html.staff .card { padding: 22px 24px; }
html.staff .sd-card { padding: 8px 24px 14px; }
html.staff .input { border-radius: 14px; border: 1.5px solid var(--line); min-height: 44px; }
html.staff .input:focus { outline: 3px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
html.staff .pill { border-radius: 999px; font-weight: 800; padding: 3px 11px; }
html.staff .pill.accent { background: var(--accent-soft); color: var(--accent); }
html.staff table.t th { font-size: .75rem; font-weight: 800; letter-spacing: .08em; }
html.staff table.t td { border-bottom-color: var(--line); }

/* the page title: a light aqua band with the scalloped water line, once per page */
html.staff .admin-shell .page > .page-head, html.staff .admin-shell .sd-head { position: relative; overflow: hidden; background: var(--pool); border-radius: 28px; padding: 26px 30px 44px; color: var(--accent); }
html.staff .admin-shell .page > .page-head::after, html.staff .admin-shell .sd-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 20px; background: radial-gradient(13px 7px at 13px 0, var(--pool) 98%, transparent) 0 0 / 26px 20px repeat-x, var(--water); }
html.staff .admin-shell .page > .page-head .sub, html.staff .admin-shell .sd-head p { color: #2F4B57; }
html.staff .admin-shell .page > .page-head .btn:not(.primary), html.staff .admin-shell .sd-head .btn:not(.primary) { background: rgba(255, 255, 255, .55); }
html.staff .admin-shell .page > .page-head .seg { background: rgba(255, 255, 255, .6); }

/* dashboard: the date stamp keeps its rubber-stamp shape, in ink blue */
html.staff .sd-head h1 { font-size: 2.5rem; }
html.staff .sd-date { background: rgba(255, 255, 255, .5); }
html.staff .sd-h { border-bottom: 2px solid var(--accent); }
html.staff .sd-h h2 { font-size: 1.5rem; }
html.staff .sd-n { border-radius: 50%; min-width: 46px; height: 46px; font-family: var(--font-display); font-weight: 400; font-size: 1.375rem; background: var(--accent); color: var(--accent-ink); border: 0; }
html.staff .sd-n.bad { background: var(--tomato); color: #FFFFFF; }
html.staff .sd-sum b { font-weight: 400; font-size: 2.25rem; }
html.staff .sd-day { border-radius: 999px; }
html.staff .stamp { border-radius: 8px; }

/* the desk keeps its calm, compact layout, in the site's own fonts and colours */
html.staff .desk { --d-font: var(--font-body); --d-label: var(--ink); --d-sub: var(--muted); --d-sep: var(--line); --d-fill: #EEF6F5; --d-fill2: #F5FAFA; --d-shadow: none; --d-card: #FFFFFF; }
html.staff .desk h1, html.staff .desk h2 { font-family: var(--font-display); font-weight: 400; letter-spacing: 0; }
html.staff .desk-card { border: 1.5px solid var(--line); border-radius: 24px; }

/* phones: the bottom tab bar */
html.staff .tabbar a.on { color: var(--accent); }
html.staff .topbar { background: var(--surface); }
@media (max-width: 860px) {
  html.staff h1 { font-size: 1.875rem; }
  html.staff .admin-shell .page > .page-head, html.staff .admin-shell .sd-head { padding: 20px 20px 38px; border-radius: 22px; }
  html.staff .sd-head h1 { font-size: 2rem; }
}

/* dark mode keeps its own colours; only the shapes and fonts above carry over */
@media (prefers-color-scheme: dark) {
  html.staff:not([data-theme="light"]) .admin-shell .page > .page-head, html.staff:not([data-theme="light"]) .admin-shell .sd-head { background: var(--sunk); color: var(--ink); }
  html.staff:not([data-theme="light"]) .admin-shell .page > .page-head::after, html.staff:not([data-theme="light"]) .admin-shell .sd-head::after { background: radial-gradient(13px 7px at 13px 0, var(--sunk) 98%, transparent) 0 0 / 26px 20px repeat-x, var(--line); }
  html.staff:not([data-theme="light"]) .admin-shell .page > .page-head .sub, html.staff:not([data-theme="light"]) .admin-shell .sd-head p { color: var(--muted); }
  html.staff:not([data-theme="light"]) .admin-shell .page > .page-head .btn:not(.primary), html.staff:not([data-theme="light"]) .admin-shell .sd-head .btn:not(.primary) { background: transparent; }
  html.staff:not([data-theme="light"]) .desk { --d-label: var(--ink); --d-card: var(--surface); --d-fill: var(--sunk); --d-fill2: var(--sunk); }
  html.staff:not([data-theme="light"]) .sd-date { background: transparent; }
}
html.staff[data-theme="dark"] .admin-shell .page > .page-head, html.staff[data-theme="dark"] .admin-shell .sd-head { background: var(--sunk); color: var(--ink); }
html.staff[data-theme="dark"] .admin-shell .page > .page-head::after, html.staff[data-theme="dark"] .admin-shell .sd-head::after { background: radial-gradient(13px 7px at 13px 0, var(--sunk) 98%, transparent) 0 0 / 26px 20px repeat-x, var(--line); }
html.staff[data-theme="dark"] .desk { --d-label: var(--ink); --d-card: var(--surface); --d-fill: var(--sunk); --d-fill2: var(--sunk); }
/* the desk's search boxes show focus on their rounded box, not a second ring on the field inside */
html.staff .desk input:focus-visible { outline: none; }

/* ---- smaller page details ---- */
/* the sign-in page opens on the same aqua band as every other page */
html.staff .auth-brand { position: relative; overflow: hidden; background: var(--pool); color: var(--accent); border-radius: 26px; padding: 22px 24px 42px; }
html.staff .auth-brand::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 20px; background: radial-gradient(13px 7px at 13px 0, var(--pool) 98%, transparent) 0 0 / 26px 20px repeat-x, var(--water); }
html.staff .auth-brand .brand-mark.bird { width: 64px; height: 52px; border-radius: 0; background: none; flex: none; }
html.staff .auth-brand .brand-mark.bird svg { width: 64px; height: 52px; }
html.staff .auth-brand p { color: #2F4B57; }
/* the book page opens on the band too, like the student page */
html.staff .admin-shell .page > .detail { position: relative; overflow: hidden; background: var(--pool); border-radius: 28px; padding: 26px 30px 48px; color: var(--accent); }
html.staff .admin-shell .page > .detail::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 20px; background: radial-gradient(13px 7px at 13px 0, var(--pool) 98%, transparent) 0 0 / 26px 20px repeat-x, var(--water); }
html.staff .admin-shell .page > .detail .muted { color: #2F4B57; }
html.staff .admin-shell .page > .detail .stars { color: #6B4C00; }
html.staff .admin-shell .page > .detail .btn:not(.primary) { background: rgba(255, 255, 255, .55); }
/* the back links are a full finger tall */
html.staff .backlink { min-height: 44px; }
/* no coloured side stripes: the Pool look marks things with fills and whole borders */
html.staff .update { border-left: 0; border-top: 1.5px solid var(--line); padding: 12px 0 4px; }
html.staff .update:first-child { border-top: 0; padding-top: 0; }
html.staff .msg { border-radius: 16px; }
html.staff .msg.unread { box-shadow: inset 0 0 0 1.5px var(--accent); }
html.staff .chalfilter .showing { border-left: 0; border-radius: 14px; background: var(--accent-soft); }
html.staff .fr-card { border: 1.5px solid var(--line); border-radius: 24px; box-shadow: none; }
html.staff .fr-card.lvl-check { border-color: var(--warn); }
html.staff .fr-card.lvl-high { border-color: var(--bad); }
/* the dashboard chart key sits on one line with its swatches */
html.staff .sd-key span { display: inline-flex; align-items: center; gap: 6px; }
html.staff .sd-key i { margin: 0; border-radius: 3px; }
html.staff .sd-chart .lw, html.staff .sd-key .lw { fill: var(--water); background: var(--water); }
/* medals settle in calmly, no bounce */
html.staff .celebrate .medal { animation-timing-function: cubic-bezier(.2, .8, .2, 1); }
html.staff .celebrate .medal { animation-name: settle; }
@keyframes settle { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
/* phones: everything you tap is at least 44px tall */
@media (max-width: 860px) {
  html.staff .btn, html.staff .btn.sm, html.staff .iconbtn { min-height: 44px; }
  html.staff .seg a, html.staff .seg button, html.staff .desk .seg a { min-height: 44px; }
  html.staff .chip, html.staff .chalfilter .chips .chip, html.staff .tagfix .chip, html.staff .audpick .chip, html.staff .shelfpick .chip { min-height: 44px; display: inline-flex; align-items: center; }
  html.staff select.input, html.staff .input { min-height: 44px !important; }
  html.staff .check { min-height: 44px; }
  html.staff .sd-quiet a, html.staff .sd-h a, html.staff .card-head a, html.staff .row > a.small { min-height: 44px; display: inline-flex; align-items: center; }
  /* settings tabs: separate pills that wrap tidily, not one pill split over two rows */
  html.staff .seg.wrap { background: none; padding: 0; gap: 8px; width: auto; }
  html.staff .admin-shell .page.desk > .page-head .seg.wrap { background: none; padding: 0; box-shadow: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: 100%; }
  #view .page.desk > .page-head .seg.wrap a { margin-block: 0 !important; }
  html.staff .seg.wrap a, html.staff .seg.wrap button { flex: 0 1 auto; border: 1.5px solid var(--accent); background: var(--surface); }
  html.staff .seg.wrap .on, html.staff .seg.wrap [aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
  html.staff .admin-shell .page > .detail { padding: 20px 20px 42px; border-radius: 22px; }
}
/* dark mode: brighter gold stars, and the new bands go calm grey like the others */
@media (prefers-color-scheme: dark) {
  html.staff:not([data-theme="light"]) .stars { color: #E8A317; }
  html.staff:not([data-theme="light"]) .auth-brand, html.staff:not([data-theme="light"]) .admin-shell .page > .detail { background: var(--sunk); color: var(--ink); }
  html.staff:not([data-theme="light"]) .auth-brand::after, html.staff:not([data-theme="light"]) .admin-shell .page > .detail::after { background: radial-gradient(13px 7px at 13px 0, var(--sunk) 98%, transparent) 0 0 / 26px 20px repeat-x, var(--line); }
  html.staff:not([data-theme="light"]) .auth-brand p, html.staff:not([data-theme="light"]) .admin-shell .page > .detail .muted { color: var(--muted); }
  html.staff:not([data-theme="light"]) .admin-shell .page > .detail .btn:not(.primary) { background: transparent; }
}
html.staff[data-theme="dark"] .stars { color: #E8A317; }
html.staff[data-theme="dark"] .auth-brand, html.staff[data-theme="dark"] .admin-shell .page > .detail { background: var(--sunk); color: var(--ink); }
html.staff[data-theme="dark"] .auth-brand::after, html.staff[data-theme="dark"] .admin-shell .page > .detail::after { background: radial-gradient(13px 7px at 13px 0, var(--sunk) 98%, transparent) 0 0 / 26px 20px repeat-x, var(--line); }
html.staff[data-theme="dark"] .auth-brand p, html.staff[data-theme="dark"] .admin-shell .page > .detail .muted { color: var(--muted); }
html.staff[data-theme="dark"] .admin-shell .page > .detail .btn:not(.primary) { background: transparent; }
@media (prefers-color-scheme: dark) { html.staff:not([data-theme="light"]) .admin-shell .page > .detail .stars { color: #E8A317; } }
html.staff[data-theme="dark"] .admin-shell .page > .detail .stars { color: #E8A317; }

/* ---------- Morning report (dashboard top) ---------- */
html.staff .mr { margin-bottom: 22px; }
.mr .sd-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mr h3 { font-family: var(--font-display); font-weight: 400; font-size: 1.15rem; color: var(--accent); margin: 16px 0 6px; }
.mr-cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 34px; align-items: start; }
.mr-big { display: flex; align-items: baseline; gap: 10px; margin: 2px 0 10px; color: var(--accent); }
.mr-big b { font-family: var(--font-display); font-weight: 400; font-size: 2.6rem; line-height: 1; }
.mr-big span { color: var(--muted); }
.mr-c { border-top: 1px solid var(--line); }
.mr-c summary { list-style: none; display: grid; grid-template-columns: 76px 112px minmax(60px, 1fr) 96px 14px; align-items: center; gap: 14px; min-height: 48px; cursor: pointer; }
.mr-c summary::-webkit-details-marker { display: none; }
.mr-c summary .sd-chev { width: 8px; color: var(--muted); transition: transform .15s; }
.mr-c[open] summary .sd-chev { transform: rotate(90deg); }
.mr-cn { font-weight: 700; color: var(--ink); }
.mr-cr { color: var(--muted); font-size: .92rem; }
.mr-cm { font-variant-numeric: tabular-nums; color: var(--accent); font-weight: 600; text-align: right; }
.mr-bar { height: 8px; border-radius: 99px; background: var(--water, #A5D8D2); overflow: hidden; opacity: .9; }
.mr-bar.none { background: none; }
.mr-bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.mr-in { padding: 0 0 12px 14px; border-left: 2px solid var(--water, #A5D8D2); margin: 0 0 12px 4px; }
.mr-p { display: grid; grid-template-columns: minmax(120px, auto) 1fr auto; gap: 12px; align-items: baseline; padding: 7px 0; color: var(--ink); text-decoration: none; }
.mr-p span { color: var(--muted); font-size: .9rem; min-width: 0; overflow-wrap: anywhere; }
.mr-p em { font-style: normal; font-variant-numeric: tabular-nums; color: var(--accent); font-size: .92rem; }
.mr-p:hover b { text-decoration: underline; }
.mr-miss { color: var(--muted); font-size: .9rem; margin: 8px 0 0; line-height: 1.6; }
.mr-miss a { color: inherit; text-decoration-color: var(--line); }
.mr-chl { border-left: 1.5px solid var(--line); padding-left: 30px; }
.mr-since { color: var(--muted); font-size: .9rem; margin: -2px 0 8px; }
.mr-ch { border-top: 1px solid var(--line); padding: 12px 0; }
.mr-chn { font-weight: 700; color: var(--ink); text-decoration: none; }
.mr-chn small { font-weight: 400; color: var(--muted); }
.mr-chs { color: var(--muted); margin-top: 2px; }
.mr-chs b { font-family: var(--font-display); font-weight: 400; font-size: 1.35rem; color: var(--accent); }
.mr-bd h4 { font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 12px 0 4px; }
.mr-bd a { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; color: var(--ink); text-decoration: none; }
.mr-bd a span { color: var(--accent); font-size: .9rem; text-align: right; }
.mr-fold { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 8px 0; color: var(--muted); }
.mr-fold b { color: var(--accent); }
html.staff .mr-done { padding-block: 6px; }
@media (max-width: 1000px) {
  .mr-cols { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .mr-chl { border-left: 0; padding-left: 0; }
}
@media (max-width: 560px) {
  .mr-c summary { grid-template-columns: minmax(0, 1fr) auto 14px; row-gap: 2px; padding: 8px 0; }
  .mr-c summary .mr-cr { grid-column: 1; grid-row: 2; }
  .mr-c summary .mr-bar { display: none; }
  .mr-c summary .mr-cm { grid-row: 1 / 3; grid-column: 2; }
  .mr-c summary .sd-chev { grid-row: 1 / 3; grid-column: 3; }
  .mr-p { grid-template-columns: minmax(0, 1fr) auto; }
  .mr-p span { grid-column: 1 / -1; grid-row: 2; }
  .mr-p em { grid-row: 1; grid-column: 2; }
}

/* View-only admins: one quiet line under the top of every page says changes are off.
   Uses the theme tokens so dark mode follows. */
.viewonly-bar { display: flex; align-items: center; gap: 10px; padding: 10px 24px; background: var(--sunk, #EEF6F5); color: var(--ink); border-bottom: 1px solid var(--line); font-size: .92rem; line-height: 1.35; }
.viewonly-bar svg { width: 20px; height: 20px; flex: none; }
@media (max-width: 860px) { .viewonly-bar { padding: 8px 16px; font-size: .86rem; } }
/* links to the pages view-only admins don't get (VIEW_ONLY_OFF in admin.js) are left out wherever they appear */
html.viewonly a[href^="#/admin/circ"], html.viewonly a[href^="#/admin/add"], html.viewonly a[href^="#/admin/import"],
html.viewonly a[href^="#/admin/labels"], html.viewonly a[href^="#/admin/cards"], html.viewonly a[href^="#/admin/settings"],
html.viewonly a[href^="#/admin/challenge-edit"], html.viewonly a[href^="#/admin/tag-cleanup"], html.viewonly a[href^="#/admin/tags"],
html.viewonly a[href^="#/admin/dewey"] { display: none !important; }
/* reading-log rows open the change form for the librarian; for view-only admins they are just rows */
html.viewonly .logrow { pointer-events: none; cursor: default; }
html.viewonly .logrow > svg:last-child { display: none; }
