* {
    box-sizing: border-box;
}

@font-face { font-family: "KozGoPr6N"; src: url("../fonts/KozGoPr6N-Regular.otf") format("opentype"); font-display: swap; }
@font-face { font-family: "CPFont"; src: url("../fonts/ja/CPFont.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "CR Gothic"; src: url("../fonts/ja/CR-Gothic.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Maru Gothic"; src: url("../fonts/ja/Maru-Gothic.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "umeMincho"; src: url("../fonts/ja/umeMincho.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Iroha Maru"; src: url("../fonts/ja/Iroha-Maru.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Aoyagi Scripture"; src: url("../fonts/ja/Aoyagi-Scripture.otf") format("opentype"); font-display: swap; }
@font-face { font-family: "Candy Gothic"; src: url("../fonts/ja/Candy-Gothic.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Makinas"; src: url("../fonts/ja/Makinas.otf") format("opentype"); font-display: swap; }
@font-face { font-family: "Mamelon"; src: url("../fonts/ja/Mamelon.otf") format("opentype"); font-display: swap; }
@font-face { font-family: "Memo Writing"; src: url("../fonts/ja/Memo-writing.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Ranube POP"; src: url("../fonts/ja/Ranube-POP.otf") format("opentype"); font-display: swap; }
@font-face { font-family: "Logo Tapu Gothic"; src: url("../fonts/ja/Logo-Tapu-Gothic.otf") format("opentype"); font-display: swap; }
@font-face { font-family: "Crayon"; src: url("../fonts/ja/crayon.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Remembrance"; src: url("../fonts/ja/Remembrance.otf") format("opentype"); font-display: swap; }
@font-face { font-family: "Sumire Flow"; src: url("../fonts/ja/Sumire-flow.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Pigmo"; src: url("../fonts/ja/Pigmo.otf") format("opentype"); font-display: swap; }
@font-face { font-family: "Font Fit"; src: url("../fonts/ja/Font-that-fits-in.otf") format("opentype"); font-display: swap; }
@font-face { font-family: "Raccoon"; src: url("../fonts/ja/Raccoon.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Oswald"; src: url("../fonts/en/Oswald-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Bangers"; src: url("../fonts/en/Bangers-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Knewave"; src: url("../fonts/en/Knewave-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Bahiana"; src: url("../fonts/en/Bahiana-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Barrio"; src: url("../fonts/en/Barrio-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Amatic SC"; src: url("../fonts/en/AmaticSC-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Bowlby One SC"; src: url("../fonts/en/BowlbyOneSC-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Fredoka One"; src: url("../fonts/en/FredokaOne-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Caveat Brush"; src: url("../fonts/en/CaveatBrush-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Ceviche One"; src: url("../fonts/en/CevicheOne-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Creepster"; src: url("../fonts/en/Creepster-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Merriweather"; src: url("../fonts/en/Merriweather-Black.ttf") format("truetype"); font-weight: 900; font-display: swap; }
@font-face { font-family: "Roboto Slab"; src: url("../fonts/en/RobotoSlab-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Pacifico"; src: url("../fonts/en/Pacifico-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Pattaya"; src: url("../fonts/en/Pattaya-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Playball"; src: url("../fonts/en/Playball-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Ruge Boogie"; src: url("../fonts/en/RugeBoogie-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Special Elite"; src: url("../fonts/en/SpecialElite.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Sancreek"; src: url("../fonts/en/Sancreek-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Sansita"; src: url("../fonts/en/Sansita-ExtraBold.ttf") format("truetype"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Diplomata SC"; src: url("../fonts/en/DiplomataSC-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Keania One"; src: url("../fonts/en/KeaniaOne-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Slabo 27px"; src: url("../fonts/en/Slabo27px-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Unifraktur Cook"; src: url("../fonts/en/UnifrakturCook-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Butcherman"; src: url("../fonts/en/Butcherman-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "IM Fell English SC"; src: url("../fonts/en/IMFeENsc28P.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Rye"; src: url("../fonts/en/Rye-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Six Caps"; src: url("../fonts/en/SixCaps.ttf") format("truetype"); font-display: swap; }

html,
body {
    min-height: 100%;
}

:root {
    --next-ui-font: "BIZ UDPGothic", "Yu Gothic UI", Meiryo, "Hiragino Sans", "Noto Sans JP", sans-serif;
}

body {
    margin: 0;
    overflow-x: hidden;
    overflow-anchor: none;
    background: #eef0f3;
    color: #202124;
    font-family: var(--next-ui-font);
    font-feature-settings: "palt" 1;
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
label {
    -webkit-tap-highlight-color: transparent;
}

.next-app {
    --accent: #00a6a6;
    --accent-strong: #007b83;
    --accent-soft: #e8fbfb;
    --joy: #7c5cff;
    --joy-soft: #f3efff;
    --sun: #f6c343;
    --sky: #3d8bfd;
    --danger: #d94a3a;
    --line: #e6e8ef;
    --panel: #ffffff;
    --soft: #f7f8fb;
    --ink-muted: #667085;
    --button-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
    font-family: var(--next-ui-font);
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-height: 0;
    overflow: hidden;
    padding: 6px 8px;
}

.next-loading-screen {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background: #050505;
    opacity: 1;
    visibility: visible;
    transition: opacity 280ms ease, visibility 280ms ease;
}

.next-loading-screen.is-done {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.next-loading-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    width: min(220px, 48vw);
}

.next-loading-logo {
    display: block;
    width: min(225px, 62vw);
    height: auto;
    transform-origin: center;
    animation: birthLogoReveal 2.6s cubic-bezier(.4, 0, .2, 1) infinite;
}

@keyframes birthLogoReveal {
    0% {
        clip-path: inset(0 100% 0 0);
        opacity: 1;
        transform: translateY(2px);
    }
    55% {
        clip-path: inset(0 0 0 0);
        opacity: 1;
        transform: translateY(0);
    }
    88% {
        clip-path: inset(0 0 0 0);
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        clip-path: inset(0 0 0 0);
        opacity: 0;
        transform: translateY(0);
    }
}

.next-loading-line {
    width: 0;
    height: 1px;
    margin-top: 14px;
    background: linear-gradient(90deg, transparent, #ffffff, transparent);
    animation: birthLineGrow 2.6s cubic-bezier(.4, 0, .2, 1) infinite;
}

@keyframes birthLineGrow {
    0% {
        width: 0;
        opacity: 0;
    }
    35% {
        width: 0;
        opacity: 0;
    }
    60% {
        width: 160px;
        opacity: 1;
    }
    88% {
        width: 160px;
        opacity: 1;
    }
    100% {
        width: 0;
        opacity: 0;
    }
}

.next-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    max-width: 1480px;
    min-height: 46px;
    margin: 0 auto 6px;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 5px 16px rgba(15, 23, 42, 0.05);
    flex: 0 0 auto;
    width: 100%;
}

.next-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 360px;
    min-width: 0;
}

.next-brand-logo {
    display: block;
    flex: 0 0 auto;
    width: 88px;
    height: 42px;
    object-fit: contain;
    border-radius: 2px;
}

.next-product {
    flex: 1 1 auto;
    min-width: 0;
}

.next-product-sku {
    display: inline-block;
    color: var(--accent-strong);
    font-size: 12px;
    font-weight: 800;
}

.next-product h1 {
    margin: 2px 0 0;
    font-size: 17px;
    line-height: 1.25;
    overflow-wrap: anywhere;
    white-space: normal;
}

.next-product-row {
    position: relative;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    min-width: 0;
}

.next-product-row h1 {
    min-width: min(220px, 100%);
    flex: 1 1 220px;
}

.next-product-info-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 52px;
    height: 30px;
    padding: 0 11px;
    border: 1px solid #d8e0ea;
    border-radius: 999px;
    background: #ffffff;
    color: #102033;
    cursor: pointer;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.07);
}

.next-product-info-toggle:hover {
    border-color: var(--accent);
    color: var(--accent-strong);
}

.next-item-color-picker {
    position: relative;
    flex: 0 0 auto;
}

.next-item-color-toggle {
    display: inline-grid;
    grid-template-columns: 22px minmax(68px, 1fr) 18px;
    align-items: center;
    gap: 7px;
    min-height: 32px;
    min-width: 132px;
    max-width: 220px;
    padding: 0 7px 0 8px;
    border: 1px solid #dbe3ef;
    border-radius: 999px;
    background: #ffffff;
    color: #152033;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
    cursor: pointer;
}

.next-item-color-label,
.next-item-color-caret {
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}

.next-item-color-label {
    display: none;
}

.next-item-color-caret {
    position: relative;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    color: transparent;
    font-size: 0;
}

.next-item-color-caret::before {
    content: "";
    position: absolute;
    top: 5px;
    left: 6px;
    width: 5px;
    height: 5px;
    border-right: 2px solid #667085;
    border-bottom: 2px solid #667085;
    transform: rotate(45deg);
}

.next-item-color-toggle strong {
    min-width: 0;
    overflow: hidden;
    font-size: 12px;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.next-item-color-toggle .next-current-swatch {
    width: 22px;
    height: 22px;
}

.next-item-color-toggle:hover,
.next-item-color-toggle.is-open {
    border-color: var(--accent);
    background: #f4fbfb;
    box-shadow: 0 0 0 3px rgba(0, 166, 166, 0.12);
}

.next-item-color-toggle:hover .next-item-color-caret::before,
.next-item-color-toggle.is-open .next-item-color-caret::before {
    border-color: var(--accent-strong);
}

.next-item-color-drawer {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 30;
    width: min(340px, calc(100vw - 24px));
    padding: 10px;
    background: #ffffff;
    border: 1px solid #dce3ec;
    border-radius: 8px;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
}

.next-item-color-drawer[hidden] {
    display: none;
}

.next-item-color-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}

.next-item-color-head strong {
    color: #102033;
    font-size: 13px;
    font-weight: 900;
}

.next-item-color-head span,
.next-item-color-code {
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
}

.next-item-color-code {
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.next-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
}

.next-top-estimate {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    min-height: 34px;
    padding: 3px;
    border: 1px solid #dce4ef;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.next-top-estimate-price {
    display: grid;
    align-content: center;
    min-width: 118px;
    height: 28px;
    padding: 0 9px;
    border-right: 1px solid #e6ebf2;
}

.next-top-estimate-price span,
.next-top-estimate-price small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.next-top-estimate-price span {
    color: #102033;
    font-size: 13px;
    font-weight: 950;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
    line-height: 1.05;
}

.next-top-estimate-price small {
    color: #667085;
    font-size: 9px;
    font-weight: 900;
    line-height: 1.05;
}

.next-top-estimate.is-ready .next-top-estimate-price span {
    color: var(--accent-strong);
}

.next-top-estimate-detail {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 46px;
    height: 28px;
    padding: 0 9px;
    border: 0;
    border-radius: 6px;
    background: #f6f8fb;
    color: #102033;
    cursor: pointer;
    font-size: 11px;
    font-weight: 950;
}

.next-top-estimate-detail.is-active,
.next-top-estimate-detail:hover {
    background: var(--accent);
    color: #ffffff;
}

.next-top-estimate-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 46;
    width: min(390px, calc(100vw - 24px));
    padding: 10px;
    border: 1px solid #dce4ef;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18);
}

.next-top-estimate-panel[hidden] {
    display: none;
}

.next-top-estimate-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.next-top-estimate-panel-head strong {
    color: #102033;
    font-size: 13px;
    font-weight: 950;
}

.next-top-estimate-panel-head span {
    min-width: 0;
    overflow: hidden;
    color: #667085;
    font-size: 11px;
    font-weight: 900;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.next-top-estimate-lines {
    max-height: min(56vh, 420px);
    overflow: auto;
}

.next-draft-menu {
    position: relative;
    flex: 0 0 auto;
}

.next-draft-toggle {
    min-width: 102px;
    padding-right: 8px;
}

.next-draft-toggle strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 86px;
    min-height: 22px;
    padding: 0 7px;
    overflow: hidden;
    border-radius: 999px;
    background: #eef2f7;
    color: #64748b;
    font-size: 10px;
    font-weight: 950;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.next-draft-toggle.has-draft strong {
    background: #e7f8ef;
    color: #0f7a42;
}

.next-draft-toggle.is-dirty strong {
    background: #fff1d6;
    color: #9a5200;
}

.next-draft-toggle.is-open,
.next-draft-toggle:hover {
    border-color: var(--accent);
    background: #edfafa;
    color: var(--accent-strong);
}

.next-draft-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 35;
    width: min(320px, calc(100vw - 24px));
    padding: 10px;
    border: 1px solid #dce3ec;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
}

.next-draft-panel[hidden] {
    display: none;
}

.next-draft-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.next-draft-panel-head strong {
    color: #102033;
    font-size: 13px;
    font-weight: 950;
}

.next-draft-panel-head button {
    min-height: 26px;
    padding: 0 8px;
    border: 1px solid #d8e0ea;
    border-radius: 999px;
    background: #ffffff;
    color: #526175;
    font-size: 11px;
    font-weight: 900;
    cursor: pointer;
}

.next-draft-inline {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 7px;
}

.next-draft-inline input {
    width: 100%;
    height: 34px;
    padding: 0 9px;
    border: 1px solid #d8e0ea;
    border-radius: 8px;
    background: #ffffff;
    color: #202124;
    font-size: 13px;
    font-weight: 850;
}

.next-draft-load {
    min-width: 58px;
    min-height: 34px;
    padding: 0 11px;
    border-radius: 8px;
    font-size: 12px;
}

.next-draft-copy {
    min-width: 58px;
    min-height: 34px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 12px;
}

.next-draft-result {
    display: block;
    min-height: 18px;
    margin: 7px 1px 0;
    overflow: hidden;
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    line-height: 1.55;
    white-space: normal;
}

.next-top-estimate[hidden],
.next-print-size-meta #printSizePrice[hidden],
.next-print-method-box[hidden],
.next-order-summary[hidden],
.next-estimate-inputs label[hidden],
.next-estimate-total[hidden],
.next-readiness-chip[hidden],
#orderCheckProceed[hidden] {
    display: none !important;
}

.next-print-method-box .next-estimate-inputs {
    grid-template-columns: minmax(0, 1fr);
}

.next-print-method-box .next-estimate-inputs label:not([hidden]) {
    width: 100%;
}

.next-order-footer #orderCheckSave {
    margin-left: auto;
}

.next-btn,
.next-tool,
.next-mini-btn,
.next-icon-btn,
.next-surface-tab,
.next-print-size-tab,
.next-library-open,
.next-asset-tabs button,
.next-asset-chip,
.next-group-chip,
.next-template-chip,
.next-layer-tile,
.next-modal-close,
.next-item-close,
.next-ink-open,
.next-preview-add {
    border: 1px solid var(--line);
    background: #fff;
    color: #202124;
    cursor: pointer;
    box-shadow: var(--button-shadow);
    transition: border-color 140ms ease, background 140ms ease, color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.next-btn:hover,
.next-tool:hover,
.next-mini-btn:hover,
.next-icon-btn:hover,
.next-surface-tab:hover,
.next-print-size-tab:hover,
.next-library-open:hover,
.next-asset-tabs button:hover,
.next-asset-chip:hover,
.next-group-chip:hover,
.next-template-chip:hover,
.next-layer-tile:hover,
.next-modal-close:hover,
.next-item-close:hover,
.next-ink-open:hover,
.next-preview-add:hover {
    border-color: #c9d2df;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.next-btn:active,
.next-tool:active,
.next-mini-btn:active,
.next-icon-btn:active,
.next-surface-tab:active,
.next-print-size-tab:active,
.next-library-open:active,
.next-asset-tabs button:active,
.next-asset-chip:active,
.next-group-chip:active,
.next-template-chip:active,
.next-layer-tile:active,
.next-modal-close:active,
.next-item-close:active,
.next-ink-open:active,
.next-preview-add:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.next-btn:focus-visible,
.next-tool:focus-visible,
.next-mini-btn:focus-visible,
.next-icon-btn:focus-visible,
.next-surface-tab:focus-visible,
.next-print-size-tab:focus-visible,
.next-library-open:focus-visible,
.next-asset-tabs button:focus-visible,
.next-asset-chip:focus-visible,
.next-group-chip:focus-visible,
.next-template-chip:focus-visible,
.next-layer-tile:focus-visible,
.next-modal-close:focus-visible,
.next-item-close:focus-visible,
.next-ink-open:focus-visible,
.next-item-color-toggle:focus-visible,
.next-search:focus,
.next-field input:focus,
.next-field select:focus,
.next-field textarea:focus,
.next-draft-inline input:focus {
    outline: 3px solid rgba(0, 166, 166, 0.2);
    outline-offset: 1px;
}

.next-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    min-width: 76px;
    padding: 0 12px;
    background: #fff;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.next-topbar .next-btn {
    min-height: 34px;
    min-width: 70px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 12px;
}

#saveServer {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

#saveServer:hover {
    background: var(--accent-strong);
}

#downloadJson,
.next-file-btn {
    border-color: #d8dde6;
    background: #ffffff;
}

#downloadSvg {
    border-color: #bed2e7;
    background: #f4f9ff;
    color: #244f7a;
}

.next-file-btn {
    position: relative;
}

.next-file-btn input {
    display: none;
}

.next-link {
    border-color: #ead99f;
    background: #fff8dd;
    color: #6d5210;
}

.next-layout {
    display: grid;
    grid-template-columns: 354px minmax(600px, 1fr) 76px;
    gap: 8px;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    max-width: 1580px;
    margin: 0 auto;
    align-items: start;
}

.next-layout > * {
    min-width: 0;
}

.next-panel,
.next-workspace {
    min-width: 0;
    height: 100%;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
}

.next-panel {
    max-height: none;
    overflow: auto;
    overflow-anchor: none;
    scrollbar-gutter: stable;
    padding: 8px;
}

.next-control-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.next-control-panel > .next-section {
    flex: 0 0 auto;
}

.next-control-panel > .next-section + .next-section {
    margin-top: 0;
}

.next-control-panel:not(.has-selection) .next-selected-section {
    display: none;
}

@media (max-width: 820px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .next-app {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        height: auto;
        min-height: 100vh;
        overflow-x: hidden;
        overflow-y: visible;
        padding: 6px;
    }

    .next-topbar {
        display: flex;
        align-items: stretch;
        flex-direction: column;
        gap: 6px;
    }

    .next-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 6px;
    }

    .next-topbar .next-btn,
    .next-btn {
        min-width: 0;
    }

    .next-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
        max-width: 100%;
        min-width: 0;
        height: auto;
        gap: 8px;
    }

    .next-layout > *,
    .next-panel,
    .next-workspace,
    .next-control-panel,
    .next-left-panel,
    .next-right-panel,
    .next-layer-dock {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }

    .next-workspace {
        order: 1;
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    .next-left-panel {
        order: 2;
        height: auto;
        max-height: none;
        overflow: visible;
    }

    .next-right-panel {
        order: 3;
        height: auto;
        max-height: none;
        overflow: visible;
    }

    .next-control-panel {
        display: grid;
        grid-template-rows: auto;
        height: auto;
        overflow: visible;
    }

    .next-workbar {
        height: auto;
        max-height: none;
        overflow: visible;
        grid-template-columns: minmax(0, 1fr);
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .next-stage-layers {
        display: none !important;
    }

    .next-layer-dragbar {
        min-height: 42px;
    }

    .next-layers {
        max-height: 138px;
        overflow: auto;
    }

    .next-stage-shell {
        min-height: 360px;
        padding: 8px;
        overflow: auto;
    }

    .next-canvas {
        width: min(760px, calc(100vw - 28px));
        min-width: 0;
        max-width: calc(100vw - 28px);
    }

    .next-order-panel,
    .next-modal-panel {
        width: calc(100vw - 14px);
        max-width: calc(100vw - 14px);
    }
}

.next-toolbar-color-bubble.is-text-style {
    width: 224px;
    padding: 8px;
}

.next-toolbar-color-bubble.is-text-style .next-toolbar-color-grid {
    grid-template-columns: repeat(8, 20px);
    gap: 5px;
    margin-inline: auto;
    padding: 0;
}

.next-toolbar-color-bubble.is-text-style .next-toolbar-color-grid .next-ink-swatch {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    max-width: 20px;
    max-height: 20px;
    border-width: 2px;
}

.next-toolbar-color-bubble.is-text-style .next-palette-auto-color-button {
    min-height: 24px;
    padding: 2px 7px;
    font-size: 11px;
}

.next-toolbar-text-style-panel {
    display: grid;
    gap: 7px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #edf1f6;
}

.next-toolbar-style-targets {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
}

.next-toolbar-style-targets button,
.next-toolbar-stroke-depth button,
.next-toolbar-stroke-layers button {
    display: inline-grid;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 24px;
    padding: 0 5px;
    border: 1px solid #dce4ef;
    border-radius: 7px;
    background: #ffffff;
    color: #102033;
    cursor: pointer;
    font-family: var(--next-ui-font);
    font-size: 10px;
    font-weight: 950;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
    transform: none !important;
    transition: none !important;
}

.next-toolbar-style-targets button {
    grid-template-columns: 10px minmax(0, auto);
    gap: 4px;
}

.next-toolbar-style-targets button i,
.next-toolbar-stroke-layers button i {
    display: block;
    width: 9px;
    height: 9px;
    border: 1px solid #ffffff;
    border-radius: 999px;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.2);
}

.next-toolbar-style-targets button i.is-transparent {
    background:
        linear-gradient(135deg, transparent 42%, #6b7280 43%, #6b7280 57%, transparent 58%),
        #ffffff !important;
}

.next-toolbar-style-targets button.is-active,
.next-toolbar-stroke-depth button.is-active,
.next-toolbar-stroke-layers button.is-active {
    border-color: var(--accent);
    background: #eafafa;
    color: var(--accent-strong);
    box-shadow: 0 0 0 1px rgba(0, 166, 166, 0.22);
}

.next-toolbar-stroke-block {
    display: grid;
    gap: 6px;
    padding: 6px;
    border: 1px solid #e6edf5;
    border-radius: 9px;
    background: #fbfdff;
}

.next-toolbar-stroke-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.next-toolbar-stroke-head strong {
    color: #102033;
    font-size: 12px;
    font-weight: 950;
}

.next-toolbar-stroke-head span {
    color: #667085;
    font-size: 11px;
    font-weight: 900;
}

.next-toolbar-stroke-modes {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
}

.next-toolbar-stroke-modes button {
    display: grid;
    place-items: center;
    position: relative;
    min-height: 30px;
    padding: 0;
    border: 1px solid #dce4ef;
    border-radius: 7px;
    background: #ffffff;
    color: #102033;
    cursor: pointer;
    font-family: var(--next-ui-font);
    font-size: 19px;
    font-weight: 950;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
    transform: none !important;
    transition: none !important;
}

.next-toolbar-stroke-modes .next-outline-icon {
    display: inline-grid;
    place-items: center;
    position: relative;
    z-index: 1;
    min-width: 18px;
    line-height: 1;
}

.next-toolbar-stroke-modes button[data-text-outline="0"] {
    color: var(--accent-strong);
}

.next-toolbar-stroke-modes button[data-text-outline="0"] .next-outline-icon {
    -webkit-text-stroke: 0 transparent;
}

.next-toolbar-stroke-modes button[data-text-outline="1"] {
    color: #00a6a6;
}

.next-toolbar-stroke-modes button[data-text-outline="1"] .next-outline-icon {
    -webkit-text-stroke: 2px #102033;
}

.next-toolbar-stroke-modes button[data-text-outline="2"] {
    color: #07172c;
}

.next-toolbar-stroke-modes button[data-text-outline="2"] .next-outline-icon {
    -webkit-text-stroke: 1.6px #ffffff;
    text-shadow:
        3px 0 0 #00a6a6,
        -3px 0 0 #00a6a6,
        0 3px 0 #00a6a6,
        0 -3px 0 #00a6a6,
        2px 2px 0 #00a6a6,
        -2px -2px 0 #00a6a6,
        -2px 2px 0 #00a6a6,
        2px -2px 0 #00a6a6;
}

.next-toolbar-stroke-modes button[data-text-outline="2"] .next-outline-icon::before {
    content: "A";
    position: absolute;
    z-index: -1;
    color: #00a6a6;
    -webkit-text-stroke: 4px #00a6a6;
    transform: translate(0, 0);
}

.next-toolbar-stroke-modes button[data-text-outline].is-active {
    border-color: var(--accent);
    background: #eafafa;
    box-shadow: 0 0 0 1px rgba(0, 166, 166, 0.24);
}

.next-toolbar-stroke-modes button.is-active {
    border-color: var(--accent);
    background: #eafafa;
    box-shadow: 0 0 0 1px rgba(0, 166, 166, 0.24);
}

.next-toolbar-stroke-depth {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
}

.next-toolbar-stroke-depth button:disabled,
.next-toolbar-stroke-layers button:disabled {
    opacity: 0.42;
    cursor: default;
    box-shadow: none;
}

.next-toolbar-stroke-layers {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
}

.next-toolbar-stroke-layers button {
    grid-template-columns: 10px minmax(0, auto);
    gap: 4px;
}

.next-toolbar-stroke-width {
    display: grid;
    gap: 4px;
    min-width: 0;
    margin: 0;
}

.next-toolbar-stroke-width > span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #39465a;
    font-size: 11px;
    font-weight: 950;
}

.next-toolbar-stroke-width output {
    min-width: 24px;
    color: var(--accent-strong);
    text-align: right;
}

.next-toolbar-stroke-width input {
    width: 100%;
    accent-color: var(--accent);
    height: 18px;
}

.next-toolbar-shadow-block {
    display: grid;
    gap: 6px;
    padding-top: 7px;
    border-top: 1px solid #e8eef6;
}

.next-toolbar-shadow-modes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
}

.next-toolbar-shadow-modes button {
    min-height: 25px;
    padding: 0 5px;
    border: 1px solid #dce4ef;
    border-radius: 7px;
    background: #ffffff;
    color: #102033;
    cursor: pointer;
    font-family: var(--next-ui-font);
    font-size: 10px;
    font-weight: 950;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
    transform: none !important;
    transition: none !important;
}

.next-toolbar-shadow-modes button[data-text-shadow="hard"] {
    text-shadow: 2px 2px 0 rgba(15, 23, 42, 0.36);
}

.next-toolbar-shadow-modes button.is-active {
    border-color: var(--accent);
    background: #eafafa;
    color: var(--accent-strong);
    box-shadow: 0 0 0 1px rgba(0, 166, 166, 0.24);
}

.next-toolbar-shadow-range {
    display: grid;
    gap: 4px;
    margin: 0;
}

.next-toolbar-shadow-range > span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #39465a;
    font-size: 11px;
    font-weight: 950;
}

.next-toolbar-shadow-range output {
    min-width: 32px;
    color: var(--accent-strong);
    text-align: right;
}

.next-toolbar-shadow-range input {
    width: 100%;
    height: 18px;
    accent-color: var(--accent);
}

.next-shape-field {
    gap: 8px !important;
    padding: 9px !important;
    border: 1px solid #dfe8f2 !important;
    border-radius: 10px !important;
    background: #fbfdff !important;
}

.next-shape-field > span {
    color: #102033;
    font-size: 12px;
    font-weight: 950;
}

.next-shape-field .next-stroke-buttons,
.next-shape-field .next-stroke-depth-buttons,
.next-shape-field .next-stroke-layer-chips {
    gap: 5px !important;
}

.next-shape-field .next-stroke-buttons button,
.next-shape-field .next-stroke-depth-buttons button,
.next-shape-field .next-stroke-layer-chip {
    border-radius: 8px !important;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06) !important;
}

.next-shape-field .next-stroke-ink-picker .next-ink-open {
    border-radius: 8px !important;
}

.next-stroke-buttons button[data-text-stroke="white"]::after {
    -webkit-text-stroke: var(--stroke-preview-width, 3px) #ffffff;
}

.next-stroke-buttons button[data-text-stroke="black"]::after {
    -webkit-text-stroke: var(--stroke-preview-width, 3px) #111111;
}

.next-stroke-buttons button[data-text-stroke="ink"]::after {
    -webkit-text-stroke: var(--stroke-preview-width, 3px) var(--stroke-ink-color, #00a6a6);
}

.next-stroke-buttons {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
}

.next-stroke-buttons button {
    position: relative;
    min-height: 44px;
    border-color: #dbe3ef !important;
    border-radius: 8px;
    background: #ffffff !important;
    color: transparent !important;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06) !important;
}

.next-stroke-buttons button::before {
    content: "";
    position: absolute;
    inset: 5px;
    border-radius: 6px;
    background: #f7f9fc;
}

.next-stroke-buttons button::after {
    content: "A";
    position: relative;
    z-index: 1;
    color: var(--stroke-fill-color, #111111);
    font-family: "Arial Black", Impact, sans-serif;
    font-size: 25px;
    font-weight: 950;
    line-height: 1;
    -webkit-text-stroke: 0 transparent;
    paint-order: stroke;
}

.next-stroke-buttons button[data-text-stroke="none"]::before {
    background: #ffffff;
    box-shadow: inset 0 0 0 1px #edf1f6;
}

.next-stroke-buttons button[data-text-stroke="white"]::before {
    background: linear-gradient(135deg, #59667a, #7b879b);
}

.next-stroke-buttons button[data-text-stroke="white"]::after {
    -webkit-text-stroke: var(--stroke-preview-width, 3px) #ffffff;
    text-shadow: 0 1px 0 rgba(15, 23, 42, 0.15);
}

.next-stroke-buttons button[data-text-stroke="black"]::before {
    background: #ffffff;
    box-shadow: inset 0 0 0 1px #edf1f6;
}

.next-stroke-buttons button[data-text-stroke="black"]::after {
    -webkit-text-stroke: var(--stroke-preview-width, 3px) #111111;
}

.next-stroke-buttons button[data-text-stroke="ink"]::before {
    background:
        radial-gradient(circle at 75% 24%, var(--stroke-ink-color, #ff0000) 0 8px, transparent 9px),
        #ffffff;
    box-shadow: inset 0 0 0 1px #edf1f6;
}

.next-stroke-buttons button[data-text-stroke="ink"]::after {
    -webkit-text-stroke: var(--stroke-preview-width, 3px) var(--stroke-ink-color, #ff0000);
}

.next-stroke-buttons button:hover:not(:disabled) {
    border-color: #91dada !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(0, 166, 166, 0.08) !important;
}

.next-stroke-buttons button.is-active {
    border-color: var(--accent) !important;
    background: #ffffff !important;
    color: transparent !important;
    box-shadow:
        inset 0 0 0 2px var(--accent),
        0 0 0 3px rgba(0, 166, 166, 0.12) !important;
}

.next-stroke-buttons button.is-active::before {
    background-color: #f3ffff;
}

.next-stroke-buttons button:disabled::after {
    opacity: 0.36;
}

.next-stroke-ink-picker {
    margin-top: 7px;
}

.next-stroke-ink-picker.is-disabled {
    opacity: 0.46;
    pointer-events: none;
}

.next-stroke-width-field {
    margin-top: 7px;
}

.next-stroke-width-field input:disabled {
    opacity: 0.38;
}

.next-stroke-depth-buttons {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 7px;
}

.next-stroke-depth-buttons button {
    min-height: 32px;
    border: 1px solid #dbe4ee;
    border-radius: 8px;
    background: #ffffff;
    color: #0b3550;
    font-size: 12px;
    font-weight: 850;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.next-stroke-depth-buttons button.is-active {
    border-color: var(--accent);
    background: var(--accent);
    color: #ffffff;
    box-shadow: 0 6px 14px rgba(0, 166, 166, 0.16);
}

.next-stroke-depth-buttons button:disabled {
    opacity: 0.45;
    cursor: default;
}

.next-stroke-layer-chips {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 7px;
}

.next-stroke-layer-chips.is-disabled {
    opacity: 0.4;
    pointer-events: none;
}

.next-stroke-layer-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 0;
    min-height: 32px;
    border: 1px solid #dbe4ee;
    border-radius: 8px;
    background: #ffffff;
    color: #12324a;
    font-size: 11px;
    font-weight: 850;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.next-stroke-layer-chip.is-active {
    border-color: var(--accent);
    background: #f0ffff;
    box-shadow: inset 0 0 0 1px var(--accent);
}

.next-stroke-layer-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(15, 23, 42, 0.08)),
        var(--layer-color, #111111);
    border: 1px solid rgba(15, 23, 42, 0.2);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.55);
}

.next-product-settings-section {
    order: 4;
}

.next-side-rail {
    display: grid;
    align-content: start;
    gap: 10px;
    min-width: 0;
    height: 100%;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.next-rail-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    width: 72px;
    min-height: 62px;
    padding: 7px 6px;
    border: 1px solid #dfe6f0;
    border-radius: 8px;
    background: #ffffff;
    color: #102033;
    box-shadow: var(--button-shadow);
    font-size: 11px;
    font-weight: 900;
    line-height: 1.25;
    text-align: center;
    cursor: pointer;
}

.next-rail-btn:disabled {
    border-color: #e2e7ef;
    background: #f7f9fc;
    color: #aab3c1;
    box-shadow: none;
    cursor: default;
}

.next-rail-btn::before {
    display: block;
    color: var(--accent);
    font-size: 22px;
    font-weight: 950;
    line-height: 1;
}

.next-rail-btn[data-rail-action="template"]::before {
    content: "T";
}

.next-rail-btn[data-rail-action="item"]::before {
    content: "i";
}

.next-rail-btn[data-rail-action="guide"]::before {
    content: "□";
}

.next-rail-btn[data-rail-action="zoom-in"]::before {
    content: "+";
}

.next-rail-btn[data-rail-action="zoom-out"]::before {
    content: "-";
}

.next-rail-btn[data-rail-action="clip"]::before {
    content: "＋";
}

.next-rail-btn[data-rail-action="layers"]::before {
    content: "▤";
}

.next-rail-btn.is-active,
.next-rail-btn:hover {
    border-color: #b9e7ee;
    background: #dff6ff;
    color: #0f3f55;
}

.next-rail-btn strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    margin-top: 2px;
    border-radius: 999px;
    background: #ffffff;
    color: var(--accent-strong);
    font-size: 11px;
    line-height: 1;
}

.next-asset-section {
    margin: 0;
    padding: 10px;
    background: #f8fbff;
    border: 1px solid #dce8f8;
    border-radius: 12px;
}

.next-asset-section + .next-section {
    border-top: 0;
}

.next-asset-compact-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.next-library-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 0;
    height: 42px;
    padding: 0 8px;
    border: 1px solid #d8dde6;
    background: #fff;
    color: #202124;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.next-library-open:first-child {
    border-color: #9adede;
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.next-library-open:last-child {
    border-color: #d8cbff;
    background: var(--joy-soft);
    color: #4f38a8;
}

.next-library-open:hover {
    border-color: var(--accent);
    color: var(--accent-strong);
}

.next-section + .next-section {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.next-section {
    min-width: 0;
}

.next-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 7px;
}

.next-section-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    min-width: 0;
}

.next-section h2,
.next-section-head h2 {
    margin: 0;
    color: #51615b;
    font-size: 12px;
    font-weight: 900;
}

.next-section-head span,
.next-draft-result,
.next-statusbar {
    color: var(--ink-muted);
    font-size: 12px;
    font-weight: 700;
}

.next-clear-btn {
    flex: 0 0 auto;
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid #f0b8b0;
    border-radius: 999px;
    color: var(--danger);
    background: #fff3f1;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.next-clear-btn:hover:not(:disabled),
.next-clear-btn:focus-visible {
    border-color: var(--danger);
    background: #ffe6e1;
    outline: none;
}

.next-clear-btn:disabled {
    color: #adb6c4;
    background: #f5f7fa;
    border-color: #e2e7ef;
    cursor: default;
}

.next-surface-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.next-surface-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 10px;
    border-radius: 6px;
    font-weight: 900;
}

.next-surface-tab.is-active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.next-print-size {
    margin-top: 10px;
    padding: 7px;
    background: #f7f9fc;
    border: 1px solid #eef1f6;
    border-radius: 6px;
}

.next-print-size-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.next-print-size-head span {
    color: #596579;
    font-size: 12px;
    font-weight: 900;
}

.next-print-size-head strong {
    color: var(--accent-strong);
    font-size: 12px;
    font-weight: 900;
}

.next-print-size-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    margin-bottom: 5px;
}

.next-print-size-meta span {
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #344054;
    font-size: 10px;
    font-weight: 900;
    line-height: 1.2;
    text-align: left;
}

.next-print-size-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
}

.next-print-size-tab {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 44px;
    min-width: 0;
    padding: 4px 4px;
    border-radius: 6px;
    line-height: 1.05;
    text-align: center;
}

.next-print-size-tab strong {
    font-size: 14px;
    font-weight: 900;
}

.next-print-size-tab span {
    margin-top: 2px;
    font-size: 10px;
    font-weight: 900;
}

.next-print-size-tab small {
    margin-top: 1px;
    color: #667085;
    font-size: 9px;
    font-weight: 900;
}

.next-print-size-tab.is-active {
    background: #202124;
    border-color: #202124;
    color: #fff;
}

.next-print-size-tab.is-active small {
    color: rgba(255, 255, 255, 0.82);
}

.next-print-size-tab.is-disabled {
    cursor: not-allowed;
    opacity: 0.44;
    transform: none;
    box-shadow: none;
}

.next-print-size-tab.is-disabled:hover,
.next-print-size-tab.is-disabled:active {
    transform: none;
    box-shadow: none;
}

.next-estimate-box {
    display: grid;
    gap: 6px;
    margin-top: 8px;
    padding: 7px;
    border: 1px solid #e4eaf2;
    border-radius: 9px;
    background: #ffffff;
}

.next-estimate-inputs {
    display: grid;
    grid-template-columns: 0.82fr 0.92fr 1.12fr;
    gap: 5px;
}

.next-estimate-inputs label {
    display: grid;
    gap: 3px;
    min-width: 0;
    margin: 0;
}

.next-estimate-inputs span {
    color: #667085;
    font-size: 9px;
    font-weight: 950;
    line-height: 1;
}

.next-estimate-inputs input,
.next-estimate-inputs select {
    width: 100%;
    height: 30px;
    min-width: 0;
    padding: 0 7px;
    border: 1px solid #dfe6f0;
    border-radius: 7px;
    background: #fff;
    color: #102033;
    font-family: var(--next-ui-font);
    font-size: 12px;
    font-weight: 900;
    outline: none;
}

.next-estimate-inputs input:focus,
.next-estimate-inputs select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 166, 166, 0.12);
}

.next-estimate-total {
    display: grid;
    grid-template-columns: minmax(0, auto) minmax(0, 1fr);
    align-items: center;
    gap: 6px;
    min-height: 26px;
    padding: 4px 6px;
    border: 1px solid #eef1f6;
    border-radius: 7px;
    background: #f8fafc;
}

.next-estimate-total span,
.next-estimate-total small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.next-estimate-total span {
    color: #102033;
    font-size: 13px;
    font-weight: 950;
}

.next-estimate-total small {
    color: #667085;
    font-size: 10px;
    font-weight: 900;
    text-align: right;
}

.next-estimate-box.is-ready .next-estimate-total {
    border-color: rgba(0, 166, 166, 0.22);
    background: rgba(0, 166, 166, 0.06);
}

.next-estimate-box.is-ready .next-estimate-total span {
    color: var(--accent-strong);
}

.next-estimate-box.is-warn .next-estimate-total {
    border-color: #f6d18f;
    background: #fff8ec;
}

.next-estimate-box.is-warn .next-estimate-total span {
    color: #9a5a00;
}

.next-estimate-lines {
    display: grid;
    gap: 1px;
    overflow: hidden;
    border: 1px solid #edf1f6;
    border-radius: 8px;
    background: #edf1f6;
}

.next-estimate-lines[hidden] {
    display: none;
}

.next-estimate-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 64px 78px;
    align-items: center;
    min-height: 28px;
    gap: 6px;
    padding: 5px 7px;
    background: #fff;
    color: #102033;
}

.next-estimate-line-empty {
    grid-template-columns: minmax(0, 1fr);
}

.next-estimate-line strong,
.next-estimate-line span,
.next-estimate-line b {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.next-estimate-line strong {
    font-size: 11px;
    font-weight: 950;
}

.next-estimate-line span,
.next-estimate-line b {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
    text-align: right;
}

.next-estimate-line span {
    color: #667085;
    font-size: 10px;
    font-weight: 850;
}

.next-estimate-line b {
    color: #102033;
    font-size: 11px;
    font-weight: 950;
}

.next-estimate-line-head {
    min-height: 22px;
    background: #f7f9fc;
}

.next-estimate-line-head span {
    color: #7b8797;
    font-size: 9px;
    font-weight: 950;
}

.next-estimate-line-head span:first-child {
    text-align: left;
}

.next-estimate-line.is-discount strong,
.next-estimate-line.is-discount b {
    color: #008575;
}

.next-estimate-line.is-subtotal,
.next-estimate-line.is-tax {
    background: #fbfcfe;
}

.next-estimate-line.is-grand {
    background: rgba(0, 166, 166, 0.08);
}

.next-estimate-line.is-grand strong,
.next-estimate-line.is-grand b {
    color: var(--accent-strong);
    font-size: 12px;
}

.next-current-color {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    min-height: 50px;
    padding: 7px;
    margin-bottom: 7px;
    background: #f7f9fc;
    border: 1px solid #eef1f6;
    border-radius: 6px;
}

.next-current-swatch {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(0, 0, 0, 0.18);
    border-radius: 50%;
}

.next-current-color strong,
.next-current-color span {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.next-current-color strong {
    font-size: 14px;
}

.next-current-color span {
    margin-top: 2px;
    color: var(--ink-muted);
    font-size: 12px;
}

.next-search,
.next-field input,
.next-field select,
.next-field textarea,
.next-asset-controls select,
#templateCategory {
    width: 100%;
    border: 1px solid var(--line);
    background: #fff;
    color: #202124;
    border-radius: 6px;
}

.next-search {
    height: 32px;
    padding: 0 10px;
    margin-bottom: 7px;
}

.next-hidden-select {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.next-asset-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 7px;
}

.next-asset-tabs button,
.next-asset-chip,
.next-group-chip,
.next-template-chip {
    min-width: 0;
    border: 1px solid var(--line);
    background: #fff;
    color: #26403b;
    border-radius: 6px;
    font-weight: 900;
    cursor: pointer;
}

.next-asset-tabs button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 32px;
    padding: 0 8px;
    white-space: nowrap;
    font-size: 12px;
}

.next-asset-tabs button.is-active,
.next-asset-chip.is-active,
.next-group-chip.is-active,
.next-template-chip.is-active {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
    box-shadow: 0 7px 16px rgba(0, 166, 166, 0.18);
}

.next-asset-controls {
    display: grid;
    gap: 8px;
}

.next-asset-categories,
.next-asset-groups,
.next-template-category-list {
    display: flex;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
    overflow: auto;
    padding: 1px 0 6px;
    scrollbar-width: thin;
}

.next-asset-chip,
.next-group-chip,
.next-template-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    height: 26px;
    padding: 0 8px;
    white-space: nowrap;
    font-size: 11px;
}

.next-asset-tree-label {
    margin: 2px 0 1px;
    color: #66766f;
    font-size: 10px;
    font-weight: 900;
}

.next-asset-tree-label-child {
    margin: 6px 0 0 13px;
}

.next-asset-tree-node {
    display: grid;
    gap: 5px;
}

.next-asset-parent-chip,
.next-asset-child-chip {
    justify-content: space-between;
    gap: 8px;
}

.next-asset-parent-chip {
    height: 34px;
    background: #f9fbfa;
    border-color: #cbd9d5;
    border-radius: 6px;
    font-size: 12px;
}

.next-asset-parent-chip.has-children .next-chip-name::before {
    content: "+";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    margin-right: 5px;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-size: 10px;
    line-height: 1;
}

.next-asset-parent-chip.has-children.is-active .next-chip-name::before {
    content: "-";
}

.next-asset-child-list {
    display: grid;
    gap: 5px;
    margin: 2px 0 2px 8px;
    padding-left: 10px;
    border-left: 2px solid #cddad7;
}

.next-asset-child-chip {
    height: 28px;
    background: #fff;
    border-color: #e0e8e5;
    color: #26403b;
    border-radius: 6px;
    font-size: 11px;
}

.next-modal-panel .next-asset-child-chip.is-active {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.next-chip-name,
.next-chip-count {
    min-width: 0;
}

.next-chip-name {
    overflow: hidden;
    text-overflow: ellipsis;
}

.next-chip-count {
    flex: 0 0 auto;
    color: inherit;
    font-size: 10px;
    font-weight: 900;
    opacity: 0.78;
}

.next-group-chip {
    height: 24px;
    background: var(--soft);
}

.next-template-tools {
    display: none;
    margin-top: 8px;
}

.next-template-tools.is-active {
    display: block;
}

.next-template-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
}

.next-swatches {
    display: grid;
    grid-template-columns: repeat(8, 30px);
    justify-content: start;
    gap: 9px;
    max-height: 166px;
    overflow: auto;
    padding: 6px;
}

.next-swatch {
    box-sizing: border-box;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px #c6d0ca;
    outline: 0 solid transparent;
    outline-offset: 2px;
    cursor: pointer;
}

.next-swatch:hover {
    box-shadow: 0 0 0 1px #95a4af;
    outline: 1px solid #95a4af;
}

.next-swatch.is-active {
    box-shadow: none;
    outline: 2px solid var(--accent-strong);
    outline-offset: 1px;
}

.next-tool-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.next-tool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 8px;
    border-width: 1px;
    border-radius: 6px;
    font-weight: 900;
    box-shadow: none;
}

.next-tool-grid .next-tool:nth-child(1) {
    border-color: #d7dde7;
    background: #ffffff;
    color: #202124;
}

.next-tool-grid .next-tool:nth-child(2) {
    border-color: #d7dde7;
    background: #ffffff;
    color: #202124;
}

.next-tool-grid .next-tool:nth-child(3) {
    border-color: #d7dde7;
    background: #ffffff;
    color: #202124;
}

.next-tool-grid .next-tool:nth-child(4) {
    border-color: #d7dde7;
    background: #ffffff;
    color: #202124;
}

.next-primary-tools {
    order: 0;
    position: sticky;
    top: 0;
    z-index: 20;
    flex: 0 0 auto;
    padding: 6px;
    background: #ffffff;
    border: 1px solid #e3e7ee;
    border-radius: 8px;
    box-shadow: 0 8px 14px rgba(255, 255, 255, 0.88);
}

.next-primary-tools h2 {
    margin-bottom: 5px;
    color: #202124;
    font-size: 12px;
    line-height: 1.2;
}

.next-primary-tools .next-tool-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
}

.next-primary-tools .next-tool {
    flex-direction: column;
    justify-content: center;
    min-height: 48px;
    padding: 4px 2px;
    gap: 2px;
    background: #fff;
    font-size: 11px;
    line-height: 1.1;
    text-align: center;
}

.next-tool-symbol {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: var(--accent-strong);
    font-size: 18px;
    font-weight: normal;
    line-height: 1;
}

.next-primary-tools .next-tool:hover {
    border-color: var(--accent);
    background: #f5ffff;
    color: var(--accent-strong);
}

.next-control-panel.has-selection .next-selected-section {
    order: 1;
}

.next-control-panel.has-selection .next-primary-tools {
    order: 0;
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 6px;
    background: #ffffff;
    box-shadow: 0 8px 14px rgba(255, 255, 255, 0.88);
}

.next-control-panel.has-selection .next-primary-tools h2 {
    margin-bottom: 5px;
    color: #202124;
    font-size: 12px;
    line-height: 1.2;
}

.next-control-panel.has-selection .next-primary-tools .next-tool-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
}

.next-control-panel.has-selection .next-primary-tools .next-tool {
    justify-content: center;
    min-height: 48px;
    padding: 4px 2px;
    gap: 2px;
    font-size: 11px;
    line-height: 1.1;
    text-align: center;
}

.next-asset-browser {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
}

.next-asset-grid,
.next-template-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
    max-height: 164px;
    overflow: auto;
    padding: 2px;
}

.next-template-grid {
    display: none;
    margin-top: 7px;
    max-height: 190px;
}

.next-template-grid.is-active {
    display: grid;
}

.next-asset-item,
.next-template-item {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
    padding: 5px;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    color: #202124;
}

.next-asset-item:hover,
.next-template-item:hover,
.next-asset-item.is-selected,
.next-template-item.is-selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(0, 166, 166, 0.16);
}

.next-asset-item img {
    display: block;
    max-width: 100%;
    max-height: 50px;
    object-fit: contain;
}

.next-template-item {
    align-items: stretch;
    flex-direction: column;
    gap: 5px;
    min-height: 74px;
    color: #202124;
    font-size: 11px;
    font-weight: 800;
    text-align: center;
}

.next-template-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    position: relative;
    min-height: 48px;
    padding: 4px;
    overflow: hidden;
    background: var(--soft);
    border-radius: 4px;
}

.next-template-thumb [data-ref-id="svg-container"] {
    position: static !important;
    inset: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
}

.next-template-thumb [data-ref-id="bg-container"],
.next-preview-thumb [data-ref-id="bg-container"] {
    display: none !important;
}

.next-template-saved-thumb {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.next-template-saved-thumb > .next-template-saved-thumb-content[data-ref-id="svg-container"],
.next-template-saved-thumb > .next-template-saved-thumb-content {
    position: absolute !important;
    inset: auto !important;
    display: block !important;
    align-items: initial !important;
    justify-content: initial !important;
    max-width: none !important;
    max-height: none !important;
    transform-origin: 0 0 !important;
    pointer-events: none;
}

.next-template-saved-thumb .next-template-saved-thumb-content svg {
    display: block;
    max-width: none !important;
    max-height: none !important;
    object-fit: fill;
}

.next-template-rendered-thumb {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    overflow: visible;
}

.next-preview-thumb [data-ref-id="svg-container"] {
    position: static !important;
    inset: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
}

.next-template-thumb svg,
.next-template-thumb img,
.next-preview-thumb svg,
.next-preview-thumb img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain;
}

.next-preview-thumb svg,
.next-preview-thumb img {
    max-height: 100% !important;
}

.next-template-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.next-asset-preview {
    display: grid;
    order: -1;
    grid-template-columns: 58px minmax(0, 1fr) 92px;
    gap: 8px;
    align-items: center;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 6px;
    padding: 8px;
}

.next-preview-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    background:
        linear-gradient(45deg, rgba(0, 0, 0, 0.05) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(0, 0, 0, 0.05) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(0, 0, 0, 0.05) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(0, 0, 0, 0.05) 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
}

.next-preview-thumb img,
.next-preview-thumb svg {
    max-width: 50px;
    max-height: 50px;
}

.next-preview-text {
    min-width: 0;
}

.next-preview-text strong,
.next-preview-text span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.next-preview-text strong {
    color: #102622;
    font-size: 13px;
}

.next-preview-text span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.next-preview-controls {
    grid-column: 2 / 3;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
    align-items: end;
}

.next-preview-controls label,
.next-preview-ink-field {
    display: grid;
    gap: 4px;
    min-width: 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
}

.next-preview-ink-field[hidden] {
    display: none !important;
}

.next-preview-controls input[type="range"] {
    width: 100%;
}

.next-ink-editor-row .next-ink-field {
    grid-column: 1 / -1;
}

.next-fill-ink-field {
    gap: 0;
    margin-bottom: 4px;
}

.next-fill-ink-field > span,
.next-fill-ink-picker .next-ink-open {
    display: none !important;
}

.next-fill-ink-picker .next-ink-drawer {
    margin-top: 0;
}

.next-fill-ink-picker .next-ink-drawer[hidden] {
    display: none !important;
}

.next-fill-ink-picker .next-ink-grid {
    display: grid;
    grid-template-columns: repeat(8, 24px);
    justify-content: start;
    gap: 7px;
    max-height: none;
    overflow: visible;
    padding: 8px;
    border: 1px solid #e7edf5;
    border-radius: 12px;
    background: #ffffff;
}

.next-fill-ink-picker .next-ink-category {
    display: none;
}

.next-fill-ink-picker .next-ink-swatch {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    max-width: 24px;
    max-height: 24px;
}

.next-editor.is-template-selection .next-ink-editor-row {
    display: none !important;
}

.next-ink-picker {
    position: relative;
    min-width: 0;
}

.next-stroke-ink-picker {
    margin-top: 7px;
}

.next-stroke-ink-picker .next-ink-open {
    min-height: 34px;
}

.next-auto-color-field {
    gap: 0;
}

.next-auto-color-open {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 36px;
    padding: 0 10px;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #ffffff;
    color: #102033;
    box-shadow: var(--ui-button-shadow);
    cursor: pointer;
    font-size: 12px;
    font-weight: 950;
    text-align: left;
}

.next-auto-color-open span {
    white-space: nowrap;
}

.next-auto-color-open output {
    min-width: 0;
    overflow: hidden;
    color: var(--accent-strong);
    font-size: 12px;
    font-weight: 950;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.next-auto-color-open i {
    color: var(--ink-muted);
    font-style: normal;
    font-size: 11px;
    font-weight: 950;
    white-space: nowrap;
}

.next-auto-color-open:hover:not(:disabled),
.next-auto-color-open.is-open {
    border-color: var(--accent);
    background: #f3fbfb;
    color: var(--accent-strong);
}

.next-auto-color-open:disabled {
    border-color: #e2e7ef;
    background: #f7f9fc;
    color: #aab3c1;
    box-shadow: none;
    cursor: default;
}

.next-auto-color-field > .next-auto-color-open {
    display: none;
}

.next-auto-color-drawer {
    display: grid;
    gap: 7px;
    margin-top: 7px;
    padding: 7px;
    border: 1px solid #e1e7f0;
    border-radius: 8px;
    background: #ffffff;
}

.next-auto-color-drawer.is-floating {
    position: fixed;
    z-index: 96;
    width: 214px;
    max-width: calc(100vw - 20px);
    margin: 0;
    padding: 8px;
    border-color: #dce4ef;
    border-radius: 16px;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.18);
    opacity: 0;
    pointer-events: auto;
    cursor: grab;
    user-select: none;
    touch-action: none;
}

.next-auto-color-drawer[hidden] {
    display: none;
}

.next-auto-color-drawer.is-floating.is-visible {
    opacity: 1;
}

.next-auto-color-drawer.is-floating.is-dragging {
    cursor: grabbing;
}

.next-auto-color-drawer.is-floating button {
    cursor: pointer;
}

.next-auto-color-label {
    color: #536073;
    font-size: 10px;
    font-weight: 950;
    line-height: 1;
}

.next-auto-color-drawer .next-auto-color-label,
.next-auto-color-drawer .next-auto-color-status,
.next-auto-color-drawer .next-auto-color-help {
    display: none;
}

.next-auto-color-status,
.next-auto-color-help {
    margin: 0;
    color: #475467;
    font-size: 10px;
    font-weight: 850;
    line-height: 1.35;
}

.next-auto-color-status {
    padding: 6px 7px;
    border: 1px solid #dbe3ef;
    border-radius: 7px;
    background: #f7f9fc;
    color: #102033;
}

.next-auto-color-status.is-muted {
    color: #98a2b3;
}

.next-auto-color-categories {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
}

.next-auto-color-drawer.is-floating .next-auto-color-categories {
    gap: 4px;
}

.next-auto-color-patterns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.next-auto-color-drawer.is-floating .next-auto-color-patterns {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
}

.next-auto-color-categories button,
.next-auto-color-patterns button {
    min-width: 0;
    min-height: 28px;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #ffffff;
    color: #102033;
    font-size: 10px;
    font-weight: 950;
    cursor: pointer;
}

.next-auto-color-categories button {
    display: grid;
    align-content: center;
    gap: 1px;
    min-height: 34px;
    padding: 4px 5px;
    text-align: center;
}

.next-auto-color-drawer.is-floating .next-auto-color-categories button {
    min-height: 25px;
    padding: 2px 4px;
    border-radius: 999px;
}

.next-auto-color-categories button strong {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.next-auto-color-categories button strong {
    font-size: 11px;
}

.next-auto-color-patterns button {
    display: grid;
    justify-items: center;
    gap: 6px;
    min-height: 82px;
    padding: 7px;
    text-align: center;
}

.next-auto-color-drawer.is-floating .next-auto-color-patterns button {
    gap: 4px;
    min-height: 52px;
    padding: 5px 4px;
    border-radius: 10px;
}

.next-auto-color-categories button.is-active,
.next-auto-color-patterns button.is-active {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.next-auto-color-categories button:hover:not(:disabled),
.next-auto-color-patterns button:hover:not(:disabled) {
    border-color: var(--accent);
    background: #f3fbfb;
    color: var(--accent-strong);
}

.next-auto-color-categories button:disabled,
.next-auto-color-patterns button:disabled {
    border-color: #e2e7ef;
    background: #f7f9fc;
    color: #aab3c1;
    cursor: default;
}

.next-auto-color-card.is-warn {
    border-color: #f4c7c3;
    background: #fff8f7;
}

.next-auto-color-preview {
    position: relative;
    display: block;
    width: 72px;
    height: 50px;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.14);
    border-radius: 7px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(0, 0, 0, 0.05)),
        var(--shirt-color);
}

.next-auto-color-drawer.is-floating .next-auto-color-preview {
    width: 48px;
    height: 30px;
    border-radius: 6px;
}

.next-auto-color-preview::before {
    content: "";
    position: absolute;
    left: 21px;
    top: 5px;
    width: 26px;
    height: 36px;
    border-radius: 8px 8px 4px 4px;
    background: rgba(255, 255, 255, 0.18);
    box-shadow:
        -16px 7px 0 -8px rgba(255, 255, 255, 0.18),
        16px 7px 0 -8px rgba(255, 255, 255, 0.18);
}

.next-auto-color-drawer.is-floating .next-auto-color-preview::before {
    left: 15px;
    top: 4px;
    width: 18px;
    height: 22px;
    border-radius: 5px 5px 3px 3px;
    box-shadow:
        -12px 5px 0 -7px rgba(255, 255, 255, 0.18),
        12px 5px 0 -7px rgba(255, 255, 255, 0.18);
}

.next-auto-color-preview-text {
    position: absolute;
    left: 6px;
    right: 6px;
    top: 13px;
    color: var(--main-color);
    font-size: 10px;
    font-weight: 950;
    line-height: 1;
    text-align: center;
    text-shadow:
        -1px -1px 0 var(--sub-color),
        1px -1px 0 var(--sub-color),
        -1px 1px 0 var(--sub-color),
        1px 1px 0 var(--sub-color);
}

.next-auto-color-drawer.is-floating .next-auto-color-preview-text {
    left: 4px;
    right: 4px;
    top: 7px;
    font-size: 8px;
}

.next-auto-color-preview-mark {
    position: absolute;
    left: 22px;
    right: 22px;
    bottom: 10px;
    height: 5px;
    border-radius: 999px;
    background: var(--accent-color);
}

.next-auto-color-drawer.is-floating .next-auto-color-preview-mark {
    left: 15px;
    right: 15px;
    bottom: 6px;
    height: 4px;
}

.next-auto-color-swatches {
    display: inline-flex;
    justify-content: center;
    gap: 5px;
}

.next-auto-color-swatches i {
    display: block;
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border: 1px solid rgba(15, 23, 42, 0.18);
    border-radius: 999px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.34);
}

.next-auto-color-drawer.is-floating .next-auto-color-swatches {
    gap: 3px;
}

.next-auto-color-drawer.is-floating .next-auto-color-swatches i {
    width: 7px;
    height: 7px;
}

.next-editor.is-auto-color-only .next-context-card,
.next-editor.is-auto-color-only .next-editor-tabs,
.next-editor.is-auto-color-only .next-editor-pane:not(.next-auto-color-field) {
    display: none !important;
}

.next-editor.is-auto-color-only .next-auto-color-field {
    display: grid !important;
}

.next-auto-color-categories button,
.next-auto-color-card,
.next-auto-color-open {
    transition: none !important;
}

.next-ink-open {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 38px;
    padding: 0 10px;
    border-radius: 8px;
    color: #173b34;
    font-size: 12px;
    font-weight: 900;
    text-align: left;
}

.next-ink-caret {
    position: relative;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    color: transparent;
    font-size: 0;
    justify-self: end;
}

.next-ink-caret::before {
    content: "";
    position: absolute;
    top: 5px;
    left: 6px;
    width: 5px;
    height: 5px;
    border-right: 2px solid #667085;
    border-bottom: 2px solid #667085;
    transform: rotate(45deg);
}

.next-ink-open:hover:not(:disabled) .next-ink-caret::before,
.next-ink-open.is-open .next-ink-caret::before {
    border-color: var(--accent-strong);
}

.next-ink-dot {
    width: 22px;
    height: 22px;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px #9fb2aa;
}

.next-ink-dot.is-transparent,
.next-ink-swatch.is-transparent,
.next-template-color-chip.is-transparent .next-template-color-swatch {
    background:
        linear-gradient(135deg, transparent 42%, #6b7280 43%, #6b7280 57%, transparent 58%),
        linear-gradient(45deg, #ffffff 25%, #edf1f6 25%, #edf1f6 50%, #ffffff 50%, #ffffff 75%, #edf1f6 75%);
    background-size: 100% 100%, 8px 8px;
    background-position: 0 0, 0 0;
}

.next-ink-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.next-ink-drawer {
    margin-top: 6px;
}

.next-ink-drawer[hidden] {
    display: none;
}

.next-ink-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(24px, 1fr));
    gap: 6px;
    max-height: 132px;
    overflow: auto;
    padding: 7px;
    border: 1px solid var(--line);
    background: #f8faf8;
    border-radius: 6px;
    scrollbar-width: thin;
}

.next-ink-grid-compact {
    grid-template-columns: repeat(auto-fill, minmax(22px, 1fr));
    max-height: 116px;
    padding: 6px;
}

.next-ink-category {
    grid-column: 1 / -1;
    margin: 2px 0 0;
    color: #66766f;
    font-size: 10px;
    font-weight: 900;
}

.next-ink-swatch {
    justify-self: center;
    box-sizing: border-box;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    max-width: 24px;
    max-height: 24px;
    padding: 0;
    border: 2px solid #ffffff;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 0 1px #cbd5e1;
    transform: none !important;
    transition: none !important;
}

.next-ink-swatch:hover {
    border-color: #ffffff;
    box-shadow: 0 0 0 2px #91a3b8;
    transform: none !important;
}

.next-ink-swatch.is-active {
    border-color: #ffffff;
    box-shadow:
        0 0 0 2px var(--accent),
        inset 0 0 0 2px #ffffff;
}

.next-ink-swatch.is-transparent {
    border-color: #ffffff;
}

.next-ink-swatch:focus-visible {
    outline: 3px solid rgba(0, 166, 166, 0.22);
    outline-offset: 2px;
}

.next-template-color-editor {
    gap: 8px;
}

.next-template-color-head {
    display: none;
}

.next-template-color-head strong {
    color: var(--accent);
    font-size: 11px;
}

.next-template-color-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(38px, 1fr));
    gap: 7px;
}

.next-template-color-chip {
    min-width: 0;
    min-height: 40px;
    display: grid;
    place-items: center;
    padding: 4px;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #ffffff;
    color: #26362f;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(16, 30, 27, 0.05);
}

.next-template-color-chip:hover,
.next-template-color-chip.is-active {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(0, 166, 166, 0.16);
}

.next-template-color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--template-current-color, #000);
    box-shadow: inset 0 0 0 1px rgba(16, 30, 27, 0.22), 0 0 0 2px #fff, 0 0 0 3px var(--template-original-color, #dbe3ef);
}

.next-template-color-chip strong,
.next-template-color-chip small {
    display: none;
}

.next-template-color-chip strong {
    font-size: 11px;
    font-weight: 950;
}

.next-template-color-chip small {
    color: #66766f;
    font-size: 9px;
    font-weight: 900;
}

.next-template-color-drawer[hidden] {
    display: none;
}

.next-template-color-drawer .next-ink-category {
    display: none;
}

.next-template-color-drawer .next-ink-grid {
    max-height: 150px;
}

.next-preview-add {
    grid-column: 3 / 4;
    grid-row: 1 / 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 100%;
    min-height: 74px;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #fff;
    border-radius: 6px;
    font-weight: 900;
    cursor: pointer;
}

.next-preview-add:hover {
    border-color: var(--accent-strong);
    background: var(--accent-strong);
}

.next-preview-add:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.next-asset-preview.is-template-mode .next-preview-controls {
    display: none;
}

.next-template-color-mode {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.next-template-color-mode[hidden] {
    display: none;
}

.next-template-color-mode button {
    min-height: 32px;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #ffffff;
    color: #283548;
    font-size: 12px;
    font-weight: 950;
    cursor: pointer;
}

.next-template-color-mode button.is-active {
    border-color: var(--accent);
    background: var(--accent);
    color: #ffffff;
}

.next-workspace {
    position: relative;
    min-width: 0;
    overflow: hidden;
    overflow-anchor: none;
    background: #ffffff;
    display: flex;
    flex-direction: column;
}

.next-workbar,
.next-statusbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
}

.next-workbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "history utility";
    gap: 6px;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
    flex: 0 0 auto;
    min-height: 44px;
    padding: 5px 8px;
    align-items: center;
    justify-content: stretch;
}

.next-workbar > .next-workbar-group:first-child {
    grid-area: history;
}

.next-workbar-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.next-workbar-utility {
    grid-area: utility;
    justify-content: flex-end;
    justify-self: end;
    margin-left: 0;
    display: none;
}

.next-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    height: 36px;
    padding: 0 10px;
    background: #ffffff;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 900;
}

.next-zoom-btn {
    min-width: 56px;
    padding: 0 10px;
    font-size: 12px;
}

.next-range-toggle {
    gap: 7px;
    min-width: 76px;
}

.next-range-icon {
    display: inline-block;
    width: 18px;
    height: 14px;
    border: 2px dashed currentColor;
    border-radius: 3px;
}

.next-range-toggle:not(.is-active) .next-range-icon {
    opacity: 0.55;
}

.next-item-info-toggle {
    min-width: 98px;
}

.next-icon-btn.is-active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.next-icon-btn:disabled,
.next-mini-btn:disabled,
.next-btn:disabled,
.next-tool:disabled,
.next-library-open:disabled,
.next-ink-open:disabled,
.next-preview-add:disabled {
    cursor: not-allowed;
    opacity: 0.45;
    transform: none;
    box-shadow: none;
}

.next-workbar output {
    display: inline-flex;
    justify-content: center;
    width: 54px;
    color: var(--ink-muted);
    font-size: 12px;
    font-weight: 900;
}

.next-workbar-utility #zoomLabel {
    display: none;
}

.next-workbar-design-size[hidden] {
    display: none !important;
}

.next-workbar-design-size {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 0 9px 0 7px;
    border: 0;
    border-radius: 999px;
    background: #f5f7fb;
    color: #102033;
    box-shadow: none;
    font-family: var(--next-ui-font);
}

.next-design-size-icon {
    position: relative;
    display: inline-block;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    border: 1.5px dashed var(--accent);
    border-radius: 4px;
    box-sizing: border-box;
    background:
        linear-gradient(var(--accent), var(--accent)) 50% 50% / 8px 1.5px no-repeat,
        linear-gradient(var(--accent), var(--accent)) 50% 50% / 1.5px 8px no-repeat,
        rgba(0, 166, 166, 0.06);
}

.next-design-size-icon::before,
.next-design-size-icon::after {
    content: "";
    position: absolute;
    width: 5px;
    height: 5px;
    border: 1.5px solid #ffffff;
    background: var(--accent);
    box-shadow: 0 0 0 1px rgba(0, 166, 166, 0.16);
}

.next-design-size-icon::before {
    top: -3px;
    left: -3px;
}

.next-design-size-icon::after {
    right: -3px;
    bottom: -3px;
}

.next-design-size-caption {
    color: #334155;
    font-size: 11px;
    font-weight: 950;
    line-height: 1;
}

.next-workbar-design-size label {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    min-width: 0;
    margin: 0;
}

.next-workbar-design-size span {
    color: #667085;
    font-size: 11px;
    font-weight: 950;
    line-height: 1;
}

.next-workbar-design-size input {
    width: 38px;
    height: 24px;
    padding: 0 1px;
    border: 0;
    border-bottom: 1px solid transparent;
    border-radius: 0;
    background: transparent;
    color: #102033;
    font-family: var(--next-ui-font);
    font-size: 13.5px;
    font-weight: 950;
    line-height: 1;
    text-align: center;
    outline: none;
}

.next-workbar-design-size input:focus {
    border-bottom-color: var(--accent);
    background: rgba(255, 255, 255, 0.72);
    box-shadow: none;
}

.next-workbar-design-size em {
    color: #8a95a5;
    font-size: 10px;
    font-style: normal;
    font-weight: 950;
    line-height: 1;
}

.next-stage-shell {
    position: relative;
    display: flex;
    align-items: safe center;
    justify-content: safe center;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    overflow-anchor: none;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding: 8px 10px;
    background:
        linear-gradient(90deg, rgba(73, 85, 102, 0.055) 1px, transparent 1px),
        linear-gradient(0deg, rgba(73, 85, 102, 0.055) 1px, transparent 1px),
        #f2f4f7;
    background-size: 24px 24px;
}

.next-layer-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    width: auto;
    min-width: 76px;
    min-height: 36px;
    padding: 0 10px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: #202124;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.next-layer-toggle strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-size: 11px;
    font-weight: 900;
}

.next-layer-toggle.is-active strong {
    background: var(--accent);
    color: #ffffff;
}

.next-stage-layers {
    position: absolute;
    top: 58px;
    right: 12px;
    z-index: 12;
    width: min(132px, calc(100% - 24px));
    min-width: 128px;
    max-width: 132px;
    padding: 0;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e5e7ef;
    border-radius: 8px;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.18);
    user-select: none;
}

.next-stage-layers[hidden] {
    display: none;
}

.next-stage-layers.is-dragging {
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.22);
}

.next-layer-dragbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    min-height: 42px;
    padding: 7px 6px 7px 9px;
    color: #111827;
    border-bottom: 1px solid #eef1f6;
    cursor: pointer;
    font-size: 14px;
    font-weight: 900;
}

.next-layer-dragbar:active {
    cursor: grabbing;
}

.next-layer-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #111827;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}

.next-layer-close:hover {
    background: #f1f3f7;
}

.next-layer-order-mini {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    padding: 7px;
}

.next-layer-order-mini button {
    min-height: 30px;
    padding: 0 4px;
    border: 1px solid #d5dee9;
    border-radius: 8px;
    background: #fff;
    color: #253044;
    font-size: 11px;
    font-weight: 900;
    cursor: pointer;
}

.next-layer-order-mini button:first-child,
.next-layer-order-mini button:last-child {
    background: #f8fafc;
}

.next-layer-order-mini button:disabled {
    color: #a9b3c2;
    background: #f5f7fa;
    cursor: default;
}

.next-stage-marquee {
    position: fixed;
    z-index: 20;
    border: 1px dashed var(--accent);
    background: rgba(0, 166, 166, 0.12);
    border-radius: 4px;
    pointer-events: none;
}

.next-canvas {
    display: block;
    flex: 0 0 auto;
    width: 780px;
    max-width: none;
    max-height: none;
    height: auto;
    min-width: 320px;
    border-radius: 4px;
    filter: drop-shadow(0 12px 18px rgba(15, 23, 42, 0.12));
    transform-origin: center center;
}

.next-canvas-bg {
    fill: transparent;
    cursor: default;
}

.next-garment-shape {
    pointer-events: none;
}

.next-garment-image {
    mix-blend-mode: multiply;
    opacity: 0.96;
    pointer-events: none;
}

#designLayer.is-dtg-preview {
    mix-blend-mode: multiply;
}

.next-print-valid-box {
    fill: transparent;
    stroke: rgba(255, 94, 111, 0.95);
    stroke-dasharray: 6 5;
    stroke-width: 1.8;
    pointer-events: none;
}

.next-print-box {
    fill: rgba(0, 166, 166, 0.04);
    stroke: var(--accent);
    stroke-dasharray: 9 5;
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
    shape-rendering: crispEdges;
    cursor: default;
    pointer-events: none;
}

.next-print-box:hover {
    fill: rgba(0, 166, 166, 0.04);
}

.next-print-box:active {
    cursor: default;
}

.next-print-valid-box.is-hidden,
.next-print-box.is-hidden {
    display: none;
}

.next-object {
    cursor: default;
}

.next-object-hitbox {
    fill: transparent;
    cursor: default;
    pointer-events: none;
}

.next-object.is-selected .next-object-hitbox {
    stroke: rgba(16, 174, 232, 0.28);
    stroke-width: 1;
    cursor: move;
    pointer-events: all;
}

.next-object.is-selected {
    cursor: move;
}

.next-canvas.has-selection .next-object:not(.is-selected),
.next-canvas.has-selection .next-object:not(.is-selected) .next-object-hitbox {
    cursor: default;
}

.next-canvas.is-over-selected .next-object,
.next-canvas.is-over-selected .next-object-hitbox {
    cursor: move;
}

.next-object text,
.next-object tspan {
    paint-order: stroke;
    pointer-events: bounding-box;
    stroke-linejoin: round;
    user-select: none;
}

.next-object image {
    pointer-events: visiblePainted;
}

.next-object svg,
.next-object svg * {
    pointer-events: visiblePainted;
}

.next-control-box {
    fill: none;
    stroke: #8b3dff;
    stroke-width: 1.4;
    pointer-events: none;
}

.next-multi-control-box {
    fill: rgba(139, 61, 255, 0.06);
    stroke: #8b3dff;
    stroke-width: 1.5;
    stroke-dasharray: 6 4;
    pointer-events: none;
}

.next-snap-guide {
    stroke: #12b3e8;
    stroke-width: 1.8;
    stroke-dasharray: 7 5;
    vector-effect: non-scaling-stroke;
    pointer-events: none;
}

.next-marquee-box {
    fill: rgba(16, 174, 232, 0.1);
    stroke: #10aee8;
    stroke-width: 1.4;
    stroke-dasharray: 6 4;
    pointer-events: none;
}

.next-control-stem {
    stroke: #8b3dff;
    stroke-width: 1.2;
    pointer-events: none;
}

.next-control-button {
    cursor: pointer;
    pointer-events: all;
}

.next-control-button circle {
    fill: #fff;
    stroke: #10aee8;
    stroke-width: 2.4;
    filter: drop-shadow(0 2px 4px rgba(15, 23, 42, 0.18));
}

.next-control-icon {
    fill: none;
    stroke: #10aee8;
    stroke-width: 2.1;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
    vector-effect: non-scaling-stroke;
}

.next-control-button text {
    fill: #8b3dff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 17px;
    font-weight: 900;
    pointer-events: none;
    user-select: none;
}

.next-control-delete text {
    font-size: 19px;
}

.next-control-scale-x {
    cursor: ew-resize;
}

.next-control-rotate {
    cursor: pointer;
}

.next-control-scale-y {
    cursor: ns-resize;
}

.next-control-resize {
    cursor: nwse-resize;
}

.next-floating-toolbar {
    pointer-events: all;
}

.next-floating-toolbar-bg {
    fill: #ffffff;
    stroke: #e1e5ee;
    stroke-width: 1;
    filter: drop-shadow(0 4px 8px rgba(15, 23, 42, 0.18));
}

.next-floating-toolbar-separator {
    stroke: #e3e7ef;
    stroke-width: 1;
}

.next-floating-toolbar-btn {
    cursor: pointer;
}

.next-floating-toolbar-btn rect {
    fill: transparent;
}

.next-floating-toolbar-btn:hover rect {
    fill: #f2ecff;
}

.next-floating-toolbar-btn text {
    fill: #1f2937;
    stroke: none;
    font-family: var(--next-ui-font);
    font-size: 15px;
    font-weight: 900;
    pointer-events: none;
    user-select: none;
}

.next-floating-toolbar-btn.is-danger text {
    fill: #d64535;
}

.next-floating-toolbar-btn.is-active rect {
    fill: #00a6a6;
}

.next-floating-toolbar-btn.is-active text {
    fill: #ffffff;
}

.next-floating-toolbar-btn.is-disabled {
    cursor: not-allowed;
}

.next-floating-toolbar-btn.is-disabled rect {
    fill: #f5f7fb;
}

.next-floating-toolbar-btn.is-disabled text {
    fill: #b5bfce;
}

.next-statusbar {
    position: absolute;
    right: 12px;
    bottom: 10px;
    z-index: 9;
    display: inline-flex;
    gap: 12px;
    min-height: 26px;
    padding: 0 9px;
    border: 1px solid rgba(210, 219, 231, 0.82);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    color: #475467;
    font-size: 11px;
    font-weight: 900;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(8px);
}

.next-editor {
    display: none;
}

.next-editor.is-active {
    display: block;
}

.next-empty {
    display: block;
    min-height: 46px;
    margin: 4px 0 8px;
    padding: 0;
    color: #5f6b7a;
    background: transparent;
    border-radius: 0;
    font-size: 12px;
    font-weight: 800;
    text-align: left;
}

.next-selected-section {
    order: 2;
    min-height: 0;
}

.next-empty.is-hidden {
    display: none;
}

.next-context-card[hidden] {
    display: none;
}

.next-context-card {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 6px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.next-context-card.is-warn {
    background: transparent;
}

.next-context-summary {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1 1 auto;
}

.next-context-title {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.next-context-title span {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    padding: 0 7px;
    border-radius: 999px;
    background: #edfafa;
    color: var(--accent-strong);
    font-size: 10px;
    font-weight: 950;
    white-space: nowrap;
}

.next-context-title strong {
    min-width: 0;
    overflow: hidden;
    color: #102033;
    font-size: 12px;
    font-weight: 950;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.next-context-card.is-warn .next-context-title span {
    background: #ffe5bd;
    color: #a85d00;
}

.next-context-summary output {
    flex: 0 0 auto;
    min-width: 0;
    overflow: hidden;
    color: #8a96a8;
    font-size: 10px;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.next-context-card.is-warn .next-context-summary output {
    color: #9a5c10;
}

.next-context-quick[hidden] {
    display: none;
}

.next-context-quick {
    display: none;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.next-context-quick label {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.next-context-quick span {
    color: #596579;
    font-size: 10px;
    font-weight: 950;
    line-height: 1;
}

.next-context-quick input {
    width: 100%;
    min-width: 0;
    height: 32px;
    padding: 0 7px;
    border: 1px solid #d8e0ea;
    border-radius: 8px;
    background: #ffffff;
    color: #102033;
    font-size: 13px;
    font-weight: 950;
    text-align: center;
    outline: none;
}

.next-context-quick input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 168, 168, 0.14);
}

.next-context-quick input:disabled {
    background: #f6f8fb;
    color: #aab3c1;
}

.next-context-fit[hidden] {
    display: none;
}

.next-context-fit {
    flex: 0 0 auto;
    width: auto;
    min-height: 24px;
    padding: 0 8px;
    border: 1px solid #f0b878;
    border-radius: 999px;
    background: #fff7e9;
    color: #9a5200;
    font-size: 10px;
    font-weight: 950;
    cursor: pointer;
}

.next-context-fit:hover {
    border-color: #e4953a;
    background: #ffedcf;
}

.next-context-toolbar {
    display: none;
}

.next-context-toolbar button {
    flex: 1 1 auto;
    min-width: 52px;
    min-height: 32px;
    padding: 0 9px;
    border: 1px solid #d8e0ea;
    border-radius: 8px;
    background: #ffffff;
    color: #102033;
    font-size: 12px;
    font-weight: 950;
    cursor: pointer;
    transition: none;
}

.next-context-toolbar button:hover:not(:disabled) {
    border-color: var(--accent);
    background: #edfafa;
    color: var(--accent-strong);
}

.next-context-toolbar button.is-active {
    border-color: var(--accent);
    background: var(--accent);
    color: #ffffff;
}

.next-context-toolbar button.is-danger {
    border-color: #f0b8b0;
    background: #fff4f2;
    color: var(--danger);
}

.next-context-toolbar button:disabled {
    border-color: #e2e7ef;
    background: #f7f9fc;
    color: #aab3c1;
    cursor: default;
}

.next-context-toolbar button[hidden] {
    display: none;
}

.next-field {
    display: block;
    min-width: 0;
    margin-bottom: 7px;
}

.next-field span {
    display: block;
    margin-bottom: 4px;
    color: #596579;
    font-size: 12px;
    font-weight: 900;
}

.next-field input,
.next-field select {
    height: 36px;
    padding: 0 9px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.next-font-field {
    position: relative;
}

.next-font-native {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.next-font-picker {
    position: relative;
}

.next-font-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 40px;
    padding: 6px 9px 6px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: #152238;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    cursor: pointer;
}

.next-font-button:focus-visible {
    outline: 3px solid rgba(0, 166, 166, 0.2);
    border-color: var(--accent);
}

.next-font-button:disabled {
    cursor: default;
    opacity: 0.58;
}

.next-font-preview {
    min-width: 0;
    overflow: hidden;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.25;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.next-font-action {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 46px;
    height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    color: #007878;
    background: #e8fbfb;
    font-size: 12px;
    font-weight: 900;
}

.next-font-menu {
    position: fixed;
    z-index: 120;
    display: grid;
    grid-template-columns: 1fr;
    align-content: start;
    gap: 6px;
    max-height: calc(100vh - 24px);
    padding: 8px;
    overflow: auto;
    border: 1px solid #d8e0ea;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.18);
    scrollbar-gutter: stable;
}

.next-font-menu[hidden] {
    display: none !important;
}

.next-font-menu-title {
    position: sticky;
    top: -8px;
    z-index: 1;
    grid-column: 1 / -1;
    margin: -8px -8px 0;
    padding: 10px 12px 8px;
    border-bottom: 1px solid #edf1f6;
    background: rgba(255, 255, 255, 0.98);
    color: #102033;
    font-size: 13px;
    font-weight: 950;
}

.next-font-group {
    grid-column: 1 / -1;
    padding: 8px 4px 2px;
    color: #728094;
    font-size: 12px;
    font-weight: 950;
    letter-spacing: 0;
}

.next-font-option {
    display: grid;
    gap: 4px;
    align-content: center;
    width: 100%;
    min-height: 62px;
    margin: 0;
    padding: 8px 10px;
    border: 1px solid #e3eaf3;
    border-radius: 10px;
    color: #172235;
    background: #fbfdff;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.15;
    text-align: left;
    cursor: pointer;
}

.next-font-option-sample {
    display: block;
    min-width: 0;
    overflow: hidden;
    color: #102033;
    font-size: 24px;
    line-height: 1.12;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.next-font-option-name {
    display: block;
    min-width: 0;
    overflow: hidden;
    color: #667085;
    font-family: var(--next-ui-font);
    font-size: 11px;
    font-weight: 900;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.next-font-option:hover,
.next-font-option.is-active {
    border-color: rgba(0, 166, 166, 0.28);
    background: #edfafa;
}

.next-font-option.is-active {
    box-shadow: inset 0 0 0 1px var(--accent);
}

.next-field textarea {
    min-height: 58px;
    padding: 7px 9px;
    resize: vertical;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.next-editor-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 3px;
    border: 1px solid #dde5ef;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.next-editor-tabs button {
    min-height: 30px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #667085;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.next-editor-tabs button.is-active {
    background: #00a6a6;
    color: #fff;
    box-shadow: 0 5px 12px rgba(0, 166, 166, 0.24);
}

.next-editor-tabs button:disabled {
    color: #c1c8d2;
    cursor: default;
}

.next-editor-pane.is-pane-hidden {
    display: none !important;
}

.next-arrange-card {
    display: grid;
    gap: 10px;
}

.next-arrange-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 3px;
    border-radius: 999px;
    background: #eef1f6;
}

.next-arrange-tabs button {
    min-height: 32px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #667085;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.next-arrange-tabs button.is-active {
    background: #fff;
    color: #111827;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

.next-arrange-panel {
    display: grid;
    gap: 10px;
}

.next-arrange-panel.is-pane-hidden {
    display: none !important;
}

.next-arrange-group {
    display: grid;
    gap: 7px;
}

.next-arrange-group h3 {
    margin: 0;
    color: #142033;
    font-size: 12px;
    font-weight: 950;
}

.next-arrange-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.next-arrange-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 10px;
    border: 1px solid #d7dee9;
    border-radius: 8px;
    background: #fff;
    color: #102033;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: border-color 140ms ease, background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.next-arrange-btn:hover:not(:disabled) {
    border-color: var(--accent);
    background: #f0fbfb;
    color: var(--accent-strong);
}

.next-arrange-btn:disabled {
    color: #a9b2c1;
    background: #f7f8fb;
    cursor: default;
    box-shadow: none;
}

.next-text-edit-field {
    position: relative;
}

.next-text-edit-popover {
    display: block;
    margin-top: 0;
}

.next-text-edit-popover[hidden] {
    display: none;
}

.next-text-edit-popover textarea {
    width: 100%;
    height: 70px;
    min-height: 70px;
    max-height: 86px;
    resize: none;
}

.next-field.is-attention textarea {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 166, 166, 0.18);
}

.next-field-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.next-slider-row {
    align-items: stretch;
}

.next-slider-field {
    padding: 7px 8px 8px;
    border: 1px solid #e2e8f2;
    border-radius: 8px;
    background: #fbfdff;
}

.next-slider-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 7px;
}

.next-slider-head output {
    color: #102033;
    font-size: 12px;
    font-weight: 950;
    line-height: 1;
}

.next-slider-field input[type="range"] {
    display: block;
    width: 100%;
    height: 24px;
}

.next-mini-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 8px;
}

.next-arrange-quick {
    margin-top: 0;
    padding: 7px;
    border: 1px solid #e6ebf3;
    border-radius: 10px;
    background: #f8fafc;
}

.next-mini-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 32px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 900;
}

.next-mini-btn[hidden] {
    display: none !important;
}

.next-order-btn {
    border-color: #cfe0ef;
    background: #f5fbff;
    color: #23506f;
}

.next-mini-btn.danger {
    grid-column: 1 / -1;
    background: #fff3f1;
    border-color: #f0b8b0;
    color: var(--danger);
}

.next-surface-transfer {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) repeat(2, minmax(0, 0.8fr));
    gap: 6px;
    padding: 7px;
    border: 1px solid #e6ebf3;
    border-radius: 10px;
    background: #f8fafc;
}

.next-surface-transfer select {
    min-width: 0;
    min-height: 36px;
    padding: 0 28px 0 10px;
    border: 1px solid #dce4ef;
    border-radius: 8px;
    background: #ffffff;
    color: #102033;
    font: inherit;
    font-size: 11px;
    font-weight: 950;
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.05);
}

.next-surface-transfer select:disabled {
    background: #f7f9fc;
    color: #aab3c1;
    box-shadow: none;
}

.next-shape-buttons {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.next-shape-buttons button,
.next-stroke-buttons button,
.next-align-buttons button,
.next-writing-buttons button {
    min-width: 0;
    min-height: 34px;
    padding: 0 5px;
    border: 1px solid #d8dde6;
    border-radius: 7px;
    background: #fff;
    color: #273244;
    font-size: 11px;
    font-weight: 900;
    cursor: pointer;
}

.next-shape-buttons button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 4px 5px;
    overflow: hidden;
}

.next-shape-buttons img {
    display: block;
    width: 100%;
    max-width: 58px;
    height: 28px;
    object-fit: contain;
    pointer-events: none;
}

.next-transform-preview {
    display: block;
    width: 100%;
    max-width: 72px;
    height: 32px;
    overflow: visible;
    pointer-events: none;
}

.next-transform-preview text {
    shape-rendering: geometricPrecision;
    text-rendering: geometricPrecision;
}

.next-shape-buttons button.is-active .next-transform-preview text {
    fill: #ffffff;
    stroke: rgba(4, 116, 116, 0.72);
}

.next-stroke-buttons,
.next-align-buttons,
.next-writing-buttons {
    display: grid;
    gap: 5px;
}

.next-stroke-buttons {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.next-align-buttons,
.next-writing-buttons {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.next-writing-buttons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.next-stroke-buttons button {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 42px;
    overflow: hidden;
    color: transparent;
    font-size: 0;
    font-weight: 950;
    line-height: 1;
}

.next-stroke-buttons button::before {
    content: "";
    position: absolute;
    inset: 5px;
    border-radius: 6px;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.07), rgba(15, 23, 42, 0)),
        #f6f8fb;
}

.next-stroke-buttons button::after {
    content: "A";
    position: relative;
    z-index: 1;
    color: var(--stroke-fill-color, #111111);
    font-family: "Arial Black", Impact, sans-serif;
    font-size: 24px;
    font-weight: 950;
    line-height: 1;
    -webkit-text-stroke: 0 transparent;
    text-shadow: none;
}

.next-stroke-buttons button[data-text-stroke="none"]::before {
    background: #ffffff;
}

.next-stroke-buttons button[data-text-stroke="white"]::before {
    background: linear-gradient(135deg, #546179, #7a8aa5);
}

.next-stroke-buttons button[data-text-stroke="white"]::after {
    -webkit-text-stroke: 3px #ffffff;
    paint-order: stroke;
    text-shadow:
        -1px -1px 0 #ffffff,
        1px -1px 0 #ffffff,
        -1px 1px 0 #ffffff,
        1px 1px 0 #ffffff;
}

.next-stroke-buttons button[data-text-stroke="black"]::before {
    background: #f8fafc;
}

.next-stroke-buttons button[data-text-stroke="black"]::after {
    -webkit-text-stroke: 3px #111111;
    paint-order: stroke;
    text-shadow:
        -1px -1px 0 #111111,
        1px -1px 0 #111111,
        -1px 1px 0 #111111,
        1px 1px 0 #111111;
}

.next-stroke-buttons button[data-text-stroke="ink"]::before {
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--stroke-ink-color, #00a6a6) 12%, #ffffff), #ffffff);
}

.next-stroke-buttons button[data-text-stroke="ink"]::after {
    -webkit-text-stroke: 3px var(--stroke-ink-color, #00a6a6);
    paint-order: stroke;
    text-shadow:
        -1px -1px 0 var(--stroke-ink-color, #00a6a6),
        1px -1px 0 var(--stroke-ink-color, #00a6a6),
        -1px 1px 0 var(--stroke-ink-color, #00a6a6),
        1px 1px 0 var(--stroke-ink-color, #00a6a6);
}

.next-range-field input[type="range"] {
    width: 100%;
    accent-color: var(--accent);
}

.next-check-field {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 32px;
    margin-top: 18px;
    color: #334155;
    font-size: 12px;
    font-weight: 850;
}

.next-check-field input {
    width: 15px;
    height: 15px;
    accent-color: var(--accent);
}

.next-shape-buttons button.is-active,
.next-stroke-buttons button.is-active,
.next-align-buttons button.is-active,
.next-writing-buttons button.is-active {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.next-stroke-buttons button.is-active[data-text-stroke="white"] {
    color: transparent;
}

.next-stroke-buttons button.is-active[data-text-stroke="black"],
.next-stroke-buttons button.is-active[data-text-stroke="ink"] {
    color: transparent;
}

.next-shape-buttons button:disabled,
.next-stroke-buttons button:disabled,
.next-align-buttons button:disabled,
.next-writing-buttons button:disabled {
    color: #aeb7c4;
    background: #f5f7fa;
    cursor: default;
}

.next-layers {
    display: grid;
    gap: 7px;
    max-height: 360px;
    align-content: start;
    grid-auto-rows: minmax(62px, auto);
    overflow: auto;
    padding: 8px;
}

.next-layers.is-compact-layers {
    gap: 6px;
    grid-auto-rows: 58px;
}

.next-layers.is-even-layers {
    gap: 5px;
    align-content: stretch;
    grid-auto-rows: minmax(38px, 1fr);
}

.next-layers.is-empty {
    min-height: 72px;
    place-items: center;
}

.next-layer-empty {
    color: var(--ink-muted);
    font-size: 12px;
    font-weight: 800;
}

.next-layer-tile {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    padding: 2px;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
}

.next-layer-tile.is-active {
    border-color: var(--accent);
    box-shadow: inset 0 0 0 2px var(--accent), 0 6px 14px rgba(0, 166, 166, 0.16);
}

.next-layer-thumb {
    position: relative;
    display: inline-block;
    box-sizing: border-box;
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    max-width: 42px;
    max-height: 42px;
    border-radius: 5px;
    background:
        linear-gradient(45deg, rgba(15, 23, 42, 0.05) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(15, 23, 42, 0.05) 25%, transparent 25%),
        #f8fafc;
    background-size: 10px 10px;
    overflow: hidden !important;
    contain: paint;
    clip-path: inset(0);
    isolation: isolate;
    flex: 0 0 auto;
}

.next-layer-thumb-svg {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden !important;
}

.next-layer-thumb-img,
.next-layer-saved-thumb {
    position: absolute;
    inset: 4px;
    display: block;
    width: calc(100% - 8px);
    height: calc(100% - 8px);
    overflow: hidden;
}

.next-layer-thumb-img {
    object-fit: contain;
}

.next-layer-saved-thumb .next-template-saved-thumb {
    width: 100%;
    height: 100%;
}

.next-layer-thumb .next-layer-thumb-fit svg {
    overflow: visible;
}

.next-layer-name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.next-panel-layer-list {
    display: grid;
    gap: 7px;
    max-height: 258px;
    align-content: start;
    grid-auto-rows: minmax(56px, auto);
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0 8px 8px;
}

.next-panel-layer-list.is-compact-layers {
    gap: 6px;
    grid-auto-rows: 52px;
}

.next-panel-layer-list.is-even-layers {
    gap: 5px;
    align-content: stretch;
    grid-auto-rows: minmax(36px, 1fr);
}

.next-panel-layer-list.is-empty {
    min-height: 72px;
    place-items: center;
    border: 1px dashed #d7dee9;
    border-radius: 8px;
    background: #f8fafc;
}

.next-layer-sort-placeholder {
    position: relative;
    flex: 0 0 var(--layer-sort-placeholder-height, 8px);
    width: auto;
    height: var(--layer-sort-placeholder-height, 8px);
    min-height: 0;
    margin: -2px 12px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    pointer-events: none;
}

.next-layer-sort-placeholder::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 2px;
    transform: translateY(-50%);
    border-radius: 999px;
    background: rgba(139, 61, 255, 0.68);
    box-shadow: none;
}

.next-panel-layer-row {
    position: relative;
    display: grid;
    grid-template-columns: 16px 1fr 16px;
    align-items: center;
    justify-items: center;
    gap: 4px;
    width: 100%;
    min-height: 56px;
    padding: 6px;
    border: 2px solid transparent;
    border-radius: 6px;
    background: #d7dbe2;
    color: #172235;
    cursor: grab;
    box-shadow: none;
    overflow: hidden;
    touch-action: none;
    user-select: none;
    -webkit-user-drag: none;
}

.next-panel-layer-row::after {
    content: "";
    display: block;
    width: 16px;
    height: 1px;
}

.next-panel-layer-row:hover,
.next-panel-layer-row.is-active {
    border-color: #8b3dff;
    background: #eef0f5;
    box-shadow: none;
}

.next-panel-layer-row:active {
    cursor: grabbing;
}

.next-panel-layer-row.is-dragging {
    opacity: 0.24;
    border-color: #8b3dff;
    background: #d7dbe2;
    box-shadow: none;
    z-index: 3;
}

.next-panel-layer-row.is-layer-floating {
    position: fixed;
    box-sizing: border-box;
    border: 2px solid #8b3dff;
    background: #eef0f5;
    box-shadow: 0 14px 28px rgba(24, 31, 52, 0.20);
    cursor: grabbing;
    opacity: 0.98;
    pointer-events: none;
    z-index: 9999;
    will-change: transform;
}

body.is-layer-row-dragging,
body.is-layer-row-dragging * {
    cursor: grabbing !important;
}

.next-panel-layer-row.is-drop-target {
    border-color: transparent;
    background: #d7dbe2;
    box-shadow: none;
    z-index: 1;
}

.next-panel-layer-row.is-drop-target::before {
    display: none;
}

.next-panel-layer-row .next-layer-thumb {
    grid-column: 2;
    width: 42px;
    height: 42px;
    background-color: #ffffff;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

.next-panel-layer-row .next-layer-thumb * {
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

.next-layer-grip {
    display: none;
    grid-template-columns: repeat(2, 3px);
    gap: 3px 2px;
    justify-content: center;
    width: 10px;
    cursor: inherit;
    touch-action: none;
    user-select: none;
}

.next-layer-grip:active {
    cursor: inherit;
}

.next-panel-layer-row .next-layer-grip {
    display: grid;
    grid-column: 1;
    align-self: center;
    justify-self: center;
}

.next-layer-grip i {
    display: block;
    width: 3px;
    height: 3px;
    border-radius: 999px;
    background: #5f6675;
}

.next-panel-layer-name {
    overflow: hidden;
    min-width: 0;
    color: #293042;
    font-size: 13px;
    font-weight: 900;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.next-panel-layer-type {
    display: none;
}

body.next-modal-open {
    overflow: hidden;
}

.next-item-drawer[hidden] {
    display: none;
}

.next-item-drawer {
    position: fixed;
    inset: 0;
    z-index: 1001;
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
}

.next-item-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(12, 14, 18, 0.52);
}

.next-item-panel {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(460px, calc(100vw - 20px));
    height: 100%;
    overflow: hidden;
    background: #fff;
    border-right: 1px solid #dce3ea;
    box-shadow: 18px 0 42px rgba(15, 23, 42, 0.2);
}

.next-item-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 16px 18px 12px;
    border-bottom: 1px solid var(--line);
}

.next-item-head h2 {
    margin: 0;
    color: #202124;
    font-size: 22px;
    line-height: 1.25;
}

.next-item-head span {
    display: block;
    margin-top: 5px;
    color: var(--ink-muted);
    font-size: 13px;
    font-weight: 800;
}

.next-item-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    height: 38px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 900;
}

.next-item-body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 18px;
}

.next-item-hero {
    display: grid;
    place-items: center;
    min-height: 320px;
    margin-bottom: 14px;
    background: #fbfcfe;
    border: 1px solid #e6e8ef;
    border-radius: 8px;
}

.next-item-hero img {
    display: block;
    width: 100%;
    max-height: 390px;
    object-fit: contain;
}

.next-item-summary h3 {
    margin: 0 0 8px;
    color: #202124;
    font-size: 20px;
    line-height: 1.35;
}

.next-item-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.next-item-badges span {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 9px;
    background: var(--accent-soft);
    border: 1px solid #bde8e8;
    border-radius: 999px;
    color: var(--accent-strong);
    font-size: 12px;
    font-weight: 900;
}

.next-item-summary p {
    margin: 0;
    color: #4b5565;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.75;
    white-space: pre-line;
}

.next-item-details {
    display: grid;
    grid-template-columns: 106px minmax(0, 1fr);
    gap: 0;
    margin: 16px 0 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.next-item-details dt,
.next-item-details dd {
    min-height: 42px;
    margin: 0;
    padding: 10px 0;
    border-top: 1px solid var(--line);
    font-size: 13px;
    line-height: 1.55;
}

.next-item-details dt:nth-of-type(1),
.next-item-details dd:nth-of-type(1) {
    border-top: 0;
}

.next-item-details dt {
    color: var(--ink-muted);
    font-weight: 900;
}

.next-item-details dd {
    color: #202124;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.next-item-links {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.next-item-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 12px;
    background: #202124;
    color: #fff;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 900;
    text-decoration: none;
}

.next-item-links a.is-secondary {
    background: #fff;
    color: #202124;
    border: 1px solid #cfd7e2;
}

.next-item-links a:hover,
.next-item-links a:focus-visible {
    filter: brightness(0.96);
}

.next-item-links a.is-secondary:hover,
.next-item-links a.is-secondary:focus-visible {
    background: #f4f7fa;
    filter: none;
}

.next-asset-modal[hidden] {
    display: none;
}

.next-asset-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 18px;
}

.next-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(9, 18, 16, 0.5);
}

.next-modal-panel {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(1180px, calc(100vw - 36px));
    max-height: calc(100vh - 36px);
    min-height: min(620px, calc(100vh - 36px));
    overflow: hidden;
    background: #fff;
    border: 1px solid #d4d9e2;
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.26);
}

.next-modal-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 230px 58px;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #e3e7ee;
    background: #ffffff;
}

.next-modal-head h2 {
    margin: 0;
    color: #202124;
    font-size: 18px;
    line-height: 1.2;
}

.next-modal-head span {
    display: block;
    margin-top: 3px;
    color: var(--ink-muted);
    font-size: 12px;
    font-weight: 800;
}

.next-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    padding: 0 10px;
    height: 38px;
    border: 1px solid var(--line);
    background: #fff;
    color: #202124;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.next-modal-body {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr) 270px;
    gap: 12px;
    flex: 1;
    min-height: 0;
    padding: 12px;
    background: #f5f6f8;
    overflow: hidden;
}

.next-modal-categories,
.next-modal-assets {
    min-width: 0;
    min-height: 0;
}

.next-modal-categories {
    overflow: auto;
    padding: 10px;
    background: #ffffff;
    border: 1px solid #e4e8ef;
    border-radius: 6px;
    scrollbar-width: thin;
}

.next-modal-assets {
    padding: 10px;
    background: #ffffff;
    border: 1px solid #e4e8ef;
    border-radius: 6px;
}

.next-modal-panel .next-asset-tabs {
    margin-bottom: 0;
}

.next-modal-panel .next-asset-categories,
.next-modal-panel .next-asset-groups,
.next-modal-panel .next-template-category-list {
    display: grid;
    gap: 6px;
    max-height: none;
    overflow: visible;
    padding: 0;
}

.next-modal-panel .next-asset-groups {
    margin-top: 8px;
}

.next-modal-panel .next-template-tools {
    margin-top: 0;
}

.next-modal-panel .next-asset-chip,
.next-modal-panel .next-group-chip,
.next-modal-panel .next-template-chip {
    width: 100%;
    height: 30px;
    padding: 0 10px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.next-modal-panel .next-asset-parent-chip,
.next-modal-panel .next-asset-child-chip {
    justify-content: space-between;
}

.next-modal-panel .next-asset-parent-chip {
    height: 34px;
}

.next-modal-panel .next-asset-child-chip {
    height: 28px;
}

.next-modal-panel .next-asset-grid,
.next-modal-panel .next-template-grid {
    align-content: start;
    grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
    gap: 8px;
    height: 100%;
    min-height: 400px;
    max-height: none;
    margin-top: 0;
    overflow: auto;
    padding: 2px;
    scrollbar-width: thin;
}

.next-modal-panel .next-template-grid {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
}

.next-modal-panel .next-asset-item {
    min-height: 82px;
}

.next-modal-panel .next-template-item {
    min-height: 124px;
}

.next-modal-panel .next-template-thumb {
    min-height: 86px;
}

.next-modal-panel .next-asset-preview {
    order: 0;
    align-self: start;
    grid-template-columns: 72px minmax(0, 1fr);
    width: 100%;
    background: #ffffff;
    border: 1px solid #e4e8ef;
    border-radius: 6px;
}

.next-modal-panel .next-preview-thumb {
    width: 72px;
    height: 72px;
}

.next-modal-panel .next-preview-controls {
    grid-column: 1 / -1;
}

.next-modal-panel .next-preview-add {
    grid-column: 1 / -1;
    grid-row: auto;
    min-height: 42px;
    height: 42px;
}

.next-image-import[hidden] {
    display: none;
}

.next-image-import {
    position: fixed;
    inset: 0;
    z-index: 1010;
    display: grid;
    place-items: center;
    padding: 16px;
}

.next-image-import-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.34);
}

.next-image-import-panel {
    position: relative;
    z-index: 1;
    width: min(520px, calc(100vw - 32px));
    padding: 12px;
    border: 1px solid #dce4ef;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 22px 56px rgba(15, 23, 42, 0.2);
}

.next-image-import-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.next-image-import-head strong {
    color: #10233f;
    font-size: 15px;
    font-weight: 900;
}

.next-image-import-close {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 1px solid #dbe3ef;
    border-radius: 6px;
    background: #fff;
    color: #243047;
    cursor: pointer;
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
}

.next-image-import-preview {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.next-image-import-preview figure {
    display: grid;
    gap: 6px;
    min-width: 0;
    margin: 0;
}

.next-image-import-preview figure > span {
    color: #475569;
    font-size: 12px;
    font-weight: 900;
}

.next-image-import-frame {
    display: grid;
    place-items: center;
    aspect-ratio: 1 / 1;
    min-height: 150px;
    overflow: hidden;
    border: 1px solid #dfe7f2;
    border-radius: 6px;
    background: #f7f9fc;
}

.next-image-import-frame.is-checker {
    background-color: #fff;
    background-image:
        linear-gradient(45deg, #e6ebf2 25%, transparent 25%),
        linear-gradient(-45deg, #e6ebf2 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e6ebf2 75%),
        linear-gradient(-45deg, transparent 75%, #e6ebf2 75%);
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
    background-size: 16px 16px;
}

.next-image-import-frame img {
    display: block;
    max-width: 94%;
    max-height: 94%;
    object-fit: contain;
}

.next-image-import-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
}

.next-image-import-range {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    min-width: 0;
    color: #31405a;
    font-size: 12px;
    font-weight: 900;
}

.next-image-import-range input {
    width: 100%;
    accent-color: #00a6a6;
}

.next-image-import-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 0 9px;
    border: 1px solid #dbe3ef;
    border-radius: 999px;
    color: #31405a;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.next-image-import-check input {
    width: 14px;
    height: 14px;
    accent-color: #00a6a6;
}

.next-image-import-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
}

.next-image-import-actions button {
    min-height: 40px;
    border: 1px solid #dbe3ef;
    border-radius: 7px;
    background: #fff;
    color: #10233f;
    cursor: pointer;
    font-size: 13px;
    font-weight: 900;
}

.next-image-import-actions .next-image-import-primary {
    border-color: #00a6a6;
    background: #00a6a6;
    color: #fff;
}

.next-image-import-actions button:disabled {
    border-color: #e6ebf2;
    background: #f4f7fb;
    color: #a0aabd;
    cursor: default;
}

.next-toast {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 20;
    max-width: min(360px, calc(100vw - 32px));
    padding: 10px 12px;
    background: #202124;
    color: #fff;
    border-radius: 6px;
    box-shadow: 0 14px 26px rgba(0, 0, 0, 0.18);
    font-weight: 800;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 140ms ease, transform 140ms ease;
}

.next-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.next-toast,
.next-toast.is-visible {
    display: none !important;
}

.next-app {
    --ui-button-height: 36px;
    --ui-button-radius: 8px;
    --ui-button-border: #dbe3ef;
    --ui-button-bg: #ffffff;
    --ui-button-hover: #f3fbfb;
    --ui-button-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
    --ui-button-shadow-hover: 0 7px 16px rgba(15, 23, 42, 0.12);
}

.next-actions,
.next-workbar-group,
.next-tool-grid,
.next-editor-tabs,
.next-arrange-tabs,
.next-arrange-grid,
.next-mini-actions,
.next-align-buttons,
.next-writing-buttons,
.next-stroke-buttons,
.next-shape-buttons,
.next-layer-order-mini {
    gap: 6px;
}

.next-btn,
.next-icon-btn,
.next-tool,
.next-mini-btn,
.next-arrange-btn,
.next-editor-tabs button,
.next-arrange-tabs button,
.next-shape-buttons button,
.next-stroke-buttons button,
.next-align-buttons button,
.next-writing-buttons button,
.next-layer-order-mini button,
.next-clear-btn,
.next-font-button,
.next-ink-open,
.next-preview-add {
    min-height: var(--ui-button-height);
    border: 1px solid var(--ui-button-border);
    border-radius: var(--ui-button-radius);
    background: var(--ui-button-bg);
    color: #102033;
    box-shadow: var(--ui-button-shadow);
    font-weight: 900;
    transition: border-color 140ms ease, background 140ms ease, color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.next-btn:hover:not(:disabled),
.next-icon-btn:hover:not(:disabled),
.next-tool:hover:not(:disabled),
.next-mini-btn:hover:not(:disabled),
.next-arrange-btn:hover:not(:disabled),
.next-editor-tabs button:hover:not(:disabled),
.next-arrange-tabs button:hover:not(:disabled),
.next-shape-buttons button:hover:not(:disabled),
.next-stroke-buttons button:hover:not(:disabled),
.next-align-buttons button:hover:not(:disabled),
.next-writing-buttons button:hover:not(:disabled),
.next-layer-order-mini button:hover:not(:disabled),
.next-clear-btn:hover:not(:disabled),
.next-font-button:hover:not(:disabled),
.next-ink-open:hover:not(:disabled),
.next-preview-add:hover:not(:disabled) {
    border-color: var(--accent);
    background: var(--ui-button-hover);
    color: var(--accent-strong);
    box-shadow: var(--ui-button-shadow-hover);
    transform: translateY(-1px);
}

.next-btn:active:not(:disabled),
.next-icon-btn:active:not(:disabled),
.next-tool:active:not(:disabled),
.next-mini-btn:active:not(:disabled),
.next-arrange-btn:active:not(:disabled),
.next-editor-tabs button:active:not(:disabled),
.next-arrange-tabs button:active:not(:disabled),
.next-shape-buttons button:active:not(:disabled),
.next-stroke-buttons button:active:not(:disabled),
.next-align-buttons button:active:not(:disabled),
.next-writing-buttons button:active:not(:disabled),
.next-layer-order-mini button:active:not(:disabled),
.next-clear-btn:active:not(:disabled),
.next-font-button:active:not(:disabled),
.next-ink-open:active:not(:disabled),
.next-preview-add:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: var(--ui-button-shadow);
}

.next-btn:disabled,
.next-icon-btn:disabled,
.next-tool:disabled,
.next-mini-btn:disabled,
.next-arrange-btn:disabled,
.next-editor-tabs button:disabled,
.next-arrange-tabs button:disabled,
.next-shape-buttons button:disabled,
.next-stroke-buttons button:disabled,
.next-align-buttons button:disabled,
.next-writing-buttons button:disabled,
.next-layer-order-mini button:disabled,
.next-clear-btn:disabled,
.next-font-button:disabled,
.next-ink-open:disabled,
.next-preview-add:disabled {
    border-color: #e2e7ef;
    background: #f7f9fc;
    color: #aab3c1;
    box-shadow: none;
    cursor: default;
    transform: none;
}

#saveServer,
.next-icon-btn.is-active,
.next-range-toggle.is-active,
.next-surface-tab.is-active,
.next-print-size-tab.is-active,
.next-editor-tabs button.is-active,
.next-shape-buttons button.is-active,
.next-stroke-buttons button.is-active,
.next-align-buttons button.is-active,
.next-writing-buttons button.is-active,
.next-asset-tabs button.is-active,
.next-asset-chip.is-active,
.next-group-chip.is-active,
.next-template-chip.is-active {
    border-color: var(--accent);
    background: var(--accent);
    color: #ffffff;
    box-shadow: 0 8px 16px rgba(0, 166, 166, 0.2);
}

.next-btn.next-link {
    border-color: #dbe3ef;
    background: #ffffff;
    color: #334155;
}

.next-workbar {
    min-height: 52px;
    padding: 7px 10px;
}

.next-workbar-group {
    min-height: 38px;
    padding: 3px;
    border: 1px solid #e1e7f0;
    border-radius: 11px;
    background: #f6f8fb;
}

.next-workbar-utility {
    gap: 4px;
    display: none;
}

.next-icon-btn {
    min-width: 44px;
    height: 34px;
    min-height: 34px;
    padding: 0 11px;
    border-radius: 8px;
    box-shadow: none;
}

.next-zoom-btn {
    min-width: 56px;
    padding: 0 10px;
    font-size: 12px;
}

.next-workbar output {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 54px;
    height: 34px;
    border: 1px solid #e2e7ef;
    border-radius: 8px;
    background: #ffffff;
    color: #334155;
    font-size: 12px;
    font-weight: 900;
}

.next-primary-tools,
.next-selected-section {
    border: 1px solid #e3e8f1;
    border-radius: 9px;
    background: #fbfcff;
    padding: 8px;
}

.next-primary-tools {
    order: 0;
    position: sticky;
    top: 0;
    z-index: 20;
    flex: 0 0 auto;
    padding: 6px;
    background: #ffffff;
}

.next-primary-tools h2 {
    margin-bottom: 5px;
    font-size: 12px;
    line-height: 1.2;
}

.next-primary-tools .next-tool-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
}

.next-primary-tools .next-tool {
    flex-direction: column;
    justify-content: center;
    min-height: 48px;
    padding: 4px 2px;
    gap: 2px;
    background: #ffffff;
    font-size: 11px;
    line-height: 1.1;
    text-align: center;
}

.next-control-panel.has-selection .next-primary-tools {
    order: 0;
    position: sticky;
    top: 0;
    z-index: 20;
    background: #ffffff;
    box-shadow: 0 8px 14px rgba(255, 255, 255, 0.88);
}

.next-control-panel.has-selection .next-primary-tools .next-tool {
    min-height: 48px;
    font-size: 11px;
}

.next-editor-tabs,
.next-arrange-tabs {
    gap: 3px;
    padding: 3px;
    border: 1px solid #e0e6ef;
    border-radius: 11px;
    background: #f1f4f8;
    box-shadow: none;
}

.next-editor-tabs button,
.next-arrange-tabs button {
    min-height: 32px;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.next-editor-tabs button.is-active,
.next-arrange-tabs button.is-active {
    border-color: var(--accent);
    background: var(--accent);
    color: #ffffff;
    box-shadow: 0 8px 16px rgba(0, 166, 166, 0.2);
}

.next-arrange-btn,
.next-mini-btn,
.next-shape-buttons button,
.next-stroke-buttons button,
.next-align-buttons button,
.next-writing-buttons button {
    background: #ffffff;
}

.next-mini-actions {
    gap: 7px;
}

.next-mini-btn {
    min-height: 34px;
    border-radius: 8px;
    font-size: 11px;
}

.next-arrange-quick .next-mini-btn {
    min-height: 36px;
    background: #ffffff;
}

.next-arrange-quick .next-mini-btn:not(:disabled):first-child {
    border-color: rgba(0, 166, 166, 0.42);
    color: var(--accent-strong);
}

.next-clear-btn,
.next-mini-btn.danger {
    border-color: #f0b8b0;
    background: #fff4f2;
    color: var(--danger);
}

.next-floating-toolbar-bg {
    fill: #ffffff;
    stroke: #dce4ef;
    stroke-width: 1;
    filter: drop-shadow(0 8px 18px rgba(15, 23, 42, 0.18));
}

.next-floating-toolbar-separator {
    stroke: #e7ebf2;
}

.next-floating-print-size-group {
    fill: #f6f8fb;
    stroke: #e1e7f0;
    stroke-width: 1;
}

.next-floating-color-group {
    fill: transparent;
    stroke: transparent;
    stroke-width: 0;
}

.next-floating-toolbar-btn rect {
    fill: transparent;
}

.next-floating-toolbar-btn:hover rect {
    fill: #e8fbfb;
}

.next-floating-toolbar-btn text {
    fill: #102033;
    font-family: var(--next-ui-font);
    font-size: 15px;
    font-weight: 950;
}

.next-floating-toolbar-btn.is-print-size text {
    font-size: 13px;
}

.next-floating-toolbar-btn.is-text-align rect {
    stroke: transparent;
}

.next-floating-toolbar-btn.is-text-align:hover rect {
    fill: #eefafa;
}

.next-floating-align-icon {
    pointer-events: none;
}

.next-floating-align-icon line {
    stroke: #263241;
    stroke-width: 2;
    stroke-linecap: square;
}

.next-floating-toolbar-btn.is-active .next-floating-align-icon line {
    stroke: #ffffff;
}

.next-floating-toolbar-btn.is-disabled .next-floating-align-icon line {
    stroke: #b5bfce;
}

.next-floating-toolbar-btn.is-print-size rect {
    stroke: transparent;
}

.next-floating-toolbar-btn.is-print-size:hover rect {
    fill: #ffffff;
}

.next-floating-toolbar-btn.is-danger:hover rect {
    fill: #fff4f2;
}

.next-floating-toolbar-btn.is-danger text {
    fill: var(--danger);
}

.next-floating-toolbar-btn.is-active rect,
.next-floating-toolbar-btn.is-active:hover rect {
    fill: #00a6a6;
}

.next-floating-toolbar-btn.is-active text {
    fill: #ffffff;
}

.next-floating-toolbar-btn.is-color-swatch rect {
    fill: transparent;
    stroke: transparent;
}

.next-floating-toolbar-btn.is-color-swatch:hover rect {
    fill: transparent;
    stroke: transparent;
}

.next-floating-color-dot {
    stroke: rgba(15, 23, 42, 0.2);
    stroke-width: 0.8;
    filter: drop-shadow(0 1px 1px rgba(15, 23, 42, 0.18));
}

.next-floating-color-dot.is-transparent {
    stroke: #9aa4b2;
}

.next-floating-color-clear {
    stroke: #6b7280;
    stroke-width: 2;
    stroke-linecap: round;
    pointer-events: none;
}

.next-floating-toolbar-btn.is-disabled,
.next-floating-toolbar-btn.is-disabled:hover {
    cursor: not-allowed;
}

.next-floating-toolbar-btn.is-disabled rect,
.next-floating-toolbar-btn.is-disabled:hover rect {
    fill: #f5f7fb;
}

.next-floating-toolbar-btn.is-disabled text {
    fill: #b5bfce;
}

/* 操作中に画面要素が動く演出は入れない。状態変化は色と線だけで示す。 */
.next-loading-screen,
.next-toast,
.next-btn,
.next-icon-btn,
.next-tool,
.next-mini-btn,
.next-arrange-btn,
.next-editor-tabs button,
.next-arrange-tabs button,
.next-shape-buttons button,
.next-stroke-buttons button,
.next-align-buttons button,
.next-writing-buttons button,
.next-layer-order-mini button,
.next-clear-btn,
.next-font-button,
.next-ink-open,
.next-item-color-toggle,
.next-preview-add,
.next-asset-item,
.next-template-item,
.next-layer-tile,
.next-modal-close,
.next-item-close,
.next-ink-swatch {
    transition: none !important;
}

.next-rail-btn {
    transition: none !important;
}

.next-loading-logo,
.next-loading-line {
    animation: none !important;
    transform: none !important;
}

.next-loading-line {
    width: 160px;
    opacity: 1;
}

.next-btn:hover,
.next-tool:hover,
.next-mini-btn:hover,
.next-icon-btn:hover,
.next-surface-tab:hover,
.next-print-size-tab:hover,
.next-library-open:hover,
.next-asset-tabs button:hover,
.next-asset-chip:hover,
.next-group-chip:hover,
.next-template-chip:hover,
.next-layer-tile:hover,
.next-modal-close:hover,
.next-item-close:hover,
.next-ink-open:hover,
.next-preview-add:hover,
.next-btn:hover:not(:disabled),
.next-icon-btn:hover:not(:disabled),
.next-tool:hover:not(:disabled),
.next-mini-btn:hover:not(:disabled),
.next-arrange-btn:hover:not(:disabled),
.next-editor-tabs button:hover:not(:disabled),
.next-arrange-tabs button:hover:not(:disabled),
.next-shape-buttons button:hover:not(:disabled),
.next-stroke-buttons button:hover:not(:disabled),
.next-align-buttons button:hover:not(:disabled),
.next-writing-buttons button:hover:not(:disabled),
.next-layer-order-mini button:hover:not(:disabled),
.next-clear-btn:hover:not(:disabled),
.next-font-button:hover:not(:disabled),
.next-ink-open:hover:not(:disabled),
.next-item-color-toggle:hover:not(:disabled),
.next-preview-add:hover:not(:disabled),
.next-ink-swatch:hover,
.next-rail-btn:hover,
.next-toast,
.next-toast.is-visible {
    transform: none !important;
}

.next-selected-section {
    border-color: #e8edf4;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.next-selected-section .next-section-head {
    margin-bottom: 7px;
}

.next-selected-section #selectedType {
    display: none;
}

.next-selected-section .next-context-card {
    margin: 0 0 8px;
    padding: 7px 8px;
    border: 1px solid #edf1f7;
    border-radius: 10px;
    background: #ffffff;
}

.next-selected-section .next-context-title {
    gap: 0;
}

.next-selected-section .next-context-title span {
    display: none;
}

.next-selected-section .next-context-title strong {
    font-size: 13px;
    letter-spacing: 0;
}

.next-selected-section .next-context-summary output {
    display: none;
}

.next-selected-section .next-context-card.is-warn .next-context-summary output {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 0 7px;
    border-radius: 999px;
    background: #fff3df;
    color: #9a5200;
}

.next-selected-section .next-editor-tabs {
    margin: 0 0 8px;
    padding: 3px;
    border: 1px solid #e6ebf3;
    border-radius: 12px;
    background: #f6f8fb;
    box-shadow: none;
}

.next-selected-section .next-editor-tabs button {
    min-height: 32px;
    border-radius: 9px;
    color: #5d6a7c;
    font-size: 12px;
}

.next-selected-section .next-editor-tabs button.is-active {
    background: var(--accent);
    color: #ffffff;
    box-shadow: 0 8px 16px rgba(0, 166, 166, 0.2);
}

.next-selected-section .next-editor-tabs button:disabled {
    color: #b4becb;
}

.next-template-color-editor {
    margin-bottom: 8px;
}

.next-template-color-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 7px;
    border: 1px solid #e8edf4;
    border-radius: 12px;
    background: #ffffff;
}

.next-template-color-chip {
    flex: 0 0 34px;
    width: 34px;
    min-height: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    box-shadow: none;
}

.next-template-color-chip:hover,
.next-template-color-chip.is-active {
    border-color: transparent;
    box-shadow: none;
}

.next-template-color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    box-shadow:
        inset 0 0 0 1px rgba(15, 23, 42, 0.18),
        0 0 0 2px #ffffff,
        0 0 0 3px #dfe5ee;
}

.next-template-color-chip:hover .next-template-color-swatch {
    box-shadow:
        inset 0 0 0 1px rgba(15, 23, 42, 0.2),
        0 0 0 2px #ffffff,
        0 0 0 3px #a7b1c2;
}

.next-template-color-chip.is-active .next-template-color-swatch {
    box-shadow:
        inset 0 0 0 1px rgba(15, 23, 42, 0.22),
        0 0 0 2px #ffffff,
        0 0 0 4px #111827;
}

.next-template-color-chip.is-transparent .next-template-color-swatch {
    box-shadow:
        inset 0 0 0 1px rgba(15, 23, 42, 0.2),
        0 0 0 2px #ffffff,
        0 0 0 3px #dfe5ee;
}

.next-template-color-chip.is-transparent.is-active .next-template-color-swatch {
    box-shadow:
        inset 0 0 0 1px rgba(15, 23, 42, 0.22),
        0 0 0 2px #ffffff,
        0 0 0 4px #111827;
}

.next-template-color-drawer {
    margin-top: 8px;
}

.next-template-color-drawer .next-ink-grid {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 8px;
    max-height: 126px;
    padding: 8px;
    border-color: #e8edf4;
    border-radius: 12px;
    background: #ffffff;
}

.next-template-color-drawer .next-ink-swatch {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    max-width: 24px;
    max-height: 24px;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 1px #dfe5ee;
}

.next-template-color-drawer .next-ink-swatch:hover {
    box-shadow: 0 0 0 2px #a7b1c2;
}

.next-template-color-drawer .next-ink-swatch.is-active {
    border-color: #ffffff;
    box-shadow:
        0 0 0 2px #111827,
        inset 0 0 0 2px #ffffff;
}

.next-workspace {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto auto;
    align-items: stretch;
}

.next-workbar {
    grid-column: 1 / 2;
    grid-row: 1 / 4;
    position: relative;
    top: auto;
    z-index: 11;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    grid-template-columns: 1fr;
    grid-template-areas:
        "history"
        "product";
    align-items: stretch;
    align-content: start;
    min-height: 0;
    padding: 6px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
}

.next-stage-shell {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
}

.next-print-check {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
}

.next-statusbar {
    grid-column: 2 / 3;
    grid-row: 3 / 4;
}

.next-workbar .next-surface-print-section {
    grid-area: product;
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
    align-items: stretch;
    min-width: 0;
    min-height: 0;
    padding: 6px;
    border: 1px solid #e1e7f0;
    border-radius: 9px;
    background: #f6f8fb;
    box-shadow: none;
    overflow: visible;
}

.next-workbar .next-surface-print-section .next-section-head {
    display: none;
}

.next-workbar .next-surface-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    min-width: 0;
}

.next-workbar .next-surface-tab {
    min-height: 32px;
    height: 32px;
    padding: 0 4px;
    border-radius: 7px;
    font-size: 11px;
}

.next-workbar .next-workbar-clear {
    height: 34px;
    min-height: 34px;
    padding: 0 11px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1;
}

.next-workbar .next-print-size {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 5px;
    min-width: 0;
    margin: 0;
    padding: 6px;
    border: 1px solid #e1e7f0;
    border-radius: 8px;
    background: #ffffff;
}

.next-workbar .next-print-size-head {
    display: grid;
    gap: 2px;
    min-width: 0;
    margin: 0;
}

.next-workbar .next-print-size-head span {
    color: #697586;
    font-size: 9px;
    font-weight: 950;
    line-height: 1;
}

.next-workbar .next-print-size-head strong {
    overflow: visible;
    color: #102033;
    font-size: 13px;
    font-weight: 950;
    line-height: 1.1;
    text-overflow: clip;
    white-space: normal;
}

.next-workbar .next-print-size-meta {
    grid-column: auto;
    grid-row: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    min-width: 0;
    margin: 0;
}

.next-workbar .next-print-size-meta span {
    overflow: hidden;
    padding: 2px 4px;
    border: 1px solid #edf1f7;
    border-radius: 999px;
    background: #f8fafc;
    color: #4b5565;
    font-size: 7.5px;
    font-weight: 950;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.next-workbar .next-print-size-tabs {
    grid-column: auto;
    grid-row: auto;
    grid-template-columns: 1fr;
    gap: 4px;
    min-width: 0;
    padding: 2px;
    border: 1px solid #edf1f7;
    border-radius: 8px;
    background: #f6f8fb;
}

.next-workbar .next-print-size-tab {
    height: 34px;
    min-height: 34px;
    padding: 3px 8px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    box-shadow: none;
}

.next-workbar .next-print-size-tab.is-active {
    border-color: transparent;
    background: var(--accent);
    color: #ffffff;
    box-shadow: 0 3px 8px rgba(0, 166, 166, 0.18);
}

.next-workbar .next-print-size-tab.is-active span {
    color: rgba(255, 255, 255, 0.86);
}

.next-workbar .next-print-size-tab.is-disabled {
    color: #aab3c1;
    opacity: 0.5;
}

.next-workbar .next-print-size-tab strong {
    font-size: 13px;
    line-height: 1;
}

.next-workbar .next-print-size-tab span {
    margin-top: 1px;
    font-size: 8px;
    line-height: 1;
}

.next-workbar .next-print-size-tab small {
    display: none;
}

.next-ink-open .next-ink-caret,
.next-item-color-toggle .next-item-color-caret {
    color: transparent !important;
    font-size: 0 !important;
}

.next-readiness-strip {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
    min-width: 0;
}

.next-readiness-chip {
    display: grid;
    align-content: center;
    gap: 1px;
    min-width: 0;
    min-height: 30px;
    padding: 3px 5px;
    border: 1px solid #e0e7f0;
    border-radius: 7px;
    background: #ffffff;
}

.next-readiness-chip span,
.next-readiness-chip strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.next-readiness-chip span {
    color: #667085;
    font-size: 8px;
    font-weight: 900;
    line-height: 1;
}

.next-readiness-chip strong {
    color: #243044;
    font-size: 10px;
    font-weight: 950;
    line-height: 1.05;
}

.next-readiness-chip.is-ok {
    border-color: #bfe5d2;
    background: #f3fbf7;
}

.next-readiness-chip.is-ok strong {
    color: #0f7a42;
}

.next-readiness-chip.is-warn {
    border-color: #f2c38c;
    background: #fff8ed;
}

.next-readiness-chip.is-warn strong {
    color: #a85d00;
}

.next-readiness-chip.is-empty {
    background: #f8fafc;
}

.next-flow {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
    padding: 3px;
    border: 1px solid #e1e7ef;
    border-radius: 999px;
    background: #f8fafc;
}

.next-flow span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    color: #667085;
    font-size: 10px;
    font-weight: 900;
    white-space: nowrap;
}

.next-flow span.is-active {
    background: #102033;
    color: #ffffff;
}

.next-save-btn,
#saveServer.next-save-btn {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
}

.next-preview-btn {
    border-color: #ccd6e3;
    background: #ffffff;
    color: #102033;
}

.next-preview-btn[hidden] {
    display: none !important;
}

.next-preview-btn.is-active {
    border-color: #102033;
    background: #102033;
    color: #ffffff;
}

.next-order-cta {
    border-color: #111827;
    background: #111827;
    color: #ffffff;
}

.next-order-cta:hover:not(:disabled) {
    border-color: #111827;
    background: #263244;
    color: #ffffff;
}

.next-order-cta.is-processing,
.next-order-cta.is-processing:disabled {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border-color: #087f7c;
    background: #087f7c;
    color: #ffffff;
    opacity: 1;
    cursor: wait;
}

.next-order-cta.is-processing::before {
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255, 255, 255, 0.42);
    border-top-color: #ffffff;
    border-radius: 50%;
    content: "";
    animation: next-order-submit-spin 700ms linear infinite;
}

@keyframes next-order-submit-spin {
    to {
        transform: rotate(360deg);
    }
}

.next-primary-tools {
    order: -5;
    padding: 10px;
    border: 1px solid #d8e8e8;
    border-radius: 8px;
    background: linear-gradient(180deg, #ffffff 0%, #f8ffff 100%);
}

.next-primary-tools .next-tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.next-primary-tools .next-tool {
    min-height: 58px;
    border-color: #dce4ee;
    background: #ffffff;
}

.next-primary-tools .next-tool:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.next-print-check {
    position: absolute;
    left: 12px;
    bottom: 10px;
    z-index: 10;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    width: min(540px, calc(100% - 210px));
    margin: 0;
    padding: 6px 8px;
    border: 1px solid #dfe6f0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
    backdrop-filter: blur(8px);
}

.next-print-check strong {
    font-size: 11px;
    font-weight: 950;
    white-space: nowrap;
}

.next-print-check span {
    min-width: 0;
    overflow: hidden;
    color: #526175;
    font-size: 11px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.next-print-check button {
    min-height: 24px;
    padding: 0 9px;
    border: 1px solid #d3dbe7;
    border-radius: 999px;
    background: #ffffff;
    color: #102033;
    font-size: 11px;
    font-weight: 900;
    cursor: pointer;
}

.next-print-check.is-empty {
    display: none;
}

.next-print-check.is-ok {
    border-color: #bfe5d2;
    background: #f3fbf7;
}

.next-print-check.is-ok strong {
    color: #0f7a42;
}

.next-print-check.is-warn {
    border-color: #f2c38c;
    background: #fff8ed;
}

.next-print-check.is-warn strong {
    color: #a85d00;
}

.next-order-modal[hidden] {
    display: none;
}

.next-order-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.next-order-panel {
    position: relative;
    z-index: 1;
    width: min(620px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    overflow: auto;
    border: 1px solid #dfe6f0;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
}

.next-order-head,
.next-order-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
}

.next-order-head {
    border-bottom: 1px solid #e9edf4;
}

.next-order-head h2 {
    margin: 0;
    color: #102033;
    font-size: 18px;
    line-height: 1.2;
}

.next-order-head span {
    display: block;
    margin-top: 3px;
    color: #667085;
    font-size: 12px;
    font-weight: 800;
}

.next-order-body {
    display: grid;
    gap: 14px;
    padding: 14px 16px 4px;
}

.next-order-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.next-order-summary div {
    min-width: 0;
    padding: 9px;
    border: 1px solid #e3e9f2;
    border-radius: 8px;
    background: #f8fafc;
}

.next-order-summary span,
.next-order-summary strong {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.next-order-summary span {
    color: #667085;
    font-size: 10px;
    font-weight: 900;
}

.next-order-summary strong {
    margin-top: 3px;
    color: #102033;
    font-size: 12px;
    font-weight: 950;
}

.next-order-advice {
    min-height: 40px;
    padding: 9px 11px;
    border: 1px solid #dfe6f0;
    border-radius: 8px;
    background: #f8fafc;
    color: #344054;
    font-size: 13px;
    font-weight: 850;
    line-height: 1.45;
}

.next-order-advice.is-ok {
    border-color: #bfe5d2;
    background: #f3fbf7;
    color: #0f7a42;
}

.next-order-advice.is-warn {
    border-color: #f2c38c;
    background: #fff8ed;
    color: #8a4b00;
}

.next-order-advice.is-busy {
    border-color: #9fdedb;
    background: #effaf9;
    color: #087c79;
}

.next-order-check-list {
    display: grid;
    gap: 7px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.next-order-check-item {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 7px 9px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
}

.next-order-check-item strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 950;
}

.next-order-check-item span {
    min-width: 0;
    color: #344054;
    font-size: 13px;
    font-weight: 800;
}

.next-order-check-item.is-ok strong {
    background: #e7f8ef;
    color: #0f7a42;
}

.next-order-check-item.is-warn {
    border-color: #f2c38c;
    background: #fff8ed;
}

.next-order-check-item.is-warn strong {
    background: #ffe5bd;
    color: #a85d00;
}

.next-order-submission-result[hidden] {
    display: none;
}

.next-order-submission-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border: 1px solid #a9dfdc;
    background: #effaf9;
}

.next-order-submission-result span,
.next-order-submission-result strong,
.next-order-submission-result small {
    display: block;
}

.next-order-submission-result span,
.next-order-submission-result small {
    color: #55716f;
    font-size: 10px;
    font-weight: 800;
}

.next-order-submission-result strong {
    margin: 1px 0;
    color: #087c79;
    font-size: 17px;
    letter-spacing: 0;
}

.next-order-submission-result a {
    flex: 0 0 auto;
    padding: 8px 12px;
    border: 1px solid #08a8a5;
    background: #ffffff;
    color: #087c79;
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
}

.next-order-footer {
    border-top: 1px solid #e9edf4;
}

.next-layout {
    grid-template-columns: 324px minmax(560px, 1fr) 188px;
    gap: 8px;
}

.next-control-panel {
    gap: 8px;
}

.next-primary-tools {
    order: 1;
}

.next-control-panel.has-selection .next-primary-tools {
    order: 1;
}

.next-control-panel .next-surface-print-section {
    order: 2;
}

.next-control-panel.has-selection .next-surface-print-section {
    order: 2;
}

.next-selected-section {
    order: 3;
}

.next-control-panel.has-selection .next-selected-section {
    order: 3;
}

.next-primary-tools .next-section-head,
.next-control-panel .next-surface-print-section > .next-section-head {
    display: none;
}

.next-selected-section .next-section-head h2,
.next-selected-section #selectedType {
    display: none;
}

.next-selected-section .next-section-head {
    justify-content: flex-end;
    min-height: 0;
    margin-bottom: 6px;
}

.next-primary-tools,
.next-selected-section,
.next-control-panel .next-surface-print-section {
    border-radius: 10px;
    background: #fbfcff;
}

.next-primary-tools .next-tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.next-primary-tools .next-tool {
    min-height: 50px;
    border-radius: 9px;
}

.next-control-panel .next-surface-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
}

.next-control-panel .next-surface-tab {
    min-height: 32px;
    height: 32px;
    border-radius: 8px;
}

.next-control-panel .next-surface-print-section .next-print-size,
.next-left-panel .next-surface-print-section .next-print-size {
    display: none !important;
}

.next-control-panel .next-print-size {
    margin-top: 8px;
    padding: 7px;
    border: 1px solid #e4eaf2;
    border-radius: 9px;
    background: #ffffff;
}

.next-control-panel .next-print-size-head span {
    display: none;
}

.next-control-panel .next-print-size-head strong {
    font-size: 14px;
}

.next-control-panel .next-print-size-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    margin: 5px 0 6px;
}

.next-control-panel .next-print-size-meta span {
    min-width: 0;
    overflow: hidden;
    padding: 3px 6px;
    border: 1px solid #edf1f7;
    border-radius: 999px;
    background: #f8fafc;
    color: #4b5565;
    font-size: 9px;
    font-weight: 950;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.next-control-panel .next-print-size-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.next-control-panel .next-print-size-tab {
    min-height: 42px;
    height: 42px;
    border-radius: 8px;
}

.next-readiness-strip {
    display: none;
}

.next-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 48px minmax(0, 1fr);
}

.next-workbar {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    position: relative;
    top: auto;
    z-index: 11;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: auto;
    min-height: 48px;
    padding: 4px 10px;
    overflow: visible;
    scrollbar-gutter: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
}

.next-workbar > .next-workbar-group:first-child,
.next-workbar-utility {
    grid-area: auto;
}

.next-workbar-group,
.next-workbar-utility {
    display: inline-flex;
    min-height: 36px;
}

.next-workbar-utility {
    justify-self: auto;
    margin-left: auto;
}

.next-workbar .next-surface-print-section {
    display: none;
}

.next-layer-toggle {
    display: none !important;
}

.next-stage-shell {
    grid-column: 1 / 2;
    grid-row: 2 / 3;
}

.next-print-check,
.next-statusbar {
    grid-column: 1 / 2;
}

.next-layer-dock {
    display: block;
    min-width: 0;
    height: 100%;
    padding: 0;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
}

.next-layer-dock .next-stage-layers {
    position: static;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    width: 100%;
    min-width: 0;
    max-width: none;
    height: 100%;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.next-layer-dock .next-stage-layers[hidden] {
    display: none;
}

.next-layer-dock .next-layer-dragbar {
    min-height: 46px;
    padding: 10px;
    cursor: default;
}

.next-layer-dock .next-layer-close {
    display: none;
}

.next-layer-dock .next-layer-dock-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    margin-left: auto;
    border: 1px solid #dbe3ef;
    border-radius: 999px;
    background: #ffffff;
    color: #0f3f55;
    font-size: 12px;
    font-weight: 950;
}

.next-layer-dock .next-layer-order-mini {
    order: 3;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 8px;
    border-top: 1px solid #eef1f6;
}

.next-layer-dock .next-layers {
    order: 2;
    max-height: none;
    min-height: 0;
    padding: 8px;
    overflow: auto;
}

.next-layer-dock .next-panel-layer-row {
    height: 62px;
    min-height: 62px;
    border-radius: 9px;
}

.next-layer-dock .next-layers.is-compact-layers .next-panel-layer-row {
    height: 58px;
    min-height: 58px;
}

.next-layer-dock .next-layers.is-even-layers .next-panel-layer-row {
    height: 52px;
    min-height: 52px;
    padding-block: 4px;
}

.next-layer-dock .next-layers.is-even-layers .next-layer-thumb {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    max-width: 42px;
    max-height: 42px;
}

.next-app.is-previewing .next-floating-toolbar,
.next-app.is-previewing #controlLayer {
    display: none;
}

@media (max-width: 1180px) {
    .next-topbar {
        display: grid;
        grid-template-columns: minmax(280px, 1fr) auto;
        align-items: center;
    }

    .next-actions {
        flex-wrap: nowrap;
        justify-content: flex-end;
    }

    .next-topbar .next-btn {
        min-width: auto;
        padding: 0 9px;
    }

    .next-flow {
        display: none;
    }

    .next-layout {
        grid-template-columns: 250px minmax(520px, 1fr) 70px;
        gap: 6px;
    }

    .next-modal-body {
        grid-template-columns: 170px minmax(0, 1fr) 240px;
    }

    .next-control-panel {
        grid-column: auto;
    }

    .next-control-panel .next-selected-section .next-editor.is-active {
        display: block;
    }

    .next-control-panel .next-selected-section .next-context-card,
    .next-control-panel .next-selected-section .next-editor-tabs {
        grid-column: 1 / -1;
    }

    .next-control-panel .next-selected-section .next-mini-actions,
    .next-control-panel .next-selected-section .next-ink-editor-row,
    .next-control-panel .next-selected-section .next-field-row {
        grid-column: auto;
    }

    .next-control-panel .next-selected-section .next-ink-editor-row {
        grid-column: 1 / -1;
    }

    .next-workbar .next-surface-print-section {
        grid-template-columns: 1fr;
    }

    .next-readiness-strip {
        display: none;
    }
}

@media (max-width: 820px) {
    .next-app {
        height: auto;
        min-height: 100vh;
        overflow: visible;
        padding: 8px;
    }

    .next-topbar {
        display: flex;
        align-items: stretch;
        flex-direction: column;
    }

    .next-brand {
        align-items: flex-start;
    }

    .next-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .next-flow {
        display: inline-flex;
        justify-content: flex-start;
        overflow: auto;
    }

    .next-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

    .next-workspace {
        display: flex;
        flex-direction: column;
    }

    .next-workbar {
        height: auto;
        max-height: none;
        overflow: visible;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas: "history product";
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .next-stage-shell,
    .next-print-check,
    .next-statusbar {
        grid-column: auto;
        grid-row: auto;
    }

    .next-asset-modal {
        padding: 8px;
    }

    .next-modal-panel {
        width: calc(100vw - 16px);
        max-height: calc(100vh - 16px);
        min-height: 0;
    }

    .next-modal-head {
        grid-template-columns: minmax(0, 1fr) 38px;
    }

    .next-modal-head .next-asset-tabs {
        grid-column: 1 / -1;
    }

    .next-modal-body {
        display: block;
        overflow: auto;
    }

    .next-modal-categories {
        overflow: visible;
        padding-right: 0;
    }

    .next-modal-panel .next-asset-categories,
    .next-modal-panel .next-asset-groups,
    .next-modal-panel .next-template-category-list {
        display: flex;
        overflow: auto;
        padding-bottom: 6px;
    }

    .next-modal-panel .next-asset-categories {
        display: grid;
        max-height: 240px;
        overflow: auto;
    }

    .next-modal-panel .next-asset-chip,
    .next-modal-panel .next-group-chip,
    .next-modal-panel .next-template-chip {
        width: auto;
        flex: 0 0 auto;
    }

    .next-modal-panel .next-asset-parent-chip,
    .next-modal-panel .next-asset-child-chip {
        width: 100%;
    }

    .next-modal-panel .next-asset-grid,
    .next-modal-panel .next-template-grid {
        height: auto;
        min-height: 230px;
        max-height: 42vh;
        margin-top: 8px;
    }

    .next-modal-panel .next-asset-preview {
        position: sticky;
        bottom: 0;
        margin-top: 10px;
        background: #fff;
        box-shadow: 0 -8px 18px rgba(255, 255, 255, 0.92);
    }

    .next-panel {
        height: auto;
        max-height: none;
        overflow: visible;
    }

    .next-left-panel {
        order: 3;
    }

    .next-workspace {
        height: auto;
        order: 1;
    }

    .next-control-panel {
        order: 2;
    }

    .next-stage-shell {
        min-height: 430px;
        padding: 10px;
    }

    .next-canvas {
        max-height: none;
        min-width: 280px;
    }

    .next-order-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .next-workbar .next-surface-print-section {
        grid-template-columns: 1fr;
    }

    .next-workbar .next-print-size {
        grid-template-columns: minmax(74px, auto) minmax(0, 1fr);
    }
}

@media (max-width: 520px) {
    .next-product-row {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .next-item-color-picker {
        width: 100%;
    }

    .next-item-color-toggle {
        grid-template-columns: 22px minmax(0, 1fr) 18px;
        width: 100%;
        max-width: none;
    }

    .next-btn {
        min-width: 0;
        flex: 1 1 calc(50% - 6px);
    }

    .next-flow span {
        min-height: 26px;
        padding: 0 8px;
        font-size: 10px;
    }

    .next-workbar {
        align-items: flex-start;
        grid-template-columns: 1fr;
    }

    .next-surface-tabs,
    .next-field-row,
    .next-mini-actions,
    .next-surface-transfer {
        grid-template-columns: 1fr;
    }

    .next-primary-tools .next-tool-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .next-swatches {
        grid-template-columns: repeat(6, 30px);
    }

    .next-asset-compact-actions {
        grid-template-columns: 1fr;
    }

    .next-modal-body {
        padding: 10px;
    }

    .next-modal-panel .next-asset-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    }

    .next-modal-panel .next-template-grid {
        grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    }

    .next-print-check {
        left: 8px;
        right: 8px;
        bottom: 8px;
        width: auto;
        grid-template-columns: auto minmax(0, 1fr) auto;
        border-radius: 10px;
    }

    .next-print-check span {
        grid-column: auto;
        white-space: nowrap;
    }

    .next-order-summary {
        grid-template-columns: 1fr;
    }

    .next-order-footer {
        align-items: stretch;
        flex-direction: column;
    }
}

.next-control-panel .next-primary-tools .next-tool-grid,
.next-control-panel.has-selection .next-primary-tools .next-tool-grid,
.next-left-panel .next-primary-tools .next-tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.next-control-panel .next-primary-tools,
.next-control-panel.has-selection .next-primary-tools,
.next-left-panel .next-primary-tools {
    padding: 8px;
}

.next-control-panel .next-primary-tools .next-tool,
.next-control-panel.has-selection .next-primary-tools .next-tool,
.next-left-panel .next-primary-tools .next-tool {
    min-height: 58px;
    padding: 6px 4px;
    gap: 4px;
    font-size: 12px;
    line-height: 1.1;
}

:root {
    --next-ui-font: "Yu Gothic", "YuGothic", "Noto Sans JP", Meiryo, "Hiragino Sans", sans-serif;
}

.next-app {
    --line: #dfe6f0;
    --soft: #f6f8fb;
    background: #eef2f6;
    color: #102033;
    padding: 8px;
}

.next-topbar,
.next-panel,
.next-workspace,
.next-layer-dock {
    border-color: #dfe6f0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
}

.next-topbar {
    margin-bottom: 8px;
}

.next-layout {
    grid-template-columns: 324px minmax(560px, 1fr) 188px;
    gap: 8px;
}

.next-panel {
    padding: 8px;
}

.next-control-panel {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 8px;
}

.next-control-panel > .next-section,
.next-control-panel .next-primary-tools,
.next-control-panel .next-selected-section,
.next-control-panel .next-surface-print-section {
    margin: 0;
    padding: 8px;
    border: 1px solid #e7edf5;
    border-radius: 10px;
    background: #fbfcff;
}

.next-control-panel .next-primary-tools .next-tool-grid {
    gap: 7px;
}

.next-control-panel .next-primary-tools .next-tool {
    min-height: 52px;
    border-color: #dbe3ee;
    border-radius: 9px;
    background: #ffffff;
    color: #102033;
    font-size: 13px;
    font-weight: 950;
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.05);
}

.next-control-panel .next-primary-tools .next-tool-symbol {
    color: #007f82;
    font-size: 21px;
    line-height: 1;
}

.next-control-panel .next-surface-tabs {
    gap: 5px;
}

.next-control-panel .next-surface-tab,
.next-editor-tabs button,
.next-mini-btn,
.next-arrange-btn,
.next-layer-order-mini button {
    border-radius: 8px;
    font-weight: 950;
}

.next-control-panel .next-surface-tab {
    min-height: 34px;
    height: 34px;
}

.next-selected-section .next-section-head {
    min-height: 0;
    margin-bottom: 8px;
}

.next-selected-section .next-section-actions {
    width: 100%;
}

.next-clear-btn {
    min-height: 30px;
    border-radius: 8px;
}

.next-empty {
    min-height: 42px;
    margin: 0;
    color: #667085;
    font-size: 12px;
    font-weight: 900;
}

.next-editor-tabs {
    gap: 5px;
    padding: 3px;
    border-color: #dde5ef;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.96);
}

.next-editor-tabs button {
    min-height: 32px;
    font-size: 12px;
}

.next-arrange-card,
.next-arrange-panel {
    gap: 8px;
}

.next-arrange-group {
    gap: 7px;
    padding: 9px;
    border: 1px solid #e2e8f2;
    border-radius: 10px;
    background: #ffffff;
}

.next-arrange-group h3 {
    color: #26344a;
    font-size: 12px;
}

.next-arrange-primary {
    border-color: #e2e8f2;
    background: #ffffff;
}

.next-arrange-primary h3 {
    color: #26344a;
}

.next-arrange-primary .next-arrange-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.next-arrange-primary .next-arrange-btn {
    min-height: 34px;
}

.next-layer-order-group,
.next-transform-group,
.next-surface-transfer-group,
.next-arrange-values {
    background: #fbfcfe;
}

.next-transform-group .next-arrange-quick {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.next-arrange-values .next-field-row {
    margin: 0;
}

.next-mini-actions,
.next-arrange-grid,
.next-field-row {
    gap: 6px;
}

.next-mini-btn,
.next-arrange-btn {
    min-height: 36px;
    border-color: #dce4ef;
    background: #ffffff;
    color: #102033;
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.05);
}

.next-mini-btn {
    padding-inline: 7px;
    font-size: 11px;
    white-space: nowrap;
}

.next-field {
    margin-bottom: 7px;
}

.next-field span {
    color: #667085;
    font-size: 11px;
    font-weight: 950;
}

.next-field input,
.next-field select,
.next-field textarea,
.next-context-quick input,
.next-draft-inline input {
    border-color: #dbe3ee;
    border-radius: 8px;
    background: #ffffff;
    color: #102033;
    font-size: 14px;
    font-weight: 950;
}

.next-field input,
.next-field select,
.next-context-quick input {
    height: 36px;
}

.next-layer-dock {
    padding: 0;
    overflow: hidden;
}

.next-layer-dock .next-stage-layers {
    grid-template-rows: auto minmax(0, 1fr) auto;
}

.next-layer-dock .next-layer-dragbar {
    min-height: 46px;
    padding: 10px;
    color: #102033;
    font-size: 14px;
}

.next-layer-dock .next-layers {
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 8px;
}

.next-layer-dock .next-layers.is-even-layers {
    align-content: start;
    grid-auto-rows: 52px;
}

.next-layer-dock .next-panel-layer-row {
    display: grid;
    grid-template-columns: 14px 42px minmax(0, 1fr);
    justify-items: stretch;
    align-items: center;
    gap: 8px;
    height: 62px;
    min-height: 62px;
    padding: 7px;
    border: 2px solid transparent;
    border-radius: 9px;
    background: #eef1f5;
    color: #102033;
    overflow: hidden;
}

.next-layer-dock .next-panel-layer-row::after {
    display: none;
}

.next-layer-dock .next-panel-layer-row:hover,
.next-layer-dock .next-panel-layer-row.is-active {
    border-color: #8b3dff;
    background: #f4efff;
}

.next-layer-dock .next-panel-layer-row .next-layer-grip {
    grid-column: 1;
}

.next-layer-dock .next-panel-layer-row .next-layer-thumb {
    grid-column: 2;
    width: 42px;
    height: 42px;
    border-radius: 7px;
    background-color: #ffffff;
}

.next-selected-section .next-context-card {
    display: none !important;
}

.next-selected-section .next-context-title strong {
    display: none;
}

.next-panel-layer-title {
    grid-column: 3;
    display: grid;
    gap: 2px;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    text-align: left;
}

.next-panel-layer-kind,
.next-panel-layer-sub {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.next-panel-layer-kind {
    color: #26344a;
    font-size: 12px;
    font-weight: 950;
    line-height: 1.25;
}

.next-panel-layer-sub {
    color: #667085;
    font-size: 10px;
    font-weight: 900;
    line-height: 1.2;
}

.next-layer-dock .next-layer-order-mini {
    gap: 6px;
    padding: 8px;
}

.next-layer-dock .next-layer-order-mini button {
    min-height: 34px;
    border-color: #dce4ef;
    background: #ffffff;
    color: #102033;
}

.next-layer-dock .next-layer-order-mini button:disabled {
    background: #f5f7fa;
    color: #a9b3c2;
}

.next-layer-dock .next-layers.is-compact-layers .next-panel-layer-row {
    height: 58px;
    min-height: 58px;
}

.next-layer-dock .next-layers.is-even-layers .next-panel-layer-row {
    height: 52px;
    min-height: 52px;
    padding-block: 4px;
}

.next-layer-dock .next-layers.is-even-layers .next-layer-thumb {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    max-width: 42px;
    max-height: 42px;
}

.next-toolbar-color-bubble {
    position: fixed;
    z-index: 95;
    width: max-content;
    max-width: calc(100vw - 24px);
    padding: 10px;
    border: 1px solid #dce4ef;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.18);
    opacity: 0;
    pointer-events: auto;
    cursor: grab;
    user-select: none;
    touch-action: none;
}

.next-toolbar-color-bubble[hidden] {
    display: none;
}

.next-toolbar-color-bubble.is-visible {
    opacity: 1;
}

.next-toolbar-color-bubble.is-dragging {
    cursor: grabbing;
}

.next-toolbar-color-bubble button,
.next-toolbar-color-bubble input,
.next-toolbar-color-bubble label {
    cursor: pointer;
}

.next-toolbar-color-bubble::after {
    content: none;
}

.next-toolbar-color-bubble.is-below::after {
    content: none;
}

.next-toolbar-color-grid {
    display: grid;
    grid-template-columns: repeat(5, 26px);
    gap: 7px;
    max-height: none;
    overflow: visible;
    padding: 2px;
}

.next-toolbar-color-grid .next-ink-swatch {
    box-sizing: border-box;
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    min-width: 26px;
    min-height: 26px;
    max-width: 26px;
    max-height: 26px;
    border-radius: 999px;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 1px #cbd5e1;
    transform: none !important;
}

.next-toolbar-color-grid .next-ink-swatch:hover {
    border-color: #ffffff;
    box-shadow: 0 0 0 2px #91a3b8;
    transform: none !important;
}

.next-toolbar-color-grid .next-ink-swatch.is-active {
    border-color: #ffffff;
    box-shadow:
        0 0 0 2px var(--accent),
        inset 0 0 0 3px #ffffff;
}


.next-palette-auto-color-button {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 30px;
    padding: 3px 8px;
    border: 1px solid #dce4ef;
    border-radius: 999px;
    background: #ffffff;
    color: #102033;
    cursor: pointer;
    font-family: var(--next-ui-font);
    font-size: 12px;
    font-weight: 950;
    line-height: 1;
    box-shadow: 0 3px 9px rgba(15, 23, 42, 0.08);
    transform: none !important;
    transition: none !important;
}

.next-palette-auto-color-button:hover:not(:disabled) {
    border-color: var(--accent);
    background: #f2fbfb;
    color: var(--accent-strong);
    transform: none !important;
}

.next-palette-auto-color-button:disabled,
.next-palette-auto-color-button.is-disabled {
    color: #aab3c1;
    cursor: default;
    box-shadow: none;
}

.next-palette-auto-color-dots {
    display: inline-grid;
    grid-template-columns: repeat(3, 12px);
    gap: 2px;
}

.next-palette-auto-color-dots i {
    width: 12px;
    height: 12px;
    border: 1px solid #ffffff;
    border-radius: 999px;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.18);
}

.next-control-panel .next-surface-tabs,
.next-left-panel .next-surface-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 3px;
    padding: 4px;
    border: 1px solid #dde7f0;
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(245, 248, 252, 0.96)),
        #f4f7fb;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 4px 10px rgba(15, 23, 42, 0.06);
}

.next-control-panel .next-surface-tab,
.next-left-panel .next-surface-tab {
    position: relative;
    min-height: 34px;
    height: 34px;
    padding: 0 8px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #102033;
    box-shadow: none;
    font-size: 14px;
    font-weight: 950;
    letter-spacing: 0;
}

.next-control-panel .next-surface-tab:hover:not(.is-active),
.next-left-panel .next-surface-tab:hover:not(.is-active) {
    background: rgba(255, 255, 255, 0.78);
    color: #007f82;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.next-control-panel .next-surface-tab.is-active,
.next-left-panel .next-surface-tab.is-active {
    border-color: transparent;
    background: linear-gradient(180deg, #12b7b2, #009b9b);
    color: #ffffff;
    box-shadow: 0 6px 14px rgba(0, 166, 166, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.next-control-panel .next-surface-tab.is-active::after,
.next-left-panel .next-surface-tab.is-active::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 4px;
    width: 14px;
    height: 2px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    transform: translateX(-50%);
}

@media (max-width: 520px) {
    .next-control-panel .next-surface-tabs,
    .next-left-panel .next-surface-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.next-control-panel {
    overflow: hidden;
    scrollbar-gutter: auto;
}

.next-control-panel .next-primary-tools,
.next-control-panel.has-selection .next-primary-tools {
    position: relative;
    top: auto;
    z-index: 2;
    flex: 0 0 auto;
    box-shadow: none;
}

.next-control-panel .next-primary-tools .next-tool-grid,
.next-control-panel.has-selection .next-primary-tools .next-tool-grid,
.next-left-panel .next-primary-tools .next-tool-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.next-control-panel .next-primary-tools .next-tool,
.next-control-panel.has-selection .next-primary-tools .next-tool,
.next-left-panel .next-primary-tools .next-tool {
    min-height: 48px;
    padding: 4px 2px;
    gap: 2px;
    font-size: 11px;
    line-height: 1.1;
}

.next-control-panel .next-selected-section {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.next-control-panel .next-selected-section .next-editor.is-active {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    overflow-x: hidden;
    padding-right: 2px;
    scrollbar-gutter: stable;
}

.next-control-panel .next-selected-section .next-ink-editor-row {
    grid-column: 1 / -1;
}

.next-control-panel .next-selected-section .next-editor-tabs {
    order: 0;
}

.next-control-panel .next-selected-section .next-text-edit-field {
    order: 10;
}

.next-control-panel .next-selected-section .next-font-field {
    order: 20;
    margin-bottom: 4px;
}

.next-control-panel .next-selected-section .next-ink-editor-row,
.next-control-panel .next-selected-section .next-template-color-editor {
    order: 21;
    margin-bottom: 7px;
}

.next-control-panel .next-selected-section .next-align-field {
    order: 40;
}

.next-control-panel .next-selected-section .next-field-row.next-text-only {
    order: 50;
}

.next-control-panel .next-selected-section .next-writing-field {
    order: 60;
}

.next-control-panel .next-selected-section .next-auto-color-field {
    order: 70;
}

.next-control-panel .next-selected-section .next-field-row.next-pane-basic:not(.next-text-only):not(.next-ink-editor-row) {
    order: 80;
}

.next-control-panel .next-selected-section .next-arrange-card.next-pane-position {
    order: 5;
}

.next-control-panel .next-selected-section .next-arrange-values.next-pane-position {
    order: 6;
    gap: 6px;
    padding: 8px;
    border-radius: 8px;
}

.next-control-panel .next-selected-section .next-pane-effects {
    order: 90;
}

.next-control-panel .next-selected-section .next-pane-position {
    order: 100;
}

.next-control-panel .next-selected-section .next-arrange-card.next-pane-position,
.next-control-panel .next-selected-section .next-arrange-card.next-pane-position .next-arrange-panel {
    gap: 6px;
}

.next-control-panel .next-selected-section .next-arrange-card.next-pane-position .next-arrange-group {
    gap: 5px;
    padding: 7px;
    border-radius: 8px;
}

.next-control-panel .next-selected-section .next-arrange-card.next-pane-position .next-arrange-group h3 {
    font-size: 11px;
    line-height: 1.1;
}

.next-control-panel .next-selected-section .next-arrange-values.next-pane-position h3 {
    font-size: 11px;
    line-height: 1.1;
}

.next-arrange-collapse-toggle {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 900;
    text-align: left;
    cursor: pointer;
}

.next-arrange-collapse-toggle i {
    position: relative;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    border: 1px solid #d6e0ec;
    border-radius: 999px;
    background: #ffffff;
    transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.next-arrange-collapse-toggle i::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 6px;
    height: 6px;
    border-right: 2px solid #506176;
    border-bottom: 2px solid #506176;
    transform: translate(-50%, -62%) rotate(45deg);
}

.next-arrange-collapse-toggle:hover i,
.next-arrange-collapse-toggle:focus-visible i {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.next-arrange-group.is-collapsed {
    gap: 0;
    padding-bottom: 7px;
}

.next-arrange-group.is-collapsed > :not(h3) {
    display: none !important;
}

.next-arrange-group.is-collapsed .next-arrange-collapse-toggle i {
    transform: rotate(-90deg);
}

.next-control-panel .next-selected-section .next-arrange-card.next-pane-position .next-arrange-grid {
    gap: 5px;
}

.next-control-panel .next-selected-section .next-arrange-card.next-pane-position .next-arrange-primary .next-arrange-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.next-control-panel .next-selected-section .next-arrange-card.next-pane-position .next-arrange-btn {
    min-height: 31px;
    padding: 0 7px;
    border-radius: 8px;
    font-size: 11px;
}

.next-control-panel .next-selected-section .next-arrange-card.next-pane-position .next-arrange-icon {
    flex-basis: 18px;
    width: 18px;
    height: 18px;
}

.next-control-panel .next-selected-section .next-arrange-card.next-pane-position .next-arrange-icon svg {
    width: 18px;
    height: 18px;
}

.next-control-panel .next-selected-section .next-arrange-card.next-pane-position .next-arrange-values .next-field-row {
    gap: 6px;
}

.next-control-panel .next-selected-section .next-arrange-values.next-pane-position .next-field-row {
    gap: 6px;
}

.next-control-panel .next-selected-section .next-arrange-card.next-pane-position .next-arrange-values {
    gap: 4px;
}

.next-control-panel .next-selected-section .next-arrange-values.next-pane-position {
    gap: 4px;
}

.next-control-panel .next-selected-section .next-arrange-card.next-pane-position .next-field {
    margin-bottom: 0;
}

.next-control-panel .next-selected-section .next-arrange-values.next-pane-position .next-field {
    margin-bottom: 0;
}

.next-control-panel .next-selected-section .next-arrange-card.next-pane-position .next-field span {
    margin-bottom: 2px;
    font-size: 10px;
    line-height: 1.1;
}

.next-control-panel .next-selected-section .next-arrange-values.next-pane-position .next-field span {
    margin-bottom: 2px;
    font-size: 10px;
    line-height: 1.1;
}

.next-control-panel .next-selected-section .next-arrange-card.next-pane-position .next-field input,
.next-control-panel .next-selected-section .next-arrange-card.next-pane-position .next-field select {
    height: 31px;
    min-height: 31px;
    padding: 0 8px;
    border-radius: 7px;
    font-size: 12px;
}

.next-control-panel .next-selected-section .next-arrange-values.next-pane-position .next-field input,
.next-control-panel .next-selected-section .next-arrange-values.next-pane-position .next-field select {
    height: 31px;
    min-height: 31px;
    padding: 0 8px;
    border-radius: 7px;
    font-size: 12px;
}

.next-control-panel .next-selected-section .next-arrange-card.next-pane-position .next-aspect-lock-field {
    min-height: 31px;
}

.next-control-panel .next-selected-section .next-arrange-values.next-pane-position .next-aspect-lock-field {
    min-height: 31px;
}

.next-control-panel .next-selected-section .next-arrange-card.next-pane-position .next-arrange-primary {
    order: 10;
}

.next-control-panel .next-selected-section .next-arrange-card.next-pane-position .next-layer-order-group {
    order: 20;
}

.next-control-panel .next-selected-section .next-arrange-card.next-pane-position .next-arrange-values {
    order: 30;
}

.next-control-panel .next-selected-section .next-arrange-card.next-pane-position .next-transform-group {
    order: 40;
}

.next-control-panel .next-selected-section .next-arrange-card.next-pane-position .next-surface-transfer-group {
    order: 50;
}

.next-field-row-compact {
    grid-template-columns: minmax(0, 1fr) minmax(92px, 0.78fr);
    align-items: end;
}

.next-aspect-lock-field {
    position: relative;
    justify-content: center;
    min-height: 38px;
    margin-top: 0;
    padding: 0 12px;
    border: 1px solid #d7dee9;
    border-radius: 8px;
    background: #ffffff;
    color: #102033;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.next-aspect-lock-field input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.next-aspect-lock-field span {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    color: inherit;
    font-size: 12px;
    font-weight: 950;
    line-height: 1;
}

.next-aspect-lock-field span::before {
    content: "";
    display: inline-block;
    width: 25px;
    height: 14px;
    border-radius: 999px;
    background: #d9e1eb;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.16);
}

.next-aspect-lock-field span::after {
    content: "";
    position: absolute;
    left: 3px;
    top: 50%;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.22);
    transform: translateY(-50%);
    transition: transform 120ms ease;
}

.next-aspect-lock-field:has(input:checked),
.next-aspect-lock-field input:checked + span {
    color: var(--accent-strong);
}

.next-aspect-lock-field:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.next-aspect-lock-field input:checked + span::before {
    background: var(--accent);
}

.next-aspect-lock-field input:checked + span::after {
    transform: translate(11px, -50%);
}

.next-control-panel .next-selected-section .next-ink-editor-row.next-pane-effects,
.next-control-panel .next-selected-section .next-template-color-editor.next-pane-effects {
    order: 21;
}

.next-arrange-primary .next-arrange-grid,
.next-layer-order-group .next-arrange-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.next-control-panel .next-selected-section .next-arrange-card.next-pane-position .next-arrange-primary .next-arrange-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.next-arrange-btn.next-arrange-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;
    min-height: 40px;
    padding: 0 11px;
    text-align: left;
}

.next-arrange-btn-icon > span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.next-arrange-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    color: #0f2138;
}

.next-arrange-icon svg {
    display: block;
    width: 21px;
    height: 21px;
    overflow: visible;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.85;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.next-arrange-btn:hover:not(:disabled) .next-arrange-icon,
.next-arrange-btn:active:not(:disabled) .next-arrange-icon {
    color: var(--accent-strong);
}

.next-arrange-btn.next-arrange-btn-icon:disabled {
    color: #8694a7;
    background: #f8fafc;
}

.next-arrange-btn:disabled .next-arrange-icon {
    color: #8391a5;
}

.next-arrange-ico {
    position: relative;
    display: inline-block;
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    color: currentColor;
}

.next-arrange-ico::before,
.next-arrange-ico::after,
.next-arrange-ico i,
.next-arrange-ico b {
    position: absolute;
    display: block;
    box-sizing: border-box;
}

.next-arrange-ico::before,
.next-arrange-ico::after {
    content: "";
}

.next-arrange-ico i,
.next-arrange-ico b {
    font-style: normal;
}

.next-arrange-ico[class*="is-align"]::before {
    background: currentColor;
    border-radius: 2px;
}

.next-arrange-ico[class*="is-align"]::after {
    border: 2px solid currentColor;
    border-radius: 2px;
}

.next-arrange-ico.is-align-top::before {
    left: 3px;
    top: 3px;
    width: 16px;
    height: 2px;
}

.next-arrange-ico.is-align-top::after {
    left: 8px;
    top: 8px;
    width: 7px;
    height: 10px;
}

.next-arrange-ico.is-align-bottom::before {
    left: 3px;
    bottom: 3px;
    width: 16px;
    height: 2px;
}

.next-arrange-ico.is-align-bottom::after {
    left: 8px;
    top: 4px;
    width: 7px;
    height: 10px;
}

.next-arrange-ico.is-align-left::before {
    left: 3px;
    top: 3px;
    width: 2px;
    height: 16px;
}

.next-arrange-ico.is-align-left::after {
    left: 8px;
    top: 7px;
    width: 10px;
    height: 8px;
}

.next-arrange-ico.is-align-right::before {
    right: 3px;
    top: 3px;
    width: 2px;
    height: 16px;
}

.next-arrange-ico.is-align-right::after {
    left: 4px;
    top: 7px;
    width: 10px;
    height: 8px;
}

.next-arrange-ico.is-align-center::before {
    left: 10px;
    top: 3px;
    width: 2px;
    height: 16px;
}

.next-arrange-ico.is-align-center::after {
    left: 5px;
    top: 7px;
    width: 12px;
    height: 8px;
}

.next-arrange-ico.is-align-middle::before {
    left: 3px;
    top: 10px;
    width: 16px;
    height: 2px;
}

.next-arrange-ico.is-align-middle::after {
    left: 7px;
    top: 5px;
    width: 8px;
    height: 12px;
}

.next-arrange-ico[class*="is-layer"]::before,
.next-arrange-ico[class*="is-layer"]::after {
    left: 7px;
    width: 10px;
    height: 7px;
    border: 2px solid currentColor;
    border-radius: 1px;
    transform: skewY(-22deg);
}

.next-arrange-ico[class*="is-layer"]::before {
    top: 8px;
    opacity: 0.95;
}

.next-arrange-ico[class*="is-layer"]::after {
    top: 12px;
    opacity: 0.5;
}

.next-arrange-ico[class*="is-layer"] i {
    left: 3px;
    top: 5px;
    width: 2px;
    height: 12px;
    background: currentColor;
    border-radius: 2px;
}

.next-arrange-ico[class*="is-layer"] b {
    left: 0;
    width: 8px;
    height: 8px;
    border-color: currentColor;
    border-style: solid;
}

.next-arrange-ico.is-layer-forward b,
.next-arrange-ico.is-layer-front b {
    top: 3px;
    border-width: 2px 0 0 2px;
    transform: rotate(45deg);
}

.next-arrange-ico.is-layer-backward b,
.next-arrange-ico.is-layer-back b {
    bottom: 3px;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.next-arrange-ico.is-layer-front i {
    box-shadow: 0 -5px 0 -0.5px currentColor;
}

.next-arrange-ico.is-layer-back i {
    box-shadow: 0 5px 0 -0.5px currentColor;
}

.next-arrange-btn-icon:disabled .next-arrange-ico {
    opacity: 0.42;
}

.next-print-note-corner {
    position: absolute;
    top: 52px;
    right: 18px;
    z-index: 7;
    display: block;
    width: auto;
    max-width: min(290px, calc(100% - 36px));
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #6b7788;
    box-shadow: none;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.35;
    text-align: right;
    pointer-events: none;
    backdrop-filter: none;
}

.next-print-note-corner span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 720px) {
    .next-print-note-corner {
        right: 10px;
        top: 48px;
        max-width: calc(100% - 20px);
        font-size: 10px;
    }
}

.next-left-panel .next-surface-tab.has-design,
.next-control-panel .next-surface-tab.has-design {
    padding-right: 18px;
}

.next-surface-label {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.next-surface-design-mark {
    position: absolute;
    top: 6px;
    right: 7px;
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #ffcf33;
    box-shadow: 0 0 0 2px #ffffff, 0 0 10px rgba(255, 207, 51, 0.75);
}

.next-surface-tab.is-active .next-surface-design-mark {
    background: #ffffff;
    box-shadow: 0 0 0 2px rgba(0, 166, 166, 0.25), 0 0 10px rgba(255, 255, 255, 0.65);
}

.next-design-preview-modal[hidden] {
    display: none;
}

.next-design-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.next-design-preview-panel {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(1080px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    overflow: hidden;
    border: 1px solid #dfe6f0;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
}

.next-design-preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border-bottom: 1px solid #e8edf5;
    background: #ffffff;
}

.next-design-preview-head h2 {
    margin: 0;
    color: #102033;
    font-size: 18px;
    line-height: 1.2;
}

.next-design-preview-head span {
    display: block;
    margin-top: 3px;
    color: #667085;
    font-size: 12px;
    font-weight: 850;
}

.next-design-preview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    padding: 14px;
    overflow: auto;
    background: #f5f7fb;
}

.next-design-preview-card {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 300px;
    overflow: hidden;
    border: 1px solid #dfe6f0;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.07);
}

.next-design-preview-card.has-design {
    border-color: rgba(0, 166, 166, 0.5);
}

.next-design-preview-card.is-current {
    box-shadow: 0 0 0 2px rgba(0, 166, 166, 0.22), 0 10px 24px rgba(15, 23, 42, 0.08);
}

.next-design-preview-card header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 10px;
    border-bottom: 1px solid #edf1f6;
}

.next-design-preview-card header strong {
    color: #102033;
    font-size: 14px;
    font-weight: 950;
}

.next-design-preview-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #667085;
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}

.next-design-preview-card.has-design .next-design-preview-count {
    background: #e6fbf9;
    color: #007f82;
}

.next-design-preview-thumb {
    display: grid;
    place-items: center;
    min-height: 0;
    padding: 10px;
    background:
        linear-gradient(90deg, rgba(16, 32, 51, 0.035) 1px, transparent 1px),
        linear-gradient(180deg, rgba(16, 32, 51, 0.035) 1px, transparent 1px),
        #fafcff;
    background-size: 18px 18px;
}

.next-design-preview-svg {
    display: block;
    width: 100%;
    max-height: min(56vh, 430px);
    height: auto;
}

.next-preview-print-area {
    fill: transparent;
    display: none;
    stroke: none;
}

@media (max-width: 1080px) {
    .next-design-preview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .next-design-preview-grid {
        grid-template-columns: 1fr;
    }
}

.next-control-panel:not(.has-selection) .next-selected-section {
    display: none;
}

@media (max-width: 820px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .next-app {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        height: auto;
        min-height: 100vh;
        overflow-x: hidden;
        overflow-y: visible;
        padding: 6px;
    }

    .next-topbar {
        display: flex;
        align-items: stretch;
        flex-direction: column;
        gap: 6px;
    }

    .next-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 6px;
    }

    .next-topbar .next-btn,
    .next-btn {
        min-width: 0;
    }

    .next-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
        max-width: 100%;
        min-width: 0;
        height: auto;
        gap: 8px;
    }

    .next-layout > *,
    .next-panel,
    .next-workspace,
    .next-control-panel,
    .next-left-panel,
    .next-right-panel,
    .next-layer-dock {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }

    .next-workspace {
        order: 1;
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    .next-left-panel {
        order: 2;
        height: auto;
        max-height: none;
        overflow: visible;
    }

    .next-right-panel {
        order: 3;
        height: auto;
        max-height: none;
        overflow: visible;
    }

    .next-control-panel {
        display: grid;
        grid-template-rows: auto;
        height: auto;
        overflow: visible;
    }

    .next-workbar {
        height: auto;
        max-height: none;
        overflow: visible;
        grid-template-columns: minmax(0, 1fr);
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .next-stage-layers {
        position: static;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        height: auto;
        max-height: 220px;
        margin: 0;
        order: 5;
    }

    .next-layer-dragbar {
        min-height: 42px;
    }

    .next-layers {
        max-height: 138px;
        overflow: auto;
    }

    .next-stage-shell {
        min-height: 360px;
        padding: 8px;
        overflow: auto;
    }

    .next-canvas {
        width: min(760px, calc(100vw - 28px));
        min-width: 0;
        max-width: calc(100vw - 28px);
    }

    .next-order-panel,
    .next-modal-panel {
        width: calc(100vw - 14px);
        max-width: calc(100vw - 14px);
    }
}

@media (max-width: 820px) {
    .next-layout {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .next-workspace,
    .next-left-panel,
    .next-right-panel {
        left: auto !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .next-stage-layers {
        display: none !important;
    }

    .next-stage-shell {
        width: 100% !important;
    }

    .next-canvas {
        width: min(760px, calc(100vw - 28px)) !important;
        max-width: calc(100vw - 28px) !important;
        min-width: 0 !important;
    }
}

/* UI typography: readable Japanese labels without changing canvas fonts. */
:root {
    --next-ui-font: "BIZ UDPGothic", "BIZ UDGothic", "Yu Gothic UI", Meiryo, "Hiragino Sans", sans-serif;
}

.next-app button,
.next-app input,
.next-app select,
.next-app textarea {
    letter-spacing: 0;
}

.next-app button {
    font-weight: 700;
}

.next-topbar button,
.next-topbar .next-btn {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
}

.next-product-info-toggle,
.next-top-estimate-detail {
    font-size: 12px;
}

/* Responsive header: keep product context and primary actions compact at every width. */
@media (min-width: 821px) and (max-width: 1180px) {
    .next-topbar {
        display: grid;
        grid-template-columns: minmax(260px, 0.85fr) minmax(0, 1.65fr);
        align-items: center;
        gap: 7px;
    }

    .next-brand {
        width: 100%;
        min-width: 0;
        flex: 0 1 auto;
    }

    .next-actions {
        width: 100%;
        min-width: 0;
        flex-wrap: wrap;
        justify-content: flex-end;
    }
}

@media (max-width: 820px) {
    .next-topbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        align-items: start;
        gap: 6px;
        min-height: 0;
        padding: 6px;
    }

    .next-brand {
        display: grid;
        grid-template-columns: 88px minmax(0, 1fr);
        align-items: start;
        gap: 7px;
        width: 100%;
        min-width: 0;
        min-height: 0;
        flex: none;
    }

    .next-brand-logo {
        width: 88px;
        height: 42px;
    }

    .next-product {
        width: 100%;
        min-width: 0;
    }

    .next-product-sku {
        display: block;
        line-height: 1;
    }

    .next-product-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 6px;
        width: 100%;
    }

    .next-product-row h1 {
        min-width: 0;
        margin: 3px 0 0;
        font-size: 15px;
        line-height: 1.25;
    }

    .next-product-info-toggle {
        align-self: center;
    }

    .next-item-color-picker {
        grid-column: 1 / -1;
        width: 100%;
        min-width: 0;
    }

    .next-item-color-toggle {
        width: 100%;
        max-width: none;
    }

    .next-item-color-drawer {
        right: 0;
        left: auto;
    }

    .next-flow {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
        min-width: 0;
        overflow: visible;
    }

    .next-flow span {
        min-width: 0;
        padding-inline: 5px;
    }

    .next-actions {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        align-items: stretch;
        gap: 5px;
        width: 100%;
        min-width: 0;
    }

    .next-actions > *,
    .next-actions .next-btn,
    .next-actions .next-draft-menu,
    .next-actions .next-draft-toggle {
        width: 100%;
        min-width: 0;
        margin: 0;
    }

    .next-top-estimate {
        min-width: 0;
    }

    .next-top-estimate-price {
        min-width: 0;
        flex: 1 1 auto;
    }

    .next-top-estimate-panel,
    .next-draft-panel {
        max-width: calc(100vw - 24px);
    }
}

@media (max-width: 560px) {
    .next-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .next-actions .next-link {
        grid-column: 1 / -1;
    }
}

@media (max-width: 380px) {
    .next-brand {
        grid-template-columns: 78px minmax(0, 1fr);
    }

    .next-brand-logo {
        width: 78px;
        height: 38px;
    }

    .next-product-row h1 {
        font-size: 14px;
    }

    .next-topbar button,
    .next-topbar .next-btn {
        font-size: 12px;
    }

    .next-top-estimate-detail {
        min-width: 42px;
        padding-inline: 6px;
    }
}

@media (min-width: 821px) {
    .next-brand {
        flex: 0 1 410px;
        width: 410px;
        max-width: 410px;
    }

    .next-product {
        flex: 0 1 auto;
        width: auto;
        max-width: 314px;
    }

    .next-product-row {
        display: grid;
        grid-template-columns: fit-content(210px) auto;
        align-items: center;
        justify-content: start;
        gap: 6px;
        width: fit-content;
        max-width: 100%;
    }

    .next-product-row h1 {
        grid-column: 1;
        min-width: 0;
        max-width: 210px;
        flex: none;
    }

    .next-product-info-toggle {
        grid-column: 2;
    }

    .next-item-color-picker {
        grid-column: 1 / -1;
        width: 140px;
        min-width: 0;
    }

    .next-item-color-toggle {
        width: 140px;
        min-width: 0;
    }

    .next-actions {
        align-items: center;
    }

    .next-actions > *,
    .next-actions .next-btn {
        min-height: 34px;
    }
}

/* Header layout is explicit at desktop/tablet widths; never rely on flex wrapping. */
@media (min-width: 1220px) {
    .next-topbar {
        display: grid;
        grid-template-columns: 340px 179px max-content;
        grid-template-areas: "brand flow actions";
        align-items: center;
        justify-content: center;
        gap: 8px;
        min-height: 0;
    }

    .next-brand {
        grid-area: brand;
        display: grid;
        grid-template-columns: 88px minmax(0, 1fr);
        align-items: center;
        width: 340px;
        max-width: 340px;
        min-width: 0;
        flex: none;
    }

    .next-product {
        width: 244px;
        max-width: 244px;
    }

    .next-product-row {
        grid-template-columns: fit-content(184px) auto;
    }

    .next-product-row h1 {
        max-width: 184px;
    }

    .next-flow {
        grid-area: flow;
    }

    .next-actions {
        grid-area: actions;
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-end;
        width: max-content;
        min-width: 0;
    }

    .next-actions > *,
    .next-actions .next-btn,
    .next-actions .next-draft-menu,
    .next-actions .next-draft-toggle {
        width: auto;
        flex: 0 0 auto;
    }
}

@media (min-width: 600px) and (max-width: 1219px) {
    .next-topbar {
        display: grid;
        grid-template-columns: 340px 179px;
        grid-template-areas:
            "brand flow"
            "actions actions";
        align-items: center;
        justify-content: center;
        gap: 6px 8px;
        min-height: 0;
    }

    .next-brand {
        grid-area: brand;
        display: grid;
        grid-template-columns: 88px minmax(0, 1fr);
        align-items: center;
        width: 340px;
        max-width: 340px;
        min-width: 0;
        flex: none;
    }

    .next-product {
        width: 244px;
        max-width: 244px;
    }

    .next-product-row {
        grid-template-columns: 184px 52px;
        width: 244px;
    }

    .next-product-row h1 {
        max-width: 184px;
    }

    .next-product-info-toggle {
        width: 52px;
        justify-self: start;
    }

    .next-flow {
        grid-area: flow;
        display: inline-flex;
    }

    .next-actions {
        grid-area: actions;
        display: flex;
        flex-wrap: nowrap;
        justify-content: center;
        justify-self: center;
        width: max-content;
        max-width: 100%;
        min-width: 0;
        gap: 5px;
    }

    .next-actions > *,
    .next-actions .next-btn,
    .next-actions .next-draft-menu,
    .next-actions .next-draft-toggle {
        width: auto;
        min-width: 0;
        flex: 0 0 auto;
    }
}

@media (min-width: 1120px) and (max-width: 1219px) {
    .next-topbar {
        grid-template-columns: 300px 179px max-content;
        grid-template-areas: "brand flow actions";
        gap: 8px;
    }

    .next-brand {
        width: 300px;
        max-width: 300px;
    }

    .next-product {
        width: 204px;
        max-width: 204px;
    }

    .next-product-row {
        grid-template-columns: 146px 52px;
        width: 100%;
    }

    .next-product-row h1 {
        max-width: 146px;
    }

    .next-product-info-toggle {
        width: 52px;
        justify-self: start;
    }

    .next-actions {
        justify-content: flex-end;
        width: max-content;
        gap: 4px;
    }
}

/* The header has two structural groups: product information and workflow actions. */
.next-top-tools {
    min-width: 0;
}

@media (min-width: 1200px) {
    .next-topbar {
        display: grid;
        grid-template-columns: 390px max-content;
        grid-template-areas: none;
        align-items: center;
        justify-content: center;
        gap: 10px;
    }

    .next-brand {
        grid-area: auto;
        grid-template-columns: 88px 294px;
        width: 390px;
        max-width: 390px;
    }

    .next-product {
        width: 294px;
        max-width: 294px;
    }

    .next-product-row {
        grid-template-columns: 236px 52px;
        width: 294px;
    }

    .next-product-row h1 {
        max-width: 236px;
    }

    .next-product-info-toggle {
        width: 52px;
        justify-self: start;
    }

    .next-top-tools {
        display: flex;
        align-items: center;
        gap: 8px;
        width: max-content;
    }

    .next-flow,
    .next-actions {
        grid-area: auto;
        flex: 0 0 auto;
    }

    .next-actions {
        width: max-content;
    }
}

@media (min-width: 1200px) and (max-width: 1299px) {
    .next-actions {
        gap: 4px;
    }

    .next-topbar .next-btn {
        min-width: auto;
        padding-inline: 9px;
    }
}

@media (min-width: 1300px) {
    .next-topbar {
        grid-template-columns: 430px max-content;
    }

    .next-brand {
        grid-template-columns: 88px 334px;
        width: 430px;
        max-width: 430px;
    }

    .next-product {
        width: 334px;
        max-width: 334px;
    }

    .next-product-row {
        grid-template-columns: 276px 52px;
        width: 334px;
    }

    .next-product-row h1 {
        max-width: 276px;
    }
}

@media (min-width: 960px) and (max-width: 1199px) {
    .next-topbar {
        display: grid;
        grid-template-columns: 350px max-content;
        grid-template-areas: none;
        align-items: center;
        justify-content: center;
        gap: 10px;
    }

    .next-brand {
        grid-area: auto;
        grid-template-columns: 88px 254px;
        width: 350px;
        max-width: 350px;
    }

    .next-product {
        width: 254px;
        max-width: 254px;
    }

    .next-product-row {
        width: 254px;
    }

    .next-product-row h1 {
        max-width: 254px;
    }

    .next-product-info-toggle {
        width: 52px;
        justify-self: start;
    }

    .next-top-tools {
        display: grid;
        grid-template-columns: max-content;
        justify-items: start;
        gap: 6px;
        width: max-content;
    }

    .next-flow,
    .next-actions {
        grid-area: auto;
    }

    .next-actions {
        width: max-content;
        gap: 4px;
    }

    .next-topbar .next-btn {
        min-width: auto;
        padding-inline: 9px;
    }
}

@media (min-width: 600px) and (max-width: 959px) {
    .next-topbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: none;
        justify-items: center;
        gap: 6px;
    }

    .next-brand {
        grid-area: auto;
        grid-template-columns: 88px 294px;
        width: 390px;
        max-width: 100%;
    }

    .next-product {
        width: 294px;
        max-width: 294px;
    }

    .next-product-row {
        grid-template-columns: 236px 52px;
        width: 294px;
    }

    .next-product-row h1 {
        max-width: 236px;
    }

    .next-product-info-toggle {
        width: 52px;
        justify-self: start;
    }

    .next-top-tools {
        display: grid;
        grid-template-columns: max-content;
        justify-items: center;
        gap: 6px;
        width: max-content;
        max-width: 100%;
    }

    .next-flow,
    .next-actions {
        grid-area: auto;
    }

    .next-flow {
        justify-self: center;
        width: 179px;
    }

    .next-actions {
        width: max-content;
        max-width: 100%;
        gap: 5px;
    }
}

@media (max-width: 599px) {
    .next-top-tools {
        display: contents;
    }
}

/* Keep the two product controls together instead of floating around the title. */
.next-product-row {
    grid-template-columns: 52px minmax(0, 1fr);
    grid-template-areas:
        "product-title product-title"
        "product-info product-color";
    align-items: center;
    gap: 4px 6px;
}

.next-product-row h1 {
    grid-area: product-title;
    width: 100%;
    max-width: none;
}

.next-product-info-toggle {
    grid-area: product-info;
    align-self: center;
    justify-self: stretch;
    width: 52px;
    height: 32px;
    border-radius: 8px;
    box-shadow: none;
}

.next-item-color-picker {
    grid-area: product-color;
    width: 100%;
    min-width: 0;
}

.next-item-color-toggle {
    width: 100%;
    max-width: none;
    min-width: 0;
    height: 32px;
    border-radius: 8px;
    box-shadow: none;
}

/* Shared jelly logo for loading and the persistent product header. */
.next-loading-mark {
    width: min(220px, 58vw);
}

.next-loading-screen {
    background: #ffffff;
}

.next-loading-logo {
    width: 100%;
    max-width: 220px;
    height: auto;
    animation: none !important;
    transform: none !important;
}

.next-loading-line {
    display: none;
}

.next-brand-logo {
    width: 55px;
    height: 71px;
    justify-self: center;
    object-fit: contain;
    border-radius: 0;
}

@media (min-width: 821px) and (max-width: 1120px) {
    .next-layout {
        grid-template-columns:
            clamp(224px, 26vw, 270px)
            minmax(0, 1fr)
            clamp(140px, 16vw, 160px);
    }
}

@media (max-width: 599px) {
    .next-brand-logo {
        width: 50px;
        height: 65px;
    }
}

/*
 * A 983px-wide Windows window can expose only about 786 CSS pixels when the
 * browser is zoomed to 125%. Keep the product block and action block on the
 * same row at that effective width so the editor does not lose canvas height.
 */
@media (min-width: 760px) and (max-width: 959px) {
    .next-topbar {
        grid-template-columns: 220px 534px;
        align-items: center;
        justify-content: center;
        gap: 6px;
    }

    .next-brand {
        grid-template-columns: 48px 166px;
        gap: 6px;
        width: 220px;
        max-width: 220px;
    }

    .next-brand-logo {
        width: 44px;
        height: 57px;
    }

    .next-product {
        width: 166px;
        max-width: 166px;
    }

    .next-product-sku {
        font-size: 11px;
        line-height: 1;
    }

    .next-product-row {
        grid-template-columns: 46px minmax(0, 1fr);
        width: 166px;
        gap: 3px 5px;
    }

    .next-product-row h1 {
        overflow: hidden;
        font-size: 14px;
        line-height: 1.2;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .next-product-info-toggle {
        width: 46px;
        height: 29px;
        padding: 0;
        font-size: 11px;
    }

    .next-item-color-toggle {
        grid-template-columns: 20px minmax(0, 1fr) 14px;
        gap: 4px;
        min-height: 29px;
        height: 29px;
        padding-inline: 6px 3px;
    }

    .next-item-color-toggle .next-current-swatch {
        width: 20px;
        height: 20px;
    }

    .next-item-color-toggle strong {
        font-size: 11px;
    }

    .next-top-tools {
        width: 534px;
        max-width: 534px;
        gap: 4px;
    }

    .next-flow {
        justify-self: start;
    }

    .next-actions {
        width: 534px;
        max-width: 534px;
        flex-wrap: nowrap;
        gap: 5px;
    }
}
