/* Sequence: the tree of , a vertical flow of step cards on a connector line, a "+" before every step and at every run's end, and a branching step's outcomes side by side when there is room, stacked when there is not. One sheet, two uses: the element adopts it as is, and dist/sequence.css is the same rules raw, for the page to . So every selector starts at the tag: that is its scope. The editor's controls are the page's markup; the sheet lays them out one per row and gives every control and button 44px. State is attributes: [data-editing] and [data-readonly] on the host, [data-open] on an adder whose menu shows, [data-confirming] and [data-unknown] on a card, [data-step] and [data-kind] on each step's item. Theming: every value is a --pebble-sequence-* custom property with a fallback, light and dark defaults chosen by prefers-color-scheme; page tokens (--accent) inherit in. */ pebble-sequence { --_ink: var(--pebble-sequence-ink, #1a1a1a); --_muted: var(--pebble-sequence-muted, #5c5f66); --_surface: var(--pebble-sequence-surface, #ffffff); --_border: var(--pebble-sequence-border, #d0d0d0); --_line: var(--pebble-sequence-line, #c3c7cc); --_accent: var(--pebble-sequence-accent, var(--accent, #1971c2)); --_danger: var(--pebble-sequence-danger, #c92a2a); --_radius: var(--pebble-sequence-radius, 0.5rem); --_size: var(--pebble-sequence-size, 44px); --_gap: var(--pebble-sequence-gap, 0.75rem); display: block; color: var(--_ink); container-type: inline-size; } @media (prefers-color-scheme: dark) { pebble-sequence { --_ink: var(--pebble-sequence-ink, #f1f3f5); --_muted: var(--pebble-sequence-muted, #adb5bd); --_surface: var(--pebble-sequence-surface, #1f1f1f); --_border: var(--pebble-sequence-border, #495057); --_line: var(--pebble-sequence-line, #5c636a); --_danger: var(--pebble-sequence-danger, #ff8787); } } pebble-sequence button, pebble-sequence .fields :is(input, select, textarea) { min-height: var(--_size); box-sizing: border-box; font: inherit; } pebble-sequence .run { list-style: none; margin: 0; padding: 0; } pebble-sequence .item { display: flex; flex-direction: column; align-items: flex-start; } /* the connector: every adder draws the line from the card above */ pebble-sequence .adder { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-inline-start: 1.25rem; padding-block: 0.25rem; border-inline-start: 2px solid var(--_line); } pebble-sequence .add { inline-size: var(--_size); margin-inline-start: calc(var(--_size) / -2 - 1px); border: none; background: none; padding: 0; cursor: pointer; display: grid; place-items: center; color: var(--_muted); } pebble-sequence .add > span { display: grid; place-items: center; inline-size: 1.75rem; block-size: 1.75rem; border-radius: 50%; border: 1px solid var(--_border); background: var(--_surface); font-size: 1.125rem; line-height: 1; } pebble-sequence .add:hover > span, pebble-sequence .adder[data-open] .add > span { border-color: var(--_accent); color: var(--_accent); } pebble-sequence .menu { display: flex; flex-wrap: wrap; gap: 0.5rem; } pebble-sequence .kind, pebble-sequence .actions button, pebble-sequence .editor-actions button { padding-inline: 0.875rem; border: 1px solid var(--_border); border-radius: var(--_radius); background: var(--_surface); color: inherit; cursor: pointer; } pebble-sequence .kind:hover, pebble-sequence .actions button:hover:not(:disabled), pebble-sequence .editor-actions button:hover { border-color: var(--_accent); } pebble-sequence button:disabled { cursor: default; opacity: 0.5; } pebble-sequence button:focus-visible { outline: 2px solid var(--_accent); outline-offset: 2px; } pebble-sequence .mark { display: inline-block; padding: 0.125rem 0.625rem; border-radius: 999px; border: 1px solid var(--_border); color: var(--_muted); font-size: 0.875em; } pebble-sequence .card, pebble-sequence .editor { box-sizing: border-box; inline-size: min(100%, var(--pebble-sequence-card-width, 32rem)); border: 1px solid var(--_border); border-radius: var(--_radius); background: var(--_surface); padding: 0.5rem 0.75rem; } pebble-sequence .card { display: flex; align-items: center; gap: var(--_gap); } pebble-sequence .text { flex: 1; min-inline-size: 0; display: flex; flex-direction: column; } pebble-sequence .label { font-weight: 600; } pebble-sequence .summary { color: var(--_muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } pebble-sequence .summary:empty { display: none; } pebble-sequence .actions { flex: none; display: flex; gap: 0.5rem; } pebble-sequence .card[data-confirming] .remove { border-color: var(--_danger); color: var(--_danger); } pebble-sequence .card[data-unknown] { border-style: dashed; } pebble-sequence .editor { border-color: var(--_accent); display: grid; gap: var(--_gap); } pebble-sequence .fields { display: grid; gap: var(--_gap); } pebble-sequence .fields label { display: grid; gap: 0.25rem; } pebble-sequence .fields :is(input:not([type="checkbox"], [type="radio"]), select, textarea) { inline-size: 100%; } pebble-sequence .editor-actions { display: flex; gap: 0.5rem; } pebble-sequence .done { border-color: var(--_accent); } /* outcomes: stacked under the card, side by side once each can have 16rem */ pebble-sequence .branches { display: grid; gap: var(--_gap); inline-size: 100%; box-sizing: border-box; margin-block-start: 0.25rem; padding-inline-start: 1.25rem; } @container (min-width: 36rem) { pebble-sequence .branches { grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); } } pebble-sequence .branch { min-inline-size: 0; padding-inline-start: var(--_gap); border-inline-start: 2px solid var(--_line); } pebble-sequence .outcome { display: inline-block; margin-block-end: 0.25rem; font-weight: 600; color: var(--_accent); font-size: 0.875em; } pebble-sequence[data-readonly] .adder { min-block-size: var(--_gap); }