/*
 * Nebula 3.7.0 — Interactive Workbench
 * A restrained glass terminal theme for emlog.
 */

:root {
  color-scheme: dark;
  --accent: #7ee787;
  --accent-rgb: 126, 231, 135;
  --accent-strong: var(--accent);
  --syntax-blue: #82aaff;
  --syntax-purple: #c792ea;
  --syntax-amber: #ffcb6b;
  --syntax-red: #ff7b8b;
  --syntax-cyan: #7fdbca;
  --danger: #ff6b7a;

  --bg: #0a0e0f;
  --bg-deep: #06090a;
  --bg-raised: #0e1315;
  --surface: #111719;
  --surface-2: #151c1f;
  --surface-3: #1b2427;
  --glass: rgba(15, 21, 23, 0.82);
  --glass-strong: rgba(17, 23, 25, 0.94);
  --glass-soft: rgba(221, 239, 235, 0.035);
  --line: rgba(188, 213, 207, 0.12);
  --line-strong: rgba(188, 213, 207, 0.22);
  --line-accent: rgba(var(--accent-rgb), 0.42);

  --text: #e7eeec;
  --text-soft: #aab7b5;
  --text-dim: #6e7d7c;
  --text-inverse: #06100a;
  --code-comment: #667572;

  --editor-rail: #0b1012;
  --editor-bar: #0d1315;
  --editor-code: #0a0f11;
  --editor-active: #151d20;
  --editor-gutter: #0d1315;

  --shadow-panel: 0 18px 48px rgba(0, 0, 0, 0.3);
  --shadow-float: 0 24px 72px rgba(0, 0, 0, 0.42);
  --shadow-reader: 0 16px 42px rgba(0, 0, 0, 0.2);
  --shadow-compact: 0 10px 26px rgba(0, 0, 0, 0.2);
  --shadow-inner: inset 0 1px 0 rgba(255, 255, 255, 0.055);

  --radius-control: 8px;
  --radius-panel: 12px;
  --radius-shell: 16px;
  --header-h: 76px;
  --sidebar-w: 304px;
  --max: 1280px;
  --blur: blur(10px) saturate(112%);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-ui: cubic-bezier(0.2, 0, 0, 1);
  --font-ui: "MiSans", "HarmonyOS Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "Maple Mono", "Cascadia Code", "JetBrains Mono", "SFMono-Regular", Consolas, monospace;

  /* Compatibility aliases used by markdown.css and plugins */
  --border: var(--line);
  --border-strong: var(--line-strong);
}

html[data-theme="light"] {
  color-scheme: light;
  --accent-strong: #24763a;
  --syntax-blue: #315cbb;
  --syntax-purple: #7c3ba8;
  --syntax-amber: #8b5a00;
  --syntax-red: #b4233a;
  --syntax-cyan: #08766d;
  --bg: #e8ecef;
  --bg-deep: #dde3e7;
  --bg-raised: #f1f4f6;
  --surface: #fafbfc;
  --surface-2: #f3f5f7;
  --surface-3: #e9edf0;
  --glass: rgba(250, 252, 253, 0.86);
  --glass-strong: rgba(252, 253, 254, 0.96);
  --glass-soft: rgba(45, 61, 70, 0.04);
  --line: rgba(46, 63, 72, 0.14);
  --line-strong: rgba(46, 63, 72, 0.24);
  --line-accent: rgba(36, 118, 58, 0.34);
  --text: #1c272c;
  --text-soft: #506068;
  --text-dim: #75838a;
  --text-inverse: #09210f;
  --code-comment: #718087;
  --editor-rail: #e5eaee;
  --editor-bar: #eef1f4;
  --editor-code: #f8fafb;
  --editor-active: #ffffff;
  --editor-gutter: #f0f3f5;
  --shadow-panel: 0 16px 40px rgba(45, 58, 66, 0.1);
  --shadow-float: 0 22px 62px rgba(45, 58, 66, 0.16);
  --shadow-reader: 0 14px 36px rgba(45, 58, 66, 0.09);
  --shadow-compact: 0 8px 22px rgba(45, 58, 66, 0.11);
  --shadow-inner: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

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

html {
  overflow-x: clip;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 22px);
  scrollbar-gutter: stable;
}

body.nb-body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.nb-lock {
  overflow: hidden;
}

::selection {
  background: rgba(var(--accent-rgb), 0.26);
  color: var(--text);
}

a {
  color: var(--accent-strong);
  text-decoration: none;
  transition:
    color 160ms var(--ease-ui),
    border-color 160ms var(--ease-ui),
    background-color 160ms var(--ease-ui),
    opacity 160ms var(--ease-ui),
    transform 160ms var(--ease-ui);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

button,
input,
textarea,
select {
  color: inherit;
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

hr {
  margin: 16px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

:where(a, button, input, textarea, select, [tabindex]):focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.nb-skip-link {
  position: fixed;
  z-index: 2000;
  top: 10px;
  left: 14px;
  padding: 10px 15px;
  border-radius: var(--radius-control);
  background: var(--accent);
  color: var(--text-inverse);
  font-weight: 800;
  transform: translateY(-160%);
  transition: transform 160ms var(--ease-ui);
}

.nb-skip-link:focus {
  transform: none;
}

.nb-container {
  width: min(var(--max), calc(100% - 40px));
  margin-inline: auto;
}

/* ---------- Atmospheric canvas ---------- */
.nb-bg {
  position: fixed;
  z-index: -2;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(900px 620px at 8% -8%, rgba(var(--accent-rgb), 0.12), transparent 62%),
    radial-gradient(760px 540px at 98% 90%, rgba(255, 189, 92, 0.065), transparent 66%),
    linear-gradient(145deg, var(--bg-deep), var(--bg) 46%, var(--bg-raised));
}

.nb-grid {
  position: absolute;
  inset: 0;
  opacity: 0.32;
  background-image:
    linear-gradient(rgba(200, 255, 218, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(200, 255, 218, 0.035) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, #000 0, rgba(0, 0, 0, 0.78) 55%, transparent 100%);
}

html[data-theme="light"] .nb-grid {
  opacity: 0.55;
  background-image:
    linear-gradient(rgba(20, 80, 42, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 80, 42, 0.045) 1px, transparent 1px);
}

.nb-glow {
  position: absolute;
  border-radius: 50%;
  opacity: 1;
}

.nb-glow-a {
  width: 620px;
  height: 620px;
  top: 4%;
  left: -340px;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.1), transparent 68%);
}

.nb-glow-b {
  width: 520px;
  height: 520px;
  right: -270px;
  bottom: -8%;
  background: radial-gradient(circle, rgba(215, 155, 71, 0.075), transparent 68%);
}

.nb-noise {
  position: absolute;
  inset: 0;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.75'/%3E%3C/svg%3E");
}

.nb-progress {
  position: fixed;
  z-index: 1200;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, var(--accent), var(--syntax-amber));
  box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.5);
  will-change: transform;
}

/* ---------- Header / navigation ---------- */
.nb-header {
  position: sticky;
  z-index: 300;
  top: 0;
  height: var(--header-h);
  padding-top: 10px;
  pointer-events: none;
}

.nb-header-shell {
  pointer-events: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--glass-strong);
  box-shadow: var(--shadow-inner);
  -webkit-backdrop-filter: blur(8px) saturate(108%);
  backdrop-filter: blur(8px) saturate(108%);
  transition:
    background-color 220ms var(--ease-ui),
    border-color 220ms var(--ease-ui),
    box-shadow 220ms var(--ease-ui),
    transform 220ms var(--ease-ui);
}

.nb-header.is-scrolled .nb-header-shell {
  border-color: var(--line-strong);
  background: var(--surface);
  box-shadow: var(--shadow-compact), var(--shadow-inner);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.nb-header-inner {
  display: flex;
  align-items: center;
  min-height: 54px;
  padding: 0 8px 0 12px;
  gap: 16px;
}

.nb-brand {
  flex: 0 1 auto;
  min-width: 0;
}

.nb-logo {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 11px;
  color: var(--text);
}

.nb-logo:hover {
  color: var(--text);
}

.nb-logo-mark {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  overflow: hidden;
  border: 1px solid var(--line-accent);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.14), transparent 65%),
    var(--surface-2);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.035);
  color: var(--accent);
  font-family: var(--font-mono);
}

.nb-logo-mark::before {
  content: ">";
  transform: translate(-3px, -1px);
  font-size: 15px;
  font-weight: 800;
}

.nb-logo-mark::after {
  content: "_";
  position: absolute;
  left: 19px;
  bottom: 8px;
  font-size: 12px;
  font-weight: 900;
  animation: nb-cursor 1.2s steps(1) infinite;
}

.nb-logo-mark i {
  position: absolute;
  inset: 4px;
  border-top: 1px solid rgba(var(--accent-rgb), 0.08);
  pointer-events: none;
}

@keyframes nb-cursor {
  0%,
  46% { opacity: 1; }
  47%,
  100% { opacity: 0; }
}

.nb-logo-text {
  display: grid;
  min-width: 0;
  line-height: 1.15;
}

.nb-logo-text strong {
  overflow: hidden;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.91rem;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nb-logo-text strong > span {
  color: var(--accent-strong);
}

.nb-logo-text small {
  overflow: hidden;
  max-width: 150px;
  margin-top: 3px;
  color: var(--text-dim);
  font-size: 0.66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nb-logo-img {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
}

.nb-logo-img img {
  width: auto;
  max-width: 172px;
  height: 34px;
}

.nb-nav {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.nb-nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
}

.nb-nav-item {
  position: relative;
}

.nb-nav-list > .nb-nav-item {
  display: flex;
  align-items: center;
}

.nb-nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 11px;
  border-radius: var(--radius-control);
  color: var(--text-soft);
  font-size: 0.84rem;
  font-weight: 650;
  white-space: nowrap;
}

.nb-nav-link:hover,
.nb-nav-link[aria-current="page"] {
  background: var(--glass-soft);
  color: var(--text);
}

.nb-nav-link[aria-current="page"]::before {
  width: 5px;
  height: 5px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.7);
  content: "";
}

.header-avatar {
  width: 24px;
  height: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  object-fit: cover;
}

.nb-submenu-toggle {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 34px;
  margin-left: -7px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
}

.nb-submenu-toggle:hover {
  background: var(--glass-soft);
  color: var(--text);
}

.nb-submenu-toggle svg {
  transition: transform 180ms var(--ease-ui);
}

.nb-nav-item.is-open > .nb-submenu-toggle svg {
  transform: rotate(180deg);
}

.nb-dropdown {
  position: absolute;
  z-index: 60;
  top: calc(100% + 9px);
  left: 0;
  display: grid;
  min-width: 190px;
  max-width: 280px;
  padding: 7px;
  list-style: none;
  visibility: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: var(--glass-strong);
  box-shadow: var(--shadow-float), var(--shadow-inner);
  opacity: 0;
  transform: translateY(7px) scale(0.98);
  transform-origin: top left;
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  transition:
    opacity 160ms var(--ease-ui),
    visibility 160ms var(--ease-ui),
    transform 160ms var(--ease-ui);
}

.nb-nav-item:hover > .nb-dropdown,
.nb-nav-item:focus-within > .nb-dropdown,
.nb-nav-item.is-open > .nb-dropdown {
  visibility: visible;
  opacity: 1;
  transform: none;
}

.nb-dropdown .nb-nav-link {
  width: 100%;
  min-height: 40px;
  padding-inline: 11px;
}

.nb-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.nb-icon-btn,
.nb-search-trigger {
  min-width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-soft);
  cursor: pointer;
  transition:
    color 160ms var(--ease-ui),
    border-color 160ms var(--ease-ui),
    background-color 160ms var(--ease-ui),
    transform 160ms var(--ease-ui);
}

.nb-icon-btn {
  display: inline-grid;
  place-items: center;
  padding: 0;
}

.nb-search-trigger {
  display: inline-flex;
  align-items: center;
  min-width: 126px;
  padding: 0 8px 0 11px;
  gap: 8px;
}

.nb-search-trigger > span {
  font-size: 0.78rem;
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 6px;
  border: 1px solid var(--line-strong);
  border-bottom-color: rgba(255, 255, 255, 0.23);
  border-radius: 6px;
  background: var(--glass-soft);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  line-height: 1;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.18);
}

.nb-search-trigger kbd {
  margin-left: auto;
}

.nb-icon-btn:hover,
.nb-search-trigger:hover {
  border-color: var(--line-accent);
  background: rgba(var(--accent-rgb), 0.075);
  color: var(--accent-strong);
}

.nb-menu-btn {
  display: none;
}

html[data-theme="dark"] .icon-sun,
html[data-theme="light"] .icon-moon {
  display: none;
}

.nb-nav-mask {
  position: fixed;
  z-index: 280;
  inset: 0;
  visibility: hidden;
  background: rgba(2, 8, 5, 0.58);
  opacity: 0;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  transition:
    opacity 200ms var(--ease-ui),
    visibility 200ms var(--ease-ui);
}

.nb-nav-mask.is-open {
  visibility: visible;
  opacity: 1;
}

/* ---------- Command palette ---------- */
.nb-search {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: start center;
  padding: min(14vh, 130px) 18px 24px;
  visibility: hidden;
  background: rgba(2, 7, 5, 0.62);
  opacity: 0;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition:
    opacity 200ms var(--ease-ui),
    visibility 200ms var(--ease-ui);
}

html[data-theme="light"] .nb-search {
  background: rgba(219, 230, 222, 0.7);
}

.nb-search.is-open {
  visibility: visible;
  opacity: 1;
}

.nb-search-panel {
  width: min(650px, 100%);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: var(--glass-strong);
  box-shadow: var(--shadow-float), var(--shadow-inner);
  transform: translateY(-12px) scale(0.985);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  transition: transform 240ms var(--ease);
}

.nb-search.is-open .nb-search-panel {
  transform: none;
}

.nb-search-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px 14px;
}

.nb-search-overline {
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.nb-search-head h2 {
  margin: 3px 0 0;
  font-size: 1.15rem;
  line-height: 1.3;
}

.nb-search-close {
  min-width: 44px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--glass-soft);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  cursor: pointer;
}

.nb-search-form {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  margin: 0 14px;
  padding: 7px 7px 7px 15px;
  border: 1px solid var(--line-accent);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.055);
  color: var(--accent-strong);
}

.nb-search-form:focus-within {
  border-color: var(--line-accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.09);
}

.nb-search-form input {
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.92rem;
}

.nb-search-form input::placeholder {
  color: var(--text-dim);
}

.nb-search-form button {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  gap: 8px;
  border: 0;
  border-radius: 9px;
  background: var(--accent);
  color: var(--text-inverse);
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.nb-search-tip {
  display: flex;
  padding: 12px 22px 18px;
  gap: 18px;
  color: var(--text-dim);
  font-size: 0.72rem;
}

.nb-search-tip span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ---------- Main layout ---------- */
.nb-main {
  padding: 22px 0 84px;
}

.nb-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--sidebar-w);
  align-items: start;
  gap: 24px;
}

.nb-layout-reading {
  grid-template-columns: minmax(0, 1fr);
}

.nb-layout-reading > .nb-sidebar {
  display: none;
}

.nb-content {
  min-width: 0;
}

/* ---------- Hero workbench ---------- */
.nb-hero {
  margin-bottom: 32px;
}

.nb-workbench {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-shell);
  background:
    linear-gradient(145deg, rgba(var(--accent-rgb), 0.035), transparent 54%),
    var(--surface);
  box-shadow: var(--shadow-panel), var(--shadow-inner);
}

.nb-workbench::before {
  position: absolute;
  z-index: 0;
  top: -180px;
  left: 18%;
  width: 470px;
  height: 310px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(var(--accent-rgb), 0.09), transparent 70%);
  content: "";
  pointer-events: none;
}

.nb-workbench-bar {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(150px, auto) 1fr auto;
  align-items: center;
  min-height: 48px;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.12);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

html[data-theme="light"] .nb-workbench-bar {
  background: rgba(20, 53, 35, 0.025);
}

.nb-workbench-tab {
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  padding: 0 18px;
  gap: 8px;
  border-right: 1px solid var(--line);
  border-top: 2px solid var(--accent);
  background: var(--glass-soft);
  color: var(--text-soft);
}

.nb-workbench-tab svg {
  color: var(--syntax-amber);
}

.nb-workbench-tab i {
  width: 5px;
  height: 5px;
  margin-left: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.nb-workbench-path {
  overflow: hidden;
  padding: 0 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nb-branch {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 18px;
  gap: 7px;
  border-left: 1px solid var(--line);
}

.nb-branch > span {
  color: var(--accent-strong);
  font-size: 0.95rem;
}

.nb-hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(310px, 0.88fr);
  align-items: stretch;
  min-height: 390px;
}

.nb-hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: clamp(38px, 5vw, 66px);
}

.nb-hero-kicker {
  display: inline-flex;
  align-items: center;
  margin-bottom: 18px;
  gap: 8px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.nb-hero-kicker i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.1), 0 0 14px rgba(var(--accent-rgb), 0.55);
}

.nb-hero-kicker span {
  color: var(--line-strong);
}

.nb-hero-title {
  max-width: 760px;
  margin: 0;
  color: var(--text);
  font-size: clamp(2.45rem, 5vw, 4.55rem);
  font-weight: 760;
  line-height: 1.06;
  letter-spacing: -0.055em;
  text-wrap: balance;
}

.nb-hero-title::first-letter {
  color: var(--accent-strong);
}

.nb-hero-description {
  max-width: 600px;
  margin: 22px 0 0;
  color: var(--text-soft);
  font-size: clamp(0.98rem, 1.5vw, 1.08rem);
  line-height: 1.85;
}

.nb-hero-actions {
  display: flex;
  flex-wrap: wrap;
  margin-top: 30px;
  gap: 10px;
}

.nb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 17px;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 0.84rem;
  font-weight: 760;
  cursor: pointer;
  transition:
    transform 160ms var(--ease-ui),
    color 160ms var(--ease-ui),
    background-color 160ms var(--ease-ui),
    border-color 160ms var(--ease-ui),
    box-shadow 160ms var(--ease-ui);
}

.nb-btn-primary {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 12px 28px rgba(var(--accent-rgb), 0.16);
  color: var(--text-inverse);
}

.nb-btn-primary:hover {
  background: color-mix(in srgb, var(--accent) 88%, white);
  color: var(--text-inverse);
  transform: translateY(-2px);
}

.nb-btn-ghost {
  border-color: var(--line-strong);
  background: var(--glass-soft);
  color: var(--text);
}

.nb-btn-ghost:hover {
  border-color: var(--line-accent);
  background: rgba(var(--accent-rgb), 0.065);
  color: var(--accent-strong);
  transform: translateY(-2px);
}

.nb-hero-stats {
  display: flex;
  flex-wrap: wrap;
  margin-top: 34px;
  gap: 8px 20px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.65rem;
}

.nb-hero-stats span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.nb-hero-stats strong {
  color: var(--text-soft);
  font-weight: 700;
}

.nb-hero-stats span:last-child strong {
  color: var(--accent-strong);
  font-size: 0.58rem;
}

.nb-editor {
  align-self: center;
  min-width: 0;
  margin: 30px 30px 30px 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 15px;
  background: rgba(4, 11, 8, 0.78);
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.28), var(--shadow-inner);
  transform: perspective(1000px) rotateY(-1.5deg);
}

html[data-theme="light"] .nb-editor {
  background: #122019;
  color-scheme: dark;
}

.nb-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 0 14px;
  border-bottom: 1px solid rgba(220, 255, 230, 0.09);
  background: rgba(255, 255, 255, 0.025);
  color: #82978b;
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.nb-editor-state {
  color: #75c77e;
  font-size: 0.61rem;
}

.nb-code-block {
  padding: 20px 0 22px;
  color: #dce8e0;
  font-family: var(--font-mono);
  font-size: clamp(0.7rem, 1.1vw, 0.8rem);
  line-height: 2;
}

.nb-code-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  min-height: 26px;
  padding-right: 16px;
}

.nb-code-row:hover {
  background: rgba(255, 255, 255, 0.025);
}

.nb-code-row > i {
  padding-right: 13px;
  color: #40534a;
  font-style: normal;
  text-align: right;
  user-select: none;
}

.nb-code-row code {
  overflow: hidden;
  color: #dce8e0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.syn-purple { color: #c792ea; font-weight: 500; }
.syn-blue { color: #82aaff; font-weight: 500; }
.syn-key { color: #89ddff; }
.syn-string { color: #c3e88d; }
.syn-green { color: #7ee787; }
.syn-number { color: #f78c6c; }
.syn-muted { color: #728779; }

.nb-code-comment code {
  color: #60766a;
  font-style: italic;
}

.nb-caret {
  display: inline-block;
  width: 7px;
  height: 1.1em;
  margin-left: 4px;
  vertical-align: -0.18em;
  background: var(--accent);
  animation: nb-cursor 1.2s steps(1) infinite;
}

/* ---------- Context / toolbar ---------- */
.nb-context {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  min-height: 150px;
  margin-bottom: 28px;
  padding: 34px 38px;
  gap: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-shell);
  background:
    linear-gradient(145deg, rgba(var(--accent-rgb), 0.025), transparent 52%),
    var(--surface);
  box-shadow: var(--shadow-inner);
}

.nb-context h1 {
  margin: 6px 0 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.nb-context-count {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.nb-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 16px;
}

.nb-toolbar-left {
  display: grid;
  gap: 4px;
}

.nb-section-kicker {
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.nb-section-title {
  margin: 0;
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1.3;
  letter-spacing: -0.025em;
}

.nb-filter-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
}

.nb-filter-label {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.64rem;
}

.nb-filter {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--glass);
}

.nb-filter button {
  min-height: 36px;
  padding: 0 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    color 150ms var(--ease-ui),
    background-color 150ms var(--ease-ui);
}

.nb-filter button:hover {
  color: var(--text);
}

.nb-filter button.is-active {
  background: rgba(var(--accent-rgb), 0.11);
  color: var(--accent-strong);
}

/* ---------- Explorer post list ---------- */
.nb-posts {
  overflow: hidden;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius-shell);
  background:
    linear-gradient(150deg, rgba(var(--accent-rgb), 0.025), transparent 48%),
    var(--surface);
  box-shadow: var(--shadow-panel), var(--shadow-inner);
}

.nb-card {
  position: relative;
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  min-height: 172px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.008);
  transition:
    background-color 190ms var(--ease-ui),
    transform 190ms var(--ease-ui);
}

.nb-card:first-child {
  border-radius: 17px 17px 0 0;
}

.nb-card:last-child {
  border-bottom: 0;
  border-radius: 0 0 17px 17px;
}

.nb-card:only-child {
  border-radius: 17px;
}

.nb-card.has-cover {
  grid-template-columns: 192px minmax(0, 1fr);
}

.nb-card.is-featured.has-cover {
  grid-template-columns: minmax(220px, 0.78fr) minmax(0, 1.22fr);
  min-height: 246px;
}

.nb-card.is-top::after {
  position: absolute;
  top: 0;
  right: 0;
  width: 44px;
  height: 44px;
  border-radius: 0 0 0 100%;
  background: rgba(var(--accent-rgb), 0.055);
  content: "";
  pointer-events: none;
}

.nb-card.is-hidden {
  display: none;
}

.nb-card-gutter {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 25px;
  gap: 7px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(90deg, transparent 49%, rgba(var(--accent-rgb), 0.045) 50%, transparent 51%);
}

.nb-ln {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
}

.nb-file-ext {
  color: rgba(var(--accent-rgb), 0.45);
  font-family: var(--font-mono);
  font-size: 0.58rem;
}

.nb-card-cover {
  position: relative;
  min-height: 172px;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: var(--surface-2);
}

.nb-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.82) contrast(1.03);
  transition:
    transform 500ms var(--ease),
    filter 300ms var(--ease-ui);
}

.nb-cover-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(4, 12, 8, 0.02), rgba(4, 12, 8, 0.32));
  pointer-events: none;
}

html[data-theme="light"] .nb-cover-shade {
  background: linear-gradient(135deg, transparent, rgba(17, 53, 31, 0.12));
}

.nb-card-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 22px 24px 19px;
}

.nb-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  min-height: 24px;
  margin-bottom: 8px;
  gap: 7px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.65rem;
}

.nb-meta-path {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 6px;
}

.nb-meta-sep {
  color: var(--line-strong);
}

.nb-sort a,
.nb-pill a,
.nb-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border: 1px solid rgba(var(--accent-rgb), 0.15);
  border-radius: 6px;
  background: rgba(var(--accent-rgb), 0.055);
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
}

.nb-top-flag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border: 1px solid rgba(255, 196, 102, 0.18);
  border-radius: 6px;
  background: rgba(255, 196, 102, 0.075);
  color: var(--syntax-amber);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 800;
}

.nb-window-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--glass-soft);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
}

.nb-card-title {
  max-width: 730px;
  margin: 0 0 9px;
  font-size: clamp(1.08rem, 2vw, 1.36rem);
  font-weight: 730;
  line-height: 1.42;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.is-featured .nb-card-title {
  font-size: clamp(1.3rem, 2.4vw, 1.68rem);
}

.nb-card-title a {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.nb-card-title a:hover {
  color: var(--accent-strong);
}

.nb-card-excerpt {
  display: -webkit-box;
  overflow: hidden;
  max-width: 760px;
  color: var(--text-soft);
  font-size: 0.86rem;
  line-height: 1.75;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.nb-card-excerpt p {
  margin: 0;
}

.nb-card-excerpt :is(img, pre, code, table, iframe, video, audio) {
  display: none !important;
}

.nb-card-foot {
  display: flex;
  align-items: center;
  min-height: 32px;
  margin-top: 14px;
  gap: 12px;
}

.nb-card-tags {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  min-width: 0;
  max-height: 28px;
  overflow: hidden;
  gap: 6px;
}

.nb-tag,
a.tags,
a.tags-side {
  display: inline-flex;
  align-items: center;
  max-width: 150px;
  min-height: 25px;
  padding: 0 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--glass-soft);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nb-tag:hover,
a.tags:hover,
a.tags-side:hover {
  border-color: var(--line-accent);
  color: var(--accent-strong);
}

.nb-card-signals {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 12px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.61rem;
}

.nb-card-more {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 32px;
  gap: 6px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 750;
}

.nb-card-more svg {
  transition: transform 180ms var(--ease-ui);
}

.nb-card-more:hover {
  color: var(--accent-strong);
}

.nb-card-more:hover svg {
  transform: translateX(3px);
}

.nb-filter-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  margin-top: 12px;
  gap: 10px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-panel);
  background: var(--glass);
  color: var(--text-dim);
  font-size: 0.86rem;
}

.nb-filter-empty > span {
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-weight: 800;
}

/* ---------- Sidebar / inspector ---------- */
.nb-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 12px);
  display: block;
  max-height: calc(100dvh - var(--header-h) - 28px);
  padding: 7px 18px;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius-shell);
  background:
    linear-gradient(180deg, rgba(var(--accent-rgb), 0.025), transparent 42%),
    var(--surface);
  box-shadow: var(--shadow-inner);
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-width: thin;
}

.nb-sidebar:empty {
  display: none;
}

.nb-widget {
  position: relative;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.nb-widget:last-child {
  border-bottom: 0;
}

.nb-widget-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 13px;
}

.nb-widget-title h3 {
  display: inline-flex;
  align-items: center;
  margin: 0;
  gap: 8px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 780;
  letter-spacing: 0.05em;
}

.nb-widget-title h3::before {
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.4);
  content: "";
}

.nb-widget-list {
  color: var(--text-soft);
  font-size: 0.79rem;
  list-style: none;
}

.nb-widget-list > li {
  min-width: 0;
}

.nb-widget-list > li + li {
  margin-top: 9px;
}

.nb-widget-list a {
  color: var(--text-soft);
}

.nb-widget-list a:hover {
  color: var(--accent-strong);
}

.nb-widget-link {
  display: flex;
  align-items: center;
  min-height: 34px;
  gap: 9px;
}

.nb-widget-link img,
.rounded {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 7px;
  object-fit: cover;
}

.bloggerinfo {
  display: grid;
  justify-items: center;
  padding: 8px 4px 3px;
  text-align: center;
}

.bloggerinfo-img {
  width: 74px;
  height: 74px;
  border: 1px solid var(--line-accent);
  border-radius: 22px;
  object-fit: cover;
  box-shadow: 0 0 0 5px rgba(var(--accent-rgb), 0.055);
}

.bloginfo-name {
  margin-top: 13px;
  color: var(--text);
  font-size: 0.95rem;
}

.bloginfo-descript {
  margin-top: 5px;
  color: var(--text-dim);
  font-size: 0.75rem;
  line-height: 1.65;
}

.tag-container {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag-container > span {
  font-size: inherit !important;
  line-height: inherit !important;
}

.log-classify-f,
.log-classify-c {
  list-style: none;
}

.log-classify-f > li > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
}

.log-classify-c {
  margin: 3px 0 7px 10px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.log-classify-c a {
  display: block;
  padding: 5px 0;
  color: var(--text-dim);
  font-size: 0.74rem;
}

.side-cover-image,
.nb-side-cover {
  position: relative;
  min-height: 92px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
}

.side-cover-image img,
.nb-side-cover img {
  width: 100%;
  height: 92px;
  object-fit: cover;
  opacity: 0.7;
  transition: transform 300ms var(--ease);
}

.side-title-container,
.nb-side-cover-title {
  position: absolute;
  inset: auto 0 0;
  padding: 24px 11px 9px;
  background: linear-gradient(transparent, rgba(3, 9, 6, 0.92));
}

.side-title-container a,
.nb-side-cover-title a {
  display: -webkit-box;
  overflow: hidden;
  color: #effaf2;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.side-comment-list .comment-info,
.side-twitter-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  column-gap: 9px;
}

.comment-info_img {
  grid-row: span 2;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 9px;
  object-fit: cover;
}

.comm-lates-name {
  overflow: hidden;
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logcom-latest-time {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.58rem;
}

.side-comment-list a,
.side-twitter-content {
  grid-column: 1 / -1;
  display: -webkit-box;
  margin-top: 7px;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 0.72rem;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

#calendar {
  min-height: 120px;
  overflow: auto;
}

#calendar table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  text-align: center;
}

#calendar th,
#calendar td {
  padding: 5px 2px;
}

#calendar a {
  color: var(--accent-strong);
}

.nb-input,
.nb-select,
.nb-widget input[type="search"],
.nb-widget input[type="text"],
.nb-widget input[type="email"],
.nb-widget input[type="password"],
.nb-widget textarea,
.nb-widget select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  outline: 0;
  background: var(--surface-2);
  color: var(--text);
  transition:
    border-color 160ms var(--ease-ui),
    box-shadow 160ms var(--ease-ui),
    background-color 160ms var(--ease-ui);
}

.nb-input::placeholder,
textarea::placeholder,
input::placeholder {
  color: var(--text-dim);
}

.nb-input:focus,
.nb-select:focus,
.nb-widget input:focus,
.nb-widget textarea:focus,
.nb-widget select:focus {
  border-color: var(--line-accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.07);
}

.nb-widget form {
  display: flex;
  gap: 7px;
}

.nb-widget input[type="submit"],
.nb-widget button[type="submit"] {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-accent);
  border-radius: var(--radius-control);
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 750;
  cursor: pointer;
}

/* ---------- Article reader ---------- */
.nb-article {
  min-width: 0;
}

.nb-reader {
  width: min(1084px, 100%);
  margin-inline: auto;
}

.nb-article-header {
  position: relative;
  overflow: hidden;
  margin-bottom: 18px;
  padding: clamp(28px, 4vw, 44px);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-shell);
  background:
    linear-gradient(120deg, rgba(var(--accent-rgb), 0.075), transparent 46%),
    var(--surface);
  box-shadow: var(--shadow-reader), var(--shadow-inner);
}

.nb-article-header::before {
  position: absolute;
  top: 16px;
  right: 20px;
  color: rgba(var(--accent-rgb), 0.1);
  font-family: var(--font-mono);
  font-size: clamp(3.2rem, 7vw, 6rem);
  font-weight: 900;
  line-height: 1;
  content: "</>";
  pointer-events: none;
}

.nb-article-path,
.nb-article-meta {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 12px;
  gap: 8px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.nb-article-title {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 0;
  color: var(--text);
  font-size: clamp(2rem, 4.2vw, 3.35rem);
  font-weight: 760;
  line-height: 1.12;
  letter-spacing: -0.05em;
  text-wrap: balance;
}

.nb-article-info {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  gap: 14px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.nb-article-info-left {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 16px;
}

.nb-article-info a {
  color: var(--text-soft);
}

.nb-article-cover {
  position: relative;
  z-index: 1;
  width: min(100%, 960px);
  max-height: 420px;
  aspect-ratio: 16 / 7;
  margin: 26px auto 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.nb-article-cover img {
  width: 100%;
  height: 100%;
  max-height: 420px;
  aspect-ratio: 16 / 7;
  object-fit: cover;
}

.nb-article-layout {
  display: grid;
  grid-template-columns: minmax(0, 820px);
  justify-content: center;
  align-items: start;
  gap: 24px;
}

@media (min-width: 1021px) {
  .nb-reader.has-toc .nb-article-layout,
  .nb-article-layout.has-toc {
    grid-template-columns: minmax(0, 820px) 240px;
  }
}

.nb-article-main {
  min-width: 0;
}

.nb-markdown,
.markdown.nb-markdown {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 5vw, 58px);
  border: 1px solid var(--line);
  border-radius: var(--radius-shell);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow-inner);
}

.nb-markdown::before {
  position: absolute;
  top: 0;
  left: clamp(28px, 5vw, 58px);
  width: 72px;
  height: 2px;
  background: var(--accent);
  content: "";
}

.nb-article-tags {
  display: flex;
  flex-wrap: wrap;
  margin-top: 14px;
  padding: 16px 18px;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--glass);
}

.nb-toc-wrap {
  position: sticky;
  top: calc(var(--header-h) + 18px);
}

.nb-toc {
  max-height: calc(100dvh - var(--header-h) - 40px);
  padding: 17px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background:
    linear-gradient(180deg, rgba(var(--accent-rgb), 0.035), transparent 58%),
    var(--surface);
  box-shadow: var(--shadow-inner);
  scrollbar-width: thin;
}

.nb-toc-title {
  display: flex;
  align-items: center;
  margin: 0 0 12px;
  gap: 8px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 800;
}

.nb-toc-title::before {
  color: var(--accent-strong);
  content: "#";
}

.nb-toc-list {
  display: grid;
  gap: 2px;
}

.nb-toc-list a {
  position: relative;
  display: -webkit-box;
  overflow: hidden;
  padding: 6px 8px 6px 12px;
  border-left: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 0.7rem;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.nb-toc-list a:hover {
  color: var(--text);
}

.nb-toc-list a.is-active {
  border-left-color: var(--accent);
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.09), transparent);
  color: var(--accent-strong);
}

.nb-toc-list .toc-h3 {
  padding-left: 22px;
}

.nb-toc-list .toc-h4 {
  padding-left: 32px;
  font-size: 0.65rem;
}

.nb-neighbor {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
  gap: 12px;
}

.nb-neighbor:empty {
  display: none;
}

.prev-log,
.next-log {
  min-width: 0;
}

.next-log {
  text-align: right;
}

.neighbor-link {
  display: flex;
  flex-direction: column;
  min-height: 92px;
  padding: 16px 18px;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--glass);
}

.neighbor-link:hover {
  border-color: var(--line-accent);
  background: rgba(var(--accent-rgb), 0.045);
}

.neighbor-dir {
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 750;
}

.neighbor-title {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 0.8rem;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* ---------- Comments / forms ---------- */
.nb-comments {
  margin-top: 28px;
}

.nb-comment-post,
.commentform,
#commentform {
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--glass);
  box-shadow: var(--shadow-inner);
}

.nb-comment-form {
  display: grid;
  gap: 12px;
}

.nb-comment-form textarea,
#comment {
  min-height: 148px;
  padding: 14px 15px;
  resize: vertical;
  line-height: 1.7;
}

.nb-field,
.nb-field-group {
  display: grid;
  gap: 6px;
}

.nb-field-label,
.nb-comment-form label {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
}

#comment-info.comment-info {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.captcha-container {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 9px;
}

.captcha-container img,
#captcha {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.com_submit_p {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.cancel-reply,
#cancel-reply,
.com-reply,
.comment-replay-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--glass-soft);
  color: var(--text-dim);
  font-size: 0.68rem;
  cursor: pointer;
}

#cancel-reply {
  display: none;
}

.com-reply:hover,
.comment-replay-btn:hover,
#cancel-reply:hover {
  border-color: var(--line-accent);
  color: var(--accent-strong);
}

.nb-comment-header {
  margin: 30px 0 13px;
  color: var(--text);
  font-size: 0.98rem;
}

.nb-comment-login {
  display: flex;
  align-items: center;
  padding: 18px;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--glass);
}

.nb-comment-login > span {
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-weight: 800;
}

.nb-comment-login p {
  flex: 1;
  margin: 0;
  color: var(--text-soft);
  font-size: 0.82rem;
}

.nb-comment-header b {
  font-weight: 720;
}

.nb-comment {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: start;
  margin-top: 12px;
  gap: 12px;
}

.nb-comment > .avatar img {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  object-fit: cover;
}

.comment-infos {
  min-width: 0;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--glass);
}

.comment-infos > b {
  color: var(--text);
  font-size: 0.78rem;
}

.comment-time {
  margin-left: 7px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.59rem;
}

.comment-content {
  margin-top: 8px;
  overflow-wrap: anywhere;
  color: var(--text-soft);
  font-size: 0.8rem;
  line-height: 1.7;
}

.comment-content p {
  margin: 0.5em 0;
}

.comment-reply {
  margin-top: 9px;
}

.comment-children {
  grid-column: 2 / -1;
  margin-left: 10px;
}

.comment-children::before {
  position: absolute;
  top: -12px;
  left: -25px;
  width: 20px;
  height: 34px;
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  border-radius: 0 0 0 10px;
  content: "";
}

/* ---------- Pagination ---------- */
.nb-pagination,
.pagination,
#pagenavi {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 20px;
  gap: 7px;
}

.nb-pagination a,
.nb-pagination span,
.pagination a,
.pagination span,
#pagenavi a,
#pagenavi span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--glass);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 730;
}

.nb-pagination a:hover,
.pagination a:hover,
#pagenavi a:hover {
  border-color: var(--line-accent);
  color: var(--accent-strong);
}

.nb-pagination span,
.pagination span,
#pagenavi span {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--text-inverse);
}

/* ---------- Empty / error / password ---------- */
.nb-empty,
.nb-error {
  padding: clamp(42px, 8vw, 82px) 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-shell);
  background: var(--glass);
  text-align: center;
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}

.nb-code-line {
  margin: 0 0 6px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.c-g {
  margin-right: 6px;
  color: var(--accent-strong);
}

.c-cmt {
  color: var(--code-comment);
}

.nb-empty-icon,
.nb-error-code {
  margin-bottom: 10px;
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: clamp(2.2rem, 7vw, 4.8rem);
  font-weight: 850;
  letter-spacing: -0.07em;
  line-height: 1;
}

.nb-empty h3,
.nb-error h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.nb-empty p,
.nb-error p {
  margin: 10px auto 0;
  color: var(--text-dim);
}

.nb-error-page {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px;
  place-items: center;
}

.nb-error {
  width: min(680px, 100%);
  border-style: solid;
  box-shadow: var(--shadow-float), var(--shadow-inner);
}

.nb-error-shell {
  width: min(680px, 100%);
}

.nb-error.nb-window {
  width: 100%;
  padding: 0;
  overflow: hidden;
  border-style: solid;
}

.nb-error-body {
  padding: clamp(42px, 8vw, 76px) 24px;
  text-align: center;
}

.nb-error-actions {
  display: flex;
  justify-content: center;
  margin-top: 24px;
  gap: 10px;
}

.nb-pw-form {
  display: grid;
  width: min(380px, 100%);
  margin: 24px auto 0;
  gap: 12px;
  text-align: left;
}

/* ---------- Footer / status bar / float ---------- */
.nb-footer {
  margin-top: 18px;
  padding: 0 0 28px;
}

.nb-footer-inner,
.nb-footer-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background:
    linear-gradient(145deg, rgba(var(--accent-rgb), 0.022), transparent 52%),
    var(--surface);
  box-shadow: var(--shadow-inner);
}

.nb-footer-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 25px 28px;
  gap: 22px;
}

.nb-footer-brand strong {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.86rem;
}

.nb-footer-brand p {
  max-width: 520px;
  margin: 6px 0 0;
  color: var(--text-dim);
  font-size: 0.75rem;
}

.nb-footer-meta {
  color: var(--text-dim);
  font-size: 0.72rem;
  text-align: right;
}

.nb-footer-meta a {
  color: var(--text-soft);
}

.nb-footer-copy {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
}

.nb-footer-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 35px;
  padding: 0 13px;
  border-top: 1px solid var(--line);
  background: rgba(var(--accent-rgb), 0.055);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.6rem;
}

.nb-footer-status > span,
.nb-status-left,
.nb-status-right {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}

.nb-status-live {
  color: var(--accent-strong);
}

.nb-float {
  position: fixed;
  z-index: 250;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  display: grid;
  gap: 8px;
}

.nb-float-btn {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface-2);
  box-shadow: var(--shadow-compact), var(--shadow-inner);
  color: var(--text-soft);
  cursor: pointer;
  place-items: center;
}

.nb-float-btn:hover {
  border-color: var(--line-accent);
  color: var(--accent-strong);
  transform: translateY(-2px);
}

/* ---------- Code copy ---------- */
.nb-markdown pre,
.markdown pre {
  position: relative;
}

.nb-copy-code {
  position: absolute;
  z-index: 2;
  top: 9px;
  right: 9px;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid rgba(225, 255, 233, 0.12);
  border-radius: 7px;
  background: rgba(3, 9, 6, 0.7);
  color: #83978b;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  cursor: pointer;
  opacity: 0;
  transition:
    opacity 160ms var(--ease-ui),
    color 160ms var(--ease-ui),
    border-color 160ms var(--ease-ui);
}

pre:hover > .nb-copy-code,
.nb-copy-code:focus-visible {
  opacity: 1;
}

.nb-copy-code.is-copied {
  border-color: rgba(var(--accent-rgb), 0.4);
  color: var(--accent);
}

/* ---------- Reveal ---------- */
.reveal {
  opacity: 1;
  transform: none;
}

html.js .reveal:not(.is-inview) {
  opacity: 0;
  transform: translateY(14px);
}

html.js .reveal.is-inview {
  animation: nb-reveal 480ms var(--ease) both;
  animation-delay: calc(var(--entry-order, 0) * 32ms);
}

html.js .nb-markdown.reveal,
html.js .nb-markdown.reveal:not(.is-inview),
html.js .nb-markdown.reveal.is-inview,
html.js .nb-article-header.reveal,
html.js .nb-article-header.reveal:not(.is-inview),
html.js .nb-article-header.reveal.is-inview {
  opacity: 1;
  transform: none;
  animation: none;
}

@keyframes nb-reveal {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Interaction-capable hover ---------- */
@media (hover: hover) and (pointer: fine) {
  .nb-card:hover {
    z-index: 1;
    background: rgba(var(--accent-rgb), 0.038);
  }

  .nb-card:hover .nb-card-cover img {
    filter: saturate(1) contrast(1.02);
    transform: scale(1.035);
  }

  .nb-card:hover .nb-ln {
    color: var(--accent-strong);
  }

  .side-cover-image:hover img,
  .nb-side-cover:hover img {
    transform: scale(1.04);
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 1160px) {
  :root {
    --sidebar-w: 280px;
  }

  .nb-hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(285px, 0.78fr);
  }

  .nb-hero-copy {
    padding-inline: 42px 32px;
  }

  .nb-editor {
    margin-right: 22px;
  }

  .nb-card-signals {
    display: none;
  }
}

@media (max-width: 1020px) {
  .nb-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .nb-sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
    padding: 7px 18px;
    gap: 0 28px;
    overflow: visible;
  }

  .nb-widget:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .nb-article-layout {
    grid-template-columns: minmax(0, 820px);
  }

  .nb-toc-wrap {
    position: static;
    grid-row: 1;
  }

  .nb-toc {
    max-height: 260px;
  }
}

@media (max-width: 880px) {
  .nb-logo-text small {
    display: none;
  }

  .nb-search-trigger {
    min-width: 42px;
    width: 42px;
    padding: 0;
    justify-content: center;
  }

  .nb-search-trigger > span,
  .nb-search-trigger kbd {
    display: none;
  }

  .nb-hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .nb-hero-copy {
    padding: 44px;
  }

  .nb-editor {
    margin: 0 44px 44px;
    transform: none;
  }

  .nb-hero-title {
    max-width: 700px;
  }
}

@media (max-width: 820px) {
  .nb-menu-btn {
    display: inline-grid;
  }

  .nb-nav {
    position: fixed;
    z-index: 320;
    top: 0;
    right: 0;
    display: block;
    width: min(350px, 88vw);
    height: 100vh;
    height: 100dvh;
    padding: calc(86px + env(safe-area-inset-top)) 16px calc(20px + env(safe-area-inset-bottom));
    overflow: auto;
    overscroll-behavior: contain;
    visibility: hidden;
    opacity: 0;
    border-left: 1px solid var(--line-strong);
    background: var(--glass-strong);
    box-shadow: var(--shadow-float);
    -webkit-clip-path: inset(0 0 0 100%);
    clip-path: inset(0 0 0 100%);
    transform: none;
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
    transition:
      opacity 200ms var(--ease-ui),
      -webkit-clip-path 240ms var(--ease),
      clip-path 240ms var(--ease),
      visibility 240ms var(--ease);
  }

  .nb-nav.is-open {
    visibility: visible;
    opacity: 1;
    -webkit-clip-path: inset(0);
    clip-path: inset(0);
  }

  .nb-nav-list {
    display: grid;
    align-items: stretch;
    gap: 4px;
  }

  .nb-nav-list > .nb-nav-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
  }

  .nb-nav-link {
    min-height: 48px;
    padding-inline: 13px;
    font-size: 0.9rem;
  }

  .nb-nav-list > .nb-nav-item > .nb-nav-link:only-child {
    grid-column: 1 / -1;
  }

  .nb-submenu-toggle {
    width: 44px;
    height: 48px;
    margin: 0;
  }

  .nb-dropdown {
    position: static;
    grid-column: 1 / -1;
    display: none;
    min-width: 0;
    max-width: none;
    padding: 3px 0 7px 12px;
    visibility: visible;
    border: 0;
    border-left: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    opacity: 1;
    transform: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .nb-nav-item:hover > .nb-dropdown,
  .nb-nav-item:focus-within > .nb-dropdown {
    display: none;
  }

  .nb-nav-item.is-open > .nb-dropdown {
    display: grid;
  }

  .nb-dropdown .nb-nav-link {
    min-height: 42px;
    color: var(--text-dim);
  }
}

@media (max-width: 720px) {
  .nb-container {
    width: min(var(--max), calc(100% - 26px));
  }

  .nb-main {
    padding-top: 15px;
  }

  .nb-workbench,
  .nb-posts,
  .nb-article-header,
  .nb-markdown,
  .nb-context {
    border-radius: 18px;
  }

  .nb-workbench-bar {
    grid-template-columns: minmax(140px, auto) 1fr;
  }

  .nb-branch {
    display: none;
  }

  .nb-hero-copy {
    padding: 34px 26px;
  }

  .nb-hero-title {
    font-size: clamp(2.2rem, 11vw, 3.5rem);
  }

  .nb-editor {
    margin: 0 20px 24px;
  }

  .nb-hero-stats span:nth-child(2) {
    display: none;
  }

  .nb-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .nb-filter-wrap {
    width: 100%;
    justify-content: space-between;
  }

  .nb-filter button {
    min-height: 40px;
  }

  .nb-card,
  .nb-card.has-cover,
  .nb-card.is-featured.has-cover {
    grid-template-columns: minmax(0, 1fr);
  }

  .nb-card {
    min-height: 0;
  }

  .nb-card-cover {
    min-height: 0;
    aspect-ratio: 16 / 8.5;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nb-card-gutter {
    display: none;
  }

  .nb-card-body {
    padding: 21px 19px 18px;
  }

  .nb-card-signals {
    display: none;
  }

  .nb-sidebar {
    grid-template-columns: minmax(0, 1fr);
  }

  .nb-widget:nth-last-child(2) {
    border-bottom: 1px solid var(--line);
  }

  .nb-article-header {
    padding: 28px 20px;
  }

  .nb-article-header::before {
    right: 12px;
    opacity: 0.55;
  }

  .nb-article-cover {
    margin: 22px auto 0;
  }

  .nb-article-title {
    font-size: clamp(1.85rem, 7.8vw, 2.6rem);
  }

  .nb-article-info {
    align-items: flex-start;
    flex-direction: column;
  }

  .nb-neighbor {
    grid-template-columns: minmax(0, 1fr);
  }

  .next-log {
    text-align: left;
  }

  .nb-comment {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 9px;
  }

  .nb-comment > .avatar img {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .comment-children {
    grid-column: 1 / -1;
    margin-left: 22px;
  }

  .comment-children::before {
    display: none;
  }

  .nb-footer-main {
    flex-direction: column;
  }

  .nb-footer-meta {
    text-align: left;
  }
}

@media (max-width: 520px) {
  :root {
    --header-h: 70px;
  }

  .nb-header {
    padding-top: 7px;
  }

  .nb-header-inner {
    min-height: 51px;
    padding-left: 9px;
    gap: 8px;
  }

  .nb-logo-mark {
    width: 34px;
    height: 34px;
  }

  .nb-logo-text {
    max-width: 112px;
  }

  .nb-actions {
    gap: 4px;
  }

  .nb-icon-btn,
  .nb-search-trigger {
    width: 40px;
    min-width: 40px;
    height: 40px;
  }

  .nb-search-head {
    padding: 17px 16px 12px;
  }

  .nb-search-form {
    margin-inline: 10px;
  }

  .nb-search-form button span {
    display: none;
  }

  .nb-search-tip {
    padding-inline: 16px;
  }

  .nb-workbench-tab {
    padding-inline: 13px;
  }

  .nb-workbench-path {
    padding-inline: 11px;
    text-align: right;
  }

  .nb-hero-copy {
    padding: 31px 20px;
  }

  .nb-hero-description {
    font-size: 0.92rem;
  }

  .nb-hero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .nb-btn {
    padding-inline: 12px;
  }

  .nb-editor {
    margin-inline: 12px;
  }

  .nb-code-row {
    grid-template-columns: 39px minmax(0, 1fr);
  }

  .nb-context {
    padding: 27px 22px;
  }

  .nb-filter-label {
    display: none;
  }

  .nb-filter {
    width: 100%;
  }

  .nb-filter button {
    flex: 1;
  }

  .nb-card-foot {
    align-items: flex-end;
  }

  .nb-card-more span {
    display: none;
  }

  .nb-markdown,
  .markdown.nb-markdown {
    padding: 26px 19px;
  }

  #comment-info.comment-info {
    grid-template-columns: minmax(0, 1fr);
  }

  .nb-comment-post {
    padding: 14px;
  }

  .nb-footer-main {
    padding: 22px 19px;
  }

  .nb-footer-status {
    overflow: hidden;
  }

  .nb-status-right {
    display: none;
  }

  .nb-float {
    right: max(11px, env(safe-area-inset-right));
    bottom: max(11px, env(safe-area-inset-bottom));
  }
}

@media (hover: none) {
  .nb-copy-code {
    opacity: 1;
  }
}

/* ---------- Code Workbench visual language ---------- */
body.nb-body {
  letter-spacing: 0;
}

.nb-bg {
  background:
    radial-gradient(820px 460px at 8% -16%, rgba(var(--accent-rgb), 0.055), transparent 64%),
    radial-gradient(700px 420px at 100% 100%, rgba(130, 170, 255, 0.035), transparent 68%),
    linear-gradient(145deg, var(--bg-deep), var(--bg) 52%, var(--bg-raised));
}

.nb-grid {
  opacity: 0.2;
  background-image:
    linear-gradient(rgba(188, 213, 207, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(188, 213, 207, 0.025) 1px, transparent 1px);
  background-size: 32px 32px;
}

html[data-theme="light"] .nb-grid {
  opacity: 0.34;
  background-image:
    linear-gradient(rgba(46, 63, 72, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(46, 63, 72, 0.035) 1px, transparent 1px);
}

.nb-glow {
  display: none;
}

.nb-noise {
  opacity: 0.014;
}

.nb-header-shell {
  border-radius: var(--radius-panel);
  background: var(--glass-strong);
}

.nb-header.is-scrolled .nb-header-shell {
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.04), var(--shadow-inner);
}

.nb-logo-mark {
  border-radius: var(--radius-control);
  background: var(--editor-code);
}

.nb-logo-text strong,
.nb-nav-link,
.nb-search-trigger > span {
  font-family: var(--font-mono);
}

.nb-nav-link {
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 650;
}

.nb-nav-link:hover,
.nb-nav-link[aria-current="page"] {
  background: var(--surface-2);
}

.nb-nav-link[aria-current="page"]::before {
  width: 4px;
  height: 4px;
  border-radius: 1px;
  box-shadow: none;
}

.nb-dropdown {
  border-radius: var(--radius-control);
  box-shadow: var(--shadow-compact), var(--shadow-inner);
}

.nb-icon-btn,
.nb-search-trigger,
.nb-menu-btn,
kbd {
  border-radius: var(--radius-control);
}

.nb-search-panel {
  border-radius: var(--radius-panel);
}

.nb-main {
  padding-top: 18px;
}

.nb-layout {
  gap: 20px;
}

.nb-hero {
  margin-bottom: 26px;
}

.nb-workbench {
  border-radius: var(--radius-shell);
  background: var(--surface);
  box-shadow: var(--shadow-panel), var(--shadow-inner);
}

.nb-workbench::before {
  display: none;
}

.nb-workbench-bar {
  min-height: 42px;
  background: var(--editor-bar);
  color: var(--text-dim);
}

html[data-theme="light"] .nb-workbench-bar {
  background: var(--editor-bar);
}

.nb-workbench-tab {
  padding-inline: 15px;
  border-top: 0;
  border-bottom: 2px solid var(--accent);
  background: var(--editor-active);
  color: var(--text);
}

.nb-workbench-tab svg {
  color: var(--syntax-blue);
}

.nb-workbench-tab i {
  width: 4px;
  height: 4px;
  border-radius: 1px;
}

.nb-workbench-path,
.nb-branch {
  min-height: 42px;
}

.nb-workbench-main {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  min-width: 0;
  background: var(--editor-code);
}

.nb-activity-rail {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 340px;
  padding: 12px 0;
  gap: 8px;
  border-right: 1px solid var(--line);
  background: var(--editor-rail);
  color: var(--text-dim);
}

.nb-activity-rail::before {
  position: absolute;
  top: 12px;
  left: 0;
  width: 2px;
  height: 34px;
  background: var(--accent);
  content: "";
}

.nb-activity-rail > :is(a, button, span) {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  place-items: center;
}

.nb-activity-rail > :is(a, button, span):first-child,
.nb-activity-rail > .is-active,
.nb-activity-rail > [aria-current="page"] {
  background: var(--surface-2);
  color: var(--text);
}

.nb-terminal-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(290px, 0.92fr);
  min-width: 0;
  min-height: 340px;
  background: var(--editor-code);
}

.nb-command {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  min-height: 42px;
  padding: 0 24px;
  gap: 9px;
  border-bottom: 1px solid var(--line);
  background: var(--editor-bar);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  overflow-wrap: anywhere;
}

.nb-prompt {
  flex: 0 0 auto;
  color: var(--accent-strong);
  font-weight: 800;
}

.nb-identity {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 34px 38px;
}

.nb-identity-name {
  max-width: 720px;
  margin: 0;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  font-weight: 760;
  line-height: 1.16;
  letter-spacing: -0.045em;
  overflow-wrap: anywhere;
}

.nb-identity-name::before {
  margin-right: 0.38em;
  color: var(--syntax-purple);
  content: "const";
  font-size: 0.42em;
  font-weight: 650;
  letter-spacing: 0;
  vertical-align: 0.34em;
}

.nb-identity-role {
  order: -1;
  margin-bottom: 12px;
  color: var(--syntax-blue);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nb-runtime-line {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  align-items: center;
  min-height: 38px;
  padding: 7px 18px;
  gap: 7px 18px;
  border-top: 1px solid var(--line);
  background: var(--editor-bar);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.62rem;
}

.nb-runtime-line strong,
.nb-runtime-line .is-online {
  color: var(--accent-strong);
}

.nb-hero-grid {
  min-height: 340px;
  background: var(--editor-code);
}

.nb-whoami {
  min-width: 0;
  border-right: 1px solid var(--line);
}

.nb-whoami-command {
  display: flex;
  align-items: center;
  margin-bottom: 22px;
  gap: 9px;
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 0.74rem;
}

.nb-whoami-command code {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--syntax-blue);
  font: inherit;
}

.nb-whoami-prompt {
  color: var(--accent-strong);
  font-weight: 750;
}

.nb-whoami-output {
  position: relative;
  padding-left: 18px;
  border-left: 2px solid var(--accent);
}

.nb-whoami-label {
  display: block;
  margin-bottom: 7px;
  color: var(--syntax-purple);
  font-family: var(--font-mono);
  font-size: 0.61rem;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.nb-whoami-name {
  max-width: 720px;
  margin: 0;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  font-weight: 760;
  line-height: 1.16;
  letter-spacing: -0.045em;
  overflow-wrap: anywhere;
}

.nb-whoami-role {
  margin: 9px 0 0;
  color: var(--syntax-cyan);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  line-height: 1.55;
}

.nb-hero-copy {
  justify-content: center;
  padding: 34px 38px;
}

.nb-hero-kicker {
  margin-bottom: 13px;
  color: var(--syntax-blue);
  letter-spacing: 0.08em;
}

.nb-hero-kicker i {
  width: 5px;
  height: 5px;
  border-radius: 1px;
  box-shadow: none;
}

.nb-hero-title {
  max-width: 720px;
  font-family: var(--font-mono);
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  line-height: 1.16;
  letter-spacing: -0.045em;
  overflow-wrap: anywhere;
}

.nb-hero-title::first-letter {
  color: inherit;
}

.nb-hero-description,
.nb-identity .nb-hero-description {
  max-width: 620px;
  margin-top: 16px;
  color: var(--text-soft);
  font-size: 0.94rem;
  line-height: 1.76;
}

.nb-hero-actions {
  margin-top: 24px;
  gap: 8px;
}

.nb-btn {
  min-height: 40px;
  padding-inline: 14px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  box-shadow: none;
}

.nb-btn-primary {
  box-shadow: none;
}

.nb-btn-primary:hover,
.nb-btn-ghost:hover {
  transform: translateY(-1px);
}

.nb-hero-stats {
  margin-top: 24px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.nb-editor {
  margin: 20px 20px 20px 0;
  border-radius: var(--radius-control);
  background: var(--editor-code);
  box-shadow: none;
  color-scheme: dark;
  transform: none;
}

html[data-theme="light"] .nb-editor {
  background: var(--editor-code);
  color-scheme: light;
}

.nb-editor-head {
  min-height: 38px;
  border-bottom-color: var(--line);
  background: var(--editor-bar);
  color: var(--text-dim);
}

.nb-code-block {
  padding: 14px 0 16px;
  color: var(--text);
  line-height: 1.82;
}

.nb-code-row {
  grid-template-columns: 44px minmax(0, 1fr);
  min-height: 24px;
}

.nb-code-row:hover {
  background: var(--glass-soft);
}

.nb-code-row > i {
  color: var(--text-dim);
}

.nb-code-row code {
  color: var(--text);
}

.syn-purple { color: var(--syntax-purple); }
.syn-blue { color: var(--syntax-blue); }
.syn-key { color: var(--syntax-cyan); }
.syn-string { color: color-mix(in srgb, var(--accent-strong) 76%, var(--syntax-amber)); }
.syn-green { color: var(--accent-strong); }
.syn-number { color: var(--syntax-red); }
.syn-muted { color: var(--text-dim); }

.nb-code-comment code {
  color: var(--code-comment);
}

.nb-devbot {
  align-self: center;
  min-width: 0;
  margin: 20px 20px 20px 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--editor-code);
  color: var(--text);
}

.nb-editor .nb-devbot {
  margin: 12px 12px 0;
  border-color: var(--line);
  border-radius: 6px;
}

.nb-devbot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 0 14px;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--editor-bar);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.66rem;
}

#nb-devbot-canvas.nb-devbot-canvas,
.nb-devbot-canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 13 / 9;
  background:
    linear-gradient(rgba(130, 170, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(130, 170, 255, 0.035) 1px, transparent 1px),
    var(--editor-code);
  background-size: 20px 20px;
  image-rendering: pixelated;
}

.nb-devbot-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
  margin: 0;
  padding: 9px 13px;
  gap: 12px;
  border-top: 1px solid var(--line);
  background: var(--editor-bar);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  line-height: 1.45;
}

.nb-devbot-caption strong {
  color: var(--accent-strong);
  font-weight: 780;
}

.nb-devbot-caption span,
.nb-devbot-head > :last-child {
  color: var(--syntax-blue);
}

.nb-code-block-compact {
  padding-block: 10px 12px;
  font-size: clamp(0.66rem, 0.9vw, 0.74rem);
  line-height: 1.65;
}

.nb-code-block-compact .nb-code-row {
  min-height: 22px;
}

.nb-context {
  min-height: 118px;
  margin-bottom: 22px;
  padding: 28px 32px;
  border-radius: var(--radius-shell);
  background: var(--surface);
}

.nb-toolbar {
  margin-bottom: 10px;
  padding-inline: 2px;
}

.nb-section-kicker {
  color: var(--syntax-blue);
  letter-spacing: 0.1em;
}

.nb-section-title {
  font-family: var(--font-mono);
  font-size: 1.16rem;
}

.nb-filter {
  border-radius: var(--radius-control);
  background: var(--editor-bar);
}

.nb-filter button {
  border-radius: 5px;
}

.nb-filter button.is-active {
  background: var(--editor-active);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.nb-posts {
  padding: 0;
  border-radius: var(--radius-panel);
  background: var(--surface);
  box-shadow: var(--shadow-compact), var(--shadow-inner);
}

.nb-card {
  min-height: 156px;
  background: var(--surface);
}

.nb-card:first-child,
.nb-card:last-child,
.nb-card:only-child {
  border-radius: 0;
}

.nb-card.has-cover {
  grid-template-columns: 180px minmax(0, 1fr);
}

.nb-card.is-featured.has-cover {
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 208px;
}

.nb-card-gutter {
  padding-top: 22px;
  background: var(--editor-gutter);
}

.nb-card-cover {
  min-height: 156px;
  background: var(--editor-gutter);
}

.nb-cover-shade {
  background: linear-gradient(135deg, transparent, rgba(7, 12, 14, 0.2));
}

html[data-theme="light"] .nb-cover-shade {
  background: linear-gradient(135deg, transparent, rgba(46, 63, 72, 0.1));
}

.nb-card-body {
  padding: 20px 22px 18px;
}

.nb-card-meta,
.nb-card-signals,
.nb-card-more {
  font-family: var(--font-mono);
}

.nb-sort a,
.nb-pill a,
.nb-pill,
.nb-top-flag,
.nb-window-badge,
.nb-tag,
a.tags,
a.tags-side {
  border-radius: 4px;
}

.nb-sort a,
.nb-pill a,
.nb-pill {
  color: var(--syntax-cyan);
}

.nb-card-title {
  margin-bottom: 7px;
  font-size: clamp(1.06rem, 1.8vw, 1.28rem);
}

.is-featured .nb-card-title {
  font-size: clamp(1.18rem, 2vw, 1.48rem);
}

.nb-card-excerpt {
  font-size: 0.83rem;
  line-height: 1.68;
}

.nb-card-foot {
  margin-top: 12px;
}

@media (hover: hover) and (pointer: fine) {
  .nb-card:hover {
    background: var(--surface-2);
    box-shadow: inset 2px 0 0 var(--accent);
  }

  .nb-card:hover .nb-card-cover img {
    filter: saturate(0.92) contrast(1.02);
    transform: none;
  }
}

.nb-sidebar {
  padding: 0;
  border-radius: var(--radius-panel);
  background: var(--surface);
}

.nb-sidebar-chrome {
  position: sticky;
  z-index: 3;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  padding-right: 11px;
  border-bottom: 1px solid var(--line);
  background: var(--editor-bar);
}

.nb-sidebar-tabs {
  display: flex;
  align-self: stretch;
  min-width: 0;
}

.nb-sidebar-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.nb-sidebar-tab.is-active {
  background: var(--editor-active);
  color: var(--text-soft);
}

.nb-sidebar-tab.is-active::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--accent);
  content: "";
}

.nb-sidebar-controls {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
}

.nb-sidebar-controls i {
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--text-dim);
}

.nb-sidebar-controls i:nth-child(1) { background: var(--syntax-red); }
.nb-sidebar-controls i:nth-child(2) { background: var(--syntax-amber); }
.nb-sidebar-controls i:nth-child(3) { background: var(--accent); }

.nb-sidebar-content {
  min-width: 0;
  padding: 0 18px;
}

.nb-sidebar-foot {
  position: sticky;
  z-index: 3;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 31px;
  padding: 0 11px;
  gap: 12px;
  border-top: 1px solid var(--line);
  background: var(--editor-bar);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.57rem;
}

.nb-widget {
  padding-block: 17px;
}

.nb-widget-title {
  color: var(--syntax-blue);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

.nb-article-tabbar {
  display: flex;
  align-items: stretch;
  min-height: 42px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-panel) var(--radius-panel) 0 0;
  background: var(--editor-bar);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.67rem;
}

.nb-article-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 0;
  padding: 0 16px;
  gap: 8px;
  border-right: 1px solid var(--line);
  background: var(--editor-active);
  color: var(--text);
}

.nb-article-tab::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  background: var(--accent);
  content: "";
}

.nb-article-tab::after {
  color: var(--text-dim);
  content: "×";
  font-size: 0.8rem;
}

.nb-article-tab svg {
  flex: 0 0 auto;
  color: var(--syntax-blue);
}

.nb-article-tabmeta {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  margin-left: auto;
  padding: 0 14px;
  gap: 12px;
  white-space: nowrap;
}

.nb-article-tabbar + .nb-article-header {
  border-top: 0;
  border-radius: 0 0 var(--radius-panel) var(--radius-panel);
}

.nb-article-header {
  margin-bottom: 16px;
  padding: 30px 32px;
  border-radius: var(--radius-panel);
  background: var(--surface);
  box-shadow: var(--shadow-compact), var(--shadow-inner);
}

.nb-article-header > .nb-article-tabbar {
  margin: -30px -32px 24px;
  border-width: 0 0 1px;
  border-radius: 0;
}

.nb-article-header::before {
  display: none;
}

.nb-article-headwrap {
  width: min(820px, 100%);
  margin-inline: auto;
}

.nb-article-path,
.nb-article-meta {
  margin-bottom: 10px;
}

.nb-article-path {
  color: var(--syntax-blue);
}

.nb-article-title {
  max-width: 820px;
  font-size: clamp(1.9rem, 3.5vw, 2.65rem);
  line-height: 1.18;
  letter-spacing: -0.04em;
}

.nb-article-info {
  margin-top: 18px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.nb-article-cover {
  margin-top: 22px;
  border-radius: var(--radius-control);
}

.nb-document-shell {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
  box-shadow: var(--shadow-reader), var(--shadow-inner);
}

.nb-document-bar {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius-panel) var(--radius-panel) 0 0;
  background: var(--editor-bar);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.64rem;
}

.nb-document-bar::before {
  width: 7px;
  height: 7px;
  border: 1px solid var(--syntax-blue);
  border-radius: 1px;
  background: rgba(130, 170, 255, 0.12);
  content: "";
}

.nb-document-breadcrumb {
  min-width: 0;
  overflow: hidden;
  color: var(--text-soft);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nb-document-status {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--text-dim);
  white-space: nowrap;
}

.nb-workspace-label {
  flex: 0 1 150px;
  min-width: 0;
  overflow: hidden;
  color: var(--text-soft);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nb-workspace-label::before {
  content: none;
}

.nb-document-shell .nb-markdown,
.nb-document-shell .markdown.nb-markdown {
  border: 0;
  border-radius: 0 0 var(--radius-panel) var(--radius-panel);
  background: var(--surface);
  box-shadow: none;
}

.nb-document-shell .nb-markdown::before {
  display: none;
}

.nb-markdown,
.markdown.nb-markdown {
  border-radius: var(--radius-panel);
  background: var(--surface);
}

.nb-toc {
  border-radius: var(--radius-control);
  background: var(--surface-2);
}

.nb-toc-title {
  min-height: 28px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
  color: var(--syntax-blue);
}

.nb-article-tags,
.neighbor-link,
.nb-comment-post,
.commentform,
#commentform,
.nb-comment-login,
.comment-infos {
  border-radius: var(--radius-control);
  background: var(--surface);
}

.neighbor-link:hover {
  background: var(--surface-2);
}

.nb-footer-inner,
.nb-footer-shell {
  border-radius: var(--radius-panel);
  background: var(--surface);
}

.nb-footer-status {
  background: var(--editor-bar);
}

@media (max-width: 1020px) {
  .nb-sidebar {
    display: block;
    padding: 0;
  }

  .nb-sidebar-chrome,
  .nb-sidebar-foot {
    position: static;
  }

  .nb-sidebar-content {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0 18px;
    gap: 0 28px;
  }

  .nb-terminal-intro {
    grid-template-columns: minmax(0, 1fr) minmax(270px, 0.78fr);
  }

  .nb-article-tabmeta {
    max-width: 45%;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 880px) {
  .nb-workbench-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .nb-activity-rail {
    flex-direction: row;
    min-height: 45px;
    padding: 5px 8px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nb-activity-rail::before {
    top: auto;
    bottom: 0;
    left: 8px;
    width: 34px;
    height: 2px;
  }

  .nb-terminal-intro {
    grid-template-columns: minmax(0, 1fr);
  }

  .nb-identity {
    padding: 30px 32px;
  }

  .nb-whoami {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nb-editor {
    margin: 0 32px 30px;
  }

  .nb-devbot {
    margin: 0 32px 30px;
  }

  .nb-editor .nb-devbot {
    margin: 12px 12px 0;
  }

  .nb-article-tabmeta {
    display: none;
  }
}

@media (max-width: 720px) {
  .nb-sidebar-content {
    grid-template-columns: minmax(0, 1fr);
  }

  .nb-workbench,
  .nb-posts,
  .nb-article-header,
  .nb-markdown,
  .nb-context,
  .nb-document-shell {
    border-radius: var(--radius-panel);
  }

  .nb-workbench-bar {
    grid-template-columns: minmax(130px, auto) 1fr;
  }

  .nb-command {
    padding-inline: 18px;
  }

  .nb-identity {
    padding: 28px 24px;
  }

  .nb-identity-name,
  .nb-hero-title,
  .nb-whoami-name {
    font-size: clamp(1.65rem, 7vw, 2rem);
  }

  .nb-hero-copy {
    padding: 30px 24px;
  }

  .nb-editor {
    margin: 0 20px 24px;
  }

  .nb-devbot {
    margin: 0 20px 24px;
  }

  .nb-editor .nb-devbot {
    margin: 10px 10px 0;
  }

  .nb-card.has-cover,
  .nb-card.is-featured.has-cover {
    grid-template-columns: minmax(0, 1fr);
  }

  .nb-article-tabbar {
    overflow-x: auto;
  }

  .nb-article-tab {
    flex: 0 0 auto;
    max-width: 78vw;
  }

  .nb-article-header {
    padding: 24px 20px;
  }

  .nb-article-header > .nb-article-tabbar {
    margin: -24px -20px 21px;
  }

  .nb-article-title {
    font-size: clamp(1.72rem, 7.5vw, 2.2rem);
  }
}

@media (max-width: 520px) {
  .nb-workspace-label {
    display: none;
  }

  .nb-workbench-bar {
    min-height: 40px;
  }

  .nb-workbench-tab {
    padding-inline: 11px;
  }

  .nb-command {
    align-items: flex-start;
    min-height: 0;
    padding-block: 10px;
    line-height: 1.55;
  }

  .nb-identity {
    padding: 24px 18px;
  }

  .nb-whoami-command {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 18px;
    gap: 3px;
  }

  .nb-whoami-output {
    padding-left: 14px;
  }

  .nb-whoami-name {
    font-size: clamp(1.5rem, 8vw, 1.85rem);
  }

  .nb-identity-name::before {
    display: block;
    margin: 0 0 8px;
    font-size: 0.48em;
    vertical-align: baseline;
  }

  .nb-hero-copy {
    padding: 26px 18px;
  }

  .nb-hero-title {
    font-size: clamp(1.55rem, 8vw, 1.85rem);
  }

  .nb-hero-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .nb-editor {
    margin-inline: 10px;
  }

  .nb-devbot {
    margin-inline: 10px;
  }

  .nb-editor .nb-devbot {
    margin: 9px 9px 0;
  }

  .nb-devbot-caption {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .nb-runtime-line {
    gap: 5px 12px;
  }

  .nb-article-tab {
    padding-inline: 12px;
  }

  .nb-document-bar {
    padding-inline: 11px;
  }

  .nb-document-status {
    display: none;
  }

  .nb-workspace-label::before {
    content: none;
  }
}

/* ---------- Home workbench viewport / activity drawer ---------- */
/*
 * The home page is deliberately composed as one IDE viewport first, then the
 * article feed.  Keeping this as a late override also lets older cached PHP
 * markup fall back to the compact 3.1 workbench without breaking.
 */
body.nb-body:has(.nb-home-feed) {
  --max: 1680px;
}

.nb-home-container {
  --max: 1680px;
}

.nb-main > .nb-container > .nb-hero {
  min-height: calc(100vh - var(--header-h) - 28px);
  min-height: calc(100svh - var(--header-h) - 28px);
  margin-bottom: 32px;
}

.nb-main > .nb-container > .nb-hero > .nb-workbench {
  display: flex;
  min-height: inherit;
  flex-direction: column;
}

.nb-home-feed {
  align-items: start;
  gap: clamp(20px, 2vw, 30px);
}

@media (min-width: 1021px) {
  .nb-home-feed > .nb-sidebar {
    position: sticky;
    top: calc(var(--header-h) + 12px);
    max-height: calc(100dvh - var(--header-h) - 28px);
    overflow: auto;
    overscroll-behavior: auto;
  }
}

.nb-workspace-label {
  display: none !important;
}

.nb-header-inner > .nb-nav {
  margin-left: clamp(4px, 1.4vw, 22px);
}

.nb-workbench-bar {
  grid-template-columns: minmax(148px, auto) minmax(0, 1fr) auto;
}

.nb-workbench-spacer {
  align-self: stretch;
  min-width: 0;
}

.nb-workbench-main {
  flex: 1 1 auto;
  grid-template-columns: 52px minmax(0, 1fr);
  min-height: 0;
  isolation: isolate;
}

.nb-workbench-main::after {
  position: absolute;
  z-index: 10;
  inset: 0 0 0 52px;
  background: rgba(2, 8, 9, 0.4);
  content: "";
  opacity: 0;
  pointer-events: none;
  transition: opacity 170ms var(--ease-ui);
}

.nb-workbench-main.is-drawer-open::after {
  opacity: 1;
}

html[data-theme="light"] .nb-workbench-main.is-drawer-open::after {
  background: rgba(72, 86, 92, 0.17);
}

.nb-activity-rail {
  z-index: 12;
  grid-column: 1;
  grid-row: 1;
  align-self: stretch;
  flex-direction: column;
  align-items: center;
  min-height: 0;
  padding: 10px 0;
  gap: 6px;
  border-right: 1px solid var(--line);
  border-bottom: 0;
}

.nb-activity-rail::before {
  display: none;
}

.nb-activity-rail .nb-activity-item {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  place-items: center;
  transition:
    color 150ms var(--ease-ui),
    background-color 150ms var(--ease-ui),
    border-color 150ms var(--ease-ui),
    transform 120ms var(--ease-ui);
}

.nb-activity-rail .nb-activity-item::before {
  position: absolute;
  top: 7px;
  bottom: 7px;
  left: -7px;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: var(--accent);
  content: "";
  opacity: 0;
  transform: scaleY(0.35);
  transition:
    opacity 150ms var(--ease-ui),
    transform 150ms var(--ease-ui);
}

.nb-activity-rail .nb-activity-item svg {
  width: 21px;
  height: 21px;
  pointer-events: none;
}

.nb-activity-rail > .nb-activity-item:first-child {
  background: transparent;
  color: var(--text-dim);
}

.nb-activity-rail .nb-activity-item:hover {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--text-soft);
}

.nb-activity-rail .nb-activity-item:focus-visible {
  z-index: 1;
  outline-offset: 1px;
}

.nb-activity-rail .nb-activity-item:active {
  transform: translateY(1px);
}

.nb-activity-rail .nb-activity-item:is(.is-active, [aria-expanded="true"], [aria-pressed="true"]) {
  border-color: var(--line-strong);
  background: var(--editor-active);
  color: var(--text);
}

.nb-activity-rail .nb-activity-item:is(.is-active, [aria-expanded="true"], [aria-pressed="true"])::before {
  opacity: 1;
  transform: scaleY(1);
}

.nb-workbench-drawer {
  position: absolute;
  z-index: 11;
  top: 0;
  bottom: 0;
  left: 52px;
  display: flex;
  flex-direction: column;
  width: clamp(240px, 19vw, 270px);
  max-width: calc(100% - 52px);
  min-height: 0;
  overflow: hidden;
  visibility: hidden;
  border-right: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: 18px 0 40px rgba(0, 0, 0, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-14px);
  transition:
    opacity 170ms var(--ease-ui),
    transform 190ms var(--ease-ui),
    visibility 190ms var(--ease-ui);
}

.nb-workbench-drawer.is-open,
.nb-workbench-drawer[aria-hidden="false"] {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

html[data-theme="light"] .nb-workbench-drawer {
  box-shadow: 18px 0 34px rgba(45, 58, 66, 0.14);
}

.nb-workbench-drawer-head {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 0 9px 0 14px;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: var(--editor-bar);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nb-workbench-drawer-close {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  place-items: center;
  transition:
    color 150ms var(--ease-ui),
    background-color 150ms var(--ease-ui),
    border-color 150ms var(--ease-ui);
}

.nb-workbench-drawer-close:hover {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--text);
}

.nb-workbench-panel {
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
  padding: 14px 13px 18px;
  overflow: auto;
  overscroll-behavior: contain;
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 0.69rem;
  line-height: 1.7;
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-width: thin;
}

.nb-workbench-panel > :first-child {
  margin-top: 0;
}

.nb-workbench-panel > :last-child {
  margin-bottom: 0;
}

.nb-workbench-panel :is(h3, h4, p, pre) {
  margin: 0 0 10px;
}

.nb-workbench-panel :is(h3, h4) {
  color: var(--syntax-blue);
  font: inherit;
  font-weight: 750;
  letter-spacing: 0.045em;
}

.nb-workbench-panel :is(ul, ol) {
  display: grid;
  padding: 0;
  gap: 2px;
  list-style: none;
}

.nb-workbench-panel li,
.nb-workbench-panel a {
  min-width: 0;
}

.nb-workbench-panel li {
  position: relative;
  padding: 4px 6px 4px 18px;
  border-radius: 4px;
  overflow-wrap: anywhere;
}

.nb-workbench-panel li::before {
  position: absolute;
  top: 4px;
  left: 5px;
  color: var(--syntax-blue);
  content: "›";
}

.nb-workbench-panel li:hover {
  background: transparent;
}

.nb-workbench-panel a {
  color: inherit;
}

.nb-workbench-panel li > a {
  padding: 2px 3px;
  margin: -2px -3px;
  border-radius: 3px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  transition:
    color 140ms var(--ease-ui),
    background-color 140ms var(--ease-ui);
}

.nb-workbench-panel li > a:hover,
.nb-workbench-panel li > a:focus-visible {
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent-strong);
}

.nb-workbench-panel code {
  color: var(--syntax-cyan);
  font: inherit;
}

.nb-workbench-panel pre {
  max-width: 100%;
  padding: 10px 11px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--editor-code);
  color: var(--text-soft);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.nb-workbench-tree ul {
  margin: 4px 0 0 4px;
  padding-left: 8px;
  border-left: 1px solid var(--line);
}

.nb-workbench-tree .is-folder > span {
  color: var(--syntax-blue);
  font-weight: 700;
}

.nb-workbench-meta {
  display: grid;
  margin: 12px 0 16px;
  gap: 1px;
}

.nb-workbench-meta > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 32px;
  padding: 5px 8px;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.nb-workbench-meta dt {
  color: var(--text-dim);
}

.nb-workbench-meta dd {
  margin: 0;
  color: var(--text);
}

.nb-workbench-meta .is-online {
  color: var(--accent-strong);
}

.nb-workbench-rss {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--editor-active);
  color: var(--syntax-cyan) !important;
}

.nb-terminal-commands {
  display: grid;
  gap: 6px;
}

.nb-terminal-commands button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--editor-active);
  color: var(--text-soft);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.nb-terminal-commands button:hover,
.nb-terminal-commands button:focus-visible {
  border-color: var(--line-accent);
  color: var(--accent-strong);
}

.nb-terminal-commands button > span {
  color: var(--accent-strong);
  font-weight: 800;
}

.nb-code-block-compact .nb-code-row code {
  white-space: pre;
}

.nb-workbench-command {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  padding: 7px 9px;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition:
    color 150ms var(--ease-ui),
    background-color 150ms var(--ease-ui),
    border-color 150ms var(--ease-ui),
    transform 120ms var(--ease-ui);
}

.nb-workbench-command svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: var(--syntax-blue);
}

.nb-workbench-command:hover {
  border-color: var(--line);
  background: var(--editor-active);
  color: var(--text);
}

.nb-workbench-command:active {
  transform: translateY(1px);
}

.nb-workbench-command + .nb-workbench-command {
  margin-top: 3px;
}

.nb-workbench-panel[data-panel="explorer"] li::before {
  color: var(--syntax-amber);
  content: "◇";
  font-size: 0.78em;
}

.nb-workbench-panel[data-panel="source"] {
  background:
    linear-gradient(90deg, var(--editor-gutter) 31px, transparent 31px),
    var(--editor-code);
}

.nb-workbench-panel[data-panel="source"] pre {
  padding-left: 13px;
  border-color: transparent;
  background: transparent;
}

.nb-workbench-panel[data-panel="terminal"] {
  background: var(--editor-code);
  color: var(--syntax-cyan);
}

.nb-workbench-panel[data-panel="terminal"]::before {
  display: block;
  margin-bottom: 10px;
  color: var(--accent-strong);
  content: "guest@nebula:~$";
  font-weight: 750;
}

.nb-workbench-main > .nb-hero-grid {
  grid-column: 2;
  grid-row: 1;
  grid-template-columns: minmax(360px, 0.93fr) minmax(420px, 1.07fr);
  align-self: stretch;
  min-height: 0;
}

.nb-workbench-main .nb-whoami {
  border-right: 1px solid var(--line);
  border-bottom: 0;
}

.nb-workbench-main .nb-hero-copy {
  padding: clamp(34px, 3.4vw, 62px);
}

.nb-workbench-main .nb-whoami-name {
  font-size: clamp(2rem, 3.15vw, 3.55rem);
}

.nb-workbench-main .nb-hero-description {
  max-width: 690px;
  font-size: clamp(0.91rem, 1.1vw, 1.04rem);
}

.nb-workbench-main .nb-editor {
  align-self: center;
  width: calc(100% - clamp(28px, 3vw, 46px));
  max-width: 800px;
  margin: clamp(14px, 2vw, 28px) clamp(14px, 2vw, 28px) clamp(14px, 2vw, 28px) 0;
  justify-self: end;
}

.nb-workbench-main .nb-devbot-canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 13 / 9;
  object-fit: contain;
}

@media (min-width: 1600px) {
  .nb-main > .nb-container > .nb-hero {
    margin-bottom: 38px;
  }

  .nb-workbench-main > .nb-hero-grid {
    grid-template-columns: minmax(520px, 0.94fr) minmax(610px, 1.06fr);
  }

  .nb-workbench-main .nb-hero-copy {
    padding-inline: clamp(54px, 4vw, 78px);
  }

  .nb-workbench-main .nb-editor {
    max-width: 830px;
  }
}

@media (max-width: 1439px) {
  .nb-workbench-main > .nb-hero-grid {
    grid-template-columns: minmax(350px, 0.96fr) minmax(400px, 1.04fr);
  }

  .nb-workbench-main .nb-hero-copy {
    padding: clamp(32px, 3vw, 46px);
  }

  .nb-workbench-main .nb-whoami-name {
    font-size: clamp(1.9rem, 3.4vw, 2.8rem);
  }
}

@media (min-width: 1021px) and (max-width: 1199px) {
  .nb-workbench-main > .nb-hero-grid {
    grid-template-columns: minmax(330px, 1.04fr) minmax(390px, 0.96fr);
  }

  .nb-workbench-main .nb-hero-copy {
    padding: 30px 32px;
  }

  .nb-workbench-main .nb-editor {
    width: calc(100% - 18px);
    margin: 14px 14px 14px 0;
  }

  .nb-workbench-main .nb-code-block-compact {
    font-size: 0.65rem;
  }
}

@media (min-width: 821px) and (max-height: 900px) {
  .nb-workbench-main .nb-hero-copy {
    padding-block: 26px;
  }

  .nb-workbench-main .nb-hero-actions,
  .nb-workbench-main .nb-hero-stats {
    margin-top: 18px;
  }

  .nb-workbench-main .nb-editor {
    max-width: 630px;
    margin-block: 10px;
  }

  .nb-workbench-main .nb-code-block-compact {
    padding-block: 8px 10px;
    line-height: 1.52;
  }
}

@media (max-width: 1020px) {
  .nb-main > .nb-container > .nb-hero {
    min-height: calc(100svh - var(--header-h) - 24px);
  }

  .nb-home-feed > .nb-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .nb-workbench-main > .nb-hero-grid {
    grid-template-columns: minmax(320px, 1fr) minmax(360px, 0.94fr);
  }

  .nb-workbench-main .nb-hero-copy {
    padding: 30px;
  }

  .nb-workbench-main .nb-editor {
    width: calc(100% - 16px);
    margin: 12px 12px 12px 0;
  }
}

@media (max-width: 820px) {
  .nb-main > .nb-container > .nb-hero {
    min-height: 0;
    margin-bottom: 24px;
  }

  .nb-header-inner > .nb-nav {
    margin-left: 0;
  }

  .nb-workbench-main {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 52px minmax(0, 1fr);
  }

  .nb-workbench-main::after {
    inset: 52px 0 0;
  }

  .nb-activity-rail {
    grid-column: 1;
    grid-row: 1;
    flex-direction: row;
    min-height: 52px;
    padding: 4px 9px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nb-activity-rail .nb-activity-item::before {
    top: auto;
    right: 7px;
    bottom: -4px;
    left: 7px;
    width: auto;
    height: 2px;
    transform: scaleX(0.35);
  }

  .nb-activity-rail .nb-activity-item:is(.is-active, [aria-expanded="true"], [aria-pressed="true"])::before {
    transform: scaleX(1);
  }

  .nb-workbench-drawer {
    top: 52px;
    right: auto;
    bottom: 0;
    left: 0;
    width: min(420px, 100%);
    max-width: 100%;
    border-top: 0;
    border-right: 1px solid var(--line-strong);
    transform: translateY(-10px);
  }

  .nb-workbench-drawer.is-open,
  .nb-workbench-drawer[aria-hidden="false"] {
    transform: none;
  }

  .nb-workbench-main > .nb-hero-grid {
    grid-column: 1;
    grid-row: 2;
    grid-template-columns: minmax(0, 1fr);
  }

  .nb-workbench-main .nb-whoami {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nb-workbench-main .nb-hero-copy {
    padding: clamp(28px, 7vw, 44px);
  }

  .nb-workbench-main .nb-editor {
    width: auto;
    max-width: 680px;
    margin: 0 clamp(18px, 5vw, 36px) clamp(22px, 5vw, 36px);
    justify-self: stretch;
  }
}

@media (max-width: 720px) {
  .nb-workbench-bar {
    grid-template-columns: minmax(132px, auto) minmax(0, 1fr);
  }

  .nb-workbench-spacer {
    display: block;
  }

  .nb-header-inner > .nb-nav {
    margin-left: 0;
  }

  .nb-workbench-main .nb-hero-copy {
    padding: 28px 24px 30px;
  }

  .nb-workbench-main .nb-editor {
    margin-inline: 16px;
    margin-bottom: 22px;
  }
}

@media (max-width: 520px) {
  .nb-main > .nb-container > .nb-hero {
    margin-bottom: 20px;
  }

  .nb-workbench-bar {
    grid-template-columns: minmax(0, auto) minmax(28px, 1fr);
  }

  .nb-workbench-tab {
    max-width: calc(100vw - 106px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nb-activity-rail {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nb-activity-rail::-webkit-scrollbar {
    display: none;
  }

  .nb-workbench-drawer {
    width: 100%;
    border-right: 0;
  }

  .nb-workbench-drawer-head {
    padding-left: 12px;
  }

  .nb-activity-rail .nb-activity-item,
  .nb-workbench-drawer-close {
    width: 44px;
    height: 44px;
  }

  .nb-workbench-main .nb-hero-copy {
    padding: 25px 18px 27px;
  }

  .nb-workbench-main .nb-whoami-name {
    font-size: clamp(1.55rem, 9vw, 2.15rem);
  }

  .nb-workbench-main .nb-hero-description {
    font-size: 0.88rem;
    line-height: 1.72;
  }

  .nb-workbench-main .nb-editor {
    margin-inline: 9px;
    margin-bottom: 12px;
  }

  .nb-workbench-main .nb-devbot {
    margin: 9px 9px 0;
  }

  .nb-workbench-main .nb-code-block-compact {
    font-size: 0.62rem;
  }
}

/* ---------- Nebula 3.3 / engineering console extensions ---------- */
/* The category pill owns the surface; its generated link must not draw a second frame. */
.nb-pill > a {
  min-height: inherit;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: inherit;
  font: inherit;
}

.nb-recent-commits {
  width: min(100%, 640px);
  margin-top: clamp(22px, 3.5vh, 34px);
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.nb-recent-commits-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 14px;
}

.nb-recent-commits-head h2 {
  display: inline-flex;
  align-items: center;
  margin: 0;
  gap: 8px;
  color: var(--syntax-blue);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.075em;
}

.nb-recent-commits-head h2 i {
  width: 7px;
  height: 7px;
  border: 1px solid rgba(var(--accent-rgb), 0.55);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.07);
}

.nb-recent-commits-head code {
  min-width: 0;
  padding: 4px 7px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--editor-code);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nb-commit-list {
  display: grid;
  margin: 0;
  padding: 0;
  gap: 5px;
  list-style: none;
}

.nb-commit-item {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  min-width: 0;
  gap: 10px;
}

.nb-commit-node {
  position: relative;
  width: 8px;
  height: 8px;
  margin: 8px 0 0 2px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--syntax-cyan);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.38);
}

.nb-commit-item:not(:last-child) .nb-commit-node::after {
  position: absolute;
  top: 8px;
  left: 2px;
  width: 1px;
  height: calc(100% + 38px);
  background: var(--line-strong);
  content: "";
}

.nb-commit-content {
  min-width: 0;
  padding: 5px 8px 7px;
  border-radius: 5px;
  transition: background-color 150ms var(--ease-ui);
}

.nb-commit-content:hover {
  background: var(--editor-active);
}

.nb-commit-title {
  display: block;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 0.76rem;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nb-commit-title:hover {
  color: var(--accent-strong);
}

.nb-commit-meta {
  display: flex;
  flex-wrap: wrap;
  margin-top: 3px;
  gap: 5px 10px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.56rem;
}

.nb-commit-empty {
  margin: 0;
  padding: 11px 12px;
  border: 1px dashed var(--line-strong);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.66rem;
}

/* Sidebar runtime sensor: its DOM only exists when the matching option is enabled. */
.nb-runtime-widget {
  padding-top: 14px;
}

.nb-runtime-title {
  margin-bottom: 9px;
}

.nb-runtime-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: 0.56rem;
  text-transform: uppercase;
}

.nb-runtime-live i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.07);
}

.nb-runtime-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.nb-runtime-cell {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--editor-code);
  box-shadow: inset 2px 0 0 rgba(var(--accent-rgb), 0.18);
  font-family: var(--font-mono);
}

.nb-runtime-label,
.nb-runtime-hint {
  display: block;
  overflow: hidden;
  color: var(--text-dim);
  font-size: 0.52rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nb-runtime-value {
  display: block;
  margin: 5px 0 3px;
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1;
}

.nb-runtime-value output {
  color: inherit;
  font: inherit;
}

.nb-runtime-value small {
  color: var(--text-dim);
  font-size: 0.5rem;
  font-weight: 650;
}

.nb-runtime-cell[data-fps-level="warn"] .nb-runtime-value,
.nb-runtime-cell[data-fps-level="medium"] .nb-runtime-value,
.nb-runtime-cell[data-fps-level="mid"] .nb-runtime-value {
  color: var(--syntax-amber);
}

.nb-runtime-cell[data-fps-level="low"] .nb-runtime-value,
.nb-runtime-cell[data-fps-level="poor"] .nb-runtime-value,
.nb-runtime-cell[data-fps-level="critical"] .nb-runtime-value {
  color: var(--syntax-red);
}

.nb-runtime-cell[data-fps-level="good"] .nb-runtime-value,
.nb-runtime-cell[data-fps-level="high"] .nb-runtime-value {
  color: var(--accent-strong);
}

.nb-runtime-crawler[data-crawler-kind="crawler"] {
  box-shadow: inset 2px 0 0 rgba(255, 196, 102, 0.45);
}

.nb-runtime-crawler[data-crawler-kind="crawler"] .nb-runtime-value {
  color: var(--syntax-amber);
}

/* The comment composer is a real movable emlog form presented as a command console. */
.nb-comment-console {
  margin-top: 4px;
}

.nb-comment-console .nb-comment-console-window {
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-panel);
  background: var(--editor-code);
  box-shadow: var(--shadow-compact), inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.nb-comment-console #commentform.nb-comment-console-body {
  display: block;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.nb-comment-console-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 42px;
  align-items: center;
  padding: 0 12px;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--editor-bar);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.59rem;
}

.nb-comment-console-lights {
  display: inline-flex;
  gap: 6px;
}

.nb-comment-console-lights i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--syntax-red);
}

.nb-comment-console-lights i:nth-child(2) {
  background: var(--syntax-amber);
}

.nb-comment-console-lights i:nth-child(3) {
  background: var(--accent);
}

.nb-comment-console-title {
  overflow: hidden;
  color: var(--text-soft);
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nb-comment-console-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.nb-comment-console-state i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.nb-comment-console-window.is-locked .nb-comment-console-state {
  color: var(--syntax-amber);
}

.nb-comment-console-window.is-locked .nb-comment-console-state i {
  background: var(--syntax-amber);
}

.nb-comment-console-command {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  min-height: 48px;
  padding: 10px 16px;
  gap: 6px 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(var(--accent-rgb), 0.025);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.67rem;
}

.nb-comment-console-prompt b {
  color: var(--accent-strong);
}

.nb-comment-console-command code {
  color: var(--syntax-cyan);
  font-family: inherit;
}

.nb-comment-console-message {
  padding: 16px;
  gap: 8px;
}

.nb-comment-console-message > .nb-field-label,
.nb-comment-console-env .nb-field-label {
  color: var(--syntax-blue);
  letter-spacing: 0.035em;
}

.nb-comment-console-editor {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background:
    linear-gradient(90deg, var(--editor-gutter) 42px, transparent 42px),
    var(--surface);
}

.nb-comment-console-editor:focus-within {
  border-color: var(--line-accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.065);
}

.nb-comment-console-editor-mark {
  padding-top: 15px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  text-align: center;
  user-select: none;
}

.nb-comment-console #comment {
  width: 100%;
  min-height: 176px;
  padding: 13px 15px;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.77rem;
  line-height: 1.72;
  resize: vertical;
}

#comment-info.comment-info.nb-comment-console-env {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 15px 16px 17px;
  gap: 11px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.nb-comment-console-section-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  color: var(--syntax-cyan);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 750;
}

.nb-comment-console-section-head small {
  color: var(--text-dim);
  font-size: 0.55rem;
  font-weight: 500;
}

.nb-comment-console-env .nb-input {
  border-radius: 5px;
  background: var(--editor-code);
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.nb-comment-console-captcha {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  align-items: center;
  min-height: 44px;
  padding-top: 3px;
  gap: 8px;
}

.nb-comment-console-captcha-label {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.6rem;
}

.nb-comment-console-status {
  display: flex;
  min-height: 33px;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  gap: 8px 16px;
  border-top: 1px solid var(--line);
  background: var(--editor-bar);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.56rem;
}

.nb-comment-console-status b {
  color: var(--accent-strong);
}

.nb-comment-console-status output {
  color: var(--syntax-cyan);
  font: inherit;
}

.nb-comment-console-actions {
  display: flex;
  min-height: 58px;
  align-items: center;
  padding: 9px 12px;
  gap: 9px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.nb-comment-console-run {
  margin-right: auto;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.61rem;
}

.nb-comment-console-actions #comment_submit,
.nb-comment-console-actions #cancel-reply {
  min-height: 38px;
  border-radius: 5px;
}

.nb-comment-console-login {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  padding: clamp(18px, 4vw, 30px);
  gap: 16px;
  border: 0;
  border-radius: 0;
  background: var(--editor-code);
}

.nb-comment-console-login-icon {
  color: var(--syntax-amber);
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 850;
}

.nb-comment-console-login-copy p {
  margin: 6px 0 0;
  color: var(--text-soft);
}

/* emlog link cache and record settings are presented as a compact connection registry. */
.nb-footer-links {
  display: grid;
  padding: 17px 24px;
  gap: 11px;
  border-bottom: 1px solid var(--line);
  background: var(--editor-code);
}

.nb-footer-links-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--syntax-blue);
  font-family: var(--font-mono);
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.065em;
}

.nb-footer-links-head small {
  color: var(--text-dim);
  font-size: 0.55rem;
  font-weight: 500;
  letter-spacing: 0;
}

.nb-footer-link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.nb-footer-link-list a {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: 5px 9px;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--editor-active);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 0.64rem;
}

.nb-footer-link-list a span {
  color: var(--accent-strong);
}

.nb-footer-link-list a:hover,
.nb-footer-link-list a:focus-visible {
  border-color: var(--line-accent);
  color: var(--accent-strong);
}

.nb-footer-records {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px 12px;
}

.nb-footer-records :is(a, span) {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
}

.nb-footer-records :is(a, span)::before {
  margin-right: 5px;
  color: var(--accent-strong);
  content: "#";
  font-family: var(--font-mono);
}

.nb-footer-custom {
  margin-top: 4px;
}

@media (max-width: 820px) {
  .nb-recent-commits {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .nb-recent-commits-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .nb-recent-commits-head code {
    max-width: 100%;
  }

  .nb-comment-console-bar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .nb-comment-console-state {
    display: none;
  }

  #comment-info.comment-info.nb-comment-console-env {
    grid-template-columns: minmax(0, 1fr);
  }

  .nb-comment-console-status,
  .nb-comment-console-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .nb-comment-console-run {
    width: 100%;
    margin-right: 0;
  }

  .nb-comment-console-actions #comment_submit,
  .nb-comment-console-actions #cancel-reply {
    width: 100%;
  }

  .nb-comment-console-login {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .nb-comment-console-login .nb-btn {
    grid-column: 1 / -1;
    width: 100%;
  }

  .nb-footer-links {
    padding-inline: 17px;
  }

  .nb-footer-records {
    justify-content: flex-start;
  }
}

@media (max-width: 390px) {
  .nb-runtime-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .nb-comment-console-editor {
    grid-template-columns: 34px minmax(0, 1fr);
    background: linear-gradient(90deg, var(--editor-gutter) 34px, transparent 34px), var(--surface);
  }

  .nb-comment-console #comment {
    padding-inline: 11px;
  }
}

/* ---------- Nebula 3.4 / data bus and bot telemetry ---------- */
.nb-workbench-folder-label {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.nb-workbench-folder-label > span {
  min-width: 0;
}

.nb-workbench-pin-count {
  flex: 0 0 auto;
  padding: 2px 4px;
  border: 1px solid rgba(255, 196, 102, 0.2);
  border-radius: 3px;
  background: rgba(255, 196, 102, 0.055);
  color: var(--syntax-amber);
  font-size: 0.48rem;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.nb-workbench-pinned-list {
  padding-top: 3px !important;
}

.nb-workbench-pinned-item > a {
  line-height: 1.58;
}

.nb-workbench-pinned-empty {
  color: var(--text-dim);
  font-size: 0.62rem;
}

.nb-workbench-pinned-empty > span {
  display: inline-block;
  padding-block: 2px;
}

.nb-data-bus {
  display: none;
}

@media (min-width: 821px) {
  .nb-workbench-main > .nb-hero-grid {
    grid-template-columns: minmax(300px, 0.96fr) 36px minmax(340px, 1.04fr);
  }

  .nb-workbench-main .nb-whoami {
    grid-column: 1;
    border-right: 0;
  }

  .nb-data-bus {
    position: relative;
    display: flex;
    grid-column: 2;
    grid-row: 1;
    min-height: 0;
    align-self: stretch;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    padding: 16px 0;
    gap: 8px;
    border-right: 1px solid var(--line);
    border-left: 1px solid var(--line);
    background:
      linear-gradient(180deg, transparent, rgba(var(--accent-rgb), 0.035) 24%, rgba(var(--accent-rgb), 0.035) 76%, transparent),
      var(--editor-gutter);
    color: var(--text-dim);
    font-family: var(--font-mono);
    isolation: isolate;
  }

  .nb-data-bus-label {
    color: var(--syntax-blue);
    font-size: 0.46rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-orientation: mixed;
    writing-mode: vertical-rl;
  }

  .nb-data-bus-direction {
    color: var(--text-dim);
    font-size: 0.45rem;
    font-weight: 750;
    letter-spacing: 0.08em;
  }

  .nb-data-bus-track {
    position: relative;
    display: flex;
    width: 14px;
    min-height: 118px;
    max-height: 42%;
    flex: 1 1 180px;
    align-items: center;
    flex-direction: column;
    justify-content: space-around;
  }

  .nb-data-bus-track::before,
  .nb-data-bus-track::after {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    content: "";
    transform: translateX(-50%);
  }

  .nb-data-bus-track::before {
    background: var(--line-strong);
  }

  .nb-data-bus-track::after {
    background: repeating-linear-gradient(to bottom, transparent 0 10px, rgba(var(--accent-rgb), 0.58) 10px 13px, transparent 13px 23px);
  }

  .nb-data-bus-node {
    position: relative;
    z-index: 1;
    width: 7px;
    height: 7px;
    border: 2px solid var(--editor-gutter);
    border-radius: 50%;
    background: var(--text-dim);
    box-shadow: 0 0 0 1px var(--line-strong);
  }

  .nb-data-bus-node.is-tx {
    background: var(--accent);
    box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.55);
  }

  .nb-data-bus-node.is-relay {
    background: var(--syntax-amber);
  }

  .nb-data-bus-node.is-rx {
    background: var(--syntax-cyan);
  }

  .nb-workbench-main .nb-editor {
    grid-column: 3;
    width: auto;
    max-width: none;
    margin: 12px;
    justify-self: stretch;
  }
}

@media (min-width: 1200px) {
  .nb-workbench-main > .nb-hero-grid {
    grid-template-columns: minmax(360px, 0.94fr) 46px minmax(420px, 1.06fr);
  }

  .nb-data-bus {
    padding-block: 22px;
  }

  .nb-workbench-main .nb-editor {
    margin: clamp(14px, 1.55vw, 26px);
  }
}

.nb-bot-traffic {
  --bot-row-color: var(--syntax-blue);
  padding-top: 15px;
  font-family: var(--font-mono);
}

.nb-bot-traffic-title {
  align-items: flex-start;
  margin-bottom: 12px;
}

.nb-bot-traffic-title > div {
  display: grid;
  gap: 3px;
}

.nb-bot-traffic-kicker {
  color: var(--syntax-blue);
  font-size: 0.55rem;
  font-weight: 820;
  letter-spacing: 0.1em;
}

.nb-bot-traffic-title h3 {
  color: var(--text);
  font-size: 0.7rem;
  letter-spacing: 0.025em;
}

.nb-bot-traffic-title h3::before {
  display: none;
}

.nb-bot-traffic-live {
  display: inline-flex;
  align-items: center;
  padding-top: 2px;
  gap: 5px;
  color: var(--accent-strong);
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nb-bot-traffic-live i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.065);
}

.nb-bot-traffic-list {
  display: grid;
  margin: 0;
  padding: 0;
  gap: 2px;
  list-style: none;
}

.nb-bot-traffic-item {
  --bot-row-color: var(--syntax-blue);
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr);
  min-width: 0;
  align-items: start;
  padding: 8px 0;
  gap: 7px;
  border-bottom: 1px solid var(--line);
}

.nb-bot-traffic-item:nth-child(1) {
  --bot-row-color: var(--accent-strong);
}

.nb-bot-traffic-item:nth-child(2) {
  --bot-row-color: var(--syntax-cyan);
}

.nb-bot-traffic-item:nth-child(3) {
  --bot-row-color: var(--syntax-amber);
}

.nb-bot-traffic-rank {
  padding-top: 1px;
  color: var(--bot-row-color);
  font-size: 0.54rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.nb-bot-traffic-entry {
  min-width: 0;
}

.nb-bot-traffic-meta {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.nb-bot-traffic-meta strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 0.66rem;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nb-bot-traffic-meta > span {
  flex: 0 0 auto;
  color: var(--text-dim);
  font-size: 0.49rem;
  white-space: nowrap;
}

.nb-bot-traffic-meta b {
  color: var(--bot-row-color);
  font-size: 0.59rem;
}

.nb-bot-traffic-bar {
  position: relative;
  display: block;
  height: 3px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 0 2px 2px 0;
  background: var(--line);
}

.nb-bot-traffic-bar i {
  display: block;
  width: min(100%, var(--bot-share));
  height: 100%;
  border-radius: inherit;
  background: var(--bot-row-color);
  box-shadow: 0 0 8px color-mix(in srgb, var(--bot-row-color) 26%, transparent);
}

@supports not (color: color-mix(in srgb, white, black)) {
  .nb-bot-traffic-bar i {
    box-shadow: none;
  }
}

.nb-bot-traffic-empty {
  display: grid;
  min-height: 108px;
  align-content: center;
  justify-items: center;
  padding: 15px 10px;
  border: 1px dashed var(--line-strong);
  background: var(--editor-code);
  color: var(--text-dim);
  text-align: center;
}

.nb-bot-traffic-empty > span {
  color: var(--syntax-cyan);
  font-size: 1.05rem;
}

.nb-bot-traffic-empty strong {
  margin-top: 5px;
  color: var(--text-soft);
  font-size: 0.64rem;
}

.nb-bot-traffic-empty p {
  max-width: 220px;
  margin: 5px 0 0;
  font-size: 0.53rem;
  line-height: 1.55;
}

.nb-bot-traffic-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 12px 0 0;
  border: 1px solid var(--line);
  background: var(--editor-code);
}

.nb-bot-traffic-summary > div {
  min-width: 0;
  padding: 8px 6px;
}

.nb-bot-traffic-summary > div + div {
  border-left: 1px solid var(--line);
}

.nb-bot-traffic-summary dt,
.nb-bot-traffic-summary dd {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nb-bot-traffic-summary dt {
  color: var(--text-dim);
  font-size: 0.43rem;
}

.nb-bot-traffic-summary dd {
  margin: 4px 0 0;
  color: var(--accent-strong);
  font-size: 0.62rem;
  font-weight: 780;
}

.nb-footer-records .nb-footer-record {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nb-footer-records .nb-footer-record::before {
  display: none;
}

.nb-footer-record img {
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
}

.nb-footer-record-icp img {
  width: 16px;
  height: 16px;
}

.nb-footer-record-police img {
  width: 20px;
  height: 20px;
}

@media (max-width: 390px) {
  .nb-bot-traffic-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .nb-bot-traffic-summary {
    grid-template-columns: minmax(0, 1fr);
  }

  .nb-bot-traffic-summary > div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

/* ---------- Nebula 3.6 / adaptive reader, indexes, telemetry and i18n ---------- */
/* Keep the featured cover width identical to every other cover. Height may
   still grow with content, but source image dimensions never affect columns. */
@media (min-width: 721px) {
  .nb-card.has-cover,
  .nb-card.is-featured.has-cover {
    grid-template-columns: 200px minmax(0, 1fr);
  }
}

.nb-card-inline-gallery {
  display: flex;
  min-width: 0;
  height: clamp(64px, 8vw, 92px);
  margin-top: 12px;
  overflow: hidden;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--editor-gutter);
}

.nb-card-inline-gallery > span {
  min-width: 0;
  flex: 1 1 0;
  overflow: hidden;
}

.nb-card-inline-gallery img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 180ms var(--ease-ui), filter 180ms var(--ease-ui);
}

.nb-card-inline-gallery:hover img {
  filter: saturate(1.04);
  transform: scale(1.025);
}

.nb-card-like {
  display: inline-flex;
  min-width: 42px;
  min-height: 34px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--editor-code);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.61rem;
  cursor: pointer;
  transition: color 140ms var(--ease-ui), border-color 140ms var(--ease-ui), background-color 140ms var(--ease-ui), transform 120ms var(--ease-ui);
}

.nb-card-like:hover,
.nb-card-like:focus-visible,
.nb-card-like.is-liked,
.nb-card-like[aria-pressed="true"] {
  border-color: var(--line-accent);
  background: rgba(var(--accent-rgb), 0.075);
  color: var(--accent-strong);
}

.nb-card-like.is-liked svg,
.nb-card-like[aria-pressed="true"] svg {
  fill: rgba(var(--accent-rgb), 0.22);
}

.nb-card-like.is-busy {
  cursor: wait;
  opacity: 0.7;
}

.nb-card-like:active:not(.is-busy) {
  transform: translateY(1px);
}

.nb-card-like.has-error {
  border-color: color-mix(in srgb, var(--danger) 46%, var(--line));
  color: var(--danger);
}

/* The reader shell now uses the same container width as the header. The TOC
   owns an independent sticky rail and the document occupies the right pane. */
.nb-layout-reading {
  --reader-rail: clamp(218px, 19vw, 250px);
  --reader-gap: clamp(20px, 2.25vw, 32px);
}

.nb-reader {
  width: 100%;
  max-width: none;
}

.nb-article-layout,
.nb-reader.has-toc .nb-article-layout,
.nb-article-layout.has-toc {
  grid-template-columns: minmax(0, 1fr);
  justify-content: stretch;
  gap: var(--reader-gap);
}

.nb-document-shell {
  min-width: 0;
}

.nb-article-breadcrumb {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 0;
  align-items: center;
  margin-bottom: 13px;
  gap: 7px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.63rem;
}

.nb-article-breadcrumb svg {
  flex: 0 0 auto;
  color: var(--accent-strong);
}

.nb-article-breadcrumb a {
  flex: 0 0 auto;
  color: var(--syntax-blue);
}

.nb-article-breadcrumb a:hover,
.nb-article-breadcrumb a:focus-visible {
  color: var(--accent-strong);
}

.nb-article-breadcrumb-current {
  min-width: 0;
  overflow: hidden;
  color: var(--text-soft);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nb-toc-rail-head {
  display: flex;
  min-height: 27px;
  align-items: center;
  justify-content: space-between;
  margin: -17px -17px 13px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
  background: var(--editor-bar);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.54rem;
}

.nb-toc-rail-head i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.07);
}

@media (min-width: 1021px) {
  .nb-article-layout.has-toc,
  .nb-reader.has-toc .nb-article-layout {
    grid-template-columns: var(--reader-rail) minmax(0, 1fr);
  }

  .nb-reader.has-toc .nb-article-headwrap {
    width: auto;
    max-width: none;
    margin-right: 0;
    margin-left: calc(var(--reader-rail) + var(--reader-gap));
  }

  .nb-reader.has-toc .nb-toc-wrap {
    grid-column: 1;
    grid-row: 1;
  }

  .nb-reader.has-toc .nb-document-shell {
    grid-column: 2;
    grid-row: 1;
  }
}

.nb-comment-header {
  display: flex;
  min-height: 44px;
  align-items: center;
  margin: 28px 0 10px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: 6px;
  background: var(--editor-bar);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.76rem;
}

.nb-comment-header::before {
  margin-right: 9px;
  color: var(--syntax-cyan);
  content: "$ git log comments";
  font-size: 0.58rem;
  font-weight: 500;
}

.nb-comments > .nb-comment {
  visibility: visible;
  opacity: 1;
}

.nb-comment > .comment-infos {
  background: var(--surface-2);
}

/* Sidebar indexes share a compact IDE-file treatment. */
.nb-widget-link-grid,
.nb-widget-tag-grid,
.nb-widget-sort-grid,
.nb-widget-archive-grid {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nb-widget-link-grid,
.nb-widget-tag-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.nb-widget-sort-grid,
.nb-widget-archive-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.nb-widget-list:is(.nb-widget-link-grid, .nb-widget-tag-grid, .nb-widget-sort-grid, .nb-widget-archive-grid) > li + li {
  margin-top: 0;
}

.nb-widget-link-card,
.nb-widget-tag-item,
.nb-widget-sort-item,
.nb-widget-archive-item {
  min-width: 0;
}

.nb-widget-link-card > .nb-widget-link {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 68px;
  align-content: center;
  justify-items: center;
  padding: 7px 4px;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--editor-code);
  text-align: center;
}

.nb-widget-link-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--syntax-cyan);
}

.nb-widget-link-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nb-widget-link-fallback {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  font-weight: 750;
}

.nb-widget-link-name {
  display: block;
  width: 100%;
  overflow: hidden;
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 0.56rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nb-widget-link-description {
  display: none;
}

.nb-widget-link-card > .nb-widget-link:hover,
.nb-widget-link-card > .nb-widget-link:focus-visible {
  border-color: var(--line-accent);
  background: rgba(var(--accent-rgb), 0.055);
}

.nb-widget-tag-item {
  --nb-tag-color: var(--tag-tone-1);
  --nb-tag-rgb: var(--tag-tone-1-rgb);
}

.nb-widget-tag-item[data-tone="2"] { --nb-tag-color: var(--tag-tone-2); --nb-tag-rgb: var(--tag-tone-2-rgb); }
.nb-widget-tag-item[data-tone="3"] { --nb-tag-color: var(--tag-tone-3); --nb-tag-rgb: var(--tag-tone-3-rgb); }
.nb-widget-tag-item[data-tone="4"] { --nb-tag-color: var(--tag-tone-4); --nb-tag-rgb: var(--tag-tone-4-rgb); }

.nb-widget-tag-item > .nb-tag {
  display: flex;
  min-width: 0;
  min-height: 31px;
  align-items: center;
  padding: 0 5px;
  gap: 3px;
  border-color: rgba(var(--nb-tag-rgb), 0.24);
  background: rgba(var(--nb-tag-rgb), 0.065);
  color: var(--nb-tag-color);
}

.nb-widget-tag-item .nb-tag-name {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  font-size: 0.55rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nb-widget-tag-item .nb-tag-count {
  flex: 0 0 auto;
  color: var(--text-dim);
  font-size: 0.46rem;
}

.nb-widget-sort-item > a,
.nb-widget-archive-item > a {
  display: flex;
  min-width: 0;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  padding: 7px 8px;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--editor-code);
}

.nb-widget-sort-item > a:hover,
.nb-widget-sort-item > a:focus-visible,
.nb-widget-archive-item > a:hover,
.nb-widget-archive-item > a:focus-visible {
  border-color: var(--line-accent);
  background: rgba(var(--accent-rgb), 0.055);
}

.nb-sort-main {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.nb-sort-depth {
  color: var(--syntax-blue);
  font-family: var(--font-mono);
  font-size: 0.45rem;
}

.nb-sort-name,
.nb-archive-label {
  min-width: 0;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 0.62rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nb-sort-count,
.nb-archive-count {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: 0.5rem;
}

.nb-side-post-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--editor-code);
}

.nb-side-post-card + .nb-side-post-card {
  margin-top: 9px !important;
}

.nb-side-post-cover {
  height: 112px;
  border-radius: 0;
}

.nb-side-post-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nb-side-post-title {
  display: block;
  min-width: 0;
  padding: 9px 10px 7px;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 0.66rem;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nb-side-post-gallery {
  display: flex;
  width: 100%;
  height: 62px;
  min-width: 0;
  gap: 3px;
  overflow: hidden;
}

.nb-side-post-gallery-item {
  min-width: 0;
  flex: 1 1 0;
  overflow: hidden;
}

.nb-side-post-gallery-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Footer connection registry and runtime table. */
.nb-footer-shell {
  overflow: visible;
}

.nb-footer-links {
  position: relative;
  z-index: 3;
}

.nb-footer-link-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.nb-footer-link-list .nb-footer-link {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 48px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  padding: 6px 8px;
  gap: 7px;
}

.nb-footer-link-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--syntax-cyan) !important;
}

.nb-footer-link-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nb-footer-link-name {
  min-width: 0;
  overflow: hidden;
  color: var(--text-soft) !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nb-footer-link-arrow {
  color: var(--accent-strong) !important;
}

.nb-footer-link-tooltip {
  position: absolute;
  z-index: 20;
  bottom: calc(100% + 9px);
  left: 0;
  display: grid;
  width: min(260px, calc(100vw - 42px));
  padding: 10px 11px;
  gap: 4px;
  visibility: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--editor-bar);
  box-shadow: var(--shadow-compact);
  color: var(--text-soft) !important;
  font-family: var(--font-mono);
  font-size: 0.61rem;
  line-height: 1.55;
  opacity: 0;
  pointer-events: none;
  transform: translateY(5px);
  transition: opacity 130ms var(--ease-ui), visibility 130ms var(--ease-ui), transform 130ms var(--ease-ui);
}

.nb-footer-link-tooltip::after {
  position: absolute;
  top: 100%;
  left: 17px;
  border: 5px solid transparent;
  border-top-color: var(--line-strong);
  content: "";
}

.nb-footer-link:nth-child(4n) .nb-footer-link-tooltip {
  right: 0;
  left: auto;
}

.nb-footer-link:nth-child(4n) .nb-footer-link-tooltip::after {
  right: 17px;
  left: auto;
}

.nb-footer-link-tooltip small {
  color: var(--syntax-blue) !important;
  font-size: 0.48rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.nb-footer-link:hover .nb-footer-link-tooltip,
.nb-footer-link:focus-visible .nb-footer-link-tooltip {
  visibility: visible;
  opacity: 1;
  transform: none;
}

.nb-footer-telemetry {
  border-top: 1px solid var(--line);
  background: var(--editor-code);
}

.nb-footer-telemetry-head {
  display: flex;
  min-height: 36px;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--syntax-blue);
  font-family: var(--font-mono);
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.065em;
}

.nb-footer-telemetry-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-size: 0.52rem;
  font-weight: 500;
  letter-spacing: 0;
}

.nb-footer-telemetry-live i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.07);
}

.nb-footer-telemetry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--line);
}

.nb-footer-metric {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 112px;
  grid-template-columns: auto minmax(0, 1fr);
  align-content: center;
  padding: 14px 15px;
  gap: 4px 9px;
  background: var(--editor-code);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.nb-footer-metric-icon {
  display: grid;
  width: 28px;
  height: 28px;
  grid-row: 1 / span 2;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--editor-active);
  color: var(--syntax-blue);
}

.nb-footer-metric[data-metric="database"] .nb-footer-metric-icon { color: var(--syntax-amber); }
.nb-footer-metric[data-metric="online"] .nb-footer-metric-icon,
.nb-footer-metric[data-metric="uptime"] .nb-footer-metric-icon,
.nb-footer-metric[data-metric="sitemap"] .nb-footer-metric-icon { color: var(--accent-strong); }

.nb-footer-metric-label {
  align-self: end;
  color: var(--text-dim);
  font-size: 0.5rem;
  font-weight: 750;
  letter-spacing: 0.06em;
}

.nb-footer-metric-value {
  min-width: 0;
  color: var(--text);
  font-size: 0.77rem;
  font-style: normal;
  line-height: 1.25;
}

.nb-footer-metric-value output {
  color: var(--accent-strong);
  font: inherit;
}

.nb-footer-metric-value small {
  color: var(--text-dim);
  font-size: 0.51rem;
  font-weight: 600;
}

.nb-footer-metric-value em {
  color: var(--line-strong);
  font-style: normal;
}

.nb-footer-metric-sub {
  grid-column: 1 / -1;
  margin-top: 4px;
  overflow-wrap: anywhere;
  color: var(--text-dim);
  font-size: 0.51rem;
  line-height: 1.45;
}

.nb-footer-metric-link {
  min-height: 112px;
}

.nb-footer-metric-link:hover,
.nb-footer-metric-link:focus-visible {
  z-index: 1;
  outline: 1px solid var(--line-accent);
  outline-offset: -1px;
  background: var(--editor-active);
}

/* Full-screen blur was the costly part of opening search in Chromium. The
   solid scrim and compositor-only panel transition retain hierarchy cheaply. */
.nb-search {
  background: rgba(2, 7, 5, 0.82);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  transition: opacity 150ms var(--ease-ui), visibility 150ms var(--ease-ui);
}

html[data-theme="light"] .nb-search {
  background: rgba(225, 233, 229, 0.9);
}

.nb-search-panel {
  background: var(--surface);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.32), var(--shadow-inner);
  opacity: 0.98;
  transform: translate3d(0, -8px, 0) scale(0.992);
  transition: opacity 150ms var(--ease-ui), transform 150ms var(--ease-ui);
  contain: paint;
}

.nb-search.is-open .nb-search-panel {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* Height drives the desktop Workbench scale. This late rule intentionally
   comes after the 3.4 DATA BUS overrides that previously defeated it. */
@media (min-width: 821px) and (max-height: 900px) {
  .nb-main > .nb-container > .nb-hero {
    min-height: calc(100vh - var(--header-h) - 28px);
    min-height: calc(100dvh - var(--header-h) - 28px);
  }

  .nb-workbench-main .nb-editor {
    width: min(calc(100% - 20px), clamp(420px, 65vh, 630px));
    width: min(calc(100% - 20px), clamp(420px, 65dvh, 630px));
    max-width: 630px;
    margin: 10px;
    justify-self: center;
  }

  .nb-workbench-main .nb-code-block-compact {
    max-height: clamp(122px, 18vh, 150px);
    max-height: clamp(122px, 18dvh, 150px);
    padding-block: 6px 8px;
    overflow: auto;
    overscroll-behavior: contain;
    line-height: 1.4;
    scrollbar-width: thin;
  }

  .nb-workbench-main .nb-code-block-compact .nb-code-row {
    min-height: 18px;
  }
}

@media (min-width: 821px) and (max-height: 800px) {
  .nb-workbench-main .nb-hero-copy {
    padding-block: 18px;
  }

  .nb-workbench-main .nb-whoami-command {
    margin-bottom: 13px;
  }

  .nb-workbench-main .nb-hero-kicker {
    margin-bottom: 8px;
  }

  .nb-workbench-main .nb-hero-description {
    display: -webkit-box;
    margin-top: 10px;
    overflow: hidden;
    line-height: 1.58;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .nb-workbench-main .nb-hero-actions,
  .nb-workbench-main .nb-hero-stats {
    margin-top: 12px;
  }

  .nb-workbench-main .nb-recent-commits {
    margin-top: 13px;
    padding-top: 11px;
  }

  .nb-workbench-main .nb-commit-list {
    gap: 2px;
  }

  .nb-workbench-main .nb-commit-content {
    padding-block: 3px 4px;
  }
}

@media (max-width: 1020px) {
  .nb-reader.has-toc .nb-article-headwrap,
  .nb-article-headwrap {
    width: min(820px, 100%);
    margin-inline: auto;
  }

  .nb-article-layout.has-toc,
  .nb-reader.has-toc .nb-article-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .nb-toc-wrap {
    position: static;
    grid-row: 1;
  }

  .nb-document-shell {
    grid-row: 2;
  }
}

@media (max-width: 720px) {
  .nb-card-inline-gallery {
    height: 76px;
  }

  .nb-footer-link-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nb-footer-link:nth-child(2n) .nb-footer-link-tooltip {
    right: 0;
    left: auto;
  }

  .nb-footer-link:nth-child(2n) .nb-footer-link-tooltip::after {
    right: 17px;
    left: auto;
  }

  .nb-footer-telemetry-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nb-footer-telemetry-grid > :last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .nb-widget-link-grid,
  .nb-widget-tag-grid {
    gap: 5px;
  }

  .nb-widget-link-card > .nb-widget-link {
    min-height: 64px;
  }

  .nb-article-breadcrumb {
    margin-bottom: 10px;
  }

  .nb-article-breadcrumb-current {
    max-width: 42vw;
  }

  .nb-comment-header {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding-block: 9px;
    gap: 3px;
  }

  .nb-comment-header::before {
    margin-right: 0;
  }
}

@media (max-width: 390px) {
  .nb-footer-link-list,
  .nb-footer-telemetry-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .nb-footer-telemetry-grid > :last-child:nth-child(odd) {
    grid-column: auto;
  }
}

@media (forced-colors: active) {
  .nb-card-inline-gallery,
  .nb-card-like,
  .nb-widget-link-card > .nb-widget-link,
  .nb-widget-tag-item > .nb-tag,
  .nb-widget-sort-item > a,
  .nb-widget-archive-item > a,
  .nb-side-post-card,
  .nb-footer-metric,
  .nb-footer-link-tooltip {
    border: 1px solid CanvasText;
  }
}

/* ---------- Reader command deck / visitor locale ---------- */
.nb-card-like {
  min-width: 0;
  min-height: 32px;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  outline-offset: 3px;
  background: transparent;
  color: var(--text-dim);
  box-shadow: none;
}

.nb-card-like:hover,
.nb-card-like:focus-visible,
.nb-card-like.is-liked,
.nb-card-like[aria-pressed="true"] {
  border-color: transparent;
  background: transparent;
  color: var(--accent-strong);
}

.nb-card-like:focus-visible {
  outline: 1px solid var(--accent-strong);
}

.nb-card-like.has-error {
  border-color: transparent;
  background: color-mix(in srgb, var(--danger) 8%, transparent);
  color: var(--danger);
}

.nb-article-header {
  overflow: visible;
  margin-bottom: 0;
}

.nb-reader-context {
  position: relative;
  z-index: 8;
  display: flex;
  min-width: 0;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  margin: 10px 0;
  padding: 0 12px;
  gap: 12px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: 6px;
  background: var(--editor-bar);
  box-shadow: var(--shadow-inner);
}

.nb-reader-context .nb-article-breadcrumb {
  flex: 1 1 auto;
  margin: 0;
  overflow: hidden;
}

.nb-reader-context-state {
  flex: 0 0 auto;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.035em;
}

.nb-article-info {
  flex-wrap: wrap;
  align-items: center;
}

.nb-article-header.has-open-popover,
.nb-article-info.has-open-popover {
  z-index: 60;
}

.nb-article-info-left {
  align-items: center;
  gap: 5px 14px;
}

.nb-reader-stat {
  display: inline-flex;
  min-width: 0;
  min-height: 28px;
  align-items: center;
  gap: 5px;
  color: var(--text-dim);
  white-space: nowrap;
}

.nb-reader-stat > svg {
  flex: 0 0 auto;
  color: var(--syntax-blue);
}

a.nb-reader-stat:hover,
a.nb-reader-stat:focus-visible {
  color: var(--accent-strong);
}

.nb-reader-live i {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--text-dim);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.04);
}

.nb-reader-live.is-live i {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.09);
  animation: nb-reader-pulse 2.2s ease-in-out infinite;
}

.nb-reader-live.has-error i {
  background: var(--syntax-amber);
}

@keyframes nb-reader-pulse {
  50% { box-shadow: 0 0 0 6px rgba(var(--accent-rgb), 0); }
}

.nb-reader-tools {
  position: relative;
  display: flex;
  min-width: 0;
  flex: 0 1 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
  gap: 2px;
}

.nb-reader-action,
.nb-reader-edit a {
  display: inline-flex;
  min-width: 0;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  gap: 5px;
  border: 0;
  border-radius: 4px;
  outline-offset: 1px;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.61rem;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 130ms var(--ease-ui), color 130ms var(--ease-ui), opacity 130ms var(--ease-ui);
}

.nb-reader-action:hover,
.nb-reader-action:focus-visible,
.nb-reader-action.is-active,
.nb-reader-action.is-copied,
.nb-reader-edit a:hover,
.nb-reader-edit a:focus-visible {
  background: rgba(var(--accent-rgb), 0.07);
  color: var(--accent-strong);
}

.nb-reader-action:focus-visible,
.nb-reader-edit a:focus-visible {
  outline: 1px solid var(--line-accent);
}

.nb-reader-action:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.nb-reader-action-icon {
  width: 28px;
  padding: 0;
  color: var(--syntax-amber);
}

.nb-reader-popover {
  position: relative;
}

.nb-reader-popover.is-open {
  z-index: 40;
}

.nb-share-menu {
  position: absolute;
  z-index: 45;
  top: calc(100% + 7px);
  right: 0;
  display: grid;
  width: 218px;
  max-width: calc(100vw - 42px);
  padding: 6px;
  gap: 2px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface-2);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.28), var(--shadow-inner);
}

.nb-share-menu[hidden] {
  display: none;
}

.nb-share-menu-label {
  padding: 5px 7px 7px;
  border-bottom: 1px solid var(--line);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.5rem;
}

.nb-share-menu :is(a, button) {
  display: flex;
  min-height: 36px;
  align-items: center;
  padding: 0 8px;
  gap: 8px;
  border: 0;
  border-radius: 4px;
  outline-offset: -1px;
  background: transparent;
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  text-align: left;
  cursor: pointer;
}

.nb-share-menu :is(a, button):hover,
.nb-share-menu :is(a, button):focus-visible {
  outline: 1px solid var(--line-accent);
  background: var(--editor-active);
  color: var(--accent-strong);
}

.nb-share-service {
  display: grid;
  width: 23px;
  height: 23px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--editor-code);
  color: var(--syntax-blue);
  font-size: 0.56rem;
  font-weight: 800;
}

.nb-qr-modal {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 150ms var(--ease-ui), visibility 150ms var(--ease-ui);
}

.nb-qr-modal[hidden] {
  display: none;
}

.nb-qr-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.nb-qr-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 7, 5, 0.82);
}

html[data-theme="light"] .nb-qr-backdrop {
  background: rgba(225, 233, 229, 0.9);
}

.nb-qr-dialog {
  position: relative;
  width: min(420px, 100%);
  max-height: calc(100dvh - 36px);
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: 0;
  background: var(--surface);
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.38), var(--shadow-inner);
  color: var(--text-soft);
  opacity: 0.96;
  transform: translateY(8px) scale(0.988);
  transition: opacity 150ms var(--ease-ui), transform 150ms var(--ease-ui);
}

.nb-qr-modal.is-open .nb-qr-dialog {
  opacity: 1;
  transform: none;
}

.nb-qr-head {
  display: flex;
  min-height: 60px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 10px 15px;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--editor-bar);
}

.nb-qr-head span {
  display: block;
  margin-bottom: 3px;
  color: var(--syntax-blue);
  font-family: var(--font-mono);
  font-size: 0.49rem;
}

.nb-qr-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 0.94rem;
}

.nb-qr-head button {
  display: grid;
  width: 32px;
  height: 32px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-dim);
  font-size: 1.1rem;
  cursor: pointer;
}

.nb-qr-head button:hover,
.nb-qr-head button:focus-visible {
  outline: 1px solid var(--line-accent);
  color: var(--accent-strong);
}

.nb-qr-stage {
  position: relative;
  display: grid;
  min-height: 286px;
  margin: 17px 17px 12px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(rgba(var(--accent-rgb), 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--accent-rgb), 0.035) 1px, transparent 1px),
    var(--editor-code);
  background-size: 18px 18px;
}

.nb-qr-stage canvas {
  display: block;
  max-width: calc(100% - 24px);
  height: auto !important;
  border: 0;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 0 0 8px #fff, 0 8px 26px rgba(0, 0, 0, 0.22);
  image-rendering: pixelated;
}

.nb-qr-corners,
.nb-qr-corners::before,
.nb-qr-corners::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.nb-qr-corners {
  inset: 12px;
}

.nb-qr-corners::before {
  top: 0;
  left: 0;
  width: 18px;
  height: 18px;
  border-color: var(--accent);
  border-style: solid;
  border-width: 1px 0 0 1px;
}

.nb-qr-corners::after {
  right: 0;
  bottom: 0;
  width: 18px;
  height: 18px;
  border-color: var(--accent);
  border-style: solid;
  border-width: 0 1px 1px 0;
}

.nb-qr-modal.has-error .nb-qr-stage::after {
  position: absolute;
  inset: 16px;
  display: grid;
  place-items: center;
  padding: 18px;
  background: var(--surface-2);
  color: var(--danger);
  content: "QR_GENERATION_ERROR";
  font-family: var(--font-mono);
  font-size: 0.66rem;
  text-align: center;
}

.nb-qr-dialog > p {
  margin: 0;
  padding: 0 17px;
  color: var(--text-soft);
  font-size: 0.72rem;
  line-height: 1.6;
}

.nb-qr-url {
  display: block;
  margin: 9px 17px 13px;
  padding: 8px 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--editor-code);
  color: var(--syntax-blue);
  font-family: var(--font-mono);
  font-size: 0.56rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nb-qr-actions {
  display: flex;
  justify-content: flex-end;
  padding: 11px 17px 16px;
  gap: 7px;
  border-top: 1px solid var(--line);
}

.nb-qr-actions button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--editor-code);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  cursor: pointer;
}

.nb-qr-actions button:hover,
.nb-qr-actions button:focus-visible,
.nb-qr-actions button.is-copied {
  border-color: var(--line-accent);
  outline: 0;
  color: var(--accent-strong);
}

.nb-footer-language,
.nb-footer-language-label,
.nb-footer-language-options {
  display: inline-flex;
  align-items: center;
}

.nb-footer-language {
  min-width: 0;
  gap: 7px;
}

.nb-footer-language-label {
  gap: 5px;
  color: var(--text-dim);
  white-space: nowrap;
}

.nb-footer-language-label svg {
  color: var(--syntax-blue);
}

.nb-footer-language-options {
  overflow: hidden;
  padding: 2px;
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--editor-code);
}

.nb-footer-language-options button {
  min-height: 24px;
  padding: 0 7px;
  border: 0;
  border-radius: 3px;
  outline-offset: -1px;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.55rem;
  cursor: pointer;
}

.nb-footer-language-options button:hover,
.nb-footer-language-options button:focus-visible {
  outline: 1px solid var(--line-accent);
  color: var(--accent-strong);
}

.nb-footer-language-options button[aria-pressed="true"] {
  background: rgba(var(--accent-rgb), 0.09);
  color: var(--accent-strong);
  cursor: default;
  opacity: 1;
}

.nb-footer-language.is-busy {
  opacity: 0.65;
}

.nb-footer-language.has-error .nb-footer-language-options {
  border-color: color-mix(in srgb, var(--danger) 45%, var(--line));
}

@media (min-width: 1021px) {
  .nb-reader.has-toc .nb-reader-context {
    margin-left: calc(var(--reader-rail) + var(--reader-gap));
  }
}

@media (max-width: 1020px) {
  .nb-reader-context {
    margin-left: 0;
  }

  .nb-reader-action > span:not(.sr-only) {
    display: none;
  }
}

@media (max-width: 720px) {
  .nb-article-info {
    gap: 9px;
  }

  .nb-article-info-left,
  .nb-reader-tools {
    width: 100%;
  }

  .nb-reader-tools {
    justify-content: flex-start;
    margin-left: 0;
    padding-top: 8px;
    border-top: 1px solid var(--line);
  }

  .nb-reader-context-state,
  .nb-footer-language-label {
    display: none;
  }

  .nb-share-menu {
    right: auto;
    left: 0;
  }

  .nb-footer-status {
    gap: 9px;
  }
}

@media (max-width: 520px) {
  .nb-reader-context {
    min-height: 36px;
    padding-inline: 9px;
  }

  .nb-reader-context .nb-article-breadcrumb {
    margin: 0;
    font-size: 0.57rem;
  }

  .nb-reader-context .nb-article-breadcrumb-current {
    max-width: 34vw;
  }

  .nb-reader-stat {
    min-height: 24px;
    font-size: 0.58rem;
  }

  .nb-reader-tools {
    gap: 0;
  }

  .nb-reader-action,
  .nb-reader-edit a {
    min-height: 40px;
    padding-inline: 8px;
  }

  .nb-share-menu {
    right: auto;
    left: 0;
    width: min(218px, calc(100vw - 52px));
  }

  .nb-qr-modal {
    padding: 13px;
  }

  .nb-qr-stage {
    min-height: 260px;
    margin-inline: 12px;
  }

  .nb-footer-status {
    padding-inline: 9px;
  }

  .nb-status-left {
    gap: 6px;
  }

  .nb-status-left > :last-child {
    display: none;
  }
}

@media (max-width: 350px) {
  .nb-status-live {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nb-reader-live.is-live i {
    animation: none;
  }
}

@media (forced-colors: active) {
  .nb-card-like,
  .nb-reader-action,
  .nb-reader-edit a,
  .nb-footer-language-options,
  .nb-qr-dialog {
    border: 1px solid CanvasText;
  }
}

/* ---------- Graceful degradation / user preferences ---------- */
@media (prefers-reduced-motion: reduce), (update: slow) {
  .nb-header-shell,
  .nb-dropdown,
  .nb-nav-mask,
  .nb-search,
  .nb-search-panel,
  .nb-workbench,
  .nb-context,
  .nb-posts,
  .nb-sidebar,
  .nb-article-header,
  .nb-toc,
  .nb-empty,
  .nb-error,
  .nb-footer-inner,
  .nb-footer-shell,
  .nb-float-btn,
  .nb-nav {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  .nb-header-shell,
  .nb-dropdown,
  .nb-search-panel,
  .nb-workbench,
  .nb-context,
  .nb-posts,
  .nb-sidebar,
  .nb-article-header,
  .nb-toc,
  .nb-empty,
  .nb-error,
  .nb-footer-inner,
  .nb-footer-shell,
  .nb-float-btn,
  .nb-nav {
    background-color: var(--surface);
  }

  .nb-noise {
    display: none;
  }

  .nb-grid {
    opacity: 0.18;
    mask-image: none;
  }
}

@supports not ((-webkit-backdrop-filter: blur(2px)) or (backdrop-filter: blur(2px))) {
  .nb-header-shell,
  .nb-search-panel,
  .nb-workbench,
  .nb-posts,
  .nb-sidebar,
  .nb-article-header,
  .nb-toc,
  .nb-footer-inner,
  .nb-footer-shell,
  .nb-float-btn {
    background: var(--surface);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html.js .reveal:not(.is-inview) {
    opacity: 1;
    transform: none;
  }
}

@media (forced-colors: active) {
  .nb-header-shell,
  .nb-workbench,
  .nb-workbench-drawer,
  .nb-posts,
  .nb-sidebar,
  .nb-article-header,
  .nb-markdown,
  .nb-toc,
  .nb-widget {
    border: 1px solid CanvasText;
  }

  .nb-activity-rail .nb-activity-item,
  .nb-workbench-drawer-close,
  .nb-workbench-command {
    border: 1px solid ButtonText;
  }

  .nb-comment-console-window,
  .nb-runtime-cell,
  .nb-footer-link-list a,
  .nb-recent-commits {
    border: 1px solid CanvasText;
  }

  .nb-workbench-drawer {
    box-shadow: none;
  }

  .nb-activity-rail .nb-activity-item:is(.is-active, [aria-expanded="true"], [aria-pressed="true"]) {
    background: Highlight;
    color: HighlightText;
    forced-color-adjust: none;
  }

  .nb-bg,
  .nb-progress {
    display: none;
  }
}
