:root {
  color-scheme: light;
  --paper: #f8f8f1;
  --surface: #fffefa;
  --ink: #143333;
  --muted: #516660;
  --teal: #1c655c;
  --dark: #082c2e;
  --mint: #c5e9d1;
  --line: #dce5d9;
  --focus: #00796e;
  --gutter: max(clamp(20px, 6.25vw, 104px), env(safe-area-inset-left), env(safe-area-inset-right));
  --sans: 'DM Sans', 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --serif: 'Instrument Serif', Georgia, serif;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; padding-block: env(safe-area-inset-top) env(safe-area-inset-bottom); }
body:has(dialog[open]) { overflow: hidden; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
button:not(:disabled) { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, video:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}
[hidden] { display: none !important; }

.wrap { width: min(100% - 2 * var(--gutter), 1320px); margin-inline: auto; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link {
  position: absolute;
  z-index: 10;
  top: 0;
  left: var(--gutter);
  padding: 12px 18px;
  color: white;
  background: var(--dark);
  transform: translateY(-120%);
}
.skip-link:focus { transform: translateY(0); }

.site-header { background: var(--paper); }
.header-inner { min-height: 76px; display: flex; align-items: center; gap: clamp(24px, 5vw, 76px); }
.brand { display: inline-flex; align-items: center; flex: none; gap: 10px; font-size: 21px; font-weight: 700; letter-spacing: -.035em; }
.brand b { font-weight: 500; }
.brand-icon {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border-radius: 10px;
  color: #d7f1de;
  background: #104a43;
}
.brand-icon i { display: block; width: 15px; height: 12px; border: 1.4px solid currentColor; border-radius: 2px; }
.brand-icon i::after {
  content: '';
  display: block;
  width: 0;
  margin: 2px 0 0 5px;
  border-block: 3px solid transparent;
  border-left: 4px solid currentColor;
}
.navigation { display: flex; align-items: center; gap: 28px; color: var(--muted); font-size: 14px; font-weight: 600; }
.navigation:has(.nav-action:not([hidden])),
.header-inner:has(.header-account-status:not([hidden])) .navigation { flex-wrap: wrap; row-gap: 0; }
.navigation a, .nav-action { padding-block: 10px; white-space: nowrap; }
.nav-action { padding-inline: 0; border: 0; background: transparent; text-align: start; }
.navigation a:hover, .nav-action:hover, .site-footer a:hover { color: var(--teal); text-decoration: underline; text-underline-offset: 4px; }
.navigation .nav-library { color: var(--ink); }
.navigation span, .site-footer a span { margin-inline-start: 2px; }
.header-access { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; flex: none; }
.header-account-status { max-inline-size: 11rem; font-size: 13px; font-weight: 650; line-height: 1.3; text-align: end; overflow-wrap: anywhere; }
.auth-notice { color: #823427; background: #f8eae1; }
.auth-notice .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; padding-block: 12px; font-size: 14px; line-height: 1.45; }
.auth-notice p { margin: 0; }
.auth-notice a { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 14px;
  line-height: 1.15;
  font-weight: 700;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
.button-header { min-height: 40px; border-color: #cddacf; background: transparent; }
.button-header:hover, .button-outline:hover { border-color: #7baa98; background: #e9f1e5; }
.button-outline { border-color: #b8cdc0; background: transparent; }
.button-solid { color: white; background: #16594f; }
.button-solid:hover { background: #0d443d; }

.hero {
  position: relative;
  isolation: isolate;
  color: #fcfff4;
  background: #0b2a2c;
}
.hero::before, .hero::after { position: absolute; z-index: -1; inset: 0; content: ''; }
.hero::before { background: url('/videos/operating-room.jpg') 64% 49% / cover no-repeat; }
.hero::after { background: linear-gradient(90deg, #061e20e8 0%, #062124cc 34%, #07252648 67%, #08272815 100%); }
.hero-inner { display: flex; align-items: center; min-height: clamp(430px, 42vw, 576px); padding-block: 54px 66px; }
.hero-copy { width: min(100%, 590px); }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .135em; text-transform: uppercase; }
.hero-kicker { margin: 0 0 22px; color: #c8e5d5; }
.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(52px, 6.6vw, 101px);
  line-height: .94;
  letter-spacing: -.064em;
}
.hero h1 em { color: #c9e4d3; font-weight: 400; }
.hero-summary { max-width: 390px; margin: 24px 0 28px; color: #ebf5ec; font-size: clamp(15px, 1.3vw, 18px); line-height: 1.6; }
.button-hero { min-height: 49px; padding-inline: 19px; color: #143b33; background: var(--mint); }
.button-hero:hover { background: #e3f7e4; }
.button-hero:focus-visible { outline-color: white; }

.library { padding-block: clamp(42px, 5.8vw, 80px) clamp(52px, 6.5vw, 90px); scroll-margin-top: 24px; }
.library-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 26px; }
.section-kicker { margin: 0 0 9px; color: var(--teal); }
.library h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(38px, 4vw, 63px);
  line-height: 1;
  letter-spacing: -.053em;
}
.access-note { display: inline-flex; align-items: center; gap: 9px; flex: none; margin: 0 0 5px; color: var(--teal); font-size: 13px; font-weight: 700; }
.lock { position: relative; display: inline-block; flex: none; width: 12px; height: 9px; margin-top: 5px; border: 1.4px solid currentColor; border-radius: 2px; }
.lock::before {
  position: absolute;
  top: -7px;
  left: 1.3px;
  width: 6.5px;
  height: 6px;
  border: 1.4px solid currentColor;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  content: '';
}
.library-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(135px, 175px);
  grid-template-areas:
    "search sort"
    "facets facets"
    "collections collections"
    "topics topics"
    "results results";
  align-items: center;
  gap: 13px 12px;
  margin: 0 0 24px;
}
.search-field, .sort-field, .filter-field select {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}
.search-field { grid-area: search; min-width: 0; }
.sort-field { grid-area: sort; }
.sort-field { min-width: 0; }
.search-field input, .sort-field select {
  width: 100%;
  height: 44px;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
}
.search-field input { padding: 0 13px 0 43px; }
.search-field input::placeholder { color: var(--muted); }
.filter-field select, .sort-field select { width: 100%; min-width: 0; padding: 0 10px; color: var(--ink); text-overflow: ellipsis; }
.video-facets { grid-area: facets; display: flex; flex-wrap: wrap; gap: 9px 12px; }
.video-facets:not(:has(.filter-field:not([hidden]))) { display: none; }
.filter-field { display: grid; flex: 1 1 170px; gap: 4px; min-width: 0; max-width: 285px; color: var(--muted); font-size: 13px; font-weight: 700; }
.filter-field select { font-size: 16px; font-weight: 400; }
.search-icon { position: absolute; left: 15px; width: 13px; height: 13px; border: 1.5px solid var(--teal); border-radius: 50%; pointer-events: none; }
.search-icon::after { position: absolute; width: 6px; height: 1.5px; right: -5px; bottom: -2px; background: var(--teal); transform: rotate(48deg); content: ''; }
.tag-filter-section { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 12px; }
.tag-filter-section > p { flex: 0 0 78px; margin: 0; color: var(--muted); font-size: 13px; font-weight: 700; }
.tag-filters { display: flex; flex: 1 1 270px; min-width: 0; flex-wrap: wrap; align-items: center; gap: 7px; }
.collection-filters { grid-area: collections; }
.topic-filters { grid-area: topics; }
.tag-filters button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 5px 11px;
  border: 1px solid #b8cdc0;
  border-radius: 999px;
  background: var(--surface);
  color: var(--teal);
  font-size: 14px;
  font-weight: 700;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
.tag-filters button:hover { border-color: var(--teal); background: #e9f1e5; }
.tag-filters button[aria-pressed="true"] { border-color: var(--teal); background: var(--teal); color: white; }
.tag-count { opacity: .85; font-size: 12px; font-variant-numeric: tabular-nums; }
.topic-filters button {
  min-height: 34px;
  border-color: var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}
.topic-filters button[aria-pressed="true"] { background: #dbeee1; color: var(--dark); }
.more-topics {
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.library-results {
  grid-area: results;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 13px;
  padding-block: 8px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.applied-filters { display: flex; flex: 1 1 auto; flex-wrap: wrap; gap: 6px; min-width: 0; }
.applied-filters button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  max-width: 100%;
  padding: 3px 9px;
  border: 1px solid #c4dccc;
  border-radius: 6px;
  background: #e9f2e7;
  color: var(--dark);
  text-align: start;
  overflow-wrap: anywhere;
}
.applied-filters button:hover { background: #dbeee1; }
.applied-filters button span { flex: none; font-size: 17px; line-height: 1; }
.clear-filters {
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.results { margin: 0; font-weight: 700; }

.continue-watching {
  padding: clamp(12px, 2.3vw, 22px);
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #edf4ea;
}
.continue-watching h3 { margin: 0 0 12px; font-size: 19px; letter-spacing: -.02em; }
.continue-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 255px), 1fr));
  gap: 9px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.continue-item {
  display: flex;
  align-items: center;
  min-width: 0;
  border: 1px solid #d4e2d5;
  border-radius: 8px;
  background: var(--surface);
}
.continue-open {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 54px;
  padding: 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  text-align: start;
}
.continue-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #dfefe2;
  color: var(--teal);
}
.continue-details { display: grid; gap: 4px; min-width: 0; }
.continue-title { font-size: 14px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.continue-progress { color: var(--muted); font-size: 12px; }
.continue-progress:empty { display: none; }
.continue-remove {
  flex: none;
  width: 40px;
  height: 44px;
  margin-inline-end: 3px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 21px;
  line-height: 1;
}
.continue-open:hover, .continue-remove:hover { background: #e9f1e5; }

.library-state {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 19px;
  min-height: 112px;
  padding: 19px 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.state-icon, .member-icon { display: grid; place-items: center; width: 47px; height: 47px; border-radius: 12px; color: var(--teal); background: #e8f1e4; }
.screen-icon { display: grid; place-items: center; width: 20px; height: 15px; border: 1.5px solid currentColor; border-radius: 3px; }
.screen-icon::after, .play-icon { display: block; width: 0; border-block: 4px solid transparent; border-left: 6px solid currentColor; content: ''; }
.library-state h3 { margin: 0 0 4px; font-size: 16px; line-height: 1.3; }
.library-state p, .noscript-note { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.noscript-note { margin-top: 14px; }

.video-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.video-card { min-width: 0; }
.card-button {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  text-align: start;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.card-button:hover, .card-button:focus-visible { border-color: #a7c7b7; box-shadow: 0 10px 24px #163b2812; }
.card-art, .dialog-art {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  width: 100%;
  overflow: hidden;
  color: #cee7d4;
  background: radial-gradient(ellipse at 78% 7%, #346c5b, transparent 73%), linear-gradient(130deg, #0e3637, #1f5149);
}
.card-art { aspect-ratio: 16 / 8.5; }
.card-art::before, .dialog-art::before {
  position: absolute;
  inset: 13px;
  z-index: -1;
  border: 1px solid #d4eeda3d;
  border-radius: 5px;
  content: '';
}
.card-art .screen-icon, .dialog-art .screen-icon { width: 45px; height: 33px; border-width: 1px; border-radius: 6px; }
.card-art .screen-icon::after, .dialog-art .screen-icon::after { border-block-width: 6px; border-left-width: 9px; }
.card-art img, .dialog-art img { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card-art:has(.preview-restriction) .screen-icon,
.dialog-art:has(.preview-restriction) .screen-icon { display: none; }
.preview-restriction {
  padding: 6px 10px;
  border: 1px solid #f1ca7b80;
  border-radius: 6px;
  background: #1d342d;
  color: #ffe1a4;
  font-size: 13px;
  font-weight: 700;
}
.card-duration { position: absolute; right: 13px; bottom: 13px; z-index: 2; padding: 4px 7px; border-radius: 4px; color: white; background: #092525e8; font-size: 12px; font-weight: 700; }
.card-body { display: flex; flex: 1; flex-direction: column; width: 100%; padding: 17px 17px 14px; }
.card-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 8px; color: var(--teal); font-size: 12px; font-weight: 700; }
.card-kind { color: var(--muted); font-weight: 400; }
.card-kind::before { margin-inline-end: 8px; content: '·'; }
.card-featured { position: absolute; z-index: 2; inset: 10px auto auto 10px; padding: 4px 7px; border-radius: 4px; color: var(--dark); background: var(--mint); font-size: 12px; font-weight: 700; }
.card-storage {
  position: absolute;
  z-index: 2;
  inset-block-start: 10px;
  inset-inline-end: 10px;
  padding: 3px 7px;
  border: 1px solid #d3e0db;
  border-radius: 4px;
  color: #22433f;
  background: #eff5f1;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
}
.card-storage[data-source='dropbox'] { border-color: #c4d6fb; color: #17498f; background: #e8f0ff; }
.card-title { margin-top: 5px; font-size: 19px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.card-summary {
  display: -webkit-box;
  margin: 8px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 9px; margin-top: auto; padding-top: 15px; color: var(--teal); font-size: 13px; font-weight: 700; }
.card-access { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }

.recently-added { margin: 0 0 26px; }
.recently-added h3 {
  margin: 0 0 4px;
  font-family: var(--serif);
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -.028em;
}
.recently-added-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max(178px, calc((100% - 60px) / 6));
  gap: 12px;
  padding: 7px 8px 11px;
  margin-inline: -8px;
  overflow-x: auto;
  scroll-padding-inline: 8px;
  scroll-snap-type: inline proximity;
  scrollbar-color: #a7c7b7 transparent;
  scrollbar-width: thin;
}
.recently-added-grid .video-card { scroll-snap-align: start; }
.recently-added-grid .card-body { padding: 10px 11px; }
.recently-added-grid .card-title { font-size: 16px; }
.recently-added-grid .card-summary, .recently-added-grid .card-bottom > :first-child { display: none; }
.recently-added-grid .card-bottom { padding-top: 9px; font-size: 12px; }
.recently-added-grid .card-duration { right: 8px; bottom: 8px; }

.member-section { border-top: 1px solid var(--line); background: #ecf2e8; }
.member-inner { display: flex; align-items: center; gap: 18px; padding-block: 26px; }
.member-icon { flex: none; background: #dfece0; }
.member-copy h2 { margin: 0 0 5px; font-size: 17px; }
.member-copy p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.member-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-inline-start: auto; }
.site-footer { background: var(--paper); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 64px; color: var(--muted); font-size: 13px; }
.footer-inner p { margin: 0; }
.footer-inner a { font-weight: 700; }

.video-dialog {
  width: min(760px, 100% - 28px);
  max-height: calc(100% - 28px);
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 0;
  border-radius: 14px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 28px 85px #00171177;
}
.video-dialog::backdrop { background: #051d20be; }
.dialog-inner { position: relative; }
.dialog-close {
  position: absolute;
  z-index: 3;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid #ffffff70;
  border-radius: 50%;
  background: #102e2de8;
  color: white;
  font-size: 25px;
  line-height: 1;
}
.dialog-close:hover { background: #1e5951; }
.dialog-close:focus-visible { outline-color: #f1fff2; }
.dialog-art { height: clamp(115px, 25vw, 222px); }
.dialog-body { padding: clamp(19px, 3.5vw, 37px); }
.dialog-body h2 { margin: 0; font-family: var(--serif); font-size: clamp(29px, 4vw, 52px); font-weight: 400; line-height: 1.06; letter-spacing: -.036em; overflow-wrap: anywhere; }
.video-facts { display: flex; flex-wrap: wrap; gap: 14px 28px; margin: 19px 0 0; }
.video-facts:empty { display: none; }
.video-facts div { min-width: 80px; }
.video-facts dt { margin: 0 0 2px; color: var(--muted); font-size: 12px; }
.video-facts dd { margin: 0; font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.video-summary { margin: 19px 0 0; color: var(--muted); line-height: 1.6; overflow-wrap: anywhere; }
.dialog-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 23px; }
.dialog-status, .player-error { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.dialog-status { flex-basis: 100%; }
.share-status { overflow-wrap: anywhere; }
.share-status:empty { position: absolute; }
.player-shell { margin: 0 0 24px; }
.player-screen { position: relative; min-width: 0; }
.player-shell video {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(72vh, 720px);
  max-height: min(72dvh, 720px);
  margin-inline: auto;
  aspect-ratio: auto 16 / 9;
  object-fit: contain;
  border-radius: 7px;
  background: #081a1a;
}
.player-status {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: calc(100% - 20px);
  margin: 0;
  padding: 7px 12px;
  transform: translate(-50%, -50%);
  border-radius: 6px;
  background: #081a1ae8;
  color: white;
  font-size: 14px;
  text-align: center;
  pointer-events: none;
}
.player-status:empty { opacity: 0; }
.player-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.player-skip, .player-select select {
  min-height: 44px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--teal);
  font-size: 16px;
  font-weight: 700;
}
.player-skip { min-width: 64px; }
.player-skip:hover:not(:disabled), .player-select select:hover:not(:disabled) { border-color: var(--teal); background: #e9f1e5; }
.player-skip:disabled, .player-select select:disabled { opacity: .55; }
.player-select { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; font-weight: 700; }
.player-error { margin-top: 10px; color: #8c3028; }
.video-dialog:has(.player-shell:not([hidden])) { width: min(960px, 100% - 28px); }
.video-dialog:has(.player-shell:not([hidden])) .dialog-art { display: none; }
.video-dialog:has(.player-shell:not([hidden])) .dialog-close { width: 44px; height: 44px; }
.video-dialog:has(.player-shell:not([hidden])) .dialog-body { padding-top: 66px; }
.video-dialog:has(.player-shell:not([hidden])) .dialog-close:focus-visible { outline-color: var(--focus); }

.history-dialog .dialog-close:focus-visible { outline-color: var(--focus); }
.history-dialog h2 { padding-inline-end: 45px; }
.history-description, .history-status { color: var(--muted); font-size: 14px; line-height: 1.5; }
.history-description { margin: 10px 0 18px; }
.history-status { margin: 14px 0 0; }
.history-status:empty { margin: 0; }
.history-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 14px; }
.history-table th, .history-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: start;
  vertical-align: top;
  overflow-wrap: anywhere;
}
.history-table th { background: #e9f1e5; color: var(--ink); }
.history-table th:nth-child(2) { width: 44%; }
.history-table a { color: var(--teal); text-decoration: underline; text-underline-offset: 3px; }
.history-table td:last-child { color: var(--muted); }
.history-table small { display: block; margin-top: 3px; }
.history-dialog .button { margin-top: 14px; }

@media (max-width: 880px) {
  .header-inner, .navigation { gap: 18px; }
  .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero::before { background-position: 63% center; }
}
@media (max-width: 700px) {
  .header-inner { display: grid; grid-template-columns: 1fr auto; gap: 0 12px; padding-top: 10px; }
  .brand { font-size: 19px; }
  .brand-icon { width: 31px; height: 31px; border-radius: 8px; }
  .navigation { grid-column: 1 / -1; grid-row: 2; }
  .header-access { grid-column: 2; grid-row: 1; }
  .header-access .button { min-height: 36px; padding-inline: 10px; font-size: 12px; }
}
@media (max-width: 620px) {
  .navigation .nav-library { display: none; }
  .hero-inner { min-height: 432px; align-items: end; padding-block: 70px 36px; }
  .hero::before { background-position: 68% 35%; }
  .hero::after { background: linear-gradient(0deg, #072729fa, #072729bb 52%, #06232627 100%); }
  .hero h1 { font-size: clamp(48px, 12.2vw, 67px); }
  .hero-kicker { margin-bottom: 14px; }
  .hero-summary { margin-block: 17px 21px; }
  .library-heading { align-items: start; flex-direction: column; gap: 12px; margin-bottom: 21px; }
  .access-note { margin-bottom: 0; }
  .library-toolbar {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "search"
      "sort"
      "facets"
      "collections"
      "topics"
      "results";
    gap: 10px;
    margin-bottom: 18px;
  }
  .sort-field { width: min(100%, 175px); }
  .filter-field { flex-basis: 130px; max-width: none; }
  .tag-filter-section > p { flex-basis: 100%; }
  .tag-filters { flex-basis: 100%; }
  .tag-filters button, .topic-filters button, .applied-filters button, .clear-filters { min-height: 40px; }
  .more-topics { min-height: 36px; }
  .applied-filters { flex-basis: 100%; order: 1; }
  .clear-filters { margin-inline-start: auto; }
  .recently-added-grid { grid-auto-columns: min(74%, 208px); }
  .library-state { min-height: 100px; grid-template-columns: auto 1fr; gap: 12px; padding-inline: 14px; }
  .library-state button { grid-column: 2; justify-self: start; }
  .member-inner { flex-wrap: wrap; gap: 12px; }
  .member-copy { flex: 1 1 200px; }
  .member-actions { margin-inline-start: 59px; }
  .video-grid { gap: 12px; }
  .card-body { padding: 12px; }
  .card-title { font-size: 16px; }
}
@media (max-width: 435px) {
  .header-access:has(.header-account-status:not([hidden])) { flex-direction: column; align-items: flex-end; }
  .header-account-status { max-inline-size: 8rem; }
  .video-grid { grid-template-columns: minmax(0, 1fr); }
  .filter-field select, .sort-field select { padding-inline: 7px; }
  .history-table { font-size: 13px; }
  .history-table th, .history-table td { padding-inline: 5px; }
}
@media (max-width: 620px), (max-height: 520px) and (orientation: landscape) and (pointer: coarse) {
  .video-dialog:has(.player-shell:not([hidden])) {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border-radius: 0;
  }
  .video-dialog:has(.player-shell:not([hidden])) .dialog-body {
    padding: calc(60px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
      calc(20px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  }
  .video-dialog:has(.player-shell:not([hidden])) .dialog-close {
    top: calc(8px + env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
  }
  .player-shell video {
    max-height: max(110px, calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 124px));
    max-height: max(110px, calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 124px));
  }
}
@media (max-height: 520px) and (orientation: landscape) and (pointer: coarse) {
  .player-shell { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; }
  .player-shell video {
    max-height: max(110px, calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 68px));
    max-height: max(110px, calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 68px));
  }
  .player-tools { flex-direction: column; align-items: stretch; margin-top: 0; }
  .player-select { justify-content: space-between; }
  .player-error { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* Dark green, the default look (Ahmed, 14 Nov 2026). The page switch (app.js) sets
   html[data-theme="light"] for visitors who choose light, which brings back the styles above. */
.theme-switch {
  display: inline-grid;
  place-items: center;
  inline-size: 42px;
  block-size: 42px;
  flex: none;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
}
.theme-switch:hover { background: rgba(127, 160, 150, .16); }
.theme-switch svg { inline-size: 19px; block-size: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html:not([data-theme="light"]) .theme-moon,
html[data-theme="light"] .theme-sun { display: none; }
body.app-playback .theme-switch { display: none; }

html:not([data-theme="light"]) {
  color-scheme: dark;
  --paper: #101c1e;
  --surface: #18272a;
  --ink: #edf4ed;
  --muted: #b7c9c4;
  --teal: #b8e3cb;
  --dark: #0a2125;
  --line: #354c4c;
  --focus: #a2dbca;
}
html:not([data-theme="light"]) .brand-icon { color: #0c3037; background: #c5e9d1; }
html:not([data-theme="light"]) .auth-notice { color: #ffd2c4; background: #3a231d; }
html:not([data-theme="light"]) .button-header,
html:not([data-theme="light"]) .button-outline,
html:not([data-theme="light"]) .tag-filters button { border-color: #4b6564; }
html:not([data-theme="light"]) .button-header:hover,
html:not([data-theme="light"]) .button-outline:hover,
html:not([data-theme="light"]) .tag-filters button:hover,
html:not([data-theme="light"]) .continue-open:hover,
html:not([data-theme="light"]) .continue-remove:hover,
html:not([data-theme="light"]) .player-skip:hover:not(:disabled),
html:not([data-theme="light"]) .player-select select:hover:not(:disabled) { border-color: #6e8884; background: #203939; }
html:not([data-theme="light"]) .button-solid { color: #0c3037; background: #c5e9d1; }
html:not([data-theme="light"]) .button-solid:hover { background: #d8f2e1; }
html:not([data-theme="light"]) .tag-filters button[aria-pressed="true"] { color: #0c3037; }
html:not([data-theme="light"]) .topic-filters button[aria-pressed="true"],
html:not([data-theme="light"]) .applied-filters button:hover { background: #2a4644; }
html:not([data-theme="light"]) .applied-filters button { border-color: #3e5756; background: #203939; }
html:not([data-theme="light"]) .continue-watching,
html:not([data-theme="light"]) .member-section { background: #15282a; }
html:not([data-theme="light"]) .continue-item { border-color: #2c4443; }
html:not([data-theme="light"]) .continue-icon,
html:not([data-theme="light"]) .state-icon,
html:not([data-theme="light"]) .member-icon { background: #203939; color: #c5e9d1; }
html:not([data-theme="light"]) .card-button:hover,
html:not([data-theme="light"]) .card-button:focus-visible { border-color: #6e8884; box-shadow: 0 10px 24px rgba(0, 0, 0, .35); }
html:not([data-theme="light"]) .recently-added-grid { scrollbar-color: #4b6564 transparent; }
html:not([data-theme="light"]) .player-error { color: #ffb4a6; }
html:not([data-theme="light"]) .history-table th { background: #203939; }
