/* index.css — extracted from inline <style> blocks. Generated by scripts/h1-extract.mjs */
:root {
    --bg: #1e1e2e;
    --sidebar: #181825;
    --tab-bg: #11111b;
    --tab-active: #1e1e2e;
    --tab-hover: #313244;
    --text: #cdd6f4;
    --text-dim: #6c7086;
    --accent: #89b4fa;
    --border: #313244;
    --line-num: #585b70;
    --gutter: #181825;
    --selection: rgba(137,180,250,0.18);
    --scrollbar: #45475a;
    --scrollbar-hover: #585b70;
    /* syntax */
    --syn-keyword: #cba6f7;
    --syn-string: #a6e3a1;
    --syn-number: #fab387;
    --syn-comment: #6c7086;
    --syn-function: #89b4fa;
    --syn-type: #f9e2af;
    --syn-operator: #89dceb;
    --syn-tag: #f38ba8;
    --syn-attr: #fab387;
    --syn-punctuation: #9399b2;
  }

  [data-theme="light"] {
    --bg: #eff1f5;
    --sidebar: #e6e9ef;
    --tab-bg: #dce0e8;
    --tab-active: #eff1f5;
    --tab-hover: #ccd0da;
    --text: #4c4f69;
    --text-dim: #8c8fa1;
    --accent: #1e66f5;
    --border: #ccd0da;
    --line-num: #9ca0b0;
    --gutter: #e6e9ef;
    --selection: rgba(30,102,245,0.15);
    --scrollbar: #bcc0cc;
    --scrollbar-hover: #9ca0b0;
    --syn-keyword: #8839ef;
    --syn-string: #40a02b;
    --syn-number: #fe640b;
    --syn-comment: #9ca0b0;
    --syn-function: #1e66f5;
    --syn-type: #df8e1d;
    --syn-operator: #04a5e5;
    --syn-tag: #d20f39;
    --syn-attr: #fe640b;
    --syn-punctuation: #7c7f93;
  }

  [data-theme="midnight"] {
    --bg: #0d1117;
    --sidebar: #010409;
    --tab-bg: #010409;
    --tab-active: #0d1117;
    --tab-hover: #161b22;
    --text: #e6edf3;
    --text-dim: #484f58;
    --accent: #58a6ff;
    --border: #21262d;
    --line-num: #484f58;
    --gutter: #010409;
    --selection: rgba(88,166,255,0.15);
    --scrollbar: #30363d;
    --scrollbar-hover: #484f58;
    --syn-keyword: #ff7b72;
    --syn-string: #a5d6ff;
    --syn-number: #79c0ff;
    --syn-comment: #484f58;
    --syn-function: #d2a8ff;
    --syn-type: #ffa657;
    --syn-operator: #79c0ff;
    --syn-tag: #7ee787;
    --syn-attr: #ffa657;
    --syn-punctuation: #8b949e;
  }

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

  body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  /* Top bar */
  .topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--sidebar);
    border-bottom: 1px solid var(--border);
    padding: 0 12px;
    height: 38px;
    flex-shrink: 0;
    user-select: none;
  }
  .topbar-left { display: flex; align-items: center; gap: 12px; }
  .logo {
    font-weight: 700;
    font-size: 14px;
    color: var(--accent);
    letter-spacing: -0.5px;
  }
  .topbar-actions { display: flex; align-items: center; gap: 6px; }
  .topbar-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
  }
  .topbar-btn:hover { color: var(--text); border-color: var(--text-dim); }
  .theme-select {
    background: var(--tab-bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    outline: none;
  }

  /* Tabs */
  .tab-bar {
    display: flex;
    background: var(--tab-bg);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    flex-shrink: 0;
    scrollbar-width: none;
  }
  .tab-bar::-webkit-scrollbar { display: none; }
  .tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 13px;
    color: var(--text-dim);
    cursor: pointer;
    border-right: 1px solid var(--border);
    white-space: nowrap;
    user-select: none;
    transition: all 0.15s;
    position: relative;
  }
  .tab:hover { background: var(--tab-hover); color: var(--text); }
  .tab.active {
    background: var(--tab-active);
    color: var(--text);
    border-bottom: 2px solid var(--accent);
  }
  .tab .lang-dot {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  }
  .tab .close-tab {
    width: 16px; height: 16px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 3px;
    font-size: 14px;
    line-height: 1;
    opacity: 0;
    transition: all 0.1s;
  }
  .tab:hover .close-tab, .tab.active .close-tab { opacity: 0.6; }
  .tab .close-tab:hover { opacity: 1; background: var(--border); }
  .tab .modified {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--accent);
    position: absolute;
    top: 6px; right: 6px;
  }
  .add-tab {
    display: flex; align-items: center; justify-content: center;
    width: 36px; flex-shrink: 0;
    color: var(--text-dim); cursor: pointer;
    font-size: 18px; transition: color 0.15s;
  }
  .add-tab:hover { color: var(--text); }

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

  /* Minimap */
  .minimap {
    width: 80px;
    background: var(--sidebar);
    border-left: 1px solid var(--border);
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
  }
  .minimap canvas { width: 100%; }
  .minimap-viewport {
    position: absolute;
    left: 0; right: 0;
    background: var(--selection);
    border: 1px solid var(--accent);
    border-left: none; border-right: none;
    opacity: 0.5;
    pointer-events: none;
  }

  /* Gutter + textarea + highlight overlay */
  .editor-container {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
  }
  .gutter {
    background: var(--gutter);
    color: var(--line-num);
    font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.6;
    padding: 8px 0;
    text-align: right;
    user-select: none;
    overflow: hidden;
    flex-shrink: 0;
    min-width: 50px;
  }
  .gutter .line-num {
    padding: 0 12px 0 8px;
    display: block;
  }
  .gutter .line-num.active { color: var(--text); font-weight: 600; }

  .editor-scroll {
    flex: 1;
    overflow: auto;
    position: relative;
  }
  .editor-scroll::-webkit-scrollbar { width: 10px; height: 10px; }
  .editor-scroll::-webkit-scrollbar-track { background: transparent; }
  .editor-scroll::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 5px; }
  .editor-scroll::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-hover); }
  .editor-scroll::-webkit-scrollbar-corner { background: transparent; }

  .editor-inner {
    position: relative;
    min-height: 100%;
  }

  .highlight-layer, .editor-textarea {
    font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.6;
    padding: 8px 16px;
    white-space: pre;
    tab-size: 2;
  }

  .highlight-layer {
    position: absolute;
    top: 0; left: 0;
    pointer-events: none;
    color: transparent;
  }
  .highlight-layer span { color: revert; }

  .editor-textarea {
    width: 100%;
    min-height: 100%;
    background: transparent;
    color: var(--text);
    caret-color: var(--accent);
    border: none;
    outline: none;
    resize: none;
    position: relative;
    z-index: 1;
    color: transparent;
    overflow: visible;
  }
  .editor-textarea::selection { background: var(--selection); }

  .active-line-highlight {
    position: absolute;
    left: 0; right: 0;
    height: 22.4px;
    background: var(--selection);
    pointer-events: none;
    z-index: 0;
    transition: top 0.05s;
  }

  /* Status bar */
  .statusbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--accent);
    color: #fff;
    padding: 0 12px;
    height: 24px;
    font-size: 12px;
    flex-shrink: 0;
    user-select: none;
  }
  .statusbar-left, .statusbar-right { display: flex; gap: 16px; }

  /* New file dialog */
  .dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
  }
  .dialog-overlay.show { display: flex; }
  .dialog {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    width: 360px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  }
  .dialog h3 { font-size: 14px; margin-bottom: 12px; }
  .dialog input {
    width: 100%;
    padding: 8px 12px;
    background: var(--tab-bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-size: 13px;
    outline: none;
  }
  .dialog input:focus { border-color: var(--accent); }
  .dialog-btns {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 12px;
  }
  .dialog-btns button {
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--tab-bg);
    color: var(--text);
  }
  .dialog-btns button.primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
  }

  /* Find bar */
  .find-bar {
    display: none;
    position: absolute;
    top: 0; right: 20px;
    background: var(--sidebar);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 6px 6px;
    padding: 8px 12px;
    z-index: 50;
    gap: 8px;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  }
  .find-bar.show { display: flex; }
  .find-bar input {
    padding: 4px 8px;
    background: var(--tab-bg);
    border: 1px solid var(--border);
    border-radius: 3px;
    color: var(--text);
    font-size: 13px;
    outline: none;
    width: 220px;
  }
  .find-bar input:focus { border-color: var(--accent); }
  .find-bar .find-count { font-size: 12px; color: var(--text-dim); min-width: 60px; }
  .find-bar button {
    background: none; border: none; color: var(--text-dim);
    cursor: pointer; font-size: 16px; padding: 2px 6px;
  }
  .find-bar button:hover { color: var(--text); }

  @media (max-width: 768px) {
    .minimap { display: none; }
    .topbar { padding: 0 8px; }
    .topbar-btn { padding: 4px 6px; font-size: 11px; min-height: 44px; }
    .theme-select { font-size: 11px; padding: 3px 4px; min-height: 44px; }
    .tab { padding: 6px 10px; font-size: 12px; min-height: 44px; }
    .gutter { min-width: 36px; font-size: 12px; }
    .gutter .line-num { padding: 0 6px 0 4px; }
    .highlight-layer, .editor-textarea { font-size: 12px; padding: 6px 8px; }
    .find-bar { right: 8px; }
    .find-bar input { width: 140px; min-height: 44px; }
    .find-bar button { min-height: 44px; min-width: 44px; }
    .dialog-btns button { min-height: 44px; }
    .dialog input { min-height: 44px; }
    .add-tab { min-height: 44px; min-width: 44px; }
  }
  @media (max-width: 480px) {
    .topbar { height: auto; min-height: 44px; flex-wrap: wrap; padding: 4px 8px; gap: 4px; }
    .topbar-actions { gap: 4px; flex-wrap: wrap; }
    .topbar-btn { min-height: 44px; }
    .theme-select { min-height: 44px; }
    .tab { padding: 5px 8px; font-size: 11px; gap: 4px; min-height: 44px; }
    .tab .lang-dot { width: 6px; height: 6px; }
    .gutter { min-width: 30px; font-size: 11px; }
    .highlight-layer, .editor-textarea { font-size: 11px; padding: 4px 6px; }
    .statusbar { font-size: 10px; padding: 0 8px; height: 20px; }
    .find-bar { right: 4px; left: 4px; flex-wrap: wrap; }
    .find-bar input { width: 100%; min-height: 44px; }
    .find-bar button { min-height: 44px; min-width: 44px; }
    .dialog { width: calc(100vw - 32px); max-width: 360px; }
    .dialog input { width: 100%; min-height: 44px; }
    .dialog-btns button { min-height: 44px; flex: 1; }
  }
:root {
      --primary: #6366f1;
      --surface: #1e1b4b;
    }
    body {
      font-family: system-ui, sans-serif;
      background: var(--surface);
      color: #e2e8f0;
      margin: 0;
      display: grid;
      grid-template-columns: 240px 1fr;
      min-height: 100vh;
    }
    .sidebar {
      background: rgba(0,0,0,0.2);
      padding: 24px 16px;
    }
    .main {
      padding: 32px;
    }
    .card {
      background: rgba(255,255,255,0.05);
      border-radius: 12px;
      padding: 24px;
      margin-bottom: 16px;
    }
