@layer reset, base, layout, components, reader, utilities, responsive, print;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { min-width: 320px; scrollbar-gutter: stable; }
  body, h1, h2, h3, p, figure, blockquote, dl, dd { margin: 0; }
  button, input, select, textarea { font: inherit; }
  button, a { -webkit-tap-highlight-color: transparent; }
  button { border: 0; }
  img, svg { display: block; max-width: 100%; }
  [hidden] { display: none !important; }
}

@layer base {
  :root {
    color-scheme: light;
    --ink: #172321;
    --ink-soft: #52605c;
    --muted: #71807b;
    --canvas: #e8e1d4;
    --canvas-deep: #c8bba6;
    --surface: #fffdf8;
    --surface-2: #f5f0e7;
    --surface-3: #e9e1d3;
    --line: #d3c8b6;
    --line-strong: #a99b85;
    --accent: #0d665f;
    --accent-deep: #0b4743;
    --accent-soft: #d8ece7;
    --gold: #c49745;
    --gold-soft: #ead9b7;
    --danger: #a43b32;
    --focus: #0b77d5;
    --page: #fffef9;
    --page-ink: #1d2422;
    --page-muted: #6d736f;
    --page-rule: #ddd4c5;
    --page-accent: #0a5c56;
    --shadow: 0 18px 60px rgb(48 38 22 / 20%);
    --font-ui: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-book: Charter, "Bitstream Charter", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
    --reader-font: var(--font-book);
    --reader-size: 1;
    --reader-leading: 1.65;
    --topbar-height: 64px;
    --page-height: clamp(520px, calc(100svh - 252px), 830px);
    --page-pad-x: clamp(30px, 4.2vw, 64px);
    --page-pad-y: clamp(28px, 4vh, 52px);
    font-family: var(--font-ui);
    font-size: 16px;
    text-rendering: optimizeLegibility;
    font-synthesis: none;
  }

  :root[data-theme="dark"] {
    color-scheme: dark;
    --ink: #ecf3f0;
    --ink-soft: #bbc9c4;
    --muted: #93a49e;
    --canvas: #101a19;
    --canvas-deep: #091211;
    --surface: #172321;
    --surface-2: #1d2c29;
    --surface-3: #283936;
    --line: #354944;
    --line-strong: #526b64;
    --accent: #72cfc2;
    --accent-deep: #9ae4da;
    --accent-soft: #233f3b;
    --gold: #d5ae65;
    --gold-soft: #44391f;
    --danger: #ff968b;
    --page: #17201f;
    --page-ink: #e7eeeb;
    --page-muted: #a7b2ae;
    --page-rule: #3b4946;
    --page-accent: #79d0c5;
    --shadow: 0 20px 70px rgb(0 0 0 / 48%);
  }

  :root[data-theme="sepia"] {
    --ink: #2c2419;
    --ink-soft: #625543;
    --muted: #7d6f5a;
    --canvas: #d4c4a8;
    --canvas-deep: #b29b78;
    --surface: #f4ead6;
    --surface-2: #eadcc3;
    --surface-3: #dac7a4;
    --line: #c8b38e;
    --line-strong: #a08861;
    --accent: #5c5840;
    --accent-deep: #3e3a28;
    --accent-soft: #ded9bd;
    --gold: #a16e2f;
    --gold-soft: #dfc594;
    --page: #f6ecd7;
    --page-ink: #2d271e;
    --page-muted: #716550;
    --page-rule: #d2c19f;
    --page-accent: #655b3e;
  }

  :root[data-font="sans"] { --reader-font: var(--font-ui); }
  :root[data-font="accessible"] {
    --reader-font: Verdana, Tahoma, Arial, sans-serif;
    font-kerning: none;
  }

  @media (prefers-color-scheme: dark) {
    :root[data-theme="system"] {
      color-scheme: dark;
      --ink: #ecf3f0;
      --ink-soft: #bbc9c4;
      --muted: #93a49e;
      --canvas: #101a19;
      --canvas-deep: #091211;
      --surface: #172321;
      --surface-2: #1d2c29;
      --surface-3: #283936;
      --line: #354944;
      --line-strong: #526b64;
      --accent: #72cfc2;
      --accent-deep: #9ae4da;
      --accent-soft: #233f3b;
      --gold: #d5ae65;
      --gold-soft: #44391f;
      --danger: #ff968b;
      --page: #17201f;
      --page-ink: #e7eeeb;
      --page-muted: #a7b2ae;
      --page-rule: #3b4946;
      --page-accent: #79d0c5;
      --shadow: 0 20px 70px rgb(0 0 0 / 48%);
    }
  }

  html, body { min-height: 100%; }
  body {
    background:
      radial-gradient(circle at 18% -10%, color-mix(in srgb, var(--gold) 16%, transparent), transparent 36%),
      linear-gradient(145deg, var(--canvas), var(--canvas-deep));
    color: var(--ink);
    overflow-x: hidden;
  }

  body.drawer-open, body.modal-open { overflow: hidden; }
  a { color: var(--accent); text-underline-offset: .18em; }
  a:hover { color: var(--accent-deep); }
  button, select, input, textarea { color: inherit; }
  button { cursor: pointer; }
  button:disabled { cursor: not-allowed; opacity: .42; }
  :focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
  ::selection { background: color-mix(in srgb, var(--gold) 42%, transparent); color: inherit; }
  kbd {
    display: inline-grid;
    min-width: 1.6em;
    min-height: 1.6em;
    place-items: center;
    padding: 0 .35em;
    border: 1px solid var(--line-strong);
    border-bottom-width: 2px;
    border-radius: 5px;
    background: var(--surface-2);
    color: var(--ink-soft);
    font: 600 .7rem/1 var(--font-ui);
  }
}

@layer layout {
  .app { min-height: 100svh; display: grid; grid-template-rows: auto 1fr auto; }
  .topbar {
    position: sticky;
    z-index: 30;
    top: 0;
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    align-items: center;
    min-height: var(--topbar-height);
    padding: max(8px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 8px max(14px, env(safe-area-inset-left));
    border-bottom: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    box-shadow: 0 4px 22px rgb(0 0 0 / 6%);
    backdrop-filter: blur(18px) saturate(130%);
  }
  .top-progress { position: absolute; inset: auto 0 -1px; height: 3px; background: transparent; }
  .top-progress span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold)); transition: width .25s ease; }
  .reader { min-width: 0; padding: 18px clamp(12px, 2.8vw, 46px) 12px; }
  .reader-status, .reader-controls, .app-footer {
    width: min(100%, 1440px);
    margin-inline: auto;
  }
  .reader-status { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 46px; margin-bottom: 12px; }
  .book-workspace { display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; align-items: center; gap: clamp(6px, 1vw, 16px); width: min(100%, 1540px); margin-inline: auto; }
  .book-frame { position: relative; width: 100%; min-width: 0; max-width: 1380px; margin-inline: auto; perspective: 2400px; }
  .flip-stage {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    width: 100%;
    height: var(--page-height);
    max-height: 900px;
    transform-style: preserve-3d;
    isolation: isolate;
  }
  .reader-controls { display: grid; grid-template-columns: auto minmax(120px, 1fr) auto auto; align-items: center; gap: 10px; max-width: 920px; margin-top: 14px; }
  .app-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 10px clamp(16px, 3vw, 38px) max(12px, env(safe-area-inset-bottom)); color: var(--ink-soft); font-size: .76rem; }
  .app-footer nav { display: flex; flex-wrap: wrap; justify-content: end; gap: 12px; }
  .app-footer button, .app-footer a { border: 0; background: none; color: inherit; text-decoration: underline; text-underline-offset: .2em; }
}

@layer components {
  .skip-link { position: fixed; z-index: 200; top: 8px; left: 8px; transform: translateY(-160%); padding: 12px 16px; border-radius: 8px; background: var(--ink); color: var(--surface); }
  .skip-link:focus { transform: none; }
  .icon-button, .tool-button, .compact-button, .quiet-button, .primary-button, .text-button {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 10px;
    transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
  }
  .icon-button { min-width: 40px; padding: 0 10px; border: 1px solid transparent; background: transparent; font-weight: 700; }
  .icon-button:hover, .compact-button:hover, .tool-button:hover { background: var(--surface-2); border-color: var(--line); }
  .tool-button { padding: 0 12px; border: 1px solid var(--line); background: var(--surface); }
  .compact-button { min-height: 36px; padding: 0 11px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 70%, transparent); color: var(--ink-soft); font-size: .78rem; font-weight: 700; }
  .compact-button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-deep); }
  .quiet-button { min-height: 36px; padding: 0 13px; border: 1px solid var(--line); background: var(--surface-2); font-size: .8rem; font-weight: 700; }
  .primary-button { min-height: 42px; padding: 0 18px; background: var(--accent); color: #fff; font-weight: 800; text-decoration: none; }
  .primary-button:hover { background: var(--accent-deep); color: #fff; transform: translateY(-1px); }
  .text-button { min-height: 32px; padding: 0 5px; background: transparent; color: var(--accent); font-weight: 800; text-decoration: none; }
  .danger-text-button { padding: 10px 0; background: transparent; color: var(--danger); text-decoration: underline; text-underline-offset: .2em; }
  .brand { display: flex; align-items: center; gap: 9px; margin-right: 20px; color: var(--ink); text-decoration: none; }
  .brand:hover { color: var(--ink); }
  .brand-mark { display: grid; width: 39px; aspect-ratio: 1; place-items: center; border: 1px solid var(--gold); border-radius: 7px 13px 7px 7px; background: linear-gradient(145deg, var(--accent), var(--accent-deep)); box-shadow: inset -5px 0 0 rgb(255 255 255 / 9%); color: #fff; font: 700 1.35rem/1 Georgia, serif; }
  .brand-copy { display: grid; line-height: 1; }
  .brand-copy strong { font-size: .88rem; letter-spacing: .03em; }
  .brand-copy small { margin-top: 4px; color: var(--muted); font-size: .69rem; letter-spacing: .12em; text-transform: uppercase; }
  .topbar-context { min-width: 0; padding-left: 18px; border-left: 1px solid var(--line); line-height: 1.2; }
  .topbar-context span, .topbar-context strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-context span { color: var(--muted); font-size: .66rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
  .topbar-context strong { margin-top: 3px; font-size: .82rem; }
  .topbar-actions, .study-actions { display: flex; align-items: center; gap: 6px; }
  .notification-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
  .eyebrow { color: var(--accent); font-size: .67rem; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
  .reader-status-copy { min-width: 0; display: grid; gap: 2px; }
  .reader-status-copy strong { overflow: hidden; color: var(--ink-soft); font-size: .83rem; text-overflow: ellipsis; white-space: nowrap; }
  .page-nav { display: grid; width: 46px; aspect-ratio: 1; place-items: center; border: 1px solid color-mix(in srgb, var(--line) 80%, transparent); border-radius: 50%; background: color-mix(in srgb, var(--surface) 78%, transparent); box-shadow: 0 8px 26px rgb(0 0 0 / 10%); color: var(--accent-deep); font: 300 2rem/1 Georgia, serif; backdrop-filter: blur(12px); }
  .page-nav:hover:not(:disabled) { transform: scale(1.05); background: var(--surface); }
  .page-scrubber { min-width: 0; }
  .page-scrubber input { width: 100%; accent-color: var(--accent); }
  .page-number-field { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: .78rem; }
  .page-number-field input { width: 56px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); text-align: center; }
  .page-number-field input::-webkit-inner-spin-button { display: none; }
  .pagination-status { position: absolute; z-index: 10; inset: 50% auto auto 50%; transform: translate(-50%, -50%); padding: 10px 14px; border-radius: 8px; background: color-mix(in srgb, var(--surface) 88%, transparent); box-shadow: var(--shadow); color: var(--ink-soft); font-size: .8rem; backdrop-filter: blur(10px); }
  .book-shadow { position: absolute; inset: 3% 2% -2%; border-radius: 10%; background: rgb(54 39 22 / 34%); filter: blur(30px); transform: translateY(18px); }
  .ad-shell { width: min(100%, 980px); min-height: 100px; margin: 20px auto 8px; border: 1px dashed var(--line-strong); border-radius: 12px; background: color-mix(in srgb, var(--surface) 50%, transparent); text-align: center; }
  .ad-shell > span { display: block; padding: 5px; color: var(--muted); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; }

  .drawer { position: fixed; z-index: 80; top: 0; bottom: 0; display: flex; width: min(440px, calc(100vw - 32px)); flex-direction: column; border-right: 1px solid var(--line); background: var(--surface); box-shadow: 16px 0 70px rgb(0 0 0 / 24%); transform: translateX(-105%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); }
  .drawer[inert] { pointer-events: none; }
  .drawer[aria-hidden="false"] { transform: translateX(0); }
  .tools-drawer { right: 0; left: auto; border-right: 0; border-left: 1px solid var(--line); transform: translateX(105%); }
  .tools-drawer[aria-hidden="false"] { transform: translateX(0); }
  .drawer-scrim { position: fixed; z-index: 70; inset: 0; visibility: hidden; background: rgb(3 15 14 / 48%); opacity: 0; transition: opacity .22s, visibility .22s; backdrop-filter: blur(2px); }
  body.drawer-open .drawer-scrim { visibility: visible; opacity: 1; }
  .drawer-head, .modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
  .drawer-head { padding: max(22px, env(safe-area-inset-top)) 22px 16px; border-bottom: 1px solid var(--line); }
  .drawer-head h2, .modal-head h2 { margin-top: 4px; font: 650 1.55rem/1.15 var(--font-book); }
  .tabs { display: grid; grid-template-columns: repeat(3, 1fr); padding: 10px 16px 0; border-bottom: 1px solid var(--line); }
  .tabs button { position: relative; min-height: 42px; background: transparent; color: var(--muted); font-size: .78rem; font-weight: 800; }
  .tabs button::after { position: absolute; right: 12px; bottom: -1px; left: 12px; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); content: ""; opacity: 0; }
  .tabs button[aria-selected="true"] { color: var(--accent); }
  .tabs button[aria-selected="true"]::after { opacity: 1; }
  .tab-panel { min-height: 0; flex: 1; overflow: auto; padding: 16px; }
  .library-summary { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; margin-bottom: 18px; color: var(--muted); font-size: .74rem; font-weight: 800; }
  .progress-track { height: 5px; grid-column: 1 / -1; overflow: hidden; border-radius: 5px; background: var(--surface-3); }
  .progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--gold)); }
  .library-summary .text-button { grid-column: 2; grid-row: 1; }
  .contents-list { display: grid; gap: 5px; }
  .toc-group-label { margin: 16px 8px 6px; color: var(--muted); font-size: .64rem; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
  .toc-item { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; padding: 10px; border-radius: 10px; background: transparent; text-align: left; }
  .toc-item:hover, .toc-item.active { background: var(--surface-2); }
  .toc-item.active { box-shadow: inset 3px 0 0 var(--accent); }
  .toc-number { display: grid; width: 30px; aspect-ratio: 1; place-items: center; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); font-size: .68rem; font-weight: 900; }
  .toc-copy { min-width: 0; }
  .toc-copy strong, .toc-copy small { display: block; overflow: hidden; text-overflow: ellipsis; }
  .toc-copy strong { font: 650 .9rem/1.25 var(--font-book); }
  .toc-copy small { margin-top: 3px; color: var(--muted); font-size: .68rem; white-space: nowrap; }
  .toc-progress { font-size: .68rem; color: var(--muted); }
  .toc-sections { margin: 2px 0 10px 42px; border-left: 1px solid var(--line); }
  .toc-sections button { display: block; width: 100%; padding: 6px 12px; background: transparent; color: var(--ink-soft); font-size: .72rem; text-align: left; }
  .toc-sections button:hover { color: var(--accent); }
  .search-field { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface-2); }
  .search-field input { min-width: 0; height: 46px; border: 0; outline: 0; background: transparent; }
  .search-options { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 2px; color: var(--muted); font-size: .68rem; }
  .search-options label { display: flex; align-items: center; gap: 5px; }
  .search-results { display: grid; gap: 8px; }
  .search-result { width: 100%; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); text-align: left; }
  .search-result:hover { border-color: var(--accent); background: var(--accent-soft); }
  .search-result strong { display: block; font: 650 .87rem var(--font-book); }
  .search-result p { display: -webkit-box; margin-top: 6px; overflow: hidden; color: var(--ink-soft); font-size: .72rem; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
  mark { border-radius: 3px; background: var(--gold-soft); color: inherit; }
  .saved-actions { display: flex; gap: 8px; margin-bottom: 18px; }
  .saved-section + .saved-section { margin-top: 22px; }
  .saved-section h3 { margin-bottom: 9px; color: var(--muted); font-size: .67rem; letter-spacing: .1em; text-transform: uppercase; }
  .saved-card { display: grid; grid-template-columns: 1fr auto; gap: 5px 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
  .saved-card button { background: transparent; color: var(--danger); }
  .saved-card .saved-go { grid-column: 1; color: var(--ink); text-align: left; }
  .saved-card small, .empty-state { color: var(--muted); font-size: .69rem; }
  .saved-card p { grid-column: 1 / -1; color: var(--ink-soft); font-size: .74rem; line-height: 1.45; }
  .tools-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 20px; }
  .tools-grid button { display: grid; min-height: 128px; align-content: center; justify-items: start; gap: 5px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); text-align: left; }
  .tools-grid button:hover, .tools-grid button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
  .tools-grid button > span { color: var(--accent); font-size: 1.3rem; }
  .tools-grid button strong { font-size: .82rem; }
  .tools-grid button small { color: var(--muted); font-size: .67rem; line-height: 1.4; }
  .shortcut-card { margin: 0 20px 20px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; }
  .shortcut-card h3 { margin-bottom: 12px; font: 650 1rem var(--font-book); }
  .shortcut-card dl { display: grid; gap: 8px; }
  .shortcut-card dl div { display: grid; grid-template-columns: 88px 1fr; align-items: center; color: var(--ink-soft); font-size: .72rem; }
  .tools-drawer > .danger-text-button { margin: auto 20px max(20px, env(safe-area-inset-bottom)); text-align: left; }

  .modal { width: min(94vw, 650px); max-height: min(90svh, 820px); padding: 0; overflow: visible; border: 1px solid var(--line); border-radius: 18px; background: transparent; box-shadow: 0 30px 100px rgb(0 0 0 / 38%); color: var(--ink); }
  .modal::backdrop { background: rgb(3 15 14 / 62%); backdrop-filter: blur(5px); }
  .modal-card { max-height: min(90svh, 820px); overflow: auto; border-radius: inherit; background: var(--surface); }
  .modal-head { position: sticky; z-index: 1; top: 0; padding: 22px 24px 16px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px); }
  .notes-modal label, .notes-modal textarea { display: block; width: calc(100% - 48px); margin-inline: 24px; }
  .notes-modal label { margin-top: 20px; margin-bottom: 7px; font-size: .75rem; font-weight: 800; }
  textarea { resize: vertical; padding: 13px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface-2); line-height: 1.5; }
  .modal-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px 22px; color: var(--muted); font-size: .7rem; }
  .wide-modal { width: min(94vw, 790px); }
  .settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 24px; padding: 22px 24px 8px; }
  .settings-grid fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
  .settings-grid legend { display: flex; width: 100%; justify-content: space-between; margin-bottom: 8px; color: var(--ink-soft); font-size: .72rem; font-weight: 800; }
  .settings-grid output { color: var(--muted); font-weight: 600; }
  .settings-grid input[type="range"] { width: 100%; accent-color: var(--accent); }
  .settings-span { grid-column: 1 / -1; }
  .segmented { display: flex; width: 100%; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
  .segmented button { min-height: 38px; flex: 1; padding: 0 8px; border-right: 1px solid var(--line); background: transparent; color: var(--muted); font-size: .7rem; font-weight: 800; }
  .segmented button:last-child { border-right: 0; }
  .segmented button.active { background: var(--accent); color: #fff; }
  .voice-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
  .voice-row select { min-width: 0; height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
  .voice-row label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .7rem; }
  .settings-note { margin: 18px 24px 0; padding: 12px; border-radius: 9px; background: var(--accent-soft); color: var(--ink-soft); font-size: .7rem; line-height: 1.5; }
  .reading-modal { width: min(94vw, 760px); }
  .information-content { padding: 22px 24px 4px; color: var(--ink-soft); font: 1rem/1.7 var(--font-book); }
  .information-content h3 { margin: 1.4em 0 .45em; color: var(--ink); font-size: 1.25rem; }
  .information-content p + p, .information-content ul + p, .information-content p + ul { margin-top: 1em; }
  .information-content ul { padding-left: 1.2em; }
  .information-content .notice-box { margin: 1em 0; padding: 14px; border-left: 4px solid var(--gold); background: var(--surface-2); }

  .reading-ruler { position: fixed; z-index: 45; right: 0; left: 0; top: 48%; display: none; height: 38px; border-top: 2px solid color-mix(in srgb, var(--gold) 72%, transparent); border-bottom: 2px solid color-mix(in srgb, var(--gold) 72%, transparent); background: color-mix(in srgb, var(--gold-soft) 26%, transparent); box-shadow: 0 -100vh 0 100vh rgb(0 0 0 / 8%); pointer-events: none; }
  body.ruler-on .reading-ruler { display: block; }
  .timer-chip { position: fixed; z-index: 50; right: 18px; bottom: max(18px, env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 8px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 100px; background: var(--surface); box-shadow: var(--shadow); font-size: .72rem; }
  .timer-chip button { padding: 4px 7px; border-radius: 20px; background: var(--surface-2); }
  .toast { position: fixed; z-index: 150; bottom: max(20px, env(safe-area-inset-bottom)); left: 50%; max-width: min(90vw, 520px); transform: translate(-50%, 22px); padding: 10px 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--ink); box-shadow: var(--shadow); color: var(--surface); font-size: .75rem; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
  .toast.show { transform: translate(-50%, 0); opacity: 1; }
  .loading-screen { position: fixed; z-index: 120; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; background: var(--canvas); transition: opacity .35s, visibility .35s; }
  .loading-screen.done { visibility: hidden; opacity: 0; }
  .loading-screen > span { color: var(--ink-soft); font-size: .77rem; }
  .loading-book { position: relative; width: 78px; height: 50px; margin-bottom: 12px; perspective: 400px; }
  .loading-book span { position: absolute; inset: 0 50% 0 0; border: 2px solid var(--accent); border-radius: 5px 0 0 5px; background: var(--surface); transform-origin: right; }
  .loading-book span:nth-child(2) { animation: loading-page 1.1s infinite ease-in-out; }
  .loading-book span:nth-child(3) { animation: loading-page 1.1s .35s infinite ease-in-out; }
  .loading-track { width: min(260px, 60vw); height: 4px; margin-top: 6px; overflow: hidden; border-radius: 4px; background: var(--surface-3); }
  .loading-track span { display: block; width: 4%; height: 100%; background: var(--accent); transition: width .2s; }
  @keyframes loading-page { 0%, 25% { transform: rotateY(0); } 75%, 100% { transform: rotateY(180deg); } }
  .noscript { position: fixed; z-index: 300; inset: 0; display: grid; place-items: center; padding: 30px; background: var(--surface); color: var(--ink); text-align: center; }
}

@layer reader {
  .page-slot { position: relative; min-width: 0; height: 100%; overflow: hidden; background: var(--page); color: var(--page-ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--page-rule) 86%, transparent); }
  .page-slot-left { border-radius: 12px 2px 2px 12px; box-shadow: inset -16px 0 25px -24px rgb(0 0 0 / 52%), inset 0 0 0 1px color-mix(in srgb, var(--page-rule) 86%, transparent); }
  .page-slot-right { border-radius: 2px 12px 12px 2px; box-shadow: inset 16px 0 25px -24px rgb(0 0 0 / 52%), inset 0 0 0 1px color-mix(in srgb, var(--page-rule) 86%, transparent); }
  .page-slot:empty::before { position: absolute; inset: 0; background: linear-gradient(110deg, var(--page), color-mix(in srgb, var(--page) 92%, var(--canvas-deep))); content: ""; opacity: .65; }
  .book-gutter { position: absolute; z-index: 5; inset: 0 auto 0 50%; width: 18px; transform: translateX(-50%); background: linear-gradient(90deg, transparent, rgb(0 0 0 / 13%), rgb(255 255 255 / 8%), rgb(0 0 0 / 10%), transparent); pointer-events: none; }
  .book-page { position: relative; display: grid; height: 100%; grid-template-rows: auto minmax(0, 1fr) auto; background:
      radial-gradient(circle at 16% 8%, rgb(255 255 255 / 28%), transparent 36%),
      repeating-linear-gradient(0deg, transparent 0 5px, rgb(80 60 30 / 1.2%) 6px),
      var(--page); color: var(--page-ink); }
  .page-head, .page-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-inline: var(--page-pad-x); color: var(--page-muted); font: 700 .58rem/1.2 var(--font-ui); letter-spacing: .1em; text-transform: uppercase; }
  .page-head { min-height: 35px; padding-top: 10px; border-bottom: 1px solid var(--page-rule); }
  .page-foot { min-height: 32px; border-top: 1px solid var(--page-rule); }
  .page-folio { color: var(--page-accent); }
  .page-body { min-height: 0; overflow: hidden; padding: var(--page-pad-y) var(--page-pad-x); font: calc(1rem * var(--reader-size))/var(--reader-leading) var(--reader-font); letter-spacing: .005em; }
  :root[data-font="accessible"] .page-body { letter-spacing: .025em; word-spacing: .06em; }
  .page-body > :first-child { margin-top: 0 !important; }
  .content-p { margin-top: .9em; orphans: 3; widows: 3; }
  .content-p.continuation { text-indent: 1.2em; }
  .content-h1 { margin: .35em 0 .72em; color: var(--page-accent); font: 720 1.62em/1.15 var(--font-book); letter-spacing: -.018em; }
  .content-h1::after { display: block; width: 48px; height: 3px; margin-top: .42em; background: var(--gold); content: ""; }
  .content-h2 { margin: 1.15em 0 .5em; color: var(--page-ink); font: 720 1.18em/1.25 var(--font-book); }
  .content-table-wrap { margin: .55em 0; overflow: hidden; border: 1px solid var(--page-rule); border-radius: 7px; }
  .content-table { width: 100%; border-collapse: collapse; font: .78em/1.38 var(--font-ui); }
  .content-table th, .content-table td { padding: .62em .72em; border-right: 1px solid var(--page-rule); border-bottom: 1px solid var(--page-rule); vertical-align: top; text-align: left; }
  .content-table th:last-child, .content-table td:last-child { border-right: 0; }
  .content-table tr:last-child td { border-bottom: 0; }
  .content-table thead th { background: color-mix(in srgb, var(--page-accent) 12%, var(--page)); color: var(--page-accent); font-weight: 800; }
  .content-table p + p { margin-top: .45em; }
  .chapter-opener .page-head, .chapter-opener .page-foot, .cover-page .page-head, .cover-page .page-foot, .front-page .page-head { border-color: transparent; }
  .chapter-opener .page-body { display: flex; flex-direction: column; justify-content: center; }
  .opener-number { color: var(--gold); font: 850 .72rem/1 var(--font-ui); letter-spacing: .2em; text-transform: uppercase; }
  .chapter-opener h1 { max-width: 12ch; margin-top: .35em; color: var(--page-ink); font: 720 clamp(2rem, 4.3vw, 3.35rem)/.98 var(--font-book); letter-spacing: -.045em; }
  .chapter-opener .opener-rule { width: 80px; height: 5px; margin: 1.4em 0; background: linear-gradient(90deg, var(--gold), var(--page-accent)); }
  .chapter-opener .opener-deck { max-width: 44ch; color: var(--page-muted); font: 1.02em/1.5 var(--font-book); }
  .chapter-opener .opener-meta { display: flex; gap: 18px; margin-top: 2.2em; color: var(--page-muted); font: 700 .64rem/1.4 var(--font-ui); letter-spacing: .08em; text-transform: uppercase; }
  .cover-page { background:
      linear-gradient(120deg, rgb(255 255 255 / 6%), transparent 35%),
      repeating-linear-gradient(120deg, transparent 0 9px, rgb(255 255 255 / 1.7%) 10px),
      #0c4945; color: #f8f3e8; }
  .cover-page::before { position: absolute; inset: 18px; border: 1px solid rgb(218 178 95 / 55%); border-radius: 3px 14px 3px 3px; content: ""; pointer-events: none; }
  .cover-page .page-body { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(55px, 8vh, 90px) clamp(40px, 6vw, 76px); }
  .cover-kicker { color: #e0bd75; font: 800 .65rem/1.4 var(--font-ui); letter-spacing: .19em; text-transform: uppercase; }
  .cover-title { max-width: 8ch; margin-top: .32em; font: 680 clamp(3.1rem, 8vw, 6.3rem)/.82 var(--font-book); letter-spacing: -.065em; }
  .cover-title span { display: block; color: #e7bd67; font-style: italic; font-weight: 500; }
  .cover-subtitle { max-width: 31ch; margin-top: 1.6em; color: #dce9e5; font: 1rem/1.5 var(--font-book); }
  .cover-emblem { position: absolute; right: clamp(35px, 7vw, 90px); bottom: clamp(70px, 12vh, 130px); width: clamp(90px, 16vw, 180px); aspect-ratio: 1; border: 1px solid rgb(225 189 115 / 45%); border-radius: 50%; opacity: .8; }
  .cover-emblem::before, .cover-emblem::after { position: absolute; inset: 50% 16%; height: 1px; background: #e0bd75; content: ""; }
  .cover-emblem::after { inset: 16% 50%; width: 1px; height: auto; }
  .cover-meta { position: relative; z-index: 1; display: grid; gap: 4px; padding-top: 26px; border-top: 1px solid rgb(255 255 255 / 25%); color: #d7e3df; font: 700 .65rem/1.35 var(--font-ui); letter-spacing: .07em; text-transform: uppercase; }
  .cover-page .page-head, .cover-page .page-foot { visibility: hidden; }
  .front-page .page-body { padding-top: calc(var(--page-pad-y) * 1.15); }
  .front-page h1 { color: var(--page-ink); font: 700 2.1em/1.05 var(--font-book); }
  .front-page .front-kicker { margin-bottom: .7em; color: var(--gold); font: 850 .66rem/1 var(--font-ui); letter-spacing: .15em; text-transform: uppercase; }
  .front-page h2 { margin: 1.35em 0 .4em; color: var(--page-accent); font: 700 1.15em var(--font-book); }
  .front-page p, .front-page li { color: var(--page-ink); font-size: .88em; line-height: 1.52; }
  .front-page p + p { margin-top: .8em; }
  .front-page ul { margin: .7em 0 0; padding-left: 1.2em; }
  .contents-page .page-body { padding-top: calc(var(--page-pad-y) * .75); }
  .contents-page h1 { margin-bottom: .7em; font: 700 2em var(--font-book); }
  .mini-toc { display: grid; gap: .42em; }
  .mini-toc button { display: grid; grid-template-columns: 2em minmax(0, 1fr) auto; gap: .7em; align-items: baseline; width: 100%; padding: .38em 0; border-bottom: 1px dotted var(--page-rule); background: transparent; color: var(--page-ink); text-align: left; }
  .mini-toc button span:first-child { color: var(--gold); font: 800 .7em var(--font-ui); }
  .mini-toc button strong { font: 650 .9em/1.25 var(--font-book); }
  .mini-toc button small { color: var(--page-muted); font: .58em var(--font-ui); }
  .back-cover { background: #0a3b38; color: #edf4f1; }
  .back-cover .page-body { display: flex; flex-direction: column; justify-content: space-between; padding: clamp(55px, 8vh, 90px) clamp(40px, 6vw, 76px); }
  .back-cover blockquote { font: 500 clamp(1.45rem, 3vw, 2.35rem)/1.2 var(--font-book); }
  .back-cover blockquote::before { display: block; margin-bottom: .45em; color: var(--gold); font-size: 2em; content: "“"; }
  .back-cover p { color: #bed0cb; line-height: 1.55; }
  .back-cover .publisher-lockup { padding-top: 20px; border-top: 1px solid rgb(255 255 255 / 22%); font: 800 .65rem/1.5 var(--font-ui); letter-spacing: .1em; text-transform: uppercase; }

  .turning-sheet { position: absolute; z-index: 20; top: 0; bottom: 0; left: 50%; display: none; width: 50%; transform: rotateY(0); transform-origin: left center; transform-style: preserve-3d; pointer-events: none; }
  .turning-sheet.active { display: block; }
  .sheet-face { position: absolute; inset: 0; overflow: hidden; background: var(--page); backface-visibility: hidden; }
  .sheet-front { border-radius: 2px 12px 12px 2px; box-shadow: inset 14px 0 22px -22px rgb(0 0 0 / 65%), 10px 6px 22px rgb(0 0 0 / 18%); }
  .sheet-back { border-radius: 12px 2px 2px 12px; box-shadow: inset -14px 0 22px -22px rgb(0 0 0 / 65%), -10px 6px 22px rgb(0 0 0 / 18%); transform: rotateY(180deg); }
  .turning-sheet::after { position: absolute; inset: 0; background: linear-gradient(90deg, rgb(0 0 0 / 27%), transparent 30%, rgb(255 255 255 / 12%) 72%, rgb(0 0 0 / 18%)); content: ""; opacity: 0; backface-visibility: visible; pointer-events: none; }
  .turning-sheet.flip-next { animation: flip-next .68s cubic-bezier(.22, .73, .18, 1) forwards; }
  .turning-sheet.flip-next::after { animation: curl-shadow .68s ease-in-out; }
  .turning-sheet.flip-prev { left: 0; transform: rotateY(-180deg); transform-origin: right center; animation: flip-prev .68s cubic-bezier(.22, .73, .18, 1) forwards; }
  .turning-sheet.flip-prev::after { animation: curl-shadow .68s ease-in-out; }
  @keyframes flip-next { 0% { transform: rotateY(0) skewY(0); } 48% { transform: rotateY(-88deg) skewY(-.6deg); } 100% { transform: rotateY(-180deg) skewY(0); } }
  @keyframes flip-prev { 0% { transform: rotateY(-180deg) skewY(0); } 52% { transform: rotateY(-88deg) skewY(.6deg); } 100% { transform: rotateY(0) skewY(0); } }
  @keyframes curl-shadow { 0%, 100% { opacity: .08; } 48% { opacity: .9; } }
  .curl-corner { position: absolute; z-index: 12; bottom: 0; width: 70px; height: 70px; background: transparent; }
  .curl-corner::before { position: absolute; right: 0; bottom: 0; width: 0; height: 0; border-style: solid; content: ""; filter: drop-shadow(-4px -4px 8px rgb(0 0 0 / 12%)); opacity: .55; transition: border-width .2s; }
  .curl-right { right: 0; }
  .curl-right::before { border-width: 0 0 35px 35px; border-color: transparent transparent color-mix(in srgb, var(--page-rule) 68%, transparent) transparent; }
  .curl-left { left: 0; }
  .curl-left::before { right: auto; left: 0; border-width: 35px 0 0 35px; border-color: transparent transparent transparent color-mix(in srgb, var(--page-rule) 68%, transparent); }
  .curl-corner:hover::before { border-width: 0 0 56px 56px; }
  .curl-left:hover::before { border-width: 56px 0 0 56px; }
  .recall-mode .page-body .content-p:not(.revealed), .recall-mode .page-body td:not(.revealed) { border-radius: 3px; background: var(--page-rule); color: transparent; text-shadow: 0 0 9px color-mix(in srgb, var(--page-ink) 55%, transparent); cursor: pointer; user-select: none; }
  .tts-active { border-radius: 4px; background: color-mix(in srgb, var(--gold-soft) 55%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold-soft) 55%, transparent); }
  .search-hit { border-radius: 3px; background: var(--gold-soft); }
  .measure-root { position: fixed; z-index: -100; top: -20000px; left: -20000px; visibility: hidden; pointer-events: none; }
  .measure-root .book-page { width: var(--measure-width, 640px); height: var(--page-height); }
  .print-root { display: none; }

  body[data-effective-view="one"] .flip-stage { grid-template-columns: 1fr; max-width: 760px; margin-inline: auto; }
  body[data-effective-view="one"] .page-slot-left, body[data-effective-view="one"] .book-gutter { display: none; }
  body[data-effective-view="one"] .page-slot-right { grid-column: 1; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--page-rule); }
  body[data-effective-view="one"] .turning-sheet { left: 0; width: 100%; }
  body[data-effective-view="one"] .curl-left { display: none; }
  body[data-effective-view="one"] .sheet-front, body[data-effective-view="one"] .sheet-back { border-radius: 12px; }
  body[data-effective-view="one"] .turning-sheet.flip-prev { left: 0; }
  body[data-motion="reduced"] .turning-sheet { animation-duration: .12s; }
  body[data-motion="reduced"] .turning-sheet::after { display: none; }

  body.focus-mode .topbar, body.focus-mode .reader-status, body.focus-mode .reader-controls, body.focus-mode .app-footer { transform: translateY(-120%); opacity: 0; pointer-events: none; }
  body.focus-mode .topbar { position: fixed; }
  body.focus-mode .reader { display: grid; min-height: 100svh; align-items: center; padding: 10px; }
  body.focus-mode .book-workspace { width: min(100%, 1540px); }
  body.focus-mode .book-frame { width: 100%; }
  body.focus-mode { --page-height: min(94svh, 940px); }
  body.focus-mode .reader-status, body.focus-mode .reader-controls, body.focus-mode .app-footer { position: fixed; }
}

@layer responsive {
  @media (max-width: 900px) {
    :root { --page-height: clamp(500px, calc(100svh - 238px), 790px); --page-pad-x: clamp(27px, 7vw, 48px); }
    .brand-copy, .topbar-context span, .tool-label, .search-button kbd { display: none; }
    .brand { margin-right: 8px; }
    .topbar-context { padding-left: 10px; border-left: 0; }
    .reader { padding-inline: 8px; }
    .book-workspace { grid-template-columns: 38px minmax(0, 1fr) 38px; gap: 3px; }
    .page-nav { width: 36px; background: color-mix(in srgb, var(--surface) 86%, transparent); }
    .reader-status { padding-inline: 5px; }
    .app-footer > span { display: none; }
    .app-footer { justify-content: center; }
  }

  @media (max-width: 600px) {
    :root { --topbar-height: 58px; --page-height: clamp(470px, calc(100svh - 225px), 735px); --page-pad-x: clamp(22px, 7vw, 34px); --page-pad-y: clamp(24px, 4vh, 38px); }
    .topbar { grid-template-columns: auto auto minmax(0, 1fr) auto; padding-inline: 7px; }
    .topbar-context strong { font-size: .72rem; }
    .topbar-actions { gap: 0; }
    .search-button { min-width: 40px; padding: 0 10px; border: 0; background: transparent; }
    .reader { padding-top: 9px; }
    .reader-status { min-height: 39px; margin-bottom: 7px; }
    .reader-status-copy .eyebrow { display: none; }
    .study-actions { margin-left: auto; }
    .compact-button { min-width: 40px; padding: 0 8px; }
    .compact-button span:not([aria-hidden="true"]):not(.sr-only):not(.notification-dot) { display: none; }
    .book-workspace { display: block; }
    .page-nav { position: fixed; z-index: 24; top: 50%; width: 38px; opacity: .5; }
    .page-nav:hover, .page-nav:focus-visible { opacity: 1; }
    .page-nav-prev { left: 3px; }
    .page-nav-next { right: 3px; }
    .page-body { font-size: calc(.94rem * var(--reader-size)); }
    .page-head, .page-foot { font-size: .52rem; }
    .reader-controls { grid-template-columns: auto minmax(70px, 1fr) auto; padding-inline: 8px; margin-top: 8px; }
    .reader-controls > .icon-button:first-child { display: none; }
    .reader-controls > .icon-button:last-child { display: none; }
    .page-number-field input { width: 44px; }
    .app-footer { padding-top: 8px; font-size: .68rem; }
    .tools-grid { padding: 14px; }
    .settings-grid { grid-template-columns: 1fr; }
    .settings-span { grid-column: 1; }
    .voice-row { grid-template-columns: 1fr; }
    .cover-emblem { opacity: .38; }
    .cover-title { font-size: clamp(3rem, 16vw, 5.5rem); }
    .chapter-opener h1 { font-size: clamp(2rem, 10vw, 3.2rem); }
  }

  @media (max-height: 690px) and (orientation: landscape) {
    :root { --page-height: calc(100svh - 155px); --page-pad-y: 22px; }
    .reader { padding-top: 8px; }
    .reader-status { display: none; }
    .reader-controls { margin-top: 6px; }
    .app-footer { display: none; }
  }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  }

  @media (forced-colors: active) {
    .book-page, .cover-page, .back-cover { border: 1px solid CanvasText; background: Canvas; color: CanvasText; }
    .book-shadow, .cover-emblem { display: none; }
    .top-progress span, .progress-track span { background: Highlight; }
  }
}

@layer utilities {
  .sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
  .notice-page { min-height: 100svh; background: var(--canvas); }
  .notice-header { position: sticky; z-index: 5; top: 0; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px); }
  .notice-header-inner { display: flex; width: min(100% - 32px, 880px); min-height: 64px; align-items: center; justify-content: space-between; gap: 18px; margin-inline: auto; }
  .notice-header .brand { margin: 0; }
  .notice-header nav { display: flex; gap: 14px; font-size: .76rem; font-weight: 750; }
  .notice-main { width: min(100% - 32px, 880px); margin: clamp(28px, 6vw, 72px) auto; padding: clamp(24px, 5vw, 64px); border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
  .notice-main > .eyebrow { margin-bottom: 10px; }
  .notice-main > h1 { max-width: 14ch; font: 700 clamp(2.3rem, 7vw, 4.8rem)/.92 var(--font-book); letter-spacing: -.045em; }
  .notice-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 18px 0 30px; padding-bottom: 20px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .72rem; }
  .notice-summary { margin-bottom: 30px; padding: 18px; border-left: 4px solid var(--gold); background: var(--surface-2); color: var(--ink-soft); font: 1.05rem/1.65 var(--font-book); }
  .notice-section { scroll-margin-top: 90px; }
  .notice-section + .notice-section { margin-top: 2rem; padding-top: 2rem; border-top: 1px solid var(--line); }
  .notice-section h2 { margin-bottom: .7em; color: var(--accent-deep); font: 700 1.5rem/1.2 var(--font-book); }
  .notice-section h3 { margin: 1.2em 0 .5em; font-size: .9rem; }
  .notice-section p, .notice-section li { color: var(--ink-soft); font: .96rem/1.72 var(--font-book); }
  .notice-section p + p, .notice-section ul + p, .notice-section p + ul { margin-top: .9em; }
  .notice-section ul { padding-left: 1.25em; }
  .notice-contact { margin-top: 32px; padding: 20px; border-radius: 12px; background: var(--accent-soft); }
  .notice-footer { width: min(100% - 32px, 880px); margin: 0 auto 40px; color: var(--ink-soft); font-size: .72rem; text-align: center; }
}

@layer print {
  @media print {
    @page { size: auto; margin: .7in; }
    body { background: #fff !important; color: #111 !important; }
    .app, .drawer, .drawer-scrim, .modal, .reading-ruler, .timer-chip, .toast, .loading-screen, .measure-root { display: none !important; }
    .print-root { display: block; color: #111; font: 11pt/1.55 Georgia, serif; }
    .print-cover { min-height: 8in; break-after: page; display: grid; align-content: center; border: 4px double #164c48; padding: .6in; }
    .print-cover h1 { max-width: 8ch; color: #164c48; font-size: 48pt; line-height: .9; }
    .print-cover p { margin-top: .25in; }
    .print-chapter { break-before: page; }
    .print-chapter > h1 { color: #164c48; font-size: 26pt; }
    .print-chapter > .print-deck { margin: .15in 0 .35in; color: #555; font-style: italic; }
    .print-chapter h2 { margin: .25in 0 .08in; color: #164c48; font-size: 18pt; break-after: avoid; }
    .print-chapter h3 { margin: .18in 0 .06in; font-size: 13pt; break-after: avoid; }
    .print-chapter p { margin: 0 0 .11in; orphans: 3; widows: 3; }
    .print-chapter table { width: 100%; border-collapse: collapse; font-size: 8.5pt; }
    .print-chapter th, .print-chapter td { padding: 5pt; border: .5pt solid #777; vertical-align: top; }
    .print-chapter th { background: #e7efed; }
    .print-notice { break-before: page; }
    a { color: #111; text-decoration: none; }
  }
}
