:root {
  --lab-bg: #071018;
  --lab-bg-soft: #0b1622;
  --lab-panel: rgba(14, 27, 40, 0.82);
  --lab-panel-solid: #0e1b28;
  --lab-border: rgba(131, 169, 196, 0.18);
  --lab-border-strong: rgba(69, 208, 191, 0.34);
  --lab-accent: #45d0bf;
  --lab-accent-strong: #69e2d3;
  --lab-accent-soft: rgba(69, 208, 191, 0.11);
  --lab-blue: #74aee8;
  --lab-text: #e8f0f6;
  --lab-text-muted: #9aabba;
  --lab-text-faint: #6f8293;
  --lab-danger: #ff8c8c;
  --lab-success: #70dfb2;
  --lab-radius: 18px;
  --lab-radius-sm: 12px;
  --lab-shadow: 0 22px 60px rgba(0, 0, 0, 0.22);
}

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

html[theme='light'] {
  --lab-bg: #f4f7f9;
  --lab-bg-soft: #edf3f5;
  --lab-panel: rgba(255, 255, 255, 0.88);
  --lab-panel-solid: #ffffff;
  --lab-border: rgba(21, 54, 72, 0.14);
  --lab-border-strong: rgba(0, 137, 123, 0.3);
  --lab-accent: #087f74;
  --lab-accent-strong: #04685f;
  --lab-accent-soft: rgba(8, 127, 116, 0.09);
  --lab-blue: #2f70ad;
  --lab-text: #162531;
  --lab-text-muted: #526673;
  --lab-text-faint: #71828c;
  --lab-shadow: 0 22px 60px rgba(21, 54, 72, 0.1);
}

html {
  scroll-behavior: smooth;
}

body {
  color: var(--lab-text);
  background:
    radial-gradient(circle at 15% -10%, rgba(69, 208, 191, 0.08), transparent 34rem),
    radial-gradient(circle at 90% 8%, rgba(116, 174, 232, 0.07), transparent 30rem),
    var(--lab-bg);
  font-family: Inter, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  display: none !important;
}

::-webkit-scrollbar-thumb {
  background: var(--lab-border-strong) !important;
  box-shadow: none !important;
}

a,
button,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(69, 208, 191, 0.3);
  outline-offset: 3px;
}

img,
video,
iframe {
  max-width: 100%;
}

#main-grid {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
}

#nav {
  position: sticky;
  top: 12px;
  z-index: 100;
  margin-top: 12px;
}

#navbar {
  min-height: 62px;
  padding: 0 14px;
  border: 1px solid var(--lab-border);
  border-radius: 16px;
  background: color-mix(in srgb, var(--lab-panel-solid) 78%, transparent) !important;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(18px) saturate(130%);
}

#title-nav > a {
  gap: 10px;
  color: var(--lab-text);
  font-weight: 700;
  letter-spacing: 0.02em;
}

#vivia-logo {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  flex: 0 0 auto;
  filter: none;
}

#vivia-logo .site-mark {
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  box-shadow: 0 7px 20px rgba(45, 212, 191, 0.13);
}

#main-nav {
  gap: 2px;
}

#main-nav .main-nav-link,
#sub-nav .nav-icon {
  border-radius: 10px;
  color: var(--lab-text-muted);
  transition: color 160ms ease, background-color 160ms ease;
}

#main-nav .main-nav-link:hover,
#main-nav .main-nav-link:focus-visible,
#sub-nav .nav-icon:hover,
#sub-nav .nav-icon:focus-visible {
  color: var(--lab-text);
  background: var(--lab-accent-soft);
}

#nav-dropdown {
  margin-top: 8px;
  border: 1px solid var(--lab-border);
  border-radius: 14px;
  background: var(--lab-panel-solid);
  box-shadow: var(--lab-shadow);
  overflow: hidden;
}

.nav-dropdown-link {
  color: var(--lab-text-muted);
}

.nav-dropdown-link:hover {
  color: var(--lab-text);
  background: var(--lab-accent-soft);
}

#content-body {
  min-width: 0;
}

.article {
  border: 1px solid var(--lab-border);
  border-radius: var(--lab-radius);
  background: var(--lab-panel);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.1);
  overflow: clip;
  animation: none !important;
}

.article-title h1,
.article-title .article-title-link {
  text-shadow: none !important;
  animation: none !important;
}

.article-title h1::after {
  display: none !important;
}

.article-inner,
.article-main {
  min-width: 0;
}

.article-inner:hover {
  border-color: var(--lab-border) !important;
  box-shadow: none !important;
  transform: none !important;
}

.article-title,
.article-title a {
  color: var(--lab-text);
  text-wrap: balance;
}

.article-entry {
  color: var(--lab-text-muted);
  font-size: 1rem;
  line-height: 1.82;
}

.article-entry h2,
.article-entry h3,
.article-entry h4 {
  color: var(--lab-text);
  text-wrap: balance;
}

.article-entry a {
  color: var(--lab-accent-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.article-entry code:not([class]) {
  border: 1px solid var(--lab-border);
  border-radius: 6px;
  background: var(--lab-accent-soft);
  color: var(--lab-accent-strong);
}

.article-entry blockquote {
  border-left-color: var(--lab-accent);
  background: var(--lab-accent-soft);
}

#sidebar-wrapper > * {
  border-color: var(--lab-border);
  border-radius: var(--lab-radius);
  background: var(--lab-panel);
}

#footer {
  margin-top: 36px;
  color: var(--lab-text-faint);
}

#footer-info {
  padding: 26px 8px 34px;
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  font-size: 0.84rem;
  text-align: center;
}

.footer-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--lab-accent);
}

.footer-links {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
}

.footer-links a {
  color: var(--lab-text-muted);
}

.footer-links a:hover {
  color: var(--lab-accent-strong);
}

.community-page {
  width: min(920px, 100%);
  margin-inline: auto;
  color: var(--lab-text-muted);
}

#page-friends,
#page-anonymous {
  border: 0;
  background: transparent;
  box-shadow: none;
}

#page-friends .article-header,
#page-anonymous .article-header,
#page-friends .article-nav,
#page-anonymous .article-nav {
  display: none;
}

#page-friends .article-main,
#page-anonymous .article-main,
#page-friends .article-entry,
#page-anonymous .article-entry {
  width: 100%;
  max-width: none;
}

.community-hero {
  padding: clamp(12px, 2vw, 24px) 0 28px;
}

.community-kicker {
  margin: 0 0 10px;
  color: var(--lab-accent-strong);
  font: 600 0.76rem/1.2 "Roboto Mono", monospace;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.community-title {
  margin: 0;
  color: var(--lab-text);
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.community-lead {
  max-width: 680px;
  margin: 16px 0 0;
  font-size: clamp(1rem, 2vw, 1.08rem);
  line-height: 1.85;
}

.community-note {
  display: flex;
  gap: 12px;
  margin: 22px 0;
  padding: 16px 18px;
  border: 1px solid var(--lab-border);
  border-radius: var(--lab-radius-sm);
  background: var(--lab-accent-soft);
}

.community-note i {
  margin-top: 4px;
  color: var(--lab-accent);
}

.friend-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 36px 0 18px;
}

.friend-toolbar h2,
.community-form-panel h2,
.anonymous-card h2 {
  margin: 0;
  padding-left: 0;
  border-left: 0 !important;
  color: var(--lab-text);
  box-shadow: none !important;
  font-size: clamp(1.25rem, 3vw, 1.65rem);
}

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

.friend-card,
.friend-empty,
.friend-loading {
  min-height: 170px;
  padding: 20px;
  border: 1px solid var(--lab-border);
  border-radius: var(--lab-radius);
  background: var(--lab-panel);
}

.friend-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  color: inherit !important;
  text-decoration: none !important;
  overflow: hidden;
  isolation: isolate;
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.friend-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle at 100% 0, var(--lab-accent-soft), transparent 46%), linear-gradient(135deg, transparent 58%, color-mix(in srgb, var(--lab-blue) 5%, transparent));
  opacity: 0.8;
}

.friend-card:hover {
  transform: translateY(-5px);
  border-color: var(--lab-border-strong);
  background: var(--lab-panel-solid);
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.17), 0 0 0 1px var(--lab-accent-soft);
}

.friend-card-top {
  display: flex;
  align-items: center;
  gap: 13px;
}

.friend-icon {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  border: 1px solid var(--lab-border-strong);
  border-radius: 15px;
  background: var(--lab-bg-soft);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  object-fit: cover;
}

.friend-identity {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.friend-arrow {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  margin-left: auto;
  border: 1px solid var(--lab-border);
  border-radius: 50%;
  color: var(--lab-accent-strong);
  transition: transform 180ms ease, background-color 180ms ease;
}

.friend-card:hover .friend-arrow {
  transform: translate(2px, -2px);
  background: var(--lab-accent-soft);
}

.friend-domain {
  color: var(--lab-accent-strong);
  font: 500 0.72rem/1.3 "Roboto Mono", monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-name {
  color: var(--lab-text);
  font-size: 1.08rem;
  font-weight: 700;
}

.friend-description {
  min-height: 4.8em;
  margin: 0 0 auto;
  color: var(--lab-text-muted);
  font-size: 0.9rem;
  line-height: 1.65;
}

.friend-card-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--lab-border);
  color: var(--lab-text-faint);
  font: 600 0.62rem/1 "Roboto Mono", monospace;
  letter-spacing: 0.12em;
}

.friend-card-footer i {
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, var(--lab-border-strong), transparent);
}

.field-optional {
  margin-left: 6px;
  color: var(--lab-text-faint);
  font-size: 0.72rem;
  font-weight: 500;
}

.friend-icon-uploader {
  display: flex;
  align-items: center;
  gap: 12px;
}

.friend-icon-drop {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px;
  border: 1px dashed var(--lab-border-strong);
  border-radius: 14px;
  background: color-mix(in srgb, var(--lab-bg-soft) 80%, transparent);
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.friend-icon-drop:hover,
.friend-icon-drop:focus-within {
  border-color: var(--lab-accent);
  background: var(--lab-accent-soft);
}

.friend-icon-input {
  position: absolute;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  opacity: 0;
  overflow: hidden;
}

.friend-icon-preview {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--lab-border);
  border-radius: 15px;
  color: var(--lab-accent-strong);
  background: var(--lab-panel-solid);
  overflow: hidden;
}

.friend-icon-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.friend-icon-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.friend-icon-copy strong { color: var(--lab-text); font-size: 0.9rem; }
.friend-icon-copy small { color: var(--lab-text-faint); font-size: 0.76rem; line-height: 1.45; }

.icon-remove-button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--lab-border);
  border-radius: 10px;
  color: var(--lab-danger, #fb7185);
  background: transparent;
  cursor: pointer;
}

.friend-empty,
.friend-loading {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  min-height: 150px;
  text-align: center;
}

.lab-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--lab-border-strong);
  border-radius: 11px;
  background: var(--lab-accent);
  color: #05201d !important;
  font: 700 0.9rem/1 Inter, sans-serif;
  text-decoration: none !important;
  cursor: pointer;
  transition: transform 160ms ease, filter 160ms ease;
}

.lab-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.lab-button.secondary {
  background: transparent;
  color: var(--lab-text) !important;
  border-color: var(--lab-border);
}

.lab-button:disabled {
  cursor: wait;
  opacity: 0.62;
  transform: none;
}

.community-form-panel,
.anonymous-card {
  margin-top: 26px;
  scroll-margin-top: 104px;
  padding: clamp(20px, 4vw, 34px);
  border: 1px solid var(--lab-border);
  border-radius: var(--lab-radius);
  background: var(--lab-panel);
  box-shadow: var(--lab-shadow);
}

.community-form-panel[hidden] {
  display: none;
}

.community-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}

.anonymous-notice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  max-width: 720px;
  margin-top: 22px;
  padding: 14px 16px;
  border-left: 2px solid var(--lab-accent);
  color: var(--lab-text-muted);
  background: color-mix(in srgb, var(--lab-accent-soft) 64%, transparent);
}

.anonymous-notice i {
  margin-top: 4px;
  color: var(--lab-accent-strong);
}

.anonymous-notice p {
  margin: 0;
  line-height: 1.7;
}

.anonymous-notice strong {
  color: var(--lab-text);
}

.lab-button.secondary {
  border-color: var(--lab-border-strong);
  color: var(--lab-accent-strong) !important;
  background: var(--lab-accent-soft);
}

.reply-wall-privacy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--lab-text-faint);
  font: 600 0.64rem/1.4 "Roboto Mono", monospace;
  letter-spacing: 0.1em;
}

.reply-wall-panel {
  margin-top: 30px;
  scroll-margin-top: 104px;
}

.reply-wall-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.reply-wall-heading h2 {
  margin: 0;
  color: var(--lab-text);
  font-size: clamp(1.35rem, 3vw, 1.8rem);
}

.reply-count {
  padding: 7px 11px;
  border: 1px solid var(--lab-border);
  border-radius: 999px;
  color: var(--lab-accent-strong);
  background: var(--lab-panel);
  font: 600 0.62rem/1 "Roboto Mono", monospace;
  letter-spacing: 0.08em;
}

.anonymous-reply-list {
  display: grid;
  gap: 0;
  transition: opacity 160ms ease;
}

.anonymous-reply-list.is-loading {
  opacity: 0.55;
}

.anonymous-reply-card {
  position: relative;
  display: block;
  padding: 22px 2px 24px;
  border-top: 1px solid var(--lab-border);
  background: transparent;
}

.anonymous-reply-card::before {
  display: none;
}

.reply-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.reply-signal,
.reply-date,
.reply-role {
  color: var(--lab-text-faint);
  font: 600 0.62rem/1.4 "Roboto Mono", monospace;
  letter-spacing: 0.1em;
}

.reply-signal { color: var(--lab-accent-strong); }

.reply-question {
  padding: 0;
  border: 0;
  background: transparent;
}

.reply-question-copy,
.reply-answer-copy {
  margin: 5px 0 0;
  color: var(--lab-text);
  font-size: clamp(0.94rem, 1.6vw, 1rem);
  line-height: 1.68;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.reply-bridge {
  display: none;
}

.reply-answer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  margin-top: 13px;
  padding: 10px 0 10px 14px;
  border-left: 2px solid color-mix(in srgb, var(--lab-accent) 68%, var(--lab-border));
  background: linear-gradient(90deg, var(--lab-accent-soft), transparent 58%);
}

.reply-avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--lab-border-strong);
  border-radius: 9px;
  color: var(--lab-accent-strong);
  background: var(--lab-panel-solid);
  font: 800 0.78rem/1 "Roboto Mono", monospace;
}

.reply-answer .reply-role { color: var(--lab-accent-strong); }

.reply-wall-empty {
  min-height: 160px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 28px;
  border: 1px dashed var(--lab-border);
  border-radius: var(--lab-radius);
  color: var(--lab-text-faint);
  text-align: center;
  background: var(--lab-panel);
}

.reply-wall-empty .lab-button {
  margin-top: 4px;
}

.reply-wall-empty strong { color: var(--lab-text-muted); }
.reply-wall-empty span { font: 0.62rem/1.4 "Roboto Mono", monospace; letter-spacing: 0.1em; }
.reply-wall-empty.loading i { width: 9px; height: 9px; border-radius: 50%; background: var(--lab-accent); box-shadow: 0 0 18px var(--lab-accent); animation: lab-pulse 1.4s ease-in-out infinite; }

.reply-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--lab-border);
}

.reply-pagination[hidden] {
  display: none;
}

.reply-page-numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.reply-pagination button {
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--lab-border);
  border-radius: 10px;
  color: var(--lab-text-muted);
  background: var(--lab-panel);
  font: 650 0.78rem/1 "Roboto Mono", monospace;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, color 140ms ease, background-color 140ms ease;
}

.reply-pagination button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--lab-border-strong);
  color: var(--lab-accent-strong);
}

.reply-pagination button[aria-current='page'] {
  border-color: var(--lab-accent);
  color: #05201d;
  background: var(--lab-accent);
}

.reply-pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.reply-page-ellipsis {
  min-width: 22px;
  color: var(--lab-text-faint);
  text-align: center;
}

@keyframes lab-pulse {
  0%, 100% { transform: scale(0.8); opacity: 0.55; }
  50% { transform: scale(1.15); opacity: 1; }
}

.lab-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.lab-field {
  display: grid;
  gap: 8px;
}

.lab-field.full {
  grid-column: 1 / -1;
}

.lab-field label {
  color: var(--lab-text);
  font-size: 0.88rem;
  font-weight: 650;
}

.lab-field input,
.lab-field textarea {
  width: 100%;
  border: 1px solid var(--lab-border);
  border-radius: 11px;
  background: color-mix(in srgb, var(--lab-bg-soft) 88%, transparent);
  color: var(--lab-text);
  font: inherit;
  line-height: 1.5;
}

.lab-field input {
  min-height: 46px;
  padding: 0 13px;
}

.lab-field textarea {
  min-height: 126px;
  padding: 12px 13px;
  resize: vertical;
}

.lab-field input::placeholder,
.lab-field textarea::placeholder {
  color: var(--lab-text-faint);
}

.lab-field input:focus,
.lab-field textarea:focus {
  border-color: var(--lab-accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--lab-accent-soft);
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.form-status {
  min-height: 24px;
  margin: 0;
  color: var(--lab-text-muted);
  font-size: 0.9rem;
}

.form-status.success {
  color: var(--lab-success);
}

.form-status.error {
  color: var(--lab-danger);
}

.honeypot-field {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
}

.anonymous-status {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 22px;
  color: var(--lab-text-muted);
  font-size: 0.88rem;
}

.anonymous-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #e6b566;
  box-shadow: 0 0 0 5px rgba(230, 181, 102, 0.1);
}

.anonymous-status.ready .anonymous-status-dot {
  background: var(--lab-success);
  box-shadow: 0 0 0 5px rgba(112, 223, 178, 0.1);
}

.anonymous-status.offline .anonymous-status-dot {
  background: var(--lab-danger);
}

.anonymous-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  color: var(--lab-text-faint);
  font-size: 0.78rem;
}

.privacy-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.privacy-list li {
  padding: 15px;
  border: 1px solid var(--lab-border);
  border-radius: var(--lab-radius-sm);
  background: var(--lab-bg-soft);
  font-size: 0.84rem;
  line-height: 1.6;
}

.privacy-list i {
  display: block;
  margin-bottom: 9px;
  color: var(--lab-accent);
}

.privacy-list .privacy-audit {
  border-color: rgba(255, 190, 92, 0.24);
  background: linear-gradient(145deg, rgba(255, 190, 92, 0.07), var(--lab-bg-soft));
}

.privacy-list .privacy-audit i {
  color: #f6c76f;
}

@media (max-width: 920px) {
  #main-grid {
    width: min(100% - 20px, 760px);
  }

  #nav {
    top: 8px;
    margin-top: 8px;
  }

  #navbar {
    min-height: 56px;
    border-radius: 14px;
  }

  .friend-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  #main-grid {
    width: min(100% - 16px, 560px);
  }

  #title-nav > a > div:last-child {
    max-width: 8.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .article {
    border-radius: 15px;
  }

  .article-entry {
    font-size: 0.96rem;
    line-height: 1.76;
    overflow-wrap: anywhere;
  }

  .friend-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .reply-wall-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .reply-answer {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .reply-pagination {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .reply-page-direction {
    flex: 1;
  }

  .reply-page-numbers {
    width: 100%;
    order: -1;
  }

  .friend-grid,
  .lab-form,
  .privacy-list {
    grid-template-columns: 1fr;
  }

  .friend-card,
  .friend-empty,
  .friend-loading {
    min-height: 145px;
  }

  .friend-icon-uploader {
    align-items: stretch;
    flex-direction: column;
  }

  .lab-field.full,
  .form-actions {
    grid-column: auto;
  }

  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .lab-button {
    width: 100%;
  }

  .lab-field input,
  .lab-field textarea {
    font-size: 16px;
  }

  .footer-dot {
    display: none;
  }

  .footer-row {
    flex-direction: column;
  }
}

body::after {
  content: '';
  position: fixed;
  inset: -35%;
  z-index: 0;
  background:
    conic-gradient(from 180deg at 50% 50%, transparent 0deg, rgba(69, 208, 191, 0.055) 64deg, transparent 122deg, rgba(116, 174, 232, 0.045) 214deg, transparent 285deg),
    radial-gradient(circle at 35% 30%, rgba(69, 208, 191, 0.08), transparent 25%),
    radial-gradient(circle at 70% 65%, rgba(116, 174, 232, 0.07), transparent 28%);
  filter: blur(28px);
  pointer-events: none;
  animation: lab-aurora-drift 28s linear infinite;
}

#tech-interface-layer {
  --pointer-x: 50vw;
  --pointer-y: 45vh;
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    linear-gradient(rgba(105, 226, 211, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(105, 226, 211, 0.018) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 88%);
}

.tech-pointer-field {
  position: absolute;
  inset: 0;
  background: radial-gradient(360px circle at var(--pointer-x) var(--pointer-y), rgba(103, 232, 249, 0.07), transparent 72%);
  transition: opacity 180ms ease;
}

.tech-scan-beam {
  position: absolute;
  inset: -14vh 0 auto;
  height: 18vh;
  background: linear-gradient(to bottom, transparent, rgba(103, 232, 249, 0.035), rgba(45, 212, 191, 0.08), transparent);
  filter: blur(1px);
  animation: tech-scan-screen 10s linear infinite;
}

#tech-hud {
  position: fixed;
  inset: 14px;
  z-index: 2;
  pointer-events: none;
  color: var(--lab-accent-strong);
  font: 600 0.58rem/1 ui-monospace, "Cascadia Code", monospace;
  letter-spacing: 0.12em;
  opacity: 0.45;
}

#tech-telemetry-rail {
  position: fixed;
  top: 50%;
  right: 19px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--lab-text-faint);
  font: 600 0.54rem/1 ui-monospace, "Cascadia Code", monospace;
  letter-spacing: 0.15em;
  writing-mode: vertical-rl;
  transform: translateY(-50%);
  pointer-events: none;
  opacity: 0.52;
}

#tech-telemetry-rail i {
  width: 1px;
  height: 42px;
  background: linear-gradient(180deg, transparent, var(--lab-accent), transparent);
}

#tech-telemetry-rail span:first-child {
  color: var(--lab-accent-strong);
}

.landing-section,
.community-hero,
.reply-wall-panel {
  position: relative;
}

.tech-section-label {
  position: absolute;
  top: 10px;
  right: 1px;
  color: var(--lab-text-faint);
  font: 600 0.56rem/1 ui-monospace, "Cascadia Code", monospace;
  letter-spacing: 0.14em;
  pointer-events: none;
  opacity: 0.58;
}

.tech-section-label::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 1px;
  margin-right: 8px;
  vertical-align: middle;
  background: linear-gradient(90deg, transparent, var(--lab-accent));
}

.tech-hud-corner {
  position: absolute;
  width: 28px;
  height: 28px;
  border-color: currentColor;
  filter: drop-shadow(0 0 8px rgba(69, 208, 191, 0.25));
}

.tech-hud-corner.top-left { top: 0; left: 0; border-top: 1px solid; border-left: 1px solid; }
.tech-hud-corner.top-right { top: 0; right: 0; border-top: 1px solid; border-right: 1px solid; }
.tech-hud-corner.bottom-left { bottom: 0; left: 0; border-bottom: 1px solid; border-left: 1px solid; }
.tech-hud-corner.bottom-right { right: 0; bottom: 0; border-right: 1px solid; border-bottom: 1px solid; }

.tech-hud-label {
  position: absolute;
  bottom: 3px;
  padding: 5px 7px;
  border: 1px solid color-mix(in srgb, currentColor 20%, transparent);
  border-radius: 5px;
  background: color-mix(in srgb, var(--lab-bg) 78%, transparent);
  backdrop-filter: blur(8px);
}

.tech-hud-label.hud-status { left: 38px; }
.tech-hud-label.hud-coordinate { right: 38px; }
.tech-hud-label b {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--lab-success);
  box-shadow: 0 0 9px var(--lab-success);
  animation: tech-status-pulse 2s ease-in-out infinite;
}

#nav::after {
  content: '';
  position: absolute;
  inset: 0 8% auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--lab-accent), var(--lab-blue), transparent);
  box-shadow: 0 0 18px rgba(69, 208, 191, 0.28);
  opacity: 0.8;
  pointer-events: none;
}

.article,
.widget,
.friend-card,
.anonymous-panel,
.lab-form {
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.035), inset 0 0 42px rgba(69, 208, 191, 0.015);
}

.article-entry h2::before,
.article-entry h3::before {
  color: var(--lab-accent);
  text-shadow: 0 0 12px rgba(69, 208, 191, 0.35);
}

.subscribe-spinner {
  width: 15px;
  height: 15px;
  display: inline-block;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -2px;
  animation: subscribe-spin 700ms linear infinite;
}

.subscribe-submission-sink {
  position: fixed;
  width: 1px;
  height: 1px;
  overflow: hidden;
  border: 0;
  clip-path: inset(50%);
  opacity: 0;
  pointer-events: none;
}

body.tech-modal-open {
  overflow: hidden;
}

/* Article reading experience */
.article-type-post {
  border-color: color-mix(in srgb, var(--lab-border) 78%, transparent);
  border-radius: 18px;
  background: color-mix(in srgb, var(--lab-panel-solid) 94%, transparent);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.13);
}

.article-type-post .article-inner,
.article-type-post .article-main {
  border: 0 !important;
  box-shadow: none !important;
  transform: none !important;
}

.article-type-post .article-header {
  padding: clamp(34px, 6vw, 64px) clamp(24px, 7vw, 76px) 24px;
  border-bottom: 1px solid var(--lab-border);
}

.article-type-post .article-title h1,
.article-type-post .article-title .article-title-link {
  max-width: 19ch;
  margin: 0;
  color: var(--lab-text) !important;
  font-size: clamp(2rem, 5vw, 3.35rem);
  line-height: 1.16;
  letter-spacing: -0.045em;
  text-shadow: none !important;
  animation: none !important;
}

.article-type-post .meta-info-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 13px;
  margin-top: 18px;
  color: var(--lab-text-faint);
  font-size: 0.76rem;
}

.article-type-post .article-entry {
  width: min(100%, 820px);
  margin: 0 auto;
  padding: clamp(30px, 5vw, 52px) clamp(24px, 7vw, 76px) clamp(52px, 8vw, 86px);
  color: color-mix(in srgb, var(--lab-text) 78%, var(--lab-text-muted));
  font-size: clamp(1rem, 1.2vw, 1.075rem);
  line-height: 1.9;
  letter-spacing: 0.008em;
  overflow-wrap: anywhere;
}

.article-type-post .article-entry > :first-child {
  margin-top: 0;
}

.article-type-post .article-entry p,
.article-type-post .article-entry ul,
.article-type-post .article-entry ol {
  margin-top: 1.05em;
  margin-bottom: 1.05em;
}

.article-type-post .article-entry h2,
.article-type-post .article-entry h3,
.article-type-post .article-entry h4 {
  margin-top: 2.2em;
  margin-bottom: 0.75em;
  color: var(--lab-text);
  line-height: 1.35;
  letter-spacing: -0.025em;
  text-shadow: none;
}

.article-type-post .article-entry h2 {
  padding-bottom: 0.45em;
  border-bottom: 1px solid var(--lab-border);
}

.article-type-post .article-entry h2::before,
.article-type-post .article-entry h3::before {
  text-shadow: none;
}

.article-type-post .article-entry img {
  height: auto;
  border: 1px solid var(--lab-border);
  border-radius: 12px;
  box-shadow: none;
}

.article-type-post .article-entry blockquote {
  margin: 1.7em 0;
  padding: 1em 1.2em;
  border-radius: 0 10px 10px 0;
  color: var(--lab-text-muted);
}

.article-type-post .article-entry pre,
.article-type-post .article-entry .highlight {
  border: 1px solid var(--lab-border);
  border-radius: 12px;
  box-shadow: none;
}

.article-type-post #article-nav {
  margin: 0;
  border-top: 1px solid var(--lab-border);
  background: transparent;
}

/* Native article comments */
.article-comments {
  width: 100%;
  margin-top: 24px;
  padding: clamp(24px, 5vw, 46px);
  border: 1px solid var(--lab-border);
  border-radius: 18px;
  background: color-mix(in srgb, var(--lab-panel-solid) 94%, transparent);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.11);
  scroll-margin-top: 92px;
}

.article-comments-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--lab-border);
}

.article-comments-kicker {
  color: var(--lab-accent-strong);
  font: 700 0.64rem/1 ui-monospace, "Cascadia Code", monospace;
  letter-spacing: 0.15em;
}

.article-comments-header h2 {
  margin: 8px 0 0;
  color: var(--lab-text);
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  letter-spacing: -0.035em;
}

.article-comments-header p {
  margin: 8px 0 0;
  color: var(--lab-text-muted);
  line-height: 1.6;
}

.article-comment-count {
  flex: 0 0 auto;
  padding: 7px 11px;
  border: 1px solid var(--lab-border);
  border-radius: 999px;
  color: var(--lab-text-muted);
  font-size: 0.72rem;
}

.article-comment-form {
  padding: 26px 0;
  border-bottom: 1px solid var(--lab-border);
}

.article-comment-fields {
  display: grid;
  grid-template-columns: minmax(170px, 0.34fr) minmax(0, 1fr);
  gap: 14px;
}

.article-comment-fields label {
  display: grid;
  align-content: start;
  gap: 8px;
  color: var(--lab-text-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.article-comment-fields input,
.article-comment-fields textarea {
  width: 100%;
  border: 1px solid var(--lab-border);
  border-radius: 11px;
  color: var(--lab-text);
  background: color-mix(in srgb, var(--lab-bg) 72%, transparent);
  font: inherit;
  font-weight: 400;
  transition: border-color 160ms ease, background 160ms ease;
}

.article-comment-fields input {
  min-height: 48px;
  padding: 0 14px;
}

.article-comment-fields textarea {
  min-height: 118px;
  padding: 12px 14px;
  line-height: 1.65;
  resize: vertical;
}

.article-comment-fields input:focus,
.article-comment-fields textarea:focus {
  border-color: var(--lab-accent);
  background: color-mix(in srgb, var(--lab-bg) 88%, transparent);
  outline: 2px solid color-mix(in srgb, var(--lab-accent) 18%, transparent);
  outline-offset: 2px;
}

.article-comment-fields input:disabled,
.article-comment-fields textarea:disabled {
  opacity: 0.65;
}

.article-comment-honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.article-comment-submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 14px;
}

.article-comment-submit-row p {
  max-width: 58ch;
  margin: 0;
  color: var(--lab-text-faint);
  font-size: 0.72rem;
  line-height: 1.6;
}

.article-comment-submit-row button,
.article-comment-empty button {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid color-mix(in srgb, var(--lab-accent) 48%, transparent);
  border-radius: 10px;
  color: var(--lab-bg);
  background: var(--lab-accent);
  font: 700 0.82rem/1 inherit;
  cursor: pointer;
  transition: transform 160ms ease, filter 160ms ease;
}

.article-comment-submit-row button:hover,
.article-comment-empty button:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.article-comment-submit-row button:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

.article-comment-status {
  min-height: 1.5em;
  margin: 10px 0 0;
  color: var(--lab-text-muted);
  font-size: 0.78rem;
}

.article-comment-status.success { color: var(--lab-success); }
.article-comment-status.error { color: var(--lab-danger); }

.article-comment-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 0 8px;
}

.article-comment-list-head h3 {
  margin: 0;
  color: var(--lab-text);
  font-size: 1rem;
}

.article-comment-list-head button {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--lab-border);
  border-radius: 9px;
  color: var(--lab-text-muted);
  background: transparent;
  cursor: pointer;
}

.article-comment-list-head button:hover {
  border-color: var(--lab-border-strong);
  color: var(--lab-accent-strong);
}

.article-comment-list {
  min-height: 92px;
}

.article-comment-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 13px;
  padding: 20px 0;
  border-bottom: 1px solid var(--lab-border);
}

.article-comment-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--lab-border-strong);
  border-radius: 10px;
  color: var(--lab-accent-strong);
  background: var(--lab-accent-soft);
  font-size: 0.82rem;
  font-weight: 700;
}

.article-comment-body {
  min-width: 0;
}

.article-comment-meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 11px;
}

.article-comment-meta strong {
  color: var(--lab-text);
  font-size: 0.9rem;
}

.article-comment-meta time,
.article-comment-meta span {
  color: var(--lab-text-faint);
  font-size: 0.68rem;
}

.article-comment-meta span {
  margin-left: auto;
  font-family: ui-monospace, "Cascadia Code", monospace;
}

.article-comment-body p {
  margin: 8px 0 0;
  color: var(--lab-text-muted);
  font-size: 0.94rem;
  line-height: 1.72;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.article-comment-empty {
  display: grid;
  justify-items: start;
  gap: 7px;
  padding: 28px 0 20px;
  color: var(--lab-text-muted);
}

.article-comment-empty strong { color: var(--lab-text); }
.article-comment-empty p { margin: 0; line-height: 1.6; }
.article-comment-empty.error strong { color: var(--lab-danger); }
.article-comment-empty button { margin-top: 6px; }

.article-comment-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding-top: 22px;
}

.article-comment-pagination[hidden] { display: none; }

.article-comment-pagination button {
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--lab-border);
  border-radius: 9px;
  color: var(--lab-text-muted);
  background: transparent;
  cursor: pointer;
}

.article-comment-pagination button:hover:not(:disabled) {
  border-color: var(--lab-border-strong);
  color: var(--lab-accent-strong);
}

.article-comment-pagination button[aria-current='page'] {
  border-color: var(--lab-accent);
  color: var(--lab-bg);
  background: var(--lab-accent);
}

.article-comment-pagination button:disabled {
  opacity: 0.36;
  cursor: not-allowed;
}

.article-comment-page-ellipsis {
  width: 24px;
  color: var(--lab-text-faint);
  text-align: center;
}

@media (max-width: 640px) {
  .article-type-post .article-header {
    padding: 28px 20px 20px;
  }

  .article-type-post .article-title h1,
  .article-type-post .article-title .article-title-link {
    font-size: clamp(1.75rem, 9vw, 2.45rem);
  }

  .article-type-post .article-entry {
    padding: 26px 20px 54px;
    font-size: 1rem !important;
    line-height: 1.82;
  }

  .article-comments {
    padding: 22px 18px;
    border-radius: 15px;
  }

  .article-comments-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
  }

  .article-comment-fields {
    grid-template-columns: 1fr;
  }

  .article-comment-fields input,
  .article-comment-fields textarea {
    font-size: 16px;
  }

  .article-comment-submit-row {
    align-items: stretch;
    flex-direction: column;
  }

  .article-comment-submit-row button {
    width: 100%;
  }

  .article-comment-meta span {
    margin-left: 0;
  }

  .article-comment-pagination {
    justify-content: flex-start;
    overflow-x: auto;
  }
}

.tech-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 9, 14, 0.78);
  backdrop-filter: blur(16px) saturate(120%);
  opacity: 0;
  visibility: hidden;
  transition: opacity 220ms ease, visibility 220ms ease;
}

.tech-modal-overlay[hidden] {
  display: none;
}

.tech-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.tech-modal-content {
  position: relative;
  width: min(100%, 540px);
  border: 1px solid rgba(103, 232, 249, 0.28);
  border-radius: 24px;
  color: #eaf8fb;
  background: linear-gradient(145deg, rgba(13, 34, 44, 0.98), rgba(5, 18, 25, 0.99));
  box-shadow: 0 34px 110px rgba(0, 0, 0, 0.58), 0 0 60px rgba(45, 212, 191, 0.1);
  overflow: hidden;
  transform: translateY(14px) scale(0.97);
  transition: transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.tech-modal-content::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  z-index: 3;
  height: 2px;
  background: linear-gradient(90deg, transparent, #67e8f9, #2dd4bf, #60a5fa, transparent);
  background-size: 200% 100%;
  animation: modal-signal-flow 3.2s linear infinite;
}

.tech-modal-overlay.active .tech-modal-content {
  transform: none;
}

.tech-modal-grid {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(103, 232, 249, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(103, 232, 249, 0.025) 1px, transparent 1px),
    radial-gradient(circle at 82% 16%, rgba(45, 212, 191, 0.13), transparent 34%);
  background-size: 34px 34px, 34px 34px, auto;
  pointer-events: none;
}

.tech-modal-header,
.tech-modal-body,
.tech-modal-footer {
  position: relative;
  z-index: 1;
}

.tech-modal-header {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 20px;
  border-bottom: 1px solid rgba(148, 195, 208, 0.13);
  background: rgba(3, 14, 20, 0.42);
}

.tech-modal-header > span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #8ea8b3;
  font: 700 0.65rem/1 ui-monospace, "Cascadia Code", monospace;
  letter-spacing: 0.14em;
}

.tech-modal-header i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2dd4bf;
  box-shadow: 0 0 0 5px rgba(45, 212, 191, 0.09), 0 0 14px rgba(45, 212, 191, 0.55);
}

.tech-modal-close {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(148, 195, 208, 0.14);
  border-radius: 10px;
  color: #8ea8b3;
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
  font-size: 1.25rem;
}

.tech-modal-close:hover {
  border-color: rgba(251, 113, 133, 0.35);
  color: #fb7185;
}

.tech-modal-body {
  padding: 34px 34px 28px;
}

.tech-modal-signal {
  position: relative;
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  margin-bottom: 26px;
  border: 1px solid rgba(103, 232, 249, 0.28);
  border-radius: 22px;
  color: #67e8f9;
  background: linear-gradient(145deg, rgba(103, 232, 249, 0.1), rgba(45, 212, 191, 0.035));
  box-shadow: inset 0 0 28px rgba(45, 212, 191, 0.06), 0 12px 30px rgba(0, 0, 0, 0.22);
}

.tech-modal-signal svg {
  width: 46px;
  height: 46px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
}

.tech-modal-signal > span {
  position: absolute;
  inset: -1px;
  border: 1px solid rgba(103, 232, 249, 0.18);
  border-radius: inherit;
  animation: modal-signal-pulse 2.4s ease-out infinite;
}

.tech-modal-signal > span:nth-child(2) { animation-delay: 0.8s; }
.tech-modal-signal > span:nth-child(3) { animation-delay: 1.6s; }
.tech-modal-kicker { margin: 0 0 10px; color: #2dd4bf; font: 700 0.68rem/1 ui-monospace, "Cascadia Code", monospace; letter-spacing: 0.15em; }
.tech-modal-body h2 { margin: 0; color: #f1fbfd; font-size: clamp(1.8rem, 5vw, 2.45rem); letter-spacing: -0.045em; }
.tech-modal-body > p:not(.tech-modal-kicker) { margin: 15px 0 0; color: #9ab0b9; line-height: 1.8; }
.tech-modal-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 26px; }
.tech-modal-meta span { padding: 11px 12px; border: 1px solid rgba(148, 195, 208, 0.12); border-radius: 10px; color: #607d88; background: rgba(2, 12, 17, 0.45); font: 600 0.62rem/1.5 ui-monospace, monospace; }
.tech-modal-meta b { display: block; margin-top: 3px; color: #67e8f9; }
.tech-modal-footer { display: flex; justify-content: flex-end; padding: 17px 20px; border-top: 1px solid rgba(148, 195, 208, 0.13); background: rgba(3, 14, 20, 0.42); }
.tech-modal-confirm { min-height: 44px; padding: 0 18px; border: 1px solid rgba(103, 232, 249, 0.32); border-radius: 11px; color: #062027; background: linear-gradient(135deg, #67e8f9, #2dd4bf); font-weight: 750; cursor: pointer; }
.tech-modal-confirm span { margin-left: 8px; }
.tech-modal-overlay.is-error .tech-modal-content { border-color: rgba(251, 113, 133, 0.3); }
.tech-modal-overlay.is-error .tech-modal-header i { background: #fb7185; box-shadow: 0 0 0 5px rgba(251, 113, 133, 0.09); }
.tech-modal-overlay.is-error .tech-modal-signal, .tech-modal-overlay.is-error .tech-modal-kicker, .tech-modal-overlay.is-error .tech-modal-meta b { color: #fb7185; }

#reading-progress-bar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 9999;
  width: 100%;
  height: 2px;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, var(--lab-accent), var(--lab-blue));
  box-shadow: 0 0 14px rgba(69, 208, 191, 0.25);
  pointer-events: none;
  will-change: transform;
}

#tech-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.48;
  pointer-events: none;
}

body:where(:not(.growth-body)) > :where(:not(#tech-canvas):not(#reading-progress-bar):not(#tech-interface-layer):not(#tech-hud):not(#tech-telemetry-rail):not(.tech-modal-overlay):not(.subscribe-submission-sink)) {
  position: relative;
  z-index: 1;
}

.tech-card-enhanced {
  --tech-card-x: 50%;
  --tech-card-y: 50%;
  isolation: isolate;
  border-color: color-mix(in srgb, var(--lab-border) 82%, var(--lab-accent) 18%);
}

.tech-card-enhanced::before {
  content: '';
  position: absolute;
  inset: 0 auto auto 0;
  z-index: 4;
  width: 34px;
  height: 1px;
  background: linear-gradient(90deg, var(--lab-accent), transparent);
  box-shadow: 0 0 11px rgba(69, 208, 191, 0.28);
  pointer-events: none;
}

.tech-card-enhanced::after {
  content: '';
  position: absolute;
  inset: auto 9px 9px auto;
  z-index: 4;
  width: 7px;
  height: 7px;
  border-right: 1px solid var(--lab-accent);
  border-bottom: 1px solid var(--lab-accent);
  opacity: 0.44;
  pointer-events: none;
}

.tech-card-glow {
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  background: radial-gradient(280px circle at var(--tech-card-x) var(--tech-card-y), rgba(105, 226, 211, 0.12), transparent 62%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.tech-card-enhanced:hover > .tech-card-glow,
.tech-card-enhanced:focus-within > .tech-card-glow {
  opacity: 1;
}

html[theme='light'] .tech-card-glow {
  background: radial-gradient(280px circle at var(--tech-card-x) var(--tech-card-y), rgba(8, 127, 116, 0.08), transparent 64%);
}

@keyframes subscribe-spin { to { transform: rotate(360deg); } }
@keyframes modal-signal-flow { to { background-position: -200% 0; } }
@keyframes modal-signal-pulse { 0% { opacity: 0.55; transform: scale(1); } 75%, 100% { opacity: 0; transform: scale(1.34); } }
@keyframes lab-aurora-drift { to { transform: rotate(360deg) scale(1.04); } }
@keyframes tech-scan-screen { from { transform: translateY(-16vh); } to { transform: translateY(118vh); } }
@keyframes tech-status-pulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }

@media (max-width: 620px) {
  .tech-modal-overlay { padding: 12px; }
  .tech-modal-body { padding: 28px 22px 24px; }
  .tech-modal-meta { grid-template-columns: 1fr; }
  .tech-modal-footer { justify-content: stretch; }
  .tech-modal-confirm { width: 100%; }
  #tech-interface-layer { background-size: 34px 34px; opacity: 0.74; }
  #tech-hud { inset: 6px; opacity: 0.32; }
  #tech-telemetry-rail,
  .tech-section-label { display: none; }
  .tech-hud-corner { width: 18px; height: 18px; }
  .tech-hud-label { display: none; }
  .tech-card-enhanced::before { width: 24px; }
}

@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;
  }

  #tech-canvas {
    display: none;
  }

  .tech-scan-beam,
  .tech-pointer-field {
    display: none;
  }

  body::after {
    animation: none;
  }
}

/* Compact article cards for blog, archive, category and tag lists */
.article-type-post.article-index-card {
  margin-bottom: 18px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.article-index-card .article-inner {
  min-height: 0;
  margin-bottom: 0;
}

.article-index-card .article-main {
  min-height: 0;
  padding-bottom: 0;
}

.article-type-post.article-index-card .article-header {
  padding: 19px 24px 8px;
  border-bottom: 0;
}

.article-type-post.article-index-card .article-header h1,
.article-type-post.article-index-card .article-title {
  display: -webkit-box;
  max-width: none;
  margin: 0;
  overflow: hidden;
  color: var(--lab-text) !important;
  font-size: clamp(1.15rem, 2vw, 1.38rem);
  line-height: 1.36;
  letter-spacing: -0.018em;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.article-type-post.article-index-card .meta-info-bar {
  gap: 5px 10px;
  margin-top: 9px;
  margin-bottom: 3px;
  font-size: 0.72rem;
}

.article-index-card .article-tag-list {
  margin-top: 5px;
  margin-bottom: 0;
}

.article-type-post.article-index-card .article-entry {
  width: auto;
  margin: 0;
  padding: 4px 24px 17px;
  font-size: 0.91rem;
  line-height: 1.62;
  letter-spacing: 0;
}

.article-type-post.article-index-card .post-outline-text {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  line-height: 1.62;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.article-type-post.article-index-card .post-outline-list {
  margin: 0;
}

.article-type-post.article-index-card .right-panel.non-pic {
  min-width: 58px;
}

.article-type-post.article-index-card .right-panel.non-pic i {
  margin-right: 19px;
  font-size: 18px;
}

@media (max-width: 640px) {
  .article-type-post.article-index-card {
    margin-bottom: 14px;
    border-radius: 13px;
  }

  .article-type-post.article-index-card .article-header {
    padding: 16px 18px 6px;
  }

  .article-type-post.article-index-card .article-header h1,
  .article-type-post.article-index-card .article-title {
    font-size: 1.12rem;
    line-height: 1.4;
  }

  .article-type-post.article-index-card .meta-info-bar {
    margin-top: 7px;
    font-size: 0.7rem;
  }

  .article-type-post.article-index-card .article-entry {
    padding: 3px 18px 15px;
    font-size: 0.88rem !important;
    line-height: 1.58;
  }

  .article-type-post.article-index-card .post-outline-text {
    line-height: 1.58;
    -webkit-line-clamp: 3;
  }
}

/* Language switcher */
.site-language-control {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 40px;
  overflow: hidden;
  border: 1px solid var(--lab-border);
  border-radius: 11px;
  background: color-mix(in srgb, var(--lab-panel-solid) 94%, transparent);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.site-language-control.floating {
  position: fixed;
  z-index: 250;
  top: 18px;
  right: 18px;
}

.site-language-control:hover,
.site-language-control:focus-within {
  border-color: var(--lab-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--lab-accent) 10%, transparent);
}

.site-language-glyph {
  position: absolute;
  z-index: 1;
  left: 10px;
  color: var(--lab-accent);
  font-size: 0.76rem;
  font-weight: 800;
  pointer-events: none;
}

.site-language-select {
  width: 126px;
  height: 100%;
  padding: 0 28px 0 29px;
  border: 0;
  background: transparent;
  color: var(--lab-text-muted);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
}

.site-language-select:disabled {
  cursor: wait;
  opacity: 0.62;
}

.site-language-chevron {
  position: absolute;
  right: 10px;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--lab-accent);
  border-bottom: 1.5px solid var(--lab-accent);
  transform: translateY(-2px) rotate(45deg);
  pointer-events: none;
}

.language-switching .site-language-control {
  opacity: 0.72;
}

/* Dynamic multilingual CMS posts */
.cms-post-feed {
  margin-bottom: 28px;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid color-mix(in srgb, var(--lab-accent) 24%, var(--lab-border));
  border-radius: 18px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--lab-accent-soft) 45%, var(--lab-panel-solid)), var(--lab-panel-solid));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.1);
}

.cms-feed-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.cms-feed-heading span {
  color: var(--lab-accent-strong);
  font-size: 0.64rem;
  letter-spacing: 0.16em;
}

.cms-feed-heading h2 {
  margin: 5px 0 0;
  color: var(--lab-text);
  font-size: clamp(1.25rem, 3vw, 1.7rem);
}

.cms-feed-heading p {
  max-width: 380px;
  margin: 0;
  color: var(--lab-text-faint);
  font-size: 0.76rem;
  line-height: 1.6;
  text-align: right;
}

.cms-feed-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.cms-feed-card {
  overflow: hidden;
  border: 1px solid var(--lab-border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--lab-panel-solid) 96%, transparent);
  transition: border-color 180ms ease, transform 180ms ease;
}

.cms-feed-card:hover {
  border-color: var(--lab-border-strong);
  transform: translateY(-2px);
}

.cms-feed-card > a {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  min-height: 148px;
  color: inherit;
  text-decoration: none;
}

.cms-feed-cover {
  display: grid;
  place-items: center;
  min-height: 100%;
  overflow: hidden;
  background: linear-gradient(145deg, var(--lab-accent-soft), color-mix(in srgb, var(--lab-panel-solid) 80%, #061219));
}

.cms-feed-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cms-feed-signal {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--lab-border-strong);
  border-radius: 14px;
  color: var(--lab-accent-strong);
  font-size: 1.3rem;
  font-weight: 800;
}

.cms-feed-copy {
  min-width: 0;
  padding: 14px 15px;
}

.cms-feed-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--lab-text-faint);
  font-size: 0.65rem;
}

.cms-feed-fallback {
  padding: 2px 6px;
  border: 1px solid var(--lab-border);
  border-radius: 999px;
}

.cms-feed-copy h3 {
  display: -webkit-box;
  margin: 7px 0 5px;
  overflow: hidden;
  color: var(--lab-text);
  font-size: 1rem;
  line-height: 1.38;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.cms-feed-copy p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--lab-text-muted);
  font-size: 0.76rem;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.cms-feed-tags {
  display: flex;
  gap: 5px;
  margin-top: 9px;
  overflow: hidden;
}

.cms-feed-tags span {
  padding: 3px 6px;
  border-radius: 6px;
  background: var(--lab-accent-soft);
  color: var(--lab-accent-strong);
  font-size: 0.6rem;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .cms-feed-grid {
    grid-template-columns: 1fr;
  }

  .cms-feed-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .cms-feed-heading p {
    text-align: left;
  }
}

@media (max-width: 480px) {
  #title-nav {
    margin-left: 0;
  }

  #title-nav > a {
    padding-inline: 8px;
  }

  #title-nav > a > div:last-child {
    display: none;
  }

  #sub-nav {
    margin-right: 0;
  }

  .site-language-select {
    width: 92px;
    padding-right: 24px;
  }

  .cms-post-feed {
    padding: 14px;
    border-radius: 14px;
  }

  .cms-feed-card > a {
    grid-template-columns: 88px minmax(0, 1fr);
    min-height: 132px;
  }

  .cms-feed-copy {
    padding: 12px;
  }
}

/* On-demand article translation */
.article-machine-translation {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  margin: 4px 0 24px;
  padding: 13px 15px;
  border: 1px solid color-mix(in srgb, var(--lab-accent) 26%, var(--lab-border));
  border-radius: 14px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--lab-accent-soft) 62%, transparent), var(--lab-panel-solid));
}

.article-machine-translation .translation-pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--lab-accent);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--lab-accent) 12%, transparent), 0 0 18px var(--lab-accent);
}

.article-machine-translation.loading .translation-pulse {
  animation: translation-pulse 1.2s ease-in-out infinite;
}

.article-machine-translation.error {
  border-color: rgba(251, 191, 36, 0.25);
  background: rgba(251, 191, 36, 0.055);
}

.article-machine-translation.error .translation-pulse {
  background: #fbbf24;
  box-shadow: 0 0 0 6px rgba(251, 191, 36, 0.1);
}

.article-machine-translation strong {
  display: block;
  color: var(--lab-text);
  font-size: 0.8rem;
}

.article-machine-translation p {
  margin: 3px 0 0;
  color: var(--lab-text-faint);
  font-size: 0.7rem;
  line-height: 1.55;
}

.article-machine-translation button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--lab-border-strong);
  border-radius: 10px;
  background: var(--lab-panel-solid);
  color: var(--lab-accent-strong);
  cursor: pointer;
}

.article-machine-translation button:hover,
.article-machine-translation button:focus-visible {
  border-color: var(--lab-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--lab-accent) 10%, transparent);
}

.article-machine-translation .translation-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

@keyframes translation-pulse {
  50% { opacity: 0.45; transform: scale(0.78); }
}

@media (max-width: 640px) {
  .article-machine-translation {
    grid-template-columns: auto minmax(0, 1fr);
    margin-bottom: 18px;
  }

  .article-machine-translation .translation-actions {
    grid-column: 1 / -1;
  }

  .article-machine-translation button {
    width: 100%;
  }
}
