:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-soft: #eef1f4;
  --fg: #141414;
  --muted: #5f6873;
  --soft: #8d97a3;
  --line: #dce1e7;
  --line-strong: #c4ccd5;
  --accent: #26364a;
  --accent-soft: #edf1f5;
  --danger: #a63838;
  --success: #276b42;
  --code: #f1f3f6;

  --page: 1080px;
  --home: 920px;
  --text: 720px;
  --toc: 230px;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  --serif: "Noto Serif SC", "Source Han Serif SC", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  /* Motion tokens (per design-eng taste: enter/exit = ease-out, move = ease-in-out) */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --press: 160ms;
}

html.theme-dark {
  --bg: #111210;
  --surface: #171815;
  --surface-soft: #1e1f1b;
  --fg: #f0f0eb;
  --muted: #b2b2a8;
  --soft: #85857b;
  --line: #303129;
  --line-strong: #4a4b40;
  --accent: #d8dfeb;
  --accent-soft: #20242a;
  --code: #20211d;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: 260px;
  background: linear-gradient(180deg, rgba(38,54,74,.075), rgba(38,54,74,0));
  pointer-events: none;
  z-index: -1;
}

::selection { background: var(--fg); color: var(--bg); }

a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(99,99,93,.42);
  text-underline-offset: 4px;
}
a:hover { border-bottom-color: currentColor; }

main,
.site-footer {
  width: min(var(--page), calc(100vw - 56px));
  margin-left: auto;
  margin-right: auto;
}

.top {
  position: sticky;
  top: 0;
  z-index: 70;
  width: min(var(--page), calc(100vw - 56px));
  margin-left: auto;
  margin-right: auto;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color 150ms ease, border-color 150ms ease;
}
.top.is-scrolled {
  background: var(--bg);
  border-bottom-color: var(--line);
}
.logo {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  color: var(--fg);
  border: 0;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: .01em;
}
.logo em { font-style: italic; color: var(--soft); font-weight: 500; }

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
  flex: 1 1 auto;
}
.top .nav {
  justify-content: flex-end;
}
.nav a {
  color: var(--muted);
  border-bottom: 1px solid transparent;
}
.nav a:hover { color: var(--fg); border-bottom-color: var(--fg); }
.lang-switch { font-family: var(--mono); letter-spacing: .06em; }
.theme-btn {
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
}
.theme-btn:hover { color: var(--fg); }

main { padding-bottom: 86px; }

/* Home */
.home-hero {
  max-width: var(--home);
  margin: 0 auto;
  padding: 92px 0 54px;
}
.home-kicker,
.index-head span,
.admin-eyebrow,
.footer-label {
  color: var(--soft);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.home-hero h1 {
  margin: 14px 0 0;
  color: var(--fg);
  font-family: var(--sans);
  font-size: clamp(42px, 6vw, 62px);
  line-height: 1;
  letter-spacing: -.045em;
  font-weight: 690;
}
.home-hero p {
  max-width: 700px;
  margin: 20px 0 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.75;
}
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--soft);
  font-family: var(--mono);
  font-size: 12px;
}
.hero-stats b { color: var(--fg); font-weight: 760; }
.index-head {
  width: min(var(--home), 100%);
  margin: 0 auto 16px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}
.index-head h2 {
  margin: 6px 0 0;
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: 0;
}
.index-head a { color: var(--muted); font-size: 13px; }

.post-list {
  max-width: var(--home);
  margin: 0 auto;
  border-top: 1px solid var(--line-strong);
}
.post-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 34px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}
.post-row:hover h2 a { border-bottom-color: currentColor; }
.date {
  padding-top: 5px;
  color: var(--soft);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
  text-transform: uppercase;
}
.post-row h2,
.post-content h2 {
  margin: 0;
  color: var(--fg);
  font-size: 20px;
  line-height: 1.38;
  letter-spacing: 0;
  font-weight: 680;
}
.post-row h2 a,
.post-content h2 a { border-bottom-color: transparent; }
.post-content p {
  max-width: 690px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.82;
}
.post-meta,
.tags {
  margin-top: 11px;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  color: var(--soft);
  font-size: 13px;
}
.post-meta a,
.tags a { color: var(--muted); border-bottom-color: transparent; }
.post-meta a:hover,
.tags a:hover { color: var(--fg); border-bottom-color: var(--fg); }
.post-meta span { color: var(--muted); }

/* Generic pages */
.page-title {
  max-width: var(--home);
  margin: 0 auto;
  padding: 62px 0 28px;
  color: var(--fg);
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1.22;
  letter-spacing: 0;
  font-weight: 560;
  text-align: center;
}
.page-title.compact {
  max-width: none;
  padding: 8px 0 22px;
  text-align: left;
}
.search-form {
  width: min(660px, 100%);
  margin: -4px auto 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}
main > .small {
  width: min(660px, 100%);
  margin: 0 auto 22px;
  text-align: center;
  color: var(--soft);
  font-family: var(--mono);
  font-size: 12px;
}
.page-tag-cloud {
  width: min(720px, 100%);
  margin: -4px auto 56px;
  justify-content: center;
  gap: 10px;
  text-align: center;
}
.page-tag-cloud a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.42);
  color: var(--muted);
  font-size: 13px;
}
.page-tag-cloud a:hover {
  color: var(--fg);
  border-color: var(--line-strong);
  background: var(--surface);
}

/* Article */
.article-page { padding-top: 46px; }
.article-head {
  width: min(var(--text), 100%);
  margin: 0 auto 30px;
  padding-bottom: 25px;
  border-bottom: 1px solid var(--line-strong);
}
.back-link {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 13px;
}
.article-head h1 {
  margin: 0;
  color: var(--fg);
  font-family: var(--sans);
  font-size: 33px;
  line-height: 1.22;
  letter-spacing: 0;
  font-weight: 560;
  word-break: keep-all;
  overflow-wrap: break-word;
}
.meta {
  color: var(--soft);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
}
.article-meta {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}
.article-meta span:not(:last-child)::after {
  content: "·";
  margin: 0 9px;
  color: var(--line-strong);
}
.article-tags { margin-top: 13px; }
.article-abstract {
  margin-top: 24px;
  padding: 20px 22px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.article-abstract h2 {
  margin: 0 0 8px;
  color: var(--soft);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.article-abstract p {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.85;
}
.keyword-line { margin-top: 12px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.keyword-line b { color: var(--fg); }

.article-grid {
  width: min(var(--text), 100%);
  margin: 0 auto;
  position: relative;
}
.toc-side {
  position: fixed;
  top: 112px;
  left: calc(50vw + (var(--text) / 2) + 56px);
  width: var(--toc);
  color: var(--muted);
  z-index: 5;
}
.toc {
  margin: 0;
  padding-left: 15px;
  border-left: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.55;
}
.toc strong {
  display: block;
  margin-bottom: 9px;
  color: var(--soft);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.toc ol { margin: 0; padding-left: 0; list-style: none; }
.toc li { margin: 6px 0; }
.toc .toc-l3 { padding-left: 12px; }
.toc .toc-l4 { padding-left: 24px; }
.toc a {
  display: block;
  color: var(--muted);
  border-bottom: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toc a:hover,
.toc a.active { color: var(--fg); }
.toc a.active { font-weight: 700; }
.markdown { max-width: var(--text); color: var(--fg); }

/* Markdown */
.markdown-body {
  color: var(--fg);
  font-size: 16.5px;
  line-height: 1.92;
}
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  color: var(--fg);
  line-height: 1.32;
  letter-spacing: 0;
  scroll-margin-top: 96px;
  word-break: keep-all;
  overflow-wrap: break-word;
}
.markdown-body h2 {
  margin-top: 44px;
  padding-top: 21px;
  border-top: 1px solid var(--line);
  font-size: 25px;
}
.markdown-body h3 { margin-top: 32px; font-size: 21px; }
.markdown-body h4 { margin-top: 26px; font-size: 18px; }
.heading-anchor {
  display: inline-block;
  width: 0;
  margin-left: -18px;
  padding-right: 18px;
  opacity: 0;
  border: 0;
  color: var(--soft);
}
.markdown-body h2:hover .heading-anchor,
.markdown-body h3:hover .heading-anchor,
.markdown-body h4:hover .heading-anchor { opacity: 1; }
.markdown-body p {
  margin-top: 0;
  margin-bottom: 18px;
  word-break: keep-all;
  overflow-wrap: break-word;
}
.markdown-body a { color: var(--accent); border-bottom: 1px solid rgba(38,54,74,.35); }
.markdown-body blockquote {
  margin: 22px 0;
  padding: 2px 0 2px 18px;
  color: var(--muted);
  border-left: 2px solid var(--line-strong);
}
.markdown-body code {
  font-family: var(--mono);
  font-size: .9em;
  background: var(--code);
  border: 1px solid var(--line);
  padding: .08em .32em;
  color: var(--fg);
}
.code-window {
  margin: 24px 0;
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
  box-shadow: 0 16px 42px rgba(25, 30, 35, .035);
}
.code-title {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}
.code-title b { color: var(--soft); font-family: var(--mono); font-size: 12px; text-transform: uppercase; }
button.copy-code {
  margin-left: auto;
  width: auto;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--fg);
  padding: 4px 9px;
  font-size: 12px;
  line-height: 1.3;
  cursor: pointer;
}
.markdown-body pre { margin: 0; padding: 18px; overflow: auto; background: transparent; }
.markdown-body pre code {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--fg);
  font-size: 14px;
  line-height: 1.85;
}
.md-callout {
  margin: 22px 0;
  padding: 15px 17px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  color: var(--muted);
}
.md-callout strong {
  display: block;
  margin-bottom: 4px;
  color: var(--fg);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .12em;
}
.md-callout p { margin: 0; }
.markdown-body ul,
.markdown-body ol { padding-left: 1.45em; }
.markdown-body li + li { margin-top: 7px; }
.markdown-body li.task { list-style: none; margin-left: -1.4em; }
.markdown-body input[type="checkbox"] { width: auto; margin-right: 8px; }
.markdown-body hr { border: 0; border-top: 1px solid var(--line); margin: 34px 0; }
.md-figure { margin: 28px 0; }
.md-figure img,
.upload-preview img,
.image-list img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border: 1px solid var(--line);
  background: var(--surface);
}
.image-thumb { display: block; }
.image-thumb img { max-height: 200px; width: auto; }
.md-figure figcaption { margin-top: 8px; text-align: center; color: var(--soft); font-size: 13px; }
.md-table-wrap { margin: 22px 0; overflow: auto; border: 1px solid var(--line); background: var(--surface); }
.markdown-body table { width: 100%; min-width: 540px; border-collapse: collapse; font-size: 15px; }
.markdown-body th,
.markdown-body td { padding: 11px 13px; border-bottom: 1px solid var(--line); text-align: left; }
.markdown-body th { background: var(--surface-soft); color: var(--fg); font-weight: 750; }
.markdown-body tr:last-child td { border-bottom: 0; }

/* About */
.about-page { width: min(var(--home), 100%); margin: 0 auto; padding-top: 62px; }
.about-hero { max-width: 760px; padding-bottom: 36px; }
.about-hero h1 {
  margin: 14px 0 0;
  font-family: var(--serif);
  font-size: 38px;
  line-height: 1.2;
  letter-spacing: 0;
  font-weight: 560;
}
.about-hero p { margin: 20px 0 0; color: var(--muted); font-size: 16px; line-height: 1.9; }
.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 16px 0 34px;
}
.about-card {
  min-height: 260px;
  padding: 22px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 16px 42px rgba(25, 30, 35, .035);
}
.about-card span { color: var(--soft); font-family: var(--mono); font-size: 12px; }
.about-card h2 { margin: 36px 0 10px; font-size: 19px; line-height: 1.3; letter-spacing: 0; }
.about-card p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.85; }
.about-note { width: min(var(--text), 100%); margin: 0 auto; padding-top: 8px; }

/* Admin / Forms */
.admin-links {
  width: min(var(--home), 100%);
  display: flex;
  gap: 9px;
  margin: 34px auto 24px;
  flex-wrap: wrap;
}
.admin-links a,
.admin-actions a,
.admin-actions button {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 7px 11px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
  cursor: pointer;
}
.admin-links a:hover,
.admin-actions a:hover,
.admin-actions button:hover { color: var(--fg); border-color: var(--line-strong); }
.admin-panel { width: min(var(--home), 100%); margin: 0 auto; }
.admin-panel.narrow { width: min(var(--text), 100%); }
.editor-panel { width: min(var(--page), 100%); }
.form { display: grid; gap: 15px; }
.form label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; }
.form-grid { display: grid; gap: 14px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.form-grid.three { grid-template-columns: 1.08fr .72fr 1.2fr; }
input,
textarea,
select,
button {
  width: 100%;
  font: inherit;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--fg);
  padding: 11px 12px;
  border-radius: 3px;
  outline: none;
}
input:focus,
textarea:focus,
select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(38,54,74,.08); }
textarea { min-height: 420px; resize: vertical; font-family: var(--mono); font-size: 14px; line-height: 1.72; }
textarea.compact-textarea { min-height: 220px; }
.form button,
.save-article-btn {
  cursor: pointer;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 750;
}
.notice,
.success,
.small,
.hint { max-width: var(--text); margin-left: auto; margin-right: auto; }
.notice { color: var(--danger); }
.success { color: var(--success); }
.small,
.hint { color: var(--muted); font-size: 13px; }
.snippet-box {
  margin: 12px 0 0;
  font-family: var(--mono);
  font-size: 13px;
  padding: 11px 12px;
  background: var(--code);
  border: 1px solid var(--line);
  word-break: break-all;
  cursor: pointer;
}
.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  color: var(--soft);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--line);
}
.dongle-login {
  display: grid;
  gap: 15px;
}
.dongle-login label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}
.dongle-login button {
  cursor: pointer;
  border-color: var(--accent);
  background: var(--surface);
  color: var(--accent);
  font-weight: 750;
}
.dongle-login button:disabled {
  opacity: .6;
  cursor: wait;
}
.dongle-log {
  min-height: 0;
  max-height: 180px;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
  padding: 11px 12px;
  border: 1px solid var(--line);
  background: var(--code);
  color: var(--muted);
}
.forenkey-binding-list {
  display: grid;
  gap: 12px;
}
.forenkey-binding {
  display: grid;
  gap: 7px;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.forenkey-binding > div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.forenkey-binding span,
.forenkey-binding small {
  color: var(--muted);
}
.forenkey-binding code {
  display: block;
  overflow-wrap: anywhere;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.forenkey-binding-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.forenkey-binding-actions form {
  margin: 0;
}
.forenkey-binding-actions button {
  min-height: 32px;
  width: auto;
  padding: 6px 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}
.forenkey-binding-actions button:hover {
  color: var(--fg);
  border-color: var(--line-strong);
}
.image-list { display: grid; gap: 28px; }
.image-item { padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.upload-preview { margin-top: 16px; }
.admin-actions { display: flex; gap: 8px; margin-top: 13px; flex-wrap: wrap; }
.admin-actions form { margin: 0; }
.admin-actions button { width: auto; font: inherit; }
.admin-row { grid-template-columns: 92px minmax(0, 1fr); }

/* Editor */
.editor-workbench {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin-top: 8px;
}
.editor-media-panel {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 17px;
  position: sticky;
  top: 92px;
  box-shadow: 0 16px 42px rgba(25, 30, 35, .035);
}
.editor-media-panel h2 { margin: 5px 0 14px; color: var(--fg); font-size: 18px; line-height: 1.25; letter-spacing: 0; }
.inline-upload { display: grid; gap: 10px; }
.inline-upload input[type="file"] { padding: 10px; font-size: 12px; }
.inline-upload button { cursor: pointer; border-color: var(--accent); background: var(--accent); color: #fff; font-weight: 700; }
.inline-upload button:disabled { opacity: .55; cursor: wait; }
.recent-images {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.recent-image {
  display: block;
  padding: 0;
  border: 1px solid var(--line);
  background: transparent;
  aspect-ratio: 1;
  overflow: hidden;
  cursor: pointer;
}
.recent-image:hover { border-color: var(--accent); }
.recent-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.editor-main { min-width: 0; }
.editor-label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 13px; }
.abstract-field { min-height: 112px; font-family: var(--sans); line-height: 1.75; }
.vditor-host {
  min-height: 680px;
  border-color: var(--line-strong) !important;
  background: var(--surface) !important;
  border-radius: 3px;
  overflow: hidden;
}
.vditor {
  --border-color: var(--line);
  --toolbar-background-color: var(--surface-soft);
  --textarea-background-color: var(--surface);
  --panel-background-color: var(--surface);
  --second-color: var(--muted);
}
.vditor-toolbar,
.vditor-ir,
.vditor-reset { font-family: var(--sans); }
.vditor-reset { font-size: 16px; line-height: 1.86; }
.vditor-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 680px;
  padding: 20px;
  color: var(--muted);
  font-size: 14px;
}
.vditor-spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: vditor-spin 0.8s linear infinite;
  flex: 0 0 auto;
}
@keyframes vditor-spin { to { transform: rotate(360deg); } }
.vditor-fallback-tip {
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
}
.save-article-btn { margin-top: 4px; }
.admin-posts .date { line-height: 1.8; }

/* Footer */
.site-footer {
  padding: 34px 0 48px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.footer-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 48px; }
.footer-name { margin-bottom: 6px; color: var(--muted); font-weight: 760; letter-spacing: .08em; text-transform: uppercase; }
.site-footer p { margin: 0 0 6px; color: var(--muted); }
.site-footer a { color: var(--muted); border-bottom-color: transparent; }
.site-footer a:hover { color: var(--fg); border-bottom-color: var(--fg); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--soft);
  font-size: 12px;
}
.footer-links { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.footer-links em { font-style: normal; color: var(--soft); }
.read-progress { position: fixed; left: 0; top: 0; height: 2px; width: 0; background: var(--accent); z-index: 80; }

@media (max-width: 1240px) {
  .toc-side { position: static; width: auto; margin: 0 0 28px; }
  .toc { padding: 14px 0; border-left: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .toc ol { columns: 2; column-gap: 32px; }
  .toc a { white-space: normal; overflow: visible; text-overflow: clip; }
}
@media (max-width: 980px) {
  .editor-workbench { grid-template-columns: 1fr; }
  .editor-media-panel { position: static; }
  .recent-images { grid-template-columns: repeat(6, 1fr); }
  .about-grid { grid-template-columns: 1fr; }
  .about-card { min-height: auto; }
  .about-card h2 { margin-top: 18px; }
}
@media (max-width: 760px) {
  .top,
  main,
  .site-footer { width: calc(100vw - 32px); }
  .top { display: flex; min-height: auto; padding: 20px 0 15px; align-items: flex-start; flex-direction: column; gap: 14px; }
  .nav { justify-content: flex-start; gap: 12px; }
  .home-hero { padding: 50px 0 38px; }
  .home-hero h1 { font-size: 36px; }
  .home-hero p { font-size: 15.5px; }
  .index-head { align-items: flex-start; flex-direction: column; gap: 8px; }
  .post-row,
  .admin-row { grid-template-columns: 1fr; gap: 6px; padding: 23px 0; }
  .article-page { padding-top: 28px; }
  .article-head { margin-bottom: 24px; padding-bottom: 22px; }
  .article-head h1 { font-size: 24px; line-height: 1.28; }
  .article-meta { margin-top: 14px; }
  .article-extra-meta { margin-top: 10px; }
  .toc ol { columns: 1; }
  .form-grid.two,
  .form-grid.three { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 22px; }
  .footer-bottom { align-items: flex-start; flex-direction: column; }
  .recent-images { grid-template-columns: repeat(3, 1fr); }
  .article-abstract { padding: 18px; }
  .about-page { padding-top: 48px; }
}

/* v16.2 bilingual site layer */
.language-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--soft);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
}

.page-subtitle {
  max-width: var(--home);
  margin: -18px auto 34px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .06em;
}

.empty-state {
  max-width: var(--home);
  margin: 34px auto 0;
  padding: 34px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.empty-state h2 {
  margin: 0;
  font-size: 20px;
  font-family: var(--serif);
  font-weight: 560;
}
.empty-state p { color: var(--muted); margin: 10px 0 0; }

.translation-bar,
.translation-tools,
.translation-missing {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 82%, var(--surface-soft));
  color: var(--muted);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
}
.translation-bar {
  margin: 0 0 18px;
}
.translation-bar a,
.translation-missing a {
  color: var(--accent);
  font-weight: 650;
}
.translation-missing {
  margin: 0 0 18px;
  border-color: color-mix(in srgb, var(--accent) 25%, var(--line));
}

.translation-tools {
  justify-content: space-between;
  margin: 0 0 18px;
}
.translation-tools div {
  display: grid;
  gap: 2px;
}
.translation-tools b {
  color: var(--fg);
}
.translation-tools span {
  color: var(--muted);
  font-size: 12px;
}
.translation-tools form { margin: 0; }
.translation-tools button,
.admin-actions button {
  min-height: 30px;
}

.form-grid.four {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.admin-actions form {
  display: inline-flex;
  margin: 0;
}

@media (max-width: 980px) {
  .form-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .form-grid.four { grid-template-columns: 1fr; }
  .translation-tools { align-items: flex-start; }
}


/* v16.3 cleaner bilingual UI */
.article-switch {
  margin: 0 0 18px;
  display: flex;
  justify-content: flex-end;
}
.article-switch a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}
.article-switch a:hover {
  color: var(--fg);
  border-color: var(--line-strong);
}

.about-minimal {
  width: min(720px, 100%);
  padding-top: 76px;
}
.about-minimal .about-hero {
  max-width: 720px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.about-minimal .about-hero h1 {
  font-size: 40px;
  letter-spacing: 0;
}
.about-profile {
  padding-top: 24px;
  display: grid;
  gap: 0;
}
.about-profile p {
  margin: 0;
  padding: 18px 0;
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  color: var(--fg);
  font-size: 16px;
  line-height: 1.85;
}
.about-profile strong {
  font-weight: 560;
  color: var(--soft);
  white-space: nowrap;
}
.about-profile span {
  color: var(--fg);
}
.about-profile a {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 4px;
}

@media (max-width: 680px) {
  .about-profile p {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .article-switch {
    justify-content: flex-start;
  }
}


/* v16.4 refined simple pages */
.about-elegant {
  width: min(680px, 100%);
  padding-top: 88px;
}
.about-elegant .about-signature {
  text-align: center;
  padding-bottom: 30px;
}
.about-elegant .about-signature h1 {
  margin: 12px 0 0;
  font-family: var(--serif);
  font-size: 40px;
  line-height: 1.08;
  letter-spacing: 0;
  font-weight: 540;
}
.about-lines {
  margin: 0 auto;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}
.about-lines p {
  margin: 0;
  min-height: 64px;
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  color: var(--fg);
}
.about-lines p:last-child { border-bottom: 0; }
.about-lines strong {
  color: var(--soft);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.about-lines span {
  color: var(--fg);
  font-size: 15.5px;
  line-height: 1.85;
}
.about-lines a {
  color: var(--fg);
  border-bottom-color: rgba(20,20,20,.36);
}
html.theme-dark .page-tag-cloud a { background: rgba(23,24,21,.48); }
html.theme-dark .about-lines a { border-bottom-color: rgba(240,240,235,.36); }

@media (max-width: 680px) {
  .search-form { grid-template-columns: 1fr; }
  .about-elegant { padding-top: 60px; }
  .about-lines p {
    grid-template-columns: 1fr;
    gap: 4px;
    align-items: start;
    padding: 16px 0;
  }
  .about-lines strong { text-transform: none; }
}

/* v16.5: grouped bilingual admin, dark editor fixes (language switch restyled under v16.27 below) */

.version-intro {
  max-width: 720px;
  margin: -10px 0 24px;
  color: var(--muted);
  font-size: 14px;
}
.version-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.version-card {
  min-height: 190px;
  padding: 22px;
  border: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.version-card > span,
.version-badges span {
  color: var(--soft);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.version-card h2 {
  margin: 12px 0 8px;
  font-size: 19px;
  line-height: 1.35;
  letter-spacing: 0;
}
.version-card p { margin: 0 0 16px; color: var(--muted); font-size: 13px; }
.version-card.is-missing {
  background: color-mix(in srgb, var(--surface) 62%, var(--surface-soft));
  border-style: dashed;
}
.version-card form { margin: 0; }
.version-card button { cursor: pointer; border-color: var(--accent); background: var(--accent); color: var(--bg); font-weight: 720; }
.version-actions { margin-top: auto; }
.version-switcher {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 18px;
  padding: 4px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
}
.version-switcher a,
.version-switcher button {
  width: auto;
  min-height: 30px;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}
.version-switcher a { display: inline-flex; align-items: center; border-bottom: 0; }
.version-switcher a.is-active {
  color: var(--fg);
  background: var(--surface-soft);
  box-shadow: inset 0 0 0 1px var(--line);
}
.version-switcher form { margin: 0; }
.version-switcher button:hover,
.version-switcher a:hover { color: var(--fg); }
.grouped-row h2 a { border-bottom-color: transparent; }
.grouped-row h2 a:hover { border-bottom-color: currentColor; }
.version-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.version-badges span {
  min-height: 25px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-transform: none;
}
.version-badges .is-ready { color: var(--success); border-color: color-mix(in srgb, var(--success) 26%, var(--line)); }
.version-badges .is-missing { color: var(--soft); border-style: dashed; }

.about-studio {
  width: min(760px, 100%);
  padding-top: 78px;
}
.about-studio-head {
  text-align: center;
  padding-bottom: 34px;
}
.about-studio-head h1 {
  margin: 12px 0 0;
  font-family: var(--serif);
  font-size: 42px;
  line-height: 1.08;
  letter-spacing: 0;
  font-weight: 540;
}
.about-studio-head p {
  max-width: 560px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.9;
}
.about-studio-card {
  padding: 6px 0;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}
.about-studio-card dl { margin: 0; }
.about-studio-card div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 28px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.about-studio-card div:last-child { border-bottom: 0; }
.about-studio-card dt {
  color: var(--soft);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .08em;
}
.about-studio-card dd {
  margin: 0;
  color: var(--fg);
  font-size: 15.5px;
  line-height: 1.88;
}
.about-studio-card a { color: var(--fg); border-bottom-color: color-mix(in srgb, var(--fg) 38%, transparent); }

html.theme-dark input,
html.theme-dark textarea,
html.theme-dark select,
html.theme-dark button,
html.theme-dark .admin-links a,
html.theme-dark .admin-actions a,
html.theme-dark .admin-actions button,
html.theme-dark .snippet-box,
html.theme-dark .editor-media-panel,
html.theme-dark .version-card,
html.theme-dark .version-switcher {
  background: #171a1d;
  color: var(--fg);
  border-color: #34383c;
}
html.theme-dark input::placeholder,
html.theme-dark textarea::placeholder { color: #757d85; }
html.theme-dark input:focus,
html.theme-dark textarea:focus,
html.theme-dark select:focus {
  border-color: #8d99a8;
  box-shadow: 0 0 0 3px rgba(141,153,168,.16);
}
html.theme-dark .form button,
html.theme-dark .save-article-btn,
html.theme-dark .inline-upload button,
html.theme-dark .version-card button {
  background: #d8dfeb;
  border-color: #d8dfeb;
  color: #111210;
}
html.theme-dark .lang-toggle { background: #151719; border-color: #34383c; }
html.theme-dark .lang-toggle a.is-active,
html.theme-dark .version-switcher a.is-active {
  background: #252a30;
  box-shadow: inset 0 0 0 1px #3b4248;
}

html.theme-dark .vditor,
html.theme-dark .vditor-host {
  background: #14171a !important;
  color: #edf0f2 !important;
  border-color: #34383c !important;
}
html.theme-dark .vditor {
  --border-color: #34383c !important;
  --toolbar-background-color: #1b1f23 !important;
  --textarea-background-color: #14171a !important;
  --panel-background-color: #1b1f23 !important;
  --second-color: #aab2bb !important;
}
html.theme-dark .vditor-toolbar,
html.theme-dark .vditor-content,
html.theme-dark .vditor-ir,
html.theme-dark .vditor-sv,
html.theme-dark .vditor-wysiwyg,
html.theme-dark .vditor-preview,
html.theme-dark .vditor-reset {
  background: #14171a !important;
  color: #edf0f2 !important;
  border-color: #34383c !important;
}
html.theme-dark .vditor-toolbar {
  background: #1b1f23 !important;
}
html.theme-dark .vditor-toolbar button,
html.theme-dark .vditor-toolbar .vditor-tooltipped {
  color: #cfd7df !important;
}
html.theme-dark .vditor-toolbar button:hover,
html.theme-dark .vditor-toolbar button.vditor-menu--current {
  background: #252b31 !important;
}
html.theme-dark .vditor-toolbar svg {
  color: #cfd7df !important;
  fill: currentColor !important;
}
html.theme-dark .vditor-reset code,
html.theme-dark .vditor-reset pre,
html.theme-dark .vditor-ir pre,
html.theme-dark .vditor-sv pre {
  background: #1f2428 !important;
  color: #edf0f2 !important;
}
html.theme-dark .vditor-panel,
html.theme-dark .vditor-hint,
html.theme-dark .vditor-menu,
html.theme-dark .vditor-select,
html.theme-dark .vditor-emojis,
html.theme-dark .vditor-outline {
  background: #1b1f23 !important;
  color: #edf0f2 !important;
  border-color: #34383c !important;
}
html.theme-dark .vditor-hint button,
html.theme-dark .vditor-menu button {
  color: #edf0f2 !important;
}
html.theme-dark .vditor-hint button:hover,
html.theme-dark .vditor-menu button:hover {
  background: #252b31 !important;
}
html.theme-dark .vditor-ir__node--expand,
html.theme-dark .vditor-ir__marker {
  color: #aab2bb !important;
}
html.theme-dark .vditor-reset table tr,
html.theme-dark .vditor-reset table th,
html.theme-dark .vditor-reset table td {
  border-color: #34383c !important;
}

@media (max-width: 760px) {
  .version-cards { grid-template-columns: 1fr; }
  .about-studio { padding-top: 56px; }
  .about-studio-card div { grid-template-columns: 1fr; gap: 6px; padding: 17px 0; }
}
html.theme-dark .theme-btn {
  width: auto;
  padding: 0;
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
html.theme-dark .theme-btn:hover { color: var(--fg); border-bottom-color: var(--fg); }

/* v16.6: fallback bilingual reading, refined about page, footer settings, stronger Vditor dark mode */
.translation-notice {
  margin: 0 0 24px;
  padding: 12px 14px;
  border-left: 3px solid var(--line-strong);
  background: color-mix(in srgb, var(--surface-soft) 72%, transparent);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.center-page-head {
  width: min(var(--text), 100%);
  margin: 0 auto 32px;
  padding-top: 58px;
  text-align: center;
}
.center-page-head .page-title { margin-left: auto; margin-right: auto; }
.center-small { text-align: center; }
.tags-page-head .page-title { margin-bottom: 26px; }
.page-tag-cloud {
  justify-content: center;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.about-journal {
  width: min(var(--text), 100%);
  padding-top: 70px;
}
.about-journal-head {
  padding-bottom: 30px;
  border-bottom: 1px solid var(--line-strong);
}
.about-journal-head h1 {
  margin: 13px 0 0;
  font-family: var(--serif);
  font-size: 40px;
  line-height: 1.08;
  letter-spacing: 0;
  font-weight: 540;
}
.about-journal-head p {
  max-width: 680px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.9;
}
.about-journal-body {
  padding-top: 8px;
}
.about-journal-body section {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 32px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}
.about-journal-body h2 {
  margin: 2px 0 0;
  color: var(--soft);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.about-journal-body p {
  margin: 0;
  color: var(--fg);
  font-size: 15.5px;
  line-height: 1.95;
}
.about-contact-line a {
  color: var(--fg);
  border-bottom-color: color-mix(in srgb, var(--fg) 36%, transparent);
}
.form-help {
  margin-top: -8px;
  margin-bottom: 6px;
}
.form-help code {
  padding: 1px 5px;
  background: var(--code);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: var(--mono);
}

/* Vditor dark fixes: toolbar buttons, SVG icons, textarea, menus, upload panels */
html.theme-dark input[type="file"]::file-selector-button {
  background: #252b31;
  color: #e8edf2;
  border: 1px solid #3c444c;
  border-radius: 5px;
  padding: 7px 10px;
  margin-right: 10px;
}
html.theme-dark input[type="file"]::file-selector-button:hover {
  background: #303841;
}
html.theme-dark .vditor-toolbar {
  background: #15191d !important;
  border-bottom: 1px solid #34383c !important;
}
html.theme-dark .vditor-toolbar__item,
html.theme-dark .vditor-toolbar__item > button,
html.theme-dark .vditor-toolbar button,
html.theme-dark .vditor-menu,
html.theme-dark .vditor-menu button {
  background: transparent !important;
  color: #d9e2ea !important;
  border: 0 !important;
  box-shadow: none !important;
}
html.theme-dark .vditor-toolbar__item > button,
html.theme-dark .vditor-toolbar button {
  border-radius: 6px !important;
}
html.theme-dark .vditor-toolbar__item > button:hover,
html.theme-dark .vditor-toolbar__item--current,
html.theme-dark .vditor-toolbar button:hover,
html.theme-dark .vditor-menu button:hover {
  background: #252c33 !important;
  color: #ffffff !important;
}
html.theme-dark .vditor-toolbar__item svg,
html.theme-dark .vditor-toolbar svg,
html.theme-dark .vditor-menu svg {
  color: #d9e2ea !important;
  fill: #d9e2ea !important;
  stroke: #d9e2ea !important;
  opacity: 1 !important;
}
html.theme-dark .vditor-toolbar__item svg path,
html.theme-dark .vditor-toolbar svg path,
html.theme-dark .vditor-menu svg path {
  fill: #d9e2ea !important;
  stroke: #d9e2ea !important;
}
html.theme-dark .vditor-toolbar__divider {
  border-left-color: #34383c !important;
}
html.theme-dark .vditor-ir textarea,
html.theme-dark .vditor-sv textarea,
html.theme-dark .vditor-textarea,
html.theme-dark .vditor-wysiwyg,
html.theme-dark .vditor-ir pre,
html.theme-dark .vditor-sv pre,
html.theme-dark .vditor-reset,
html.theme-dark .vditor-reset p,
html.theme-dark .vditor-reset li,
html.theme-dark .vditor-reset blockquote {
  background: #14171a !important;
  color: #edf0f2 !important;
  caret-color: #ffffff !important;
}
html.theme-dark .vditor-ir .vditor-ir__marker,
html.theme-dark .vditor-ir .vditor-ir__node,
html.theme-dark .vditor-sv .vditor-sv__marker,
html.theme-dark .vditor-placeholder {
  color: #89929c !important;
}
html.theme-dark .vditor-panel,
html.theme-dark .vditor-panel--none,
html.theme-dark .vditor-hint,
html.theme-dark .vditor-select,
html.theme-dark .vditor-emojis,
html.theme-dark .vditor-outline,
html.theme-dark .vditor-upload,
html.theme-dark .vditor-resize {
  background: #1b1f23 !important;
  color: #edf0f2 !important;
  border-color: #34383c !important;
}
html.theme-dark .vditor-panel input,
html.theme-dark .vditor-panel textarea,
html.theme-dark .vditor-select input {
  background: #121518 !important;
  color: #edf0f2 !important;
  border-color: #34383c !important;
}
html.theme-dark .vditor-counter {
  color: #89929c !important;
  background: transparent !important;
}

@media (max-width: 760px) {
  .about-journal { padding-top: 54px; }
  .about-journal-body section { grid-template-columns: 1fr; gap: 8px; padding: 22px 0; }
  .about-journal-body h2 { text-transform: none; }
}

/* v16.7: lightweight friend links page and safer public link settings */
.links-page .links-list { margin-top: 28px; }
.link-row .link-host { margin-top: 9px; font-family: var(--mono); font-size: 12px; }
.friend-link-fields { margin-top: 10px; }


/* v16.8: project index and backend security checklist, reusing existing academic rows */
.projects-page .projects-list { margin-top: 28px; }
.project-row .project-meta { margin-top: 10px; }
.security-check-list { display: grid; gap: 12px; margin-top: 22px; }
.security-item { border: 1px solid var(--line); padding: 14px 16px; background: var(--card); }
.security-item strong { display: block; margin-bottom: 6px; font-family: var(--mono); font-size: 12px; letter-spacing: .04em; }
.security-item p { margin: 0; color: var(--soft); line-height: 1.75; }
.security-item.is-ok strong { color: var(--fg); }
.security-item.is-warn strong { color: #8a5a00; }
.security-item.is-fail strong { color: #a12626; }
html.theme-dark .security-item.is-warn strong { color: #d0a24a; }
html.theme-dark .security-item.is-fail strong { color: #ff8b8b; }


/* v16.9: timeline, uses/setup, safer 404 and quieter article enhancements */
.timeline-page .about-journal-head,
.setup-page .about-journal-head,
.not-found-page .about-journal-head { max-width: 760px; }
.timeline-list {
  max-width: var(--home);
  margin: 30px auto 0;
  border-top: 1px solid var(--line-strong);
}
.timeline-item {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 34px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}
.timeline-content h2 {
  margin: 0;
  color: var(--fg);
  font-size: 20px;
  line-height: 1.38;
  letter-spacing: 0;
  font-weight: 680;
}
.timeline-content h2 a { border-bottom-color: transparent; }
.timeline-content h2 a:hover { border-bottom-color: currentColor; }
.timeline-content p {
  max-width: 690px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.82;
}
.setup-page .setup-list { margin-top: 28px; }
.setup-row .setup-meta { margin-top: 10px; font-family: var(--mono); font-size: 12px; }
.not-found-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.not-found-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface);
}
.not-found-actions a:hover { color: var(--fg); border-color: var(--line-strong); }
.article-extra-meta {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  color: var(--soft);
  font-family: var(--mono);
  font-size: 12px;
}
.article-copy-link {
  width: auto;
  padding: 0;
  border: 0;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}
.article-copy-link:hover { color: var(--fg); border-bottom-color: var(--fg); }
.article-foot {
  width: min(var(--text), 100%);
  margin: 44px auto 0;
  border-top: 1px solid var(--line-strong);
}
.article-end-box {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.article-end-box p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.article-end-box em { margin: 0 8px; color: var(--soft); font-style: normal; }
.article-neighbors {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.article-neighbors a {
  display: grid;
  gap: 6px;
  min-height: 86px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.article-neighbors span {
  color: var(--soft);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.article-neighbors b {
  color: var(--fg);
  font-size: 15px;
  line-height: 1.55;
  font-weight: 650;
}
.article-related {
  padding: 20px 0 0;
  display: grid;
  gap: 10px;
}
.article-related a {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}
.article-related a:hover { color: var(--fg); }
@media (max-width: 760px) {
  .timeline-item { grid-template-columns: 1fr; gap: 6px; padding: 23px 0; }
  .article-neighbors { grid-template-columns: 1fr; }
}

/* v16.10: bilingual timeline with automatic article entries */
.timeline-item .date {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.timeline-item .date span {
  font-family: var(--mono);
}
.timeline-item .date em {
  color: var(--soft);
  font-size: 11px;
  font-style: normal;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.timeline-lang-note {
  color: var(--soft) !important;
  font-size: 12px !important;
}
.inline-check {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 14px;
}
.inline-check input {
  width: auto;
}

/* v16.12/v16.13: research article page enhancements */
.research-version-strip {
  margin-top: 18px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}
.research-version-strip span { display: inline-flex; align-items: baseline; gap: 6px; }
.research-version-strip b {
  color: var(--soft);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 650;
}
.research-version-strip a { color: var(--fg); }
.article-citation-box {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.citation-box-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.citation-box-head p {
  margin: 6px 0 0;
  color: var(--soft);
  font-size: 12px;
}
.citation-link-copy {
  flex: 0 0 auto;
  margin-top: 2px;
}
.citation-list {
  margin-top: 12px;
  display: grid;
  gap: 0;
}
.citation-row {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.citation-row-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}
.citation-row-head strong {
  color: var(--fg);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.citation-row p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.68;
  word-break: break-word;
}
.article-series-box {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.series-progress {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.series-progress a { color: var(--fg); }
.series-nav-grid {
  margin-top: 13px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.series-nav-grid a {
  display: grid;
  gap: 6px;
  min-height: 78px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.series-nav-grid span,
.related-card span {
  color: var(--soft);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.series-nav-grid b,
.related-card b {
  color: var(--fg);
  font-size: 14.5px;
  line-height: 1.55;
  font-weight: 650;
}
.related-list {
  display: grid;
  gap: 10px;
}
.related-card {
  display: grid;
  gap: 5px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.related-card em {
  color: var(--soft);
  font-family: var(--mono);
  font-size: 11px;
  font-style: normal;
}
@media (max-width: 760px) {
  .series-nav-grid { grid-template-columns: 1fr; }
  .research-version-strip { gap: 6px 12px; }
  .research-version-strip span { width: 100%; }
  .citation-box-head { flex-direction: column; }
}

/* v16.14: compact research article footer + editor autosave */
.article-extra-meta a {
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.article-extra-meta a:hover { color: var(--fg); border-bottom-color: var(--fg); }
.research-version-strip { display: none; }
.article-info-compact {
  padding: 16px 0;
}
.article-info-compact p {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 0;
  align-items: center;
}
.article-citation-compact {
  padding: 20px 0 0;
  border-top: 1px solid var(--line-strong);
}
.citation-compact-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.citation-compact-head p {
  margin: 6px 0 0;
  color: var(--soft);
  font-size: 12.5px;
  line-height: 1.7;
}
.citation-details {
  margin-top: 12px;
  border-top: 1px solid var(--line);
}
.citation-details summary {
  padding: 13px 0;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12px;
  list-style-position: inside;
}
.citation-details summary:hover { color: var(--fg); }
.article-citation-compact .citation-list { margin-top: 0; }
.article-citation-compact .citation-row {
  padding: 13px 0;
  border-top: 1px solid var(--line);
}
.article-citation-compact .citation-row p {
  font-size: 12px;
  line-height: 1.62;
  color: var(--soft);
}
.autosave-status {
  margin: 10px 0 0;
  min-height: 20px;
  color: var(--soft);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
}
.autosave-status.is-saving { color: var(--muted); }
.autosave-status.is-error { color: #b45; }
.autosave-status.is-ok { color: var(--soft); }
@media (max-width: 760px) {
  .citation-compact-head { flex-direction: column; }
}

/* v16.15: keep article footer minimal; copy actions are buttons, not content blocks */
.article-foot {
  margin-top: 42px;
}
.article-copy-tools {
  padding: 18px 0 0;
  border-top: 1px solid var(--line);
}
.article-copy-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.article-copy-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 31px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1;
  letter-spacing: .02em;
}
.article-copy-pill:hover {
  color: var(--fg);
  border-color: var(--line-strong);
  border-bottom-color: var(--line-strong);
}
.article-copy-pill:focus-visible {
  outline: 1px solid var(--fg);
  outline-offset: 2px;
}
.article-copy-pill.is-copied {
  color: var(--fg);
  border-color: var(--line-strong);
}
.article-info-compact,
.article-citation-compact,
.citation-details,
.citation-list-bottom {
  display: none;
}
.article-neighbors,
.series-nav-grid {
  gap: 0;
}
.article-neighbors a,
.series-nav-grid a {
  min-height: auto;
  padding: 13px 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
}
.article-neighbors a:hover b,
.series-nav-grid a:hover b {
  border-bottom: 1px solid var(--fg);
}
.article-series-box {
  padding: 16px 0;
}
.article-related {
  padding-top: 16px;
}
@media (max-width: 760px) {
  .article-copy-actions { gap: 8px; }
  .article-copy-pill { min-height: 34px; }
}

/* v16.16: neutral light palette, admin controls, PDF articles, and compact article footer */
.settings-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.settings-check-grid .inline-check {
  min-height: 44px;
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--fg);
}
.settings-check-grid input { width: auto; margin: 0; }

.version-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.version-actions > a,
.version-actions > form,
.version-actions > form > button {
  width: 100%;
  min-height: 40px;
}
.version-actions > a,
.version-actions > form > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--accent);
  border-radius: 3px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  font-weight: 720;
  text-align: center;
}
.version-actions > a:hover,
.version-actions > form > button:hover { color: #fff; filter: brightness(.92); }

.pdf-editor-panel {
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.pdf-editor-panel h2 { margin: 5px 0 14px; font-size: 18px; }
.pdf-upload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}
.pdf-upload-row button {
  cursor: pointer;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 720;
}
.pdf-upload-row button:disabled { opacity: .55; cursor: wait; }
.pdf-upload-row span {
  grid-column: 1 / -1;
  min-height: 20px;
  color: var(--muted);
  font-size: 12px;
}
.article-pdf { width: 100%; }
.article-pdf iframe {
  display: block;
  width: 100%;
  height: min(78vh, 920px);
  min-height: 620px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
}
.article-pdf p { margin: 8px 0 0; text-align: right; font-size: 12px; }
.article-pdf-document { grid-column: 1 / -1; }
.article-pdf-embed { margin: 0 0 34px; }

.article-neighbors {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}
.article-neighbors a.is-newer { grid-column: 1; }
.article-neighbors a.is-older {
  grid-column: 2;
  text-align: right;
  justify-items: end;
}
.article-copy-head { margin-bottom: 12px; }
.article-copy-head p {
  max-width: 620px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

@media (max-width: 760px) {
  .settings-check-grid { grid-template-columns: 1fr; }
  .version-actions { grid-template-columns: 1fr; }
  .pdf-upload-row { grid-template-columns: 1fr; }
  .pdf-upload-row span { grid-column: 1; }
  .article-pdf iframe { min-height: 520px; height: 72vh; }
  .article-neighbors { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .article-neighbors b { font-size: 13px; line-height: 1.45; }
}

/* v16.17: de-template the public shell into a quieter research archive */
:root {
  --bg: #f7f4ee;
  --surface: #fffdf8;
  --surface-soft: #eee8dc;
  --fg: #181715;
  --muted: #625d54;
  --soft: #8a8377;
  --line: #d8d0c2;
  --line-strong: #b8ad9b;
  --accent: #1f4039;
  --accent-soft: #e5ece7;
  --code: #eee7db;
  --home: 900px;
}

html.theme-dark {
  --bg: #11110f;
  --surface: #181713;
  --surface-soft: #222018;
  --fg: #f2eee5;
  --muted: #b7afa1;
  --soft: #8d8578;
  --line: #343027;
  --line-strong: #554b3e;
  --accent: #c7dfd2;
  --accent-soft: #1f2b26;
  --code: #242119;
}

body {
  background:
    linear-gradient(90deg, rgba(24,23,21,.032) 1px, transparent 1px) 0 0 / 56px 56px,
    var(--bg);
}
body::before { display: none; }

.top {
  min-height: 58px;
  border-bottom: 2px solid var(--fg);
}
.logo {
  font-size: 12px;
  letter-spacing: .18em;
}
.logo em {
  color: var(--accent);
  font-weight: 760;
}
.nav {
  gap: 13px;
  font-family: var(--mono);
  font-size: 12px;
}
.nav a,
.theme-btn {
  color: var(--muted);
}
.lang-toggle {
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.lang-toggle a {
  min-width: auto;
  min-height: auto;
  padding: 0 7px;
  border-radius: 0;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: .06em;
}
.lang-toggle a + a {
  border-left: 1px solid var(--line-strong);
}
.lang-toggle a.is-active {
  color: var(--fg);
  background: transparent;
  box-shadow: none;
}
html.theme-dark .lang-toggle {
  background: transparent;
  border-color: transparent;
}
html.theme-dark .lang-toggle a.is-active {
  color: var(--fg);
  background: transparent;
  box-shadow: none;
}

.home-hero {
  max-width: var(--home);
  display: grid;
  grid-template-columns: 154px minmax(0, 1fr);
  column-gap: 30px;
  margin: 0 auto;
  padding: 34px 0 24px;
  border-bottom: 1px solid var(--line-strong);
}
.home-kicker {
  grid-column: 1;
  grid-row: 1 / span 3;
  padding-top: 5px;
  color: var(--accent);
  letter-spacing: .14em;
}
.home-kicker::after {
  content: "";
  display: block;
  width: 54px;
  height: 2px;
  margin-top: 14px;
  background: var(--fg);
}
.home-hero h1 {
  grid-column: 2;
  margin: 0;
  font-family: var(--mono);
  font-size: 22px;
  line-height: 1.3;
  font-weight: 820;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.home-hero p {
  grid-column: 2;
  max-width: 640px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.85;
}
.hero-stats {
  grid-column: 2;
  gap: 14px;
  margin-top: 17px;
  padding-top: 12px;
  border-top: 1px dashed var(--line-strong);
  font-size: 12px;
}
.hero-stats span {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
}
.hero-stats b {
  color: var(--accent);
  font-size: 14px;
}

.index-head {
  width: min(var(--home), 100%);
  margin: 24px auto 0;
  padding-bottom: 8px;
  align-items: center;
  border-bottom: 1px solid var(--line-strong);
}
.index-head h2 {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: 0;
  font-weight: 760;
}
.index-head a {
  font-family: var(--mono);
  font-size: 12px;
}

.post-list {
  max-width: var(--home);
  border-top: 0;
}
.post-row {
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.post-row:hover {
  background: linear-gradient(90deg, rgba(31,64,57,.055), transparent 66%);
}
.date {
  padding-top: 3px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .08em;
}
.post-row h2,
.post-content h2 {
  font-size: 18px;
  line-height: 1.46;
  letter-spacing: 0;
  font-weight: 760;
}
.post-row h2 a:hover,
.post-content h2 a:hover {
  color: var(--accent);
}
.post-content p {
  max-width: 660px;
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.75;
}
.post-meta,
.tags {
  gap: 7px 10px;
  margin-top: 9px;
  font-family: var(--mono);
  font-size: 12px;
}
.post-meta a,
.tags a,
.post-meta span {
  color: var(--soft);
}

@media (max-width: 760px) {
  body {
    background:
      linear-gradient(90deg, rgba(24,23,21,.026) 1px, transparent 1px) 0 0 / 42px 42px,
      var(--bg);
  }
  .top {
    min-height: auto;
    padding: 16px 0 13px;
    border-bottom-width: 2px;
  }
  .nav {
    gap: 10px;
    font-size: 12px;
  }
  .home-hero {
    display: block;
    padding: 28px 0 22px;
  }
  .home-kicker::after {
    width: 44px;
    margin-top: 11px;
  }
  .home-hero h1 {
    margin-top: 13px;
    font-size: 22px;
  }
  .home-hero p {
    font-size: 14.5px;
  }
  .hero-stats {
    margin-top: 16px;
  }
  .index-head {
    align-items: flex-start;
    gap: 8px;
  }
  .post-row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 20px 0;
  }
  .date {
    padding-top: 0;
  }
}

/* v16.18: stronger ledger layout, away from landing-page/blog-template rhythm */
:root {
  --bg: #f1eee5;
  --surface: #fffdf6;
  --surface-soft: #e7e0d1;
  --fg: #161512;
  --muted: #5d584d;
  --soft: #837a6c;
  --line: #d4cabb;
  --line-strong: #a99b88;
  --accent: #134b43;
  --accent-soft: #dfe9e4;
  --mark: #8b2f1f;
  --page: 1100px;
  --home: 1040px;
}

html.theme-dark {
  --bg: #10100d;
  --surface: #181713;
  --surface-soft: #28241b;
  --fg: #f3efe5;
  --muted: #bab1a1;
  --soft: #908675;
  --line: #383126;
  --line-strong: #5a4f40;
  --accent: #92d2c3;
  --accent-soft: #172823;
  --mark: #db846e;
}

body {
  background: var(--bg);
}

.top,
main,
.site-footer {
  width: min(var(--page), calc(100vw - 48px));
}

.top {
  margin-top: 18px;
  min-height: 0;
  padding: 10px 0 11px;
  align-items: flex-start;
  border-bottom: 1px solid var(--fg);
}
.logo {
  padding-top: 1px;
  font-size: 16px;
  letter-spacing: .01em;
}
.logo span::after {
  content: "/";
  margin-left: 7px;
  color: var(--mark);
}
.logo em {
  color: var(--fg);
}
.nav {
  max-width: 660px;
  gap: 10px 14px;
  line-height: 1.5;
}
.nav a,
.theme-btn,
.lang-toggle a {
  color: var(--muted);
}
.nav a:hover,
.theme-btn:hover,
.lang-toggle a:hover {
  color: var(--fg);
}

main {
  padding-bottom: 78px;
}

.home-hero {
  max-width: var(--home);
  grid-template-columns: 176px minmax(0, 1fr);
  column-gap: 34px;
  padding: 26px 0 18px;
  border-bottom: 0;
}
.home-kicker {
  padding-top: 2px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .18em;
}
.home-kicker::after {
  width: 72px;
  height: 3px;
  margin-top: 12px;
  background: var(--mark);
}
.home-hero h1 {
  max-width: 680px;
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.45;
  font-weight: 840;
  letter-spacing: .03em;
}
.home-hero h1::before {
  content: "INDEX / ";
  color: var(--mark);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 760;
  letter-spacing: .08em;
}
.home-hero p {
  max-width: 720px;
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.8;
}
.hero-stats {
  max-width: 720px;
  gap: 0;
  margin-top: 13px;
  padding-top: 10px;
  border-top: 1px solid var(--line-strong);
}
.hero-stats span {
  min-height: 26px;
  padding: 4px 13px 4px 0;
  margin-right: 13px;
  border-right: 1px solid var(--line);
}
.hero-stats span:last-child {
  border-right: 0;
}
.hero-stats b {
  color: var(--fg);
  font-size: 13px;
}

.index-head {
  max-width: var(--home);
  margin-top: 10px;
  padding: 11px 0 10px;
  border-top: 3px solid var(--fg);
  border-bottom: 1px solid var(--line-strong);
}
.index-head span {
  color: var(--mark);
  font-size: 10px;
}
.index-head h2 {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 820;
}
.index-head a {
  color: var(--muted);
  border-bottom-color: var(--line-strong);
}

.post-list {
  max-width: var(--home);
  counter-reset: article-row;
}
.post-row {
  counter-increment: article-row;
  grid-template-columns: 46px 118px minmax(0, 1fr);
  gap: 18px;
  padding: 18px 0 20px;
  border-bottom: 1px solid var(--line);
}
.post-row::before {
  content: counter(article-row, decimal-leading-zero);
  grid-column: 1;
  grid-row: 1;
  padding-top: 3px;
  color: var(--mark);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
}
.post-row:hover {
  background: transparent;
}
.post-row:hover::before {
  color: var(--fg);
}
.date {
  grid-column: 2;
  color: var(--muted);
  font-size: 11px;
}
.post-content {
  grid-column: 3;
  min-width: 0;
}
.post-row h2,
.post-content h2 {
  max-width: 760px;
  font-size: 19px;
  line-height: 1.42;
  font-weight: 850;
}
.post-row h2 a,
.post-content h2 a,
.post-content p,
.post-meta,
.tags {
  overflow-wrap: anywhere;
}
.post-content p {
  max-width: 760px;
  margin-top: 7px;
  color: var(--muted);
}
.post-meta,
.tags {
  max-width: 760px;
  margin-top: 10px;
  color: var(--soft);
}
.post-meta a,
.tags a,
.post-meta span {
  border-bottom-color: transparent;
}

@media (max-width: 760px) {
  .top,
  main,
  .site-footer {
    width: calc(100vw - 28px);
  }
  .top {
    margin-top: 10px;
    padding: 9px 0 10px;
  }
  .logo {
    width: 100%;
  }
  .nav {
    gap: 7px 10px;
  }
  .home-hero {
    display: block;
    padding: 24px 0 14px;
  }
  .home-hero h1 {
    margin-top: 12px;
    font-size: 18px;
  }
  .home-hero h1::before {
    display: block;
    margin-bottom: 3px;
  }
  .hero-stats span {
    min-height: 24px;
    margin-right: 10px;
    padding-right: 10px;
  }
  .index-head {
    margin-top: 12px;
  }
  .post-row {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 8px 12px;
    padding: 18px 0 21px;
  }
  .post-row::before {
    grid-column: 1;
    grid-row: 1 / span 2;
  }
  .date {
    grid-column: 2;
    grid-row: 1;
  }
  .post-content {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
  }
  .post-row h2,
  .post-content h2 {
    font-size: 18px;
  }
}

/* v16.19: pull back from the harsh ledger look into a calmer reading site */
:root {
  --bg: #faf9f6;
  --surface: #ffffff;
  --surface-soft: #f2f0eb;
  --fg: #171717;
  --muted: #60646b;
  --soft: #92969d;
  --line: #e3e0d8;
  --line-strong: #cac4b8;
  --accent: #365f57;
  --accent-soft: #edf4f1;
  --mark: var(--accent);
  --page: 1080px;
  --home: 880px;
}

html.theme-dark {
  --bg: #111210;
  --surface: #181916;
  --surface-soft: #20211d;
  --fg: #f0eee9;
  --muted: #b5b2aa;
  --soft: #85827a;
  --line: #303129;
  --line-strong: #4b4a41;
  --accent: #c0ddd2;
  --accent-soft: #1c2925;
}

body {
  background: var(--bg);
}

.top,
main,
.site-footer {
  width: min(var(--page), calc(100vw - 56px));
}

.top {
  margin-top: 0;
  min-height: 66px;
  padding: 0;
  align-items: center;
  border-top: 0;
  border-bottom: 1px solid var(--line);
}
.logo {
  width: auto;
  padding-top: 0;
  gap: 0;
  color: var(--fg);
  font-size: 16px;
  letter-spacing: .01em;
}
.logo span::after {
  content: "";
  margin-left: 0;
}
.logo em {
  color: var(--soft);
  font-weight: 650;
}
.nav {
  max-width: none;
  gap: 15px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.4;
}
.nav a,
.theme-btn,
.lang-toggle a {
  color: var(--muted);
}
.theme-btn {
  border-radius: 0;
}

main {
  padding-bottom: 84px;
}

.home-hero {
  max-width: var(--home);
  display: block;
  margin: 0 auto;
  padding: 58px 0 38px;
  border-bottom: 1px solid var(--line);
}
.home-kicker {
  padding-top: 0;
  color: var(--soft);
  font-size: 11px;
  letter-spacing: .16em;
}
.home-kicker::after {
  display: none;
}
.home-hero h1 {
  max-width: 720px;
  margin: 13px 0 0;
  color: var(--fg);
  font-family: var(--serif);
  font-size: 42px;
  line-height: 1.12;
  font-weight: 560;
  letter-spacing: 0;
  text-transform: none;
}
.home-hero h1::before {
  content: "";
}
.home-hero p {
  max-width: 690px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.9;
}
.hero-stats {
  max-width: none;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--soft);
}
.hero-stats span {
  min-height: 0;
  margin-right: 0;
  padding: 0;
  border-right: 0;
}
.hero-stats b {
  color: var(--fg);
  font-size: 13px;
}

.index-head {
  width: min(var(--home), 100%);
  max-width: var(--home);
  margin: 28px auto 12px;
  padding: 0;
  align-items: flex-end;
  border-top: 0;
  border-bottom: 0;
}
.index-head span {
  color: var(--soft);
  font-size: 11px;
}
.index-head h2 {
  margin-top: 5px;
  color: var(--fg);
  font-family: var(--sans);
  font-size: 22px;
  line-height: 1.25;
  font-weight: 720;
}
.index-head a {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
  border-bottom-color: var(--line-strong);
}

.post-list {
  max-width: var(--home);
  margin: 0 auto;
  border-top: 1px solid var(--line-strong);
  counter-reset: none;
}
.post-row {
  counter-increment: none;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 30px;
  padding: 27px 0;
  border-bottom: 1px solid var(--line);
}
.post-row::before {
  display: none;
  content: "";
}
.date {
  grid-column: 1;
  padding-top: 4px;
  color: var(--soft);
  font-size: 12px;
  letter-spacing: .04em;
}
.post-content {
  grid-column: 2;
  min-width: 0;
}
.post-row h2,
.post-content h2 {
  max-width: 720px;
  color: var(--fg);
  font-family: var(--sans);
  font-size: 21px;
  line-height: 1.38;
  font-weight: 760;
}
.post-content p {
  max-width: 700px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.82;
}
.post-meta,
.tags {
  max-width: 700px;
  gap: 8px 12px;
  margin-top: 11px;
  color: var(--soft);
  font-family: var(--mono);
  font-size: 12px;
}
.post-row h2 a,
.post-content h2 a,
.post-content p,
.post-meta,
.tags {
  overflow-wrap: break-word;
}

@media (max-width: 760px) {
  .top,
  main,
  .site-footer {
    width: calc(100vw - 32px);
  }
  .top {
    min-height: auto;
    margin-top: 0;
    padding: 18px 0 14px;
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
  }
  .logo {
    width: auto;
  }
  .nav {
    justify-content: flex-start;
    gap: 10px 13px;
  }
  .home-hero {
    padding: 44px 0 30px;
  }
  .home-hero h1 {
    margin-top: 12px;
    font-size: 34px;
    line-height: 1.14;
  }
  .home-hero h1::before {
    display: none;
  }
  .home-hero p {
    margin-top: 17px;
    font-size: 15px;
  }
  .hero-stats {
    gap: 12px;
    margin-top: 22px;
    padding-top: 14px;
  }
  .hero-stats span {
    min-height: 0;
    margin-right: 0;
    padding-right: 0;
  }
  .index-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
    margin-top: 26px;
  }
  .post-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 24px 0;
  }
  .date,
  .post-content {
    grid-column: 1;
    grid-row: auto;
  }
  .date {
    padding-top: 0;
  }
  .post-row h2,
  .post-content h2 {
    font-size: 20px;
    line-height: 1.42;
  }
}

/* v16.21: larger, calmer typography for the archive + lab direction */
body {
  font-size: 16.5px;
}

.top {
  min-height: 64px;
}
.logo {
  font-size: 16px;
}
.nav,
.theme-btn,
.lang-toggle a {
  font-size: 13px;
}

.home-hero {
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 16px 56px;
  padding: 44px 0 38px;
}
.home-kicker {
  font-size: 12px;
}
.home-hero h1 {
  font-size: 40px;
  line-height: 1.12;
}
.home-hero h1::before {
  font-size: 17px;
}
.home-hero p {
  max-width: 820px;
  font-size: 16.5px;
  line-height: 1.85;
}
.hero-stats span {
  min-height: 62px;
  padding: 13px 15px;
  font-size: 13px;
}
.hero-stats b {
  font-size: 20px;
}

.index-head {
  margin-top: 28px;
  padding-bottom: 14px;
}
.index-head span {
  font-size: 12px;
}
.index-head h2 {
  font-size: 26px;
}
.index-head a {
  font-size: 13.5px;
}

.post-row {
  grid-template-columns: 126px minmax(0, 1fr);
  gap: 26px;
  padding: 24px 0;
}
.date {
  font-size: 12.5px;
}
.post-content {
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 10px 32px;
}
.post-row h2,
.post-content h2 {
  font-size: 22px;
  line-height: 1.38;
}
.post-content p {
  font-size: 15.5px;
  line-height: 1.82;
}
.post-meta,
.tags {
  font-size: 12.5px;
  line-height: 1.72;
}

@media (max-width: 900px) {
  .home-hero {
    grid-template-columns: 1fr;
  }
  .post-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 16px;
  }
  .top {
    min-height: auto;
  }
  .nav,
  .theme-btn,
  .lang-toggle a {
    font-size: 13px;
  }
  .home-hero {
    padding: 34px 0 28px;
  }
  .home-kicker {
    font-size: 12px;
  }
  .home-hero h1 {
    font-size: 34px;
  }
  .home-hero h1::before {
    font-size: 14px;
  }
  .home-hero p {
    font-size: 16px;
    line-height: 1.82;
  }
  .hero-stats span {
    min-height: 52px;
    font-size: 13px;
  }
  .index-head h2 {
    font-size: 24px;
  }
  .post-row {
    padding: 25px 0;
  }
  .date {
    font-size: 12.5px;
  }
  .post-row h2,
  .post-content h2 {
    font-size: 22px;
    line-height: 1.38;
  }
  .post-content p {
    font-size: 15.5px;
  }
  .post-meta,
  .tags {
    font-size: 12.5px;
  }
}

/* v16.22: fix the visual scale; less spread-out, stronger reading weight */
:root {
  --page: 1080px;
  --home: 960px;
}

body {
  font-size: 17px;
}

.top,
main,
.site-footer {
  width: min(var(--page), calc(100vw - 64px));
}

.home-hero {
  max-width: var(--home);
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px 44px;
  padding: 42px 0 34px;
}
.home-hero h1 {
  font-size: 46px;
  line-height: 1.08;
}
.home-hero h1::before {
  font-size: 18px;
}
.home-hero p {
  max-width: 760px;
  font-size: 17.5px;
  line-height: 1.8;
}
.hero-stats span {
  min-height: 64px;
  padding: 14px 16px;
  font-size: 14px;
}
.hero-stats b {
  font-size: 23px;
}

.index-head,
.post-list {
  width: min(var(--home), 100%);
  max-width: var(--home);
}
.index-head h2 {
  font-size: 28px;
}

.post-row {
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 28px;
  padding: 26px 0;
}
.date {
  font-size: 13px;
}
.post-content {
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 11px 26px;
}
.post-row h2,
.post-content h2 {
  font-size: 24px;
  line-height: 1.34;
}
.post-content p {
  font-size: 16.5px;
  line-height: 1.78;
}
.post-meta,
.tags {
  font-size: 13px;
  line-height: 1.75;
}

@media (max-width: 1100px) {
  .post-content {
    grid-template-columns: 1fr;
  }
  .post-meta,
  .tags {
    grid-column: 1;
    grid-row: auto;
    justify-content: flex-start;
    text-align: left;
  }
}

@media (max-width: 760px) {
  .top,
  main,
  .site-footer {
    width: calc(100vw - 30px);
  }
  body {
    font-size: 16.5px;
  }
  .home-hero h1 {
    font-size: 38px;
  }
  .home-hero h1::before {
    font-size: 15px;
  }
  .home-hero p {
    font-size: 16.5px;
  }
  .index-head h2 {
    font-size: 26px;
  }
  .post-row h2,
  .post-content h2 {
    font-size: 23px;
  }
  .post-content p {
    font-size: 16px;
  }
}

/* v16.20: archive + lab fusion, aligned with the existing language/theme shell */
:root {
  --bg: #f7fafb;
  --surface: #ffffff;
  --surface-soft: #eef4f4;
  --fg: #101820;
  --muted: #4e5d68;
  --soft: #87949f;
  --line: #dce5e9;
  --line-strong: #aebdc5;
  --accent: #16615c;
  --accent-soft: #e6f2ef;
  --mark: #3157a4;
  --code: #edf3f5;
  --page: 1160px;
  --home: 1040px;
}

html.theme-dark {
  --bg: #0c1113;
  --surface: #121a1d;
  --surface-soft: #172327;
  --fg: #edf5f3;
  --muted: #a9b8b6;
  --soft: #667a7a;
  --line: #213237;
  --line-strong: #385057;
  --accent: #66d6bd;
  --accent-soft: #142a26;
  --mark: #d8c06a;
  --code: #151f22;
}

body {
  background:
    linear-gradient(90deg, rgba(22,97,92,.035) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(180deg, rgba(49,87,164,.045), transparent 260px),
    var(--bg);
}
html.theme-dark body {
  background:
    linear-gradient(90deg, rgba(102,214,189,.045) 1px, transparent 1px) 0 0 / 54px 54px,
    linear-gradient(180deg, rgba(102,214,189,.055), transparent 320px),
    var(--bg);
}

.top,
main,
.site-footer {
  width: min(var(--page), calc(100vw - 56px));
}

.top {
  min-height: 58px;
  margin-top: 18px;
  padding: 0 0 12px;
  align-items: center;
  border-bottom: 1px solid var(--line-strong);
}
.logo {
  width: auto;
  color: var(--fg);
  font-size: 16px;
  letter-spacing: .01em;
}
.logo em {
  color: var(--accent);
  font-weight: 760;
}
.nav {
  gap: 12px 15px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}
.nav a,
.theme-btn,
.lang-toggle a {
  color: var(--muted);
}
.nav a:hover,
.theme-btn:hover,
.lang-toggle a:hover {
  color: var(--fg);
}
.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.lang-toggle a {
  min-width: auto;
  min-height: auto;
  padding: 0 7px;
  border-radius: 0;
  font-size: 12px;
}
.lang-toggle a + a {
  border-left: 1px solid var(--line-strong);
}
.lang-toggle a.is-active,
html.theme-dark .lang-toggle a.is-active {
  color: var(--fg);
  background: transparent;
  box-shadow: none;
}
.theme-btn {
  width: auto;
  min-height: auto;
  padding: 0 0 1px;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.4;
}

main {
  padding-bottom: 82px;
}

.home-hero {
  max-width: var(--home);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  grid-template-areas:
    "kicker stats"
    "title stats"
    "desc stats";
  grid-template-rows: auto auto auto;
  align-items: start;
  gap: 12px 52px;
  margin: 0 auto;
  padding: 36px 0 30px;
  border-bottom: 1px solid var(--line-strong);
}
.home-kicker {
  grid-area: kicker;
  grid-column: 1;
  padding-top: 0;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.home-kicker::after {
  display: none;
}
.home-hero h1 {
  grid-area: title;
  grid-column: 1;
  max-width: 720px;
  margin: 0;
  color: var(--fg);
  font-family: var(--sans);
  font-size: 34px;
  line-height: 1.12;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: none;
}
.home-hero h1::before {
  content: "LAB / ";
  color: var(--mark);
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .08em;
}
.home-hero p {
  grid-area: desc;
  grid-column: 1;
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.85;
}
.hero-stats {
  grid-area: stats;
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: start;
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--muted);
}
.hero-stats span {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0;
  padding: 11px 13px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 74%, transparent);
  font-family: var(--mono);
  font-size: 12px;
}
.hero-stats b {
  color: var(--fg);
  font-size: 17px;
  font-weight: 850;
}

.index-head {
  width: min(var(--home), 100%);
  max-width: var(--home);
  margin: 24px auto 0;
  padding: 0 0 12px;
  align-items: flex-end;
  border-bottom: 2px solid var(--line-strong);
}
.index-head span {
  color: var(--soft);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.index-head h2 {
  margin-top: 5px;
  color: var(--fg);
  font-family: var(--sans);
  font-size: 22px;
  line-height: 1.25;
  font-weight: 850;
}
.index-head a {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  border-bottom-color: var(--line-strong);
}

.post-list {
  max-width: var(--home);
  margin: 0 auto;
  border-top: 0;
}
.post-row {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 22px;
  padding: 19px 0;
  border-bottom: 1px solid var(--line);
  counter-increment: none;
}
.post-row::before {
  display: none;
}
.post-row:hover {
  background: transparent;
}
.date {
  grid-column: 1;
  padding-top: 2px;
  color: var(--soft);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.65;
  letter-spacing: .06em;
}
.post-content {
  grid-column: 2;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 8px 28px;
}
.post-row h2,
.post-content h2 {
  grid-column: 1;
  max-width: 760px;
  margin: 0;
  color: var(--fg);
  font-family: var(--sans);
  font-size: 19px;
  line-height: 1.4;
  font-weight: 820;
  letter-spacing: 0;
}
.post-row h2 a,
.post-content h2 a {
  border-bottom-color: transparent;
  overflow-wrap: anywhere;
}
.post-row h2 a:hover,
.post-content h2 a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.post-content p {
  grid-column: 1;
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}
.post-meta,
.tags {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-content: start;
  justify-content: flex-end;
  gap: 7px 10px;
  max-width: none;
  margin-top: 2px;
  color: var(--soft);
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.65;
  text-align: right;
}
.post-meta a,
.tags a,
.post-meta span {
  color: var(--soft);
  border-bottom-color: transparent;
}
.post-meta a:hover,
.tags a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

html.theme-dark .hero-stats span,
html.theme-dark .settings-check-grid .inline-check,
html.theme-dark .forenkey-binding {
  background: color-mix(in srgb, var(--surface) 78%, transparent);
}
html.theme-dark .post-row h2 a:hover,
html.theme-dark .post-content h2 a:hover,
html.theme-dark .post-meta a:hover,
html.theme-dark .tags a:hover {
  color: var(--accent);
}

@media (max-width: 900px) {
  .home-hero {
    grid-template-columns: 1fr;
    grid-template-areas:
      "kicker"
      "title"
      "desc"
      "stats";
    gap: 16px;
  }
  .hero-stats {
    grid-column: 1;
    grid-row: auto;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .post-content {
    grid-template-columns: 1fr;
  }
  .post-meta,
  .tags {
    grid-column: 1;
    grid-row: auto;
    justify-content: flex-start;
    text-align: left;
  }
}

@media (max-width: 760px) {
  .top,
  main,
  .site-footer {
    width: calc(100vw - 32px);
  }
  .top {
    min-height: auto;
    margin-top: 12px;
    padding-bottom: 13px;
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
  .logo {
    width: auto;
  }
  .nav {
    justify-content: flex-start;
    gap: 9px 12px;
  }
  .home-hero {
    padding: 30px 0 24px;
  }
  .home-hero h1 {
    font-size: 28px;
    line-height: 1.16;
  }
  .home-hero h1::before {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
  }
  .home-hero p {
    font-size: 14.5px;
  }
  .hero-stats {
    grid-template-columns: 1fr;
  }
  .hero-stats span {
    min-height: 44px;
  }
  .index-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
    margin-top: 22px;
  }
  .post-row {
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 22px 0;
  }
  .date,
  .post-content {
    grid-column: 1;
    grid-row: auto;
  }
  .date {
    padding-top: 0;
  }
  .post-row h2,
  .post-content h2 {
    font-size: 19px;
    line-height: 1.42;
  }
}

/* v16.23: final visual scale override, must stay at file end */
:root {
  --page: 1080px;
  --home: 960px;
}
body { font-size: 17px; }
.top,
main,
.site-footer {
  width: min(var(--page), calc(100vw - 64px));
}
.top { min-height: 64px; }
.logo { font-size: 12px; }
.nav,
.theme-btn,
.lang-toggle a { font-size: 13px; }
.home-hero {
  max-width: var(--home);
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px 44px;
  padding: 42px 0 34px;
}
.home-hero h1 {
  font-size: 46px;
  line-height: 1.08;
}
.home-hero h1::before { font-size: 18px; }
.home-hero p {
  max-width: 760px;
  font-size: 17.5px;
  line-height: 1.8;
}
.hero-stats span {
  min-height: 64px;
  padding: 14px 16px;
  font-size: 14px;
}
.hero-stats b { font-size: 23px; }
.index-head,
.post-list {
  width: min(var(--home), 100%);
  max-width: var(--home);
}
.index-head h2 { font-size: 28px; }
.post-row {
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 28px;
  padding: 26px 0;
}
.date { font-size: 13px; }
.post-content {
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 11px 26px;
}
.post-row h2,
.post-content h2 {
  font-size: 24px;
  line-height: 1.34;
}
.post-content p {
  font-size: 16.5px;
  line-height: 1.78;
}
.post-meta,
.tags {
  font-size: 13px;
  line-height: 1.75;
}
@media (max-width: 1100px) {
  .post-content { grid-template-columns: 1fr; }
  .post-meta,
  .tags {
    grid-column: 1;
    grid-row: auto;
    justify-content: flex-start;
    text-align: left;
  }
}
@media (max-width: 760px) {
  .top,
  main,
  .site-footer { width: calc(100vw - 30px); }
  body { font-size: 16.5px; }
  .home-hero {
    grid-template-columns: 1fr;
    grid-template-areas:
      "kicker"
      "title"
      "desc"
      "stats";
  }
  .home-kicker,
  .home-hero h1,
  .home-hero p,
  .hero-stats {
    grid-column: 1;
  }
  .hero-stats {
    grid-template-columns: 1fr;
  }
  .home-hero h1 { font-size: 38px; }
  .home-hero h1::before { font-size: 15px; }
  .home-hero p { font-size: 16.5px; }
  .index-head h2 { font-size: 26px; }
  .post-row h2,
  .post-content h2 { font-size: 23px; }
  .post-content p { font-size: 16px; }
}

/* v16.24: remove right rail, unify switches, keep this block last */
.top {
  gap: 22px;
}
.nav {
  align-items: center;
  gap: 10px;
}
.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--bg);
}
.lang-toggle a,
.theme-btn {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1;
}
.lang-toggle a + a {
  border-left: 0;
}
.lang-toggle a.is-active,
html.theme-dark .lang-toggle a.is-active,
.theme-btn {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--fg);
  box-shadow: none;
}
.theme-btn {
  margin-left: 0;
}
.theme-btn:hover,
.lang-toggle a:hover {
  border-color: var(--fg);
  color: var(--fg);
}
html.theme-dark .lang-toggle,
html.theme-dark .theme-btn,
html.theme-dark .lang-toggle a.is-active {
  border-color: var(--line-strong);
  background: var(--surface);
}

.home-hero {
  grid-template-columns: 1fr;
  grid-template-areas:
    "title"
    "desc";
  gap: 16px;
  padding-top: 46px;
}
.home-hero h1,
.home-hero p {
  grid-column: 1;
}
.home-hero h1::before {
  content: none;
}
.home-kicker {
  display: none;
}
.hero-stats {
  display: none;
}

.post-content {
  grid-template-columns: 1fr;
  gap: 10px;
}
.post-content h2,
.post-content p,
.post-meta,
.tags {
  grid-column: 1;
  grid-row: auto;
}
.post-meta,
.tags {
  justify-content: flex-start;
  max-width: 760px;
  margin-top: 2px;
  text-align: left;
}
.post-meta a,
.tags a,
.post-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
}
.article-related {
  display: none;
}

@media (max-width: 760px) {
  .top {
    gap: 12px;
  }
  .nav {
    gap: 8px;
  }
  .lang-toggle a,
  .theme-btn {
    min-height: 32px;
    padding: 0 10px;
    font-size: 13px;
  }
  .home-hero {
    padding-top: 34px;
  }
}

/* v16.25: individual switch buttons and scoped kicker hiding */
.home-kicker {
  display: block;
}
.home-hero .home-kicker {
  display: none;
}
.lang-toggle {
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
}
.lang-toggle a,
.theme-btn,
.lang-toggle a.is-active,
html.theme-dark .lang-toggle a.is-active {
  min-width: 42px;
  min-height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface);
  color: var(--fg);
}
.lang-toggle a:not(.is-active),
html.theme-dark .lang-toggle a:not(.is-active) {
  background: transparent;
  color: var(--muted);
}
.theme-btn {
  min-width: 42px;
  background: var(--surface);
}

/* v16.26: stronger lab/commercial admin console */
.admin-console-nav,
.admin-panel {
  width: min(1060px, 100%);
}
.admin-console-nav {
  margin: 28px auto 26px;
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-top: 4px solid var(--fg);
  border-radius: 6px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 92%, transparent), var(--bg));
  box-shadow: 0 18px 48px rgba(28, 35, 40, .08);
}
.admin-console-head,
.admin-section-head,
.admin-login-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}
.admin-console-head strong {
  display: block;
  margin-top: 4px;
  color: var(--fg);
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: .01em;
}
.admin-console-head p,
.admin-section-head p,
.admin-login-hero p {
  max-width: 680px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}
.admin-status-strip,
.login-security-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-width: 420px;
}
.admin-status-strip span,
.login-security-cards span,
.admin-metric-grid article,
.admin-command-grid a,
.admin-auth-card,
.dongle-login,
.forenkey-import-card,
.forenkey-policy-card,
.forenkey-binding {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: 0 14px 34px rgba(28, 35, 40, .055);
}
.admin-status-strip span,
.login-security-cards span {
  min-height: 62px;
  padding: 11px 12px;
  color: var(--fg);
  font-family: var(--mono);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-status-strip b,
.login-security-cards b,
.admin-metric-grid span,
.admin-command-grid span,
.binding-grid b {
  display: block;
  margin-bottom: 6px;
  color: var(--soft);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.2;
  text-transform: uppercase;
}
.admin-status-strip .is-good,
.login-security-cards .is-good,
.admin-metric-grid .is-good {
  border-color: color-mix(in srgb, var(--success) 42%, var(--line));
  background: color-mix(in srgb, var(--success) 8%, var(--surface));
}
.admin-status-strip .is-muted,
.login-security-cards .is-muted {
  color: var(--muted);
}
.admin-links {
  width: 100%;
  margin: 18px 0 0;
  gap: 8px;
}
.admin-links a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 12px;
}
.admin-links a.is-active {
  border-color: var(--fg);
  background: var(--fg);
  color: var(--bg);
}

.admin-panel {
  margin: 0 auto;
}
.admin-panel.narrow {
  width: min(820px, calc(100vw - 64px));
}
.admin-login-console {
  padding-top: 30px;
}
.admin-section-head {
  margin-bottom: 18px;
}
.admin-section-head.compact {
  align-items: flex-end;
  margin-top: 26px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-strong);
}
.admin-section-head h2 {
  margin: 4px 0 0;
  color: var(--fg);
  font-size: 24px;
  line-height: 1.2;
}
.admin-primary-link {
  width: auto;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font-weight: 760;
}
.admin-primary-link:hover {
  color: #fff;
  filter: brightness(.94);
}
.admin-metric-grid,
.admin-command-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}
.admin-metric-grid article {
  min-height: 116px;
  padding: 16px;
}
.admin-metric-grid strong {
  display: block;
  color: var(--fg);
  font-size: 34px;
  line-height: 1;
  font-weight: 880;
}
.admin-metric-grid em,
.admin-command-grid em {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
  line-height: 1.45;
}
.admin-metric-grid .is-warn {
  border-color: #d7b46a;
  background: color-mix(in srgb, #d7b46a 10%, var(--surface));
}
.admin-metric-grid .is-danger,
.binding-badges .is-danger {
  border-color: color-mix(in srgb, var(--danger) 44%, var(--line));
  background: color-mix(in srgb, var(--danger) 9%, var(--surface));
}
.admin-command-grid a {
  min-height: 112px;
  display: block;
  padding: 16px;
  color: var(--fg);
  border-bottom: 1px solid var(--line);
}
.admin-command-grid a:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.admin-command-grid b {
  display: block;
  font-size: 18px;
  line-height: 1.25;
}

.admin-login-hero {
  margin-bottom: 18px;
  padding: 22px;
  border: 1px solid var(--line-strong);
  border-top: 4px solid var(--fg);
  border-radius: 6px;
  background: var(--surface);
}
.admin-login-grid {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 14px;
}
.admin-auth-card,
.dongle-login,
.forenkey-import-card,
.forenkey-policy-card {
  padding: 18px;
}
.auth-card-head {
  margin-bottom: 16px;
}
.auth-card-head span {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
}
.auth-card-head strong {
  display: block;
  margin-top: 5px;
  color: var(--fg);
  font-size: 20px;
  line-height: 1.25;
}
.form label,
.dongle-login label {
  color: var(--fg);
  font-size: 14px;
  font-weight: 660;
}
input,
textarea,
select {
  min-height: 44px;
  border-radius: 5px;
  background: var(--bg);
}
.form button,
.dongle-login button,
.save-article-btn {
  min-height: 44px;
  border-radius: 5px;
}
.dongle-login.is-disabled {
  align-content: start;
}
.dongle-login.is-disabled .hint {
  margin: 0;
}
.dongle-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}
.dongle-steps span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}
.dongle-steps span.is-running {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}
.dongle-steps span.is-ok,
.binding-badges .is-good {
  border-color: color-mix(in srgb, var(--success) 48%, var(--line));
  color: var(--success);
  background: color-mix(in srgb, var(--success) 9%, var(--surface));
}
.dongle-steps span.is-error {
  border-color: var(--danger);
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 8%, var(--surface));
}
.dongle-log {
  min-height: 124px;
  max-height: 220px;
  border-radius: 5px;
}

.forenkey-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
  gap: 14px;
  margin: 18px 0;
}
.forenkey-policy-card ol {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}
.forenkey-policy-card li + li {
  margin-top: 8px;
}
.forenkey-policy-card p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  word-break: break-all;
}
.forenkey-binding-list {
  gap: 14px;
}
.forenkey-binding {
  padding: 16px;
}
.binding-main {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}
.binding-main strong {
  display: block;
  color: var(--fg);
  font-size: 19px;
  line-height: 1.25;
}
.binding-main span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}
.binding-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}
.binding-badges span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}
.status-pill {
  background: var(--bg);
  color: var(--fg) !important;
}
.binding-grid {
  display: grid !important;
  grid-template-columns: minmax(160px, .7fr) minmax(180px, .9fr) minmax(0, 1.25fr) minmax(220px, 1fr);
  gap: 10px;
  margin-top: 14px;
}
.binding-grid span {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--fg);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.forenkey-binding-actions {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.forenkey-binding-actions button {
  min-height: 34px;
  border-radius: 4px;
}

html.theme-dark .admin-console-nav,
html.theme-dark .admin-login-hero,
html.theme-dark .admin-status-strip span,
html.theme-dark .login-security-cards span,
html.theme-dark .admin-metric-grid article,
html.theme-dark .admin-command-grid a,
html.theme-dark .admin-auth-card,
html.theme-dark .dongle-login,
html.theme-dark .forenkey-import-card,
html.theme-dark .forenkey-policy-card,
html.theme-dark .forenkey-binding {
  box-shadow: none;
}

@media (max-width: 980px) {
  .admin-console-nav,
  .admin-panel,
  .admin-panel.narrow {
    width: calc(100vw - 32px);
  }
  .admin-console-head,
  .admin-section-head,
  .admin-login-hero {
    display: grid;
  }
  .admin-status-strip,
  .login-security-cards,
  .admin-metric-grid,
  .admin-command-grid,
  .admin-login-grid,
  .forenkey-workbench,
  .binding-grid {
    grid-template-columns: 1fr;
    min-width: 0;
  }
  .dongle-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .binding-main {
    display: grid;
  }
  .binding-badges {
    justify-content: flex-start;
  }
}

/* v16.27: mobile nav collapse, unify lang/theme toggles with nav links, fix mobile post-row squeeze */
.nav-toggle {
  display: none;
  flex-shrink: 0;
  margin-left: auto;
  padding: 7px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  margin: 5px 0;
  background: currentColor;
  border-radius: 1px;
}
.nav-toggle:hover {
  background: var(--surface-soft);
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .04em;
}
.lang-switch a {
  border: 0;
  padding: 0;
  color: var(--muted);
  transition: color .15s ease;
}
.lang-switch a:hover { color: var(--fg); }
.lang-switch a.is-active {
  color: var(--fg);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}
.lang-switch .lang-sep {
  color: var(--soft);
  opacity: .55;
  user-select: none;
}

.theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  font: inherit;
  line-height: 1;
  transition: background .15s ease, border-color .15s ease, transform var(--press) var(--ease-out);
}
.theme-btn:hover { background: var(--surface-soft); border-color: var(--line-strong); }
.theme-btn .theme-ico { display: inline-flex; align-items: center; justify-content: center; }
.theme-btn .theme-ico::before { content: "\263E"; font-size: 15px; line-height: 1; }
html.theme-dark .theme-btn .theme-ico::before { content: "\2600"; }

/* Desktop: panel groups nav + tools as one right-aligned cluster */
.nav-panel {
  display: inline-flex;
  align-items: center;
  gap: 24px;
}
.nav-tools {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
}
.nav-tools .lang-switch { padding: 0 8px; }
.nav-tools .theme-btn {
  width: 30px;
  height: 30px;
  border: 0;
  background: transparent;
}

@media (max-width: 760px) {
  .top {
    position: sticky;
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
  }
  .logo {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 15px;
  }
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    margin-left: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--fg);
  }
  .nav-toggle:hover {
    background: var(--surface-soft);
  }
  .nav-toggle span {
    width: 20px;
    height: 2px;
    margin: 4px 0;
  }
  .nav-panel {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 100;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 14px 40px rgba(0, 0, 0, .14);
  }
  .nav-panel.is-open {
    display: flex;
  }
  .nav-panel .nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 0 0 auto;
  }
  .nav a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border: 0;
    border-radius: 10px;
    font-size: 15px;
    color: var(--fg);
  }
  .nav a:hover,
  .nav a:focus-visible {
    background: var(--accent-soft);
    color: var(--fg);
  }
  .nav a.is-current {
    font-weight: 600;
    background: var(--accent-soft);
    color: var(--fg);
  }
  .nav-panel .nav-tools {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 6px;
    padding: 12px 8px 6px;
    border-top: 1px solid var(--line);
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    border-radius: 0;
    background: transparent;
  }
  .nav-panel .nav-tools .lang-switch {
    font-size: 14px;
  }
  .nav-panel .nav-tools .theme-btn {
    width: 34px;
    height: 34px;
    border: 0;
    background: transparent;
  }
  .nav-toggle span {
    transition: transform .2s var(--ease-out), opacity .15s ease;
  }
  .nav-toggle.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .nav-toggle.is-open span:nth-child(2) { opacity: 0; }
  .nav-toggle.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

  .post-row,
  .academic-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .post-row .date,
  .academic-row .date {
    padding-top: 0;
  }
}

/* (v17 redesign block removed: reverted to original non-glass header; language/theme toggles restyled under v16.27 above) */

/* ===== Smoothness: cross-document page transitions + scrolling (v18) ===== */
html { scroll-behavior: smooth; }

/* Chrome 126+: smooth cross-fade between full-page navigations, removes the blank flash */
@view-transition { navigation: auto; }
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 240ms;
  animation-timing-function: cubic-bezier(.4, 0, .2, 1);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  ::view-transition-old(root),
  ::view-transition-new(root) { animation: none; }
}

/* ===== Motion: tasteful micro-interactions (v19, per design-eng principles) ===== */

/* 1) Press feedback — subtle scale on every pressable element (Feedback, high-freq but near-imperceptible) */
.top a,
.top button,
.post-row,
.academic-row,
.post-card,
.btn,
button {
  transition: transform var(--press) var(--ease-out);
}
.top a:active,
.top button:active,
.post-row:active,
.academic-row:active,
.post-card:active,
.btn:active,
button:active {
  transform: scale(0.97);
}

/* 2) Hover lift on cards — gated to real pointers only */
@media (hover: hover) and (pointer: fine) {
  .post-card {
    transition: transform 200ms var(--ease-out), box-shadow 200ms var(--ease-out), border-color 200ms var(--ease-out);
  }
  .post-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(20, 28, 40, .10);
    border-color: var(--line-strong);
  }
  html.theme-dark .post-card:hover {
    box-shadow: 0 10px 28px rgba(0, 0, 0, .45);
  }
}

/* 3) Group entrance — staggered rise-in for list items (Group entrance, occasional views) */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}
.reveal-item {
  opacity: 0;
}
.reveal-item.is-in {
  animation: rise-in 260ms var(--ease-out) both;
  animation-delay: var(--reveal-delay, 0ms);
}

/* Reduced motion: keep entrances but drop transform/scale, shorten to opacity only */
@media (prefers-reduced-motion: reduce) {
  .top a,
  .top button,
  .post-row,
  .academic-row,
  .post-card,
  .btn,
  button {
    transition: none;
  }
  .top a:active,
  .top button:active,
  .post-row:active,
  .academic-row:active,
  .post-card:active,
  .btn:active,
  button:active {
    transform: none;
  }
  .reveal-item { opacity: 1; }
  .reveal-item.is-in { animation: none; }
}

/* ===== Mobile post-row hover: replace ghost shadow with clean padded background ===== */
@media (max-width: 760px) {
  .post-list {
    padding: 0 16px;
  }
  .post-row,
  .academic-row {
    position: relative;
    padding: 20px 0;
  }
  .post-row::after,
  .academic-row::after {
    content: "";
    position: absolute;
    inset: -8px -16px;
    border-radius: 12px;
    background: var(--surface-soft);
    opacity: 0;
    z-index: -1;
    transition: opacity 200ms var(--ease-out);
    pointer-events: none;
  }
  .post-row:hover::after,
  .academic-row:hover::after,
  .post-row:focus-within::after,
  .academic-row:focus-within::after {
    opacity: 1;
  }
}

/* v-fix: the sticky header must not draw its own top border line, which
   duplicates the read-progress bar at the very top of the viewport. */
.top {
  border-top: 0;
}

/* v20: give the brand mark a real presence in the header (overrides the
   small per-theme logo sizes). */
.top .logo {
  font-size: 15px;
  letter-spacing: .12em;
}
.top .nav a.is-current {
  border-bottom-color: var(--fg);
  color: var(--fg);
}

/* v16.18: article/media reliability */
.markdown-body .md-align-center { text-align: center; }
.markdown-body .md-align-right { text-align: right; }
.markdown-body .md-align-left { text-align: left; }
.footnotes { margin-top: 42px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.footnotes hr { margin-bottom: 18px; }
.footnotes ol { padding-left: 1.5em; }
.footnotes li + li { margin-top: 9px; }
.footnote-ref { margin-left: .08em; font-size: .72em; line-height: 0; vertical-align: super; }
.footnote-ref a,
.footnote-backref { text-decoration: none; }
.footnote-backref { margin-left: .3em; color: var(--soft); }
.article-pdf-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 18px;
  border: 1px solid var(--line-strong);
  background: var(--surface-soft);
}
.article-pdf-link strong { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; }
.article-pdf-link a { font-size: 13px; }
@media (max-width: 760px) {
  .article-pdf-link { align-items: flex-start; flex-direction: column; gap: 8px; }
}

/* v3 admin refinement — keeps the site's existing typography variables intact. */
.admin-login-shell {
  width: min(520px, calc(100vw - 40px));
  margin: 9vh auto 12vh;
}
.admin-login-brand {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 0 14px;
  padding: 0 2px;
}
.admin-login-brand span {
  color: var(--soft);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.admin-login-brand strong {
  color: var(--fg);
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .01em;
}
.admin-login-card {
  padding: 28px;
  border: 1px solid var(--line-strong);
  border-top: 3px solid var(--fg);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(28,35,40,.08);
}
.admin-login-card .auth-card-head { margin-bottom: 22px; }
.admin-login-card .auth-card-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}
.admin-login-card label + label { margin-top: 14px; }
.admin-login-submit { width: 100%; margin-top: 18px; }
.admin-login-error { margin: 0 0 16px; }
.admin-login-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.admin-login-foot a,
.admin-alt-login { border-bottom-color: transparent; }
.admin-login-foot a:hover,
.admin-alt-login:hover { border-bottom-color: currentColor; }
.forenkey-login-card { width: min(620px, 100%); }
.forenkey-login-card .dongle-login {
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}
.admin-alt-login {
  display: inline-block;
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
}
.admin-links-primary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}
.admin-links-spacer { flex: 1 1 auto; }
.admin-more-menu { position: relative; }
.admin-more-menu > summary {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
  list-style: none;
}
.admin-more-menu > summary::-webkit-details-marker { display: none; }
.admin-more-menu[open] > summary,
.admin-more-menu > summary:hover { color: var(--fg); border-color: var(--fg); }
.admin-more-links {
  position: absolute;
  z-index: 90;
  top: calc(100% + 7px);
  left: 0;
  width: 190px;
  padding: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  box-shadow: 0 16px 40px rgba(28,35,40,.12);
}
.admin-more-links a {
  width: 100%;
  min-height: 34px;
  border: 0;
  background: transparent;
}
.admin-more-links a.is-active,
.admin-more-links a:hover {
  background: var(--surface-soft);
  color: var(--fg);
}
.project-detail-head { margin-bottom: 32px; }
.project-external-link { margin-top: 20px !important; }
.project-markdown { max-width: 760px; }
html.theme-dark .admin-login-card,
html.theme-dark .admin-more-links { box-shadow: none; }
@media (max-width: 760px) {
  .admin-login-shell { width: calc(100vw - 28px); margin-top: 36px; }
  .admin-login-card { padding: 22px; }
  .admin-links-spacer { display: none; }
  .admin-more-links { position: fixed; left: 14px; right: 14px; top: auto; width: auto; }
}
