/* ИИноагент — вариант В «Корректура» (задача web-1): бумага, чернила, линейки.
   Без карточек, теней и скруглений; единственная рамка — у текста пометки.
   Шрифты — только с нашего сервера (fonts/, SIL OFL 1.1). */

@font-face { font-family: "PT Serif"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/pt-serif-cyrillic-400-normal.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "PT Serif"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/pt-serif-latin-400-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "PT Serif"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(fonts/pt-serif-cyrillic-700-normal.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "PT Serif"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(fonts/pt-serif-latin-700-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "PT Sans"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/pt-sans-cyrillic-400-normal.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "PT Sans"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/pt-sans-latin-400-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "PT Sans"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(fonts/pt-sans-cyrillic-700-normal.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "PT Sans"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(fonts/pt-sans-latin-700-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "PT Sans"; font-style: italic; font-weight: 400; font-display: swap;
  src: url(fonts/pt-sans-cyrillic-400-italic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "PT Sans"; font-style: italic; font-weight: 400; font-display: swap;
  src: url(fonts/pt-sans-latin-400-italic.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --paper: #F4EFE3; --ink: #1C1B19; --muted: #5A5446; --body2: #3A362D;
  --red: #A8231B; --ochre: #B7791F; --ochre-text: #7A4F00; --alert-text: #6B4600;
  --box: #FFFCF4; --on-red: #FFFFFF;
  --serif: "PT Serif", Georgia, serif;
  --sans: "PT Sans", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--paper); }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 16px/1.5 var(--sans);
}
.page { max-width: 1180px; margin: 0 auto; padding: 0 48px 56px; }

a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 4px; }
a:hover { color: var(--red); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

/* buttons: one filled kind (.fill), the rest are links */
button { font: inherit; color: var(--ink); cursor: pointer; border-radius: 0; }
button:disabled { opacity: 0.55; cursor: default; }
.fill {
  min-height: 44px; padding: 0 20px; border: 0; background: var(--ink); color: var(--paper);
  font-size: 15px; font-weight: 700;
}
.fill:hover { background: var(--red); }
.link, .plain {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0; border: 0;
  background: none; text-decoration: underline; text-decoration-thickness: 1px;
  text-underline-offset: 4px; text-align: left;
}
.link:hover, .plain:hover { color: var(--red); }
.link.strong { font-weight: 700; }
.link.dashed { color: var(--muted); text-decoration-style: dashed; }

/* header */
.top {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px 24px;
  flex-wrap: wrap; padding: 26px 0 12px; border-bottom: 3px double var(--ink);
}
.brand { font-family: var(--serif); font-size: 22px; font-weight: 700; letter-spacing: 0.02em; }
.fresh { font-size: 14px; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.fresh .warn { color: var(--alert-text); font-style: italic; }
.top .link { font-size: 15px; }

/* the input page */
.input { padding: 40px 0 8px; max-width: 820px; }
.lead { margin: 0 0 8px; font-family: var(--serif); font-size: 40px; line-height: 1.1; font-weight: 700; letter-spacing: -0.01em; }
.sub { margin: 0 0 24px; font-size: 18px; color: var(--body2); }
label { display: block; font-size: 13px; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; margin: 24px 0 8px; }
input, textarea, select {
  width: 100%; font: inherit; color: var(--ink); background: var(--box);
  border: 1px solid var(--ink); border-radius: 0; padding: 12px 14px; min-height: 44px;
}
textarea { resize: vertical; min-height: 14rem; font-family: var(--serif); font-size: 18px; line-height: 1.6; }
.go-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
#counter { color: var(--muted); font-size: 14px; }
.hint { color: var(--muted); font-size: 14px; margin: 8px 0; }
#status { min-height: 1.5em; color: var(--muted); margin: 16px 0 0; }
#status.error { color: var(--red); font-weight: 700; }

/* the stamp */
.stamp { padding: 44px 0 30px; border-bottom: 1px solid var(--ink); display: flex; flex-direction: column; gap: 12px; }
.stamp h1 { margin: 0; font-family: var(--serif); font-size: 64px; line-height: 1.05; font-weight: 700; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.stamp p { margin: 0; font-size: 19px; color: var(--body2); }

/* text and margin: one row per paragraph */
.cols-head, .row { display: flex; flex-wrap: wrap; }
.cols-head { padding-top: 36px; }
.cols-head span { font-size: 13px; color: var(--muted); letter-spacing: 0.06em; padding-bottom: 18px; }
.col-text, .para { flex: 999 1 620px; min-width: 0; padding-right: 48px; }
.col-margin, .margin { flex: 1 1 340px; min-width: 0; border-left: 1px solid var(--ink); padding-left: 32px; }
.para {
  margin: 0; padding-bottom: 32px; font-family: var(--serif); font-size: 21px; line-height: 1.8;
  overflow-wrap: anywhere; white-space: pre-wrap;
}
.margin { display: flex; flex-direction: column; gap: 32px; padding-bottom: 32px; }

/* marks in the text: never by colour alone — every mark has its number and aria-label */
.m { font-style: normal; background: transparent; color: inherit; }
.m sup { font-family: var(--sans); font-size: 12px; font-weight: 700; line-height: 0; }
.m-red { background: var(--red); color: var(--on-red); padding: 1px 5px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.m-red sup { margin-left: 4px; }
.m-yellow .w { text-decoration: underline wavy var(--ochre); text-decoration-thickness: 2px; text-underline-offset: 6px; text-decoration-skip-ink: none; }
.m-yellow sup { color: var(--ochre-text); margin-left: 3px; }
.m-info .w { text-decoration: underline dotted var(--ink); text-decoration-thickness: 2px; text-underline-offset: 6px; }
.m-info sup { color: var(--muted); margin-left: 3px; }

/* a note on the margin */
.note { display: flex; flex-direction: column; gap: 12px; }
.note-head { display: flex; align-items: center; margin-left: -33px; }
.leader { width: 26px; flex: none; height: 0; border-top: 2px solid var(--red); }
.z-yellow .leader { border-top-style: dotted; border-top-color: var(--ochre); }
.z-info .leader { border-top-style: dotted; border-top-color: var(--ink); }
.num { font-family: var(--serif); font-size: 56px; line-height: 0.9; font-weight: 700; margin-left: 6px; color: var(--red); }
.z-yellow .num { color: var(--ochre-text); }
.z-info .num { color: var(--muted); }
.act { font-size: 20px; font-weight: 700; margin-left: 14px; line-height: 1.2; }
.note p { margin: 0; font-size: 16px; overflow-wrap: anywhere; }
.note .small, .note .details { font-size: 13px; color: var(--muted); }
.note .details { display: flex; flex-direction: column; gap: 2px; }
.note .alert { font-size: 14px; font-style: italic; color: var(--alert-text); }
.note .alert a { font-style: normal; color: var(--alert-text); display: inline-block; min-height: 44px; line-height: 44px; }
.mark-box {
  background: var(--box); border: 1px solid var(--ink); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.mark-box .mark-text { font-family: var(--serif); font-size: 17px; line-height: 1.45; overflow-wrap: anywhere; }
.mark-box .fill { align-self: flex-start; }
.note details summary { cursor: pointer; font-size: 14px; min-height: 44px; display: flex; align-items: center; text-decoration: underline; text-underline-offset: 4px; }
.note details summary::before { content: "▸"; margin-right: 8px; text-decoration: none; }
.note details[open] summary::before { content: "▾"; }
.note details[open] summary { margin-bottom: 8px; }
.note .info-text { font-size: 14px; color: var(--body2); }

/* the footer */
.foot {
  margin-top: 40px; border-top: 3px double var(--ink); padding-top: 10px;
  display: flex; gap: 4px 32px; flex-wrap: wrap; align-items: center; font-size: 14px; color: var(--body2);
}
.foot-note { flex: 1 1 320px; color: var(--muted); font-size: 13px; padding: 12px 0; }
.limits, .review { padding-top: 12px; max-width: 820px; }
.limits h2, .review h2 { font-family: var(--serif); font-size: 22px; margin: 12px 0; }
.limits ul { margin: 0; padding: 0; list-style: none; }
.limits li { border-top: 1px solid var(--ink); overflow-wrap: anywhere; }
.limits li:last-child { border-bottom: 1px solid var(--ink); }
.limits li > * { display: block; min-height: 44px; padding: 11px 0; }

/* the review report (WEB_REVIEW_REPORT=1 only) */
.review { border-top: 1px solid var(--ink); margin-top: 24px; }
.miss { display: flex; gap: 8px; flex-wrap: wrap; }
.miss input { flex: 1 1 220px; }
.miss select { flex: 0 1 180px; width: auto; }
#miss-list { padding-left: 1.2rem; }
.warn-note { color: var(--red); font-weight: 700; margin: 12px 0 4px; }
#report-text { font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; min-height: 16rem; }
.marks { display: flex; flex-wrap: wrap; gap: 4px 12px; padding-top: 8px; border-top: 1px dashed var(--muted); }
.marks select { width: auto; font-size: 14px; }
.marks .plain[aria-pressed="true"] { font-weight: 700; color: var(--red); }

/* the phone: one column, notes right under their paragraph */
@media (max-width: 720px) {
  .page { padding: 0 20px 40px; }
  .top { gap: 0 16px; padding-top: 14px; }
  .fresh { order: 3; flex-basis: 100%; padding-bottom: 4px; }
  .lead { font-size: 32px; }
  .stamp { padding: 28px 0 22px; }
  .stamp h1 { font-size: 40px; }
  .stamp p { font-size: 17px; }
  .cols-head { display: none; }
  .row { padding-top: 24px; }
  .para { flex-basis: 100%; padding-right: 0; padding-bottom: 16px; font-size: 18px; line-height: 1.7; }
  .margin { flex-basis: 100%; border-left: 0; padding-left: 0; gap: 24px; padding-bottom: 8px; }
  .margin:empty { display: none; }
  .note { border-left: 3px solid var(--red); padding-left: 16px; }
  .note.z-yellow { border-left-color: var(--ochre); }
  .note.z-info { border-left-color: var(--muted); }
  .note-head { margin-left: 0; }
  .leader { display: none; }
  .num { font-size: 40px; margin-left: 0; }
  .act { font-size: 18px; margin-left: 12px; }
  .mark-box .fill { align-self: stretch; width: 100%; }
  .foot { flex-direction: column; align-items: flex-start; gap: 0; }
  .foot-note { flex: none; }
}
