:root {
    --text: #181818;
    --muted: #777;
    --line: #e8e8e8;
    --surface: #ffffff;
    --surface-2: #f7f7f7;
    --accent: #111111;
    --shadow: 0 18px 40px #00000014;
    --panel-width: 360px;
    --panel-offset: 18px;
    --panel-hidden-x: calc(-1 * (var(--panel-width) + var(--panel-offset)));
    --stage-safe-left: calc(var(--panel-width) + (var(--panel-offset) * 2) + 32px);
    --stage-safe-right: 32px;
    --canvas-extra-space: 0px;
    --canvas-max-height: calc(100vh - 56px);
}

body.panel-collapsed {
    --stage-safe-left: 14px;
    --stage-safe-right: 14px;
    --canvas-extra-space: 0px;
    --canvas-max-height: calc(100vh - 28px);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html,
body {
    height: 100%;
    overflow: hidden;
}

body {
    margin: 0;
    color: var(--text);
    background: #ffffff;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
    font: inherit;
}

button {
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--surface);
    color: var(--text);
    min-height: 42px;
    padding: 0 14px;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

button:hover {
    border-color: #cfcfcf;
    transform: translateY(-1px);
}

button.primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

button.is-record-active {
    background: #ef233c;
    color: #ffffff;
    border-color: #ef233c;
}

button.is-record-active:hover {
    background: #d90429;
    border-color: #d90429;
}

button.soft {
    background: var(--surface-2);
}

.app-shell {
    position: relative;
    display: block;
    height: 100vh;
    overflow: hidden;
}

.panel {
    position: absolute;
    top: var(--panel-offset);
    bottom: var(--panel-offset);
    left: var(--panel-offset);
    z-index: 2;
    width: var(--panel-width);
    border-right: 1px solid var(--line);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 0;
    height: auto;
    overflow-y: auto;
    overflow-x: hidden;
    background: rgba(255, 255, 255, 0.96);
    overscroll-behavior: contain;
    box-shadow: 0 18px 40px #00000014;
    scrollbar-width: none;
    -ms-overflow-style: none;
    transition: transform 0.22s ease;
}

body.panel-collapsed .panel {
    transform: translateX(var(--panel-hidden-x));
}

.panel::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.panel-toggle {
    position: absolute;
    top: 50%;
    left: calc(var(--panel-offset) + var(--panel-width));
    z-index: 5;
    width: 32px;
    height: 64px;
    min-height: 64px;
    padding: 0;
    border: 0;
    border-radius: 0 24px 24px 0;
    background: #ffffff;
    box-shadow: 8px 10px 24px #00000012;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%);
    transition: left 0.22s ease, opacity 0.16s ease;
}

.panel-toggle:hover {
    transform: translateY(-50%);
    border-color: transparent;
}

.panel-toggle span {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-left: 2px solid #111111;
    border-bottom: 2px solid #111111;
    transform: rotate(45deg);
    transition: transform 0.18s ease;
}

body.panel-collapsed .panel-toggle span {
    transform: rotate(-135deg);
}

body.panel-collapsed .panel-toggle {
    left: 0;
}

.panel:hover + .panel-toggle,
.panel-toggle:hover,
body.panel-collapsed .panel-toggle {
    opacity: 1;
    pointer-events: auto;
}

.floating-actions {
    position: absolute;
    top: 28px;
    right: 28px;
    z-index: 6;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 18px 40px #00000014;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.96);
    transition: opacity 0.18s ease, transform 0.18s ease;
    user-select: none;
}

body.panel-collapsed .floating-actions {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

.floating-actions.is-dragging {
    cursor: grabbing;
}

.floating-actions button {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    min-height: 46px;
    padding: 0;
    border: 0;
    border-radius: 16px;
    background: #f4f4f6;
    color: #111111;
}

.floating-actions button:hover {
    transform: none;
    background: #ececef;
}

.floating-actions svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.floating-actions button.is-record-active {
    background: #ef233c;
    color: #ffffff;
}

.brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 56px;
    padding: 0 18px;
    margin-bottom: 0;
    border-bottom: 1px solid var(--line);
}

.brand-mark {
    width: 21px;
    height: 21px;
    border-radius: 6px;
    display: inline-block;
    background:
        radial-gradient(circle at 50% 52%, #fff 0 25%, transparent 26%),
        radial-gradient(circle at 50% 52%, #111 0 44%, transparent 45%),
        #ff2a16;
}

.brand h1,
.brand p,
.section-title h2 {
    margin: 0;
}

.brand h1 {
    font-size: 0.92rem;
    line-height: 1.1;
    font-weight: 700;
}

.brand h1 span {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-left: 5px;
    border-radius: 50%;
    background: #ff5b5b;
    vertical-align: middle;
}

.menu-dot {
    min-height: 28px;
    width: 34px;
    padding: 0;
    border: 0;
    background: transparent;
    font-weight: 800;
    letter-spacing: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.canvas-select-field {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.brand + .field {
    margin-top: 20px;
}

.brand p,
.status,
.saved-meta {
    color: var(--muted);
    font-size: 0.86rem;
}

.field {
    display: grid;
    gap: 8px;
    margin: 0 26px 16px;
}

.field span,
.toggle {
    color: #9aa0ae;
    font-size: 0.72rem;
}

.field b {
    float: right;
    color: #343434;
    font-weight: 650;
}

input[type="text"],
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    min-height: 44px;
    padding: 0 12px;
    background: var(--surface);
    color: var(--text);
}

input[type="text"] {
    border: 0;
    border-radius: 999px;
    min-height: 54px;
    padding: 0 22px;
    background: #f0f0f2;
    color: #1f2024;
    outline: 1px solid transparent;
    outline-offset: 0;
}

input[type="text"]:focus,
input[type="text"]:focus-visible {
    outline: 1px solid var(--line);
}

select {
    appearance: none;
    border: 0;
    border-radius: 999px;
    min-height: 54px;
    padding: 0 54px 0 22px;
    background-color: #f0f0f2;
    background-image:
        linear-gradient(45deg, transparent 50%, #9a9ca3 50%),
        linear-gradient(135deg, #9a9ca3 50%, transparent 50%);
    background-position:
        calc(100% - 32px) 50%,
        calc(100% - 24px) 50%;
    background-size: 8px 8px, 8px 8px;
    background-repeat: no-repeat;
    color: #1f2024;
    outline: 1px solid transparent;
    outline-offset: 0;
}

select:focus,
select:focus-visible {
    outline: 1px solid var(--line);
    border-color: var(--line);
}

input[type="range"] {
    width: 100%;
    height: 34px;
    appearance: none;
    background: transparent;
}

input[type="range"]::-webkit-slider-runnable-track {
    height: 34px;
    border-radius: 999px;
    background: #f1f1f3;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 32px;
    height: 32px;
    margin-top: 1px;
    border: 0;
    border-radius: 50%;
    background: #191919;
    box-shadow: none;
}

input[type="range"]::-moz-range-track {
    height: 34px;
    border-radius: 999px;
    background: #f1f1f3;
}

input[type="range"]::-moz-range-thumb {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: #191919;
}

input[type="color"] {
    width: 100%;
    height: 44px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.swatches {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 0 26px;
}

.color-controls {
    display: grid;
    gap: 18px;
    padding: 0 26px;
}

.color-row {
    display: grid;
    gap: 12px;
}

.color-row > span {
    color: #9aa0ae;
    font-size: 0.78rem;
}

.color-control {
    display: grid;
    grid-template-columns: 46px 1fr;
    align-items: center;
    gap: 14px;
}

.color-control input.color-picker {
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid #ececef;
    border-radius: 50%;
    background: transparent;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    overflow: hidden;
}

.color-control input.color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-control input.color-picker::-webkit-color-swatch {
    border: 0;
    border-radius: 50%;
}

.color-control input.color-picker::-moz-color-swatch {
    border: 0;
    border-radius: 50%;
}

.color-control input.color-text {
    width: 100%;
    min-height: 46px;
    border: 0;
    border-radius: 999px;
    background: #f0f0f2;
    color: #2e3036;
    padding: 0 18px;
    font: inherit;
}

.dimension-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    grid-column: 1 / -1;
    padding: 0;
    margin-top: 2px;
}

.dimension-grid .field,
.swatches .field {
    margin-left: 0;
    margin-right: 0;
}

.dimension-grid input[type="number"] {
    width: 100%;
    border: 0;
    border-radius: 999px;
    min-height: 54px;
    padding: 0 22px;
    background: #f0f0f2;
    color: #1f2024;
    outline: 1px solid transparent;
    outline-offset: 0;
}

.dimension-grid input[type="number"]:focus,
.dimension-grid input[type="number"]:focus-visible {
    outline: 1px solid var(--line);
}

.toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    margin: 4px 26px 18px;
}

.toggle input {
    width: 18px;
    height: 18px;
    accent-color: #111;
}

.actions {
    display: grid;
    gap: 10px;
    margin-bottom: 10px;
    padding: 0 26px;
}

.mode-switch {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 0 26px;
    margin-bottom: 14px;
}

.visu-editor__editor-menu-btn {
    min-height: 42px;
    border: 0;
    border-radius: 999px;
    background: #f4f4f6;
    color: #687080;
    font-size: 0.86rem;
    font-weight: 700;
    transform: none;
}

.visu-editor__editor-menu-btn:hover {
    transform: none;
    background: #ececef;
}

.visu-editor__editor-menu-btn.is-active {
    background: #171717;
    color: #ffffff;
}

.actions.two {
    grid-template-columns: 1fr 1fr;
}

.saved-block {
    margin-top: 0;
    padding-top: 34px;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.section-title h2 {
    font-size: 0.98rem;
}

.section-title button {
    min-height: 32px;
    padding: 0 10px;
    font-size: 0.82rem;
}

.saved-list {
    display: grid;
    gap: 10px;
    padding: 0 26px 4px;
}

.saved-item {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 12px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px;
    background: var(--surface);
}

.saved-thumb {
    width: 64px;
    height: auto;
    aspect-ratio: var(--thumb-ratio-w, 2) / var(--thumb-ratio-h, 3);
    border-radius: 6px;
    background: var(--surface-2);
    object-fit: contain;
    border: 1px solid var(--line);
}

.saved-name {
    font-weight: 650;
    margin-bottom: 4px;
    overflow-wrap: anywhere;
}

.saved-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.saved-actions button {
    min-height: 32px;
    padding: 0 10px;
    font-size: 0.82rem;
}

.admin-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    margin: 18px 26px 0;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
}

.panel > .admin-link {
    min-height: 42px;
    margin: 18px 26px 0;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    font-size: 1rem;
}

.status {
    min-height: 22px;
    margin: 16px 0 0;
}

.stage {
    position: relative;
    min-width: 0;
    min-height: 0;
    width: 100%;
    height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px var(--stage-safe-right) 28px var(--stage-safe-left);
    overflow: hidden;
    background:
        linear-gradient(#f7f7f7 1px, transparent 1px),
        linear-gradient(90deg, #f7f7f7 1px, transparent 1px),
        #ffffff;
    background-size: 42px 42px;
    transition: padding 0.28s ease;
}

.dot-color-panel {
    position: absolute;
    right: 28px;
    top: 28px;
    z-index: 3;
    width: min(310px, calc(100vw - 56px));
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 18px 40px #00000014;
    padding: 18px;
    opacity: 0;
    transform: scale(0.94);
    transform-origin: top right;
    transition: opacity 0.18s ease, transform 0.18s ease;
    will-change: opacity, transform;
}

.dot-color-panel.is-open {
    opacity: 1;
    transform: scale(1);
}

.dot-color-panel-handle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    cursor: grab;
    user-select: none;
}

.dot-color-panel.is-dragging .dot-color-panel-handle {
    cursor: grabbing;
}

.dot-color-panel strong {
    font-size: 0.98rem;
}

.dot-color-panel button {
    width: 34px;
    min-height: 34px;
    padding: 0;
    border-radius: 50%;
    background: #f4f4f6;
    border: 0;
    font-size: 1.2rem;
    line-height: 1;
}

.dot-color-panel .color-row {
    gap: 10px;
}

.dot-color-panel .saved-meta {
    margin: 12px 0 0;
}

.record-overlay {
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
}

.record-overlay.is-selecting {
    cursor: crosshair;
}

.record-selection-box {
    position: absolute;
    border: 2px solid #111111;
    border-radius: 12px;
    background: rgba(17, 17, 17, 0.08);
    box-shadow: 0 0 0 9999px rgba(255, 255, 255, 0.38);
}

.record-countdown {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 96px;
    height: 96px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 18px 40px #00000014;
    color: #111111;
    font-size: 2.4rem;
    font-weight: 800;
    transform: translate(-50%, -50%) scale(0.96);
}

.record-stop-btn {
    position: absolute;
    z-index: 5;
    min-height: 42px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    background: #ef233c;
    color: #ffffff;
    box-shadow: 0 18px 40px #00000024;
    pointer-events: auto;
}

.record-stop-btn:hover {
    background: #d90429;
}

.size-chips {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px 12px;
    padding: 20px 26px 28px;
    border-bottom: 1px solid var(--line);
}

.size-chips button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    padding: 0 12px;
    border: 0;
    border-radius: 999px;
    background: #f4f4f6;
    color: #687080;
    font-size: 0.78rem;
    font-weight: 700;
    transform: none;
}

.size-chips button:hover {
    transform: none;
    background: #ececef;
}

.size-chips button.is-active {
    background: #171717;
    color: #ffffff;
}

.size-chips span {
    line-height: 1;
}

.chip-icon {
    position: relative;
    width: 12px;
    height: 12px;
    display: inline-block;
    border: 2px solid currentColor;
    border-radius: 3px;
    opacity: 0.8;
}

.chip-icon.landscape {
    width: 13px;
    height: 9px;
}

.chip-icon.portrait {
    width: 9px;
    height: 13px;
}

.chip-icon.free {
    border-style: dashed;
}

.panel-section {
    padding: 34px 0 26px;
    border-bottom: 1px solid var(--line);
}

.panel-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0 26px;
    margin-bottom: 40px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    text-align: left;
    transform: none;
}

.panel-section-title:hover {
    border-color: transparent;
    transform: none;
}

.panel-section-title h2 {
    margin: 0;
    font-size: 1.55rem;
    line-height: 1;
    font-weight: 500;
    letter-spacing: 0;
}

.panel-section-title span {
    color: #c9c9c9;
    font-size: 1.3rem;
}

.chevron {
    width: 9px;
    height: 9px;
    border-right: 2px solid #c9c9c9;
    border-bottom: 2px solid #c9c9c9;
    transform: rotate(45deg);
    transition: transform 0.18s ease;
}

.panel-section-body {
    display: grid;
    grid-template-rows: 1fr;
    opacity: 1;
    overflow: hidden;
    transition: grid-template-rows 0.28s ease, opacity 0.18s ease;
}

.panel-section-body-inner {
    min-height: 0;
    overflow: hidden;
}

.panel-section:not(.is-open) {
    padding-bottom: 34px;
}

.panel-section:not(.is-open) .panel-section-title {
    margin-bottom: 0;
}

.panel-section:not(.is-open) .panel-section-body {
    grid-template-rows: 0fr;
    opacity: 0;
    pointer-events: none;
}

.panel-section:not(.is-open) .chevron {
    transform: rotate(-45deg);
}

.compact-actions {
    margin-top: 14px;
}

.switch-row {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 60px;
    margin: 18px 26px;
    font-size: 0.9rem;
}

.switch-row > span {
    color: #3b3b3b;
    font-size: 0.9rem;
}

.switch-row input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.switch-row i {
    position: relative;
    width: 64px;
    height: 36px;
    border-radius: 999px;
    background: #ededf0;
    transition: background 0.18s ease;
}

.switch-row i::after {
    content: "";
    position: absolute;
    top: 4px;
    left: 4px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #191919;
    transition: transform 0.18s ease, background 0.18s ease;
}

.switch-row input:checked + i {
    background: #050505;
}

.switch-row input:checked + i::after {
    transform: translateX(28px);
    background: #ededf0;
}

.canvas-wrap {
    --canvas-ratio-w: 720;
    --canvas-ratio-h: 1080;
    width: min(
        calc(var(--canvas-max-height) * var(--canvas-ratio-w) / var(--canvas-ratio-h)),
        calc(100vw - var(--stage-safe-left) - var(--stage-safe-right) + var(--canvas-extra-space)),
        1600px
    );
    max-width: calc(100vw - var(--stage-safe-left) - var(--stage-safe-right) + var(--canvas-extra-space));
    max-height: var(--canvas-max-height);
    aspect-ratio: var(--canvas-ratio-w) / var(--canvas-ratio-h);
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition:
        width 0.28s ease,
        max-width 0.28s ease,
        max-height 0.28s ease,
        transform 0.28s ease;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
    cursor: crosshair;
}

canvas.is-grid-mode {
    cursor: default;
}

.admin-page {
    min-height: 100%;
    overflow: auto;
    background:
        linear-gradient(#f0f0f2 1px, transparent 1px),
        linear-gradient(90deg, #f0f0f2 1px, transparent 1px),
        #ffffff;
    background-size: 42px 42px;
}

.admin-shell {
    width: min(1220px, calc(100% - 36px));
    margin: 0 auto;
    padding: 28px 0 48px;
}

.admin-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 22px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 18px 40px #00000014;
    padding: 18px 22px;
}

.admin-top h1 {
    margin: 0;
    font-size: 1.45rem;
    line-height: 1;
}

.admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 20px;
}

.admin-card {
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 18px 40px #00000014;
    padding: 24px;
}

.drawing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.drawing-card {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #ffffff;
    padding: 12px;
}

.drawing-card img {
    width: 100%;
    aspect-ratio: var(--thumb-ratio-w, 2) / var(--thumb-ratio-h, 3);
    object-fit: contain;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: #f4f4f4;
}

.drawing-card h3,
.preset-row strong {
    margin: 10px 0 4px;
    font-size: 1rem;
    overflow-wrap: anywhere;
}

.inline-form {
    display: inline;
}

.preset-list {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.preset-row {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #ffffff;
    padding: 14px;
}

.preset-row form {
    margin-top: 8px;
}

.mini-colors {
    display: flex;
    gap: 8px;
    margin: 8px 0;
}

.mini-colors span {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--line);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.admin-page .admin-link {
    margin: 0;
    border-radius: 8px;
}

.admin-page .saved-actions {
    align-items: center;
    flex-wrap: wrap;
}

.admin-page .saved-actions .admin-link,
.admin-page .saved-actions button,
.admin-page .preset-form button,
.admin-page .preset-row button {
    min-height: 42px;
    padding: 0 14px;
}

.admin-page .preset-form .field,
.admin-page .preset-row .field {
    margin-left: 0;
    margin-right: 0;
}

.admin-page input[type="number"] {
    width: 100%;
    border: 0;
    border-radius: 999px;
    min-height: 54px;
    padding: 0 22px;
    background: #f0f0f2;
    color: #1f2024;
    outline: 1px solid transparent;
    outline-offset: 0;
}

.admin-page input[type="number"]:focus,
.admin-page input[type="number"]:focus-visible {
    outline: 1px solid var(--line);
}

.admin-page .admin-color-controls {
    padding: 0;
    margin-bottom: 16px;
}

.admin-page .admin-switch-row {
    margin: 4px 0 18px;
}

.admin-page .color-control input.color-text {
    pointer-events: none;
}

.admin-page details {
    margin-top: 12px;
}

.admin-page summary {
    cursor: pointer;
    color: #687080;
    font-weight: 700;
}

@media (max-width: 920px) {
    .app-shell {
        display: block;
    }

    .admin-grid {
        grid-template-columns: 1fr;
    }

    .panel {
        position: absolute;
        top: 12px;
        bottom: auto;
        left: 12px;
        right: 12px;
        border-right: 0;
        width: auto;
        height: 42vh;
        max-height: 42vh;
    }

    body.panel-collapsed .panel {
        transform: translateX(calc(-100% - 12px));
    }

    .panel-toggle {
        left: calc(100% - 12px);
    }

    body.panel-collapsed .panel-toggle {
        left: 0;
    }

    .stage {
        margin-top: 0;
        padding: 18px;
        padding-top: calc(42vh + 18px);
        height: 100vh;
        min-height: 0;
    }

    .canvas-wrap {
        width: min(100%, calc((58vh - 36px) * var(--canvas-ratio-w) / var(--canvas-ratio-h)));
        max-width: min(100%, 760px);
        max-height: calc(58vh - 36px);
    }
}

@media (max-width: 560px) {
    .panel {
        padding: 18px;
    }

    .swatches,
    .dimension-grid,
    .actions.two {
        grid-template-columns: 1fr;
    }

    .stage {
        padding: 12px;
    }
}
