/* Qistas ISMS Wiki - Wikipedia's page anatomy, Qistas mailsender palette.
   Navy #01294F, steel #1A75A9, ink #1F2328, body #3A4047, muted #6B7278,
   hairlines #E3E8EE / #ECEEF0, page background #F5F7FA, logo yellow #FFC838. */
:root {
  --navy: #01294F; --blue: #1A75A9; --blue-dark: #145E88; --ink: #1F2328; --body: #2C333D; --muted: #6B7278;
  --line: #E3E8EE; --line-2: #ECEEF0; --rule: #C8D1DB; --bg: #F5F7FA; --panel: #F8F9FA; --yellow: #FFC838;
  --ok: #0F7A2B; --ok-bg: #F0FBF3; --err: #A3241F; --err-bg: #FDF2F2; --info-bg: #EEF5FB;
  --serif: "Linux Libertine", "Georgia", "Times", "Source Serif Pro", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --brand: "Poppins", var(--sans);
}
* { box-sizing: border-box; }
html { scroll-padding-top: 70px; }
body { margin: 0; background: var(--bg); color: var(--body); font: 15px/1.6 var(--sans); }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
a:visited { color: #3D5F86; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
mark { background: #FFF1C2; color: inherit; padding: 0 1px; }

/* ---------- top bar (mailsender header) */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 20px; height: 58px;
  padding: 0 22px; background: var(--navy); color: #fff; box-shadow: 0 1px 0 rgba(0,0,0,.15); }
.brand { display: flex; align-items: center; gap: 9px; color: #fff !important; text-decoration: none !important; flex: none; }
.brand-logo { height: 30px; width: auto; display: block; }
.brand-sub { font: 500 12px/1 var(--brand); color: #CFE3F2; border-left: 1px solid rgba(255,255,255,.3); padding-left: 10px;
  text-transform: uppercase; letter-spacing: .08em; }
.search { flex: 1; display: flex; max-width: 560px; margin-left: 24px; }
.search input { flex: 1; height: 36px; border: 1px solid transparent; border-radius: 4px 0 0 4px; padding: 0 12px; font: inherit; font-size: 14px; }
.search input:focus { outline: 2px solid var(--yellow); outline-offset: -2px; }
.search button { border-radius: 0 4px 4px 0; height: 36px; background: var(--blue); border-color: var(--blue); }
.userbar { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 13.5px; }
.userbar .who { color: #fff !important; font-weight: 600; }
.userbar .who::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); margin-right: 7px; vertical-align: 1px; }
.userbar .linkbtn { color: #CFE3F2; }
.userbar .linkbtn:hover { color: #fff; text-decoration: underline; }
.nav-toggle, .nav-btn { display: none; }

/* ---------- shell: Wikipedia sidebar + content */
.shell { display: flex; max-width: 1400px; margin: 0 auto; min-height: calc(100vh - 140px); }
.sidebar { width: 186px; flex: none; padding: 18px 10px 30px 22px; font-size: 13.5px; }
.portal { margin: 0 0 18px; }
.portal h3 { margin: 0 0 6px; padding-bottom: 4px; font: 600 11.5px/1.4 var(--sans); text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); border-bottom: 1px solid var(--rule); }
.portal ul { list-style: none; margin: 0; padding: 0; }
.portal li { padding: 3px 0; line-height: 1.35; }
.portal li a { color: var(--blue); }
.content { flex: 1; min-width: 0; margin: 18px 22px 30px 4px; }
.page { background: #fff; border: 1px solid var(--line); border-top: 0; padding: 22px 30px 34px; border-radius: 0 0 8px 8px; }

/* tabs (Article / Read / Edit / View history) */
.tabs { display: flex; justify-content: space-between; align-items: flex-end; background: transparent; border-bottom: 1px solid var(--line); }
.tabs > div { display: flex; gap: 2px; }
.tabs a { display: block; padding: 9px 14px 8px; font-size: 13.5px; color: var(--blue); background: #fff; border: 1px solid var(--line);
  border-bottom: 0; border-radius: 6px 6px 0 0; margin-bottom: -1px; }
.tabs a:hover { text-decoration: none; background: var(--panel); }
.tabs a.on { color: var(--ink); font-weight: 600; box-shadow: inset 0 3px 0 var(--navy); background: #fff; border-bottom: 1px solid #fff; }
.tabs a.special { cursor: default; }

/* ---------- article */
.first-heading { margin: 0; font: 400 30px/1.25 var(--serif); color: var(--ink); border-bottom: 1px solid var(--rule); padding-bottom: 6px; }
.tagline { margin: 6px 0 18px; font-size: 13px; color: var(--muted); }
.tagline:empty { display: none; }
.mw-body { color: var(--body); }
.mw-body h2 { clear: none; margin: 1.4em 0 .5em; font: 400 23px/1.3 var(--serif); color: var(--navy); border-bottom: 1px solid var(--rule); padding-bottom: 3px; }
.mw-body h3 { margin: 1.2em 0 .35em; font: 700 16.5px/1.4 var(--sans); color: var(--ink); }
.mw-body h4 { margin: 1em 0 .3em; font: 700 15px/1.4 var(--sans); }
.mw-body p { margin: .45em 0 .75em; }
.mw-body ul, .mw-body ol { margin: .3em 0 .8em 1.6em; padding: 0; }
.mw-body li { margin-bottom: .25em; }
.mw-body ul { list-style: square; }
.mw-body ul li::marker { color: var(--blue); }
.mw-body blockquote { margin: 1em 0; padding: 4px 16px; border-left: 3px solid var(--line); color: var(--muted); }

.infobox { float: right; clear: right; width: 290px; margin: 0 0 16px 24px; border: 1px solid var(--rule); background: var(--panel);
  border-collapse: collapse; font-size: 13px; line-height: 1.45; }
.infobox caption { caption-side: top; background: var(--navy); color: #fff; font: 600 14.5px/1.35 var(--brand); padding: 9px 12px; text-align: center; }
.infobox th, .infobox td { padding: 6px 10px; vertical-align: top; text-align: left; border-top: 1px solid var(--line); }
.infobox th { width: 40%; color: var(--ink); font-weight: 600; }
.infobox td { word-break: break-word; }
.infobox .infobox-image { text-align: center; padding: 10px; border-top: 0; }
.infobox-cover img { width: 150px; border: 1px solid var(--line); box-shadow: 0 1px 3px rgba(0,0,0,.12); display: block; margin: 0 auto; }

.toc { display: table; margin: 14px 0 18px; padding: 10px 18px 12px 14px; background: var(--panel); border: 1px solid var(--rule); font-size: 13.5px; min-width: 240px; max-width: 520px; }
.toc-title { display: flex; align-items: baseline; gap: 10px; justify-content: center; }
.toc-title h2 { all: unset; font-weight: 700; color: var(--ink); font-size: 14px; }
.toc-toggle { font-size: 12px; color: var(--blue); }
.toc-toggle::before { content: "["; color: var(--ink); } .toc-toggle::after { content: "]"; color: var(--ink); }
.toc ul { list-style: none; margin: 6px 0 0; padding: 0; }
.toc ul ul { margin: 0 0 0 1.8em; }
.toc li { margin: 2px 0; }
.toc .tocnum { color: var(--ink); padding-right: 4px; }
.toc.collapsed > ul { display: none; }

.table-wrap { overflow-x: auto; margin: 1em 0; max-width: 100%; }
.wikitable { border-collapse: collapse; background: var(--panel); border: 1px solid var(--rule); font-size: 13.5px; line-height: 1.45; }
.wikitable th, .wikitable td { border: 1px solid var(--rule); padding: 6px 9px; vertical-align: top; text-align: left; }
.wikitable th { background: #EEF2F6; color: var(--ink); font-weight: 600; }
.wikitable td ul { margin: 0 0 0 1.1em; }
.wikitable td p { margin: 0 0 .3em; }
.wikitable.full { width: 100%; }
.mw-body > .table-wrap .wikitable td:first-child { white-space: nowrap; }

figure.scan { margin: 1em 0; display: inline-block; max-width: 100%; border: 1px solid var(--rule); background: var(--panel); padding: 6px; }
figure.scan img { max-width: 100%; display: block; background: #fff; }
figure figcaption { font-size: 12.5px; color: var(--muted); padding: 5px 2px 0; }
figure.video { margin: 1em 0; }
figure.video video { width: 100%; max-width: 900px; background: #000; border-radius: 4px; display: block; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; margin: 12px 0 8px; }
.gallery .thumb { display: block; text-align: center; font-size: 12px; color: var(--muted); }
.gallery img { width: 100%; aspect-ratio: 595 / 842; object-fit: cover; border: 1px solid var(--rule); background: #fff; display: block; margin-bottom: 4px;
  transition: box-shadow .15s, border-color .15s; }
.gallery .thumb:hover img { border-color: var(--blue); box-shadow: 0 2px 8px rgba(1,41,79,.18); }

.catlinks { clear: both; margin-top: 26px; padding: 7px 10px; border: 1px solid var(--rule); background: var(--panel); font-size: 13px; }
.lastmod { font-size: 12px; color: var(--muted); margin: 10px 0 0; }
.files td { white-space: normal; }
form.attach { margin: 10px 0; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
form.attach input[type=text] { width: 260px; }

/* ---------- main page */
.mp-welcome { background: linear-gradient(135deg, #01294F 0%, #0E4D7E 60%, #1A75A9 100%); color: #fff; border-radius: 8px; padding: 26px 30px 24px; margin-bottom: 18px; }
.mp-welcome h1 { margin: 0 0 8px; font: 500 25px/1.3 var(--brand); }
.mp-welcome h1 span { color: var(--yellow); }
.mp-welcome p { margin: 0 0 14px; color: #DCE9F4; max-width: 820px; }
.mp-search { display: flex; max-width: 620px; }
.mp-search input { flex: 1; height: 40px; border: 0; border-radius: 4px 0 0 4px; padding: 0 14px; font: inherit; }
.mp-search button { border-radius: 0 4px 4px 0; height: 40px; background: var(--yellow); border-color: var(--yellow); color: var(--navy); }
.mp-search button:hover { background: #FFC94D; border-color: #FFC94D; color: var(--navy); }
.mp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.mp-col { display: grid; gap: 18px; }
.mp-box { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fff; }
.mp-box h2 { margin: 0; padding: 8px 14px; background: #EEF2F6; border-bottom: 1px solid var(--line); font: 600 15px/1.4 var(--brand); color: var(--navy);
  display: flex; justify-content: space-between; align-items: center; }
.mp-box h2 a { color: var(--navy); }
.mp-featured h2 { background: #FFF6DE; border-bottom-color: #F3E2B0; }
.mp-count { font: 600 12px/1 var(--sans); background: var(--navy); color: #fff; border-radius: 99px; padding: 4px 9px; }
.mp-body { padding: 10px 14px 12px; font-size: 14px; }
.mp-body > p:first-child { margin-top: 0; }
.mp-list { margin: 6px 0 0; padding-left: 1.2em; list-style: square; }
.mp-list li { margin: 2px 0; }
.mp-list li::marker { color: var(--blue); }
.more { margin: 8px 0 0; font-size: 13px; text-align: right; }

/* ---------- category page / lists */
.cat-columns { columns: 3 220px; column-gap: 28px; }
.cat-group { break-inside: avoid; margin-bottom: 12px; }
.cat-group h3 { margin: 0 0 4px; font-size: 15px; color: var(--ink); }
.cat-group ul { margin: 0; padding-left: 1.2em; list-style: square; }
.all-pages { columns: 2 320px; column-gap: 30px; padding-left: 1.2em; }
.history { list-style: none; padding: 0; margin: 0 0 12px; font-size: 13.5px; }
.history li { padding: 4px 0; border-bottom: 1px solid var(--line-2); }
.hist-user { font-weight: 600; color: var(--ink); }
.hist-comment { color: var(--muted); }
.delta.pos { color: var(--ok); } .delta.neg { color: var(--err); }
.search-results { list-style: none; padding: 0; }
.search-results li { margin: 0 0 16px; }
.sr-title { font-size: 16px; }
.sr-snip { font-size: 13.5px; color: var(--body); }
.sr-meta { font-size: 12.5px; color: var(--ok); }
.search-big { display: flex; max-width: 640px; margin: 4px 0 14px; }
.search-big input { flex: 1; height: 38px; padding: 0 12px; border: 1px solid var(--rule); border-radius: 4px 0 0 4px; font: inherit; }
.search-big button { border-radius: 0 4px 4px 0; }

/* diff */
.diff { width: 100%; border-collapse: separate; border-spacing: 6px 4px; table-layout: fixed; font-size: 13.5px; }
.diff th { text-align: left; font-weight: 400; vertical-align: top; font-size: 13px; padding-bottom: 8px; }
.diff td { vertical-align: top; padding: 4px 8px; border-left: 4px solid transparent; word-wrap: break-word; }
.diff td.ctx { color: var(--muted); border-left-color: var(--line); background: #FAFBFC; }
.diff td.del { border-left-color: #FFE49C; background: #FFFBEF; }
.diff td.add { border-left-color: #A3D3FF; background: #F2F8FF; }
.diff del { background: #FEECC8; text-decoration: none; font-weight: 600; }
.diff ins { background: #D8ECFF; text-decoration: none; font-weight: 600; }
.diff .skip { text-align: center; color: var(--muted); font-style: italic; }

/* ---------- forms & buttons (mailsender) */
button, a.btn { display: inline-block; padding: 7px 14px; border-radius: 6px; border: 1px solid var(--line); background: #fff; color: var(--navy);
  font: 600 13px/1.4 var(--sans); cursor: pointer; text-decoration: none; }
button:hover, a.btn:hover { border-color: var(--blue); color: var(--blue); text-decoration: none; }
button.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
button.primary:hover { background: var(--navy); border-color: var(--navy); color: #fff; }
button.danger, .linkbtn.danger { color: var(--err); }
button.danger:hover { border-color: var(--err); }
button.wide { width: 100%; padding: 10px; font-size: 14px; }
.linkbtn { all: unset; cursor: pointer; font: inherit; color: var(--blue); }
.linkbtn:hover { text-decoration: underline; }
.linkbtn:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
form.inline { display: inline; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], select, textarea {
  padding: 8px 10px; border: 1px solid var(--rule); border-radius: 6px; font: 14px/1.4 var(--sans); background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(26,117,169,.35); border-color: var(--blue); }
.field { display: block; margin: 0 0 14px; }
.field > span, .field-label { display: block; font-size: 12.5px; color: #44505C; font-weight: 600; margin: 0 0 5px; }
.field input, .field select { width: 100%; }
.field.check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.row { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-end; }
.row .grow { flex: 1; min-width: 240px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 18px 20px; margin: 0 0 18px; }
.card h2 { margin: 0 0 12px; font: 600 16px/1.4 var(--brand); color: var(--navy); }
.card.narrow { max-width: 620px; }
.msg { border: 1px solid; border-radius: 6px; padding: 10px 14px; margin: 0 0 16px; font-size: 14px; }
.msg-ok { border-color: var(--ok); background: var(--ok-bg); }
.msg-err { border-color: var(--err); background: var(--err-bg); color: var(--err); }
.msg-info { border-color: #A7C6E0; background: var(--info-bg); }
.linkbox { margin-top: 10px; font-size: 13px; }
.linkbox input { width: 100%; margin-top: 6px; font: 12.5px ui-monospace, Menlo, monospace; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; background: #EEF2F6; color: #44505C; vertical-align: 1px; }
.pill.edit { background: #E2F0FA; color: var(--blue-dark); }
.pill.off { background: var(--err-bg); color: var(--err); }
.perms td.opts { white-space: nowrap; }
.perms .opt { margin-right: 14px; font-size: 13.5px; }
.perms { margin: 0 0 14px; width: 100%; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cat-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cat-row .sort { width: 70px; }
.cat-row input[name=name] { width: 230px; }
.cat-row .grow { flex: 1; min-width: 200px; }
.filters { margin: 0 0 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13.5px; }
.audit td { font-size: 12.5px; }

/* editor */
.edit-meta { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
.toolbar { position: sticky; top: 58px; z-index: 5; display: flex; gap: 4px; flex-wrap: wrap; align-items: center; padding: 6px; background: #EEF2F6;
  border: 1px solid var(--rule); border-bottom: 0; border-radius: 6px 6px 0 0; }
.toolbar button { padding: 4px 10px; font-weight: 600; }
.toolbar button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.toolbar .sep { width: 1px; height: 22px; background: var(--rule); margin: 0 4px; }
.toolbar .grow { flex: 1; }
.editor { min-height: 420px; max-height: 70vh; overflow: auto; border: 1px solid var(--rule); padding: 14px 18px; background: #fff; margin-bottom: 14px; border-radius: 0 0 6px 6px; }
.editor:focus { outline: 2px solid rgba(26,117,169,.35); }
textarea.source { width: 100%; min-height: 420px; font: 13px/1.5 ui-monospace, Menlo, monospace; margin-bottom: 14px; border-radius: 0 0 6px 6px; }
.delete-page { margin-top: 26px; padding-top: 14px; border-top: 1px solid var(--line); }
.edit-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* login */
.login-wrap { max-width: 420px; margin: 7vh auto 40px; padding: 0 16px; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.login-brand .logo-full { height: 46px; width: auto; padding-right: 14px; border-right: 1px solid var(--rule); }
.login-title { font: 600 22px/1.2 var(--brand); color: var(--navy); }
.shell.no-side { display: block; }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(1,20,40,.88); display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 92vw; max-height: 88vh; background: #fff; box-shadow: 0 8px 40px rgba(0,0,0,.5); }
.lightbox .lb-bar { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: 10px 18px; color: #fff; font-size: 14px; }
.lightbox button { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.25); }
.lightbox .lb-prev, .lightbox .lb-next { position: absolute; top: 50%; transform: translateY(-50%); font-size: 22px; padding: 10px 16px; }
.lightbox .lb-prev { left: 14px; } .lightbox .lb-next { right: 14px; }

.footer { border-top: 1px solid var(--line); padding: 16px 22px 26px; font-size: 12px; color: var(--muted); text-align: center; }
.footer p { margin: 0 auto; max-width: 900px; }

/* ---------- small screens */
@media (max-width: 900px) {
  .topbar { gap: 10px; padding: 0 12px; }
  .brand-sub { display: none; }
  .search { margin-left: 0; }
  .nav-btn { display: block; font-size: 22px; cursor: pointer; padding: 0 4px; color: #fff; }
  .sidebar { display: none; position: fixed; top: 58px; left: 0; bottom: 0; z-index: 30; background: #fff; overflow-y: auto; width: 260px;
    box-shadow: 4px 0 20px rgba(0,0,0,.18); }
  .nav-toggle:checked ~ .shell .sidebar { display: block; }
  .content { margin: 10px 8px 20px; }
  .page { padding: 16px; }
  .infobox { float: none; width: 100%; margin: 0 0 16px; }
  .mp-grid { grid-template-columns: 1fr; }
  .edit-meta { grid-template-columns: 1fr; }
  .userbar .who { display: none; }
}
@media (max-width: 560px) {
  .brand-logo { height: 24px; }
  .search button { display: none; }
  .search input { border-radius: 4px; }
  .tabs a { padding: 8px 9px 7px; font-size: 13px; }
  .first-heading { font-size: 25px; }
}
@media print {
  .topbar, .sidebar, .tabs, .footer, .toc-toggle, form.attach { display: none !important; }
  .page { border: 0; padding: 0; }
  .content { margin: 0; }
  body { background: #fff; }
}
