/* MaidThis Training. Follows DESIGN.md: direction A "Portal" + MaidThis brand. */
:root {
  --page: #f3f8fd; --panel: #ffffff; --line: #e1ebf5; --ink: #37393b; --muted: #6b7280;
  --azure: #0a85c2; --azure-wash: #e6f4fb; --lime: #92ef3f; --lime-ink: #2f5c06; --lime-tint: #effbe3;
  --flag: #b42318; --ring: #cfd3d9; --chip: #eef1f4;
  color-scheme: light;
  --head: 'Space Grotesk', system-ui, sans-serif; --body: Montserrat, system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 15px/1.5 var(--body); }
a { color: var(--azure); text-decoration: none; } a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--head); font-weight: 700; line-height: 1.2; margin: 0 0 10px; }
h1 { font-size: 24px; } h2 { font-size: 18px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.ic { width: 1em; height: 1em; flex: none; }

/* top bar */
.top { display: flex; align-items: center; gap: 16px; min-height: 56px; padding: 8px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; flex: none; color: var(--ink); }
.brand:hover { text-decoration: none; }
.logo { height: 38px; width: auto; display: block; }
.tag { font: 700 11px/1 var(--head); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-left: 10px; padding-left: 10px; border-left: 1px solid var(--line); }
.crumb { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; }
.crumb a { color: var(--muted); } .crumb em { font-style: normal; color: var(--azure); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.who { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 14px; font-weight: 600; }
.who form { margin: 0; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; }
.av { width: 34px; height: 34px; border-radius: 50%; background: var(--azure-wash); color: var(--azure); display: grid; place-items: center; font: 700 12px/1 var(--head); }

/* layout */
main { padding: 16px; }
.wrap { max-width: 1180px; margin: 0 auto; }
.narrow-col { max-width: 760px; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 20px; margin: 0 0 16px; }
.phead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.phead small { color: var(--muted); font-size: 13px; white-space: nowrap; }
.ptitle { font: 700 14px/1.3 var(--head); letter-spacing: .06em; text-transform: uppercase; margin: 0 0 8px; }
.eyebrow { font: 700 12px/1.3 var(--head); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 46px; padding: 12px 18px; border: 1px solid var(--lime); border-radius: 4px;
  background: var(--lime); color: var(--lime-ink); font: 700 15px/1.2 var(--body); cursor: pointer; text-decoration: none; }
.btn:hover { text-decoration: none; filter: brightness(.96); }
.btn.ghost { background: transparent; color: var(--azure); border-color: var(--azure); }
.chev { font-size: .8em; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.actions form { margin: 0; }

/* progress */
.meter { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin: 10px 0 8px; }
.meter i { display: block; height: 100%; background: var(--azure); border-radius: 3px; transition: width .3s; }
.circ { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--ring); flex: none; display: grid; place-items: center; }
.circ.done { border: 0; background: var(--azure); color: #fff; } .circ .ic { width: 14px; height: 14px; }
.okline { display: flex; align-items: center; gap: 8px; color: var(--azure); font-weight: 700; }
.lockline { display: flex; gap: 10px; align-items: flex-start; } .lockline .ic { margin-top: 3px; color: var(--muted); }
ul.rules { list-style: none; margin: 14px 0 0; padding: 0; }
ul.rules li { display: flex; gap: 10px; margin: 6px 0; font-size: 14px; }
.spk { width: 13px; height: 13px; flex: none; margin-top: 4px; color: var(--azure); }

/* lesson rows */
.lessons { list-style: none; margin: 0; padding: 0; }
.lessons li { border-top: 1px solid var(--line); }
.lessons li a { display: grid; grid-template-columns: 22px 88px minmax(0, 1fr) 22px; gap: 12px; align-items: center; padding: 10px 4px; color: var(--ink); }
.lessons li a:hover { text-decoration: none; background: var(--page); }
.lessons li.current a { background: var(--azure-wash); }
.lessons .n { color: var(--muted); font-size: 13px; text-align: center; }
.lessons .th { position: relative; display: block; }
.lessons .th img, .mini { width: 88px; height: 50px; object-fit: cover; border-radius: 5px; display: block; background: var(--line); }
.lessons .badge { position: absolute; left: 4px; top: 4px; background: var(--panel); color: var(--azure); border-radius: 4px; padding: 3px; display: grid; }
.lessons .badge .ic { width: 13px; height: 13px; }
.lessons .t b { display: block; font-weight: 600; font-size: 14px; line-height: 1.3; }
.lessons .t small { color: var(--muted); font-size: 12.5px; }

/* home */
.resume-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: center; }
.cover { position: relative; display: block; aspect-ratio: 16/9; border-radius: 6px; overflow: hidden; background: #000; }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pbtn { position: absolute; inset: 0; margin: auto; width: 56px; height: 56px; border-radius: 50%; background: #fff; color: #37393b; display: grid; place-items: center; }
.pbtn .ic { width: 26px; height: 26px; }
.resume h1 { font-size: 22px; }

/* lesson */
.resume-note { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; margin-top: 10px; padding: 10px 12px; border-radius: 4px; background: var(--azure-wash); font-size: 14px; }
.resume-note .linkbtn { color: var(--azure); font-weight: 700; }
.vid { padding: 12px; }
video { width: 100%; aspect-ratio: 16/9; background: #000; border-radius: 4px; display: block; }
.speed { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 13px; }
.speed button { border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 4px; padding: 6px 12px; font: 600 13px var(--body); cursor: pointer; }
.speed button.on { background: var(--azure); border-color: var(--azure); color: #fff; }
.contents .eyebrow { margin-top: 4px; }
.modnav { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; }
.modnav .btn { min-height: 40px; padding: 8px 14px; font-size: 14px; }

/* quiz */
fieldset.q { border: 1px solid var(--line); }
fieldset.q legend { float: left; width: 100%; display: flex; gap: 12px; font: 600 16px/1.4 var(--body); margin-bottom: 12px; padding: 0; }
fieldset.q legend + * { clear: both; }
.qn { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--azure-wash); color: var(--azure); display: grid; place-items: center; font: 700 13px var(--head); }
.opt { display: flex; gap: 12px; align-items: flex-start; min-height: 48px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px; margin: 8px 0 0; cursor: pointer; clear: both; }
.opt:hover { border-color: var(--azure); }
.opt:has(input:checked) { border-color: var(--azure); background: var(--azure-wash); }
.opt input { margin: 3px 0 0; width: 18px; height: 18px; accent-color: var(--azure); flex: none; }
.formend { display: flex; justify-content: flex-end; }
.result .score { font: 700 22px/1.3 var(--head); margin: 0; }
.result.pass .score { color: var(--azure); } .result.fail .score { color: var(--flag); }
.result.fail .meter i { background: var(--flag); }

/* auth */
.auth { max-width: 440px; margin: 48px auto; }
input[type=email], input[name=name] { width: 100%; min-height: 46px; padding: 12px; font: 15px var(--body); color: var(--ink); background: var(--page); border: 1px solid var(--line); border-radius: 4px; margin: 0 0 12px; }
input:focus-visible, .btn:focus-visible, .opt:focus-within { outline: 2px solid var(--azure); outline-offset: 2px; }
.auth .btn { width: 100%; }

/* admin */
.notice { max-width: 1180px; margin: 0 auto 16px; padding: 12px 16px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); font-weight: 600; }
.notice.ok { color: var(--azure); border-color: var(--azure); } .notice.bad { color: var(--flag); border-color: var(--flag); }
.scroll { overflow-x: auto; margin: 0 -4px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { text-align: left; color: var(--muted); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
td small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
td a { font-weight: 700; }
tr.mod td { background: var(--page); font: 700 12px/1.3 var(--head); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
tr.inactive { opacity: .5; }
.lcell { display: flex; gap: 12px; align-items: center; min-width: 260px; }
.lcell .mini { width: 64px; height: 36px; }
.chip { display: inline-block; padding: 3px 10px; border-radius: 99px; background: var(--chip); color: var(--muted); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.chip.done { background: var(--azure-wash); color: var(--azure); } .chip.mid { background: var(--lime-tint); color: var(--lime-ink); }
.flag { color: var(--flag); font-size: 13px; font-weight: 600; }
.addrow { display: flex; flex-wrap: wrap; gap: 10px; } .addrow input { flex: 1 1 220px; margin: 0; }

/* phones */
@media (max-width: 860px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
  .crumb { display: none; }
  .who a[href="/admin"] { display: none; }
}
@media (max-width: 560px) {
  main { padding: 12px; }
  .panel { padding: 16px; }
  .tag { display: none; }
  .logo { height: 34px; }
  .resume-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .resume .btn { width: 100%; }
  .lessons li a { grid-template-columns: 18px 72px minmax(0, 1fr) 20px; gap: 10px; }
  .lessons .th img { width: 72px; height: 41px; }
  .formend .btn { width: 100%; }
}
