/* RiverNote reviews: the Markdown article (.md) and its editor (.md-editor). Colours are tokens; the dark set is
   used when the page sets data-theme="dark" on <html> (the site itself has no dark theme yet). */
.md,.md-editor{--md-ink:#20382e;--md-muted:#6b7770;--md-line:#dfe5dc;--md-soft:#f3f6f0;--md-code:#eef2ec;--md-accent:#196a4b;
  --md-red:#c0392b;--md-dark:#1d2a24;--md-mistake:#b24d49;--md-mistake-bg:#fbefed;--md-advice:#196a4b;--md-advice-bg:#ebf5ee;
  --md-summary:#9a6b12;--md-summary-bg:#fbf4e3;--md-hand-bg:#f6f8f4;--md-table-head:#eef3ea;--md-stripe:#fafbf8}
:root[data-theme="dark"] .md,:root[data-theme="dark"] .md-editor{--md-ink:#e3ebe5;--md-muted:#9aa8a0;--md-line:#33423a;--md-soft:#1c2620;
  --md-code:#25312a;--md-accent:#6fcf9d;--md-red:#ff7b6e;--md-dark:#e8eee9;--md-mistake:#ff8f84;--md-mistake-bg:#3a2523;
  --md-advice:#7bd6a4;--md-advice-bg:#1d3326;--md-summary:#f0c060;--md-summary-bg:#382f1b;--md-hand-bg:#18211c;--md-table-head:#223029;--md-stripe:#1a231e}

.md{color:var(--md-ink);font-size:14.5px;line-height:1.7;overflow-wrap:anywhere;min-width:0}
.md>:first-child,.md .callout>:first-child,.md blockquote>:first-child,.md li>:first-child{margin-top:0}
.md>:last-child,.md .callout>:last-child,.md blockquote>:last-child,.md li>:last-child{margin-bottom:0}
.md p{margin:0 0 .85em}
.md h2,.md h3,.md h4{color:var(--md-ink);line-height:1.3;letter-spacing:-.2px;margin:1.5em 0 .55em;font-weight:700}
.md h2{font-size:1.32em;padding-bottom:.3em;border-bottom:1px solid var(--md-line)}
.md h3{font-size:1.14em}
.md h4{font-size:1em;color:var(--md-accent)}
.md strong{font-weight:650}
.md del{color:var(--md-muted)}
.md a{color:var(--md-accent);text-decoration:underline;text-underline-offset:3px}
.md ul,.md ol{margin:0 0 .85em;padding-left:1.5em}
.md li{margin:.25em 0}
.md li>ul,.md li>ol{margin:.25em 0 .35em}
.md li::marker{color:var(--md-muted)}
.md ol>li::marker{font-weight:600}
.md hr{border:0;border-top:1px solid var(--md-line);margin:1.6em 0}
.md blockquote{margin:0 0 .9em;padding:.55em 1em;border-left:3px solid var(--md-line);color:var(--md-muted);background:var(--md-soft);border-radius:0 8px 8px 0}
.md code{font:.88em/1.5 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;background:var(--md-code);padding:.12em .38em;border-radius:5px}
.md pre{margin:0 0 .9em;padding:.8em 1em;background:var(--md-code);border-radius:9px;overflow-x:auto;white-space:pre;line-height:1.55}
.md pre code{background:none;padding:0;font-size:.86em}

/* A hand record: compact, one action line per row, wraps on a phone rather than scrolling. */
.md .hand-record{margin:0 0 .9em;padding:.7em 1em;background:var(--md-hand-bg);border:1px solid var(--md-line);border-left:3px solid var(--md-accent);
  border-radius:9px;font:13px/1.65 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;white-space:pre-wrap;overflow-wrap:anywhere}
.md pre.hand-record code{font-size:inherit;white-space:pre-wrap}

/* Tables: their own horizontal scroll, so a wide range table never widens the page. */
.md .md-table{margin:0 0 1em;overflow-x:auto;-webkit-overflow-scrolling:touch;border:1px solid var(--md-line);border-radius:9px;max-width:100%}
.md .md-table:focus-visible{outline:2px solid var(--md-accent);outline-offset:2px}
.md .md-table table{border-collapse:collapse;width:max-content;min-width:100%;font-size:13.5px;line-height:1.45;font-variant-numeric:tabular-nums;white-space:normal}
.md .md-table th,.md .md-table td{padding:.5em .8em;border-bottom:1px solid var(--md-line);text-align:left;vertical-align:top;max-width:22em;overflow-wrap:normal;word-break:normal;color:var(--md-ink)}
.md .md-table th{background:var(--md-table-head);font-size:inherit;font-weight:650;white-space:nowrap}
.md .md-table tbody tr:nth-child(even){background:var(--md-stripe)}
.md .md-table tbody tr:hover{background:var(--md-soft)}
.md .md-table tbody tr:last-child td{border-bottom:0}
.md .md-table .al-right{text-align:right}.md .md-table .al-center{text-align:center}

/* «Ключевая ошибка», «Рекомендация», «Вывод». */
.md .callout{margin:0 0 1em;padding:.8em 1.05em;border-radius:10px;border:1px solid transparent;border-left-width:4px}
.md .callout h2,.md .callout h3,.md .callout h4{margin:0 0 .45em;border:0;padding:0;font-size:1.05em;display:flex;gap:.45em;align-items:baseline}
.md .callout h2::before,.md .callout h3::before,.md .callout h4::before{font-size:.95em}
.md .callout-mistake{background:var(--md-mistake-bg);border-color:var(--md-mistake)}
.md .callout-mistake h2,.md .callout-mistake h3,.md .callout-mistake h4{color:var(--md-mistake)}
.md .callout-mistake.callout-section>:first-child::before{content:"⚠"}
.md .callout-advice{background:var(--md-advice-bg);border-color:var(--md-advice)}
.md .callout-advice h2,.md .callout-advice h3,.md .callout-advice h4{color:var(--md-advice)}
.md .callout-advice.callout-section>:first-child::before{content:"✓"}
.md .callout-summary{background:var(--md-summary-bg);border-color:var(--md-summary)}
.md .callout-summary h2,.md .callout-summary h3,.md .callout-summary h4{color:var(--md-summary)}
.md .callout-summary.callout-section>:first-child::before{content:"★"}
.md .callout blockquote{background:transparent}

/* Suits, coloured in display only. */
.md .suit{font-family:"Segoe UI Symbol","Apple Symbols",system-ui,sans-serif;font-variant-emoji:text}
.md .suit-red{color:var(--md-red)}
.md .suit-dark{color:var(--md-dark)}

/* Formulas: \frac, x^2, \times — read lightly, without a maths library. */
.md .math{font-family:"Cambria Math","STIX Two Math","Times New Roman",serif;font-size:1.05em;white-space:nowrap}
.md .math-block{margin:0 0 .9em;padding:.55em .9em;background:var(--md-soft);border-radius:8px;text-align:center;overflow-x:auto;
  font-family:"Cambria Math","STIX Two Math","Times New Roman",serif;font-size:1.1em}
.md .frac{display:inline-flex;flex-direction:column;vertical-align:middle;text-align:center;font-size:.9em;margin:0 .15em}
.md .frac .num{border-bottom:1px solid currentColor;padding:0 .2em}
.md .frac .den{padding:0 .2em}
.md .sqrt{border-top:1px solid currentColor;padding-top:.05em}

/* The editor. */
.md-editor{margin:8px 0 14px;border:1px solid var(--md-line);border-radius:10px;background:#fff;color:var(--md-ink)}
:root[data-theme="dark"] .md-editor{background:#141c17}
.md-top{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap;padding:6px 8px;border-bottom:1px solid var(--md-line)}
.md-tabs{display:flex;gap:2px;background:var(--md-soft);padding:3px;border-radius:8px}
.md-tab{border:0;background:transparent;color:var(--md-muted);padding:6px 12px;border-radius:6px;font:inherit;font-size:13px;cursor:pointer}
.md-tab.active{background:#fff;color:var(--md-ink);font-weight:600;box-shadow:0 1px 3px #0001}
:root[data-theme="dark"] .md-tab.active{background:#2a3830}
.md-editor .md-paste{font-size:13px;padding:6px 12px}
.md-toolbar{display:flex;flex-wrap:wrap;gap:3px;padding:6px 8px;border-bottom:1px solid var(--md-line)}
.md-tool{min-width:32px;height:30px;padding:0 8px;border:1px solid transparent;border-radius:6px;background:transparent;color:var(--md-ink);font:13px/1 inherit;cursor:pointer}
.md-tool:hover,.md-tool:focus-visible{background:var(--md-soft);border-color:var(--md-line)}
.md-tool.md-b{font-weight:800}.md-tool.md-i{font-style:italic;font-family:Georgia,serif}.md-tool.md-s{text-decoration:line-through}
.md-tool.md-card{font-size:12px;color:var(--md-muted)}
.md-sep{width:1px;background:var(--md-line);margin:3px 4px}
dialog .md-editor textarea.md-input,.md-editor textarea.md-input{display:block;width:100%;min-height:320px;margin:0;border:0;border-radius:0;padding:12px 14px;
  font:13px/1.6 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;resize:vertical;background:transparent;color:var(--md-ink);outline:none}
.md-editor textarea.md-input[hidden]{display:none}
.md-preview{padding:16px 18px;min-height:320px;max-height:60vh;overflow:auto}
.md-foot{display:flex;justify-content:space-between;gap:10px;padding:6px 10px;border-top:1px solid var(--md-line);font-size:12px;color:var(--md-muted)}
.md-counter{margin-left:auto;font-variant-numeric:tabular-nums}
.md-counter.over{color:var(--md-mistake);font-weight:600}
@media (max-width:600px){.md{font-size:14px}.md-tool{min-width:30px;padding:0 6px}.md-preview{padding:12px}.md .hand-record{font-size:12px;padding:.6em .75em}}
.form-grid .wide>span{color:#677567;font-size:12px}
.review .md{font-size:15.5px}
/* Comments in Markdown: smaller headings, the text right under the author line. */
.comment-row .md,.comment .md{margin-top:4px}.user-item-text .md{white-space:normal}.comment-row .md h2,.comment .md h2,.user-item-text .md h2{font-size:1.12em;border-bottom:0;padding-bottom:0}.comment-row .md h3,.comment .md h3,.user-item-text .md h3{font-size:1.04em}
