:root {
  color-scheme: light;
  --bg: #fff;
  --panel: #fff;
  --raised: #e9f5f5;
  --ink: #18181b;
  --muted: #71717a;
  --line: #e8e8eb;
  --accent: #007b90;
  --accent-hover: #005971;
  --rail: #103946;
  --rail-line: #39616c;
  --rail-ink: #f0fbfe;
  --accent-text: #fff;
  --radius: 12px;
  font: 15px/1.5 ui-sans-serif, system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
body { margin: 0; }
.shell { width: min(100% - 3rem, 80rem); margin-inline: auto; }
.masthead { border-bottom: 1px solid var(--line); background: var(--panel); }
.topbar, .brand, .top-actions, .controls, .toolbar, .profile, .library-actions, .selection, .lightbox-head, .lightbox-footer { display: flex; align-items: center; gap: .75rem; }
.topbar { justify-content: space-between; min-height: 64px; }
.brand { line-height: 1.15; }
.brand strong { display: block; font-size: .93rem; font-weight: 650; letter-spacing: -.02em; }
.brand-icon { display: block; width: 40px; height: 40px; flex: none; border-radius: 9px; }
.library-actions svg { width: 21px; height: 21px; flex: none; }
.connection { color: #23604d; font-size: .83rem; white-space: nowrap; padding-inline: .7rem; }
.connection span { display: inline-block; width: 7px; height: 7px; margin-right: 3px; background: var(--accent); border-radius: 50%; }
main { padding-block: clamp(1.5rem, 4vw, 3.5rem) 6rem; }
h1 { margin: 0; font-size: clamp(2.75rem, 6vw, 4rem); line-height: 1.07; font-weight: 740; letter-spacing: -.06em; overflow-wrap: anywhere; }
.intro, .status, #status { color: var(--muted); }
.intro { margin: .8rem 0 0; font-size: clamp(.9rem, 1.5vw, 1.15rem); font-variant-numeric: tabular-nums; font-weight: 400; }
.sign-in { max-width: 54rem; }
.controls { margin-block: 1.2rem; flex-wrap: wrap; }
.controls:has(#status[hidden]):has(#open[hidden]) { display: none; }
button, select, .search, .action {
  min-height: 44px; padding: .52rem .85rem; font: inherit; color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel);
}
button, .action { font-weight: 560; }
button:enabled, select, .action { cursor: pointer; }
button:disabled { opacity: .45; }
button:enabled:hover, select:hover { background: var(--raised); }
button.primary, a.primary { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; color: var(--accent-text); background: var(--accent); border-color: var(--accent); border-radius: 999px; padding-inline: 1.15rem; text-decoration: none; }
button.primary:enabled:hover, a.primary:hover { background: var(--accent-hover); }
button.quiet { background: transparent; border-color: transparent; }
button.quiet:enabled:hover { background: var(--raised); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
#student-name:focus { outline: none; }
#viewer { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
#screen { display: block; width: 100%; min-width: 0; height: auto; margin-inline: auto; cursor: default; }
.remote-keyboard { position: fixed; left: 0; bottom: 0; width: 1px; height: 1px; padding: 0; opacity: .01; pointer-events: none; font-size: 16px; }
#screen:focus-visible { outline-offset: -3px; }
.library { display: block; }
.student-panel { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem 1.25rem; margin-bottom: 2.5rem; }
.student-panel h2 { margin: 0; font-size: .8rem; font-weight: 500; color: var(--muted); }
#student-picker { display: flex; flex-wrap: wrap; gap: .5rem; }
.student-option { position: relative; display: flex; align-items: center; text-align: left; gap: .65rem; border-color: transparent; border-radius: 999px; background: transparent; color: var(--muted); font-weight: 560; padding: .35rem .85rem .35rem .35rem; overflow-wrap: anywhere; }
.student-option:enabled:hover { background: #f6f6f7; color: var(--ink); }
.student-option[aria-pressed=true] { background: var(--raised); color: var(--accent-hover); }
.student-option .avatar { width: 38px; font-size: .78rem; }
.student-option[aria-pressed=true] .avatar { outline: 2px solid var(--accent); outline-offset: 2px; }
.library-feed { min-width: 0; }
.library-title { display: flex; justify-content: space-between; align-items: end; gap: 1.5rem; flex-wrap: wrap; margin-block: 0 2.5rem; }
.profile { min-width: 0; gap: .9rem; }
.avatar {
  display: grid; position: relative; overflow: hidden; place-items: center; width: clamp(54px, 6vw, 72px); aspect-ratio: 1; flex: none;
  border-radius: 50%; background: var(--raised); border: 1px solid #bfdce4; color: var(--accent);
  font-size: 1rem; font-weight: 680;
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--raised); }
.library-actions { align-items: end; flex-wrap: wrap; }
.gallery-controls { padding: 0; }
.toolbar { flex-wrap: wrap; gap: .5rem; padding-bottom: .75rem; }
.search { display: flex; align-items: center; gap: .6rem; flex: 1 1 12rem; min-width: 0; max-width: 30rem; border-radius: 999px; background: #f5f5f6; border-color: transparent; }
.control-popup { position: relative; }
.control-popup > summary { min-height: 44px; display: flex; align-items: center; justify-content: center; gap: .45rem; list-style: none; padding: .52rem .8rem; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); cursor: pointer; font-weight: 500; white-space: nowrap; font-size: .85rem; }
.control-popup > summary::-webkit-details-marker { display: none; }
.control-popup[open] > summary, .control-popup > summary:hover { background: var(--raised); }
.control-popup summary svg, .page-arrow svg { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.control-popup summary .chevron { width: 14px; height: 14px; color: var(--muted); }
.popup-panel { position: absolute; z-index: 8; right: 0; top: calc(100% + .5rem); width: 14rem; max-width: calc(100vw - 2rem); display: grid; gap: .4rem; padding: .85rem; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: 0 12px 40px #102b3426; }
.popup-panel label { margin-left: .15rem; color: var(--muted); font-size: .8rem; font-weight: 630; }
.popup-panel select { width: 100%; font-size: .88rem; }
.view-options-panel select + label { margin-top: .25rem; }
.view-options-panel button { text-align: left; margin-top: .2rem; }
.date-options.has-filter > summary { border-color: #a2cdd7; background: var(--raised); color: var(--accent-hover); }
.date-panel input { width: 100%; min-width: 0; min-height: 44px; padding: .5rem .65rem; border: 1px solid var(--line); border-radius: 9px; font: inherit; color: var(--ink); background: var(--panel); }
.filter-row { display: flex; align-items: center; justify-content: space-between; gap: .3rem .7rem; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.status-segments { position: relative; display: inline-flex; align-items: stretch; flex-wrap: wrap; min-width: 0; gap: 1.5rem; padding: 0; margin: 0; border: 0; }
.status-segments label { position: relative; display: flex; cursor: pointer; }
.status-segments input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.status-segments span { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: .55rem 0; border-bottom: 2px solid transparent; font-size: .85rem; font-weight: 450; color: var(--muted); }
.status-segments input:checked + span { color: var(--accent-hover); border-bottom-color: var(--accent); font-weight: 650; }
.status-segments input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
.status-segments label:hover span { color: var(--accent-hover); }
#reset-filters { color: var(--muted); font-size: .82rem; padding-inline: .45rem; }
.search svg { color: var(--muted); width: 19px; height: 19px; flex: none; }
.search input { border: 0; font: inherit; width: 100%; background: transparent; color: var(--ink); min-width: 0; }
.search:focus-within { outline: 2px solid var(--accent); }
.search input:focus { outline: none; }
#clear-date { color: var(--accent-hover); }
#download-history-note { margin: .35rem .2rem; color: var(--muted); font-size: .78rem; line-height: 1.5; }
.status:empty { display: none; }
.status { margin-block: 1.1rem; }
.calendar-browser { margin-top: .5rem; }
.calendar-navigation { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .25rem .75rem; }
#toggle-browse-mode { color: var(--accent-hover); font-size: .82rem; }
#calendar-breadcrumb ol { display: flex; align-items: center; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; gap: .25rem; }
#calendar-breadcrumb li { display: flex; align-items: center; gap: .25rem; }
#calendar-breadcrumb li + li::before { content: "/"; color: #a1a1aa; font-size: .8rem; }
#calendar-breadcrumb button { min-height: 44px; padding: .35rem .55rem; border: 0; background: transparent; color: var(--muted); font-size: .82rem; }
#calendar-breadcrumb button:disabled { color: var(--ink); opacity: 1; font-weight: 600; }
#calendar-breadcrumb button:enabled:hover { color: var(--accent-hover); background: var(--raised); }
.calendar-heading { margin: .75rem 0 1.5rem; text-align: center; }
.calendar-heading h2 { margin: 0; color: var(--ink); font-size: clamp(1.6rem, 4vw, 2.3rem); line-height: 1.2; letter-spacing: -.045em; }
.calendar-heading h2:focus { outline: none; }
.calendar-heading p { margin: .55rem 0 0; color: var(--muted); font-size: .95rem; }
.calendar-browser[data-level=photos] .calendar-heading { margin: .6rem 0 1.2rem; text-align: left; }
.calendar-browser[data-level=photos] .calendar-heading h2 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); letter-spacing: -.025em; }
.gallery { container-type: inline-size; min-height: 10rem; }
.gallery-skeleton { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
.skeleton-card { display: block; aspect-ratio: 3 / 4; border-radius: 12px; }
.skeleton-card, .tile button[data-image=loading]::before, .album-card[data-image=loading]::before {
  background: linear-gradient(100deg, #f1f3f4 20%, #fafbfc 45%, #f1f3f4 70%); background-size: 220% 100%; animation: photo-shimmer 1.5s linear infinite;
}
.tile button[data-image=loading]::before, .album-card[data-image=loading]::before { content: ''; position: absolute; inset: 0; }
.tile button[data-image=loading]::after, .album-card[data-image=loading]::after, .lightbox-media[data-image=loading]::after {
  content: ''; position: absolute; z-index: 1; top: calc(50% - .7rem); left: calc(50% - .7rem); width: 1.4rem; height: 1.4rem;
  border: 2px solid #b9d9df; border-top-color: var(--accent); border-radius: 50%; animation: photo-spin .8s linear infinite;
}
.tile button[data-image=loading] .tile-meta { visibility: hidden; }
.gallery-more { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .45rem; min-height: 96px; padding: 1.5rem .5rem 2.5rem; color: var(--muted); font-size: .86rem; }
.gallery-more button { color: var(--accent-hover); }
.gallery-more[data-loading=true] #more-status::before, .status[data-loading=true]::before, .intro[data-loading=true]::before, .primary[aria-busy=true]::before {
  content: ''; display: inline-block; width: .9rem; height: .9rem; margin-right: .6rem; vertical-align: -.15rem;
  border: 2px solid #b9d9df; border-top-color: var(--accent); border-radius: 50%; animation: photo-spin .8s linear infinite;
}
.preview-loading { position: absolute; z-index: 1; top: calc(50% + 1.1rem); left: 50%; transform: translateX(-50%); padding: .35rem .65rem; border-radius: 8px; background: #17313e; color: #f0fbfe; font-size: .8rem; white-space: nowrap; }
.lightbox-media:not([data-image=loading]) .preview-loading { display: none; }
@container (min-width: 640px) { .gallery-skeleton { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container (min-width: 1080px) { .gallery-skeleton { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@keyframes photo-spin { to { transform: rotate(360deg); } }
@keyframes photo-shimmer { to { background-position: -220% 0; } }
@media (prefers-reduced-motion: reduce) {
  .skeleton-card, .tile button[data-image=loading]::before, .album-card[data-image=loading]::before,
  .tile button[data-image=loading]::after, .album-card[data-image=loading]::after, .lightbox-media[data-image=loading]::after,
  .gallery-more[data-loading=true] #more-status::before, .status[data-loading=true]::before, .intro[data-loading=true]::before, .primary[aria-busy=true]::before { animation: none; }
}
.photo-group { margin-block: 0 2rem; }
.bento-grid { display: grid; grid-template-columns: minmax(0, 1fr); grid-auto-rows: 72px; grid-auto-flow: dense; gap: 1rem; }
.bento-grid > * { grid-row: span 3; min-width: 0; }
.album-card { position: relative; overflow: hidden; min-height: 0; padding: 0; border: 0; border-radius: 18px; background: var(--rail); text-align: left; isolation: isolate; }
.album-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.album-card[data-image=ready] img { opacity: 1; }
.album-card:enabled:hover { background: var(--rail); }
.album-copy { position: absolute; inset: auto 0 0; z-index: 1; display: grid; gap: .15rem; padding: 3rem 1.15rem 1.1rem; color: #fff; background: linear-gradient(transparent, #071a29d9); }
.album-copy strong { font-size: clamp(1.65rem, 4cqw, 3rem); font-weight: 700; letter-spacing: -.045em; line-height: 1.1; }
.album-count { font-size: .88rem; font-weight: 500; }
.album-hint { margin-top: .2rem; font-size: .75rem; color: #ddf3f5; opacity: 0; transform: translateY(6px); }
.album-card:hover .album-hint, .album-card:focus-visible .album-hint { opacity: 1; transform: none; }
.tile { position: relative; min-width: 0; min-height: 0; }
.tile button { position: relative; display: block; width: 100%; height: 100%; min-height: 0; border-radius: 18px; border: 0; padding: 0; overflow: hidden; background: #f5f5f6; cursor: zoom-in; }
.tile button:enabled:hover { background: #f5f5f6; }
.tile img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.tile button[data-image=ready] img { opacity: 1; }
.gallery .bento-photos { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .85rem; }
.gallery .bento-photos > .tile { flex: 0 0 auto; width: calc((100% - .85rem) / 2); margin: 0; }
.gallery .bento-photos .tile button { height: auto; aspect-ratio: 3 / 4; border-radius: 12px; }
.gallery .bento-photos .tile img { height: 100%; aspect-ratio: auto; object-fit: contain; }
.gallery .bento-photos .tile button[data-image=unavailable] { aspect-ratio: 3 / 4; }
.gallery .bento-photos[data-count="1"] { columns: 1; max-width: 28rem; }
.gallery[data-single-day=true] .tile-meta time { display: none; }
.gallery[data-single-day=true] .tile-meta:not(:has(.tile-caption)) { display: none; }
.gallery[data-single-day=true] .tile-meta { opacity: 0; transition: opacity 150ms ease; }
.bento-photos .tile:hover .tile-meta, .bento-photos .tile:focus-within .tile-meta { opacity: 1; }
@container (min-width: 480px) {
  .bento-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bento-grid > :nth-child(7n + 2), .bento-grid > :nth-child(7n + 4), .bento-grid > :nth-child(7n + 6) { grid-column: span 2; grid-row: span 2; }
  .gallery.compact .bento-photos { column-count: 3; }
  .bento-grid[data-count="1"] { grid-template-columns: minmax(0, 1fr); grid-auto-rows: 96px; }
  .bento-grid[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bento-grid[data-count="1"] > *, .bento-grid[data-count="2"] > * { grid-column: auto; grid-row: span 3; }
  .bento-grid[data-count="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bento-grid[data-count="3"] > :first-child { grid-column: span 1; grid-row: span 4; }
  .bento-grid[data-count="3"] > :nth-child(2), .bento-grid[data-count="3"] > :nth-child(3) { grid-column: span 2; grid-row: span 2; }
  .bento-grid[data-count="4"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bento-grid[data-count="4"] > * { grid-row: span 3; grid-column: span 1; }
  .bento-grid[data-count="4"] > :nth-child(2), .bento-grid[data-count="4"] > :nth-child(3) { grid-column: span 2; }
}
@container (min-width: 760px) {
  .bento-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .gallery.compact .bento-photos { column-count: 4; }
}
@container (min-width: 640px) {
  .gallery .bento-photos { column-count: 3; }
}
@container (min-width: 1080px) {
  .gallery .bento-photos { column-count: 4; }
}
@container (min-width: 1080px) { .gallery.compact .bento-photos { column-count: 5; } }
.gallery .bento-photos[data-count="2"] { column-count: 2; max-width: 56rem; }
.gallery .bento-photos[data-count="1"] { column-count: 1; }
.tile-unavailable { display: none; position: absolute; inset: 0; place-items: center; padding: .7rem; color: var(--muted); font-size: .75rem; }
.tile button[data-image=unavailable] .tile-unavailable { display: grid; }
.tile-meta {
  position: absolute; inset: auto 0 0; padding: 1.45rem .7rem .55rem; display: flex; align-items: baseline; gap: .5rem;
  background: linear-gradient(transparent, #091c26da); color: #fff; text-align: left; font-size: .76rem;
}
.tile-meta time { flex: none; font-weight: 720; }
.tile-caption { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 520; }
.tile button:focus-visible { z-index: 1; }
.tile:has(input:checked) button { outline: 3px solid var(--accent); outline-offset: -3px; }
.tile label { position: absolute; z-index: 1; right: .25rem; top: .25rem; display: grid; place-items: center; width: 44px; height: 44px; cursor: pointer; }
.tile input { appearance: none; display: grid; place-items: center; width: 24px; height: 24px; margin: 0; border: 2px solid #fff; border-radius: 50%; background: #122c3799; cursor: pointer; }
.tile input:checked { background: var(--accent); }
.tile input:checked::before { content: ""; width: 13px; height: 11px; background: #fff; clip-path: polygon(0 52%, 17% 36%, 40% 61%, 83% 10%, 100% 25%, 41% 94%); }
.tile input:focus-visible { outline-color: white; }
.downloaded-mark { position: absolute; z-index: 1; left: .45rem; top: .55rem; display: flex; align-items: center; gap: .35rem; max-width: calc(100% - 3.5rem); border-radius: 99px; padding: .25rem .5rem; font-size: .7rem; font-weight: 650; color: #fff; background: #104d43ee; pointer-events: none; }
.downloaded-mark::before { content: ""; flex: none; width: 11px; height: 9px; background: currentColor; clip-path: polygon(0 52%, 17% 36%, 40% 61%, 83% 10%, 100% 25%, 41% 94%); }
.preview-download-state { display: inline-block; font-size: .78rem; color: #bed9e1; margin-top: .2rem; }
.preview-download-state.is-downloaded { color: #9de9c2; }
.pagination { display: flex; justify-content: space-between; align-items: center; gap: .4rem .75rem; flex-wrap: wrap; padding-block: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; font-size: .82rem; }
.results-actions { display: flex; align-items: center; gap: .6rem; margin-left: auto; }
#select-visible { padding-inline: .45rem; font-size: .82rem; font-weight: 600; color: var(--accent-hover); }
.page-controls { display: flex; align-items: center; gap: .05rem; padding: .1rem; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); }
.page-controls .page-arrow { display: grid; place-items: center; width: 40px; min-height: 40px; padding: 0; background: transparent; border-color: transparent; }
.page-options > summary { border: 0; min-height: 40px; padding: .45rem .5rem; font-size: .82rem; }
#jump-page { display: grid; gap: .45rem; }
.jump-input { display: flex; gap: .45rem; }
#page-jump { flex: 1; min-width: 0; min-height: 44px; width: 5rem; border: 1px solid var(--line); background: var(--panel); border-radius: 9px; padding-inline: .65rem; color: var(--ink); font: inherit; }
#page-total { font-size: .78rem; color: var(--muted); }
.page-shortcuts { display: flex; justify-content: space-between; padding-top: .25rem; border-top: 1px solid var(--line); }
.page-shortcuts button { padding-inline: .4rem; font-size: .8rem; color: var(--accent-hover); }
.empty-state { display: grid; justify-items: center; text-align: center; gap: .6rem; padding: 2.5rem 1rem 3rem; color: var(--muted); }
.empty-state svg { width: 40px; height: 40px; padding: .45rem; box-sizing: content-box; color: var(--accent); border-radius: 14px; background: var(--raised); fill: none; stroke: currentColor; stroke-width: 1.5; }
.empty-state strong { margin-top: .3rem; color: var(--ink); font-size: 1.1rem; font-weight: 650; letter-spacing: -.02em; }
.empty-state p { margin: 0; font-size: .88rem; }
.empty-state button { margin-top: .35rem; }
.selection { position: fixed; z-index: 2; bottom: 1rem; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 1.5rem); padding: .5rem .55rem .5rem 1rem; background: var(--panel); border: 1px solid var(--line); border-radius: 11px; box-shadow: 0 8px 30px #25334424; }
.export-panel { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding: .75rem 0; margin-bottom: 1.25rem; }
.export-copy { flex: 1 1 15rem; min-width: 0; }
.export-copy strong { overflow-wrap: anywhere; font-size: .85rem; font-weight: 550; }
.export-copy p { margin: .15rem 0 0; color: var(--muted); font-size: .8rem; }
.export-copy progress { display: block; width: min(100%, 25rem); height: .4rem; margin-top: .55rem; accent-color: var(--accent); }
.earlier-exports { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: .45rem; }
.earlier-exports:empty { display: none; }
.earlier-exports a { display: inline-flex; align-items: center; color: var(--accent-hover); }
#preview { width: min(86rem, calc(100% - 1.5rem)); max-height: calc(100% - 1.5rem); border: 0; padding: .4rem .65rem .7rem; overflow: visible; background: transparent; color: var(--rail-ink); }
#preview::backdrop { background: rgb(0 0 0 / .8); backdrop-filter: blur(32px); opacity: var(--backdrop-opacity, 1); }
.lightbox-head, .lightbox-footer { justify-content: space-between; padding: .1rem .25rem; }
.lightbox-head span { color: #bed9e1; font-variant-numeric: tabular-nums; }
.icon-button { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 50%; }
.icon-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#preview .icon-button { color: var(--rail-ink); background: #17313eeb; border: 1px solid #41616d; }
#preview .icon-button:enabled:hover { background: #315969; }
#preview :focus-visible { outline-color: #8ee4ec; }
.lightbox-stage { position: relative; display: grid; place-items: center; height: min(64dvh, 53rem); margin-block: .45rem; }
.lightbox-media { position: absolute; inset: 0 3.25rem; touch-action: none; cursor: zoom-in; overflow: hidden; border-radius: 12px; }
.lightbox-media.is-zoomed { cursor: grab; }
.lightbox-media.is-zoomed:active { cursor: grabbing; }
.lightbox-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; user-select: none; }
#preview-image { opacity: 0; }
.lightbox-media[data-image=ready] #preview-image { opacity: 1; }
.lightbox-media[data-image=ready] #preview-thumb { visibility: hidden; }
.lightbox-media.in-flight { opacity: 0; }
.preview-message { position: absolute; bottom: .5rem; left: 50%; transform: translateX(-50%); width: max-content; max-width: 100%; padding: .35rem .65rem; border-radius: 8px; background: #17313e; color: #f0fbfe; }
.lightbox-stage button { position: absolute; z-index: 1; }
#previous { left: 0; }
#next { right: 0; }
.photo-flight { position: fixed; z-index: 3; top: 0; left: 0; object-fit: cover; transform-origin: top left; pointer-events: none; }
.preview-strip { display: flex; justify-content: center; align-items: center; width: max-content; max-width: 100%; min-height: 78px; margin: .9rem auto .45rem; padding: 10px 17px; border: 1px solid #93d9e65c; border-radius: 18px; background: #d8f4fa24; box-shadow: 0 10px 32px #0003; }
.preview-strip button { position: relative; flex: 0 0 auto; width: clamp(44px, 8vw, 62px); min-height: 48px; height: 48px; margin-inline: -5px; padding: 0; border: 2px solid #deeff1; border-radius: 9px; overflow: hidden; background: #17313e; box-shadow: 0 3px 7px #0004; transform-origin: center; will-change: transform; }
.preview-strip button:hover, .preview-strip button:focus-visible { border-color: #f0fbfe; }
.preview-strip button[aria-current=true] { border: 2px solid #8ee4ec; box-shadow: 0 0 0 3px #103946, 0 8px 16px #0005; }
.preview-strip img { display: block; width: 100%; height: 100%; object-fit: cover; }
.preview-actions { display: flex; gap: .5rem; }
.zoom-controls { display: flex; justify-content: center; gap: 2px; margin: .4rem auto 0; width: max-content; border: 1px solid #41616d; border-radius: 99px; background: #17313eeb; overflow: hidden; }
.zoom-controls button { min-width: 44px; min-height: 44px; padding: .3rem .7rem; background: transparent; color: #f0fbfe; border: 0; border-radius: 0; font-size: 1.2rem; }
.zoom-controls #zoom-reset { min-width: 68px; font-size: .8rem; font-variant-numeric: tabular-nums; }
.zoom-controls button:enabled:hover { background: #315969; }
.favorites-option svg, .favorite-toggle svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.favorites-option { gap: .75rem; }
#favorites-count { margin-left: auto; font-size: .8rem; font-variant-numeric: tabular-nums; }
.gallery .bento-photos .tile .tile-favorite { position: absolute; left: .25rem; top: .25rem; display: grid; place-items: center; width: 44px; height: 44px; min-height: 44px; aspect-ratio: 1; padding: 10px; border-radius: 50%; background: #122c3799; color: #fff; cursor: pointer; z-index: 1; }
.favorite-toggle[aria-pressed=true] svg { fill: currentColor; }
.gallery .bento-photos .tile .tile-favorite[aria-pressed=true], #preview .favorite-toggle[aria-pressed=true] { color: #ffb6c9; }
@media (hover: hover) { .tile-favorite[aria-pressed=false] { opacity: 0; } .tile:hover .tile-favorite, .tile:focus-within .tile-favorite { opacity: 1; } }
@media (prefers-reduced-motion: no-preference) { .preview-strip button { transition: border-color 180ms ease, box-shadow 180ms ease; } }
.lightbox-footer { padding-top: .65rem; align-items: start; flex-wrap: wrap; }
.lightbox-footer p { color: #bed9e1; margin: .15rem 0; overflow-wrap: anywhere; }
@media (prefers-reduced-motion: no-preference) {
  .album-card { transition: transform 220ms cubic-bezier(.2,.8,.2,1), box-shadow 220ms ease; }
  .album-card img { transition: opacity 200ms ease, transform 350ms cubic-bezier(.2,.8,.2,1); }
  .album-hint { transition: transform 180ms ease, opacity 180ms ease; }
  .album-card:active { transform: scale(.98); }
  .tile img { transition: opacity 200ms ease-out, transform 350ms cubic-bezier(.2,.8,.2,1); }
  .tile button:active img { transform: scale(.95); }
  #preview[open]::backdrop { animation: shade-in 260ms ease-out; }
  #preview.is-closing::backdrop { animation: shade-out 220ms ease-out both; }
  #preview-image { transition: opacity 160ms ease-out; }
  .lightbox-media[data-image=ready] #preview-thumb { transition: visibility 0s 160ms; }
  
  @keyframes shade-in { from { opacity: 0; } }
  @keyframes shade-out { to { opacity: 0; } }
}
@media (hover: hover) {
  .tile-meta, .tile label { opacity: 0; transition: opacity 180ms ease-out; }
  .tile:hover .tile-meta, .tile:focus-within .tile-meta, .tile:hover label, .tile:focus-within label,
  .gallery:has(input:checked) .tile label { opacity: 1; }
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .album-card:hover { transform: translateY(-3px); box-shadow: 0 12px 32px #102b3424; }
  .album-card:hover img, .tile button:hover:not(:active) img { transform: scale(1.04); }
}
@media (hover: none) { .album-hint { opacity: 1; transform: none; } }
@media (max-width: 780px) {
  .shell { width: calc(100% - 1.5rem); }
  .student-panel { gap: .5rem; margin-bottom: 2rem; }
  .student-panel h2 { width: 100%; }
  .library-title { margin-block: 0 1.75rem; }
  .topbar { min-height: 58px; }
  .connection { display: none; }
  .lightbox-media { inset-inline: 0; }
  .lightbox-stage { height: min(61dvh, 52rem); }
}
@media (max-width: 420px) {
  .library-actions, .library-actions button { width: 100%; }
  .gallery-controls { padding: 0; }
  .toolbar .search { flex-basis: 100%; }
  .date-options { flex: 1; }
  .status-segments { width: 100%; }
  .status-segments { gap: 1.15rem; }
  .status-segments span { font-size: .8rem; }
  .results-actions { justify-content: space-between; width: 100%; margin-left: 0; }
  .page-summary { padding-block: .2rem; }
  .gallery.compact .tile-caption { display: none; }
  .gallery.compact .downloaded-mark { max-width: none; font-size: 0; gap: 0; padding: .4rem; }
  .lightbox-stage { height: min(56dvh, 45rem); }
}

@media (max-width: 780px) { .lightbox-stage { height: min(53dvh, 52rem); } .favorites-option { width: auto; } }
@media (max-width: 420px) { .lightbox-stage { height: min(48dvh, 45rem); } .lightbox-head > span { font-size: .75rem; max-width: 60%; } .preview-strip { margin-top: .6rem; } }

.media-filter select { min-height: 44px; color: var(--accent-hover); font-size: .85rem; }
.lightbox-media video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; max-width: 100%; max-height: 100%; object-fit: contain; object-position: center; border-radius: 12px; background: #081e28; }
.lightbox-media[data-kind=video] { display: block; cursor: default; touch-action: auto; }
.lightbox-media[data-kind=video] .preview-message { pointer-events: none; bottom: 4rem; }
.zoom-controls svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.tile .video-mark { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: #103946ad; border: 1px solid #ffffffa6; color: #fff; z-index: 1; pointer-events: none; }
.video-mark svg { width: 24px; height: 24px; fill: currentColor; }
.video-kind { display: inline-block; font-weight: 650; }
.preview-strip button[data-kind=video]::after { content: ''; position: absolute; right: 5px; bottom: 5px; width: 10px; height: 12px; background: #fff; clip-path: polygon(0 0,100% 50%,0 100%); filter: drop-shadow(0 1px 2px #000); }

.native-sign-in { max-width: 28rem; margin: clamp(1.5rem, 7vh, 5rem) auto; }
.login-panel h1 { margin: 0 0 1.75rem; font-size: 1.65rem; letter-spacing: -.035em; }
.login-disclaimer { margin: -1rem 0 1.4rem; color: var(--muted); font-size: .86rem; line-height: 1.6; }
.login-panel form { display: grid; gap: .6rem; }
.login-panel label { margin-top: .6rem; font-size: .88rem; font-weight: 600; }
.login-panel input, .login-panel select { min-width: 0; width: 100%; min-height: 48px; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); font: inherit; font-size: 16px; }
.login-panel input:focus { border-color: var(--accent); outline: 2px solid var(--raised); }
.password-field { position: relative; }
.password-field input { padding-right: 4.5rem; }
.password-field button { position: absolute; right: .2rem; top: .1rem; min-height: 44px; font-size: .8rem; color: var(--accent-hover); }
.login-panel .primary { width: 100%; margin-top: 1rem; min-height: 48px; }
.forgot-password { justify-self: center; padding: .6rem; color: var(--accent-hover); font-size: .85rem; text-decoration: none; }
.login-privacy { margin: 1.75rem 0 0; font-size: .78rem; line-height: 1.6; color: var(--muted); }
.login-links { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin-top: .5rem; }
.login-links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent-hover); font-size: .85rem; text-underline-offset: 3px; }
.login-panel #status { font-size: .88rem; line-height: 1.5; color: var(--muted); }
.login-panel #status:empty { display: none; }
@media (max-width: 420px) { .native-sign-in { width: calc(100% - 2rem); } }
