:root {
  color-scheme: light;
  --ink: #202620;
  --muted: #5c655e;
  --canvas: #f3f5ef;
  --paper: #fff;
  --line: #dfe4db;
  --dark: #151b17;
  --dark-soft: #222b23;
  --lime: #d4f66b;
  --green: #32563b;
  --radius: 19px;
  --edge: clamp(18px, 4vw, 54px);
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  background: var(--canvas);
  color: var(--ink);
  text-rendering: optimizeLegibility;
}

*, *::before, *::after { box-sizing: border-box; }
body { min-width: 300px; margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1rem; line-height: 1.62; }
p:last-child { margin-bottom: 0; }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -.035em; }
h1 { font-size: clamp(2.15rem, 4.1vw, 3.4rem); font-weight: 760; }
h2 { font-size: clamp(1.23rem, 2vw, 1.5rem); font-weight: 730; }
h3 { font-size: 1.12rem; font-weight: 720; }
small { font-size: .875rem; }
svg { display: block; flex: 0 0 auto; }
:focus-visible { outline: 3px solid #6a9630; outline-offset: 3px; }
main:focus { outline: none; }
[hidden] { display: none !important; }
.skip-link { position: fixed; top: 10px; left: 10px; z-index: 20; padding: 12px; background: var(--lime); transform: translateY(-150%); }
.skip-link:focus { transform: none; }

.shell { display: grid; grid-template-columns: 231px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { background: var(--dark); color: #f2f6ee; position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; padding: 30px 17px 19px; }
.brand { display: flex; gap: 11px; align-items: center; padding: 0 10px; font-size: 1.38rem; font-weight: 750; letter-spacing: -.045em; }
.brand small { display: block; color: #a7b6a4; margin-top: 2px; font-size: .65rem; font-weight: 650; letter-spacing: .13em; }
.brand-mark { width: 39px; height: 39px; flex: 0 0 auto; border-radius: 12px; display: inline-grid; place-items: center; background: var(--lime); color: #242d12; font-size: 1.38rem; font-weight: 850; font-style: italic; letter-spacing: -.12em; padding-right: .12em; }
.brand-light { color: #c2cfbb; font-weight: 500; }
.nav { display: grid; gap: 5px; margin-top: 46px; }
.nav a, .connection-link { display: flex; align-items: center; gap: 12px; min-height: 47px; border-radius: 10px; padding: 10px 12px; color: #bfcbbd; font-size: .94rem; font-weight: 600; }
.nav a:hover, .connection-link:hover { background: #253026; color: #fff; }
.nav a[aria-current], .connection-link[aria-current] { color: var(--lime); background: #2a3826; }
.connection-link { margin-top: auto; }
.main-wrap { min-width: 0; }
.toolbar { display: flex; justify-content: space-between; align-items: center; min-height: 64px; gap: 15px; padding: 0 var(--edge); border-bottom: 1px solid #e3e8df; background: #f9faf6; color: var(--muted); }
.toolbar-label, .toolbar-end { font-size: .88rem; font-weight: 620; }
.toolbar-end { display: inline-flex; align-items: center; gap: 7px; }
.toolbar-end:hover { color: var(--green); }
.toolbar-end svg { width: 17px; height: 17px; }
.mobile-brand, .bottom-nav { display: none; }
#main { max-width: 1470px; margin: 0 auto; padding: 31px var(--edge) 45px; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 17px; margin: 0 0 25px; }
.page-head p { color: var(--muted); margin: 10px 0 0; line-height: 1.48; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 3px 10px #202f1906; min-width: 0; }
.inside { padding: clamp(16px, 2.4vw, 25px); }
.stack { display: grid; gap: 18px; align-content: start; min-width: 0; }
.home-grid, .detail-grid { display: grid; grid-template-columns: minmax(0, 1.42fr) minmax(0, 1fr); gap: 18px; margin-top: 18px; align-items: start; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-head p { color: var(--muted); margin: 6px 0 0; font-size: .94rem; }
.section-head + p { color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 7px; width: fit-content; min-height: 43px; padding: 9px 14px; border: 1px solid #d7dfd4; border-radius: 10px; background: var(--paper); color: var(--ink); font-weight: 670; font-size: .9rem; line-height: 1.25; white-space: nowrap; }
.button:hover { border-color: #9db093; background: #f0f4ed; }
.button svg { width: 17px; height: 17px; }
.button:disabled { cursor: wait; opacity: .65; }
.button.primary { background: var(--lime); border-color: #c1e25b; color: #1a290d; }
.button.primary:hover { background: #e0fb8e; }
.button.text-button { padding-inline: 0; border-color: transparent; background: transparent; color: var(--green); white-space: normal; }
.button.text-button:hover { text-decoration: underline; }
.button.danger { color: #9b382a; border-color: #efd8cf; }
.button.danger:hover { background: #fff0ed; }
.icon-button { width: 42px; height: 42px; padding: 0; place-items: center; display: inline-grid; border: 0; background: transparent; color: var(--muted); border-radius: 9px; }
.icon-button:hover { background: var(--canvas); }
.back { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 13px; color: var(--green); font-weight: 650; font-size: .92rem; }
.back span { font-size: 1.36rem; line-height: 1; }
.back:hover { text-decoration: underline; }

.hero { overflow: hidden; position: relative; display: grid; align-items: center; min-height: 270px; background: radial-gradient(ellipse at 86% 81%, #3f5730 0%, #293b26 26%, #1c2720 59%, #19231d 100%); border: 0; color: #f9fcf5; }
.hero-body { position: relative; z-index: 1; max-width: 620px; padding: clamp(22px, 3.8vw, 39px); }
.hero-tag { display: inline-flex; align-items: center; gap: 7px; color: #deefcb; font-weight: 670; font-size: .85rem; }
.hero-tag svg { width: 17px; }
.hero h2 { font-size: clamp(2.35rem, 6vw, 4.8rem); font-weight: 760; letter-spacing: -.065em; margin: 10px 0 10px; }
.hero p { margin: 0 0 22px; color: #e1e9dc; }
.hero-link { background: #ffffff12; border-color: #ffffff37; color: #f9fcf5; }
.hero-link:hover { background: #ffffff27; border-color: #ffffff74; }
.hero-art { position: absolute; inset: 0 0 0 auto; z-index: 0; width: 50%; overflow: hidden; pointer-events: none; mask-image: linear-gradient(90deg, transparent, black 33%); }
.hero-art i { position: absolute; top: -54%; right: 0; width: 104%; height: 200%; border: 1.5px solid #c9ef6c5c; border-radius: 45%; transform: rotate(41deg); }
.hero-art i:nth-child(2) { right: -11%; border-color: #c9ef6c77; }
.hero-art i:nth-child(3) { right: -22%; border-color: #c9ef6c99; }
.hero-art i:nth-child(4) { right: -33%; border-color: #c9ef6cae; }
.hero-art b { position: absolute; width: 11px; height: 11px; top: 38%; right: 32%; border-radius: 50%; background: #d3f76d; box-shadow: 0 0 24px #d3f76d80; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.stat { display: flex; align-items: center; gap: 12px; padding: 14px; }
.stat:hover, .group-card:hover { border-color: #a7b79e; }
.stat-icon { display: inline-grid; width: 43px; height: 43px; flex: 0 0 auto; place-items: center; background: #eaf0e6; color: var(--green); border-radius: 12px; }
.stat small { display: block; color: var(--muted); font-weight: 590; }
.stat strong { display: block; font-size: 1.8rem; font-weight: 730; line-height: 1.07; letter-spacing: -.055em; margin-top: 5px; }
.stat em { color: var(--muted); font-size: 1rem; font-style: normal; letter-spacing: 0; }
.pill { min-height: 26px; display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 10px; font-size: .81rem; font-weight: 690; white-space: nowrap; background: #eff1ec; color: #505b52; }
.pill.neutral { background: #eef2ea; color: #4a604b; }
.pill.learning { color: #5a460a; background: #f5eabf; }
.pill.review { color: #7b422b; background: #f9e8dc; }
.pill.ready { color: #345124; background: #e1f2cb; }
progress { appearance: none; display: block; height: 9px; width: 100%; margin: 2px 0 8px; border: 0; border-radius: 20px; background: #e9eee5; }
progress::-webkit-progress-bar { border-radius: 20px; background: #e9eee5; }
progress::-webkit-progress-value { border-radius: 20px; background: #79a349; }
progress::-moz-progress-bar { border-radius: 20px; background: #79a349; }
.simple-list { margin-bottom: 3px; }
.simple-list a { display: grid; grid-template-columns: 11px minmax(0, 1fr) 18px; gap: 11px; align-items: center; min-height: 41px; border-bottom: 1px solid #edf0ea; font-size: .96rem; font-weight: 600; }
.simple-list a:hover { color: var(--green); }
.simple-list svg { color: #80917e; width: 16px; }
.row-dot { width: 7px; height: 7px; border-radius: 50%; background: #a4b29f; }
.row-dot.ready { background: #729641; }
.row-dot.review { background: #cb7654; }
.row-dot.learning { background: #b29138; }
.class-preview { padding: 17px 0 22px; display: grid; gap: 6px; }
.class-preview strong { font-size: 1.13rem; }
.class-preview span { line-height: 1.5; }
.class-preview small, .class-preview span { color: var(--muted); }

.tabs { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 15px; }
.tabs a { padding: 10px 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); font-size: .92rem; font-weight: 650; }
.tabs a[aria-current] { background: var(--dark-soft); color: #effce6; border-color: var(--dark-soft); }
.tabs a:hover { border-color: #869982; }
.program-row { display: grid; align-items: center; grid-template-columns: 36px minmax(0, 1fr) 42px auto 18px; min-height: 70px; padding: 10px 0; gap: 13px; border-top: 1px solid #edf0ea; }
.program-number { font-variant-numeric: tabular-nums; font-weight: 690; color: #5c7659; font-size: .92rem; }
.program-label, .media-info { min-width: 0; }
.program-label strong, .media-info strong { display: block; overflow-wrap: anywhere; }
.program-label small, .media-info small { display: block; line-height: 1.35; color: var(--muted); margin-top: 4px; }
.program-row > svg, .media-row > svg { color: #80917e; width: 17px; }
.program-row:hover strong, .media-row:hover strong { color: #466a3d; }
.program-media { display: inline-flex; align-items: center; gap: 4px; font-size: .9rem; color: var(--muted); }
.program-media svg { width: 16px; }
.topic-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; }
.topic-nav a { white-space: normal; }
.bullet-list, .steps { margin: 0 0 15px; padding-left: 1.4rem; }
.bullet-list li, .steps li { margin: 8px 0; line-height: 1.58; }
.steps li::marker { font-weight: 700; color: #4a7049; }
.steps p { color: var(--muted); margin-top: 3px; }
.inside h3 + p, .inside h3 + .steps { margin-top: 7px; }
.source { color: var(--muted); border-top: 1px solid var(--line); margin: 18px 0 0; padding-top: 11px; font-size: .85rem; }
.filename { overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.preserve { white-space: pre-wrap; overflow-wrap: anywhere; }
.separator { margin-inline: 2px; }
.empty { padding: 14px 0; }
.empty strong { font-size: 1.1rem; }
.empty p { color: var(--muted); margin: 7px 0 11px; }
.empty p:last-child { margin-bottom: 0; }
.alert { border-radius: 10px; background: #f9eadb; color: #743c25; padding: 10px 13px; }

.filters { display: grid; grid-template-columns: minmax(180px, 1.4fr) minmax(155px, 1fr) minmax(125px, .55fr); gap: 9px; }
.search { position: relative; }
.search svg { position: absolute; top: 12px; left: 11px; color: var(--muted); }
.search input[type="search"] { padding-left: 39px; }
.filter-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 55px; color: var(--muted); font-size: .89rem; }
.checkbox { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.checkbox input { width: 17px; height: 17px; accent-color: #4c753d; }
.media-row { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 9px 1px; border-top: 1px solid #edf0ea; }
.media-info { flex: 1; }
.media-icon { display: grid; width: 39px; height: 39px; flex: 0 0 auto; border-radius: 10px; place-items: center; background: #edf2e9; color: #466648; }
.media-duration { flex: 0 0 auto; color: var(--muted); font-size: .88rem; font-variant-numeric: tabular-nums; }
.playback { overflow: hidden; }
.playback video { display: block; width: 100%; max-height: 68dvh; aspect-ratio: 16 / 9; margin: 0 auto; background: #0e1310; object-fit: contain; }
.playback video.portrait { width: auto; max-width: 100%; aspect-ratio: 9 / 16; }
.audio-player { min-height: 115px; display: grid; place-items: center; align-content: center; gap: 10px; padding: 15px; background: var(--dark); color: var(--lime); }
.audio-player audio { max-width: 100%; }
.playback-actions { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px; }
.playback-error { margin: 10px; }
.speed, .timecode { min-height: 38px; min-width: 44px; padding: 6px 8px; border: 1px solid #dae1d7; border-radius: 8px; background: #fff; color: var(--green); font-weight: 640; }
.speed[aria-pressed="true"], .timecode:hover { background: #e9f0e4; border-color: #b3c7ad; }
.marks { list-style: none; padding: 0; margin: 0; }
.marks li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); }
.marks li > span { flex: 1; overflow-wrap: anywhere; }
.log-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 10px; padding: 14px 0 11px; border-top: 1px solid #edf0ea; }
.log-row small { color: var(--muted); display: block; margin-bottom: 4px; }
.log-row p { color: var(--muted); margin-top: 5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.group-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 13px; }
.group-card { display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 9px; }
.group-card h2, .group-card p { grid-column: 1 / -1; overflow-wrap: anywhere; }
.group-card p { color: var(--muted); }

.form { display: grid; gap: 13px; }
.form label { min-width: 0; display: grid; gap: 6px; font-size: .93rem; font-weight: 650; }
input:not([type="checkbox"]), textarea, select { width: 100%; min-width: 0; min-height: 43px; border: 1px solid #cfd9cc; color: var(--ink); border-radius: 9px; background-color: #fff; padding: 9px 11px; font-size: 1rem; }
input::placeholder, textarea::placeholder { color: #687468; }
select { appearance: none; padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, #52684f 50%), linear-gradient(135deg, #52684f 50%, transparent 50%); background-position: calc(100% - 17px) 53%, calc(100% - 12px) 53%; background-size: 5px 5px; background-repeat: no-repeat; }
textarea { resize: vertical; line-height: 1.5; font-weight: 400; }
.field-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.form-error { color: #a13125; }
dialog { width: min(550px, calc(100vw - 24px)); max-height: calc(100dvh - 36px); margin: auto; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); color: var(--ink); box-shadow: 0 12px 60px #17221650; }
dialog::backdrop { background: #142019a1; }
.dialog-head, .dialog-actions { display: flex; justify-content: space-between; gap: 9px; align-items: center; }
.dialog-head { margin-bottom: 10px; }
.dialog-actions { margin-top: 7px; }
.notice { position: fixed; z-index: 15; bottom: 18px; right: 18px; max-width: min(430px, calc(100vw - 36px)); border-radius: 10px; background: #273a28; color: #fff; padding: 11px 14px; box-shadow: 0 8px 20px #17221640; }
.notice.error { background: #813b2d; }
.access-code { display: block; width: fit-content; max-width: 100%; overflow-wrap: anywhere; margin: 8px 0 16px; padding: 10px 12px; color: #253f2a; background: #ebf2e6; border-radius: 9px; font-size: 1rem; }
.boot, .entry-screen { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 19px; }
.entry-screen #main { width: min(430px, calc(100vw - 38px)); padding: 25px; }
.entry-panel h1 { margin: 10px 0; }

@media (max-width: 1060px) {
  :root { --edge: 23px; }
  .shell { grid-template-columns: 194px minmax(0, 1fr); }
  .sidebar { padding-inline: 11px; }
}

@media (max-width: 780px) {
  :root { --edge: 16px; }
  .shell { display: block; }
  .sidebar { display: none; }
  .toolbar { min-height: 61px; }
  .toolbar-label { display: none; }
  .toolbar-end span { display: none; }
  .toolbar-end { min-width: 40px; min-height: 40px; justify-content: center; }
  .toolbar-end::after { content: none; }
  .toolbar-end svg { width: 21px; height: 21px; }
  .mobile-brand { display: flex; align-items: center; gap: 8px; font-weight: 750; letter-spacing: -.045em; color: var(--ink); }
  .mobile-brand .brand-mark { width: 34px; height: 34px; border-radius: 9px; }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; z-index: 10; inset: auto 0 0; padding: 4px 4px env(safe-area-inset-bottom); background: #151b17; color: #c7d1c4; }
  .bottom-nav a { display: grid; align-content: center; justify-items: center; gap: 3px; padding: 5px 1px; min-height: 50px; text-align: center; font-weight: 640; font-size: .74rem; line-height: 1.05; border-radius: 8px; }
  .bottom-nav a[aria-current] { color: var(--lime); background: #2a3826; }
  .bottom-nav a:focus-visible { outline-offset: -3px; }
  .bottom-nav.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #main { padding-top: 22px; padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
  .notice { bottom: calc(64px + env(safe-area-inset-bottom)); }
}

@media (max-width: 620px) {
  .home-grid, .detail-grid { grid-template-columns: minmax(0, 1fr); gap: 13px; }
  .page-head { align-items: start; flex-direction: column; margin-bottom: 17px; gap: 11px; }
  .hero { min-height: 222px; }
  .hero-art { width: 64%; opacity: .72; }
  .hero-body { padding: 21px 17px; }
  .hero p { max-width: 31ch; font-size: .95rem; }
  .stats { gap: 6px; margin-top: 9px; }
  .stat { flex-direction: column; align-items: start; gap: 5px; padding: 8px; border-radius: 12px; }
  .stat small { font-size: .78rem; line-height: 1.12; }
  .stat strong { font-size: 1.4rem; }
  .stat em { font-size: .8rem; }
  .stat-icon { width: 34px; height: 34px; border-radius: 9px; }
  .stat-icon svg { width: 17px; height: 17px; }
  .program-row { grid-template-columns: 22px minmax(0, 1fr) auto 12px; gap: 7px; }
  .program-media { display: none; }
  .program-label small { font-size: .8rem; }
  .program-row > svg { width: 13px; }
  .pill { padding-inline: 6px; font-size: .76rem; }
  .filters { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 7px; }
  .search { grid-column: 1 / -1; }
  .filter-line { font-size: .84rem; }
  .media-row { gap: 8px; }
  .media-icon { width: 34px; height: 34px; }
  .media-info small { font-size: .79rem; }
}

@media (max-width: 375px) {
  :root { --edge: 12px; }
  .button { padding-inline: 9px; }
  .dialog-actions .actions { gap: 4px; }
  .inside { padding-inline: 13px; }
  .tabs { gap: 5px; }
  .tabs a { padding: 8px; font-size: .81rem; }
}
