/* =========================================================
   Markdown Live Editor — styles.css
   Free Online Markdown Editor with Live Preview
   ========================================================= */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0a0b;
  --bg-subtle: #111113;
  --surface: #18181b;
  --surface-hover: #1f1f23;
  --surface-active: #27272b;
  --border: #27272b;
  --border-subtle: #1f1f23;
  --text: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-subtle: rgba(99, 102, 241, 0.12);
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.5);
  --font-sans: 'Inter', ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
  --topbar-h: 56px;
  --toolbar-h: 40px;
  --tab-bar-h: 34px;
  --footer-h: 40px;
  --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Component backgrounds (dark defaults) */
  --topbar-bg: rgba(10, 10, 11, 0.85);
  --toolbar-bg: rgba(17, 17, 19, 0.9);
  --footer-bg: rgba(10, 10, 11, 0.9);
  --overlay-bg: rgba(10, 10, 11, 0.9);
}

/* --- Light Theme --- */
[data-theme="light"] {
  --bg: #f8f9fb;
  --bg-subtle: #f0f1f3;
  --surface: #ffffff;
  --surface-hover: #f3f4f6;
  --surface-active: #e5e7eb;
  --border: #d1d5db;
  --border-subtle: #e5e7eb;
  --text: #1a1a2e;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-subtle: rgba(99, 102, 241, 0.08);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.1);

  --topbar-bg: rgba(255, 255, 255, 0.85);
  --toolbar-bg: rgba(248, 249, 251, 0.9);
  --footer-bg: rgba(248, 249, 251, 0.95);
  --overlay-bg: rgba(255, 255, 255, 0.92);
}

[data-theme="light"] .bg-orb { opacity: 0.06; }
[data-theme="light"] .bg-grain { opacity: 0.015; }

[data-theme="light"] .brand-logo svg rect { fill: #6366f1; }
[data-theme="light"] .brand-logo svg path { fill: #fff; }

[data-theme="light"] .markdown-body code {
  color: #c026d3;
}

[data-theme="light"] .markdown-body tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .markdown-body tbody tr:hover {
  background: rgba(99, 102, 241, 0.06);
}

/* --- Prism.js theme-aware overrides --- */
.markdown-body pre[class*="language-"],
.markdown-body code[class*="language-"] {
  background: var(--surface) !important;
  border-color: var(--border);
}

[data-theme="light"] .markdown-body pre[class*="language-"],
[data-theme="light"] .markdown-body pre {
  background: #f6f8fa !important;
}

[data-theme="light"] .markdown-body pre code {
  color: #24292e;
}

/* Light-mode Prism token colors (GitHub-style) */
[data-theme="light"] .token.comment,
[data-theme="light"] .token.prolog,
[data-theme="light"] .token.doctype,
[data-theme="light"] .token.cdata { color: #6a737d; }

[data-theme="light"] .token.punctuation { color: #24292e; }

[data-theme="light"] .token.property,
[data-theme="light"] .token.tag,
[data-theme="light"] .token.boolean,
[data-theme="light"] .token.number,
[data-theme="light"] .token.constant,
[data-theme="light"] .token.symbol,
[data-theme="light"] .token.deleted { color: #005cc5; }

[data-theme="light"] .token.selector,
[data-theme="light"] .token.attr-name,
[data-theme="light"] .token.string,
[data-theme="light"] .token.char,
[data-theme="light"] .token.builtin,
[data-theme="light"] .token.inserted { color: #22863a; }

[data-theme="light"] .token.operator,
[data-theme="light"] .token.entity,
[data-theme="light"] .token.url { color: #d73a49; }

[data-theme="light"] .token.atrule,
[data-theme="light"] .token.attr-value,
[data-theme="light"] .token.keyword { color: #d73a49; }

[data-theme="light"] .token.function,
[data-theme="light"] .token.class-name { color: #6f42c1; }

[data-theme="light"] .token.regex,
[data-theme="light"] .token.important,
[data-theme="light"] .token.variable { color: #e36209; }

/* Theme toggle button */
.theme-toggle {
  position: relative;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.theme-toggle:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon { position: absolute; transition: opacity var(--transition), transform var(--transition); }
.theme-toggle .icon-sun { opacity: 0; transform: rotate(-90deg) scale(0.5); }
.theme-toggle .icon-moon { opacity: 1; transform: rotate(0deg) scale(1); }

[data-theme="light"] .theme-toggle .icon-sun { opacity: 1; transform: rotate(0deg) scale(1); }
[data-theme="light"] .theme-toggle .icon-moon { opacity: 0; transform: rotate(90deg) scale(0.5); }

html {
  height: 100%;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  height: 100%;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  display: grid;
  grid-template-rows: var(--topbar-h) var(--toolbar-h) var(--tab-bar-h) 1fr var(--footer-h);
  overflow: hidden;
}

/* --- Background Effects --- */
.bg-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

.bg-orb {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(100px);
  opacity: 0.15;
}

.orb-1 {
  width: 600px; height: 600px;
  top: -200px; right: -100px;
  background: radial-gradient(circle, #6366f1, transparent 70%);
}

.orb-2 {
  width: 500px; height: 500px;
  bottom: -150px; left: -100px;
  background: radial-gradient(circle, #8b5cf6, transparent 70%);
}

.orb-3 {
  width: 400px; height: 400px;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, #3b82f6, transparent 70%);
  opacity: 0.06;
}

/* --- Topbar / Header --- */
.topbar {
  position: relative;
  z-index: 20;
  height: var(--topbar-h);
  background: var(--topbar-bg);
  backdrop-filter: blur(16px) saturate(1.5);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-logo svg {
  display: block;
  border-radius: 6px;
}

.brand-text h1 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  white-space: nowrap;
  padding-top: 2px;
}

.brand-tagline {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.2;
  white-space: nowrap;
}

.actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.actions-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 4px;
}

/* --- Dropdown Menus --- */
.dropdown {
  position: relative;
}

.dropdown-trigger {
  gap: 4px;
}

.dropdown-chevron {
  transition: transform var(--transition);
  opacity: 0.5;
  flex-shrink: 0;
}

.dropdown.open .dropdown-chevron {
  transform: rotate(180deg);
  opacity: 1;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 50;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 4px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
}

.dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu--right {
  left: auto;
  right: 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-align: left;
  line-height: 1;
}

.dropdown-item svg {
  flex-shrink: 0;
}

.dropdown-item:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.dropdown-item--danger:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
}

.dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 0;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1;
}

.btn svg {
  flex-shrink: 0;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.mobile-only {
  display: none;
}

/* --- Toolbar --- */
.toolbar {
  position: relative;
  z-index: 15;
  height: var(--toolbar-h);
  background: var(--toolbar-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.toolbar::-webkit-scrollbar { display: none; }

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 2px;
}

.toolbar-right {
  gap: 6px;
  flex-shrink: 0;
}

.toolbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 28px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.toolbar-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.toolbar-btn:active {
  background: var(--surface-active);
}

.toolbar-sep {
  width: 1px;
  height: 18px;
  background: var(--border-subtle);
  margin: 0 4px;
  flex-shrink: 0;
}

.toolbar-info {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* --- Workspace (Editor + Preview) --- */
.workspace {
  position: relative;
  z-index: 10;
  display: flex;
  overflow: hidden;
  min-height: 0;
}

.pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.pane-editor {
  flex: 1 1 50%;
  border-right: 1px solid var(--border);
}

.pane-preview {
  flex: 1 1 50%;
}

.pane-head {
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.pane-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pane-tab.active {
  color: var(--text);
}

.pane-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

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

/* --- Editor --- */
.editor-wrap {
  flex: 1;
  overflow: hidden;
  position: relative;
}

#editor {
  width: 100%;
  height: 100%;
  padding: 16px;
  border: none;
  outline: none;
  resize: none;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.87rem;
  line-height: 1.7;
  tab-size: 2;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-active) transparent;
}

#editor::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

#editor::-webkit-scrollbar { width: 6px; }
#editor::-webkit-scrollbar-track { background: transparent; }
#editor::-webkit-scrollbar-thumb { background: var(--surface-active); border-radius: 3px; }

/* --- Pane Divider (Resizable) --- */
.pane-divider {
  width: 5px;
  cursor: col-resize;
  background: var(--border);
  position: relative;
  flex-shrink: 0;
  z-index: 11;
  transition: background var(--transition);
}

.pane-divider:hover,
.pane-divider.active {
  background: var(--accent);
}

.pane-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 3px;
  height: 32px;
  border-radius: 2px;
  background: var(--text-muted);
  opacity: 0;
  transition: opacity var(--transition);
}

.pane-divider:hover::after,
.pane-divider.active::after {
  opacity: 0.5;
}

/* --- Preview --- */
.markdown-body {
  flex: 1;
  padding: 24px 28px;
  overflow-y: auto;
  background: var(--bg);
  scrollbar-width: thin;
  scrollbar-color: var(--surface-active) transparent;
  line-height: 1.7;
  font-size: 0.93rem;
  color: var(--text);
}

.markdown-body::-webkit-scrollbar { width: 6px; }
.markdown-body::-webkit-scrollbar-track { background: transparent; }
.markdown-body::-webkit-scrollbar-thumb { background: var(--surface-active); border-radius: 3px; }

/* Markdown rendered content */
.markdown-body h1, .markdown-body h2, .markdown-body h3,
.markdown-body h4, .markdown-body h5, .markdown-body h6 {
  font-weight: 700;
  line-height: 1.3;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  color: var(--text);
}

.markdown-body h1 { font-size: 2em; letter-spacing: -0.03em; border-bottom: 1px solid var(--border); padding-bottom: 0.3em; }
.markdown-body h2 { font-size: 1.5em; letter-spacing: -0.02em; border-bottom: 1px solid var(--border-subtle); padding-bottom: 0.25em; }
.markdown-body h3 { font-size: 1.25em; }
.markdown-body h4 { font-size: 1.1em; }
.markdown-body h5 { font-size: 1em; }
.markdown-body h6 { font-size: 0.9em; color: var(--text-secondary); }

.markdown-body h1:first-child,
.markdown-body h2:first-child,
.markdown-body h3:first-child {
  margin-top: 0;
}

.markdown-body p {
  margin-bottom: 1em;
}

.markdown-body a {
  color: var(--accent-hover);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition);
}

.markdown-body a:hover {
  border-bottom-color: var(--accent-hover);
}

.markdown-body strong {
  font-weight: 700;
  color: var(--text);
}

.markdown-body em {
  font-style: italic;
}

.markdown-body del {
  color: var(--text-muted);
}

.markdown-body code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 0.15em 0.4em;
  color: #e879f9;
}

.markdown-body pre {
  margin-bottom: 1em;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface) !important;
}

.markdown-body pre code {
  display: block;
  padding: 16px;
  overflow-x: auto;
  background: transparent !important;
  border: none;
  border-radius: 0;
  font-size: 0.85em;
  line-height: 1.6;
  color: var(--text);
}

.markdown-body blockquote {
  margin: 0 0 1em;
  padding: 0.5em 1em;
  border-left: 3px solid var(--accent);
  background: var(--accent-subtle);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
}

.markdown-body blockquote p:last-child {
  margin-bottom: 0;
}

.markdown-body ul, .markdown-body ol {
  margin-bottom: 1em;
  padding-left: 1.8em;
}

.markdown-body li {
  margin-bottom: 0.3em;
}

.markdown-body li > ul, .markdown-body li > ol {
  margin-top: 0.3em;
  margin-bottom: 0;
}

.markdown-body hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 1.5em 0;
}

.markdown-body img {
  max-width: 100%;
  border-radius: var(--radius);
  margin: 0.5em 0;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1em;
  font-size: 0.9em;
}

.markdown-body thead th {
  background: var(--surface);
  font-weight: 600;
  text-align: left;
  border-bottom: 2px solid var(--border);
}

.markdown-body th, .markdown-body td {
  padding: 8px 12px;
  border: 1px solid var(--border-subtle);
}

.markdown-body tbody tr:nth-child(even) {
  background: rgba(255,255,255,0.02);
}

.markdown-body tbody tr:hover {
  background: rgba(99, 102, 241, 0.04);
}

/* Task list checkboxes */
.markdown-body input[type="checkbox"] {
  margin-right: 6px;
  accent-color: var(--accent);
}

.markdown-body .task-list-item {
  list-style: none;
  margin-left: -1.3em;
}

/* --- Drop Overlay --- */
.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--overlay-bg);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.drop-overlay-content {
  text-align: center;
  color: var(--accent-hover);
  animation: drop-pulse 1.5s ease-in-out infinite;
}

.drop-overlay-content svg {
  margin-bottom: 12px;
}

.drop-overlay-content p {
  font-size: 1.1rem;
  font-weight: 600;
}

@keyframes drop-pulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

/* --- Toast --- */
.toast {
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 200;
  padding: 10px 20px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: opacity 200ms ease, transform 200ms ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast[hidden] {
  display: none;
}

.toast.toast-success {
  border-color: var(--success);
  background: rgba(34, 197, 94, 0.1);
}

.toast.toast-error {
  border-color: var(--error);
  background: rgba(239, 68, 68, 0.1);
}

.toast.toast-warning {
  border-color: var(--warning);
  background: rgba(245, 158, 11, 0.1);
}

/* --- Ad Banner (Header) --- */
.ad-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background: var(--accent-subtle);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 99px;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
}

.ad-banner:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.3);
}

.ad-banner-text {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.ad-banner-text strong {
  color: var(--text);
}

.ad-banner-cta {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--accent-hover);
  background: rgba(99, 102, 241, 0.15);
  padding: 2px 8px;
  border-radius: 99px;
  white-space: nowrap;
}

.ad-banner:hover .ad-banner-cta {
  background: rgba(99, 102, 241, 0.25);
}

@media (max-width: 768px) {
  .ad-banner { display: none; }
}

/* --- Footer --- */
.footer {
  position: relative;
  z-index: 10;
  height: var(--footer-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--footer-bg);
  border-top: 1px solid var(--border-subtle);
}

.footer p {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-align: center;
}

.footer a {
  color: var(--text-secondary);
  text-decoration: none;
}

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

/* --- Responsive --- */
@media (max-width: 768px) {
  .brand-tagline { display: none; }

  .actions .btn span { display: none; }
  .actions .btn { padding: 6px 8px; }
  .actions-divider { display: none; }

  .mobile-only { display: inline-flex; }

  .actions {
    display: none;
    position: absolute;
    top: var(--topbar-h);
    right: 0;
    left: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 8px 12px;
    flex-wrap: wrap;
    z-index: 30;
    box-shadow: var(--shadow-lg);
  }

  .actions.open {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .actions.open .btn span { display: inline; }
  .actions.open .actions-divider { display: block; width: 100%; height: 1px; margin: 4px 0; }

  /* Dropdowns become inline accordions in mobile drawer */
  .actions.open .dropdown {
    width: 100%;
  }

  .actions.open .dropdown-trigger {
    width: 100%;
    justify-content: flex-start;
    padding: 8px 10px;
  }

  .actions.open .dropdown-trigger span { display: inline; }

  .actions.open .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    background: transparent;
    padding: 0 0 0 12px;
    min-width: 0;
    display: none;
  }

  .actions.open .dropdown.open .dropdown-menu {
    display: block;
  }

  .workspace {
    flex-direction: column;
  }

  .pane-editor {
    border-right: none;
    border-bottom: 1px solid var(--border);
    flex: 1 1 50%;
  }

  .pane-preview {
    flex: 1 1 50%;
  }

  .pane-divider {
    width: 100%;
    height: 5px;
    cursor: row-resize;
  }

  .toolbar-btn {
    width: 28px;
    height: 26px;
  }
}

@media (max-width: 480px) {
  .brand-text h1 { font-size: 0.9rem; }

  .toolbar { padding: 0 8px; }

  .markdown-body { padding: 16px; }

  #editor { padding: 12px; font-size: 0.82rem; }
}

/* --- Selection --- */
::selection {
  background: rgba(99, 102, 241, 0.3);
  color: var(--text);
}

/* --- Focus --- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* --- Scrollbar global --- */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--surface-active) transparent;
}

/* --- Mermaid diagrams --- */
.mermaid-container {
  margin-bottom: 1em;
  text-align: center;
  overflow-x: auto;
}

.mermaid-container svg {
  max-width: 100%;
  height: auto;
}

/* --- Find & Replace Bar --- */
.find-bar {
  position: absolute;
  top: calc(var(--topbar-h) + var(--toolbar-h));
  right: 16px;
  z-index: 50;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 320px;
}

.find-bar[hidden] { display: none; }

.find-bar-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.find-bar input {
  flex: 1;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  outline: none;
}

.find-bar input:focus { border-color: var(--accent); }

.find-count {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 32px;
  text-align: center;
}

.find-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 4px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-sans);
}

.find-nav:hover { background: var(--surface-hover); color: var(--text); }

/* --- Side Panels (Cheat Sheet, TOC, History) --- */
.side-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 300px;
  z-index: 60;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 200ms ease;
}

.side-panel:not([hidden]) { transform: translateX(0); }
.side-panel[hidden] { display: flex; pointer-events: none; }

.side-panel-left {
  left: 0;
  right: auto;
  border-left: none;
  border-right: 1px solid var(--border);
  transform: translateX(-100%);
}

.side-panel-left:not([hidden]) { transform: translateX(0); }

.side-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.side-panel-header h3 {
  font-size: 0.85rem;
  font-weight: 600;
}

.side-panel-close {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.side-panel-close:hover { background: var(--surface-hover); color: var(--text); }

.side-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-active) transparent;
}

/* Cheat Sheet Table */
.cheatsheet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.cheatsheet-table td {
  padding: 4px 6px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.cheatsheet-table td:first-child {
  white-space: nowrap;
  color: var(--text-muted);
  width: 45%;
}

.cheatsheet-table code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--accent-hover);
}

/* TOC List */
.toc-list {
  list-style: none;
  padding: 0;
}

.toc-list li {
  margin-bottom: 2px;
}

.toc-list a {
  display: block;
  padding: 4px 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 4px;
  transition: all var(--transition);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.toc-list .toc-h2 { padding-left: 20px; }
.toc-list .toc-h3 { padding-left: 32px; font-size: 0.75rem; }
.toc-list .toc-h4 { padding-left: 44px; font-size: 0.72rem; }

.toc-empty, .history-empty {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  padding: 20px 10px;
}

/* History List */
.history-list {
  list-style: none;
  padding: 0;
}

.history-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  gap: 6px;
}

.history-list .history-info {
  min-width: 0;
  flex: 1;
}

.history-list .history-time {
  font-weight: 500;
  color: var(--text);
  display: block;
}

.history-list .history-preview {
  color: var(--text-muted);
  font-size: 0.72rem;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-list .history-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.history-list .history-actions button {
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.7rem;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-sans);
}

.history-list .history-actions button:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.history-list .history-actions .history-delete:hover {
  border-color: var(--error);
  color: var(--error);
}

/* --- Guide Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

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

.modal-container {
  width: 100%;
  max-width: 720px;
  max-height: 85vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.modal-header h2 {
  font-size: 1rem;
  font-weight: 600;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* --- URL to Markdown Modal --- */
.url-to-md-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.url-to-md-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.url-to-md-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  outline: none;
  transition: border-color var(--transition);
}

.url-to-md-input:focus {
  border-color: var(--accent);
}

.url-to-md-input::placeholder {
  color: var(--text-muted);
}

.url-to-md-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  margin-bottom: 12px;
}

.url-to-md-option input[type="checkbox"] {
  accent-color: var(--accent);
}

.url-to-md-status {
  font-size: 0.78rem;
  min-height: 1.2em;
}

.url-to-md-loading {
  color: var(--accent);
}

.url-to-md-loading::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid var(--accent);
  border-top-color: transparent;
  border-radius: 50%;
  animation: url-to-md-spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

.url-to-md-error {
  color: var(--error);
}

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

/* --- Zen Mode --- */
body.zen-mode .topbar,
body.zen-mode .toolbar,
body.zen-mode .tab-bar,
body.zen-mode .footer,
body.zen-mode .pane-preview,
body.zen-mode .pane-divider,
body.zen-mode .bg-orb,
body.zen-mode .bg-grain {
  display: none !important;
}

body.zen-mode {
  grid-template-rows: 1fr;
}

body.zen-mode .workspace {
  grid-row: 1;
}

body.zen-mode .pane-editor {
  flex: 1 1 100%;
  border-right: none;
}

body.zen-mode .pane-head {
  background: var(--bg);
  border-bottom-color: var(--border-subtle);
}

body.zen-mode #editor {
  font-size: 1rem;
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 32px;
}

.zen-exit-hint {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  font-size: 0.72rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 4px 14px;
  opacity: 0;
  transition: opacity 300ms ease;
  pointer-events: none;
}

body.zen-mode .zen-exit-hint { opacity: 1; }

@media (max-width: 768px) {
  .side-panel { width: 100%; }
  .find-bar { right: 8px; left: 8px; min-width: auto; }
  .modal-container { max-width: 100%; max-height: 90vh; }
  body.zen-mode #editor { padding: 16px; }
}

/* --- Print --- */
@media print {
  .topbar, .toolbar, .footer, .pane-editor, .pane-divider,
  .bg-grain, .bg-orb, .drop-overlay, .toast { display: none !important; }

  body {
    display: block;
    background: #fff;
    color: #000;
  }

  .workspace { display: block; }
  .pane-preview { border: none; }

  .markdown-body {
    padding: 0;
    background: #fff;
    color: #000;
    overflow: visible;
  }

  .markdown-body pre { border-color: #ccc; }
  .markdown-body code { background: #f4f4f4; color: #333; }
  .markdown-body blockquote { border-left-color: #999; background: #f9f9f9; }
  .markdown-body a { color: #0066cc; }
}

/* =========================================================
   Tab Bar
   ========================================================= */
.tab-bar {
  position: relative;
  z-index: 14;
  height: var(--tab-bar-h);
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: stretch;
  padding: 0 4px;
  gap: 2px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  flex-shrink: 0;
}

.tab-bar::-webkit-scrollbar { display: none; }

.tab-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  min-width: 0;
  max-width: 160px;
  font-size: 0.73rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.tab-item:hover {
  color: var(--text-secondary);
  background: var(--surface-hover);
}

.tab-item.active {
  color: var(--text);
  border-bottom-color: var(--accent);
  background: var(--bg);
}

.tab-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.tab-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: none;
  border-radius: 3px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  opacity: 0;
  transition: all var(--transition);
  flex-shrink: 0;
  line-height: 1;
}

.tab-item:hover .tab-close,
.tab-item.active .tab-close {
  opacity: 1;
}

.tab-close:hover {
  background: var(--surface-active);
  color: var(--error);
}

.tab-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 100%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}

.tab-add:hover {
  color: var(--text);
  background: var(--surface-hover);
}

/* =========================================================
   Presentation Mode — Bespoke Slide Deck
   ========================================================= */

/* Overlay & Backdrop */
.pres-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  background: #08080a;
}
.pres-overlay[hidden] { display: none; }

.pres-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(99, 102, 241, 0.08) 0%, transparent 70%),
    radial-gradient(ellipse 50% 80% at 80% 80%, rgba(139, 92, 246, 0.06) 0%, transparent 60%),
    #08080a;
  pointer-events: none;
}
[data-theme="light"] .pres-backdrop {
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(99, 102, 241, 0.06) 0%, transparent 70%),
    radial-gradient(ellipse 50% 80% at 80% 80%, rgba(139, 92, 246, 0.04) 0%, transparent 60%),
    #f0f1f5;
}

/* Slide area — clickable to advance */
.pres-slide-area {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 60px;
  overflow: hidden;
  cursor: pointer;
}

/* Floating card */
.pres-card {
  width: 100%;
  max-width: 960px;
  max-height: 100%;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.25),
    0 1px 4px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  padding: 48px 56px;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-active) transparent;
}
.pres-card::-webkit-scrollbar { width: 5px; }
.pres-card::-webkit-scrollbar-thumb { background: var(--surface-active); border-radius: 3px; }
.pres-card::-webkit-scrollbar-track { background: transparent; }

[data-theme="light"] .pres-card {
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.10),
    0 1px 4px rgba(0, 0, 0, 0.06);
}

/* Slide inner — rendered content */
.pres-slide-inner {
  font-size: 1.35rem;
  line-height: 1.85;
  color: var(--text);
  font-family: var(--font-sans);
}

/* Slide typography overrides */
.pres-slide-inner h1 {
  font-size: 2.8em;
  letter-spacing: -0.04em;
  font-weight: 800;
  margin-top: 0;
  margin-bottom: 0.4em;
  line-height: 1.15;
  background: linear-gradient(135deg, var(--text), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.pres-slide-inner h2 {
  font-size: 2em;
  letter-spacing: -0.03em;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 0.4em;
  line-height: 1.2;
  border-bottom: none;
  padding-bottom: 0;
  color: var(--text);
}
.pres-slide-inner h3 {
  font-size: 1.5em;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 0.4em;
  color: var(--text);
}
.pres-slide-inner h4 {
  font-size: 1.2em;
  margin-top: 0;
  color: var(--text-secondary);
}
.pres-slide-inner h1:first-child,
.pres-slide-inner h2:first-child,
.pres-slide-inner h3:first-child {
  margin-top: 0;
}

.pres-slide-inner p {
  margin-bottom: 0.9em;
  color: var(--text-secondary);
}
.pres-slide-inner strong { color: var(--text); }
.pres-slide-inner a { color: var(--accent-hover); }

.pres-slide-inner ul, .pres-slide-inner ol {
  margin-bottom: 1em;
  padding-left: 1.6em;
}
.pres-slide-inner li {
  margin-bottom: 0.5em;
  color: var(--text-secondary);
}

.pres-slide-inner code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  padding: 0.15em 0.45em;
  color: #e879f9;
}
[data-theme="light"] .pres-slide-inner code { color: #c026d3; }

.pres-slide-inner pre {
  margin-bottom: 1em;
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--bg) !important;
}
.pres-slide-inner pre code {
  display: block;
  padding: 20px 24px;
  background: transparent !important;
  border: none;
  border-radius: 0;
  font-size: 0.82em;
  line-height: 1.65;
  color: var(--text);
  overflow-x: auto;
}

.pres-slide-inner blockquote {
  margin: 0 0 1em;
  padding: 0.6em 1.2em;
  border-left: 3px solid var(--accent);
  background: var(--accent-subtle);
  border-radius: 0 8px 8px 0;
  color: var(--text-secondary);
  font-style: italic;
}
.pres-slide-inner blockquote p:last-child { margin-bottom: 0; }

.pres-slide-inner img {
  max-width: 100%;
  border-radius: 12px;
  margin: 0.5em 0;
}

.pres-slide-inner table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1em;
  font-size: 0.9em;
}
.pres-slide-inner th, .pres-slide-inner td {
  padding: 10px 14px;
  border: 1px solid var(--border-subtle);
  text-align: left;
}
.pres-slide-inner thead th {
  background: var(--bg);
  font-weight: 600;
  border-bottom: 2px solid var(--border);
}

.pres-slide-inner hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 1.5em 0;
}

/* ---- Slide Transitions ---- */
.pres-slide-inner.slide-in-right {
  animation: presSlideRight 320ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.pres-slide-inner.slide-in-left {
  animation: presSlideLeft 320ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.pres-slide-inner.slide-in-up {
  animation: presSlideUp 400ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes presSlideRight {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes presSlideLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes presSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- Chrome: Progress + Controls ---- */
.pres-chrome {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}

.pres-progress {
  height: 3px;
  background: var(--border-subtle);
  width: 100%;
}
.pres-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #818cf8);
  width: 0%;
  transition: width 350ms cubic-bezier(0.22, 1, 0.36, 1);
  border-radius: 0 2px 2px 0;
}

.pres-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: rgba(10, 10, 11, 0.6);
  backdrop-filter: blur(12px);
}
[data-theme="light"] .pres-controls {
  background: rgba(248, 249, 251, 0.8);
}

.pres-controls-left,
.pres-controls-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pres-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.pres-btn:hover:not(:disabled) {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--text-muted);
}
.pres-btn:disabled {
  opacity: 0.3;
  cursor: default;
}
.pres-btn-exit:hover {
  border-color: var(--error);
  color: var(--error);
  background: rgba(239, 68, 68, 0.08);
}

.pres-counter {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  min-width: 52px;
  text-align: center;
  letter-spacing: 0.02em;
}

.pres-hint {
  font-size: 0.68rem;
  color: var(--text-muted);
  opacity: 0.6;
  letter-spacing: 0.02em;
}

/* ---- Pres-active: hide everything else ---- */
body.pres-active .topbar,
body.pres-active .toolbar,
body.pres-active .tab-bar,
body.pres-active .workspace,
body.pres-active .footer,
body.pres-active .bg-orb,
body.pres-active .bg-grain,
body.pres-active .zen-exit-hint,
body.pres-active .find-bar,
body.pres-active .side-panel,
body.pres-active .toast {
  display: none !important;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .pres-slide-area { padding: 20px 16px; }
  .pres-card { padding: 28px 24px; border-radius: 12px; }
  .pres-slide-inner { font-size: 1.05rem; }
  .pres-slide-inner h1 { font-size: 2em; }
  .pres-slide-inner h2 { font-size: 1.5em; }
  .pres-hint { display: none; }
  .pres-controls { padding: 8px 12px; }
}
@media (max-width: 480px) {
  .pres-slide-area { padding: 12px 8px; }
  .pres-card { padding: 20px 16px; border-radius: 10px; }
  .pres-slide-inner { font-size: 0.95rem; }
}

/* =========================================================
   Keybinding Mode Indicator
   ========================================================= */
#keymode-indicator {
  font-size: 0.7rem;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--accent);
  letter-spacing: 0.05em;
  padding: 0 8px;
}

/* =========================================================
   Collaborative Editing Panel
   ========================================================= */
.collab-section {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.collab-section:last-child {
  border-bottom: none;
}

.collab-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.collab-status {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 2px 10px;
  border-radius: 99px;
  background: var(--surface-hover);
}

.collab-status.connected {
  color: var(--success);
  background: rgba(34, 197, 94, 0.1);
}

.collab-join-row {
  display: flex;
  gap: 6px;
}

.collab-input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  outline: none;
}

.collab-input:focus { border-color: var(--accent); }

.collab-room-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.collab-room-code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  background: var(--bg);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  flex: 1;
}

.collab-peers {
  font-size: 0.75rem;
  color: var(--text-muted);
}
