:root {
  color-scheme: light;
  --background: #f6f4ef;
  --panel: #ffffff;
  --text: #1e2528;
  --muted: #667174;
  --accent: #f48929;
  --accent-dark: #f48929;
  --border: #d9dedb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--background);
}

.shell,
.library-shell {
  min-height: 100vh;
  padding: 24px;
}

.shell {
  display: grid;
  place-items: center;
}

.library-shell {
  width: min(100%, 1160px);
  margin: 0 auto;
}

.panel {
  width: min(100%, 560px);
  padding: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 14px;
  font-size: clamp(2rem, 7vw, 3.4rem);
  line-height: 1;
  letter-spacing: 0;
}

.lede {
  margin: 0 0 28px;
  color: var(--muted);
  line-height: 1.55;
}

.message {
  min-height: 22px;
  margin: 2px 0 0;
  color: var(--muted);
}

.login-preview {
  display: grid;
  gap: 8px;
}

label {
  font-weight: 700;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

input,
button {
  min-height: 44px;
  border-radius: 6px;
  font: inherit;
}

input {
  width: 100%;
  border: 1px solid var(--border);
  padding: 0 12px;
}

button {
  border: 0;
  padding: 0 18px;
  color: #ffffff;
  background: var(--accent-dark);
}

input:disabled,
button:disabled {
  opacity: 0.72;
}

.library-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 28px 0;
}

.library-header.compact {
  padding-bottom: 18px;
}

.library-header h1 {
  margin-bottom: 0;
}

.back-link {
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: none;
}

.video-list {
  display: grid;
  gap: 12px;
  padding-bottom: 40px;
}

.video-row {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  min-height: 112px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: inherit;
  background: var(--panel);
  text-decoration: none;
}

.video-row:hover,
.video-row:focus-visible {
  border-color: var(--accent);
  outline: 0;
}

.video-thumb {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 6px;
  color: #ffffff;
  background: var(--accent-dark);
  font-size: 2rem;
  font-weight: 800;
}

.video-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-row-copy h2 {
  margin: 0 0 8px;
  font-size: 1.25rem;
  line-height: 1.2;
}

.video-row-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.video-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}

.video-frame,
.lesson-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

.video-frame {
  overflow: hidden;
}

video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #111719;
}

.video-controls {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 16px;
  align-items: center;
  padding: 12px;
  border-top: 1px solid var(--border);
}

.video-controls button {
  min-width: 82px;
}

#fullscreenButton {
  min-width: 112px;
}

.video-controls input[type="range"] {
  width: 100%;
  margin: 0;
}

#timeReadout {
  min-width: 94px;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: right;
}

.lesson-panel {
  padding: 22px;
}

.lesson-panel h2 {
  margin: 0 0 12px;
  font-size: 1.45rem;
  line-height: 1.1;
}

.lesson-panel h1 {
  margin: 0 0 12px;
  font-size: 1.7rem;
  line-height: 1.1;
}

.lesson-panel p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.assets-panel {
  margin-top: 20px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

.assets-panel h2 {
  margin: 0 0 12px;
  font-size: 1.2rem;
}

.assets-text {
  color: var(--muted);
  line-height: 1.65;
  white-space: normal;
}

.assets-text a {
  color: var(--accent-dark);
  font-weight: 700;
}

@media (max-width: 560px) {
  .panel {
    padding: 24px;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .video-controls {
    grid-template-columns: 1fr;
  }

  #timeReadout {
    text-align: left;
  }

  .video-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .library-header,
  .video-layout {
    grid-template-columns: 1fr;
  }

  .library-header {
    display: grid;
  }

  .library-header button {
    width: fit-content;
  }
}
