/* index.css — extracted from inline <style> blocks. Generated by scripts/h1-extract.mjs */
:root {
    --bg: #1a1b26;
    --panel: #16171f;
    --panel2: #22242e;
    --border: #2d2f3b;
    --text: #c0caf5;
    --muted: #6b7089;
    --accent: #7aa2f7;
    --accent-dim: #3d59a1;
    --danger: #f7768e;
    --hover: #2a2d3a;
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  html, body { height: 100%; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); overflow: hidden; }
  #app { display: grid; grid-template-columns: 260px 1fr 1fr; height: 100vh; }

  /* Sidebar */
  #sidebar { background: var(--panel); border-right: 1px solid var(--border); display: flex; flex-direction: column; min-width: 0; }
  .sidebar-header { padding: 14px 16px; border-bottom: 1px solid var(--border); }
  .sidebar-header h1 { font-size: 15px; font-weight: 600; letter-spacing: 0.3px; margin-bottom: 10px; color: var(--accent); }
  .toolbar { display: flex; gap: 6px; margin-bottom: 10px; }
  .toolbar button { flex: 1; background: var(--panel2); color: var(--text); border: 1px solid var(--border); padding: 6px 8px; border-radius: 5px; font-size: 12px; cursor: pointer; transition: all 0.15s; }
  .toolbar button:hover { background: var(--hover); border-color: var(--accent-dim); }
  #search { width: 100%; background: var(--panel2); border: 1px solid var(--border); color: var(--text); padding: 7px 10px; border-radius: 5px; font-size: 13px; outline: none; }
  #search:focus { border-color: var(--accent); }

  #tree { flex: 1; overflow-y: auto; padding: 8px; }
  .tree-node { user-select: none; }
  .tree-item { display: flex; align-items: center; padding: 5px 8px; border-radius: 4px; cursor: pointer; font-size: 13px; gap: 6px; position: relative; }
  .tree-item:hover { background: var(--hover); }
  .tree-item.active { background: var(--accent-dim); color: #fff; }
  .tree-item .icon { width: 14px; text-align: center; flex-shrink: 0; font-size: 11px; color: var(--muted); }
  .tree-item.active .icon { color: #fff; }
  .tree-item .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tree-item .actions { display: none; gap: 2px; }
  .tree-item:hover .actions { display: flex; }
  .tree-item .actions button { background: none; border: none; color: var(--muted); cursor: pointer; padding: 2px 4px; font-size: 11px; border-radius: 3px; }
  .tree-item .actions button:hover { background: var(--bg); color: var(--text); }
  .tree-children { margin-left: 14px; }
  .tree-children.collapsed { display: none; }
  .empty-state { padding: 20px; text-align: center; color: var(--muted); font-size: 12px; }

  /* Editor & Preview */
  .pane { display: flex; flex-direction: column; min-width: 0; }
  .pane-header { padding: 10px 16px; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.8px; background: var(--panel); display: flex; justify-content: space-between; align-items: center; }
  .pane-header .title-input { background: transparent; border: none; color: var(--text); font-size: 13px; font-weight: 500; outline: none; flex: 1; text-transform: none; letter-spacing: normal; }
  .pane-header .title-input:focus { color: var(--accent); }
  #editor-pane { background: var(--panel); border-right: 1px solid var(--border); }
  #editor { flex: 1; background: var(--panel); color: var(--text); border: none; padding: 20px 24px; font-family: "Consolas", "Monaco", monospace; font-size: 14px; line-height: 1.6; resize: none; outline: none; }
  #editor::placeholder { color: var(--muted); }
  #preview-pane { background: var(--bg); }
  #preview { flex: 1; padding: 24px 32px; overflow-y: auto; line-height: 1.7; }
  #preview h1, #preview h2, #preview h3 { margin: 18px 0 10px; color: var(--accent); }
  #preview h1 { font-size: 26px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
  #preview h2 { font-size: 21px; }
  #preview h3 { font-size: 17px; }
  #preview p { margin: 10px 0; }
  #preview code { background: var(--panel2); padding: 2px 6px; border-radius: 3px; font-size: 0.9em; color: #f7768e; }
  #preview pre { background: var(--panel); border: 1px solid var(--border); padding: 14px; border-radius: 6px; overflow-x: auto; margin: 12px 0; }
  #preview pre code { background: none; color: var(--text); padding: 0; }
  #preview blockquote { border-left: 3px solid var(--accent); padding-left: 14px; margin: 12px 0; color: var(--muted); }
  #preview ul, #preview ol { margin: 10px 0 10px 24px; }
  #preview li { margin: 4px 0; }
  #preview a { color: var(--accent); }
  #preview table { border-collapse: collapse; margin: 12px 0; }
  #preview th, #preview td { border: 1px solid var(--border); padding: 8px 12px; }
  #preview th { background: var(--panel); }
  #preview hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
  #preview img { max-width: 100%; border-radius: 6px; }

  .empty-editor { display: flex; align-items: center; justify-content: center; flex: 1; color: var(--muted); font-size: 14px; flex-direction: column; gap: 10px; }
  .empty-editor .big { font-size: 42px; opacity: 0.4; }

  /* Scrollbars */
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-track { background: var(--panel); }
  ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 5px; }
  ::-webkit-scrollbar-thumb:hover { background: var(--accent-dim); }

  /* Search highlight */
  .search-hit { background: rgba(247, 118, 142, 0.2); }
  .hidden { display: none !important; }

  .status { padding: 6px 16px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--border); background: var(--panel); }

  /* Mobile tabs (hidden on desktop) */
  .mobile-tabs { display: none; }

  @media (max-width: 768px) {
    #app {
      grid-template-columns: 1fr;
      grid-template-rows: auto auto 1fr;
    }
    #sidebar {
      max-height: 32vh;
      border-right: none;
      border-bottom: 1px solid var(--border);
    }
    .sidebar-header { padding: 10px 12px; }
    .sidebar-header h1 { font-size: 14px; margin-bottom: 8px; }
    .toolbar button {
      min-height: 44px;
      font-size: 13px;
    }
    #search {
      min-height: 44px;
      font-size: 14px;
    }
    .tree-item {
      min-height: 44px;
      font-size: 14px;
      padding: 8px 10px;
    }
    .tree-item .actions { display: flex; }
    .tree-item .actions button {
      min-width: 36px;
      min-height: 36px;
      font-size: 14px;
    }
    .mobile-tabs {
      display: flex;
      background: var(--panel);
      border-bottom: 1px solid var(--border);
    }
    .mobile-tabs button {
      flex: 1;
      min-height: 44px;
      background: var(--panel);
      color: var(--muted);
      border: none;
      border-right: 1px solid var(--border);
      font-size: 13px;
      cursor: pointer;
    }
    .mobile-tabs button:last-child { border-right: none; }
    .mobile-tabs button.active {
      color: var(--accent);
      background: var(--panel2);
      border-bottom: 2px solid var(--accent);
    }
    #editor-pane, #preview-pane {
      grid-column: 1;
      grid-row: 3;
      border-right: none;
    }
    #editor-pane.mobile-hidden, #preview-pane.mobile-hidden {
      display: none;
    }
    .pane-header { padding: 8px 12px; }
    #editor {
      padding: 12px 14px;
      font-size: 14px;
      min-height: 200px;
    }
    #preview { padding: 14px 16px; font-size: 14px; }
    #preview h1 { font-size: 22px; }
    #preview h2 { font-size: 18px; }
    #preview h3 { font-size: 16px; }
    .title-input { font-size: 14px; min-height: 32px; }
    .status { font-size: 11px; padding: 5px 12px; }
  }

  @media (max-width: 480px) {
    #sidebar { max-height: 28vh; }
    .sidebar-header h1 { font-size: 13px; margin-bottom: 6px; }
    .toolbar { gap: 4px; margin-bottom: 6px; }
    .toolbar button { font-size: 12px; padding: 8px 6px; }
    #search { font-size: 13px; padding: 8px; }
    .tree-item { font-size: 13px; }
    .mobile-tabs button { font-size: 12px; }
    #editor { padding: 10px 12px; font-size: 13px; }
    #preview { padding: 12px 14px; font-size: 13px; }
    #preview h1 { font-size: 19px; }
    #preview h2 { font-size: 16px; }
    #preview h3 { font-size: 14px; }
  }
