:root,
[data-theme="light"] {
  color-scheme: light;
  --bg-canvas: #f5f5f7;
  --bg-surface: #ffffff;
  --bg-elevated: rgba(255, 255, 255, 0.82);
  --bg-sidebar: #f2f2f7;
  --bg-hover: rgba(0, 0, 0, 0.045);
  --bg-selected: rgba(0, 122, 255, 0.12);
  --bg-code: #ffffff;
  --bg-gutter: #fafafa;
  --bg-devtools: #f8f8fa;
  --bg-devtools-overview: #f0f0f5;
  --border-hairline: rgba(0, 0, 0, 0.09);
  --border-strong: rgba(0, 0, 0, 0.16);
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-muted: #86868b;
  --accent: #007aff;
  --accent-hover: #0066d6;
  --accent-soft: rgba(0, 122, 255, 0.12);
  --green: #28cd41;
  --green-soft: rgba(52, 199, 89, 0.15);
  --red: #ff3b30;
  --red-soft: rgba(255, 59, 48, 0.14);
  --purple: #af52de;
  --orange: #ff9500;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.10), 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-cursor: 0 6px 18px rgba(0, 0, 0, 0.18);
  --sb-thumb: rgba(0, 0, 0, 0.20);
  --sb-thumb-hover: rgba(0, 0, 0, 0.36);

  /* Syntax Tokens (Light) */
  --tok-kw: #ad3da4;
  --tok-type: #0b4f79;
  --tok-str: #c41a16;
  --tok-num: #1c00cf;
  --tok-comment: #707f8c;
  --tok-fn: #326d74;
  --tok-attr: #836c28;
  --tok-tag: #0b4f79;
  --tok-op: #5c6670;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg-canvas: #0d0d10;
  --bg-surface: #16161a;
  --bg-elevated: rgba(28, 28, 32, 0.78);
  --bg-sidebar: #141418;
  --bg-hover: rgba(255, 255, 255, 0.06);
  --bg-selected: rgba(10, 132, 255, 0.20);
  --bg-code: #121216;
  --bg-gutter: #15151a;
  --bg-devtools: #18181c;
  --bg-devtools-overview: #1c1c21;
  --border-hairline: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text-primary: #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-muted: #6e6e73;
  --accent: #0a84ff;
  --accent-hover: #3399ff;
  --accent-soft: rgba(10, 132, 255, 0.18);
  --green: #32d74b;
  --green-soft: rgba(50, 215, 75, 0.14);
  --red: #ff453a;
  --red-soft: rgba(255, 69, 58, 0.14);
  --purple: #bf5af2;
  --orange: #ff9f0a;
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55), 0 1px 0 rgba(255, 255, 255, 0.05) inset;
  --shadow-cursor: 0 8px 22px rgba(0, 0, 0, 0.45);
  --sb-thumb: rgba(255, 255, 255, 0.18);
  --sb-thumb-hover: rgba(255, 255, 255, 0.34);

  /* Syntax Tokens (Dark - Xcode style) */
  --tok-kw: #ff7ab2;
  --tok-type: #6bdfff;
  --tok-str: #ff8170;
  --tok-num: #d9c97c;
  --tok-comment: #7f8c98;
  --tok-fn: #66d9ef;
  --tok-attr: #dabaff;
  --tok-tag: #5dd8ff;
  --tok-op: #9ea7b3;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* macOS Sequoia-style floating pill scrollbars */
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track,
*::-webkit-scrollbar-corner {
  background: transparent;
}

*::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

*::-webkit-scrollbar-thumb {
  background: var(--sb-thumb);
  border-radius: 9999px;
  border: 2.5px solid transparent;
  background-clip: content-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--sb-thumb-hover);
  border: 2px solid transparent;
  background-clip: content-box;
}

@supports not selector(::-webkit-scrollbar) {
  * {
    scrollbar-width: thin;
    scrollbar-color: var(--sb-thumb) transparent;
  }
}

html, body, #app {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: transparent;
}

.mono {
  font-family: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

/* Boot Screen */
.boot-screen {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.boot-spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2.5px solid var(--border-strong);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

.boot-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.boot-error {
  padding: 14px 20px;
  border-radius: 12px;
  background: var(--red-soft);
  color: var(--red);
  border: 1px solid var(--red);
}

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

/* ==================== LANDING SCREEN ==================== */
.landing {
  position: relative;
  height: 100%;
  width: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background:
    radial-gradient(900px 420px at 50% 10%, rgba(0, 122, 255, 0.12), transparent 65%),
    radial-gradient(600px 360px at 80% 80%, rgba(175, 82, 222, 0.08), transparent 65%),
    var(--bg-canvas);
}

.landing-top-actions {
  position: fixed;
  top: 18px;
  right: 22px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 10;
}

.landing-card {
  width: 100%;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 22px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 14px 6px 10px;
  border-radius: 9999px;
  background: var(--bg-elevated);
  backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.brand-dot {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: linear-gradient(135deg, #007aff, #5856d6);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.landing-title {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--text-primary);
}

.landing-subtitle {
  max-width: 520px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.repo-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 7px 7px 18px;
  border-radius: 16px;
  background: var(--bg-elevated);
  backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.search-pill:focus-within {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg), 0 0 0 3.5px var(--accent-soft);
}

.search-pill input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14.5px;
  color: var(--text-primary);
}

.search-pill input::placeholder {
  color: var(--text-muted);
}

.btn-primary {
  padding: 10px 20px;
  border-radius: 11px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 13.5px;
  transition: background 150ms ease, transform 120ms ease;
  white-space: nowrap;
}

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

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 9999px;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 140ms ease;
}

.btn-pill:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: var(--bg-hover);
}

.btn-pill.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(0, 122, 255, 0.35);
}

.quick-picks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.quick-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-right: 4px;
}

.advanced-toggle {
  font-size: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 8px;
}

.advanced-toggle:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.advanced-panel {
  width: 100%;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-hairline);
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 12px;
  text-align: left;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field-group label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.field-input {
  padding: 8px 11px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  outline: none;
  font-size: 12.5px;
}

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

.status-banner {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  text-align: left;
}

.status-banner.error {
  background: var(--red-soft);
  color: var(--red);
  border: 1px solid rgba(255, 59, 48, 0.3);
}

.status-banner.loading {
  background: var(--bg-elevated);
  border: 1px solid var(--border-hairline);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-track {
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: var(--border-hairline);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #007aff, #5856d6);
  border-radius: 999px;
  transition: width 200ms ease;
}

.feature-grid {
  width: 100%;
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  text-align: left;
}

.feature-tile {
  padding: 15px 16px;
  border-radius: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-hairline);
  backdrop-filter: blur(12px);
}

.feature-tile h3 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}

.feature-tile p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* ==================== WORKSPACE SHELL ==================== */
.workspace {
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  height: 50px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  background: var(--bg-elevated);
  backdrop-filter: blur(28px) saturate(190%);
  box-shadow: inset 0 -1px 0 var(--border-hairline), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  z-index: 20;
}

.topbar-left, .topbar-center, .topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.topbar-left {
  flex: 0 1 auto;
}

.topbar-center {
  flex: 0 0 auto;
}

.topbar-right {
  flex: 1 1 0;
  justify-content: flex-end;
}

.topbar .btn-pill,
.topbar .brand-dot,
.topbar .branch-wrap {
  flex-shrink: 0;
  white-space: nowrap;
}

.repo-switcher {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 9px;
  background: var(--bg-hover);
  border: 1px solid var(--border-hairline);
  font-weight: 600;
  font-size: 12.5px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: border-color 140ms ease, background 140ms ease;
}

.repo-switcher:hover {
  border-color: var(--border-strong);
  background: var(--bg-surface);
}

.branch-wrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px 3px 8px;
  border-radius: 9999px;
  background: var(--accent-soft);
  border: 1px solid rgba(0, 122, 255, 0.25);
  color: var(--accent);
}

.branch-ico {
  display: inline-flex;
  align-items: center;
}

.branch-select {
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  max-width: 140px;
}

.branch-select option {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.transport-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border-radius: 9999px;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-sm);
}

.icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: background 120ms ease, color 120ms ease;
}

.icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.play-btn {
  height: 28px;
  padding: 0 13px;
  border-radius: 9999px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 140ms ease, transform 100ms ease;
}

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

.play-btn.playing {
  background: var(--purple);
}

.speed-select {
  padding: 4px 9px;
  border-radius: 9999px;
  border: 1px solid var(--border-hairline);
  background: var(--bg-surface);
  font-size: 11.5px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.commit-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: 9px;
  background: var(--bg-hover);
  border: 1px solid var(--border-hairline);
  min-width: 0;
  max-width: 260px;
  overflow: hidden;
  font-size: 12px;
}

#commit-sha {
  white-space: nowrap;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.commit-pill-msg {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
}

.author-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ==================== MAIN SPLIT AREA ==================== */
.main-area {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 264px;
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-hairline);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  padding: 10px 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-bottom: 1px solid var(--border-hairline);
}

.sidebar-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.sidebar-search {
  width: 100%;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-hairline);
  background: var(--bg-surface);
  outline: none;
  font-size: 12px;
}

.sidebar-search:focus {
  border-color: var(--accent);
}

.file-tree {
  flex: 1;
  overflow-y: auto;
  padding: 6px 6px 14px;
}

.tree-row {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 27px;
  padding-right: 8px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--text-secondary);
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
}

.tree-row:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.tree-row.active {
  background: var(--bg-selected);
  color: var(--accent);
  font-weight: 600;
}

.tree-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tree-caret {
  width: 14px;
  text-align: center;
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.tree-icon {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
}

.live-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  opacity: 0.9;
}

/* ==================== CODE EDITOR SPLIT & PANES ==================== */
.editor-split {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  overflow: hidden;
  background: var(--bg-code);
}

.editor-pane {
  flex: 1 1 auto;
  min-width: 0;
  background: var(--bg-code);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.editor-col {
  flex: 1 1 0;
  min-width: 0;
}

#secondary-pane {
  display: none;
  border-left: 1px solid var(--border-strong);
}

.editor-split.split-active #secondary-pane {
  display: flex;
}

.split-close-btn {
  padding: 2px 9px;
  font-size: 11px;
  flex-shrink: 0;
}

.editor-header {
  height: 38px;
  flex-shrink: 0;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-hairline);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-secondary);
  flex: 1 1 150px;
  min-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breadcrumb-file {
  color: var(--text-primary);
  font-weight: 600;
}

.active-editors {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 1 auto;
  max-width: 65%;
  overflow-x: auto;
  scrollbar-width: none;
}

.active-editors::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.concurrent-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(175, 82, 222, 0.16);
  color: var(--purple);
  border: 1px solid rgba(175, 82, 222, 0.30);
  white-space: nowrap;
}

.editor-author-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
  transition: transform 120ms ease, filter 120ms ease;
}

.editor-author-chip:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.editor-scroll {
  position: relative;
  flex: 1;
  overflow: auto;
  background: var(--bg-code);
}

.code-canvas {
  position: relative;
  min-width: 100%;
  min-height: 100%;
  padding: 26px 0 40px;
  font-family: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12.5px;
  line-height: 21px;
}

.code-line {
  display: flex;
  align-items: stretch;
  height: 21px;
  padding-right: 28px;
  transition: background-color 220ms ease;
}

.code-line.hl-insert {
  background: var(--green-soft);
}

.code-line.hl-delete {
  background: var(--red-soft);
}

.line-num {
  width: 58px;
  flex-shrink: 0;
  padding-right: 14px;
  text-align: right;
  color: var(--text-muted);
  user-select: none;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.line-gutter {
  width: 4px;
  flex-shrink: 0;
  margin-right: 12px;
  border-radius: 2px;
}

.code-line.hl-insert .line-gutter {
  background: var(--green);
}

.code-line.hl-delete .line-gutter {
  background: var(--red);
}

.line-content {
  white-space: pre;
  tab-size: 4;
}

.editor-empty {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
  padding: 24px;
  text-align: center;
}

/* Floating Simulated Multiplayer Cursors & Selection Drag Overlays */
.cursor-layer {
  position: absolute;
  top: 26px;
  left: 74px; /* 58px line-num + 4px gutter + 12px margin */
  pointer-events: none;
  z-index: 15;
}

.sim-selection {
  position: absolute;
  border-radius: 6px;
  border: 1px solid rgba(10, 132, 255, 0.45);
  background: rgba(10, 132, 255, 0.16);
  pointer-events: none;
  transition: height 90ms ease, width 90ms ease;
}

.sim-selection.sel-delete {
  border-color: rgba(255, 69, 58, 0.55);
  background: rgba(255, 69, 58, 0.18);
}

.sim-selection.sel-paste {
  border-color: rgba(50, 215, 75, 0.55);
  background: rgba(50, 215, 75, 0.16);
}

.meta-tag {
  display: inline-block;
  padding: 0 5px;
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  vertical-align: middle;
}

.tag-merge {
  background: rgba(175, 82, 222, 0.18);
  color: var(--purple);
}

.tag-rebase {
  background: rgba(255, 149, 0, 0.18);
  color: var(--orange);
}

.tag-concurrent {
  background: var(--accent-soft);
  color: var(--accent);
}

.sim-cursor {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
  pointer-events: none;
}

.sim-caret {
  width: 2.5px;
  height: 21px;
  border-radius: 2px;
  position: relative;
}

.sim-caret-glow {
  position: absolute;
  inset: -4px -5px;
  border-radius: 6px;
  opacity: 0.25;
  filter: blur(4px);
}

.sim-label {
  position: absolute;
  top: -21px;
  left: 0;
  padding: 1.5px 8px;
  border-radius: 6px 6px 6px 2px;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: var(--shadow-cursor);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.sim-label.flip-left {
  left: auto;
  right: 0;
  border-radius: 6px 6px 2px 6px;
}

.sim-action {
  opacity: 0.85;
  font-weight: 500;
  font-size: 10px;
}

/* Syntax Token Colors */
.tok-kw { color: var(--tok-kw); font-weight: 600; }
.tok-type { color: var(--tok-type); }
.tok-str { color: var(--tok-str); }
.tok-num { color: var(--tok-num); }
.tok-comment { color: var(--tok-comment); font-style: italic; }
.tok-fn { color: var(--tok-fn); }
.tok-attr { color: var(--tok-attr); }
.tok-tag { color: var(--tok-tag); }
.tok-op { color: var(--tok-op); }

/* ==================== DEVTOOLS WATERFALL DRAWER ==================== */
.timeline-resizer {
  height: 5px;
  flex-shrink: 0;
  background: var(--bg-devtools);
  border-top: 1px solid var(--border-hairline);
  cursor: row-resize;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timeline-resizer:hover {
  background: var(--accent-soft);
}

.timeline-resizer-grip {
  width: 36px;
  height: 3px;
  border-radius: 999px;
  background: var(--border-strong);
}

.timeline-drawer {
  height: 280px;
  min-height: 160px;
  max-height: 60vh;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-devtools);
  overflow: hidden;
}

.devtools-toolbar {
  height: 34px;
  flex-shrink: 0;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--border-hairline);
  background: var(--bg-surface);
}

.devtools-toolbar-left, .devtools-toolbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-pill {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 120ms ease;
}

.filter-pill:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.filter-pill.active {
  background: var(--accent);
  color: #fff;
}

.devtools-filter-input {
  width: 160px;
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid var(--border-hairline);
  background: var(--bg-devtools);
  font-size: 11.5px;
  outline: none;
}

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

.waterfall-overview-wrap {
  position: relative;
  height: 92px;
  flex-shrink: 0;
  background: var(--bg-devtools-overview);
  border-bottom: 1px solid var(--border-hairline);
  user-select: none;
}

#waterfall-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

.waterfall-tooltip {
  position: absolute;
  top: 8px;
  pointer-events: none;
  padding: 6px 10px;
  border-radius: 9px;
  background: var(--bg-elevated);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
  font-size: 11px;
  z-index: 25;
  white-space: nowrap;
  display: none;
}

/* DevTools Detail Table */
.devtools-table-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: var(--bg-devtools);
}

.devtools-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 11.5px;
}

.devtools-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-weight: 600;
  text-align: left;
  padding: 5px 10px;
  border-bottom: 1px solid var(--border-strong);
  border-right: 1px solid var(--border-hairline);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.devtools-table tbody tr {
  height: 24px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-hairline);
}

.devtools-table tbody tr:nth-child(even) {
  background: rgba(128, 128, 128, 0.03);
}

.devtools-table tbody tr:hover {
  background: var(--bg-hover);
}

.devtools-table tbody tr.selected {
  background: var(--bg-selected);
}

.devtools-table td {
  padding: 2px 10px;
  border-right: 1px solid var(--border-hairline);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 600;
}

.status-added { background: var(--green-soft); color: var(--green); }
.status-modified { background: var(--accent-soft); color: var(--accent); }
.status-deleted { background: var(--red-soft); color: var(--red); }
.status-renamed { background: rgba(175, 82, 222, 0.16); color: var(--purple); }

.mini-waterfall-track {
  position: relative;
  width: 100%;
  height: 12px;
  border-radius: 3px;
  background: rgba(128, 128, 128, 0.08);
  overflow: hidden;
}

.mini-waterfall-bar {
  position: absolute;
  top: 2px;
  height: 8px;
  min-width: 4px;
  border-radius: 2px;
}

/* Modal / Popover for Settings */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal-card {
  width: 100%;
  max-width: 440px;
  padding: 22px;
  border-radius: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  font-size: 16px;
  font-weight: 700;
}

/* ==================== PRODUCT HOME LANDING PAGE ==================== */
.home-page {
  height: 100%;
  width: 100%;
  overflow-y: auto;
  scroll-behavior: smooth;
  background:
    radial-gradient(1000px 480px at 50% -60px, rgba(0, 122, 255, 0.16), transparent 65%),
    radial-gradient(640px 360px at 85% 24%, rgba(175, 82, 222, 0.10), transparent 65%),
    var(--bg-canvas);
}

.home-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 58px;
  background: var(--bg-elevated);
  backdrop-filter: blur(22px) saturate(180%);
  border-bottom: 1px solid var(--border-hairline);
}

.home-nav-inner {
  max-width: 1080px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.home-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
}

.home-nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.home-nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color 140ms ease;
}

.home-nav-link:hover {
  color: var(--text-primary);
}

.home-nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.home-launch-btn {
  padding: 7px 15px;
  border-radius: 9999px;
  font-size: 12.5px;
}

.home-main {
  max-width: 1040px;
  margin: 0 auto;
  padding: 56px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 84px;
}

.home-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
}

.home-hero-title {
  font-size: clamp(38px, 6vw, 62px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
  color: var(--text-primary);
}

.home-hero-subtitle {
  max-width: 600px;
  font-size: 17px;
  line-height: 1.55;
  color: var(--text-secondary);
}

.home-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 4px;
}

.home-cta-primary {
  padding: 12px 24px;
  border-radius: 9999px;
  font-size: 14.5px;
  box-shadow: 0 8px 24px rgba(0, 122, 255, 0.28);
}

.home-cta-secondary {
  padding: 11px 20px;
  font-size: 14px;
}

/* Animated macOS Preview Window */
.preview-window {
  width: 100%;
  max-width: 860px;
  margin-top: 18px;
  border-radius: 18px;
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  text-align: left;
}

.preview-titlebar {
  height: 38px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-hairline);
}

.traffic-lights {
  display: inline-flex;
  gap: 7px;
}

.tl {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.tl-red { background: #ff5f57; }
.tl-yellow { background: #febc2e; }
.tl-green { background: #28c840; }

.preview-title-pill {
  font-size: 11.5px;
  color: var(--text-secondary);
}

.preview-badge-live {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
}

.preview-body {
  display: grid;
  grid-template-columns: 185px 1fr;
  min-height: 188px;
  border-bottom: 1px solid var(--border-hairline);
}

.preview-sidebar {
  padding: 12px 10px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-hairline);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.preview-sb-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 0 6px 4px;
}

.preview-sb-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 6px;
}

.preview-sb-active {
  background: var(--bg-selected);
  color: var(--accent);
  font-weight: 600;
}

.preview-editor {
  position: relative;
  padding: 14px 16px;
  background: var(--bg-code);
  font-size: 12px;
  line-height: 22px;
  overflow: hidden;
}

.preview-code-row {
  white-space: nowrap;
  border-radius: 4px;
  padding: 0 6px;
}

.preview-hl-add {
  background: var(--green-soft);
}

.preview-ln {
  display: inline-block;
  width: 26px;
  color: var(--text-muted);
  user-select: none;
}

.preview-cursor {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}

.preview-caret {
  width: 2.5px;
  height: 20px;
  border-radius: 2px;
}

.preview-cursor-tag {
  position: absolute;
  top: -19px;
  left: 0;
  padding: 1px 7px;
  border-radius: 5px 5px 5px 2px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  box-shadow: var(--shadow-cursor);
}

.preview-cursor-elena {
  animation: previewGlideElena 6s ease-in-out infinite;
}

.preview-cursor-sora {
  animation: previewGlideSora 7s ease-in-out infinite;
}

@keyframes previewGlideElena {
  0%, 100% { transform: translate3d(265px, 36px, 0); }
  45% { transform: translate3d(340px, 36px, 0); }
  75% { transform: translate3d(280px, 124px, 0); }
}

@keyframes previewGlideSora {
  0%, 100% { transform: translate3d(210px, 146px, 0); }
  50% { transform: translate3d(325px, 124px, 0); }
  80% { transform: translate3d(175px, 102px, 0); }
}

.preview-waterfall {
  background: var(--bg-devtools-overview);
  padding: 6px 12px 10px;
}

.preview-wf-ruler {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
  padding-bottom: 5px;
  border-bottom: 1px solid var(--border-hairline);
}

.preview-wf-lanes {
  position: relative;
  height: 40px;
  margin-top: 4px;
}

.preview-wf-bar {
  position: absolute;
  height: 6px;
  border-radius: 3px;
}

.preview-playhead {
  position: absolute;
  top: -4px;
  bottom: 0;
  width: 2px;
  background: #5e9eff;
  animation: previewScrub 8s linear infinite;
}

@keyframes previewScrub {
  0% { left: 8%; }
  100% { left: 92%; }
}

/* Sections, Bento Grid & Steps */
.home-section {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.home-section-head {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.home-eyebrow {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.home-section-head h2 {
  font-size: clamp(24px, 3.5vw, 34px);
  font-weight: 700;
  letter-spacing: -0.025em;
}

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

.bento-card {
  padding: 24px;
  border-radius: 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-hairline);
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 180ms ease, border-color 180ms ease;
}

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

.bento-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 700;
}

.bento-card h3 {
  font-size: 16px;
  font-weight: 600;
}

.bento-card p {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-secondary);
}

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

.step-card {
  padding: 22px;
  border-radius: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.step-num {
  font-family: "SF Mono", ui-monospace, monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

.step-card h3 {
  font-size: 15px;
  font-weight: 600;
}

.step-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.home-cta-banner {
  padding: 40px 28px;
  border-radius: 22px;
  text-align: center;
  background:
    radial-gradient(500px 220px at 50% 0%, rgba(0, 122, 255, 0.16), transparent 70%),
    var(--bg-elevated);
  border: 1px solid var(--border-strong);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.home-cta-banner h2 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.home-cta-banner p {
  color: var(--text-secondary);
  font-size: 14.5px;
}

.home-footer {
  max-width: 1040px;
  margin: 0 auto;
  padding: 22px 24px 34px;
  border-top: 1px solid var(--border-hairline);
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

/* Responsive adjustments */
@media (max-width: 880px) {
  .sidebar { width: 200px; }
  .feature-grid { grid-template-columns: 1fr; }
  .commit-pill { display: none; }
  .advanced-panel { grid-template-columns: 1fr; }
  .bento-grid, .steps-strip { grid-template-columns: 1fr; }
  .preview-body { grid-template-columns: 1fr; }
  .preview-sidebar { display: none; }
  .home-nav-links { display: none; }
  .editor-split.split-active #secondary-pane { display: none; }
}
