@font-face {
  font-family: "Montserrat";
  src: url("fonts/Montserrat-Variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Roboto Slab";
  src: url("fonts/RobotoSlab-Variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --navy: #0b2e4f;
  --navy-soft: #123b63;
  --blue: #236f9f;
  --ice: #eef7fb;
  --paper: #ffffff;
  --muted: #587084;
  --line: rgba(11, 50, 86, 0.16);
  --success: #18704d;
  --danger: #a33b34;
  --shell: min(1180px, calc(100vw - 48px));
  --sans: "Montserrat", "Avenir Next", Arial, sans-serif;
  --serif: "Roboto Slab", Rockwell, Georgia, serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow-wrap: break-word;
  background:
    radial-gradient(circle at 88% 8%, rgba(190, 220, 233, 0.58), transparent 34%),
    linear-gradient(145deg, #ffffff 0%, var(--ice) 100%);
  color: var(--navy);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { display: block; }
button, input, textarea, select { font: inherit; }

.portal-shell { width: var(--shell); margin-inline: auto; }

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 20;
  padding: 10px 16px;
  transform: translateY(-160%);
  border-radius: 4px;
  background: var(--navy);
  color: #fff;
  font-weight: 750;
}
.skip-link:focus { transform: translateY(0); }

.portal-header {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
}

.portal-header-inner {
  min-height: 88px;
  padding-block: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
}

.portal-brand { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 13px; line-height: 1.05; }
.portal-brand img { flex: 0 0 auto; width: 48px; height: 48px; }
.portal-brand span { flex: 0 0 auto; white-space: nowrap; font-size: 13px; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; }
.portal-brand strong { display: block; font-size: 16px; }

.portal-badge {
  padding: 8px 13px;
  border: 1px solid rgba(47, 128, 186, 0.34);
  border-radius: 999px;
  background: rgba(238, 247, 251, 0.88);
  color: var(--navy-soft);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.portal-main { flex: 1; padding: clamp(62px, 8vw, 104px) 0 clamp(68px, 8vw, 110px); }

.login-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.65fr);
  align-items: center;
  gap: clamp(48px, 8vw, 112px);
}

.eyebrow,
.panel-kicker {
  margin: 0 0 14px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.login-copy h1 {
  max-width: 760px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(42px, 5.5vw, 68px);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.login-copy > p:last-child { max-width: 660px; margin: 26px 0 0; color: var(--muted); font-size: 17px; }

.panel {
  padding: 34px;
  border: 1px solid var(--line);
  border-top: 5px solid var(--blue);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 65px rgba(11, 46, 79, 0.13);
}

.panel h2 { margin: 0; font-family: var(--serif); font-size: 32px; font-weight: 500; line-height: 1.15; }
.form-stack { margin-top: 28px; display: grid; gap: 10px; }
.form-stack label { color: var(--navy-soft); font-size: 13px; font-weight: 750; }
.form-stack input {
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--ice);
  color: var(--navy);
  outline: none;
}
.form-stack input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47, 128, 186, 0.13); }

.button-primary {
  min-height: 56px;
  margin-top: 12px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--navy);
  border-radius: 3px;
  background: var(--navy);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.privacy-note { margin: 20px 0 0; color: var(--muted); font-size: 12px; }

.portal-footer { padding: 25px 0; border-top: 1px solid var(--line); background: rgba(255, 255, 255, 0.76); }
.portal-footer .portal-shell { display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.portal-footer p { margin: 0; color: var(--muted); font-size: 12px; }
.portal-footer div { display: flex; gap: 18px; }
.portal-footer a { color: var(--navy-soft); font-size: 12px; font-weight: 750; }

:where(a, button, input, textarea, select):focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
  box-shadow: 0 0 0 6px rgba(30, 112, 162, 0.92);
}

@media (max-width: 900px) {
  :root { --shell: calc(100vw - 36px); }
  .login-layout { grid-template-columns: minmax(0, 1fr); gap: 46px; }
  .login-panel { max-width: 620px; }
}

@media (max-width: 560px) {
  :root { --shell: calc(100vw - 28px); }
  .portal-header-inner { min-height: 78px; }
  .portal-brand img { width: 42px; height: 42px; }
  .portal-brand span { font-size: 11px; }
  .portal-brand strong { font-size: 14px; }
  .portal-badge { max-width: 138px; padding: 7px 10px; font-size: 9px; line-height: 1.3; text-align: center; }
  .portal-main { padding: 48px 0 66px; }
  .login-copy h1 { font-size: clamp(34px, 10.4vw, 43px); }
  .login-copy > p:last-child { font-size: 15px; }
  .panel { padding: 26px 21px; }
  .portal-footer .portal-shell { align-items: flex-start; flex-direction: column; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}

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

.header-actions { display: flex; align-items: center; gap: 16px; }
.header-actions form { margin: 0; }
.header-logout {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--navy-soft);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.panel-text { margin: 18px 0 0; color: var(--muted); }
.field-hint { margin: -2px 0 8px; color: var(--muted); font-size: 11px; }
.alert { margin: 20px 0 0; padding: 12px 14px; border-left: 3px solid var(--danger); background: #fff2f2; color: #7d2d29; font-size: 13px; }
.alert--success { border-color: var(--success); background: #f1faf6; color: #155c42; }

.dashboard-page .portal-main { padding-top: clamp(54px, 6vw, 82px); }
.dashboard-shell { display: grid; gap: 34px; }

.library-filters {
  min-width: 0;
  margin: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--blue);
  background: var(--paper);
  box-shadow: 0 15px 38px rgba(11, 46, 79, 0.08);
}
.library-filters[hidden],
.library-no-results[hidden],
.video-card[hidden] { display: none; }
.library-filter-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.library-filter-fields label { min-width: 0; display: grid; gap: 8px; color: var(--navy-soft); font-size: 14px; font-weight: 750; }
.library-filter-fields input,
.library-filter-fields select {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--ice);
  color: var(--navy);
  font-size: 16px;
  font-weight: 500;
}
.library-filter-footer { margin-top: 18px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.library-filter-footer p { margin: 0; color: var(--muted); font-size: 14px; }
.library-filter-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.library-filter-actions button { margin: 0; font-size: 14px; }
.library-section, .video-card h3 { scroll-margin-top: 24px; }
.library-section h2:focus-visible, .video-card h3:focus-visible { outline: 3px solid var(--blue); outline-offset: 5px; }

.dashboard-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 44px;
}

.dashboard-intro h1 {
  max-width: 820px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(40px, 4.8vw, 62px);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.dashboard-intro > div > p:last-child { max-width: 760px; margin: 22px 0 0; color: var(--muted); font-size: 16px; }
.intro-action { min-width: 240px; text-decoration: none; }

.button-primary,
.button-secondary,
.button-danger {
  min-height: 52px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border-radius: 4px;
  font-weight: 800;
  font-size: 13px;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.button-primary { border: 1px solid var(--navy); background: var(--navy); color: #fff; }
.button-secondary { border: 1px solid rgba(47, 128, 186, 0.48); background: #fff; color: var(--navy-soft); }
.button-danger { border: 1px solid #b75a54; background: #fff5f4; color: #8e302b; }
.button-compact { min-height: 44px; padding-inline: 14px; font-size: 12px; }
.button-primary:disabled { opacity: 0.58; cursor: wait; }

@media (hover: hover) and (pointer: fine) {
  .button-primary:hover,
  .button-secondary:hover,
  .button-danger:hover,
  .header-logout:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(11, 46, 79, 0.13); }
}

.alert-card {
  padding: 20px 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
  align-items: center;
  gap: 24px;
  border: 1px solid #b8dfcf;
  border-left: 4px solid var(--success);
  background: #f3fbf7;
}

.alert-card--error { border-color: #e5b4b0; border-left-color: var(--danger); background: #fff5f4; }
.alert-card strong { display: block; color: var(--navy); font-size: 13px; }
.alert-card p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.share-copy-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }

.share-copy-row input,
.link-row > input,
.new-link-form input,
.field input,
.field textarea,
.settings-form input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fff;
  color: var(--navy);
  outline: none;
}

.share-copy-row input,
.link-row > input,
.new-link-form input,
.field input,
.settings-form input { min-height: 52px; padding: 0 14px; }
.field textarea { min-height: 112px; padding: 13px 14px; resize: vertical; }

.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: stretch; }
.stats-grid article {
  min-height: 160px;
  padding: 23px 24px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-top: 4px solid var(--blue);
  background: rgba(255, 255, 255, 0.93);
  box-shadow: 0 15px 38px rgba(11, 46, 79, 0.08);
}
.stats-grid span { color: var(--blue); font-size: 11px; font-weight: 850; letter-spacing: 0.1em; text-transform: uppercase; }
.stats-grid strong { margin-top: 9px; font-family: var(--serif); font-size: 46px; font-weight: 500; line-height: 1; }
.stats-grid small { margin-top: auto; color: var(--muted); font-size: 12px; }

.upload-panel { scroll-margin-top: 24px; }
.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.5fr);
  align-items: end;
  gap: 54px;
}
.section-heading h2 { margin: 0; font-family: var(--serif); font-size: clamp(30px, 3vw, 42px); font-weight: 500; line-height: 1.08; letter-spacing: -0.03em; }
.section-heading > p { margin: 0; color: var(--muted); font-size: 13px; }
.upload-form { margin-top: 34px; }
.codec-note { margin: 0 0 20px; padding: 13px 15px; border-left: 3px solid var(--blue); background: var(--ice); color: var(--muted); font-size: 12px; }
.codec-note strong { color: var(--navy-soft); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field { display: grid; align-content: start; gap: 8px; color: var(--navy-soft); font-size: 12px; font-weight: 750; }
.field--wide { grid-column: 1 / -1; }
.field small,
.file-field small { color: var(--muted); font-weight: 500; }
.field strong,
.file-field strong { color: var(--danger); }

.file-field {
  position: relative;
  min-height: 172px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  border: 1px dashed rgba(47, 128, 186, 0.75);
  background: var(--ice);
  color: var(--navy-soft);
  cursor: pointer;
}
.file-field-label { font-size: 12px; font-weight: 800; }
.file-field input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.file-field:focus-within {
  outline: 3px solid #fff;
  outline-offset: 2px;
  box-shadow: 0 0 0 6px rgba(30, 112, 162, 0.92);
}
.file-button { min-height: 46px; padding: 0 15px; display: inline-flex; align-items: center; border: 1px solid var(--navy-soft); border-radius: 3px; background: var(--navy-soft); color: #fff; font-size: 12px; font-weight: 800; }
.file-field small { margin-top: auto; font-size: 11px; overflow-wrap: anywhere; }
.poster-preview { width: 100%; margin-top: 4px; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.poster-preview[hidden] { display: none; }
.poster-preview img { width: 100%; height: 100%; object-fit: cover; }
.file-field--poster:has(.poster-preview:not([hidden])) { min-height: 320px; }
.file-field--compact { min-height: 132px; }
.file-field--wide { grid-column: 1 / -1; }

.upload-progress { margin-top: 24px; display: grid; gap: 8px; }
.upload-progress[hidden] { display: none; }
.upload-progress label { color: var(--navy-soft); font-size: 12px; font-weight: 750; }
.upload-progress progress { width: 100%; height: 14px; accent-color: var(--blue); }
.form-status { min-height: 22px; margin: 15px 0 0; color: var(--muted); font-size: 12px; }
.form-status.is-error { color: var(--danger); }
.form-status.is-success { color: var(--success); }
.upload-submit { margin-top: 4px; }

.library-section { margin-top: 36px; }
.library-heading { margin-bottom: 26px; }
.video-list { display: grid; gap: 22px; }
.empty-state {
  min-height: 270px;
  padding: 42px 28px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  border: 1px dashed rgba(47, 128, 186, 0.55);
  background: rgba(255, 255, 255, 0.72);
}
.empty-state > span { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 50%; background: var(--navy); color: #fff; }
.empty-state h3 { margin: 20px 0 0; font-family: var(--serif); font-size: 28px; font-weight: 500; }
.empty-state p { margin: 8px 0 0; color: var(--muted); }

.video-card {
  display: grid;
  grid-template-columns: minmax(320px, 0.78fr) minmax(0, 1.22fr);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 18px 46px rgba(11, 46, 79, 0.1);
}
.video-card-media { min-height: 0; align-self: start; background: var(--navy); }
.video-preview-stage { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--navy); }
.video-preview-stage > img, .video-preview-stage > video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.video-preview-stage > img { object-fit: cover; }
.video-preview-stage > video { object-fit: contain; }
.video-preview-play { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; width: 100%; border: 0; padding: 16px; color: #fff; background: linear-gradient(transparent, rgb(8 30 49 / 34%)); cursor: pointer; font: inherit; }
.video-preview-play-icon { display: grid; place-items: center; width: 64px; height: 64px; border: 2px solid #fff; border-radius: 50%; background: rgb(8 30 49 / 88%); box-shadow: 0 4px 18px rgb(0 0 0 / 25%); }
.video-preview-play-label { border-radius: 4px; padding: 5px 10px; background: rgb(8 30 49 / 90%); font-size: 14px; font-weight: 700; }
.video-preview-play:hover .video-preview-play-icon { background: var(--navy); }
.video-preview-play:focus-visible { outline: 3px solid #fff; outline-offset: -6px; box-shadow: inset 0 0 0 9px var(--navy); }
.video-preview-error { margin: 0; padding: 12px 16px; color: #8b1c1c; background: #fff2f2; font-size: 14px; line-height: 1.5; }
.video-preview-stage > [hidden], .video-preview-frame[hidden], .video-preview-error[hidden] { display: none; }
.video-preview-frame[hidden] + .edit-form { grid-column: 1 / -1; }
.video-card-main { min-width: 0; padding: 27px 28px; display: flex; flex-direction: column; }
.video-card-meta { display: flex; justify-content: space-between; gap: 18px; color: var(--blue); font-size: 10px; font-weight: 850; letter-spacing: 0.1em; text-transform: uppercase; }
.video-card h3 { margin: 12px 0 0; font-family: var(--serif); font-size: clamp(27px, 2.8vw, 38px); font-weight: 500; line-height: 1.1; letter-spacing: -0.025em; }
.video-card-main > p { margin: 13px 0 0; color: var(--muted); font-size: 13px; }
.video-card-muted { font-style: italic; }
.video-card-stats { margin: 24px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.video-card-stats div { padding: 12px 13px; border-left: 2px solid rgba(47, 128, 186, 0.42); background: var(--ice); }
.video-card-stats dt { color: var(--muted); font-size: 10px; }
.video-card-stats dd { margin: 2px 0 0; color: var(--navy); font-size: 15px; font-weight: 800; }
.video-card-actions { margin-top: auto; padding-top: 22px; display: flex; flex-wrap: wrap; gap: 10px; }
.status-pill { min-height: 44px; padding: 0 13px; display: inline-flex; align-items: center; border-radius: 999px; font-size: 11px; font-weight: 800; }
.status-pill--blocked { border: 1px solid #e5b4b0; background: #fff5f4; color: #8e302b; }

.video-manage { grid-column: 1 / -1; border-top: 1px solid var(--line); background: #f8fbfd; scroll-margin-top: 18px; }
.video-manage > summary,
.settings-panel > summary {
  min-height: 58px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--navy-soft);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}
.video-manage > summary::-webkit-details-marker,
.settings-panel > summary::-webkit-details-marker { display: none; }
.video-manage[open] > summary span,
.settings-panel[open] > summary span { transform: rotate(45deg); }
.manage-content { padding: 26px; display: grid; grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr); gap: 24px; border-top: 1px solid var(--line); }
.video-preview-frame { align-self: start; aspect-ratio: 16 / 9; background: var(--navy); }
.video-preview-frame video { width: 100%; height: 100%; display: block; object-fit: contain; }
.edit-form { display: grid; gap: 14px; }
.edit-form .button-secondary { justify-self: start; }
.checkbox-field { display: flex; align-items: flex-start; gap: 9px; color: var(--navy-soft); font-size: 12px; }
.checkbox-field input { margin-top: 5px; }

.link-manager { grid-column: 1 / -1; margin-top: 8px; padding-top: 26px; border-top: 1px solid var(--line); }
.subsection-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.subsection-heading h4 { margin: 0; font-family: var(--serif); font-size: 27px; font-weight: 500; }
.subsection-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.link-list { margin-top: 18px; display: grid; gap: 9px; }
.link-row {
  min-width: 0;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(120px, 0.42fr) minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  background: #fff;
}
.link-row > div { min-width: 0; }
.link-row strong { display: block; font-size: 12px; overflow-wrap: anywhere; }
.link-row small { color: var(--muted); font-size: 10px; }
.link-row form { margin: 0; }
.link-row--revoked { grid-template-columns: minmax(0, 1fr); opacity: 0.66; }
.text-danger { padding: 4px 0; border: 0; border-bottom: 1px solid currentColor; background: transparent; color: var(--danger); font-size: 11px; font-weight: 800; cursor: pointer; }

.new-link-form { margin-top: 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; }
.new-link-form label { display: grid; gap: 7px; color: var(--navy-soft); font-size: 11px; font-weight: 750; }
.new-link-form small { color: var(--muted); font-size: 10px; font-weight: 500; }
.danger-zone { grid-column: 1 / -1; margin-top: 6px; border-top: 1px solid rgba(163, 59, 52, 0.25); }
.danger-zone > summary { padding-top: 18px; color: var(--danger); font-size: 12px; font-weight: 800; cursor: pointer; }
.danger-zone form { margin-top: 15px; padding: 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid #e5b4b0; background: #fff5f4; }
.danger-zone label { color: #7d2d29; font-size: 12px; }

.settings-panel { margin-top: 18px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.82); }
.settings-form { padding: 22px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; align-items: end; gap: 12px; border-top: 1px solid var(--line); }
.settings-form label { display: grid; gap: 7px; color: var(--navy-soft); font-size: 11px; font-weight: 750; }
.settings-hint { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 11px; }

.copy-status {
  position: fixed;
  z-index: 50;
  right: 20px;
  bottom: 20px;
  max-width: min(360px, calc(100vw - 40px));
  margin: 0;
  padding: 12px 15px;
  transform: translateY(140%);
  border-radius: 4px;
  background: var(--navy);
  color: #fff;
  font-size: 12px;
  opacity: 0;
  transition: transform 180ms ease, opacity 180ms ease;
}
.copy-status.is-visible { transform: translateY(0); opacity: 1; }

@media (max-width: 1000px) {
  .video-card { grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr); }
  .settings-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-form button { justify-self: start; }
}

@media (max-width: 900px) {
  .dashboard-intro { grid-template-columns: minmax(0, 1fr); align-items: start; gap: 26px; }
  .intro-action { width: fit-content; }
  .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .stats-grid article { min-height: 145px; padding: 20px 18px; }
  .stats-grid strong { font-size: 39px; }
  .section-heading { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .video-card { grid-template-columns: minmax(0, 1fr); }
  .video-card-media { min-height: 0; }
  .video-manage { grid-column: auto; }
  .manage-content { grid-template-columns: minmax(0, 1fr); }
  .link-manager,
  .danger-zone { grid-column: auto; }
  .link-row { grid-template-columns: minmax(120px, 0.45fr) minmax(180px, 1fr) auto; }
  .link-row form { grid-column: 3; }
}

@media (max-width: 680px) {
  .header-actions { gap: 8px; }
  .library-filters { padding: 20px 16px; }
  .library-filter-fields { grid-template-columns: minmax(0, 1fr); }
  .library-filter-actions { width: 100%; }
  .library-filter-actions button { flex: 1 1 140px; }
  .portal-badge { display: none; }
  .dashboard-intro h1 { font-size: clamp(34px, 9vw, 44px); }
  .stats-grid { grid-template-columns: minmax(0, 1fr); }
  .stats-grid article { min-height: 126px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .field--wide { grid-column: auto; }
  .alert-card { grid-template-columns: minmax(0, 1fr); }
  .share-copy-row { grid-template-columns: minmax(0, 1fr); }
  .video-card-main { padding: 23px 20px; }
  .video-card-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .video-card-stats div:last-child { grid-column: 1 / -1; }
  .video-card-actions { display: grid; grid-template-columns: minmax(0, 1fr); }
  .video-card-actions > * { width: 100%; }
  .manage-content { padding: 20px; }
  .subsection-heading { align-items: start; flex-direction: column; gap: 6px; }
  .link-row { grid-template-columns: minmax(0, 1fr); }
  .link-row form { grid-column: auto; }
  .link-row .button-secondary,
  .link-row .text-danger { width: 100%; }
  .new-link-form { grid-template-columns: minmax(0, 1fr); }
  .danger-zone form { align-items: stretch; flex-direction: column; }
  .settings-form { grid-template-columns: minmax(0, 1fr); }
  .settings-form button { width: 100%; }
}

@media (max-width: 410px) {
  .header-logout { min-height: 38px; padding-inline: 10px; font-size: 10px; }
  .dashboard-page .portal-main { padding-top: 42px; }
  .intro-action,
  .upload-submit { width: 100%; }
  .panel.upload-panel { padding: 24px 18px; }
  .video-card-stats { grid-template-columns: minmax(0, 1fr); }
  .video-card-stats div:last-child { grid-column: auto; }
  .video-manage > summary,
  .settings-panel > summary { padding-inline: 18px; }
}

/* Private Einzelansicht */
.watch-page {
  background:
    radial-gradient(circle at 88% 4%, rgba(190, 220, 233, 0.48), transparent 31%),
    linear-gradient(160deg, #ffffff 0%, #eef7fb 100%);
}

.watch-shell { width: min(1080px, calc(100vw - 48px)); margin-inline: auto; }
.watch-header { border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, 0.92); }
.watch-header-inner { min-height: 88px; padding-block: 14px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; }
.watch-brand { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 13px; line-height: 1.05; text-decoration: none; }
.watch-brand img { flex: 0 0 auto; width: 48px; height: 48px; }
.watch-brand span { flex: 0 0 auto; white-space: nowrap; font-size: 13px; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; }
.watch-brand strong { display: block; font-size: 16px; }
.watch-badge { padding: 8px 13px; border: 1px solid rgba(47, 128, 186, 0.34); border-radius: 999px; background: var(--ice); color: var(--navy-soft); font-size: 11px; font-weight: 850; letter-spacing: 0.06em; text-transform: uppercase; }
.watch-main { flex: 1; padding: clamp(50px, 6.5vw, 84px) 0 clamp(66px, 8vw, 100px); }
.watch-title { max-width: 100%; }
.watch-title h1 { text-wrap: balance; }
.watch-title h1,
.watch-unavailable h1,
.exchange-card h1 { margin: 0; font-family: var(--serif); font-size: clamp(38px, 5.3vw, 64px); font-weight: 500; line-height: 1.05; letter-spacing: -0.04em; }
.watch-player { margin-top: 34px; overflow: hidden; aspect-ratio: 16 / 9; border: 1px solid rgba(11, 50, 86, 0.22); background: #061a2b; box-shadow: 0 26px 66px rgba(11, 46, 79, 0.18); }
.watch-player video { width: 100%; height: 100%; display: block; object-fit: contain; }
.watch-description { max-width: 840px; margin: 26px 0 0; color: var(--muted); font-size: 16px; line-height: 1.72; }
.watch-next-steps {
  margin-top: clamp(38px, 5vw, 58px);
  padding: clamp(26px, 4.5vw, 44px);
  border: 1px solid var(--line);
  border-top: 5px solid var(--blue);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 20px 50px rgba(11, 46, 79, 0.11);
}
.watch-next-steps-intro { max-width: 760px; }
.watch-next-steps-intro h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(28px, 3.5vw, 42px);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.03em;
}
.watch-next-steps-intro > p:last-child { margin: 16px 0 0; color: var(--muted); }
.watch-next-step-grid { margin-top: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.watch-next-step {
  min-width: 0;
  min-height: 116px;
  padding: 20px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid var(--line);
  background: var(--ice);
  color: var(--navy);
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.watch-next-step--primary {
  min-height: 128px;
  margin-top: 28px;
  border-color: var(--navy);
  background: var(--navy);
  color: #fff;
}
.watch-next-step span { min-width: 0; display: grid; gap: 6px; }
.watch-next-step small { color: var(--blue); font-size: 10px; font-weight: 850; letter-spacing: 0.12em; text-transform: uppercase; }
.watch-next-step--primary small { color: #9ed6ef; }
.watch-next-step strong { font-size: clamp(16px, 1.7vw, 20px); line-height: 1.3; overflow-wrap: anywhere; }
.watch-next-step b { flex: 0 0 auto; color: var(--blue); font-size: 25px; transition: transform 180ms ease; }
.watch-next-step--primary b { color: #fff; }
.watch-receipt { scroll-margin-block: 24px; animation: watch-receipt-in 480ms ease both; }
.watch-next-step--preview { opacity: 0.55; cursor: default; }
@keyframes watch-receipt-in { from { opacity: 0; transform: translateY(14px); } }
.watch-note { max-width: 820px; margin-top: 30px; padding: 17px 18px; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; border-left: 3px solid var(--blue); background: rgba(255, 255, 255, 0.82); }
.watch-note > span { width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid var(--blue); border-radius: 50%; color: var(--blue); font-family: var(--serif); font-weight: 700; }
.watch-note p { margin: 0; color: var(--muted); font-size: 12px; }
.watch-footer { padding: 25px 0; border-top: 1px solid var(--line); background: rgba(255, 255, 255, 0.78); }
.watch-footer .watch-shell { display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.watch-footer p { margin: 0; color: var(--muted); font-size: 12px; }
.watch-footer div { display: flex; gap: 18px; }
.watch-footer a { color: var(--navy-soft); font-size: 12px; font-weight: 750; }
.watch-unavailable { max-width: 820px; min-height: 55vh; display: grid; align-content: center; }
.watch-unavailable > p:last-child { max-width: 680px; margin: 24px 0 0; color: var(--muted); font-size: 17px; }

.exchange-page .watch-main { display: grid; place-items: center; padding-block: 44px; }
.exchange-card { max-width: 760px; padding: clamp(30px, 6vw, 58px); border: 1px solid var(--line); border-top: 5px solid var(--blue); background: rgba(255, 255, 255, 0.96); box-shadow: 0 24px 65px rgba(11, 46, 79, 0.13); }
.exchange-card .watch-brand { margin-bottom: 52px; }
.exchange-card > p:not(.eyebrow) { max-width: 620px; margin: 24px 0 0; color: var(--muted); }
.exchange-loader { width: 34px; height: 34px; margin-top: 26px; display: block; border: 3px solid rgba(47, 128, 186, 0.2); border-top-color: var(--blue); border-radius: 50%; animation: exchange-spin 800ms linear infinite; }
.exchange-loader[hidden] { display: none; }
.watch-error { color: var(--danger) !important; }
@keyframes exchange-spin { to { transform: rotate(360deg); } }

@media (max-width: 680px) {
  .watch-shell { width: calc(100vw - 28px); }
  .watch-header-inner { min-height: 78px; }
  .watch-brand img { width: 42px; height: 42px; }
  .watch-brand span { font-size: 11px; }
  .watch-brand strong { font-size: 14px; }
  .watch-badge { padding: 7px 10px; font-size: 9px; }
  .watch-title h1,
  .watch-unavailable h1,
  .exchange-card h1 { font-size: clamp(32px, 9.5vw, 42px); }
  .watch-player { margin-top: 26px; width: calc(100% + 28px); margin-left: -14px; border-left: 0; border-right: 0; }
  .watch-description { font-size: 14px; }
  .watch-next-steps { margin-top: 34px; padding: 25px 20px; }
  .watch-next-step-grid { grid-template-columns: minmax(0, 1fr); }
  .watch-next-step { min-height: 104px; padding: 18px; }
  .watch-next-step--primary { min-height: 114px; margin-top: 24px; }
  .watch-footer .watch-shell { align-items: flex-start; flex-direction: column; gap: 8px; }
  .exchange-card { width: calc(100vw - 28px); }
  .exchange-card .watch-brand { margin-bottom: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  .exchange-loader { animation: none; border-color: var(--blue); }
  .copy-status { transition: none; }
  .watch-receipt { animation: none; }
}

@media (hover: hover) and (pointer: fine) {
  .watch-next-step:hover {
    transform: translateY(-3px);
    border-color: rgba(47, 128, 186, 0.7);
    box-shadow: 0 14px 30px rgba(11, 46, 79, 0.12);
  }
  .watch-next-step:hover b { transform: translateX(4px); }
  .watch-next-step--primary:hover { border-color: var(--navy); }
  .watch-next-step--preview:hover { transform: none; box-shadow: none; }
  .watch-next-step--preview:hover b { transform: none; }
}

/* Öffentliche Videomediathek */
.public-library-page {
  background:
    radial-gradient(circle at 88% 3%, rgba(190, 220, 233, 0.58), transparent 31%),
    linear-gradient(160deg, #fff 0%, var(--ice) 100%);
}

.public-library-brand { text-decoration: none; }
.public-library-main { flex: 1; }
.public-library-hero {
  padding: clamp(70px, 9vw, 116px) 0 clamp(64px, 8vw, 98px);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--navy);
  color: #fff;
}

.public-library-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  align-items: end;
  gap: clamp(42px, 8vw, 104px);
}

.public-library-hero .eyebrow { color: #9ed6ef; }
.public-library-hero h1 {
  max-width: 820px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(44px, 5.7vw, 72px);
  font-weight: 500;
  line-height: 1.03;
  letter-spacing: -0.045em;
}

.public-library-hero-grid > p {
  max-width: 510px;
  margin: 0;
  color: rgba(255, 255, 255, 0.75);
  font-size: 16px;
  line-height: 1.75;
}

.public-library-content { padding: clamp(64px, 8vw, 104px) 0 clamp(76px, 9vw, 120px); }
.public-library-heading {
  margin-bottom: 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 36px;
}

.public-library-heading h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(34px, 4vw, 50px);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.public-library-heading > p { margin: 0; color: var(--muted); font-size: 12px; font-weight: 750; }
.public-library-message { padding: 20px; border-left: 4px solid var(--danger); background: #fff5f4; color: #7d2d29; }
.public-library-empty { background: rgba(255, 255, 255, 0.84); }
.public-video-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; align-items: stretch; }

.public-video-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--navy);
  text-decoration: none;
  box-shadow: 0 18px 46px rgba(11, 46, 79, 0.1);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.public-video-poster { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #061a2b; }
.public-video-poster img { width: 100%; height: 100%; object-fit: cover; transition: transform 260ms ease; }
.public-video-play {
  position: absolute;
  left: 24px;
  bottom: 22px;
  width: 58px;
  height: 58px;
  padding-left: 4px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  background: rgba(11, 46, 79, 0.88);
  color: #fff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.24);
}

.public-video-copy { min-height: 264px; padding: 27px 28px 25px; display: flex; flex-direction: column; }
.public-video-copy small { color: var(--blue); font-size: 10px; font-weight: 850; letter-spacing: 0.12em; text-transform: uppercase; }
.public-video-copy strong { margin-top: 10px; font-family: var(--serif); font-size: clamp(26px, 2.5vw, 35px); font-weight: 500; line-height: 1.12; letter-spacing: -0.025em; }
.public-video-copy > span { margin-top: 14px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.public-video-copy b { margin-top: auto; padding-top: 24px; display: flex; align-items: center; justify-content: space-between; gap: 18px; color: var(--navy-soft); font-size: 12px; }
.public-video-copy b span { color: var(--blue); font-size: 18px; transition: transform 180ms ease; }
.watch-back { margin: 30px 0 0; }
.watch-back a { color: var(--navy-soft); font-size: 12px; font-weight: 800; text-decoration-thickness: 1px; text-underline-offset: 4px; }

@media (hover: hover) and (pointer: fine) {
  .public-video-card:hover { transform: translateY(-5px); border-color: rgba(47, 128, 186, 0.5); box-shadow: 0 26px 58px rgba(11, 46, 79, 0.16); }
  .public-video-card:hover .public-video-poster img { transform: scale(1.025); }
  .public-video-card:hover .public-video-copy b span { transform: translateX(4px); }
}

@media (max-width: 900px) {
  .public-library-hero-grid { grid-template-columns: minmax(0, 1fr); align-items: start; gap: 30px; }
  .public-video-grid { gap: 18px; }
  .public-video-copy { min-height: 250px; padding: 24px 22px; }
}

@media (max-width: 680px) {
  .public-library-hero { padding-block: 58px 64px; }
  .public-library-hero h1 { font-size: clamp(37px, 11vw, 50px); }
  .public-library-hero-grid > p { font-size: 14px; }
  .public-library-heading { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .public-video-grid { grid-template-columns: minmax(0, 1fr); }
  .public-video-copy { min-height: 232px; }
  .public-video-play { left: 18px; bottom: 17px; width: 50px; height: 50px; }
}

/* Der Name des Betreibers kommt aus der Einrichtung und kann lang sein: Er darf
   umbrechen, statt auf schmalen Bildschirmen aus dem Kopf zu laufen. */
.portal-brand,
.watch-brand { flex: 0 1 auto; min-width: 0; }
.portal-brand span,
.watch-brand span { flex: 0 1 auto; min-width: 0; white-space: normal; overflow-wrap: anywhere; }
