
  @font-face {
    font-family: "Fraunces";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("/assets/fonts/fraunces-wght.woff2?v=20260924a1") format("woff2");
  }
  @font-face {
    font-family: "Newsreader";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("/assets/fonts/newsreader-400.woff2?v=20260924a1") format("woff2");
  }
  @font-face {
    font-family: "Newsreader";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("/assets/fonts/newsreader-600.woff2?v=20260924a1") format("woff2");
  }
  :root {
    color-scheme: dark;
    /* Fraunces only on brand / H1 / issue titles; UI is system-ui */
    --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
    --font-ui: system-ui, -apple-system, "Segoe UI", sans-serif;
    font-family: var(--font-ui);
    /* Quiet cool ink */
    --bg: #0e1218;
    --card: #161c26;
    --card-border: rgba(176, 190, 208, 0.14);
    /* One ink: cool off-white for primary actions. */
    --accent: #e8eef5;
    --accent-strong: #ffffff;
    --accent-rgb: 232, 238, 245;
    --accent-contrast: #0e1218;
    --accent-text: rgba(232, 238, 245, 0.88);
    --text: #e8eef5;
    --text-muted: rgba(232, 238, 245, 0.52);
    --surface-strong: #121820;
    --radius-cover: 0;
    --radius-control: 2px;
    --shadow-soft: none;
    --shadow-soft-strong: none;
    --shadow-button: none;
    --axis-art:    #c8906a;
    --axis-story:  #6a9ec8;
    --axis-pacing: #6ac8a0;
    --axis-art-dim:    rgba(200, 144, 106, 0.13);
    --axis-story-dim:  rgba(106, 158, 200, 0.13);
    --axis-pacing-dim: rgba(106, 200, 160, 0.13);
  }
  body {
    background:
      radial-gradient(110% 65% at 50% -8%, rgba(232, 238, 245, 0.1), transparent 50%),
      linear-gradient(180deg, #161c26 0%, var(--bg) 35%, #090d13 100%);
  }
  /* Paper grain — light material, under all page chrome */
  body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.06;
    mix-blend-mode: soft-light;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  }
  /* Folio spine — quiet, below header/Clerk (never trap overlays) */
  body::after {
    content: "";
    position: fixed;
    top: 0;
    bottom: 0;
    left: clamp(0.65rem, 1.6vw, 1.15rem);
    width: 1px;
    pointer-events: none;
    z-index: 2;
    background: linear-gradient(
      180deg,
      transparent 0%,
      rgba(232, 238, 245, 0.14) 18%,
      rgba(232, 238, 245, 0.22) 50%,
      rgba(232, 238, 245, 0.1) 82%,
      transparent 100%
    );
  }
  @media (max-width: 720px) {
    body::after { display: none; }
  }
  /*
   * Stacking: do NOT stamp z-index on every body child — that trapped Browse,
   * mobile menus, and Clerk under main's opaque table-plane. Header alone
   * sits above main so dropdowns paint over the catalog.
   */
  header {
    position: relative;
    z-index: 40;
  }
  main,
  .site-footer {
    position: relative;
    z-index: 1;
  }
  /* Covers as objects on the table — cool edge + soft contact shadow */
  img.cover-object,
  .card img,
  .rec-card img,
  .cover-slide img,
  .signin-covers img,
  .similar-item-cover img,
  .concept-tile img,
  .miss-covers img,
  .series-rail img,
  .series-item img {
    box-shadow:
      0 0 0 1px rgba(232, 238, 245, 0.18),
      0 1px 0 rgba(232, 238, 245, 0.08),
      0 2px 4px rgba(0, 0, 0, 0.35),
      0 10px 22px rgba(0, 0, 0, 0.42),
      0 22px 0 -20px rgba(0, 0, 0, 0.55);
  }
  .card {
    position: relative;
  }
  /*
   * Shared table plane — one material under every cover field
   * (home catalog, detail cover, profile shelf, 404 miss covers).
   */
  .table-plane,
  .catalog-section,
  .cover-panel,
  .signin-covers,
  .miss-covers {
    position: relative;
    background:
      linear-gradient(180deg, rgba(232, 238, 245, 0.055) 0%, transparent 1.25px),
      linear-gradient(180deg, #1a2230 0%, #121820 55%, #0c1118 100%);
    box-shadow:
      inset 0 1px 0 rgba(232, 238, 245, 0.1),
      0 18px 40px rgba(0, 0, 0, 0.28);
  }
  .catalog-section {
    padding: 1.35rem clamp(1rem, 3vw, 2.25rem) 3rem;
    margin-top: 0.35rem;
  }
  .cover-panel {
    padding: 0.85rem 0.85rem 1rem;
    border-radius: 0;
  }
  .signin-covers {
    padding: 0.85rem 0.75rem 1.35rem;
    margin-bottom: 0.25rem;
  }
  .miss-covers {
    padding: 0.75rem 0.75rem 1.25rem;
  }
  /* Shared table lip — quiet rule under cover fields */
  .table-lip,
  .catalog-section > .catalog-toolbar::after {
    content: "";
    display: block;
    height: 1px;
    margin-top: 0.75rem;
    border-radius: 0;
    background: linear-gradient(
      90deg,
      rgba(232, 238, 245, 0.28) 0%,
      rgba(232, 238, 245, 0.12) 55%,
      transparent 100%
    );
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
  }
  .catalog-section > .catalog-toolbar::after {
    margin-top: 0.15rem;
    margin-bottom: 0.35rem;
  }
  /*
   * Cover-strip lips must be absolute — as flex/grid items they became a
   * stray 4th 404 cell / side lip beside the last signed-out cover.
   */
  .signin-covers::after,
  .miss-covers::after {
    content: "";
    position: absolute;
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.55rem;
    height: 1px;
    display: block;
    pointer-events: none;
    background: linear-gradient(
      90deg,
      rgba(232, 238, 245, 0.28) 0%,
      rgba(232, 238, 245, 0.12) 55%,
      transparent 100%
    );
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
  }
  /* Soft / wonky Fraunces on display titles — not stock Newsreader */
  header .brand,
  .catalog-header,
  .display-title,
  .signin-prompt h2,
  .miss .code,
  .miss h1,
  .title-block h1 {
    font-variation-settings: "SOFT" 48, "WONK" 0.85, "opsz" 96;
  }
  /* Author display rules beat the UA [hidden] stylesheet */
  #my-library-link[hidden],
  #mobile-my-library-link[hidden],
  #admin-link[hidden],
  #mobile-admin-link[hidden] {
    display: none !important;
  }


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


  .skip-link {
    position: absolute;
    top: 0;
    left: -9999px;
    z-index: 1000;
    padding: 0.5rem 1rem;
    background: var(--accent);
    color: var(--accent-contrast);
    text-decoration: none;
    border-radius: 0 0 4px 0;
  }
  .skip-link:focus {
    left: 0;
    top: 0;
  }


  .toast {
    position: fixed;
    bottom: 1.25rem;
    left: 50%;
    transform: translate(-50%, 0.5rem);
    background: var(--surface-strong);
    border: 1px solid var(--card-border);
    color: var(--text);
    font-size: 0.85rem;
    padding: 0.6rem 1rem;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 200;
  }
  .toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  .toast.is-error {
    border-color: rgba(255, 120, 120, 0.45);
    color: #ffb5b5;
  }


  .site-footer {
    margin-top: auto;
    padding: 1.5rem 1.5rem 2rem;
    border-top: 1px solid var(--card-border);
    text-align: center;
    display: flex;
    flex-direction: column;
    /* Column flex shrinks each <p> to its content width and pins it to the
       start, so text-align alone centres inside a narrow box rather than
       across the footer. */
    align-items: center;
    gap: 0.3rem;
  }
  .site-footer p {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-muted);
  }
  .site-footer a {
    color: var(--accent-text);
    text-decoration: underline;
  }
  .site-footer a:hover { color: var(--accent-strong); }
  .site-footer a:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
  .site-footer-legal {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem 1rem;
    margin-top: 0.35rem;
  }
  .site-footer-legal a,
  .site-footer-legal button {
    color: var(--accent-text);
    font-size: 0.82rem;
    font-family: var(--font-ui);
    background: none;
    border: 0;
    padding: 0;
    text-decoration: underline;
    cursor: pointer;
  }
  .site-footer-legal a:hover,
  .site-footer-legal button:hover { color: var(--accent-strong); }
  .site-footer-legal a:focus-visible,
  .site-footer-legal button:focus-visible {
    outline: 2px solid var(--accent-strong);
    outline-offset: 2px;
  }


  html[data-consent="set"] .cookie-scrim,
  html[data-consent="set"] .cookie-banner { display: none !important; }
  .cookie-scrim {
    position: fixed;
    inset: 0;
    z-index: 400;
    background: rgba(6, 8, 12, 0.72);
  }
  .cookie-scrim[hidden],
  .cookie-banner[hidden] { display: none !important; }
  .cookie-banner {
    position: fixed;
    z-index: 410;
    left: 50%;
    bottom: 1.25rem;
    transform: translateX(-50%);
    width: min(40rem, calc(100vw - 2rem));
    margin: 0;
    padding: 1.15rem 1.25rem 1.2rem;
    background: var(--surface-strong, #121820);
    border: 1px solid rgba(232, 238, 245, 0.28);
    color: var(--text, #e8eef5);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  }
  .cookie-banner h2 {
    margin: 0 0 0.45rem;
    font-size: 1.15rem;
    font-family: var(--font-ui, "Segoe UI", sans-serif);
    color: var(--text, #e8eef5);
  }
  .cookie-banner p {
    margin: 0 0 1rem;
    font-size: 0.95rem;
    line-height: 1.45;
    color: var(--accent-text, rgba(232, 238, 245, 0.88));
  }
  .cookie-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
  }
  .cookie-banner-actions button {
    font-family: var(--font-ui, "Segoe UI", sans-serif);
    font-size: 0.95rem;
    min-height: 44px;
    padding: 0.55rem 1rem;
    cursor: pointer;
    border-radius: 2px;
  }
  .cookie-banner-accept {
    background: var(--accent, #e8eef5);
    color: var(--accent-contrast, #0e1218);
    border: 0;
    font-weight: 600;
  }
  .cookie-banner-reject {
    background: transparent;
    color: var(--text, #e8eef5);
    border: 1px solid rgba(232, 238, 245, 0.45);
    font-weight: 600;
  }
  html:not([data-consent="set"]) .scroll-top-btn { bottom: 12.5rem; }
  @media (max-width: 720px) {
    .cookie-banner {
      left: 0;
      right: 0;
      bottom: 0;
      transform: none;
      width: auto;
      padding-bottom: calc(1.1rem + env(safe-area-inset-bottom, 0px));
    }
    .cookie-banner-actions { flex-direction: column; }
    .cookie-banner-actions button { width: 100%; }
    html:not([data-consent="set"]) .scroll-top-btn { bottom: 16.5rem; }
  }


  .scroll-top-btn {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 90;
    width: 2.75rem;
    height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid var(--card-border);
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(0.5rem);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  }
  .scroll-top-btn.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  .scroll-top-btn:hover { border-color: var(--accent-strong); }
  .scroll-top-btn:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
  .scroll-top-btn svg {
    width: 1.25rem;
    height: 1.25rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
  }
  /* Keep clear of the mobile bottom bar where one exists. */
  @media (max-width: 720px) {
    .scroll-top-btn { bottom: 4.5rem; }
  }


  .reading-list-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 17px;
    height: 17px;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-contrast);
    font-size: 0.64rem;
    font-weight: 700;
    margin-left: 0.1rem;
  }
  .reading-list-count[hidden] { display: none; }


  html,
  body {
    overflow-x: clip;
    max-width: 100%;
  }


  header {
    padding: 1.25rem clamp(1.25rem, 4vw, 3.5rem);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 40;
    gap: 1rem;
    flex-wrap: wrap;
  }
  header .brand,
  a.brand {
    color: var(--text);
    text-decoration: none;
    font-family: var(--font-display);
    font-weight: 550;
    font-size: clamp(1.95rem, 3.6vw, 2.6rem);
    letter-spacing: -0.04em;
    text-transform: none;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: baseline;
    flex-shrink: 0;
    line-height: 1;
    white-space: nowrap;
    font-variation-settings: "SOFT" 55, "WONK" 1, "opsz" 144;
  }
  header .brand:hover,
  a.brand:hover {
    color: var(--accent-strong);
  }
  .personalized-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: transparent;
    border: none;
    box-shadow: none;
    margin-left: 0.55rem;
    align-self: center;
    opacity: 0;
    pointer-events: none;
  }
  .personalized-tag[data-state="on"] {
    opacity: 1;
    background: #2fd676;
    border: none;
    box-shadow: 0 0 0 2px rgba(47, 214, 118, 0.18);
    pointer-events: auto;
  }
  header nav {
    display: flex;
    gap: 1.25rem;
    align-items: center;
  }
  header nav a {
    color: rgba(232, 238, 245, 0.72);
    text-decoration: none;
    font-family: var(--font-ui);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    white-space: nowrap;
    transition: color 0.2s ease;
  }
  header nav a:hover,
  header nav a.active {
    color: var(--accent-strong);
  }
  header nav a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 2px;
  }
  .header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    min-width: 0;
  }
  .auth-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
  }
  /* Header Sign In = text chrome (same weight as Browse). */
  .auth-btn {
    border: none;
    background: transparent;
    color: rgba(232, 238, 245, 0.72);
    border-radius: 0;
    padding: 0;
    font-family: var(--font-ui);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: color 0.15s ease;
  }
  .auth-btn:hover {
    color: var(--accent-strong);
  }
  .auth-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }
  /* One ink brick — page primary only. Never for header chrome. */
  .cta-primary,
  .auth-btn.primary,
  a.cta-primary,
  button.cta-primary {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: var(--accent-contrast);
    border-radius: var(--radius-control);
    padding: 0.55rem 1.15rem;
    font-family: var(--font-ui);
    font-size: 1.02rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  }
  .cta-primary:hover,
  .auth-btn.primary:hover,
  a.cta-primary:hover,
  button.cta-primary:hover {
    background: var(--accent-strong);
    border-color: var(--accent-strong);
    color: var(--accent-contrast);
  }
  .cta-primary:focus-visible,
  .auth-btn.primary:focus-visible,
  a.cta-primary:focus-visible,
  button.cta-primary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }
  /* .auth-btn.primary sets display:inline-flex, which beats the UA [hidden] rule. */
  .auth-btn[hidden],
  .auth-btn.primary[hidden] {
    display: none !important;
  }
  /* Secondary outline — only beside an ink primary (e.g. 404) */
  .cta-secondary,
  a.cta-secondary {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid rgba(232, 238, 245, 0.38);
    background: transparent;
    color: var(--text);
    border-radius: var(--radius-control);
    padding: 0.55rem 1.15rem;
    font-family: var(--font-ui);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
  }
  .cta-secondary:hover,
  a.cta-secondary:hover {
    border-color: rgba(232, 238, 245, 0.7);
    color: var(--accent-strong);
  }
  .cta-secondary:focus-visible,
  a.cta-secondary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }
  .display-title {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.02em;
  }


  @media (max-width: 720px) {
    .mobile-menu nav a,
    .header-actions nav > a,
    .header-actions [data-browse-toggle] {
      display: flex;
      align-items: center;
      min-height: 44px;
    }
  }
