/* ---- the image family's looks (Layout/ToolLooks.cs) ------------------------------------------------------------
   What each look is made of is in looks.css; this sheet gives each of its tools its colour and its own touches, so a
   picture of any one of them says which tool it is: a gallery wall for Image generation, marching ants for Edit image,
   a burst of speed for the quick picture page, a strip of frames for the GIF generator, a blueprint for Layout image,
   big pixels turning into fine ones for Upscale, a sprite atlas for Sprite sheet and a cutting mat for Seamless tiles.
   Every colour is mixed from the look's hue and the theme's own tokens, so each holds in light and dark. */

.look--generate { --look-hue: 265; --look-turn: 50; }
.look--edit { --look-hue: 338; --look-turn: 28; }
.look--flux3 { --look-hue: 48; --look-turn: 14; }
.look--pjit { --look-hue: 292; --look-turn: 36; }
.look--picture-reader { --look-hue: 172; --look-turn: -18; }
.look--gif { --look-hue: 16; --look-turn: 26; }
.look--layout-image { --look-hue: 186; --look-turn: 22; }
.look--upscale { --look-hue: 222; --look-turn: 22; }
.look--sprites { --look-hue: 95; --look-turn: -25; }
.look--tiles { --look-hue: 148; --look-turn: 24; }

/* ---- shared by this family: the run button wears the tool's glyph, the stage knows its own floor colour ---- */

.tool:is(.look--generate, .look--edit, .look--flux3, .look--gif, .look--layout-image, .look--upscale, .look--sprites, .look--tiles) {
    --stage-bg: color-mix(in srgb, var(--look-c) 5%, var(--rl-surface-sunken));
    /* the look's colour as text: lighter on a dark theme, deeper on a light one */
    --look-text: color-mix(in srgb, var(--look-c) 62%, var(--rl-text));
}
.tool:is(.look--generate, .look--edit, .look--flux3, .look--gif, .look--layout-image, .look--upscale, .look--sprites, .look--tiles) .tool__actions .btn--primary { display: inline-flex; align-items: center; justify-content: center; gap: .55em; }
.tool:is(.look--generate, .look--edit, .look--flux3, .look--gif, .look--layout-image, .look--upscale, .look--sprites, .look--tiles) .tool__actions .btn--primary::before {
    content: ""; flex: none; width: 1.1em; height: 1.1em;
    background: currentColor;
    -webkit-mask: var(--run-glyph) center / contain no-repeat;
    mask: var(--run-glyph) center / contain no-repeat;
}
.tool:is(.look--generate, .look--edit, .look--flux3, .look--gif, .look--layout-image, .look--upscale, .look--sprites, .look--tiles) .tool__actions .btn--primary:disabled::before { opacity: .55; }

/* The bright hues carry a dark glyph in the banner's icon tile, and dark lettering on their run button: white on yellow or
   lime cannot be read. */
.hero.look--flux3 .hero__icon, .hero.look--sprites .hero__icon, .hero.look--tiles .hero__icon, .hero.look--layout-image .hero__icon {
    color: hsl(var(--look-hue) 70% 12%);
}
.tool.look--flux3 .tool__actions .btn--primary:not(:disabled),
.tool.look--sprites .tool__actions .btn--primary:not(:disabled),
.tool.look--tiles .tool__actions .btn--primary:not(:disabled),
.tool.look--layout-image .tool__actions .btn--primary:not(:disabled) {
    color: hsl(var(--look-hue) 70% 11%);
    text-shadow: 0 1px 0 rgb(255 255 255 / .25);
}

/* ============================================================================================================== */
/* ---- Image generation: a gallery wall. Pictures land on a matted, transparent board; the panel glows violet. ---- */

.tool.look--generate {
    --run-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M9 1Q9 9 17 9Q9 9 9 17Q9 9 1 9Q9 9 9 1Z'/%3E%3Cpath d='M16 12Q16 16 20 16Q16 16 16 20Q16 16 12 16Q16 16 16 12Z'/%3E%3C/svg%3E");
}

.tool.look--generate .tool__stage {
    background-image:
        radial-gradient(90% 55% at 50% -6%, color-mix(in srgb, var(--look-c) 18%, transparent), transparent 72%),
        repeating-conic-gradient(color-mix(in srgb, var(--rl-text) 5%, transparent) 0 25%, transparent 0 50%);
    background-size: auto, 18px 18px;
    /* the mat inside the frame */
    box-shadow:
        inset 0 0 0 9px color-mix(in srgb, var(--look-c) 4%, var(--rl-surface)),
        inset 0 0 0 10px color-mix(in srgb, var(--look-c) 30%, transparent),
        inset 0 18px 30px -18px rgb(0 0 0 / .35);
    padding: 1.4rem;
}

/* Results hang like prints: a mat round each, a shadow on the wall. */
.tool.look--generate .comfy-result img,
.tool.look--generate .tool__stage .asset__thumb {
    border-radius: 4px;
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--look-c) 3%, var(--rl-surface)), 0 0 0 7px var(--look-line), 0 16px 28px -14px rgb(0 0 0 / .55);
}

.tool.look--generate .tool-sec__ico.ui-ico {
    background: linear-gradient(140deg, var(--look-c), var(--look-c2));
    color: #fff;
    box-shadow: 0 4px 12px -4px hsl(var(--look-hue) 80% 50% / .6);
}
.tool.look--generate .tool-sec--lead textarea {
    border-color: color-mix(in srgb, var(--look-c) 40%, var(--rl-border));
    background-image: linear-gradient(160deg, color-mix(in srgb, var(--look-c) 7%, transparent), transparent 60%);
}
.tool.look--generate .tool-sec--lead textarea:focus { box-shadow: 0 0 0 3px var(--look-soft), 0 0 22px -6px var(--look-c); }
.tool.look--generate .tool-chip--on {
    border-color: var(--look-c);
    background: color-mix(in srgb, var(--look-c) 16%, var(--rl-surface));
    color: var(--look-text);
}

/* ============================================================================================================== */
/* ---- Edit image: a selection. Marching ants round the stage, a masked hatch inside, mode chips as a tool bar. ---- */

.tool.look--edit {
    --run-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M18.6 1.4a1.4 1.4 0 0 0-2 0L8.4 9.6l2 2 8.2-8.2a1.4 1.4 0 0 0 0-2Z'/%3E%3Cpath d='M7.3 10.8c-2.1 0-3.6 1.5-3.6 3.5 0 1.2-.7 1.9-2.2 2.3 1.1.9 2.7 1.4 4.3 1.4 2.6 0 4.4-1.7 4.4-4Z'/%3E%3C/svg%3E");
    --ant: color-mix(in srgb, var(--look-c) 85%, transparent);
}

.tool.look--edit .tool__stage {
    border-color: transparent;
    background-image:
        linear-gradient(90deg, var(--ant) 50%, transparent 0),
        linear-gradient(90deg, var(--ant) 50%, transparent 0),
        linear-gradient(0deg, var(--ant) 50%, transparent 0),
        linear-gradient(0deg, var(--ant) 50%, transparent 0),
        repeating-linear-gradient(-45deg, color-mix(in srgb, var(--look-c) 7%, transparent) 0 2px, transparent 2px 13px);
    background-size: 14px 2px, 14px 2px, 2px 14px, 2px 14px, auto;
    background-repeat: repeat-x, repeat-x, repeat-y, repeat-y, repeat;
    background-position: 0 0, 0 100%, 0 0, 100% 0, 0 0;
    background-origin: border-box;
    /* Stepped, like a selection's ants, so the stage repaints a few times a second rather than every frame. */
    animation: look-edit-ants 1.1s steps(7) infinite;
}
@keyframes look-edit-ants {
    to { background-position: 14px 0, -14px 100%, 0 -14px, 100% 14px, 0 0; }
}

/* The page's own empty stage (it keeps one for the mask canvas) shows the tool's spot art too. */
.tool.look--edit .tool__empty--keep { gap: 1.1rem; max-width: 26rem; }
.tool.look--edit .tool__empty--keep .tool__emptyIcon {
    width: min(15rem, 62%); height: auto; aspect-ratio: 1; padding: 0; border: 0; border-radius: 0;
    background: url(edit/spot.svg) center / contain no-repeat;
    filter: drop-shadow(0 14px 28px hsl(var(--look-hue) 70% 30% / .35));
    animation: look-float 6s ease-in-out infinite alternate;
}
.tool.look--edit .tool__empty--keep .tool__emptyIcon use { display: none; }

/* The mask canvas: a selection's edge, and its brush, undo and clear on a tool bar. */
.tool.look--edit .mask-painter__stage {
    border-color: var(--look-c);
    box-shadow: 0 0 0 3px var(--look-soft), 0 18px 34px -18px rgb(0 0 0 / .55);
}
.tool.look--edit .mask-painter__tools {
    padding: .45rem .65rem; border: 1px solid var(--look-line); border-radius: 12px;
    background: color-mix(in srgb, var(--look-c) 7%, var(--rl-surface));
}
.tool.look--edit .mask-painter__tools input[type=range] { accent-color: var(--look-c); }

/* Inpaint / Whole image / Instruct as one segmented tool bar. */
.tool.look--edit .tool-sec--lead .tool-chips {
    display: inline-flex; gap: 3px; padding: 3px;
    border: 1px solid var(--rl-border); border-radius: 12px; background: var(--rl-surface-sunken);
}
.tool.look--edit .tool-sec--lead .tool-chip { border-color: transparent; border-radius: 9px; background: transparent; }
.tool.look--edit .tool-sec--lead .tool-chip:hover:not(:disabled) { background: var(--rl-surface); }
.tool.look--edit .tool-sec--lead .tool-chip--on,
.tool.look--edit .tool-sec--lead .tool-chip--on:hover:not(:disabled) {
    border-color: transparent; color: #fff;
    background: linear-gradient(135deg, var(--look-c), var(--look-c2));
    box-shadow: 0 4px 12px -4px hsl(var(--look-hue) 80% 50% / .6);
    text-shadow: 0 1px 2px rgb(0 0 0 / .25);
}

/* The run button carries a selection's dashed edge inside it. */
.tool.look--edit .tool__actions .btn--primary { position: relative; }
.tool.look--edit .tool__actions .btn--primary:not(:disabled)::after {
    content: ""; position: absolute; inset: 4px; border: 1.5px dashed rgb(255 255 255 / .6); border-radius: 6px; pointer-events: none;
}

/* ============================================================================================================== */
/* ---- The quick picture page: speed. Rays burst from the middle of the stage; the run button is a bolt. ---- */

.tool.look--flux3 {
    --run-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M12 .8 3.6 11.4h5.3l-1.6 7.8 9.1-11.6h-5.5L13.6.8Z'/%3E%3C/svg%3E");
}

.tool.look--flux3 .tool__stage {
    background-image:
        radial-gradient(circle at 50% 46%, var(--stage-bg) 0 15%, transparent 52%),
        repeating-conic-gradient(from 3deg at 50% 46%, color-mix(in srgb, var(--look-c) 10%, transparent) 0deg 1.1deg, transparent 1.1deg 7deg),
        radial-gradient(75% 60% at 50% 46%, color-mix(in srgb, var(--look-c) 12%, transparent), transparent 72%);
    background-size: auto;
}

.tool.look--flux3 .tool__panel {
    border-top: 0;
    background-image:
        linear-gradient(90deg, var(--look-c), var(--look-c2) 60%, transparent),
        linear-gradient(180deg, var(--look-soft), transparent 9rem);
    background-size: 100% 3px, auto;
    background-repeat: no-repeat;
}
.tool.look--flux3 .tool-sec__ico.ui-ico { background: color-mix(in srgb, var(--look-c) 22%, transparent); color: var(--look-text); }
.tool.look--flux3 .tool__actions .btn--primary:not(:disabled) { letter-spacing: .02em; font-style: italic; }

/* The pictures the sentence names, numbered like the prompt calls them. */
.app__content.look--flux3 .flux3-ref__num {
    background: linear-gradient(135deg, var(--look-c), var(--look-c2));
    color: hsl(var(--look-hue) 70% 11%);
}

/* ============================================================================================================== */
/* ---- GIF generator: a flipbook. Strips of frames run along the stage's edges; chips are frames, not pills. ---- */

.tool.look--gif {
    --run-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16.6 10a6.6 6.6 0 1 1-1.9-4.7'/%3E%3Cpath d='M15.3 1.6 15 5.6l-4-.3'/%3E%3C/svg%3E");
    --frame-cell: color-mix(in srgb, var(--look-c) 13%, transparent);
}

.tool.look--gif .tool__stage {
    background-image:
        repeating-linear-gradient(90deg, var(--frame-cell) 0 50px, transparent 50px 58px),
        repeating-linear-gradient(90deg, var(--frame-cell) 0 50px, transparent 50px 58px),
        radial-gradient(60% 45% at 50% 50%, color-mix(in srgb, var(--look-c) 9%, transparent), transparent 75%),
        radial-gradient(color-mix(in srgb, var(--rl-text) 8%, transparent) 1px, transparent 1.2px);
    /* The strips are one frame wider than the stage and roll by one frame, the top one left and the bottom one right, so the
       roll never shows an edge. Stepped, so the stage repaints a few times a second rather than every frame. */
    background-size: calc(100% + 58px) 34px, calc(100% + 58px) 34px, auto, 18px 18px;
    background-repeat: no-repeat, no-repeat, no-repeat, repeat;
    background-position: 0 12px, -58px calc(100% - 12px), 0 0, 0 0;
    animation: look-gif-roll 7s steps(29) infinite;
}
@keyframes look-gif-roll {
    to { background-position: -58px 12px, 0 calc(100% - 12px), 0 0, 0 0; }
}
.tool.look--gif .tool__stage > .tool__empty { margin-block: auto; }

.tool.look--gif .tool-chip { border-radius: 6px; font-variant-numeric: tabular-nums; }
.tool.look--gif .tool-chip--on,
.tool.look--gif .tool-chip--on:hover:not(:disabled) {
    border-color: var(--look-c);
    background: color-mix(in srgb, var(--look-c) 15%, var(--rl-surface));
    color: var(--look-text);
    box-shadow: inset 0 0 0 1px var(--look-c), inset 0 -3px 0 var(--look-c);
}
.tool.look--gif .tool-sec__ico.ui-ico { background: color-mix(in srgb, var(--look-c) 18%, transparent); border-radius: 5px; }
.tool.look--gif .tool__actions .btn--primary:not(:disabled) {
    background: linear-gradient(135deg, hsl(var(--look-hue) 70% 52%), hsl(calc(var(--look-hue) + var(--look-turn)) 74% 44%));
}

/* ============================================================================================================== */
/* ---- Layout image: a blueprint. Rulers along the stage, a drafting grid round the layout, boxes for icons. ---- */

.tool.look--layout-image {
    --run-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 4h10v1.6H5zM5 14.4h10V16H5zM4 5h1.6v10H4zM14.4 5H16v10h-1.6z' opacity='.55'/%3E%3Cpath d='M1.5 1.5h5v5h-5zM13.5 1.5h5v5h-5zM1.5 13.5h5v5h-5zM13.5 13.5h5v5h-5z'/%3E%3C/svg%3E");
    --bp-line: color-mix(in srgb, var(--look-c) 16%, transparent);
    --bp-major: color-mix(in srgb, var(--look-c) 30%, transparent);
    --bp-tick: color-mix(in srgb, var(--look-c) 60%, transparent);
}

.tool.look--layout-image .tool__stage {
    padding-top: 1.35rem;
    padding-left: 1.35rem;
    background-image:
        repeating-linear-gradient(90deg, var(--bp-tick) 0 1px, transparent 1px 10px),
        repeating-linear-gradient(90deg, var(--bp-tick) 0 1.5px, transparent 1.5px 50px),
        repeating-linear-gradient(180deg, var(--bp-tick) 0 1px, transparent 1px 10px),
        repeating-linear-gradient(180deg, var(--bp-tick) 0 1.5px, transparent 1.5px 50px),
        linear-gradient(90deg, var(--bp-line) 1px, transparent 1px),
        linear-gradient(var(--bp-line) 1px, transparent 1px);
    background-size: 100% 6px, 100% 11px, 6px 100%, 11px 100%, 20px 20px, 20px 20px;
    background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, repeat, repeat;
    background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0;
}

/* The layout card: a drafting board round the canvas. The canvas itself keeps its own grid. */
.tool.look--layout-image .mlay-card {
    --bp-major: color-mix(in srgb, var(--look-c) 20%, transparent);
    --bp-line: color-mix(in srgb, var(--look-c) 9%, transparent);
    background-image:
        linear-gradient(90deg, var(--bp-major) 1px, transparent 1px),
        linear-gradient(var(--bp-major) 1px, transparent 1px),
        linear-gradient(90deg, var(--bp-line) 1px, transparent 1px),
        linear-gradient(var(--bp-line) 1px, transparent 1px);
    background-size: 60px 60px, 60px 60px, 12px 12px, 12px 12px;
    background-color: color-mix(in srgb, var(--look-c) 6%, var(--rl-surface));
}
.app__content.look--layout-image .mlay {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--look-c) 14%, transparent), 0 20px 40px -22px rgb(0 0 0 / .6);
}

/* Section icons as bounding boxes: a dashed edge and the four handles. */
.tool.look--layout-image .tool-sec__ico.ui-ico {
    position: relative; overflow: visible; border-radius: 3px; color: var(--look-text);
    background: color-mix(in srgb, var(--look-c) 10%, transparent);
    outline: 1.5px dashed color-mix(in srgb, var(--look-c) 70%, transparent); outline-offset: -1.5px;
}
.tool.look--layout-image .tool-sec__ico.ui-ico::before {
    content: ""; position: absolute; inset: -3px; pointer-events: none;
    background:
        linear-gradient(var(--look-c), var(--look-c)) 0 0 / 5px 5px no-repeat,
        linear-gradient(var(--look-c), var(--look-c)) 100% 0 / 5px 5px no-repeat,
        linear-gradient(var(--look-c), var(--look-c)) 0 100% / 5px 5px no-repeat,
        linear-gradient(var(--look-c), var(--look-c)) 100% 100% / 5px 5px no-repeat;
}
.app__content.look--layout-image .mlay-list__item.is-selected { border-color: var(--look-c); }
.tool.look--layout-image .tool__actions .btn--primary:not(:disabled) { border-radius: 4px; }

/* ============================================================================================================== */
/* ---- Upscale textures: big soft pixels on the left of the stage giving way to a fine grid on the right. ---- */

.tool.look--upscale {
    --run-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 7V2h5M13 2h5v5M18 13v5h-5M7 18H2v-5'/%3E%3Cpath d='M7 7l6 6M10 13h3v-3' stroke-width='2'/%3E%3C/svg%3E");
    --px-fine: color-mix(in srgb, var(--rl-text) 6%, transparent);
}

.tool.look--upscale .tool__stage {
    background-image:
        linear-gradient(90deg, var(--px-fine) 1px, transparent 1px),
        linear-gradient(var(--px-fine) 1px, transparent 1px),
        linear-gradient(90deg, transparent 18%, var(--stage-bg) 70%),
        repeating-conic-gradient(color-mix(in srgb, var(--look-c) 17%, transparent) 0 25%, transparent 0 50%);
    background-size: 7px 7px, 7px 7px, auto, 56px 56px;
}

/* Output sizes read as sizes: tabular, a little bigger as they grow. */
.tool.look--upscale .tool-chip { font-variant-numeric: tabular-nums; letter-spacing: .01em; border-radius: 7px; }
.tool.look--upscale .tool-chips .tool-chip:nth-child(3) { font-size: .88rem; }
.tool.look--upscale .tool-chips .tool-chip:nth-child(4) { font-size: .92rem; }
.tool.look--upscale .tool-chips .tool-chip:nth-child(5) { font-size: .96rem; font-weight: 650; }
.tool.look--upscale .tool-chip--on,
.tool.look--upscale .tool-chip--on:hover:not(:disabled) {
    border-color: var(--look-c);
    background: linear-gradient(135deg, color-mix(in srgb, var(--look-c) 22%, var(--rl-surface)), color-mix(in srgb, var(--look-c2) 14%, var(--rl-surface)));
    color: var(--look-text);
}
.tool.look--upscale .tool-sec__ico.ui-ico {
    background:
        conic-gradient(color-mix(in srgb, var(--look-c) 30%, transparent) 0 25%, color-mix(in srgb, var(--look-c) 14%, transparent) 0 50%, color-mix(in srgb, var(--look-c) 30%, transparent) 0 75%, color-mix(in srgb, var(--look-c) 14%, transparent) 0);
    border-radius: 3px;
}

/* ============================================================================================================== */
/* ---- Sprite sheet: an atlas. Equal cells over a pixel checkerboard; square, chunky, eight-bit controls. ---- */

.tool.look--sprites {
    --run-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M2 2h7v7H2zM11 2h7v7h-7zM2 11h7v7H2zM11 11h7v7h-7z' opacity='.45'/%3E%3Cpath d='M11 2h7v7h-7z'/%3E%3C/svg%3E");
    --sheet-cell: color-mix(in srgb, var(--look-c) 26%, transparent);
    --sheet-check: color-mix(in srgb, var(--rl-text) 6%, transparent);
    --pixel-font: ui-monospace, "Cascadia Mono", Consolas, "SFMono-Regular", monospace;
}

.tool.look--sprites .tool__stage {
    border-radius: 6px;
    background-image:
        linear-gradient(90deg, var(--sheet-cell) 2px, transparent 2px),
        linear-gradient(var(--sheet-cell) 2px, transparent 2px),
        repeating-conic-gradient(var(--sheet-check) 0 25%, transparent 0 50%);
    background-size: 96px 96px, 96px 96px, 16px 16px;
    background-position: -1px -1px, -1px -1px, 0 0;
}
.tool.look--sprites .tool__panel { border-radius: 6px; }
.tool.look--sprites .tool__actions { border-radius: 0 0 6px 6px; }

/* Section heads in a terminal face with a pixel marker. */
.tool.look--sprites .tool-sec__title {
    display: inline-flex; align-items: center; gap: .55rem;
    font-family: var(--pixel-font); font-size: .8rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
}
.tool.look--sprites .tool-sec__title::before {
    content: ""; flex: none; width: 4px; height: 4px; margin-right: 8px;
    background: var(--look-c);
    box-shadow: 4px 0 var(--look-c), 0 4px var(--look-c), 4px 4px var(--look-c2), 8px 4px var(--look-c), 4px 8px var(--look-c);
    transform: translateY(-2px);
}

.tool.look--sprites .tool-chip { border-radius: 3px; font-family: var(--pixel-font); font-size: .78rem; }
.tool.look--sprites .tool-chip--on,
.tool.look--sprites .tool-chip--on:hover:not(:disabled) {
    border-color: var(--look-c); color: var(--rl-text);
    background: color-mix(in srgb, var(--look-c) 22%, var(--rl-surface));
    box-shadow: 2px 2px 0 color-mix(in srgb, var(--look-c) 70%, transparent);
}
.tool.look--sprites .ui-empty { border-radius: 4px; border-style: dashed; border-color: var(--look-line); }
.tool.look--sprites .ui-empty__ico { border-radius: 3px; color: var(--look-text); }

/* The run button: a chunky cartridge-era key that sits on its own shadow. */
.tool.look--sprites .tool__actions .btn--primary {
    border-radius: 3px;
    font-family: var(--pixel-font); font-size: .9rem; letter-spacing: .12em; text-transform: uppercase;
}
.tool.look--sprites .tool__actions .btn--primary:not(:disabled) {
    background: var(--look-c);
    box-shadow: 0 4px 0 hsl(var(--look-hue) 55% 30%), 0 10px 18px -8px hsl(var(--look-hue) 80% 30% / .6);
    transform: translateY(-2px);
}
.tool.look--sprites .tool__actions .btn--primary:not(:disabled):active {
    transform: translateY(2px); box-shadow: 0 0 0 hsl(var(--look-hue) 55% 30%);
}

/* ============================================================================================================== */
/* ---- Seamless tiles: a cutting mat. A green board with its grid, rulers and angle lines; cut lines under heads. ---- */

.tool.look--tiles {
    --run-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M2 2h7v7H2zM11 2h7v7h-7zM2 11h7v7H2zM11 11h7v7h-7z'/%3E%3C/svg%3E");
    --mat: color-mix(in srgb, var(--look-c) 12%, var(--rl-surface-sunken));
    --mat-line: color-mix(in srgb, var(--look-c) 15%, transparent);
    --mat-major: color-mix(in srgb, var(--look-c) 28%, transparent);
    --mat-tick: color-mix(in srgb, var(--look-c) 65%, transparent);
}

.tool.look--tiles .tool__stage {
    padding-top: 1.4rem;
    padding-left: 1.4rem;
    border-color: color-mix(in srgb, var(--look-c) 35%, var(--rl-border));
    background-color: var(--mat);
    background-image:
        repeating-linear-gradient(90deg, var(--mat-tick) 0 1px, transparent 1px 12px),
        repeating-linear-gradient(90deg, var(--mat-tick) 0 2px, transparent 2px 60px),
        repeating-linear-gradient(180deg, var(--mat-tick) 0 1px, transparent 1px 12px),
        repeating-linear-gradient(180deg, var(--mat-tick) 0 2px, transparent 2px 60px),
        repeating-linear-gradient(45deg, transparent 0 calc(240px - 1px), var(--mat-major) calc(240px - 1px) 240px),
        linear-gradient(90deg, var(--mat-major) 1px, transparent 1px),
        linear-gradient(var(--mat-major) 1px, transparent 1px),
        linear-gradient(90deg, var(--mat-line) 1px, transparent 1px),
        linear-gradient(var(--mat-line) 1px, transparent 1px);
    background-size: 100% 7px, 100% 13px, 7px 100%, 13px 100%, auto, 60px 60px, 60px 60px, 12px 12px, 12px 12px;
    background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, repeat, repeat, repeat, repeat, repeat;
    background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0;
}

/* Every head sits over a cut line. */
.tool.look--tiles .tool-sec__head,
.tool.look--tiles .tool-sec--fold > summary {
    background: linear-gradient(90deg, var(--mat-tick) 50%, transparent 0) 0 100% / 8px 1px repeat-x;
    padding-bottom: .5rem;
}
.tool.look--tiles .tool-sec__title { display: inline-flex; align-items: center; gap: .55rem; }
.tool.look--tiles .tool-sec__title::before {
    content: ""; flex: none; width: .95rem; height: .95rem; border-radius: 2px;
    background:
        linear-gradient(var(--look-c), var(--look-c)) 0 0 / 45% 45% no-repeat,
        linear-gradient(var(--look-c2), var(--look-c2)) 100% 0 / 45% 45% no-repeat,
        linear-gradient(var(--look-c2), var(--look-c2)) 0 100% / 45% 45% no-repeat,
        linear-gradient(var(--look-c), var(--look-c)) 100% 100% / 45% 45% no-repeat;
}

.tool.look--tiles .tool-chip { border-radius: 4px; font-variant-numeric: tabular-nums; }
.tool.look--tiles .tool-chip--on,
.tool.look--tiles .tool-chip--on:hover:not(:disabled) {
    border-color: var(--look-c); color: var(--rl-text);
    background: color-mix(in srgb, var(--look-c) 18%, var(--rl-surface));
    box-shadow: inset 0 0 0 1px var(--look-c);
}
.tool.look--tiles .tool__actions .btn--primary { border-radius: 6px; }

/* The repeat and the atlas sit on the mat like cut pieces. */
.app__content.look--tiles .tiles__repeat,
.app__content.look--tiles .tiles__atlas {
    border-color: var(--look-c);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--look-c) 14%, transparent), 0 16px 30px -16px rgb(0 0 0 / .6);
}

/* ---- motion ---- */
@media (prefers-reduced-motion: reduce) {
    .tool.look--edit .tool__stage, .tool.look--gif .tool__stage, .tool.look--edit .tool__empty--keep .tool__emptyIcon { animation: none; }
}
