/* PaulsQuiz modern look. Loaded after site.css. System fonts only, no downloads. */
:root {
  --bg: #f4f7fa; --surface: #ffffff; --surface-2: #eef3f8; --text: #1c2733; --muted: #5b6b7a;
  --line: #dde5ec; --accent: #1a6fb5; --accent-d: #135489; --accent-soft: #e6f1fa; --accent-text: #ffffff;
  --band: #0f3a5f; --band-text: #ffffff; --answers: #eef6ee; --answers-line: #cfe3d0; --warn: #fff6dd;
  --foot: #0e2336; --foot-text: #c6d3df; --shadow: 0 1px 2px rgba(15, 35, 54, .06), 0 4px 14px rgba(15, 35, 54, .06);
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1720; --surface: #17212c; --surface-2: #1d2a38; --text: #e4ebf2; --muted: #9db0c2;
    --line: #2a3a4b; --accent: #5aaeea; --accent-d: #8cc7f3; --accent-soft: #1b2e42; --accent-text: #08213a;
    --band: #1d4d78; --band-text: #ffffff; --answers: #16261c; --answers-line: #2c4a35; --warn: #3a3217;
    --foot: #0a121a; --foot-text: #9db0c2; --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .35);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.m { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--font); }
body.m a { color: var(--accent); text-decoration: none; }
body.m a:hover { text-decoration: underline; }
body.m img { max-width: 100%; height: auto; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-text) !important; padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }

/* ---------- header and navigation ---------- */
.mhead { position: sticky; top: 0; z-index: 50; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: 0 1px 8px rgba(15, 35, 54, .06); }
.mhead-in { max-width: 1160px; margin: 0 auto; padding: 8px 20px; display: flex; align-items: center; gap: 18px; }
.mlogo { display: block; flex: none; }
.mlogo img { display: block; height: 46px; width: auto; }
@media (prefers-color-scheme: dark) { .mlogo { background: #fff; border-radius: 8px; padding: 3px 8px; } .mlogo img { height: 38px; } }
.mnav { flex: 1; }
.mnav-list { list-style: none; margin: 0; padding: 0; display: flex; align-items: stretch; gap: 2px; }
.mitem { position: relative; }
.mitem.mright { margin-left: auto; }
.mtop { display: flex; flex-direction: column; justify-content: center; padding: 6px 14px; color: var(--text) !important; font-weight: 600; font-size: 16px; line-height: 1.15; border-radius: 8px; cursor: default; text-decoration: none !important; white-space: nowrap; }
a.mtop { cursor: pointer; }
.mtop small { font-weight: 400; font-size: 11px; color: var(--muted); margin-top: 2px; letter-spacing: .01em; }
.mitem:hover > .mtop, .mitem:focus-within > .mtop { background: var(--accent-soft); color: var(--accent) !important; }
.mdrop { display: none; position: absolute; left: 0; top: 100%; min-width: 270px; padding: 8px; margin-top: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(15, 35, 54, .18); }
.mdrop::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }
.mdrop-right { left: auto; right: 0; min-width: 260px; }
.mdrop-wide { width: min(760px, 92vw); }
.mitem:hover > .mdrop, .mitem:focus-within > .mdrop { display: block; }
.mdrop ul { list-style: none; margin: 0; padding: 0; }
.mdrop-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.mdrop li a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none !important; }
.mdrop li a:hover, .mdrop li a:focus { background: var(--accent-soft); }
.mdrop li a b { display: block; font-weight: 600; font-size: 14px; line-height: 1.25; }
.mdrop li a small { display: block; font-size: 12px; color: var(--muted); line-height: 1.25; }
.mdrop li img { flex: none; }
.mlogin { display: flex; flex-direction: column; gap: 8px; padding: 6px; }
.mlogin input { padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; }
.mhello { margin: 0 0 4px; font-weight: 600; }
.mforgot { font-size: 13px; }
.msearch { flex: none; display: flex; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 0 4px 0 14px; width: 250px; transition: width .2s, border-color .2s, box-shadow .2s; }
.msearch:focus-within { width: 300px; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.msearch input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 15px; padding: 8px 0; outline: none; }
.msearch button { border: 0; background: transparent; color: var(--muted); padding: 7px 9px; cursor: pointer; display: flex; border-radius: 999px; }
.msearch button:hover { color: var(--accent); }
.pq-mobile-only { display: none; position: static; }

/* ---------- banner ---------- */
.mbanner { background: linear-gradient(135deg, #0f4f86, #1a78c2); }
.mbanner .pq-banner { max-width: 1160px; height: 240px; }
.mbanner .pq-slide img { max-height: 240px; }

/* ---------- page grid ---------- */
.mpage { max-width: 1160px; margin: 0 auto; padding: 24px 20px 48px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; align-items: start; }
.mpage.has-side { grid-template-columns: 270px minmax(0, 1fr); grid-template-areas: "side main"; }
.mpage.has-side .mmain { grid-area: main; }
.mpage.has-side .mside { grid-area: side; position: sticky; top: 84px; }
.mmain { min-width: 0; }
.crumbs { font-size: 13px; color: var(--muted); margin: 0 0 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.crumbs a { color: var(--muted) !important; }
.crumbs a:hover { color: var(--accent) !important; }
.crumbs .sep { margin: 0 6px; opacity: .6; }
.crumbs .here { color: var(--text); }

/* ---------- sidebar ---------- */
.side-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 8px 8px; }
.side-card h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 10px 8px; font-weight: 700; }
.side-card ul { list-style: none; margin: 0; padding: 0; max-height: 62vh; overflow: auto; }
.side-card li a { display: block; padding: 7px 10px; border-radius: 7px; color: var(--text); font-size: 15px; }
.side-card li a:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.side-all { display: block; margin: 6px 4px 4px; padding: 9px; text-align: center; border-radius: 8px; background: var(--accent-soft); font-weight: 600; font-size: 14px; }

/* ---------- headings and article ---------- */
#system { color: var(--text); }
#system h1.title, #system .page-h, .hero h1 { font-size: clamp(26px, 4vw, 36px); line-height: 1.2; font-weight: 750; letter-spacing: -.01em; margin: 0 0 6px; color: var(--text); text-transform: none; }
#system header { margin-bottom: 14px; }
#system .meta { color: var(--muted); font-size: 14px; margin: 0; }
.sec-h { font-size: 20px; margin: 30px 0 14px; font-weight: 700; }
.pq-tools { float: right; margin: 6px 0 0 12px; }
.pq-tools a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 14px; }
article.item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px clamp(18px, 4vw, 40px) 30px; }
.pq-quiz { font-size: 18px; line-height: 1.7; max-width: 46rem; }
.pq-quiz p { margin: 0 0 1.05em; }
.pq-quiz .qn { font-weight: 800; color: var(--accent); margin-right: .15em; }
.pq-answers { margin: 34px -2px 0; padding: 0 clamp(14px, 3vw, 26px) 12px; background: var(--answers); border: 1px solid var(--answers-line); border-radius: var(--radius); overflow: hidden; }
.pq-answers h1 { margin: 0 calc(-1 * clamp(14px, 3vw, 26px)) 20px; padding: 12px clamp(14px, 3vw, 26px); background: var(--band); color: var(--band-text); font-size: 15px; letter-spacing: .14em; text-transform: uppercase; font-weight: 800; }
.pq-answers .qn { color: #2b8a3e; }
@media (prefers-color-scheme: dark) { .pq-answers .qn { color: #7fd18f; } }
.pq-notice { margin: 0 0 16px; padding: 10px 14px; border-radius: 8px; background: var(--warn); border: 1px solid var(--line); }
p.edit { margin-top: 18px; }
.pq-edit { font-size: 14px; }
.pq-ad { margin: 22px 0; }
.pq-ad .adsbygoogle { min-height: 0; }

/* previous / next */
.pq-prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 28px; }
.pn { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); color: var(--text) !important; font-weight: 650; text-decoration: none !important; }
.pn:hover { border-color: var(--accent); background: var(--accent-soft); }
.pn small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.pn-next { justify-content: flex-end; text-align: right; }
.pn .ico { flex: none; color: var(--accent); }

/* ---------- home and cards ---------- */
.hero { padding: 6px 0 4px; }
.hero p { font-size: 18px; color: var(--muted); margin: 6px 0 0; max-width: 40rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.card { display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto 1fr; column-gap: 14px; row-gap: 4px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text) !important; text-decoration: none !important; transition: transform .12s, border-color .12s; }
.card:hover { transform: translateY(-2px); border-color: var(--accent); }
.card img { grid-row: 1 / span 2; width: 44px; height: 44px; object-fit: contain; }
.card-t { font-weight: 700; font-size: 17px; line-height: 1.25; }
.card-d { color: var(--muted); font-size: 14px; line-height: 1.45; }
.latest { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.latest a { display: block; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; font-weight: 600; }
.latest a:hover { border-color: var(--accent); text-decoration: none; }

/* ---------- quiz list ---------- */
.pq-filter { display: flex; flex-wrap: wrap; gap: 14px; margin: 0 0 16px; overflow: visible; }
.pq-filter .pq-filter-title, .pq-filter .pq-filter-limit { float: none; margin: 0; }
.pq-filter label { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.pq-filter input[type=text], .pq-filter select { padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: 15px; width: auto; }
.pq-filter input[type=text] { width: min(320px, 100%); }
table.pq-list { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin: 0 0 8px; }
table.pq-list th { text-align: left; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); color: var(--muted); }
table.pq-list th a { color: var(--muted); }
table.pq-list td { padding: 12px 16px; border-bottom: 1px solid var(--line); background: transparent; }
table.pq-list tbody tr:nth-child(odd) { background: transparent; }
table.pq-list tbody tr:hover td { background: var(--accent-soft); }
table.pq-list tbody tr:last-child td { border-bottom: 0; }
table.pq-list td.list-title a { font-weight: 600; font-size: 17px; }
table.pq-list th.list-date, table.pq-list td.list-date { color: var(--muted); font-size: 14px; }
.pq-count { color: var(--muted); font-size: 13px; }
.pagination { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0; background: none; padding: 0; height: auto; }
.pagination a, .pagination strong { display: inline-block; min-width: 38px; padding: 8px 12px; text-align: center; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font-weight: 600; height: auto; width: auto; text-indent: 0; line-height: 1.3; }
.pagination strong { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.pagination a:hover { border-color: var(--accent); text-decoration: none; }
.pagination a.previous::before { content: "\2039"; } .pagination a.next::before { content: "\203A"; }
.pagination a.previous, .pagination a.next { background-image: none; font-size: 0; } .pagination a.previous::before, .pagination a.next::before { font-size: 18px; }

/* ---------- forms and buttons ---------- */
body.m .pq-btn, body.m a.pq-btn, body.m button.pq-btn { display: inline-block; background: var(--accent); background-image: none; color: var(--accent-text) !important; border: 0; border-radius: 8px; padding: 9px 18px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none !important; }
body.m .pq-btn:hover { background: var(--accent-d); background-image: none; }
body.m .pq-btn-grey, body.m button.pq-btn-grey { background: var(--surface-2); color: var(--text) !important; border: 1px solid var(--line); }
body.m .pq-btn-grey:hover { background: var(--accent-soft); }
body.m .pq-btn-red, body.m button.pq-btn-red { background: #c0392b; color: #fff !important; border: 0; }
body.m .pq-btn-red:hover { background: #a02d21; }
body.m .pq-btn-small { padding: 4px 11px; font-size: 13px; }
.pq-form input[type=text], .pq-form input[type=email], .pq-form input[type=password], .pq-form input[type=number], .pq-form input[type=datetime-local], .pq-form select, .pq-form textarea, .pq-searchform input[type=text] {
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); padding: 10px 12px; font: inherit; }
.pq-form label { font-weight: 600; }
.pq-hint { color: var(--muted); }
.pq-msg { border-radius: 8px; background: var(--accent-soft); border: 1px solid var(--line); color: var(--text); }
.pq-msg.pq-ok { background: var(--answers); border-color: var(--answers-line); color: var(--text); }
.pq-msg.pq-error { background: #fdeeec; border-color: #efb9b3; color: #8a1f17; }
@media (prefers-color-scheme: dark) { .pq-msg.pq-error { background: #3b1b18; border-color: #7b3a34; color: #ffb4ab; } }
.pq-results { padding-left: 20px; } .pq-snippet { color: var(--muted); font-size: 14px; }
.pq-badge { background: #f4a259; color: #402100; }

/* admin screens inherit the same look */
.pq-admin-nav a { background: var(--surface); border: 1px solid var(--line); color: var(--accent); border-radius: 8px; }
.pq-admin-nav a.is-on, .pq-admin-nav a:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-text); text-decoration: none; }
.pq-card { background: var(--surface); border-color: var(--line); border-radius: var(--radius); }
.pq-card small { color: var(--muted); }
.pq-card.premium { background: var(--warn); }
table.pq-table th { border-bottom: 2px solid var(--accent); color: var(--text); }
table.pq-table td { border-bottom: 1px solid var(--line); }
table.pq-table tr:hover td { background: var(--accent-soft); }
.pq-confirm { background: #fdeeec; border-color: #e0a39c; color: #5a1a14; }
.pq-confirm.neutral { background: var(--accent-soft); border-color: var(--line); color: var(--text); }
@media (prefers-color-scheme: dark) { .pq-confirm:not(.neutral) { background: #3b1b18; color: #ffd6d1; } }
.pq-filterbar select, .pq-filterbar input[type=text] { background: var(--surface); color: var(--text); border-color: var(--line); }
code { background: var(--surface-2); color: var(--text); }
.pq-consent { background: #10202e; border-radius: 12px 12px 0 0; }

/* ---------- footer ---------- */
.mfoot { background: var(--foot); color: var(--foot-text); padding: 38px 20px 22px; }
.mfoot-in { max-width: 1160px; margin: 0 auto; display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 28px; }
.mfoot h3 { color: #fff; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 10px; }
.mfoot ul { list-style: none; margin: 0; padding: 0; }
.mfoot li { margin: 0 0 7px; }
.mfoot a, .mfoot .pq-linkbtn { color: var(--foot-text) !important; font-size: 15px; }
.mfoot a:hover, .mfoot .pq-linkbtn:hover { color: #fff !important; text-decoration: underline; }
.mfoot-about img { background: #fff; border-radius: 8px; padding: 3px 8px; display: block; margin-bottom: 12px; }
.mfoot-about p { margin: 0; max-width: 22rem; font-size: 15px; }
.mfoot-copy { max-width: 1160px; margin: 26px auto 0; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: 13px; }

/* ---------- smaller screens ---------- */
@media (max-width: 980px) {
  .mnav, .msearch { display: none; }
  .mhead-in { justify-content: space-between; }
  .pq-mobile-only { display: block; }
  .pq-mnav { margin: 0; position: relative; }
  .pq-mnav summary { display: inline-block; padding: 9px 18px; background: var(--accent); color: var(--accent-text); border-radius: 8px; font-weight: 600; cursor: pointer; list-style: none; }
  .pq-mnav summary::-webkit-details-marker { display: none; }
  .pq-mnav ul { position: absolute; right: 0; top: calc(100% + 8px); width: min(320px, 90vw); max-height: 75vh; overflow: auto; margin: 0; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(15, 35, 54, .25); }
  .pq-mnav li a { display: block; padding: 11px 12px; border-radius: 8px; color: var(--text); font-size: 16px; border: 0; }
  .pq-mnav li.sub a { padding-left: 26px; font-size: 15px; color: var(--muted); }
  .mpage.has-side { grid-template-columns: minmax(0, 1fr); grid-template-areas: "main" "side"; }
  .mpage.has-side .mside { position: static; }
  .side-card ul { max-height: none; }
  .mfoot-in { grid-template-columns: 1fr 1fr; }
  .mfoot-about { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .mhead-in { padding: 8px 14px; }
  .mlogo img { height: 38px; }
  .mpage { padding: 16px 14px 36px; }
  article.item { padding: 20px 16px 24px; }
  .pq-quiz { font-size: 17px; }
  .pq-prevnext { grid-template-columns: 1fr; }
  .mbanner .pq-banner { height: 150px; } .mbanner .pq-slide img { max-height: 150px; }
  .cards { grid-template-columns: 1fr; }
  .mfoot-in { grid-template-columns: 1fr; }
  table.pq-list th, table.pq-list td { padding: 10px 12px; }
  .pq-consent { padding: 12px 14px 22px; }
}

/* ---------- printing ---------- */
.pq-print-head { margin: 0 0 10px; padding-bottom: 8px; border-bottom: 2px solid #000; font-weight: 700; letter-spacing: .06em; font-size: 12pt; }
@media print {
  body.m { background: #fff; color: #000; font-size: 13pt; }
  .pq-print-wrap .pq-quiz { font-size: 14pt; line-height: 1.6; max-width: none; }
  .pq-print-wrap .qn { color: #000; font-weight: 700; }
  .pq-print-wrap .pq-answers { background: none; border: 0; padding: 0; margin: 0; page-break-before: always; }
  .pq-print-wrap .pq-answers h1 { background: none; color: #000; margin: 0 0 14px; padding: 0 0 6px; border-bottom: 2px solid #000; font-size: 18pt; }
  .pq-print-wrap h1.title { font-size: 26pt; }
  .pq-print-wrap article.item { border: 0; box-shadow: none; padding: 0; background: none; }
  .mhead, .mbanner, .mside, .mfoot, .pq-consent, .pq-ad { display: none !important; }
}

/* ======================================================================
   Round two: icons, tags, chips, suggestions, quiz mode, motion
   ====================================================================== */
.ico { flex: none; vertical-align: -0.2em; }
body.m .pq-btn, body.m .qt, body.m .pq-btn-small, .pq-admin-nav a, .qtools a, .chip, .mdrop li a, .pn, .pq-edit { }
body.m .pq-btn, body.m a.pq-btn, body.m button.pq-btn { display: inline-flex; align-items: center; gap: 8px; line-height: 1.2; }
.pq-admin-nav a { display: inline-flex; align-items: center; gap: 8px; }
.pq-edit { display: inline-flex; align-items: center; gap: 5px; }
.pq-card-title { display: flex !important; align-items: center; gap: 8px; }
.mi { flex: none; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; background: var(--accent-soft); color: var(--accent); }
.mdrop li a:hover .mi { background: var(--accent); color: var(--accent-text); }

/* category cards and headers use line icons */
.card-i { grid-row: 1 / span 2; width: 46px; height: 46px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; transition: background .15s, color .15s; }
.card:hover .card-i { background: var(--accent); color: var(--accent-text); }
.card { grid-template-columns: 46px 1fr; }
.cat-head { display: flex; align-items: center; gap: 16px; margin: 0 0 16px; }
.cat-badge { flex: none; width: 56px; height: 56px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; }
.cat-desc { margin: 4px 0 0; color: var(--muted); max-width: 44rem; }
.cat-head .page-h { margin: 0; font-size: clamp(24px, 3.4vw, 32px); font-weight: 750; line-height: 1.2; }

/* tags and the New badge */
.tag, .badge-new { display: inline-block; font-size: 11px; line-height: 1; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 4px 8px; border-radius: 999px; vertical-align: middle; white-space: nowrap; }
.tag { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--line); }
.tag-easy { background: #e3f5e8; color: #17692f; border-color: #bfe3c9; }
.tag-medium { background: #fff1d6; color: #7a4b00; border-color: #f0d9a6; }
.tag-hard { background: #fde4e1; color: #9a2a1f; border-color: #f1bbb5; }
.badge-new { background: #e8590c; color: #fff; }
@media (prefers-color-scheme: dark) {
  .tag-easy { background: #163a22; color: #8fe0a6; border-color: #2a5a39; }
  .tag-medium { background: #3d2f10; color: #f6cf7a; border-color: #66501f; }
  .tag-hard { background: #461d19; color: #ffb4ab; border-color: #7a3a34; }
  .badge-new { background: #f5792a; color: #1d1000; }
}
#system h1.title .tag, #system h1.title .badge-new { font-size: 12px; margin-left: 6px; transform: translateY(-3px); }
.latest a { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* category chips */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 12px; margin: 0 0 8px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text) !important; font-size: 14px; font-weight: 600; white-space: nowrap; text-decoration: none !important; }
.chip .ico { color: var(--accent); }
.chip:hover { border-color: var(--accent); }
.chip.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-text) !important; }
.chip.is-on .ico { color: var(--accent-text); }

/* quiz list in two columns */
.sortbar { display: flex; align-items: center; gap: 8px; margin: 4px 0 12px; font-size: 14px; color: var(--muted); }
.sortbar a { padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font-weight: 600; }
.sortbar a.is-on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.qlist { list-style: none; margin: 0 0 10px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.qlist li { position: relative; min-width: 0; }
.qrow { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 13px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--text) !important; text-decoration: none !important; transition: border-color .12s, transform .12s; }
.qrow:hover { border-color: var(--accent); transform: translateY(-1px); }
.qrow-t { font-weight: 650; font-size: 17px; line-height: 1.3; }
.qrow-m { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 13px; }
.qrow-admin { display: flex; align-items: center; gap: 10px; padding: 4px 4px 0 6px; font-size: 13px; }
@media (max-width: 760px) { .qlist { grid-template-columns: minmax(0, 1fr); } }

/* quiz page tools */
.facts { display: inline-block; margin-left: 10px; padding-left: 10px; border-left: 1px solid var(--line); }
.qtools { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; align-items: center; }
.qt-group { display: inline-flex; gap: 0; }
.qt-group .qt:first-child { border-radius: 8px 0 0 8px; }
.qt-group .qt:last-child { border-radius: 0 8px 8px 0; border-left: 0; }
.qt { display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--text) !important; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none !important; line-height: 1.2; }
.qt:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.qt:disabled { opacity: .4; cursor: default; }
.qt[hidden] { display: none; }
.qt-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text) !important; }
.qt-primary:hover:not(:disabled) { background: var(--accent-d); border-color: var(--accent-d); }
body.m .pq-tools { display: none; }

/* related quizzes */
.related { margin-top: 30px; }
.related .sec-h { margin: 0 0 12px; font-size: 18px; }
.related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.rel { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; color: var(--text) !important; text-decoration: none !important; }
.rel:hover { border-color: var(--accent); background: var(--accent-soft); }
.rel-t { font-weight: 650; }
.rel-m { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
@media (max-width: 760px) { .related-grid { grid-template-columns: minmax(0, 1fr); } }

/* search suggestions */
.msearch, .nf-search { position: relative; }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 80; margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(15, 35, 54, .22); min-width: 300px; }
.msearch .suggest { left: auto; right: 0; width: 380px; max-width: 92vw; }
.suggest[hidden] { display: none; }
.suggest li a { display: flex; flex-direction: column; gap: 3px; padding: 9px 12px; border-radius: 8px; color: var(--text) !important; text-decoration: none !important; }
.suggest li.is-active a, .suggest li a:hover { background: var(--accent-soft); }
.sg-t { font-weight: 650; font-size: 15px; }
.sg-m { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }
.nf-search { display: flex; gap: 10px; max-width: 560px; margin: 18px 0 8px; }
.nf-search input { flex: 1; min-width: 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; }
.nf-search .suggest { top: calc(100% + 6px); right: 0; left: 0; }

/* progress line and back to top */
#pq-progress { position: fixed; left: 0; top: 0; height: 3px; width: 100%; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; z-index: 120; pointer-events: none; }
#pq-top { position: fixed; right: 18px; bottom: 18px; z-index: 70; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--accent); box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; visibility: hidden; transform: translateY(10px); transition: opacity .2s, transform .2s, visibility .2s; }
#pq-top.is-on { opacity: 1; visibility: visible; transform: none; }
#pq-top:hover { background: var(--accent); color: var(--accent-text); }
.pq-consent ~ #pq-top, body.m:has(.pq-consent:not([hidden])) #pq-top { bottom: 150px; }

/* header: larger logo on the front page, compact while scrolling, always on a readable background */
.mlogo img { transition: height .2s ease; }
.mhead-in { transition: padding .2s ease; }
body.is-home .mlogo img { height: 56px; }
.mhead.is-scrolled .mhead-in { padding-top: 5px; padding-bottom: 5px; }
.mhead.is-scrolled .mlogo img, body.is-home .mhead.is-scrolled .mlogo img { height: 36px; }
.mlogo { background: #fff; border-radius: 10px; padding: 2px 8px; }
@media (max-width: 600px) { body.is-home .mlogo img { height: 44px; } .mhead.is-scrolled .mlogo img { height: 32px; } }

/* friendlier not found page */
.nf .hero { padding-top: 10px; }

/* motion: gentle, and switched off for people who prefer less */
@keyframes pq-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.mmain > #system, .mmain .crumbs { animation: pq-rise .35s ease both; }
.cards .card, .qlist li, .latest li { animation: pq-rise .4s ease both; }
.cards .card:nth-child(2), .qlist li:nth-child(2) { animation-delay: .03s; }
.cards .card:nth-child(3), .qlist li:nth-child(3) { animation-delay: .06s; }
.cards .card:nth-child(4), .qlist li:nth-child(4) { animation-delay: .09s; }
.cards .card:nth-child(n+5), .qlist li:nth-child(n+5) { animation-delay: .12s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* quiz mode: always dark with white text so it can be read across a room */
html.qm-open { overflow: hidden; }
.qm { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; background: #0b1a2a; color: #fff; font-family: var(--font); outline: none; }
.qm-top { display: flex; align-items: center; gap: 12px; padding: 14px 22px; background: #0f2438; border-bottom: 1px solid #23415c; }
.qm-title { font-weight: 700; font-size: 18px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qm-count { color: #b8cde0; font-size: 16px; }
.qm-btn { border: 1px solid #3a5d7e; background: #17324b; color: #fff; padding: 10px 18px; border-radius: 10px; font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; }
.qm-btn:hover:not(:disabled) { background: #20466a; }
.qm-btn:disabled { opacity: .35; cursor: default; }
.qm-primary { background: #2b8ad0; border-color: #2b8ad0; }
.qm-primary:hover:not(:disabled) { background: #3b9be2; }
.qm-main { flex: 1; overflow: auto; display: flex; flex-direction: column; justify-content: center; padding: 28px clamp(20px, 7vw, 120px); }
.qm-num { font-size: clamp(30px, 5vw, 64px); font-weight: 800; color: #6cc0ff; line-height: 1; margin-bottom: 14px; }
.qm-text { font-size: clamp(28px, 4.6vw, 68px); line-height: 1.25; font-weight: 600; max-width: 26em; }
.qm-text p { margin: 0 0 .6em; }
.qm-text.long { font-size: clamp(22px, 3.4vw, 46px); }
.qm-text.xlong { font-size: clamp(18px, 2.6vw, 34px); }
.qm-text.list { font-size: clamp(18px, 2.4vw, 32px); max-width: none; font-weight: 500; }
.qm-line { margin: 0 0 .5em; } .qm-line b { color: #6cc0ff; margin-right: .3em; }
.qm-answer { margin-top: 28px; padding: 18px 24px; border-radius: 14px; background: #123a24; border: 2px solid #2f8f55; font-size: clamp(24px, 3.6vw, 52px); line-height: 1.25; font-weight: 700; max-width: 26em; }
.qm-alabel { display: block; font-size: 14px; letter-spacing: .14em; text-transform: uppercase; color: #8fe0a6; margin-bottom: 6px; font-weight: 800; }
.qm-bar { display: flex; justify-content: space-between; gap: 12px; padding: 16px 22px; background: #0f2438; border-top: 1px solid #23415c; }
.qm-bar .qm-btn { padding: 14px 26px; font-size: 18px; min-width: 120px; }
@media (max-width: 600px) { .qm-top { padding: 10px 12px; flex-wrap: wrap; } .qm-bar { padding: 12px; } .qm-bar .qm-btn { min-width: 0; padding: 12px 14px; flex: 1; } }

html.qm-open .pq-consent, html.qm-open #pq-top, html.qm-open #pq-progress { display: none !important; }
.cat-head { align-items: flex-start; }
.latest { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
@media (max-width: 600px) {
  .facts { display: block; margin: 2px 0 0; padding: 0; border: 0; }
  .cat-badge { width: 48px; height: 48px; }
}

/* round three: admin row under quiz cards, roomier icon spacing */
.qlist li { display: flex; flex-direction: column; gap: 6px; }
.qrow { height: auto; flex: 1 1 auto; }
.qrow-admin { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 2px 6px 6px; font-size: 13px; color: var(--muted); }
.qrow-admin .pq-edit { padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); font-weight: 600; }
.qrow-admin .pq-edit:hover { border-color: var(--accent); text-decoration: none; }
body.m .pq-btn, body.m a.pq-btn, body.m button.pq-btn { gap: 10px; }
body.m .pq-btn-small { gap: 8px; padding: 5px 12px; }
.pq-admin-nav a { gap: 10px; padding: 8px 15px; }
.pq-edit { gap: 8px; }
.qt { gap: 9px; }
.chip { gap: 8px; }
.mdrop li a { gap: 12px; }

/* quiz mode: never show any advert over the content, including Google Auto ads (side rails, anchor, vignette) */
html.qm-open ins.adsbygoogle,
html.qm-open ins[data-anchor-status],
html.qm-open ins[data-vignette-status],
html.qm-open .google-auto-placed,
html.qm-open .pq-ad,
html.qm-open iframe[id^="aswift"],
html.qm-open iframe[id^="google_ads"],
html.qm-open body > ins,
html.qm-open body > div[id^="google"],
html.qm-open body > iframe[id^="google"],
html.qm-open body > div[id^="aswift"],
html.qm-open body > div[class*="google"],
html.qm-open .pq-qm-hidden { display: none !important; visibility: hidden !important; }

/* statistics: quieter secondary buttons, clear active range */
body.m .pq-range a.pq-btn, body.m .pq-inline .pq-btn-grey, body.m td .pq-btn-grey { background: var(--surface) !important; background-image: none !important; color: var(--accent) !important; border: 1px solid var(--line) !important; box-shadow: none; }
body.m .pq-range a.pq-btn:hover, body.m .pq-inline .pq-btn-grey:hover, body.m td .pq-btn-grey:hover { border-color: var(--accent) !important; background: var(--accent-soft) !important; }
body.m .pq-range a.pq-btn.is-on { background: var(--accent) !important; color: var(--accent-text) !important; border-color: var(--accent) !important; }
svg.pq-ch .dot.s1, svg.pq-ch .dot.s2 { fill: var(--surface); }
@media (max-width: 760px) {
  .pq-admin table.pq-table { display: block; overflow-x: auto; max-width: 100%; }
  .pq-admin .pq-inline input[type=text] { max-width: 100% !important; }
}

/* ---------- round four: print menu, saved quizzes, seen marks, votes, app ---------- */
details.qt-menu { position: relative; }
details.qt-menu > summary { list-style: none; }
details.qt-menu > summary::-webkit-details-marker { display: none; }
.qt-pop { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; min-width: 290px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(15, 35, 54, .2); display: flex; flex-direction: column; }
.qt-pop a { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 7px; color: var(--text) !important; font-size: 14px; text-decoration: none !important; }
.qt-pop a:hover { background: var(--accent-soft); }
.qt.is-on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent) !important; }
.qt[data-fav].is-on svg { fill: currentColor; }
.print-label { font-size: .55em; font-weight: 500; color: var(--muted); white-space: nowrap; }

.fav-btn { position: absolute; top: 9px; right: 9px; display: inline-flex; padding: 6px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; line-height: 0; }
.fav-btn:hover { background: var(--accent-soft); color: var(--accent); }
.fav-btn.is-on { color: #d6336c; }
.fav-btn.is-on svg { fill: currentColor; }
.qlist li:has(.fav-btn) .qrow-t { padding-right: 28px; }
.seen-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--muted); padding: 1px 7px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); }
a.is-seen .qrow-t, a.is-seen .lt, a.is-seen .rel-t { opacity: .72; }
.seen-toggle { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 13px; font-weight: 600; padding: 4px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--accent); cursor: pointer; }
.seen-toggle.is-on { background: var(--accent-soft); border-color: var(--accent); }
.sortbar { flex-wrap: wrap; }

.mfav { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin-left: -6px; border-radius: 999px; color: var(--muted) !important; }
.mfav:hover { background: var(--accent-soft); color: #d6336c !important; }
.mfav-n { position: absolute; top: 1px; right: 0; min-width: 17px; padding: 0 4px; border-radius: 999px; background: #d6336c; color: #fff; font-size: 10px; font-weight: 700; line-height: 17px; text-align: center; }
.mfav-n[hidden] { display: none; }

.cat-actions, .hero-actions { margin: 10px 0 4px; display: flex; flex-wrap: wrap; gap: 8px; }
.pq-recent { margin-top: 18px; }
.pq-saved-empty { color: var(--muted); }
.pq-saved-tools { margin-top: 18px; }

.qvote { margin: 22px 0 6px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); text-align: center; }
.qvote-q { margin: 0 0 10px; font-weight: 700; }
.qvote-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.qvote-btns button { font: inherit; font-weight: 600; font-size: 14px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); cursor: pointer; }
.qvote-btns button:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.qvote-thanks { margin: 0; color: var(--muted); }
.qvote [hidden] { display: none; }
.pq-votes-line { margin-left: 14px; color: var(--muted); }

.mfoot-app { margin: 8px 0 0; font-size: 13px; color: #b7c7d6; }
#pq-install { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: 13px; font-weight: 600; padding: 6px 14px; border: 1px solid #5d7e99; border-radius: 999px; background: transparent; color: #fff; cursor: pointer; }
#pq-install[hidden], #pq-ios-hint[hidden] { display: none; }

/* team answer sheet and the print variants */
.pq-sheet .sheet-sub { margin: 0 0 18px; color: #333; font-size: 12pt; }
.pq-sheet .sheet-top { display: flex; align-items: flex-end; gap: 10px; margin: 0 0 18px; font-weight: 700; }
.pq-sheet .sheet-top i { flex: 1; border-bottom: 1.5px solid #000; height: 22px; }
.pq-sheet .sheet-top i.short { flex: 0 0 90px; }
.pq-sheet .sheet-lines { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 34px; }
.pq-sheet .sheet-lines li { display: flex; align-items: flex-end; gap: 10px; break-inside: avoid; height: 38px; }
.pq-sheet .sn { flex: 0 0 26px; font-weight: 700; text-align: right; }
.pq-sheet .sheet-lines i { flex: 1; border-bottom: 1px solid #555; height: 22px; }
.pq-print-wrap .pq-quiz > h1 { font-size: 18pt; margin: 0 0 14px; padding: 0 0 6px; border-bottom: 2px solid #000; background: none; color: #000; }
@media print { .pq-sheet .sheet-lines li { height: 36px; } }

.pq-tools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; margin: 14px 0; }
.pq-tool-card { display: flex; flex-direction: column; gap: 6px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text) !important; text-decoration: none !important; }
.pq-tool-card:hover { border-color: var(--accent); background: var(--accent-soft); }
.pq-tool-card svg { color: var(--accent); }
.pq-tool-card span { color: var(--muted); font-size: 14px; }

/* round five: online members, compact recent strip, long strings in admin tables */
.pq-online { margin: 6px 0 14px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.pq-online ul { list-style: none; margin: 8px 0 6px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.pq-dot { display: inline-block; width: 9px; height: 9px; margin-right: 7px; border-radius: 50%; background: #2eb872; box-shadow: 0 0 0 3px rgba(46, 184, 114, .22); }
.pq-recent .qlist, #pq-recent .qlist { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px 10px; }
.pq-recent .qrow, #pq-recent .qrow { padding: 12px 14px; }
.pq-recent .qrow-t, #pq-recent .qrow-t { font-size: 15px; }
.pq-admin table.pq-table code { overflow-wrap: anywhere; word-break: break-all; white-space: normal; }
.pq-admin table.pq-table td:first-child { max-width: 360px; }
.pq-inline { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pq-inline input[type=text] { flex: 1 1 100%; min-width: 0; width: 100%; max-width: 100% !important; }
.pq-admin table.pq-table td:last-child form.pq-inline { min-width: 200px; max-width: 280px; }
