.app {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  height: var(--header-height);
  padding: 0 var(--space-5);
  border-bottom: var(--border-width) solid var(--border);
  background: var(--layer-01);
  flex: 0 0 auto;
  /* The header sits on --layer-01, so ghost/secondary controls step their hover
     fill up to --layer-02 (arch 09 §4; consumed by Button/IconButton). */
  --control-hover-fill: var(--layer-02);
}

.title {
  margin: 0; /* it's an <h1> now — drop the UA heading margin */
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.01em;
}

/*
 * Skip link — visually hidden until focused, then pinned top-left above
 * everything. Reveal uses :focus (not only :focus-visible) so a keyboard Tab
 * shows it; the transition is neutralized under prefers-reduced-motion by base.css.
 */
.skipLink {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: 1200;
  padding: var(--space-3) var(--space-4);
  background: var(--accent);
  color: var(--accent-contrast);
  border-radius: var(--radius);
  transition: top var(--dur-fast) var(--ease);
}

.skipLink:focus {
  top: var(--space-3);
}

/* The focus target itself shouldn't paint a ring (the skip link already shows). */
.panes:focus {
  outline: none;
}

.version {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  /* A passive badge, not a control — subtle border (borders mark function). */
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-1) var(--space-3);
}

.spacer {
  flex: 1;
}

/* Vertical rule separating the utilities from Support + the theme toggle.
   (The header buttons themselves are the shared Button primitive — ghost
   utilities, soft-accent Support; arch 09 §4.) */
/* TODO: --border-strong is the 3:1 component-boundary token (arch 09 §3.3), which
   makes this passive divider fairly dark; --border would be the semantic choice but
   is near-invisible on the --layer-01 header in light theme. A separator may want
   its own subtler value if this reads too heavy. */
.headerDivider {
  flex: 0 0 auto;
  width: var(--border-width);
  height: 20px;
  margin: 0 var(--space-2);
  background: var(--border-strong);
}

/* The Import file picker is driven programmatically by its header button. */
.hiddenInput {
  display: none;
}

.panes {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
}

/*
 * Side panes (library, preview) carry an explicit width (set inline from the
 * PanesStore) and don't grow or shrink — the drag handles change that width.
 * The editor between them flexes to fill the remainder, so a drag leaves the
 * opposite side pane untouched (spec §01A). Panes are separated by the
 * ResizeHandle, so no inter-pane borders here.
 */
.pane {
  flex: 0 0 auto;
  min-width: 0;
  overflow: auto;
  background: var(--bg);
}

/* Editor pane: Monaco manages its own scroll/layout, so no padding. */
.paneEditor {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  background: var(--bg);
}

/* Onboarding canvas fills the whole panes area when the library is empty (it
   replaces the entire chrome, not just editor+preview); it scrolls internally. */
.paneOnboarding {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  background: var(--bg);
}
