:root {
  color-scheme: dark;
  --black: #000000;
  --panel: #171717;
  --silver: #C0C0C0;
  --white: #FFFFFF;
  --line: #393939;
  --surface: #101010;
  --gutter: clamp(1rem, 3vw, 2.75rem);
  font: 16px/1.55 system-ui, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--black); color: var(--white); }
a { color: inherit; text-underline-offset: .22em; }
a:hover { color: var(--silver); }
:focus-visible { outline: 2px solid var(--white); outline-offset: 4px; }
img { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0 0 .55em; line-height: 1.04; letter-spacing: -.045em; overflow-wrap: anywhere; }
h1 { font-size: clamp(2.35rem, 5vw, 5.15rem); font-weight: 850; }
h2 { font-size: clamp(1.5rem, 2.7vw, 2.3rem); }
h3 { font-size: 1.25rem; }
p { margin: .5em 0 1em; }
code { font: .92em "Cascadia Mono", Consolas, monospace; overflow-wrap: anywhere; }
[hidden] { display: none !important; }
.skip { position: absolute; left: .6rem; top: -6rem; background: white; color: black; z-index: 5; padding: .65rem; }
.skip:focus { top: .65rem; }
.top { position: sticky; top: 0; z-index: 3; background: var(--black); border-bottom: 1px solid var(--line); }
.top-inner { margin: auto; max-width: 1640px; min-height: 74px; padding: .75rem var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: .8rem 1.75rem; flex-wrap: wrap; }
.brand { text-decoration: none; }
.wordmark { display: inline-block; font-weight: 850; text-transform: uppercase; letter-spacing: .075em; font-size: clamp(.75rem, 2.7vw, 1.08rem); max-height: 46px; max-width: min(17rem, 58vw); object-fit: contain; }
.wordmark span { color: var(--silver); }
.top nav, .actions { display: flex; align-items: center; gap: .55rem .85rem; flex-wrap: wrap; }
.top nav { font-size: .86rem; font-weight: 650; }
.top nav a { text-decoration: none; }
.layout { max-width: 1250px; margin: auto; padding: clamp(1.2rem, 4vw, 3.2rem) var(--gutter) 5rem; }
.layout.admin { max-width: 1640px; display: grid; grid-template-columns: 13.5rem minmax(0, 1fr); gap: clamp(1.25rem, 3vw, 3.2rem); }
main, aside, article { min-width: 0; }
.sidebar { position: sticky; top: 105px; align-self: start; border: 1px solid var(--line); background: var(--surface); }
.side-desktop > p { padding: 1rem 1rem .4rem; }
.sidebar nav { display: grid; }
.side-mobile { display: none; }
.side-mobile summary { padding: .7rem .85rem; }
.side-mobile summary span { margin-left: .4rem; color: var(--silver); font-size: .8rem; font-weight: 500; }
.side-mobile[open] > summary { margin-bottom: 0; border-bottom: 1px solid var(--line); }
.sidebar nav a { display: block; padding: .75rem .95rem; font-size: .92rem; border-left: 3px solid transparent; color: var(--silver); text-decoration: none; }
.sidebar nav a:hover { background: var(--panel); color: white; }
.sidebar nav a[aria-current] { border-left-color: white; background: var(--panel); color: white; font-weight: 700; }
.eyebrow { font: 700 .74rem/1.4 "Cascadia Mono", Consolas, monospace; color: var(--silver); text-transform: uppercase; letter-spacing: .13em; margin: 0 0 .85rem; }
.hero { border: 1px solid var(--line); border-top: 3px solid var(--silver); background: var(--panel); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .72fr); align-items: stretch; overflow: hidden; }
.hero > div:first-child { padding: clamp(1.4rem, 5.2vw, 4.4rem); }
.hero h1 { text-transform: uppercase; letter-spacing: -.07em; margin-bottom: .25em; }
.hero .actions:not(:empty) { margin-top: 1.25rem; }
.hero-art { min-height: 13rem; background: repeating-linear-gradient(118deg, transparent 0 10px, #c0c0c014 11px 12px), linear-gradient(120deg, #121212 11%, #4c4c4c 59%, #141414 92%); border-left: 1px solid var(--line); }
.hero-art.cover { aspect-ratio: auto; height: 100%; }
.hero-art.cover img { height: 100%; }
.hero:not(:has(.hero-art)) { grid-template-columns: 1fr; }
.page-heading { margin-bottom: 1.35rem; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: .7rem 1rem; flex-wrap: wrap; margin: 2rem 0 1rem; }
.section-head h1, .section-head h2 { margin: 0; }
.crumb { display: inline-block; margin-bottom: 1.2rem; color: var(--silver); }
.muted, .prose { color: var(--silver); }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 68ch; }
.license { display: inline-flex; align-items: center; flex-wrap: wrap; gap: .45rem .75rem; color: var(--silver); border: 1px solid #5b5b5b; padding: .55rem .75rem; font-size: .85rem; }
.license code { color: white; font-weight: 750; }
button, .button, input, select, textarea { font: inherit; }
button, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: .55rem .9rem; border: 1px solid var(--white); background: var(--white); color: var(--black); font-weight: 750; font-size: .87rem; text-decoration: none; cursor: pointer; text-align: center; }
button:hover, .button:hover { background: var(--silver); color: black; border-color: var(--silver); }
button.secondary, .button.secondary { border-color: #626262; background: transparent; color: white; }
button.secondary:hover, .button.secondary:hover { background: #303030; }
button.quiet { min-height: 38px; padding-inline: .55rem; border-color: transparent; color: var(--silver); background: transparent; }
button.quiet:hover { color: white; background: var(--panel); }
button:disabled { opacity: .45; cursor: default; }
.panel, .empty, .notice, .table-panel { background: var(--panel); border: 1px solid var(--line); padding: clamp(.9rem, 2.3vw, 1.55rem); margin: .8rem 0; }
.empty { border-style: dashed; color: var(--silver); padding: clamp(1.25rem, 5vw, 2.5rem); }
.notice { border-left: 3px solid var(--silver); }
.preview { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .55rem; }
details > summary { cursor: pointer; font-weight: 750; }
details[open] > summary { margin-bottom: .75rem; }
label { display: grid; gap: .3rem; color: var(--silver); font-size: .9rem; font-weight: 650; }
label + label { margin-top: .8rem; }
input:not([type=hidden]), textarea, select { width: 100%; min-width: 0; min-height: 42px; border: 1px solid #626262; border-radius: 0; padding: .55rem .7rem; background: var(--black); color: var(--white); }
input[type=file] { font-size: .85rem; padding: .45rem; }
input::file-selector-button { border: 1px solid #626262; background: #262626; color: white; padding: .35rem .5rem; margin-inline-end: .6rem; cursor: pointer; }
textarea { min-height: 90px; resize: vertical; }
label.check { display: flex; align-items: center; margin: .8rem 0; gap: .55rem; }
label.check input { min-height: auto; width: 1rem; }
form label:last-of-type + button, .panel > button:last-child { margin-top: .85rem; }
.fields, .module-edit, .split { display: grid; gap: 1rem; }
.fields { grid-template-columns: minmax(0, 1fr) minmax(7rem, .4fr); margin: .75rem 0; }
.module-edit { grid-template-columns: minmax(0, 1fr) minmax(8rem, .65fr) auto; align-items: end; }
.fields label, .module-edit label, .table-controls label { margin: 0; }
.module-edit button { justify-self: start; }
.split { grid-template-columns: minmax(0, .75fr) minmax(0, 1fr); align-items: start; }
.split > .panel { margin: 0; }
.package { border-bottom: 1px solid var(--line); margin: 1.2rem 0; padding-bottom: 1.2rem; }
.course-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 1rem; }
.course-card { border: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; }
.course-card .card-body { padding: 1.1rem; display: flex; flex: 1; flex-direction: column; align-items: flex-start; }
.card-body h2, .card-body h3 { font-size: clamp(1.15rem, 2.3vw, 1.6rem); }
.card-body h3 a { text-decoration: none; }
.card-body > .button, .card-body > .actions { margin-top: auto; }
.cover { background: #101010; aspect-ratio: 16/8; overflow: hidden; border-bottom: 1px solid var(--line); }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-fallback { background: repeating-linear-gradient(135deg, #ffffff09 0 1px, transparent 1px 8px), linear-gradient(142deg, #0c0c0c 25%, #404040 70%, #1b1b1b); }
.progress { width: 100%; margin: .35rem 0 1rem; color: var(--silver); font-size: .84rem; }
.progress > div { display: flex; justify-content: space-between; gap: 1rem; }
.progress strong { color: var(--white); }
progress { width: 100%; height: .38rem; display: block; margin-top: .5rem; border: 0; background: #3b3b3b; }
progress::-webkit-progress-bar { background: #3b3b3b; }
progress::-webkit-progress-value { background: var(--silver); }
progress::-moz-progress-bar { background: var(--silver); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.7rem), 1fr)); gap: .7rem; margin: 1rem 0; }
.stat { min-width: 0; background: var(--panel); border: 1px solid var(--line); padding: .9rem; text-decoration: none; display: flex; flex-direction: column; gap: .5rem; }
.stat:hover { border-color: var(--silver); }
.stat span { color: var(--silver); font-size: .82rem; }
.stat strong { font-size: clamp(1.5rem, 3.1vw, 2.7rem); line-height: 1.15; overflow-wrap: anywhere; }
.table-controls { display: flex; flex-wrap: wrap; gap: .65rem; margin-bottom: .85rem; }
.table-controls label { flex: 1 1 10rem; max-width: 24rem; }
.table-scroll { overflow: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: .88rem; }
th { text-transform: uppercase; font-size: .74rem; color: var(--silver); letter-spacing: .04em; }
td, th { border-bottom: 1px solid var(--line); padding: .65rem .65rem .65rem .2rem; vertical-align: top; }
td { overflow-wrap: anywhere; }
td .actions { gap: .3rem; }
td .button, td button { min-height: 36px; font-size: .78rem; padding: .4rem .55rem; }
.table-panel [data-empty] { margin: .85rem 0 0; }
.lesson-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(14rem, 18rem); gap: clamp(1rem, 3vw, 2.6rem); }
.lesson-layout h1 { font-size: clamp(2rem, 4vw, 4.4rem); }
.lesson-layout > aside { align-self: start; border: 1px solid var(--line); background: var(--surface); padding: 1rem; }
.module { margin: .8rem 0; }
.module h3 { margin: 0; padding: .7rem .85rem; background: var(--panel); border: 1px solid var(--line); }
.module ol { padding: 0; margin: 0; list-style: none; }
.module li a { padding: .7rem .85rem; border: 1px solid var(--line); border-top: 0; text-decoration: none; display: flex; align-items: center; justify-content: space-between; gap: .5rem; overflow-wrap: anywhere; }
.module li a:hover, .module li a[aria-current] { background: #2b2b2b; }
.module small { color: var(--silver); white-space: nowrap; }
.step { margin: 1rem 0 1.5rem; border: 1px solid var(--line); background: var(--panel); }
.step > img { width: 100%; max-height: 78vh; object-fit: contain; background: black; }
.step figcaption { padding: 1rem; }
.step figcaption p:last-child { margin-bottom: 0; }
.lesson-actions { margin-top: 1.1rem; }
.upload [role=status]:empty { display: none; }
.editor-steps { padding: 0; list-style: none; }
.editor-step { display: grid; grid-template-columns: minmax(0, .36fr) minmax(0, 1fr); gap: 1rem; margin: .7rem 0; padding: .85rem; border: 1px solid var(--line); background: var(--panel); }
.editor-step > img { max-height: 12rem; width: 100%; object-fit: contain; align-self: center; background: black; }
.editor-step .actions { margin-top: .55rem; }
.logo-preview { padding: 1rem; max-height: 8rem; object-fit: contain; }
dd { margin: .2rem 0 1rem; overflow-wrap: anywhere; }
.layout:has(form[action="/login"], #activation-password) { max-width: 44rem; }
@media (max-width: 920px) {
  .layout.admin { display: block; }
  .sidebar { position: static; margin-bottom: 1rem; }
  .side-desktop { display: none; }
  .side-mobile { display: block; }
}
@media (max-width: 650px) {
  .top-inner { min-height: 56px; gap: .3rem .65rem; }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-art { min-height: 4rem; border-left: 0; border-top: 1px solid var(--line); }
  .hero-art.cover { max-height: 13rem; }
  .lesson-layout, .split, .module-edit { grid-template-columns: minmax(0, 1fr); }
  .lesson-layout > aside { order: 2; }
  .editor-step { grid-template-columns: minmax(0, 1fr); }
  .editor-step > img { justify-self: start; max-width: 16rem; }
  .section-head { align-items: start; }
  .fields { grid-template-columns: 1fr; }
  table { min-width: 22rem; }
}

.signin { border: 1px solid var(--line); border-top: 3px solid var(--silver); background: var(--panel); padding: clamp(1rem, 5vw, 2.6rem); }
.signin > div { border-bottom: 1px solid var(--line); }
.signin > div h1 { text-transform: uppercase; }
.signin form { border: none; padding: .6rem 0 0; margin-bottom: 0; }

.catalog-label { display: flex; align-items: center; gap: .55rem; }
.catalog-thumb { width: 2.7rem; height: 2.7rem; object-fit: cover; border: 1px solid var(--line); flex-shrink: 0; }
.catalog-pages { justify-content: flex-end; align-items: center; margin: .8rem 0; }
.price-product { border: 1px solid var(--line); margin: .5rem 0; min-width: 0; }
.price-product summary, .panel > summary { cursor: pointer; min-height: 2.6rem; padding: .65rem; }
.price-product summary .catalog-label { display: inline-flex; vertical-align: middle; max-width: calc(100% - 1rem); }
.price-product small { color: var(--silver); display: block; text-transform: none; }
.price-product small:empty { display: none; }
.price-table { min-width: 68rem; font-variant-numeric: tabular-nums; }
.price-table td, .price-table th { padding: .45rem .35rem; }
.price-table tbody th { min-width: 9rem; text-transform: none; }
.price-table input[type="number"], .price-table select { min-width: 6.1rem; min-height: 2.3rem; margin: .1rem 0; padding: .28rem; }
.price-table .margin-alert { color: #ffd199; }
.price-table .margin-alert small { color: inherit; }
.layout.admin > main, [data-price-grid] { min-width: 0; }
[data-price-grid] .table-controls { align-items: end; }
@media (max-width: 650px) {
  [data-price-grid] .table-controls label { max-width: 100%; }
  .price-table input[type="number"], .price-table select { min-height: 2.75rem; }
}
