/* ===== Χημεία Γ' Λυκείου — στυλ ===== */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f0f2f7;
  --text: #1d2433;
  --muted: #5d6679;
  --border: #e1e5ee;
  --accent: #4263eb;
  --accent-soft: #e7ecff;
  --ok: #2b8a3e;
  --ok-soft: #e6f6ea;
  --bad: #c92a2a;
  --bad-soft: #fdeaea;
  --warn: #e67700;
  --warn-soft: #fff4e0;
  --info-soft: #e8f4fd;
  --shadow: 0 1px 2px rgba(20, 30, 60, .06), 0 4px 16px rgba(20, 30, 60, .06);
  --radius: 14px;
  --c: var(--accent);
  --c-soft: var(--accent-soft);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Ubuntu, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #11141b;
  --surface: #1a1f2a;
  --surface-2: #232937;
  --text: #e6e9f0;
  --muted: #9aa3b5;
  --border: #2e3546;
  --accent: #748ffc;
  --accent-soft: #252d4a;
  --ok: #69db7c;
  --ok-soft: #1c3324;
  --bad: #ff8787;
  --bad-soft: #3a1f22;
  --warn: #ffa94d;
  --warn-soft: #3a2c17;
  --info-soft: #1b2b3b;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.6;
  background: var(--bg); color: var(--text);
  padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
}
a { color: var(--accent); }
img, svg { max-width: 100%; }
[hidden] { display: none !important; }
button { font: inherit; }
sub, sup { font-size: .72em; line-height: 0; }
h1, h2, h3, h4 { line-height: 1.25; margin: 1.2em 0 .5em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }
p { margin: .6em 0; }
ul, ol { padding-left: 1.3em; }
li { margin: .25em 0; }
table { border-collapse: collapse; width: 100%; font-size: .95em; }
th, td { border: 1px solid var(--border); padding: .45em .6em; text-align: left; vertical-align: top; }
th { background: var(--surface-2); }
.tbl { overflow-x: auto; margin: .8em 0; }
code, .mono { font-family: var(--mono); font-size: .92em; }

/* ===== Header ===== */
.topbar {
  position: sticky; top: 0; z-index: 20;
  padding-top: env(safe-area-inset-top, 0px);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.5) blur(10px);
  -webkit-backdrop-filter: saturate(1.5) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-in { max-width: 920px; margin: 0 auto; display: flex; align-items: center; gap: 8px; padding: 8px 16px; min-height: 56px; }
.topbar .back { display: none; }
.topbar.has-back .back { display: inline-flex; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; min-width: 0; flex: 1; }
.brand-logo { width: 32px; height: 32px; flex: none; }
.brand-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 1.1rem; flex: none;
}
.icon-btn:hover { background: var(--surface-2); }

/* ===== Bottom nav ===== */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--surface); border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bottomnav-in { max-width: 920px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); }
.bottomnav a {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 9px;
  text-decoration: none; color: var(--muted); font-size: .72rem; font-weight: 600;
}
.bottomnav a .ico { font-size: 1.25rem; line-height: 1.2; }
.bottomnav a.active { color: var(--accent); }

/* ===== Layout ===== */
main { max-width: 920px; margin: 0 auto; padding: 8px 16px 32px; }
.muted { color: var(--muted); }
.small { font-size: .88em; }
.center { text-align: center; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.grid.sm { grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }

.hero {
  margin: 12px 0 18px; padding: 22px 20px; border-radius: 20px; color: #fff;
  background: linear-gradient(135deg, #4263eb 0%, #7048e8 55%, #0ca678 120%);
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.hero h1 { margin: 0 0 6px; font-size: 1.55rem; }
.hero p { margin: 0; opacity: .93; }
.hero .hero-mol { position: absolute; right: -20px; top: -20px; width: 170px; opacity: .18; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
}
a.card { display: block; text-decoration: none; color: var(--text); transition: transform .12s ease, border-color .12s; }
a.card:hover { transform: translateY(-2px); border-color: var(--c); }
.chap-card { border-top: 4px solid var(--c); }
.chap-card .num { font-size: .78rem; font-weight: 700; color: var(--c); text-transform: uppercase; letter-spacing: .04em; }
.chap-card h3 { margin: .2em 0 .3em; }
.chap-card .emoji { font-size: 1.8rem; float: right; margin-left: 8px; }
.progress { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.progress > i { display: block; height: 100%; background: var(--c); border-radius: 99px; transition: width .3s; }

.section-title { display: flex; align-items: center; gap: 8px; margin: 26px 0 10px; font-size: 1.1rem; }

.extra-card { display: flex; gap: 12px; align-items: flex-start; }
.extra-card .emoji { font-size: 1.7rem; line-height: 1; }
.extra-card h3 { margin: 0 0 4px; font-size: 1.02rem; }
.extra-card p { margin: 0; font-size: .9rem; color: var(--muted); }

.lesson-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.lesson-item { display: flex; align-items: center; gap: 12px; }
.lesson-item .badge-num {
  flex: none; width: 42px; height: 42px; border-radius: 12px; background: var(--c-soft); color: var(--c);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .9rem;
}
.lesson-item .t { flex: 1; min-width: 0; }
.lesson-item .t b { display: block; }
.lesson-item .status { font-size: 1.2rem; }

.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 99px;
  background: var(--c-soft); color: var(--c); font-size: .78rem; font-weight: 700;
}
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 14px; }
.chip-btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 6px 12px; border-radius: 99px; cursor: pointer; font-size: .88rem;
}
.chip-btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }

.page-head { margin: 14px 0 6px; }
.page-head .kicker { color: var(--c); font-weight: 800; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.page-head h1 { margin: .15em 0 .2em; }

/* ===== Lesson content ===== */
.lesson { font-size: 1.02rem; }
.lesson h2 { border-left: 4px solid var(--c); padding-left: 10px; margin-top: 1.6em; }
.box { border-radius: 12px; padding: 12px 14px; margin: 14px 0; border: 1px solid var(--border); background: var(--surface); }
.box > :first-child { margin-top: 0; }
.box > :last-child { margin-bottom: 0; }
.box .bt { font-weight: 800; display: block; margin-bottom: 4px; }
.box.def { background: var(--accent-soft); border-color: transparent; }
.box.def .bt { color: var(--accent); }
.box.key { background: var(--c-soft); border-color: transparent; }
.box.key .bt { color: var(--c); }
.box.ex { background: var(--surface); border-left: 4px solid var(--ok); }
.box.ex .bt { color: var(--ok); }
.box.trap { background: var(--warn-soft); border-color: transparent; }
.box.trap .bt { color: var(--warn); }
.box.tip { background: var(--info-soft); border-color: transparent; }
.box.tip .bt { color: var(--accent); }
.box.life { background: var(--ok-soft); border-color: transparent; }
.box.life .bt { color: var(--ok); }
.eq {
  display: block; text-align: center; padding: 10px 12px; margin: 10px 0; border-radius: 10px;
  background: var(--surface-2); font-size: 1.04em; overflow-x: auto; white-space: nowrap;
}
.eq.big { font-size: 1.2em; font-weight: 600; }
details { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; margin: 10px 0; background: var(--surface); }
details > summary { cursor: pointer; font-weight: 700; color: var(--accent); }
details[open] > summary { margin-bottom: 6px; }
.fig { margin: 14px 0; text-align: center; }
.fig svg { display: block; margin: 0 auto; height: auto; }
.fig figcaption, .fig .cap { font-size: .86rem; color: var(--muted); margin-top: 4px; }
.two { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.hl { background: color-mix(in srgb, var(--c) 18%, transparent); padding: 0 3px; border-radius: 4px; }
.red { color: var(--bad); font-weight: 700; }
.green { color: var(--ok); font-weight: 700; }
.blue { color: var(--accent); font-weight: 700; }

.lesson-nav { display: flex; gap: 10px; justify-content: space-between; margin: 26px 0 8px; flex-wrap: wrap; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 10px 16px; border-radius: 12px; cursor: pointer; font-weight: 600; text-decoration: none;
  min-height: 44px;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.c { background: var(--c); color: #fff; border-color: var(--c); }
.btn.sm { padding: 6px 12px; min-height: 36px; font-size: .9rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ===== Quiz ===== */
.quiz { margin-top: 30px; border: 2px solid var(--c); border-radius: 18px; padding: 16px; background: var(--surface); }
.quiz h2 { margin-top: 0; border: 0; padding: 0; }
.quiz-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.qdots { display: flex; gap: 5px; flex-wrap: wrap; flex: 1; }
.qdots span { width: 12px; height: 12px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); cursor: pointer; }
.qdots span.cur { outline: 2px solid var(--c); outline-offset: 1px; }
.qdots span.ok { background: var(--ok); border-color: var(--ok); }
.qdots span.bad { background: var(--bad); border-color: var(--bad); }
.qtext { font-weight: 600; font-size: 1.05rem; margin: 6px 0 12px; }
.opts { display: grid; gap: 8px; }
.opt {
  text-align: left; border: 2px solid var(--border); background: var(--surface); color: var(--text);
  padding: 11px 14px; border-radius: 12px; cursor: pointer; font-size: 1rem; line-height: 1.4;
}
.opt:hover:not(:disabled) { border-color: var(--c); }
.opt.ok { border-color: var(--ok); background: var(--ok-soft); }
.opt.bad { border-color: var(--bad); background: var(--bad-soft); }
.opt:disabled { cursor: default; }
.explain { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: .95rem; }
.explain.ok { background: var(--ok-soft); }
.explain.bad { background: var(--bad-soft); }
.quiz-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; }
.score-big { font-size: 2.6rem; font-weight: 800; color: var(--c); text-align: center; margin: 8px 0 0; }

/* ===== Flashcards ===== */
.fc-wrap { perspective: 1200px; max-width: 560px; margin: 10px auto; }
.fc { position: relative; height: 300px; cursor: pointer; transform-style: preserve-3d; transition: transform .5s; }
.fc.flip { transform: rotateY(180deg); }
.fc-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: 20px; padding: 22px; display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; box-shadow: var(--shadow); border: 1px solid var(--border); overflow: auto;
}
.fc-front { background: var(--surface); font-size: 1.25rem; font-weight: 700; }
.fc-back { background: var(--c-soft); transform: rotateY(180deg); font-size: 1.02rem; }
.fc-face .tag { position: absolute; top: 12px; left: 14px; font-size: .75rem; font-weight: 700; color: var(--c); }
.fc-face .hint { position: absolute; bottom: 10px; font-size: .75rem; color: var(--muted); font-weight: 400; }

/* ===== Tools ===== */
.tool { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px; margin: 16px 0; box-shadow: var(--shadow); }
.tool-h { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 1.05rem; font-weight: 800; }
.tool-h .tag { font-size: .7rem; padding: 2px 8px; border-radius: 99px; background: var(--c-soft); color: var(--c); }
.tool label { font-size: .9rem; font-weight: 600; }
.tool .ctrl { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); margin: 10px 0; }
.tool .ctrl > div { display: flex; flex-direction: column; gap: 3px; }
.tool input[type=range] { width: 100%; accent-color: var(--c); }
.tool input[type=number], .tool input[type=text], .tool select {
  font: inherit; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); width: 100%; min-height: 40px;
}
.tool .out { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; margin-top: 8px; }
.tool .out b { color: var(--c); }
.tool canvas, .tool svg.plot { width: 100%; height: auto; display: block; background: var(--surface-2); border-radius: 12px; touch-action: pan-y; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: 8px; margin-top: 8px; }
.kv > div { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; }
.kv .k { font-size: .75rem; color: var(--muted); font-weight: 600; display: block; }
.kv .v { font-size: 1.12rem; font-weight: 800; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 170px; padding: 8px; background: var(--surface-2); border-radius: 12px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.bar i { display: block; width: 100%; max-width: 60px; border-radius: 8px 8px 0 0; transition: height .5s ease; }
.bar .bl { font-size: .8rem; font-weight: 700; margin-top: 4px; white-space: nowrap; }
.bar .bv { font-size: .75rem; color: var(--muted); }
.arrow-anim { font-size: 1.8rem; text-align: center; font-weight: 800; color: var(--c); min-height: 1.4em; }
.ph-scale { height: 20px; border-radius: 10px; background: linear-gradient(90deg, #e03131, #f76707, #fab005, #82c91e, #2f9e44, #15aabf, #1c7ed6, #5f3dc4, #862e9c); position: relative; margin: 26px 4px 18px; }
.ph-scale .mark { position: absolute; top: -24px; transform: translateX(-50%); font-weight: 800; font-size: .85rem; transition: left .3s; }
.ph-scale .mark::after { content: ""; position: absolute; left: 50%; top: 20px; width: 3px; height: 26px; background: var(--text); transform: translateX(-50%); border-radius: 2px; }
.ph-scale .ticks { position: absolute; top: 24px; left: 0; right: 0; display: flex; justify-content: space-between; font-size: .7rem; color: var(--muted); }

/* orbital boxes */
.orb-wrap { display: flex; flex-wrap: wrap; gap: 10px 14px; margin: 10px 0; }
.orb-sub { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.orb-boxes { display: flex; }
.orb-box { width: 30px; height: 34px; border: 2px solid var(--text); margin-left: -2px; display: flex; align-items: center; justify-content: center; font-size: 1.05rem; font-weight: 800; letter-spacing: -2px; background: var(--surface); }
.orb-box:first-child { margin-left: 0; }
.orb-sub .lbl { font-size: .78rem; font-weight: 700; }

/* periodic table */
.pt { display: grid; grid-template-columns: repeat(18, minmax(0, 1fr)); gap: 2px; min-width: 560px; }
.pt-scroll { overflow-x: auto; padding-bottom: 6px; }
.pt-el { aspect-ratio: 1; border-radius: 5px; font-size: .62rem; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; border: 1px solid transparent; color: #111; line-height: 1.1; }
.pt-el b { font-size: .85rem; }
.pt-el.sel { outline: 3px solid var(--text); }
.legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: .8rem; margin-top: 6px; }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }

/* organic map */
.node-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.node-btn { border: 2px solid var(--border); background: var(--surface); color: var(--text); padding: 7px 11px; border-radius: 12px; cursor: pointer; font-weight: 600; font-size: .9rem; }
.node-btn.on { border-color: var(--c); background: var(--c-soft); color: var(--c); }
.node-btn.to { border-color: var(--ok); }
.rx-list { display: grid; gap: 8px; margin-top: 10px; }
.rx { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.rx .rxh { font-weight: 800; color: var(--c); }

.vial { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; }
.lab-log { max-height: 220px; overflow-y: auto; }
.lab-log div { padding: 6px 8px; border-bottom: 1px dashed var(--border); font-size: .92rem; }

/* defs / search */
.search { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; margin: 6px 0 10px; }
.def-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.def-item:last-child { border-bottom: 0; }
.def-item dt { font-weight: 800; color: var(--c); }
.def-item dd { margin: 4px 0 0; }
.trap-item { border-left: 4px solid var(--warn); }
.trap-item h3 { margin: 0 0 6px; font-size: 1rem; }
.trap-item .wrong { color: var(--bad); }
.trap-item .right { color: var(--ok); }

.formula-group h3 { color: var(--c); margin-top: .4em; }
.formula-row { display: flex; gap: 10px; justify-content: space-between; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.formula-row .fl { font-weight: 600; }
.formula-row .fr { font-family: var(--font); }

.toast {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; z-index: 50; font-weight: 600;
  box-shadow: var(--shadow); max-width: calc(100% - 32px);
}
.install-banner { display: flex; gap: 10px; align-items: center; }

.theme-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.theme-opts .btn.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

@media (min-width: 760px) {
  body { font-size: 17px; }
  .hero h1 { font-size: 2rem; }
  main { padding-top: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
@media print {
  .topbar, .bottomnav, .quiz, .tool { display: none !important; }
}
.formula-row .fr { min-width: 0; max-width: 100%; }
.formula-row .eq { white-space: normal; text-align: left; }

/* ===== Κατασκευή διαγωνίσματος / εκτύπωση ===== */
.builder-form details { border: 0; padding: 0; background: none; }
.builder-form input[type=text] { font: inherit; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); width: 100%; }
.builder-form .chip-btn input { margin: 0 4px 0 0; vertical-align: middle; }
.builder-form select { font: inherit; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 2px 4px; }
.exam-sheet { background: #fff; color: #111; border-radius: 6px; box-shadow: var(--shadow); padding: 22px 20px; margin: 16px auto; max-width: 820px; font-family: Arial, Helvetica, "Noto Sans", sans-serif; font-size: 15px; line-height: 1.45; }
.exam-sheet a { color: #1c3faa; }
.ex-head { text-align: center; margin-bottom: 14px; }
.ex-title { font-size: 1.35em; font-weight: 800; }
.ex-sub { font-size: .95em; margin-top: 2px; }
.ex-meta { width: 100%; margin-top: 10px; border-collapse: collapse; font-size: .95em; text-align: left; }
.ex-meta td { border: 1px solid #999; padding: 6px 8px; background: none; }
.ex-line { display: inline-block; min-width: 60%; border-bottom: 1px dotted #555; height: 1em; }
.ex-line.short { min-width: 40%; }
.ex-box { display: inline-block; width: 46px; height: 20px; border: 1px solid #555; vertical-align: middle; }
.ex-sec h3 { font-size: 1.08em; text-decoration: underline; margin: 18px 0 8px; }
.ex-sum { font-weight: 400; font-size: .85em; text-decoration: none; display: inline-block; }
.ex-instr { margin: 4px 0 8px; }
.ex-item { margin: 10px 0 12px; page-break-inside: avoid; break-inside: avoid; }
.ex-item p { margin: 4px 0; }
.ex-q b { margin-right: 2px; }
.ex-opts { list-style: none; padding-left: 26px; margin: 4px 0; }
.ex-opts li { margin: 2px 0; }
.ex-tf { padding-left: 26px; margin: 6px 0; }
.ex-tf li { margin: 4px 0; }
.ex-pts { display: block; text-align: right; font-weight: 700; font-size: .95em; }
.ex-pts input { width: 52px; padding: 2px 4px; border: 1px solid #aaa; border-radius: 6px; font: inherit; background: #fff; color: #111; }
.print-only { display: none; }
.ex-src { color: #666; font-size: .78em; font-weight: 400; }
.ex-solt { color: #333; font-size: .92em; }
.ex-fig { text-align: center; margin: 6px 0; }
.ex-fig img { max-width: min(100%, 520px); height: auto; }
.ex-ctrl { display: inline-flex; gap: 4px; margin-left: 6px; vertical-align: middle; }
.ex-ctrl .chip-btn { padding: 2px 9px; font-size: .8rem; background: #f1f3f5; color: #222; border-color: #ccc; }
.ex-foot { margin-top: 18px; text-align: center; font-size: .92em; border-top: 1px solid #bbb; padding-top: 8px; }
.qpart { margin: 6px 0; }
.arch-q { margin: 8px 0; }
.arch-q p { margin: 4px 0; }
.page-break { page-break-before: always; break-before: page; }
#printArea { display: none; }
@media print {
  @page { size: A4; margin: 14mm 13mm; }
  body.printing { padding: 0 !important; background: #fff !important; }
  body.printing > *:not(#printArea) { display: none !important; }
  body.printing #printArea { display: block; font-family: Arial, Helvetica, sans-serif; font-size: 11.5pt; color: #000; line-height: 1.4; }
  #printArea .ex-fig img { max-width: 95%; max-height: 80mm; }
  .noprint { display: none !important; }
}
