:root {
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  --font-serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-mono: "SF Mono", ui-monospace, "Cascadia Code", Monaco, monospace;
  --site-font-family: var(--font-sans);
  --code-font-family: var(--font-mono);
  --display-font-family: var(--font-serif);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: #0b0d10;
  color: #e7e9ec;
}

h1,
.hero-name {
  font-family: var(--font-serif);
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.03em;
  line-height: 1;
}

h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: -0.01em;
}

code,
kbd,
samp,
pre {
  font-family: var(--font-mono);
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 10050;
  transform: translateY(-180%);
  padding: 0.65rem 0.9rem;
  background: #101a2b;
  color: #e7e9ec;
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

a {
  color: inherit;
}

.site-header {
  border-bottom: 1px solid #252a31;
  padding: 1rem max(1rem, calc((100% - 1100px) / 2));
}

.nav-wrapper {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
}

.site-title {
  justify-self: start;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  text-decoration: none;
  font-size: 1.25rem;
  white-space: nowrap;
}

.site-nav {
  justify-self: center;
}

.site-nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
  justify-content: center;
}

.page-link {
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0.9;
}

.page-link:hover {
  text-decoration: none;
  background: rgba(133, 133, 255, 0.12);
  opacity: 1;
}

.page-link-eng {
  position: relative;
  background: #ffd84d;
  color: #101216;
  font-weight: 600;
  opacity: 1;
  padding: 5px 12px 7px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
}

.page-link-eng::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 3px;
  height: 2px;
  border-radius: 2px;
  background: #101216;
  opacity: 0.8;
}

.page-link-eng:hover {
  background: #ffe07a;
  color: #101216;
  text-decoration: none;
  opacity: 1;
}

.header-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Live visitor badge - hidden until the first count arrives. */
.header-live {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: #89919b;
  white-space: nowrap;
}

/* An author display rule beats the UA's [hidden] { display: none }. */
.header-live[hidden] {
  display: none;
}

.header-live-count {
  font-variant-numeric: tabular-nums;
}

.header-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8585ff;
  animation: header-live-pulse 2.4s ease-out infinite;
}

@keyframes header-live-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(133, 133, 255, 0.45); }
  70%  { box-shadow: 0 0 0 6px rgba(133, 133, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(133, 133, 255, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .header-live-dot {
    animation: none;
  }
}

/* Header space is tight on phones - keep the dot and number only. */
@media (max-width: 640px) {
  .header-live-label {
    display: none;
  }
}

html[data-theme="light"] .header-live {
  color: #5c6470;
}

.theme-toggle {
  background: transparent;
  border: 1px solid #252a31;
  border-radius: 6px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  color: inherit;
  font-size: 1rem;
  line-height: 1;
}

.theme-toggle:hover {
  border-color: #8585ff;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid #252a31;
  border-radius: 6px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: inherit;
  flex-shrink: 0;
}

.nav-toggle:hover {
  border-color: #8585ff;
}

.hamburger-box {
  width: 18px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.hamburger-inner,
.hamburger-inner::before,
.hamburger-inner::after {
  width: 18px;
  height: 2px;
  background-color: currentColor;
  position: absolute;
  border-radius: 4px;
  transition: transform 0.25s ease, opacity 0.25s ease, top 0.25s ease;
}

.hamburger-inner {
  top: 50%;
  transform: translateY(-50%);
  left: 0;
}

.hamburger-inner::before {
  content: "";
  top: -6px;
  left: 0;
}

.hamburger-inner::after {
  content: "";
  top: 6px;
  left: 0;
}

.nav-toggle.is-active .hamburger-inner {
  transform: rotate(225deg);
}

.nav-toggle.is-active .hamburger-inner::before {
  top: 0;
  opacity: 0;
}

.nav-toggle.is-active .hamburger-inner::after {
  top: 0;
  transform: rotate(-90deg);
}

.nav-close {
  display: none;
}

@media (max-width: 860px) {
  .nav-wrapper {
    display: flex;
    justify-content: space-between;
    flex-wrap: nowrap;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    display: none;
  }

  .site-nav.is-open {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    inset: 0;
    width: 100%;
    height: 100dvh;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    padding: 4rem 1.5rem 3rem;
    overflow-y: auto;
    animation: nav-fade-in 0.22s ease both;
  }

  /*
   * The actual dim + blur lives on #nav-backdrop (a direct child of
   * <body>, see partials/header.ejs) instead of on .site-nav itself.
   * .site-nav.is-open only has to size/center the link buttons; the
   * backdrop below is guaranteed to cover the true full viewport.
   */
  .nav-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    inset: 0;
    width: 100%;
    height: 100dvh;
    z-index: 1990;
    background: rgba(11, 13, 16, 0.72);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    backdrop-filter: blur(20px) saturate(140%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease;
  }

  .nav-backdrop.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  /* Browsers/webviews without backdrop-filter support still get a solid,
     unmistakably full-viewport dim - never a half-transparent gap. */
  @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .nav-backdrop {
      background: rgba(8, 10, 14, 0.94);
    }
  }

  .site-nav.is-open .site-nav-links {
    animation: nav-links-in 0.28s 0.05s ease both;
  }

  @keyframes nav-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  @keyframes nav-links-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
  }

  @media (prefers-reduced-motion: reduce) {
    .site-nav.is-open,
    .site-nav.is-open .site-nav-links,
    .nav-backdrop {
      animation: none;
      transition: none;
    }
  }

  .site-nav.is-open .nav-close {
    display: inline-flex;
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    background: #1a2027;
    border: 1px solid #3a434e;
    border-radius: 10px;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
  }

  .site-nav.is-open .nav-close:hover {
    border-color: #8585ff;
    color: #8585ff;
  }

  .site-nav.is-open .site-nav-links {
    flex-direction: column;
    gap: 0.9rem;
    width: 100%;
    max-width: 360px;
  }

  .site-nav.is-open .page-link {
    font-size: 1.3rem;
    padding: 0.8rem 1.25rem;
    width: 100%;
    text-align: center;
    background: #1a2027;
    border: 1px solid #3a434e;
    border-radius: 10px;
    color: #fff;
    opacity: 1;
  }

  html[data-theme="light"] .site-nav.is-open .page-link {
    background: #fffdf8;
    border-color: #e2ddd0;
    color: #1a1d21;
  }

  .site-nav.is-open .page-link-eng {
    background: #ffd84d;
    border-color: #ffd84d;
    color: #101216;
  }

  .site-nav.is-open .page-link-eng::after {
    left: 50%;
    right: auto;
    bottom: 0.55rem;
    width: 3.5rem;
    transform: translateX(-50%);
  }

  html[data-theme="light"] .site-nav.is-open .page-link-eng {
    background: #f5c518;
    border-color: #f5c518;
    color: #101216;
  }

  html[data-theme="light"] .site-nav.is-open .nav-close {
    background: #fffdf8;
    border-color: #e2ddd0;
    color: #1a1d21;
  }

  html[data-theme="light"] .nav-toggle,
  html[data-theme="light"] .theme-toggle {
    color: #1a1d21;
  }

  body.nav-open {
    overflow: hidden;
  }
}

.brand {
  font-weight: 800;
  text-decoration: none;
}

.container {
  max-width: 860px;
  margin: auto;
  padding: 2rem 1.5rem;
}

.wrapper {
  width: 100%;
}

.hero {
  margin-bottom: 2rem;
}

.post-list {
  display: grid;
  gap: 1rem;
}

.card {
  padding: 1.25rem;
  border: 1px solid #252a31;
  border-radius: 10px;
  background: #11151a;
}

.card h2 {
  margin: 0.35rem 0;
}

.card h2 a {
  text-decoration: none;
}

.meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.85rem;
  color: #aeb5bd;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.badge.active {
  color: #ffb4b4;
}

.badge.retired {
  color: #a9e7b0;
}

.post {
  max-width: 850px;
  margin: auto;
}

.post-header {
  margin-bottom: 2rem;
}

.post-header h1 {
  line-height: 1.2;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: #89919b;
  margin-top: 0.5rem;
}

.post-author {
  color: #aeb5bd;
}

.post-author strong {
  color: #c5cbf7;
  font-weight: 600;
}

html[data-theme="light"] .post-author strong {
  color: #5b5ec9;
}

.views-live {
  cursor: help;
  text-decoration: underline dotted;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* ---------------- reading progress + back to top ---------------- */

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 999;
  background: transparent;
  pointer-events: none;
}

.reading-progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #4a90d9, #7dc4ff);
  transition: width 0.08s linear;
}

.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid #252a31;
  background: #0f141b;
  color: #c7cdd4;
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 998;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: #182029;
  border-color: #4a90d9;
  color: #7dc4ff;
}

html[data-theme="light"] .back-to-top {
  background: #f0ede6;
  border-color: #d8d2c4;
  color: #3d4450;
}

/* ---------------- series box ---------------- */

.series-box {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border: 1px solid #2a313c;
  border-left: 3px solid #4a90d9;
  border-radius: 8px;
  background: #0d1219;
}

.series-box h2 {
  font-size: 1rem;
  margin: 0 0 0.5rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.series-list {
  margin: 0;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.92rem;
}

.series-list li.series-current {
  color: #7dc4ff;
  font-weight: 600;
}

.series-list li.series-current::marker {
  content: "▸ ";
  color: #4a90d9;
}

html[data-theme="light"] .series-box {
  background: #f0ede6;
  border-color: #d8d2c4;
}

/* ---------------- admin dashboard ---------------- */

.admin-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem 0 3rem;
}

.admin-tabs {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  border-bottom: 1px solid #252a31;
  margin: 1.25rem 0 1.5rem;
}

.admin-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: #89919b;
  font: inherit;
  font-size: 0.95rem;
  padding: 0.6rem 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.admin-tab:hover {
  color: #c7cdd4;
}

.admin-tab.is-active {
  color: #7dc4ff;
  border-bottom-color: #4a90d9;
}

.admin-tab-count {
  font-size: 0.7rem;
  font-weight: 700;
  background: #d9635a;
  color: #fff;
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
}

.admin-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.admin-card,
.admin-card-wide {
  border: 1px solid #1d232c;
  border-radius: 10px;
  background: #0d1219;
  padding: 1rem 1.1rem;
}

.admin-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.admin-card-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #89919b;
}

.admin-card-value {
  font-size: 1.6rem;
  line-height: 1.1;
}

.admin-card-sub {
  font-size: 0.75rem;
  color: #89919b;
}

.admin-card-wide {
  margin-bottom: 1rem;
}

.admin-card-wide h3 {
  margin: 0 0 0.5rem;
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.admin-status {
  font-size: 0.82rem;
  color: #89919b;
}

.admin-hint {
  font-size: 0.82rem;
  color: #89919b;
  margin: 0.25rem 0 0.75rem;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.admin-filter {
  display: flex;
  gap: 0.4rem;
}

.admin-chip {
  background: none;
  border: 1px solid #252a31;
  border-radius: 999px;
  color: #89919b;
  font: inherit;
  font-size: 0.8rem;
  padding: 0.25rem 0.85rem;
  cursor: pointer;
}

.admin-chip.is-active {
  color: #7dc4ff;
  border-color: #4a90d9;
}

#admin-post-search {
  flex: 1;
  min-width: 200px;
  padding: 0.5rem 0.75rem;
  border: 1px solid #252a31;
  border-radius: 8px;
  background: #0f141b;
  color: inherit;
  font: inherit;
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.admin-row {
  display: flex;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid #1d232c;
  border-radius: 10px;
  background: #0d1219;
}

.admin-row-main {
  flex: 1;
  min-width: 0;
}

.admin-row-slug {
  font-size: 0.75rem;
  color: #89919b;
  margin-left: 0.5rem;
}

.admin-row-meta {
  font-size: 0.8rem;
  color: #89919b;
  margin-top: 0.15rem;
  overflow-wrap: break-word;
}

.admin-label {
  display: block;
  font-size: 0.85rem;
  color: #c7cdd4;
  margin: 0.75rem 0 0.3rem;
}

.admin-label input[type="checkbox"] {
  margin-right: 0.4rem;
}

#editor-text {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid #252a31;
  border-radius: 8px;
  background: #0f141b;
  color: inherit;
  font: inherit;
}

#editor-text {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.55;
  min-height: 420px;
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: auto;
}

.admin-editor {
  margin-top: 1.5rem;
  padding: 1rem;
  border: 1px solid #2a313c;
  border-radius: 10px;
  background: #0d1219;
}

.admin-editor h3 {
  margin: 0 0 0.25rem;
}

.admin-kv {
  margin: 0;
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.92rem;
}

.admin-logout {
  margin: 2rem 0;
  text-align: center;
}

html[data-theme="light"] .admin-card,
html[data-theme="light"] .admin-card-wide,
html[data-theme="light"] .admin-row,
html[data-theme="light"] .admin-editor,
html[data-theme="light"] #editor-text,
html[data-theme="light"] #admin-post-search {
  background: #f0ede6;
  border-color: #d8d2c4;
}


.toc {
  max-width: 320px;
  margin: 1rem 0 2rem;
  border: 1px solid #252a31;
  border-radius: 8px;
  background: #11151a;
  padding: 0.75rem;
}

.toc details summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
}

.toc ul {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
  list-style: none;
}

.toc li {
  margin: 0.25rem 0;
}

.toc a {
  color: #89919b;
  font-size: 0.85rem;
  text-decoration: none;
}

.toc a:hover {
  color: #8585ff;
}

.related {
  max-width: 850px;
  margin: 2rem auto;
}

.related h2 {
  margin-bottom: 1rem;
}

.about-author {
  max-width: 640px;
  margin: 2rem auto;
  padding: 1rem 1.25rem;
  border: 1px solid #252a31;
  border-radius: 10px;
  background: #11151a;
  text-align: center;
}

.about-author img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.about-author p {
  margin: 0.4rem 0 0;
  font-size: 0.88rem;
  color: #aeb5bd;
}

.about-author a {
  color: #8585ff;
}

.share-buttons {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  margin-top: 1rem;
}

.share-btn {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border: 1px solid #252a31;
  border-radius: 6px;
  background: transparent;
  color: #aeb5bd;
  font-size: 0.8rem;
  text-decoration: none;
}

.share-btn:hover {
  border-color: #8585ff;
  color: #8585ff;
}

html[data-theme="light"] .about-author {
  background: #fffdf8;
  border-color: #e2ddd0;
}

.lead {
  color: #b7bec7;
  font-size: 1.1rem;
}

.prose img {
  max-width: 100%;
  height: auto;
}

/* A subtle reveal confirms that an offscreen screenshot has finished loading. */
.prose img.lozad {
  opacity: 0;
  background: #11151b;
  transition: opacity 180ms ease-out;
}

.prose img.lozad.is-loaded {
  opacity: 1;
}

.prose pre {
  overflow-x: auto;
  padding: 1rem;
  background: #07090b;
  border-radius: 8px;
}

.code-window {
  margin: 1.5rem 0;
  border: 1px solid #252a31;
  border-radius: 12px;
  overflow: hidden;
  background: #07090b;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.code-window-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.9rem;
  background: rgba(255, 255, 255, 0.045);
  border-bottom: 1px solid #252a31;
}

.code-window-dots {
  display: inline-flex;
  gap: 0.45rem;
}

.code-window-dots i {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.code-window-dots i:nth-child(1) {
  background: #ff5f57;
}

.code-window-dots i:nth-child(2) {
  background: #febc2e;
}

.code-window-dots i:nth-child(3) {
  background: #28c840;
}

.code-window-lang {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8b93a0;
}

.code-window pre {
  margin: 0;
  border-radius: 0;
  background: transparent;
}

.code-window-bar .copy-btn {
  position: static;
}

.prose code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.prose :not(pre) > code {
  background: rgba(133, 133, 255, 0.14);
  color: #b7b7ff;
  padding: 0.15em 0.4em;
  border-radius: 5px;
  font-size: 0.88em;
  border: 1px solid rgba(133, 133, 255, 0.25);
  white-space: nowrap;
}

.prose table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.92rem;
  line-height: 1.5;
  border: 1px solid #252a31;
  border-radius: 10px;
}

.prose thead {
  background: linear-gradient(135deg, rgba(133, 133, 255, 0.22), rgba(0, 209, 178, 0.16));
}

.prose th {
  color: #b7b7ff;
  text-align: left;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.78rem;
}

.prose th,
.prose td {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid #252a31;
  vertical-align: top;
}

.prose tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.025);
}

.prose tbody tr:hover {
  background: rgba(133, 133, 255, 0.08);
}

.prose tbody tr:last-child th,
.prose tbody tr:last-child td {
  border-bottom: none;
}

.prose td code {
  white-space: nowrap;
}

.locked,
.auth-box,
.center {
  max-width: 650px;
  margin: 5rem auto;
  text-align: center;
}

.auth-box form {
  display: grid;
  gap: 0.75rem;
  text-align: left;
}

input {
  width: 100%;
  padding: 0.75rem;
  border-radius: 6px;
  border: 1px solid #343b44;
  background: #0d1116;
  color: inherit;
}

.button {
  display: inline-block;
  padding: 0.65rem 1rem;
  border: 0;
  border-radius: 6px;
  background: #e7e9ec;
  color: #0b0d10;
  text-decoration: none;
  cursor: pointer;
}

.error {
  margin: 1rem 0;
  padding: 0.75rem;
  border: 1px solid #8b4141;
  border-radius: 6px;
}

.site-footer {
  padding: 2.5rem 1.5rem 2rem;
  color: #89919b;
  border-top: 1px solid #252a31;
  text-align: center;
}

.footer-simple-wrapper {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
}

.footer-simple-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.footer-kicker {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #89919b;
}

.footer-simple-title {
  margin: 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.25rem;
  color: #e7e9ec;
}

.footer-simple-description {
  margin: 0;
  font-size: 0.9rem;
}

.footer-email {
  color: inherit;
  font-size: 0.9rem;
}

.footer-simple-nav,
.footer-simple-social {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem 1rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
}

.footer-simple-social a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.footer-simple-social svg {
  flex-shrink: 0;
}

.footer-simple-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding-top: 1rem;
  border-top: 1px solid #252a31;
  width: 100%;
  font-size: 0.78rem;
}

.footer-simple-bottom p {
  margin: 0;
}

.latest {
  margin: 2rem 0 1rem;
}

.page {
  max-width: 850px;
  margin: auto;
}

.privacy-consent-banner[hidden],
.privacy-consent-dialog[hidden] {
  display: none;
}

.privacy-consent-banner {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 11000;
  display: grid;
  gap: 1rem;
  width: min(960px, calc(100vw - 2rem));
  padding: 1.2rem 1.25rem;
  border: 1px solid #8585ff;
  border-radius: 10px;
  background: #242018;
  color: #f5eedc;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.35);
}

.privacy-consent-dialog {
  position: fixed;
  inset: 0;
  z-index: 11001;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.privacy-consent-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
}

.privacy-consent-panel {
  position: relative;
  width: min(680px, 100%);
  max-height: min(760px, calc(100vh - 2rem));
  overflow-y: auto;
  padding: 1.35rem;
  border: 1px solid #8585ff;
  border-radius: 10px;
  background: #0b0d10;
}

.privacy-consent-options {
  display: grid;
  gap: 0.65rem;
  margin-top: 1.1rem;
}

.privacy-consent-option {
  display: block;
  padding: 0.85rem;
  border: 1px solid #3d3628;
  border-radius: 6px;
  background: #242018;
  cursor: pointer;
}

.privacy-consent-btn {
  min-height: 2.35rem;
  border: 1px solid #8585ff;
  border-radius: 6px;
  padding: 0.55rem 0.8rem;
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.privacy-consent-btn-primary {
  background: #8585ff;
  color: #fff;
}

.privacy-choices-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: #8585ff;
  font: inherit;
  cursor: pointer;
}

.about-page {
  max-width: 640px;
  margin: 0 auto;
}

.about-kicker {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #89919b;
  margin: 0 0 0.5rem;
}

.about-intro h1 {
  margin: 0 0 0.75rem;
  font-size: 2.5rem;
}

.about-lead {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.2rem;
  line-height: 1.5;
  color: #c6cdd6;
  margin: 0 0 1.5rem;
}

.about-story p,
.about-note {
  color: #aeb5bd;
}

.about-section {
  margin-top: 2.5rem;
}

.about-section-heading {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.about-section-number {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #89919b;
}

.about-section-heading h2 {
  margin: 0;
  font-size: 1.4rem;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}

.tool-card,
.security-card,
.profile-card {
  border: 1px solid #252a31;
  border-radius: 10px;
  background: #11151a;
  padding: 0.8rem 0.9rem;
}

.tool-card span {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
}

.tool-card small {
  color: #89919b;
  font-size: 0.78rem;
}

.tool-group {
  margin-bottom: 1rem;
}

.tool-group h3 {
  margin: 1rem 0 0.5rem;
  font-size: 0.95rem;
}

.tool-icon {
  width: 28px;
  height: 28px;
  display: block;
  margin-bottom: 0.4rem;
}

.tool-invert {
  filter: invert(1);
}

html[data-theme="light"] .tool-invert {
  filter: none;
}

.security-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
}

.security-card h3,
.profile-card h3 {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
}

.security-card p {
  margin: 0;
  font-size: 0.88rem;
  color: #aeb5bd;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
}

.profile-card img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  display: block;
}

.about-links {
  margin-top: 1rem;
  font-size: 0.9rem;
  text-align: center;
}

.eng-page {
  max-width: 720px;
  margin: 0 auto;
  color: #f3f5f8;
}

.post:has(.eng-page) .post-header h1,
.eng-page h1,
.eng-page h2,
.eng-page h3 {
  font-family: var(--font-sans);
  font-style: normal;
}

.eng-page h1 {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.eng-page h2 {
  font-weight: 700;
  letter-spacing: -0.01em;
}

.eng-page h3 {
  font-weight: 600;
}

.eng-page .about-lead {
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 1.05rem;
  line-height: 1.6;
  color: inherit;
}

.eng-page .about-story p,
.eng-page .about-note {
  color: inherit;
}

.eng-page .about-intro h1,
.eng-page .about-section-heading h2 {
  width: fit-content;
  background: #ffd84d;
  color: #101216;
  padding: 0.14em 0.42em;
  border-radius: 4px;
}

.eng-page .eng-card h3 {
  width: fit-content;
  background: #ffd84d;
  color: #101216;
  padding: 0.12em 0.42em;
  border-radius: 4px;
}

.eng-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
}

.eng-card {
  border: 1px solid #252a31;
  border-radius: 10px;
  background: #11151a;
  padding: 0.85rem 1rem;
}

.eng-card h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.eng-card p {
  margin: 0;
  font-size: 0.88rem;
  color: inherit;
}

.eng-card-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.4rem;
}

.eng-card-head h3 {
  margin: 0;
}

.eng-icon {
  width: 20px;
  height: 20px;
  flex: none;
  filter: invert(1);
  opacity: 0.85;
}

.eng-icon.is-brand {
  filter: none;
  opacity: 1;
}

.eng-node-title .eng-icon {
  width: 16px;
  height: 16px;
  vertical-align: -3px;
  margin-right: 0.35rem;
}

html[data-theme="light"] .eng-icon {
  filter: none;
}

.eng-page code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #8585ff;
  background: rgba(133, 133, 255, 0.1);
  padding: 1px 5px;
  border-radius: 4px;
  word-break: break-word;
}

.eng-flow {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: eng-step;
}

.eng-flow li {
  position: relative;
  margin-left: 0.7rem;
  padding: 0 0 1.1rem 2.1rem;
  border-left: 1px solid #252a31;
}

.eng-flow li:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}

.eng-flow li::before {
  counter-increment: eng-step;
  content: counter(eng-step, decimal-leading-zero);
  position: absolute;
  left: -0.85rem;
  top: 0.1rem;
  width: 1.7rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: #8585ff;
  background: #0b0d10;
}

.eng-flow strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.eng-flow p {
  margin: 0;
  font-size: 0.9rem;
  color: inherit;
}

.eng-note {
  border-left: 3px solid #ffd84d;
  background: rgba(255, 216, 77, 0.07);
  border-radius: 0 8px 8px 0;
  padding: 0.8rem 1rem;
  margin: 1.25rem 0;
  font-size: 0.9rem;
  color: inherit;
}

.eng-note p {
  margin: 0;
}

.eng-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-top: 1rem;
}

.eng-metric {
  border: 1px solid #252a31;
  border-radius: 10px;
  background: #11151a;
  padding: 0.7rem 0.5rem;
  text-align: center;
}

.eng-metric-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  color: #ffd84d;
}

.eng-metric-label {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.72rem;
  color: #89919b;
}

.eng-figure {
  border: 1px solid #252a31;
  border-radius: 12px;
  background: #11151a;
  padding: 1.15rem 1rem;
  margin: 1.5rem 0;
}

.eng-figure-caption {
  margin: 0.9rem 0 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #89919b;
  text-align: center;
}

.eng-chart {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.eng-node {
  width: 100%;
  max-width: 430px;
  border: 1px solid #2f3742;
  border-radius: 9px;
  background: #151a21;
  padding: 0.5rem 0.85rem;
  text-align: center;
}

.eng-node-title {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
}

.eng-node-sub {
  display: block;
  font-size: 0.76rem;
  color: #89919b;
  margin-top: 0.1rem;
}

.eng-node.is-accent {
  border-color: #ffd84d;
  background: rgba(255, 216, 77, 0.08);
}

.eng-node.is-accent .eng-node-title {
  color: #ffd84d;
}

.eng-node.is-muted .eng-node-title {
  color: #b6bdc6;
  font-weight: 500;
}

.eng-arrow {
  font-size: 0.82rem;
  line-height: 1;
  color: #6c7681;
}

.eng-pair {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  width: 100%;
}

.eng-pair .eng-node {
  width: auto;
  flex: 1 1 190px;
  max-width: 300px;
}

.eng-bucket {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.28rem;
  border: 1px dashed #3a434e;
  border-radius: 9px;
  padding: 0.5rem 0.6rem;
  max-width: 260px;
  margin: 0 auto;
}

.eng-token {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffd84d;
}

.eng-token.is-spent {
  background: transparent;
  border: 1px dashed #4b5560;
}

.eng-legend {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 0.75rem;
  font-size: 0.78rem;
  color: #89919b;
}

.eng-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.eng-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffd84d;
}

.eng-swatch.is-spent {
  background: transparent;
  border: 1px dashed #4b5560;
}

@media (max-width: 640px) {
  .eng-grid,
  .eng-metrics {
    grid-template-columns: 1fr;
  }

  .eng-pair {
    flex-direction: column;
  }

  .eng-pair .eng-arrow {
    transform: rotate(90deg);
  }
}

.card {
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.card:hover {
  border-color: #3a434e;
}

.prose {
  font-size: 1rem;
  line-height: 1.75;
}

#post-comments-slot,
#post-comments-mid,
#post-comments-bottom,
#locked-comments-mid,
#locked-comments-bottom {
  max-width: 720px;
  margin: 2.5rem auto;
  text-align: center;
}

#post-comments-slot.in-content,
#post-comments-mid.in-content,
#locked-comments-mid.in-content {
  border-top: 1px solid #252a31;
  border-bottom: 1px solid #252a31;
  padding: 2rem 0;
}

/* ---------------- custom comment system ---------------- */

.post-comments {
  text-align: left;
}

.post-comments h2 {
  margin-bottom: 1rem;
}

.comment-form,
.comment {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.comment-avatar {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 8px;
  border: 1px solid #252a31;
  background: #131820;
}

.comment-form-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.commenting-as {
  font-size: 0.8rem;
  color: #e8b341;
}

.comment-form-main input[type="text"],
.comment-form-main textarea,
.comment-reply-form textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid #252a31;
  border-radius: 8px;
  background: #0f141b;
  color: inherit;
  font: inherit;
  font-size: 0.95rem;
}

.comment-form-main input[type="text"]:focus,
.comment-form-main textarea:focus,
.comment-reply-form textarea:focus {
  outline: 1px solid #4a90d9;
  border-color: #4a90d9;
}

.comment-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.comment-form-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.comment-status {
  font-size: 0.8rem;
  color: #89919b;
}

.comment-cancel-btn {
  background: none;
  border: none;
  color: #89919b;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  text-decoration: underline;
}

.comment {
  padding: 0.85rem 1rem;
  border: 1px solid #1d232c;
  border-radius: 10px;
  background: #0d1219;
}

.comment-admin {
  border-color: #6e5416;
  background: #171307;
}

.comment-main {
  flex: 1;
  min-width: 0;
}

.comment-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.comment-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.comment-badge-admin {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: linear-gradient(135deg, #e8b341, #c98a1b);
  color: #14100a;
}

.comment-badge-pending {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: #3a2a10;
  color: #e8b341;
  border: 1px solid #6e5416;
}

.comment.comment-pending {
  border-style: dashed;
  opacity: 0.85;
}

.comment-approve-btn,
.comment-delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  padding: 0;
}

.comment-approve-btn {
  color: #3fb68b;
}

.comment-approve-btn:hover {
  text-decoration: underline;
}

.comment-delete-btn {
  color: #d9635a;
}

.comment-delete-btn:hover {
  text-decoration: underline;
}

.comment-admin > .comment-main > .comment-head > .comment-name {
  color: #e8b341;
}

.comment-time {
  font-size: 0.75rem;
  color: #89919b;
}

.comment-body {
  margin: 0.4rem 0 0.5rem;
  font-size: 0.95rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.comment-actions {
  display: flex;
  gap: 0.75rem;
}

.comment-reply-btn {
  background: none;
  border: none;
  color: #4a90d9;
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  padding: 0;
}

.comment-reply-btn:hover {
  text-decoration: underline;
}

.comment-replies {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.comment-replies .comment {
  margin-bottom: 0;
}

.comment-replies .comment-avatar {
  width: 28px;
  height: 28px;
  min-width: 28px;
}

.comment-reply-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem;
  border: 1px dashed #2a313c;
  border-radius: 8px;
  margin-bottom: 0.75rem;
}

.comment-replying-as {
  font-size: 0.75rem;
  color: #89919b;
}

.comment-reply-row {
  display: flex;
}

.comment-empty {
  color: #89919b;
  font-size: 0.9rem;
  text-align: center;
  padding: 1.5rem 0;
}

html[data-theme="light"] .comment,
html[data-theme="light"] .comment-form-main input[type="text"],
html[data-theme="light"] .comment-form-main textarea,
html[data-theme="light"] .comment-reply-form textarea {
  background: #f0ede6;
  border-color: #d8d2c4;
}

html[data-theme="light"] .comment-avatar {
  background: #e6e1d5;
  border-color: #d8d2c4;
}

html[data-theme="light"] .comment-admin {
  background: #faf0d7;
  border-color: #e0c875;
}


html[data-theme="light"] #post-comments-slot.in-content,
html[data-theme="light"] #post-comments-mid.in-content,
html[data-theme="light"] #locked-comments-mid.in-content {
  border-color: #e2ddd0;
}

.prose img {
  border-radius: 8px;
}

.prose {
  -webkit-user-select: none;
  user-select: none;
}

.prose pre,
.prose pre code {
  -webkit-user-select: text;
  user-select: text;
}

.prose img {
  cursor: zoom-in;
}

.zoom-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 7, 10, 0.92);
  cursor: zoom-out;
  animation: zoom-fade-in 0.18s ease both;
}

.zoom-overlay img {
  max-width: 92vw;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

@keyframes zoom-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.page {
  max-width: 640px;
}

@media (max-width: 640px) {
  .tool-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .security-grid,
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .about-intro h1 {
    font-size: 2rem;
  }

  .site-nav-links {
    gap: 0.6rem;
  }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: auto;
}

.prose pre {
  position: relative;
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 10px;
  background: #0b0d10;
  border: 1px solid #252a31;
  color: #aeb5bd;
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  cursor: pointer;
}

.copy-btn:hover {
  border-color: #8585ff;
  color: #8585ff;
}

.copy-btn.copied {
  background: #22c55e;
  border-color: #22c55e;
  color: #fff;
}

.optional-comments {
  margin: 1.5rem 0;
  padding: 1rem;
  border: 1px dashed #252a31;
  border-radius: 10px;
  background: #11151a;
}

.optional-comments-title {
  margin: 0 0 0.35rem;
  font-weight: 700;
}

.optional-comments p:not(.optional-comments-title) {
  margin: 0 0 0.8rem;
  color: #aeb5bd;
  font-size: 0.9rem;
}

.consent-action-btn {
  border: 1px solid #8585ff;
  border-radius: 6px;
  padding: 0.5rem 0.85rem;
  background: rgba(133, 133, 255, 0.12);
  color: #8585ff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.consent-action-btn:hover {
  background: #8585ff;
  color: #fff;
}

/* ---------------------------------------------------------------- */
/* Simple 404 page                                                   */
/* ---------------------------------------------------------------- */
.button-secondary {
  background: transparent;
  color: #e7e9ec;
  border: 1px solid #343b44;
}

.button-secondary:hover {
  border-color: #8585ff;
  color: #8585ff;
}

.error-simple {
  text-align: center;
  padding: 4rem 1rem 5rem;
}

.error-simple-code {
  margin: 0;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: clamp(3.5rem, 14vw, 6rem);
  letter-spacing: -0.04em;
  color: #8585ff;
  line-height: 1;
}

.error-simple h1 {
  margin: 1rem 0 0.5rem;
  font-size: clamp(1.4rem, 4vw, 1.9rem);
}

.error-simple p {
  color: #a5abc2;
  max-width: 480px;
  margin: 0 auto;
}

.error-simple-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.notice-banner {
  background: none;
  color: #f5d78e;
  font-size: 0.85rem;
  line-height: 1.55;
  text-align: center;
}

.notice-banner-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0.4rem 2.75rem 0.4rem 1rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: center;
  position: relative;
}

.notice-banner-text {
  display: block;
  width: 100%;
}

.notice-banner-text strong {
  display: block;
  color: #ffe9b0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.1rem;
}

.notice-banner-text a {
  color: #ffe9b0;
  font-weight: 600;
}

.notice-banner-text s {
  opacity: 0.7;
}

/* Light mode: dark amber so the text stays readable on a light page. */
html[data-theme="light"] .notice-banner {
  color: #7a5a0a;
}

html[data-theme="light"] .notice-banner-text strong {
  color: #57400a;
}

html[data-theme="light"] .notice-banner-text a {
  color: #8a6408;
}

.notice-banner-close {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: inherit;
  border-radius: 6px;
  width: 26px;
  height: 26px;
  cursor: pointer;
  font-size: 0.8rem;
  line-height: 1;
  opacity: 0.4;
}

.notice-banner-close:hover {
  opacity: 1;
}

html[data-theme="light"] .notice-banner-close:hover {
  color: #57400a;
}

.discuss-strip {
  background: #141b2e;
  border-bottom: 1px solid #2b3a5e;
  color: #c9d6ff;
  font-size: 0.85rem;
  text-align: center;
  padding: 0.45rem 1rem;
}

.discuss-strip a {
  color: #fff;
  font-weight: 700;
}

html[data-theme="light"] .discuss-strip {
  background: #eef2ff;
  border-bottom-color: #c9d6ff;
  color: #2b3a5e;
}

html[data-theme="light"] .discuss-strip a {
  color: #2b3a5e;
}

html[data-theme="light"] body {
  background: #f6f4ee;
  color: #1a1d21;
}

html[data-theme="light"] .site-header {
  border-bottom-color: #e2ddd0;
  background: #f6f4ee;
}

html[data-theme="light"] .page-link:hover {
  background: rgba(0, 0, 0, 0.06);
}

html[data-theme="light"] .page-link-eng {
  background: #f5c518;
  color: #17181c;
}

html[data-theme="light"] .page-link-eng:hover {
  background: #ffd94a;
  color: #17181c;
}

html[data-theme="light"] .card {
  background: #fffdf8;
  border-color: #e2ddd0;
}

html[data-theme="light"] .meta {
  color: #5c6470;
}

html[data-theme="light"] .lead {
  color: #4a5058;
}

html[data-theme="light"] .prose pre {
  background: #1a1d21;
  color: #e7e9ec;
}

html[data-theme="light"] .code-window {
  border-color: #2a2f36;
}

html[data-theme="light"] .prose :not(pre) > code {
  background: rgba(76, 76, 200, 0.1);
  color: #3f3fb0;
  border-color: rgba(76, 76, 200, 0.25);
}

html[data-theme="light"] .prose table {
  border-color: #e2ddd0;
  background: #fff;
}

html[data-theme="light"] .prose thead {
  background: linear-gradient(135deg, rgba(76, 76, 200, 0.14), rgba(0, 150, 130, 0.12));
}

html[data-theme="light"] .prose th {
  color: #3f3fb0;
}

html[data-theme="light"] .prose th,
html[data-theme="light"] .prose td {
  border-bottom-color: #e2ddd0;
}

html[data-theme="light"] .prose tbody tr:nth-child(even) {
  background: rgba(76, 76, 200, 0.04);
}

html[data-theme="light"] .prose tbody tr:hover {
  background: rgba(76, 76, 200, 0.08);
}

html[data-theme="light"] input {
  background: #fff;
  border-color: #d4cFC2;
  color: #1a1d21;
}

html[data-theme="light"] .button {
  background: #1a1d21;
  color: #f6f4ee;
}

html[data-theme="light"] .site-footer {
  border-top-color: #e2ddd0;
  color: #5c6470;
}

html[data-theme="light"] .theme-toggle,
html[data-theme="light"] .nav-toggle {
  border-color: #d4cfc2;
}

html[data-theme="light"] .about-lead {
  color: #3d434c;
}

html[data-theme="light"] .about-story p,
html[data-theme="light"] .about-note {
  color: #4a5058;
}

html[data-theme="light"] .about-kicker,
html[data-theme="light"] .about-section-number {
  color: #6b7280;
}

html[data-theme="light"] .tool-card,
html[data-theme="light"] .security-card,
html[data-theme="light"] .profile-card {
  background: #fffdf8;
  border-color: #e2ddd0;
  color: #1a1d21;
}

html[data-theme="light"] .tool-card small {
  color: #6b7280;
}

html[data-theme="light"] .security-card p {
  color: #4a5058;
}

html[data-theme="light"] .tool-group h3 {
  color: #1a1d21;
}

html[data-theme="light"] .eng-page {
  color: #101216;
}

html[data-theme="light"] .eng-card,
html[data-theme="light"] .eng-metric {
  background: #fffdf8;
  border-color: #e2ddd0;
}

html[data-theme="light"] .eng-flow li {
  border-left-color: #e2ddd0;
}

html[data-theme="light"] .eng-flow li:last-child {
  border-left-color: transparent;
}

html[data-theme="light"] .eng-flow li::before {
  background: #f6f4ee;
}

html[data-theme="light"] .eng-metric-label {
  color: #5c6470;
}

html[data-theme="light"] .eng-metric-value {
  color: #7a6000;
}

html[data-theme="light"] .eng-figure {
  background: #fffdf8;
  border-color: #e2ddd0;
}

html[data-theme="light"] .eng-node {
  background: #fbf9f4;
  border-color: #e2ddd0;
}

html[data-theme="light"] .eng-node-sub,
html[data-theme="light"] .eng-figure-caption,
html[data-theme="light"] .eng-legend {
  color: #5c6470;
}

html[data-theme="light"] .eng-node.is-accent {
  background: rgba(255, 216, 77, 0.22);
}

html[data-theme="light"] .eng-node.is-accent .eng-node-title {
  color: #7a6000;
}

html[data-theme="light"] .eng-node.is-muted .eng-node-title {
  color: #4a5058;
}

html[data-theme="light"] .eng-arrow {
  color: #8a919b;
}

html[data-theme="light"] .eng-bucket {
  border-color: #ddd7c8;
}

html[data-theme="light"] .eng-token.is-spent,
html[data-theme="light"] .eng-swatch.is-spent {
  border-color: #b9b2a2;
}

.notice-card {
  border: 1px solid #252a31;
  border-radius: 10px;
  background: #11151a;
  padding: 1.25rem;
  margin: 1.5rem 0;
}

html[data-theme="light"] .notice-card {
  background: #fffdf8;
  border-color: #e2ddd0;
}

.policy-warning {
  border: 1px solid rgba(255, 95, 87, 0.5);
  border-radius: 10px;
  background: rgba(255, 95, 87, 0.1);
  padding: 0.9rem 1.1rem;
  margin: 1.2rem 0 0;
  font-size: 0.92rem;
  line-height: 1.55;
}

.policy-warning strong {
  color: #ff7b72;
}

.policy-warning a {
  color: #ff7b72;
  font-weight: 600;
}

html[data-theme="light"] .policy-warning {
  background: rgba(200, 40, 30, 0.07);
  border-color: rgba(200, 40, 30, 0.35);
}

html[data-theme="light"] .policy-warning strong,
html[data-theme="light"] .policy-warning a {
  color: #b3261e;
}

.machine-banner {
  position: relative;
  display: flex;
  min-height: 230px;
  border: 1px solid #252a31;
  border-radius: 14px;
  overflow: hidden;
  margin: 1.5rem 0 0;
  background: linear-gradient(115deg, #161c3f 0%, #0d3a3a 55%, #0a1512 100%);
  background-size: cover;
  background-position: center;
}

.machine-banner-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5, 8, 12, 0.05) 0%, rgba(5, 8, 12, 0.45) 55%, rgba(5, 8, 12, 0.9) 100%);
}

.machine-watermark {
  position: absolute;
  right: 0.5rem;
  bottom: -3.2rem;
  font-family: var(--font-mono);
  font-size: 11rem;
  font-weight: 800;
  line-height: 1;
  color: rgba(255, 255, 255, 0.07);
  pointer-events: none;
  user-select: none;
}

.machine-banner-inner {
  position: relative;
  width: 100%;
  margin-top: auto;
  padding: 1.1rem 1.3rem;
}

.machine-name {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #f2f4f8;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

.machine-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.45rem;
}

.machine-platform {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.65);
}

.machine-monogram {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 1.7rem;
  font-weight: 800;
  color: #0b1220;
  background: linear-gradient(135deg, #8585ff, #00d1b2);
}

.machine-box {
  flex-shrink: 0;
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #252a31;
}

.machine-name {
  font-size: 1.25rem;
  font-weight: 700;
}

.machine-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.35rem;
}

.machine-platform {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8b93a0;
}

.diff {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.diff-easy {
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(34, 197, 94, 0.12);
}

.diff-medium {
  color: #f5a524;
  border-color: rgba(245, 165, 36, 0.5);
  background: rgba(245, 165, 36, 0.12);
}

.diff-hard {
  color: #ff5f57;
  border-color: rgba(255, 95, 87, 0.5);
  background: rgba(255, 95, 87, 0.12);
}

.diff-insane {
  color: #c084fc;
  border-color: rgba(192, 132, 252, 0.5);
  background: rgba(192, 132, 252, 0.12);
}

.machine-completion {
  width: 100%;
  border-radius: 12px;
  border: 1px solid #252a31;
  margin: 1rem 0 0;
}

html[data-theme="light"] .machine-banner {
  border-color: #2a2f36;
}

html[data-theme="light"] .machine-completion {
  border-color: #e2ddd0;
}

.feedback {
  border: 1px solid #252a31;
  border-radius: 12px;
  background: #11151a;
  padding: 1.25rem;
  margin: 2rem 0 0;
  text-align: center;
}

.feedback h2 {
  font-size: 1.05rem;
  margin: 0 0 0.3rem;
}

.feedback-meta {
  color: #8b93a0;
  font-size: 0.85rem;
  margin: 0 0 0.9rem;
}

.feedback-buttons {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
}

.feedback-btn {
  background: #0b0d10;
  border: 1px solid #252a31;
  color: #e7e9ec;
  border-radius: 8px;
  padding: 0.5rem 1.2rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.feedback-btn:hover:not(:disabled) {
  border-color: #8585ff;
  color: #8585ff;
}

.feedback-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.feedback-thanks {
  color: #22c55e;
  font-size: 0.85rem;
  margin: 0.7rem 0 0;
}

.chart-card {
  border: 1px solid #252a31;
  border-radius: 12px;
  background: #11151a;
  padding: 1.25rem;
  margin: 1.5rem 0;
}

.chart-card h2 {
  font-size: 1rem;
  margin: 0 0 0.8rem;
}

.chart-card canvas {
  max-height: 260px;
}

html[data-theme="light"] .feedback,
html[data-theme="light"] .chart-card {
  background: #fffdf8;
  border-color: #e2ddd0;
}

html[data-theme="light"] .feedback-btn {
  background: #fff;
  border-color: #d4cfc2;
  color: #1a1d21;
}

html[data-theme="light"] .feedback-meta {
  color: #5c6470;
}

.discuss-notice {
  border: 1px solid #252a31;
  border-radius: 10px;
  background: #11151a;
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  text-align: left;
}

.discuss-notice strong {
  display: block;
  margin-bottom: 0.15rem;
}

.discuss-notice a {
  color: #8585ff;
  font-weight: 600;
}

html[data-theme="light"] .discuss-notice {
  background: #fffdf8;
  border-color: #e2ddd0;
}

.contact-grid {
  margin-top: 1.5rem;
  display: grid;
  gap: 1rem;
  max-width: 560px;
}

.contact-card {
  padding: 1rem 1.25rem;
  background: #11151a;
  border: 1px solid #252a31;
  border-radius: 12px;
}

.contact-card strong {
  display: block;
  margin-bottom: 0.25rem;
  color: #8585ff;
}

.contact-card a {
  color: inherit;
  overflow-wrap: anywhere;
}

html[data-theme="light"] .contact-card {
  background: #fffdf8;
  border-color: #e2ddd0;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  margin: 1.5rem auto;
  max-width: 600px;
}

.pagination .page-link {
  display: inline-block;
  padding: 0.45rem 0.75rem;
  border: 1px solid #252a31;
  border-radius: 6px;
  background: #11151a;
  color: #e7e9ec;
  text-decoration: none;
  font-size: 0.85rem;
}

.pagination .page-link:hover {
  border-color: #8585ff;
  color: #8585ff;
}

.pagination .page-link.is-active {
  background: #8585ff;
  color: #fff;
  border-color: #8585ff;
}

html[data-theme="light"] .pagination .page-link {
  background: #fffdf8;
  border-color: #e2ddd0;
  color: #1a1d21;
}

html[data-theme="light"] .pagination .page-link:hover {
  border-color: #8585ff;
  color: #8585ff;
}

html[data-theme="light"] .pagination .page-link.is-active {
  background: #1a1d21;
  color: #f6f4ee;
}

.tag-list,
.archive-list,
.related-list {
  display: grid;
  gap: 0.75rem;
}

.tag-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.9rem;
  border: 1px solid #252a31;
  border-radius: 8px;
  background: #11151a;
}

.tag-item a {
  color: inherit;
  text-decoration: none;
  font-weight: 500;
}

.tag-item span {
  color: #89919b;
  font-size: 0.85rem;
}

.archive-entry {
  padding: 0.8rem 0.9rem;
  border: 1px solid #252a31;
  border-radius: 10px;
  background: #11151a;
}

.archive-entry h3 {
  margin: 0 0 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.archive-count {
  font-size: 0.75rem;
  font-weight: 400;
  color: #89919b;
  border: 1px solid #252a31;
  border-radius: 999px;
  padding: 0 0.5rem;
}

.archive-entry .meta {
  font-size: 0.85rem;
  color: #89919b;
}

.archive-posts {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: grid;
}

.archive-posts li {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  padding: 0.45rem 0;
  border-top: 1px solid #252a31;
}

.archive-posts li:first-child {
  border-top: 0;
}

.archive-posts time {
  flex: none;
  width: 3rem;
  font-size: 0.8rem;
  color: #89919b;
  font-variant-numeric: tabular-nums;
}

.archive-posts a {
  color: inherit;
  text-decoration: none;
  font-weight: 500;
}

.archive-posts a:hover {
  text-decoration: underline;
}

.archive-platform {
  margin-left: auto;
  flex: none;
  font-size: 0.72rem;
  color: #89919b;
}

.related-card {
  padding: 0.8rem 0.9rem;
  border: 1px solid #252a31;
  border-radius: 10px;
  background: #11151a;
}

.related-card h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.related-card a {
  color: inherit;
  text-decoration: none;
}

.related-card .tags {
  font-size: 0.78rem;
  color: #89919b;
}

.tags-badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  background: rgba(133, 133, 255, 0.12);
  color: #8585ff;
  font-size: 0.72rem;
  margin-right: 0.3rem;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}

.tool-card,
.security-card,
.profile-card,
.post-list .card,
.related-card,
.archive-entry,
.tag-item {
  border-color: #252a31;
}

html[data-theme="light"] .related-card,
html[data-theme="light"] .archive-entry,
html[data-theme="light"] .tag-item {
  background: #fffdf8;
  border-color: #e2ddd0;
  color: #1a1d21;
}

html[data-theme="light"] .related-card .tags,
html[data-theme="light"] .archive-entry .meta,
html[data-theme="light"] .tag-item span {
  color: #6b7280;
}

.cookie-consent {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  max-width: 400px;
  width: calc(100% - 2rem);
  border: 1px solid #2b3a5e;
  border-radius: 10px;
  background: #141b2e;
  color: #c9d6ff;
  padding: 0.9rem 1.1rem;
  font-size: 0.82rem;
  line-height: 1.5;
  z-index: 9999;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.cookie-consent p {
  margin: 0 0 0.6rem;
}

.cookie-consent p:last-child {
  margin-bottom: 0;
}

.cookie-consent a {
  color: #fff;
  font-weight: 600;
}

.cookie-consent button {
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  border: 1px solid #2b3a5e;
  background: #2b3a5e;
  color: #fff;
  cursor: pointer;
  font-size: 0.82rem;
}

.cookie-consent button:hover {
  background: #3b4a6e;
}

@media (max-width: 640px) {
  .cookie-consent {
    right: 0.5rem;
    bottom: 0.5rem;
    width: calc(100% - 1rem);
    max-width: none;
  }
}

@media (max-width: 640px) {
  .tool-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .pagination .page-link {
    padding: 0.35rem 0.6rem;
    font-size: 0.8rem;
  }
}

@media (min-width: 641px) {
  .tag-list {
    display: grid;
    gap: 0.75rem;
  }
  .archive-list {
    display: grid;
    gap: 0.75rem;
  }
  .related-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
  }
}

.toc {
  max-width: 320px;
  margin: 1rem 0 2rem;
  border: 1px solid #252a31;
  border-radius: 8px;
  background: #11151a;
  padding: 0.75rem;
}

.toc details summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
}

.toc ul {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
  list-style: none;
}

.toc li {
  margin: 0.25rem 0;
}

.toc a {
  color: #c9d6ff;
  font-size: 0.85rem;
  text-decoration: none;
}

.toc a:hover {
  color: #fff;
}

html[data-theme="light"] .toc {
  border-color: #e2ddd0;
  background: #fffdf8;
}

html[data-theme="light"] .toc a {
  color: #2b3a5e;
}

html[data-theme="light"] .toc a:hover {
  color: #8585ff;
}



.post-feedback {
  margin: 2rem 0 1rem;
  padding: 1.25rem 1.25rem 1rem;
  border: 1px solid #252a31;
  border-radius: 12px;
  background: #11151a;
  text-align: center;
}

html[data-theme="light"] .post-feedback {
  border-color: #e2ddd0;
  background: #fffdf8;
}

.post-feedback h2 {
  font-size: 1.1rem;
  margin: 0 0 0.75rem;
}

.feedback-buttons {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
}

.feedback-btn {
  padding: 0.5rem 1.1rem;
  border-radius: 8px;
  border: 1px solid #2c333c;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.feedback-btn:hover:not(:disabled) {
  border-color: #8585ff;
}

.feedback-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.feedback-status {
  font-size: 0.82rem;
  color: #89919b;
  margin: 0.6rem 0 0;
  min-height: 1.2em;
}

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 2.5rem 0 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid #252a31;
}

html[data-theme="light"] .post-nav {
  border-top-color: #e2ddd0;
}

.post-nav-link {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  max-width: 48%;
  text-decoration: none;
  color: inherit;
}

.post-nav-older {
  text-align: right;
  margin-left: auto;
}

.post-nav-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #89919b;
}

.post-nav-title {
  font-weight: 600;
}

.post-nav-link:hover .post-nav-title {
  text-decoration: underline;
}

.card-meta {
  font-size: 0.82rem;
  color: #89919b;
  margin-top: 0.4rem;
}

.card-author {
  color: #c5cbf7;
  font-weight: 500;
}

html[data-theme="light"] .card-author {
  color: #5b5ec9;
}

.card-meta time {
  color: inherit;
}

.archive-author {
  font-size: 0.78rem;
  color: #c5cbf7;
  font-style: italic;
  margin-left: 0.35rem;
}

html[data-theme="light"] .archive-author {
  color: #5b5ec9;
}

.archive-readtime {
  font-size: 0.78rem;
  color: #89919b;
  margin-left: 0.5rem;
}

.post-comments {
  max-width: 100%;
  overflow-x: hidden;
}

.post-comments iframe {
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

.bx-skeleton {
  position: fixed;
  inset: 0;
  z-index: 10040;
  background: #0b0d10;
  overflow: hidden;
}

.bx-skeleton[hidden] {
  display: none;
}

html[data-theme="light"] .bx-skeleton {
  background: #f6f4ee;
}

.bx-skeleton-inner {
  max-width: 720px;
  margin: 5rem auto 0;
  padding: 0 1rem;
  display: grid;
  gap: 0.9rem;
}

.sk {
  border-radius: 8px;
  background: linear-gradient(90deg, #1a2027 25%, #252d36 50%, #1a2027 75%);
  background-size: 200% 100%;
  animation: bx-shimmer 1.2s ease-in-out infinite;
}

html[data-theme="light"] .sk {
  background: linear-gradient(90deg, #e8e2d4 25%, #f4efe2 50%, #e8e2d4 75%);
  background-size: 200% 100%;
}

.sk-title { height: 2rem; width: 60%; }
.sk-line { height: 0.9rem; }
.sk-line.short { width: 45%; }
.sk-card { height: 5.5rem; }

@keyframes bx-shimmer {
  to { background-position: -200% 0; }
}

.bx-spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  opacity: 0.8;
  animation: bx-spin 0.7s linear infinite;
}

@keyframes bx-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .sk, .bx-spinner { animation: none; }
  .prose img.lozad { transition: none; }
}
