.page-tool--cubic-bezier-editor .tool-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.page-tool--cubic-bezier-editor .cbe-studio {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.page-tool--cubic-bezier-editor .cbe-editor,
.page-tool--cubic-bezier-editor .cbe-side {
    min-width: 0;
}

.page-tool--cubic-bezier-editor .cbe-editor__body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.page-tool--cubic-bezier-editor .cbe-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Presets */
.page-tool--cubic-bezier-editor .cbe-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.page-tool--cubic-bezier-editor .cbe-preset {
    padding: 0.32rem 0.7rem;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--ink-2);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.page-tool--cubic-bezier-editor .cbe-preset:hover {
    border-color: var(--accent);
    color: var(--ink);
}

.page-tool--cubic-bezier-editor .cbe-preset.is-active {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
}

/* Curve canvas */
.page-tool--cubic-bezier-editor .cbe-canvas {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.page-tool--cubic-bezier-editor .cbe-canvas__svg {
    display: block;
    width: 100%;
    height: auto;
    max-width: 34rem;
    margin: 0 auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-2);
    touch-action: none;
}

.page-tool--cubic-bezier-editor .cbe-grid__unit {
    fill: var(--surface-3);
    opacity: 0.55;
}

.page-tool--cubic-bezier-editor .cbe-grid__line {
    stroke: var(--line);
    stroke-width: 0.6;
}

.page-tool--cubic-bezier-editor .cbe-handle-line {
    stroke: var(--line-strong);
    stroke-width: 0.9;
    stroke-dasharray: 3 2.4;
}

.page-tool--cubic-bezier-editor .cbe-curve-path {
    fill: none;
    stroke: var(--accent);
    stroke-width: 2.2;
    stroke-linecap: round;
}

.page-tool--cubic-bezier-editor .cbe-anchor {
    fill: var(--faint);
}

.page-tool--cubic-bezier-editor .cbe-handle {
    fill: var(--accent);
    stroke: var(--surface);
    stroke-width: 1.5;
    cursor: grab;
    outline: none;
}

.page-tool--cubic-bezier-editor .cbe-handle:hover {
    stroke: var(--accent-soft);
    stroke-width: 2.4;
}

.page-tool--cubic-bezier-editor .cbe-handle:focus-visible {
    stroke: var(--ink);
    stroke-width: 2.6;
}

.page-tool--cubic-bezier-editor .cbe-handle:active {
    cursor: grabbing;
}

.page-tool--cubic-bezier-editor .cbe-canvas__caption {
    margin: 0;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--ink-2);
}

/* Per-point sliders */
.page-tool--cubic-bezier-editor .cbe-point-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
}

.page-tool--cubic-bezier-editor .cbe-point {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    margin: 0;
    padding: 10px 12px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.page-tool--cubic-bezier-editor .cbe-point__legend {
    padding: 0 6px;
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--faint);
}

.page-tool--cubic-bezier-editor .cbe-control {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.page-tool--cubic-bezier-editor .cbe-control__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.page-tool--cubic-bezier-editor .cbe-control__label {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--faint);
}

.page-tool--cubic-bezier-editor .cbe-control__range {
    width: 100%;
    height: 1.5rem;
    margin: 0;
    accent-color: var(--accent);
    cursor: pointer;
}

.page-tool--cubic-bezier-editor .cbe-control__number {
    flex: 0 0 4.5rem;
    width: 4.5rem;
    min-height: 1.85rem;
    padding: 0.15rem 0.35rem;
    border-color: var(--line);
    background: var(--surface-3);
    color: var(--ink-2);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-align: right;
}

/* Paste input */
.page-tool--cubic-bezier-editor .cbe-paste {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.page-tool--cubic-bezier-editor .cbe-paste__label {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--faint);
}

.page-tool--cubic-bezier-editor .cbe-paste__row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.page-tool--cubic-bezier-editor .cbe-paste__input {
    flex: 1 1 16rem;
    min-width: 0;
    font-family: var(--font-mono);
    font-size: 0.82rem;
}

.page-tool--cubic-bezier-editor .cbe-status,
.page-tool--cubic-bezier-editor .cbe-copy-status {
    margin: 0;
    min-height: 0;
    font-size: 0.78rem;
}

.page-tool--cubic-bezier-editor .cbe-copy-status:empty {
    display: none;
}

/* Motion preview */
.page-tool--cubic-bezier-editor .cbe-preview__body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.page-tool--cubic-bezier-editor .cbe-track {
    position: relative;
    display: flex;
    align-items: center;
    height: 4.2rem;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-2);
    overflow: hidden;
}

.page-tool--cubic-bezier-editor .cbe-dot {
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 12px;
    background: var(--accent);
    box-shadow: var(--shadow-sm);
    will-change: transform;
}

.page-tool--cubic-bezier-editor .cbe-preview-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
}

.page-tool--cubic-bezier-editor .cbe-duration {
    flex: 0 0 8rem;
    width: 8rem;
}

/* Output */
.page-tool--cubic-bezier-editor .cbe-output__body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.page-tool--cubic-bezier-editor .cbe-code {
    min-height: 3.6rem;
    font-size: 0.9rem;
}

.page-tool--cubic-bezier-editor .cbe-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* About */
.page-tool--cubic-bezier-editor .cbe-about__text {
    max-width: 80ch;
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.page-tool--cubic-bezier-editor .cbe-about__text code,
.page-tool--cubic-bezier-editor .tool-header__summary code {
    padding: 0.05rem 0.3rem;
    border-radius: var(--radius-xs);
    background: var(--surface-3);
    color: var(--ink-2);
    font-family: var(--font-mono);
}

@media (max-width: 900px) {
    .page-tool--cubic-bezier-editor .cbe-studio {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 560px) {
    .page-tool--cubic-bezier-editor .cbe-point-controls {
        grid-template-columns: minmax(0, 1fr);
    }
}
