/* ==========================================================================
   Host An App — Design System (hand-written, zero dependencies, no Tailwind)
   --------------------------------------------------------------------------
   Single source of truth for every page: landing, docs, 404, and the server-
   rendered document shell (internal/render/layout.html) loaded by Markdown
   and Mermaid deployments. Self-hosted fonts live under /assets/fonts/ so the
   strict Content-Security-Policy on /<slug> routes cannot block them.
   ========================================================================== */

/* ----- Self-hosted fonts (latin subset) ----- */
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 300; font-display: swap; src: url("/assets/fonts/plus-jakarta-sans-300.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/plus-jakarta-sans-400.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/plus-jakarta-sans-500.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/plus-jakarta-sans-600.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/plus-jakarta-sans-700.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/jetbrains-mono-400.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/jetbrains-mono-500.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/jetbrains-mono-700.woff2") format("woff2"); }
@font-face { font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/instrument-serif-400.woff2") format("woff2"); }
@font-face { font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap; src: url("/assets/fonts/instrument-serif-400-italic.woff2") format("woff2"); }

/* ----- Design tokens ----- */
:root {
  --bg-base: #030405;
  --bg-surface: #0A0B0E;
  --bg-surface-hover: #111318;
  --bg-deep: #050608;
  --border: #1E2128;
  --border-active: #323642;
  --text-bright: #F3F4F6;
  --text: #E5E7EB;
  --text-muted: #A8B0BC;
  --text-muted-2: #8A919E;
  --accent: #FF4F19;
  --accent-hover: #FF6B3D;
  --success: #00E676;
  --warning: #F5A623;
  --error: #FF3366;

  --font-sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", "Menlo", "Consolas", monospace;
  --font-serif: "Instrument Serif", Georgia, serif;

  --radius: 0.75rem;
  --radius-sm: 0.375rem;
  --header-h: 3.5rem;
}

/* ----- Reset / base ----- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-base);
  color: var(--text-bright);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-image:
    radial-gradient(circle at 50% 0%, rgba(255, 79, 25, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(0, 230, 118, 0.02) 0%, transparent 50%);
  background-attachment: fixed;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
::selection { background: rgba(255, 79, 25, 0.3); color: var(--text-bright); }
[id] { scroll-margin-top: 5rem; }

/* ----- Scrollbar ----- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-active); }

/* ----- Screen-reader only ----- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.hide-sm { display: inline; }
@media (min-width: 640px) { .hide-sm { display: none; } }

/* ----- Layout primitives ----- */
.page-main { flex: 1 0 auto; }
.container { width: 100%; max-width: 72rem; margin-inline: auto; padding-inline: 1rem; }
@media (min-width: 640px) { .container { padding-inline: 1.5rem; } }

/* ==========================================================================
   Brand logo (shared by header + footer)
   ========================================================================== */
.brand-logo { display: inline-flex; align-items: center; gap: 0.75rem; }
.brand-logo__mark { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; transition: transform 0.3s ease; }
.brand-logo:hover .brand-logo__mark { transform: scale(1.05); }
.brand-logo:hover .brand-logo__mark svg { filter: drop-shadow(0 0 8px rgba(255, 79, 25, 0.5)); }
.brand-logo__name { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; color: var(--text-bright); white-space: nowrap; transition: opacity 0.3s ease; }
.brand-logo:hover .brand-logo__name { opacity: 1; }
.brand-logo__name em { font-style: normal; font-weight: 400; font-size: 13px; color: var(--text-muted); }

/* ==========================================================================
   Site header
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 11, 14, 0.7);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.site-header__inner {
  max-width: 72rem; margin-inline: auto;
  height: var(--header-h); padding-inline: 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
@media (min-width: 640px) { .site-header__inner { padding-inline: 1.5rem; } }
.site-header__inner--wide { max-width: 1400px; }
.site-header__left { display: flex; align-items: center; gap: 1.5rem; }
.site-header__docslink {
  display: none;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--text-muted); padding: 0.375rem 0.75rem; border-radius: 0.375rem;
  transition: color 0.15s ease, background 0.15s ease;
}
.site-header__docslink:hover { color: var(--text-bright); background: rgba(255, 255, 255, 0.03); }
@media (min-width: 640px) { .site-header__docslink { display: inline-flex; margin-left: 1rem; } }

/* Header nav (docs variant) */
.site-nav { display: flex; align-items: center; gap: 0.25rem; font-family: var(--font-mono); font-size: 12px; }
.site-nav__item {
  padding: 0.375rem 0.75rem; border-radius: 0.375rem;
  color: var(--text-muted);
  transition: color 0.15s ease, background 0.15s ease;
}
.site-nav__item:hover { color: var(--text-bright); background: rgba(255, 255, 255, 0.03); }
.site-nav__item.is-active { color: var(--accent); background: rgba(255, 79, 25, 0.08); }

.site-header__meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.site-header__meta .version { display: none; opacity: 0.7; font-size: 10px; }
@media (min-width: 640px) { .site-header__meta .version { display: inline; } }

/* Health indicator (landing header) */
.health-indicator { display: inline-flex; align-items: center; gap: 0.5rem; font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.health-dot {
  position: relative; width: 8px; height: 8px; border-radius: 9999px;
  background: var(--text-muted); transition: background 0.5s ease;
}
.health-dot.is-ok { background: var(--success); }
.health-dot.is-ok::before {
  content: ""; position: absolute; inset: -4px; border-radius: 9999px;
  background: var(--success); animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}
.health-dot.is-error { background: var(--error); }
.health-label { font-size: 10px; transition: color 0.5s ease; }
.health-label.is-ok { color: rgba(0, 230, 118, 0.7); }
.health-label.is-error { color: rgba(255, 51, 102, 0.7); }

/* ==========================================================================
   Site footer
   ========================================================================== */
.site-footer {
  flex-shrink: 0; border-top: 1px solid var(--border);
  padding: 1.5rem 1rem; background: var(--bg-base);
  font-family: var(--font-mono); font-size: 11px; color: var(--text-muted);
}
@media (min-width: 640px) { .site-footer { padding-inline: 1.5rem; } }
.site-footer--bottom { margin-top: auto; }
.site-footer__inner {
  max-width: 72rem; margin-inline: auto;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 1rem;
}
@media (min-width: 640px) { .site-footer__inner { flex-direction: row; } }
.footer-brand { display: flex; align-items: center; gap: 0.5rem; transition: opacity 0.2s ease; }
.footer-brand:hover { opacity: 0.8; }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { transition: color 0.15s ease; }
.footer-links a:hover { color: var(--text-bright); }

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes pulse-ring { 0% { transform: scale(0.8); opacity: 0.5; } 100% { transform: scale(2.5); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ping { 75%, 100% { transform: scale(2); opacity: 0; } }

.anim-fade-up { opacity: 0; animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.anim-delay-1 { animation-delay: 0.1s; }
.anim-delay-2 { animation-delay: 0.2s; }
.anim-delay-3 { animation-delay: 0.3s; }
.anim-delay-4 { animation-delay: 0.4s; }

/* Pulsing live dot (landing hero stats) */
.pulse-dot { position: relative; display: inline-flex; width: 8px; height: 8px; }
.pulse-dot > i { position: absolute; inset: 0; border-radius: 9999px; opacity: 0.4; animation: ping 1.6s cubic-bezier(0, 0, 0.2, 1) infinite; }
.pulse-dot > b { position: relative; display: inline-block; width: 8px; height: 8px; border-radius: 9999px; }
.pulse-dot--accent > i, .pulse-dot--accent > b { background: var(--accent); }
.pulse-dot--success > i, .pulse-dot--success > b { background: var(--success); }

/* ==========================================================================
   Reusable components (used by docs + landing)
   ========================================================================== */
.glass-panel { background: rgba(10, 11, 14, 0.7); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }

.doc-card {
  background: rgba(10, 11, 14, 0.7);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.doc-card--accent { border-color: rgba(255, 79, 25, 0.2); background: rgba(255, 79, 25, 0.03); }
.doc-card:hover { border-color: var(--border-active); background: var(--bg-surface-hover); transform: translateY(-2px); }

.code-block { background: var(--bg-deep); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; position: relative; }
.code-block pre { padding: 1.25rem; margin: 0; overflow-x: auto; font-family: var(--font-mono); font-size: 0.8125rem; line-height: 1.7; color: var(--text-bright); }
.code-block .code-header { padding: 0.625rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; background: rgba(10, 11, 14, 0.5); }
.code-block .code-header > span { font-family: var(--font-mono); font-size: 0.6875rem; color: var(--text-muted-2); }
.code-shimmer::after { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent 0%, rgba(255, 79, 25, 0.5) 50%, transparent 100%); background-size: 200% 100%; animation: shimmer 3s linear infinite; }

code { font-family: var(--font-mono); font-size: 0.875em; background: var(--bg-surface); border: 1px solid var(--border); padding: 0.15em 0.4em; border-radius: 4px; color: var(--text-bright); }
pre code { background: none; border: 0; padding: 0; font-size: inherit; border-radius: 0; }

.hl-keyword { color: #FF79C6; }
.hl-string { color: #F1FA8C; }
.hl-comment { color: #6272A4; font-style: italic; }
.hl-type { color: #8BE9FD; }
.hl-number { color: #BD93F9; }
.hl-property { color: #50FA7B; }
.hl-literal { color: #BD93F9; }
.hl-tag { color: #FF79C6; }
.hl-attr { color: #50FA7B; }
.hl-value { color: #F1FA8C; }
.hl-method { color: #8BE9FD; }
.hl-url { color: #FF6B3D; }

.badge { display: inline-flex; align-items: center; font-family: var(--font-mono); font-size: 0.625rem; padding: 0.125rem 0.5rem; border-radius: 0.25rem; font-weight: 500; }
.badge-get { background: rgba(0, 230, 118, 0.1); color: var(--success); border: 1px solid rgba(0, 230, 118, 0.2); }
.badge-post { background: rgba(255, 79, 25, 0.1); color: var(--accent); border: 1px solid rgba(255, 79, 25, 0.2); }
.badge-required { background: rgba(255, 79, 25, 0.1); color: var(--accent); border: 1px solid rgba(255, 79, 25, 0.2); }
.badge-optional { background: rgba(138, 145, 158, 0.1); color: var(--text-muted-2); border: 1px solid rgba(138, 145, 158, 0.2); }
.badge-success { background: rgba(0, 230, 118, 0.1); color: var(--success); border: 1px solid rgba(0, 230, 118, 0.2); }
.badge-error { background: rgba(255, 51, 102, 0.1); color: var(--error); border: 1px solid rgba(255, 51, 102, 0.2); }

.copy-btn { font-family: var(--font-mono); font-size: 0.625rem; background: var(--border); border: 0; color: var(--text-muted-2); padding: 0.25rem 0.75rem; border-radius: 0.25rem; cursor: pointer; transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease; position: absolute; top: 0.4rem; right: 0.4rem; z-index: 2; }
.copy-btn:hover { background: var(--border-active); color: var(--text-bright); }
.copy-btn:active { transform: scale(0.95); }

.param-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.param-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.param-table th { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border); font-family: var(--font-mono); font-size: 0.6875rem; color: var(--text-muted-2); text-transform: uppercase; letter-spacing: 0.05em; }
.param-table td { padding: 0.625rem 0.75rem; border-bottom: 1px solid rgba(30, 33, 40, 0.5); color: var(--text-bright); vertical-align: top; }
.param-table tr:last-child td { border-bottom: 0; }
.param-table td.muted { color: var(--text-muted); font-size: 0.75rem; }
.param-table td.mono { font-family: var(--font-mono); color: var(--accent); font-size: 0.75rem; }

/* ==========================================================================
   Landing page
   ========================================================================== */
.landing-hero { max-width: 56rem; margin-inline: auto; padding: 4rem 1rem 3rem; text-align: center; }
@media (min-width: 640px) { .landing-hero { padding-top: 6rem; padding-bottom: 3rem; } }
.landing-hero h1 { margin: 0 0 1rem; font-weight: 600; letter-spacing: -0.02em; color: var(--text-bright); font-size: 2.25rem; line-height: 1.1; }
@media (min-width: 640px) { .landing-hero h1 { font-size: 3rem; } }
@media (min-width: 768px) { .landing-hero h1 { font-size: 3.75rem; } }
.landing-hero h1 strong { font-weight: 500; font-family: var(--font-mono); }
.landing-hero h1 .light { font-weight: 300; }
.landing-hero h1 .accent {
  display: block; margin-top: 0.25rem;
  font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: 0;
  color: var(--accent); font-size: 1.875rem; line-height: 1.1;
}
.landing-hero h1 .accent b { font-style: normal; font-weight: 700; }
@media (min-width: 640px) { .landing-hero h1 .accent { font-size: 3rem; } }
@media (min-width: 768px) { .landing-hero h1 .accent { font-size: 3.75rem; } }
@media (min-width: 1024px) { .landing-hero h1 .accent { font-size: 4.5rem; } }
.landing-hero .lede { margin-inline: auto; max-width: 36rem; color: var(--text-muted); font-size: 0.875rem; line-height: 1.625; font-weight: 300; }
@media (min-width: 640px) { .landing-hero .lede { font-size: 1rem; } }
.landing-stats { display: flex; align-items: center; justify-content: center; gap: 1.5rem; margin-top: 2rem; }
@media (min-width: 640px) { .landing-stats { gap: 2.5rem; } }
.stat { display: flex; align-items: center; gap: 0.625rem; }
.stat__num { font-size: 1.5rem; font-weight: 600; color: var(--text-bright); font-variant-numeric: tabular-nums; }
@media (min-width: 640px) { .stat__num { font-size: 1.875rem; } }
.stat__label { font-size: 0.75rem; color: var(--text-muted); font-weight: 300; }
.stat-divider { width: 1px; height: 1.5rem; background: var(--border); }

/* MCP integration section */
.landing-section { max-width: 64rem; margin-inline: auto; padding: 0 1rem 4rem; width: 100%; }
@media (min-width: 640px) { .landing-section { padding-inline: 1.5rem; } }
.integ-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 768px) { .integ-grid { grid-template-columns: repeat(3, 1fr); } }
.integ-card {
  display: block; width: 100%; text-align: left; cursor: pointer;
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem; color: inherit;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.02);
  transition: border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.integ-card:hover { border-color: var(--border-active); background: var(--bg-surface-hover); transform: translateY(-2px); }
.integ-card.is-active { border-color: rgba(255, 79, 25, 0.4); background: linear-gradient(180deg, rgba(255, 79, 25, 0.05) 0%, rgba(10, 11, 14, 0) 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 8px 30px -10px rgba(255, 79, 25, 0.15); }
.integ-card__top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 1rem; }
.integ-card__icon { width: 2.5rem; height: 2.5rem; border-radius: 0.5rem; display: flex; align-items: center; justify-content: center; }
.integ-card__icon img { width: 1.25rem; height: 1.25rem; }
.integ-card__tag { font-size: 10px; font-family: var(--font-mono); color: rgba(255, 79, 25, 0.8); background: rgba(255, 79, 25, 0.1); padding: 2px 8px; border-radius: 4px; }
.integ-card h2 { margin: 0; font-size: 0.875rem; font-weight: 600; color: var(--text-bright); }
.integ-card p { margin: 0.375rem 0 0; font-size: 0.75rem; color: var(--text-muted); }

.integ-panel { margin-top: 1rem; overflow: hidden; transition: max-height 0.5s cubic-bezier(0.16, 1, 0.3, 1); }
.integ-panel__inner { border: 1px solid var(--border); background: var(--bg-deep); border-radius: var(--radius); padding: 1.25rem; position: relative; overflow: hidden; }
.integ-pane { display: none; }
.integ-pane.is-open { display: block; }
.integ-pane__head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.integ-pane__tag { font-size: 10px; font-family: var(--font-mono); padding: 2px 8px; border-radius: 4px; border: 1px solid; }
.integ-pane__tag--terminal { color: var(--accent); background: rgba(255, 79, 25, 0.1); border-color: rgba(255, 79, 25, 0.2); }
.integ-pane__tag--json { color: var(--text-bright); background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.1); }
.integ-pane__tag--vscode { color: #007ACC; background: rgba(0, 122, 204, 0.1); border-color: rgba(0, 122, 204, 0.2); }
.integ-pane__hint { font-size: 0.75rem; color: var(--text-muted); }
.integ-cmdrow { display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 0.5rem; padding: 0.75rem; }
.integ-cmdrow code { flex: 1; font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-bright); background: none; border: 0; padding: 0; overflow-x: auto; white-space: nowrap; }
@media (min-width: 640px) { .integ-cmdrow code { font-size: 0.875rem; } }
.integ-cmdrow code .prefix { color: var(--text-muted); margin-right: 0.5rem; user-select: none; }
.integ-jsonbox { position: relative; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 0.5rem; padding: 0.75rem; }
.integ-jsonbox pre { margin: 0; font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-bright); overflow-x: auto; white-space: pre; }
@media (min-width: 640px) { .integ-jsonbox pre { font-size: 0.875rem; } }
.integ-copy { flex-shrink: 0; font-size: 10px; font-family: var(--font-mono); background: var(--border); color: var(--text-muted-2); border: 0; padding: 0.375rem 0.75rem; border-radius: 0.25rem; cursor: pointer; transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease; }
.integ-copy:hover { background: var(--border-active); color: var(--text-bright); }
.integ-copy:active { transform: scale(0.95); }
.integ-copy.is-done { color: var(--success); }
.integ-copy--abs { position: absolute; top: 0.75rem; right: 0.75rem; }

/* Divider */
.landing-divider { max-width: 72rem; margin-inline: auto; width: 100%; padding: 1.5rem 1rem; }
@media (min-width: 640px) { .landing-divider { padding-inline: 1.5rem; } }
.landing-divider__inner { display: flex; align-items: center; gap: 1rem; opacity: 0.7; }
.landing-divider__line { flex: 1; height: 1px; background: var(--border); }
.landing-divider__label { font-size: 10px; font-family: var(--font-mono); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; }

/* Manual deploy (split layout) */
.deploy-section { max-width: 72rem; margin-inline: auto; width: 100%; padding: 0 1rem 2.5rem; flex: 1; display: flex; flex-direction: column; }
@media (min-width: 640px) { .deploy-section { padding-inline: 1.5rem; padding-bottom: 5rem; } }
.deploy-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 1024px) { .deploy-grid { grid-template-columns: 3fr 2fr; min-height: 500px; } }
.deploy-editor { display: flex; flex-direction: column; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.02); min-height: 350px; }
@media (min-width: 1024px) { .deploy-editor { min-height: 0; } }
.editor-bar { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; background: rgba(3, 4, 5, 0.5); }
.editor-bar__left { display: flex; align-items: center; gap: 0.75rem; }
.editor-bar__lights { display: flex; gap: 0.375rem; }
.editor-bar__lights i { width: 12px; height: 12px; border-radius: 9999px; border: 1px solid rgba(0, 0, 0, 0.1); display: inline-block; }
.editor-bar__file { font-size: 11px; font-family: var(--font-mono); color: var(--text-muted); }
.editor-bar__types { display: flex; align-items: center; gap: 0.375rem; margin-left: 0.75rem; padding-left: 0.75rem; border-left: 1px solid var(--border); }
.type-toggle { font-size: 10px; font-family: var(--font-mono); padding: 0.25rem 0.625rem; border-radius: 0.25rem; border: 0; cursor: pointer; color: var(--text-muted); background: transparent; transition: color 0.15s ease, background 0.15s ease; }
.type-toggle:hover { color: var(--text-bright); background: rgba(3, 4, 5, 0.5); }
.type-toggle.is-active { background: var(--accent); color: var(--bg-base); font-weight: 500; }
.editor-bar__weight { font-size: 10px; font-family: var(--font-mono); color: var(--text-bright); }
.editor-bar__weight.is-warn { color: var(--warning); font-weight: 700; }
.editor-bar__weight.is-error { color: var(--error); font-weight: 700; }
.slug-row { border-bottom: 1px solid var(--border); background: var(--bg-surface); padding: 0.5rem; }
.slug-row__inner { display: flex; align-items: center; font-family: var(--font-mono); font-size: 12px; background: var(--bg-base); border: 1px solid var(--border); border-radius: 0.375rem; overflow: hidden; transition: border-color 0.2s ease; }
.slug-row__inner:focus-within { border-color: rgba(255, 79, 25, 0.5); box-shadow: 0 0 0 1px rgba(255, 79, 25, 0.5); }
.slug-row__inner .slash { padding: 0.5rem 0 0.5rem 0.75rem; color: var(--text-muted); user-select: none; }
.slug-row__inner input { flex: 1; background: transparent; border: 0; padding: 0.5rem 0.25rem; color: var(--text-bright); font-family: var(--font-mono); font-size: 12px; }
.slug-row__inner input:focus { outline: none; }

/* One-time toggle */
.one-time-toggle { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; padding: 0 0.25rem; cursor: pointer; user-select: none; font-size: 11px; font-family: var(--font-mono); color: var(--text-muted); }
.one-time-toggle:hover { color: var(--text-bright); }
.one-time-toggle input[type="checkbox"] { position: absolute; opacity: 0; width: 0; height: 0; }
.one-time-toggle__switch { width: 28px; height: 16px; border-radius: 999px; background: var(--border); position: relative; transition: background 0.2s ease; flex-shrink: 0; }
.one-time-toggle__switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 999px; background: var(--text-muted); transition: transform 0.2s ease, background 0.2s ease; }
.one-time-toggle input:checked + .one-time-toggle__switch { background: rgba(255, 79, 25, 0.3); }
.one-time-toggle input:checked + .one-time-toggle__switch::after { transform: translateX(12px); background: var(--accent); }
.one-time-toggle input:checked ~ .one-time-toggle__text { color: var(--accent); }

.purge-clock.is-onetime { color: var(--warning); border-color: rgba(245, 166, 35, 0.3); background: rgba(245, 166, 35, 0.1); text-transform: uppercase; }
.editor-body { flex: 1; position: relative; min-height: 200px; background-image: linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px); background-size: 20px 20px; }
.editor-body textarea { position: absolute; inset: 0; width: 100%; height: 100%; background: transparent; border: 0; padding: 1rem; font-family: var(--font-mono); font-size: 12px; color: var(--text-bright); resize: none; line-height: 1.625; }
@media (min-width: 640px) { .editor-body textarea { font-size: 13px; } }
.editor-body textarea:focus { outline: none; }
textarea { tab-size: 4; caret-color: var(--accent); }

.deploy-side { display: flex; flex-direction: column; gap: 1rem; min-height: 0; }
.result-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; display: flex; flex-direction: column; position: relative; box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.02); }
.result-card__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.result-card__label { font-size: 10px; font-family: var(--font-mono); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.purge-clock { font-size: 10px; font-family: var(--font-mono); color: var(--text-muted); border: 1px solid var(--border); padding: 0.25rem 0.5rem; border-radius: 0.25rem; background: var(--bg-base); transition: all 0.3s ease; }
.purge-clock.is-live { color: var(--accent); border-color: rgba(255, 79, 25, 0.3); background: rgba(255, 79, 25, 0.1); }
.result-card__body { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 1rem 0; }
.status-orb { width: 3rem; height: 3rem; border-radius: 9999px; background: rgba(30, 33, 40, 0.5); display: flex; align-items: center; justify-content: center; margin-bottom: 0.75rem; color: var(--text-muted); transition: all 0.5s ease; }
.status-orb.is-loading { background: rgba(255, 79, 25, 0.2); color: var(--accent); }
.status-orb.is-ok { background: rgba(0, 230, 118, 0.2); color: var(--success); box-shadow: 0 0 30px rgba(0, 230, 118, 0.3); }
.status-orb.is-error { background: rgba(255, 51, 102, 0.2); color: var(--error); }
.status-orb.is-loading svg { animation: spin 1s linear infinite; }
.status-heading { font-size: 0.875rem; font-weight: 500; color: var(--text-bright); margin: 0 0 0.25rem; transition: color 0.3s ease; }
.result-url { font-size: 11px; font-family: var(--font-mono); color: var(--text-muted); max-width: 100%; padding: 0 0.5rem; height: 0; overflow: hidden; opacity: 0; transition: color 0.3s ease; }
.result-url:hover { color: var(--accent); }
.result-url.is-shown { height: 1.25rem; opacity: 1; }
.publish-btn { width: 100%; margin-top: 1rem; background: var(--text-bright); color: var(--bg-base); font-weight: 500; padding: 0.625rem; border: 0; border-radius: 0.5rem; font-size: 12px; display: flex; align-items: center; justify-content: center; gap: 0.5rem; cursor: pointer; transition: background 0.2s ease; }
.publish-btn:hover:not(:disabled) { background: #fff; box-shadow: 0 0 20px rgba(255, 255, 255, 0.2); }
.publish-btn:disabled { cursor: default; opacity: 0.7; }
.terminal { flex: 1; background: var(--bg-deep); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.02); min-height: 200px; }
.terminal__head { padding: 0.5rem 1rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; background: rgba(10, 11, 14, 0.5); }
.terminal__head span { font-size: 10px; font-family: var(--font-mono); color: var(--text-muted); }
.terminal__body { padding: 1rem; font-family: var(--font-mono); font-size: 11px; display: flex; flex-direction: column; gap: 0.375rem; overflow-y: auto; flex: 1; line-height: 1.625; }
.log-line { color: var(--text-bright); }
.log-line.log-info { color: var(--text-bright); }
.log-line.log-error { color: var(--error); }
.log-line.log-success { color: var(--success); }
.log-line.log-accent { color: var(--accent); }
.log-line.log-system { color: var(--text-muted); }
.log-line .ts { color: rgba(168, 176, 188, 0.7); }
.log-line a { color: var(--success); text-decoration: underline; }
.log-line a:hover { color: #fff; }

/* ==========================================================================
   Docs page
   ========================================================================== */
.docs-layout { display: flex; flex: 1; flex-direction: column; }
@media (min-width: 1024px) { .docs-layout { flex-direction: row; } }
.docs-sidebar { padding: 1.5rem 0.75rem; border-right: 1px solid var(--border); background: rgba(10, 11, 14, 0.5); }
@media (min-width: 1024px) { .docs-sidebar { position: fixed; top: var(--header-h); left: 0; bottom: 0; width: 15rem; overflow-y: auto; } }
.docs-sidebar-inner { display: flex; flex-direction: column; gap: 1rem; }
@media (max-width: 1023px) {
  .docs-sidebar { padding: 0.75rem 1rem; border-right: 0; border-bottom: 1px solid var(--border); }
  .docs-sidebar-inner { flex-direction: row; gap: 0.25rem; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .docs-sidebar-inner::-webkit-scrollbar { display: none; }
  .sidebar-group { flex-direction: row; align-items: center; gap: 0.25rem; flex-shrink: 0; }
  .docs-sidebar .section-title { display: none; }
  .docs-sidebar .nav-link { white-space: nowrap; flex-shrink: 0; }
}
.sidebar-group { display: flex; flex-direction: column; gap: 0.125rem; }
.section-title { font-size: 0.6875rem; font-family: var(--font-mono); font-weight: 700; color: var(--text-muted-2); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.5rem; padding: 0 0.75rem; }
.nav-link { display: block; padding: 0.375rem 0.75rem; font-size: 0.8125rem; color: var(--text-muted-2); border-radius: 0.375rem; transition: color 0.15s ease, background 0.15s ease; font-family: var(--font-sans); }
.nav-link:hover { color: var(--text-bright); background: rgba(255, 255, 255, 0.03); }
.nav-link.active { color: var(--accent); background: rgba(255, 79, 25, 0.08); }

.docs-content { flex: 1; min-width: 0; }
@media (min-width: 1024px) { .docs-content { margin-left: 15rem; } }
.docs-content__inner { max-width: 48rem; margin-inline: auto; padding: 2.5rem 1rem; }
@media (min-width: 640px) { .docs-content__inner { padding: 2.5rem 2.5rem 4rem; } }
.docs-content section { margin-bottom: 4rem; }
.docs-content h1 { margin: 0 0 1rem; font-size: 1.875rem; font-weight: 600; letter-spacing: -0.02em; color: var(--text-bright); }
@media (min-width: 640px) { .docs-content h1 { font-size: 2.25rem; } }
.docs-content h2 { margin: 0 0 1rem; font-size: 1.25rem; font-weight: 600; color: var(--text-bright); }
.docs-content h3 { margin: 0 0 0.75rem; font-size: 0.875rem; font-weight: 600; color: var(--text-bright); }
.docs-content h4 { margin: 0 0 0.25rem; font-size: 0.875rem; font-weight: 600; color: var(--text-bright); }
.docs-content p { margin: 0 0 1rem; font-size: 0.875rem; color: var(--text-muted); line-height: 1.625; }
.docs-content p strong { color: var(--text-bright); font-weight: 600; }
.docs-content code { font-size: 0.75rem; }
.docs-content .lead { font-size: 1rem; max-width: 36rem; margin-bottom: 2rem; }
.docs-content .code-block { margin-bottom: 1.5rem; }
.docs-content .doc-card { margin-bottom: 0; }
.docs-content ol { margin: 0 0 1rem; padding-left: 1.25rem; font-size: 0.875rem; color: var(--text-muted); line-height: 1.625; display: flex; flex-direction: column; gap: 0.5rem; }
.docs-content .reserved-slugs { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.docs-content .table-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; margin: 0 -1.5rem 1.5rem; }
@media (max-width: 639px) { .docs-content .table-card { margin-inline: -1rem; } }
@media (min-width: 640px) { .docs-content .table-card { margin-inline: 0; } }
.docs-content .table-card .param-table th, .docs-content .table-card .param-table td { padding-inline: 1rem; }
.docs-content .stack { display: flex; flex-direction: column; gap: 0.75rem; }
.docs-content .row { display: flex; align-items: center; gap: 0.75rem; }
.docs-content .setup-title { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.docs-content .setup-title img { width: 1.25rem; height: 1.25rem; border-radius: 0.25rem; }
.docs-content .setup-block { margin-bottom: 1.5rem; }

/* ==========================================================================
   404 page
   ========================================================================== */
.error-page { flex: 1; display: flex; align-items: center; justify-content: center; }
.error-page__box { text-align: center; padding: 0 1.5rem; }
.error-page__mark { width: 3rem; height: 3rem; border-radius: var(--radius); background: var(--accent); color: var(--bg-base); display: flex; align-items: center; justify-content: center; font-size: 1.25rem; font-weight: 700; margin: 0 auto 1.5rem; }
.error-page h1 { margin: 0 0 0.75rem; font-size: 3.75rem; font-weight: 700; color: var(--text-bright); font-family: var(--font-mono); }
.error-page p { color: var(--text-muted); font-size: 0.875rem; max-width: 24rem; margin: 0 auto 2rem; }
.error-page__actions { display: flex; align-items: center; justify-content: center; gap: 0.75rem; }
.btn { font-size: 12px; font-family: var(--font-mono); padding: 0.5rem 1rem; border-radius: 0.5rem; cursor: pointer; transition: all 0.15s ease; display: inline-flex; align-items: center; }
.btn--primary { background: var(--text-bright); color: var(--bg-base); border: 1px solid var(--text-bright); }
.btn--primary:hover { background: #fff; }
.btn--ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn--ghost:hover { color: var(--text-bright); border-color: var(--border-active); }

/* ==========================================================================
   Deployed document styles (Markdown & Mermaid)
   ========================================================================== */

/* Document body */
body.deploy-page {
    background-color: var(--bg-base);
    color: var(--text-bright);
    background-image:
        radial-gradient(circle at 50% 0%, rgba(255,79,25,0.05) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(0,230,118,0.02) 0%, transparent 50%);
    background-attachment: fixed;
}

/* --- Markdown content --- */
.md-content { max-width: 720px; margin: 0 auto; padding: 3rem 1.5rem 4rem; width: 100%; }
@media (max-width: 768px) { .md-content { padding: 2rem 1rem 3rem; max-width: 100%; } }
.md-content h1, .md-content h2, .md-content h3, .md-content h4,
.md-content h5, .md-content h6 { font-weight: 600; line-height: 1.25; color: var(--text-bright); }
.md-content h1 { font-size: 1.6rem; margin-top: 0.5rem; margin-bottom: 1.5rem; }
@media (max-width: 768px) { .md-content h1 { font-size: 1.35rem; } }
.md-content h2 { font-size: 1.25rem; margin-top: 2.5rem; margin-bottom: 0.75rem; }
@media (max-width: 768px) { .md-content h2 { font-size: 1.1rem; } }
.md-content h3 { font-size: 1.05rem; margin-top: 2rem; margin-bottom: 0.5rem; }
.md-content h4 { font-size: 1rem; margin-top: 1.5rem; margin-bottom: 0.5rem; }
.md-content h5 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted-2); }
.md-content h6 { font-size: 0.75rem; color: var(--text-muted-2); }
.md-content p { margin-bottom: 1rem; color: var(--text); line-height: 1.7; }
.md-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.md-content a:hover { color: var(--accent-hover); }
.md-content strong { font-weight: 600; color: var(--text-bright); }
.md-content em { font-style: italic; color: var(--text); }
.md-content del { text-decoration: line-through; color: var(--text-muted); }
.md-content code {
    font-family: var(--font-mono); font-size: 0.875em; background: var(--bg-surface);
    border: 1px solid var(--border); padding: 0.15em 0.4em; border-radius: 4px; color: var(--text-bright);
}
.md-content pre {
    position: relative;
    background: var(--bg-deep); border: 1px solid var(--border); border-radius: 6px;
    padding: 1rem 1.25rem; overflow-x: auto; margin-bottom: 1.25rem;
    font-size: 0.85rem; line-height: 1.6; -webkit-overflow-scrolling: touch;
}
@media (max-width: 768px) { .md-content pre { padding: 0.75rem 0.85rem; font-size: 0.78rem; } }
.md-content pre code { background: none; padding: 0; border: none; border-radius: 0; font-size: inherit; color: inherit; line-height: inherit; }
.md-content blockquote {
    margin: 1.5rem 0; padding: 0.75rem 1rem; border-left: 2px solid var(--border-active);
    color: var(--text-muted); background: rgba(255,255,255,0.015); border-radius: 0 4px 4px 0;
}
.md-content blockquote p { margin-bottom: 0.25rem; }
.md-content blockquote p:last-child { margin-bottom: 0; }
.md-content ul, .md-content ol { margin: 0.5rem 0 1rem 1.5rem; color: var(--text); }
.md-content li { margin-bottom: 0.3rem; }
.md-content li p { margin-bottom: 0.25rem; }
.md-content hr { border: none; height: 1px; background: var(--border); margin: 2.5rem 0; }
.md-content img { max-width: 100%; height: auto; border-radius: 4px; margin: 1rem 0; }
.md-content .table-wrapper {
    overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1rem 0 1.5rem;
    border: 1px solid var(--border); border-radius: 6px; background: var(--bg-surface);
}
@media (max-width: 768px) { .md-content .table-wrapper { border-radius: 4px; } }
.md-content table { width: 100%; border-collapse: collapse; font-size: 0.875rem; min-width: 400px; }
.md-content th, .md-content td { text-align: left; padding: 0.6rem 0.85rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.md-content thead tr:last-child th { border-bottom: 1px solid var(--border-active); }
.md-content th { font-weight: 600; color: var(--text-bright); background: var(--bg-deep); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }
.md-content tbody tr:last-child td { border-bottom: none; }
.md-content td { color: var(--text); }
.doc-header { margin-bottom: 1.5rem; }
.doc-header h1 { margin-top: 0; color: var(--text-bright); font-size: 1.8rem; }

/* Mermaid diagram tabs (shared by Markdown inline and standalone Mermaid pages) */
.md-content .mermaid-block, .mermaid-content .mermaid-block { border: 1px solid var(--border); border-radius: 6px; margin: 1.5rem 0; overflow: hidden; }
.mermaid-content .mermaid-block { margin: 0 0 1.5rem; }
.md-content .mermaid-tabs, .mermaid-content .mermaid-tabs { display: flex; border-bottom: 1px solid var(--border); background: var(--bg-deep); }
.md-content .mermaid-tab, .mermaid-content .mermaid-tab {
    padding: 0.5rem 1rem; font-size: 0.6875rem; font-weight: 500; text-transform: uppercase;
    letter-spacing: 0.06em; color: var(--text-muted-2); background: none; border: none;
    border-bottom: 2px solid transparent; cursor: pointer; font-family: var(--font-mono);
    transition: color 0.15s; outline: none;
}
.md-content .mermaid-tab:hover, .mermaid-content .mermaid-tab:hover { color: var(--text-bright); }
.md-content .mermaid-tab.active, .mermaid-content .mermaid-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.md-content .mermaid-panel, .mermaid-content .mermaid-panel { background: var(--bg-surface); padding: 1.5rem; display: flex; justify-content: center; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.md-content .mermaid-panel[data-panel="visual"], .mermaid-content .mermaid-panel[data-panel="visual"] {
    position: relative; overflow: hidden; display: block; padding: 0;
    background: #FFFFFF; height: 60vh; min-height: 280px;
    touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none;
    transition: position 0s, inset 0s;
}
.md-content .mermaid-panel[data-panel="visual"].panning, .mermaid-content .mermaid-panel[data-panel="visual"].panning { cursor: grabbing; }
.md-content .mermaid-panel[data-panel="visual"] pre.mermaid, .mermaid-content .mermaid-panel[data-panel="visual"] pre.mermaid { margin: 0; padding: 0; background: none; border: none; display: block; }
.md-content .mermaid-panel[data-panel="visual"] svg, .mermaid-content .mermaid-panel[data-panel="visual"] svg { display: block; position: absolute; top: 0; left: 0; max-width: none !important; transform-origin: 0 0; }
.md-content .mermaid-panel pre.mermaid, .mermaid-content .mermaid-panel pre.mermaid { margin: 0; background: none; border: none; padding: 0; font-family: inherit; color: inherit; border-radius: 0; }
.md-content .mermaid-panel pre.mermaid svg, .mermaid-content .mermaid-panel pre.mermaid svg { max-width: 100%; height: auto; }
.md-content .mermaid-raw, .mermaid-content .mermaid-raw {
    position: relative;
    margin: 0; background: var(--bg-deep); border: 1px solid var(--border); border-radius: 4px;
    padding: 1rem 1.25rem; overflow-x: auto; -webkit-overflow-scrolling: touch;
    font-family: var(--font-mono); font-size: 0.85rem; line-height: 1.6; color: var(--text); white-space: pre; width: 100%;
}
.md-content .mermaid-raw code, .mermaid-content .mermaid-raw code { background: none; border: none; padding: 0; font-size: inherit; color: inherit; }
@media (max-width: 768px) {
    .md-content .mermaid-block, .mermaid-content .mermaid-block { border-radius: 4px; }
    .md-content .mermaid-panel, .mermaid-content .mermaid-panel { padding: 1rem 0.5rem; }
    .md-content .mermaid-raw, .mermaid-content .mermaid-raw { padding: 0.75rem 0.85rem; font-size: 0.78rem; }
    .md-content .mermaid-tab, .mermaid-content .mermaid-tab { padding: 0.4rem 0.75rem; font-size: 0.625rem; }
}

/* --- Mermaid standalone page (container only — block rules shared above) --- */
.mermaid-content { max-width: 100%; margin: 0 auto; padding: 2rem 1rem 3rem; width: 100%; }
@media (min-width: 768px) { .mermaid-content { max-width: 960px; padding: 3rem 1.5rem 4rem; } }
.mermaid-content h1 { font-weight: 600; font-size: 1.6rem; line-height: 1.3; margin-bottom: 1.25rem; color: var(--text-bright); }
@media (max-width: 768px) { .mermaid-content h1 { font-size: 1.3rem; } }

/* Legacy standalone diagram styles (kept for previously deployed content) */
.diagram-container {
    position: relative; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 1.25rem;
    overflow: hidden; display: block; height: 65vh; min-height: 300px; background: #FFFFFF;
    touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none;
}
.diagram-container.panning { cursor: grabbing; }
.diagram-container pre.mermaid { margin: 0; padding: 0; background: none; border: none; display: block; }
.diagram-container svg { display: block; position: absolute; top: 0; left: 0; max-width: none !important; transform-origin: 0 0; }
.diagram-zoom {
    position: absolute; top: 0.6rem; right: 0.6rem; z-index: 5;
    display: flex; flex-direction: column; gap: 0.3rem;
    opacity: 0.85; transition: opacity 0.15s;
}
.diagram-container:hover .diagram-zoom { opacity: 1; }
.diagram-zoom button {
    width: 34px; height: 34px; padding: 0; border: 1px solid #D1D5DB;
    background: #FFFFFF; color: #1F2937; border-radius: 6px; cursor: pointer;
    font-size: 1.15rem; line-height: 1; font-weight: 500;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.diagram-zoom button:hover { background: #F3F4F6; }
.diagram-zoom button:active { background: #E5E7EB; }
.diagram-hint {
    position: absolute; left: 0.6rem; bottom: 0.5rem; z-index: 5;
    font-size: 0.7rem; color: #6B7280; pointer-events: none;
    font-family: var(--font-mono);
}

/* Fullscreen diagram panel */
.mermaid-panel[data-panel="visual"].is-fullscreen,
.diagram-container.is-fullscreen {
    position: fixed !important; inset: 0 !important; z-index: 9999;
    width: 100vw !important; height: 100dvh !important;
    border-radius: 0; margin: 0;
    background: #FFFFFF;
}
/* Let the mermaid block container overflow so the fixed panel breaks out */
.mermaid-block:has(.is-fullscreen) { overflow: visible; }
.source-label {
    font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted-2);
    margin-bottom: 0.5rem; font-weight: 500; font-family: var(--font-mono);
}
.source-block {
    background: var(--bg-deep); border: 1px solid var(--border); border-radius: 6px;
    padding: 1rem 1.25rem; overflow-x: auto; -webkit-overflow-scrolling: touch;
    font-size: 0.85rem; line-height: 1.6; font-family: var(--font-mono);
    color: var(--text); white-space: pre;
}
@media (max-width: 768px) { .source-block { padding: 0.75rem 0.85rem; font-size: 0.78rem; } }
