:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #182925;
  background: #f3f6f4;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input { font: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible, video:focus-visible {
  outline: 3px solid #dfaa43;
  outline-offset: 2px;
}

.header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  max-width: 1440px;
  margin: auto;
  padding: 32px 32px 24px;
}
.eyebrow, .exercise-code { color: #28745f; font-size: .72rem; font-weight: 750; letter-spacing: .11em; }
.eyebrow { margin: 0 0 8px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 5px; font-size: clamp(1.8rem, 4vw, 2.45rem); letter-spacing: -.04em; }
.subtitle, .muted { color: #60716a; }
.subtitle { margin: 0; }
.notice { margin: 0; padding: 8px 12px; border-radius: 6px; background: #e3ede7; color: #30634f; font-size: .82rem; white-space: nowrap; }
.layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px; max-width: 1440px; margin: 0 auto; padding: 0 32px 40px; align-items: start; }
.panel { background: #fff; border: 1px solid #dce5df; border-radius: 12px; }
.library { padding: 20px; }
.library-heading, .events-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.library-heading h2 { margin: 0; font-size: 1.05rem; }
.library-heading span, .events-heading span { color: #60716a; font-size: .78rem; }
.search-label { display: block; margin: 20px 0 7px; font-size: .78rem; font-weight: 650; }
input[type="search"] { width: 100%; padding: 10px 11px; border: 1px solid #cbd8d0; border-radius: 7px; background: #fbfcfb; }
.exercise-list { max-height: min(68vh, 720px); overflow-y: auto; list-style: none; padding: 0; margin: 14px -8px -8px; }
.exercise-list li { margin: 2px 0; }
.exercise-list button { width: 100%; display: flex; gap: 10px; align-items: baseline; padding: 10px 8px; text-align: left; color: #253b33; background: transparent; border: 0; border-radius: 6px; cursor: pointer; }
.exercise-list button:hover { background: #f0f6f2; }
.exercise-list button[aria-current="true"] { background: #e4f1e9; color: #185a43; font-weight: 650; }
.list-code { flex: 0 0 55px; color: #658078; font-size: .72rem; font-weight: 700; }
.list-name { font-size: .86rem; line-height: 1.35; }
#list-message { margin: 18px 0 4px; font-size: .88rem; }

.viewer { padding: 24px; min-width: 0; }
.viewer-heading { padding-bottom: 21px; border-bottom: 1px solid #e6ece8; }
.viewer-heading h2 { margin: 7px 0; font-size: clamp(1.25rem, 3vw, 1.65rem); letter-spacing: -.025em; }
.viewer-heading p { margin: 0; font-size: .87rem; }
.viewer-body { display: grid; grid-template-columns: minmax(200px, 360px) minmax(220px, 1fr); gap: 30px; padding-top: 24px; align-items: start; }
.video-wrap { width: 100%; max-width: 360px; overflow: hidden; border-radius: 8px; background: #202923; }
video { display: block; width: 100%; aspect-ratio: 9 / 16; object-fit: contain; }
.details h3 { margin: 21px 0 7px; font-size: .9rem; }
.count-card { display: flex; align-items: baseline; gap: 8px; padding: 15px 16px; background: #f1f7f3; border: 1px solid #dcebe1; border-radius: 8px; color: #245f49; }
.count-card strong { font-size: 1.6rem; line-height: 1; }
.count-card span { font-size: .83rem; }
.detail-text, .detail-note { color: #4d6158; font-size: .87rem; line-height: 1.55; }
.detail-text { margin-bottom: 0; }
.detail-note { margin: 9px 0 0; }
.download-link { display: inline-block; margin-top: 14px; color: #1d6d51; font-size: .85rem; font-weight: 650; }
.events-heading { margin-top: 25px; border-bottom: 1px solid #e6ece8; }
.events-heading h3 { margin: 0 0 10px; }
#events-message { margin: 12px 0; font-size: .85rem; }
.events-list { list-style: none; margin: 0; padding: 0; }
.events-list button { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 10px 4px; color: #253b33; text-align: left; border: 0; border-bottom: 1px solid #edf1ee; background: transparent; cursor: pointer; }
.events-list button:hover { color: #1d6d51; background: #f7faf8; }
.event-title { font-size: .83rem; font-weight: 650; white-space: nowrap; }
.event-time { color: #60716a; font-size: .76rem; text-align: right; }

@media (max-width: 800px) {
  .header { padding: 24px 18px 20px; align-items: start; flex-direction: column; gap: 12px; }
  .notice { white-space: normal; }
  .layout { grid-template-columns: 1fr; padding: 0 18px 28px; gap: 14px; }
  .library { padding: 16px; }
  .exercise-list { max-height: 220px; }
  .viewer { padding: 18px; }
  .viewer-body { grid-template-columns: 1fr; gap: 20px; }
  .video-wrap { margin: 0 auto; }
}
