/**
 * Olive Turn Scholar — Article Display Stylesheet
 *
 * Spec v0.7.0 Sections 2, 4, 5, 10, 11.
 * All values use var(--ot-*, fallback) pattern per Q&A Q11.
 *
 * Load order:
 *   1. This file (Scholar Core defaults)
 *   2. Webhost/theme overrides
 */

/* ==========================================================================
   1. CSS Custom Properties (:root)
   Spec Section 5 + 11. Discoverable for theme developers.
   ========================================================================== */

:root {
  /* Typography (Section 11.1) */
  --ot-body-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ot-body-size: 17px;
  --ot-body-line-height: 1.75;
  --ot-body-color: #212529;
  --ot-heading-color: #1a1a1a;
  --ot-link-color: #0066cc;
  --ot-muted-color: #6c757d;

  /* Heading sizes */
  --ot-h1-size: 30px;
  --ot-h2-size: 23px;
  --ot-h3-size: 19px;
  --ot-h4-size: 17px;

  /* Layout */
  --ot-sidebar-width: 340px;
  --ot-nav-rail-width: 140px;
  --ot-content-max-width: 780px;
  --ot-content-inline-padding: 16px;
  --ot-header-inline-padding: 12px;
  --ot-content-shell-max-width: calc(var(--ot-content-max-width, 780px) + (var(--ot-content-inline-padding, 16px) * 2));
  --ot-header-shell-max-width: calc(var(--ot-content-max-width, 780px) + (var(--ot-header-inline-padding, 12px) * 2));
  --ot-pill-strip-width: 52px;
  --ot-action-bar-height: auto;
  --ot-page-max-width: 1100px;
  --ot-reading-anchor-top: 24px;

  /* Offset from viewport right edge to layout container right edge.
     Keeps sidebar+pill anchored to content area on wide screens. */
  --ot-layout-right-offset: 0px; /* JS computes this from actual layout position */

  /* Abstract card (Design Pattern 1) */
  --ot-abstract-bg: #f8f9fa;
  --ot-abstract-padding-block: 24px;
  --ot-abstract-padding-inline: 24px;
  --ot-abstract-border-radius: 8px;
  --ot-abstract-separator-color: #dee2e6;

  /* Borders */
  --ot-border-color: #e9ecef;

  /* Pill strip (Section 2.3 / 5.4) */
  --ot-pill-bg: #ffffff;
  --ot-pill-color: #6c757d;
  --ot-pill-hover-bg: #f0f7ff;
  --ot-pill-hover-color: #0066cc;
  --ot-pill-active-bg: #0066cc;
  --ot-pill-active-color: #ffffff;

  /* Pill bar – mobile */
  --ot-pill-bar-bg: rgba(255, 255, 255, 0.97);

  /* Action bar buttons (Section 2.4 / 5.3) */
  --ot-action-primary-bg: #0066cc;
  --ot-action-primary-color: #ffffff;
  --ot-action-primary-hover: #0052a3;
  --ot-action-secondary-border: #0066cc;
  --ot-action-secondary-color: #0066cc;
  --ot-action-secondary-hover: #f0f7ff;
  --ot-action-tertiary-color: #495057;
  --ot-action-tertiary-hover: #0066cc;

  /* Nav rail (Section 5.4) */
  --ot-nav-color: #6c757d;
  --ot-nav-hover: #343a40;
  --ot-nav-active-color: #0066cc;
  --ot-nav-active-border: #0066cc;

  /* Sidebar content (Section 5.6) */
  --ot-info-label-color: #6c757d;
  --ot-info-value-color: #333;
  --ot-info-subhead-color: #333;
  --ot-caption-color: #555;
  --ot-btn-secondary-bg: #f8f9fa;

  /* Retraction banner (Section 5.8) */
  --ot-retraction-bg: #fff3cd;
  --ot-retraction-border: #ffc107;
  --ot-retraction-link: #0066cc;

  /* Footer (Section 10.4) */
  --ot-footer-heading-color: #495057;
  --ot-footer-text-color: #333;

  /* Overlay */
  --ot-overlay-bg: rgba(255, 255, 255, 0.98);

  /* Highlight pulse */
  --ot-highlight-bg: rgba(255, 213, 79, 0.4);
}

/* ==========================================================================
   1b. WordPress Theme Overrides
   Reduce WP theme padding/margins when displaying Scholar articles.
   ========================================================================== */

/* Twenty Twenty-Four uses block-based templates with main element padding */
main:has(.ot-article-page) {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.wp-block-post-content:has(.ot-article-page),
.entry-content:has(.ot-article-page) {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Fallback for browsers without :has() - use body class for custom post type */
.single-olive_turn_article main,
.post-type-archive-olive_turn_article main {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.single-olive_turn_article .wp-block-post-content,
.post-type-archive-olive_turn_article .wp-block-post-content,
.single-olive_turn_article .entry-content,
.post-type-archive-olive_turn_article .entry-content {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Classic themes with entry-content wrapper */
.entry-content:has(.ot-article-page) {
  padding-top: 0 !important;
}

/* WP block-theme flow layout adds gap between blocks via --wp--style--block-gap.
   Override the inline padding-top/padding-bottom on main and suppress block gap. */
.single-olive_turn_article main.is-layout-flow {
  gap: 0 !important;
}

main.is-layout-flow:has(.ot-article-page) {
  gap: 0 !important;
}

/* Also override the WP inline style: padding-top: var(--wp--custom--spacing--medium) */
.single-olive_turn_article main[style] {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* WP block gap applies margin-block-start on .wp-site-blocks children via :where() selector.
   Block layout doesn't reliably honor margin overrides; switching to flex eliminates the gap. */
.single-olive_turn_article .wp-site-blocks {
  display: flex !important;
  flex-direction: column !important;
}
.single-olive_turn_article .wp-site-blocks > * {
  margin-block-start: 0 !important;
  margin-block-end: 0 !important;
}

/* Reduce WP header padding on Scholar article pages */
.single-olive_turn_article .wp-site-blocks > header > * {
  padding-top: 16px !important;
  padding-bottom: 8px !important;
}

/* ==========================================================================
   2. Base Typography (Section 11.1)
   ========================================================================== */

.ot-article-page {
  font-family: var(--ot-body-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);
  font-size: var(--ot-body-size, 17px);
  padding-left: 16px;
  padding-right: 16px;
  color: var(--ot-body-color, #212529);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Break out of WP theme content-width constraint (42rem default). Use 100% width with box-sizing. */
  max-width: 100%;
  box-sizing: border-box;
}

.ot-article-page a {
  color: var(--ot-link-color, #0066cc);
  text-decoration: none;
}

.ot-article-page a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   3. Article Header (Section 10.2)
   ========================================================================== */

.ot-article-header,
.ot-action-bar,
.ot-article-content,
.ot-article-references,
.ot-footer-metadata {
  width: 100%;
  max-width: var(--ot-content-shell-max-width, calc(var(--ot-content-max-width, 780px) + 32px));
  box-sizing: border-box;
  padding-left: var(--ot-content-inline-padding, 16px);
  padding-right: var(--ot-content-inline-padding, 16px);
  margin-left: auto;
  margin-right: auto;
}

.ot-article-header {
  margin-bottom: 0;
  padding-top: 4px;
  padding-bottom: 8px;
}

.ot-article-type-badge {
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--ot-muted-color, #6c757d);
  margin-bottom: 8px;
}

.ot-article-page .ot-article-title {
  margin: 0 0 14px 0;
  font-size: var(--ot-h1-size, 28px);
  font-weight: 700;
  line-height: 1.2;
  color: var(--ot-heading-color, #1a1a1a);
}

.ot-article-authors {
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 10px;
}

.ot-author-name {
  cursor: pointer;
  color: var(--ot-body-color, #212529);
  font-weight: 600;
}

.ot-author-name:hover {
  color: var(--ot-link-color, #0066cc);
}

.ot-aff-marker {
  font-size: 11px;
  color: var(--ot-link-color, #0066cc);
  cursor: pointer;
  vertical-align: super;
  line-height: 1;
  margin: 0 1px;
}

.ot-orcid-link {
  vertical-align: middle;
  margin-left: 2px;
}

.ot-orcid-icon {
  width: 16px;
  height: 16px;
  vertical-align: middle;
}

/* Popover API affiliation tooltip (Q2) */
.ot-aff-popover {
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--ot-border-color, #e9ecef);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  font-size: 13px;
  color: var(--ot-body-color, #212529);
  max-width: 320px;
}

.ot-aff-popover:popover-open {
  display: block;
}

.ot-article-dates {
  font-size: 13px;
  color: var(--ot-muted-color, #6c757d);
  margin-top: 4px;
  margin-bottom: 14px;
}

.ot-article-dates span + span::before {
  content: " | ";
}

/* Related articles in header (Section 10.2 — quiet links) */
.ot-related-articles {
  font-size: 13px;
  color: var(--ot-muted-color, #6c757d);
  margin: 8px 0;
}

.ot-related-articles a {
  color: var(--ot-link-color, #0066cc);
  text-decoration: none;
}

.ot-related-articles a:hover {
  text-decoration: underline;
}

/* Abstract card — publisher-style visual distinction (Design Pattern 1 & 4) */
.ot-article-abstract {
  margin-left: calc(-1 * var(--ot-abstract-padding-inline, 24px));
  margin-right: calc(-1 * var(--ot-abstract-padding-inline, 24px));
  margin-top: 0;
  margin-bottom: 32px;
  padding: var(--ot-abstract-padding-block, 24px) var(--ot-abstract-padding-inline, 24px);
  background: var(--ot-abstract-bg, #f8f9fa);
  border-radius: var(--ot-abstract-border-radius, 8px);
  font-size: var(--ot-body-size, 17px);
  line-height: 1.6;
  color: var(--ot-body-color, #212529);
}
.ot-article-abstract p:first-child { margin-top: 0; }
.ot-article-abstract p:last-child { margin-bottom: 0; }

/* ==========================================================================
   4. Retraction Banner (Section 5.8)
   ========================================================================== */

.ot-retraction-banner {
  padding: 12px 16px;
  background: var(--ot-retraction-bg, #fff3cd);
  border: 2px solid var(--ot-retraction-border, #ffc107);
  border-radius: 6px;
  margin: 12px 0;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ot-retraction-banner a {
  color: var(--ot-retraction-link, #0066cc);
  text-decoration: underline;
}

/* ==========================================================================
   5. Top Action Bar (Section 2.4 / 5.3)
   ========================================================================== */

.ot-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 8px;
  padding-bottom: 8px;
  background: #fafbfc;
  margin-top: 12px;
  margin-bottom: 20px;
  margin-left: auto;
  margin-right: auto;
}

.ot-action-bar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: none;
  font-family: inherit;
}

.ot-action-bar-btn-primary {
  background: var(--ot-action-primary-bg, #0066cc);
  color: var(--ot-action-primary-color, #ffffff);
}

.ot-action-bar-btn-secondary {
  background: transparent;
  border: 1px solid var(--ot-action-secondary-border, #0066cc);
  color: var(--ot-action-secondary-color, #0066cc);
}

.ot-action-bar-btn-tertiary {
  background: transparent;
  color: var(--ot-action-tertiary-color, #495057);
}

.ot-action-bar-btn-tertiary:hover {
  color: var(--ot-action-tertiary-hover, #0066cc);
}

.ot-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
}

a.ot-download-btn-primary {
  background: var(--ot-action-primary-bg, #0066cc);
  color: var(--ot-action-primary-color, #ffffff);
}

a.ot-download-btn-primary:hover {
  background: var(--ot-action-primary-hover, #0052a3);
  color: var(--ot-action-primary-color, #ffffff);
  text-decoration: none;
}

a.ot-download-btn-secondary {
  background: transparent;
  border: 1px solid var(--ot-action-secondary-border, #0066cc);
  color: var(--ot-action-secondary-color, #0066cc);
}

a.ot-download-btn-secondary:hover {
  background: var(--ot-action-secondary-hover, #f0f7ff);
  text-decoration: none;
}

.ot-download-btn-size {
  font-size: 12px;
  opacity: 0.7;
}

/* Button group: View + Download paired (§6.3.4 action bar) */
.ot-action-btn-group {
  display: inline-flex;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.ot-action-btn-group > * {
  box-sizing: border-box;
}

/* Primary group — filled with single outer border */
.ot-action-btn-group-primary {
  border: 1px solid var(--ot-action-primary-bg, #0066cc);
}
.ot-action-btn-group-primary .ot-view-btn {
  background: var(--ot-action-primary-bg, #0066cc);
  color: #fff;
  border: none;
}
.ot-action-btn-group-primary .ot-view-btn:hover {
  background: var(--ot-action-primary-hover, #0052a3);
}
.ot-action-btn-group-primary .ot-download-icon-btn {
  background: var(--ot-action-primary-bg, #0066cc);
  color: #fff;
  border: none;
  border-left: 1px solid rgba(255, 255, 255, 0.3);
}
.ot-action-btn-group-primary .ot-download-icon-btn:hover {
  background: var(--ot-action-primary-hover, #0052a3);
}

/* When primary group has only a view button (no download pair), ensure clean borders */
.ot-action-btn-group-primary .ot-view-btn:only-child {
  border-radius: 6px;
}

/* Secondary group — outlined with single outer border */
.ot-action-btn-group-secondary {
  border: 1px solid var(--ot-action-secondary-border, #ced4da);
}
.ot-action-btn-group-secondary .ot-view-btn {
  background: #fff;
  color: var(--ot-action-secondary-color, #495057);
  border: none;
}
.ot-action-btn-group-secondary .ot-view-btn:hover {
  background: var(--ot-action-secondary-hover-bg, #f8f9fa);
}
.ot-action-btn-group-secondary .ot-download-icon-btn {
  background: #fff;
  color: var(--ot-action-secondary-color, #495057);
  border: none;
  border-left: 1px solid var(--ot-action-secondary-border, #ced4da);
}
.ot-action-btn-group-secondary .ot-download-icon-btn:hover {
  background: var(--ot-action-secondary-hover-bg, #f8f9fa);
}

/* Shared View button styling */
.ot-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: none;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  font-family: inherit;
  line-height: 1;
  transition: background 120ms ease, border-color 120ms ease;
}

/* Shared Download icon button styling */
.ot-download-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  cursor: pointer;
  text-decoration: none;
  transition: background 120ms ease;
}

/* Supplementary materials — View and Download as inline links */
.ot-figure-actions .ot-view-link,
.ot-figure-actions .ot-download-link {
  color: var(--ot-action-link-color, #0066cc);
  text-decoration: none;
  font-size: 13px;
}

.ot-figure-actions .ot-view-link:hover,
.ot-figure-actions .ot-download-link:hover {
  text-decoration: underline;
  color: var(--ot-action-link-hover, #0052a3);
}

/* Icon inside action bar links */
.ot-btn-icon {
  flex-shrink: 0;
  vertical-align: middle;
}

/* ==========================================================================
   6. Three-Zone Layout (Section 2.1 / 10.1)
   ========================================================================== */

.ot-layout {
  display: grid;
  grid-template-columns: 1fr auto;
  position: relative;
  max-width: var(--ot-page-max-width, 1100px);
  margin: 0 auto;
}

.ot-article-main {
  min-width: 0; /* prevent grid blowout */
}

.ot-article-content {
  line-height: var(--ot-body-line-height, 1.65);
  padding-top: 0;
  padding-bottom: 0;
}

.ot-article-content img {
  max-width: 100%;
  height: auto;
}

.ot-sidebar-zone {
  position: relative;
  /* Permanent min-width matches the pill strip's natural rendered width
     (8px padding + 36px icons = 44px).  Prevents zone collapse when
     the pill switches to position:fixed, so the grid never reflows. */
  min-width: 44px;
}

/* ==========================================================================
   7. Article Section Navigation — Left Rail (Section 5.4)
   ========================================================================== */

.ot-article-nav {
  font-size: 13px;
  color: var(--ot-nav-color, #6c757d);
  padding: 0 8px 16px;
  display: none; /* Shown via media queries */
}

.ot-article-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ot-article-nav-item a {
  display: block;
  padding: 5px 10px;
  text-decoration: none;
  color: inherit;
  border-left: 3px solid transparent;
  transition: color 100ms ease, border-color 100ms ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
  line-height: 1.4;
}

.ot-article-nav-item.is-sub a {
  padding-left: 20px;
  font-size: 12px;
}

.ot-article-nav a {
  display: block;
  padding: 5px 10px;
  text-decoration: none;
  color: var(--ot-nav-color, #495057);
  border-left: 3px solid transparent;
  transition: color 100ms ease, border-color 100ms ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ot-article-nav a:hover {
  color: var(--ot-nav-hover, #343a40);
  text-decoration: none;
}

.ot-article-page .ot-article-nav a.is-active,
.ot-article-nav a.is-active {
  font-weight: 600;
  color: var(--ot-nav-active-color, #0066cc) !important;
  border-left-color: var(--ot-nav-active-border, #0066cc) !important;
}

/* ==========================================================================
   8. Pill Strip — Vertical Right Edge (Section 2.3)
   ========================================================================== */

.ot-pill-strip {
  position: sticky;
  top: var(--ot-reading-anchor-top, 24px);
  transform: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  background: var(--ot-pill-bg, #ffffff);
  border-radius: 10px 0 0 10px;
  box-shadow: -1px 1px 6px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.04);
  z-index: 1001;
  align-self: start;
  height: fit-content;
}

.ot-pill-icon {
  width: 38px;
  height: 38px;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ot-pill-color, #495057);
  font-size: 16px;
  transition: background 120ms ease, color 120ms ease, box-shadow 120ms ease;
  font-family: inherit;
  padding: 0;
  position: relative;
}

.ot-pill-icon svg {
  width: 18px;
  height: 18px;
  color: inherit;
}

.ot-pill-icon:hover {
  background: var(--ot-pill-hover-bg, #e8f0fe);
  color: var(--ot-pill-hover-color, #0066cc);
  box-shadow: 0 0 0 1px rgba(0, 102, 204, 0.15);
}

.ot-pill-icon.is-active {
  background: var(--ot-pill-active-bg, #0066cc);
  color: var(--ot-pill-active-color, #ffffff);
  box-shadow: 0 1px 4px rgba(0, 102, 204, 0.3);
}

.ot-pill-icon[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
} 
.ot-sidebar-panel {
  position: fixed;
  top: 0;
  right: var(--ot-layout-right-offset, 0px);
  width: var(--ot-sidebar-width, 340px);
  height: 100vh;
  background: #ffffff;
  box-shadow: none;
  overflow-y: auto;
  overflow-x: hidden;
  transform: translateX(100%);
  transition: transform 200ms ease-out, box-shadow 200ms ease-out;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

/* Adjust sticky positions when WP admin bar is present (32px tall, position: fixed) */
body.admin-bar .ot-article-page {
  --ot-reading-anchor-top: 56px; /* 32px admin bar + 24px spacing */
}

/* Admin bar sidebar offset — desktop/medium only (mobile uses bottom drawer) */
@media (min-width: 768px) {
  body.admin-bar .ot-sidebar-panel {
    top: 32px;
    height: calc(100vh - 32px);
  }
}

.ot-sidebar-panel.is-open {
  transform: translateX(0);
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.1);
  z-index: 1002; /* Above pill strip (1001) when sidebar overlaps it */
}

/* When sidebar is open, fix pill strip to the LEFT of the sidebar panel
   with a consistent 8px gap.  Uses the same --ot-layout-right-offset so
   pill + sidebar move as one unit on resize.  'top' is set by JS to
   prevent a vertical jump when switching from sticky to fixed. */
.ot-sidebar-zone.is-sidebar-open .ot-pill-strip {
  position: fixed;
  /* top is set by JS — see open()/closeSidebar() in ot-article.js */
  right: calc(var(--ot-layout-right-offset, 0px) + var(--ot-sidebar-width, 340px) + 8px);
  left: auto;
  transition: right 200ms ease-out;
}

.ot-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--ot-border-color, #e9ecef);
  position: sticky;
  top: 0;
  background: #ffffff;
  z-index: 1;
  flex-shrink: 0;
}

.ot-sidebar-title {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #343a40;
  margin: 0;
}

.ot-sidebar-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 20px;
  color: #6c757d;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}

.ot-sidebar-close:hover {
  color: #343a40;
}

.ot-sidebar-content {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  padding: 0;
}

.ot-sidebar-drag-handle {
  display: none; /* Shown on mobile via media query */
}

/* ==========================================================================
   10. Accordion (Section 5.2)
   ========================================================================== */

.ot-accordion {
  border-bottom: 1px solid var(--ot-border-color, #e9ecef);
}

.ot-accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 16px 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #495057;
  font-family: inherit;
}

.ot-accordion-header:hover {
  background: #f8f9fa;
}

.ot-accordion-icon {
  width: 14px;
  height: 14px;
  transition: transform 200ms ease;
  color: #6c757d;
  flex-shrink: 0;
}

.ot-accordion.is-expanded .ot-accordion-icon {
  transform: rotate(180deg);
}

.ot-accordion-content {
  padding: 0 20px 16px;
  display: none;
  font-size: 13px;
  line-height: 1.55;
  animation: accordion-open 150ms ease-out;
}

.ot-accordion-content p,
.ot-accordion-content li,
.ot-accordion-content dd,
.ot-accordion-content input,
.ot-accordion-content button,
.ot-accordion-content a {
  font-size: inherit;
}

.ot-accordion.is-expanded .ot-accordion-content {
  display: block;
}

.ot-accordion.is-disabled .ot-accordion-header {
  opacity: 0.4;
  cursor: not-allowed;
}

@keyframes accordion-open {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes ot-highlight-pulse {
  0%   { background-color: var(--ot-highlight-bg, rgba(255, 213, 79, 0.4)); }
  100% { background-color: transparent; }
}

.ot-highlight-pulse {
  animation: ot-highlight-pulse 1.5s ease-out;
}

/* ==========================================================================
   11. Sidebar Content Sections (Section 5.6)
   ========================================================================== */

/* Info section */
.ot-info-list {
  margin: 0;
  padding: 0;
}

.ot-info-list dt {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--ot-info-label-color, #6c757d);
  margin-top: 12px;
}

.ot-info-list dt:first-child {
  margin-top: 0;
}

.ot-info-list dd {
  margin: 2px 0 0 0;
  font-size: 14px;
  color: var(--ot-info-value-color, #333);
}

.ot-info-subhead {
  font-size: 12px;
  font-weight: 600;
  color: var(--ot-info-subhead-color, #333);
  margin: 16px 0 4px;
  padding-top: 8px;
  border-top: 1px solid var(--ot-border-color, #e9ecef);
}

/* Figures section */
.ot-figure-entry {
  padding: 8px 0;
  border-bottom: 1px solid var(--ot-border-color, #e9ecef);
}

.ot-figure-entry-table {
  padding-top: 10px;
}

.ot-figure-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ot-figure-entry-table .ot-figure-header {
  gap: 6px;
}

.ot-figure-thumb {
  max-width: 100%;
  height: auto;
  max-height: 120px;
  object-fit: contain;
  border-radius: 4px;
  cursor: pointer;
}

.ot-figure-thumb-placeholder {
  width: 100%;
  height: 120px;
  border-radius: 4px;
  background: var(--ot-border-color, #e9ecef);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--ot-muted-color, #6c757d);
}

.ot-figure-thumb-placeholder svg {
  width: 28px;
  height: 28px;
}

.ot-figure-no-preview {
  font-size: 11px;
  color: var(--ot-muted-color, #6c757d);
  text-align: center;
  line-height: 1.3;
}

.ot-figure-content {
  flex: 1;
  min-width: 0;
}

.ot-figure-caption {
  font-size: 12px;
  color: var(--ot-caption-color, #555);
  word-break: break-word;
}

.ot-caption-text {
  display: inline;
}

.ot-caption-toggle {
  background: none;
  border: none;
  color: var(--ot-action-primary-bg, #0066cc);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  margin-left: 4px;
  font-family: inherit;
}

.ot-figure-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.ot-figure-link,
.ot-figure-link-external {
  font-size: 11px;
  color: var(--ot-action-primary-bg, #0066cc);
  text-decoration: none;
}

.ot-figure-link:hover,
.ot-figure-link-external:hover {
  text-decoration: underline;
}

/* References section */
.ot-ref-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ot-ref-entry {
  padding: 6px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
}

.ot-ref-text {
  display: inline;
}

.ot-ref-doi {
  display: block;
  font-size: 11px;
  color: var(--ot-action-primary-bg, #0066cc);
  margin-top: 2px;
}

.ot-icon-extlink,
.ot-icon-envelope {
  display: inline-block;
  vertical-align: middle;
}

/* Share & Cite section */
.ot-copy-link {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.ot-copy-link input[type="text"] {
  flex: 1;
  min-width: 0;
  padding: 4px 8px;
  font-size: 13px;
  border: 1px solid var(--ot-border-color, #ccc);
  border-radius: 4px;
  font-family: inherit;
}

.ot-copy-btn {
  padding: 4px 12px;
  font-size: 13px;
  border: 1px solid var(--ot-border-color, #ccc);
  border-radius: 4px;
  background: var(--ot-btn-secondary-bg, #f8f9fa);
  cursor: pointer;
  font-family: inherit;
}

.ot-cite-btns,
.ot-share-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.ot-cite-btn {
  padding: 4px 12px;
  font-size: 13px;
  border: 1px solid var(--ot-border-color, #ccc);
  border-radius: 4px;
  background: var(--ot-btn-secondary-bg, #f8f9fa);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  font-family: inherit;
}

.ot-share-btns a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: 13px;
  border: 1px solid var(--ot-border-color, #ccc);
  border-radius: 4px;
  background: var(--ot-btn-secondary-bg, #f8f9fa);
  text-decoration: none;
  color: inherit;
}

.ot-share-label {
  white-space: nowrap;
}

.ot-share-btns a:hover {
  background: var(--ot-border-color, #e9ecef);
}

.ot-share-btns svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Author entries in sidebar */
.ot-author-entry {
  padding: 8px 0;
  border-bottom: 1px solid var(--ot-border-color, #f0f0f0);
}

.ot-author-entry:last-child {
  border-bottom: none;
}

.ot-author-entry-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--ot-body-color, #212529);
}

.ot-author-entry-aff {
  font-size: 12px;
  color: var(--ot-muted-color, #6c757d);
  margin-top: 2px;
}

.ot-author-entry-roles {
  font-size: 11px;
  color: var(--ot-muted-color, #6c757d);
  margin-top: 2px;
}

.ot-author-entry-corresponding {
  display: inline-block;
  margin-left: 4px;
  font-size: 13px;
  cursor: help;
}

.ot-author-entry-orcid,
.ot-author-entry-email {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  margin-top: 2px;
}

.ot-author-entry-orcid a,
.ot-author-entry-email a {
  color: var(--ot-link-color, #0066cc);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ot-author-entry-orcid a:hover,
.ot-author-entry-email a:hover {
  text-decoration: underline;
}

.ot-author-entry-orcid svg,
.ot-author-entry-email svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Core Data links */
.ot-sidebar-core-data {
  padding: 12px 20px;
  font-size: 12px;
  color: var(--ot-muted-color, #6c757d);
  border-top: 1px solid var(--ot-border-color, #e9ecef);
}

.ot-sidebar-core-data a {
  color: var(--ot-link-color, #0066cc);
  text-decoration: none;
}

.ot-sidebar-core-data a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   12. Lightbox (Section 5.7)
   ========================================================================== */

.ot-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.ot-lightbox[hidden] {
  display: none;
}

.ot-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  animation: ot-lightbox-fade 150ms ease-out;
}

@keyframes ot-lightbox-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.ot-lightbox-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 90vw;
  max-height: 85vh;
  animation: ot-lightbox-scale 200ms ease-out;
}

@keyframes ot-lightbox-scale {
  from { transform: scale(0.9); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.ot-lightbox-img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 4px;
}

.ot-lightbox-caption {
  color: #ffffff;
  font-size: 14px;
  margin-top: 12px;
  text-align: center;
  max-width: 80vw;
}

.ot-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  color: #ffffff;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 100ms ease;
  font-family: inherit;
}

.ot-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.ot-figure-lightbox-btn {
  background: none;
  border: none;
  color: var(--ot-action-primary-bg, #0066cc);
  font-size: 11px;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  font-family: inherit;
}

.ot-figure-lightbox-btn:hover {
  text-decoration: underline;
}

/* ==========================================================================
   13. Backdrop Overlay — Mobile only (Section 5.5)
   ========================================================================== */

.ot-sidebar-backdrop {
  display: none;
}

/* ==========================================================================
   14. Footer Metadata (Section 10.4)
   ========================================================================== */

.ot-footer-metadata {
  padding-top: 32px;
  padding-bottom: 32px;
  border-top: 2px solid var(--ot-border-color, #e9ecef);
  margin-top: 48px;
}

.ot-footer-metadata-section {
  margin-bottom: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--ot-border-color, #e9ecef);
}

.ot-footer-metadata-section:first-child {
  border-top: none;
  padding-top: 0;
}

.ot-footer-metadata-section:last-child {
  margin-bottom: 0;
}

.ot-footer-metadata-section h3 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ot-footer-heading-color, #495057);
  margin: 0 0 8px;
}

.ot-footer-metadata-section p,
.ot-footer-metadata-section ul {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ot-footer-text-color, #333);
  margin: 0;
}

/* ==========================================================================
   15. Table Rendering (Section 10.5)
   ========================================================================== */

.ot-table-wrapper {
  overflow-x: auto;
  margin: 1.5em 0;
  -webkit-overflow-scrolling: touch;
}

.ot-table-wrapper table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  border: 1px solid #dee2e6;
}

.ot-table-wrapper th {
  background: #e9ecef;
  font-weight: 600;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid #dee2e6;
  color: #212529;
}

.ot-table-wrapper td {
  padding: 8px 12px;
  border: 1px solid #dee2e6;
  vertical-align: top;
}

.ot-table-wrapper tr:nth-child(even) {
  background: #f8f9fa;
}

.ot-table-wrapper tr:hover {
  background: #e2e6ea;
}

.ot-table-wrapper caption {
  caption-side: top;
  text-align: left;
  font-size: 14px;
  color: #212529;
  padding: 10px 0;
  font-weight: 700;
}

.ot-table-footnotes {
  font-size: 12px;
  color: var(--ot-muted-color, #6c757d);
  padding: 8px 0;
}

/* ==========================================================================
   16. JATS Semantic HTML — Migrated from getSharedArticleCss()
   Dual selectors: .ot-article-content and .ot-viewer-content
   ========================================================================== */

/* Article structure */
.ot-article-content .jats-article,
.ot-viewer-content .jats-article { width: 100%; }

.ot-article-content .jats-front,
.ot-viewer-content .jats-front { margin-bottom: 24px; }

.ot-article-content .jats-body,
.ot-viewer-content .jats-body { margin-bottom: 24px; }

.ot-article-content .jats-back,
.ot-viewer-content .jats-back { border-top: 1px solid #e5e5e5; padding-top: 24px; margin-top: 24px; }

/* Title and headings */
.ot-article-content .jats-title,
.ot-viewer-content .jats-title {
  margin: 0 0 16px 0 !important;
  font-size: var(--ot-h1-size, 30px) !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
  color: var(--ot-heading-color, #1a1a1a) !important;
  letter-spacing: normal !important;
  text-transform: none !important;
}

.ot-article-content .jats-section h2,
.ot-viewer-content .jats-section h2 {
  font-size: var(--ot-h2-size, 23px) !important;
  font-weight: 600 !important;
  margin: 38px 0 14px 0 !important;
  color: var(--ot-heading-color, #1a1a1a) !important;
  letter-spacing: normal !important;
  text-transform: none !important;
}

.ot-article-content .jats-section h3,
.ot-viewer-content .jats-section h3 {
  font-size: var(--ot-h3-size, 19px) !important;
  font-weight: 600 !important;
  margin: 20px 0 10px 0 !important;
  color: var(--ot-heading-color, #1a1a1a) !important;
}

/* Contributors (authors, affiliations) */
.ot-article-content .jats-contributors,
.ot-viewer-content .jats-contributors { margin: 0 0 20px 0; font-size: 15px; line-height: 1.6; }

.ot-article-content .jats-authors,
.ot-viewer-content .jats-authors { margin-bottom: 8px; }

.ot-article-content .jats-author,
.ot-viewer-content .jats-author { color: var(--ot-heading-color, #1a1a1a); display: inline; }

.ot-article-content .jats-aff-marker,
.ot-viewer-content .jats-aff-marker { font-size: 11px; color: var(--ot-link-color, #0066cc); margin: 0 1px; }

.ot-article-content .jats-corresp-marker,
.ot-viewer-content .jats-corresp-marker { font-size: 11px; color: #d63638; }

.ot-article-content .jats-equal-marker,
.ot-viewer-content .jats-equal-marker { font-size: 11px; color: #6f42c1; }

.ot-article-content .jats-deceased-marker,
.ot-viewer-content .jats-deceased-marker { font-size: 11px; color: #50575e; }

.ot-article-content .jats-affiliations,
.ot-viewer-content .jats-affiliations { font-size: 13px; color: #50575e; margin-bottom: 8px; }

.ot-article-content .jats-affiliation,
.ot-viewer-content .jats-affiliation { margin: 2px 0; }

.ot-article-content .jats-author-notes,
.ot-viewer-content .jats-author-notes { font-size: 13px; color: #50575e; margin-top: 8px; padding-top: 8px; border-top: 1px solid #eee; }

.ot-article-content .jats-orcid,
.ot-viewer-content .jats-orcid { vertical-align: middle; margin-left: 2px; }

.ot-article-content .jats-orcid-icon,
.ot-viewer-content .jats-orcid-icon { vertical-align: middle; }

/* Abstract — inherits card styling from .ot-article-abstract parent */
.ot-article-content .jats-abstract,
.ot-viewer-content .jats-abstract { margin: 0 0 8px 0; padding: 0; background: transparent; border-radius: 0; }

/* Remove bottom margin from last paragraph in abstract */
.ot-article-content .jats-abstract > .jats-para:last-child,
.ot-viewer-content .jats-abstract > .jats-para:last-child,
.ot-article-content .jats-abstract > p:last-child,
.ot-viewer-content .jats-abstract > p:last-child { margin-bottom: 0; }

/* Remove bottom margin from last paragraph in abstract subsection */
.ot-article-content .jats-abstract-subsection > .jats-para:last-child,
.ot-viewer-content .jats-abstract-subsection > .jats-para:last-child,
.ot-article-content .jats-abstract-subsection > p:last-child,
.ot-viewer-content .jats-abstract-subsection > p:last-child { margin-bottom: 0; }

.ot-article-content .jats-abstract h2,
.ot-viewer-content .jats-abstract h2 { margin: 0 0 2px 0 !important; font-size: 16px !important; font-weight: 600 !important; color: var(--ot-heading-color, #1a1a1a) !important; }

/* Abstract subsections (e.g., IMPORTANCE) */
.ot-article-content .jats-abstract-subsection,
.ot-viewer-content .jats-abstract-subsection { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--ot-abstract-separator-color, #dee2e6); }

.ot-article-content .jats-abstract-subsection-title,
.ot-viewer-content .jats-abstract-subsection-title { margin: 0 0 6px 0 !important; font-size: 14px !important; font-weight: 700 !important; text-transform: uppercase !important; letter-spacing: 0.5px !important; color: var(--ot-heading-color, #1a1a1a) !important; }

/* Section depth classes — 32px inter-section gap matching PNAS (Design Pattern 6) */
.ot-article-content .jats-section-top,
.ot-viewer-content .jats-section-top { margin-top: 32px; margin-bottom: 0; }

/* Adjacent body sections: no extra padding (margins alone provide the 32px gap) */
.ot-article-content .jats-section-top + .jats-section-top,
.ot-viewer-content .jats-section-top + .jats-section-top {
  padding-top: 0;
}

/* First h2 in a top-level section needs no extra top margin;
   the section's margin-top handles inter-section spacing. */
.ot-article-content .jats-section-top > h2:first-child,
.ot-viewer-content .jats-section-top > h2:first-child { margin-top: 0 !important; }

.ot-article-content .jats-section-sub,
.ot-viewer-content .jats-section-sub { margin-left: 0; margin-bottom: 16px; }

.ot-article-content .jats-section-deep,
.ot-viewer-content .jats-section-deep { margin-left: 0; margin-bottom: 12px; }

/* h4 styling for deep sections */
.ot-article-content .jats-section h4,
.ot-viewer-content .jats-section h4 {
  font-size: var(--ot-h4-size, 16px) !important;
  font-weight: 600 !important;
  font-style: italic;
  margin: 16px 0 8px 0 !important;
  color: var(--ot-heading-color, #1a1a1a) !important;
}

/* History and permissions */
.ot-article-content .jats-history,
.ot-viewer-content .jats-history { font-size: 13px; color: #50575e; margin: 12px 0; }

.ot-article-content .jats-history-date,
.ot-viewer-content .jats-history-date { margin-right: 16px; }

.ot-article-content .jats-permissions,
.ot-viewer-content .jats-permissions { font-size: 13px; color: #50575e; margin: 12px 0; }

.ot-article-content .jats-copyright,
.ot-viewer-content .jats-copyright { margin-right: 8px; }

/* Paragraphs, lists, inline elements */
.ot-article-content .jats-para,
.ot-viewer-content .jats-para { margin: 0 0 16px 0; }

.ot-article-content .jats-list,
.ot-viewer-content .jats-list { margin: 0 0 16px 0; padding-left: 24px; }

.ot-article-content .jats-list-bullet,
.ot-viewer-content .jats-list-bullet { list-style-type: disc; }

.ot-article-content .jats-list-order,
.ot-viewer-content .jats-list-order { list-style-type: decimal; }

.ot-article-content .jats-monospace,
.ot-viewer-content .jats-monospace { font-family: monospace; background: #f6f7f7; padding: 2px 4px; border-radius: 2px; }

/* Cross-references */
.ot-article-content .jats-xref-bibr,
.ot-viewer-content .jats-xref-bibr { color: var(--ot-link-color, #0066cc); text-decoration: none; }

.ot-article-content .jats-xref-bibr:hover,
.ot-viewer-content .jats-xref-bibr:hover { text-decoration: underline; }

.ot-article-content .jats-xref-fig,
.ot-viewer-content .jats-xref-fig { color: var(--ot-link-color, #0066cc); }

.ot-article-content .jats-xref-fn,
.ot-viewer-content .jats-xref-fn { font-size: 11px; vertical-align: super; color: var(--ot-link-color, #0066cc); }

/* Figures and tables */
.ot-article-content .jats-fig,
.ot-article-content .figure-wrap,
.ot-viewer-content .jats-fig,
.ot-viewer-content .figure-wrap { margin: 24px 0; text-align: center; }

.ot-article-content .jats-fig img,
.ot-article-content .figure-wrap img,
.ot-viewer-content .jats-fig img,
.ot-viewer-content .figure-wrap img { max-width: 100%; height: auto; cursor: zoom-in; }

.ot-article-content .jats-fig-caption,
.ot-article-content .jats-caption,
.ot-viewer-content .jats-fig-caption,
.ot-viewer-content .jats-caption { font-size: 14px; color: #50575e; margin-top: 8px; text-align: left; }

/* Table wrapper - ASM-style bordered container with caption/footer */
.ot-article-content .table-wrap,
.ot-article-content .jats-table-wrap,
.ot-viewer-content .table-wrap,
.ot-viewer-content .jats-table-wrap {
  margin: 24px 0;
  overflow-x: auto;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  background: #fff;
}

/* Table caption (figcaption) inside wrapper */
.ot-article-content .table-wrap > figcaption,
.ot-article-content .jats-table-wrap > figcaption,
.ot-viewer-content .table-wrap > figcaption,
.ot-viewer-content .jats-table-wrap > figcaption {
  padding: 12px 16px;
  background: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  font-size: 14px;
  line-height: 1.5;
}

/* Table label (e.g., "TABLE 3") */
.ot-article-content .jats-table-label,
.ot-viewer-content .jats-table-label {
  font-weight: 700;
  text-transform: uppercase;
  color: #212529;
  display: block;
  margin-bottom: 4px;
}

/* Table caption text */
.ot-article-content .jats-table-caption,
.ot-viewer-content .jats-table-caption {
  color: #495057;
  display: block;
}

.ot-article-content .table-wrap table,
.ot-article-content .jats-table-wrap table,
.ot-viewer-content .table-wrap table,
.ot-viewer-content .jats-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.ot-article-content .table-wrap th,
.ot-article-content .table-wrap td,
.ot-article-content .jats-table-wrap th,
.ot-article-content .jats-table-wrap td,
.ot-viewer-content .table-wrap th,
.ot-viewer-content .table-wrap td,
.ot-viewer-content .jats-table-wrap th,
.ot-viewer-content .jats-table-wrap td {
  padding: 10px 12px;
  border: 1px solid #dee2e6;
  text-align: left;
  vertical-align: top;
}

.ot-article-content .table-wrap th,
.ot-article-content .jats-table-wrap th,
.ot-viewer-content .table-wrap th,
.ot-viewer-content .jats-table-wrap th {
  background: #e9ecef;
  font-weight: 600;
  color: #212529;
}

.ot-article-content .table-wrap tbody tr:nth-child(even),
.ot-article-content .jats-table-wrap tbody tr:nth-child(even),
.ot-viewer-content .table-wrap tbody tr:nth-child(even),
.ot-viewer-content .jats-table-wrap tbody tr:nth-child(even) {
  background: #f8f9fa;
}

/* Table footer (footnotes) */
.ot-article-content .jats-table-wrap-foot,
.ot-viewer-content .jats-table-wrap-foot {
  padding: 12px 16px;
  background: #f8f9fa;
  border-top: 1px solid #dee2e6;
  font-size: 13px;
  color: #6c757d;
}

.ot-article-content .jats-table-fn,
.ot-viewer-content .jats-table-fn {
  display: flex;
  gap: 4px;
  margin: 4px 0;
  line-height: 1.5;
}

.ot-article-content .jats-table-fn p,
.ot-viewer-content .jats-table-fn p {
  margin: 0;
}

.ot-article-content .jats-table-fn .jats-fn-label,
.ot-viewer-content .jats-table-fn .jats-fn-label {
  font-weight: 600;
  color: #495057;
}

/* References */
.ot-article-content .references,
.ot-article-content .jats-ref-list,
.ot-viewer-content .references,
.ot-viewer-content .jats-ref-list { margin: 24px 0; }

.ot-article-content .references h2,
.ot-article-content .jats-ref-list h2,
.ot-viewer-content .references h2,
.ot-viewer-content .jats-ref-list h2 { font-size: 18px !important; font-weight: 600 !important; margin: 0 0 16px 0 !important; }

.ot-article-content .jats-ref,
.ot-viewer-content .jats-ref { margin: 8px 0; font-size: 14px; line-height: 1.6; }

.ot-article-content .jats-ref-label,
.ot-viewer-content .jats-ref-label { font-weight: 600; margin-right: 8px; }

/* Footnotes */
.ot-article-content .footnotes,
.ot-article-content .jats-fn-group,
.ot-viewer-content .footnotes,
.ot-viewer-content .jats-fn-group { margin: 24px 0; padding-top: 16px; border-top: 1px solid #e5e5e5; }

.ot-article-content .footnotes h2,
.ot-article-content .jats-fn-group h2,
.ot-viewer-content .footnotes h2,
.ot-viewer-content .jats-fn-group h2 { font-size: 16px !important; font-weight: 600 !important; margin: 0 0 12px 0 !important; }

.ot-article-content .jats-fn,
.ot-viewer-content .jats-fn { font-size: 13px; margin: 6px 0; }

.ot-article-content .jats-fn-label,
.ot-viewer-content .jats-fn-label { font-weight: 600; margin-right: 4px; }

/* Acknowledgments */
.ot-article-content .jats-ack,
.ot-viewer-content .jats-ack { margin: 24px 0; }

.ot-article-content .jats-ack h2,
.ot-viewer-content .jats-ack h2 { font-size: 16px !important; font-weight: 600 !important; margin: 0 0 8px 0 !important; }

/* Supplementary material */
.ot-article-content .jats-supplementary,
.ot-viewer-content .jats-supplementary { margin-top: 1.5em; }

.ot-article-content .jats-supplementary h2,
.ot-viewer-content .jats-supplementary h2 { font-size: 1.2em; margin-bottom: 0.5em; }

.ot-article-content .jats-supplementary-list,
.ot-viewer-content .jats-supplementary-list { list-style: none; padding: 0; }

.ot-article-content .jats-supplementary-item,
.ot-viewer-content .jats-supplementary-item { margin-bottom: 0.5em; }

.ot-article-content .jats-supplementary-link,
.ot-viewer-content .jats-supplementary-link { font-weight: 600; }

.ot-article-content .jats-supplementary-caption,
.ot-viewer-content .jats-supplementary-caption { display: block; color: #555; font-size: 0.9em; }

/* Figure borders and captions per Section 11.1 */
.ot-article-content .jats-fig,
.ot-viewer-content .jats-fig {
  border: 1px solid var(--ot-border-color, #e9ecef);
  border-radius: 8px;
  padding: 12px;
}

/* Reference hanging indent */
.ot-article-content .jats-ref,
.ot-viewer-content .jats-ref {
  padding-left: 2em;
  text-indent: -2em;
}

/* D3: Distinct section headings */
.ot-article-content h2 {
  font-size: var(--ot-h2-size, 23px);
  font-weight: 700;
  color: var(--ot-heading-color, #1a1a1a);
  margin: 32px 0 12px;
  padding-bottom: 6px;
}

.ot-article-content h3 {
  font-size: var(--ot-h3-size, 19px);
  font-weight: 600;
  color: var(--ot-heading-color, #1a1a1a);
  margin: 24px 0 8px;
}

.ot-article-content h4 {
  font-size: var(--ot-h4-size, 17px);
  font-weight: 600;
  color: var(--ot-heading-color, #1a1a1a);
  margin: 20px 0 6px;
}

/* D4: Abstract callout - tight spacing matching jats-abstract rules above */
.ot-article-content .jats-abstract {
  background: transparent;
  padding: 0 0 8px;
  border-radius: 0;
  margin: 0 0 8px;
}

/* Reset subsection - no extra padding/background from D4 wildcard */
.ot-article-content .jats-abstract-subsection {
  background: transparent;
  padding: 12px 0 0;
  margin: 12px 0 0;
  border-radius: 0;
}

/* D2: Metadata labels */
.ot-info-list dt {
  font-size: 11px;
}

/* ==========================================================================
   17. Responsive — Wide Desktop >=1200px (Section 4.2)
   ========================================================================== */

@media (min-width: 1200px) {
  .ot-layout {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .ot-article-main {
    display: grid;
    grid-template-columns: var(--ot-nav-rail-width, 140px) 1fr;
    /* Explicit rows so the nav rail's grid-row: 1 / -1 spans ALL rows
       instead of only row 1 (which inflates the header row).  Extra
       rows beyond the actual child count collapse to 0. */
    grid-template-rows: repeat(6, auto);
  }

  .ot-article-main > .ot-article-header,
  .ot-article-main > .ot-action-bar,
  .ot-article-main > .ot-article-content,
  .ot-article-main > .ot-article-references,
  .ot-article-main > .ot-footer-metadata {
    grid-column: 2;
  }

  .ot-article-nav {
    display: block;
    position: sticky;
    top: var(--ot-reading-anchor-top, 24px);
    height: fit-content;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    overflow-x: hidden;
    grid-column: 1;
    grid-row: 1 / -1;
  }

  .ot-pill-bar {
    display: none;
  }

  .ot-section-overlay {
    display: none;
  }

  .ot-nav-toggle {
    display: none;
  }

  /* Sidebar open at >=1200px: sidebar is always anchored 8px to the
     right of the pill strip via --ot-layout-right-offset (JS-computed).
     When the viewport is wide enough, the sidebar fits in the margin
     without overlapping content.  When not, offset = 0 and the sidebar
     floats at the viewport right edge over the content. */
}

/* ==========================================================================
   18. Responsive — Medium Desktop 768-1199px (Section 4.3)
   ========================================================================== */

@media (min-width: 768px) and (max-width: 1199px) {
  .ot-layout {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  /* #21: Nav hidden by default at medium, shown via toggle */
  .ot-article-nav {
    display: none;
  }

  .ot-article-nav.is-nav-open {
    display: block;
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    max-width: 200px;
    padding: 12px 12px 12px 8px;
    background: white;
    border-radius: 0 8px 8px 0;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
    z-index: 998;
    font-size: 11px;
    overflow-y: auto;
    max-height: 60vh;
  }

  .ot-article-nav.is-nav-open a {
    padding: 4px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-left-width: 2px;
  }

  /* #16: Show pill strip at medium viewport */
  .ot-pill-strip {
    display: flex;
  }

  .ot-pill-bar {
    display: none;
  }

  .ot-section-overlay {
    display: none;
  }

  .ot-sidebar-panel {
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  }

  .ot-sidebar-backdrop {
    display: none;
  }

  /* Nav toggle button (#21) */
  .ot-nav-toggle {
    display: flex;
    position: fixed;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 997;
    background: white;
    border: 1px solid #dcdcde;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    color: #495057;
  }

  .ot-nav-toggle:hover {
    background: #f0f0f1;
  }
}

/* ==========================================================================
   19. Responsive — Mobile <768px (Section 4.4)
   ========================================================================== */

@media (max-width: 767px) {
  /* Prevent horizontal scroll on mobile */
  .ot-article-page,
  .ot-layout,
  .ot-article-main {
    max-width: 100vw;
    overflow-x: hidden;
  }

  .ot-article-nav {
    display: none;
  }

  .ot-nav-toggle {
    display: none;
  }

  .ot-pill-strip {
    display: none;
  }

  .ot-pill-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 2px;
    padding: 6px 8px;
    background: var(--ot-pill-bar-bg, rgba(255, 255, 255, 0.97));
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    z-index: 999;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* Visible from page load per spec guidance */
  }

  .ot-pill-bar.is-hidden {
    transform: translateY(100%);
    transition: transform 200ms ease-out;
  }

  .ot-pill-bar-toggle {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--ot-pill-color, #6c757d);
    font-family: inherit;
  }

  .ot-nav-pill {
    white-space: nowrap;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--ot-pill-color, #6c757d);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-family: inherit;
  }

  .ot-nav-pill svg {
    width: 20px;
    height: 20px;
  }

  .ot-nav-pill.is-active {
    background: var(--ot-pill-active-bg, #0066cc);
    color: var(--ot-pill-active-color, #ffffff);
  }

  .ot-nav-pill[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
  }

  /* Section navigation overlay */
  .ot-section-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--ot-overlay-bg, rgba(255, 255, 255, 0.98));
    z-index: 998;
    padding-top: 56px;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 200ms ease-out;
  }

  .ot-section-overlay.is-open {
    transform: translateX(0);
  }

  .ot-section-overlay a {
    display: block;
    padding: 12px 20px;
    min-height: 44px;
    font-size: 16px;
    color: var(--ot-nav-color, #333);
    text-decoration: none;
    border-left: 3px solid transparent;
  }

  .ot-section-overlay a.is-active {
    color: var(--ot-nav-active-color, #0066cc);
    border-left-color: var(--ot-nav-active-border, #0066cc);
    font-weight: 600;
  }

  .ot-section-overlay-list {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .ot-section-overlay-list li {
    margin: 0;
  }

  /* Backdrop */
  .ot-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
    z-index: 999;
  }

  .ot-sidebar-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
  }

  /* Bottom drawer sidebar */
  .ot-sidebar-panel {
    position: fixed;
    top: auto;
    right: auto;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60vh;
    max-height: 90vh;
    transform: translateY(100%);
    border-radius: 16px 16px 0 0;
    transition: transform 300ms cubic-bezier(0.32, 0.72, 0, 1);
    will-change: transform;
    touch-action: none;
  }

  .ot-sidebar-panel.is-open {
    transform: translateY(0);
  }

  .ot-sidebar-panel.is-dragging {
    transition: none;
  }

  .ot-sidebar-drag-handle {
    display: flex;
    width: 100%;
    padding: 12px 0 8px;
    justify-content: center;
    cursor: grab;
  }

  .ot-sidebar-drag-handle::after {
    content: '';
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: #ccc;
  }

  /* Action bar mobile: compact single row with icons */
  .ot-action-bar {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .ot-download-btn {
    padding: 6px 10px;
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .ot-download-btn-size {
    display: none; /* Hide file size on mobile to save space */
  }

  /* Link groups: compact on mobile */
  .ot-action-btn-group {
    flex-shrink: 0;
    gap: 10px;
  }

  .ot-action-btn-group .ot-view-link,
  .ot-action-btn-group .ot-download-link {
    font-size: 13px;
    white-space: nowrap;
  }

  .ot-action-btn-group .ot-view-link .ot-link-label,
  .ot-action-btn-group .ot-download-link .ot-link-label {
    display: none; /* Icon-only on small screens */
  }

  /* Cite/Share: icon-only on mobile */
  .ot-action-bar-btn-tertiary .ot-btn-label {
    display: none;
  }

  .ot-action-bar-btn {
    padding: 6px 8px;
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
  }
}

/* ==========================================================================
   20. Viewer Chrome (Admin Version Viewer)
   ========================================================================== */

.ot-viewer-wrap {
  max-width: 980px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid #c3c4c7;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.ot-viewer-header {
  padding: 20px;
  border-bottom: 1px solid #dcdcde;
  background: #f6f7f7;
}

.ot-viewer-header h1 {
  margin: 0 0 16px 0;
  font-size: 20px;
  font-weight: 600;
  color: #1d2327;
}

.ot-viewer-meta {
  font-size: 14px;
  color: #50575e;
  line-height: 1.8;
}

.ot-viewer-meta-row {
  margin: 4px 0;
}

.ot-viewer-meta-label {
  font-weight: 600;
  color: #1d2327;
  margin-right: 8px;
}

.ot-viewer-content {
  padding: 20px;
}

.ot-viewer-content img {
  max-width: 100%;
  height: auto;
}

.ot-viewer-actions {
  padding: 16px 20px;
  border-top: 1px solid #dcdcde;
  background: #f6f7f7;
}

.ot-viewer-actions a {
  display: inline-block;
  margin-right: 12px;
  padding: 6px 12px;
  background: #2271b1;
  color: #fff;
  text-decoration: none;
  border-radius: 3px;
  font-size: 13px;
  font-weight: 500;
}

.ot-viewer-actions a:hover {
  background: #135e96;
}

.ot-viewer-actions a.ot-action-secondary {
  background: #f6f7f7;
  color: #2271b1;
  border: 1px solid #2271b1;
}

.ot-viewer-actions a.ot-action-secondary:hover {
  background: #f0f0f1;
}

.ot-viewer-actions a.ot-action-danger {
  background: #d63638;
  border-color: #d63638;
}

.ot-viewer-actions a.ot-action-danger:hover {
  background: #b32d2e;
}

.ot-work-warning {
  margin: 12px 0 0 0;
  padding: 12px 16px;
  background: #fcf0f1;
  border: 1px solid #d63638;
  border-radius: 4px;
  color: #8a2424;
}

.ot-work-warning strong {
  color: #d63638;
}

/* Legacy compatibility — old shortcode wrapper classes */
.ot-article-wrap {
  max-width: 980px;
  margin: 0 auto;
  font-family: var(--ot-body-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif);
}

/* Old-style download buttons kept for compatibility */
.ot-downloads {
  margin-bottom: 16px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.ot-download-pdf {
  background: #dc3545;
  color: #fff;
}

.ot-download-pdf:hover {
  background: #c82333;
  color: #fff;
}

.ot-download-epub {
  background: #6f42c1;
  color: #fff;
}

.ot-download-epub:hover {
  background: #5a32a3;
  color: #fff;
}

.ot-article-toolbar {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #e5e5e5;
}

.ot-article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 14px;
  color: #50575e;
}

.ot-article-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ot-article-meta-label {
  font-weight: 600;
  color: #1d2327;
}

/* ==========================================================================
   Admin Viewer: Action Header (Spec Section 7.2-7.3)
   ========================================================================== */

.ot-admin-viewer {
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.ot-admin-viewer .ot-article-page {
  max-width: 100%;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}

.ot-admin-viewer .ot-article-content [id],
.ot-admin-viewer .ot-article-references [id],
.ot-admin-viewer .ot-footer-metadata [id] {
  scroll-margin-top: calc(var(--ot-viewer-header-offset, 0px) + 12px);
}

/* Pill strip and nav rail account for viewer header in admin viewer */
.ot-admin-viewer .ot-pill-strip {
  top: calc(var(--ot-viewer-header-offset, 0px) + 16px);
}

.ot-admin-viewer .ot-article-nav {
  top: calc(var(--ot-viewer-header-offset, 0px) + 16px);
  max-height: calc(100vh - var(--ot-viewer-header-offset, 0px) - 48px);
}

.ot-admin-viewer .ot-layout {
  max-width: var(--ot-page-max-width, 1100px);
}

/* Admin viewer: header and action bar use same max-width as content */

.ot-admin-viewer .ot-article-content,
.ot-admin-viewer .ot-article-references,
.ot-admin-viewer .ot-footer-metadata {
  max-width: var(--ot-content-shell-max-width, calc(var(--ot-content-max-width, 780px) + 32px));
}

.ot-viewer-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #1d2327;
  color: #fff;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: padding 180ms ease-out, box-shadow 180ms ease-out;
}

.ot-viewer-header-inner {
  max-width: calc(var(--ot-page-max-width, 1100px) + 32px);
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}

.ot-viewer-header.is-collapsed {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.ot-viewer-header.is-collapsed .ot-viewer-header-inner {
  padding: 4px 16px;
  gap: 4px 16px;
  flex-wrap: nowrap;
  overflow: hidden;
}

.ot-viewer-header.is-expanded {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.ot-viewer-header.is-measuring {
  overflow: hidden;
}

.ot-viewer-header.is-measuring .ot-viewer-header-actions {
  display: flex !important;
}

.ot-viewer-header-info {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
}

.ot-viewer-header-summary {
  min-width: 0;
  flex: 1 1 auto;
}

.ot-viewer-header-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  flex: 0 0 auto;
}

.ot-viewer-header-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  justify-content: flex-end;
}

.ot-viewer-title {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 6px 0;
  color: #fff;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.ot-viewer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.ot-badge {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  white-space: nowrap;
}

.ot-badge-status {
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ot-badge-draft {
  background: #d63638;
}

.ot-badge-live {
  background: #00a32a;
}

.ot-badge-removed,
.ot-badge-inactive {
  background: #72777c;
}

.ot-badge-warning {
  background: #dba617;
  color: #1d2327;
}

.ot-badge-pid {
  font-family: monospace;
  font-size: 11px;
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ot-viewer-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  cursor: pointer;
}

.ot-viewer-toggle[hidden] {
  display: none;
}

.ot-viewer-toggle-icon {
  width: 16px;
  height: 16px;
  transition: transform 160ms ease;
}

.ot-viewer-header.is-expanded .ot-viewer-toggle-icon {
  transform: rotate(180deg);
}

.ot-viewer-toggle:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
}

.ot-viewer-toggle:disabled {
  opacity: 1;
}

.ot-action-btn {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
  line-height: 1;
  box-sizing: border-box;
}

.ot-action-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.7);
  color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.ot-action-primary {
  background: var(--ot-action-primary-bg, #2271b1);
  border-color: var(--ot-action-primary-bg, #2271b1);
}

.ot-action-primary:hover {
  background: var(--ot-action-primary-hover, #135e96);
  color: #fff;
}

.ot-action-promote {
  background: #00a32a;
  border-color: #00a32a;
}

.ot-action-promote:hover {
  background: #008a20;
  color: #fff;
}

.ot-action-danger {
  background: transparent;
  border-color: #d63638;
  color: #ffb3b3;
}

.ot-action-danger:hover {
  background: #d63638;
  border-color: #d63638;
  color: #fff;
}



/* R6: Compact viewer header at desktop */
@media (min-width: 768px) {
  .ot-viewer-title {
    margin-bottom: 2px;
  }

  .ot-action-btn {
    height: 26px;
    padding: 0 10px;
    font-size: 11px;
    white-space: nowrap;
  }
}

.ot-viewer-header.is-collapsed .ot-viewer-header-info {
  align-items: center;
}

.ot-viewer-header.is-collapsed .ot-viewer-title {
  margin: 0;
  font-size: 12px;
  line-height: 1.2;
}

.ot-viewer-header.is-collapsed .ot-viewer-badges {
  flex-wrap: nowrap;
  overflow: hidden;
}

.ot-viewer-header.is-collapsed .ot-badge {
  font-size: 10px;
  padding: 2px 6px;
}

.ot-viewer-header.is-collapsed .ot-badge-pid {
  max-width: 210px;
}

.ot-viewer-header.is-mobile-controls.is-collapsed .ot-badge-pid {
  display: none;
}

.ot-viewer-header.is-collapsed .ot-viewer-header-controls {
  display: none;
}

.ot-viewer-header.is-collapsed .ot-viewer-header-actions {
  display: none;
}

.ot-viewer-header.is-stacked .ot-viewer-header-inner {
  /* Flexbox wrapping handles the stacked layout naturally */
}

.ot-viewer-header.is-stacked .ot-viewer-header-controls {
  width: 100%;
  justify-content: flex-start;
}

.ot-viewer-header.is-stacked .ot-viewer-header-actions {
  justify-content: flex-start;
}

.ot-viewer-header.is-mobile-controls .ot-viewer-header-actions {
  flex-direction: column;
  width: 100%;
}

.ot-viewer-header.is-mobile-controls .ot-action-btn {
  text-align: center;
  white-space: normal;
}

/* Responsive action buttons (Section 7.2) */
@media (max-width: 1199px) {
  .ot-viewer-header-actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 767px) {
  .ot-viewer-header-info {
    padding: 10px 16px;
  }

  .ot-action-btn {
    text-align: center;
    padding: 7px 16px;
    font-size: 13px;
    white-space: normal;
  }
}

/* Copy button feedback */
.ot-copy-btn.ot-copy-success {
  background: #00a32a;
  color: #fff;
  border-color: #00a32a;
}

.ot-copy-btn.ot-copy-fail {
  background: #d63638;
  color: #fff;
  border-color: #d63638;
}

/* ==========================================================================
   Phase 9 additions
   ========================================================================== */

/* #19: Persistent highlight on sidebar entries */
.ot-highlight-active {
  background: rgba(255, 235, 59, 0.18);
  border-left: 3px solid #c28a00;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(194, 138, 0, 0.12);
}

.ot-accordion.ot-highlight-active {
  background: rgba(255, 248, 196, 0.6);
  border-left-width: 4px;
  scroll-margin-top: 16px;
}

.ot-accordion.ot-highlight-active .ot-accordion-header {
  background: rgba(255, 243, 176, 0.72);
}

.ot-accordion.ot-highlight-active .ot-accordion-content {
  background: rgba(255, 252, 235, 0.96);
}

/* F6: Inline copy button for DOI in info sidebar */
.ot-copy-btn-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  color: var(--ot-link-color, #0066cc);
  vertical-align: middle;
  margin-left: 4px;
}

.ot-copy-btn-inline:hover {
  background: rgba(0, 102, 204, 0.1);
}

/* F9: Visually hidden class for screen-reader-only elements */
.ot-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* #21: Nav toggle button — visibility controlled per breakpoint (medium only) */

/* #4: Additional contributor IDs */
.ot-author-entry-contrib-id {
  font-size: 12px;
  color: #6c757d;
  margin: 2px 0;
}

/* #17: Ensure viewer pill bar/strip matches front-end */
.ot-admin-viewer .ot-pill-bar {
  z-index: 1001;
}

.ot-admin-viewer .ot-pill-strip {
  z-index: 1001;
}

/* ==========================================================================
   Cycle 3: Body References (Section 10.3)
   ========================================================================== */

.ot-article-references {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 2px solid var(--ot-border-color, #e9ecef);
}

.ot-article-references h2 {
  font-size: var(--ot-h2-size, 1.3em);
  font-weight: 600;
  color: var(--ot-heading-color, #1d2327);
  margin: 0 0 0.75em 0;
}

.ot-article-references ol {
  padding-left: 2em;
  margin: 0;
}

.ot-article-references .ot-body-ref-list.is-collapsed > li:nth-child(n+5) {
  display: none;
}

.ot-article-references li {
  font-size: var(--ot-body-size, 15px);
  line-height: 1.6;
  margin-bottom: 6px;
  word-break: break-word;
}

.ot-article-references a {
  color: var(--ot-action-primary-bg, #0066cc);
}

.ot-body-ref-controls {
  margin-top: 0.9em;
}

.ot-body-ref-toggle {
  appearance: none;
  border: 1px solid var(--ot-border-color, #d0d7de);
  border-radius: 999px;
  background: #fff;
  color: var(--ot-action-primary-bg, #0066cc);
  cursor: pointer;
  font: inherit;
  font-size: 0.95em;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.55em 0.95em;
}

.ot-body-ref-toggle:hover,
.ot-body-ref-toggle:focus-visible {
  border-color: var(--ot-action-primary-bg, #0066cc);
  outline: none;
}

/* Cycle 3: Sidebar reference formatting improvements */
.ot-ref-text em {
  font-style: italic;
}

.ot-ref-text {
  word-break: break-word;
}

.ot-ref-entry + .ot-ref-entry {
  margin-top: 2px;
}

/* Cycle 3: Figure thumbnail constraint */

/* =====================================================
   Scroll-to-top button
   Aligned horizontally with the pill strip; JS sets the
   left position dynamically.  Visible at ≥768px (same
   threshold as the pill strip).  On mobile (<768px) a
   duplicate lives inside the pill bar.
   ===================================================== */

.ot-scroll-top {
  position: fixed;
  bottom: 40px;
  z-index: 900;

  width: 36px;
  height: 36px;

  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: var(--ot-action-primary-bg, #0066cc);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  padding: 0;
}

.ot-scroll-top[hidden] {
  display: none;
}

.ot-scroll-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.ot-scroll-top:hover,
.ot-scroll-top:focus-visible {
  background: var(--ot-action-primary-hover, #0052a3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  outline: none;
}

.ot-scroll-top svg {
  width: 55%;
  height: 55%;
}

/* Hide the standalone scroll-to-top on mobile — pill bar has its own */
@media (max-width: 767px) {
  .ot-scroll-top {
    display: none;
  }
}

/* --- Mobile pill-bar scroll-to-top (circle matching desktop) --- */
.ot-pill-bar .ot-scroll-top-mobile {
  margin-left: auto;  /* push to far right */
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--ot-action-primary-bg, #0066cc);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  padding: 0;
}

.ot-pill-bar .ot-scroll-top-mobile svg {
  width: 20px;
  height: 20px;
}

.ot-pill-bar .ot-scroll-top-mobile:hover {
  background: var(--ot-action-primary-hover, #0052a3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* ===========================================================================
   Accessibility Audit — CVV Styles (Spec v0.8.0 §6.2.1, §6.3)
   Replicated from admin.css for the standalone Core Version Viewer page,
   which does not load admin.css.
   =========================================================================== */

/* --- Color Palette (§6.2.1.1) --- */
.ot-admin-viewer {
  --ot-status-pass: #1971C2;
  --ot-status-warning: #B45309;
  --ot-status-fail: #D84315;
  --ot-status-ai-review: #5C3D99;
  --ot-status-neutral: #666666;
}

/* --- Status Badges --- */
.ot-admin-viewer .ot-audit-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  color: #fff;
  background-color: var(--ot-status-neutral);
}

.ot-admin-viewer .ot-audit-badge--pass { background-color: var(--ot-status-pass); }
.ot-admin-viewer .ot-audit-badge--warning { background-color: var(--ot-status-warning); }
.ot-admin-viewer .ot-audit-badge--fail { background-color: var(--ot-status-fail); }
.ot-admin-viewer .ot-audit-badge--ai-review { background-color: var(--ot-status-ai-review); }
.ot-admin-viewer .ot-audit-badge--neutral { background-color: var(--ot-status-neutral); }

/* --- ♿ Toolbar Button (§6.2.1) — inherits .ot-action-btn base, status-colored border --- */
.ot-admin-viewer .ot-a11y-btn {
  /* Override only what differs from .ot-action-btn: status-colored borders */
  gap: 4px;
}

.ot-admin-viewer .ot-a11y-btn:hover { background: rgba(255, 255, 255, 0.22); border-color: rgba(255, 255, 255, 0.7); color: #fff; }
.ot-admin-viewer .ot-a11y-btn:focus { outline: 2px solid #2271b1; outline-offset: 1px; box-shadow: none; }
.ot-admin-viewer .ot-a11y-btn[data-ot-audit-status="pass"] { border-color: var(--ot-status-pass); color: var(--ot-status-pass); }
.ot-admin-viewer .ot-a11y-btn[data-ot-audit-status="fail"] { border-color: var(--ot-status-fail); color: var(--ot-status-fail); }
.ot-admin-viewer .ot-a11y-btn[data-ot-audit-status="warning"] { border-color: var(--ot-status-warning); color: var(--ot-status-warning); }
.ot-admin-viewer .ot-a11y-btn[data-ot-audit-status="ai-review"] { border-color: var(--ot-status-ai-review); color: var(--ot-status-ai-review); }
.ot-admin-viewer .ot-a11y-btn[data-ot-audit-status="running"] { border-color: var(--ot-status-pass); color: var(--ot-status-pass); opacity: 0.7; }
.ot-admin-viewer .ot-a11y-btn-label { font-size: 12px; }

/* --- Sidebar Shell --- */
.ot-admin-viewer .ot-audit-sidebar {
  position: fixed;
  top: 0;
  right: -340px;
  width: 340px;
  height: 100vh;
  background: #fff;
  border-left: 1px solid #c3c4c7;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.08);
  z-index: 9990;
  overflow-y: auto;
  transition: right 0.25s ease-in-out;
}

.ot-admin-viewer .ot-audit-sidebar.is-open { right: 0; }

.ot-admin-viewer .ot-audit-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #dcdcde;
  background: #f6f7f7;
}

.ot-admin-viewer .ot-audit-sidebar-header h2 { margin: 0; font-size: 14px; font-weight: 600; color: #1d2327; }

/* --- Sidebar Tabs --- */
.ot-admin-viewer .ot-audit-sidebar-tabs {
  display: flex;
  border-bottom: 1px solid #dcdcde;
  background: #f6f7f7;
}

.ot-admin-viewer .ot-audit-sidebar-tabs button {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  font-size: 13px;
  color: #50575e;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.ot-admin-viewer .ot-audit-sidebar-tabs button:hover { color: #1d2327; }
.ot-admin-viewer .ot-audit-sidebar-tabs button.is-active { color: #1d2327; border-bottom-color: var(--ot-status-pass); font-weight: 600; }

/* --- Ignored count badge next to "Show ignored" checkbox (#257) --- */
.ot-admin-viewer .ot-audit-ignored-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 6px;
  border-radius: 9px;
  background: #dba617;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  vertical-align: middle;
}

/* --- Sidebar Content --- */
.ot-admin-viewer .ot-audit-sidebar-content { padding: 16px; }

/* --- Close Button --- */
.ot-admin-viewer .ot-audit-sidebar-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #50575e;
  border-radius: 3px;
  transition: background 0.15s, color 0.15s;
}

.ot-admin-viewer .ot-audit-sidebar-close:hover { background: #dcdcde; color: #1d2327; }
.ot-admin-viewer .ot-audit-sidebar-close:focus { outline: 2px solid #2271b1; outline-offset: -2px; }

/* --- Summary Tab --- */
.ot-admin-viewer .ot-audit-summary { display: flex; flex-direction: column; gap: 16px; }
.ot-admin-viewer .ot-audit-summary-status { text-align: center; padding: 8px 0; }
.ot-admin-viewer .ot-audit-summary-status .ot-audit-badge { font-size: 14px; padding: 4px 16px; }
.ot-admin-viewer .ot-audit-summary-counts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.ot-admin-viewer .ot-audit-count {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 4px;
  background: #f6f7f7;
  font-size: 13px;
}

.ot-admin-viewer .ot-audit-count--fail { color: var(--ot-status-fail); }
.ot-admin-viewer .ot-audit-count--warning { color: var(--ot-status-warning); }
.ot-admin-viewer .ot-audit-count--ai-review { color: var(--ot-status-ai-review); }
.ot-admin-viewer .ot-audit-count--ignored { color: var(--ot-status-neutral); font-style: italic; }
.ot-admin-viewer .ot-audit-count-icon { font-size: 14px; }
.ot-admin-viewer .ot-audit-count-value { font-weight: 700; font-size: 16px; }
.ot-admin-viewer .ot-audit-count-label { font-size: 12px; }

.ot-admin-viewer .ot-audit-summary-tiers { font-size: 12px; color: #50575e; padding: 4px 0; border-top: 1px solid #f0f0f1; }
.ot-admin-viewer .ot-audit-tiers-label { font-weight: 600; }
.ot-admin-viewer .ot-audit-summary-timestamp { font-size: 12px; color: #50575e; }
.ot-admin-viewer .ot-audit-timestamp-label { font-weight: 600; }

.ot-admin-viewer .ot-audit-summary-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid #dcdcde;
}

.ot-admin-viewer .ot-audit-ai-optin {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #50575e;
  cursor: pointer;
}

.ot-admin-viewer .ot-audit-ai-optin input[type="checkbox"] { margin: 0; min-width: 16px; min-height: 16px; }

.ot-admin-viewer .ot-audit-run-btn {
  min-height: 44px;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  background: #2271b1;
  color: #fff;
  border: 1px solid #2271b1;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
}

.ot-admin-viewer .ot-audit-run-btn:hover { background: #135e96; border-color: #135e96; }
.ot-admin-viewer .ot-audit-run-btn:focus { outline: 2px solid #2271b1; outline-offset: 1px; }
.ot-admin-viewer .ot-audit-run-btn:disabled { opacity: 0.6; cursor: default; }

.ot-admin-viewer .ot-audit-run-spinner { float: none; margin: 0; }
.ot-admin-viewer .ot-audit-placeholder { color: var(--ot-status-neutral); font-style: italic; font-size: 13px; text-align: center; padding: 24px 0; }

/* --- Findings Tab --- */
.ot-admin-viewer .ot-findings-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
  align-items: center;
}

.ot-admin-viewer .ot-filter-group { flex: 1 1 auto; min-width: 0; }

.ot-admin-viewer .ot-filter-select {
  width: 100%;
  padding: 4px 6px;
  font-size: 12px;
  border: 1px solid #c3c4c7;
  border-radius: 3px;
  background: #fff;
  color: #1d2327;
}

.ot-admin-viewer .ot-filter-select:focus { border-color: #2271b1; box-shadow: 0 0 0 1px #2271b1; outline: none; }

.ot-admin-viewer .ot-findings-show-ignored {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #50575e;
  cursor: pointer;
  white-space: nowrap;
}

.ot-admin-viewer .ot-findings-show-ignored input[type="checkbox"] { margin: 0; }

.ot-admin-viewer .ot-findings-count {
  font-size: 12px;
  color: #50575e;
  font-weight: 600;
  margin-bottom: 6px;
  padding: 4px 0;
  border-bottom: 1px solid #f0f0f1;
}

/* Run report — checks performed */
.ot-admin-viewer .ot-audit-run-report {
  margin-bottom: 8px;
  font-size: 12px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  background: #f9f9f9;
}
.ot-admin-viewer .ot-audit-run-report > summary {
  padding: 6px 10px;
  cursor: pointer;
  font-weight: 600;
  color: #50575e;
  user-select: none;
}
.ot-admin-viewer .ot-audit-run-report > summary:hover { background: #f0f0f1; }
.ot-admin-viewer .ot-audit-run-report-list {
  margin: 0;
  padding: 4px 10px 8px 28px;
  list-style: disc;
}
.ot-admin-viewer .ot-audit-run-report-list li {
  margin-bottom: 3px;
  line-height: 1.4;
}
.ot-admin-viewer .ot-audit-run-report-list strong {
  color: #1d2327;
}

.ot-admin-viewer .ot-findings-list { display: flex; flex-direction: column; gap: 2px; }

/* AI provider unavailable consolidated disclosure (#256, #298) */
.ot-admin-viewer .ot-findings-ai-unavailable {
  margin: 0 0 8px;
}
.ot-admin-viewer .ot-findings-ai-unavailable-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  color: #5C3D99;
  background: #f3effb;
  border: 1px solid #d3c5e8;
  border-radius: 4px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.ot-admin-viewer .ot-findings-ai-unavailable-banner:hover {
  background: #ebe3f7;
}
.ot-admin-viewer .ot-findings-ai-unavailable-banner:focus {
  outline: 2px solid #5C3D99;
  outline-offset: -2px;
}
.ot-admin-viewer .ot-findings-ai-unavailable-chevron {
  flex-shrink: 0;
  font-size: 11px;
  line-height: 1;
}
.ot-admin-viewer .ot-findings-ai-unavailable-label {
  flex: 1;
}
.ot-admin-viewer .ot-findings-ai-unavailable-detail {
  margin-top: 6px;
  padding: 6px 0 0;
  border-top: 1px dashed #d3c5e8;
}
.ot-admin-viewer .ot-findings-ai-unavailable-section {
  margin-top: 8px;
}
.ot-admin-viewer .ot-findings-ai-unavailable-section:first-child {
  margin-top: 0;
}
.ot-admin-viewer .ot-findings-ai-unavailable-heading {
  margin: 0 0 4px;
  padding: 2px 4px;
  font-size: 12px;
  font-weight: 600;
  color: #5C3D99;
  text-transform: capitalize;
}
.ot-admin-viewer .ot-findings-ai-unavailable-section .ot-finding-item {
  margin-bottom: 2px;
}

.ot-admin-viewer .ot-finding-item { border: 1px solid #dcdcde; border-radius: 4px; background: #fff; transition: border-color 0.15s; }
.ot-admin-viewer .ot-finding-item:hover { border-color: #2271b1; }
.ot-admin-viewer .ot-finding-ignored { opacity: 0.6; }
.ot-admin-viewer .ot-finding-ignored:hover { opacity: 0.8; }

.ot-admin-viewer .ot-finding-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  color: #1d2327;
  min-height: 44px;
}

.ot-admin-viewer .ot-finding-summary:hover { background: #f6f7f7; }
.ot-admin-viewer .ot-finding-summary:focus { outline: 2px solid #2271b1; outline-offset: -2px; }

.ot-admin-viewer .ot-finding-sev-icon { flex-shrink: 0; font-size: 14px; }
.ot-admin-viewer .ot-finding-sev--fail { color: var(--ot-status-fail); }
.ot-admin-viewer .ot-finding-sev--warning { color: var(--ot-status-warning); }
.ot-admin-viewer .ot-finding-sev--ai_review { color: var(--ot-status-ai-review); }
.ot-admin-viewer .ot-finding-msg { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ot-admin-viewer .ot-finding-badges { display: flex; gap: 4px; flex-shrink: 0; }

.ot-admin-viewer .ot-finding-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.ot-admin-viewer .ot-finding-badge--layer { background: #e8f0fe; color: #174ea6; }
.ot-admin-viewer .ot-finding-badge--tier { background: #f0f0f1; color: #50575e; }
.ot-admin-viewer .ot-finding-badge--ignored { background: #f0f0f1; color: var(--ot-status-neutral); font-style: italic; }

.ot-admin-viewer .ot-finding-arrow { flex-shrink: 0; font-size: 10px; color: #8c8f94; transition: transform 0.15s; }

/* --- Finding Detail --- */
.ot-admin-viewer .ot-finding-detail {
  padding: 10px 12px 12px;
  border-top: 1px solid #f0f0f1;
  background: #fafafa;
  font-size: 13px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ot-admin-viewer .ot-finding-detail-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.ot-admin-viewer .ot-finding-detail-message { font-weight: 500; color: #1d2327; }

.ot-admin-viewer .ot-finding-detail-impact {
  background: #f6f7f7;
  border-left: 3px solid var(--ot-status-warning);
  padding: 8px 10px;
  border-radius: 0 4px 4px 0;
  font-size: 12px;
}

.ot-admin-viewer .ot-finding-detail-impact strong { display: block; margin-bottom: 2px; font-size: 12px; color: #50575e; }

.ot-admin-viewer .ot-finding-detail-xpath { font-size: 12px; }
.ot-admin-viewer .ot-finding-detail-xpath strong { display: block; margin-bottom: 2px; color: #50575e; }
.ot-admin-viewer .ot-finding-detail-xpath code {
  display: inline-block;
  background: #f0f0f1;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  word-break: break-all;
}

.ot-admin-viewer .ot-finding-detail-line { font-size: 11px; color: #8c8f94; }

/* Clickable source location — navigates to line in XML editor */
.ot-admin-viewer .ot-finding-goto-line {
  cursor: pointer;
  border-radius: 4px;
  padding: 4px 6px;
  margin: -4px -6px;
  transition: background 0.15s;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.ot-admin-viewer .ot-finding-goto-line:hover {
  background: #e8f0fe;
}
.ot-admin-viewer .ot-finding-goto-line:focus-visible {
  outline: 2px solid #2271b1;
  outline-offset: 1px;
}
.ot-admin-viewer .ot-finding-goto-icon {
  font-size: 14px;
  color: #2271b1;
  flex-shrink: 0;
}

.ot-admin-viewer .ot-finding-detail-guidance {
  background: #eef6ee;
  border-left: 3px solid #00a32a;
  padding: 8px 10px;
  border-radius: 0 4px 4px 0;
  font-size: 12px;
}

.ot-admin-viewer .ot-finding-detail-guidance strong { display: block; margin-bottom: 2px; color: #50575e; }
.ot-admin-viewer .ot-finding-detail-wcag,
.ot-admin-viewer .ot-finding-detail-rule { font-size: 12px; color: #50575e; }

.ot-admin-viewer .ot-finding-detail-ai {
  border: 1px solid #e8e0f0;
  background: #f8f5fc;
  border-radius: 4px;
  padding: 10px;
}

.ot-admin-viewer .ot-finding-detail-ai-header { font-weight: 600; color: var(--ot-status-ai-review); margin-bottom: 4px; font-size: 12px; }
.ot-admin-viewer .ot-finding-detail-confidence { font-weight: normal; color: #50575e; }
.ot-admin-viewer .ot-finding-detail-rationale { margin: 4px 0; font-size: 12px; color: #1d2327; }
.ot-admin-viewer .ot-finding-detail-disclaimer {
  margin: 6px 0 0;
  padding: 6px 8px;
  background: #fff3cd;
  border-radius: 3px;
  font-size: 11px;
  color: #856404;
  font-style: italic;
}

/* --- Ignore/Un-ignore Actions --- */
.ot-admin-viewer .ot-finding-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid #f0f0f1;
}

.ot-admin-viewer .ot-ignore-btn,
.ot-admin-viewer .ot-unignore-btn {
  font-size: 12px;
  color: var(--ot-status-neutral);
  text-decoration: underline;
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
}

.ot-admin-viewer .ot-ignore-btn:hover,
.ot-admin-viewer .ot-unignore-btn:hover { color: #1d2327; }
.ot-admin-viewer .ot-ignore-btn:focus,
.ot-admin-viewer .ot-unignore-btn:focus { outline: 2px solid #2271b1; outline-offset: 1px; }

.ot-admin-viewer .ot-ignore-confirm { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.ot-admin-viewer .ot-ignore-reason-input {
  padding: 4px 6px;
  font-size: 12px;
  border: 1px solid #c3c4c7;
  border-radius: 3px;
  width: 160px;
  max-width: 100%;
}

.ot-admin-viewer .ot-ignore-reason-input:focus { border-color: #2271b1; box-shadow: 0 0 0 1px #2271b1; outline: none; }
.ot-admin-viewer .ot-ignore-reason { font-size: 11px; color: #8c8f94; font-style: italic; }

.ot-admin-viewer .ot-ignore-confirm-btn,
.ot-admin-viewer .ot-ignore-cancel-btn {
  padding: 4px 10px;
  font-size: 12px;
  border: 1px solid #c3c4c7;
  border-radius: 3px;
  background: #f6f7f7;
  color: #1d2327;
  cursor: pointer;
  min-height: 28px;
}

.ot-admin-viewer .ot-ignore-confirm-btn:hover { background: #2271b1; color: #fff; border-color: #2271b1; }
.ot-admin-viewer .ot-ignore-cancel-btn:hover { background: #dcdcde; }

/* --- Snapshot Banner --- */
.ot-admin-viewer .ot-findings-snapshot-banner {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 4px;
  padding: 8px 12px;
  margin-bottom: 8px;
  font-size: 12px;
  color: #856404;
}

.ot-admin-viewer .ot-snapshot-back {
  font-size: 12px;
  color: #2271b1;
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
}

.ot-admin-viewer .ot-snapshot-back:hover { color: #135e96; }
.ot-admin-viewer .ot-snapshot-back:focus { outline: 2px solid #2271b1; outline-offset: 1px; }

/* --- History Tab --- */
.ot-admin-viewer .ot-history-list { display: flex; flex-direction: column; gap: 4px; }

.ot-admin-viewer .ot-history-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #dcdcde;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  color: #1d2327;
  transition: border-color 0.15s, background 0.15s;
  min-height: 44px;
}

.ot-admin-viewer .ot-history-entry:hover { border-color: #2271b1; background: #f0f7fc; }
.ot-admin-viewer .ot-history-entry:focus { outline: 2px solid #2271b1; outline-offset: -2px; }
.ot-admin-viewer .ot-history-info { flex: 1; min-width: 0; }
.ot-admin-viewer .ot-history-timestamp { font-weight: 600; font-size: 12px; margin-bottom: 2px; }
.ot-admin-viewer .ot-history-counts { font-size: 11px; color: #50575e; }
.ot-admin-viewer .ot-history-tiers { font-size: 11px; color: #8c8f94; }

/* --- Screen Reader Only --- */
.ot-admin-viewer .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Responsive (§6.5) --- */
@media screen and (max-width: 782px) {
  .ot-admin-viewer .ot-audit-sidebar { width: 100%; right: -100%; }
  .ot-admin-viewer .ot-audit-sidebar.is-open { right: 0; }
}
