/* ==========================================================================
   SPRhinoplasty On-Demand — Design System & Authenticated Learning UI
   ========================================================================== */

:root {
  --background: #F5F4F0;
  --surface: #FFFFFF;
  --surface-subtle: #FAF9F6;
  --text-primary: #202725;
  --text-secondary: #626D68;
  --brand: #174C46;
  --brand-hover: #103A35;
  --brand-soft: #E7EFEB;
  --border: #DDE2DC;
  --border-strong: #C3CBC2;
  --accent-decorative: #A58A61;
  --video-stage: #141918;

  --danger: #9B2C2C;
  --danger-soft: #FDF2F2;
  --danger-border: #F2CACA;

  --font-heading: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --radius-card: 10px;
  --radius-control: 8px;
  --header-height: 72px;
  --container-max: 1440px;

  --shadow-subtle: 0 1px 2px rgba(32, 39, 37, 0.04);
  --shadow-elevated: 0 8px 24px rgba(32, 39, 37, 0.08);
  --shadow-card-hover: 0 6px 18px rgba(32, 39, 37, 0.06);
}

/* Base Reset & Typography for SPRhinoplasty On-Demand */
body.spr-app {
  margin: 0;
  background-color: var(--background);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

body.spr-app *,
body.spr-app *::before,
body.spr-app *::after {
  box-sizing: border-box;
}

body.spr-app [hidden] {
  display: none !important;
}

body.spr-app h1,
body.spr-app h2,
body.spr-app h3,
body.spr-app h4,
body.spr-app .spr-font-heading {
  font-family: var(--font-heading);
  color: var(--text-primary);
  margin: 0;
}

/* Accessible Keyboard Focus */
body.spr-app :focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.spr-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;
}

.spr-skip-link {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 100;
  background: var(--brand);
  color: #FFFFFF;
  padding: 10px 16px;
  border-radius: var(--radius-control);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.spr-skip-link:focus {
  top: 12px;
}

/* Centered Container (1440px max, 48px gutters on wide desktop) */
.spr-container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}

@media (min-width: 640px) {
  .spr-container {
    padding-left: 24px;
    padding-right: 24px;
  }
}

@media (min-width: 1200px) {
  .spr-container {
    padding-left: 48px;
    padding-right: 48px;
  }
}

/* ==========================================================================
   Shared Compact Header (~72px)
   ========================================================================== */
.spr-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-height);
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
}

.spr-header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.spr-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

@media (min-width: 640px) {
  .spr-header-left {
    gap: 32px;
  }
}

.spr-wordmark {
  display: inline-flex;
  flex-direction: column;
  text-decoration: none;
  padding: 4px 0;
  border-radius: 4px;
  line-height: 1.15;
}

.spr-wordmark-title {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.spr-wordmark-accent {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background-color: var(--accent-decorative);
  display: inline-block;
  flex-shrink: 0;
}

.spr-wordmark-sub {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin-top: 2px;
}

.spr-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.spr-nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  border-radius: var(--radius-control);
  transition: color 0.15s ease, background-color 0.15s ease;
}

.spr-nav-link:hover {
  color: var(--text-primary);
  background-color: var(--surface-subtle);
}

.spr-nav-link[aria-current="page"] {
  color: var(--brand);
  font-weight: 600;
}

.spr-nav-link[aria-current="page"]::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -14px;
  height: 2px;
  background-color: var(--brand);
}

.spr-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Header Icon & Account Triggers */
.spr-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-control);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.spr-icon-btn:hover,
.spr-icon-btn[aria-expanded="true"] {
  color: var(--text-primary);
  background-color: var(--surface-subtle);
  border-color: var(--border);
}

.spr-notif-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background-color: var(--brand);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
}

.spr-account-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 4px 10px 4px 6px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border);
  background-color: var(--surface);
  color: var(--text-primary);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.spr-account-trigger:hover,
.spr-account-trigger[aria-expanded="true"] {
  background-color: var(--surface-subtle);
  border-color: var(--border-strong);
}

.spr-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background-color: var(--brand-soft);
  color: var(--brand);
  border: 1px solid rgba(23, 76, 70, 0.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.spr-account-label {
  display: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 640px) {
  .spr-account-label {
    display: inline;
  }
}

/* Dropdown Menus (Account & Notifications) */
.spr-menu-wrap {
  position: relative;
}

.spr-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-elevated);
  z-index: 50;
  overflow: hidden;
}

.spr-dropdown[hidden] {
  display: none !important;
}

.spr-account-dropdown {
  width: 240px;
}

.spr-notif-dropdown {
  width: min(340px, calc(100vw - 32px));
}

.spr-dropdown-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background-color: var(--surface-subtle);
}

.spr-dropdown-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spr-dropdown-email {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spr-menu-group {
  padding: 6px;
}

.spr-menu-divider {
  height: 1px;
  background-color: var(--border);
  margin: 0;
}

.spr-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 40px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.spr-menu-item:hover {
  background-color: var(--surface-subtle);
}

.spr-menu-item-secondary {
  color: var(--text-secondary);
  font-size: 13px;
}

.spr-menu-item-secondary:hover {
  color: var(--text-primary);
}

.spr-menu-item-danger {
  color: var(--danger);
}

.spr-menu-item-danger:hover {
  background-color: var(--danger-soft);
}

/* Notification List Items */
.spr-notif-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.spr-notif-title {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.spr-text-btn {
  border: 0;
  background: transparent;
  color: var(--brand);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
}

.spr-text-btn:hover {
  background-color: var(--brand-soft);
  color: var(--brand-hover);
}

.spr-notif-list {
  max-height: 320px;
  overflow-y: auto;
}

.spr-notif-item {
  width: 100%;
  display: block;
  text-align: left;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-family: var(--font-body);
  transition: background-color 0.12s ease;
}

.spr-notif-item:last-child {
  border-bottom: 0;
}

.spr-notif-item:hover {
  background-color: var(--surface-subtle);
}

.spr-notif-item.is-unread {
  background-color: var(--brand-soft);
}

.spr-notif-item.is-unread:hover {
  background-color: #DDE8E2;
}

/* ==========================================================================
   Buttons & Form Controls (8px Radius, >= 44px Mobile Targets)
   ========================================================================== */
.spr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-control);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.spr-btn-primary {
  background-color: var(--brand);
  color: #FFFFFF;
}

.spr-btn-primary:hover {
  background-color: var(--brand-hover);
}

.spr-btn-secondary {
  background-color: var(--surface);
  color: var(--text-primary);
  border-color: var(--border);
}

.spr-btn-secondary:hover {
  background-color: var(--surface-subtle);
  border-color: var(--border-strong);
}

.spr-btn-quiet {
  background-color: transparent;
  color: var(--text-secondary);
  border-color: transparent;
  padding: 0 10px;
}

.spr-btn-quiet:hover {
  background-color: var(--surface);
  color: var(--text-primary);
  border-color: var(--border);
}

.spr-input,
.spr-select {
  height: 42px;
  padding: 0 12px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border);
  background-color: var(--surface);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.4;
  transition: border-color 0.15s ease;
}

.spr-input::placeholder {
  color: var(--text-secondary);
}

.spr-input:hover,
.spr-select:hover {
  border-color: var(--border-strong);
}

.spr-input:focus,
.spr-select:focus {
  outline: 2px solid var(--brand);
  outline-offset: 0;
  border-color: var(--brand);
}

@media (max-width: 767px) {
  .spr-btn,
  .spr-input,
  .spr-select,
  .spr-menu-item {
    min-height: 44px;
  }
}

/* ==========================================================================
   Library Page Layout, Intro & Filter Row
   ========================================================================== */
.spr-library-main {
  padding-top: 32px;
  padding-bottom: 64px;
}

.spr-page-intro {
  margin-bottom: 24px;
}

.spr-page-heading {
  font-size: clamp(1.75rem, 2.2vw, 2.125rem); /* ~28px mobile -> 34px desktop */
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.2;
  color: var(--text-primary);
}

.spr-page-subtext {
  margin: 6px 0 0 0;
  font-size: 15px;
  color: var(--text-secondary);
}

/* Search & Compact Single-Row Filters */
.spr-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.spr-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.spr-field-search {
  flex: 1 1 260px;
  min-width: 0;
}

.spr-field-filter {
  flex: 0 1 auto;
  min-width: 168px;
}

.spr-field-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

.spr-search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.spr-search-icon {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
  pointer-events: none;
}

.spr-search-input {
  width: 100%;
  padding-left: 36px;
  padding-right: 36px;
}

.spr-search-clear {
  position: absolute;
  right: 4px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.spr-search-clear:hover {
  color: var(--text-primary);
  background-color: var(--surface-subtle);
}

.spr-select {
  width: 100%;
  padding-right: 32px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23626D68' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.spr-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 639px) {
  .spr-field-search,
  .spr-field-filter {
    flex: 1 1 100%;
    min-width: 0;
  }
  .spr-toolbar-actions {
    width: 100%;
  }
  .spr-toolbar-actions .spr-btn {
    width: 100%;
  }
}

/* ==========================================================================
   Continue Watching Section (Max 2 Restrained Horizontal Items)
   ========================================================================== */
.spr-continue-section {
  margin-bottom: 40px;
}

.spr-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.spr-section-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.spr-section-meta {
  font-size: 13px;
  color: var(--text-secondary);
}

.spr-continue-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 900px) {
  .spr-continue-grid.has-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.spr-continue-card {
  display: flex;
  flex-direction: column;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-subtle);
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.spr-continue-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card-hover);
}

@media (min-width: 560px) {
  .spr-continue-card {
    flex-direction: row;
    align-items: stretch;
  }
}

.spr-continue-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: var(--video-stage);
  flex-shrink: 0;
  overflow: hidden;
}

@media (min-width: 560px) {
  .spr-continue-thumb {
    width: 208px;
  }
}

.spr-continue-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.spr-continue-body {
  flex: 1;
  min-width: 0;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.spr-continue-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.spr-continue-speaker {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.spr-continue-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.spr-continue-progress {
  flex: 1;
  min-width: 0;
}

.spr-progress-track {
  width: 100%;
  height: 4px;
  background-color: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.spr-progress-fill {
  height: 100%;
  background-color: var(--brand);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.spr-progress-caption {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 6px;
}

.spr-resume-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-control);
  background-color: var(--brand);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  flex-shrink: 0;
  transition: background-color 0.15s ease;
}

.spr-resume-link:hover {
  background-color: var(--brand-hover);
}

@media (max-width: 767px) {
  .spr-resume-link {
    min-height: 44px;
    padding: 0 16px;
  }
}

/* ==========================================================================
   Video Cards Grid (3 Desktop / 2 Tablet / 1 Mobile)
   ========================================================================== */
.spr-library-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.spr-results-count {
  font-size: 13px;
  color: var(--text-secondary);
}

.spr-video-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 640px) {
  .spr-video-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .spr-video-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.spr-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-subtle);
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.spr-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

.spr-card:focus-within {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-color: var(--brand);
}

/* 16:9 Contained Thumbnail (Never Crops Clinical Framing or Slides) */
.spr-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: var(--video-stage);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.spr-card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.spr-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: var(--video-stage);
  color: #9DA7A3;
  padding: 16px;
  text-align: center;
}

.spr-thumb-placeholder-label {
  font-size: 12px;
  letter-spacing: 0.03em;
  color: #9DA7A3;
}

/* Subtle Play Affordance */
.spr-play-affordance {
  position: absolute;
  left: 12px;
  bottom: 12px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background-color: rgba(20, 25, 24, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.spr-card:hover .spr-play-affordance,
.spr-card:focus-within .spr-play-affordance {
  background-color: var(--brand);
  border-color: var(--brand);
  transform: scale(1.04);
}

/* Duration Badge (Only when real duration exists) */
.spr-duration-badge {
  position: absolute;
  right: 10px;
  bottom: 12px;
  padding: 2px 7px;
  border-radius: 5px;
  background-color: rgba(20, 25, 24, 0.86);
  color: #F5F4F0;
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
  pointer-events: none;
}

/* Subtle Thumbnail Bottom Progress Line */
.spr-thumb-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background-color: rgba(255, 255, 255, 0.18);
}

.spr-thumb-progress-bar {
  height: 100%;
  background-color: #2E8B7E;
}

/* Card Content Hierarchy */
.spr-card-body {
  padding: 16px 20px 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.spr-card-main {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.spr-card-title {
  font-family: var(--font-heading);
  font-size: 17.5px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.012em;
  color: var(--text-primary);
}

.spr-card-subtitle {
  display: block;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.38;
  color: var(--text-primary);
  margin-top: 2px;
}

.spr-card-link {
  color: inherit;
  text-decoration: none;
}

.spr-card-link:focus-visible {
  outline: none;
}

.spr-card-link::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}

.spr-card-meta-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 2px;
}

.spr-card-speaker {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
}

.spr-card-session {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.spr-meta-sep {
  color: var(--accent-decorative);
  margin: 0 5px;
}

/* Card Footer Status Pill (Never Color Alone) */
.spr-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.spr-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  padding: 5px 8px;
  border-radius: 6px;
}

.spr-status-not-started {
  color: var(--text-secondary);
  background-color: var(--surface-subtle);
  border: 1px solid var(--border);
}

.spr-status-in-progress {
  color: var(--brand);
  background-color: var(--brand-soft);
  border: 1px solid rgba(23, 76, 70, 0.18);
}

.spr-status-completed {
  color: var(--brand);
  background-color: var(--brand-soft);
  border: 1px solid rgba(23, 76, 70, 0.22);
}

.spr-card-progress-note {
  font-size: 12px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Skeletons & Empty / Error States
   ========================================================================== */
@keyframes sprPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.52; }
}

.spr-skeleton {
  background-color: #E5E7E2;
  border-radius: 6px;
  animation: sprPulse 1.6s ease-in-out infinite;
}

.spr-skeleton-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #DFE2DC;
  animation: sprPulse 1.6s ease-in-out infinite;
}

.spr-empty-state {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 48px 24px;
  text-align: center;
  max-width: 560px;
  margin: 24px auto;
}

.spr-empty-title {
  font-family: var(--font-heading);
  font-size: 19px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.spr-empty-desc {
  font-size: 15px;
  color: var(--text-secondary);
  margin: 0 auto 20px;
  max-width: 420px;
}

/* ==========================================================================
   Video Viewing Page (/watch/{id})
   ========================================================================== */
.spr-watch-main {
  padding-top: 20px;
  padding-bottom: 64px;
}

/* Above the Player Bar */
.spr-watch-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.spr-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
  font-size: 14px;
}

.spr-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 10px 0 6px;
  margin-left: -6px;
  border-radius: var(--radius-control);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.15s ease, background-color 0.15s ease;
}

@media (min-width: 768px) {
  .spr-back-link {
    min-height: 38px;
  }
}

.spr-back-link:hover {
  color: var(--text-primary);
  background-color: rgba(32, 39, 37, 0.05);
}

.spr-breadcrumb-sep {
  color: var(--border-strong);
  display: none;
}

.spr-breadcrumb-session {
  color: var(--text-secondary);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  display: none;
}

@media (min-width: 640px) {
  .spr-breadcrumb-sep,
  .spr-breadcrumb-session {
    display: inline;
  }
}

.spr-stage-controls {
  display: none;
  align-items: center;
  gap: 8px;
}

@media (min-width: 1024px) {
  .spr-stage-controls {
    display: flex;
  }
}

.spr-stage-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border);
  background-color: var(--surface);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.spr-stage-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.spr-stage-btn[aria-pressed="true"] {
  background-color: var(--brand-soft);
  color: var(--brand);
  border-color: rgba(23, 76, 70, 0.28);
}

/* Watch Layout Grid (Main Column + Optional 340px Session Sidebar) */
.spr-watch-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

@media (min-width: 1024px) {
  .spr-watch-layout.has-sidebar:not(.is-sidebar-collapsed):not(.is-theater) {
    grid-template-columns: minmax(0, 1fr) 340px;
  }

  /* When standalone (no sidebar) and not in theater mode, keep comfortable reading/viewing measure */
  .spr-watch-layout:not(.has-sidebar):not(.is-theater) .spr-watch-primary,
  .spr-watch-layout.is-sidebar-collapsed:not(.is-theater) .spr-watch-primary {
    max-width: 1040px;
  }
}

/* Dark Charcoal Video Stage */
.spr-player-stage {
  position: relative;
  width: 100%;
  background-color: var(--video-stage);
  border-radius: var(--radius-card);
  overflow: hidden;
  border: 1px solid rgba(32, 39, 37, 0.18);
}

.spr-player-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 76vh;
  margin: 0 auto;
  background-color: #0B0E0D;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spr-watch-layout.is-theater .spr-player-frame {
  max-height: 80vh;
}

.spr-player-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background-color: #000000;
}

.spr-player-frame video {
  width: 100%;
  height: 100%;
  max-height: 76vh;
  object-fit: contain; /* Never stretch or crop portrait / non-16:9 surgical footage */
  display: block;
  background-color: #000000;
}

.spr-watch-layout.is-theater .spr-player-frame video {
  max-height: 80vh;
}

.spr-stage-state {
  padding: 32px 24px;
  text-align: center;
  color: #E3E7E5;
  max-width: 440px;
}

.spr-stage-state-title {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 600;
  color: #FFFFFF;
  margin-bottom: 8px;
}

.spr-stage-state-desc {
  font-size: 14px;
  color: #AAB3AF;
  margin: 0 0 16px 0;
}

/* Below the Player Details Hierarchy */
.spr-video-details {
  margin-top: 24px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px;
}

@media (min-width: 768px) {
  .spr-video-details {
    padding: 28px 32px;
  }
}

.spr-watch-title {
  font-family: var(--font-heading);
  font-size: clamp(1.375rem, 1.9vw, 1.875rem); /* ~22px mobile -> 30px desktop */
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text-primary);
}

.spr-watch-subtitle {
  display: block;
  font-family: var(--font-heading);
  font-size: clamp(1.125rem, 1.4vw, 1.375rem);
  font-weight: 500;
  color: var(--text-primary);
  margin-top: 4px;
}

.spr-watch-speaker {
  margin-top: 10px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
}

.spr-watch-meta-row {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-secondary);
}

/* Quiet Progress Line Below Metadata */
.spr-quiet-progress {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.spr-quiet-progress-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.spr-quiet-progress-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.spr-quiet-progress-text strong {
  font-weight: 600;
  color: var(--text-primary);
}

.spr-quiet-progress-text.is-completed strong {
  color: var(--brand);
}

.spr-watch-description-wrap {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.spr-watch-description-heading {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
  letter-spacing: 0.01em;
}

.spr-watch-description {
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--text-primary);
  white-space: pre-wrap;
  max-width: 72ch;
  margin: 0;
}

/* ==========================================================================
   Session Sidebar ("In this session")
   ========================================================================== */
.spr-session-sidebar {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.spr-watch-layout.is-sidebar-collapsed .spr-session-sidebar,
.spr-watch-layout.is-theater .spr-session-sidebar {
  display: none;
}

/* On mobile (<1024px), always keep session list below player & details even if desktop was in theater/collapsed */
@media (max-width: 1023px) {
  .spr-watch-layout.has-sidebar .spr-session-sidebar {
    display: block;
  }
}

.spr-session-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.spr-session-heading {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.spr-session-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.spr-session-count {
  font-size: 12px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.spr-session-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.spr-session-item {
  border-bottom: 1px solid var(--border);
}

.spr-session-item:last-child {
  border-bottom: 0;
}

.spr-session-link {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--text-primary);
  background-color: var(--surface);
  transition: background-color 0.14s ease;
}

.spr-session-link:hover {
  background-color: var(--surface-subtle);
}

/* Active item: soft green surface + restrained brand marker */
.spr-session-link.is-active {
  background-color: var(--brand-soft);
}

.spr-session-link.is-active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background-color: var(--brand);
}

.spr-session-thumb {
  position: relative;
  width: 96px;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  background-color: var(--video-stage);
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid rgba(32, 39, 37, 0.12);
}

.spr-session-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.spr-session-info {
  flex: 1;
  min-width: 0;
}

.spr-session-item-title {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.spr-session-link.is-active .spr-session-item-title {
  color: var(--brand);
}

.spr-session-item-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.spr-session-state-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--brand);
  margin-top: 4px;
}

/* ==========================================================================
   Accessible Modal Dialog (Profile Settings) & Toast Notifications
   ========================================================================== */
.spr-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background-color: rgba(20, 25, 24, 0.48);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.spr-modal-backdrop[hidden] {
  display: none !important;
}

.spr-modal {
  width: 100%;
  max-width: 440px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-elevated);
  padding: 24px;
}

.spr-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.spr-modal-title {
  font-family: var(--font-heading);
  font-size: 19px;
  font-weight: 600;
  color: var(--text-primary);
}

.spr-form-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.spr-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* Toast Styling for SPRhinoplasty App */
body.spr-app .spr-toast {
  padding: 12px 16px;
  border-radius: var(--radius-control);
  background-color: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-elevated);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
}

body.spr-app .spr-toast-success {
  border-left: 3px solid var(--brand);
}

body.spr-app .spr-toast-error {
  border-left: 3px solid var(--danger);
}

body.spr-app .spr-toast-info {
  border-left: 3px solid var(--accent-decorative);
}

/* ==========================================================================
   Reduced Motion Support
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  body.spr-app *,
  body.spr-app *::before,
  body.spr-app *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .spr-card:hover {
    transform: none;
  }

  .spr-card:hover .spr-play-affordance,
  .spr-card:focus-within .spr-play-affordance {
    transform: none;
  }
}
