/*
  Havoc Wiki - article layout on top of styles.css / themes.css.
  Uses the console's colour tokens, so every theme (and light/dark) applies;
  the article itself follows encyclopedia conventions: serif headings with
  a rule, infobox on the right, table of contents, categories at the end.
*/

.wk {
  --wk-serif: "Linux Libertine", "Georgia", "Times New Roman", serif;
  --wk-side: 230px;
  --wk-red: var(--danger);
  --wk-soft: var(--accent-soft, var(--surface-2));
}

.wk-skip {
  position: absolute;
  left: -9999px;
}

.wk-skip:focus {
  left: 12px;
  top: 12px;
  z-index: 50;
  background: var(--surface);
  padding: 8px 12px;
  border-radius: 8px;
}

.wk-shell {
  display: grid;
  grid-template-columns: var(--wk-side) minmax(0, 1fr);
  min-height: 100vh;
}

/* ---- Sidebar ---- */

.wk-side {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 18px 14px;
  border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 60%, var(--bg));
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.wk-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

.wk-brand strong {
  display: block;
  font-family: var(--wk-serif);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.1;
}

.wk-brand small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.wk-logo {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #1e1b4b));
  color: var(--accent-text);
  font: 700 21px/1 var(--wk-serif);
}

.wk-logo.big {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  font-size: 38px;
}

.wk-project {
  width: 100%;
}

.wk-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.wk-nav-title {
  margin: 0 0 4px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.wk-nav a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
}

.wk-nav a:hover {
  background: var(--surface-2);
}

.wk-nav a.active {
  background: var(--wk-soft);
  color: var(--accent-ink, var(--accent));
  font-weight: 600;
}

.wk-nav .count {
  margin-left: auto;
  font-size: 11px;
  padding: 0 6px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-text);
}

/* ---- Header ---- */

.wk-page {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.wk-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  position: sticky;
  top: 0;
  z-index: 10;
}

.wk-head:empty {
  display: none;
}

.wk-menu {
  display: none;
}

.wk-search {
  flex: 1;
  max-width: 560px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}

.wk-search:focus-within {
  border-color: var(--accent);
}

.wk-search input {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 8px 0;
  min-height: 0;
}

.wk-search input:focus {
  outline: none;
  box-shadow: none;
}

.wk-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.wk-user-name small {
  margin-left: 6px;
  color: var(--muted);
}

/* ---- Main ---- */

.wk main.wk-main {
  max-width: 1680px;
  width: 100%;
  margin: 0;
  padding: 24px 28px 48px;
  flex: 1;
}

.wk-main:focus {
  outline: none;
}

.wk-foot {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 14px 28px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12.5px;
}

.wk-loading {
  padding: 24px 0;
}

/* ---- Tabs (Article | Read · Edit · History) ---- */

.wk-tabs {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
  font-size: 14px;
}

.wk-tabs > div {
  display: flex;
  gap: 2px;
}

.wk-tabs a {
  padding: 7px 12px;
  color: var(--accent-ink, var(--accent));
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.wk-tabs a.active {
  color: var(--text);
  border-bottom-color: var(--text);
  font-weight: 600;
}

/* ---- Article ---- */

.wk-article {
  line-height: 1.65;
  font-size: 15px;
}

.wk-article::after {
  content: "";
  display: block;
  clear: both;
}

.wk-title {
  font-family: var(--wk-serif);
  font-size: 30px;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: 0;
  margin: 0 0 4px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.wk-sub {
  margin: 4px 0 16px;
  color: var(--muted);
  font-size: 13px;
}

.wk-lead {
  font-size: 16px;
  margin: 0 0 16px;
}

.wk-article .markdown {
  border-top: 0;
  padding-top: 0;
}

.wk-article h2,
.wk-article .markdown h2 {
  font-family: var(--wk-serif);
  font-size: 23px;
  font-weight: 400;
  margin: 26px 0 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.wk-article h3,
.wk-article .markdown h3 {
  font-size: 17px;
  font-weight: 700;
  margin: 20px 0 6px;
}

.wk-article p,
.wk-article ul,
.wk-article ol {
  margin: 0 0 12px;
}

.wk-article blockquote {
  margin: 0 0 12px;
  padding: 4px 16px;
  border-left: 3px solid var(--border);
  color: var(--muted);
}

.wk-article hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

.wk-article pre {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  overflow-x: auto;
  font: 13px/1.5 ui-monospace, "Cascadia Code", Consolas, monospace;
}

.wk-article img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.wk-article table {
  border-collapse: collapse;
  margin: 0 0 14px;
  font-size: 14px;
}

.wk-article .markdown th,
.wk-article .markdown td {
  border: 1px solid var(--border);
  padding: 6px 10px;
  text-align: left;
}

.wk-article .markdown th {
  background: var(--surface-2);
}

.wk-link {
  text-decoration: none;
}

.wk-link:hover {
  text-decoration: underline;
}

.wk-red,
a.wk-red {
  color: var(--wk-red);
}

/* ---- Infobox ---- */

.wk-infobox {
  float: right;
  clear: right;
  width: 300px;
  margin: 0 0 16px 22px;
  padding: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 13px;
  line-height: 1.45;
  border-radius: 4px;
}

.wk-infobox-title {
  margin: 0;
  text-align: center;
  font-weight: 700;
  font-size: 15px;
}

.wk-infobox-type {
  margin: 0 0 8px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.wk-infobox table {
  width: 100%;
  margin: 0;
  font-size: 13px;
}

.wk-infobox th,
.wk-infobox td {
  padding: 4px 6px;
  border-top: 1px solid var(--border);
  vertical-align: top;
  text-align: left;
}

.wk-infobox th {
  width: 40%;
  font-weight: 600;
}

.wk-infobox td {
  word-break: break-word;
}

/* ---- Entries in the look of their app (settings.display) ---- */

.wk-card {
  padding: 14px;
  border-radius: 14px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--tile, var(--accent)) 10%, transparent), transparent 120px),
    var(--surface);
  border-color: color-mix(in srgb, var(--tile, var(--accent)) 28%, var(--border));
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 10px 26px -18px color-mix(in srgb, var(--tile, var(--accent)) 60%, transparent);
}

.wk-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.wk-card-head p {
  margin: 0;
}

.wk-card-module {
  font-weight: 700;
  font-size: 14px;
}

.wk-card-type {
  color: var(--muted);
  font-size: 12px;
}

.wk-card .wk-infobox-title {
  text-align: left;
  font-size: 17px;
  margin-bottom: 8px;
}

/* The module's tile, as on its app icon: its colour fading to 80 %, corners at 22 %. */
.wk-tile {
  display: inline-grid;
  place-items: center;
  flex: none;
  border-radius: 22%;
  background: linear-gradient(135deg, var(--tile), color-mix(in srgb, var(--tile) 80%, transparent));
}

.wk-chip {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.wk-chip-status {
  background: color-mix(in srgb, var(--tile, var(--accent)) 14%, var(--surface));
  border-color: color-mix(in srgb, var(--tile, var(--accent)) 35%, var(--border));
}

.wk-chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.wk-people {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
}

.wk-person {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.wk-avatar {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  background: color-mix(in srgb, var(--tile, var(--accent)) 18%, var(--surface));
}

.wk-swatch-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.wk-swatch {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  border: 1px solid var(--border);
}

.wk-yes {
  color: var(--ok, inherit);
  font-weight: 600;
}

.wk-no {
  color: var(--muted);
}

.wk-reflist {
  margin: 0;
  padding-left: 18px;
}

/* A handbook: its pages with their text, as in Knowledge. */
.wk-book-toc {
  columns: 2 220px;
  padding-left: 22px;
}

.wk-book-page {
  margin: 22px 0;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.wk-book-page > h3 {
  margin-top: 0;
}

/* ---- Table of contents ---- */

.wk-toc {
  display: inline-block;
  min-width: 220px;
  margin: 4px 0 16px;
  padding: 10px 16px 6px 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 4px;
  font-size: 14px;
}

.wk-toc-title {
  margin: 0 0 4px !important;
  font-weight: 700;
  text-align: center;
}

.wk-toc ol {
  margin: 0 0 4px !important;
  padding-left: 22px;
}

.wk-toc a {
  text-decoration: none;
}

/* ---- Notices ---- */

.wk-notice {
  margin: 0 0 14px;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 4px;
  background: var(--surface-2);
  font-size: 14px;
}

.wk-notice.warn {
  border-left-color: var(--warn);
  background: var(--warn-bg);
}

.wk-notice.error {
  border-left-color: var(--danger);
  background: var(--danger-bg);
}

.wk-notice.review {
  border-left-color: var(--ok);
  background: var(--ok-bg);
}

.wk-review-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.wk-review-row input {
  flex: 1;
  min-width: 200px;
}

/* ---- Sections, categories, last change ---- */

.wk-section {
  clear: both;
}

.wk-refs ol {
  font-size: 13.5px;
}

.wk-catlinks {
  clear: both;
  margin-top: 28px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 13.5px;
  border-radius: 4px;
}

.wk-catlinks a + a::before {
  content: " | ";
  color: var(--muted);
}

.wk-lastmod {
  margin-top: 12px !important;
  color: var(--muted);
  font-size: 12.5px;
}

/* ---- Editor ---- */

.wk-edit {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 900px;
}

.wk-fields {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px 14px;
  margin: 0;
}

.wk-fields legend {
  font-weight: 600;
  font-size: 13px;
  padding: 0 4px;
}

.wk-fields-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.wk-editor {
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface);
}

.wk-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 4px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.wk-toolbar-gap {
  flex: 1;
}

.wk-source {
  width: 100%;
  border: 0;
  border-radius: 0;
  font: 14px/1.6 ui-monospace, "Cascadia Code", Consolas, monospace;
  resize: vertical;
  box-shadow: none;
}

textarea.wk-source[readonly] {
  border: 1px solid var(--border);
  border-radius: 6px;
}

.wk-preview {
  padding: 12px 16px;
  min-height: 200px;
}

.wk-new-type {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
}

.wk-new-type select {
  width: auto;
}

/* ---- History and differences ---- */

.wk-history-list {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  font-size: 14px;
}

.wk-history-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.wk-history-list input {
  width: auto;
  min-height: 0;
}

.wk-history-links {
  font-size: 13px;
  white-space: nowrap;
}

.wk-history-author {
  font-weight: 600;
}

.wk-history-note {
  color: var(--muted);
  font-style: italic;
}

.wk-log {
  font-size: 14px;
}

.wk-diff-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}

table.wk-diff {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 4px 2px;
  font: 13px/1.5 ui-monospace, "Cascadia Code", Consolas, monospace;
}

table.wk-diff td,
table.wk-diff th {
  padding: 3px 8px;
  white-space: pre-wrap;
  word-break: break-word;
  vertical-align: top;
  border-radius: 4px;
  text-align: left;
}

table.wk-diff th {
  font-family: inherit;
}

table.wk-diff td.del {
  background: var(--danger-bg);
  border-left: 3px solid var(--danger);
}

table.wk-diff td.add {
  background: var(--ok-bg);
  border-left: 3px solid var(--ok);
}

table.wk-diff td.ctx {
  color: var(--muted);
}

.wk-diff-gap td {
  text-align: center !important;
  color: var(--muted);
}

/* ---- Lists of pages ---- */

.wk-filter {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0 0 16px;
}

.wk-filter select {
  width: auto;
}

.wk-day {
  margin: 18px 0 6px !important;
  font-size: 15px !important;
}

.wk-change {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: center;
  padding: 3px 0 3px 12px;
  font-size: 14px;
}

.wk-time {
  font-variant-numeric: tabular-nums;
  min-width: 42px;
}

.wk-index {
  columns: 3 220px;
  column-gap: 32px;
}

.wk-index section {
  break-inside: avoid;
}

.wk-index h3 {
  margin: 10px 0 4px !important;
  border-bottom: 1px solid var(--border);
}

.wk-index ul,
.wk-columns {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
}

.wk-columns {
  columns: 3 220px;
}

.wk-more {
  margin-top: 12px;
}

.wk-results {
  padding-left: 22px;
}

.wk-results li {
  margin-bottom: 12px;
}

.wk-result-title {
  font-size: 16px;
}

.wk-snippet {
  margin: 2px 0 0 !important;
  font-size: 13.5px;
  color: var(--muted);
}

.wk-snippet mark {
  background: transparent;
  color: var(--text);
  font-weight: 700;
}

.wk-search-big {
  display: flex;
  gap: 8px;
  max-width: 640px;
  margin: 0 0 18px;
}

.wk-queue {
  list-style: none;
  padding: 0;
}

.wk-queue li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

/* ---- Main page ---- */

.wk-portal-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  align-items: start;
}

.wk-portal-side { display: grid; gap: 16px; }

/* Topics grouped by the module that owns them, in its look. */
.wk-topic-group + .wk-topic-group { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.wk-topic-module { display: flex; align-items: center; gap: 8px; margin: 4px 0 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.wk-topic-module .wk-tile { border-radius: 7px; }
.wk-topic-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.wk-topic-list a { display: inline-block; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg); text-decoration: none; font-size: 14px; }
.wk-topic-list a:hover { border-color: var(--accent); }

/* Help for the apps: one card per app. */
.wk-help-box { margin: 16px 0; background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.wk-help-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.wk-help-start { font-weight: 650; }
.wk-help-list { list-style: none; margin: 4px 0 4px; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.wk-help-list li { display: flex; flex-direction: column; gap: 2px; padding: 9px 12px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); }
.wk-help-list a { font-weight: 650; text-decoration: none; }
.wk-help-list .muted { font-size: 12.5px; }

@media (max-width: 860px) {
  .wk-portal-grid { grid-template-columns: 1fr; }
}

.wk-box {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 16px 12px;
  background: var(--surface);
}

.wk-box h2 {
  font-size: 19px !important;
  margin-top: 10px !important;
}

.wk-type-list,
.wk-recent-mini {
  padding-left: 18px;
}

.wk-cats-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}

.wk-help pre {
  margin: 0;
  white-space: pre-wrap;
}

.wk-help td,
.wk-help th {
  border: 1px solid var(--border);
  padding: 6px 10px;
  vertical-align: top;
}

/* ---- Sign-in ---- */

.wk-signin {
  max-width: 460px;
  margin: 10vh auto;
  padding: 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.wk-signin h1 {
  font-family: var(--wk-serif);
  font-weight: 400;
  font-size: 30px;
}

/* ---- Small screens: the sidebar becomes a drawer ---- */

@media (max-width: 860px) {
  .wk-shell {
    grid-template-columns: 1fr;
  }

  .wk-side {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(84vw, 300px);
    z-index: 40;
    transform: translateX(-102%);
    transition: transform 0.2s;
    box-shadow: var(--shadow-lg, 0 10px 30px rgba(0, 0, 0, 0.25));
  }

  .wk-side-open .wk-side {
    transform: none;
  }

  .wk-menu {
    display: inline-flex;
  }

  .wk-menu .ico {
    display: inline-block;
  }

  .wk-head,
  .wk main.wk-main,
  .wk-foot {
    padding-left: 16px;
    padding-right: 16px;
  }

  .wk-user-name {
    display: none;
  }

  .wk-infobox {
    float: none;
    width: 100%;
    margin: 0 0 16px;
  }

  .wk-tabs {
    flex-wrap: wrap;
  }

  .wk-diff-head {
    grid-template-columns: 1fr;
  }
}

@media print {
  .wk-side,
  .wk-head,
  .wk-foot,
  .wk-tabs,
  .wk-notice {
    display: none !important;
  }

  .wk-shell {
    display: block;
  }
}

/* ---- Preview: the entry as its app shows it ---- */
.wk-preview-box { clear: none; }
.wk-preview-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.wk-open-app {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); font-weight: 600; font-size: 14px; text-decoration: none;
}
.wk-open-app:hover { border-color: var(--accent); }
.wk-open-app .wk-tile { border-radius: 6px; }

.wk-app-card {
  position: relative; max-width: 560px; margin-top: 8px; padding: 18px 20px; border-radius: 16px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); box-shadow: 0 10px 30px -18px rgba(0, 0, 0, 0.35);
  display: flex; flex-direction: column; gap: 10px;
}
.wk-app-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--tile, var(--accent)); }
.wk-app-card-head { display: flex; gap: 12px; align-items: center; }
.wk-app-card-type { margin: 0; font-size: 12px; color: var(--muted); font-weight: 600; }
.wk-app-card-title { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.25; }
.wk-app-card-summary { margin: 0; color: var(--muted); }
.wk-app-card-facts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.wk-fact { display: inline-flex; flex-direction: column; padding: 6px 10px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border); font-size: 14px; font-weight: 600; }
.wk-fact small { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.wk-app-card-excerpt { margin: 0; font-size: 14px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 10px; }

/* A certificate in small: the paper and layout of mo-tion Credentials. */
.wk-cert {
  --cert: #0f766e; --ink: #1c1d21; --soft: #6b6e76;
  position: relative; container-type: inline-size; max-width: 620px; aspect-ratio: 297 / 210; margin-top: 8px; overflow: hidden;
  border-radius: 6px; background: #fffdf8; color: var(--ink); color-scheme: light;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 18px 40px -18px rgba(0, 0, 0, 0.35);
}
.wk-cert *, .wk-cert *::before { box-sizing: border-box; }
.wk-cert-frame { position: relative; z-index: 1; height: 100%; padding: 6cqw 7cqw 4.5cqw; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1cqw; }
.wk-cert p { margin: 0; }
.wk-cert-issuer { font-size: 1.9cqw; letter-spacing: 0.1em; text-transform: uppercase; color: var(--soft); font-weight: 600; }
.wk-cert-kind { margin-top: 1.5cqw !important; font-size: 1.7cqw; letter-spacing: 0.3em; text-transform: uppercase; font-weight: 700; color: color-mix(in srgb, var(--cert) 60%, var(--ink)); }
.wk-cert-title { font-size: 5cqw; font-weight: 750; line-height: 1.1; letter-spacing: -0.02em; }
.wk-cert-lead { margin-top: 1.5cqw !important; font-size: 1.8cqw; color: var(--soft); }
.wk-cert-name { font: italic 4.4cqw/1.2 "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; padding: 0 3cqw 0.6cqw; border-bottom: 0.2cqw solid color-mix(in srgb, var(--cert) 45%, transparent); }
.wk-cert-text { max-width: 72cqw; font-size: 1.9cqw; line-height: 1.5; color: #33363d; }
.wk-cert-skills { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.8cqw; }
.wk-cert-skills span { font-size: 1.5cqw; padding: 0.3cqw 1.3cqw; border-radius: 99px; border: 0.15cqw solid color-mix(in srgb, var(--cert) 45%, transparent); color: color-mix(in srgb, var(--cert) 60%, var(--ink)); }
.wk-cert-foot { margin-top: auto; width: 100%; display: flex; justify-content: space-between; align-items: flex-end; text-align: left; font-size: 1.8cqw; font-weight: 600; }
.wk-cert-foot small { display: block; font-size: 1.2cqw; color: var(--soft); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.wk-cert-sign { text-align: center; min-width: 26cqw; border-top: 0.15cqw solid var(--ink); padding-top: 0.6cqw; }
/* The designs as in mo-tion Credentials (credentials.css): frames, paper and type - no coloured bars. */
.wk-cert.design-prestige { background: #fcf9f1; }
.wk-cert.design-prestige::before { content: ""; position: absolute; inset: 1.8cqw; border: 0.2cqw solid #b08a3a; border-radius: 0.4cqw; box-shadow: inset 0 0 0 0.6cqw #fcf9f1, inset 0 0 0 0.75cqw rgba(176, 138, 58, 0.6); }
.wk-cert.design-prestige .wk-cert-title { color: #9c7420; font-family: "Iowan Old Style", Georgia, serif; }
.wk-cert.design-academic { background: #f8f1e1; font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; }
.wk-cert.design-academic::before, .wk-cert.design-classic::before { content: ""; position: absolute; inset: 2cqw; border: 0.45cqw double color-mix(in srgb, var(--cert) 55%, #6e5420); }
.wk-cert.design-academic .wk-cert-title { text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; font-size: 4.2cqw; }
.wk-cert.design-classic .wk-cert-title { font-family: Georgia, "Times New Roman", serif; }
.wk-cert.design-heritage { background: color-mix(in srgb, var(--cert) 82%, #000); }
.wk-cert.design-heritage::before { content: ""; position: absolute; inset: 2.2cqw; border-radius: 0.5cqw; background: #fffdf8; box-shadow: 0 0 0 0.25cqw rgba(227, 199, 122, 0.7); }
.wk-cert.design-heritage .wk-cert-frame { padding: 7cqw 9cqw 6cqw; }
.wk-cert.design-heritage .wk-cert-title { font-family: "Iowan Old Style", Georgia, serif; color: color-mix(in srgb, var(--cert) 70%, #000); }
.wk-cert.design-modern { background: #fff; }
.wk-cert.design-modern::before { content: ""; position: absolute; width: 52cqw; height: 52cqw; right: -18cqw; top: -24cqw; border-radius: 50%; background: color-mix(in srgb, var(--cert) 12%, transparent); }
.wk-cert.design-modern .wk-cert-frame, .wk-cert.design-minimal .wk-cert-frame { align-items: flex-start; text-align: left; }
.wk-cert.design-modern .wk-cert-name, .wk-cert.design-minimal .wk-cert-name { font-family: inherit; font-style: normal; font-weight: 600; font-size: 3.6cqw; padding-left: 0; border-bottom: 0; }
.wk-cert.design-modern .wk-cert-skills, .wk-cert.design-minimal .wk-cert-skills { justify-content: flex-start; }
.wk-cert.design-minimal { background: #fff; }
@media (max-width: 640px) {
  .wk-help-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wk-help-list .muted { display: none; }
  .wk-help-list li { padding: 8px 10px; }
}

/* ---- Long words, ids and addresses never leave their box ---- */
.wk-article, .wk-infobox, .wk-box, .wk-card, .wk-app-card, td, th { overflow-wrap: break-word; }
.wk-chip, .wk-chip-status { white-space: nowrap; }
.wk-infobox table { table-layout: fixed; width: 100%; }
.wk-infobox th { width: 38%; }
.wk-portal-grid > *, .wk-help-list li { min-width: 0; }
.wk-article pre { max-width: 100%; overflow-x: auto; white-space: pre-wrap; }
.wk-article code { word-break: break-all; }
.wk-article table { display: block; max-width: 100%; overflow-x: auto; }

/* ---- Link to this entry (copy [[type:slug]]) and "Used by" ---- */
.wk-linkchip { display: inline-flex; align-items: center; gap: 6px; padding: 1px 8px 1px 2px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--muted); font: inherit; font-size: 12.5px; cursor: pointer; vertical-align: middle; max-width: 100%; }
.wk-linkchip:hover { border-color: var(--accent); color: var(--text); }
.wk-linkchip-label { padding: 0 7px; border-radius: 999px; background: var(--accent-soft, var(--bg)); color: var(--accent-ink, var(--accent)); font-weight: 650; }
.wk-linkchip code { background: none; padding: 0; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 30ch; }
.wk-linkchip[data-copied]::after { content: "✓"; color: var(--ok, #067647); font-weight: 700; }
.wk-usedby { columns: 2 260px; column-gap: 24px; }

/* ---- Readability: lines of running text stay a comfortable length on wide
   screens (tables, infobox and lists of pages keep the full width) ---- */
.wk-article .markdown > p,
.wk-article .markdown > ul,
.wk-article .markdown > ol,
.wk-article .markdown > blockquote,
.wk-lead { max-width: 92ch; }
.wk-nav .count { font-size: 12px; }
.wk-nav-title { font-size: 11.5px; }
.wk-foot { font-size: 13px; }
.wk-usedby li { break-inside: avoid; margin-bottom: 4px; }

/* ---- Reading and installing (2026-11): a calmer column on wide screens, a larger title and
   text, visible focus, room for the notch and the home bar when the wiki runs as its own app
   (wiki.webmanifest). Last in the file, so it refines the rules above. ---- */

/* One column, centred: lines and cards stay readable on wide screens. */
.wk main.wk-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px clamp(16px, 3vw, 40px) 56px;
}
.wk-foot {
  padding-left: clamp(16px, 3vw, 40px);
  padding-right: clamp(16px, 3vw, 40px);
}
.wk-head {
  padding-left: clamp(16px, 3vw, 40px);
  padding-right: clamp(16px, 3vw, 40px);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
}

/* The article: a title worth the encyclopedia, text one size larger. */
.wk-title {
  font-size: clamp(28px, 3.2vw, 38px);
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.wk-article {
  font-size: 16px;
  line-height: 1.7;
}
.wk-lead {
  font-size: 17px;
  color: color-mix(in srgb, var(--text) 88%, var(--muted));
}
.wk-article .markdown a,
.wk-lead a {
  text-underline-offset: 3px;
  text-decoration-thickness: from-font;
}

/* Keyboard: every link and control shows where it is. */
.wk a:focus-visible,
.wk button:focus-visible,
.wk select:focus-visible,
.wk-search:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.wk-nav a:focus-visible {
  outline-offset: -2px;
}

/* Phones: larger targets in the drawer and the toolbar. */
@media (max-width: 860px) {
  .wk-nav a {
    min-height: 44px;
    font-size: 15px;
  }
  .wk main.wk-main {
    padding-top: 20px;
  }
}

/* As an installed app: clear of the notch and the home bar. */
@media (display-mode: standalone) {
  .wk-head {
    padding-top: max(12px, env(safe-area-inset-top));
  }
  .wk-side {
    padding-top: max(18px, env(safe-area-inset-top));
    padding-bottom: max(18px, env(safe-area-inset-bottom));
  }
  .wk-foot {
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  .wk * {
    transition: none !important;
    animation: none !important;
  }
}
