/* The one chrome vocabulary — the interactive primitives both viewers
   build their UI from. One border, one hover, one focus, one active
   state, defined here and nowhere else. */

/* Focus: one visible ring everywhere. */
.pill:focus-visible,
.ctl:focus-visible,
.ghost-btn:focus-visible,
.chrome-card:focus-visible,
.handle:focus-visible {
  outline: 2px solid var(--color-ring);
  outline-offset: 1px;
}

/* Segmented pill group: one bordered container, dividers between
   segments, the active segment accent-tinted. */
.pill-group {
  pointer-events: auto;
  display: flex;
  align-items: stretch;
  /* The segmented control's frame. The generic border token is white at
     10% in dark — invisible on the near-black header — so the control
     carries its own dark override. */
  --seg-border: var(--color-border);
  border: 1px solid var(--seg-border);
  border-radius: 8px;
  overflow: hidden;
  font-size: 12px;
}
[data-theme='dark'] .pill-group {
  --seg-border: oklch(1 0 0 / 28%);
}
.pill {
  border: none;
  border-radius: 0;
  padding: 4px 10px;
  font: inherit;
  font-size: 12px;
  line-height: 16px;
  background: var(--color-background);
  color: var(--color-muted-foreground);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.pill + .pill {
  border-left: 1px solid var(--seg-border);
}
/* No divider against the selected segment — its filled block meets the
   neighbor cleanly; transparent (not none) keeps the 1px geometry. */
.pill.on + .pill,
.pill[aria-current] + .pill,
.pill + .pill.on,
.pill + .pill[aria-current] {
  border-left-color: transparent;
}
.pill:hover {
  background: var(--color-accent);
  color: var(--color-accent-foreground);
}
.pill.on,
.pill[aria-current] {
  /* The active segment fills its cell inside the group's one continuous
     border — no ring overlay, so both segments share one silhouette. */
  background: var(--color-accent);
  color: var(--color-accent-foreground);
}

/* Bordered pill button (a one-segment group). */
.ctl {
  pointer-events: auto;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 4px 10px;
  font: inherit;
  font-size: 12px;
  line-height: 16px;
  background: var(--color-background);
  color: var(--color-foreground);
  cursor: pointer;
}
.ctl:hover {
  background: var(--color-accent);
  color: var(--color-accent-foreground);
}

/* Borderless icon button (the theme toggle's kind). */
.ghost-btn {
  pointer-events: auto;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  padding: 0;
  background: transparent;
  color: var(--color-foreground);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.ghost-btn:hover {
  background: var(--color-accent);
  color: var(--color-accent-foreground);
}

/* Popover card. */
.menu {
  position: absolute;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
  z-index: 30;
}

/* Gallery card: bordered, accent on hover with the one lift. */
.chrome-card {
  border: 1px solid var(--color-border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--color-card);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.chrome-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

/* One vertical rhythm for both home landings (design gallery, manual
   subject grid): the hero block starts at the same window height on
   either page — the header floats over both full-bleed canvases. */
.home-landing {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 89px 24px 48px;
}

/* One header geometry for both pages — height, alignment, padding come
   from this rule alone. */
.app-header {
  box-sizing: border-box;
  height: 41px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}
.app-header .header-lead {
  display: flex;
  align-items: center;
  gap: 12px;
}
