/* LibraryPro: same building blocks as FieldTripPro, with its own blue brand color */
:root {
  --primary: #0f766e; --primary-dark: #0b5850; --primary-soft: #e6f4f2;
  --dark: #1f2937; --gray: #6b7280; --light: #f8fafc; --border: #e2e8f0; --white: #fff;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); color: var(--dark); background: var(--light); line-height: 1.55; font-size: 16px; }
a { color: var(--primary); }
.container { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.topbar { background: var(--white); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.topbar .container { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.2rem; color: var(--dark); text-decoration: none; }
.brand b { color: var(--primary); }
.topnav { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.topnav a { color: var(--dark); text-decoration: none; font-weight: 500; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--border); background: var(--white); color: var(--dark); font-weight: 600; text-decoration: none; cursor: pointer; }
.btn-primary, .topnav a.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); }
.hero { background: linear-gradient(135deg, #0b5850 0%, #0f766e 55%, #14b8a6 100%); color: var(--white); padding: 72px 0 80px; text-align: center; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.1rem); margin: 0 0 14px; letter-spacing: -.02em; }
.hero p { font-size: 1.15rem; max-width: 640px; margin: 0 auto 26px; opacity: .95; }
.eyebrow { display: inline-block; background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3); border-radius: 999px; padding: 4px 14px; font-weight: 600; font-size: .9rem; margin-bottom: 18px; }
.section { padding: 56px 0; }
.section h2 { text-align: center; margin: 0 0 28px; font-size: 1.8rem; }
.grid { display: grid; gap: 18px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 860px) { .grid { grid-template-columns: minmax(0, 1fr); } }
.card { background: var(--white); border: 1px solid var(--border); border-radius: 14px; padding: 20px 22px; }
.card h3 { margin: 6px 0 8px; }
.card .icon { font-size: 1.8rem; }
.muted { color: var(--gray); }
.footer { border-top: 1px solid var(--border); padding: 28px 0; color: var(--gray); font-size: .92rem; text-align: center; }

/* ---------- app components ---------- */
.page { padding: 24px 0 48px; }
.narrow { max-width: 760px; }
h1 { font-size: 1.7rem; margin: 0 0 14px; letter-spacing: -.01em; }
h2 { font-size: 1.3rem; margin: 20px 0 10px; }
.small { font-size: .9rem; } .center { text-align: center; } .break { word-break: break-all; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 28px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .row.between, .between { justify-content: space-between; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.btn-sm { padding: 6px 12px; font-size: .9rem; border-radius: 8px; }
.btn-lg { padding: 13px 22px; font-size: 1.05rem; }
.btn-white { background: var(--white); color: var(--primary-dark); border-color: var(--white); }
.btn-light { background: rgba(255,255,255,.14); color: var(--white); border-color: rgba(255,255,255,.4); }
.btn-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-note { margin-top: 14px; opacity: .9; }
.section.alt { background: var(--white); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.price { text-align: center; } .price .amount { font-size: 2.2rem; font-weight: 800; margin: 6px 0; } .price .amount span { font-size: 1rem; font-weight: 500; color: var(--gray); }
.price.featured { border: 2px solid var(--primary); }
.field { margin-bottom: 14px; display: flex; flex-direction: column; gap: 5px; }
.field > label, fieldset.field legend { font-weight: 600; font-size: .95rem; }
fieldset.field { border: 0; padding: 0; margin: 0 0 14px; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea { font: inherit; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--white); color: var(--dark); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
.hint { font-size: .85rem; color: var(--gray); }
.grid-2, .grid-3 { display: grid; gap: 12px; } .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } }
hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
.hp { position: absolute; left: -9999px; }
.flash { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; border: 1px solid; }
.flash.success { background: #e7f6ec; border-color: #b7e4c2; color: #1e6b34; } .flash.error { background: #fdecee; border-color: #f1b0b7; color: #a61b1b; }
.flash-x { background: none; border: 0; font-size: 1.2rem; cursor: pointer; color: inherit; line-height: 1; }
.demo-note { background: #fff6db; border: 1px solid #f3dd9b; border-radius: 10px; padding: 8px 14px; margin-top: 12px; }
.badge { display: inline-block; font-size: .78rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-dark); }
.badge.gray { background: #f1f5f9; color: var(--gray); } .badge.warn { background: #fff3cd; color: #7a5a00; }
.count { font-size: .78rem; padding: 1px 8px; border-radius: 999px; background: #f1f5f9; color: var(--gray); font-weight: 600; }
.ok { color: #1e6b34; } .danger { color: #b02a37; }
.topsearch { flex: 1 1 260px; max-width: 420px; } .topsearch input { padding: 8px 12px; }
.who { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.section-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.section-card { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: inherit; transition: border-color .15s; }
.section-card:hover { border-color: var(--primary); } .section-card .icon { font-size: 1.6rem; }
.res-list { display: flex; flex-direction: column; gap: 6px; }
.res-row { display: flex; align-items: center; gap: 10px; background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; }
.res-main { flex: 1 1 auto; min-width: 0; display: flex; gap: 10px; align-items: center; text-decoration: none; color: inherit; }
.res-main b, .res-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .res-main small { color: var(--gray); }
.res-kind { font-size: 1.3rem; } .res-tags { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.star { background: none; border: 0; font-size: 1.25rem; cursor: pointer; padding: 2px 6px; }
.notice { border-color: #f3dd9b; background: #fffbea; } .notice-soft { border-color: var(--border); } .ok-box { border-color: #b7e4c2; background: #f0faf3; }
.card h3 { margin-top: 0; }
.list-line { padding: 7px 0; border-top: 1px solid var(--border); } .list-line:first-child { border-top: 0; }
.lead-text { font-size: 1.08rem; }
.page-body h3 { margin: 18px 0 6px; } .page-body p { margin: 0 0 10px; } .page-body li { margin-bottom: 4px; }
.seg { display: flex; gap: 8px; flex-wrap: wrap; } .seg label { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; cursor: pointer; font-weight: 500; }
.seg label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.choice { display: flex; gap: 8px; align-items: center; font-weight: 500; margin: 4px 0; }
.group-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chip { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; font-size: .9rem; cursor: pointer; background: var(--white); }
.chip:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.filter-row { margin: 10px 0; max-width: 360px; }
details > summary { cursor: pointer; } details.card > summary { list-style: none; } details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::before { content: '▸ '; color: var(--gray); } details.card[open] > summary::before { content: '▾ '; }
.staff-row.off { opacity: .6; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tab { background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 14px; font: inherit; font-weight: 600; color: var(--gray); cursor: pointer; white-space: nowrap; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; } .tab-panel.active { display: block; }
.school-lookup { position: relative; }
.school-matches { position: absolute; top: 100%; left: 0; right: 0; z-index: 30; background: var(--white); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.12); max-height: 340px; overflow-y: auto; }
.school-matches.hidden, .hidden { display: none; }
.school-match { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--border); padding: 9px 12px; cursor: pointer; font: inherit; }
.school-match:hover, .school-match.active { background: var(--primary-soft); } .school-match small { display: block; color: var(--gray); }
.match-note { padding: 8px 12px; color: var(--gray); font-size: .9rem; }
@media (max-width: 760px) { .who { display: none; } .topsearch { order: 3; flex-basis: 100%; max-width: none; } }
.btn-link { background: none; border: 0; padding: 0; color: var(--primary); text-decoration: underline; cursor: pointer; font: inherit; }
.badge { white-space: nowrap; }
@media (max-width: 640px) { .section-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .section-card small { font-size: .8rem; } }
.demo-label { margin: 22px 0 8px; font-weight: 700; }
.demo-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; max-width: 420px; margin: 0 auto; }
.bottom-nav { display: none; }
@media (max-width: 760px) {
  body:has(.bottom-nav) { padding-bottom: 72px; }
  .bottom-nav { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--white); border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .72rem; font-weight: 600; color: var(--gray); text-decoration: none; padding: 4px 0; border-radius: 10px; }
  .bottom-nav a span { font-size: 1.25rem; } .bottom-nav a.on { color: var(--primary); background: var(--primary-soft); }
  .topbar .topnav > a { display: none; }
}
.res-main > span:last-child { min-width: 0; flex: 1 1 auto; } .res-row { min-width: 0; }
.hero .hero-note { margin-top: 16px; }
.price h3 { min-height: 3.1em; margin-bottom: 0; text-align: center; }
.price.featured { border-width: 1px; box-shadow: 0 0 0 1px var(--primary); }

/* ---------- Teacher Resources + file browser (List / Details / Icons / Preview) ---------- */
.pill.free { background: #dcfce7; color: #166534; font-size: .72rem; padding: 1px 8px; border-radius: 999px; margin-left: 6px; font-weight: 600; }
.note { background: var(--primary-soft); border-color: #b9e0db; }
.note.ok { background: #ecfdf5; }
.tr-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.tr-filter input[type=search] { flex: 1 1 220px; min-width: 0; }
.tr-filter select { max-width: 100%; }
.sg-wrap { position: relative; display: inline-block; }
.sg-panel { position: absolute; z-index: 30; top: 100%; left: 0; width: 290px; max-width: 86vw; background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.sg-list { margin: 6px 0 12px; display: flex; flex-direction: column; gap: 2px; }
.sg-list label { display: inline-block; }
.dirbtn { border: 1px solid var(--border); background: var(--white); border-radius: 6px; cursor: pointer; margin-left: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0; }
.chips > b { min-width: 64px; font-size: .85rem; color: var(--gray); }
.chip { display: inline-block; padding: 3px 11px; border: 1px solid var(--border); border-radius: 999px; background: var(--white); color: var(--dark); text-decoration: none; font-size: .88rem; }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip.on .muted { color: #d1fae5; }
.pager { text-align: center; }
details.grp { margin: 8px 0; }
details.grp > summary { cursor: pointer; font-weight: 600; padding: 4px 0; }

.fb-bar { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin: 10px 0 6px; }
.fb-views { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--white); }
.fb-views button { border: 0; border-right: 1px solid var(--border); background: transparent; padding: 6px 11px; cursor: pointer; font: inherit; font-size: .88rem; color: var(--dark); }
.fb-views button:last-child { border-right: 0; }
.fb-views button[aria-pressed=true] { background: var(--primary); color: #fff; }
.fb-item, .fb-head { display: grid; grid-template-columns: minmax(0, 3.2fr) 1.4fr 1.1fr 1.2fr 1fr; gap: 10px; align-items: center; padding: 7px 10px; }
.fb-head { font-weight: 600; font-size: .85rem; color: var(--gray); border-bottom: 2px solid var(--border); background: var(--white); border-radius: 8px 8px 0 0; }
.fb-head a, .fb-head [data-sort] { color: inherit; text-decoration: none; cursor: pointer; white-space: nowrap; }
.fb-items { background: var(--white); border: 1px solid var(--border); border-top: 0; }
.fb-item { border-top: 1px solid var(--border); cursor: default; }
.fb-item:first-child { border-top: 0; }
.fb-item:hover, .fb-item:focus { background: #f1f5f9; outline: 0; }
.fb-item.sel { background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.fb-name { display: flex; align-items: center; gap: 8px; min-width: 0; color: inherit; text-decoration: none; font-weight: 600; }
.fb-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-icon { font-size: 1.3rem; flex: none; }
.fb-c { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .92rem; }
.fb-pane { display: none; }
/* List: names only */
.fb[data-view=list] .fb-head, .fb[data-view=icons] .fb-head, .fb[data-view=preview] .fb-head { display: none; }
.fb[data-view=list] .fb-item, .fb[data-view=preview] .fb-item { grid-template-columns: 1fr; padding: 5px 10px; }
.fb[data-view=list] .fb-c, .fb[data-view=preview] .fb-c, .fb[data-view=icons] .fb-c { display: none; }
/* Icons: tiles */
.fb[data-view=icons] .fb-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; background: transparent; border: 0; padding: 6px 0; }
.fb[data-view=icons] .fb-item { grid-template-columns: 1fr; text-align: center; background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 14px 8px; }
.fb[data-view=icons] .fb-name { flex-direction: column; gap: 6px; }
.fb[data-view=icons] .fb-icon { font-size: 2.6rem; }
.fb[data-view=icons] .fb-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
/* Preview: list on the left, the file on the right */
.fb[data-view=preview] .fb-body { display: grid; grid-template-columns: minmax(240px, 360px) minmax(0, 1fr); gap: 16px; align-items: start; }
.fb[data-view=preview] .fb-pane { display: block; position: sticky; top: 76px; background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 14px; max-height: calc(100vh - 92px); overflow: auto; }
.fb[data-view=preview] .fb-item { cursor: pointer; }
.fb-frame { width: 100%; height: min(70vh, 640px); border: 1px solid var(--border); border-radius: 8px; background: #f8fafc; }
.fb-img { max-width: 100%; max-height: 70vh; display: block; margin: 0 auto 8px; border-radius: 8px; }
.fb-card { text-align: center; padding: 24px 12px; border: 1px dashed var(--border); border-radius: 10px; margin-bottom: 8px; }
.fb-bigicon { font-size: 3.4rem; line-height: 1; }
.fb-fname { font-weight: 600; margin: 8px 0 2px; overflow-wrap: anywhere; }
.fb-files { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.fb-files .btn.on { background: var(--primary-soft); border-color: var(--primary); }
.fb-desc { white-space: pre-wrap; }
.fb-stage { margin: 8px 0; }
.fb-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.filelist { list-style: none; padding: 0; margin: 0 0 12px; }
.filelist li { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
@media (max-width: 800px) {
  .fb-item, .fb-head { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .fb-head a:nth-child(n+3), .fb-item .fb-c:nth-of-type(n+3) { display: none; }
  .fb[data-view=preview] .fb-body { grid-template-columns: 1fr; }
  .fb[data-view=preview] .fb-pane { position: static; max-height: none; }
  .fb-views button { padding: 6px 8px; }
}
.fb-thumb { display: none; }
.fb[data-view=icons] .fb-thumb { display: block; width: 100%; max-width: 150px; height: 190px; object-fit: cover; object-position: top; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.fb[data-view=icons] .fb-thumb + .fb-icon { display: none; }
.previews { display: flex; gap: 10px; flex-wrap: wrap; }
.previews img { max-width: 100%; width: 420px; border: 1px solid var(--border); border-radius: 8px; }

/* ---------- Teacher Resources page: search bar + dropdown menus ---------- */
.tr-hero { padding: 18px 0 8px; } .tr-hero h1 { margin: 0 0 2px; }
.tr-banner { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 10px 14px; border: 1px solid #b9e0db; border-radius: 10px; margin: 8px 0 14px; }
.tr-banner.ok { border-color: #bbf7d0; }
.tr-searchbar { display: flex; gap: 8px; }
.tr-searchbar input[type=search] { flex: 1 1 auto; min-width: 0; padding: 12px 16px; font-size: 1.05rem; border: 2px solid var(--border); border-radius: 999px; }
.tr-searchbar input[type=search]:focus { border-color: var(--primary); outline: 0; }
.tr-searchbar .btn { border-radius: 999px; padding-left: 22px; padding-right: 22px; }
.tr-menus { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 6px; padding: 8px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.dd { position: relative; }
.dd-right { margin-left: auto; }
.dd-btn { display: inline-block; border: 1px solid var(--border); background: var(--white); color: var(--dark); border-radius: 8px; padding: 7px 13px; font: inherit; font-size: .93rem; cursor: pointer; text-decoration: none; }
.dd-btn:hover { border-color: var(--primary); }
.dd-btn.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-dark); font-weight: 600; }
.dd-panel { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; min-width: 240px; background: var(--white); border: 1px solid var(--border); border-radius: 12px; padding: 8px; box-shadow: 0 10px 28px rgba(0,0,0,.14); display: grid; gap: 2px; }
.dd-panel[hidden] { display: none; }
.dd-cols-2 { grid-template-columns: repeat(2, minmax(150px, 1fr)); min-width: 360px; }
.dd-cols-3 { grid-template-columns: repeat(3, minmax(100px, 1fr)); min-width: 340px; }
.dd-panel > .dd-item:first-child { grid-column: 1 / -1; border-bottom: 1px solid var(--border); border-radius: 6px 6px 0 0; margin-bottom: 4px; }
.dd-item { display: block; padding: 6px 10px; border-radius: 6px; color: var(--dark); text-decoration: none; font-size: .92rem; }
.dd-item:hover { background: #f1f5f9; }
.dd-item.on { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
.tr-active { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0; }
.fb-bar { justify-content: flex-start; } .fb-spacer { flex: 1 1 auto; } .tr-count { font-weight: 600; }
.sg-panel { right: 0; left: auto; }
@media (max-width: 800px) {
  .dd { position: static; } .dd-right { margin-left: 0; }
  .tr-menus { position: relative; }
  .dd-panel, .sg-panel { left: 0; right: 0; width: auto; min-width: 0; max-width: none; }
  .dd-cols-2, .dd-cols-3 { min-width: 0; grid-template-columns: repeat(2, 1fr); }
}
.grid-narrow { grid-template-columns: minmax(0, 460px); justify-content: center; }
.card.price.teacher { border: 2px solid var(--primary); text-align: center; }
ul.tick { text-align: left; list-style: none; padding: 0; margin: 10px 0 14px; }
ul.tick li::before { content: "✓ "; color: var(--primary); font-weight: 700; }
.compare th, .compare td { padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.compare thead th { background: var(--white); }
.compare { width: 100%; background: var(--white); border-radius: 10px; }
.adminnav a.on { color: var(--primary-dark); font-weight: 700; border-bottom: 2px solid var(--primary); }
.admin-stats { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.card.stat { display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: inherit; }
.card.stat:hover { border-color: var(--primary); }
.card.stat .num { font-size: 2rem; font-weight: 800; color: var(--primary-dark); line-height: 1.1; }
.admin-links { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.admin-links a { display: block; padding: 12px; border: 1px solid var(--border); border-radius: 10px; text-decoration: none; color: inherit; }
.admin-links a:hover { border-color: var(--primary); background: var(--primary-soft); }
.admin-links small { display: block; }

/* ---------- Suggest a Resource ---------- */
.narrow-wide { max-width: 860px; }
.suggest-form { margin-top: 12px; }
.sg-tabs { align-items: center; }
.sg-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; align-items: center; }
.sg-filters input[type=search] { min-width: 160px; }
.sg-item { display: flex; gap: 14px; align-items: flex-start; margin-top: 10px; }
.sg-vote { margin: 0; flex: none; }
.votebtn { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 54px; height: 58px; border: 1px solid var(--border); border-radius: 10px; background: var(--white); cursor: pointer; font: inherit; color: var(--dark); }
.votebtn span { font-size: .8rem; line-height: 1; } .votebtn b { font-size: 1.1rem; }
.votebtn:hover:not(:disabled) { border-color: var(--primary); }
.votebtn.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.votebtn:disabled { opacity: .7; cursor: default; }
.sg-body { min-width: 0; flex: 1 1 auto; }
.sg-details { white-space: pre-wrap; margin: 6px 0; }
.status { font-size: .72rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; vertical-align: middle; background: #e2e8f0; color: #334155; }
.status.s-planned { background: #fef3c7; color: #92400e; } .status.s-done { background: #dcfce7; color: #166534; } .status.s-declined { background: #fee2e2; color: #991b1b; }
.pill.demo { background: #fee2e2; color: #991b1b; font-size: .72rem; padding: 1px 8px; border-radius: 999px; margin-left: 6px; font-weight: 700; letter-spacing: .04em; }
.hero-links { margin-top: 10px; opacity: .9; } .hero-links a { color: var(--white); text-decoration: underline; text-underline-offset: 3px; }

/* nav hover: text turns the brand color, the sign-in button darkens and lifts slightly */
.topnav a:not(.btn) { transition: color .15s ease; }
.topnav a:not(.btn):hover { color: var(--primary); }
.topnav a.btn { transition: background .15s ease, transform .15s ease; }
.topnav a.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }

/* Phone width: the links open from a Menu button (same as FieldTripPro) */
.menu-toggle { display: none; }
@media (max-width: 900px) {
  .menu-toggle { display: inline-flex; align-items: center; gap: 6px; }
  .topbar .topnav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--white); border-bottom: 1px solid var(--border); flex-direction: column; align-items: stretch; padding: 12px 20px; gap: 10px; z-index: 30; }
  .topbar .topnav.open { display: flex; flex-wrap: nowrap; max-height: calc(100vh - 80px); max-height: calc(100dvh - 80px); overflow-y: auto; overscroll-behavior: contain; }
  .topbar .topnav .inline-form { margin-bottom: 8px; }
  .topbar .topnav.open > a { display: block; }
}
/* LibraryPro */
.lp-table { width: 100%; border-collapse: collapse; font-size: .95rem; } .lp-table th { text-align: left; font-size: .8rem; color: var(--gray); padding: 8px 10px; border-bottom: 1px solid var(--border); } .lp-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; } .lp-table tr:last-child td { border-bottom: 0; } .lp-table .n { text-align: right; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; } .card.pad0 { padding: 0; } .danger { color: #b42318; font-weight: 600; }
.seg-tabs { display: flex; background: #eef0f4; border-radius: 12px; padding: 4px; margin-bottom: 12px; } .seg-tabs button { flex: 1; border: 0; background: none; padding: 12px; font: inherit; font-weight: 600; border-radius: 9px; cursor: pointer; color: var(--dark); } .seg-tabs button.on { background: var(--primary); color: #fff; }
.scan-msg { margin: 12px 0; padding: 14px; border-radius: 12px; font-weight: 600; font-size: 1.05rem; } .scan-msg.ok { background: #e4f6ea; color: #14602b; } .scan-msg.bad { background: #fde8e8; color: #8a1c1c; } .scan-msg.hold { background: #fff3cd; color: #7a5a00; }
.cam { margin-top: 10px; border-radius: 12px; overflow: hidden; background: #000; } .cam[hidden] { display: none; } .cam video { display: block; width: 100%; max-height: 300px; object-fit: cover; }
.scan-log { list-style: none; padding: 0; margin: 10px 0; font-size: .9rem; color: var(--gray); } .scan-log li { padding: 4px 0; border-bottom: 1px solid var(--border); }
.book-found { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; } .book-found[hidden] { display: none; } .book-found img { border-radius: 6px; flex: none; } .book-found img[hidden] { display: none; }
@media print { .no-print, .topbar, .bottom-nav, .footer { display: none !important; } }

/* Room above the top bar on phones: clears the status bar and camera cutout when installed as an app */
@media (max-width: 800px) {
  .topbar { padding-top: max(10px, env(safe-area-inset-top)); }
  .topbar .container { min-height: 56px; }
  .topbar .container { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
}
/* check-in: which student is returning this title */
.choose-list { display: flex; flex-direction: column; gap: 8px; }
.choose-btn { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; text-align: left; min-height: 48px; }
.choose-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1 1 auto; min-width: 0; }
.choose-meta { color: var(--muted, #5b6472); font-size: .9rem; white-space: nowrap; flex: 0 0 auto; }
.choose-meta.danger { color: #8a1c1c; font-weight: 600; }
.count-table td.num, .count-table th.num { text-align: right; white-space: nowrap; width: 1%; } .count-table td:first-child { min-width: 7rem; } .count-table th, .count-table td { padding-left: 8px; padding-right: 8px; }
.count-table td.diff-up { color: #14602b; font-weight: 700; } .count-table td.diff-down { color: #8a1c1c; font-weight: 700; }
/* scan desk: Check out, Check in, Class visit (returns and checkouts side by side) */
.circ-wrap { max-width: 1100px; }
.seg-tabs.seg-3 button { flex: 1 1 0; }
.auto-only { display: none; } body[data-circ="auto"] .auto-only { display: block; }
.circ-panes { display: grid; grid-template-columns: 1fr; gap: 16px; margin-top: 8px; }
body[data-circ="out"] .in-pane { display: none; } body[data-circ="in"] .out-pane { display: none; }
@media (min-width: 860px) { body[data-circ="auto"] .circ-panes { grid-template-columns: 1fr 1.25fr; } }
.pane-h { font-size: 1.05rem; margin: 8px 0; display: flex; align-items: center; gap: 8px; }
.pill { display: inline-block; min-width: 1.6em; padding: 1px 8px; border-radius: 999px; background: #f1e3e7; color: #0f766e; font-size: .85rem; text-align: center; }
.scan-log li.bad { color: #8a1c1c; } .scan-log li.hold { color: #7a5a00; font-weight: 600; }
.nowrap { white-space: nowrap; }
.shelf-form .shelf-btn { display: flex; align-items: flex-end; }
.list-plain { list-style: none; padding: 0; margin: 0; }
/* self-checkout station */
.station-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: calc(14px + env(safe-area-inset-top)) 16px 14px; background: #0f766e; color: #fff; }
.station-brand { font-weight: 700; font-size: 1.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .station-name { opacity: .85; font-size: .9rem; white-space: nowrap; }
.station-wrap { max-width: 1150px; } .station-h { font-size: 1.3rem; margin: 6px 0 10px; }
.station-grid { display: grid; grid-template-columns: 1fr; gap: 20px; } @media (min-width: 900px) { .station-grid { grid-template-columns: 1.2fr 1fr; } }
.station-input { font-size: 1.3rem; padding: 14px; } .station-msg { font-size: 1.2rem; }
.station-book .sb-title { font-weight: 700; } .station-book .sb-row { display: flex; justify-content: space-between; gap: 10px; } .station-book .sb-row .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.station-book .sb-where { font-size: .92rem; margin-top: 2px; } .sb-in { color: #14602b; font-weight: 700; white-space: nowrap; } .sb-out { color: #8a1c1c; font-weight: 700; white-space: nowrap; }
.station-results { display: flex; flex-direction: column; gap: 8px; } .station-results .card { margin: 0; padding: 12px 14px; }

/* Phone menu: stop above the bottom bar with a gap, and scroll if it's taller */
@media (max-width: 760px) { .topbar .topnav.open { max-height: calc(100vh - 190px - env(safe-area-inset-bottom)); max-height: calc(100dvh - 190px - env(safe-area-inset-bottom)); } }
/* Books list: clickable headings and group rows */
.th-sort { color: inherit; text-decoration: none; display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; }
.th-sort .arrow { opacity: .35; font-size: .75rem; } th.sorted .th-sort { color: var(--primary-dark); } th.sorted .th-sort .arrow { opacity: 1; }
.lp-table th.n .th-sort { justify-content: flex-end; }
.grp-row th { background: var(--primary-soft); color: var(--primary-dark); font-size: .95rem; text-align: left; padding: 8px 10px; }
.grp-row.lvl1 th { background: #fbf3f5; padding-left: 24px; font-size: .9rem; } .grp-row.lvl2 th { background: #fdf8f9; padding-left: 38px; font-size: .88rem; }
.sg-list > div { display: flex; align-items: center; }
.demo-try summary { cursor: pointer; } .demo-try code { font-size: .9rem; background: #f1f5f9; padding: 1px 6px; border-radius: 6px; user-select: all; }
@media (max-width: 640px) { .demo-try td { display: block; border: 0; padding: 2px 4px; } .demo-try tr { display: block; border-bottom: 1px solid var(--border); padding: 6px 0; } }
/* Book page: subjects and details */
.subject-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; } .subject-chips .chip { font-size: .82rem; }
.book-details summary, details > summary { cursor: pointer; }
.details-table th { width: 34%; max-width: 220px; font-weight: 600; color: var(--gray); background: none; font-size: .88rem; } .details-table td { overflow-wrap: anywhere; }
/* Medium screens: the name line hides so the menu and Sign out stay on one row */
@media (min-width: 901px) and (max-width: 1320px) { .topbar .who { display: none; } .topbar .topnav { gap: 14px; } }

/* ---- Mobile polish 2026-11-06: no zoom on input focus, comfortable tap targets ---- */
@media (max-width: 640px) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]), select, textarea { font-size: 16px; }
  .btn-link, .flash-x, button.star { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; }
}
.hc-dot { position: relative; }
.hc-dot::after { content: ''; position: absolute; inset: -14px; }
/* wide screens use 90% of the width, up to 1680px: less scrolling (Noah 2026-11-07) */
@media (min-width: 1200px) { .container { max-width: min(90vw, 1680px); } }

/* homepage screenshot carousel (same as FieldTripPro; added 2026-11-07). Click a picture to see it full size. */
.hc-section { padding-top: 40px; padding-bottom: 30px; }
.hc-section h2 { text-align: center; margin: 0 0 16px; }
.hero-carousel { background: #fff; color: #1f2937; border-radius: 16px; box-shadow: 0 20px 50px rgba(15, 23, 42, .18); padding: 12px 12px 10px; width: 100%; max-width: 900px; margin: 0 auto; box-sizing: border-box; min-width: 0; outline-offset: 4px; }
.hc-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; border-radius: 10px; }
.hc-track::-webkit-scrollbar { display: none; }
.hc-slide { flex: 0 0 100%; scroll-snap-align: start; margin: 0; }
.hc-desktop, .hc-phone { aspect-ratio: 8 / 5; border-radius: 10px; overflow: hidden; background: #eef3f8; display: flex; justify-content: center; align-items: flex-start; }
.hc-desktop img { width: 100%; height: 100%; object-fit: cover; object-position: top left; display: block; }
.hc-phone { background: linear-gradient(135deg, #e2e8f0, #f8fafc); align-items: center; }
.hc-phone img { height: 94%; width: auto; border: 6px solid #1f2937; border-radius: 22px; box-shadow: 0 10px 24px rgba(0, 0, 0, .25); display: block; object-fit: cover; object-position: top; }
.hc-slide figcaption { padding: 10px 6px 2px; font-weight: 600; font-size: .95rem; text-align: center; min-height: 3em; }
.hc-slide figcaption::after { content: "  🔍 Tap to enlarge"; font-weight: 500; color: #64748b; font-size: .85em; white-space: nowrap; }
.hc-controls { display: flex; align-items: center; justify-content: center; gap: 12px; padding-top: 6px; }
.hc-prev, .hc-next { border: 1px solid #cfd8e3; background: #fff; border-radius: 999px; width: 40px; height: 40px; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--primary); }
.hc-dots { display: flex; gap: 8px; align-items: center; }
.hc-dot { position: relative; width: 12px; height: 12px; padding: 0; border-radius: 50%; border: 0; background: #c5d0dd; cursor: pointer; }
.hc-dot::after { content: ''; position: absolute; inset: -14px; }
.hc-dot[aria-current="true"] { background: var(--primary); transform: scale(1.25); }
.hc-track img { cursor: zoom-in; }
.hc-big { position: fixed; inset: 0; z-index: 9999; background: rgba(15, 23, 42, .92); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; gap: 10px; cursor: zoom-out; }
.hc-big img { max-width: 100%; max-height: calc(100vh - 110px); border-radius: 10px; background: #fff; box-shadow: 0 20px 50px rgba(0, 0, 0, .5); }
.hc-big p { color: #fff; font-weight: 600; text-align: center; margin: 0; }
.hc-big-x { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 999px; border: 0; background: #fff; font-size: 1.3rem; cursor: pointer; }
@media (min-width: 1200px) { .hero-carousel { max-width: 1040px; } }
.hc-desktop, .hc-phone { min-height: 0; } .hc-phone img { max-height: 94%; }   /* phone screenshot keeps the box its normal shape (no empty gap) (2026-11-07) */
.hc-phone { position: relative; } .hc-phone img { position: absolute; top: 3%; left: 50%; transform: translateX(-50%); height: 94%; max-height: none; }
/* the demo note lines up with the page text and never touches the screen edges (2026-11-07) */
.demo-note.container { width: calc(100% - 32px); max-width: 1088px; margin-left: auto; margin-right: auto; box-sizing: border-box; }
@media (min-width: 1200px) { .demo-note.container { max-width: calc(min(90vw, 1680px) - 32px); } }

/* "Sign in with Google" button (kit: /root/google-signin) */
.gsi-btn { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 46px; padding: 10px 16px; border: 1px solid #747775; border-radius: 999px; background: #fff; color: #1f1f1f; font: 500 15px/1.2 Roboto, Arial, system-ui, sans-serif; text-decoration: none; box-sizing: border-box; }
.gsi-btn:hover, .gsi-btn:focus-visible { background: #f2f6fc; text-decoration: none; color: #1f1f1f; }
.gsi-btn svg { flex: none; }
.gsi-or { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: #6b7280; font-size: .85rem; }
.gsi-or::before, .gsi-or::after { content: ""; flex: 1; border-top: 1px solid #e5e7eb; }

/* Student "My library" page (2026-11-07): its short top bar stays visible on phones (no Menu button) */
@media (max-width: 900px) { .topbar .topnav.open-always { display: flex; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-end; padding: 0; border: 0; gap: 8px; background: none; } .topbar .topnav.open-always .inline-form { margin-bottom: 0; } }
