/* Shared R&D chrome, using Jarvis portal's surface and typography tokens. */
:root {
  color-scheme: dark;
  --bg: #111112;
  --panel: #171718;
  --panel-2: #212123;
  --border: #29292b;
  --border-lit: #3b3b3e;
  --text: #e7e7e8;
  --muted: #99999f;
  --accent: #e5e5e7;
  --hover: #232325;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-underline-offset: 4px; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a:focus-visible, button:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
[hidden] { display: none !important; }
.muted, .intro, .document-meta { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; top: -100px; left: 16px; padding: 10px 16px; background: var(--accent); color: var(--bg); z-index: 1000; }
.skip-link:focus { top: 12px; }
.site-bar { min-height: 65px; padding: 14px 36px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 20px; font-size: 13px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 34px; border-radius: 5px; background: var(--accent); color: var(--bg); font-size: 14px; font-weight: 650; }
.library-header, main, footer { width: 100%; max-width: 1320px; margin: 0 auto; padding-inline: 42px; }
.library-header { padding-top: 42px; }
.heading-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.eyebrow { font-size: 10px; font-weight: 500; letter-spacing: .1em; color: var(--muted); margin: 0 0 12px; }
h1 { font-size: clamp(25px, 3vw, 32px); font-weight: 550; line-height: 1.2; letter-spacing: -.8px; margin: 0 0 12px; }
h2 { font-size: 17px; line-height: 1.4; font-weight: 500; margin: 0 0 16px; }
.intro { margin: 0; }
.badge, .tag { display: inline-block; border: 1px solid var(--border-lit); border-radius: 5px; padding: 4px 10px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--border); overflow-x: auto; padding: 4px 2px 0; }
.tab-btn { flex: none; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); padding: 11px 0 14px; font-size: 13px; }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { border-bottom-color: var(--accent); color: var(--text); }
main { padding-top: 28px; padding-bottom: 60px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.featured { display: flex; align-items: center; gap: 24px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 28px; margin-bottom: 36px; }
.document-mark { display: flex; flex: none; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 58px; height: 78px; border: 1px solid var(--border-lit); border-radius: 5px; color: var(--muted); font-size: 10px; }
.document-mark svg { width: 24px; height: 24px; color: var(--text); }
.featured-copy { flex: 1; min-width: 0; }
.featured .eyebrow { margin-bottom: 6px; }
.featured h2 { font-size: 20px; margin: 0 0 7px; }
.featured p:not(.eyebrow) { color: var(--muted); margin: 0 0 10px; max-width: 560px; }
.document-meta { font-size: 12px; }
.document-actions { display: flex; flex: none; flex-direction: column; gap: 12px; align-items: center; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 14px; min-height: 40px; padding: 8px 14px; border: 1px solid var(--border-lit); border-radius: 5px; background: var(--panel); text-decoration: none; font-size: 13px; }
.button:hover { background: var(--hover); }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.button.primary:hover { background: #fff; }
.text-link { font-size: 12px; color: var(--muted); text-decoration: none; }
.text-link:hover { color: var(--text); }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin: 0 0 16px; }
.section-heading h2 { margin: 0; }
.section-heading > span { font-size: 12px; }
.search-wrap, .pod-search-wrap { position: relative; margin-bottom: 20px; }
.search-wrap input, .pod-search-wrap input, #auth-input { width: 100%; min-height: 44px; border: 1px solid var(--border-lit); border-radius: 5px; background: var(--bg); color: var(--text); padding: 11px 14px 11px 40px; }
input::placeholder { color: var(--muted); }
.search-icon { position: absolute; top: 50%; left: 15px; transform: translateY(-50%); color: var(--muted); font-size: 20px; pointer-events: none; }
.pages { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.page-link { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 22px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; text-decoration: none; min-width: 0; }
.page-link:hover { background: var(--hover); border-color: var(--border-lit); }
.page-link > div { min-width: 0; }
.page-title { font-size: 15px; line-height: 1.45; font-weight: 500; overflow-wrap: anywhere; }
.page-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 10px; color: var(--muted); font-size: 11px; }
.page-path { overflow-wrap: anywhere; }
.tag { padding: 1px 6px; font-size: 10px; }
.arrow { flex: none; color: var(--muted); font-size: 18px; }
.no-results, .pod-no-results { display: none; padding: 28px; text-align: center; color: var(--muted); border: 1px dashed var(--border-lit); border-radius: 8px; }
.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; }
.pod-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pod-table th { background: var(--panel); text-align: left; font-weight: 500; color: var(--muted); font-size: 11px; white-space: nowrap; }
.pod-table th, .pod-table td { padding: 16px; border-bottom: 1px solid var(--border); }
.pod-table tr:last-child td { border-bottom: none; }
.pod-table tbody tr:hover { background: var(--panel); }
.ep-num, .ep-date-cell { color: var(--muted); white-space: nowrap; font-size: 12px; }
.ep-title-cell { min-width: 180px; }
.ep-tags { display: flex; flex-wrap: wrap; gap: 5px; min-width: 160px; }
.ep-chip { padding: 2px 6px; border: 1px solid var(--border); border-radius: 4px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.ep-actions { display: flex; align-items: center; gap: 10px; white-space: nowrap; font-size: 12px; }
.ep-listen-btn { padding: 5px 10px; border: 1px solid var(--border-lit); border-radius: 5px; text-decoration: none; }
.ep-listen-btn:hover { background: var(--hover); }
footer { border-top: 1px solid var(--border); padding-block: 24px; display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: 11px; }
#auth-overlay { position: fixed; inset: 0; background: var(--bg); display: grid; place-items: center; z-index: 999; padding: 24px; }
#auth-box { width: 100%; max-width: 340px; }
#auth-box .logo { color: var(--muted); font-size: 12px; margin-bottom: 20px; }
#auth-box h2 { font-size: 25px; }
#auth-input { padding-left: 14px; margin-bottom: 12px; }
#auth-btn { width: 100%; min-height: 42px; border: 0; border-radius: 5px; background: var(--accent); color: var(--bg); }
#auth-error { color: #fca5a5; min-height: 24px; margin-top: 10px; font-size: 12px; }
#auth-input.error { border-color: #fca5a5; }
.embedded .site-bar, .embedded footer { display: none; }
.embedded .library-header { padding-top: 32px; }
/* The document reader keeps its own useful title and navigation inside Jarvis. */
.reader-back { display: inline-block; color: var(--muted); text-decoration: none; font-size: 12px; margin-bottom: 24px; }
.reader-layout { display: grid; grid-template-columns: 235px minmax(0, 1fr); gap: 24px; }
.contents { padding: 20px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); align-self: start; }
.contents h2 { font-size: 14px; }
.contents a { display: flex; justify-content: space-between; gap: 10px; text-decoration: none; padding: 9px 8px; margin-inline: -8px; color: var(--muted); font-size: 12px; border-radius: 4px; }
.contents a:hover, .contents a[aria-current] { color: var(--text); background: var(--hover); }
.contents a span { flex: none; }
.reader-document { min-width: 0; }
.reader-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.reader-toolbar > div { display: flex; gap: 8px; }
.pdf-frame { width: 100%; height: 76vh; min-height: 500px; border: 1px solid var(--border-lit); border-radius: 8px; background: var(--panel); }
.reader-fallback { font-size: 12px; color: var(--muted); }
@media (max-width: 850px) {
  .library-header, main, footer { padding-inline: 24px; }
  .site-bar { padding-inline: 24px; }
  .featured { flex-wrap: wrap; }
  .document-actions { flex-direction: row; margin-left: 82px; }
  .reader-layout { grid-template-columns: 1fr; }
  .contents nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
}
@media (max-width: 600px) {
  .site-bar { padding: 12px 18px; }
  .site-bar > .muted, .brand .muted { display: none; }
  .library-header, main, footer { padding-inline: 18px; }
  .library-header { padding-top: 28px; }
  .heading-row { align-items: flex-start; flex-direction: column; gap: 14px; margin-bottom: 24px; }
  .tabs { gap: 22px; }
  .pages { grid-template-columns: 1fr; }
  .featured { padding: 20px; gap: 16px; }
  .document-mark { width: 46px; height: 66px; }
  .featured-copy { flex-basis: calc(100% - 62px); }
  .featured h2 { font-size: 18px; }
  .document-actions { margin-left: 0; flex-wrap: wrap; gap: 16px; }
  .featured-copy p:not(.eyebrow) { font-size: 12px; }
  .document-meta { font-size: 11px; }
  .page-link { padding: 20px; }
  footer { flex-wrap: wrap; }
  .contents { padding: 16px; }
  .pdf-frame { min-height: 420px; height: 70vh; }
}

/* Chronological document lists share a single readable row layout. */
.section-intro { color: var(--muted); margin: -4px 0 22px; }
.page-link { justify-content: flex-start; gap: 22px; padding: 16px 20px; }
.page-preview { flex: none; width: 180px; height: 116px; object-fit: cover; object-position: top; border: 1px solid var(--border-lit); border-radius: 5px; background: var(--bg); }
.page-preview.pdf-preview { object-fit: contain; background: #eee; }
.page-copy { flex: 1; }
.page-date { color: var(--text); white-space: nowrap; }
@media (max-width: 600px) {
  .page-link { padding: 12px; gap: 12px; }
  .page-preview { width: 96px; height: 74px; }
  .page-title { font-size: 13px; }
  .page-meta { gap: 4px 8px; margin-top: 7px; }
  .page-link > .arrow { display: none; }
}
