:root {
  --bg: #f5f6f4; --card: #fff; --ink: #18201b; --muted: #5d6a62; --line: #dfe4df;
  --accent: #1f7a4d; --accent-ink: #fff; --warn: #a15c00; --bad: #b3261e; --ok: #1f7a4d;
  --radius: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.45; }
.wrap { max-width: 720px; margin: 0 auto; padding: 16px 16px 64px; }
.wide { max-width: 1280px; }
h1 { font-size: 1.45rem; margin: 0 0 4px; }
h2 { font-size: 1.1rem; margin: 0 0 12px; }
h3 { font-size: 1rem; margin: 16px 0 8px; }
.muted { color: var(--muted); }
.small-text { font-size: .85rem; }
.pre { white-space: pre-wrap; margin: 0 0 6px; }
.big { font-size: 1.1rem; font-weight: 600; }
.row { display: flex; align-items: center; flex-wrap: wrap; }
.gap { gap: 8px; }
.spread { justify-content: space-between; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.brand { font-weight: 700; letter-spacing: .2px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0 0 14px; }
.card.done { border-color: #b9dcc8; }
.card.locked { opacity: .55; pointer-events: none; }
label { display: block; font-weight: 600; font-size: .92rem; margin: 12px 0 4px; }
input[type=text], input[type=email], input[type=number], input[type=password], textarea, select {
  width: 100%; font: inherit; padding: 11px 12px; border: 1px solid #c9d1cb; border-radius: 10px; background: #fff; color: var(--ink);
}
textarea { min-height: 84px; resize: vertical; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600;
  padding: 11px 16px; border-radius: 10px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  cursor: pointer; min-height: 44px; text-decoration: none;
}
.btn.ghost { background: transparent; color: var(--accent); }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn.small { padding: 6px 10px; min-height: 34px; font-size: .88rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.pkg { display: grid; gap: 10px; }
.pkg label { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.pkg label:has(input:checked) { border-color: var(--accent); background: #eef7f1; }
.pkg input { margin-top: 4px; width: 20px; height: 20px; }
.pkg .price { font-weight: 700; margin-left: auto; white-space: nowrap; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { width: 22px; height: 22px; flex: none; margin-top: 2px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.progress { height: 14px; background: #e6ebe7; border-radius: 99px; overflow: hidden; margin: 12px 0 6px; }
.progress > div { height: 100%; background: var(--accent); width: 0; transition: width .2s; }
.notice { padding: 10px 12px; border-radius: 10px; background: #fff7e8; border: 1px solid #f0d9a8; margin: 10px 0; }
.ok { color: var(--ok); font-weight: 600; }
.bad { color: var(--bad); }
.code { font-family: ui-monospace, Menlo, monospace; font-size: 1.2rem; font-weight: 700; letter-spacing: 1px; }
.chip { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: .8rem; background: #eceeea; white-space: nowrap; }
.chip.ok { background: #dff1e6; color: #145236; }
.chip.warn { background: #fff0d6; color: #7a4600; }
.chip.bad { background: #fde3e0; color: #8c1d16; }
.langs select { width: auto; padding: 6px 8px; }
.hidden { display: none !important; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 50; max-width: 90vw; }

/* report */
.report-video { width: 100%; max-height: 60vh; background: #000; border-radius: 10px; margin: 0 0 12px; }
.moment { border-top: 1px solid var(--line); padding: 10px 0; }
.moment-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.print-only { display: none; }

/* coach */
table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: .92rem; }
th { font-size: .8rem; text-transform: uppercase; color: var(--muted); letter-spacing: .4px; }
.analyzer { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.player video { width: 100%; background: #000; border-radius: 10px; max-height: 70vh; display: block; }
.controls { margin: 10px 0; }
.time { font-family: ui-monospace, Menlo, monospace; min-width: 120px; }
.notebox { border: 2px solid var(--accent); }
.mlist .m { border-top: 1px solid var(--line); padding: 8px 0; }
.mlist .m.sel { background: #f2f9f4; }
.mlist .m textarea { min-height: 60px; margin-top: 6px; }
.mlist .tm { font-family: ui-monospace, Menlo, monospace; font-weight: 700; cursor: pointer; }
.problems { margin: 8px 0; padding-left: 18px; color: var(--warn); }
.player { position: sticky; top: 12px; }
@media (max-width: 980px) { .analyzer { grid-template-columns: 1fr; } .player { position: static; } }
@media (max-width: 520px) { .two { grid-template-columns: 1fr; } th:nth-child(3), td:nth-child(3) { display: none; } }

@media print {
  body { background: #fff; }
  .no-print, .topbar, .toast { display: none !important; }
  .print-only { display: block; }
  .card { border: none; padding: 0; margin-bottom: 18px; }
  .wrap { max-width: none; padding: 0; }
  body.print-drill-only .report-part:not(.drill-part) { display: none; }
  body.print-drill-only .family-only { display: none; }
}

/* family account: my orders */
.order-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.order-row:hover { background: #f6f8f6; }
.order-row .chev { font-size: 1.4rem; color: var(--muted); }

/* coach: orders that need attention */
tr.todo td:first-child { box-shadow: inset 4px 0 0 var(--accent); }
/* coach: orders table becomes stacked cards on narrow screens */
@media (max-width: 760px) {
  table.orders thead { display: none; }
  table.orders, table.orders tbody, table.orders tr, table.orders td { display: block; width: 100%; }
  table.orders tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  table.orders td { border: 0; padding: 4px 12px; }
  table.orders td[data-label]:not([data-label=""])::before { content: attr(data-label); display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
  table.orders tr.todo td:first-child { box-shadow: none; }
  table.orders tr.todo { box-shadow: inset 4px 0 0 var(--accent); }
}

/* subtitles: readable on phones */
video::cue { font-size: 1.05em; line-height: 1.3; background: rgba(0, 0, 0, .78); color: #fff; }
