:root {
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #0f766e;
  --accent-soft: #ecfdf5;
  --bg: #fafaf9;
  --card: #ffffff;
  --danger: #b91c1c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

header.site {
  padding: .8rem 1.2rem;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

header.site a {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: .02em;
  text-decoration: none;
}

main {
  max-width: 44rem;
  margin: 0 auto;
  padding: 1.5rem 1.2rem 5rem;
}

h1 { font-size: 2rem; line-height: 1.2; margin: .3rem 0 1rem; }
h2 { font-size: 1.3rem; line-height: 1.3; margin: 2rem 0 .6rem; }
p { margin: 0 0 1rem; }
a { color: var(--accent); }

.kicker {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: .85rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.kicker a { color: inherit; }
.muted { color: var(--muted); }
.error { color: var(--danger); font-weight: 600; }

.card {
  display: block;
  margin: 1.2rem 0;
  padding: 1.2rem 1.4rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.card h2:first-child { margin-top: 0; }
a.card { color: inherit; text-decoration: none; }
a.card:hover { border-color: var(--accent); }
a.card h2 { color: var(--accent); margin: 0 0 .4rem; }

.block { margin: 1.6rem 0; }
.text p { white-space: pre-line; }
figure { margin: 1.6rem 0; }
figure img { display: block; max-width: 100%; height: auto; border-radius: 12px; }

.video { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 12px; overflow: hidden; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video + p { margin-top: .5rem; font-size: .95rem; }

label { display: block; margin: 1rem 0 .4rem; font-weight: 600; }
label.option { display: flex; gap: .7rem; align-items: center; margin: 0; padding: .45rem 0; font-weight: 400; }

fieldset {
  margin: 1.6rem 0;
  padding: 1rem 1.3rem 1.2rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}

legend { padding: 0 .35rem; font-weight: 600; }

input:not([type]), input[type=text], input[type=email], input[type=date], input[type=time], input[type=number], select, textarea {
  width: 100%;
  padding: .6rem .75rem;
  font: inherit;
  color: inherit;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 9px;
}

input[type=radio], input[type=checkbox] { width: 1.15rem; height: 1.15rem; accent-color: var(--accent); }
input[type=file] { font: inherit; font-size: .95rem; }
textarea { min-height: 6rem; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

button, .button {
  display: inline-block;
  padding: .65rem 1.2rem;
  font: inherit;
  font-weight: 600;
  line-height: 1.3;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 9px;
  text-decoration: none;
  cursor: pointer;
}

button.secondary, .button.secondary { color: var(--accent); background: #fff; }
button.danger { color: var(--danger); background: #fff; border-color: #fca5a5; }
button.small { padding: .3rem .7rem; font-size: .9rem; }
button:disabled { opacity: .4; cursor: default; }
.default-submit { position: absolute; left: -9999px; }

.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.4rem 0 1.2rem; }
[data-draft-status] { align-self: center; color: var(--muted); font-size: .9rem; }
.tools { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .9rem; }
.add-block { display: flex; flex-wrap: wrap; gap: .5rem; }

ol.outline li { margin: .2rem 0; }
ol.lessons { padding-left: 1.4rem; }
ol.lessons li { margin: .6rem 0; }
ol.lessons form.tools { display: inline-flex; margin: 0 0 0 .8rem; vertical-align: middle; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: .55rem .4rem; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: .85rem; font-weight: 600; }

img.thumb { display: block; max-width: 14rem; max-height: 9rem; margin-bottom: .4rem; border-radius: 8px; }
.banner { padding: .7rem 1rem; background: #fef3c7; border: 1px solid #fcd34d; border-radius: 9px; }

.lesson { margin: 1.8rem 0; padding-top: .2rem; border-top: 1px solid var(--line); }
.lesson h2 { margin: 1rem 0 .2rem; }
.status { margin: 0 0 .8rem; color: var(--muted); font-size: .9rem; }
.status.done { color: var(--accent); }
.answer { margin: .7rem 0 1rem; }
.answer .prompt { color: var(--muted); font-size: .95rem; }
.answer .value { font-weight: 500; white-space: pre-line; }
img.upload { display: block; max-width: 100%; max-height: 22rem; margin-top: .3rem; border-radius: 10px; }

@media print {
  header.site, .noprint, form { display: none !important; }
  body { font: 11.5pt/1.5 Georgia, "Times New Roman", serif; color: #000; background: #fff; }
  main { max-width: none; padding: 0; }
  h1 { font-size: 20pt; }
  h2 { font-size: 13.5pt; }
  .kicker, .muted, .status, .answer .prompt { color: #444; }
  .lesson { break-inside: avoid; border-top: 1px solid #999; }
  a { color: inherit; text-decoration: none; }
  img.upload { max-height: 9cm; }
}
