/* =========================================================
   FreeStudyKit theme
   One stylesheet for every page. Change a colour or size here
   and the whole site updates.
   ========================================================= */

:root {
  /* Base */
  --bg: #faf7f0;
  --paper: #ffffff;
  --ink: #1d2126;
  --ink-soft: #3d434c;
  --muted: #646b76;
  --line: #e7e1d4;
  --line-strong: #d6cebd;
  --focus: #1f5fbf;

  /* Section colours */
  --notes: #1d7a4c;      --notes-soft: #e6f3ec;
  --print: #c2560c;      --print-soft: #fcede2;
  --tools: #1f5fbf;      --tools-soft: #e5eefb;
  --tests: #6b3fa0;      --tests-soft: #f0e9f8;

  --good: #1d7a4c;  --good-soft: #e3f3ea;
  --bad: #b42318;   --bad-soft: #fdecea;
  --warn: #9a6200;  --warn-soft: #fff4dc;

  /* Type */
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-body: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(29, 33, 38, .05), 0 6px 20px rgba(29, 33, 38, .06);
  --wrap: 1160px;
  --read: 70ch;

  /* Accent for the current section; pages override via body[data-section] */
  --accent: var(--ink);
  --accent-soft: #efebe2;
}

body[data-section="notes"]  { --accent: var(--notes); --accent-soft: var(--notes-soft); }
body[data-section="print"]  { --accent: var(--print); --accent-soft: var(--print-soft); }
body[data-section="tools"]  { --accent: var(--tools); --accent-soft: var(--tools-soft); }
body[data-section="tests"]  { --accent: var(--tests); --accent-soft: var(--tests-soft); }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  padding-bottom: 64px; /* keeps the bottom clear on preview */
  text-rendering: optimizeLegibility;
}

img, svg, canvas { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  color: var(--ink);
  margin: 0 0 .5em;
  font-weight: 700;
  letter-spacing: -.01em;
}
h1 { font-size: clamp(2rem, 4.5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.read { max-width: var(--read); }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 247, 240, .94);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; gap: 18px; min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; letter-spacing: -.02em; }
.logo-mark { width: 34px; height: 34px; flex: none; }
.logo b { color: var(--notes); font-weight: 700; }

.main-nav { display: flex; gap: 4px; margin-left: 8px; }
.main-nav a {
  text-decoration: none; color: var(--ink-soft); font-weight: 600; font-size: .95rem;
  padding: 8px 12px; border-radius: 999px; display: inline-flex; align-items: center; gap: 7px;
}
.main-nav a::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dot, var(--muted)); }
.main-nav a:hover { background: #f0ebe0; color: var(--ink); }
.main-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.main-nav a.n-notes { --dot: var(--notes); }
.main-nav a.n-print { --dot: var(--print); }
.main-nav a.n-tools { --dot: var(--tools); }
.main-nav a.n-tests { --dot: var(--tests); }

.header-tools { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.search-btn {
  display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: .92rem;
  background: var(--paper); border: 1px solid var(--line-strong); color: var(--muted);
  padding: 7px 10px 7px 12px; border-radius: 999px; cursor: pointer; min-width: 190px;
}
.search-btn:hover { border-color: var(--ink-soft); color: var(--ink); }
.search-btn kbd { margin-left: auto; }
kbd { font-family: var(--font-mono); font-size: .78rem; border: 1px solid var(--line-strong); border-bottom-width: 2px; padding: 0 6px; border-radius: 5px; background: #faf8f3; color: var(--ink-soft); }

.size-control { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden; background: var(--paper); }
.size-control button { font-family: var(--font-display); font-weight: 700; border: 0; background: none; padding: 4px 9px; cursor: pointer; color: var(--ink-soft); line-height: 1.4; }
.size-control button[data-size-btn="s"] { font-size: .8rem; }
.size-control button[data-size-btn="m"] { font-size: .98rem; }
.size-control button[data-size-btn="l"] { font-size: 1.16rem; }
.size-control button[aria-pressed="true"] { background: var(--ink); color: #fff; }

.mobile-nav { display: none; }

@media (max-width: 900px) {
  .main-nav { display: none; }
  .search-btn { min-width: 0; }
  .search-btn .label, .search-btn kbd { display: none; }
  .mobile-nav { display: flex; gap: 8px; overflow-x: auto; padding: 0 20px 10px; scrollbar-width: none; }
  .mobile-nav::-webkit-scrollbar { display: none; }
  .mobile-nav a { flex: none; text-decoration: none; font-weight: 600; font-size: .9rem; padding: 6px 13px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink-soft); }
  .mobile-nav a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: #fff; }
}
@media (max-width: 420px) { .logo span.word { font-size: 1.1rem; } .size-control button { padding: 4px 7px; } }

/* ---------- Breadcrumbs & page head ---------- */
.crumbs { font-size: .88rem; color: var(--muted); margin: 22px 0 6px; }
.crumbs a { color: var(--muted); }
.crumbs span[aria-hidden] { margin: 0 6px; }

.page-head { padding: 18px 0 26px; }
.page-head .eyebrow, .eyebrow {
  display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft); padding: 3px 10px; border-radius: 999px; margin-bottom: 12px;
}
.page-head p.lead, .lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 62ch; }

/* ---------- Cards & grids ---------- */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); } }

.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); min-width: 0;
}
a.card { display: block; color: inherit; text-decoration: none; transition: transform .15s ease, border-color .15s ease; }
a.card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.card h3 { margin-bottom: .3em; }
.card p { color: var(--ink-soft); margin: 0; }

.tag { display: inline-block; font-size: .74rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: #f0ebe0; color: var(--ink-soft); }
.tag.soon { background: #efece6; color: var(--muted); }
.tag.new { background: var(--good-soft); color: var(--good); }

.section { padding: 44px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.section-head h2 { margin: 0; display: flex; align-items: center; gap: 12px; }
.section-head h2::before { content: ""; width: 12px; height: 12px; border-radius: 4px; background: var(--sec, var(--ink)); flex: none; }
.section-head p { margin: 4px 0 0; color: var(--muted); }
.section-head .more { font-weight: 700; text-decoration: none; color: var(--sec, var(--ink)); white-space: nowrap; }
.sec-notes { --sec: var(--notes); --sec-soft: var(--notes-soft); }
.sec-print { --sec: var(--print); --sec-soft: var(--print-soft); }
.sec-tools { --sec: var(--tools); --sec-soft: var(--tools-soft); }
.sec-tests { --sec: var(--tests); --sec-soft: var(--tests-soft); }

/* ---------- Buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 700; font-size: 1rem; line-height: 1.2;
  padding: 12px 20px; border-radius: 999px; border: 2px solid var(--accent);
  background: var(--accent); color: #fff; cursor: pointer; text-decoration: none;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.btn.secondary { background: var(--paper); color: var(--accent); }
.btn.ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn.small { padding: 7px 14px; font-size: .9rem; }
body:not([data-section]) .btn { --accent: var(--ink); }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label, .label { font-weight: 700; font-size: .95rem; }
.field .hint { font-size: .86rem; color: var(--muted); }
input[type="text"], input[type="number"], input[type="date"], input[type="search"], select, textarea {
  font: inherit; color: var(--ink); background: var(--paper);
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 10px 12px; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 3px solid color-mix(in srgb, var(--accent) 22%, transparent); outline-offset: 0; }
textarea { min-height: 180px; resize: vertical; line-height: 1.6; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 18px; height: 18px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row > .field { flex: 1 1 180px; }

.segmented { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.segmented label { cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: inline-block; padding: 7px 14px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: var(--paper); font-weight: 600; font-size: .92rem; }
.segmented input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.segmented input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- Ads ----------
   js/site.js turns each .ad-slot into an AdSense unit (see AD SETTINGS there).
   Space is reserved before the ad loads so the page doesn't jump (better Core Web Vitals),
   and slots next to buttons get extra room so nobody taps an ad by mistake. */
.ad-slot { margin: 36px auto; max-width: 970px; text-align: center; font-size: 0; }
.ad-slot.ad-live { min-height: 100px; }
.ad-slot.ad-live.ad-top { min-height: 90px; }
.ad-slot.ad-live::before { content: "Advertisement"; display: block; font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: #9a9384; margin-bottom: 4px; }
.ad-slot ins.adsbygoogle { margin: 0 auto; }
.ad-slot:has(ins[data-ad-status="unfilled"]), .ad-slot.ad-empty, html.ads-off .ad-slot { display: none !important; }
/* Keep ads well away from tool buttons, test controls and download links. */
.tool-shell + .ad-slot, #mock + .ad-slot, .out-grid + .ad-slot, .pg-thumbs + .ad-slot, .mt-tests + .ad-slot, .rm + .ad-slot, #sheets + .ad-slot { margin-top: 56px; }
/* Preview mode (?adpreview): show where each ad sits. */
html.ads-preview .ad-slot {
  min-height: 100px; border: 1px dashed var(--line-strong); border-radius: 10px;
  display: grid; place-items: center; color: #a39b8b; font-size: .75rem; letter-spacing: .12em; text-transform: uppercase;
  background: repeating-linear-gradient(135deg, transparent 0 10px, rgba(0,0,0,.015) 10px 20px);
}
html.ads-preview .ad-slot::after { content: " · " attr(data-ad-pos); }
@media (max-width: 620px) {
  .ad-slot { margin: 28px 0; }
  .ad-slot.ad-live { min-height: 250px; }
  .ad-slot.ad-live.ad-top { min-height: 100px; }
  .tool-shell + .ad-slot, #mock + .ad-slot, .out-grid + .ad-slot, .pg-thumbs + .ad-slot, .mt-tests + .ad-slot, .rm + .ad-slot, #sheets + .ad-slot { margin-top: 44px; }
}

/* ---------- Search dialog ---------- */
.search-dialog { position: fixed; inset: 0; z-index: 80; display: none; background: rgba(29, 33, 38, .38); padding: 10vh 16px 16px; }
.search-dialog.open { display: block; }
.search-panel { max-width: 640px; margin: 0 auto; background: var(--paper); border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.25); overflow: hidden; }
.search-panel .search-input-row { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.search-panel input { border: 0; outline: 0; font-size: 1.15rem; padding: 6px 0; }
.search-panel input:focus { outline: 0; }

.search-box { position: relative; }
.search-box .search-field {
  display: flex; align-items: center; gap: 10px; background: var(--paper);
  border: 2px solid var(--ink); border-radius: 999px; padding: 6px 8px 6px 18px; box-shadow: var(--shadow);
}
.search-box input { border: 0; padding: 10px 4px; font-size: 1.1rem; }
.search-box input:focus { outline: 0; }
.search-box .search-results { position: absolute; left: 0; right: 0; top: calc(100% + 8px); background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 40px rgba(0,0,0,.14); z-index: 30; }

.search-results { list-style: none; margin: 0; padding: 6px; max-height: 60vh; overflow: auto; }
.search-results:empty { display: none; }
.search-results li a, .search-results li .soon-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--ink);
}
.search-results li .soon-row { color: var(--muted); }
.search-results li[aria-selected="true"] a, .search-results li a:hover { background: #f4f0e7; }
.search-results .r-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.search-results .r-title { font-weight: 600; }
.search-results .r-sec { margin-left: auto; font-size: .78rem; color: var(--muted); white-space: nowrap; }
.search-empty { padding: 14px 16px; color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer { margin-top: 56px; border-top: 1px solid var(--line); background: #f4f0e6; padding: 40px 0 28px; font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(4, minmax(0, 1fr)); gap: 24px; }
.footer-grid h4 { font-family: var(--font-body); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 10px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer-grid a { color: var(--ink-soft); text-decoration: none; }
.footer-grid a:hover { color: var(--ink); text-decoration: underline; }
.footer-bottom { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; color: var(--muted); font-size: .88rem; }
.footer-bottom a { color: var(--muted); }
@media (max-width: 860px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .footer-grid .f-brand { grid-column: 1 / -1; } }

/* ---------- Note pages ---------- */
.note-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 40px; align-items: start; }
@media (max-width: 960px) { .note-layout { grid-template-columns: minmax(0, 1fr); } .note-aside { order: 2; } }
.note-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: .92rem; margin-bottom: 18px; }
.note-body { max-width: var(--read); }
.note-body h2 { font-size: 1.55rem; margin-top: 1.8em; padding-top: .2em; scroll-margin-top: 90px; }
.note-body ul, .note-body ol { padding-left: 1.3em; }
.note-body li { margin-bottom: .45em; }
.note-body li::marker { color: var(--accent); }

.one-line {
  background: var(--accent-soft); border-left: 5px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0; padding: 16px 20px; margin: 6px 0 26px;
}
.one-line .label { display: block; font-size: .76rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.one-line p { font-family: var(--font-display); font-size: 1.35rem; line-height: 1.4; margin: 0; }

.formula {
  font-family: var(--font-mono); font-size: 1.08rem; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px 16px; margin: 12px 0 18px; overflow-x: auto; white-space: nowrap;
}
.defs { display: grid; gap: 10px; margin: 0 0 18px; }
.defs div { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 16px; }
.defs dt { font-weight: 700; }
.defs dd { margin: 2px 0 0; color: var(--ink-soft); }
.callout { border-radius: var(--radius-sm); padding: 14px 18px; margin: 16px 0; background: var(--warn-soft); border: 1px solid #f1dfb3; }
.callout.tip { background: var(--tools-soft); border-color: #cddcf4; }
.callout strong:first-child { display: block; margin-bottom: 2px; }
.diagram { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 14px 0 20px; text-align: center; }
.diagram figcaption { font-size: .88rem; color: var(--muted); margin-top: 6px; }
table.simple { width: 100%; border-collapse: collapse; margin: 10px 0 20px; background: var(--paper); border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); }
table.simple th, table.simple td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.simple th { background: #f4f0e7; font-size: .9rem; }
table.simple tr:last-child td { border-bottom: 0; }
.table-scroll { overflow-x: auto; }

.note-aside { position: sticky; top: 84px; display: grid; gap: 16px; }
.toc { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.toc h4 { font-family: var(--font-body); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.toc ol { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; font-size: .95rem; }
.toc a { color: var(--ink-soft); text-decoration: none; }
.toc a:hover { color: var(--accent); }
@media (max-width: 960px) { .note-aside { position: static; } }

/* ---------- Quick check quiz ---------- */
.quiz { margin: 18px 0 8px; display: grid; gap: 14px; }
.quiz-q { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.quiz-q .q { font-weight: 700; margin-bottom: 10px; }
.quiz-q .opts { display: grid; gap: 8px; }
.opt {
  font: inherit; text-align: left; width: 100%; cursor: pointer;
  background: #fbfaf6; border: 1.5px solid var(--line-strong); border-radius: 10px; padding: 10px 14px; color: var(--ink);
  display: flex; gap: 10px; align-items: flex-start;
}
.opt:hover:not(:disabled) { border-color: var(--accent); }
.opt .key { font-weight: 700; color: var(--muted); min-width: 1.2em; }
.opt.correct { background: var(--good-soft); border-color: var(--good); }
.opt.wrong { background: var(--bad-soft); border-color: var(--bad); }
.opt.chosen { border-color: var(--accent); background: var(--accent-soft); }
.opt:disabled { cursor: default; }
.explain { margin-top: 10px; font-size: .95rem; color: var(--ink-soft); background: #f6f3ec; border-radius: 10px; padding: 10px 14px; }
.explain b.ok { color: var(--good); } .explain b.no { color: var(--bad); }
.quiz-score { font-weight: 700; padding: 12px 16px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }

/* ---------- Tool pages ---------- */
.tool-shell { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .tool-shell { grid-template-columns: minmax(0, 1fr); } }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.panel h2 { font-size: 1.2rem; font-family: var(--font-body); }
.dropzone {
  border: 2px dashed var(--line-strong); border-radius: var(--radius); padding: 30px 18px; text-align: center; cursor: pointer;
  background: #fbfaf6; transition: background .15s, border-color .15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone strong { display: block; font-size: 1.1rem; margin-bottom: 4px; }
.dropzone input { display: none; }
.privacy-note { display: flex; gap: 8px; align-items: center; font-size: .88rem; color: var(--good); margin-top: 10px; }
.result-box { background: var(--accent-soft); border-radius: var(--radius); padding: 18px 20px; }
.big-num { font-family: var(--font-display); font-size: clamp(2rem, 5vw, 2.8rem); font-weight: 700; line-height: 1.1; color: var(--accent); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-top: 14px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.stat b { display: block; font-size: 1.25rem; font-family: var(--font-display); }
.stat span { font-size: .84rem; color: var(--muted); }
.status { font-size: .92rem; color: var(--muted); min-height: 1.4em; }
.status.error { color: var(--bad); font-weight: 600; }
.status.ok { color: var(--good); font-weight: 600; }
.dl-fallback { font-size: .88rem; margin-top: 8px; }
.progress { height: 8px; background: #ece6da; border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.checker { background-color: #fff; background-image: linear-gradient(45deg, #eee 25%, transparent 25%), linear-gradient(-45deg, #eee 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #eee 75%), linear-gradient(-45deg, transparent 75%, #eee 75%); background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; }

.how-to { max-width: var(--read); }
.how-to ol { padding-left: 1.3em; }
.faq details { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 10px; }
.faq summary { font-weight: 700; cursor: pointer; }
.faq details p { margin: 8px 0 0; color: var(--ink-soft); }

/* ---------- Lists of links ---------- */
.link-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.link-list a, .link-list .soon-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 10px; border-radius: 8px; text-decoration: none; color: var(--ink); }
.link-list a:hover { background: var(--sec-soft, #f1ede4); }
.link-list .soon-item { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: var(--paper); text-decoration: none; color: var(--ink); font-weight: 600; font-size: .94rem; }
a.chip:hover { border-color: var(--sec, var(--accent)); color: var(--sec, var(--accent)); }
.chip.soon { color: var(--muted); border-style: dashed; font-weight: 500; }

/* ---------- Mock tests ---------- */
.mt-bar { position: sticky; top: 64px; z-index: 5; display: flex; justify-content: space-between; align-items: center; background: var(--tests); color: #fff; border-radius: 12px; padding: 10px 18px; margin-bottom: 14px; font-weight: 700; }
.mt-timer { font-family: var(--font-mono); font-size: 1.1rem; background: rgba(255,255,255,.16); padding: 2px 10px; border-radius: 8px; }
.mt-timer.low { background: #fff; color: var(--bad); }
.mt-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 16px; align-items: start; }
.mt-text { font-size: 1.15rem; font-weight: 600; margin: 10px 0 16px; }
.mt-multi { color: var(--tests); }
.mt-q .opts { display: grid; gap: 10px; }
.mt-actions { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.mt-nav h3 { font-family: var(--font-body); font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.mt-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; }
.mt-grid button { font: inherit; font-size: .9rem; font-weight: 700; height: 36px; border-radius: 8px; border: 1.5px solid var(--line-strong); background: var(--paper); cursor: pointer; }
.mt-grid button.done { background: var(--tests-soft); border-color: var(--tests); color: var(--tests); }
.mt-grid button.flag { box-shadow: inset 0 -4px 0 #f2b33d; }
.mt-grid button.cur { outline: 2px solid var(--ink); outline-offset: 1px; }
.mt-key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: middle; margin: 0 2px 0 8px; border: 1.5px solid var(--tests); background: var(--tests-soft); }
.mt-key.flag { background: #f2b33d; border-color: #f2b33d; }
.mt-result { text-align: left; }
.mt-result.pass .big-num { color: var(--good); }
.mt-result.fail .big-num { color: var(--bad); }
.mt-verdict { font-size: 1.2rem; font-weight: 700; margin: 4px 0 0; }
div.opt { cursor: default; }
.mt-fig { margin: 0 0 16px; padding: 12px; background: #fbfaf6; border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; }
.mt-fig svg { display: block; max-width: 100%; height: auto; margin: 0 auto; font-family: var(--font-body); }
.mt-fig figcaption { font-size: .82rem; color: var(--muted); text-align: center; margin-top: 6px; }
.mt-order { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.mt-order li { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--line-strong); border-radius: 12px; padding: 10px 12px; background: var(--paper); }
.mt-order li .num { font-weight: 800; color: var(--tests); min-width: 1.4em; }
.mt-order li span.txt { flex: 1; }
.mt-order li button { font: inherit; width: 34px; height: 34px; border-radius: 8px; border: 1.5px solid var(--line-strong); background: var(--paper); cursor: pointer; }
.mt-order li button:disabled { opacity: .35; cursor: default; }
.mt-match { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
.mt-match td { vertical-align: middle; padding: 8px 10px; background: var(--paper); border-top: 1.5px solid var(--line-strong); border-bottom: 1.5px solid var(--line-strong); }
.mt-match td:first-child { border-left: 1.5px solid var(--line-strong); border-radius: 12px 0 0 12px; font-weight: 600; width: 50%; }
.mt-match td:last-child { border-right: 1.5px solid var(--line-strong); border-radius: 0 12px 12px 0; }
.mt-match select { width: 100%; font: inherit; padding: 8px; border-radius: 8px; border: 1.5px solid var(--line-strong); background: #fff; }
.mt-match td.ok { background: var(--good-soft); } .mt-match td.no { background: var(--bad-soft); }
.mt-hint { font-size: .9rem; color: var(--muted); margin: -6px 0 12px; }
/* Exam page: list of mock tests for one exam */
.mt-tests { display: grid; gap: 12px; margin: 14px 0 8px; }
.mt-test { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 16px; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); text-decoration: none; color: var(--ink); }
a.mt-test:hover { border-color: var(--tests); }
.mt-test .num { width: 56px; height: 56px; border-radius: 14px; background: var(--tests); color: #fff; display: grid; place-items: center; font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; }
.mt-test b { display: block; font-size: 1.1rem; }
.mt-test .go { color: var(--tests); font-weight: 800; white-space: nowrap; }
.mt-test.soon { box-shadow: none; border-style: dashed; opacity: .7; }
.mt-test.soon .num { background: var(--tests-soft); color: var(--tests); }
.exam-domains td:last-child { text-align: right; font-weight: 700; white-space: nowrap; }
@media (max-width: 600px) { .mt-match td { display: block; width: auto !important; border-radius: 0 !important; border-left: 1.5px solid var(--line-strong); border-right: 1.5px solid var(--line-strong); } .mt-match td:first-child { border-radius: 12px 12px 0 0 !important; border-bottom: 0; } .mt-match td:last-child { border-radius: 0 0 12px 12px !important; border-top: 0; } }
@media (max-width: 900px) { .mt-layout { grid-template-columns: minmax(0, 1fr); } .mt-bar { top: 104px; } }

/* ---------- PDF and file tools ---------- */
.pg-thumbs { list-style: none; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.pg-thumbs li { background: #fbfaf6; border: 1.5px solid var(--line); border-radius: 10px; padding: 8px; display: grid; gap: 6px; position: relative; }
.pg-thumbs li.sel { border-color: var(--tools); background: var(--tools-soft); }
.pg-thumbs li.off { opacity: .35; }
.pg-thumbs .img { height: 140px; display: grid; place-items: center; background: #fff; border-radius: 6px; overflow: hidden; }
.pg-thumbs canvas, .pg-thumbs img { max-width: 100%; max-height: 136px; box-shadow: 0 1px 4px rgba(0,0,0,.18); transition: transform .2s; }
.pg-thumbs .bar { display: flex; gap: 4px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.pg-thumbs .bar > span:first-child { font-size: .8rem; color: var(--muted); font-weight: 700; }
.pg-thumbs button, .file-list button, .mini-btn { border: 1px solid var(--line-strong); background: var(--paper); border-radius: 6px; font: inherit; font-size: .85rem; padding: 2px 7px; cursor: pointer; }
.pg-thumbs button:hover, .file-list button:hover, .mini-btn:hover { border-color: var(--tools); color: var(--tools); }
.file-list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.file-list li { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: #fbfaf6; border-radius: 10px; padding: 8px 12px; }
.file-list li .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.file-list li .sz { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.out-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.out-grid a { display: grid; gap: 4px; text-decoration: none; color: var(--ink); background: #fbfaf6; border: 1px solid var(--line); border-radius: 10px; padding: 8px; font-size: .85rem; }
.out-grid img { width: 100%; height: 130px; object-fit: contain; background: #fff; border-radius: 6px; }
.lib-note { font-size: .84rem; color: var(--muted); margin-top: 6px; }
.row-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }

/* ---------- Money calculators (js/fin.js) ---------- */
.fin-bar { display: flex; height: 14px; border-radius: 99px; overflow: hidden; margin-top: 14px; background: #ece6da; }
.fin-bar i { display: block; height: 100%; }
.fin-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .85rem; margin-top: 6px; }
.fin-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; background: var(--c); }
.fin-chart { margin-top: 18px; }
.fin-chart svg { display: block; width: 100%; height: auto; font-family: var(--font-body); }
.fin-note { font-size: .86rem; color: var(--muted); margin: 12px 0 0; }
.fin-warn { font-size: .9rem; color: var(--warn); background: var(--warn-soft); border-radius: 10px; padding: 8px 12px; margin-top: 12px; }
.fin-warn:empty { display: none; }
.related { margin-top: 34px; }
.related h2 { font-size: 1.2rem; font-family: var(--font-body); }
.related + .ad-slot { margin-top: 56px; }

/* ---------- Legal pages ---------- */
.legal { max-width: var(--read); }
.legal h2 { font-size: 1.3rem; margin-top: 1.6em; }

/* ---------- Print ---------- */
@media print {
  .site-header, .mobile-nav, .site-footer, .ad-slot, .no-print, .note-aside, .search-dialog, .crumbs, .skip-link { display: none !important; }
  body { padding: 0; font-size: 11.5pt; }
  .wrap { max-width: none; padding: 0; }
  .note-layout { display: block; }
  .card, .panel, .quiz-q, .defs div, .diagram { box-shadow: none; break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
  .note-body h2 { break-after: avoid; }
  .print-footer { display: block !important; }
}
.print-footer { display: none; margin-top: 20px; font-size: 9pt; color: #666; border-top: 1px solid #ccc; padding-top: 6px; }
