    :root {
      color-scheme: light;
      --fg: #333333;
      --muted: #8a8a8a;
      --bg: #ffffff;
      --pane: #fafafa;
      --card: #fff;
      --border: #ececec;
      /* Cyan accent — matches the .html file icon. Paired with the
       * #d9a000 amber on .md icons, the two are the project's color
       * signature (see `.tree-row.file.format-*` comments). */
      --accent: #0891b2;
      --hover: #f0f0f0;
      --active: #e8e8e8;
    }

    * {
      box-sizing: border-box;
    }

    html,
    body {
      height: 100%;
      margin: 0;
    }

    body {
      font: 14px/1.55 -apple-system, system-ui, "PingFang SC", "Hiragino Sans", sans-serif;
      color: var(--fg);
      background: var(--bg);
      overflow: hidden;
    }

    /* React mounts into #root — make IT the flex column so the chrome
     * strip + .app grid get the full viewport. With this on `body` the
     * flex chain breaks at #root (a plain block) and `.app` collapses
     * to its content height (~200px). */
    #root {
      height: 100%;
      display: flex;
      flex-direction: column;
    }

    /* Dedicated chrome strip across the top of the window — holds the
     * embedder picker on the right. In Electron with `hiddenInset` the
     * macOS traffic lights are inset at the left (x:14, y:14) and the
     * rest of the strip is empty; we paint our own background so the
     * boundary between OS chrome and app content is seamless. The whole
     * strip is a drag region; interactive controls (the picker button)
     * opt out via the `no-drag` rule below. */
    .app-chrome {
      position: relative;
      flex-shrink: 0;
      height: 40px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 14px;
      background: var(--pane);
      border-bottom: 1px solid var(--border);
    }

    /* Left group sits to the right of the traffic lights (which overlay
     * at x:14, y:14, taking ~62px). Padding here keeps the toggle button
     * clear of the OS chrome. macOS fullscreen hides the traffic lights;
     * the `.is-fullscreen` body class (driven by Electron IPC) drops
     * the inset so the toggle hugs the edge again. */
    .app-chrome-left {
      padding-left: 62px;
      display: flex;
      align-items: center;
      gap: 4px;
    }

    body.is-fullscreen .app-chrome-left {
      padding-left: 0;
    }

    .app-chrome-right {
      display: flex;
      align-items: center;
      gap: 4px;
    }

    /* Centered space name, VSCode-titlebar style. Absolutely positioned
     * so traffic lights (left) and embedder picker (right) can grow
     * independently without nudging it off-center. `max-width` leaves
     * a guard band so a long name truncates with ellipsis instead of
     * sliding under the picker. */
    .app-chrome-title {
      position: absolute;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
      font-size: 12px;
      font-weight: 500;
      color: var(--muted);
      white-space: nowrap;
      max-width: calc(100% - 280px);
      overflow: hidden;
      text-overflow: ellipsis;
      pointer-events: none;
    }

    body.is-electron .app-chrome {
      -webkit-app-region: drag;
    }

    body.is-electron button,
    body.is-electron input,
    body.is-electron .tree-row,
    body.is-electron a,
    body.is-electron strong {
      -webkit-app-region: no-drag;
    }

    .app {
      flex: 1;
      min-height: 0;
      display: grid;
      /* Anchor for the absolutely-positioned `.sidebar-splitter`, which
       * straddles the sidebar/main boundary without taking a grid track. */
      position: relative;
      /* Four columns always — sidebar | main | splitter | chat.
       * Closed chat panel collapses its track to 0 instead of structurally
       * adding/removing columns, so CSS can transition the width smoothly.
       *
       * Sidebar column = 44px ActivityBar rail + the user-resizable panel
       * (`--sidebar-width`, driven from `state.sidebarWidth`). When the
       * panel is collapsed the column shrinks to the bare 44px rail — the
       * rail itself never disappears (VSCode semantics). */
      grid-template-columns: calc(44px + var(--sidebar-width, 280px)) 1fr 0 0;
      /* Explicit single-row track so .sidebar fills the height instead
       * of shrinking to its content — the file list grows into the full
       * column height and depends on the column being tall. */
      grid-template-rows: minmax(0, 1fr);
      transition: grid-template-columns 220ms ease;
    }

    /* While dragging the sidebar splitter, the column must track the
     * cursor instantly — the 220ms ease would otherwise lag behind the
     * (instantly-positioned) splitter and open a blank gap. */
    .app.sidebar-dragging {
      transition: none;
    }

    /* Panel collapsed — only the 44px activity rail remains. Keep the
     * sidebar mounted (preserves selection / scroll / search state);
     * shrinking the column + sidebar's own overflow:hidden hides the
     * panel without unmounting. */
    .app.sidebar-collapsed {
      grid-template-columns: 44px 1fr 0 0;
    }

    /* Drag handle on the sidebar's right edge. Absolutely positioned at
     * `left: calc(44px + var(--sidebar-width))` (set inline by React) so
     * it tracks the panel's right border without consuming a grid track.
     * The element is a wide-ish (6px) invisible hit area; the visible
     * cue is a thin 1px line drawn by `::after`, so hovering shows a
     * crisp seam highlight rather than a fat colored band. */
    .sidebar-splitter {
      position: absolute;
      top: 0;
      bottom: 0;
      width: 6px;
      margin-left: -3px;
      z-index: 5;
      cursor: col-resize;
      background: transparent;
    }
    .sidebar-splitter::after {
      content: '';
      position: absolute;
      top: 0;
      bottom: 0;
      left: 50%;
      transform: translateX(-50%);
      width: 2px;
      background: transparent;
      transition: background .12s;
    }
    .sidebar-splitter:hover::after,
    .sidebar-splitter:active::after {
      background: var(--accent);
    }

