/* =====================================================================
   KPCE PAST QUESTIONS LIBRARY — STYLES
   Brand: navy #0B2D72 · blue #0992C2 · cyan #0AC4E0 · cream #F6E7BC
   Contrast notes (WCAG AA): text on white uses navy (12.9:1) or --blue-text
   (#07729A, 5.4:1). The brand blue #0992C2 (3.6:1 on white) is used for
   fills, large text, icons and chart bars only. Cyan is an accent with navy text.
   ===================================================================== */

:root {
  --navy: #0B2D72;
  --navy-700: #0A275F;
  --navy-900: #071B47;
  --blue: #0992C2;
  --blue-text: #07729A;
  --cyan: #0AC4E0;
  --cream: #F6E7BC;
  --cream-soft: #FBF4DF;
  --white: #FFFFFF;
  --bg: #F4F7FB;
  --surface: #FFFFFF;
  --line: #E3E9F2;
  --line-strong: #CBD5E3;
  --text: #13223F;
  --text-2: #475569;
  --text-3: #64748B;
  --ok: #0F7A4A;
  --ok-bg: #E3F6EC;
  --warn: #8A5A00;
  --warn-bg: #FFF1D1;
  --danger: #B42318;
  --danger-bg: #FDE8E7;
  --info-bg: #E3F4FA;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(11, 45, 114, .06), 0 1px 3px rgba(11, 45, 114, .08);
  --shadow: 0 4px 14px rgba(11, 45, 114, .08), 0 1px 3px rgba(11, 45, 114, .06);
  --shadow-lg: 0 18px 50px rgba(7, 27, 71, .22);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sidebar-w: 260px;
  --sidebar-w-collapsed: 76px;
  --topbar-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55;
  color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--blue-text); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: .88em; background: #EEF3F9; padding: .1em .35em; border-radius: 5px; color: var(--navy); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .4em; color: var(--navy); letter-spacing: .01em; }
p { margin: 0 0 .8em; }
hr { border: 0; border-top: 1px solid var(--line); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; border-radius: 6px; }

/* ---------- CAPITALS: labels, buttons, menus, headers, badges, titles ---------- */
label, .btn, button, .badge, th, .tab, .page-title, .page-sub, .card-head h2, .side-nav, .topnav-links,
.dropdown-head, .dropdown-menu a, .menu-btn, .stat-label, .help, .error-text, .alert, .empty-state h3,
.empty-state p, .hero-kicker, .tag, .online-pill, .toast, .modal-head h2, .auth-heading, .auth-tagline,
.auth-points, .auth-foot, .meta-list dt, .paper-code, .paper-meta, .views, .section-title, .slot-label,
.result-count, .muted, .page-link, .zoom-level, .viewer-pageinfo, .site-footer, legend,
.check, .switch-label, .checklist, .sidebar-foot, .side-heading, .topbar-title, .tips, .fine-print, .dz-text,
.nav-label, .hbar-label, .legend, .chart text, .stat-tile small, .notif-empty, .year-chip, .col-list, .steps-list {
  text-transform: uppercase;
}

/* ---------- UTILITIES ---------- */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 1000; background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 8px; font-weight: 700; }
.skip-link:focus { top: 12px; }
.icon { width: 20px; height: 20px; flex: none; vertical-align: middle; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 32px; height: 32px; }
.icon-xl { width: 48px; height: 48px; }
.muted, .muted-text { color: var(--text-3); }
.muted-text { font-size: .85em; }
.t-right { text-align: right; }
.t-center { text-align: center; }
.nowrap { white-space: nowrap; }
.ok-text { color: var(--ok) !important; }
.warn-text { color: var(--warn) !important; }
.danger-text { color: var(--danger) !important; }
.stack > * + * { margin-top: 14px; }
.inline { display: inline; }
.as-stored { text-transform: none; }
.h2 { font-size: 1.25rem; }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 9px 18px; border-radius: 10px; border: 2px solid transparent;
  font: inherit; font-weight: 700; font-size: .86rem; letter-spacing: .04em; line-height: 1.1;
  cursor: pointer; text-decoration: none !important; white-space: nowrap;
  transition: background .15s, box-shadow .15s, transform .05s, border-color .15s, color .15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.is-loading { opacity: .65; cursor: not-allowed; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-700); box-shadow: 0 4px 14px rgba(11,45,114,.3); }
.btn-accent { background: var(--cyan); color: var(--navy); }
.btn-accent:hover { background: #2AD0E8; }
.btn-outline { background: #fff; color: var(--navy); border-color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: #fff; }
.btn-ghost { background: #fff; color: var(--navy); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue-text); background: #F4FBFE; }
.btn-success { background: var(--ok); color: #fff; }
.btn-success:hover { background: #0B6239; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #8F1C13; }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: .78rem; border-radius: 8px; }
.btn-lg { min-height: 50px; padding: 12px 26px; font-size: .95rem; }
.btn-block { width: 100%; }
.btn .spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid transparent; background: transparent; color: var(--navy); cursor: pointer; position: relative;
  transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: #EAF4FB; color: var(--blue-text); }
.icon-btn.danger { color: var(--danger); }
.icon-btn.danger:hover { background: var(--danger-bg); }
.link-btn { background: none; border: 0; padding: 0; color: var(--blue-text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }
.link-btn.danger { color: var(--danger); }

/* Tooltips for icon buttons (title attribute is kept for touch / screen readers). */
[data-tip] { position: relative; }
.tooltip {
  position: fixed; z-index: 2000; pointer-events: none; background: var(--navy-900); color: #fff;
  font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: 6px 9px; border-radius: 6px; box-shadow: var(--shadow); white-space: nowrap; transform: translate(-50%, -100%);
}

/* ---------- BADGES ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px;
  font-size: .7rem; font-weight: 800; letter-spacing: .06em; line-height: 1.4; white-space: nowrap;
}
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-muted { background: #EEF2F7; color: var(--text-2); }
.badge-info { background: var(--info-bg); color: var(--blue-text); }
.badge-navy { background: var(--navy); color: #fff; }

/* ---------- ALERTS ---------- */
.alert {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid; font-size: .86rem; font-weight: 600; margin: 0 0 14px; letter-spacing: .01em;
}
.alert .icon { margin-top: 1px; }
.alert-success { background: var(--ok-bg); border-color: #B6E3CB; color: #0B5D38; }
.alert-danger { background: var(--danger-bg); border-color: #F5C2BE; color: #8F1C13; }
.alert-warning { background: var(--warn-bg); border-color: #F2D693; color: #6E4700; }
.alert-info { background: var(--info-bg); border-color: #B5E0F0; color: #05506D; }
.alert code { background: rgba(255,255,255,.6); }

/* ---------- CARDS ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); margin-bottom: 20px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head h2 { font-size: .95rem; margin: 0; display: flex; align-items: center; gap: 8px; letter-spacing: .05em; }
.card-head h2 .icon { color: var(--blue); }
.card-body { padding: 18px 20px; }
.card-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.card-foot:has(.pagination) { justify-content: space-between; }
.card-cream { background: var(--cream-soft); border-color: #EEDDAA; }
.card-cream .card-head { border-color: #EEDDAA; }
.narrow { max-width: 520px; margin: 0 auto; }
.narrow-card { max-width: 620px; }

/* ---------- FORMS ---------- */
.field { margin-bottom: 16px; min-width: 0; }
.field > label { display: block; font-weight: 800; font-size: .78rem; letter-spacing: .06em; color: var(--navy); margin-bottom: 6px; }
.req { color: var(--danger); }
input[type=text], input[type=url], input[type=search], input[type=email], input[type=password], input[type=number], input[type=tel], input[type=date], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; font: inherit; font-size: .95rem; color: var(--text);
  background: #fff; border: 1.5px solid var(--line-strong); border-radius: 10px; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 90px; resize: vertical; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230B2D72' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; padding-right: 34px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(10, 196, 224, .22); }
input[type=file] { font: inherit; font-size: .86rem; max-width: 100%; }
.help { display: block; margin-top: 6px; font-size: .74rem; color: var(--text-3); letter-spacing: .03em; font-weight: 600; }
.help code { text-transform: none; }
.error-text { display: block; margin-top: 6px; font-size: .76rem; font-weight: 800; color: var(--danger); letter-spacing: .03em; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger); background: #FFFBFA; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.form-grid.tight { gap: 0 12px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: .82rem; letter-spacing: .03em; margin: 8px 0; cursor: pointer; color: var(--navy); }
.check input { width: 18px; height: 18px; accent-color: var(--navy); }
.input-icon { position: relative; }
.input-icon > .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-icon input { padding-left: 42px; }
.input-icon .input-action { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; background: none; color: var(--text-3); border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.input-icon .input-action:hover { color: var(--navy); background: #EEF3F9; }
.input-icon input[type=password], .input-icon input[data-has-action] { padding-right: 46px; }
[data-index-input] { text-transform: uppercase; letter-spacing: .03em; }
[data-index-input]::placeholder { text-transform: none; }

/* Toggle switch */
.field-toggle { margin-bottom: 18px; }
.switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.switch input[type=checkbox] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { flex: none; width: 46px; height: 26px; background: var(--line-strong); border-radius: 999px; position: relative; transition: background .2s; margin-top: 1px; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + .switch-track { background: var(--navy); }
.switch input:checked + .switch-track::after { transform: translateX(20px); background: var(--cyan); }
.switch input:focus-visible + .switch-track { outline: 3px solid var(--cyan); outline-offset: 2px; }
.switch-label { font-weight: 800; font-size: .82rem; letter-spacing: .04em; color: var(--navy); line-height: 1.4; padding-top: 3px; }
.field-toggle .help { margin-left: 58px; }

/* Dropzone */
.dropzone {
  display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center;
  padding: 26px 16px; border: 2px dashed var(--line-strong); border-radius: var(--radius-sm); background: #FAFCFE;
  color: var(--text-2); cursor: pointer; transition: border-color .15s, background .15s; font-weight: 700; font-size: .8rem; letter-spacing: .04em;
}
.dropzone.small { padding: 18px 12px; }
.dropzone .icon { color: var(--blue); }
.dropzone:hover, .dropzone.is-drag { border-color: var(--blue); background: #F0FAFD; }
.dropzone.has-file { border-style: solid; border-color: var(--ok); background: var(--ok-bg); color: var(--ok); }
.dropzone input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone { position: relative; }
.has-error .dropzone { border-color: var(--danger); }

/* ---------- TABLES ---------- */
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .72rem; font-weight: 800; letter-spacing: .07em; color: var(--text-2); background: #F7F9FC; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:nth-child(even) td { background: #FFFCF3; }
.table tbody tr:hover td { background: #F1F9FD; }
.table-compact td { padding: 8px 12px; font-size: .84rem; }
.table .t-check { width: 44px; }
.table input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--navy); }
.row-actions { display: inline-flex; gap: 2px; align-items: center; justify-content: flex-end; flex-wrap: nowrap; }
.row-bad td { background: #FFF7F6 !important; }
.cell-paper, .cell-person { display: flex; align-items: center; gap: 12px; }
.cell-paper img { width: 36px; height: 48px; object-fit: cover; border-radius: 5px; box-shadow: var(--shadow-sm); flex: none; background: var(--line); }
.cell-paper span, .cell-person > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.cell-paper small, .cell-person small { color: var(--text-3); font-size: .8rem; }
.reject-reason { margin-top: 6px; font-size: .8rem; color: var(--danger); max-width: 320px; }
.block-reason { display: block; color: var(--text-3); font-size: .75rem; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-details summary { cursor: pointer; color: var(--text-2); font-size: .8rem; }
.log-details pre { white-space: pre-wrap; word-break: break-word; font-size: .75rem; background: #F4F7FB; padding: 8px; border-radius: 8px; max-width: 420px; }
.ua { display: inline-block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- TABS / PAGINATION ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tab { padding: 9px 14px; border-radius: 999px; font-weight: 800; font-size: .76rem; letter-spacing: .06em; color: var(--navy); background: #fff; border: 1px solid var(--line); text-decoration: none !important; display: inline-flex; gap: 8px; align-items: center; }
.tab:hover { border-color: var(--blue); }
.tab.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.tab-count { background: rgba(10,196,224,.18); color: inherit; padding: 1px 8px; border-radius: 999px; font-size: .7rem; }
.tab.active .tab-count { background: var(--cyan); color: var(--navy); }
.pagination { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; justify-content: center; margin: 14px 0 4px; }
.page-link { min-width: 38px; height: 38px; padding: 0 10px; display: inline-grid; place-items: center; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--navy); font-weight: 800; font-size: .78rem; text-decoration: none !important; }
.page-link:hover { border-color: var(--blue); }
.page-link.current { background: var(--navy); color: #fff; border-color: var(--navy); }
.page-link.disabled { opacity: .45; cursor: default; }
.page-gap { padding: 0 4px; color: var(--text-3); }

/* ---------- EMPTY / SKELETON ---------- */
.empty-state { text-align: center; padding: 38px 16px; color: var(--text-3); }
.empty-state .icon { color: var(--blue); opacity: .55; margin-bottom: 8px; }
.empty-state h3 { font-size: 1rem; letter-spacing: .06em; margin-bottom: 6px; }
.empty-state p { font-size: .8rem; max-width: 420px; margin: 0 auto 14px; font-weight: 600; letter-spacing: .03em; }
.skeleton, .skeleton-line { background: linear-gradient(90deg, #EDF1F7 25%, #F7F9FC 37%, #EDF1F7 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 8px; }
.skeleton-line { height: 12px; margin: 10px 0; }
.skeleton-line.short { width: 55%; }
.skeleton-thumb { aspect-ratio: 3 / 4; border-radius: 12px 12px 0 0; }
.skeleton-page { width: min(100%, 640px); aspect-ratio: 1 / 1.414; margin: 0 auto 14px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@media (prefers-reduced-motion: reduce) { .skeleton, .skeleton-line, .pulse-dot::after { animation: none !important; } }

/* ---------- ONLINE INDICATOR ---------- */
.online-pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; background: #E9FBF2; border: 1px solid #BDEBD3; color: #0B5D38; font-size: .74rem; font-weight: 800; letter-spacing: .05em; white-space: nowrap; }
.pulse-dot { width: 9px; height: 9px; border-radius: 50%; background: #16A34A; position: relative; display: inline-block; flex: none; box-shadow: 0 0 0 0 rgba(10,196,224,.6); }
.pulse-dot::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--cyan); opacity: 0; animation: pulse 1.8s ease-out infinite; }
.pulse-dot.big { width: 14px; height: 14px; }
@keyframes pulse { 0% { transform: scale(.5); opacity: .9; } 100% { transform: scale(1.6); opacity: 0; } }
.online-text { display: inline-flex; align-items: center; gap: 8px; color: var(--ok); font-weight: 800; font-size: .78rem; }

/* ---------- AVATAR / DROPDOWN ---------- */
.avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--navy), var(--blue)); color: #fff; font-weight: 800; font-size: .8rem; display: inline-grid; place-items: center; position: relative; flex: none; letter-spacing: .02em; }
.avatar.sm { width: 32px; height: 32px; font-size: .72rem; }
.avatar.xl { width: 84px; height: 84px; font-size: 1.6rem; box-shadow: 0 0 0 5px var(--cream); }
.avatar-online { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: #16A34A; border: 2px solid #fff; }
.avatar-btn { display: flex; align-items: center; gap: 6px; background: none; border: 0; padding: 4px; border-radius: 999px; cursor: pointer; color: var(--navy); font: inherit; font-weight: 700; }
.avatar-btn:hover { background: #EEF3F9; }
.avatar-name { font-size: .82rem; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 300; display: none;
}
.dropdown.open .dropdown-menu { display: block; animation: drop .14s ease-out; }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.dropdown-wide { width: 340px; }
.dropdown-head { padding: 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-weight: 800; font-size: .76rem; letter-spacing: .06em; color: var(--navy); display: flex; flex-direction: column; }
.dropdown-head small { color: var(--text-3); text-transform: none; font-weight: 600; }
.dropdown-menu a, .menu-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 8px; color: var(--text); font-weight: 700; font-size: .8rem; letter-spacing: .03em; background: none; border: 0; cursor: pointer; text-decoration: none !important; text-align: left; font-family: inherit; }
.dropdown-menu a:hover, .menu-btn:hover { background: #F1F7FC; color: var(--navy); }
.dropdown-foot { justify-content: center; border-top: 1px solid var(--line); margin-top: 4px; color: var(--blue-text) !important; }
.count-badge { position: absolute; top: 2px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .66rem; font-weight: 800; display: grid; place-items: center; border: 2px solid #fff; }
.notif-list { max-height: 360px; overflow-y: auto; }
.notif-item { align-items: flex-start !important; }
.notif-item.unread { background: #F1FAFD; }
.notif-icon { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--info-bg); color: var(--blue-text); }
.notif-icon.type-approved { background: var(--ok-bg); color: var(--ok); }
.notif-icon.type-rejected { background: var(--danger-bg); color: var(--danger); }
.notif-icon.type-announcement { background: var(--cream); color: var(--navy); }
.notif-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; text-transform: none; }
.notif-text strong { font-size: .8rem; color: var(--navy); }
.notif-text span, .notif-text p { font-size: .78rem; color: var(--text-2); font-weight: 500; margin: 0; }
.notif-text time { font-size: .7rem; color: var(--text-3); font-weight: 700; }
.notif-empty { padding: 22px; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--text-3); font-size: .78rem; font-weight: 700; }

/* ---------- TOASTS ---------- */
.toast-stack { position: fixed; top: 16px; right: 16px; z-index: 3000; display: flex; flex-direction: column; gap: 10px; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; padding: 13px 14px; border-radius: 12px; background: #fff;
  box-shadow: var(--shadow-lg); border-left: 5px solid var(--blue); font-size: .82rem; font-weight: 700; letter-spacing: .02em; color: var(--text);
  animation: toastIn .25s ease-out;
}
.toast span { flex: 1; }
.toast-success { border-color: var(--ok); } .toast-success > .icon { color: var(--ok); }
.toast-error { border-color: var(--danger); } .toast-error > .icon { color: var(--danger); }
.toast-warning { border-color: #E0A100; } .toast-warning > .icon { color: var(--warn); }
.toast-info > .icon { color: var(--blue-text); }
.toast-close { background: none; border: 0; cursor: pointer; color: var(--text-3); padding: 2px; border-radius: 6px; }
.toast.hide { opacity: 0; transform: translateX(20px); transition: all .3s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

/* ---------- MODALS ---------- */
.modal { position: fixed; inset: 0; z-index: 2500; display: grid; place-items: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(7, 27, 71, .55); backdrop-filter: blur(2px); }
.modal-card { position: relative; width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); animation: modalIn .18s ease-out; }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 1rem; margin: 0; letter-spacing: .05em; }
.modal-body { padding: 18px 20px; }
.modal-body p { font-weight: 600; color: var(--text-2); }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); background: #FAFBFD; border-radius: 0 0 16px 16px; }
body.modal-open { overflow: hidden; }

/* ---------- PAGE HEADER ---------- */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-title { font-size: 1.45rem; margin: 0; letter-spacing: .03em; }
.page-sub { margin: 4px 0 0; color: var(--text-3); font-size: .8rem; font-weight: 700; letter-spacing: .04em; max-width: 760px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* =====================================================================
   AUTH (split screen)
   ===================================================================== */
.auth-body { background: #fff; }
.auth-split { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; }
.auth-brand {
  position: relative; overflow: hidden; color: #fff; display: flex; align-items: center; padding: 56px;
  background: linear-gradient(145deg, var(--navy) 0%, #0A4F96 55%, var(--blue) 100%);
}
.auth-brand::before, .auth-brand::after { content: ""; position: absolute; border-radius: 50%; }
.auth-brand::before { width: 520px; height: 520px; right: -180px; top: -160px; background: radial-gradient(circle, rgba(10,196,224,.35), rgba(10,196,224,0) 70%); }
.auth-brand::after { width: 420px; height: 420px; left: -160px; bottom: -180px; background: radial-gradient(circle, rgba(246,231,188,.25), rgba(246,231,188,0) 70%); }
.auth-brand-inner { position: relative; z-index: 1; max-width: 520px; }
.auth-title { color: #fff; font-size: clamp(1.7rem, 3vw, 2.5rem); font-weight: 900; letter-spacing: .03em; margin: 22px 0 8px; }
.auth-tagline { color: var(--cream); font-weight: 800; letter-spacing: .08em; font-size: .85rem; }
.auth-points { list-style: none; padding: 0; margin: 30px 0; display: grid; gap: 14px; }
.auth-points li { display: flex; gap: 12px; align-items: center; font-weight: 700; font-size: .82rem; letter-spacing: .04em; }
.auth-points .icon { width: 38px; height: 38px; padding: 9px; border-radius: 10px; background: rgba(255,255,255,.12); color: var(--cyan); }
.auth-online .online-pill { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.25); color: #fff; }
.auth-form-side { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: #fff; }
.auth-card { width: min(440px, 100%); }
.auth-heading { font-size: 1.5rem; letter-spacing: .05em; margin-bottom: 4px; }
.auth-form { margin-top: 22px; }
.auth-foot { margin-top: 16px; font-size: .74rem; color: var(--text-3); font-weight: 700; letter-spacing: .03em; text-align: center; }
.brand-logo { width: 40px; height: 40px; border-radius: 10px; object-fit: contain; flex: none; }
.brand-mark { display: inline-grid; place-items: center; background: linear-gradient(135deg, var(--cyan), var(--blue)); color: var(--navy); }
.brand-mark .icon { width: 60%; height: 60%; }
.brand-logo.xl { width: 72px; height: 72px; border-radius: 18px; }
.brand-logo.light.brand-mark { background: var(--cream); color: var(--navy); }
.center-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }

/* =====================================================================
   STUDENT AREA
   ===================================================================== */
.topnav { position: sticky; top: 0; z-index: 200; background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 rgba(11,45,114,.03); }
.topnav-inner { max-width: 1280px; margin: 0 auto; height: 66px; padding: 0 20px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--navy); font-weight: 900; text-decoration: none !important; min-width: 0; }
.brand-text { font-size: .86rem; letter-spacing: .05em; line-height: 1.15; max-width: 210px; text-transform: uppercase; }
.topnav-links { flex: 1; }
.topnav-links ul { list-style: none; display: flex; gap: 2px; margin: 0; padding: 0; }
.topnav-links { min-width: 0; }
.topnav-links a { display: flex; align-items: center; gap: 6px; padding: 9px 10px; border-radius: 10px; font-weight: 800; font-size: .74rem; letter-spacing: .04em; color: var(--text-2); text-decoration: none !important; white-space: nowrap; }
.topnav-links a:hover { color: var(--navy); background: #F1F7FC; }
.topnav-links a.active { color: var(--navy); background: var(--cream); }
.topnav-links a.active .icon { color: var(--blue); }
.topnav-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.nav-toggle { display: none; }
.student-main { max-width: 1280px; margin: 0 auto; padding: 26px 20px 50px; min-height: calc(100vh - 140px); }
.student-main.wide { max-width: 1500px; }
.site-footer { max-width: 1280px; margin: 0 auto; padding: 18px 20px 28px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; color: var(--text-3); font-size: .72rem; font-weight: 700; letter-spacing: .05em; border-top: 1px solid var(--line); }

.hero {
  position: relative; overflow: hidden; border-radius: 20px; padding: 30px 32px; color: #fff; margin-bottom: 22px;
  background: linear-gradient(120deg, var(--navy) 0%, #0A4F96 60%, var(--blue) 100%); box-shadow: var(--shadow);
}
.hero::after { content: ""; position: absolute; right: -100px; top: -120px; width: 360px; height: 360px; border-radius: 50%; background: radial-gradient(circle, rgba(10,196,224,.4), transparent 70%); }
.hero > * { position: relative; z-index: 1; }
.hero-kicker { color: var(--cream); font-weight: 800; letter-spacing: .08em; font-size: .8rem; margin: 0; }
.hero-title { color: #fff; font-size: clamp(1.4rem, 3vw, 2rem); margin: 2px 0 12px; }
.hero-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: .74rem; font-weight: 800; letter-spacing: .05em; }
.tag-light { background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.2); }
.hero-search { margin-top: 22px; display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 14px; padding: 6px 6px 6px 14px; max-width: 720px; box-shadow: 0 10px 30px rgba(7,27,71,.25); }
.hero-search .icon { color: var(--text-3); }
.hero-search input { border: 0; box-shadow: none !important; min-height: 46px; padding: 0 6px; }
.hero-note { margin: 12px 0 0; font-size: .74rem; font-weight: 800; letter-spacing: .06em; color: var(--cream); }

.stat-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card, .stat-tile {
  display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); color: var(--text); text-decoration: none !important; position: relative; transition: transform .12s, box-shadow .12s;
}
a.stat-card:hover, a.stat-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 8px; }
.stat-icon.warn { background: var(--warn-bg); color: var(--warn); }
.stat-icon.ok { background: var(--ok-bg); color: var(--ok); }
.stat-icon.danger { background: var(--danger-bg); color: var(--danger); }
.stat-icon.blue { background: var(--info-bg); color: var(--blue-text); }
.stat-icon.online { background: #E9FBF2; }
.stat-icon.cream { background: var(--cream); color: var(--navy); }
.stat-num { font-size: 1.7rem; font-weight: 900; color: var(--navy); line-height: 1.1; }
.stat-label { font-size: .7rem; font-weight: 800; letter-spacing: .07em; color: var(--text-2); }
.stat-online { background: linear-gradient(135deg, #fff, #EFFBFD); border-color: #BFEFF7; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.announce-list { list-style: none; margin: 0; padding: 0; }
.announce-list li + li { border-top: 1px solid #EEDDAA; padding-top: 14px; margin-top: 14px; }
.announce-list h3 { font-size: .95rem; margin-bottom: 2px; }
.announce-list time { font-size: .7rem; font-weight: 800; color: var(--text-3); letter-spacing: .05em; }
.announce-list p { margin: 6px 0 0; font-size: .88rem; color: var(--text-2); }
.cta-card { background: linear-gradient(135deg, #fff, #EAF7FC); }
.cta-card h2 { font-size: 1rem; letter-spacing: .05em; }
.cta-card p { font-size: .78rem; font-weight: 700; color: var(--text-2); letter-spacing: .03em; }

/* Paper cards */
.paper-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px; }
.paper-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s; }
.paper-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.paper-thumb { position: relative; display: block; aspect-ratio: 3 / 4; background: linear-gradient(160deg, var(--navy), var(--blue)); overflow: hidden; }
.paper-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.paper-card:hover .paper-thumb img { transform: scale(1.03); }
.paper-prog { position: absolute; left: 10px; top: 10px; background: var(--cyan); color: var(--navy); font-size: .66rem; font-weight: 900; letter-spacing: .06em; padding: 3px 8px; border-radius: 999px; }
.paper-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.paper-code { font-weight: 900; color: var(--blue-text); font-size: .8rem; letter-spacing: .06em; }
.paper-code.big { font-size: 1rem; }
.paper-title { font-size: .92rem; margin: 0; line-height: 1.3; }
.paper-title a { color: var(--navy); }
.paper-meta { font-size: .72rem; font-weight: 800; color: var(--text-3); letter-spacing: .04em; }
.paper-foot { margin-top: auto; padding-top: 8px; display: flex; justify-content: space-between; align-items: center; }
.views { display: inline-flex; align-items: center; gap: 5px; font-size: .7rem; font-weight: 800; color: var(--text-3); letter-spacing: .04em; }
.fav-mark { color: #C99700; }
.fav-mark .icon { fill: currentColor; }
.fav-wrap { display: flex; flex-direction: column; gap: 6px; }
.skeleton-card .paper-body { gap: 0; }

/* Library */
.library-hero { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 22px; margin-bottom: 18px; box-shadow: var(--shadow-sm); }
.library-hero .page-sub { margin-bottom: 16px; }
.search-box { position: relative; }
.search-box > .icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.search-box input { min-height: 54px; padding-left: 48px; font-size: 1.02rem; border-radius: 14px; border-width: 2px; }
.filter-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) auto; gap: 12px; margin-top: 14px; align-items: end; }
.field.compact { margin: 0; }
.field.compact > label { font-size: .7rem; margin-bottom: 4px; }
.field.compact select, .field.compact input { min-height: 40px; padding-top: 7px; padding-bottom: 7px; font-size: .88rem; }
.filter-actions { display: flex; gap: 8px; }
.result-count { font-weight: 800; font-size: .78rem; letter-spacing: .06em; color: var(--text-2); margin-bottom: 12px; }
#library-results[aria-busy="true"] [data-result-grid] { opacity: .5; }

/* Upload */
.upload-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.tips { margin: 0; padding-left: 18px; font-size: .78rem; font-weight: 700; color: var(--text-2); letter-spacing: .02em; }
.tips li + li { margin-top: 8px; }
.dup-warning { margin-top: 0; }

/* Viewer */
.view-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.viewer { background: #E9EEF5; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.viewer-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; background: var(--navy); color: #fff; flex: none; }
.viewer-toolbar .icon-btn { color: #fff; }
.viewer-toolbar .icon-btn:hover { background: rgba(255,255,255,.12); color: var(--cyan); }
.viewer-tools { display: flex; align-items: center; gap: 2px; }
.viewer-pageinfo, .zoom-level { font-size: .74rem; font-weight: 800; letter-spacing: .06em; }
.zoom-level { min-width: 48px; text-align: center; }
.viewer-pages { height: calc(100vh - 170px); min-height: 480px; overflow: auto; padding: 18px; display: flex; flex-direction: column; align-items: center; gap: 16px; outline: none; }
.viewer-page-wrap { position: relative; background: #fff; box-shadow: 0 4px 18px rgba(7,27,71,.18); flex: none; }
.viewer-page-wrap canvas { display: block; width: 100%; height: 100%; pointer-events: none; }
.viewer-page-wrap .page-num { position: absolute; bottom: -1px; right: 0; background: rgba(11,45,114,.85); color: #fff; font-size: .66rem; font-weight: 800; padding: 2px 8px; border-radius: 6px 0 0 0; }
.viewer-loading { width: 100%; text-align: center; color: var(--text-3); font-weight: 800; font-size: .78rem; letter-spacing: .05em; }
.viewer-error { margin: 40px auto; max-width: 420px; }
.viewer:fullscreen { border-radius: 0; }
.viewer:fullscreen .viewer-pages { height: calc(100vh - 54px); }
.print-block { display: none; }
.view-title { font-size: 1.2rem; margin: 4px 0 14px; }
.meta-list { margin: 0; display: grid; gap: 0; }
.meta-list > div { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.meta-list > div:last-child { border-bottom: 0; }
.meta-list dt { font-size: .7rem; font-weight: 800; letter-spacing: .07em; color: var(--text-3); }
.meta-list dd { margin: 0; font-weight: 700; font-size: .86rem; text-align: right; color: var(--navy); word-break: break-word; }
.notes-box { background: var(--cream-soft); border: 1px solid #EEDDAA; border-radius: 10px; padding: 10px 12px; margin-top: 12px; font-size: .86rem; }
.notes-box strong { font-size: .7rem; letter-spacing: .07em; color: var(--navy); }
.notes-box p { margin: 4px 0 0; }
.view-actions { display: grid; gap: 10px; margin-top: 16px; }
.btn[aria-pressed="true"] .icon { fill: currentColor; }
.related-list { list-style: none; margin: 0; padding: 6px; }
.related-list a { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 10px; color: var(--text); text-decoration: none !important; }
.related-list a:hover { background: #F1F7FC; }
.related-list small { display: block; color: var(--text-3); font-size: .7rem; font-weight: 700; }
.year-chip { background: var(--cream); color: var(--navy); font-weight: 900; font-size: .78rem; padding: 5px 9px; border-radius: 8px; }
.fine-print { display: flex; gap: 8px; font-size: .7rem; font-weight: 700; color: var(--text-3); letter-spacing: .03em; }
.fine-print .icon { color: var(--blue); }

.notif-page-list { list-style: none; margin: 0; padding: 0; }
.notif-page-list li { display: flex; gap: 14px; align-items: flex-start; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.notif-page-list li.unread { background: #F4FBFE; }
.notif-page-list .notif-text { flex: 1; }
.profile-grid { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 20px; align-items: start; }
.profile-card { text-align: center; border-bottom: 1px solid var(--line); }
.profile-card h2 { margin: 14px 0 2px; }

/* =====================================================================
   ADMIN AREA
   ===================================================================== */
.admin-body { background: var(--bg); }
.admin-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: none; background: linear-gradient(180deg, var(--navy) 0%, var(--navy-900) 100%); color: #fff;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; transition: width .2s; z-index: 400;
}
.sidebar-brand { padding: 18px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-brand a { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none !important; font-weight: 900; font-size: .8rem; letter-spacing: .05em; line-height: 1.2; text-transform: uppercase; }
.sidebar-brand small { display: block; color: var(--cyan); font-size: .64rem; letter-spacing: .1em; margin-top: 3px; }
.sidebar nav { padding: 12px 10px; flex: 1; }
.side-nav { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; color: #C9D6EE; font-weight: 800; font-size: .76rem; letter-spacing: .06em; text-decoration: none !important; position: relative; white-space: nowrap; }
.side-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-nav a.active { background: rgba(10,196,224,.16); color: #fff; }
.side-nav a.active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--cyan); }
.side-nav a.active .icon { color: var(--cyan); }
.nav-badge { margin-left: auto; background: var(--cyan); color: var(--navy); font-size: .66rem; font-weight: 900; padding: 2px 8px; border-radius: 999px; }
.side-heading { padding: 16px 12px 6px; font-size: .64rem; font-weight: 900; letter-spacing: .12em; color: var(--cream); opacity: .85; }
.sidebar-foot { padding: 14px 18px; font-size: .64rem; color: #8FA3C7; font-weight: 700; letter-spacing: .08em; }
.sidebar-scrim { display: none; }
.admin-main-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar { position: sticky; top: 0; z-index: 300; height: var(--topbar-h); background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 20px; }
.topbar-title { font-size: .92rem; letter-spacing: .07em; margin: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.admin-main { padding: 24px; max-width: 1600px; width: 100%; }

body.sidebar-collapsed .sidebar { width: var(--sidebar-w-collapsed); }
body.sidebar-collapsed .sidebar .nav-label, body.sidebar-collapsed .nav-badge { display: none; }
body.sidebar-collapsed .side-nav a { justify-content: center; }
body.sidebar-collapsed .sidebar-brand a { justify-content: center; }

.stat-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-grid.small { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-tile small { color: var(--text-3); font-size: .68rem; font-weight: 700; letter-spacing: .04em; margin-top: 2px; }
.stat-tile.highlight { background: linear-gradient(140deg, var(--cream) 0%, #FFF9E6 100%); border-color: #E9CF85; box-shadow: 0 6px 20px rgba(224,170,40,.18); }
.stat-tile.highlight::after { content: ""; position: absolute; top: 14px; right: 14px; width: 10px; height: 10px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 4px rgba(10,196,224,.25); }
.admin-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.admin-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.admin-grid-form { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.card-span { grid-column: 1 / -1; }

/* Charts */
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: #E8EDF4; stroke-width: 1; }
.chart .axis { fill: #64748B; font-size: 11px; font-weight: 700; font-family: var(--font); }
.chart .val { fill: var(--navy); font-size: 11px; font-weight: 800; font-family: var(--font); }
.chart .bar rect { transition: opacity .15s; }
.chart .bar:hover rect { fill: var(--navy); }
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; justify-content: center; }
.donut { width: 190px; flex: none; }
.donut-num { fill: var(--navy); font-size: 32px; font-weight: 900; font-family: var(--font); }
.donut-label { fill: #64748B; font-size: 11px; font-weight: 800; letter-spacing: 2px; font-family: var(--font); }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: .78rem; font-weight: 800; letter-spacing: .04em; }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend small { color: var(--text-3); }
.swatch { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.hbar-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.hbar-top { display: flex; justify-content: space-between; gap: 10px; font-size: .82rem; }
.hbar-label { font-weight: 800; color: var(--navy); letter-spacing: .03em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-label small { color: var(--text-3); font-weight: 700; text-transform: none; }
.hbar-track { height: 9px; background: #EEF2F7; border-radius: 999px; margin-top: 5px; overflow: hidden; }
.hbar-track span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--blue), var(--cyan)); }

.mini-list { list-style: none; margin: 0; padding: 6px 10px; }
.mini-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 8px; border-bottom: 1px solid var(--line); }
.mini-list li:last-child { border-bottom: 0; }
.mini-list a { display: flex; flex-direction: column; min-width: 0; color: var(--text); text-decoration: none !important; }
.mini-list a strong { color: var(--navy); font-size: .86rem; }
.mini-list a span { font-size: .82rem; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-list small { color: var(--text-3); font-size: .72rem; }
.activity-feed { list-style: none; margin: 0; padding: 12px 20px; max-height: 420px; overflow-y: auto; }
.activity-feed li { display: flex; gap: 12px; padding: 8px 0; position: relative; }
.activity-feed li:not(:last-child)::before { content: ""; position: absolute; left: 5px; top: 22px; bottom: -8px; width: 2px; background: var(--line); }
.act-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--blue); flex: none; margin-top: 4px; box-shadow: 0 0 0 3px #E3F4FA; }
.act-student .act-dot { background: var(--cyan); }
.act-system .act-dot { background: var(--navy); }
.act-bad .act-dot { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-bg); }
.activity-feed div { display: flex; flex-direction: column; font-size: .8rem; }
.activity-feed strong { color: var(--navy); font-size: .74rem; letter-spacing: .05em; }
.activity-feed time { color: var(--text-3); font-size: .7rem; font-weight: 700; }

.toolbar { display: flex; align-items: flex-end; gap: 12px; padding: 14px 16px; flex-wrap: wrap; }
.toolbar .grow { flex: 1 1 240px; }
.toolbar .field.compact { min-width: 140px; }
.toolbar-actions { display: flex; gap: 8px; }
.bulk-bar { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--cream-soft); border-bottom: 1px solid #EEDDAA; flex-wrap: wrap; }
.bulk-bar [data-bulk-count] { font-weight: 900; font-size: .76rem; letter-spacing: .06em; color: var(--navy); margin-right: 6px; }
.bulk-bar.is-empty .btn { opacity: .5; pointer-events: none; }

/* Vetting */
.vet-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.vet-viewers { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.vet-viewers.comparing { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.vet-viewer-slot { min-width: 0; }
.slot-label { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-weight: 800; font-size: .76rem; color: var(--navy); letter-spacing: .04em; }
.slot-label .icon-btn { margin-left: auto; width: 30px; height: 30px; }
.admin-body .viewer-pages { height: calc(100vh - 230px); }
.compare-list { list-style: none; margin: 0; padding: 6px 10px; }
.compare-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.compare-list li:last-child { border-bottom: 0; }
.compare-list li > span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.compare-list small { color: var(--text-3); font-size: .78rem; }
.compare-list .is-match { background: #FFF9EA; border-radius: 8px; }
.decision-buttons { display: grid; gap: 10px; }
.thumb-editor { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.thumb-editor img { width: 120px; height: 160px; object-fit: cover; border-radius: 10px; box-shadow: var(--shadow); background: var(--line); }
.thumb-editor form { flex: 1; min-width: 180px; }

/* Reports */
.report-list { list-style: none; margin: 0; padding: 0; }
.report-item { display: flex; gap: 20px; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.report-main { flex: 1 1 380px; min-width: 0; }
.report-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.report-top time { color: var(--text-3); font-size: .74rem; font-weight: 700; }
.report-main h3 { font-size: 1rem; margin: 0 0 4px; }
.report-main h3 small { display: block; color: var(--text-2); font-size: .82rem; font-weight: 600; }
.report-details { font-style: italic; color: var(--text-2); background: #F7F9FC; padding: 8px 12px; border-radius: 8px; border-left: 3px solid var(--blue); }
.admin-note { font-size: .84rem; color: var(--ok); }
.report-actions { display: flex; flex-direction: column; gap: 8px; width: 300px; max-width: 100%; }
.report-form { display: grid; gap: 8px; }
.btn-row { display: flex; gap: 8px; }
.btn-row .btn { flex: 1; }

/* Announcements admin */
.announce-admin { list-style: none; margin: 0; padding: 0; }
.announce-admin li { display: flex; justify-content: space-between; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.announce-admin h3 { font-size: .95rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.announce-admin p { color: var(--text-2); font-size: .86rem; margin-bottom: 4px; }

/* Settings / import */
.sticky-save { position: sticky; bottom: 0; padding: 14px 0; background: linear-gradient(180deg, rgba(244,247,251,0), var(--bg) 40%); display: flex; justify-content: flex-end; z-index: 5; }
.brand-preview { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; padding: 8px; background: #F4F7FB; border-radius: 10px; }
.brand-preview img { max-height: 48px; width: auto; }
.progress { height: 14px; background: #EEF2F7; border-radius: 999px; overflow: hidden; margin: 14px 0 8px; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--navy), var(--blue), var(--cyan)); border-radius: 999px; transition: width .3s; }
.import-run .btn { margin-bottom: 10px; }
.col-list { font-size: .8rem; font-weight: 700; padding-left: 20px; }
.col-list li { margin: 4px 0; }

/* =====================================================================
   INSTALLER & ERROR PAGES
   ===================================================================== */
.install-body { background: linear-gradient(160deg, #EAF1FA 0%, var(--bg) 40%); }
.install-wrap { max-width: 880px; margin: 0 auto; padding: 30px 18px 60px; }
.install-head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.install-head h1 { font-size: 1.3rem; margin: 0; }
.install-head p { margin: 0; color: var(--blue-text); font-weight: 800; letter-spacing: .1em; font-size: .78rem; }
.install-head .brand-logo { width: 54px; height: 54px; border-radius: 14px; }
.checklist { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; font-size: .8rem; font-weight: 700; letter-spacing: .03em; }
.checklist li { display: flex; gap: 12px; align-items: center; padding: 8px 12px; border-radius: 8px; background: #F7F9FC; }
.check-state { font-size: .68rem; font-weight: 900; padding: 3px 8px; border-radius: 6px; min-width: 74px; text-align: center; }
.check-pass .check-state { background: var(--ok-bg); color: var(--ok); }
.check-fail .check-state { background: var(--danger-bg); color: var(--danger); }
.check-warn .check-state { background: var(--warn-bg); color: var(--warn); }
.section-title { font-size: .82rem; letter-spacing: .08em; color: var(--blue-text); margin: 18px 0 12px; padding-bottom: 6px; border-bottom: 2px solid var(--cream); }
.steps-list { font-size: .82rem; font-weight: 700; }
.error-page { display: grid; place-items: center; min-height: 100vh; }
.error-box { text-align: center; padding: 40px; background: #fff; border-radius: 16px; box-shadow: var(--shadow); max-width: 460px; }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 1280px) {
  .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .admin-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-grid-3 > :last-child { grid-column: 1 / -1; }
  .filter-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filter-actions { grid-column: 1 / -1; }
}
@media (max-width: 1440px) {
  .topnav-links a span { display: none; }
  .topnav-links a { padding: 10px; }
  .topnav-links a.active span { display: inline; }
}
@media (max-width: 1100px) {
  .topnav-links a.active span { display: none; }
  .dash-grid, .upload-layout, .view-layout, .vet-layout, .admin-grid-form, .profile-grid { grid-template-columns: minmax(0, 1fr); }
  .stat-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .vet-viewers.comparing { grid-template-columns: minmax(0, 1fr); }
  .admin-body .viewer-pages, .viewer-pages { height: 72vh; }
}
@media (max-width: 960px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .25s; box-shadow: var(--shadow-lg); width: var(--sidebar-w) !important; }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .sidebar-scrim { display: block; position: fixed; inset: 0; background: rgba(7,27,71,.45); z-index: 350; }
  body.sidebar-collapsed .sidebar .nav-label, body.sidebar-collapsed .nav-badge { display: initial; }
  .admin-grid-2, .admin-grid-3 { grid-template-columns: minmax(0, 1fr); }
  .admin-main { padding: 18px 14px; }
  .avatar-name { display: none; }
  .auth-split { grid-template-columns: 1fr; }
  .auth-brand { padding: 58px 24px 30px; }
  .auth-points { display: none; }
  .auth-title { margin-top: 14px; }
}
@media (max-width: 760px) {
  body { font-size: 14.5px; }
  .nav-toggle { display: inline-grid; order: 3; }
  .topnav-inner { gap: 8px; padding: 0 12px; }
  .topnav-links { position: absolute; top: 66px; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); display: none; padding: 8px; }
  .topnav.nav-open .topnav-links { display: block; }
  .topnav-links ul { flex-direction: column; }
  .topnav-links a span { display: inline; }
  .topnav-links a { padding: 12px; }
  .brand-text { display: none; }
  .online-label { display: none; }
  .student-main { padding: 18px 12px 40px; }
  .hero { padding: 22px 18px; border-radius: 16px; }
  .hero-search { flex-wrap: wrap; padding: 8px; }
  .hero-search input { flex: 1; min-width: 0; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-row .stat-online { grid-column: 1 / -1; }
  .stat-grid, .stat-grid.small { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .filter-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .paper-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .dropdown-wide { width: min(340px, calc(100vw - 24px)); right: -60px; }
  .admin-topbar { padding: 0 10px; gap: 6px; }
  .topbar-right .online-pill { padding: 5px 9px; }
  .page-title { font-size: 1.2rem; }
  /* Tables become stacked cards */
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border-bottom: 1px solid var(--line); padding: 10px 6px; }
  .table td { border: 0; padding: 6px 10px; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .table td[data-label]::before { content: attr(data-label); font-size: .68rem; font-weight: 800; letter-spacing: .06em; color: var(--text-3); text-align: left; flex: none; }
  .table td.t-check { justify-content: flex-start; }
  .table td .cell-paper, .table td .cell-person { text-align: left; }
  .table tbody tr:nth-child(even) td { background: transparent; }
  .row-actions { flex-wrap: wrap; }
  .viewer-pages { padding: 10px; height: 75vh; }
  .report-actions { width: 100%; }
  .toast-stack { top: auto; bottom: 12px; right: 12px; left: 12px; width: auto; }
}
@media (max-width: 420px) {
  .paper-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .paper-title { font-size: .84rem; }
  .filter-row { grid-template-columns: minmax(0, 1fr); }
}


/* =====================================================================
   BOOK LIBRARY MODULE
   ===================================================================== */
.book-author { font-size: .8rem; color: var(--text-2); font-weight: 600; }
.book-author.big { font-size: 1rem; margin-bottom: 10px; }
.book-card .paper-thumb { background: var(--cream); }
.book-card .paper-foot { padding-top: 10px; }
.book-detail { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 24px; align-items: start; margin-bottom: 24px; }
.book-cover img { width: 100%; height: auto; border-radius: 12px; box-shadow: var(--shadow); display: block; background: var(--cream); }
.book-title { font-size: 1.6rem; margin-top: 8px; }
.avail-line { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.book-desc { color: var(--text-2); }
.borrow-box { display: block; }
.borrow-box .alert { margin: 0; }
.request-form { display: grid; gap: 4px; max-width: 520px; }
.request-form .btn { justify-self: start; }
.mini-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; }
.mini-stats span { background: #F7F9FC; border-radius: 10px; padding: 8px 4px; text-align: center; font-size: .64rem; font-weight: 800; letter-spacing: .05em; color: var(--text-2); }
.mini-stats strong { display: block; font-size: 1.2rem; color: var(--navy); }
.mini-stats .danger-text strong { color: var(--danger); }
.mini-stats .ok-text strong { color: var(--ok); }
.mini-list.flush { padding: 0; margin: 0 0 12px; }
.mini-text { display: flex; flex-direction: column; min-width: 0; }
.mini-text strong { color: var(--navy); font-size: .86rem; }
.mini-text small { color: var(--text-3); font-size: .72rem; }
.notif-icon.type-library { background: var(--cream); color: var(--navy); }
.side-nav-foot { margin-top: 10px; border-top: 1px solid rgba(255,255,255,.08); padding-top: 10px; }
.side-heading:first-child { padding-top: 4px; }
.desk-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 20px; align-items: start; }
.lookup-row { display: flex; gap: 8px; }
.lookup-row input { flex: 1; }
.student-strip { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--cream-soft); border-top: 1px solid #EEDDAA; border-bottom: 1px solid #EEDDAA; }
.strip-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.hold-box { background: #F1FBF5; border-bottom: 1px solid var(--line); }
.hold-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px dashed #BDEBD3; }
.hold-row:last-child { border-bottom: 0; }
.hold-row span { display: flex; flex-direction: column; }
.hold-row small { color: var(--text-3); font-size: .74rem; }
.note-line { font-size: .78rem; color: var(--text-2); font-style: italic; margin-top: 3px; }
.copy-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.copy-form select, .copy-form input[type=text] { min-height: 34px; padding: 5px 30px 5px 8px; font-size: .8rem; width: auto; }
.copy-form input[type=text] { padding-right: 8px; min-width: 140px; flex: 1; }
.error-list { max-height: 260px; overflow: auto; font-size: .8rem; color: var(--danger); background: var(--danger-bg); border-radius: 8px; padding: 10px 10px 10px 28px; }
.code-box { background: var(--navy-900); color: #DDF6FB; padding: 12px 14px; border-radius: 10px; font-family: var(--mono); font-size: .78rem; white-space: pre-wrap; word-break: break-all; text-transform: none; }
.filter-row.books-filter { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; }
@media (max-width: 1100px) {
  .desk-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .book-detail { grid-template-columns: minmax(0, 1fr); }
  .book-cover { max-width: 220px; margin: 0 auto; }
  .filter-row.books-filter { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .lookup-row { flex-direction: column; }
}



/* ---------- Student emails & bulk email ---------- */
.email-line { display: inline-flex !important; align-items: center; gap: 4px; font-size: .74rem !important; text-transform: none; }
.email-line .icon { width: 13px; height: 13px; }
.audience-box { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 16px 4px; margin: 0 0 16px; background: #FAFCFE; }
.audience-box legend { font-weight: 800; font-size: .78rem; letter-spacing: .06em; color: var(--navy); padding: 0 6px; text-transform: uppercase; }
.audience-box .form-grid, .audience-box [data-aud-show] { margin-top: 10px; }
.message-preview { background: #F7F9FC; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; white-space: normal; }
.message-preview strong { display: block; color: var(--navy); margin-bottom: 8px; }
.message-preview p { margin: 0; color: var(--text-2); }
.pending-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; background: var(--warn-bg); border-top: 1px solid #F2D693; border-bottom: 1px solid #F2D693; }
.pending-actions .help { flex-basis: 100%; margin: 0 0 4px; }
.verify-box h1 { margin-top: 12px; }
.verify-icon { width: 84px; height: 84px; border-radius: 50%; display: inline-grid; place-items: center; }
.verify-icon.ok { background: var(--ok-bg); color: var(--ok); }
.verify-icon.bad { background: var(--danger-bg); color: var(--danger); }
.link-inline { margin-left: 8px; font-size: .74rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }


/* =====================================================================
   PUBLIC LANDING PAGE
   ===================================================================== */
.landing-body { background: #fff; }
.land-wrap { width: min(1180px, 100% - 40px); margin: 0 auto; }
.land-narrow { width: min(820px, 100% - 40px); }
.land-nav { position: fixed; top: 0; left: 0; right: 0; z-index: 400; transition: background .25s ease, box-shadow .25s ease, backdrop-filter .25s ease; view-transition-name: kpce-topnav; }
.land-nav.scrolled { background: rgba(11, 45, 114, .92); backdrop-filter: blur(10px); box-shadow: 0 6px 24px rgba(7, 27, 71, .25); }
.land-nav-inner { display: flex; align-items: center; gap: 16px; height: 72px; }
.land-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 900; font-size: .86rem; letter-spacing: .05em; text-decoration: none !important; text-transform: uppercase; line-height: 1.15; max-width: 260px; }
.land-brand .brand-logo { width: 40px; height: 40px; }
.land-links { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.land-links a:not(.btn) { color: rgba(255,255,255,.86); font-weight: 800; font-size: .76rem; letter-spacing: .07em; padding: 9px 12px; border-radius: 8px; text-decoration: none !important; }
.land-links a:not(.btn):hover { color: #fff; background: rgba(255,255,255,.1); }
.land-links .land-staff { border: 1px solid rgba(255,255,255,.28); margin: 0 6px; }
.land-menu-btn { display: none; margin-left: auto; color: #fff; }
.land-menu-btn:hover { background: rgba(255,255,255,.12); color: #fff; }

.land-hero { position: relative; overflow: hidden; color: #fff; padding: 132px 0 0;
  background: radial-gradient(1100px 600px at 85% 10%, rgba(10,196,224,.28), transparent 60%), radial-gradient(800px 500px at 0% 100%, rgba(246,231,188,.14), transparent 60%), linear-gradient(150deg, #071B47 0%, var(--navy) 45%, #0A5A9E 100%); }
.land-hero-glow { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 56px 56px; mask-image: linear-gradient(180deg, rgba(0,0,0,.8), transparent 75%); pointer-events: none; }
.land-hero-grid { position: relative; display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.land-eyebrow { display: inline-flex; align-items: center; gap: 10px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); padding: 7px 14px; border-radius: 999px; font-size: .72rem; font-weight: 800; letter-spacing: .08em; color: var(--cream); margin-bottom: 22px; }
.land-title { color: #fff; font-size: clamp(2.3rem, 5.2vw, 4rem); line-height: 1.02; font-weight: 900; letter-spacing: .01em; margin: 0 0 20px; }
.land-title span { background: linear-gradient(90deg, var(--cyan), #7FE6F4); -webkit-background-clip: text; background-clip: text; color: transparent; }
.land-lead { font-size: 1.08rem; line-height: 1.65; color: rgba(255,255,255,.84); max-width: 560px; margin-bottom: 26px; }
.land-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-glass { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.3); }
.btn-glass:hover { background: rgba(255,255,255,.18); color: #fff; }
.land-hint { margin-top: 18px; font-size: .74rem; font-weight: 700; letter-spacing: .05em; color: rgba(255,255,255,.7); display: flex; align-items: flex-start; gap: 8px; text-transform: uppercase; line-height: 1.6; }
.land-hint .icon { margin-top: 2px; }
.land-hint strong { color: var(--cream); }

/* Hero illustration (pure CSS) */
.land-visual { position: relative; height: 470px; }
.mock-window { position: absolute; inset: 20px 30px 60px 0; background: #fff; border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.35); overflow: hidden; transform: perspective(1400px) rotateY(-9deg) rotateX(3deg); transform-origin: left center; }
.mock-bar { display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; background: #F1F5FA; border-bottom: 1px solid var(--line); }
.mock-bar span { width: 10px; height: 10px; border-radius: 50%; background: #D3DCE8; }
.mock-bar span:first-child { background: #F2A3A3; } .mock-bar span:nth-child(2) { background: #F4D58D; } .mock-bar span:nth-child(3) { background: #9EDDB3; }
.mock-bar em { margin-left: 12px; font-style: normal; font-size: .64rem; font-weight: 800; letter-spacing: .1em; color: var(--text-3); }
.mock-search { margin: 16px; padding: 11px 14px; border: 2px solid var(--line); border-radius: 12px; font-size: .78rem; font-weight: 800; letter-spacing: .05em; color: var(--navy); display: flex; gap: 8px; align-items: center; }
.mock-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 0 16px 16px; }
.mock-card { aspect-ratio: 3 / 4; border-radius: 12px; padding: 12px; display: flex; flex-direction: column; justify-content: flex-end; color: #fff; position: relative; overflow: hidden; }
.mock-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 18%; background: var(--cream); }
.mock-card::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: rgba(10,196,224,.35); }
.mock-card b { position: relative; z-index: 1; font-size: 1rem; letter-spacing: .04em; }
.mock-card i { position: relative; z-index: 1; font-style: normal; font-size: .6rem; font-weight: 800; letter-spacing: .08em; color: var(--cream); }
.mock-card.c1 { background: linear-gradient(170deg, var(--navy), var(--blue)); }
.mock-card.c2 { background: linear-gradient(170deg, #0A3B8A, #0AA6CC); }
.mock-card.c3 { background: linear-gradient(170deg, #12307A, #0B7FB0); }
.mock-float { position: absolute; background: #fff; color: var(--text); border-radius: 16px; box-shadow: 0 22px 50px rgba(0,0,0,.3); animation: floaty 6s ease-in-out infinite; }
.mock-paper { right: 0; top: 0; width: 190px; padding: 12px; }
.mock-page { position: relative; height: 150px; border: 1px solid var(--line); border-radius: 8px; padding: 14px 12px; overflow: hidden; }
.mock-page span { display: block; height: 7px; border-radius: 4px; background: #E6ECF4; margin-bottom: 9px; }
.mock-page span.short { width: 62%; }
.mock-mark { position: absolute; left: -20px; right: -20px; top: 62px; transform: rotate(-28deg); font-size: .58rem; font-weight: 900; color: rgba(11,45,114,.22); letter-spacing: .08em; text-align: center; white-space: nowrap; }
.mock-paper small { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: .62rem; font-weight: 800; letter-spacing: .07em; color: var(--navy); }
.mock-paper small .icon { color: var(--blue); }
.mock-book { left: -24px; bottom: 26px; display: flex; gap: 12px; align-items: center; padding: 12px 16px 12px 12px; animation-delay: -2s; }
.mock-cover { width: 42px; height: 56px; border-radius: 6px; background: linear-gradient(90deg, var(--navy) 0 22%, var(--cyan) 22% 28%, var(--cream) 28%); box-shadow: 0 4px 10px rgba(0,0,0,.15); }
.mock-book strong { display: block; font-size: .7rem; letter-spacing: .07em; color: var(--ok); }
.mock-book small { display: block; font-size: .74rem; font-weight: 800; color: var(--navy); }
.mock-book em { display: flex; align-items: center; gap: 4px; font-style: normal; font-size: .62rem; font-weight: 700; color: var(--text-3); letter-spacing: .05em; margin-top: 2px; }
.mock-remind { right: 22px; bottom: 0; padding: 10px 14px; font-size: .68rem; font-weight: 800; letter-spacing: .06em; color: var(--navy); display: flex; gap: 8px; align-items: center; animation-delay: -4s; }
.mock-remind .icon { color: var(--warn); }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.land-stats { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); margin: 56px 0 0; border-top: 1px solid rgba(255,255,255,.14); }
.land-stats > div { padding: 26px 8px 34px; text-align: center; }
.land-stats > div + div { border-left: 1px solid rgba(255,255,255,.14); }
.land-stats dd { margin: 0; font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 900; color: #fff; order: -1; }
.land-stats > div { display: flex; flex-direction: column; }
.land-stats dt { font-size: .68rem; font-weight: 800; letter-spacing: .1em; color: rgba(255,255,255,.66); text-transform: uppercase; margin-top: 4px; }

.land-section { padding: 96px 0; }
.land-alt { background: linear-gradient(180deg, var(--cream-soft), #fff); }
.land-head { text-align: center; max-width: 720px; margin: 0 auto 48px; }
.land-head h2 { font-size: clamp(1.6rem, 3.2vw, 2.4rem); font-weight: 900; margin: 6px 0 12px; }
.land-head p { color: var(--text-2); font-size: 1.02rem; }
.land-kicker { display: inline-block; font-size: .72rem; font-weight: 900; letter-spacing: .14em; color: var(--blue-text); background: var(--info-bg); padding: 6px 12px; border-radius: 999px; margin: 0; text-transform: uppercase; }
.land-kicker.light { color: var(--navy); background: var(--cyan); }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature { padding: 28px; border: 1px solid var(--line); border-radius: 18px; background: #fff; transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #CFE6F2; }
.feature-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, var(--navy), var(--blue)); color: #fff; margin-bottom: 18px; box-shadow: 0 8px 18px rgba(11,45,114,.22); }
.feature-icon .icon { width: 24px; height: 24px; }
.feature h3 { font-size: .98rem; letter-spacing: .05em; margin-bottom: 8px; }
.feature p { color: var(--text-2); margin: 0; font-size: .95rem; }

.how-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.how-grid.single { grid-template-columns: minmax(0, 620px); justify-content: center; }
.how-track { background: #fff; border: 1px solid #EEDDAA; border-radius: 20px; padding: 30px; box-shadow: var(--shadow-sm); }
.how-track h3 { display: flex; align-items: center; gap: 10px; font-size: 1rem; letter-spacing: .06em; margin-bottom: 20px; }
.how-track h3 .icon { color: var(--blue); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.steps li { display: flex; gap: 16px; align-items: flex-start; }
.steps li > span { flex: none; width: 38px; height: 38px; border-radius: 12px; background: var(--cream); color: var(--navy); font-weight: 900; display: grid; place-items: center; }
.steps strong { display: block; color: var(--navy); font-size: .84rem; letter-spacing: .07em; text-transform: uppercase; }
.steps p { margin: 2px 0 0; color: var(--text-2); font-size: .94rem; }

.prog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.prog-card { position: relative; overflow: hidden; padding: 28px; border-radius: 20px; background: linear-gradient(160deg, #F7FAFD, #fff); border: 1px solid var(--line); }
.prog-card::after { content: ""; position: absolute; right: -40px; bottom: -40px; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle, rgba(10,196,224,.22), transparent 70%); }
.prog-tag { display: inline-block; font-weight: 900; font-size: 1.5rem; color: var(--navy); letter-spacing: .04em; }
.prog-card h3 { font-size: .82rem; letter-spacing: .08em; color: var(--text-2); margin: 8px 0 16px; }
.prog-card code { font-size: .82rem; padding: 6px 10px; background: var(--cream); color: var(--navy); }

.land-dark { background: linear-gradient(150deg, #071B47, var(--navy)); color: #fff; }
.trust-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.land-dark h2 { color: #fff; font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 900; margin: 12px 0 14px; }
.land-dark p { color: rgba(255,255,255,.8); font-size: 1.02rem; }
.trust-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.trust-list li { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border-radius: 14px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); font-weight: 800; font-size: .8rem; letter-spacing: .06em; }
.trust-list .icon { color: var(--cyan); }

.faq { display: grid; gap: 12px; }
.faq details { border: 1px solid var(--line); border-radius: 14px; background: #fff; transition: border-color .2s ease, box-shadow .2s ease; }
.faq details[open] { border-color: #BFE3F1; box-shadow: var(--shadow-sm); }
.faq summary { cursor: pointer; list-style: none; padding: 18px 54px 18px 20px; font-weight: 800; font-size: .86rem; letter-spacing: .05em; color: var(--navy); position: relative; text-transform: uppercase; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border-radius: 50%; background: var(--info-bg); color: var(--blue-text); display: grid; place-items: center; font-size: 1.1rem; transition: transform .2s ease, background .2s ease; }
.faq details[open] summary::after { content: "–"; background: var(--navy); color: #fff; }
.faq details p { margin: 0; padding: 0 20px 20px; color: var(--text-2); }

.land-cta-band { padding: 0 0 96px; }
.land-cta-inner { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; padding: 40px 44px; border-radius: 24px; color: #fff;
  background: radial-gradient(500px 200px at 90% 0%, rgba(10,196,224,.4), transparent 70%), linear-gradient(120deg, var(--navy), #0A5A9E); box-shadow: 0 20px 50px rgba(11,45,114,.25); }
.land-cta-inner h2 { color: #fff; font-size: clamp(1.4rem, 2.6vw, 2rem); font-weight: 900; margin: 0 0 6px; }
.land-cta-inner p { margin: 0; color: rgba(255,255,255,.82); }

.land-footer { background: #071B47; color: rgba(255,255,255,.7); padding: 34px 0; }
.land-footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.land-footer nav { display: flex; gap: 18px; }
.land-footer a { color: rgba(255,255,255,.85); font-weight: 800; font-size: .74rem; letter-spacing: .07em; }
.land-footer p { margin: 0; font-size: .72rem; font-weight: 700; letter-spacing: .05em; width: 100%; }
.land-brand.small { font-size: .78rem; }

/* Scroll reveal (only when JavaScript is running and motion is allowed) */
.js-reveal [data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s cubic-bezier(.2, .7, .2, 1); }
.js-reveal [data-reveal].revealed { opacity: 1; transform: none; }
.feature-grid [data-reveal]:nth-child(3n+2), .prog-grid [data-reveal]:nth-child(2), .how-grid [data-reveal]:nth-child(2) { transition-delay: .08s; }
.feature-grid [data-reveal]:nth-child(3n), .prog-grid [data-reveal]:nth-child(3) { transition-delay: .16s; }

/* Login pages: link back to the home page */
.back-home { position: absolute; top: 20px; left: 24px; z-index: 2; display: inline-flex; align-items: center; gap: 6px; color: rgba(255,255,255,.85); font-weight: 800; font-size: .74rem; letter-spacing: .07em; text-decoration: none !important; text-transform: uppercase; }
.back-home:hover { color: #fff; }

@media (max-width: 1000px) {
  .land-hero-grid, .trust-grid { grid-template-columns: 1fr; }
  .land-visual { height: 420px; max-width: 560px; margin: 0 auto; width: 100%; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .how-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .land-menu-btn { display: inline-grid; }
  .land-links { position: absolute; top: 72px; left: 12px; right: 12px; flex-direction: column; align-items: stretch; background: var(--navy); border-radius: 16px; padding: 10px; box-shadow: var(--shadow-lg); display: none; }
  .land-nav.open .land-links { display: flex; }
  .land-nav.open { background: rgba(11, 45, 114, .96); }
  .land-links a:not(.btn) { padding: 12px; }
  .land-links .land-staff { margin: 4px 0; text-align: center; }
  .land-brand span { max-width: 180px; }
}
@media (max-width: 640px) {
  .land-hero { padding-top: 108px; }
  .land-cta .btn { flex: 1 1 100%; }
  .land-lead { font-size: 1rem; }
  .land-visual { height: 340px; }
  .mock-window { inset: 10px 10px 50px 0; transform: none; }
  .mock-paper { width: 140px; top: -10px; } .mock-page { height: 100px; }
  .mock-book { left: 0; bottom: 0; }
  .mock-remind { display: none; }
  .land-stats { grid-template-columns: 1fr 1fr; }
  .land-stats > div:nth-child(3) { border-left: 0; }
  .land-stats > div:nth-child(n+3) { border-top: 1px solid rgba(255,255,255,.14); }
  .feature-grid, .prog-grid { grid-template-columns: 1fr; }
  .land-section { padding: 64px 0; }
  .land-cta-inner { padding: 30px 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .mock-float { animation: none; }
  .js-reveal [data-reveal] { opacity: 1; transform: none; }
}

/* =====================================================================
   SMOOTH TRANSITIONS
   - Cross-page fade with the View Transitions API (Chrome/Edge 126+, Safari 18.2+);
     other browsers get the CSS entry animations below.
   - Header, top bar and sidebar stay put while the content changes.
   - Everything is switched off for users who prefer reduced motion.
   ===================================================================== */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vtFadeOut .18s ease-in both; }
::view-transition-new(root) { animation: vtFadeIn .28s ease-out both; }
.sidebar { view-transition-name: kpce-sidebar; }
.admin-topbar { view-transition-name: kpce-topbar; }
.topnav { view-transition-name: kpce-topnav; }
::view-transition-group(kpce-sidebar), ::view-transition-group(kpce-topbar), ::view-transition-group(kpce-topnav) { animation-duration: .2s; }
@keyframes vtFadeOut { to { opacity: 0; } }
@keyframes vtFadeIn { from { opacity: 0; transform: translateY(6px); } }

@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes riseIn { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.student-main, .admin-main, .install-wrap, .center-page > .card, .error-box { animation: pageIn .38s cubic-bezier(.2, .7, .2, 1) backwards; }
.auth-card { animation: pageIn .45s cubic-bezier(.2, .7, .2, 1) .05s backwards; }
.auth-brand-inner { animation: fadeIn .6s ease-out backwards; }
.auth-points li { animation: riseIn .45s ease-out backwards; }
.auth-points li:nth-child(2) { animation-delay: .08s; }
.auth-points li:nth-child(3) { animation-delay: .16s; }
.auth-points li:nth-child(4) { animation-delay: .24s; }

/* Staggered entry for stats, cards and grids (new search results animate in the same way). */
.stat-row > *, .stat-grid > *, .paper-grid > *, .admin-main > .card, .student-main > .card,
.admin-grid-2 > *, .admin-grid-3 > *, .admin-grid-form > *, .dash-grid > *, .desk-grid > *,
.view-layout > *, .vet-layout > *, .upload-layout > *, .profile-grid > *, .book-detail > *, .hero, .library-hero, .tabs, .toolbar {
  animation: riseIn .42s cubic-bezier(.2, .7, .2, 1) backwards;
}
.stat-row > :nth-child(2), .stat-grid > :nth-child(2), .paper-grid > :nth-child(2), .admin-grid-2 > :nth-child(2), .admin-grid-3 > :nth-child(2), .admin-grid-form > :nth-child(2), .dash-grid > :nth-child(2), .desk-grid > :nth-child(2), .view-layout > :nth-child(2), .vet-layout > :nth-child(2), .upload-layout > :nth-child(2), .profile-grid > :nth-child(2), .book-detail > :nth-child(2) { animation-delay: .05s; }
.stat-row > :nth-child(3), .stat-grid > :nth-child(3), .paper-grid > :nth-child(3), .admin-grid-3 > :nth-child(3) { animation-delay: .1s; }
.stat-row > :nth-child(4), .stat-grid > :nth-child(4), .paper-grid > :nth-child(4) { animation-delay: .15s; }
.stat-row > :nth-child(5), .stat-grid > :nth-child(5), .paper-grid > :nth-child(5) { animation-delay: .2s; }
.stat-grid > :nth-child(6), .paper-grid > :nth-child(6) { animation-delay: .24s; }
.paper-grid > :nth-child(7) { animation-delay: .28s; }
.paper-grid > :nth-child(n+8) { animation-delay: .32s; }
.table tbody tr { animation: fadeIn .35s ease-out backwards; }
.table tbody tr:nth-child(n+2) { animation-delay: .03s; }
.table tbody tr:nth-child(n+4) { animation-delay: .06s; }
.table tbody tr:nth-child(n+8) { animation-delay: .09s; }
.alert { animation: riseIn .35s ease-out backwards; }
.viewer-page-wrap { animation: fadeIn .35s ease-out backwards; }
.empty-state { animation: fadeIn .4s ease-out backwards; }
.notif-item, .activity-feed li, .mini-list li { animation: fadeIn .3s ease-out backwards; }

/* Softer interactions everywhere */
a, button, .btn, .icon-btn, .tab, .page-link, .card, .stat-card, .stat-tile, .paper-card, input, select, textarea, .badge, .dropzone, .side-nav a, .topnav-links a {
  transition-property: color, background-color, border-color, box-shadow, transform, opacity;
  transition-duration: .18s;
  transition-timing-function: ease;
}
.card { transition-duration: .25s; }
.modal:not([hidden]) .modal-backdrop { animation: fadeIn .2s ease-out backwards; }
.sidebar, .admin-main-wrap { transition: width .25s ease, transform .25s ease; }
html { scroll-behavior: smooth; }

/* Live search: results fade while they refresh */
[data-result-grid] { transition: opacity .2s ease; }

/* Page-loading bar */
#nav-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 5000; pointer-events: none;
  background: linear-gradient(90deg, var(--cyan), var(--blue), var(--navy)); box-shadow: 0 0 10px rgba(10, 196, 224, .6); opacity: 0; }
#nav-progress.active { opacity: 1; animation: navProgress 6s cubic-bezier(.1, .7, .2, 1) forwards; }
#nav-progress.done { opacity: 0; width: 100%; transition: opacity .3s ease .1s, width .15s ease; }
@keyframes navProgress { 0% { width: 0; } 15% { width: 35%; } 50% { width: 70%; } 100% { width: 92%; } }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  html { scroll-behavior: auto; }
}

/* =====================================================================
   PRINT: library material is never printable.
   ===================================================================== */
@media print {
  body.viewer-page * { visibility: hidden !important; }
  body.viewer-page .viewer-pages, body.viewer-page canvas, body.viewer-page img { display: none !important; }
  body.viewer-page .print-block { display: block !important; visibility: visible !important; position: fixed; inset: 0; padding: 40vh 10vw; text-align: center; font: 700 20pt/1.4 var(--font); color: #000; }
  .sidebar, .admin-topbar, .topnav, .toast-stack { display: none !important; }
}

/* =====================================================================
   E-RESOURCES (DIGITAL LIBRARY)
   ===================================================================== */
.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.res-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s; animation: riseIn .42s cubic-bezier(.2, .7, .2, 1) backwards; }
.res-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.res-grid > :nth-child(2) { animation-delay: .04s; } .res-grid > :nth-child(3) { animation-delay: .08s; } .res-grid > :nth-child(4) { animation-delay: .12s; }
.res-grid > :nth-child(5) { animation-delay: .16s; } .res-grid > :nth-child(6) { animation-delay: .2s; } .res-grid > :nth-child(n+7) { animation-delay: .24s; }
.res-thumb { position: relative; display: block; aspect-ratio: 4 / 3; background: linear-gradient(160deg, var(--navy), var(--blue)); overflow: hidden; }
.res-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s; }
.res-card:hover .res-thumb img { transform: scale(1.04); }
.res-thumb::after { content: ""; position: absolute; inset: auto 0 0 0; height: 45%; background: linear-gradient(to top, rgba(7, 27, 71, .45), transparent); pointer-events: none; }
.res-play { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; background: rgba(255, 255, 255, .92); color: var(--navy); display: grid; place-items: center; box-shadow: 0 6px 18px rgba(0, 0, 0, .28); z-index: 1; transition: transform .2s; }
.res-play .icon { width: 30px; height: 30px; }
.res-play.big { width: 84px; height: 84px; margin: -42px 0 0 -42px; }
.res-play.big .icon { width: 46px; height: 46px; }
.res-card:hover .res-play { transform: scale(1.08); }
.res-type { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-size: .68rem; font-weight: 800; letter-spacing: .06em; padding: 4px 9px; border-radius: 999px; background: var(--cream); color: var(--navy); }
.res-type .icon { width: 14px; height: 14px; }
.res-thumb .res-type { position: absolute; left: 10px; top: 12px; z-index: 1; box-shadow: var(--shadow-sm); }
.res-type-video { background: #FFE3E1; color: #8E1B12; }
.res-type-image { background: var(--ok-bg); color: var(--ok); }
.res-type-audio { background: #EDE7FB; color: #4A2E91; }
.res-type-link { background: var(--info-bg); color: var(--blue-text); }
.res-type-document { background: #E6EEF9; color: var(--navy); }
.res-body { padding: 14px 15px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.res-title { font-size: .98rem; margin: 0; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.res-title a { color: var(--navy); }
.res-meta { color: var(--text-3); font-size: .8rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-foot { margin-top: auto; padding-top: 8px; display: flex; justify-content: space-between; align-items: center; color: var(--text-3); font-size: .72rem; font-weight: 800; letter-spacing: .04em; }
.res-foot span { display: inline-flex; align-items: center; gap: 4px; }
.res-skel { aspect-ratio: 4 / 3; }
.res-mini { width: 64px !important; height: 48px !important; }

.type-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.type-chips .chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; background: #F1F5FA; border: 1px solid var(--line); color: var(--text-2); font-weight: 800; font-size: .74rem; letter-spacing: .05em; text-decoration: none !important; transition: background .15s, color .15s, border-color .15s; }
.type-chips .chip span { background: #fff; border-radius: 999px; padding: 0 7px; font-size: .68rem; color: var(--text-3); }
.type-chips .chip:hover { border-color: var(--line-strong); color: var(--navy); }
.type-chips .chip.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.type-chips .chip.active .icon { color: var(--cyan); }
.type-chips .chip.active span { background: rgba(255, 255, 255, .18); color: #fff; }

/* Players */
.res-stage { display: block; position: relative; background: #0F1B33; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin: 0; }
.res-image { background: repeating-conic-gradient(#EEF2F8 0 25%, #fff 0 50%) 0 0 / 22px 22px; display: grid; place-items: center; padding: 14px; min-height: 260px; }
.res-image img { max-height: 78vh; width: auto; border-radius: 8px; box-shadow: var(--shadow); -webkit-user-drag: none; user-select: none; }
.res-video { aspect-ratio: 16 / 9; }
.res-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.res-external img, .res-doc > img, .res-audio > img { width: 100%; display: block; aspect-ratio: 4 / 3; object-fit: cover; max-height: 62vh; }
.res-external { text-decoration: none !important; }
.res-external:hover img { filter: brightness(.9); }
.res-external-label { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: inline-flex; gap: 8px; align-items: center; background: #fff; color: var(--navy); font-weight: 800; letter-spacing: .04em; font-size: .82rem; padding: 10px 18px; border-radius: 999px; box-shadow: var(--shadow); white-space: nowrap; max-width: calc(100% - 30px); overflow: hidden; text-overflow: ellipsis; }
.res-audio { background: linear-gradient(160deg, var(--navy-900), var(--navy)); }
.res-audio audio { display: block; width: calc(100% - 28px); margin: 14px; }
.res-doc { background: #fff; display: grid; grid-template-columns: minmax(0, 1fr); }
.res-doc-info { padding: 18px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.res-doc-info strong { color: var(--navy); letter-spacing: .04em; }
.res-doc-info span { color: var(--text-2); font-size: .86rem; }
.res-preview { max-width: 1000px; }
.res-related img { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; flex: none; }
.res-layout .view-side .res-type { margin-bottom: 10px; }

/* Admin form */
.type-picker { border: 0; padding: 0; margin: 0 0 16px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.type-picker legend { font-weight: 800; font-size: .78rem; letter-spacing: .05em; color: var(--navy); margin-bottom: 8px; padding: 0; }
.type-option { cursor: pointer; }
.type-option input { position: absolute; opacity: 0; pointer-events: none; }
.type-option > span { display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 12px 12px 11px; border: 2px solid var(--line); border-radius: 12px; background: #fff; transition: border-color .15s, background .15s, transform .15s; }
.type-option > span .icon { color: var(--blue); margin-bottom: 4px; }
.type-option strong { color: var(--navy); font-size: .82rem; letter-spacing: .05em; }
.type-option small { color: var(--text-3); font-size: .68rem; font-weight: 700; letter-spacing: .03em; }
.type-option:hover > span { border-color: var(--line-strong); transform: translateY(-1px); }
.type-option input:checked + span { border-color: var(--navy); background: var(--cream-soft); box-shadow: inset 0 0 0 1px var(--navy); }
.type-option input:focus-visible + span { outline: 3px solid var(--cyan); outline-offset: 2px; }
.toggle-stack { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.res-side-thumb img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; box-shadow: var(--shadow-sm); margin-bottom: 12px; }
.res-side-thumb .btn-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.tip-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 10px; font-size: .84rem; color: var(--text-2); }
.tip-list strong { color: var(--navy); }
@media (max-width: 700px) {
  .type-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .res-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .res-body { padding: 10px 11px; }
  .res-title { font-size: .88rem; }
  .res-play { width: 42px; height: 42px; margin: -21px 0 0 -21px; }
  .res-external-label { font-size: .72rem; padding: 8px 12px; }
}
@media (prefers-reduced-motion: reduce) { .res-card { animation: none; } .res-card:hover, .res-card:hover .res-thumb img { transform: none; } }
.field label.switch { display: flex; align-items: flex-start; gap: 12px; margin: 0; text-transform: none; }
.field-toggle .help { padding-left: 58px; }
.dash-res { margin-top: 20px; }

/* Login screens: centre the logo, name and tagline (points stay left-aligned inside a centred block). */
.auth-brand { justify-content: center; }
.auth-brand-inner { width: 100%; margin: 0 auto; text-align: center; }
.auth-logo { display: flex; justify-content: center; }
.auth-points { width: fit-content; max-width: 100%; margin-left: auto; margin-right: auto; text-align: left; }
.auth-online { display: flex; justify-content: center; }

/* =====================================================================
   PRIVACY POLICY, TERMS OF SERVICE AND ACCEPTANCE
   ===================================================================== */
.legal-body { background: #F7F9FC; }
.legal-wrap { max-width: 1120px; margin: 0 auto; padding: 0 22px; }
.legal-head { background: linear-gradient(135deg, var(--navy), #0A4F96); position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 14px rgba(7, 27, 71, .18); }
.legal-head-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.legal-head nav { display: flex; align-items: center; gap: 6px; }
.legal-head nav a:not(.btn) { color: rgba(255, 255, 255, .82); font-weight: 800; font-size: .74rem; letter-spacing: .06em; padding: 8px 10px; border-radius: 8px; text-decoration: none; }
.legal-head nav a:not(.btn):hover, .legal-head nav a[aria-current] { color: #fff; background: rgba(255, 255, 255, .12); }
.legal-head .btn-primary { background: var(--cream); color: var(--navy); border-color: var(--cream); }
.legal-main { padding-top: 34px; padding-bottom: 50px; }
.legal-hero { margin-bottom: 26px; }
.legal-hero .eyebrow { color: var(--blue); font-weight: 800; font-size: .74rem; letter-spacing: .1em; margin: 0 0 6px; text-transform: uppercase; }
.legal-hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 900; letter-spacing: .03em; margin: 0 0 6px; color: var(--navy); }
.legal-date { display: inline-block; background: var(--cream); color: var(--navy); font-weight: 800; font-size: .72rem; letter-spacing: .08em; padding: 5px 11px; border-radius: 999px; margin: 0 0 12px; }
.legal-lead { color: var(--text-2); font-size: 1.04rem; max-width: 680px; margin: 0; }
.legal-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; align-items: start; }
.legal-grid > aside { position: sticky; top: 86px; }
.legal-toc { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.legal-toc strong { display: block; font-size: .7rem; letter-spacing: .1em; color: var(--text-3); margin-bottom: 8px; }
.legal-toc ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: .82rem; font-weight: 700; color: var(--text-3); }
.legal-toc a { color: var(--navy); text-decoration: none; }
.legal-toc a:hover { color: var(--blue); text-decoration: underline; }
.legal-switch { font-size: .72rem; font-weight: 800; letter-spacing: .06em; color: var(--text-3); margin: 14px 4px 0; }
.legal-doc { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 34px 30px; box-shadow: var(--shadow-sm); color: var(--text); line-height: 1.7; font-size: .97rem; }
.legal-doc section { padding-top: 22px; scroll-margin-top: 84px; }
.legal-doc section + section { border-top: 1px solid var(--line); margin-top: 6px; }
.legal-doc h2 { font-size: 1.08rem; letter-spacing: .05em; color: var(--navy); margin: 0 0 10px; display: flex; gap: 8px; }
.legal-doc h2 span { color: var(--blue); }
.legal-doc h3 { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--blue-text, var(--blue)); margin: 16px 0 4px; }
.legal-doc p { margin: 0 0 10px; }
.legal-doc ul { margin: 0 0 10px; padding-left: 22px; display: grid; gap: 6px; }
.legal-doc a { color: var(--blue); font-weight: 600; }
.legal-foot { border-top: 1px solid var(--line); padding: 20px 0 30px; color: var(--text-3); font-size: .74rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; background: #fff; }
.legal-foot a { color: var(--navy); }
.auth-legal { margin: 12px 0 0; font-size: .7rem; font-weight: 700; letter-spacing: .04em; color: var(--text-3); text-align: center; text-transform: uppercase; }
.site-footer a { color: inherit; text-decoration: underline; }
.agree-card { width: min(640px, 100%); }
.agree-summary { background: var(--cream-soft, #FBF5E4); border: 1px solid #EEDDAE; border-radius: 12px; padding: 14px 18px 8px; margin: 14px 0; }
.agree-summary h2 { font-size: .78rem; letter-spacing: .1em; color: var(--navy); margin: 0 0 8px; }
.agree-summary ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.agree-summary li { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; line-height: 1.45; color: var(--text); }
.agree-summary li .icon { flex: none; color: var(--blue); margin-top: 3px; }
.agree-links { display: flex; flex-wrap: wrap; gap: 8px; }
.agree-check { align-items: flex-start; font-size: .8rem; line-height: 1.5; padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; background: #fff; }
.agree-check input { width: 20px; height: 20px; margin-top: 1px; flex: none; accent-color: var(--navy); }
.agree-check:has(input:checked) { border-color: var(--navy); background: #F3F7FD; }
.has-error .agree-check { border-color: var(--danger, #C62828); }
@media (max-width: 860px) {
  .legal-grid { grid-template-columns: 1fr; }
  .legal-grid > aside { position: static; }
  .legal-doc { padding: 6px 18px 22px; font-size: .94rem; }
  .legal-head .land-brand span { display: none; }
}
@media print { .legal-head, .legal-grid > aside, .legal-foot { display: none; } .legal-grid { display: block; } .legal-doc { border: 0; box-shadow: none; } }
.field label.agree-check { display: flex; gap: 10px; margin: 0; }
.stat-num.stat-num-sm { font-size: 1.35rem; white-space: nowrap; }

/* =====================================================================
   VERSION 6: KOHA-STYLE MODULES
   ===================================================================== */
/* Shared bits */
.form-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.num-in { width: 76px; padding: 7px 8px !important; text-align: right; }
.code-in { width: 110px; font-family: ui-monospace, Menlo, monospace; text-transform: uppercase; }
.check.small { font-size: .7rem; margin: 4px 0 0; }
.tabs.small .tab { padding: 6px 11px; font-size: .7rem; }
.row-muted td { opacity: .55; }
.row-default td { background: #F6F9FE; }
.meter { height: 8px; border-radius: 999px; background: #E9EEF5; overflow: hidden; min-width: 90px; margin-top: 6px; }
.meter span { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--cyan)); border-radius: inherit; }
.mono-text { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .86rem; line-height: 1.55; }
.marc-view { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .82rem; line-height: 1.6; white-space: pre-wrap; word-break: break-word; margin: 0; color: var(--text); background: #F7F9FC; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; text-transform: none; }
.more-fields { border: 1px dashed var(--line-strong); border-radius: 12px; padding: 4px 14px; margin: 6px 0 14px; }
.more-fields summary { cursor: pointer; font-weight: 800; font-size: .76rem; letter-spacing: .06em; color: var(--navy); padding: 9px 0; }
.more-fields[open] summary { margin-bottom: 6px; }
.rules-table td { vertical-align: middle; }
.rules-table select { padding: 6px 8px; font-size: .78rem; }
.order-status { display: flex; gap: 10px; align-items: center; margin: -6px 0 12px; }
.receive-form, .decide-form { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.decide-form input[type=text] { min-width: 160px; padding: 7px 10px; }
.nowrap { white-space: nowrap; }

/* ISBN lookup */
.isbn-inline { background: #F3F7FD; border: 1px solid #DCE6F5; border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; }
.isbn-inline .lookup-row, .isbn-result + .lookup-row { display: flex; gap: 8px; }
.lookup-row input[type=search] { flex: 1; }
.isbn-status { margin: 8px 0 0; font-size: .76rem; font-weight: 800; letter-spacing: .04em; min-height: 1em; }
.isbn-status.ok { color: var(--ok); } .isbn-status.err { color: var(--danger, #B42318); } .isbn-status.warn { color: #8A5A00; } .isbn-status.busy { color: var(--text-3); }
.isbn-cover-note { font-size: .74rem; font-weight: 700; color: var(--ok); display: flex; gap: 6px; align-items: center; margin: 6px 0 0; }
.isbn-result { border-top: 1px solid var(--line); }

/* Calendar */
.day-picks { display: flex; gap: 8px; flex-wrap: wrap; }
.day-pick input { position: absolute; opacity: 0; }
.day-pick span { display: inline-grid; place-items: center; width: 58px; height: 44px; border-radius: 10px; border: 2px solid var(--line); font-weight: 800; font-size: .78rem; color: var(--navy); cursor: pointer; background: #fff; }
.day-pick input:checked + span { background: #FDECEC; border-color: #E5A3A3; color: #8E1B12; text-decoration: line-through; }
.day-pick input:focus-visible + span { outline: 3px solid var(--cyan); outline-offset: 2px; }
.mini-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.mc-head { font-size: .64rem; font-weight: 800; color: var(--text-3); letter-spacing: .06em; padding: 2px 0; }
.mc-day { padding: 7px 0; border-radius: 8px; background: #EEF7EE; color: var(--ok); font-weight: 800; font-size: .8rem; }
.mc-day.closed { background: #F3F4F6; color: #9AA3AF; text-decoration: line-through; }
.mc-day.today { box-shadow: inset 0 0 0 2px var(--navy); }

/* Print pages: receipts, orders, labels */
.print-body { background: #fff; }
.receipt { max-width: 560px; margin: 30px auto; padding: 28px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.receipt.wide { max-width: 900px; }
.receipt h1 { margin: 0; font-size: 1.3rem; color: var(--navy); }
.receipt h2 { font-size: 1rem; letter-spacing: .06em; margin: 16px 0 12px; }
.print-head { display: flex; justify-content: space-between; gap: 20px; border-bottom: 2px solid var(--navy); padding-bottom: 12px; margin-bottom: 14px; }
.sign-line { margin-top: 40px; font-size: .8rem; }
.labels-print { background: #fff; margin: 0; }
.labels-toolbar { display: flex; gap: 10px; align-items: center; padding: 12px 16px; background: #F7F9FC; border-bottom: 1px solid var(--line); font-size: .78rem; font-weight: 700; }
.lbl { overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: 1.5mm 2.5mm; box-sizing: border-box; outline: 1px dashed #D5DCE6; font-family: Arial, Helvetica, sans-serif; color: #000; }
.lbl.empty { outline-color: #EEF1F5; }
.lbl-lib { font-size: 6pt; font-weight: 700; letter-spacing: .4pt; text-transform: uppercase; }
.lbl-title { font-size: 7pt; line-height: 1.15; max-height: 2.4em; overflow: hidden; }
.lbl-code svg { width: 100%; height: 11mm; display: block; margin: .6mm 0; }
.lbl-foot { display: flex; justify-content: space-between; font-size: 7.5pt; }
.lbl.spine { align-items: center; text-align: center; }
.lbl.spine strong { font-size: 13pt; line-height: 1.2; }
.lbl.spine small { font-size: 6.5pt; margin-top: 1mm; }
.label-sample { display: grid; place-items: center; background: #fff; }
.label-sample svg { max-width: 100%; height: auto; }
@media print {
  .no-print, .labels-toolbar { display: none !important; }
  .lbl { outline: none; }
  .receipt { border: 0; margin: 0; max-width: none; }
}

/* OPAC */
.opac-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 22px; align-items: start; }
.facets { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; }
.facets-title { font-size: .8rem; letter-spacing: .08em; color: var(--navy); margin: 0 0 10px; display: flex; gap: 6px; align-items: center; }
.facet-group { padding: 10px 0; border-top: 1px solid var(--line); }
.facet-group h3 { font-size: .68rem; letter-spacing: .1em; color: var(--text-3); margin: 0 0 6px; }
.facet-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.facet-link { display: flex; justify-content: space-between; gap: 8px; padding: 5px 8px; border-radius: 8px; font-size: .78rem; font-weight: 700; color: var(--navy); text-decoration: none !important; text-transform: uppercase; }
.facet-link span { color: var(--text-3); font-weight: 800; font-size: .7rem; }
.facet-link:hover { background: #F1F6FD; }
.facet-link.strong { background: var(--ok-bg); color: var(--ok); align-items: center; }
.facet-active { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 10px; }
.facet-pill { background: var(--navy); color: #fff !important; border-radius: 999px; padding: 4px 10px; font-size: .7rem; font-weight: 800; text-decoration: none !important; text-transform: uppercase; }
.facet-clear { font-size: .7rem; font-weight: 800; align-self: center; }
.suggest-link { font-size: .74rem; font-weight: 800; letter-spacing: .04em; display: inline-flex; gap: 6px; align-items: center; margin-left: auto; }
.stars { display: inline-flex; align-items: center; gap: 1px; color: #D7DCE4; font-size: 1.05rem; line-height: 1; }
.stars.sm { font-size: .82rem; }
.stars .star.on { color: #F2A900; }
.stars .star.half { background: linear-gradient(90deg, #F2A900 50%, #D7DCE4 50%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stars small { margin-left: 6px; color: var(--text-3); font-weight: 800; font-size: .72rem; }
.rating-link { text-decoration: none !important; display: inline-block; margin: 2px 0 8px; }
.book-subtitle { margin: -4px 0 6px; color: var(--text-2); font-size: 1rem; }
.subject-links { display: flex; flex-wrap: wrap; gap: 6px; }
.subject-links a { background: #EEF4FC; border-radius: 999px; padding: 2px 10px; font-size: .74rem; font-weight: 700; text-decoration: none; }
.book-extra { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px; margin-top: 18px; }
.list-add { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.list-add .field { margin: 0; min-width: 180px; flex: 1; }
.link-small { font-size: .72rem; font-weight: 800; align-self: center; }
.review-wrap { display: grid; gap: 16px; }
.review-form { background: #FBFCFE; border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.star-input { border: 0; padding: 0; margin: 0 0 8px; display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; }
.star-input legend { font-weight: 800; font-size: .74rem; letter-spacing: .06em; color: var(--navy); margin-bottom: 4px; width: 100%; }
.star-input input { position: absolute; opacity: 0; }
.star-input label { font-size: 1.9rem; color: #D7DCE4; cursor: pointer; line-height: 1; padding: 0 2px; transition: color .12s, transform .12s; }
.star-input label:hover, .star-input label:hover ~ label, .star-input input:checked ~ label { color: #F2A900; }
.star-input input:focus-visible + label { outline: 3px solid var(--cyan); border-radius: 6px; }
.review-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.review-list li { border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.review-list li > div { display: flex; gap: 8px; align-items: center; font-size: .78rem; }
.review-list time { color: var(--text-3); font-size: .72rem; }
.review-list p { margin: 6px 0 0; }
.list-books { list-style: none; margin: 0; padding: 0; }
.list-books li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.list-books li > a { display: flex; gap: 12px; align-items: center; text-decoration: none; color: inherit; min-width: 0; }
.list-books img { width: 48px; height: 64px; object-fit: cover; border-radius: 6px; flex: none; }
.list-books strong { display: block; color: var(--navy); }
.list-books small, .list-books em { display: block; color: var(--text-3); font-size: .76rem; }
.list-book-side { display: flex; gap: 8px; align-items: center; flex: none; }
.list-desc { margin-top: -6px; color: var(--text-2); }

/* Stocktake */
.scan-label { display: block; font-weight: 800; font-size: .74rem; letter-spacing: .06em; color: var(--navy); margin-bottom: 6px; }
.scan-input { width: 100%; font-size: 1.5rem !important; font-family: ui-monospace, Menlo, monospace; padding: 14px 16px !important; border: 3px solid var(--navy) !important; border-radius: 14px !important; text-transform: uppercase; }
.scan-log { list-style: none; margin: 12px 0 0; padding: 0; max-height: 380px; overflow: auto; display: grid; gap: 4px; }
.scan-log li { padding: 8px 12px; border-radius: 8px; font-size: .8rem; font-weight: 700; animation: riseIn .25s ease backwards; }
.scan-log li.ok { background: var(--ok-bg); color: var(--ok); }
.scan-log li.dup { background: #F3F4F6; color: var(--text-3); }
.scan-log li.bad { background: #FFF4E5; color: #8A5A00; }

/* Notices */
.notice-preview { background: #FBFCFE; }
.notice-preview strong { display: block; color: var(--navy); margin-bottom: 8px; }
.notice-preview p { margin: 0; font-size: .9rem; line-height: 1.6; }

@media (max-width: 1100px) { .form-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .opac-layout, .book-extra { grid-template-columns: 1fr; }
  .facets { position: static; max-height: none; }
  .suggest-link { margin-left: 0; }
}
@media (max-width: 560px) { .form-grid.four { grid-template-columns: 1fr; } .num-in { width: 64px; } }

.facets > summary { list-style: none; cursor: pointer; }
.facets > summary::-webkit-details-marker { display: none; }
@media (min-width: 901px) { .facets > summary { pointer-events: none; } }
@media (max-width: 900px) { .facets > summary::after { content: '▾'; margin-left: auto; } .facets[open] > summary::after { content: '▴'; } .facets-title { margin: 0; } .facets[open] .facets-title { margin-bottom: 10px; } }
.receive-form .num-in, .rules-table .num-in { width: 70px !important; flex: none; }
.receive-form { flex-wrap: nowrap; }
.rules-table th, .rules-table td { padding-left: 8px; padding-right: 8px; }
.rules-table .num-in { width: 60px !important; } .rules-table td:first-child { min-width: 120px; }

/* =====================================================================
   VERSION 7: HOMEPAGE PHOTOS (hero slider, inside the library, gallery, lightbox)
   ===================================================================== */
.focus-center { object-position: 50% 50%; } .focus-top { object-position: 50% 15%; } .focus-bottom { object-position: 50% 85%; }
.focus-left { object-position: 15% 50%; } .focus-right { object-position: 85% 50%; }

/* Hero slider */
.land-hero.has-slides { min-height: min(100svh, 900px); display: flex; flex-direction: column; justify-content: flex-end; background: #071B47; }
.has-slides .land-hero-glow { opacity: .35; z-index: 1; }
.has-slides .land-hero-grid, .has-slides > .land-wrap { position: relative; z-index: 2; }
.has-slides .land-hero-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); align-items: end; flex: 1; padding-top: 20px; }
.has-slides .land-hero-copy { padding: 30px 0 10px; }
.has-slides .land-title { text-shadow: 0 2px 30px rgba(0, 0, 0, .35); }
.has-slides .land-lead { color: rgba(255, 255, 255, .92); text-shadow: 0 1px 12px rgba(0, 0, 0, .4); }
.hero-slides { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.hero-slide { position: absolute; inset: 0; margin: 0; opacity: 0; visibility: hidden; transition: opacity 1.3s ease, visibility 0s linear 1.3s; }
.hero-slide.is-active { opacity: 1; visibility: visible; transition: opacity 1.3s ease, visibility 0s; }
.hero-img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.08); transform-origin: 60% 50%; }
.hero-slide.is-active .hero-img { animation: heroZoom var(--hero-zoom, 14s) ease-out forwards; }
@keyframes heroZoom { from { transform: scale(1.1); } to { transform: scale(1); } }
.hero-shade { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(7, 27, 71, .92) 0%, rgba(7, 27, 71, .72) 38%, rgba(7, 27, 71, .22) 72%, rgba(7, 27, 71, .1) 100%),
              linear-gradient(0deg, rgba(7, 27, 71, .95) 0%, rgba(7, 27, 71, .4) 24%, transparent 46%),
              linear-gradient(180deg, rgba(7, 27, 71, .55) 0%, transparent 22%); }
.hero-label { position: absolute; right: clamp(16px, 3vw, 40px); top: 104px; display: inline-flex; gap: 8px; align-items: center; z-index: 2;
  padding: 8px 14px; border-radius: 999px; background: rgba(7, 27, 71, .45); border: 1px solid rgba(255, 255, 255, .25); backdrop-filter: blur(8px);
  color: #fff; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: 0; transform: translateY(-6px); transition: opacity .6s ease .5s, transform .6s ease .5s; }
.hero-slide.is-active .hero-label { opacity: 1; transform: none; }
.hero-controls { justify-self: end; align-self: end; display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 999px;
  background: rgba(7, 27, 71, .4); border: 1px solid rgba(255, 255, 255, .2); backdrop-filter: blur(10px); margin-bottom: 18px; }
.hero-btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .08); color: #fff;
  display: grid; place-items: center; cursor: pointer; transition: background .2s, transform .2s; }
.hero-btn:hover { background: rgba(255, 255, 255, .2); transform: translateY(-1px); }
.hero-btn:focus-visible, .hero-dot:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.ic-pause { width: 12px; height: 14px; border-left: 4px solid #fff; border-right: 4px solid #fff; box-sizing: border-box; }
[data-hero-pause][aria-pressed="true"] .ic-pause { width: 0; height: 0; border: 0; border-left: 12px solid #fff; border-top: 7px solid transparent; border-bottom: 7px solid transparent; margin-left: 3px; }
.hero-dots { display: flex; gap: 6px; align-items: center; padding: 0 4px; }
.hero-dot { width: 22px; height: 22px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.hero-dot span { display: block; width: 8px; height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .5); overflow: hidden; position: relative; transition: width .35s ease, background .35s; }
.hero-dot.is-active span { width: 34px; background: rgba(255, 255, 255, .3); }
.hero-dot.is-active span::after { content: ""; position: absolute; inset: 0; background: var(--cyan); transform-origin: left; animation: heroProgress var(--hero-interval, 6s) linear forwards; }
.hero-slides.is-paused ~ * .hero-dot.is-active span::after, .land-hero.is-paused .hero-dot.is-active span::after { animation-play-state: paused; }
@keyframes heroProgress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.has-slides .land-stats { margin-top: 18px; background: rgba(7, 27, 71, .42); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, .14); border-bottom: 0; border-radius: 20px 20px 0 0; }

/* Inside the library */
.land-about { background: linear-gradient(180deg, #fff, var(--cream-soft)); overflow: hidden; }
.about-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(36px, 6vw, 80px); align-items: center; }
.about-collage { position: relative; display: grid; gap: 16px; }
.about-collage::before { content: ""; position: absolute; inset: 36px -22px -22px 36px; border-radius: 28px; border: 2px dashed rgba(9, 146, 194, .35); z-index: 0; }
.about-collage.n3 { grid-template-columns: 1.35fr 1fr; grid-template-rows: 230px 230px; }
.about-collage.n3 .p1 { grid-row: 1 / 3; }
.about-collage.n2 { grid-template-columns: 1.3fr 1fr; grid-template-rows: 470px; }
.about-collage.n2 .p2 { align-self: end; height: 72%; }
.about-collage.n1 { grid-template-rows: 460px; }
.about-photo { position: relative; z-index: 1; margin: 0; border-radius: 24px; overflow: hidden; box-shadow: 0 24px 60px rgba(7, 27, 71, .22); background: #DCE6F5; }
.about-img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .8s ease; }
.about-photo:hover .about-img { transform: scale(1.04); }
.about-photo figcaption { position: absolute; left: 12px; bottom: 12px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .9); color: var(--navy); font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.about-badge { position: absolute; z-index: 2; left: -14px; top: 28px; display: flex; gap: 12px; align-items: center; background: #fff; border-radius: 18px; padding: 14px 18px; box-shadow: 0 18px 40px rgba(7, 27, 71, .2); }
.about-badge .icon { width: 38px; height: 38px; padding: 8px; border-radius: 12px; background: var(--cream); color: var(--navy); }
.about-badge strong { display: block; font-size: 1.4rem; color: var(--navy); line-height: 1; }
.about-badge span { font-size: .64rem; font-weight: 800; letter-spacing: .08em; color: var(--text-3); }
.about-copy h2 { font-size: clamp(1.6rem, 3.1vw, 2.4rem); font-weight: 900; margin: 12px 0 14px; line-height: 1.12; }
.about-text { color: var(--text-2); font-size: 1.04rem; line-height: 1.75; margin: 0 0 20px; }
.about-points { list-style: none; margin: 0 0 26px; padding: 0; display: grid; gap: 10px; }
.about-points li { display: flex; gap: 12px; align-items: center; font-size: .8rem; font-weight: 800; letter-spacing: .05em; color: var(--navy); }
.about-points .icon { width: 30px; height: 30px; padding: 6px; border-radius: 10px; background: var(--info-bg); color: var(--blue); flex: none; }

/* Gallery */
.land-gallery { background: #fff; }
.gallery-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 210px; gap: 14px; grid-auto-flow: dense; }
.gallery-grid.n1 { grid-template-columns: 1fr; grid-auto-rows: 460px; }
.gallery-grid.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 360px; }
.gallery-grid.n3 { grid-template-columns: 2fr 1fr; grid-auto-rows: 230px; }
.gallery-item { position: relative; display: block; overflow: hidden; border-radius: 18px; background: #DCE6F5; box-shadow: 0 10px 30px rgba(7, 27, 71, .1); }
.gallery-grid.n4 .is-lead, .gallery-grid.n5 .is-lead, .gallery-grid.n6 .is-lead { grid-column: span 2; grid-row: span 2; }
.gallery-grid.n3 .is-lead { grid-row: span 2; }
.gallery-img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .7s cubic-bezier(.2, .7, .2, 1), filter .4s; }
.gallery-item:hover .gallery-img, .gallery-item:focus-visible .gallery-img { transform: scale(1.06); }
.gallery-over { position: absolute; inset: auto 0 0 0; display: flex; gap: 8px; align-items: center; padding: 26px 14px 12px; color: #fff;
  background: linear-gradient(0deg, rgba(7, 27, 71, .82), transparent); opacity: 0; transform: translateY(8px); transition: opacity .35s, transform .35s; font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; }
.gallery-item:hover .gallery-over, .gallery-item:focus-visible .gallery-over { opacity: 1; transform: none; }
.gallery-item:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 2000; display: grid; grid-template-rows: 1fr auto; place-items: center; padding: 56px 70px 24px; background: rgba(4, 12, 30, .94); animation: lbIn .25s ease; }
.lightbox[hidden] { display: none; }
@keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }
.lightbox img { max-width: 100%; max-height: calc(100vh - 150px); border-radius: 10px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); animation: lbImg .35s ease; }
@keyframes lbImg { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
.lightbox p { color: #fff; font-size: .82rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; margin: 14px 0 0; text-align: center; }
.lightbox p small { display: block; color: rgba(255, 255, 255, .55); font-size: .7rem; margin-top: 4px; }
.lb-btn { position: absolute; width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .08); color: #fff; display: grid; place-items: center; cursor: pointer; }
.lb-btn:hover { background: rgba(255, 255, 255, .2); }
.lb-close { top: 14px; right: 14px; } .lb-prev { left: 14px; top: 50%; transform: translateY(-50%); } .lb-next { right: 14px; top: 50%; transform: translateY(-50%); }

/* Admin: homepage photos */
.hp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.hp-card { position: relative; overflow: hidden; }
.hp-card.is-hidden .hp-thumb img { filter: grayscale(1) opacity(.6); }
.hp-thumb { position: relative; aspect-ratio: 3 / 2; background: #E9EEF5; }
.hp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hp-pos { position: absolute; left: 10px; top: 10px; background: rgba(7, 27, 71, .8); color: #fff; font-weight: 900; font-size: .74rem; padding: 4px 10px; border-radius: 999px; }
.hp-state { position: absolute; left: 56px; top: 10px; }
.hp-order { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 6px; }
.hp-order .icon-btn { background: rgba(255, 255, 255, .92); }
.hp-del { position: absolute; right: 8px; top: 8px; }
.hp-del .icon-btn { background: rgba(255, 255, 255, .92); }
.hp-form .field { margin-bottom: 10px; }

@media (max-width: 900px) {
  .land-hero.has-slides { min-height: 0; }
  .has-slides .land-hero-grid { grid-template-columns: 1fr; padding-top: 0; }
  .has-slides .land-hero-copy { padding-top: 40px; }
  .hero-shade { background: linear-gradient(180deg, rgba(7, 27, 71, .7) 0%, rgba(7, 27, 71, .55) 40%, rgba(7, 27, 71, .92) 100%); }
  .hero-controls { justify-self: start; margin: 6px 0 4px; }
  .hero-label { display: none; }
  .about-grid { grid-template-columns: 1fr; }
  .about-collage.n3 { grid-template-rows: 180px 180px; }
  .about-collage.n2 { grid-template-rows: 320px; }
  .about-collage.n1 { grid-template-rows: 300px; }
  .about-collage::before { inset: 20px -10px -12px 20px; }
  .about-badge { left: 8px; top: -16px; padding: 10px 14px; }
  .gallery-grid, .gallery-grid.n3 { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 150px; gap: 10px; }
  .gallery-grid.n3 .is-lead, .gallery-grid.n4 .is-lead, .gallery-grid.n5 .is-lead, .gallery-grid.n6 .is-lead { grid-column: span 2; grid-row: span 2; }
  .gallery-grid.n1 { grid-auto-rows: 260px; } .gallery-grid.n2 { grid-auto-rows: 200px; }
  .gallery-over { opacity: 1; transform: none; }
  .lightbox { padding: 60px 10px 20px; }
  .lb-prev, .lb-next { top: auto; bottom: 18px; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-slide, .hero-slide.is-active { transition: none; }
  .hero-slide.is-active .hero-img, .hero-dot.is-active span::after { animation: none; }
  .hero-img { transform: none; }
  .hero-dot.is-active span { background: var(--cyan); }
}
