1/* Compose your own: one working copy, shown in two real slots.23 The editor has two faces. Rules up to "The workbench" style the strip a4 lesson teaches and what both faces share: the previews, the empty marker5 and the cues of a move. The workbench's own rules all begin `.workbench`. */6.editor-panel {7display: contents;8}9.bar [hidden] {10display: none;11}12.starter[hidden],13.workspace[hidden] {14display: none;15}16.starter {17display: flex;18flex-wrap: wrap;19align-items: baseline;20gap: 8px16px;21}22.start-action {23padding: 8px14px;24border: 1pxsolidvar(--ink);25border-radius: 4px;26color: var(--ink);27font-weight: 600;28}29.start-blank {30color: var(--ink);31padding: 8px4px;32}33.starter-note {34color: var(--quiet);35font-size: 12px;36}3738/* Each preview is a host of its own size. These are demonstration slots:39 ordinary CSS sizes them, and the composition inside responds to the space40 it is given. Side by side when the page has room, one above the other41 when it does not; neither can be wider than the page. */42.previews {43display: flex;44flex-wrap: wrap;45align-items: flex-start;46gap: 12px24px;47}48.preview {49min-inline-size: 0;50max-inline-size: 100%;51}52.preview[data-preview="wide"] {53flex: 11560px;54}55.preview[data-preview="rail"] {56flex: 01260px;57}58.preview[data-preview="rail"] .stage {59padding-inline-end: 0;60}61.preview[data-preview="rail"] .viewport {62inline-size: 260px;63}64.preview-label {65padding: 4px0;66}67/* One readout for each view: the selected item, or its Switchers' result.68 Two lines are reserved so a selection does not move the controls below. */69.preview.caption {70min-block-size: 2lh;71}72.preview.caption:has(.selection:not(:empty)) .note {73display: none;74}7576/* A group with no members, or a text with no characters, renders nothing.77 An outline marks its place. It adds no size to the layout and no extent to78 a scrolling Shelf; the declaration is where such a node is selected. */79.rendered:is(.node, .leaf)[data-empty="true"] {80outline: 1pxdottedcolor-mix(insrgb, var(--ink) 60%, transparent);81outline-offset: 4px;82}83.rendered84:is(.node, .leaf)[data-empty="true"]:is(85 [data-chosen="true"],86 [data-inspected="true"]87 ) {88outline: 1.5pxsolidvar(--ink);89outline-offset: 4px;90}9192/* The text of the one selected fact. It sits outside the previews, which are93 replaced as it changes. */94.working.text-edit {95flex-basis: 100%;96flex-wrap: nowrap;97margin-block-start: 0;98}99.working.text-editinput {100min-inline-size: 0;101}102.working.text-editinput:disabled {103opacity: 0.55;104}105.creation {106display: flex;107align-items: baseline;108flex-wrap: wrap;109gap: 8px20px;110flex-basis: 100%;111}112.creationlabel {113display: inline-flex;114align-items: baseline;115gap: 8px;116}117.creationselect {118font: inherit;119color: var(--ink);120background: var(--paper);121border: 1pxsolidvar(--line);122border-radius: 4px;123padding: 4px6px;124}125.creationselect:focus-visible {126outline: 2pxsolidvar(--ink);127outline-offset: 3px;128}129@media (pointer: coarse) {130.creationselect,131.starterbutton {132min-block-size: 44px;133 }134}135136/* Keep editing beside the visible part of a tall comparison. Sticky remains137 bounded by this workspace and releases at the strip's normal position.138 Short windows retain ordinary flow so the controls cannot cover the view.139 This query sizes teaching chrome; primitives still adapt intrinsically. */140@media (min-height: 40rem) and (pointer: fine),141 (min-height: 56rem) and (pointer: coarse) {142.working {143position: sticky;144inset-block-end: 0;145z-index: 2;146margin-block-end: 0;147padding-block: 10px14px;148border-block-start: 1pxsolidvar(--line);149background: var(--paper);150max-block-size: 40dvh;151overflow: auto;152 }153/* Native keyboard scrolling reserves the strip's maximum footprint.154 Mouse selection keeps its position; no rectangle tracking is needed.155 The workbench has no strip over its previews. */156:host(:not([standalone])) .rendered.node[tabindex="0"]:focus-visible {157scroll-margin-block-end: 42dvh;158 }159}160.working.inside-action,161.working.after-action {162color: var(--ink);163font-weight: 600;164}165/* Their wording follows the selection; reserve room so neighbors stay put. */166.working.inside-action {167min-inline-size: 10em;168text-align: start;169}170.working.after-action {171min-inline-size: 8em;172text-align: start;173}174@media (forced-colors: active) {175.rendered:is(.node, .leaf)[data-empty="true"] {176outline: 1pxdottedGrayText;177outline-offset: 4px;178 }179.rendered180:is(.node, .leaf)[data-empty="true"]:is(181 [data-chosen="true"],182 [data-inspected="true"]183 ) {184outline: 2pxsolidHighlight;185outline-offset: 4px;186 }187.start-action {188border-color: ButtonText;189 }190}191192/* Move keeps the authored selection while choosing a separate destination.193 Both are painted on existing boxes; no measured overlay participates. */194/* Every moving member has its own solid edge, including a run and forced195 colors. Inset edges survive native clipping inside a scrolling Shelf. */196.workspace[data-moving]197.rendered198:is(.node, .leaf)[data-chosen="true"]:not([data-empty="true"]) {199outline: 1.5pxsolidvar(--ink);200outline-offset: -1.5px;201}202.rendered:is(.node, .leaf)[data-destination] {203outline: 2pxdashedvar(--ink);204outline-offset: -2px;205}206/* A destination underline coexists with the ordinary solid focus ring. */207.code-name[data-destination] {208text-decoration: underlinedashed;209text-decoration-thickness: 2px;210text-underline-offset: 3px;211}212/* While a move's destination is being chosen, its controls stand in for213 the others. */214.workspace[data-moving]215.working216>:is(.text-edit, .arrangement, .creation, .composition-actions, .history),217.workspace[data-moving] .inspector-body {218display: none;219}220.move-controls {221display: flex;222flex-wrap: wrap;223flex-basis: 100%;224gap: 6px16px;225}226.move-source,227.move-destination {228flex-basis: 100%;229overflow-wrap: anywhere;230}231.move-source {232font-weight: 600;233}234.move-destination {235color: var(--quiet);236}237.move-placements {238display: flex;239flex-wrap: wrap;240gap: 6px20px;241}242.move-placementsbutton:not(.cancel-move):enabled,243.move-action:enabled {244color: var(--ink);245font-weight: 600;246}247.move-placements.cancel-move {248margin-inline-start: 12px;249}250@media (forced-colors: active) {251.workspace[data-moving] .rendered:is(.node, .leaf)[data-chosen="true"] {252outline-color: Highlight;253 }254.rendered:is(.node, .leaf)[data-destination] {255outline-color: CanvasText;256 }257.code-name[data-destination] {258text-decoration-color: CanvasText;259 }260}261262/* Empty groups have no area to paint inside; mark their native zero-sized263 box, with a stronger dash than the idle dotted placeholder. Code remains264 their complete selector. */265.rendered:is(.node, .leaf)[data-empty="true"][data-destination] {266outline: 2pxdashedvar(--ink);267outline-offset: 4px;268}269@media (forced-colors: active) {270.code-name[data-chosen="true"] {271text-decoration: underlinesolid;272text-decoration-thickness: 2px;273text-underline-offset: 3px;274 }275.code-name[data-destination] {276text-decoration-style: dashed;277 }278.rendered:is(.node, .leaf)[data-empty="true"][data-destination] {279outline-color: CanvasText;280 }281}282283/* Scrollable Shelves are keyboard stops. Their native focus ring takes284 precedence while focused; the code cue and destination label remain. */285.rendered.node[data-destination]:focus-visible,286.workspace[data-moving] .rendered.node[data-chosen="true"]:focus-visible {287outline: 2pxsolidvar(--ink);288outline-offset: 3px;289}290@media (forced-colors: active) {291.rendered.node[data-destination]:focus-visible,292.workspace[data-moving] .rendered.node[data-chosen="true"]:focus-visible {293outline-color: Highlight;294 }295}296297/* ------------------------------------------------------------------------298 The workbench: the editor on its own page.299300 The result is on top, in its two real slots. Below it the hierarchy sits301 beside an inspector for whatever is selected there. Nothing here sizes a302 composition: these rules lay out editing chrome, and the previews remain303 hosts that ordinary CSS sizes.304305 Type is sized on the chrome and never on an ancestor of the previews: the306 separation between a row's members follows the font size it inherits.307 ------------------------------------------------------------------------ */308:host([standalone]) {309margin: 0;310}311.workbench {312display: grid;313grid-template-columns: minmax(0, 1fr);314gap: 24px;315}316.workbench [hidden] {317display: none!important;318}319.workbenchh2 {320margin: 0;321font-size: 14px;322font-weight: 650;323line-height: 1.4;324}325/* The chrome's own buttons. Names in the hierarchy have their own rules. */326.workbench327:where(.document-actions, .hierarchy-head, .view-choice, .inspector)328button {329padding: 6px0;330color: var(--ink);331}332.workbench333:where(.document-actions, .hierarchy-head, .view-choice, .inspector)334button:disabled {335color: var(--quiet);336opacity: 0.6;337cursor: default;338}339340/* The result, and what acts on the whole composition. */341.workbench.results {342min-inline-size: 0;343}344.workbench.results-head {345display: flex;346flex-wrap: wrap;347align-items: baseline;348justify-content: space-between;349gap: 6px24px;350margin-block-end: 12px;351font-size: 12px;352}353.workbench.results-hint {354margin-block-start: 2px;355color: var(--quiet);356line-height: 1.5;357}358.workbench.document-actions {359display: flex;360flex-wrap: wrap;361gap: 020px;362}363.workbench.result-views:focus-visible {364outline: 2pxsolidvar(--ink);365outline-offset: 2px;366}367/* A tall result scrolls within about half the window, so the editor below368 stays in reach while it changes. The box has no height of its own: a short369 result leaves no empty canvas. The gutter is reserved so that a scrollbar370 appearing cannot change the space the previews are offered. Short windows371 keep ordinary flow. This query sizes editing chrome only. */372@media (min-height: 40rem) {373.workbench.result-views {374max-block-size: 55dvh;375/* Room for a focus ring at the box's edges, which now clip. */376padding-block: 4px;377overflow: hiddenauto;378scrollbar-gutter: stable;379 }380}381/* The card is as wide as it was asked to be, with the rail beside it. This382 independent box says how wide the card may become; the 24px is the room383 the card's stage keeps for its grip. */384.workbench.preview-limit {385position: relative;386inline-size: calc(100%-24px);387block-size: 0;388}389.workbench.previews {390gap: 16px24px;391}392.workbench.preview[data-preview="wide"] {393flex: 01auto;394}395.workbench.empty-hint {396margin-block-start: 8px;397color: var(--quiet);398font-size: 12px;399}400/* The inspector names the selection, so each view keeps reporting what its401 Switchers did. Showing structure brings the selected group's measured402 readout back in its place. */403.workbench404.preview:not(:has(.rendered[data-structure="true"]))405.caption406.selection {407display: none;408}409.workbench410.preview:not(:has(.rendered[data-structure="true"]))411.caption412.note:not(:empty) {413display: inline;414}415/* A selected box has a wash and a flat inset edge, one for each member of a416 run. The edge is the cue that remains where colors are forced. It yields417 to the empty marker, a move's destination and keyboard focus. */418.workbench:where(.rendered) :where(.node, .leaf)[data-chosen="true"] {419outline: 1.5pxsolidvar(--ink);420outline-offset: -1.5px;421}422423/* The hierarchy beside the inspector. */424.workbench.editing {425display: grid;426grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);427align-items: start;428padding-block-start: 18px;429border-block-start: 1pxsolidvar(--line);430font-size: 13px;431}432.workbench.hierarchy {433min-inline-size: 0;434padding-inline-end: 24px;435}436.workbench.inspector {437min-inline-size: 0;438padding-inline-start: 24px;439border-inline-start: 1pxsolidvar(--line);440}441.workbench.hierarchy-head {442display: flex;443flex-wrap: wrap;444align-items: baseline;445justify-content: space-between;446gap: 016px;447}448.workbench.view-choice {449display: flex;450gap: 16px;451margin-block-end: 6px;452}453.workbench:is(.hierarchy-head, .view-choice) button {454font-size: 12px;455}456.workbench.view-choicebutton {457color: var(--quiet);458}459/* A choice that is on is underlined, as a link in use would be. */460.workbench:is(.view-choicebutton, .several)[aria-pressed="true"] {461color: var(--ink);462text-decoration: underline;463text-decoration-thickness: 1.5px;464text-underline-offset: 5px;465}466.workbench.select-help {467margin-block-end: 8px;468color: var(--quiet);469font-size: 12px;470line-height: 1.5;471}472/* A long composition scrolls in its list. */473.workbench:is(.outline, .source) {474max-block-size: min(24rem, 50dvh);475overflow: auto;476}477.workbenchpre {478margin: 0;479padding: 4px8px;480border-radius: 0;481background: none;482}483484/* The inspector: what is selected, then what can be done with it. */485.workbench.selection-context {486margin-block-end: 14px;487}488.workbench.inspector.parent {489display: block;490padding: 004px;491font-size: 12px;492}493.workbench.inspector.selected-title {494display: inline;495font-size: 17px;496}497.workbench.selected-detail {498margin-inline-start: 8px;499color: var(--quiet);500font-size: 12px;501}502.workbench.wording {503display: grid;504gap: 6px;505color: var(--quiet);506font-size: 12px;507}508.workbench.wordinginput {509inline-size: 100%;510min-inline-size: 0;511padding: 8px10px;512border: 1pxsolidvar(--line);513border-radius: 3px;514background: var(--paper);515color: var(--color-text, #26332c);516font-size: 14px;517}518.workbench.choice {519min-inline-size: 0;520margin: 16px00;521padding: 0;522border: 0;523}524.workbench.choicelegend {525margin-block-end: 4px;526padding: 0;527color: var(--quiet);528font-size: 12px;529}530.workbench.choicelabel {531display: inline-flex;532align-items: center;533gap: 6px;534margin-inline-end: 16px;535padding-block: 4px;536cursor: pointer;537}538.workbench.group-arrangementlabel {539display: flex;540margin-inline-end: 0;541}542.workbench.choiceinput {543inline-size: 1em;544block-size: 1em;545margin: 0;546accent-color: var(--ink);547}548.workbench.choicesmall {549margin-inline-start: 4px;550color: var(--quiet);551font-size: 11px;552}553.workbench.choicep {554margin-block-start: 6px;555color: var(--quiet);556font-size: 12px;557line-height: 1.5;558}559.workbench.add-area {560margin-block-start: 18px;561padding-block-start: 14px;562border-block-start: 1pxsolidvar(--line);563}564.workbench.insertion-context {565color: var(--quiet);566font-size: 12px;567}568.workbench.inspector.place-toggle {569margin-inline-start: 12px;570padding: 0;571font-size: 12px;572}573.workbench.add-actions {574display: flex;575flex-wrap: wrap;576align-items: baseline;577gap: 4px16px;578margin-block-start: 8px;579}580.workbench.add-groups {581display: inline-flex;582flex-wrap: wrap;583align-items: baseline;584gap: 014px;585color: var(--quiet);586font-size: 12px;587}588.workbench.selection-actions {589display: flex;590flex-wrap: wrap;591gap: 020px;592margin-block-start: 12px;593font-size: 12px;594}595/* An action that does not apply to the selection is not shown. */596.workbench.selection-actionsbutton:disabled {597display: none;598}599.workbench.inspector.move-action {600font-weight: 400;601}602.workbench.inspector.remove-action {603margin-inline-start: auto;604color: var(--quiet);605}606/* The one action a selection most invites: adding to it, or grouping a run. */607.workbench.inspector.add-text,608.workbench.inspector[data-multiple] .group-action {609padding: 6px12px;610border-radius: 3px;611background: var(--ink);612color: var(--paper);613font-weight: 600;614}615.workbench.inspector.add-text:disabled,616.workbench.inspector[data-multiple] .add-text {617padding: 6px0;618background: none;619color: var(--ink);620font-weight: 400;621}622.workbench.inspector.add-text:disabled {623color: var(--quiet);624}625.workbench.move-source {626font-size: 15px;627}628.workbench.author-status {629display: block;630min-block-size: 1lh;631margin-block-start: 14px;632color: var(--quiet);633font-size: 12px;634line-height: 1.5;635}636637@media (width<44rem) {638.workbench.editing {639grid-template-columns: minmax(0, 1fr);640 }641.workbench.hierarchy {642padding-inline-end: 0;643 }644.workbench.inspector {645margin-block-start: 16px;646padding: 16px00;647border-inline-start: 0;648border-block-start: 1pxsolidvar(--line);649 }650.workbench:is(.outline, .source) {651max-block-size: 14rem;652 }653}654@media (pointer: coarse) {655.workbench656:where(.document-actions, .hierarchy-head, .view-choice, .inspector)657button,658.workbench.choicelabel,659.workbench.wordinginput {660min-block-size: 44px;661 }662}663@media (forced-colors: active) {664/* Stronger than the edge every box gets while structure is shown, and665 still behind the empty marker, a destination and keyboard focus. */666.workbench667.rendered668:is(.node, .leaf)[data-chosen="true"]:not(669 [data-empty],670 [data-destination],671:focus-visible672 ) {673outline: 2pxsolidHighlight;674outline-offset: -2px;675 }676.workbench.inspector:not([data-multiple]) .add-text:enabled,677.workbench.inspector[data-multiple] .group-action {678border: 1pxsolidButtonText;679 }680}