/* Shared with the Canvas renderers in ts/common/geometry_style.ts.
   Dark colors follow overlay_editor/src/app/design.rs; light colors keep
   the same Subject / Clip / Result roles with contrast on white. */
:root {
    --geometry-scheme: light;
    --geometry-canvas: #ffffff;
    --geometry-panel: #f5f6f8;
    --geometry-border: #d5dbe3;
    --geometry-control: #ffffff;
    --geometry-hover: #e9ecf2;
    --geometry-selection: #ede7fa;
    --geometry-text: #303641;
    --geometry-muted: #647084;
    --geometry-subject: #c4515a;
    --geometry-clip: #2c73b9;
    --geometry-result: #218259;
    --geometry-accent: #7654c2;
    --geometry-warm: #aa7000;
}

.coal, .navy, .ayu {
    --geometry-scheme: dark;
    --geometry-canvas: #15181d;
    --geometry-panel: #20242b;
    --geometry-border: #303641;
    --geometry-control: #2a2f39;
    --geometry-hover: #373b49;
    --geometry-selection: #40345b;
    --geometry-text: #dee4ed;
    --geometry-muted: #919bad;
    --geometry-subject: #f08080;
    --geometry-clip: #67aef7;
    --geometry-result: #65d6a0;
    --geometry-accent: #a78bfa;
    --geometry-warm: #ffcc00;
}

.rust {
    --geometry-canvas: #faf8f4;
    --geometry-panel: #f0ede7;
    --geometry-border: #d5cec4;
    --geometry-control: #fffdf9;
    --geometry-hover: #e9e4da;
}

.geometry-diagram-frame {
    margin: 1rem 0;
    overflow: hidden;
    border: 1px solid var(--geometry-border);
    border-radius: 10px;
    background: var(--geometry-canvas);
}

.geometry-diagram-frame--compact {
    width: 50%;
}

.geometry-diagram-frame--medium {
    max-width: 512px;
}

.geometry-diagram-frame--thumbnail {
    max-width: 240px;
}

.geometry-diagram-frame--scroll {
    overflow-x: auto;
}

.geometry-diagram-frame--scroll .geometry-diagram {
    min-width: 720px;
}

.geometry-diagram-frame--scroll:focus-visible,
.benchmark-section .table-wrapper:focus-visible {
    outline: 2px solid var(--geometry-accent);
    outline-offset: 3px;
}

.geometry-scroll-hint {
    display: none;
    color: var(--geometry-muted);
    font-size: 0.9em;
}

@media (max-width: 800px) {
    .geometry-scroll-hint {
        display: block;
    }
}

.benchmark-section .table-wrapper {
    margin: 1.25rem 0;
    overflow-x: auto;
    border: 1px solid var(--geometry-border);
    border-radius: 10px;
    background: var(--geometry-canvas);
}

.benchmark-section table {
    --benchmark-row-background: var(--geometry-canvas);
    display: table;
    width: 100%;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    color: var(--geometry-text);
    font-variant-numeric: tabular-nums lining-nums;
}

.benchmark-section :is(th, td) {
    padding: 0.65rem 0.85rem;
    border: 0;
    border-bottom: 1px solid var(--geometry-border);
    text-align: right;
    white-space: nowrap;
}

.benchmark-section thead {
    --benchmark-row-background: var(--geometry-panel);
    background: var(--benchmark-row-background);
}

.benchmark-section th {
    color: var(--geometry-muted);
    font-weight: 600;
}

.benchmark-section tbody tr {
    background: var(--benchmark-row-background);
}

.benchmark-section tbody tr:nth-child(2n) {
    --benchmark-row-background: var(--geometry-panel);
    background: var(--benchmark-row-background);
}

.benchmark-section tbody tr:last-child td {
    border-bottom: 0;
}

.benchmark-section table:has(th:nth-child(2) .benchmark-own) tr > :nth-child(2),
.benchmark-section table:has(th:nth-child(3) .benchmark-own) tr > :nth-child(3),
.benchmark-section table:has(th:nth-child(4) .benchmark-own) tr > :nth-child(4) {
    background: color-mix(in srgb, var(--geometry-result) 10%, var(--benchmark-row-background));
}

.benchmark-section th:has(.benchmark-own) {
    color: var(--geometry-result);
}

@media (max-width: 600px) {
    .geometry-diagram-frame--compact {
        width: auto;
    }
}

.geometry-subject {
    color: var(--geometry-subject);
}

.geometry-clip {
    color: var(--geometry-clip);
}

.demo-shell {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    color: inherit;
}

.demo-shell--wide {
    max-width: 1200px;
}

.curve-playground-page {
    --content-max-width: 1320px;
}

.curve-playground-page .curve-playground.demo-shell--wide {
    max-width: 1320px;
}

.curve-playground-page .nav-chapters,
.curve-playground-page .nav-wrapper {
    display: none;
}

.demo-title {
    margin: 0 0 1rem;
    color: inherit;
    text-align: center;
}

.demo-controls {
    color: var(--geometry-text);
    color-scheme: var(--geometry-scheme);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 0.75rem 1.5rem;
    padding: 1rem;
    border: 1px solid var(--geometry-border);
    border-radius: 10px;
    background: var(--geometry-panel);
}

.demo-control {
    display: grid;
    grid-template-columns: minmax(8rem, auto) minmax(0, 1fr);
    align-items: center;
    gap: 0.75rem;
    min-height: 2rem;
}

.demo-control label {
    white-space: nowrap;
}

.demo-control select,
.demo-control input[type="range"] {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
}

.demo-control select {
    border: 1px solid var(--geometry-border);
    border-radius: 5px;
    min-height: 2rem;
    padding-inline: 0.5rem;
    color: inherit;
    background: var(--geometry-control);
}

.demo-control--toggle {
    grid-template-columns: 1fr auto;
}

.demo-control--range {
    grid-template-columns: minmax(7.5rem, auto) minmax(0, 1fr) 3.75rem;
}

.demo-control--wide {
    grid-column: 1 / -1;
    justify-self: center;
    width: min(100%, 32rem);
}

.demo-control input[type="checkbox"] {
    width: 1.35rem;
    height: 1.35rem;
    margin: 0;
}

.demo-value {
    min-width: 3.75rem;
    padding: 0.2rem 0.35rem;
    border-radius: 4px;
    font-variant-numeric: tabular-nums;
    text-align: right;
    background: var(--geometry-control);
}

.demo-control-group {
    min-width: 0;
}

.demo-control-group h3 {
    margin: 0 0 0.75rem;
    text-align: center;
}

.demo-control-group .demo-control + .demo-control {
    margin-top: 0.5rem;
}

.demo-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem 1.5rem;
    margin-top: 0.75rem;
}

.demo-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding: 0 0.5rem;
    border-radius: 5px;
    cursor: pointer;
}

.demo-option:hover {
    color: var(--geometry-text);
    background: var(--geometry-hover);
}

.demo-option input {
    width: 1.35rem;
    height: 1.35rem;
    margin: 0;
}

.demo-navigation {
    display: grid;
    grid-template-columns: 100px minmax(0, 1fr) 100px;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0 0.75rem;
}

.demo-test-title {
    margin: 0;
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.demo-button {
    color-scheme: var(--geometry-scheme);
    min-height: 2.75rem;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--geometry-border);
    border-radius: 5px;
    color: var(--geometry-text);
    background: var(--geometry-control);
    cursor: pointer;
}

.demo-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin: 0.75rem 0;
}

.demo-actions .demo-button {
    min-width: 7rem;
}

.demo-hint {
    margin: 0.75rem 0;
    color: inherit;
    opacity: 0.78;
    text-align: center;
}

.demo-legend {
    padding: 0.65rem;
    border-radius: 5px;
    color: var(--geometry-text);
    background: var(--geometry-panel);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem 1.25rem;
    margin: 0.75rem 0;
    font-size: 0.9em;
}

.demo-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.demo-swatch {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: currentColor;
}

.demo-swatch--subject {
    color: var(--geometry-subject);
}

.demo-swatch--clip {
    color: var(--geometry-clip);
}

.demo-swatch--result {
    color: var(--geometry-result);
}

.demo-button:hover {
    border-color: var(--geometry-accent);
    background: var(--geometry-hover);
}

.demo-button:active {
    transform: translateY(1px);
}

.demo-button:focus-visible,
.demo-control :focus-visible,
.demo-option :focus-visible {
    outline: 2px solid var(--geometry-accent);
    outline-offset: 2px;
}

.demo-canvas {
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: 800px;
    height: auto;
    margin: 0 auto;
    border: 1px solid var(--geometry-border);
    border-radius: 8px;
    background: var(--geometry-canvas);
    touch-action: none;
}

.demo-canvas--draggable {
    cursor: grab;
}

.demo-canvas--draggable:active {
    cursor: grabbing;
}

.demo-canvas--portrait,
.demo-canvas--stars {
    max-width: 750px;
}

.demo-canvas--stars {
    margin-top: 0.75rem;
}

.demo-app-viewport {
    max-width: 100%;
    overflow: auto;
    border-radius: 8px;
}

.demo-app-canvas {
    display: block;
    width: 800px;
    height: 800px;
}

.demo-warning {
    padding: 1rem;
    border: 1px solid var(--geometry-subject);
    border-radius: 8px;
    color: var(--geometry-subject);
    text-align: center;
    background: var(--geometry-panel);
}

.demo-warning img {
    width: 150px;
    height: auto;
    margin-top: 0.5rem;
}

.curve-playground {
    --curve-subject: var(--geometry-subject);
    --curve-clip: var(--geometry-clip);
    --curve-result: var(--geometry-result);
}

.curve-playground__header {
    max-width: 760px;
    margin: 0 auto 1.25rem;
    text-align: center;
}

.curve-playground__eyebrow {
    margin: 0 0 0.35rem;
    color: var(--geometry-accent);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.curve-playground__intro {
    margin: -0.35rem auto 0;
    color: inherit;
    line-height: 1.55;
    opacity: 0.78;
}

.curve-playground__test-switcher {
    color: var(--geometry-text);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.85rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--geometry-border);
    border-radius: 14px;
    background: var(--geometry-panel);
}

.curve-playground__test-copy {
    min-width: 0;
    text-align: center;
}

.curve-playground__test-index {
    display: block;
    margin-bottom: 0.1rem;
    color: var(--geometry-accent);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.curve-playground__test-copy h2 {
    margin: 0;
    color: inherit;
    font-size: 1.15rem;
}

.curve-playground__test-copy p {
    margin: 0.18rem 0 0;
    color: inherit;
    font-size: 0.84rem;
    opacity: 0.7;
}

.curve-playground__test-arrow {
    width: 2.8rem;
    min-width: 2.8rem;
    padding: 0;
    border-radius: 50%;
    font-size: 1.2rem;
}

.curve-playground__test-dots {
    display: flex;
    justify-content: center;
    gap: 0.38rem;
    margin-top: 0.55rem;
}

.curve-playground__test-dot {
    width: 1.65rem;
    height: 0.38rem;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 999px;
    color: transparent;
    background: var(--geometry-border);
    cursor: pointer;
    transition: width 140ms ease, background-color 140ms ease;
}

.curve-playground__test-dot.is-active {
    width: 2.8rem;
    background: var(--geometry-accent);
}

.curve-playground__test-dot:focus-visible {
    outline: 3px solid var(--geometry-accent);
    outline-offset: 3px;
}

.curve-playground__panel {
    color: var(--geometry-text);
    color-scheme: var(--geometry-scheme);
    display: grid;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--geometry-border);
    border-radius: 14px;
    background: var(--geometry-panel);
    box-shadow: none;
}

.curve-playground__control-block {
    display: grid;
    gap: 0.45rem;
}

.curve-playground__control-block--compact {
    min-width: min(100%, 19rem);
}

.curve-playground__label {
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    opacity: 0.65;
    text-transform: uppercase;
}

.curve-playground__segments {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.curve-playground__segment {
    min-height: 2.55rem;
    padding: 0.45rem 0.85rem;
    border: 1px solid var(--geometry-border);
    border-radius: 999px;
    color: inherit;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    background: var(--geometry-control);
    cursor: pointer;
    transition: border-color 120ms ease, box-shadow 120ms ease, color 120ms ease, transform 120ms ease;
}

.curve-playground__segment:hover {
    border-color: var(--geometry-accent);
    transform: translateY(-1px);
}

.curve-playground__segment.is-active {
    border-color: var(--geometry-accent);
    color: var(--geometry-text);
    background: var(--geometry-selection);
    box-shadow: none;
}

.curve-playground__segment:focus-visible,
.curve-playground__reset:focus-visible {
    outline: 3px solid var(--geometry-accent);
    outline-offset: 2px;
}

.curve-playground__toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
}

.curve-playground__reset {
    flex: 0 0 auto;
    border-radius: 999px;
}

.curve-playground__legend {
    padding: 0.65rem;
    border-radius: 5px;
    color: var(--geometry-text);
    background: var(--geometry-panel);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.55rem 1.25rem;
    margin: 0.95rem 0 0.7rem;
    font-size: 0.86rem;
    opacity: 0.88;
}

.curve-playground__legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
}

.curve-playground__key {
    display: inline-block;
    width: 1.25rem;
    height: 0.62rem;
    border: 2px dashed currentColor;
    border-radius: 999px;
    background: color-mix(in srgb, currentColor 18%, transparent);
}

.curve-playground__key--subject {
    color: var(--curve-subject);
}

.curve-playground__key--clip {
    color: var(--curve-clip);
}

.curve-playground__key--result {
    border-style: solid;
    color: var(--curve-result);
}

.curve-playground__handle-key {
    width: 0.75rem;
    height: 0.75rem;
    border: 1px solid var(--geometry-subject);
    transform: rotate(45deg);
    background: var(--geometry-canvas);
}

.curve-playground__stage {
    position: relative;
}

.curve-playground__canvas {
    max-width: none;
    aspect-ratio: 50 / 34;
    border-color: var(--geometry-border);
    border-radius: 14px;
    box-shadow: none;
}

.curve-playground__canvas.is-dragging {
    cursor: grabbing !important;
}

.curve-playground__canvas-hint {
    position: absolute;
    right: 0.8rem;
    bottom: 0.7rem;
    margin: 0;
    padding: 0.35rem 0.6rem;
    border: 1px solid var(--geometry-border);
    border-radius: 999px;
    color: var(--geometry-text);
    font-size: 0.75rem;
    background: var(--geometry-panel);
    backdrop-filter: blur(8px);
    pointer-events: none;
}

.curve-playground__stats {
    display: grid;
    grid-template-columns: 1.45fr repeat(3, 1fr);
    gap: 0.65rem;
    margin-top: 0.75rem;
}

.curve-playground__stat {
    color: var(--geometry-text);
    color-scheme: var(--geometry-scheme);
    min-width: 0;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--geometry-border);
    border-radius: 10px;
    background: var(--geometry-panel);
}

.curve-playground__stat span {
    display: block;
    margin-bottom: 0.18rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    opacity: 0.62;
    text-transform: uppercase;
}

.curve-playground__stat strong {
    display: block;
    overflow: hidden;
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.curve-playground__status {
    margin: 0.55rem 0 0;
    color: inherit;
    font-size: 0.77rem;
    opacity: 0.65;
    text-align: right;
}

.curve-playground__status.is-warning {
    color: var(--geometry-warm);
    opacity: 1;
}

.curve-playground__status.is-error {
    color: var(--geometry-subject);
    opacity: 1;
}

/* Keep the curve demos' controls visually light without shrinking their
   pointer hit areas below a comfortable size. */
.curve-playground .curve-playground__test-switcher {
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-color: var(--geometry-border);
    border-radius: 10px;
    background: var(--geometry-panel);
}

.curve-playground .curve-playground__test-arrow {
    width: 2.3rem;
    min-width: 2.3rem;
    min-height: 2.3rem;
    border-width: 1px;
    font-size: 1rem;
}

.curve-playground .curve-playground__test-dot {
    height: 0.25rem;
}

.curve-playground .curve-playground__panel {
    color: var(--geometry-text);
    color-scheme: var(--geometry-scheme);
    gap: 0.7rem;
    padding: 0.7rem;
    border-color: var(--geometry-border);
    border-radius: 10px;
    background: var(--geometry-panel);
    box-shadow: none;
}

.curve-playground .curve-playground__control-block {
    gap: 0.3rem;
}

.curve-playground .curve-playground__segments {
    gap: 0.3rem;
}

.curve-playground .curve-playground__segment {
    min-height: 2.15rem;
    padding: 0.3rem 0.65rem;
    border-color: var(--geometry-border);
    font-size: 0.82rem;
    font-weight: 550;
}

.curve-playground .curve-playground__segment:hover {
    border-color: var(--geometry-accent);
    transform: none;
}

.curve-playground .curve-playground__segment.is-active {
    border-color: var(--geometry-accent);
    background: var(--geometry-selection);
    color: var(--geometry-text);
    box-shadow: none;
}

.curve-playground .curve-playground__segment:focus-visible,
.curve-playground .curve-playground__reset:focus-visible {
    outline-width: 2px;
}

.curve-playground .curve-playground__reset {
    min-height: 2.2rem;
    padding: 0.35rem 0.7rem;
    border-width: 1px;
    font-size: 0.82rem;
}

.curve-playground .curve-playground__key {
    border-width: 0.75px;
}

.curve-playground .curve-playground__handle-key {
    width: 0.62rem;
    height: 0.62rem;
    border-width: 1px;
}

.curve-playground .curve-playground__canvas {
    border-color: var(--geometry-border);
    border-radius: 10px;
    box-shadow: none;
}

.curve-playground .curve-playground__canvas-hint {
    padding: 0.25rem 0.5rem;
    border-color: var(--geometry-border);
    font-size: 0.7rem;
}

.curve-playground .curve-playground__stats {
    gap: 0.45rem;
    margin-top: 0.55rem;
}

.curve-playground .curve-playground__stat {
    color: var(--geometry-text);
    color-scheme: var(--geometry-scheme);
    padding: 0.55rem 0.65rem;
    border-color: var(--geometry-border);
    border-radius: 7px;
    background: var(--geometry-panel);
}

/* TypeCurve extends the Shapes Editor / Boolean Playground demo system without
   changing either existing demo's layout or interaction styles. */
.type-curve {
    --curve-selected: var(--geometry-accent);
}

.type-curve .curve-playground__text-controls {
    display: grid;
    grid-template-columns: minmax(14rem, 1.4fr) minmax(13rem, 1fr) auto;
    align-items: end;
    gap: 0.85rem;
}

.type-curve .curve-playground__field {
    display: grid;
    gap: 0.4rem;
}

.type-curve .curve-playground__field .curve-playground__label {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
}

.type-curve .curve-playground__field output {
    color: var(--geometry-accent);
    font-variant-numeric: tabular-nums;
}

.type-curve .curve-playground__text-input {
    width: 100%;
    min-height: 2.75rem;
    box-sizing: border-box;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--geometry-border);
    border-radius: 9px;
    color: var(--geometry-text);
    font: 600 1rem/1.2 inherit;
    letter-spacing: 0.04em;
    background: var(--geometry-control);
}

.type-curve .curve-playground__text-input:focus,
.type-curve .curve-playground__field input[type="range"]:focus-visible {
    outline: 3px solid var(--geometry-accent);
    outline-offset: 2px;
}

.type-curve .curve-playground__field-help {
    margin: -0.45rem 0 0;
    font-size: 0.75rem;
    opacity: 0.62;
}

.type-curve .curve-playground__control-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(12rem, 0.8fr);
    gap: 1rem;
}

.type-curve .curve-playground__canvas {
    aspect-ratio: 25 / 13;
}

.type-curve .curve-playground__key--selected {
    border-width: 0.75px;
    border-style: dotted;
    color: var(--curve-selected);
}

.type-curve .curve-playground__handle-key {
    border-color: var(--curve-selected);
}

.type-curve .curve-playground__stats {
    grid-template-columns: 1.2fr 1.45fr repeat(3, 1fr);
}

.type-curve .curve-playground__attribution {
    max-width: 820px;
    margin: 0.9rem auto 0;
    font-size: 0.72rem;
    line-height: 1.55;
    opacity: 0.66;
    text-align: center;
}

.curve-motion__control-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
    gap: 0.8rem 1rem;
}

.curve-motion__field {
    display: grid;
    gap: 0.38rem;
    min-width: 0;
}

.curve-motion__field .curve-playground__label {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
}

.curve-motion__field output {
    color: var(--geometry-accent);
    font-variant-numeric: tabular-nums;
}

.curve-motion__field input[type="range"] {
    width: 100%;
    margin: 0;
}

.curve-motion__field input[type="range"]:focus-visible {
    outline: 3px solid var(--geometry-accent);
    outline-offset: 2px;
}

.curve-motion__toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
}

.curve-motion__toolbar .curve-playground__control-block {
    min-width: 0;
}

.curve-motion__canvas {
    aspect-ratio: 50 / 31;
}

.curve-motion__stats {
    grid-template-columns: 1.35fr 1.35fr repeat(3, 0.8fr);
}

@media (max-width: 700px) {
    .demo-controls {
        grid-template-columns: 1fr;
        padding: 0.75rem;
    }

    .demo-control {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }

    .demo-control--toggle {
        grid-template-columns: 1fr auto;
    }

    .demo-control--range {
        grid-template-columns: minmax(0, 1fr) 3.75rem;
    }

    .demo-control--range label {
        grid-column: 1 / -1;
    }

    .demo-navigation {
        grid-template-columns: minmax(72px, auto) minmax(0, 1fr) minmax(72px, auto);
        gap: 0.5rem;
    }

    .curve-playground__panel {
        padding: 0.8rem;
        border-radius: 12px;
    }

    .curve-playground__test-switcher {
        gap: 0.55rem;
        padding: 0.75rem 0.65rem;
    }

    .curve-playground__test-copy h2 {
        font-size: 1rem;
    }

    .curve-playground__test-copy p {
        min-height: 2.6em;
        font-size: 0.76rem;
        line-height: 1.3;
    }

    .curve-playground__test-arrow {
        width: 2.6rem;
        min-width: 2.6rem;
    }

    .curve-playground__segments {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .curve-playground__segment {
        width: 100%;
        min-height: 2.75rem;
        padding-inline: 0.55rem;
        border-radius: 9px;
        font-size: 0.82rem;
    }

    .curve-playground__toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .curve-playground__reset {
        width: 100%;
    }

    .curve-playground__canvas-hint {
        position: static;
        padding: 0.5rem 0 0;
        border: 0;
        color: inherit;
        background: transparent;
        backdrop-filter: none;
        text-align: center;
    }

    .curve-playground__stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .curve-playground__stat {
        padding: 0.65rem;
    }

    .curve-playground__stat strong {
        font-size: 0.8rem;
    }

    .type-curve .curve-playground__text-controls,
    .type-curve .curve-playground__control-grid {
        grid-template-columns: 1fr;
    }

    .type-curve .curve-playground__field--size {
        padding-top: 0.2rem;
    }

    .type-curve .curve-playground__stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .curve-motion__toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .curve-motion__toolbar .curve-playground__reset {
        align-self: stretch;
    }

    .curve-motion__stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 420px) {
    .curve-playground__legend {
        justify-content: flex-start;
    }

    .curve-playground__stats {
        grid-template-columns: 1fr;
    }

    .type-curve .curve-playground__stats {
        grid-template-columns: 1fr;
    }

    .curve-motion__stats {
        grid-template-columns: 1fr;
    }
}

.demo-control input,
.demo-option input,
.curve-playground input {
    accent-color: var(--geometry-accent);
}

#delaunayCanvas {
    max-width: 500px;
}
