/* ==========================================================================
   计算机九班 · 校园纸本年鉴与日常活页册
   Design System — Light (Daytime Paper & Pine Ink) / Dark (Night Study Desk)
   Zero external fonts, zero CDN, zero decorative blur/gradient slop.
   ========================================================================== */

:root {
  color-scheme: light dark;

  /* Fonts (local system stacks only) */
  --font-serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "FangSong", "SimSun", Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  /* Light Palette: Daytime Paper & Pine Ink */
  --bg: #F4F2EC;
  --surface: #FAF9F5;
  --surface-alt: #EAE6DC;
  --surface-hover: #EFECE3;
  --note-bg: #FCFBF7;

  --ink: #181A1B;
  --ink-2: #484D50;
  --muted: #62686B;

  --brand: #1B4D3E;
  --brand-hover: #143B2F;
  --brand-ink: #FAF9F5;
  --brand-tint: rgba(27, 77, 62, 0.08);
  --brand-line: rgba(27, 77, 62, 0.30);

  --accent: #B85A19;
  --accent-tint: rgba(184, 90, 25, 0.10);
  --accent-line: rgba(184, 90, 25, 0.34);

  --income: #1B6640;
  --expense: #B23A2B;
  --danger: #A62C22;
  --danger-tint: rgba(166, 44, 34, 0.09);

  --line: rgba(24, 26, 27, 0.14);
  --line-strong: rgba(24, 26, 27, 0.28);
  --line-double: rgba(24, 26, 27, 0.65);

  --shadow-paper: 0 1px 2px rgba(24, 26, 27, 0.06);
  --shadow-modal: 0 18px 44px rgba(18, 22, 20, 0.18);
  --backdrop: rgba(18, 20, 19, 0.56);

  /* Radii — restrained print craft */
  --r-xs: 2px;
  --r-sm: 4px;
  --r-md: 6px;

  /* Spacing scale (4px base) */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;

  /* Type adjustments (light) */
  --body-leading: 1.65;
  --body-tracking: 0em;

  /* Layout metrics */
  --topbar-h: 58px;
  --m-bar-h: 52px;
  --m-tabs-h: 56px;
  --max-w: 1060px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131615;
    --surface: #1B1F1E;
    --surface-alt: #242A28;
    --surface-hover: #212725;
    --note-bg: #1E2321;

    --ink: #E8E6DF;
    --ink-2: #B6BBB6;
    --muted: #939A94;

    --brand: #2B755D;
    --brand-hover: #358A6E;
    --brand-ink: #F4F7F5;
    --brand-text: #72C7AA;
    --brand-tint: rgba(114, 199, 170, 0.11);
    --brand-line: rgba(114, 199, 170, 0.34);

    --accent: #E2A65F;
    --accent-tint: rgba(226, 166, 95, 0.12);
    --accent-line: rgba(226, 166, 95, 0.36);

    --income: #6CC496;
    --expense: #E68274;
    --danger: #E6766B;
    --danger-tint: rgba(230, 118, 107, 0.13);

    --line: rgba(232, 230, 223, 0.13);
    --line-strong: rgba(232, 230, 223, 0.26);
    --line-double: rgba(232, 230, 223, 0.45);

    --shadow-paper: none;
    --shadow-modal: 0 22px 54px rgba(0, 0, 0, 0.62);
    --backdrop: rgba(6, 8, 7, 0.76);

    --body-leading: 1.72;
    --body-tracking: 0.012em;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #131615;
  --surface: #1B1F1E;
  --surface-alt: #242A28;
  --surface-hover: #212725;
  --note-bg: #1E2321;

  --ink: #E8E6DF;
  --ink-2: #B6BBB6;
  --muted: #939A94;

  --brand: #2B755D;
  --brand-hover: #358A6E;
  --brand-ink: #F4F7F5;
  --brand-text: #72C7AA;
  --brand-tint: rgba(114, 199, 170, 0.11);
  --brand-line: rgba(114, 199, 170, 0.34);

  --accent: #E2A65F;
  --accent-tint: rgba(226, 166, 95, 0.12);
  --accent-line: rgba(226, 166, 95, 0.36);

  --income: #6CC496;
  --expense: #E68274;
  --danger: #E6766B;
  --danger-tint: rgba(230, 118, 107, 0.13);

  --line: rgba(232, 230, 223, 0.13);
  --line-strong: rgba(232, 230, 223, 0.26);
  --line-double: rgba(232, 230, 223, 0.45);

  --shadow-paper: none;
  --shadow-modal: 0 22px 54px rgba(0, 0, 0, 0.62);
  --backdrop: rgba(6, 8, 7, 0.76);

  --body-leading: 1.72;
  --body-tracking: 0.012em;
}

:root[data-theme="light"] {
  color-scheme: light;
}

/* Link / accent ink alias */
:root {
  --link-ink: var(--brand-text, var(--brand));
}

/* ---------- Base Reset & Browser Surface Theming ---------- */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: var(--body-leading);
  letter-spacing: var(--body-tracking);
  overflow-x: clip;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--brand-tint);
  color: var(--ink);
}

input, textarea, select {
  caret-color: var(--link-ink);
  font: inherit;
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

img {
  display: block;
  max-width: 100%;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 600;
  line-height: 1.28;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

:focus-visible {
  outline: 2px solid var(--link-ink);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 200;
  padding: 10px 14px;
  background: var(--brand);
  color: var(--brand-ink);
  border-radius: var(--r-xs);
  font-size: 14px;
  text-decoration: none;
}
.skip-link:focus {
  top: 12px;
}

/* Role visibility */
body:not(.is-admin) .admin-only {
  display: none !important;
}

/* Utility classes */
.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.serif {
  font-family: var(--font-serif);
}
.muted {
  color: var(--muted);
}
.ink-2 {
  color: var(--ink-2);
}
.prose {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  color: var(--ink);
}
.preview-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.preview-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.preview-4 {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ico {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

/* ---------- Navigation Chrome: Editorial Top Masthead (Desktop) ---------- */
.masthead {
  display: none;
}

.m-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--m-bar-h);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.brand-link {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  text-decoration: none;
  min-height: 40px;
  align-items: center;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.brand-code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.m-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.m-user-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 4px;
  text-decoration: none;
  font-size: 13.5px;
  color: var(--ink-2);
}

/* Mobile bottom 5-tab bar: pure typography + crisp top active rule */
.m-tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.m-tabs a,
.m-tabs button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--m-tabs-h);
  padding: 0 4px;
  border: 0;
  background: transparent;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}

.m-tabs a[aria-current="page"],
.m-tabs button.is-active {
  color: var(--ink);
  font-weight: 700;
}

.m-tabs a[aria-current="page"]::before,
.m-tabs button.is-active::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 22%;
  right: 22%;
  height: 2px;
  background: var(--accent);
}

@media (min-width: 900px) {
  .m-bar,
  .m-tabs {
    display: none;
  }

  .masthead {
    position: sticky;
    top: 0;
    z-index: 40;
    display: block;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }

  .masthead-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 28px;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
  }

  .masthead-nav {
    display: flex;
    align-items: stretch;
    gap: 2px;
    height: 100%;
  }

  .masthead-nav a {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 0 11px;
    font-size: 14px;
    font-weight: 500;
    color: var(--ink-2);
    text-decoration: none;
    white-space: nowrap;
    transition: color 150ms ease;
  }

  .masthead-nav a:hover {
    color: var(--ink);
  }

  .masthead-nav a[aria-current="page"] {
    color: var(--ink);
    font-weight: 600;
  }

  .masthead-nav a[aria-current="page"]::after {
    content: "";
    position: absolute;
    left: 11px;
    right: 11px;
    bottom: -1px;
    height: 2px;
    background: var(--accent);
  }

  .masthead-user {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
  }

  .masthead-me {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13.5px;
    color: var(--ink-2);
    text-decoration: none;
    min-height: 36px;
  }
  .masthead-me:hover {
    color: var(--ink);
  }
  .masthead-me strong {
    font-weight: 600;
    color: var(--ink);
  }
}

/* ---------- Page Shell ---------- */
.page-shell {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 20px 16px calc(var(--m-tabs-h) + 36px + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 900px) {
  .page-shell {
    padding: 36px 28px 72px;
  }
}

/* Standard Editorial Page Header (adapted per page via modifiers) */
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
  padding-bottom: 16px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.page-head h1 {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.page-head-note {
  margin-top: 6px;
  font-size: 14px;
  color: var(--muted);
  max-width: 58ch;
}

@media (min-width: 900px) {
  .page-head h1 {
    font-size: 30px;
  }
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* ---------- Buttons & Interactive Controls (One Consistent Vocabulary) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: var(--r-xs);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.btn:hover:not(:disabled) {
  background: var(--surface-alt);
  border-color: var(--ink-2);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-ink);
}
.btn.btn-primary:hover:not(:disabled) {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
  color: var(--brand-ink);
}

.btn.btn-accent {
  background: var(--accent-tint);
  border-color: var(--accent-line);
  color: var(--accent);
}
.btn.btn-accent:hover:not(:disabled) {
  background: var(--accent-tint);
  border-color: var(--accent);
}

.btn.btn-danger {
  border-color: transparent;
  background: transparent;
  color: var(--danger);
}
.btn.btn-danger:hover:not(:disabled) {
  background: var(--danger-tint);
  border-color: transparent;
}

.btn.btn-quiet {
  border-color: transparent;
  background: transparent;
  color: var(--ink-2);
  padding: 0 8px;
}
.btn.btn-quiet:hover:not(:disabled) {
  background: var(--surface-alt);
  border-color: transparent;
  color: var(--ink);
}

.btn.btn-sm {
  min-height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

/* Text action link/button for inline lists (no button-box clutter) */
.text-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: color 140ms ease;
}
.text-action:hover:not(:disabled) {
  color: var(--ink);
  text-decoration: underline;
}
.text-action.is-brand {
  color: var(--link-ink);
}
.text-action.is-accent,
.text-action[aria-pressed="true"] {
  color: var(--accent);
  font-weight: 600;
}
.text-action.is-danger {
  color: var(--danger);
}
.text-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Hairline Stamps (replaces plastic colored pills) */
.stamp {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xs);
  font-size: 12px;
  line-height: 1.45;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
}
.stamp-brand {
  border-color: var(--brand-line);
  color: var(--link-ink);
  background: var(--brand-tint);
}
.stamp-accent {
  border-color: var(--accent-line);
  color: var(--accent);
  background: var(--accent-tint);
}
.stamp-income {
  border-color: rgba(27, 102, 64, 0.32);
  color: var(--income);
}
.stamp-expense {
  border-color: rgba(178, 58, 43, 0.34);
  color: var(--expense);
}

/* Quiet Square Avatar */
.avatar {
  width: var(--av-size, 36px);
  height: var(--av-size, 36px);
  border-radius: var(--r-sm);
  overflow: hidden;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-family: var(--font-serif);
  font-size: calc(var(--av-size, 36px) * 0.44);
  font-weight: 700;
  user-select: none;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Forms & Inputs ---------- */
.form-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field > span {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-2);
}

.field input:not([type="checkbox"]),
.field textarea,
.field select {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  transition: border-color 140ms ease;
}

.field textarea {
  min-height: 104px;
  resize: vertical;
}

.field input[type="file"] {
  padding: 8px 10px;
  font-size: 14px;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--link-ink);
  box-shadow: 0 0 0 1px var(--link-ink);
}

.check-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  font-size: 13.5px;
  color: var(--ink-2);
  cursor: pointer;
}
.check-label input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
}

.form-error {
  padding: 10px 12px;
  border: 1px solid var(--danger);
  border-radius: var(--r-xs);
  background: var(--danger-tint);
  color: var(--danger);
  font-size: 14px;
}

/* Search Input */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
}
.roster-controls .search-box {
  flex: 1 1 240px;
  width: auto;
}
.search-box .ico {
  position: absolute;
  left: 11px;
  color: var(--muted);
  pointer-events: none;
}
.search-box input {
  width: 100%;
  min-height: 42px;
  padding: 8px 12px 8px 34px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 15px;
}
.search-box input:focus {
  outline: none;
  border-color: var(--link-ink);
}

/* Filter Underline Tabs (replaces bubble chips) */
.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
}
.filter-tab {
  position: relative;
  min-height: 40px;
  padding: 4px 2px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.filter-tab:hover {
  color: var(--ink);
}
.filter-tab[aria-pressed="true"] {
  color: var(--ink);
  font-weight: 600;
}
.filter-tab[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4px;
  height: 2px;
  background: var(--accent);
}

/* ---------- Empty, Loading, Error & Toast ---------- */
.empty-note {
  padding: 28px 18px;
  border-top: 1px dashed var(--line-strong);
  border-bottom: 1px dashed var(--line-strong);
  color: var(--muted);
  font-size: 14.5px;
  text-align: left;
}
.empty-note[role="alert"] {
  color: var(--danger);
  border-color: var(--danger);
}

.toast-stack {
  position: fixed;
  right: 16px;
  bottom: calc(var(--m-tabs-h) + 16px + env(safe-area-inset-bottom, 0px));
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(340px, calc(100vw - 32px));
}
@media (min-width: 900px) {
  .toast-stack {
    bottom: 24px;
    right: 24px;
  }
}
.toast {
  padding: 10px 14px;
  border-radius: var(--r-xs);
  border: 1px solid var(--line-strong);
  background: var(--ink);
  color: var(--bg);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-modal);
}
.toast-error {
  background: var(--danger);
  border-color: var(--danger);
  color: #FAF9F5;
}

/* ---------- Native <dialog> Modals & Drawer & Lightbox ---------- */
dialog.modal {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-modal);
  overflow: hidden;
}
dialog.modal::backdrop {
  background: var(--backdrop);
}
dialog.modal[open] {
  display: flex;
  flex-direction: column;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
}

.modal-body {
  padding: 18px;
  overflow-y: auto;
  flex: 1 1 auto;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

/* Mobile "More" Drawer */
dialog.modal.drawer {
  width: 100%;
  max-width: 100%;
  margin: auto 0 0 0;
  border-radius: var(--r-md) var(--r-md) 0 0;
  border-bottom: 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.drawer-list {
  display: flex;
  flex-direction: column;
}
.drawer-list a,
.drawer-list button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 4px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-size: 15.5px;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
}
.drawer-list a[aria-current="page"] {
  color: var(--accent);
  font-weight: 600;
}
.drawer-foot {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Lightbox Modal */
dialog.modal.lightbox {
  width: min(1020px, calc(100vw - 20px));
  background: #141716;
  color: #E8E6DF;
  border-color: rgba(232, 230, 223, 0.18);
}
dialog.modal.lightbox .modal-head {
  border-bottom-color: rgba(232, 230, 223, 0.14);
}
dialog.modal.lightbox .modal-head h2,
dialog.modal.lightbox .btn-quiet,
dialog.modal.lightbox .text-action {
  color: #E8E6DF;
}
dialog.modal.lightbox .muted {
  color: #A2A8A2;
}
dialog.modal.lightbox .field > span {
  color: #C4C9C4;
}
dialog.modal.lightbox .field textarea {
  background: #1D2220;
  border-color: rgba(232, 230, 223, 0.22);
  color: #E8E6DF;
}
dialog.modal.lightbox .comment-item {
  border-bottom-color: rgba(232, 230, 223, 0.12);
}

.lightbox-grid {
  display: grid;
  gap: 20px;
}
@media (min-width: 820px) {
  .lightbox-grid {
    grid-template-columns: minmax(0, 1.55fr) minmax(260px, 1fr);
    align-items: start;
  }
}
.lightbox-stage {
  margin: 0;
  background: #0B0D0C;
  border-radius: var(--r-xs);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.lightbox-stage img {
  width: 100%;
  max-height: 64dvh;
  object-fit: contain;
}
.lightbox-caption {
  width: 100%;
  padding: 10px 14px;
  font-size: 13.5px;
  color: #C9CEC9;
  border-top: 1px solid rgba(232, 230, 223, 0.1);
}
.lightbox-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}

/* ---------- Comments Block (Shared) ---------- */
.comments {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.comments-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 12px;
}
.comment-list {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
}
.comment-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.comment-item:last-child {
  border-bottom: 0;
}
.comment-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.comment-head strong {
  font-size: 13.5px;
  font-weight: 600;
}
.comment-head time {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

/* ==========================================================================
   PAGE 1: LOGIN — Class Registration Slip & Print Colophon
   ========================================================================== */
body.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
}
.login-shell {
  width: 100%;
  max-width: 880px;
}
.login-sheet {
  display: grid;
  border-top: 2px solid var(--line-double);
  border-bottom: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: var(--shadow-paper);
}
.login-colophon {
  padding: 28px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
}
.login-org {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.03em;
}
.login-title {
  font-family: var(--font-serif);
  font-size: 38px;
  font-weight: 700;
  line-height: 1.15;
  margin-top: 10px;
  letter-spacing: 0.04em;
}
.login-lead {
  margin-top: 14px;
  font-size: 15px;
  color: var(--ink-2);
  max-width: 34ch;
}
.login-meta-foot {
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
}
.login-form-pane {
  padding: 28px 24px;
}
.login-form-pane h2 {
  font-size: 18px;
  font-weight: 600;
}
.login-form-hint {
  margin-top: 4px;
  margin-bottom: 20px;
  font-size: 13.5px;
  color: var(--muted);
}
.login-mode-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: -8px;
  font-size: 12.5px;
  color: var(--muted);
}

@media (min-width: 780px) {
  .login-sheet {
    grid-template-columns: 0.92fr 1.08fr;
    border: 1px solid var(--line-strong);
    border-top: 3px solid var(--brand);
  }
  .login-colophon {
    padding: 44px 36px;
    border-bottom: 0;
    border-right: 1px solid var(--line);
  }
  .login-title {
    font-size: 46px;
  }
  .login-form-pane {
    padding: 44px 40px;
  }
}

/* ==========================================================================
   PAGE 2: INDEX — Campus Broadsheet Cover (NOT a SaaS Dashboard)
   ========================================================================== */
.frontpage {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.issue-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 16px;
  padding: 8px 0;
  border-top: 2px solid var(--line-double);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

.cover-head {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 6px;
}

.cover-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px 24px;
}

.cover-title {
  font-family: var(--font-serif);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.1;
}

@media (min-width: 900px) {
  .cover-title {
    font-size: 52px;
  }
}

.cover-summary {
  font-size: 15.5px;
  color: var(--ink-2);
  max-width: 54ch;
}

.cover-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 4px;
}

/* Horizontal Index Band (6 live counts separated by hairlines — zero cards) */
.index-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

.index-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 12px;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  transition: background-color 140ms ease;
}
.index-cell:nth-child(3n) {
  border-right: 0;
}
.index-cell:nth-child(n + 4) {
  border-bottom: 0;
}
.index-cell:hover {
  background: var(--surface-hover);
}
.index-cell strong {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
}
.index-cell span {
  font-size: 13px;
  color: var(--muted);
}

@media (min-width: 760px) {
  .index-band {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .index-cell {
    border-bottom: 0;
    border-right: 1px solid var(--line);
    padding: 16px 14px;
  }
  .index-cell:nth-child(3n) {
    border-right: 1px solid var(--line);
  }
  .index-cell:last-child {
    border-right: 0;
  }
  .index-cell strong {
    font-size: 26px;
  }
}

/* Asymmetric Broadsheet Columns: Lead Photos (Left) + Chronicle Briefs (Right) */
.cover-columns {
  display: grid;
  gap: 32px;
}

@media (min-width: 860px) {
  .cover-columns {
    grid-template-columns: minmax(0, 1.38fr) minmax(0, 1fr);
    gap: 36px;
    align-items: start;
  }
  .cover-side {
    padding-left: 32px;
    border-left: 1px solid var(--line);
  }
}

.sec-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line-strong);
}
.sec-bar h2 {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
}
.sec-more {
  font-size: 13.5px;
  color: var(--link-ink);
  text-decoration: none;
}
.sec-more:hover {
  text-decoration: underline;
}

.cover-lead-photo {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.cover-lead-photo img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--r-xs);
  border: 1px solid var(--line);
  transition: opacity 160ms ease;
}
.cover-lead-photo:hover img {
  opacity: 0.94;
}
.cover-photo-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 8px;
  font-size: 13.5px;
  color: var(--ink-2);
}

.cover-thumb-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.cover-thumb {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.cover-thumb img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--r-xs);
  border: 1px solid var(--line);
}

.brief-list {
  display: flex;
  flex-direction: column;
}
.brief-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  align-items: baseline;
}
.brief-row:first-child {
  padding-top: 4px;
}
.brief-row:hover strong {
  color: var(--link-ink);
}
.brief-row time {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.brief-row strong {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  transition: color 140ms ease;
}

.cover-shortcuts {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 14px;
}
.cover-shortcuts a {
  color: var(--ink-2);
  text-decoration: none;
}
.cover-shortcuts a:hover {
  color: var(--link-ink);
  text-decoration: underline;
}

/* ==========================================================================
   PAGE 3: MEMBERS — Compact Class Directory / Roster (NOT E-commerce Cards)
   ========================================================================== */
.roster-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 18px;
}

.roster-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  border-top: 1px solid var(--line-strong);
}

@media (min-width: 860px) {
  .roster-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 32px;
  }
}

.roster-row {
  display: grid;
  grid-template-columns: 28px 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 6px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: background-color 140ms ease;
}
.roster-row:hover {
  background: var(--surface-hover);
}
.roster-seat {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.roster-info {
  min-width: 0;
}
.roster-name-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.roster-name-line strong {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink);
}
.roster-bio {
  margin-top: 2px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.roster-tail {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}
.roster-award {
  font-family: var(--font-mono);
  color: var(--accent);
  font-weight: 500;
}

/* ==========================================================================
   PAGE 4: PROFILE — Personal Dossier & Honors Sheet
   ========================================================================== */
.export-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 12px 0;
  margin-bottom: 24px;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}
.export-strip-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
}

.dossier-layout {
  display: grid;
  gap: 32px;
}
@media (min-width: 880px) {
  .dossier-layout {
    grid-template-columns: minmax(0, 1.55fr) minmax(260px, 1fr);
    gap: 36px;
    align-items: start;
  }
  .dossier-honors {
    padding-left: 28px;
    border-left: 1px solid var(--line);
  }
}

.dossier-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line-strong);
}
.dossier-id {
  display: flex;
  align-items: center;
  gap: 16px;
}
.dossier-id h2 {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
}
.dossier-sub {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--muted);
}

.dossier-facts {
  margin: 18px 0 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 600px) {
  .dossier-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 28px;
  }
}
.dossier-fact {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.dossier-fact dt {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 3px;
}
.dossier-fact dd {
  margin: 0;
  font-size: 14.5px;
}

.record-list {
  display: flex;
  flex-direction: column;
}
.record-row {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.record-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 12px;
}
.record-top h3 {
  font-size: 16px;
  font-weight: 600;
}
.record-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
}
.record-ops {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 2px;
}

/* ==========================================================================
   PAGE 5: TIMELINE — Vertical Chronicle Spine
   ========================================================================== */
.chronicle {
  max-width: 780px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.chronicle-year {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding-bottom: 10px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line-strong);
  font-variant-numeric: tabular-nums;
}

.chronicle-rail {
  position: relative;
  padding-left: 22px;
  border-left: 1px solid var(--line-strong);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.chronicle-entry {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chronicle-entry::before {
  content: "";
  position: absolute;
  left: -26px;
  top: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.chronicle-date {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.chronicle-entry h3 {
  font-size: 18px;
  font-weight: 600;
}

.chronicle-entry .prose {
  max-width: 64ch;
  color: var(--ink-2);
}

.chronicle-photo-btn {
  display: block;
  width: 100%;
  max-width: 560px;
  padding: 0;
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  overflow: hidden;
  background: var(--surface-alt);
  cursor: pointer;
}
.chronicle-photo-btn img {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
}

/* ==========================================================================
   PAGE 6 & 7: ALBUMS & ALBUM DETAIL — Photo-First Contact Sheet
   ========================================================================== */
.gallery-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px 20px;
}
@media (min-width: 620px) {
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 960px) {
  .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px 24px;
  }
}

.album-tile {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
}
.album-frame {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--r-xs);
  background: var(--surface-alt);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
}
.album-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 240ms ease;
}
.album-tile:hover .album-frame img {
  transform: scale(1.025);
}
.album-empty-cover {
  font-size: 13px;
  color: var(--muted);
}
.album-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.album-title-row h3 {
  font-size: 16.5px;
  font-weight: 600;
  color: var(--ink);
}
.album-meta-line {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}
.album-desc {
  font-size: 13.5px;
  color: var(--ink-2);
}

/* Album Detail */
.album-header-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 18px;
}
.album-desc-lead {
  margin-bottom: 20px;
  max-width: 66ch;
  color: var(--ink-2);
}

.contact-sheet {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
@media (min-width: 680px) {
  .contact-sheet {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }
}
@media (min-width: 980px) {
  .contact-sheet {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.photo-cell {
  position: relative;
  display: block;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  overflow: hidden;
  background: var(--surface-alt);
  aspect-ratio: 1 / 1;
  cursor: pointer;
}
.photo-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 220ms ease;
}
.photo-cell:hover img {
  transform: scale(1.03);
}
.photo-like-tag {
  position: absolute;
  right: 6px;
  bottom: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: var(--r-xs);
  background: rgba(16, 18, 17, 0.72);
  color: #F4F2EC;
  font-family: var(--font-mono);
  font-size: 12px;
}

/* ==========================================================================
   PAGE 8: TREEHOLE — Intimate Narrow Anonymous Stream (max 680px)
   ========================================================================== */
.treehole-col {
  max-width: 680px;
  margin: 0 auto;
}

.composer-sheet {
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  margin-bottom: 28px;
}
.composer-sheet textarea {
  width: 100%;
  min-height: 78px;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 15.5px;
  line-height: 1.7;
  resize: vertical;
}
.composer-sheet textarea:focus {
  outline: none;
}
.composer-foot {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.composer-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}
.char-meter.near-limit {
  color: var(--danger);
  font-weight: 600;
}

.echo-stream {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line-strong);
}

.echo-item {
  padding: 18px 2px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.echo-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.echo-author {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.echo-time {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.echo-body {
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--ink);
}
.echo-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
}

/* ==========================================================================
   PAGE 9: LEDGER — Structured Class Accounting Sheet
   ========================================================================== */
.ledger-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 20px;
}

.ledger-summary-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  border-top: 2px solid var(--line-double);
  border-bottom: 2px solid var(--line-double);
  background: var(--surface);
  margin-bottom: 28px;
}
.ledger-kpi {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.ledger-kpi:last-child {
  border-bottom: 0;
}
.ledger-kpi span {
  font-size: 13.5px;
  color: var(--muted);
}
.ledger-kpi strong {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 24px;
  font-weight: 700;
}
.amount-income {
  color: var(--income);
}
.amount-expense {
  color: var(--expense);
}

@media (min-width: 680px) {
  .ledger-summary-band {
    grid-template-columns: 1.25fr 1fr 1fr;
  }
  .ledger-kpi {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    border-bottom: 0;
    border-right: 1px solid var(--line);
    padding: 18px 22px;
  }
  .ledger-kpi:last-child {
    border-right: 0;
  }
  .ledger-kpi.is-balance strong {
    font-size: 30px;
  }
}

.ledger-head-row {
  display: none;
}

.ledger-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line-strong);
}

.ledger-item {
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 14px;
  align-items: baseline;
}
.ledger-item:nth-child(even) {
  background: rgba(128, 128, 120, 0.04);
}
.ledger-reason {
  font-size: 15.5px;
  font-weight: 500;
  color: var(--ink);
}
.ledger-amt {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 16px;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}
.ledger-sub {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 14px;
  font-size: 13px;
  color: var(--muted);
}
.ledger-cell-date,
.ledger-cell-handler,
.ledger-cell-ops {
  display: none;
}

.ledger-sub-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

@media (min-width: 820px) {
  .ledger-head-row {
    display: grid;
    grid-template-columns: 108px minmax(0, 1.5fr) 88px 132px minmax(120px, 0.9fr);
    gap: 14px;
    padding: 9px 8px;
    border-top: 1px solid var(--line-strong);
    border-bottom: 1px solid var(--line-strong);
    background: var(--surface-alt);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink-2);
  }
  .ledger-head-row span:nth-child(4) {
    text-align: right;
  }
  .ledger-list {
    border-top: 0;
  }
  .ledger-item {
    grid-template-columns: 108px minmax(0, 1.5fr) 88px 132px minmax(120px, 0.9fr);
    gap: 14px;
    padding: 13px 8px;
    align-items: center;
  }
  .ledger-sub {
    display: none;
  }
  .ledger-cell-date {
    display: block;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--muted);
  }
  .ledger-cell-handler {
    display: block;
    font-size: 13.5px;
    color: var(--ink-2);
  }
  .ledger-cell-ops {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 2px 10px;
  }
}

/* ==========================================================================
   PAGE 10: RESOURCES — Library Index & Bookshelf Catalog
   ========================================================================== */
.catalog-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.catalog-groups {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.catalog-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line-strong);
}

.catalog-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 8px 14px;
  padding: 15px 4px;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.catalog-row:hover {
  background: var(--surface-hover);
}
.catalog-call {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: center;
  padding: 3px 4px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xs);
  color: var(--ink-2);
  margin-top: 2px;
}
.catalog-call.is-file {
  border-color: var(--accent-line);
  color: var(--accent);
}
.catalog-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.catalog-title {
  font-size: 16.5px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}
.catalog-title:hover {
  color: var(--link-ink);
  text-decoration: underline;
}
.catalog-desc {
  font-size: 14px;
  color: var(--ink-2);
  max-width: 64ch;
}
.catalog-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 14px;
  font-size: 12.5px;
  color: var(--muted);
}
.catalog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}
.catalog-ops {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
}

@media (min-width: 780px) {
  .catalog-row {
    grid-template-columns: 62px minmax(0, 1fr) auto;
    align-items: center;
    padding: 16px 8px;
  }
  .catalog-ops {
    grid-column: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
  }
}

/* ==========================================================================
   PAGE 11: EXPERIENCE — Campus Pinboard Notes
   ========================================================================== */
.pending-board {
  padding: 18px;
  margin-bottom: 24px;
  border: 1px dashed var(--accent-line);
  border-radius: var(--r-sm);
  background: var(--accent-tint);
}
.pending-board .sec-bar {
  border-bottom-color: var(--accent-line);
}

.pinboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}
@media (min-width: 720px) {
  .pinboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    align-items: start;
  }
}

.note-sheet {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-top: 2px solid var(--line-strong);
  background: var(--note-bg);
  box-shadow: var(--shadow-paper);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.note-sheet.is-pinned {
  border-top-color: var(--accent);
}
.note-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
  font-size: 12.5px;
  color: var(--muted);
}
.note-sheet h3 {
  font-size: 17px;
  font-weight: 600;
}
.note-sheet .prose {
  font-size: 14.5px;
  color: var(--ink-2);
}
.note-foot {
  padding-top: 8px;
  margin-top: 4px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}
