/* WoundK base styles. No build step: edit and reload. */
:root {
  --ink: #1b2a33;
  --muted: #5b6b75;
  --line: #d9e2e6;
  --bg: #f6f8f8;
  --surface: #ffffff;
  --brand: #0f6b6f;
  --brand-ink: #ffffff;
  --brand-soft: #e3f1f1;
  --accent: #c2553a;
  --radius: 10px;
  --wrap: 72rem;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  color: var(--ink);
  line-height: 1.5;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; padding-block: 2rem 3rem; }
img { max-width: 100%; height: auto; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
p { margin: 0 0 1em; overflow-wrap: anywhere; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 1rem; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Buttons and forms */
button, .button, input, select, textarea { font: inherit; }
.button, button[type=submit] {
  display: inline-block; padding: .55rem 1rem; border: 0; border-radius: var(--radius);
  background: var(--brand); color: var(--brand-ink); text-decoration: none; cursor: pointer;
}
.button:hover, button[type=submit]:hover { filter: brightness(1.1); }
input, select, textarea { padding: .5rem .65rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); max-width: 100%; }
.inline-form { display: inline; margin: 0; }
.link-button { background: none !important; color: var(--brand) !important; padding: 0 !important; text-decoration: underline; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: .75rem; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; font-size: 1.25rem; color: var(--ink); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 8px; background: var(--brand); color: var(--brand-ink); font-size: 1rem; }
.site-nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.site-nav > a { color: var(--ink); text-decoration: none; font-weight: 500; }
.site-nav > a:hover { color: var(--brand); }
.nav-search { display: flex; gap: .35rem; margin: 0; }
.nav-search input { width: 14rem; }
.nav-search button { padding-inline: .75rem; }
.badge { display: inline-block; min-width: 1.4em; padding: 0 .4em; border-radius: 999px; background: var(--accent); color: #fff; font-size: .8em; text-align: center; }
.nav-toggle { display: none; background: var(--brand-soft); color: var(--brand); border: 0; border-radius: var(--radius); padding: .45rem .8rem; cursor: pointer; }

@media (max-width: 760px) {
  .nav-toggle { display: inline-block; }
  .site-nav { display: none; width: 100%; flex-direction: column; align-items: stretch; gap: .25rem; padding-bottom: .5rem; }
  .site-nav.open { display: flex; }
  .site-nav > a, .site-nav > .inline-form { padding: .5rem 0; border-top: 1px solid var(--line); }
  .nav-search { order: -1; }
  .nav-search input { flex: 1; width: auto; min-width: 0; }
}
/* Without JS the toggle can't work, so always show the nav. */
.no-js .site-nav { display: flex; }
.no-js .nav-toggle { display: none; }

/* Cards and sections */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.hero { padding-block: 1rem 2rem; max-width: 46rem; }
.eyebrow { color: var(--brand); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; font-size: .85rem; margin-bottom: .5rem; }
.lead { font-size: 1.15rem; color: var(--muted); }
.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: 1rem; }
.pillar { border-top: 4px solid var(--brand); }
.notice { max-width: 40rem; padding-block: 2rem; }

/* Footer */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); font-size: .9rem; }
.footer-inner { padding-block: 1.25rem; }
.footer-inner p:last-child { margin-bottom: 0; }

/* Forms */
.form-page { max-width: 34rem; }
.form { display: grid; gap: 1rem; }
.field { display: grid; gap: .3rem; align-content: start; }
.field label { font-weight: 600; }
.field input, .field select, .field textarea { width: 100%; }
.hint { font-weight: 400; color: var(--muted); font-size: .9em; }
.field.invalid input, .field.invalid select { border-color: var(--accent); }
.field-error, .form-error { color: var(--accent); margin: 0; font-size: .95rem; }
.form-error { margin-bottom: 1rem; font-weight: 600; }
.demo-logins { margin-top: 1.5rem; background: var(--brand-soft); border-color: transparent; font-size: .9rem; overflow-x: auto; }
.demo-logins h2 { font-size: 1rem; }
.demo-logins table { border-collapse: collapse; width: 100%; }
.demo-logins th, .demo-logins td { text-align: left; padding: .25rem .5rem .25rem 0; overflow-wrap: anywhere; }
.nav-admin { color: var(--accent) !important; }
.form h2 { font-size: 1.1rem; margin-top: .5rem; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: 1rem; }
.form-success { color: var(--brand); background: var(--brand-soft); padding: .6rem .8rem; border-radius: var(--radius); font-weight: 600; }

/* Tables (admin) */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.data-table { border-collapse: collapse; width: 100%; font-size: .95rem; }
.data-table th, .data-table td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table th { background: var(--bg); font-weight: 600; white-space: nowrap; }
.data-table tr:last-child td { border-bottom: 0; }
.pill { display: inline-block; padding: .1rem .55rem; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); font-size: .85em; }
.pill-admin { background: #fbe9e4; border-color: #f0c2b5; color: var(--accent); }
button.button-secondary, .button-secondary { background: var(--brand-soft); color: var(--brand); padding: .35rem .7rem; white-space: nowrap; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
.row-actions { white-space: nowrap; }
.row-actions > * + * { margin-left: .4rem; }
button.button-danger { background: #fbe9e4; color: var(--accent); padding: .35rem .7rem; }
.form-actions { display: flex; align-items: center; gap: 1rem; }
textarea { width: 100%; }
.form-page-wide { max-width: 48rem; }
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.field legend { font-weight: 600; padding: 0; margin-bottom: .3rem; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); gap: .35rem 1rem; }
.check { display: flex; align-items: center; gap: .45rem; font-weight: 400; cursor: pointer; }
.check input { width: auto; }
.input-prefix { display: flex; align-items: stretch; }
.input-prefix span { display: grid; place-items: center; padding: 0 .6rem; background: var(--bg); border: 1px solid var(--line); border-right: 0; border-radius: var(--radius) 0 0 var(--radius); color: var(--muted); }
.input-prefix input { border-radius: 0 var(--radius) var(--radius) 0; flex: 1; min-width: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.small { font-size: .85em; }
.pill-ok { background: var(--brand-soft); border-color: transparent; color: var(--brand); }
.status-paid, .status-shipped { background: var(--brand-soft); border-color: transparent; color: var(--brand); }
.status-pending { background: #fff6e0; border-color: #f0dca8; color: #7a5600; }
.status-cancelled { color: var(--muted); }
.image-form { margin-bottom: 1rem; }
.image-row { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.image-row .field { flex: 1; min-width: min(100%, 16rem); }
.product-thumb { width: 8rem; height: 8rem; object-fit: contain; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); }
.product-thumb.placeholder, .list-thumb.placeholder { display: grid; place-items: center; color: var(--muted); font-size: .85rem; }
.list-thumb { display: block; width: 3rem; height: 3rem; object-fit: contain; background: var(--bg); border-radius: 6px; }

/* Store */
.product-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); gap: 1rem; }
.product-card { display: flex; flex-direction: column; gap: .35rem; padding: .9rem; }
.product-card-link { display: flex; flex-direction: column; gap: .35rem; color: var(--ink); text-decoration: none; }
.product-card-link:hover .product-card-name { color: var(--brand); text-decoration: underline; }
.product-card img, .product-card .img-placeholder { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--bg); border-radius: 8px; }
.img-placeholder { display: grid; place-items: center; color: var(--muted); background: var(--bg); border-radius: 8px; font-size: .9rem; }
.product-card-brand { color: var(--muted); font-size: .85rem; }
.product-card-name { font-weight: 600; line-height: 1.3; }
.product-card-price { font-weight: 700; margin-top: auto; }
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: 1rem; }
.product-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 2rem; align-items: start; }
@media (max-width: 760px) { .product-detail { grid-template-columns: 1fr; gap: 1rem; } }
.product-media img, .product-media .img-placeholder { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.product-price { font-size: 1.6rem; font-weight: 700; margin-bottom: .25rem; }
.stock { font-weight: 600; }
.stock-in { color: var(--brand); }
.stock-low { color: #9a6a00; }
.stock-out { color: var(--accent); }
.product-desc { white-space: pre-line; }
.spec { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 1.25rem 0 0; padding-top: 1rem; border-top: 1px solid var(--line); }
.spec dt { color: var(--muted); }
.spec dd { margin: 0; overflow-wrap: anywhere; }
.browse { margin-top: 2rem; }
.browse h2 { font-size: 1.25rem; }
.tile-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); gap: 1rem; }
.tile-grid-compact { grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); gap: .75rem; }
.tile { display: flex; flex-direction: column; gap: .35rem; height: 100%; color: var(--ink); text-decoration: none; border-left: 4px solid var(--brand); }
.tile:hover { border-color: var(--brand); box-shadow: 0 2px 8px rgba(15, 107, 111, .12); }
.tile:hover .tile-title { color: var(--brand); }
.tile-title { font-weight: 600; }
.tile-text { color: var(--muted); font-size: .92rem; }
.tabs { display: flex; gap: .25rem; box-shadow: inset 0 -2px 0 var(--line); margin: 1rem 0 1.25rem; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs a { padding: .55rem .9rem; color: var(--muted); text-decoration: none; font-weight: 600; white-space: nowrap; border-bottom: 3px solid transparent; }
.tabs a:hover { color: var(--brand); }
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }
.prose { max-width: 46rem; }
.prose h3 { font-size: 1.2rem; margin-top: 1.25rem; }
.prose h4 { font-size: 1.05rem; margin-top: 1rem; }
.prose ul, .prose ol { padding-left: 1.4rem; margin: 0 0 1em; }
.prose li { margin-bottom: .25rem; }
.link-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.link-list li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem 1rem; overflow-wrap: anywhere; }
.format-help { margin-bottom: 1rem; padding: .75rem 1rem; }
.format-help summary { cursor: pointer; font-weight: 600; }
.format-help p { margin: .5rem 0 0; }
.section-title { font-size: 1.2rem; margin-top: 2rem; }
.video-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.add-video { margin-top: 1rem; }
.add-video h3 { font-size: 1rem; margin: 0; }
.search-page-form { display: flex; gap: .5rem; max-width: 36rem; margin-bottom: 1.25rem; }
.search-page-form input { flex: 1; min-width: 0; }
.add-to-cart { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin: 1rem 0; }
.add-to-cart input { width: 5rem; }
.qty-form { display: flex; gap: .4rem; align-items: center; margin: 0; }
.qty-form input { width: 4.5rem; }
.cart-table tfoot th { border-top: 2px solid var(--line); border-bottom: 0; background: var(--surface); }
.cart-table tfoot td { border-bottom: 0; background: var(--surface); }
.cart-table .total-row th { font-size: 1.05rem; }
.cart-actions { display: flex; justify-content: flex-end; }
.checkout-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
@media (max-width: 760px) { .checkout-grid { grid-template-columns: 1fr; } }
.checkout h2 { font-size: 1.15rem; margin: 0; }
.summary-lines { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: .5rem; }
.summary-lines li, .summary-totals { display: flex; justify-content: space-between; gap: 1rem; }
.summary-totals { display: grid; grid-template-columns: 1fr auto; gap: .35rem 1rem; margin: 0; padding-top: .75rem; border-top: 1px solid var(--line); }
.summary-totals dd { margin: 0; }
.summary-totals .total { font-weight: 700; font-size: 1.1rem; }
button[disabled] { opacity: .5; cursor: not-allowed; }
.lesson-admin-list { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: .5rem; }
.lesson-admin-row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; padding: .7rem .9rem; }
.lesson-pos { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-weight: 700; flex: none; }
.lesson-title { flex: 1; min-width: 10rem; }
.lesson-admin-row .row-actions { display: flex; gap: .35rem; flex-wrap: wrap; }
.lesson-admin-row .row-actions > * + * { margin-left: 0; }
.add-lesson h2 { font-size: 1.1rem; margin: 0; }
.notice-bar { background: #fff6e0; border: 1px solid #f0dca8; border-radius: var(--radius); padding: .5rem .9rem; font-size: .92rem; }
.lesson { max-width: 46rem; }
.lesson-video-link { margin: .5rem 0 1rem; }
.inline-fields { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.inline-fields input { width: 6rem; }
.passmark-form { margin-bottom: 1rem; }
.quiz-admin-list { padding-left: 1.4rem; margin: 0 0 1.25rem; display: grid; gap: .6rem; }
.quiz-admin-list > li { padding: .8rem 1rem; }
.quiz-q-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.quiz-opts { margin: .5rem 0 0; padding-left: 1.2rem; }
.quiz-opts li.correct { font-weight: 600; }
.opt-row { display: flex; gap: .6rem; align-items: center; margin-bottom: .4rem; }
.opt-row input:not([type=checkbox]) { flex: 1; min-width: 0; }
.course-card img, .course-card .img-placeholder { aspect-ratio: 16 / 9; object-fit: cover; }
.course-card-summary { color: var(--muted); font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.course-card-meta { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: auto; flex-wrap: wrap; }
.course-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 1.5rem; align-items: start; }
@media (max-width: 760px) { .course-head { grid-template-columns: 1fr; } }
.course-cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); }
.outline { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; max-width: 40rem; }
.outline li { display: flex; align-items: center; gap: .6rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem .75rem; }
.outline-quiz { font-weight: 600; }
.course-cta { display: flex; align-items: center; gap: .75rem; margin-top: 1rem; flex-wrap: wrap; }
.enrolled-pill { font-size: .95rem; padding: .3rem .8rem; font-weight: 600; }
.lesson-video { display: block; width: 100%; max-width: 46rem; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); margin: .75rem 0 1rem; }
.progress { display: flex; align-items: center; gap: .75rem; margin: .25rem 0 1rem; flex-wrap: wrap; }
.progress-bar { flex: 1; min-width: 8rem; max-width: 24rem; height: .6rem; border: 0; border-radius: 999px; overflow: hidden; background: var(--line); accent-color: var(--brand); -webkit-appearance: none; appearance: none; }
.progress-bar::-webkit-progress-bar { background: var(--line); border-radius: 999px; }
.progress-bar::-webkit-progress-value { background: var(--brand); border-radius: 999px; }
.progress-bar::-moz-progress-bar { background: var(--brand); border-radius: 999px; }
.progress-text { font-size: .9rem; color: var(--muted); font-weight: 600; }
.course-cta .progress { margin: 0; flex-basis: 100%; }
.lesson-actions { margin: 1.25rem 0; }
.lesson-nav { display: flex; justify-content: space-between; align-items: center; gap: .75rem; max-width: 46rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.lesson-pos.done { background: var(--brand); color: var(--brand-ink); }
.quiz { max-width: 46rem; }
.quiz-form { display: grid; gap: 1rem; }
.quiz-q { border: 1px solid var(--line); margin: 0; min-width: 0; }
.quiz-q legend { display: flex; align-items: center; gap: .6rem; font-weight: 600; padding: 0 .25rem; float: left; width: 100%; margin-bottom: .6rem; }
.quiz-opt { display: flex; align-items: center; gap: .6rem; padding: .5rem .6rem; border-radius: 8px; cursor: pointer; clear: both; }
.quiz-opt:hover { background: var(--bg); }
.quiz-opt input { width: auto; }
.quiz-result { max-width: 34rem; border-top: 4px solid var(--accent); }
.quiz-result.passed { border-top-color: var(--brand); }
.quiz-score { font-size: 1.15rem; }

/* Certificate (D010): screen view plus one A4 landscape page when printed. */
.cert-tools { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.certificate { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; max-width: 60rem; margin: 0 auto; aspect-ratio: 297 / 210; display: flex; }
.cert-inner { flex: 1; border: 3px double var(--brand); border-radius: 6px; padding: 2rem 2.5rem; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: .35rem; }
.cert-brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--brand); margin: 0; }
.cert-kicker { text-transform: uppercase; letter-spacing: .18em; font-weight: 700; color: var(--accent); margin: .5rem 0 0; }
.cert-small { color: var(--muted); margin: .25rem 0 0; }
.cert-name { font-size: clamp(1.6rem, 4.2vw, 2.6rem); margin: .1rem 0; font-family: Georgia, "Times New Roman", serif; }
.cert-title { font-size: clamp(1.1rem, 2.6vw, 1.6rem); margin: .1rem 0 .5rem; }
.cert-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 2rem; margin: .5rem 0; }
.cert-meta div { text-align: center; }
.cert-meta dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.cert-meta dd { margin: 0; font-weight: 600; }
.cert-id { font-family: ui-monospace, Menlo, monospace; font-size: .85rem; overflow-wrap: anywhere; }
.cert-issuer { margin: .5rem 0 0; }
.cert-verify { font-size: .8rem; color: var(--muted); margin: 0; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .certificate { aspect-ratio: auto; padding: .5rem; }
  .cert-inner { padding: 1.25rem 1rem; }
}
@page { size: A4 landscape; margin: 0; }
@media print {
  .no-print { display: none !important; }
  html, body { background: #fff; }
  body { min-height: 0; display: block; }
  main { padding: 0 !important; max-width: none !important; flex: none; }
  .certificate { width: 100%; height: 205mm; max-width: none; aspect-ratio: auto; border: 0; border-radius: 0; padding: 12mm; margin: 0; box-sizing: border-box; page-break-inside: avoid; break-inside: avoid; overflow: hidden; }
  .cert-inner { padding: 14mm 18mm; }
  .cert-name { font-size: 34pt; }
  .cert-title { font-size: 20pt; }
}
/* Receipt (F028): screen view plus one A4 portrait page when printed (named page; certificates keep landscape). */
.receipt { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem; max-width: 50rem; margin: 1rem auto 0; page: receipt; }
.receipt-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; padding-bottom: 1rem; border-bottom: 2px solid var(--brand); }
.receipt-seller { margin: .25rem 0 0; }
.receipt-title { text-align: right; }
.receipt-title h1 { margin: 0; font-size: 1.6rem; text-transform: uppercase; letter-spacing: .12em; }
.receipt-no { margin: .2rem 0 0; font-family: ui-monospace, Menlo, monospace; font-weight: 700; }
.receipt-meta { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; margin: 1.25rem 0; }
.receipt-meta dl { margin: 0; display: grid; gap: .5rem; align-content: start; }
.receipt-meta dt, .receipt-buyer h2 { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0; font-weight: 600; }
.receipt-meta dd { margin: 0; }
.receipt-buyer p { margin: .15rem 0 .75rem; }
.receipt-lines { width: 100%; border-collapse: collapse; }
.receipt-lines th, .receipt-lines td { padding: .45rem .5rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.receipt-lines thead th { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.receipt-lines .num { text-align: right; }
.receipt-lines tfoot th { text-align: right; font-weight: 600; }
.receipt-lines tfoot tr:not(.receipt-total) th, .receipt-lines tfoot tr:not(.receipt-total) td { border-bottom: 0; padding-block: .2rem; }
.receipt-total th, .receipt-total td { font-size: 1.1rem; font-weight: 700; border-top: 2px solid var(--ink); border-bottom: 0; }
.receipt-note { color: var(--muted); font-size: .85rem; margin: 1.5rem 0 0; }
@media (max-width: 640px) {
  .receipt { padding: 1rem; }
  .receipt-title { text-align: left; }
  .receipt-lines th, .receipt-lines td { padding-inline: .25rem; font-size: .9rem; }
}
@page receipt { size: A4 portrait; margin: 14mm; }
@media print {
  .receipt { max-width: none; border: 0; border-radius: 0; padding: 0; margin: 0; font-size: 10.5pt; }
}
.empty-state { max-width: 34rem; }
.webinar-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.webinar-item { display: flex; align-items: center; gap: 1rem; padding: .8rem 1rem; flex-wrap: wrap; }
.webinar-date { display: grid; place-items: center; width: 3.4rem; height: 3.4rem; border-radius: var(--radius); background: var(--brand-soft); color: var(--brand); flex: none; line-height: 1.05; }
.wd-day { font-size: 1.3rem; font-weight: 700; }
.wd-mon { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; }
.webinar-main { flex: 1; min-width: 12rem; display: grid; gap: .15rem; }
.webinar-title { font-weight: 600; }
.webinar-tags { display: flex; gap: .4rem; flex-wrap: wrap; }
.pill-live { background: #fdecea; border-color: #f3c2bc; color: #b3261e; font-weight: 600; }
.webinar-detail { max-width: 46rem; }
.webinar-desc { margin-top: 1.25rem; }

/* Live room */
.live-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.live-head h1 { margin: 0; font-size: clamp(1.2rem, 3.5vw, 1.8rem); }
.live-status { font-weight: 700; color: var(--muted); }
.live-status.on { color: #b3261e; }
.live-grid { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 1rem; margin-top: 1rem; align-items: start; }
@media (max-width: 900px) { .live-grid { grid-template-columns: minmax(0, 1fr); } }
.live-stage, .live-grid > * { min-width: 0; }
.screen { position: relative; width: 100%; background: #0d1b20; border-radius: var(--radius); min-height: 12rem; aspect-ratio: 16 / 9; overflow: hidden; }
.videos { position: relative; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); grid-auto-rows: 1fr; gap: 4px; width: 100%; height: 100%; }
.video-tile { position: relative; background: #000; min-height: 0; overflow: hidden; }
.video-tile video { width: 100%; height: 100%; object-fit: contain; display: block; }
/* A shared screen fills the stage; cameras float as picture-in-picture insets. */
.video-tile.screenshare { position: absolute; inset: 0; }
.videos:has(.screenshare) .video-tile:not(.screenshare) { position: absolute; top: auto; left: auto; right: .5rem; bottom: .5rem; width: 26%; height: auto; aspect-ratio: 16 / 9; z-index: 2; border: 2px solid rgba(255,255,255,.7); border-radius: 6px; }
.videos:has(.screenshare) .video-tile:not(.screenshare) video { height: 100%; object-fit: cover; }
.empty[hidden] { display: none; }
.video-tile.local video { transform: scaleX(-1); }
.video-tile .label { position: absolute; left: .4rem; bottom: .4rem; background: rgba(0,0,0,.6); color: #fff; font-size: .8rem; padding: .1rem .45rem; border-radius: 4px; }
.empty { position: absolute; inset: 0; display: grid; place-items: center; color: #b9c7cc; text-align: center; padding: 1rem; }
.controls { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: .6rem; }
.controls .spacer { flex: 1; }
.controls button.on { background: var(--brand); color: var(--brand-ink); }
a.button-danger { display: inline-block; padding: .35rem .7rem; border-radius: var(--radius); background: #fbe9e4; color: var(--accent); text-decoration: none; }
.chat { display: flex; flex-direction: column; gap: .5rem; padding: .9rem; }
.chat h2 { font-size: 1rem; margin: 0; }
.messages { list-style: none; margin: 0; padding: 0; height: 18rem; overflow-y: auto; display: grid; align-content: start; gap: .3rem; font-size: .92rem; overflow-wrap: anywhere; }
.messages .sys { color: var(--muted); font-style: italic; }
.chat-form { display: flex; gap: .4rem; }
.chat-form input { flex: 1; min-width: 0; }
.webinar-controls { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin: 1rem 0; }
.recording-form { display: grid; gap: .35rem; flex: 1; }
.recording-form .inline-fields input { flex: 1; width: auto; min-width: 12rem; }

/* Touch targets (F058): on small screens every control is at least 44px tall. Standalone text links
   (breadcrumbs, link lists, course outline, product facts, brand) get vertical padding, which enlarges
   the tap area of an inline link without moving the surrounding layout. */
@media (max-width: 760px) {
  button, input:not([type=checkbox]):not([type=radio]), select, textarea { min-height: 44px; }
  a.button:not([hidden]) { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; }
  .crumbs a, .link-list a, .outline a, .product-detail dd a { padding-block: 12px; }
  .brand { padding-block: 6px; }
}

/* Cart on phones: each line becomes a small card (name; unit price and line total; quantity and remove). */
@media (max-width: 640px) {
  .cart-table thead { display: none; }
  .cart-table, .cart-table tbody, .cart-table tfoot { display: block; }
  .cart-table tbody tr {
    display: grid; grid-template-columns: 1fr auto; gap: .5rem .75rem; align-items: center;
    grid-template-areas: "name name" "unit line" "qty remove";
    padding: .75rem 1rem; border-bottom: 1px solid var(--line);
  }
  .cart-table tbody td { display: block; padding: 0; border: 0; }
  .cart-table .c-name { grid-area: name; }
  .cart-table .c-unit { grid-area: unit; text-align: left; color: var(--muted); }
  .cart-table .c-unit::after { content: " each"; }
  .cart-table .c-line { grid-area: line; font-weight: 600; }
  .cart-table .c-qty { grid-area: qty; }
  .cart-table .c-remove { grid-area: remove; }
  .cart-table tfoot tr { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 1rem; }
  .cart-table tfoot th, .cart-table tfoot td { display: block; padding: 0; border: 0; }
  .cart-table tfoot th:empty, .cart-table tfoot td:empty { display: none; }
  .cart-table tfoot tr:first-child { border-top: 2px solid var(--line); padding-top: .75rem; }
}

/* Small data tables (.stack-table) become one card per row on phones; cells show their data-label. */
@media (max-width: 640px) {
  .stack-table thead { display: none; }
  .stack-table, .stack-table tbody, .stack-table tr, .stack-table td { display: block; }
  .stack-table tr { padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
  .stack-table tr:last-child { border-bottom: 0; }
  .stack-table td { padding: .1rem 0; border: 0; }
  .stack-table td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); }
  .stack-table .st-title { font-weight: 600; margin-bottom: .2rem; }
  .stack-table .st-title a { display: inline-block; padding-block: .6rem; margin-block: -.6rem; min-height: 44px; }
  .stack-table .row-actions { display: flex; gap: .5rem; padding-top: .6rem; }
}

/* Section tabs on phones: a grid of pills instead of a sideways-scrolling strip. */
@media (max-width: 640px) {
  .tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; box-shadow: none; overflow: visible; }
  .tabs a { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: .4rem;
    border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
  .tabs a.active { background: var(--brand-soft); border-color: var(--brand); }
}

/* Live streaming test (admin) */
.live-test { max-width: 52rem; display: grid; gap: 1rem; }
.live-test > * { min-width: 0; }
.live-test h1, .live-test .lead { margin-bottom: 0; }
.live-test #liveTest { display: grid; gap: 1rem; }
.test-step-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .6rem; }
.test-step-head h2 { margin: 0; font-size: 1.15rem; flex: 1; }
.step-no { display: grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-weight: 700; flex: none; }
.check-list, .check-results { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.check-list code, .live-test code { overflow-wrap: anywhere; }
.check-results:not(:empty) { margin-top: .75rem; }
.check-results > li { border: 1px solid var(--line); border-radius: var(--radius); padding: .55rem .75rem; }
.check-row { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.check-hint { margin: .35rem 0 0; color: #7a5600; }
.check-logs { margin: .35rem 0 0; padding-left: 1.1rem; color: var(--muted); }
.check-logs:empty { display: none; }
.check-logs .log-warning { color: #7a5600; }
.check-logs .log-error { color: #b3261e; }
.pill-bad { background: #fdecea; border-color: #f3c2bc; color: #b3261e; font-weight: 600; }
.pill-warn { background: #fff6e0; border-color: #f0dca8; color: #7a5600; }
.pill-run { color: var(--muted); }
.test-summary { margin: .75rem 0 0; font-weight: 600; }
.test-summary.ok { color: var(--brand); }
.test-summary.warn { color: #7a5600; }
.test-summary.bad { color: #b3261e; }
.live-test .form-actions { flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
.live-test .inline-fields input { flex: 1; min-width: 0; width: auto; }
.checklist { margin: 0; padding-left: 1.4rem; display: grid; gap: .4rem; }
.checklist input { margin-right: .35rem; }
.troubleshoot td { vertical-align: top; min-width: 11rem; }
.dev-notes summary { cursor: pointer; font-weight: 600; }
.dev-notes ul { margin: .75rem 0 0; padding-left: 1.2rem; display: grid; gap: .5rem; font-size: .92rem; }
