/* OpCode Learn: same family as OpCode Drive (accent #0f6cbd, soft cards). No web fonts. */
:root {
  --accent: #0f6cbd; --accent-2: #115ea3; --accent-soft: #ebf3fc;
  --bg: #f7f9fc; --surface: #ffffff; --text: #1b1f24; --muted: #5f6b7a; --line: #e3e8ef;
  --ok: #107c10; --ok-soft: #e7f5e7; --bad: #c50f1f; --bad-soft: #fdecee; --warn: #8a5300; --warn-soft: #fff4ce;
  --radius: 12px; --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --accent: #479ef5; --accent-2: #62abf5; --accent-soft: #10263d;
    --bg: #121417; --surface: #1b1e23; --text: #e6e9ee; --muted: #9aa5b4; --line: #2b3038;
    --ok: #54b054; --ok-soft: #12301a; --bad: #f1707b; --bad-soft: #3b1418; --warn: #f2c661; --warn-soft: #3a2e10;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.5;
  font: 15px/1.5 "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: .2em 0 .6em; font-weight: 650; }
h2 { font-size: 1.15rem; margin: 0 0 .6em; font-weight: 650; }
h3 { font-size: .95rem; margin: 1em 0 .4em; color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); } .small { font-size: .85rem; }
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .9em; }

/* top bar */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 650; font-size: 1.05rem; }
.brand:hover { text-decoration: none; }
.top nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.top nav a, .top nav .link { color: var(--text); padding: 6px 10px; border-radius: 8px; font-size: .92rem; }
.top nav a:hover, .top nav .link:hover { background: var(--accent-soft); text-decoration: none; }

/* layout */
main.page { max-width: 1100px; margin: 24px auto; padding: 0 16px; }
main.narrow { max-width: 460px; margin: 48px auto; padding: 0 16px; }
main.wide { max-width: 1400px; margin: 16px auto; padding: 0 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }
.card.empty { text-align: center; padding: 40px 20px; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0; }
.crumbs { margin: 0 0 8px; font-size: .9rem; color: var(--muted); }

/* forms and buttons */
.form label { display: block; margin: 12px 0; font-weight: 550; font-size: .92rem; }
.form label input { margin-top: 4px; }
input, select { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; }
.form input:not([type=checkbox]), .form select { width: 100%; }
input:focus, select:focus, button:focus-visible, .button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin: 12px 0; }
legend { font-weight: 550; font-size: .92rem; padding: 0 4px; }
label.check { font-weight: 400; margin: 6px 0; display: flex; gap: 8px; align-items: center; }
button, .button { font: inherit; font-size: .92rem; display: inline-block; cursor: pointer; padding: 8px 16px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font-weight: 550; }
button:hover, .button:hover { background: var(--accent-soft); text-decoration: none; }
.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.primary:hover { background: var(--accent-2); color: #fff; }
.form button.primary { width: 100%; margin-top: 8px; padding: 10px; }
.danger { color: var(--bad); border-color: var(--bad); background: transparent; }
.danger:hover { background: var(--bad-soft); }
button.link { background: none; border: 0; font-weight: 400; cursor: pointer; }
form.inline { display: inline; margin: 0; }
.error { background: var(--bad-soft); color: var(--bad); padding: 8px 12px; border-radius: 8px; }
.ok { background: var(--ok-soft); color: var(--ok); padding: 8px 12px; border-radius: 8px; }
.warn { background: var(--warn-soft); color: var(--warn); padding: 6px 12px; border-radius: 8px; margin: 6px 0; font-size: .9rem; }
.danger-zone { margin-top: 16px; } .danger-zone summary { color: var(--bad); cursor: pointer; }

/* progress bars */
progress.bar { appearance: none; -webkit-appearance: none; width: 100%; height: 6px; border: 0; border-radius: 3px;
  background: var(--line); overflow: hidden; vertical-align: middle; }
progress.bar::-webkit-progress-bar { background: var(--line); border-radius: 3px; }
progress.bar::-webkit-progress-value { background: var(--accent); border-radius: 3px; }
progress.bar::-moz-progress-bar { background: var(--accent); border-radius: 3px; }
td progress.bar { width: 120px; margin-right: 8px; }

/* course cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.course-card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); color: var(--text); transition: transform .12s, box-shadow .12s; }
.course-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 6px 24px rgba(16, 24, 40, .12); }
.course-card .cover { aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--accent), #5b5fc7);
  display: grid; place-items: center; color: #fff; font-size: 3rem; font-weight: 700; }
.course-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.course-card .body { padding: 14px 16px; }
.course-card h2 { font-size: 1.05rem; margin-bottom: 10px; }

/* course page */
.course-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.course-head > div { flex: 1 1 320px; } .course-head .desc { white-space: pre-line; }
ol.lessons { list-style: none; padding: 0; margin: 0; }
ol.lessons li a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--text); }
ol.lessons li a:hover { background: var(--accent-soft); text-decoration: none; }
ol.lessons .t { flex: 1; }
.tick { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); flex: none; position: relative; }
li.done .tick { background: var(--ok); border-color: var(--ok); }
li.done .tick::after { content: ""; position: absolute; left: 4px; top: 1px; width: 5px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
li.current a { background: var(--accent-soft); font-weight: 600; }
ol.compact li a { padding: 6px 8px; font-size: .9rem; }
.files { margin-top: 12px; }
a.file { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 8px; margin: 6px 0; color: var(--text); }
a.file:hover { background: var(--accent-soft); text-decoration: none; }
a.file::before { content: "⤓"; color: var(--accent); }
a.file { justify-content: flex-start; } a.file span { margin-left: auto; }

/* player */
.player-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.player-main video { width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); display: block; }
.player-main h1 { font-size: 1.35rem; margin: 14px 0 10px; }
.nav-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
aside.outline { position: sticky; top: 70px; max-height: calc(100vh - 90px); overflow: auto; padding: 16px; }
@media (max-width: 900px) {
  .player-layout { grid-template-columns: 1fr; }
  aside.outline { position: static; max-height: none; }
  .top { padding: 8px 16px; }
}

/* tables and chips */
.table-wrap { overflow-x: auto; padding: 0; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent);
  font-size: .8rem; margin: 2px 4px 2px 0; white-space: nowrap; font-weight: 550; }
.chip.expired { background: var(--bad-soft); color: var(--bad); }
.chip.okc { background: var(--ok-soft); color: var(--ok); }
h1 .chip { vertical-align: middle; }
details summary { cursor: pointer; padding: 6px 0; }
@media (max-width: 600px) { th, td { padding: 8px; } main.page { margin-top: 16px; } }
