/* REC FINAL 2026 — caderno de revisão */
:root {
  --paper: #f2f3ec;
  --paper-2: #e8ebe1;
  --sheet: #fbfbf6;
  --ink: #17211b;
  --ink-soft: #53605a;
  --ink-faint: #7c877f;
  --rule: #ccd2c4;
  --rule-strong: #aab3a3;
  --red: #ce3a2b;
  --red-soft: #f6e2dd;
  --amber: #a86a12;
  --amber-soft: #f7ecd4;
  --green: #276b4e;
  --green-soft: #e2eee6;
  --mat: #2246c8;
  --qui: #0e6f5c;
  --bio: #a52d57;
  --c: var(--ink);
  --sans: 'Archivo', 'Segoe UI', system-ui, sans-serif;
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --mono: 'IBM Plex Mono', 'Consolas', monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(120, 135, 110, .09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 135, 110, .09) 1px, transparent 1px);
  background-size: 26px 26px;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

::selection { background: #f2c9c1; }

a { color: inherit; }

button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: 100vh;
}

/* ---------- rail ---------- */
.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 26px 20px 22px;
  background: var(--paper-2);
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 26px;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule);
}

.brand-mark {
  font-family: var(--sans);
  font-weight: 800;
  font-size: 30px;
  line-height: .8;
  letter-spacing: -.06em;
  color: var(--red);
  border: 2px solid var(--red);
  padding: 5px 6px 4px;
  transform: rotate(-3deg);
}

.brand-text {
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--ink-soft);
  text-transform: lowercase;
}

.brand-text b {
  display: block;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .02em;
  color: var(--ink);
  text-transform: none;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 8px;
  border: 0;
  border-left: 3px solid transparent;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink-soft);
  transition: background .15s, color .15s, border-color .15s;
}

.nav-item:hover { background: rgba(255, 255, 255, .45); color: var(--ink); }

.nav-item[aria-selected="true"] {
  border-left-color: var(--c);
  background: var(--sheet);
  color: var(--ink);
}

.nav-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  background: var(--c);
  border-radius: 50%;
}

.nav-count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 400;
  color: var(--ink-faint);
}

.rail-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
}

.rail-progress {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-soft);
}

.rail-progress b {
  display: block;
  font-family: var(--sans);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--ink);
  line-height: 1.1;
}

.rail-btn {
  border: 1px solid var(--rule-strong);
  background: transparent;
  padding: 8px 10px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.rail-btn:hover { background: var(--sheet); }

/* ---------- main ---------- */
main {
  min-width: 0;
  padding: 0 48px 90px;
}

.panel { display: none; }
.panel.active { display: block; }

.wrap { max-width: 1120px; margin: 0 auto; }

/* ---------- overview hero ---------- */
.hero {
  position: relative;
  padding: 64px 0 40px;
  border-bottom: 1px solid var(--rule);
}

.kicker {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .06em;
  color: var(--ink-soft);
  margin: 0 0 22px;
}

.hero h1 {
  margin: 0;
  max-width: 16ch;
  font-family: var(--sans);
  font-weight: 800;
  font-size: clamp(46px, 6.4vw, 82px);
  line-height: .94;
  letter-spacing: -.045em;
}

.scribble {
  display: block;
  width: min(430px, 80%);
  height: 14px;
  margin: 14px 0 24px;
  color: var(--red);
}

.hero-lead {
  max-width: 58ch;
  margin: 0;
  font-size: 20px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.hero-lead b { color: var(--ink); font-weight: 600; }

.stamp {
  position: absolute;
  right: 4px;
  top: 66px;
  transform: rotate(-6deg);
  border: 3px double var(--red);
  color: var(--red);
  padding: 9px 14px 7px;
  font-family: var(--sans);
  font-weight: 800;
  font-size: 21px;
  letter-spacing: .16em;
  line-height: 1;
  text-align: center;
  opacity: .82;
}

.stamp small {
  display: block;
  margin-top: 5px;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 400;
  letter-spacing: .22em;
}

/* ---------- tickets ---------- */
.tickets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 36px 0 0;
}

.ticket {
  position: relative;
  display: block;
  padding: 18px 18px 16px 26px;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-top: 5px solid var(--c);
  text-decoration: none;
  transition: transform .18s, box-shadow .18s;
}

.ticket:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(30, 40, 30, .08);
}

.ticket::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 8px;
  bottom: 8px;
  border-left: 1px dashed var(--rule-strong);
}

.ticket-day {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-soft);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.ticket-date {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin: 2px 0 0;
  font-family: var(--sans);
  font-weight: 800;
  font-size: 46px;
  letter-spacing: -.05em;
  line-height: 1;
}

.ticket-date em {
  font-style: normal;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--ink-soft);
}

.ticket-subject {
  margin: 8px 0 0;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -.01em;
}

.ticket-meta {
  margin: 3px 0 0;
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--ink-faint);
}

.ticket-progress {
  margin-top: 12px;
  height: 4px;
  background: var(--paper-2);
  overflow: hidden;
}

.ticket-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--c);
  transition: width .3s;
}

/* ---------- alerts ---------- */
.alerts { display: grid; gap: 10px; margin: 28px 0 0; }

.callout {
  border-left: 3px solid var(--rule-strong);
  background: rgba(255, 255, 255, .55);
  padding: 13px 16px;
  font-size: 15px;
  line-height: 1.55;
}

.callout p { margin: 0 0 6px; }
.callout p:last-child { margin-bottom: 0; }

.callout .c-title {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -.005em;
  margin-bottom: 4px;
}

.callout.warn { border-left-color: var(--red); background: var(--red-soft); }
.callout.warn .c-title { color: var(--red); }
.callout.alert { border-left-color: var(--amber); background: var(--amber-soft); }
.callout.alert .c-title { color: var(--amber); }
.callout.info { border-left-color: var(--green); background: var(--green-soft); }
.callout.info .c-title { color: var(--green); }
.callout.tip { border-left-color: var(--green); background: var(--green-soft); }
.callout.tip .c-title { color: var(--green); }

/* ---------- steps ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 42px 0 0;
  border-top: 1px solid var(--rule);
}

.step {
  padding: 18px 22px 0 0;
  border-right: 1px solid var(--rule);
}

.step + .step { padding-left: 22px; }
.step:last-child { border-right: 0; }

.step-n {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--red);
}

.step h3 {
  margin: 5px 0 4px;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 700;
}

.step p { margin: 0; font-size: 14.5px; color: var(--ink-soft); line-height: 1.5; }

/* ---------- subject header ---------- */
.subject-head {
  position: relative;
  padding: 52px 0 30px;
  border-top: 6px solid var(--c);
  border-bottom: 1px solid var(--rule);
}

.subject-head .kicker { color: var(--c); margin-bottom: 12px; }

.subject-head h1 {
  margin: 0;
  font-family: var(--sans);
  font-weight: 800;
  font-size: clamp(40px, 5.4vw, 66px);
  line-height: .95;
  letter-spacing: -.04em;
}

.subject-sub {
  max-width: 58ch;
  margin: 12px 0 0;
  font-size: 18px;
  color: var(--ink-soft);
}

.exam-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-soft);
}

.exam-line b {
  color: var(--ink);
  font-weight: 500;
}

.subject-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  max-width: 360px;
}

.subject-progress .track {
  flex: 1;
  height: 5px;
  background: var(--paper-2);
}

.subject-progress .track span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--c);
  transition: width .3s;
}

.subject-progress .pct {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-soft);
  min-width: 62px;
  text-align: right;
}

/* ---------- blocks ---------- */
.block { padding: 46px 0 0; }

.block > h2 {
  margin: 0 0 16px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 27px;
  line-height: 1.15;
  letter-spacing: -.025em;
}

.block > h2 .h2-note {
  display: block;
  margin-top: 5px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--ink-faint);
}

.rule { height: 1px; background: var(--rule); margin: 0 0 22px; }

/* ---------- plan markdown ---------- */
.plan { font-size: 16.5px; }

.plan h2 {
  margin: 34px 0 10px;
  font-family: var(--sans);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -.02em;
}

.plan h3 {
  margin: 26px 0 8px;
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 700;
}

.plan h4 {
  margin: 20px 0 6px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
}

.plan p { margin: 0 0 12px; max-width: 74ch; }

.plan ul, .plan ol { margin: 0 0 14px; padding-left: 22px; }
.plan li { margin: 0 0 5px; }
.plan li::marker { color: var(--ink-faint); }

/* fórmulas inline com fração precisam de entrelinha maior */
.plan p, .plan li { line-height: 1.72; }
.plan p:has(.katex), .plan li:has(.katex) { line-height: 2.15; }
.katex { font-size: 1.04em; }
.katex-display { margin: .9em 0; overflow-x: auto; overflow-y: hidden; }

.plan hr { border: 0; border-top: 1px solid var(--rule); margin: 26px 0; }

.plan blockquote { margin: 0; }

.plan code {
  font-family: var(--mono);
  font-size: .86em;
  background: rgba(120, 135, 110, .13);
  padding: 1px 4px;
  overflow-wrap: anywhere;
}

.plan strong { font-weight: 600; }

.plan em { font-style: italic; }

/* tables */
.table-wrap {
  overflow-x: auto;
  margin: 0 0 20px;
  border: 1px solid var(--rule);
  background: var(--sheet);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.45;
}

th {
  text-align: left;
  font-weight: 700;
  padding: 9px 12px;
  border-bottom: 2px solid var(--ink);
  vertical-align: bottom;
}

td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(120, 135, 110, .07); }

td:first-child { white-space: nowrap; }

/* tasks */
.task {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  padding: 2px 0;
  font-size: 15.5px;
  line-height: 1.45;
}

.task input {
  appearance: none;
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  margin: 3px 0 0;
  border: 1.5px solid var(--rule-strong);
  background: var(--sheet);
  cursor: pointer;
  position: relative;
}

.task input:checked { background: var(--c); border-color: var(--c); }

.task input:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 0px;
  width: 5px;
  height: 9px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(38deg);
}

.task input:checked + span {
  color: var(--ink-faint);
  text-decoration: line-through;
  text-decoration-color: var(--rule-strong);
}

/* cronograma */
.cron h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin: 30px 0 8px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 700;
}

.cron h3:first-of-type { border-top: 0; padding-top: 0; }

.cron .day-date {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--red);
  border: 1px solid var(--red);
  padding: 2px 6px;
  white-space: nowrap;
}

.cron .day-title { font-size: 18px; letter-spacing: -.01em; }

.cron ul { list-style: none; padding-left: 0; }

.cron li { margin-bottom: 2px; }

/* ---------- exercises ---------- */
.ex-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 26px;
  padding: 12px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.ex-search {
  flex: 1 1 240px;
  min-width: 180px;
  border: 1px solid var(--rule-strong);
  background: var(--sheet);
  padding: 8px 11px;
  font-family: var(--sans);
  font-size: 14px;
}

.ex-count {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-faint);
}

.chapter {
  margin: 0 0 42px;
  padding: 0 0 6px;
}

.chapter-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
  padding: 16px 0 12px;
  border-top: 3px solid var(--c);
}

.chapter-head h3 {
  margin: 0;
  font-family: var(--sans);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.02em;
}

.chapter-head .ch-meta {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-faint);
}

.chapter-head .ch-pdf {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--c);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  white-space: nowrap;
}

.chapter-sub {
  margin: 0 0 4px;
  font-size: 15px;
  color: var(--ink-soft);
}

.sec-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 0;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.sec-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.ex {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  padding: 16px 0 14px;
  border-bottom: 1px solid var(--rule);
}

.ex-num {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 500;
  color: var(--c);
  padding-top: 1px;
}

.ex-num .star {
  display: block;
  font-size: 10px;
  color: var(--red);
  letter-spacing: .04em;
  margin-top: 2px;
}

.ex-text {
  margin: 0;
  max-width: 76ch;
  font-size: 16px;
  line-height: 1.58;
}

.ex-text.missing {
  font-family: var(--sans);
  font-size: 14.5px;
  color: var(--ink-faint);
  font-style: italic;
}

.ex-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 9px;
}

.mini-btn, .pdf-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid var(--rule-strong);
  background: transparent;
  font-family: var(--mono);
  font-size: 10.5px;
  text-decoration: none;
  color: var(--ink-soft);
  cursor: pointer;
}

.mini-btn:hover, .pdf-link:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--sheet);
}

.mini-btn.gab { border-color: var(--red); color: var(--red); }
.mini-btn.gab:hover { background: var(--red-soft); }
.mini-btn[disabled] { opacity: .45; cursor: default; }

.gab {
  margin: 12px 0 2px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--rule);
  max-width: 720px;
}

.gab img {
  display: block;
  width: 100%;
  height: auto;
}

.gab figcaption {
  margin-top: 7px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-faint);
}

.ex.hidden, .chapter.hidden { display: none; }

/* ---------- simulados ---------- */
.sim {
  border-top: 2px solid var(--ink);
  margin: 0 0 22px;
  background: rgba(255, 255, 255, .32);
}

.sim > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  padding: 14px 4px;
  cursor: pointer;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 17px;
  list-style: none;
}

.sim > summary::-webkit-details-marker { display: none; }

.sim > summary::before {
  content: "+";
  font-family: var(--mono);
  font-weight: 400;
  color: var(--c);
  width: 16px;
}

.sim[open] > summary::before { content: "−"; }

.sim > summary .sim-tag {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 400;
  color: var(--ink-faint);
}

.sim-body { padding: 4px 4px 22px; }

.sim-body h2, .sim-body h1 {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 700;
  margin: 22px 0 8px;
}

.sim-body h3 { font-family: var(--sans); font-size: 15px; margin: 18px 0 6px; }

.sim-body p { max-width: 72ch; margin: 0 0 10px; }

.sim-body ol, .sim-body ul { max-width: 74ch; }

.sim-body hr { border: 0; border-top: 1px dashed var(--rule-strong); margin: 18px 0; }

.gab-wrap {
  margin-top: 20px;
  border: 1px solid var(--red);
  background: var(--red-soft);
}

.gab-wrap > summary {
  padding: 10px 14px;
  cursor: pointer;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 14px;
  color: var(--red);
}

.sim-gab { padding: 6px 16px 16px; }

.sim-gab h2 {
  font-family: var(--sans);
  font-size: 15px;
  margin: 18px 0 8px;
}

/* ---------- two column ---------- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 34px;
  align-items: start;
}

.acc {
  border-top: 1px solid var(--rule);
  padding: 14px 0;
}

.acc > summary {
  display: flex;
  align-items: baseline;
  gap: 10px;
  cursor: pointer;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 15.5px;
  list-style: none;
}

.acc > summary::-webkit-details-marker { display: none; }

.acc > summary::before {
  content: "+";
  font-family: var(--mono);
  font-weight: 400;
  color: var(--c);
}

.acc[open] > summary::before { content: "−"; }

.acc-body { padding: 12px 0 0 22px; }

/* formulário em blocos */
.plan .formula { margin: 0 0 10px; }

/* ---------- log ---------- */
.log-form {
  display: grid;
  grid-template-columns: 120px 1fr 100px 1.4fr 1.4fr auto;
  gap: 8px;
  margin: 0 0 18px;
}

.log-form input {
  border: 1px solid var(--rule-strong);
  background: var(--sheet);
  padding: 7px 9px;
  font-family: var(--sans);
  font-size: 13px;
  min-width: 0;
}

.log-form button {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  padding: 7px 14px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.log-form button:hover { background: var(--red); border-color: var(--red); }

.log-empty {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-faint);
  padding: 10px 0;
}

.log-table td { font-size: 13px; }
.log-table td:last-child { white-space: nowrap; }

.log-del {
  border: 0;
  background: transparent;
  color: var(--red);
  font-family: var(--mono);
  font-size: 11px;
  cursor: pointer;
}

/* ---------- footer ---------- */
.foot {
  margin-top: 60px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-faint);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .shell { grid-template-columns: 1fr; }
  .rail {
    position: sticky;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 10px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
    overflow-x: auto;
  }
  .brand { border-bottom: 0; padding-bottom: 0; flex: 0 0 auto; }
  .brand-text { display: none; }
  .brand-mark { font-size: 21px; padding: 3px 5px; }
  .nav { flex-direction: row; gap: 4px; }
  .nav-item { white-space: nowrap; padding: 7px 9px; border-left: 0; border-bottom: 3px solid transparent; font-size: 13.5px; }
  .nav-item[aria-selected="true"] { border-left-color: transparent; border-bottom-color: var(--c); }
  .nav-count { display: none; }
  .rail-foot { display: none; }
  main { padding: 0 22px 70px; }
  .two-col { grid-template-columns: 1fr; gap: 0; }
  .log-form { grid-template-columns: 1fr 1fr; }
  .log-form input:nth-child(4), .log-form input:nth-child(5) { grid-column: span 2; }
}

@media (max-width: 720px) {
  .tickets { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .step { border-right: 0; border-bottom: 1px solid var(--rule); padding: 16px 0; }
  .step + .step { padding-left: 0; }
  .stamp { display: none; }
  .hero { padding-top: 40px; }
  .ex { grid-template-columns: 38px minmax(0, 1fr); }
  .chapter-head .ch-pdf { margin-left: 0; }
  .log-form { grid-template-columns: 1fr; }
  .log-form input:nth-child(4), .log-form input:nth-child(5) { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- print ---------- */
@media print {
  body { background: #fff; font-size: 11pt; }
  .rail, .ex-tools, .mini-btn, .pdf-link, .log-form, .stamp, .scribble { display: none !important; }
  .shell { display: block; }
  main { padding: 0; }
  .panel { display: none !important; }
  .panel.active { display: block !important; }
  .subject-head { border-top-width: 3px; }
  .ex { break-inside: avoid; }
  .gab { break-inside: avoid; }
  a { text-decoration: none; }
}

/* ---------- stats / links (gerado) ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 34px 0 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.stat {
  padding: 16px 18px 15px 0;
  border-right: 1px solid var(--rule);
}

.stat + .stat { padding-left: 18px; }
.stat:last-child { border-right: 0; }

.stat b {
  display: block;
  font-family: var(--sans);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1;
}

.stat span {
  display: block;
  margin-top: 5px;
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.plan a {
  color: var(--c);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

.plan a:hover { background: rgba(120, 135, 110, .12); }

.wl { border-bottom: 1px dotted var(--rule-strong); }

@media (max-width: 720px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat { padding-left: 0; }
  .stat:nth-child(2n) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
  .stat:nth-child(2n+1) { padding-left: 0; }
  .stat:nth-child(2n) { padding-left: 18px; }
}

/* ---------- ajustes do caderno ---------- */
.ex-num .star {
  font-size: 9px;
  letter-spacing: 0;
  white-space: nowrap;
}

.steps.four { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1000px) {
  .steps.four { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .steps.four { grid-template-columns: 1fr; }
  .brand-mark { font-size: 19px; padding: 2px 4px 1px; }
  .nav-item { font-size: 12px; padding: 6px 7px; gap: 7px; }
}

@media (max-width: 720px) {
  .rail {
    flex-wrap: wrap;
    overflow-x: visible;
    gap: 8px 12px;
    padding: 8px 12px;
  }
  .nav {
    flex: 1 1 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
  }
  .nav-item {
    justify-content: center;
    border-bottom-width: 2px;
    padding: 7px 3px;
    font-size: 11.5px;
    letter-spacing: -.01em;
  }
  .nav-dot, .nav-count { display: none; }
}

.prio-btn.on {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

/* barra de progresso mais legível sobre o papel */
.subject-progress .track {
  background: rgba(23, 33, 27, .10);
  box-shadow: inset 0 0 0 1px var(--rule);
}

@media print {
  .subject-progress { display: none; }
}
