:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  --max-width: 720px;
  --primary: #111827;      /* Gray 900 */
  --accent: #4F46E5;       /* Indigo 600 */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  margin: 0;
  padding: 0 1.5rem;
  color: var(--primary);
  line-height: 1.6;
  background: #fff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Site wrapper */
.site-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header, main, footer {
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}

header {
  padding: 3rem 0 0;
}

.header-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Terminal Window - unified container */
.terminal-window {
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  border-radius: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  margin-bottom: 4rem;
}

/* Terminal Header */
.terminal-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--gray-600);
  text-decoration: none;
  transition: background 0.2s ease;
  white-space: nowrap;
  border-radius: 1rem 1rem 0 0;
}

.terminal-header:hover {
  background: var(--gray-100);
}

.terminal-user {
  color: #059669; /* Emerald 600 - green for user context */
}

.terminal-dollar {
  color: var(--gray-400);
}

.terminal-cmd {
  color: #7c3aed; /* Violet 600 - purple for the command */
  font-weight: 600;
}

.terminal-args {
  color: var(--gray-700);
}

@media (min-width: 480px) {
  .terminal-header {
    font-size: 0.95rem;
  }
}

@media (min-width: 768px) {
  .terminal-header {
    font-size: 1.125rem;
    padding: 1rem 1.5rem;
  }
}

/* Terminal Output (Bio) */
.terminal-output {
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--gray-200);
}

.terminal-output p {
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.75;
  color: var(--gray-700);
}

.terminal-output p + p {
  margin-top: 1rem;
  font-size: 1rem;
  color: var(--gray-600);
}

.terminal-output a {
  color: var(--accent);
  text-decoration: none;
  transition: text-decoration 0.2s ease;
}

.terminal-output a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 2px;
}

.terminal-output strong {
  color: var(--gray-900);
  font-weight: 600;
}

@media (min-width: 768px) {
  .terminal-output {
    padding: 2rem 2.5rem;
  }
  
  .terminal-output p {
    font-size: 1.25rem;
  }
}

/* Posts Section */
.posts-section {
  margin-bottom: 4rem;
}

.section-title {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray-400);
  border-bottom: 1px solid var(--gray-100);
  padding-bottom: 0.5rem;
  margin: 0 0 2rem;
}

/* Post List */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.post-item {
  position: relative;
}

.post-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.post-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0 0 0.5rem;
  line-height: 1.3;
  transition: color 0.2s ease;
}

.post-link:hover .post-title {
  color: var(--accent);
}

.post-date {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-400);
  margin-bottom: 0.5rem;
}

.post-excerpt {
  color: var(--gray-600);
  line-height: 1.65;
  margin: 0;
  max-width: 42rem;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  opacity: 0;
  transform: translateX(-0.5rem);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.read-more svg {
  transition: transform 0.2s ease;
}

.post-link:hover .read-more {
  opacity: 1;
  transform: translateX(0);
}

.post-link:hover .read-more svg {
  transform: translateX(2px);
}

img {
  max-width: 100%;
  height: auto;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

img:hover {
  opacity: 0.9;
}

/* Image Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  cursor: pointer;
}

.modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
}

.modal.show {
  display: block;
}

/* Image hover effect */
.image-hover-container {
  position: relative;
  display: inline-block;
  line-height: 0;
  cursor: pointer;
  user-select: none;
  border-radius: 8px;
  overflow: hidden;
}

.image-hover-container .base-image {
  display: block !important;
  max-width: 100%;
  height: auto;
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.image-hover-container .hover-image {
  display: block !important;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* Desktop hover effect */
@media (hover: hover) and (pointer: fine) {
  .image-hover-container:hover .base-image {
    opacity: 0;
  }

  .image-hover-container:hover .hover-image {
    opacity: 1;
  }
}

/* Image subtitle styling */
.image-subtitle {
  text-align: center;
  font-size: 0.9rem;
  color: #666;
  margin: 0.5rem 0 1rem 0;
  font-style: italic;
}


footer {
  margin-top: auto;
  padding: 3rem 0;
  border-top: 1px solid var(--gray-100);
  text-align: center;
}

.copyright {
  color: var(--gray-500);
  font-weight: 500;
  margin: 0 0 1.5rem;
}

.social-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.social-links a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gray-500);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.social-links a:hover {
  color: var(--gray-900);
}

.social-links svg {
  flex-shrink: 0;
}

/* Code highlighting */
.highlight {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 0.5rem;
  padding: 1rem;
  margin: 1.5rem 0;
  overflow-x: auto;
}

.highlight pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.4;
}

/* Inline code */
code {
  background: var(--gray-100);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.875em;
}

/* Don't double-style code inside highlight blocks */
.highlight code {
  background: none;
  padding: 0;
}

/* Interactive pseudocode tooltips */
.code-tip {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 0.5rem;
  padding: 1rem;
  margin: 1.5rem 0;
  overflow-x: visible;
}

.code-tip code {
  background: none;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--gray-900);
  white-space: pre-wrap;
  word-break: break-word;
}

.code-tip .tip {
  display: inline;
  cursor: inherit;
  position: relative;
  color: inherit;
  border-bottom: none;
  text-decoration: none;
}

.code-tip .tip:focus-visible {
  outline: 1px solid rgba(79, 70, 229, 0.6);
  outline-offset: 2px;
  border-radius: 2px;
}

.code-tip .tip::after {
  content: attr(data-tip);
  position: absolute;
  left: 0;
  top: 1.45em;
  min-width: 220px;
  max-width: 340px;
  padding: 0.5rem 0.65rem;
  border-radius: 0.5rem;
  background: #0f172a;
  color: #e2e8f0;
  border: 1px solid #334155;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.22);
  font-size: 0.76rem;
  line-height: 1.35;
  white-space: normal;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 120ms ease, transform 120ms ease;
  pointer-events: none;
  z-index: 20;
}

.code-tip .tip:hover::after,
.code-tip .tip:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

/* Table styling */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  background: white;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}

th {
  background: var(--gray-50);
  font-weight: 600;
  color: var(--primary);
  border-bottom: 2px solid var(--accent);
}

tr:hover {
  background: var(--gray-50);
}

tr:last-child td {
  border-bottom: none;
}

/* Responsive table */
@media (max-width: 768px) {
  table {
    font-size: 0.8rem;
  }
  
  th, td {
    padding: 0.5rem;
  }
}

/* Math styling */
.MathJax {
  font-size: 1.1em !important;
}

mjx-container[display="true"] {
  margin: 1.5rem 0 !important;
}

mjx-container[display="false"] {
  margin: 0 0.2rem !important;
}

/* Blockquote styling */
blockquote {
  background: var(--gray-50);
  border-left: 4px solid var(--accent);
  border-radius: 0 0.5rem 0.5rem 0;
  padding: 1.5rem;
  margin: 1.5rem 0;
  font-style: italic;
  line-height: 1.7;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  white-space: pre-line;
  color: var(--gray-700);
}
/* 
blockquote::before {
  content: '\201C';
  font-size: 3rem;
  color: var(--accent);
  opacity: 0.3;
  position: relative;
  top: 0.2rem;
  line-height: 0;
}

blockquote::after {
  content: '\201D';
  font-size: 3rem;
  color: var(--accent);
  opacity: 0.3;
  position: relative;
  top: 0.2rem;
  line-height: 0;
  float: right;
} */

/* Syntax highlighting colors */
.highlight .c { color: #999988; font-style: italic } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #000000; font-weight: bold } /* Keyword */
.highlight .o { color: #000000; font-weight: bold } /* Operator */
.highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */
.highlight .cp { color: #999999; font-weight: bold; font-style: italic } /* Comment.Preproc */
.highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */
.highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .ge { color: #000000; font-style: italic } /* Generic.Emph */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #999999 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #aaaaaa } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { color: #000000; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #000000; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #000000; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #000000; font-weight: bold } /* Keyword.Pseudo */
.highlight .kr { color: #000000; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #445588; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #009999 } /* Literal.Number */
.highlight .s { color: #d01040 } /* Literal.String */
.highlight .na { color: #008080 } /* Name.Attribute */
.highlight .nb { color: #0086B3 } /* Name.Builtin */
.highlight .nc { color: #445588; font-weight: bold } /* Name.Class */
.highlight .no { color: #008080 } /* Name.Constant */
.highlight .nd { color: #3c5d5d; font-weight: bold } /* Name.Decorator */
.highlight .ni { color: #800080 } /* Name.Entity */
.highlight .ne { color: #990000; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #990000; font-weight: bold } /* Name.Function */
.highlight .nl { color: #990000; font-weight: bold } /* Name.Label */
.highlight .nn { color: #555555 } /* Name.Namespace */
.highlight .nt { color: #000080 } /* Name.Tag */
.highlight .nv { color: #008080 } /* Name.Variable */
.highlight .ow { color: #000000; font-weight: bold } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mf { color: #009999 } /* Literal.Number.Float */
.highlight .mh { color: #009999 } /* Literal.Number.Hex */
.highlight .mi { color: #009999 } /* Literal.Number.Integer */
.highlight .mo { color: #009999 } /* Literal.Number.Oct */
.highlight .sb { color: #d01040 } /* Literal.String.Backtick */
.highlight .sc { color: #d01040 } /* Literal.String.Char */
.highlight .sd { color: #d01040 } /* Literal.String.Doc */
.highlight .s2 { color: #d01040 } /* Literal.String.Double */
.highlight .se { color: #d01040 } /* Literal.String.Escape */
.highlight .sh { color: #d01040 } /* Literal.String.Heredoc */
.highlight .si { color: #d01040 } /* Literal.String.Interpol */
.highlight .sx { color: #d01040 } /* Literal.String.Other */
.highlight .sr { color: #009926 } /* Literal.String.Regex */
.highlight .s1 { color: #d01040 } /* Literal.String.Single */
.highlight .ss { color: #990073 } /* Literal.String.Symbol */
.highlight .bp { color: #999999 } /* Name.Builtin.Pseudo */
.highlight .vc { color: #008080 } /* Name.Variable.Class */
.highlight .vg { color: #008080 } /* Name.Variable.Global */
.highlight .vi { color: #008080 } /* Name.Variable.Instance */
.highlight .il { color: #009999 } /* Literal.Number.Integer.Long */ 

/* Terminal Navigation (Post pages) */
.terminal-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-500);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  margin-left: -0.75rem;
  border-radius: 6px;
  transition: background 0.2s ease, color 0.2s ease;
}

.terminal-nav:hover {
  background: var(--gray-100);
  color: #059669;
}

.terminal-nav svg {
  transition: transform 0.2s ease;
  color: var(--gray-400);
}

.terminal-nav:hover svg {
  transform: translateX(-3px);
  color: #059669;
}

.terminal-nav .terminal-user {
  color: inherit;
}

/* Article Header */
.article-header {
  margin-bottom: 2rem;
  padding: 0;
}

/* TL;DR styling */
.tldr {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--gray-700);
  padding: 1.25rem 1.5rem;
  margin: 0 0 2rem;
  background: var(--gray-50);
  border-radius: 0.5rem;
}

.tldr-label {
  font-weight: 700;
  color: #7c3aed;
  margin-right: 0.25rem;
}

.article-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.025em;
  line-height: 1.3;
  margin: 0.75rem 0 1.5rem;
}

@media (min-width: 768px) {
  .article-title {
    font-size: 2.5rem;
    line-height: 1.25;
  }
}

@media (min-width: 1024px) {
  .article-title {
    font-size: 3rem;
  }
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--gray-500);
  border-left: 2px solid var(--accent);
  padding-left: 1rem;
}

.meta-separator {
  color: var(--gray-300);
}

.meta-link {
  color: var(--gray-500);
  text-decoration: none;
  transition: color 0.2s ease;
}

.meta-link:hover {
  color: var(--accent);
}

/* Article Content */
.article-content {
  color: var(--gray-700);
  line-height: 1.8;
}

.article-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 2.5rem 0 1rem;
  letter-spacing: -0.015em;
}

.article-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-900);
  margin: 2rem 0 0.75rem;
}

.article-content p {
  margin: 1.25rem 0;
}

.article-content a {
  color: var(--accent);
  text-decoration: none;
}

.article-content a:hover {
  text-decoration: underline;
}

.article-content img {
  border-radius: 0.75rem;
}

/* Footnote images should render as compact thumbnails */
.article-content .footnote img,
.article-content .footnotes img {
  max-width: 220px;
  width: auto;
  height: auto;
  display: block;
  margin-top: 0.4rem;
}

/* Hiring CTA */
.hiring-cta {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 0.5rem;
  padding: 1rem 1.5rem;
  margin-top: 3rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.hiring-cta-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hiring-cta-icon svg {
  color: var(--gray-400);
  width: 20px;
  height: 20px;
}

.hiring-cta-title {
  display: none;
}

.hiring-cta-text {
  color: var(--gray-600);
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.4;
  flex: 1;
}

.hiring-cta-button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: transparent;
  color: var(--gray-700);
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: 0.375rem;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.hiring-cta-button:hover {
  border-color: var(--gray-400);
  color: var(--gray-900);
}

.hiring-cta-button svg {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
}

.hiring-cta-button:hover svg {
  transform: translateX(2px);
}

/* Discussion banner for Hacker News links */
.discussion-banner {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  padding: 1rem;
  border-radius: 0.5rem;
  margin: 1.5rem 0;
  text-align: center;
  color: var(--gray-600);
}

.discussion-banner a {
  color: var(--accent);
  text-decoration: none;
}

.discussion-banner a:hover {
  text-decoration: underline;
} 

/* Inline update callout */
.update {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-left: 4px solid var(--accent);
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0 2rem;
  color: var(--gray-600);
}

.update-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.update-badge {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.2rem 0.9rem;
  background: rgba(79, 70, 229, 0.15);
  color: var(--accent);
}

.update-date {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-500);
}

.update p {
  margin: 0;
  line-height: 1.5;
}

.update p + p {
  margin-top: 0.6rem;
}

.update-footnote {
  font-size: 0.9rem;
  color: var(--gray-500);
}

@media (max-width: 600px) {
  .update {
    padding: 0.9rem 1rem;
  }

  .update-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .hiring-cta {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }

  .hiring-cta-icon {
    display: none;
  }

  .hiring-cta-button {
    width: 100%;
    justify-content: center;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideInFromBottom {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.5s ease-out;
}

.animate-slide-in {
  animation: slideInFromBottom 0.5s ease-out;
}

/* Selection colors */
::selection {
  background-color: rgba(79, 70, 229, 0.15);
  color: var(--accent);
}

/* =========================================================
   Magic Eye Visualizations
   ========================================================= */

.meviz {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 0.75rem;
  padding: 1.25rem 1.25rem 1rem;
  margin: 2rem 0;
  overflow-x: auto;
}

.meviz-panels {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.meviz-panels-stack {
  flex-direction: column;
  align-items: center;
}

.meviz-panel {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: flex-start;
  flex-shrink: 0;
}

.meviz-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.6;
}

.meviz-legend {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 0.25rem;
  text-transform: none;
  letter-spacing: 0;
  color: #475569;
}

.meviz-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.meviz-dot-fg { background: #818cf8; }
.meviz-dot-bg { background: #4b5563; }
.meviz-dot-singleton {
  background: none;
  color: #475569;
  font-size: 0.55rem;
  line-height: 1;
}

.meviz-arrow {
  font-size: 1.2rem;
  color: #4F46E5;
  flex-shrink: 0;
  align-self: center;
  margin-top: 1.15rem;
}

.meviz-panels-stack .meviz-arrow {
  margin-top: 0;
}

.meviz-sub {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.meviz-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.meviz-btn {
  background: #1e293b;
  color: #cbd5e1;
  border: 1px solid #334155;
  border-radius: 0.375rem;
  padding: 0.3rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  line-height: 1.5;
  user-select: none;
}

.meviz-btn:hover {
  background: #334155;
  border-color: #6366f1;
  color: #e2e8f0;
}

.meviz-btn-done {
  border-color: #4f46e5;
  color: #a5b4fc;
}

.meviz-btn-done:hover {
  background: #312e81;
  border-color: #818cf8;
  color: #c7d2fe;
}

.meviz canvas {
  display: block;
  image-rendering: pixelated;
}

.meviz .ev-depth {
  touch-action: none;
}

.meviz-sliders {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  margin-bottom: 0.75rem;
}

.meviz-slider-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.meviz-slider-name {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  min-width: 4.5rem;
}

.meviz-range {
  accent-color: #6366f1;
  width: 100px;
  cursor: pointer;
}

.meviz-select {
  background: #1e293b;
  color: #cbd5e1;
  border: 1px solid #334155;
  border-radius: 0.375rem;
  padding: 0.22rem 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.meviz-sep-val {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #94a3b8;
  min-width: 1.4rem;
  text-align: right;
}

@media (max-width: 760px) {
  .meviz {
    padding: 0.85rem;
    border-radius: 0.65rem;
    overflow-x: hidden;
  }

  .meviz-panels {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }

  .meviz-panel {
    width: 100%;
    align-items: stretch;
  }

  .meviz-arrow {
    margin-top: 0;
    font-size: 1rem;
  }

  .meviz canvas {
    max-width: 100%;
    width: 100% !important;
    height: auto !important;
  }

  .meviz-label {
    font-size: 0.63rem;
    line-height: 1.45;
  }

  .meviz-legend {
    margin-left: 0;
    gap: 0.35rem;
    display: inline-flex;
    flex-wrap: wrap;
  }

  .meviz-sliders {
    gap: 0.45rem;
  }

  .meviz-slider-row {
    width: 100%;
    gap: 0.45rem;
  }

  .meviz-slider-name {
    min-width: 3.9rem;
  }

  .meviz-range {
    flex: 1;
    min-width: 0;
  }

  .meviz-select {
    flex: 1;
    min-width: 0;
  }

  .meviz-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
    align-items: stretch;
  }

  .meviz-btn {
    width: 100%;
    text-align: center;
    padding: 0.42rem 0.55rem;
    font-size: 0.74rem;
    line-height: 1.35;
  }
}