/* Jaryq Lab brand for server-rendered pages: the client workspace and printable acts.
   One stylesheet for the browser and for WeasyPrint (PDF), so no custom properties inside
   @page and nothing newer than WeasyPrint understands (no :has, no container queries). */

@font-face { font-family: "Montserrat"; font-weight: 700; src: url("fonts/Montserrat-700.ttf"); }
@font-face { font-family: "Montserrat"; font-weight: 800; src: url("fonts/Montserrat-800.ttf"); }
@font-face { font-family: "Nunito Sans"; font-weight: 400; src: url("fonts/NunitoSans-400.ttf"); }
@font-face { font-family: "Nunito Sans"; font-weight: 600; src: url("fonts/NunitoSans-600.ttf"); }
@font-face { font-family: "Nunito Sans"; font-weight: 700; src: url("fonts/NunitoSans-700.ttf"); }

:root {
  --bg: #faf7f2;
  --paper: #ffffff;
  --ink: #0d0d0d;
  --ink-2: #4b4b4b;
  --muted: #857d71;
  --line: #ebe4d8;
  --orange: #ff8e03;
  --orange-deep: #c96d00; /* orange text on light surfaces: #ff8e03 is too pale to read */
  --orange-50: #fffbf5;
  --orange-100: #fff1d9;
  --orange-300: #fdb966;
  --ok: #1d7a45;
  --ok-bg: #e6f4ec;
  --warn: #a15c00;
  --warn-bg: #fff1d9;
  --display: "Montserrat", "Nunito Sans", system-ui, sans-serif;
  --text: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--text);
  font-size: 16px;
  line-height: 1.55;
}
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.15; margin: 0; }

.wordmark {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: 0.18em;
  font-size: 13px;
  text-transform: uppercase;
  text-decoration: none;
}
.wordmark::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 8px;
  border-radius: 2px;
  background: var(--orange);
  vertical-align: 1px;
}

/* --- the document (a release act): the same markup on screen and in the PDF ------------- */

.doc {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 44px 48px 28px;
}
.eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.eyebrow .wordmark { color: var(--ink); }
.chip {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  background: var(--orange-100);
  color: var(--warn);
}
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.muted { background: #f1ede6; color: var(--ink-2); }
.doc h1 { font-size: 34px; margin-top: 18px; letter-spacing: -0.01em; }
.lede { font-size: 18px; color: var(--ink-2); margin: 14px 0 0; max-width: 46em; }
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 36px;
  margin: 26px 0 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--line);
}
.meta div { min-width: 120px; }
.meta dt { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; }
.meta dd { margin: 2px 0 0; font-weight: 600; }

.doc-body { counter-reset: section; margin-top: 30px; }
.doc-body h2 {
  counter-increment: section;
  font-size: 20px;
  margin: 30px 0 12px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.doc-body h2::before {
  content: counter(section, decimal-leading-zero);
  display: inline-block;
  min-width: 42px;
  color: var(--orange);
}
.doc-body h2:first-child { margin-top: 0; }
.doc-body p { margin: 10px 0; color: var(--ink-2); }
.doc-body ul { list-style: none; margin: 8px 0 0; padding: 0 0 0 42px; }
.doc-body li { position: relative; padding: 5px 0 5px 20px; }
.doc-body li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--orange);
}
.doc-body strong { font-weight: 700; }
.doc-empty { color: var(--muted); font-style: italic; }

/* Progress against the specification plan: "было" and "стало" as two bars. Done is green,
   what this release finished is orange, partly done is a pale stripe. */
.plan { margin-top: 30px; padding: 20px 22px; background: var(--orange-50); border: 1px solid var(--line); border-radius: 14px; }
.plan-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 14px; }
.plan-head h2 { font-size: 17px; }
.plan-head .chip { background: var(--orange-100); color: var(--orange-deep); }
.plan-row { display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; gap: 12px; margin-top: 8px; }
.plan-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.plan-num { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.pbar { height: 12px; border-radius: 999px; background: #efe8dc; overflow: hidden; display: flex; }
.pbar .seg { display: block; height: 100%; }
.pbar .seg.done { background: var(--ok); }
.pbar .seg.gained { background: var(--orange); }
.pbar .seg.partial { background: #b9dcc7; }
.plan-note { margin: 10px 0 0; font-size: 14px; color: var(--ink-2); }
.plan-moves { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.plan-moves ul { list-style: none; margin: 6px 0 0; padding: 0; }
.plan-moves li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; padding: 4px 0; font-size: 14.5px; }
.plan-no { color: var(--orange-deep); font-weight: 700; font-variant-numeric: tabular-nums; }
.plan-title { font-weight: 600; }
.plan-step { margin-left: auto; color: var(--muted); font-size: 13px; }
.st { font-weight: 700; }
.st.done { color: var(--ok); }
.st.partial { color: var(--warn); }
.st.todo, .st.new { color: var(--muted); }

/* --- the reconciliation act (act_doc.html): the one Jaryq Lab act format --------------- */

.act { --st-ok: #1d7a45; --st-ok-bg: #e6f4ec; --st-part: #9a5b00; --st-part-bg: #fbecd2; --st-todo: #b3261e; --st-todo-bg: #fbe4e1; }
.act .chip.ok { background: var(--st-ok-bg); color: var(--st-ok); }
.act .chip.part { background: var(--st-part-bg); color: var(--st-part); }
.act .chip.todo { background: var(--st-todo-bg); color: var(--st-todo); }
.act-progress { margin-top: 30px; }
.act-score { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.act-score b { font-family: var(--display); font-weight: 800; font-size: 32px; }
.act-score span { color: var(--ink-2); }
.act-bar { margin-top: 12px; max-width: 520px; }
.act-strip { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 12px; }
.act-cell { display: block; min-width: 40px; padding: 10px 6px 8px; text-align: center; text-decoration: none; border-radius: 6px; border-bottom: 3px solid transparent; font-weight: 700; font-size: 12px; }
.act-cell.ok { background: var(--st-ok-bg); color: var(--st-ok); border-bottom-color: var(--st-ok); }
.act-cell.part { background: var(--st-part-bg); color: var(--st-part); border-bottom-color: var(--st-part); }
.act-cell.todo { background: var(--st-todo-bg); color: var(--st-todo); border-bottom-color: var(--st-todo); }
.act-legend { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 12px; font-size: 14px; color: var(--ink-2); }
.act-legend i { display: inline-block; width: 20px; height: 8px; border-radius: 2px; margin-right: 8px; vertical-align: 1px; }
.act-legend i.ok { background: var(--st-ok); }
.act-legend i.part { background: var(--st-part); }
.act-legend i.todo { background: var(--st-todo); }
.act-legend b { color: var(--ink); }
.act-rubric { font-size: 13px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 46px 0 0; padding-bottom: 10px; border-bottom: 2px solid var(--ink); }
.act-item, .act-task { display: flex; gap: 18px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.act-task { padding: 16px 0; }
.act-num { flex: 0 0 46px; font-weight: 800; font-size: 18px; color: var(--orange-deep); font-variant-numeric: tabular-nums; }
.act-num.small { font-size: 13px; color: var(--muted); padding-top: 2px; }
.act-main { flex: 1 1 auto; min-width: 0; }
.act-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; margin-bottom: 12px; }
.act-head h3 { font-size: 19px; }
.act-note { margin: -4px 0 12px; color: var(--ink-2); font-size: 15px; }
.act-cols { display: flex; flex-wrap: wrap; gap: 16px 32px; }
.act-cols > div { flex: 1 1 260px; min-width: 0; }
.act-label { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.act-list { list-style: none; margin: 0; padding: 0; }
.act-list li { position: relative; padding: 3px 0 3px 18px; font-size: 15px; color: var(--ink-2); }
.act-list li::before { content: ""; position: absolute; left: 0; top: 0.85em; width: 8px; height: 2px; border-radius: 1px; background: var(--muted); }
.act-list.done li { color: var(--ink); }
.act-list.done li::before { background: var(--st-ok); }
.act-list.part li::before { background: var(--st-part); }
.act-list.todo li::before { background: var(--st-todo); }
.act-nothing { margin: 0; color: var(--muted); font-size: 15px; font-style: italic; }
.act-box { margin-top: 16px; padding: 18px 22px; border: 1px solid var(--line); border-radius: 14px; }
.act-box.tone-ok { background: var(--st-ok-bg); border-color: transparent; }
.act-box.tone-warn { background: var(--orange-100); border-color: transparent; }
.act-box h4 { font-family: var(--display); font-size: 15px; font-weight: 800; margin: 0 0 6px; }
.act-box.tone-ok h4 { color: var(--st-ok); }
.act-box.tone-warn h4 { color: var(--orange-deep); }
.act-box p { margin: 6px 0 0; font-size: 15px; color: var(--ink-2); }
.act-extras { margin-top: 46px; padding: 22px 24px 20px; border-radius: 16px; background: var(--orange-50); border: 1px solid var(--orange-100); }
.act-extras-head { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.act-extras-count { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; min-width: 56px; height: 56px; padding: 0 10px; border-radius: 14px; background: var(--orange); color: #fff; font-family: var(--display); font-weight: 800; font-size: 22px; }
.act-extras-head h2 { font-size: 19px; }
.act-extras-head p { margin: 2px 0 0; font-size: 14px; color: var(--ink-2); }
.act-extras ul { list-style: none; margin: 0; padding: 0; columns: 2 260px; column-gap: 32px; }
.act-extras li { position: relative; break-inside: avoid; padding: 5px 0 5px 26px; font-size: 15px; }
.act-extras li::before { content: "+"; position: absolute; left: 0; top: 4px; width: 18px; height: 18px; border-radius: 5px; background: var(--orange-100); color: var(--orange-deep); font-weight: 800; font-size: 14px; line-height: 18px; text-align: center; }
body.print .act-extras { break-inside: avoid; }
.act-task h4 { font-family: var(--text); font-size: 16px; font-weight: 700; margin: 0 0 3px; }
.act-task p { margin: 0; font-size: 15px; color: var(--ink-2); }
.act-tags { flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; justify-content: flex-end; max-width: 40%; }
.act-tag { font-size: 11px; font-weight: 700; padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-2); white-space: nowrap; }
.act-tag.size { background: #f4efe6; border-color: transparent; }
.act-rework { margin-top: 10px; padding-left: 12px; border-left: 2px solid var(--st-part); }
.act-rework .act-label { color: var(--st-part); }
.act-rework dl { margin: 6px 0 0; }
.act-rework dt { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; margin-top: 6px; }
.act-rework dd { margin: 3px 0 0; font-size: 14.5px; padding: 4px 10px; border-radius: 6px; }
.act-rework .was { color: var(--st-todo); }
.act-rework dd.was { background: var(--st-todo-bg); }
.act-rework .now { color: var(--st-ok); }
.act-rework dd.now { background: var(--st-ok-bg); }
.act-signs { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 30px; }
.act-sign { flex: 1 1 220px; }
.act-sign .who { font-weight: 700; margin-top: 4px; }
.act-sign .line { border-bottom: 1px solid var(--ink-2); height: 40px; }
.act-sign .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.act-foot span:first-child { max-width: 80ch; }
@media (max-width: 640px) {
  .act-item, .act-task { flex-wrap: wrap; gap: 6px 12px; }
  .act-num { flex-basis: 100%; }
  .act-tags { justify-content: flex-start; max-width: none; }
}
body.print .act-task, body.print .act-box, body.print .act-sign, body.print .act-list li { break-inside: avoid; }
body.print .act-head, body.print .act-label { break-after: avoid; }
/* WeasyPrint does not split a flex box across pages: sections become plain blocks in print. */
body.print .act-item { display: block; }
body.print .act-item .act-num { float: left; width: 46px; }
body.print .act-item .act-main { margin-left: 64px; }
body.print .act-cols { display: block; }
body.print .act-cols > div + div { margin-top: 12px; }
body.print .act-rubric { break-after: avoid; font-size: 10pt; }
body.print .act-score b { font-size: 22pt; }

/* Screenshots of the release: phone screens are tall, so a row of narrow figures. */
.doc-shots { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); }
.doc-shots h2 { font-size: 20px; margin: 0 0 14px; }
.shots { display: flex; flex-wrap: wrap; gap: 18px; }
.shots figure { margin: 0; width: 200px; max-width: 100%; }
.shots img {
  display: block;
  width: 100%;
  max-height: 440px;
  object-fit: contain;
  object-position: top;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.shots figcaption { margin-top: 6px; font-size: 13px; color: var(--ink-2); }

.accept-mark {
  margin-top: 30px;
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--ok-bg);
  color: var(--ok);
  font-weight: 700;
}
.doc-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 40px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

/* --- the client workspace ------------------------------------------------------------------ */

.shell { max-width: 880px; margin: 0 auto; padding: 0 16px 64px; }
.shell.with-nav { max-width: 1120px; }

/* The sidebar: the home page's blocks, kept in view; on a phone a strip of chips that scrolls. */
.ws { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 36px; align-items: start; }
.ws-main { min-width: 0; }
.ws-main > .hero:first-child { padding-top: 6px; }
.ws-nav { position: sticky; top: 20px; padding-top: 10px; }
.ws-project {
  display: block;
  font-family: var(--display);
  font-weight: 800;
  font-size: 15px;
  text-decoration: none;
  padding: 0 12px 12px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.ws-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ws-nav li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--ink-2);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  border-left: 3px solid transparent;
}
.ws-nav li a:hover { background: var(--paper); color: var(--ink); }
.ws-nav li a[aria-current="page"] {
  background: var(--orange-50);
  color: var(--ink);
  border-left-color: var(--orange);
}
.ws-count { font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.ws-main .card { scroll-margin-top: 20px; }
@media (max-width: 860px) {
  .ws { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .ws-nav {
    top: 0;
    z-index: 5;
    margin: 0 -16px;
    padding: 8px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
  }
  .ws-project { display: none; }
  .ws-nav ul { display: flex; gap: 6px; width: max-content; }
  .ws-nav li a { border-left: 0; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 14px; white-space: nowrap; background: var(--paper); }
  .ws-nav li a[aria-current="page"] { border-color: var(--orange-300); }
  .ws-main .card { scroll-margin-top: 64px; }
}
@media print { .ws-nav { display: none; } .ws { display: block; } }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 0;
}
.topbar .who { display: flex; align-items: center; gap: 12px; color: var(--ink-2); font-size: 14px; }
.linkbtn {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
}
.hero { padding: 26px 0 8px; }
.hero .eyebrow { margin-bottom: 10px; }
.hero h1 { font-size: 40px; letter-spacing: -0.015em; }
.hero p { color: var(--ink-2); margin: 8px 0 0; }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 24px;
  margin-top: 18px;
}
.card h2 { font-size: 18px; margin-bottom: 12px; }
.card.now { background: var(--orange-50); border-color: var(--orange-100); }
.card.now .label { color: var(--orange-deep); font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
.card.now p { margin: 6px 0 0; white-space: pre-line; }

.rel-list { list-style: none; margin: 0; padding: 0; }
.rel-list li + li { border-top: 1px solid var(--line); }
.rel-list a {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 4px;
  text-decoration: none;
}
.rel-list a:hover .rel-title { text-decoration: underline; }
.rel-no { font-family: var(--display); font-weight: 800; font-size: 22px; color: var(--orange); }
.rel-title { font-weight: 700; display: block; }
.rel-date { color: var(--muted); font-size: 14px; }
.empty { color: var(--muted); }

/* Demo accounts: a row per role; login and password select in one click. */
.demo-sub { color: var(--muted); margin: -6px 0 10px; font-size: 14px; }
.demo { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 6px 16px; padding: 14px 4px; }
.demo + .demo { border-top: 1px solid var(--line); }
.demo-role { font-family: var(--display); font-weight: 800; font-size: 15px; }
.demo dl { margin: 0; display: grid; gap: 6px; }
.demo dl div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px; align-items: baseline; }
.demo dt { color: var(--muted); font-size: 13px; }
.demo dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.demo code { user-select: all; font-size: 14px; background: var(--orange-50); border: 1px solid var(--orange-100); border-radius: 6px; padding: 1px 7px; }
@media (max-width: 560px) {
  .demo { grid-template-columns: minmax(0, 1fr); }
  .demo dl div { grid-template-columns: 96px minmax(0, 1fr); }
}

.pay-sum { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-bottom: 14px; }
.pay-sum b { font-family: var(--display); font-size: 20px; display: block; }
.pay-sum span { color: var(--muted); font-size: 13px; }
.bar { height: 8px; border-radius: 99px; background: #f1ede6; overflow: hidden; margin-bottom: 16px; }
.bar i { display: block; height: 100%; background: var(--orange); border-radius: 99px; }
table.pay { width: 100%; border-collapse: collapse; font-size: 15px; }
table.pay td { padding: 9px 4px; border-top: 1px solid var(--line); vertical-align: top; }
table.pay td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.pay td.st { white-space: nowrap; }

.btn {
  display: inline-block;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 11px 20px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  background: var(--ink);
  color: #fff;
}
.btn.orange { background: var(--orange); color: var(--ink); }
.btn.ghost { background: var(--paper); border-color: var(--line); color: var(--ink); }
.btn:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid var(--orange-300); outline-offset: 2px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
textarea, input[type="text"], input[type="password"] {
  width: 100%;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 14px;
  background: var(--paper);
  color: var(--ink);
}
textarea { min-height: 110px; resize: vertical; }
details.remarks summary { cursor: pointer; list-style: none; }
details.remarks summary::-webkit-details-marker { display: none; }
details.remarks[open] summary { margin-bottom: 12px; }
.feedback { list-style: none; margin: 0; padding: 0; }
.feedback li { padding: 12px 0; border-top: 1px solid var(--line); }
.feedback li:first-child { border-top: 0; padding-top: 0; }
.feedback .when { color: var(--muted); font-size: 13px; }
.feedback .text { margin-top: 4px; white-space: pre-line; }
.back { display: inline-block; margin: 6px 0 16px; color: var(--ink-2); text-decoration: none; font-size: 14px; }
.back:hover { text-decoration: underline; }
.notice { padding: 12px 16px; border-radius: 12px; background: var(--ok-bg); color: var(--ok); font-weight: 600; margin-top: 18px; }
.site-foot { margin-top: 48px; color: var(--muted); font-size: 13px; display: flex; justify-content: space-between; gap: 12px; }

/* the PIN screen */
.gate { min-height: 100svh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.gate .card { width: 100%; max-width: 420px; padding: 32px 30px; margin: 0; }
.gate h1 { font-size: 26px; margin: 22px 0 6px; }
.gate p { color: var(--ink-2); margin: 0 0 20px; }
.pin {
  font-family: var(--display);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.5em;
  text-align: center;
  padding: 12px 0 12px 0.5em;
}
.gate .btn { width: 100%; margin-top: 14px; }
.error { color: #b42318; font-weight: 600; margin: 12px 0 0; }

@media (max-width: 640px) {
  .doc { padding: 26px 20px 20px; border-radius: 14px; }
  .doc h1 { font-size: 26px; }
  .hero h1 { font-size: 30px; }
  .doc-body ul { padding-left: 0; }
  .doc-body h2::before { min-width: 34px; }
  .rel-list a { grid-template-columns: 40px minmax(0, 1fr); }
  .rel-list a .chip { grid-column: 2; justify-self: start; }
  .card { padding: 18px; }
}

/* --- the PDF ------------------------------------------------------------------------------- */

@page {
  size: A4;
  margin: 18mm 16mm 18mm;
  background: #faf7f2;
  @bottom-right {
    content: counter(page) " / " counter(pages);
    font-family: "Nunito Sans", sans-serif;
    font-size: 9pt;
    color: #857d71;
  }
}
body.print { background: #faf7f2; font-size: 11pt; }
body.print .doc { border: 0; border-radius: 0; padding: 0; background: transparent; }
body.print .doc h1 { font-size: 26pt; }
body.print .lede { font-size: 13pt; }
body.print .doc-body h2 { break-after: avoid; font-size: 15pt; }
body.print .doc-body li { break-inside: avoid; }
body.print .plan { break-inside: avoid; }
body.print .doc-shots h2 { font-size: 15pt; break-after: avoid; }
body.print .shots figure { width: 150pt; break-inside: avoid; }
body.print .shots img { max-height: 320pt; }
body.print .doc-body li::before { top: 11pt; }

/* --- markdown pages (guides, and anything richer than a release) -------------------------- */

.guide h1 { font-size: 34px; margin-top: 18px; }
.prose { margin-top: 26px; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: 22px; margin: 34px 0 12px; padding-top: 22px; border-top: 1px solid var(--line); }
.prose h3 { font-size: 17px; margin: 22px 0 8px; }
.prose p, .prose li { color: var(--ink-2); }
.prose p { margin: 10px 0; }
.prose ul, .prose ol { margin: 10px 0; padding-left: 24px; }
.prose li { margin: 5px 0; }
.prose li > p { margin: 0; }
.prose ol { counter-reset: step; list-style: none; padding-left: 0; }
.prose ol > li { counter-increment: step; position: relative; padding-left: 40px; min-height: 28px; }
.prose ol > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--orange);
  color: var(--orange-deep);
  font-weight: 800;
  font-size: 13px;
  text-align: center;
  line-height: 23px;
}
.prose a { color: var(--orange-deep); text-underline-offset: 3px; }
.prose code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.88em;
  background: #f1ede6;
  border-radius: 5px;
  padding: 1px 6px;
}
.prose blockquote {
  margin: 14px 0;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--orange-50);
  border: 1px solid var(--orange-100);
}
.prose blockquote p { margin: 4px 0; color: var(--ink); }
.prose blockquote strong { color: var(--orange-deep); }
.prose table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 26px 0; }

ul.tasks { list-style: none; padding: 0; margin: 12px 0; }
ul.tasks li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 8px; align-items: start; padding: 6px 0; }
ul.tasks form { margin: 0; }
.tick {
  display: inline-block;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  border-radius: 6px;
  border: 1.5px solid var(--muted);
  background: var(--paper);
  cursor: pointer;
  padding: 0;
  position: relative;
}
.tick:hover { border-color: var(--orange); }
.tick[aria-pressed="true"] { background: var(--orange); border-color: var(--orange); }
.tick[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 11px;
  border: solid var(--ink);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}
ul.tasks li.done .task-text { color: var(--muted); text-decoration: line-through; }
.task-who { display: block; font-size: 13px; color: var(--muted); }

/* A hidden value in a guide (||value||, core/web/markdown.py): masked until the eye is pressed
   (static/secret.js); print shows the mask and the last 4 characters. */
.secret {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  vertical-align: baseline;
  padding: 0 2px 0 6px;
  border-radius: 6px;
  background: #f1ede6;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.88em;
  color: var(--ink);
  text-decoration: none;
}
.secret-mask { display: inline-block; min-width: 8ch; letter-spacing: 0.05em; color: var(--muted); }
.secret-value { display: none; overflow-wrap: anywhere; user-select: all; }
.secret.shown .secret-mask { display: none; }
.secret.shown .secret-value { display: inline; }
.secret-print { display: none; }
.secret-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.secret-btn:hover { color: var(--ink); background: var(--orange-100); }
.secret-btn:focus-visible { outline: 3px solid var(--orange-300); outline-offset: 0; }
.secret-btn svg { width: 15px; height: 15px; }
.secret-btn .i-hide, .secret-btn .i-done, .secret.shown .i-show, .secret-copy.copied .i-copy { display: none; }
.secret.shown .i-hide, .secret-copy.copied .i-done { display: block; }
.secret-copy.copied { color: #2f7d32; }
.secret-status {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
@media print {
  .secret { background: none; padding: 0; }
  .secret-mask, .secret-value, .secret.shown .secret-value, .secret-btn { display: none !important; }
  .secret-print { display: inline; }
}
@media (max-width: 640px) { .guide h1 { font-size: 26px; } }
