/*
Theme Name: DataScience+
Theme URI: https://datascienceplus.com
Description: Fresh, in-house theme for DataScience+ — an Apple-inspired, light/dark, community tutorial site. Built from scratch (replaces the retired m01 theme). No third-party framework or plugin dependencies.
Author: DataSciencePlus
Version: 0.1.0
Requires at least: 6.0
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: dsplus
*/

/* ============================================================
   Design tokens
   ============================================================ */
:root {
  --bg: #FFFFFF;
  --panel: #F5F5F7;
  --panel-2: #FBFBFD;
  --ink: #1D1D1F;
  --ink-soft: #515154;
  --muted: #86868B;
  --hair: #D2D2D7;
  --blue: #0066CC;
  --blue-ink: #0066CC;
  --field: #FFFFFF;
  --seg-track: #E8E8ED;
  --shadow: 0 1px 3px rgba(0,0,0,.04), 0 6px 20px rgba(0,0,0,.05);
  --seg-shadow: 0 1px 3px rgba(0,0,0,.12), 0 1px 1px rgba(0,0,0,.06);
  --nav-bg: rgba(255,255,255,.72);
  --warm: #C2620C;

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --maxw: 1080px;
  /* Fine-print type scale — secondary/muted text. Use these instead of
     hardcoding 12.5/13.5 for small text.
       --fs-note  : running prose that wraps to >1 line (notes, hints, footnotes, excerpts)
       --fs-meta  : single-line meta / dates / labels
       --fs-micro : tiny labels, kickers, pills */
  --fs-note: 13.5px;
  --fs-meta: 13px;
  --fs-micro: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000; --panel: #1D1D1F; --panel-2: #161617; --ink: #F5F5F7;
    --ink-soft: #C7C7CC; --muted: #86868B; --hair: #38383A; --blue: #2997FF;
    --blue-ink: #2997FF; --field: #1C1C1E; --seg-track: #1D1D1F;
    --shadow: 0 1px 3px rgba(0,0,0,.4), 0 6px 24px rgba(0,0,0,.5);
    --seg-shadow: 0 1px 3px rgba(0,0,0,.5); --nav-bg: rgba(0,0,0,.7);
    --warm: #FFB340;
  }
}
:root[data-theme="light"] {
  --bg:#FFFFFF; --panel:#F5F5F7; --panel-2:#FBFBFD; --ink:#1D1D1F; --ink-soft:#515154;
  --muted:#86868B; --hair:#D2D2D7; --blue:#0066CC; --blue-ink:#0066CC; --field:#FFFFFF;
  --seg-track:#E8E8ED; --seg-shadow:0 1px 3px rgba(0,0,0,.12),0 1px 1px rgba(0,0,0,.06);
  --shadow:0 1px 3px rgba(0,0,0,.04),0 6px 20px rgba(0,0,0,.05); --nav-bg:rgba(255,255,255,.72);
  --warm:#C2620C;
}
:root[data-theme="dark"] {
  --bg:#000000; --panel:#1D1D1F; --panel-2:#161617; --ink:#F5F5F7; --ink-soft:#C7C7CC;
  --muted:#86868B; --hair:#38383A; --blue:#2997FF; --blue-ink:#2997FF; --field:#1C1C1E;
  --seg-track:#1D1D1F; --seg-shadow:0 1px 3px rgba(0,0,0,.5);
  --shadow:0 1px 3px rgba(0,0,0,.4),0 6px 24px rgba(0,0,0,.5); --nav-bg:rgba(0,0,0,.7);
  --warm:#FFB340;
}

/* ============================================================
   Base
   ============================================================ */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--ink); font-family: var(--sans);
  font-size: 17px; line-height: 1.5; letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.site-main { flex: 1 0 auto; }

/* Accessibility */
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus {
  left: 12px; top: 12px; z-index: 100; background: var(--bg); color: var(--ink);
  padding: 10px 16px; border: 1px solid var(--hair); border-radius: 10px;
}
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ============================================================
   Nav
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 20; background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hair);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 22px;
  height: 52px; display: flex; align-items: center; gap: 26px;
}
.brand { font-size: 23px; font-weight: 400; letter-spacing: -0.02em; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand b { color: var(--muted); font-weight: 700; }
@media (prefers-color-scheme: dark) { .brand b { color: #B0B0B5; } }
:root[data-theme="light"] .brand b { color: var(--muted); }
:root[data-theme="dark"] .brand b { color: #B0B0B5; }
.nav-left { flex: 1; display: flex; align-items: center; gap: 12px; }
.nav-sep { color: var(--hair); font-size: 20px; font-weight: 300; line-height: 1; }
.nav .acct { display: flex; gap: 16px; align-items: center; }
.nav .acct a { color: var(--ink-soft); font-size: 13.5px; font-weight: 400; }
.nav .acct a:hover { color: var(--ink); text-decoration: none; }
.nav-actions { flex: 1; display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.navsearch {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px;
  min-width: 168px; background: var(--bg); border: 1px solid var(--hair);
  border-radius: 980px; color: var(--muted); font-family: var(--sans);
  font-size: 13.5px; margin: 0;
}
.navsearch:hover { border-color: var(--muted); }
.navsearch:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 16%, transparent); }
.navsearch .ic { flex: 0 0 auto; color: var(--muted); display: block; }
.navsearch input {
  border: 0; background: transparent; outline: none; padding: 0; margin: 0;
  font-family: var(--sans); font-size: 13.5px; color: var(--ink); width: 100%; min-width: 0;
}
.navsearch input::placeholder { color: var(--muted); }
/* hide the native search "x" clear button for a cleaner look */
.navsearch input::-webkit-search-decoration,
.navsearch input::-webkit-search-cancel-button { -webkit-appearance: none; }
.navicon {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--hair);
  background: transparent; color: var(--ink-soft); display: inline-flex;
  align-items: center; justify-content: center; cursor: pointer; font-size: 19px;
  line-height: 1; padding: 0;
}
.navicon:hover { border-color: var(--muted); color: var(--ink); }
@media (max-width: 560px) {
  .navsearch { min-width: 0; width: 130px; }
}

/* ============================================================
   Hero + stats
   ============================================================ */
.hero { text-align: center; padding: 76px 22px 64px; }
.hero h1 {
  font-size: 52px; line-height: 1.06; font-weight: 600; letter-spacing: -0.025em;
  margin: 0 auto 18px; max-width: 16ch; text-wrap: balance;
}
.hero p { font-size: 20px; color: var(--ink-soft); max-width: 46ch; margin: 0 auto; line-height: 1.45; }
@media (max-width: 540px) { .hero h1 { font-size: 40px; } }

.stats {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 0; max-width: 600px;
  margin: 38px auto 0; border: 1px solid var(--hair); border-radius: 16px;
  overflow: hidden; background: var(--panel);
}
.stat { flex: 1 1 0; min-width: 120px; padding: 18px 16px; text-align: center; }
.stat + .stat { border-left: 1px solid var(--hair); }
.stat .num { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); line-height: 1; font-variant-numeric: tabular-nums; }
.stat .lbl { font-size: 12px; color: var(--muted); margin-top: 7px; }

/* Warm invitation to register & write, below the stats. */
.join-cta { margin: 17px auto 0 !important; max-width: 500px !important; font-size: 15px !important; letter-spacing: -0.01em; line-height: 1.5; color: var(--warm); }
.join-cta a { color: var(--warm); font-weight: 600; }
.join-cta a:hover { color: var(--warm); text-decoration: underline; }

/* ============================================================
   Browse band: segmented control, chips, section label, cards
   ============================================================ */
.browse { flex: 1 0 auto; background: var(--panel); border-top: 1px solid var(--hair); padding: 44px 0 60px; }
#browse { scroll-margin-top: 58px; transition: opacity .15s ease; } /* opacity: brief fade during in-place switch */

.seg-wrap { display: flex; justify-content: center; margin-bottom: 30px; }
.segmented { display: inline-flex; gap: 5px; width: 340px; background: var(--seg-track); border: 1px solid var(--hair); border-radius: 980px; padding: 5px; }
.segmented a {
  flex: 1 1 50%; text-align: center; font-size: 15px; font-weight: 600; color: var(--ink-soft);
  padding: 13px 0; border-radius: 980px; letter-spacing: -0.01em; transition: color .15s ease;
}
.segmented a:hover { text-decoration: none; }
.segmented a.on { background: var(--ink); color: var(--bg); font-weight: 700; box-shadow: var(--seg-shadow); }

.filters { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; margin: 0 auto 34px; }
.chip {
  font-size: 13.5px; font-weight: 500; color: var(--ink-soft); background: var(--bg);
  border: 1px solid var(--hair); padding: 8px 16px; border-radius: 980px;
  display: inline-flex; gap: 7px; align-items: center;
}
.chip:hover { border-color: var(--muted); text-decoration: none; }
.chip .c { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chip.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.chip.on .c { color: #d6e6fb; }

.seclabel { display: flex; align-items: baseline; gap: 12px; margin: 8px 0 20px; }
.seclabel h2 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin: 0; }
.seclabel span { font-size: 13px; color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding-bottom: 30px; }
@media (max-width: 820px) { .grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 540px) { .grid { grid-template-columns: 1fr; } }
.card {
  background: var(--bg); border: 1px solid var(--hair); border-radius: 18px;
  padding: 22px 22px 20px; display: flex; flex-direction: column; min-height: 172px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: transparent; }
.card .kick { font-size: 12px; font-weight: 600; color: var(--blue-ink); margin-bottom: 12px; display: flex; justify-content: space-between; }
.card .kick a { color: var(--blue-ink); }
.card .kick .yr { color: var(--muted); font-weight: 400; }
.card h3 { font-size: 20px; line-height: 1.24; font-weight: 600; letter-spacing: -0.015em; margin: 0 0 auto; color: var(--ink); text-wrap: balance; }
.card h3 a { color: var(--ink); }
.card h3 a:hover { color: var(--blue-ink); text-decoration: none; }
.card .who { display: flex; align-items: center; gap: 9px; margin-top: 18px; }
.card .lang { margin-left: auto; font-size: 11.5px; color: var(--muted); letter-spacing: 0.02em; }
.card .av {
  width: 24px; height: 24px; border-radius: 50%; background: var(--panel);
  border: 1px solid var(--hair); color: var(--ink-soft); font-size: 10px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.card .name { font-size: 13.5px; color: var(--ink-soft); font-weight: 500; }
.card .name a { color: var(--ink-soft); }

/* ============================================================
   Footer
   ============================================================ */
.site-footer { border-top: 1px solid var(--hair); background: var(--panel-2); }
.foot-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 40px 22px 34px;
  font-size: var(--fs-meta); color: var(--muted);
}
.foot-inner a { color: var(--muted); }
.foot-inner a:hover { color: var(--ink); text-decoration: none; }
.foot-top {
  display: flex; justify-content: space-between; flex-wrap: wrap;
  gap: 34px 60px; padding-bottom: 30px;
}
.foot-about { max-width: 340px; }
.foot-brand { font-size: 15px; font-weight: 400; color: var(--ink) !important; letter-spacing: -0.2px; }
.foot-brand b { font-weight: 700; }
.foot-about p { margin: 10px 0 0; line-height: 1.65; }
.foot-cols { display: flex; gap: 60px; flex-wrap: wrap; }
.foot-col { display: flex; flex-direction: column; gap: 9px; min-width: 120px; }
.foot-col h2 {
  margin: 0 0 3px; font-size: 12.5px; font-weight: 600; color: var(--ink);
  letter-spacing: 0; line-height: 1.4;
}
.foot-bottom { border-top: 1px solid var(--hair); padding-top: 16px; }
@media (max-width: 640px) {
  .foot-cols { gap: 34px 44px; }
}

/* ============================================================
   Pagination
   ============================================================ */
/* "Show more" button — a centered pill sitting on a divider line. */
.infinite-more { display: flex; align-items: center; gap: 20px; padding: 34px 0 6px; }
.infinite-more[hidden] { display: none; }
button.more-link { font-family: inherit; }
.infinite-more::before,
.infinite-more::after { content: ""; flex: 1 1 0; height: 1px; background: var(--hair); }
.more-link {
	flex: 0 0 auto; display: inline-flex; align-items: center; gap: 9px;
	font-size: 13.5px; font-weight: 500; color: var(--ink-soft);
	border: 1px solid var(--hair); background: var(--bg); border-radius: 980px;
	padding: 9px 22px; cursor: pointer;
}
.more-link:hover { border-color: var(--muted); color: var(--ink); text-decoration: none; }
.infinite-more.loading .more-link { pointer-events: none; }
.infinite-more.loading .more-link::after {
	content: ""; width: 14px; height: 14px;
	border: 2px solid var(--hair); border-top-color: var(--muted);
	border-radius: 50%; animation: dsp-spin .7s linear infinite;
}
@keyframes dsp-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .infinite-more.loading .more-link::after { animation: none; } }

/* "Page N" separator inserted between loaded batches (spans the whole grid). */
.grid > .page-divider {
	grid-column: 1 / -1; display: flex; align-items: center; gap: 16px;
	margin: 6px 0 2px; color: var(--muted);
	font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase;
}
.grid > .page-divider::before,
.grid > .page-divider::after { content: ""; flex: 1 1 0; height: 1px; background: var(--hair); }

.pagination { display: flex; justify-content: center; gap: 8px; padding: 10px 0 0; flex-wrap: wrap; }
.pagination .page-numbers {
  font-size: 14px; color: var(--ink-soft); border: 1px solid var(--hair); background: var(--bg);
  border-radius: 980px; padding: 8px 15px; min-width: 40px; text-align: center;
}
.pagination .page-numbers:hover { border-color: var(--muted); text-decoration: none; }
.pagination .page-numbers.current { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ============================================================
   Avatars: Gravatar photo layered over initials fallback
   ============================================================ */
.av, .c-av { position: relative; overflow: hidden; }
.av .grav, .c-av .grav {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; border-radius: inherit; display: block;
}

/* ============================================================
   Breadcrumb + centered page/archive header
   ============================================================ */
.breadcrumb {
  max-width: var(--maxw); margin: 0 auto; padding: 40px 22px 0;
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted);
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:last-child { color: var(--ink-soft); font-weight: 500; }
.breadcrumb a:hover { color: var(--ink); text-decoration: none; }
.breadcrumb .sep { opacity: .5; }

.head { text-align: center; padding: 40px 22px 40px; }
.head h1 { font-size: 44px; line-height: 1.06; font-weight: 600; letter-spacing: -0.025em; margin: 0 0 14px; text-wrap: balance; }
.head p { font-size: 20px; color: var(--ink-soft); max-width: 46ch; margin: 0 auto; line-height: 1.44; }
.head .searchbar { margin-top: 35px; }
@media (max-width: 460px) { .head h1 { font-size: 34px; } }

.browse-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 20px; }
.browse-head h2 { font-size: 15px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; margin: 0; }
.browse-head .count { font-size: 13px; color: var(--muted); font-family: var(--mono); }
.browse-head .grow { flex: 1; }

/* ============================================================
   Author profile header
   ============================================================ */
.prof { text-align: center; padding: 34px 22px 54px; }
.prof .av {
  width: 96px; height: 96px; border-radius: 50%; margin: 0 auto 20px;
  background: var(--panel); border: 1px solid var(--hair);
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; font-weight: 600; color: var(--ink-soft);
}
.prof h1 { font-size: 40px; line-height: 1.08; font-weight: 600; letter-spacing: -0.025em; margin: 0 0 14px; }
.prof .bio { font-size: 19px; line-height: 1.45; color: var(--ink-soft); max-width: 52ch; margin: 0 auto 10px; }
.prof .social { display: flex; gap: 18px; justify-content: center; margin-top: 16px; font-size: 13.5px; flex-wrap: wrap; }
.prof .social a { color: var(--blue-ink); }
.prof .stats { max-width: 520px; }
@media (max-width: 540px) { .prof h1 { font-size: 32px; } }

/* ============================================================
   Authors index grid
   ============================================================ */
.agrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 900px) { .agrid { grid-template-columns: repeat(3,1fr); } }
@media (max-width: 680px) { .agrid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 460px) { .agrid { grid-template-columns: 1fr; } }
.acard {
  background: var(--bg); border: 1px solid var(--hair); border-radius: 16px; padding: 20px 18px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 11px;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.acard:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: transparent; text-decoration: none; }
.acard .av {
  width: 56px; height: 56px; border-radius: 50%; background: var(--panel); border: 1px solid var(--hair);
  display: flex; align-items: center; justify-content: center; font-size: 19px; font-weight: 600; color: var(--ink-soft);
}
.acard .name { font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.25; }
.acard .count { font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* ============================================================
   Single article
   ============================================================ */
.shell {
  max-width: var(--maxw); margin: 0 auto; padding: 54px 22px 0;
  display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 48px; align-items: start;
}
.article { min-width: 0; }
.article .breadcrumb { max-width: none; margin: 0 0 20px; padding: 0; } /* flush-left, unlike the centered archive breadcrumb */
.postmeta { font-size: var(--fs-meta); color: var(--muted); margin: 0px 0 25px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.coi-note { margin: -6px 0 26px; padding: 10px 14px; background: var(--panel); border-radius: 10px; font-size: var(--fs-note); line-height: 1.5; color: var(--ink-soft); }
.coi-note b { font-weight: 600; }
.write-legal { margin: 26px 0 4px; }
.write-legal h3 { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 12px; }
.write-legal h3 .opt { font-weight: 400; font-size: 13px; color: var(--muted); }
.legal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: stretch; }
@media (max-width: 760px) { .legal-grid { grid-template-columns: 1fr; } }
.legal-box { background: var(--panel); border: 1px solid var(--hair); border-radius: 12px; padding: 16px 18px; }
.legal-box h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 600; margin: 0 0 12px; }
.legal-box .check { margin-bottom: 10px; }
.legal-note { margin: 6px 0 0; font-size: var(--fs-note); color: var(--muted); }
.share-row { display: inline-flex; align-items: center; gap: 14px; }
.share-row .share-lbl { font-size: 13px; margin-right: -4px; }
.s-ic { color: var(--muted); display: inline-flex; }
.s-ic:hover { color: var(--ink-soft); }

/* End-of-article share pills — category-chip shape, single ink tint. */
.share-end { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 30px 0 6px; }
.share-pill { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; padding: 8px 15px; border-radius: 980px; text-decoration: none; transition: background 0.15s ease; color: var(--ink); background: color-mix(in srgb, var(--ink) 8%, transparent); }
.share-pill:hover { background: color-mix(in srgb, var(--ink) 14%, transparent); }
.postmeta a { color: inherit; text-decoration: none; }
.postmeta a:hover { color: var(--ink-soft); }
.postmeta b { color: var(--ink-soft); font-weight: 600; font-variant-numeric: tabular-nums; }

.bio-more { margin-top: 22px; margin-bottom: 40px; }
.bio-more a {
  display: block; font-size: 14px; line-height: 1.35; color: var(--ink); font-weight: 500;
  padding: 11px 0; border-bottom: 1px solid var(--hair);
}
.bio-more a:first-of-type { border-top: 1px solid var(--hair); }
.bio-more a:hover { color: var(--blue-ink); text-decoration: none; }
.topline { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin: 0 0 22px; }
.topline .meta { font-size: 13px; color: var(--muted); }
.topline .meta b { color: var(--ink-soft); font-weight: 600; font-variant-numeric: tabular-nums; }
.article h1 { font-size: 42px; line-height: 1.1; font-weight: 600; letter-spacing: -0.025em; margin: 0 0 20px; text-wrap: balance; }
@media (max-width: 540px) { .article h1 { font-size: 32px; } }

.byline {
  display: flex; align-items: center; gap: 13px; padding: 18px 0;
  border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); margin-bottom: 8px;
}
.byline .av {
  width: 44px; height: 44px; border-radius: 50%; flex: 0 0 auto; background: var(--panel); border: 1px solid var(--hair);
  display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 600; color: var(--ink-soft);
}
.byline .who-name { font-size: 15px; font-weight: 600; }
.byline .who-name a { color: var(--ink); }
.byline .meta { font-size: var(--fs-meta); color: var(--muted); }
.byline .meta b { color: var(--ink-soft); font-weight: 600; font-variant-numeric: tabular-nums; }

/* article body (WordPress the_content output) */
.entry-content { padding: 30px 0 10px; border-top: 1px solid var(--hair); font-size: 18px; line-height: 1.62; }
.entry-content p { margin: 0 0 20px; color: var(--ink); }
/* Lead paragraph: enlarge the first paragraph of the article body */
.entry-content > p:first-of-type { font-size: 21px; line-height: 1.55; color: var(--ink); }
.entry-content h2 { font-size: 27px; font-weight: 600; letter-spacing: -0.018em; line-height: 1.2; margin: 44px 0 16px; padding-bottom: 12px; border-bottom: 1px solid var(--hair); text-wrap: balance; scroll-margin-top: 68px; }
/* When a ToC is present, number the article's headings 01, 02… to match it. */
.entry-content { counter-reset: dsp-h2; }
.entry-content .toc ~ h2 { counter-increment: dsp-h2; }
.entry-content .toc ~ h2::before {
  content: counter(dsp-h2, decimal-leading-zero);
  font-family: var(--mono); font-size: 1em; font-weight: 400; color: var(--muted);
  margin-right: 14px;
}

/* Posts with no <h2> (top-level sections are <h3>): promote those h3 to h2 look. */
.dsp-h3top .entry-content h3 {
  font-size: 27px; font-weight: 600; letter-spacing: -0.018em; line-height: 1.2;
  margin: 44px 0 16px; padding-bottom: 12px; border-bottom: 1px solid var(--hair);
  text-wrap: balance; scroll-margin-top: 68px;
}
.dsp-h3top .entry-content .toc ~ h3 { counter-increment: dsp-h2; }
.dsp-h3top .entry-content .toc ~ h3::before {
  content: counter(dsp-h2, decimal-leading-zero);
  font-family: var(--mono); font-size: 1em; font-weight: 400; color: var(--muted);
  margin-right: 14px;
}

/* Table of Contents — squared box, floated right, numbered vertical list, mono font */
.toc {
  float: right; width: 252px; margin: 5px 0 22px 30px;
  border: 1px solid var(--hair); background: var(--bg); padding: 16px 18px;
  font-family: var(--mono); font-size: 12.5px;
}
.toc-title {
  font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink); font-weight: 600; margin-bottom: 10px; padding-bottom: 10px;
  border-bottom: 1px solid var(--hair);
}
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; display: flex; flex-direction: column; }
.toc li { counter-increment: toc; }
.toc a { display: flex; gap: 10px; align-items: baseline; padding: 7px 0; color: var(--ink-soft); line-height: 1.4; }
.toc a::before { content: counter( toc, decimal-leading-zero ); color: var(--muted); font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.toc a:hover { color: var(--blue-ink); text-decoration: none; }
.entry-content::after { content: ""; display: block; clear: both; } /* contain the float */
@media (max-width: 620px) { .toc { float: none; width: auto; margin: 0 0 24px; } }
.entry-content h3 { font-size: 20px; font-weight: 600; letter-spacing: -0.012em; margin: 32px 0 12px; }
/* Post-content lists: bordered letter/number badge markers (skips the ToC list) */
.entry-content ul:not(.toc-list),
.entry-content ol:not(.toc-list) { margin: 0 0 22px; padding-left: 0; list-style: none; }
.entry-content ul:not(.toc-list) > li,
.entry-content ol:not(.toc-list) > li {
  position: relative; padding-left: 36px; margin-bottom: 12px; line-height: 1.6;
}
/* divider line under each item (table-row style) */
.entry-content ul:not(.toc-list) > li,
.entry-content ol:not(.toc-list) > li { padding: 0 0 0 34px; margin: 0 0 10px; }
/* plain letter/number marker in the gutter — same size as body text */
.entry-content ul:not(.toc-list) > li::before,
.entry-content ol:not(.toc-list) > li::before {
  position: absolute; left: 1px; top: 0;
  font-family: var(--mono); font-size: 1em; font-weight: 400; color: var(--muted);
}
/* unordered → letters a, b, c */
.entry-content ul:not(.toc-list) { counter-reset: dsp-abc; }
.entry-content ul:not(.toc-list) > li { counter-increment: dsp-abc; }
.entry-content ul:not(.toc-list) > li::before { content: counter(dsp-abc, lower-alpha) "."; }
/* ordered → numbers 1, 2, 3 */
.entry-content ol:not(.toc-list) { counter-reset: dsp-li; }
.entry-content ol:not(.toc-list) > li { counter-increment: dsp-li; }
.entry-content ol:not(.toc-list) > li::before { content: counter(dsp-li) "."; font-variant-numeric: tabular-nums; }
/* nested lists keep spacing tidy; second-level ul switches to dashes so the
   letters don't restart a. b. c. inside a lettered list */
.entry-content li > ul, .entry-content li > ol { margin: 10px 0 0; }
.entry-content li > ul:not(.toc-list) > li::before { content: "–"; }
.entry-content a { color: var(--blue-ink); }
/* Content images: centered on their own line, matted frame, click to zoom */
.entry-content img {
  display: block; max-width: 78%; height: auto; margin: 34px auto;
  box-sizing: border-box; padding: 10px; background: var(--panel);
  border: 1px solid var(--hair); border-radius: 12px; cursor: zoom-in;
}
@media (max-width: 600px) { .entry-content img { max-width: 100%; } }
.entry-content figure img { margin: 0 auto; }
.entry-content a img { cursor: zoom-in; }

/* Full-screen image lightbox */
.dsp-lightbox {
  position: fixed; inset: 0; z-index: 1000; padding: 24px;
  background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center;
  cursor: zoom-out; opacity: 0; visibility: hidden; transition: opacity .2s ease;
}
.dsp-lightbox.open { opacity: 1; visibility: visible; }
.dsp-lightbox img {
  max-width: 94vw; max-height: 94vh; width: auto; height: auto;
  margin: 0; padding: 0; background: transparent; border: 0; border-radius: 8px;
  box-shadow: 0 12px 48px rgba(0,0,0,.5); cursor: zoom-out;
}
.dsp-lightbox .dsp-lightbox-close {
  position: absolute; top: 18px; right: 22px; width: 40px; height: 40px;
  border: 0; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff;
  font-size: 22px; line-height: 1; cursor: pointer;
}
.dsp-lightbox .dsp-lightbox-close:hover { background: rgba(255,255,255,.22); }
@media (prefers-reduced-motion: reduce) { .dsp-lightbox { transition: none; } }
.entry-content blockquote {
  position: relative; margin: 34px 0; padding: 24px 28px 24px 30px;
  background: var(--panel); border: 1px solid var(--hair);
  border-radius: 14px; font-size: 20px; line-height: 1.5; font-weight: 500;
  letter-spacing: -0.012em; color: var(--ink); overflow: hidden;
}
/* oversized decorative quote mark in the corner */
.entry-content blockquote::before {
  content: "\201C"; position: absolute; right: 16px; top: 6px;
  font-size: 72px; line-height: 1; font-weight: 700; color: var(--blue);
  opacity: .12; pointer-events: none;
}
.entry-content blockquote > :first-child { margin-top: 0; }
.entry-content blockquote p { margin: 0 0 12px; font-size: inherit; line-height: inherit; color: inherit; }
.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-content blockquote cite,
.entry-content blockquote footer {
  display: block; margin-top: 14px; font-size: 14px; font-weight: 400; font-style: normal;
  letter-spacing: 0; color: var(--muted);
}
.entry-content blockquote cite::before,
.entry-content blockquote footer::before { content: "— "; }
/* Code blocks: <pre> is the code, <em> inside is the output */
.codeblock { position: relative; margin: 26px 0; }
.entry-content .codeblock pre { margin: 0; }
.entry-content pre {
  margin: 26px 0; background: var(--code-bg); border: 1px solid var(--hair);
  border-radius: 12px; padding: 16px 18px; overflow-x: auto;
  font-family: var(--mono); font-size: 14px; line-height: 1.6; color: var(--code-ink);
}
.entry-content pre code { font-family: inherit; font-size: inherit; line-height: inherit; color: inherit; background: none; padding: 0; white-space: pre; }
/* output block(s) inside code — distinct dimmer box, monospace, not italic */
.entry-content pre em {
  display: block; font-style: normal; font-family: var(--mono);
  background: var(--out-bg); color: var(--out-ink);
  margin: 13px -18px 13px; padding: 11px 18px;
}
.entry-content pre em:last-child { margin-bottom: -16px; border-radius: 0 0 12px 12px; }
/* inline code within prose */
.entry-content p code, .entry-content li code {
  font-family: var(--mono); font-size: 15px; background: var(--code-bg); padding: 2px 6px; border-radius: 5px; color: var(--code-ink);
}

/* Syntax highlighting tokens (highlight.js) tuned to the site palette */
:root { --hl-comment:#6E7781; --hl-keyword:#CF222E; --hl-string:#0A3069; --hl-number:#0550AE; --hl-func:#8250DF; --hl-builtin:#8250DF; }
@media (prefers-color-scheme: dark) { :root { --hl-comment:#8B949E; --hl-keyword:#FF7B72; --hl-string:#A5D6FF; --hl-number:#79C0FF; --hl-func:#D2A8FF; --hl-builtin:#D2A8FF; } }
:root[data-theme="light"] { --hl-comment:#6E7781; --hl-keyword:#CF222E; --hl-string:#0A3069; --hl-number:#0550AE; --hl-func:#8250DF; --hl-builtin:#8250DF; }
:root[data-theme="dark"] { --hl-comment:#8B949E; --hl-keyword:#FF7B72; --hl-string:#A5D6FF; --hl-number:#79C0FF; --hl-func:#D2A8FF; --hl-builtin:#D2A8FF; }
.entry-content pre .hljs { color: var(--code-ink); background: transparent; }
.hljs-comment, .hljs-quote { color: var(--hl-comment); font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-operator, .hljs-doctag { color: var(--hl-keyword); }
.hljs-string, .hljs-regexp, .hljs-attr, .hljs-attribute, .hljs-meta-string { color: var(--hl-string); }
.hljs-number, .hljs-literal, .hljs-boolean { color: var(--hl-number); }
.hljs-title, .hljs-title.function_, .hljs-section, .hljs-name { color: var(--hl-func); }
.hljs-built_in, .hljs-type, .hljs-title.class_, .hljs-class .hljs-title { color: var(--hl-builtin); }
.hljs-variable, .hljs-params, .hljs-property { color: var(--code-ink); }
.hljs-meta, .hljs-symbol, .hljs-bullet { color: var(--hl-comment); }

/* Copy button */
.code-copy {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  font-family: var(--mono); font-size: 11px; color: var(--out-ink);
  background: var(--bg); border: 1px solid var(--hair); border-radius: 7px;
  padding: 5px 11px; cursor: pointer; opacity: 0; transition: opacity .15s ease, color .15s ease, border-color .15s ease;
}
.codeblock:hover .code-copy, .code-copy:focus-visible { opacity: 1; }
.code-copy:hover { color: var(--ink); border-color: var(--muted); }
.code-copy.copied { color: var(--blue-ink); border-color: var(--blue); opacity: 1; }
@media (hover: none) { .code-copy { opacity: 1; } }
.entry-content figure { margin: 26px 0; }
.entry-content figcaption { font-size: var(--fs-meta); color: var(--muted); margin-top: 10px; text-align: center; }
:root { --code-bg: #F6F8FA; --code-ink: #1F2328; --out-bg: #ECECEF; --out-ink: #5A6068; }
@media (prefers-color-scheme: dark) { :root { --code-bg: #15161A; --code-ink: #E6EDF3; --out-bg: #0D0E11; --out-ink: #8A9099; } }
:root[data-theme="light"] { --code-bg: #F6F8FA; --code-ink: #1F2328; --out-bg: #ECECEF; --out-ink: #5A6068; }
:root[data-theme="dark"] { --code-bg: #15161A; --code-ink: #E6EDF3; --out-bg: #0D0E11; --out-ink: #8A9099; }

/* tags + author card */
.tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 20px 0 30px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--hair);
}
.tags a { font-size: 13px; color: var(--ink-soft); background: var(--panel); border: 1px solid var(--hair); padding: 6px 13px; border-radius: 980px; }
.tags a:hover { border-color: var(--muted); text-decoration: none; }

.authorcard {
  display: flex; gap: 16px; align-items: flex-start; background: var(--panel);
  border: 1px solid var(--hair); border-radius: 18px; padding: 22px; margin-bottom: 50px;
}
.authorcard .av {
  width: 56px; height: 56px; border-radius: 50%; flex: 0 0 auto; background: var(--bg); border: 1px solid var(--hair);
  display: flex; align-items: center; justify-content: center; font-size: 19px; font-weight: 600; color: var(--ink-soft);
}
.authorcard .name { font-size: 17px; font-weight: 600; margin-bottom: 3px; }
.authorcard .name a { color: var(--ink); }
.authorcard .bio { font-size: 15px; color: var(--ink-soft); line-height: 1.5; margin: 0 0 8px; }
.authorcard .count { font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* right rail author bio */
.rail { position: sticky; top: 74px; }
.rail h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.13em; color: var(--muted); font-weight: 600; margin: 0 0 12px; }
.biocard { border: 1px solid var(--hair); border-radius: 16px; padding: 20px; background: var(--panel); }
.biocard .bio-head { display: flex; align-items: center; gap: 13px; margin-bottom: 14px; }
.biocard .av {
  width: 48px; height: 48px; border-radius: 50%; flex: 0 0 auto; background: var(--bg); border: 1px solid var(--hair);
  display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 600; color: var(--ink-soft);
}
.biocard .wb { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.biocard .name { font-size: 16px; font-weight: 600; }
.biocard .bio { font-size: 14px; color: var(--ink-soft); line-height: 1.5; margin: 0 0 14px; }
.biocard .count { font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-bottom: 14px; }
.biocard .btn { display: block; text-align: center; font-size: 13.5px; font-weight: 500; padding: 9px 0; border-radius: 980px; border: 1px solid var(--hair); color: var(--ink); }
.biocard .btn:hover { border-color: var(--muted); text-decoration: none; }
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; gap: 0; max-width: 700px; }
  .rail { position: static; margin: 10px 0 40px; }
}

/* related */
.related { background: var(--panel); border-top: 1px solid var(--hair); }
.related-inner { max-width: var(--maxw); margin: 0 auto; padding: 46px 22px 60px; }
.related h2 { font-size: 15px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; margin: 0 0 20px; }
.rel-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 720px) { .rel-grid { grid-template-columns: 1fr; } }

/* ============================================================
   Comments
   ============================================================ */
.comments { margin-top: 44px; margin-bottom: 40px; padding: 26px 30px 30px; border: 1px solid var(--hair); border-radius: 16px; background: var(--panel); }
.comments-title { font-size: 22px; font-weight: 600; letter-spacing: -0.015em; margin: 0 0 24px; }
.commentlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 26px; }
.commentlist .children { list-style: none; margin: 20px 0 0 0; padding-left: 45px; border-left: none; display: flex; flex-direction: column; gap: 20px; }
.comment .comment-inner { display: flex; gap: 13px; }
.c-av {
  width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto; background: var(--panel); border: 1px solid var(--hair);
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; color: var(--ink-soft);
}
.c-av.av-author { background: var(--blue); border-color: var(--blue); color: #fff; }
.c-body { flex: 1; min-width: 0; }
.c-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.c-name { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.c-badge { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: #fff; background: var(--blue); padding: 2px 7px; border-radius: 980px; margin-left: 6px; }
.c-date { font-size: var(--fs-meta); color: var(--muted); font-family: var(--mono); }
.c-body p { margin: 0 0 8px; font-size: 15.5px; line-height: 1.55; color: var(--ink); }
.c-reply a { background: transparent; border: 0; color: var(--blue-ink); font-size: 13px; font-weight: 500; padding: 0; }

.respond { margin-top: 40px; padding-top: 30px; border-top: 1px solid var(--hair); }
/* no comments yet: the section already has a top border, so drop the form's */
.comments--empty .respond { margin-top: 0; padding-top: 0; border-top: 0; }
.respond .comment-reply-title { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 16px; }
.respond form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.respond form > * { grid-column: 1 / -1; margin: 0; }
.respond .comment-form-author { grid-column: 1 / 2; }
.respond .comment-form-email { grid-column: 2 / 3; }
@media (max-width: 540px) {
  .respond form { grid-template-columns: 1fr; }
  .respond .comment-form-author, .respond .comment-form-email { grid-column: 1 / -1; }
}
.respond label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.respond input[type="text"], .respond input[type="email"], .respond input[type="url"], .respond textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--hair); border-radius: 10px;
  padding: 11px 13px; font-family: var(--sans); font-size: 15px; color: var(--ink); outline: none;
}
.respond textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.respond input:focus, .respond textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 18%, transparent); }
.respond .form-submit .submit {
  background: var(--blue); color: #fff; border: 0; border-radius: 980px; padding: 11px 24px;
  font-family: var(--sans); font-size: 14.5px; font-weight: 600; cursor: pointer;
}
.respond .form-submit .submit:hover { opacity: .92; }

/* ============================================================
   Static page (single column)
   ============================================================ */
.page-wrap { max-width: 760px; margin: 0 auto; padding: 48px 22px 60px; }
.page-wrap h1 { font-size: 40px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.1; margin: 24px 0 24px; text-wrap: balance; }

/* ============================================================
   404
   ============================================================ */
.notfound { flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; padding: 80px 22px; }
.notfound .box { max-width: 520px; }
.notfound .code { font-family: var(--mono); font-size: 14px; letter-spacing: 0.1em; color: var(--blue-ink); font-weight: 600; margin-bottom: 18px; }
.notfound h1 { font-size: 44px; line-height: 1.08; font-weight: 600; letter-spacing: -0.025em; margin: 0 0 16px; text-wrap: balance; }
.notfound p { font-size: 19px; color: var(--ink-soft); line-height: 1.5; margin: 0 0 28px; }
.btn {
  display: inline-block; font-size: 14.5px; font-weight: 500; padding: 11px 22px; border-radius: 980px;
  border: 1px solid var(--hair); color: var(--ink); background: var(--bg);
}
.btn:hover { border-color: var(--muted); text-decoration: none; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { opacity: .92; }

/* search bar in header */
.searchbar {
  display: flex; max-width: 420px; margin: 0 auto; background: var(--panel); border: 1px solid var(--hair);
  border-radius: 10px; padding: 11px 15px; font-size: 14px; color: var(--muted); align-items: center; gap: 9px;
}
.searchbar input { border: 0; background: transparent; outline: none; font-family: var(--sans); font-size: 14px; color: var(--ink); width: 100%; }
.searchbar button { border: 0; background: transparent; cursor: pointer; color: var(--muted); font-size: 16px; }

/* ============================================================
   Notices (auth, dashboard, contact)
   ============================================================ */
.dsp-notice {
  margin: 0 0 20px; padding: 12px 16px; border-radius: 12px; font-size: 14.5px; line-height: 1.5;
  border: 1px solid var(--hair); background: var(--panel);
}
.dsp-notice.ok { border-color: color-mix(in srgb, #34C759 40%, var(--hair)); background: color-mix(in srgb, #34C759 10%, var(--panel)); }
.dsp-notice.err { border-color: color-mix(in srgb, #FF3B30 40%, var(--hair)); background: color-mix(in srgb, #FF3B30 8%, var(--panel)); }
.dsp-notice.info { border-color: color-mix(in srgb, var(--blue) 35%, var(--hair)); background: color-mix(in srgb, var(--blue) 8%, var(--panel)); }

/* ============================================================
   Shared form styles (auth, write, profile, contact)
   ============================================================ */
.dsp-form { display: flex; flex-direction: column; gap: 16px; }
.dsp-form .field label { display: block; font-size: 15px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.dsp-form .field .opt { color: var(--muted); font-weight: 400; }
.dsp-form .field .lbl-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.dsp-form .field .lbl-row label { margin-bottom: 0; }
.dsp-form .field .lbl-row a { font-size: 12.5px; }
.dsp-form .field input, .dsp-form .field textarea, .dsp-form .field select {
  width: 100%; background: var(--field); border: 1px solid var(--hair); border-radius: 10px;
  padding: 11px 13px; font-family: var(--sans); font-size: 15px; color: var(--ink); outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.dsp-form .field textarea { resize: vertical; line-height: 1.5; }
/* Safari won't pad a native select — draw it ourselves with a chevron. */
.dsp-form .field select {
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2386868B' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
  padding-right: 36px;
}
.dsp-form .field input:focus, .dsp-form .field textarea:focus, .dsp-form .field select:focus {
  border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 18%, transparent);
}
.dsp-form .field .hint, .dsp-form .hint { font-size: var(--fs-note); color: var(--muted); margin-top: 6px; line-height: 1.5; }
.dsp-form .check { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; color: var(--ink-soft); line-height: 1.5; cursor: pointer; }
.dsp-form .check input[type="checkbox"],
.dsp-form .check input[type="radio"] {
  appearance: none; -webkit-appearance: none;
  flex: 0 0 auto; width: 18px; height: 18px; margin: 1px 0 0;
  border: 1.5px solid var(--hair); border-radius: 5px;
  background: var(--field); cursor: pointer;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.dsp-form .check input[type="radio"] { border-radius: 50%; }
.dsp-form .check:hover input:not(:checked) { border-color: var(--muted); }
.dsp-form .check input:checked { background: var(--blue); border-color: var(--blue); }
.dsp-form .check input[type="checkbox"]:checked {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M3 7.4 5.8 10 11 4.4' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 12px 12px; background-position: center; background-repeat: no-repeat;
}
.dsp-form .check input[type="radio"]:checked {
  background-image: radial-gradient(circle, #fff 0 3px, transparent 3.5px);
}
.dsp-form .check input:active { box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 15%, transparent); }
.dsp-hp-wrap { position: absolute !important; left: -9999px !important; }

.dsp-btn {
  display: inline-block; font-size: 14.5px; font-weight: 500; padding: 11px 22px; border-radius: 980px;
  border: 1px solid var(--hair); color: var(--ink); background: var(--bg); cursor: pointer;
  font-family: var(--sans); text-align: center; transition: opacity .15s ease, border-color .15s ease;
}
.dsp-btn:hover { border-color: var(--muted); text-decoration: none; }
.dsp-btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }
.dsp-btn.primary:hover { opacity: .92; }
.dsp-btn.big { padding: 13px 0; width: 100%; font-size: 15.5px; margin-top: 4px; }
.dsp-btn.danger { color: #FF3B30; border-color: color-mix(in srgb, #FF3B30 45%, var(--hair)); }
.dsp-btn.danger:hover { background: #FF3B30; border-color: #FF3B30; color: #fff; }

/* ============================================================
   Auth pages (/login /register /lost-password)
   ============================================================ */
.auth-wrap { display: flex; justify-content: center; padding: 72px 22px 80px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card.wide { max-width: 560px; }
.auth-head { text-align: center; margin-bottom: 30px; }
.auth-head h1 { font-size: 32px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 10px; }
.auth-head .sub { font-size: 16px; color: var(--ink-soft); margin: 0; line-height: 1.45; }
.auth-intro { font-size: 15px; line-height: 1.6; color: var(--ink-soft); margin: 0 0 28px; }
.dsp-form.dsp-register { gap: 0; }
.auth-alt { text-align: center; font-size: 14px; color: var(--muted); margin-top: 22px; }

/* ============================================================
   Dashboard shell
   ============================================================ */
.dash-head { border-bottom: 1px solid var(--hair); background: var(--panel-2); }
.dash-head-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 18px 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
}
.dash-who { display: flex; align-items: center; gap: 12px; }
.dash-who .av {
  width: 40px; height: 40px; border-radius: 50%; background: var(--panel); border: 1px solid var(--hair);
  color: var(--ink-soft); font-size: 14px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.dash-name { font-size: 15.5px; font-weight: 600; line-height: 1.25; }
.dash-sub { font-size: 12px; color: var(--muted); }
.dash-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.dash-nav a {
  font-size: 13.5px; font-weight: 500; color: var(--ink-soft); padding: 8px 16px;
  border-radius: 980px; border: 1px solid transparent;
}
.dash-nav a:hover { color: var(--ink); text-decoration: none; border-color: var(--hair); }
.dash-nav a.on { background: var(--ink); color: var(--bg); }

.dash-wrap { max-width: var(--maxw); margin: 0 auto; padding: 48px 22px 70px; }
.dash-hero { margin-bottom: 26px; }
.dash-hero h1 { font-size: 36px; font-weight: 600; letter-spacing: -0.025em; margin: 0 0 8px; }
.dash-hero p { font-size: 17px; color: var(--ink-soft); margin: 0; }
.dash-stats { margin: 0 0 24px; max-width: none; }
.dash-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 34px; }

.dash-panel {
  background: var(--panel); border: 1px solid var(--hair); border-radius: 18px;
  padding: 24px 26px; margin-bottom: 24px;
}
.dash-panel h2 { font-size: 19px; font-weight: 600; letter-spacing: -0.015em; margin: 0 0 16px; padding-bottom: 10px; border-bottom: 1px solid var(--hair); }
.dash-sec-title { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin: 36px 0 14px; }
.cmt-list { list-style: none; margin: 0; padding: 0; }
.cmt-list li { padding: 12px 0; border-bottom: 1px solid var(--hair); }
.cmt-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.cmt-line { margin: 0 0 4px; font-size: 14px; }
.cmt-line b { font-weight: 600; }
.cmt-line a { color: var(--blue); text-decoration: none; }
.cmt-line a:hover { text-decoration: underline; }
.cmt-date { color: var(--muted); font-size: var(--fs-meta); margin-left: 6px; }
.cmt-excerpt { margin: 0; color: var(--muted); font-size: var(--fs-note); line-height: 1.5; }
.char-wrap { position: relative; }
.char-wrap textarea { padding-bottom: 26px; display: block; width: 100%; }
.char-wrap .charcount { position: absolute; right: 12px; bottom: 8px; font-size: 11.5px; color: var(--muted); pointer-events: none; font-variant-numeric: tabular-nums; }
.dash-panel h2:not(:first-of-type) { margin-top: 28px; }
.dash-panel.danger { border-color: color-mix(in srgb, #FF3B30 35%, var(--hair)); }
.dash-footnote { font-size: var(--fs-note); color: var(--muted); }

.onboarding .steps { list-style: none; margin: 0; padding: 0; counter-reset: dsp-step; display: flex; flex-direction: column; gap: 14px; }
.onboarding .steps li { counter-increment: dsp-step; position: relative; padding-left: 44px; font-size: 15px; line-height: 1.55; color: var(--ink-soft); }
.onboarding .steps li b { display: block; color: var(--ink); font-size: 15.5px; }
.onboarding .steps li::before {
  content: counter(dsp-step, decimal-leading-zero); position: absolute; left: 0; top: 2px;
  font-family: var(--mono); font-size: 13px; color: var(--blue-ink); font-weight: 600;
}

/* onboarding tabs (write on site / from RStudio) */
.onb-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.onb-tabs [role="tab"] {
  font: inherit; font-size: 13.5px; font-weight: 500; color: var(--ink-soft); cursor: pointer;
  padding: 7px 15px; border-radius: 980px; border: 1px solid var(--hair); background: var(--bg);
}
.onb-tabs [role="tab"]:hover { color: var(--ink); }
.onb-tabs [role="tab"][aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.onb-code {
  display: block; margin: 10px 0 4px; padding: 12px 14px; overflow-x: auto;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.6; color: var(--ink);
  background: var(--panel-2); border: 1px solid var(--hair); border-radius: 10px;
}
.onb-note { display: block; margin-top: 6px; font-size: var(--fs-note); color: var(--muted); }
.onb-tip { margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--hair); line-height: 1.55; }
.onb-tip b { color: var(--ink-soft); }
.onb-tip-row { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--hair); }
.onb-tip-row .onb-tip { margin: 0; padding-top: 0; border-top: 0; }
@media (max-width: 640px) { .onb-tip-row { grid-template-columns: 1fr; gap: 18px; } }
.onb-welcome { margin: 0 0 16px; font-size: 15px; line-height: 1.55; color: var(--ink-soft); }
.onb-actions { margin-bottom: 0; }

/* article rows (dashboard + my-articles) */
.art-list { list-style: none; margin: 0; padding: 0; }
.art-list li {
  display: flex; align-items: baseline; gap: 14px; padding: 12px 0;
  border-bottom: 1px solid var(--hair); flex-wrap: wrap;
}
.art-list li:last-child { border-bottom: 0; }
.art-status {
  flex: 0 0 auto; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 3px 10px; border-radius: 980px; border: 1px solid var(--hair); color: var(--muted); background: var(--bg);
}
.art-status.st-publish { color: #fff; background: #34C759; border-color: #34C759; }
.art-status.st-pending { color: #fff; background: var(--warm); border-color: var(--warm); }
.art-title { flex: 1 1 300px; font-size: 15.5px; font-weight: 500; color: var(--ink); min-width: 0; }
.art-title:hover { color: var(--blue-ink); text-decoration: none; }
.art-extra { display: flex; gap: 14px; font-size: 13px; }
.art-views { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.art-trash { color: #FF3B30; }
.art-date { flex: 0 0 auto; font-size: var(--fs-meta); color: var(--muted); font-family: var(--mono); }

/* ============================================================
   Write page (editor + live preview)
   ============================================================ */
.write-top { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.write-top h1 { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; margin: 0; flex: 1; }
.write-top-actions { display: flex; gap: 10px; }
.write-title { font-size: 19px !important; font-weight: 600; }
.editor-split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: stretch; }
@media (max-width: 900px) { .editor-split { grid-template-columns: 1fr; } }
.editor-col { display: flex; flex-direction: column; min-width: 0; }
.editor-col-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; color: var(--muted);
  margin-bottom: 8px;
}
.editor-col-head .hint { text-transform: none; letter-spacing: 0; font-weight: 400; margin: 0; }
.mdhint code { font-family: var(--mono); font-size: 11px; background: var(--panel); border: 1px solid var(--hair); border-radius: 5px; padding: 1px 5px; }
#dsp-md {
  flex: 1; width: 100%; min-height: 460px; background: var(--field); border: 1px solid var(--hair);
  border-radius: 12px; padding: 16px 18px; font-family: var(--mono); font-size: 14px; line-height: 1.65;
  color: var(--ink); outline: none; resize: vertical;
}
#dsp-md:focus { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 15%, transparent); }
.editor-preview {
  flex: 1; min-height: 460px; overflow-y: auto; max-height: 75vh;
  border: 1px dashed var(--hair); border-radius: 12px; padding: 16px 22px !important;
  font-size: 16px !important; border-top: 1px dashed var(--hair) !important;
}
.editor-preview:empty::before { content: "Preview appears here as you type…"; color: var(--muted); font-size: 14px; }
.write-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .write-meta { grid-template-columns: 1fr; } }
.attest {
  background: var(--panel); border: 1px solid color-mix(in srgb, var(--warm) 40%, var(--hair));
  border-radius: 12px; padding: 14px 16px;
}
.write-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* editor image upload */
.dsp-btn.small { font-size: 12px; padding: 5px 13px; }
.editor-col-head .dsp-btn.small { text-transform: none; letter-spacing: 0; font-weight: 500; }
#dsp-md.dragging { border-color: var(--blue); border-style: dashed; box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 15%, transparent); }

/* editor formatting toolbar */
.md-toolbar {
  display: flex; flex-direction: column; gap: 3px;
  border: 1px solid var(--hair); border-bottom: 0; border-radius: 12px 12px 0 0;
  background: var(--panel); padding: 6px 8px;
}
.md-toolbar .tb-row { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.md-toolbar .tb-row + .tb-row { border-top: 1px dashed var(--hair); padding-top: 3px; }
.md-toolbar button {
  border: 1px solid transparent; background: transparent; color: var(--ink-soft);
  font-family: var(--sans); font-size: 12.5px; font-weight: 600; line-height: 1;
  min-width: 30px; height: 28px; padding: 0 8px; border-radius: 7px; cursor: pointer;
}
.md-toolbar button:hover { background: var(--bg); border-color: var(--hair); color: var(--ink); }
.md-toolbar button b { font-weight: 800; }
.md-toolbar button i { font-style: italic; font-family: Georgia, serif; }
.md-toolbar .tb-sep { width: 1px; height: 18px; background: var(--hair); margin: 0 4px; }
.md-toolbar .tb-grow { flex: 1; }
#dsp-upload-btn { display: inline-flex; align-items: center; justify-content: center; }
#dsp-upload-btn svg { display: block; }
/* textarea joins the toolbar into one visual unit */
.md-toolbar + textarea#dsp-md, .md-toolbar ~ #dsp-md { border-radius: 0 0 12px 12px; }

/* preview pane: first element sits flush at the top of the box */
.editor-preview > :first-child { margin-top: 0 !important; }

/* author page: job title · location line under the name */
.prof .role { font-size: 14px; color: var(--muted); margin: -8px 0 14px; }

/* account deletion: article-fate options */
.del-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 720px) { .del-options { grid-template-columns: 1fr; } }
.del-opt {
  display: flex; gap: 12px; align-items: flex-start; padding: 13px 15px;
  background: var(--bg); border: 1px solid var(--hair); border-radius: 12px; cursor: pointer;
}
.del-opt:has(input:checked) { border-color: #34C759; box-shadow: 0 0 0 3px color-mix(in srgb, #34C759 16%, transparent); }
.del-opt input {
  appearance: none; -webkit-appearance: none;
  flex: 0 0 auto; width: 18px; height: 18px; margin: 2px 0 0;
  border: 1.5px solid var(--hair); border-radius: 50%; background: var(--field);
  cursor: pointer; transition: background .15s ease, border-color .15s ease;
}
.del-opt input:checked {
  background: #34C759; border-color: #34C759;
  background-image: radial-gradient(circle, #fff 0 3px, transparent 3.5px);
}
.del-opt span { font-size: var(--fs-note); color: var(--ink-soft); line-height: 1.5; }
.del-opt b { display: block; color: var(--ink); font-size: 14px; }

/* delete-account intro: readable size, not hint-sized */
.del-intro { font-size: 15px; color: var(--ink-soft); line-height: 1.55; margin: 0 0 6px; }

/* delete button row: warning sits to the right of the button */
.del-final { align-items: center; gap: 16px; }
.del-warn { font-size: 13px; color: #FF3B30; line-height: 1.45; }

/* "you choose…" lead-in on its own row, slightly emphasized */
.del-choice { color: var(--ink); font-weight: 500; margin-top: 2px; }

/* /write: delete link pushed to the right of the action row */
.write-delete { margin-left: auto; align-self: center; font-size: 13.5px; color: #FF3B30; }
.write-delete:hover { color: #FF3B30; text-decoration: underline; }

/* Akismet "this site uses Akismet…" notice under the comment box */
.akismet_comment_form_privacy_notice {
  font-size: 11.5px; line-height: 1.5; color: var(--muted); margin: 12px 0 0;
}
.akismet_comment_form_privacy_notice a { color: var(--muted); text-decoration: underline; }
.akismet_comment_form_privacy_notice a:hover { color: var(--ink-soft); }

/* privacy request form: radio group legend */

/* privacy request page: narrow centered column with intro text */
.dsp-pr-intro { font-size: 18px; line-height: 1.62; color: var(--ink); margin: 0 0 20px; }
/* titled section cards — shared by contact, register, data-request */
.dsp-c-sec { margin: 0 0 30px; }
.dsp-c-sec > h3 {
  margin: 0 0 12px; font-size: 21px; font-weight: 600; color: var(--ink);
  letter-spacing: -0.015em;
}
.dsp-c-card {
  background: var(--panel); border: 1px solid var(--hair);
  border-radius: 18px; padding: 22px 24px;
}
.dsp-c-card .field { margin-bottom: 16px; }
.dsp-c-card .field:last-child { margin-bottom: 0; }
.dsp-c-topics { display: flex; flex-direction: column; gap: 12px; }
.dsp-c-topics .check { font-size: 15.5px; color: var(--ink); align-items: center; }
.dsp-c-footer { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 4px; }
.dsp-c-footer .check { max-width: 480px; }
.dsp-c-footer .dsp-btn { min-width: 240px; }

/* data-request: two titled section cards + centered send, like contact */
.dsp-privacy-box .dsp-form { margin-top: 34px; max-width: 560px; gap: 0; }

/* contact form */
.dsp-form.dsp-contact { margin-top: 34px; max-width: 640px; gap: 0; }
.dsp-c-note { margin: 0; font-size: var(--fs-note); color: var(--muted); text-align: center; }
.dsp-c-note a { color: var(--muted); text-decoration: underline; }

/* consent gates the button; sending feedback; plain-text result */
.dsp-form .dsp-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.dsp-btn.sending { animation: dsp-sending 1.1s ease-in-out infinite; }
@keyframes dsp-sending { 50% { opacity: 0.55; } }
.dsp-form.dsp-contact .dsp-notice {
  background: none; border: 0; padding: 0; margin: 0;
  text-align: center; font-size: 14.5px; font-weight: 500;
}
.dsp-form.dsp-contact .dsp-notice.ok  { color: color-mix(in srgb, #34C759 60%, var(--ink)); }
.dsp-form.dsp-contact .dsp-notice.err { color: color-mix(in srgb, #FF3B30 65%, var(--ink)); }

/* ============================================================
   Static page: single centered column
   ============================================================ */
.page-shell { max-width: 760px; margin: 0 auto; padding: 56px 22px 60px; }
.page-shell > .page-title { font-size: 40px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.1; margin: 0 0 24px; text-wrap: balance; }
.page-main { min-width: 0; }
