:root[data-brand="custom"] {
  --navy-900: #fff;
  --navy-800: #fff;
  --navy-700: #f2f5fb;
  --navy-600: #e7eefc;
  --line: #d8e1ed;
  --text-on-dark: #192e50;
  --muted-on-dark: #526781;
  --accent: #0045be;
  --accent-strong: #003ca6;
  --accent-soft: #f0f5ff;
  --paper-bg: #edf1f6;
  --ink: #192e50;
  --ink-muted: #526781;
  --focus: #0045be;
  --college-yellow: #f5e800;
  --radius: 5px;
  --panel-w: 280px;
  color-scheme: light;
}

[data-brand="custom"] .topbar {
  border-top: 4px solid var(--college-yellow);
  padding: max(6px, env(safe-area-inset-top)) clamp(16px, 1.4vw, 26px) 6px;
}
[data-brand="custom"] .university-brand {
  display: flex;
  flex: none;
  align-items: center;
  width: 128px;
  height: 44px;
}
[data-brand="custom"] .university-brand img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
[data-brand="custom"] .title-wrap {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
[data-brand="custom"] .book-title { max-width: 100%; font-size: 17px; }
[data-brand="custom"] #panelToggle {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
[data-brand="custom"] #panelToggle:hover:not(:disabled) { background: var(--accent-strong); }
[data-brand="custom"] .badge { color: #725400; background: #fff9ca; border-color: #d6bc4d; }
[data-brand="custom"] .btn:not(.accent):not([aria-pressed="true"]) { background-color: #fff; }
[data-brand="custom"] .btn:hover:not(:disabled):not(.accent):not([aria-pressed="true"]) { background-color: var(--navy-600); }
[data-brand="custom"] .btn.accent,
[data-brand="custom"] .btn[aria-pressed="true"] { color: #fff; }
[data-brand="custom"] .tab[aria-selected="true"] { color: var(--accent); }
[data-brand="custom"] .tab[aria-selected="true"]::after { background: var(--college-yellow); }
[data-brand="custom"] .thumb-list { grid-template-columns: minmax(0, 1fr); }
[data-brand="custom"] .thumb {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 10px;
  border: 1px solid var(--line);
  text-align: left;
}
[data-brand="custom"] .thumb-frame { box-shadow: 0 1px 4px #192e5020; }
[data-brand="custom"] .thumb-no { text-align: left; }
[data-brand="custom"] .thumb-no::before { content: "ページ "; }
[data-brand="custom"] .thumb.is-current {
  border-color: var(--accent);
  box-shadow: inset 4px 0 var(--college-yellow);
  color: var(--accent);
}
[data-brand="custom"] .thumb-mark { right: 15px; }
[data-brand="custom"] .result-snippet { color: var(--ink-muted); }
[data-brand="custom"] .result-snippet mark { background: #fff6a3; color: var(--ink); }
[data-brand="custom"] .side-nav {
  width: 38px;
  height: 38px;
  margin-top: -19px;
  border: 1px solid #d1dced;
  border-radius: 50%;
  background: #ffffffed;
  color: var(--accent);
  opacity: 1;
}
[data-brand="custom"] .side-nav:hover,
[data-brand="custom"] .side-nav:focus-visible { background: #fff; box-shadow: 0 2px 12px #192e5026; }
[data-brand="custom"] .side-nav:disabled { opacity: 0; }
[data-brand="custom"] .side-nav .icon { width: 22px; height: 22px; }
[data-brand="custom"] .reader-slider input { appearance: none; -webkit-appearance: none; background: transparent; }
[data-brand="custom"] .reader-slider input::-webkit-slider-runnable-track { height: 4px; background: linear-gradient(to right, var(--accent) 0%, var(--accent) var(--reader-progress, 0%), #dce4f1 var(--reader-progress, 0%), #dce4f1 100%); border-radius: 3px; }
[data-brand="custom"] .reader-slider input::-moz-range-track { height: 4px; background: #dce4f1; border-radius: 3px; }
[data-brand="custom"] .reader-slider input::-moz-range-progress { height: 4px; background: var(--accent); }
[data-brand="custom"] .reader-slider input::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 13px; height: 13px; margin-top: -4.5px; border: 2px solid var(--accent); border-radius: 50%; background: var(--college-yellow); }
[data-brand="custom"] .reader-slider input::-moz-range-thumb { width: 10px; height: 10px; border: 2px solid var(--accent); border-radius: 50%; background: var(--college-yellow); }
[data-brand="custom"] #navRight { background: var(--accent); color: #fff; border-color: var(--accent); }
[data-brand="custom"] #navRight:hover:not(:disabled) { background: var(--accent-strong); }
[data-brand="custom"] .toast { background: #192e50; }
[data-brand="custom"] .help-list dt { color: var(--accent); }
[data-brand="custom"] .reader-dialog .dialog-close:hover:not(:disabled),
[data-brand="custom"] .text-reader-head .btn:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent); }
[data-brand="custom"] .status-icon { color: var(--accent); }
[data-brand="custom"] .spinner,
[data-brand="custom"] .page-spinner { border-color: #0045be22; border-top-color: var(--accent); }
[data-brand="custom"] .reader-options .btn { background-color: transparent; }
[data-brand="custom"] select { background-color: #fff; }

@media (min-width: 720px) and (max-width: 959px) {
  [data-brand="custom"] .university-brand { width: 108px; }
}
@media (max-width: 719px) {
  [data-brand="custom"] .topbar { padding-inline: 8px; }
  [data-brand="custom"] .university-brand { width: 108px; }
  [data-brand="custom"] .book-title { font-size: 14px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  [data-brand="custom"] .topbar { padding-block: 4px; }
  [data-brand="custom"] .university-brand { width: 95px; height: 38px; }
}

:root[data-brand="custom"] {
  --accent: var(--brand-ink);
  --accent-strong: var(--brand-ink);
  --accent-soft: var(--brand-tint);
  --focus: var(--brand-ink);
  --college-yellow: var(--brand-accent);
}
[data-brand="custom"] .university-brand { color: var(--ink); }
[data-brand="custom"] .brand-name-fallback {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 700;
}
[data-brand="custom"] #panelToggle,
[data-brand="custom"] #navRight,
[data-brand="custom"] .btn.accent,
[data-brand="custom"] .btn[aria-pressed="true"] {
  background: var(--brand-primary);
  border-color: var(--brand-ink);
  color: var(--brand-foreground);
}
[data-brand="custom"] #panelToggle:hover:not(:disabled),
[data-brand="custom"] #navRight:hover:not(:disabled),
[data-brand="custom"] .btn.accent:hover:not(:disabled) {
  background: var(--brand-hover);
  color: var(--brand-foreground);
}
[data-brand="custom"] .result-snippet mark { background: var(--brand-tint); }
[data-brand="custom"] .spinner,
[data-brand="custom"] .page-spinner { border-color: var(--line); border-top-color: var(--brand-ink); }
