/* ring: commons
 * seed: snap
 * still: ./still.md
 * reduced: replace (finished glyph — no frame play)
 * when-not: how-strip films, type chips, a row of unrelated buttons, plane-lerp "morph" (vignette groups), interpolating unequal-topology d
 *
 * C-TOOLBAR — 44px hits. Glyph morph is two-frame snap of path d (morph-d, topology
 * may be unequal). NEVER vignette plane-lerp. Overflow moves tools into More.
 */

[data-c-toolbar] {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  color: var(--os-ink);
}

[data-c-toolbar] .c-toolbar-well {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  border: 1px solid var(--os-rule);
  border-radius: var(--os-radius-md);
  background: var(--os-ground);
  padding: 4px;
}

[data-c-toolbar] .c-toolbar-btn {
  box-sizing: border-box;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  margin: 0;
  flex: 0 0 44px;
  border: 0;
  border-radius: var(--os-radius-sm);
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

[data-c-toolbar] .c-toolbar-btn svg {
  width: 20px;
  height: 20px;
  display: block;
  overflow: visible;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[data-c-toolbar] .c-toolbar-btn svg circle {
  fill: currentColor;
  stroke: none;
}

[data-c-toolbar] .c-toolbar-btn:focus-visible {
  outline: var(--os-focus-ring-width) solid var(--os-focus-ring-color);
  outline-offset: var(--os-focus-ring-offset);
}

[data-c-toolbar] [data-c-toolbar-morph] [data-frame="close"] {
  visibility: hidden;
}

[data-c-toolbar] [data-c-toolbar-morph][data-glyph="close"] [data-frame="plus"] {
  visibility: hidden;
}

[data-c-toolbar] [data-c-toolbar-morph][data-glyph="close"] [data-frame="close"] {
  visibility: visible;
}

[data-c-toolbar] [data-c-toolbar-more] {
  flex: 0 0 44px;
}

[data-c-toolbar] [data-c-toolbar-more][hidden] {
  display: none;
}

[data-c-toolbar] [data-c-toolbar-overflow] {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: min(100%, 220px);
  padding: 8px;
  border: 1px solid var(--os-rule);
  border-radius: var(--os-radius-md);
  background: var(--os-ground);
  box-shadow: var(--os-press-shadow-out);
}

[data-c-toolbar] [data-c-toolbar-overflow][hidden] {
  display: none;
}

[data-c-toolbar] [data-c-toolbar-overflow] .c-toolbar-btn {
  flex: 0 0 44px;
}

html[data-theme="night"] [data-c-toolbar],
html[data-night="1"] [data-c-toolbar] {
  color: var(--os-ground);
}

html[data-theme="night"] [data-c-toolbar] .c-toolbar-well,
html[data-theme="night"] [data-c-toolbar] [data-c-toolbar-overflow],
html[data-night="1"] [data-c-toolbar] .c-toolbar-well,
html[data-night="1"] [data-c-toolbar] [data-c-toolbar-overflow] {
  background: color-mix(in oklab, var(--os-ground-void) 88%, var(--os-ground));
  border-color: color-mix(in oklab, var(--os-ground) 16%, transparent);
}
