/* Shared stylesheet for mcmodule.org and mckuhei.mcmodule.org.
   One file, no build step, no external fonts. Light and dark follow the system setting. */

:root {
  color-scheme: light dark;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef0f3;
  --text: #15181c;
  --muted: #5a6572;
  --border: #e1e5ea;
  --border-strong: #cdd3da;
  --accent: #0b7a53;
  --accent-hover: #086143;
  --on-accent: #ffffff;
  --warn-bg: #fff6dd;
  --warn-border: #e3bd55;
  --info-bg: #e9f2fe;
  --info-border: #8fb8f0;
  --ok-bg: #e7f5ed;
  --ok-border: #9bd2b4;
  --shadow-sm: 0 1px 2px rgba(16, 24, 32, .05);
  --shadow: 0 1px 2px rgba(16, 24, 32, .06), 0 10px 28px rgba(16, 24, 32, .08);
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans",
          "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0f12;
    --surface: #15181d;
    --surface-2: #1d2128;
    --text: #e8ebef;
    --muted: #9aa5b1;
    --border: #262b33;
    --border-strong: #39404a;
    --accent: #42d392;
    --accent-hover: #74e2af;
    --on-accent: #06281a;
    --warn-bg: #2a2209;
    --warn-border: #7a6117;
    --info-bg: #0f2038;
    --info-border: #2a5290;
    --ok-bg: #0f2519;
    --ok-border: #236443;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 10px 28px rgba(0, 0, 0, .4);
  }
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--font);
}

main { flex: 1; }
img { max-width: 100%; height: auto; }

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { color: var(--accent-hover); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -.01em; }

code, kbd, pre { font-family: var(--mono); font-size: .9em; }
code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .08em .4em;
  overflow-wrap: anywhere;
}

.wrap {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px;
}
.wrap.narrow { max-width: 820px; }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 16px;
  min-height: 60px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font: 600 1.05rem/1 var(--mono);
  letter-spacing: -.02em;
  text-decoration: none;
}
.brand:hover { color: var(--text); }
.brand svg { width: 20px; height: 20px; flex: none; color: var(--accent); }
.brand-sub, .brand-tld { color: var(--muted); font-weight: 400; }

.site-nav { display: flex; flex-wrap: wrap; gap: 2px; margin: 0 -10px; }
.site-nav a {
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: .95rem;
  text-decoration: none;
}
.site-nav a:hover { color: var(--text); background: var(--surface-2); }
.site-nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); font-weight: 600; }

/* ---------- hero ---------- */

.hero { padding: 72px 0 36px; }
.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font: 500 .85rem/1.4 var(--mono);
  letter-spacing: .02em;
}
.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(2.1rem, 6vw, 3.25rem);
  letter-spacing: -.035em;
}
.lead {
  max-width: 44rem;
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 1.15rem;
}

.link-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }

.pill, .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: 500 .95rem/1.5 var(--font);
  text-decoration: none;
  cursor: pointer;
}
.pill:hover, .btn:hover { border-color: var(--accent); color: var(--accent); }
.pill.primary, .btn.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}
.pill.primary:hover, .btn.primary:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
  color: var(--on-accent);
}

/* ---------- sections and cards ---------- */

.section { padding: 28px 0; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 16px;
}
.section-title { margin: 0; font-size: 1.35rem; }
.section-title .count { color: var(--muted); font-weight: 400; }
.section-note { margin: -8px 0 16px; color: var(--muted); }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  color: inherit;
  text-decoration: none;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  color: inherit;
  transform: translateY(-2px);
}
.card h3 { margin: 0; font-size: 1.1rem; }
.card p { flex: 1; margin: 0; color: var(--muted); font-size: .95rem; }
.card-meta { color: var(--muted); font: 500 .8rem/1.4 var(--mono); overflow-wrap: anywhere; }
.card-go { margin-top: 6px; color: var(--accent); font-size: .9rem; font-weight: 600; }

/* two short sections side by side (stacked on narrow screens) */
.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0 16px;
}
.split .section { display: flex; flex-direction: column; }
.split .card { flex: 1; }

/* project list: one row per project, title + one line, destination on the right */
.plist {
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  list-style: none;
}
.plist li + li { border-top: 1px solid var(--border); }
.plist a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 24px;
  padding: 16px 20px;
  color: inherit;
  text-decoration: none;
}
.plist a:hover { background: var(--surface-2); color: inherit; }
.plist h3 { margin: 0; font-size: 1.02rem; overflow-wrap: anywhere; }
.plist p { grid-column: 1; margin: 0; color: var(--muted); font-size: .93rem; }
.plist .where {
  grid-column: 2;
  grid-row: 1 / span 2;
  color: var(--muted);
  font: 500 .82rem/1.4 var(--mono);
  white-space: nowrap;
}
.plist a:hover .where { color: var(--accent); }

/* ---------- article pages ---------- */

.page-head { padding: 44px 0 4px; }
.page-head h1 {
  margin: 0 0 12px;
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  letter-spacing: -.03em;
}
.page-head .lead { margin-bottom: 0; }

.breadcrumb { margin: 0 0 14px; color: var(--muted); font-size: .9rem; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }

.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; padding: 0; list-style: none; }
.toc a {
  display: inline-block;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: .88rem;
  text-decoration: none;
}
.toc a:hover { border-color: var(--accent); color: var(--accent); }

.prose h2 {
  margin: 2.75rem 0 1rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
  font-size: 1.5rem;
}
.prose h3 { margin: 2rem 0 .75rem; font-size: 1.15rem; }
.prose h4 {
  margin: 1.75rem 0 .6rem;
  color: var(--muted);
  font-size: .85rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.prose p, .prose ul, .prose ol { margin: 0 0 1rem; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin-bottom: .45rem; }
.prose li > .lcd, .prose li > .callout { margin-top: .75rem; }
.prose ul.tiles { padding-left: 0; }
.page-head + .prose > h2:first-child { margin-top: 1.5rem; }
.prose section[lang] + section[lang] { margin-top: 2.75rem; padding-top: 1.75rem; border-top: 1px solid var(--border); }

.callout {
  margin: 1rem 0;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: 10px;
  background: var(--surface);
}
.callout > :first-child { margin-top: 0; }
.callout > :last-child { margin-bottom: 0; }
.callout.warning { border-color: var(--warn-border); background: var(--warn-bg); }
.callout.info { border-color: var(--info-border); background: var(--info-bg); }

.download {
  margin: 1rem 0;
  padding: 18px 20px;
  border: 1px solid var(--ok-border);
  border-radius: var(--radius);
  background: var(--ok-bg);
}
.download.compact { padding: 12px 16px; }
.dl-link { font-size: 1.1rem; font-weight: 700; }
.dl-meta { display: block; margin-top: 6px; color: var(--muted); font-size: .88rem; }
.download .dl-date { margin: 12px 0 0; font-size: .92rem; }
.unavailable { color: var(--muted); }

.changelog {
  margin: 1rem 0;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.changelog h3 { margin: 0 0 .6rem; }
.changelog ul { margin: 0; }

.tag {
  display: inline-block;
  margin-right: 6px;
  padding: 0 8px;
  border-radius: 999px;
  color: #fff;
  font: 700 .72rem/1.7 var(--mono);
  letter-spacing: .04em;
  vertical-align: 1px;
}
.tag-new { background: #1f8f4e; }
.tag-fix { background: #2470d6; }
.tag-change { background: #c2620a; }

/* The Sound Canvas display: fixed colours on purpose, it imitates the real LCD. */
.lcd {
  display: block;
  width: max-content;
  max-width: 100%;
  margin: 10px 0;
  padding: 12px 16px;
  overflow-x: auto;
  border: 2px solid #55504a;
  border-radius: 6px;
  background: #fc8600;
  color: #4d4843;
  font: 600 .9rem/1.5 var(--mono);
  white-space: pre;
}

kbd, .key {
  display: inline-block;
  padding: 0 6px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--surface-2);
  font: 600 .82rem/1.6 var(--mono);
  white-space: nowrap;
}

.faq h3 { margin: 1.5rem 0 .4rem; font-size: 1.05rem; }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}
.tiles li { margin: 0; }
.tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}
.tile::after { content: "\2192"; color: var(--muted); }
.tile:hover { border-color: var(--accent); color: var(--accent); }
.tile:hover::after { color: var(--accent); }

.figure { margin: 0 0 1.25rem; }
.figure img { display: block; border: 1px solid var(--border); border-radius: var(--radius); }

/* ---------- comments ---------- */

.comments { margin-top: 44px; padding-top: 32px; border-top: 1px solid var(--border); }

.visitor { color: var(--muted); font-size: .9rem; }
.visitor b {
  margin: 0 2px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--text);
  color: var(--bg);
  font: 700 .85rem/1.5 var(--mono);
}

.comment-list { display: grid; gap: 14px; margin: 0 0 36px; }
.comment {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.comment .avatar {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface-2);
}
.comment .avatar img { display: block; width: 44px; height: 44px; border-radius: 50%; }
.comment .avatar img[hidden] { display: none; }
.comment-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: .88rem;
}
.comment-head .c-title { flex-basis: 100%; color: var(--text); font-size: 1rem; font-weight: 700; overflow-wrap: anywhere; }
.comment-head .c-name { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.comment-head .c-id { font-family: var(--mono); text-decoration: none; }
.comment-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.comment:target { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.comment.removed { border-style: dashed; color: var(--muted); font-style: italic; }

/* replies: one level of indentation under the comment they belong to */
.thread { display: grid; gap: 10px; }
.replies {
  display: grid;
  gap: 10px;
  margin-left: 22px;
  padding-left: 18px;
  border-left: 2px solid var(--border);
}
.comment.reply { grid-template-columns: 32px minmax(0, 1fr); gap: 12px; padding: 12px 14px; }
.comment.reply .avatar, .comment.reply .avatar img { width: 32px; height: 32px; }
.comment-head .reply-to { color: var(--muted); text-decoration: none; }
.comment-head .reply-to:hover { color: var(--accent); }
.comment-actions { margin-top: 8px; font-size: .86rem; }
.reply-link { color: var(--muted); font-weight: 600; text-decoration: none; }
.reply-link:hover { color: var(--accent); }

/* a comment written in Markdown */
.comment-text.md { white-space: normal; }
.comment-text.md > :first-child { margin-top: 0; }
.comment-text.md > :last-child { margin-bottom: 0; }
.comment-text.md p,
.comment-text.md ul,
.comment-text.md ol,
.comment-text.md blockquote,
.comment-text.md pre,
.comment-text.md table { margin: 0 0 .7em; }
.comment-text.md h4, .comment-text.md h5, .comment-text.md h6 { margin: 1em 0 .4em; }
.comment-text.md h4 { font-size: 1.08rem; }
.comment-text.md h5 { font-size: 1rem; }
.comment-text.md h6 { font-size: .92rem; color: var(--muted); }
.comment-text.md ul, .comment-text.md ol { padding-left: 1.4rem; }
.comment-text.md li { margin-bottom: .2em; }
.comment-text.md blockquote {
  padding: 2px 0 2px 12px;
  border-left: 3px solid var(--border-strong);
  color: var(--muted);
}
.comment-text.md pre {
  padding: 10px 12px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}
.comment-text.md pre code { padding: 0; border: 0; background: none; overflow-wrap: normal; white-space: pre; }
.comment-text.md hr { margin: 1em 0; border: 0; border-top: 1px solid var(--border); }
.comment-text.md table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.comment-text.md th, .comment-text.md td { padding: 4px 10px; border: 1px solid var(--border); }

.notice {
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .92rem;
}
.notice.error { border-color: var(--warn-border); background: var(--warn-bg); }

.check { display: flex; align-items: baseline; gap: 10px; font-size: .9rem; font-weight: 600; cursor: pointer; }
.check input { flex: none; margin: 0; accent-color: var(--accent); transform: translateY(2px); }
.check .opt { color: var(--muted); font-weight: 400; }

.replying {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--info-border);
  border-radius: 8px;
  background: var(--info-bg);
  font-size: .92rem;
  overflow-wrap: anywhere;
}

.empty {
  margin: 0 0 36px;
  padding: 20px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.comment-form {
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.comment-form h3 { margin: 0; font-size: 1.15rem; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); align-items: end; gap: 16px; }
.field { display: grid; gap: 6px; font-size: .9rem; font-weight: 600; }
.field .opt { color: var(--muted); font-weight: 400; }
.field input, .field textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.5 var(--font);
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field textarea:focus {
  border-color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 0;
}
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.h-captcha:empty { display: none; }
[hidden] { display: none !important; }

/* ---------- blog ---------- */

.blog-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; padding-bottom: 20px; }
.blog-head h1 { margin: 0; }
.blog-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin: 0; color: var(--muted); font-size: .9rem; }
.blog-tools a { color: var(--muted); }
.blog-tools a:hover { color: var(--accent); }
.lang-switch { display: inline-flex; gap: 10px; }
.lang-switch [aria-current] { color: var(--text); font-weight: 600; }
.post-foot { justify-content: space-between; margin-top: 36px; }

.post-card {
  display: block;
  margin-bottom: 16px;
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.post-card h2 { margin: 0 0 6px; font-size: 1.3rem; }
.post-card h2 a { color: var(--text); text-decoration: none; }
.post-card h2 a:hover { color: var(--accent); }
.post-summary { margin: 10px 0 12px; color: var(--muted); overflow-wrap: anywhere; }
.post-card .card-go { margin: 0; text-decoration: none; }

.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; color: var(--muted); font-size: .9rem; }
.post-meta .views::before { content: "\00B7"; margin-right: 10px; }
.tag-link {
  display: inline-block;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.7;
  text-decoration: none;
}
a.tag-link:hover { border-color: var(--accent); color: var(--accent); }
.tag-link .count { opacity: .7; }
.tag-cloud { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--border); }
.tag-cloud p { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }

.post .page-head h1 { overflow-wrap: anywhere; }
.post-body { margin-top: 28px; font-size: 1.04rem; line-height: 1.8; overflow-wrap: anywhere; }
.post-body > :first-child { margin-top: 0; }
.post-body h2 { margin-top: 2.4rem; padding-top: 0; border-top: 0; font-size: 1.45rem; }
.post-body h3 { font-size: 1.2rem; }
.post-body h4 { color: var(--text); font-size: 1.05rem; letter-spacing: 0; text-transform: none; }
.post-body img { display: block; max-width: 100%; height: auto; margin: 1.2rem auto; border-radius: 8px; }
.post-body blockquote {
  margin: 1rem 0;
  padding: 4px 0 4px 16px;
  border-left: 3px solid var(--border-strong);
  color: var(--muted);
}
.post-body pre {
  margin: 1rem 0;
  padding: 14px 16px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  line-height: 1.55;
}
.post-body pre code { padding: 0; border: 0; background: none; overflow-wrap: normal; white-space: pre; }
.post-body hr { margin: 2rem 0; border: 0; border-top: 1px solid var(--border); }
.post-body table { display: block; max-width: 100%; margin: 1rem 0; overflow-x: auto; border-collapse: collapse; }
.post-body th, .post-body td { padding: 6px 12px; border: 1px solid var(--border); }
.post-body th { background: var(--surface-2); }

/* ---------- comment manager ---------- */

.notice.ok { border-color: var(--ok-border); background: var(--ok-bg); }
.btn.small { padding: 4px 14px; font-size: .88rem; }
.btn.danger, .linkish.danger { color: #c0392b; }
.btn.danger:hover { border-color: #c0392b; color: #c0392b; }
.linkish {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: 600 .86rem/1.5 var(--font);
  cursor: pointer;
}
.linkish:hover { color: var(--accent); text-decoration: underline; }
.linkish.danger:hover { color: #c0392b; }
.linkish + .linkish { margin-left: 16px; }

.admin-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-bottom: 14px; }
.admin-head h1 { margin: 0; }
.admin-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.admin-tools form { margin: 0; }
.admin-tools .btn { text-decoration: none; }
.admin-tools .btn[aria-current] { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.admin-bar .btn { text-decoration: none; }
.admin-bar + .admin-list, .admin-bar + .empty { margin-top: 10px; }
a.linkish { text-decoration: none; }
.admin-post { grid-template-columns: minmax(0, 1fr); padding: 14px 16px; }
.admin-post .c-title { flex-basis: auto; text-decoration: none; }
.admin-post .c-title:hover { color: var(--accent); }
.admin-post .comment-text { color: var(--muted); font-size: .93rem; }
.editor textarea[name="body"] { min-height: 460px; font: 400 .92rem/1.6 var(--mono); }
.editor .form-actions .btn { text-decoration: none; }
.login-form { max-width: 420px; margin-top: 16px; }

.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin: 20px 0 16px; }
.filters .field { min-width: 150px; }
.filters .field.grow { flex: 1; min-width: 220px; }
.field select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.5 var(--font);
}

.admin-list { display: grid; gap: 10px; }
.admin-bar {
  position: sticky;
  top: 61px;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.admin-count { margin-left: auto; color: var(--muted); font-size: .88rem; }
.admin-item { grid-template-columns: 24px minmax(0, 1fr); padding: 14px 16px; }
.admin-item.is-hidden { border-style: dashed; background: var(--surface-2); }
.admin-item.is-hidden .comment-text { color: var(--muted); }
.admin-pick { padding-top: 3px; cursor: pointer; }
.admin-pick input, #check-all { accent-color: var(--accent); }
.badge {
  padding: 0 8px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--muted);
  font: 600 .72rem/1.7 var(--mono);
}
.badge.warn { border-color: var(--warn-border); background: var(--warn-bg); color: var(--text); }

.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 24px 0; color: var(--muted); font-size: .9rem; }

/* ---------- footer ---------- */

.site-footer {
  margin-top: 64px;
  padding: 24px 0 36px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .9rem;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }

/* ---------- small screens, motion ---------- */

@media (max-width: 560px) {
  .hero { padding: 44px 0 24px; }
  .page-head { padding-top: 28px; }
  .lead { font-size: 1.05rem; }
  .brand-sub { display: none; }
  .plist a { grid-template-columns: minmax(0, 1fr); padding: 14px 16px; }
  .plist .where { grid-column: 1; grid-row: auto; margin-top: 4px; }
  .comment { grid-template-columns: 36px minmax(0, 1fr); gap: 12px; padding: 14px; }
  .comment .avatar, .comment .avatar img { width: 36px; height: 36px; }
  .replies { margin-left: 6px; padding-left: 10px; }
  .comment.reply { grid-template-columns: 28px minmax(0, 1fr); gap: 10px; padding: 10px 12px; }
  .comment.reply .avatar, .comment.reply .avatar img { width: 28px; height: 28px; }
  .comment-form { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card { transition: none; }
  .card:hover { transform: none; }
}
