/* Map painting: the Paint tab, the Painting section in Inspect, badges on painted areas, and drafts over the board. */
:is(.workspace-leaf-content, .wl-page)[data-type="world-builder-map-paint"] > :is(.view-header, .wl-page-header) { display: none; }
:is(.workspace-leaf-content, .wl-page)[data-type="world-builder-map-paint"] > :is(.view-content, .wl-page-content) { padding: 12px 14px 0; overflow: auto; display: flex; flex-direction: column; gap: 12px; container-type: inline-size; }
.wb-map-paint-view > .wb-map-panel-heading { padding: 0 0 6px; }
.wb-map-paint-view > .wb-feature-note { margin: 0 0 12px; font-size: 11px; line-height: 1.5; color: var(--wl-text-2); }
.wb-map-paint-view > .wb-map-form-error:empty, .wb-map-feature-details .wb-map-form-error:empty { display: none; }
.wb-map-paint-view > .wb-map-form-error { margin: 0 0 12px; font-size: 11px; color: var(--wl-danger); }
.wb-map-paint-view .wb-feature-field { margin: 0; gap: 7px; font-size: 11px; min-width: 0; }
.wb-map-paint-view .wb-feature-field select { height: 32px; font-size: 12px; padding: 4px 7px; }
.wb-map-paint-view .wb-feature-field textarea { width: 100%; min-height: 64px; resize: vertical; box-sizing: border-box; font-size: 12px; line-height: 1.5; padding: 7px 9px; color: var(--wl-text); }
.wb-map-paint-view .wb-feature-note { margin: 0; font-size: 11px; line-height: 1.5; }
.wb-map-paint-view .wb-feature-lock { margin: 0; }

/* One choice of a few, as one control: Not painted · Ground · Prop, This computer · OpenRouter. A recessed track; the
   one that is on takes the selection's ice. */
.wb-paint-switch { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 2px; padding: 2px; border-radius: var(--r-md); background: var(--wl-inset); border: 1px solid var(--wl-line); }
.wb-paint-switch > button { min-height: 30px; padding: 4px 6px; font-size: 11px; border-radius: calc(var(--r-md) - 3px); background: transparent; box-shadow: none; color: var(--wl-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb-paint-switch > button:hover:not(:disabled) { color: var(--wl-text); background: var(--wl-raised); }
.wb-paint-switch > button[aria-pressed="true"] { color: var(--wl-text); background: var(--wl-selection-soft); box-shadow: none; font-weight: 600; }
.wb-paint-switch > button:disabled { opacity: .45; cursor: default; }
.wb-paint-switch > button:focus-visible { outline: 2px solid var(--wl-selection); outline-offset: -2px; }
.wb-paint-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.wb-paint-chip { height: 26px; padding: 0 10px; border-radius: var(--r-md); font-size: 11px; color: var(--wl-text-2); background: transparent; border: 1px solid var(--wl-line); box-shadow: none; }
.wb-paint-chip:hover:not(:disabled) { color: var(--wl-text); background: var(--wl-raised); }
.wb-paint-chip[aria-pressed="true"] { color: var(--wl-text); background: var(--wl-selection-soft); border-color: var(--wl-selection); }
.wb-paint-prop-row { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 10px; }
.wb-paint-measure { margin: 0; font-family: var(--wl-font-mono); font-size: 11px; line-height: 1.5; color: var(--wl-text-3); font-variant-numeric: tabular-nums; }
@media (pointer: coarse) { .wb-paint-switch > button { min-height: 36px; } .wb-paint-chip { height: 32px; } }

/* Styles: yours, then the presets, each a strip of its colours over its name. The chosen one opens in a card below. */
.wb-paint-group-title { margin: 0 0 -6px; font-size: 11px; font-weight: 600; color: var(--wl-text-3); }
.wb-paint-styles { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 6px; }
.wb-paint-style.wb-paint-style-new { justify-content: center; align-items: center; gap: 2px; border-style: dashed; color: var(--wl-text-2); }
.wb-paint-style.wb-paint-style-new:hover:not(:disabled) { color: var(--wl-text); }
.wb-paint-plus { font-size: 16px; line-height: 14px; height: 14px; font-weight: 400; }
/* The panel's cards paint nothing of their own (the frame shows through, as in Inspect's sections): a hairline holds them. */
.wb-paint-style-card { display: flex; flex-direction: column; gap: 10px; padding: 10px; border-radius: var(--r-md); background: transparent; border: 1px solid var(--wl-line); animation: wl-in var(--wl-base, .18s) var(--wl-ease-out, ease-out); }
.wb-paint-style-card > header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
.wb-paint-style-card > header strong { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-paint-style-card > header small { flex-shrink: 0; font-size: 11px; color: var(--wl-text-3); }
.wb-paint-style-card .wb-map-media-control { margin: 0; }
.wb-paint-style-card .wb-map-media-row { background: var(--wl-inset); }
.wb-paint-look { margin: 0; font-size: 11px; line-height: 1.5; color: var(--wl-text-2); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.wb-paint-card-button { align-self: flex-start; min-height: 28px; font-size: 11px; }
.wb-paint-colours { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.wb-paint-colours input[type="color"] { width: 100%; height: 26px; padding: 0; border: 1px solid var(--wl-line); border-radius: var(--r-sm); background: none; cursor: pointer; }
.wb-paint-colours input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.wb-paint-colours input[type="color"]::-webkit-color-swatch { border: none; border-radius: calc(var(--r-sm) - 1px); }
.wb-paint-colours input[type="color"]:disabled { cursor: default; opacity: .6; }
.wb-paint-style { display: flex; flex-direction: column; align-items: stretch; gap: 6px; height: auto; min-height: 44px; padding: 6px; border-radius: var(--r-md); font-size: 11px; text-align: left; background: transparent; border: 1px solid var(--wl-line); box-shadow: none; color: var(--wl-text); }
.wb-paint-style > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb-paint-style:hover:not(:disabled) { background: var(--wl-raised); }
.wb-paint-style[aria-pressed="true"] { border-color: var(--wl-selection); background: var(--wl-selection-soft); box-shadow: none; }
.wb-paint-swatch { display: flex; height: 14px; border-radius: var(--r-xs); overflow: hidden; }
.wb-paint-swatch > i { flex: 1; }
/* In a narrow panel each style is one short row: its colours beside its name. */
@container (max-width: 280px) {
  .wb-paint-styles { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .wb-paint-style, .wb-paint-style.wb-paint-style-new { flex-direction: row; align-items: center; justify-content: flex-start; gap: 8px; min-height: 32px; padding: 5px 7px; }
  .wb-paint-style > .wb-paint-swatch { width: 30px; flex-shrink: 0; }
  .wb-paint-plus { width: 30px; text-align: center; }
}

/* What is here: the painted areas and props, each opening its painting in Inspect. */
.wb-paint-list-title { margin: 0; font-size: 11px; font-weight: 600; color: var(--wl-text-2); }
.wb-paint-list { display: flex; flex-direction: column; gap: 2px; margin-top: -8px; }
.wb-paint-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; height: auto; min-height: 36px; padding: 6px 8px; border-radius: var(--r-sm); font-size: 12px; text-align: left; background: transparent; box-shadow: none; }
.wb-paint-item:hover { background: var(--wl-raised); }
.wb-paint-item strong { font-weight: 500; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-paint-item small { font-size: 11px; color: var(--wl-text-3); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* OpenRouter models: the chosen one alone with Change, which opens the list: name over price, the chosen one outlined.
   Prices are numbers, in mono. */
.wb-paint-chosen { display: flex; align-items: center; gap: 8px; padding: 7px 7px 7px 9px; border-radius: var(--r-md); border: 1px solid var(--wl-line); background: transparent; }
.wb-paint-chosen > span { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.wb-paint-chosen strong { font-size: 12px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-paint-chosen small { font-family: var(--wl-font-mono); font-size: 11px; color: var(--wl-text-3); font-variant-numeric: tabular-nums; }
.wb-paint-change { flex-shrink: 0; min-height: 28px; font-size: 11px; }
.wb-paint-models { display: flex; flex-direction: column; gap: 4px; }
.wb-paint-model { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; height: auto; min-height: 40px; padding: 7px 9px; border-radius: var(--r-md); font-size: 12px; text-align: left; background: transparent; border: 1px solid var(--wl-line); box-shadow: none; }
.wb-paint-model:hover:not(:disabled) { background: var(--wl-raised); }
.wb-paint-model[aria-pressed="true"] { border-color: var(--wl-selection); background: var(--wl-selection-soft); box-shadow: none; }
.wb-paint-model strong { font-weight: 500; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-paint-model small { font-family: var(--wl-font-mono); font-size: 11px; color: var(--wl-text-3); font-variant-numeric: tabular-nums; }
.wb-map-paint-view .wb-map-form-error { margin: 0; font-size: 11px; color: var(--wl-danger); }

/* The painting itself stays in reach at the foot of the tab, painted with the panel's own frame so it matches. */
.wb-paint-run { position: sticky; bottom: 0; margin: auto -14px 0; padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px; background: var(--wl-frame, var(--wl-surface)); border-top: 1px solid var(--wl-line); }
.wb-paint-run .wb-feature-note { margin: 0; font-size: 11px; line-height: 1.5; color: var(--wl-text-2); }
.wb-paint-engine { margin: 0; display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--wl-text-2); }
.wb-paint-engine::before { content: ''; width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; background: var(--wl-text-3); }
.wb-paint-engine[data-state="ready"]::before { background: var(--wl-success); }
.wb-paint-go, .wb-paint-cancel { width: 100%; min-height: 34px; font-size: 12px; }
.wb-artwork-blocked { margin: 0; font-size: 12px; line-height: 1.5; color: var(--wl-text-2); }
.wb-paint-unlock { align-self: flex-start; min-height: 32px; font-size: 12px; }
.wb-paint-progress { height: 6px; border-radius: 3px; overflow: hidden; background: var(--wl-line); }
.wb-paint-progress > span { display: block; height: 100%; width: 0; background: var(--wl-accent); transition: width var(--wl-base, .18s) var(--wl-ease, ease); }
.wb-paint-progress.is-waiting > span { width: 35%; animation: wb-paint-wait 1.4s var(--wl-ease, ease) infinite; }
@keyframes wb-paint-wait { from { transform: translateX(-100%); } to { transform: translateX(290%); } }
.wb-paint-progress-text { margin: -4px 0 0; font-size: 11px; color: var(--wl-text-2); font-variant-numeric: tabular-nums; }
.wb-paint-drafts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.wb-paint-draft-pick { height: auto; padding: 0; border-radius: var(--r-md); overflow: hidden; border: 2px solid transparent; background: var(--wl-inset); box-shadow: none; aspect-ratio: 4 / 3; }
.wb-paint-draft-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wb-paint-draft-pick[aria-pressed="true"] { border-color: var(--wl-selection); }
.wb-paint-draft-actions { display: flex; gap: 8px; }
.wb-paint-draft-actions > button { flex: 1; min-height: 32px; font-size: 12px; }
@media (prefers-reduced-motion: reduce) { .wb-paint-progress.is-waiting > span { animation: none; width: 100%; opacity: .5; } .wb-paint-progress > span { transition: none; } }

/* Inspect's Painting section. */
.wb-map-feature-details .wb-paint-switch + .wb-feature-note { margin-top: -4px; }
.wb-paint-repaint { align-self: flex-start; min-height: 30px; font-size: 12px; }

/* While it paints: a soft veil and a slow sweep over the board, or over the one area being repainted, in steel. */
.wb-paint-loading { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; overflow: hidden; z-index: 3; background: color-mix(in srgb, var(--wl-accent) 10%, transparent); animation: wl-fade var(--wl-base, .18s) var(--wl-ease-out, ease-out), wb-paint-breathe 2.8s var(--wl-ease, ease) infinite; }
.wb-paint-loading::after { content: ''; position: absolute; top: 0; bottom: 0; left: -60%; width: 60%; background: linear-gradient(100deg, transparent, color-mix(in srgb, var(--wl-accent) 32%, transparent) 40%, color-mix(in srgb, var(--wl-text) 34%, transparent) 50%, color-mix(in srgb, var(--wl-accent) 32%, transparent) 60%, transparent); animation: wb-paint-sweep 2.4s var(--wl-ease, ease) infinite; }
@keyframes wb-paint-sweep { to { transform: translateX(267%); } }
@keyframes wb-paint-breathe { 50% { background-color: color-mix(in srgb, var(--wl-accent) 18%, transparent); } }
.wb-paint-spinner { width: 12px; height: 12px; margin: 0 2px 0 4px; flex-shrink: 0; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--wl-accent) 30%, transparent); border-top-color: var(--wl-accent); animation: wb-paint-spin .9s linear infinite; }
@keyframes wb-paint-spin { to { transform: rotate(360deg); } }
.wb-paint-draft-bar[data-state="running"] .wb-paint-draft-count { min-width: 0; max-width: 52ch; overflow: hidden; text-overflow: ellipsis; }
.wb-paint-bar-error { max-width: 40ch; padding: 0 4px; color: var(--wl-danger); line-height: 1.4; }
@media (prefers-reduced-motion: reduce) { .wb-paint-loading { animation: none; } .wb-paint-loading::after { display: none; } .wb-paint-spinner { animation: none; border-color: var(--wl-accent); } .wb-paint-style-card { animation: none; } }

/* On the map: a draft lies where the map image does; badges show only while painting. */
.wb-paint-draft { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; overflow: hidden; }
.wb-paint-draft.is-object { z-index: 3; }
.wb-paint-draft > img { width: 100%; height: 100%; display: block; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.wb-paint-draft-bar { position: absolute; top: 56px; left: 50%; transform: translateX(-50%); z-index: 30; display: flex; align-items: center; gap: 6px; max-width: calc(100% - 24px); flex-wrap: wrap; justify-content: center; padding: 6px 8px; font-size: 12px; animation: wl-pop var(--wl-fast, .12s) var(--wl-ease-out, ease-out); }
.wb-paint-draft-bar > button { min-height: 30px; font-size: 12px; }
.wb-paint-draft-step { width: 30px; padding: 0; font-size: 17px; }
.wb-paint-draft-count { padding: 0 2px; color: var(--wl-text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.wb-paint-badge { display: none; position: absolute; left: .4em; top: .4em; max-width: calc(100% - .8em); padding: .1em .6em; border-radius: var(--r-pill); font-size: var(--wb-paint-badge-size, 13px); line-height: 1.45; font-weight: 600; color: var(--wl-text); background: color-mix(in srgb, var(--wl-bg) 75%, transparent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; z-index: 2; }
.wb-painting-view .wb-paint-badge, .canvas-wrapper:is([data-wb-tool="object"], [data-wb-tool="token"]) .wb-map-object .wb-paint-badge { display: block; }
/* An object's number sits in its middle, so a small object still shows it. */
:is(.wb-painting-view, .canvas-wrapper[data-wb-tool="object"], .canvas-wrapper[data-wb-tool="token"]) .wb-map-area[data-wb-paint="prop"] .wb-paint-badge { left: 50%; top: 50%; max-width: none; transform: translate(-50%, -50%); min-width: 1.5em; text-align: center; color: var(--wl-on-accent); background: var(--wl-accent); box-shadow: 0 1px 3px color-mix(in srgb, var(--wl-bg) 40%, transparent); }
/* One that shows its name has its number on its corner instead, so the number never covers the name. */
:is(.wb-painting-view, .canvas-wrapper[data-wb-tool="object"], .canvas-wrapper[data-wb-tool="token"]) .wb-map-area[data-wb-paint="prop"]:has(> .canvas-node-container .wb-feature-label) .wb-paint-badge { left: 0; top: 0; transform: translate(-40%, -40%); }
.wb-painting-view .wb-map-area:not([data-wb-paint="ground"]):not([data-wb-paint="prop"]) .wb-feature-visual { opacity: .45; }
@media (max-width: 600px) { .wb-paint-draft-bar { gap: 4px; } .wb-paint-draft-bar > .mod-cta { flex-basis: 100%; order: 5; } }

/* Artwork: one task at a time, with style/provider libraries opened on demand. */
.wb-artwork-map-name { margin: -10px 0 0; color: var(--wl-text-2); font-size: 12px; overflow-wrap: anywhere; }
.wb-map-paint-view > .wb-paint-switch { display: flex; flex-shrink: 0; }
.wb-map-paint-view > .wb-paint-switch > button { flex: 1; }
.wb-map-paint-view > .wb-paint-switch > button { white-space: normal; line-height: 1.35; min-height: 40px; padding: 7px; }
.wb-artwork-style-summary { display: grid; grid-template-columns: 36px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--wl-line); border-radius: var(--r-md); background: transparent; }
.wb-artwork-style-summary strong { font-size: 12px; font-weight: 500; overflow-wrap: anywhere; }
.wb-artwork-provider { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wb-artwork-provider .wb-paint-engine { overflow-wrap: anywhere; min-width: 0; }
.wb-artwork-target { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--wl-line); border-radius: var(--r-md); background: transparent; }
.wb-artwork-target strong { font-size: 12px; }
.wb-artwork-target .wb-feature-note { margin: 0; }
.wb-artwork-target button { align-self: flex-start; }
.wb-artwork-target .wb-paint-switch { width: 100%; }
.wb-artwork-target .wb-paint-switch > button { min-height: 34px; white-space: normal; line-height: 1.35; }
.wb-artwork-drawing { display: grid; grid-template-columns: minmax(90px,1fr) minmax(100px,1fr); gap: 8px; align-items: end; }
.wb-artwork-drawing > .wb-artwork-draw { min-height: 34px; align-self: end; }
.wb-artwork-target .wb-feature-note[role="status"] { color: var(--wl-text-2); }
.wb-artwork-target:has(.wb-feature-note[role="status"]) { gap: 10px; }
/* Not :has() with a plain tag after it: Chrome then re-styled every select on the page whenever anything a :has() reads
   changed. The Make choice is the select itself. */
.wb-map-paint-view > .wb-feature-field select[aria-label="Make"] { height: 38px; font-weight: 600; }
@container (max-width: 280px) { .wb-artwork-drawing { grid-template-columns: minmax(0,1fr); } }
.wb-artwork-target-label { color: var(--wl-text-3); font-size: 11px; }
.wb-artwork-back { font-size: 12px; background: transparent; box-shadow: none; padding: 5px; }
.wb-map-paint-view .wb-map-panel-heading:has(.wb-artwork-back) { flex-wrap: wrap; }
/* Back comes before the title (paint-ui.mjs), so a sibling says it is there; not :has() with a plain h3 after it. */
.wb-map-paint-view .wb-map-panel-heading > .wb-artwork-back ~ h3 { flex-basis: 100%; margin-top: 6px; }
.wb-artwork-reference summary { color: var(--wl-text-2); font-size: 11px; cursor: pointer; margin: 6px 0; }
.wb-artwork-reference .wb-feature-field { margin-top: 10px; }
.wb-artwork-edit-region { display: none; position: absolute; left: 0; top: 0; transform-origin: 0 0; z-index: 4; pointer-events: none; }
.wb-artwork-edit-region svg { width: 100%; height: 100%; fill: color-mix(in srgb, var(--wl-selection) 24%, transparent); }
.wb-artwork-edit-region :is(polygon, path) { stroke: var(--wl-selection); stroke-width: calc(2 * var(--wb-artwork-pixel, 1px)); stroke-dasharray: calc(6 * var(--wb-artwork-pixel, 1px)) calc(4 * var(--wb-artwork-pixel, 1px)); vector-effect: non-scaling-stroke; }
.wb-artwork-active .wb-artwork-edit-region { display: block; }

/* paint-ui.mjs marks the body while a map's artwork is open (and wb-paint-bar-open below while a paint bar shows),
   rather than a :has() on body, which made every change on the page look through the whole page. */
body.wb-shell.wb-artwork-open .wt-orbis-orb { bottom: 16px !important; }
.wb-map-paint-view .wb-paint-run { padding-bottom: 62px; }
.wb-map-paint-view > * { flex-shrink: 0; }

.wb-paint-draft-bar { width: max-content; }
.wb-paint-bar-text { min-width: 0; flex: 1 1 14ch; max-width: 100%; overflow-wrap: anywhere; }

/* The paint bar (§9.4): above the toolbar on the map tools' glass (map-panel-polish.css: the map's picture blurred
   through a dark tint, a hairline of light, one shadow). The jobs and where they paint, what to paint, then the style,
   the drafts with their price and Paint, the one filled steel action. While it paints and after, the same bar holds the
   progress and the drafts. On a phone it is a sheet over the toolbar. */
.wb-paint-draft-bar { top: auto; bottom: var(--wb-paint-bar-bottom, 76px); z-index: 31; color: var(--wl-text); background: var(--wb-map-glass, var(--wl-surface)); border: 1px solid var(--wl-glass-line); border-radius: var(--r-md); box-shadow: var(--wl-elev-pop); -webkit-backdrop-filter: blur(var(--wl-glass-blur)) saturate(1.08); backdrop-filter: blur(var(--wl-glass-blur)) saturate(1.08); animation: wl-toast var(--wl-base) var(--wl-ease-out); }
.wb-paint-draft-bar[hidden] { display: none; }
/* As wide as its jobs need (five once the plan has changed), from 560px up to the map's width. */
.wb-paint-draft-bar[data-state="pick"] { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 8px; width: max-content; min-width: min(560px, calc(100% - 24px)); max-width: calc(100% - 24px); padding: 8px; }
.wb-paint-bar-jobs { grid-auto-columns: max-content; }
.wb-paint-bar-jobs > button { padding: 4px 10px; }
.wb-paint-bar-row { display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: nowrap; }
.wb-paint-bar-row > .wb-paint-switch { flex: 1 1 0; min-width: 0; }
.wb-paint-bar-inside { flex: 0 0 150px; min-width: 0; height: 30px; font-size: 12px; }
.wb-paint-bar-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wb-paint-bar-close { width: 28px; height: 28px; padding: 0; font-size: 18px; line-height: 1; color: var(--wl-text-3); }
.wb-paint-bar-words { width: 100%; height: 32px; font-size: 13px; }
.wb-paint-bar-foot { flex-wrap: nowrap; }
.wb-paint-bar-style { display: inline-flex; align-items: center; gap: 6px; height: 30px; max-width: 36%; padding: 0 10px 0 6px; font-size: 12px; color: var(--wl-text); border: 1px solid var(--wl-line); border-radius: var(--r-md); background: transparent; box-shadow: none; }
.wb-paint-bar-style:hover { background: var(--wl-raised); }
.wb-paint-bar-style > .wb-paint-swatch { width: 28px; height: 12px; flex-shrink: 0; }
.wb-paint-bar-style > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-paint-bar-drafts { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.wb-paint-bar-drafts > .wb-paint-switch { grid-auto-columns: 30px; }
.wb-paint-bar-price { flex: 1 1 auto; justify-content: flex-start; min-width: 0; height: 30px; padding: 0 6px; font-size: 11px; color: var(--wl-text-3); background: transparent; box-shadow: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-paint-bar-price:hover { color: var(--wl-text); background: var(--wl-raised); }
.wb-paint-bar-go { flex: 0 0 auto; min-width: 76px; height: 32px; }
.wb-paint-bar-note, .wb-paint-draft-bar[data-state="pick"] :is(.wb-paint-bar-error, .wb-artwork-blocked) { margin: 0; max-width: none; padding: 0 2px; font-size: 11px; line-height: 1.4; }
.wb-paint-bar-note { color: var(--wl-text-3); }
.wb-paint-draft-bar[data-state="pick"] .wb-paint-unlock { align-self: flex-start; }
/* A narrow map stacks the rows: where, Touch up and close, then the jobs under them, then the line, the style and
   drafts, then the price and Paint. */
.is-narrow .wb-paint-bar-head, .is-narrow .wb-paint-bar-foot, .is-narrow .wb-paint-bar-options { flex-wrap: wrap; }
/* The jobs keep their names on one line ("Paint the map", not "Paint the / map"): they share the row by their
   length, and one that doesn't fit starts a second row, so none is cut short or hidden. */
.is-narrow .wb-paint-bar-jobs { flex-basis: 100% !important; order: 3; display: flex; flex-wrap: wrap; }
.is-narrow .wb-paint-bar-jobs > button { flex: 1 1 auto; }
.is-narrow .wb-paint-bar-inside { flex: 1 1 0; }
.is-narrow .wb-paint-bar-style { flex: 1 1 auto; max-width: none; }
.is-narrow .wb-paint-bar-price { flex: 1 1 calc(100% - 96px); order: 4; }
.is-narrow .wb-paint-bar-go { order: 5; }
@media (max-width: 640px) {
  .wb-paint-draft-bar, .wb-paint-draft-bar[data-state="pick"] { left: 8px; right: 8px; bottom: 8px; width: auto; max-width: none; transform: none; border-radius: var(--r-xl); animation-name: wl-in; }
  /* While it paints and with the drafts it stands above the toolbar instead, so the tools stay in reach. */
  .wb-paint-draft-bar:not([data-state="pick"]) { bottom: var(--wb-paint-bar-bottom, 76px); }
  /* Brushing and touching up are a sheet like picking, as wide as the phone. */
  .wb-paint-draft-bar:is([data-state="brush"], [data-state="touch"]) { bottom: 8px; width: auto; min-width: 0; max-width: none; }
  /* The sheet covers the bottom of the map, so Orbis steps aside while it is open. */
  body.wb-shell.wb-paint-bar-open .wt-orbis-orb { opacity: 0; pointer-events: none; }
}
@media (pointer: coarse) { .wb-paint-bar-inside, .wb-paint-bar-style, .wb-paint-bar-price, .wb-paint-hand-cancel { height: 36px; } .wb-paint-bar-words, .wb-paint-bar-go { height: 38px; } .wb-paint-bar-close, .wb-paint-hand-step { width: 36px; height: 36px; } .wb-paint-hand-swatch { width: 32px; height: 32px; } .wb-paint-hand-own input[type="color"] { height: 32px; } }
@media (prefers-reduced-motion: reduce) { .wb-paint-draft-bar { animation: none; } }
/* Asked for less see-through, the bar's glass is solid (DESIGN-SYSTEM §6). */
@media (prefers-reduced-transparency: reduce) { .wb-paint-draft-bar { background: var(--wl-inset); -webkit-backdrop-filter: none; backdrop-filter: none; } }

/* The style library's samples: the style's picture over its colours, so it is chosen by seeing it (§9.5). */
.wb-paint-style > img.wb-paint-sample { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--r-xs); background: var(--wl-raised); }
.wb-paint-style.has-sample > .wb-paint-swatch { height: 6px; }
.wb-paint-sample-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wb-paint-sample-row > small { margin: 0; }
@media (max-width: 640px) { .wb-paint-style > img.wb-paint-sample { width: 48px; flex-shrink: 0; } }

/* Repaint changes (§9.6): while Paint offers it, each spot where the plan no longer matches the picture is marked on
   the map, where a thing was dashed and where it is now solid, in white with a dark halo so it reads on any picture. */
.wb-paint-changes { display: none; position: absolute; left: 0; top: 0; transform-origin: 0 0; z-index: 4; pointer-events: none; }
.wb-artwork-active .wb-paint-changes { display: block; }
.wb-paint-changes svg { width: 100%; height: 100%; overflow: visible; }
.wb-paint-changes polygon { fill: none; stroke: var(--wl-text); stroke-width: calc(2 * var(--wb-artwork-pixel, 1px)); stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.wb-paint-changes polygon.is-halo { fill: color-mix(in srgb, var(--wl-text) 16%, transparent); stroke: color-mix(in srgb, var(--wl-bg) 70%, transparent); stroke-width: calc(5 * var(--wb-artwork-pixel, 1px)); }
.wb-paint-changes polygon.is-was:not(.is-halo) { stroke-dasharray: calc(6 * var(--wb-artwork-pixel, 1px)) calc(5 * var(--wb-artwork-pixel, 1px)); }
.wb-paint-changes polygon.is-was.is-halo { fill: color-mix(in srgb, var(--wl-bg) 14%, transparent); }
.wb-paint-bar-changes { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }

/* Earlier pictures (§9.1), in a map's or an object's Look: each small, with what made it and Bring back. */
.wb-paint-earlier { display: flex; flex-direction: column; gap: 6px; }
.wb-paint-earlier-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 4px; border-radius: var(--r-sm, 6px); }
.wb-paint-earlier-row:hover { background: var(--wl-raised); }
.wb-paint-earlier-thumb { width: 44px; height: 32px; object-fit: cover; border-radius: var(--r-xs); border: 1px solid var(--wl-line); background: var(--wl-inset); }
.wb-paint-earlier-text { display: flex; flex-direction: column; min-width: 0; font-size: 11px; line-height: 1.35; color: var(--wl-text-2); }
.wb-paint-earlier-text strong { font-size: 12px; font-weight: 600; color: var(--wl-text); }
.wb-paint-earlier-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Who paints is chosen from this button (the shared model picker), so it carries a small chevron. */
.wb-paint-bar-price { gap: 4px; }
.wb-paint-bar-price-more { flex: none; margin-left: auto; }
.wb-paint-bar-price-more svg { width: 12px; height: 12px; }

/* The paint bar, calmer: where it paints first, then the jobs, with Touch up and close at the end of that row; one
   muted line under them saying what the chosen job does; small plain captions over the words and beside the drafts
   and options, so each control says what it is. */
.wb-paint-bar-head > .wb-paint-bar-inside { order: 0; }
.wb-paint-bar-touch { flex: none; height: 30px; }
.wb-paint-bar-hint { margin: -2px 0 0; padding: 0 2px; font-size: 11px; line-height: 1.4; color: var(--wl-text-2); }
.wb-paint-bar-caption { flex: none; font-size: 11px; line-height: 1.3; color: var(--wl-text-3); white-space: nowrap; }
.wb-paint-bar-options { flex-wrap: wrap; row-gap: 6px; }
.wb-paint-bar-options > .wb-paint-switch { flex: 0 1 auto; grid-auto-columns: max-content; }
.wb-paint-bar-options > .wb-paint-switch > button { padding: 4px 10px; }
.wb-paint-bar-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.wb-paint-bar-field > .wb-paint-bar-caption { padding: 0 2px; }

/* Brushing and touching up by hand (paint-hand.mjs). Over the map a catcher takes the pointer, under the toolbar and
   the zoom buttons; a ring shows the brush's size where it would paint. What is brushed is a calm tint in the
   selection colour, exactly the part that will be repainted; Touch up shows the picture itself, painted on. */
.wb-paint-hand { position: absolute; inset: 0; z-index: 4; touch-action: none; cursor: none; }
.wb-paint-hand.is-picking { cursor: crosshair; }
.wb-paint-ring { position: absolute; left: 0; top: 0; width: var(--wb-paint-ring, 32px); height: var(--wb-paint-ring, 32px); margin: calc(var(--wb-paint-ring, 32px) / -2) 0 0 calc(var(--wb-paint-ring, 32px) / -2); border: 1.5px solid var(--wl-text); border-radius: 50%; box-shadow: 0 0 0 1px color-mix(in srgb, var(--wl-bg) 65%, transparent), inset 0 0 0 1px color-mix(in srgb, var(--wl-bg) 65%, transparent); pointer-events: none; }
.wb-paint-ring::after { content: ''; position: absolute; left: 50%; top: 50%; width: 2px; height: 2px; margin: -1px 0 0 -1px; border-radius: 50%; background: var(--wl-text); }
.wb-paint-ring.is-erase { border-style: dashed; }
.wb-paint-ring.is-pick, .wb-paint-ring[hidden] { display: none; }
.wb-paint-brushed, .wb-paint-touch { position: absolute; left: 0; top: 0; z-index: 4; transform-origin: 0 0; pointer-events: none; }
.wb-paint-touch { z-index: 3; }
.wb-paint-brushed > svg, .wb-paint-touch > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.wb-paint-brushed-fill { fill: color-mix(in srgb, var(--wl-selection) 38%, transparent); }
.wb-paint-touch > canvas { display: block; width: 100%; height: 100%; }

/* The bar while brushing or touching up: the tool's name, Brush or Eraser (or Pick colour), undo and redo; the style's
   colours for Touch up; the sliders; a line of help; then Cancel and the one filled action. */
.wb-paint-draft-bar:is([data-state="brush"], [data-state="touch"]) { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: var(--sp-2); width: max-content; min-width: min(480px, calc(100% - 24px)); max-width: calc(100% - 24px); padding: var(--sp-2); }
.wb-paint-hand-head { flex-wrap: wrap; row-gap: 6px; }
.wb-paint-hand-title { margin-right: 4px; padding: 0 2px; font-family: var(--wl-font-title); font-size: var(--t-title-panel); font-weight: 400; letter-spacing: 0; line-height: 1.2; color: var(--wl-text); white-space: nowrap; }
.wb-paint-bar-row > .wb-paint-hand-tools { flex: 0 0 auto; grid-auto-columns: max-content; }
.wb-paint-hand-tools > button { padding: 4px 12px; }
.wb-paint-hand-steps { display: inline-flex; gap: 2px; }
.wb-paint-hand-step { width: 30px; height: 30px; padding: 0; color: var(--wl-text-2); }
.wb-paint-hand-step:disabled { opacity: .4; cursor: default; }
.wb-paint-hand-step svg { width: 16px; height: 16px; }
.wb-paint-hand-clear { margin-left: auto; }
.wb-paint-hand-clear:disabled { opacity: .45; cursor: default; }
.wb-paint-hand-colours { flex-wrap: wrap; gap: 6px; }
.wb-paint-hand-swatch { width: 26px; height: 26px; min-height: 0; padding: 0; flex: none; border: 1px solid var(--wl-line-strong); border-radius: 50%; background: var(--wb-paint-swatch, var(--wl-inset)); box-shadow: none; }
/* The app's own button look (body.wl-own button:not(.clickable-icon), and its hover) is more specific than one class:
   each swatch keeps its own colour over it. */
.wb-paint-draft-bar .wb-paint-hand-swatch, .wb-paint-draft-bar .wb-paint-hand-swatch:hover { background: var(--wb-paint-swatch, var(--wl-inset)); }
.wb-paint-hand-swatch:hover { border-color: var(--wl-text-2); }
.wb-paint-hand-swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--wl-bg), 0 0 0 4px var(--wl-selection); }
.wb-paint-hand-swatch:focus-visible { outline: 2px solid var(--wl-selection); outline-offset: 3px; }
.wb-paint-hand-own { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-size: 11px; color: var(--wl-text-3); }
.wb-paint-hand-own input[type="color"] { width: 36px; height: 26px; padding: 0; border: 1px solid var(--wl-line); border-radius: var(--r-sm); background: none; cursor: pointer; }
.wb-paint-hand-own input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.wb-paint-hand-own input[type="color"]::-webkit-color-swatch { border: none; border-radius: calc(var(--r-sm) - 1px); }
.wb-paint-hand-settings { flex-wrap: wrap; gap: 6px var(--sp-3); }
.wb-paint-slider { display: inline-flex; align-items: center; gap: 6px; flex: 1 1 150px; min-width: 0; font-size: 11px; color: var(--wl-text-3); }
.wb-paint-slider > input[type="range"] { flex: 1 1 auto; min-width: 64px; margin: 0; accent-color: var(--wl-selection); }
.wb-paint-slider > output { min-width: 5ch; font-family: var(--wl-font-mono); font-size: 11px; text-align: right; color: var(--wl-text-2); font-variant-numeric: tabular-nums; }
.wb-paint-hand-foot { justify-content: flex-end; }
.wb-paint-hand-cancel { height: 32px; }
.wb-paint-draft-bar:is([data-state="brush"], [data-state="touch"]) :is(.wb-paint-bar-note, .wb-paint-bar-error) { margin: 0; max-width: none; padding: 0 2px; font-size: 11px; line-height: 1.4; }
.is-narrow .wb-paint-hand-clear, .is-narrow .wb-paint-hand-own { margin-left: 0; }
.is-narrow .wb-paint-slider { flex-basis: 100%; }

/* A map when you need one (paint-draft.mjs). In the style library: whether games draft a map for a place with none. */
.wb-map-draft-setting { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--wl-line); }
.wb-map-paint-view .wb-map-draft-setting small.wb-feature-note { color: var(--wl-text-2); }
/* On an empty map of a place, the offer to draft it: solid, read like a page, in the middle of the map. Centred by
   its margins, so the shared entrance motion (a small rise) doesn't move it off centre. */
.wb-map-draft-offer { position: absolute; inset: 0; margin: auto; z-index: 29; box-sizing: border-box; width: min(360px, calc(100% - 32px)); height: fit-content; max-height: calc(100% - 32px); overflow: auto; display: flex; flex-direction: column; gap: 10px; padding: 16px; color: var(--wl-text); background: var(--wl-surface); border: 1px solid var(--wl-line); border-radius: var(--r-lg); box-shadow: var(--wl-elev-card); animation: wl-in var(--wl-base, .18s) var(--wl-ease-out, ease-out); }
.wb-map-draft-offer > h3 { margin: 0; font-size: 14px; font-weight: 600; }
.wb-map-draft-offer > p { margin: 0; font-size: 12px; line-height: 1.5; color: var(--wl-text-2); }
.wb-map-draft-offer > .wb-map-draft-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.wb-map-draft-offer > .wb-map-draft-actions > button { min-height: 32px; }
.wb-map-draft-offer > .wb-map-draft-actions > .mod-cta { flex: 1 1 auto; }
.wb-map-draft-offer > .wb-map-draft-games { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding-top: 10px; border-top: 1px solid var(--wl-line); font-size: 11px; color: var(--wl-text-3); }
.wb-map-draft-offer > .wb-map-draft-games > button { min-height: 26px; padding: 0 10px; font-size: 11px; }
.wb-map-draft-offer > .wb-map-draft-error { font-size: 11px; color: var(--wl-danger); }
.wb-map-draft-offer > .wb-map-draft-error:empty { display: none; }
/* A drafted map says so, quietly, under the map's bar, until something on it is changed. */
.wb-map-draft-mark { position: absolute; top: 56px; left: 12px; z-index: 6; margin: 0; padding: 3px 10px; font-size: 11px; line-height: 1.5; color: var(--wl-text-2); background: var(--wl-surface); border: 1px solid var(--wl-line); border-radius: 999px; pointer-events: none; animation: wl-in var(--wl-base, .18s) var(--wl-ease-out, ease-out); }
@media (pointer: coarse) { .wb-map-draft-offer > .wb-map-draft-actions > button, .wb-map-draft-offer > .wb-map-draft-games > button { min-height: 44px; } }
@media (prefers-reduced-motion: reduce) { .wb-map-draft-offer, .wb-map-draft-mark { animation: none; } }
