*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
    height: 100%
}

body {
    font-family: 'DM Sans', -apple-system, sans-serif;
    background: #F5F6FA;
    color: #0F1117;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    height: 100%;
    min-height: 100vh
}

:root {
    --white: #FFFFFF;
    --bg: #F5F6FA;
    --surface: #FFFFFF;
    --surface-2: #ECEEF4;
    --border: #E2E5EE;
    --border-2: #CDD1DC;
    --text: #0F1117;
    --text-2: #52586A;
    --text-3: #97A0B5;
    --accent: #1A56DB;
    --accent-hover: #1446c0;
    --accent-light: rgba(26, 86, 219, .08);
    --accent-border: rgba(26, 86, 219, .2);
    --green: #0B7A52;
    --green-bg: rgba(11, 122, 82, .08);
    --green-border: rgba(11, 122, 82, .18);
    --amber: #92540A;
    --amber-bg: rgba(146, 84, 10, .08);
    --amber-border: rgba(146, 84, 10, .18);
    --red: #B91C1C;
    --red-bg: rgba(185, 28, 28, .07);
    --red-border: rgba(185, 28, 28, .16);
    --purple: #6D28D9;
    --purple-bg: rgba(109, 40, 217, .07);
    --purple-border: rgba(109, 40, 217, .18);
    --sidebar-w: 248px;
    --sidebar-collapsed-w: 64px;
    --topbar-h: 58px;
    --radius: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .04);
    --shadow: 0 4px 12px rgba(0, 0, 0, .08), 0 1px 3px rgba(0, 0, 0, .04);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, .12), 0 4px 12px rgba(0, 0, 0, .06);
    --content-pad: clamp(12px, 3vw, 24px);
}

/* ── SHELL ── */
.shell {
    display: flex;
    height: 100vh;
    overflow: hidden;
    position: relative
}

/* ── SIDEBAR ── */
.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--white);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    transition: width .25s cubic-bezier(.4, 0, .2, 1);
    position: relative;
    z-index: 50
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-w)
}

.sidebar.collapsed .nav-group-label,
.sidebar.collapsed .sidebar-section-label,
.sidebar.collapsed .workspace-info,
.sidebar.collapsed .workspace-chevron,
.sidebar.collapsed .logo-text,
.sidebar.collapsed .group-chevron,
.sidebar.collapsed .nav-badge {
    opacity: 0;
    width: 0;
    overflow: hidden;
    white-space: nowrap;
    pointer-events: none
}

.sidebar.collapsed .sidebar-logo {
    justify-content: center;
    padding: 0
}

.sidebar.collapsed .nav-group-trigger {
    justify-content: center;
    padding: 9px
}

.sidebar.collapsed .workspace-card {
    padding: 8px;
    justify-content: center
}

.sidebar.collapsed .sidebar-nav {
    padding: 10px 8px 0
}

.sidebar.collapsed .nav-sub-list {
    display: none
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    height: var(--topbar-h);
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    flex-shrink: 0;
    transition: padding .25s;
    overflow: hidden
}

.logo-text {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -.4px;
    white-space: nowrap
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 10px 10px 0;
    scrollbar-width: none
}

.sidebar-nav::-webkit-scrollbar {
    display: none
}

.sidebar-section {
    padding-top: 8px;
    margin-bottom: 2px
}

.sidebar-section-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.6px;
    color: var(--text-3);
    padding: 0 8px;
    margin-bottom: 4px;
    white-space: nowrap
}

.nav-group {
    margin-bottom: 1px
}

.nav-group-trigger {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-2);
    cursor: pointer;
    border: 1px solid transparent;
    white-space: nowrap;
    overflow: hidden;
    width: 100%;
    background: none;
    font-family: inherit;
    text-align: left;
    transition: all .14s
}

.nav-group-trigger:hover {
    background: var(--bg);
    color: var(--text)
}

.nav-group-trigger.active-group {
    background: var(--accent-light);
    color: var(--accent);
    border-color: var(--accent-border);
    font-weight: 600
}

.group-icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    color: var(--text-3)
}

.nav-group-label {
    flex: 1
}

.group-chevron {
    width: 13px;
    height: 13px;
    color: var(--text-3);
    transition: transform .2s;
    margin-left: auto
}

.nav-group.open .group-chevron {
    transform: rotate(90deg)
}

.nav-sub-list {
    overflow: hidden;
    max-height: 0;
    transition: max-height .26s cubic-bezier(.4, 0, .2, 1), opacity .2s;
    opacity: 0;
    margin-top: 1px
}

.nav-group.open .nav-sub-list {
    opacity: 1
}

.nav-sub {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px 7px 34px;
    border-radius: var(--radius);
    font-size: 12.5px;
    color: var(--text-3);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: all .12s;
    position: relative
}

.nav-sub::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--border-2)
}

.nav-sub:hover {
    background: var(--bg);
    color: var(--text-2)
}

.nav-sub.active {
    color: var(--accent);
    font-weight: 600;
    background: var(--accent-light)
}

.nav-sub.active::before {
    background: var(--accent)
}

.sidebar-toggle {
    position: absolute;
    top: 50%;
    right: -12px;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 50%;
    display: grid;
    place-items: center;
    cursor: pointer;
    z-index: 60;
    box-shadow: var(--shadow-sm)
}

.sidebar-toggle:hover {
    background: var(--accent);
    border-color: var(--accent)
}

.sidebar-toggle:hover svg {
    color: #fff
}

.sidebar-toggle svg {
    width: 12px;
    height: 12px;
    color: var(--text-2);
    transition: transform .25s, color .2s
}

.sidebar.collapsed .sidebar-toggle svg {
    transform: rotate(180deg)
}

.sidebar-footer {
    padding: 12px 10px;
    border-top: 1px solid var(--border);
    flex-shrink: 0
}

.workspace-card {
    display: flex;
    align-items: center;
    gap: 9px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 9px 11px;
    cursor: pointer;
    overflow: hidden
}

.ws-avi {
    width: 28px;
    height: 28px;
    background: var(--accent);
    border-radius: 7px;
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0
}

.ws-info {
    flex: 1;
    min-width: 0
}

.ws-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text)
}

.ws-plan {
    font-size: 11px;
    color: var(--text-3)
}

.nav-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 100px;
    white-space: nowrap;
    flex-shrink: 0
}

.nav-badge.blue {
    background: var(--accent-light);
    border: 1px solid var(--accent-border);
    color: var(--accent)
}

.nav-badge.green {
    background: var(--green-bg);
    border: 1px solid var(--green-border);
    color: var(--green)
}

.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 17, 23, .4);
    backdrop-filter: blur(3px);
    z-index: 40;
    opacity: 0;
    transition: opacity .25s
}

.overlay.show {
    display: block;
    opacity: 1
}

/* ── MAIN ── */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden
}

/* ── TOPBAR ── */
.topbar {
    height: var(--topbar-h);
    flex-shrink: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--content-pad);
    position: sticky;
    top: 0;
    z-index: 30;
    gap: 12px
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0
}

.mobile-menu-btn {
    display: none;
    width: 34px;
    height: 34px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    place-items: center;
    cursor: pointer;
    color: var(--text-2);
    flex-shrink: 0
}

.mobile-menu-btn svg {
    width: 16px;
    height: 16px
}

.page-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text)
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-3);
    margin-top: 1px
}

.breadcrumb a {
    color: var(--text-3);
    text-decoration: none
}

.breadcrumb a:hover {
    color: var(--accent)
}

.breadcrumb .active {
    color: var(--text-2)
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0
}

.tb-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 500;
    padding: 6px 13px;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all .14s;
    white-space: nowrap
}

.tb-btn svg {
    width: 13px;
    height: 13px
}

.tb-btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-2)
}

.tb-btn-ghost:hover {
    background: var(--bg);
    color: var(--text)
}

.tb-btn-primary {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(26, 86, 219, .3)
}

.tb-btn-primary:hover {
    background: var(--accent-hover)
}

.icon-btn {
    width: 34px;
    height: 34px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: grid;
    place-items: center;
    cursor: pointer;
    color: var(--text-2);
    position: relative;
    flex-shrink: 0
}

.icon-btn:hover {
    background: var(--bg)
}

.icon-btn svg {
    width: 15px;
    height: 15px
}

.notif-ring {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 7px;
    height: 7px;
    background: var(--accent);
    border-radius: 50%;
    border: 2px solid var(--white)
}

.user-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px;
    border-radius: 100px;
    border: 1px solid var(--border);
    cursor: pointer;
    background: var(--white)
}

.user-avi {
    width: 26px;
    height: 26px;
    background: var(--accent);
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 10px;
    font-weight: 700;
    color: #fff
}

.user-name {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text)
}

/* ── BUILDER LAYOUT ── */
.builder-wrap {
    flex: 1;
    display: flex;
    overflow: hidden;
    min-height: 0
}

/* ── PALETTE ── */
.palette {
    width: 228px;
    flex-shrink: 0;
    background: var(--white);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden
}

.palette-top {
    padding: 12px 13px 10px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0
}

.palette-heading {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.6px;
    color: var(--text-3);
    margin-bottom: 8px
}

.palette-search {
    display: flex;
    align-items: center;
    gap: 7px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px 10px
}

.palette-search:focus-within {
    border-color: var(--accent)
}

.palette-search svg {
    width: 12px;
    height: 12px;
    color: var(--text-3);
    flex-shrink: 0
}

.palette-search input {
    border: none;
    background: none;
    font-family: inherit;
    font-size: 12px;
    color: var(--text);
    outline: none;
    flex: 1
}

.palette-search input::placeholder {
    color: var(--text-3)
}

.palette-body {
    flex: 1;
    overflow-y: auto;
    padding: 6px 8px 16px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent
}

.palette-group-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: var(--text-3);
    padding: 10px 6px 5px
}

.fi {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 9px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--white);
    margin-bottom: 3px;
    cursor: grab;
    user-select: none;
    position: relative;
    transition: all .15s
}

.fi:active {
    cursor: grabbing
}

.fi:hover {
    border-color: var(--accent-border);
    background: var(--accent-light)
}

.fi.drag-active {
    opacity: .45;
    transform: scale(.96)
}

.fi-icon {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: grid;
    place-items: center;
    flex-shrink: 0
}

.fi-icon svg {
    width: 12px;
    height: 12px
}

.fi-icon.blue {
    background: var(--accent-light);
    color: var(--accent)
}

.fi-icon.green {
    background: var(--green-bg);
    color: var(--green)
}

.fi-icon.amber {
    background: var(--amber-bg);
    color: var(--amber)
}

.fi-icon.slate {
    background: var(--surface-2);
    color: var(--text-2)
}

.fi-icon.purple {
    background: var(--purple-bg);
    color: var(--purple)
}

.fi-icon.red {
    background: var(--red-bg);
    color: var(--red)
}

.fi-text {
    flex: 1;
    min-width: 0
}

.fi-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.fi-desc {
    font-size: 10.5px;
    color: var(--text-3)
}

/* ── CANVAS ── */
.canvas-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    background: var(--bg)
}

/* Step bar */
.step-bar {
    height: 42px;
    flex-shrink: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
    position: relative
}

.step-bar::-webkit-scrollbar {
    display: none
}

.step-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    height: 42px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-3);
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all .14s;
    white-space: nowrap;
    flex-shrink: 0;
    position: relative
}

.step-btn:hover {
    color: var(--text-2)
}

.step-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 600
}

.step-num {
    width: 19px;
    height: 19px;
    border-radius: 50%;
    border: 1.5px solid var(--border-2);
    display: grid;
    place-items: center;
    font-size: 9.5px;
    font-weight: 700;
    color: var(--text-3);
    transition: all .14s
}

.step-btn.active .step-num {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff
}

.step-btn.done .step-num {
    background: var(--green-bg);
    border-color: var(--green-border);
    color: var(--green)
}

.step-arrow {
    font-size: 10px;
    color: var(--border-2);
    padding: 0 2px;
    flex-shrink: 0
}

.step-del {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    display: grid;
    place-items: center;
    color: var(--text-3);
    opacity: 0;
    transition: opacity .14s, background .14s;
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    margin-top: -1px
}

.step-btn:hover .step-del {
    opacity: 1
}

.step-del:hover {
    background: var(--red-bg);
    color: var(--red)
}

.step-del svg {
    width: 8px;
    height: 8px
}

.add-step-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-3);
    background: transparent;
    border: none;
    border-left: 1px solid var(--border);
    cursor: pointer;
    font-family: inherit;
    padding: 0 12px;
    height: 42px;
    flex-shrink: 0;
    margin-left: 8px
}

.add-step-btn:hover {
    color: var(--accent)
}

.add-step-btn svg {
    width: 11px;
    height: 11px
}

/* Canvas toolbar */
.canvas-toolbar {
    height: 42px;
    flex-shrink: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px
}

.ct-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-3);
    flex-shrink: 0
}

.ct-group {
    display: flex;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden
}

.ct-btn {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-3);
    transition: all .14s;
    flex-shrink: 0
}

.ct-btn:hover {
    background: var(--bg);
    color: var(--text-2)
}

.ct-btn.active {
    background: var(--accent-light);
    color: var(--accent)
}

.ct-btn svg {
    width: 13px;
    height: 13px
}

.ct-sep {
    width: 1px;
    height: 18px;
    background: var(--border);
    flex-shrink: 0
}

.ct-zoom-val {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-2);
    padding: 0 8px;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    height: 28px;
    display: flex;
    align-items: center;
    min-width: 44px;
    justify-content: center
}

.toolbar-fill {
    flex: 1
}

.ct-small {
    font-size: 11px;
    color: var(--text-3);
    display: flex;
    align-items: center;
    gap: 5px
}

.ct-small svg {
    width: 11px;
    height: 11px
}

/* Canvas scroll */
.canvas-scroll {
    flex: 1;
    overflow: auto;
    padding: 20px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent
}

.canvas-scroll::-webkit-scrollbar {
    width: 5px;
    height: 5px
}

.canvas-scroll::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px
}

.canvas-inner {
    max-width: 680px;
    margin: 0 auto
}

/* Form header */
.form-header-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    margin-bottom: 10px;
    position: relative;
    overflow: hidden
}

.form-bg-preview {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: .18;
    pointer-events: none;
    border-radius: var(--radius-lg)
}

.form-title-in {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    font-family: inherit;
    letter-spacing: -.3px;
    position: relative;
    z-index: 1
}

.form-title-in::placeholder {
    color: var(--text-3)
}

.form-desc-in {
    font-size: 13px;
    color: var(--text-2);
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    font-family: inherit;
    resize: none;
    line-height: 1.6;
    margin-top: 5px;
    overflow: hidden;
    position: relative;
    z-index: 1
}

.form-desc-in::placeholder {
    color: var(--text-3)
}

.fhc-divider {
    height: 1px;
    background: var(--border);
    margin: 12px 0;
    position: relative;
    z-index: 1
}

.fhc-chips {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1
}

.fhc-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-3);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 3px 9px;
    cursor: pointer;
    transition: all .14s;
    position: relative
}

.fhc-chip:hover {
    border-color: var(--accent-border);
    color: var(--accent);
    background: var(--accent-light)
}

.fhc-chip svg {
    width: 9px;
    height: 9px
}

.tag-del {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    color: inherit;
    margin-left: 2px;
    font-size: 10px;
    padding: 0;
    line-height: 1
}

.tag-del:hover {
    background: var(--red-bg);
    color: var(--red)
}

/* Drop zone */
.drop-zone {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    min-height: 400px;
    padding: 6px;
    position: relative;
    transition: border-color .2s, background .2s
}

.drop-zone.dz-over {
    border-color: var(--accent);
    border-style: dashed;
    background: rgba(26, 86, 219, .03)
}

.dz-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 56px 20px;
    text-align: center;
    pointer-events: none
}

.dz-empty.hidden {
    display: none
}

.dz-empty-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--surface-2);
    border: 2px dashed var(--border-2);
    display: grid;
    place-items: center;
    margin-bottom: 12px
}

.dz-empty-icon svg {
    width: 20px;
    height: 20px;
    color: var(--text-3)
}

.dz-empty-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 4px
}

.dz-empty-sub {
    font-size: 11.5px;
    color: var(--text-3);
    line-height: 1.6;
    max-width: 260px
}

.drop-line {
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
    margin: 1px 6px;
    opacity: 0;
    transition: opacity .12s;
    pointer-events: none;
    position: relative
}

.drop-line::before {
    content: '';
    position: absolute;
    left: -4px;
    top: -3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent)
}

.drop-line.show {
    opacity: 1
}

/* Field row */
.fr {
    position: relative;
    margin: 1px 0;
    border-radius: var(--radius-md)
}

.fr.selected .fr-inner {
    border-color: var(--accent);
    border-width: 2px;
    box-shadow: 0 0 0 3px var(--accent-light)
}

.fr.fr-ghost {
    opacity: .35;
    pointer-events: none
}

.fr-inner {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 14px 11px;
    position: relative;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s
}

.fr:hover:not(.selected) .fr-inner {
    border-color: var(--border-2)
}

.fr-handle {
    position: absolute;
    left: -4px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    color: var(--text-3);
    opacity: 0;
    transition: opacity .14s;
    border-radius: 5px;
    z-index: 2
}

.fr:hover .fr-handle,
.fr.selected .fr-handle {
    opacity: 1
}

.fr-handle:hover {
    background: var(--surface-2)
}

.fr-handle svg {
    width: 10px;
    height: 10px
}

.fr-actions {
    position: absolute;
    right: 8px;
    top: 8px;
    display: flex;
    gap: 3px;
    opacity: 0;
    transition: opacity .14s;
    z-index: 2
}

.fr:hover .fr-actions,
.fr.selected .fr-actions {
    opacity: 1
}

.fr-act {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 5px;
    border: 1px solid var(--border);
    background: var(--white);
    cursor: pointer;
    color: var(--text-3);
    transition: all .12s
}

.fr-act:hover {
    background: var(--bg);
    color: var(--text-2)
}

.fr-act.del:hover {
    background: var(--red-bg);
    color: var(--red);
    border-color: var(--red-border)
}

.fr-act svg {
    width: 11px;
    height: 11px
}

.fr-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding-right: 70px
}

.fr-field-id {
    font-size: 9.5px;
    font-weight: 500;
    color: var(--text-3);
    font-family: 'DM Mono', monospace;
    background: var(--surface-2);
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 4px;
    cursor: default;
    border: 1px solid var(--border)
}

.fr-req {
    color: var(--red);
    font-size: 14px;
    line-height: 1
}

.fr-hint {
    font-size: 11px;
    color: var(--text-3);
    margin-top: 4px
}

/* Field previews */
.pv-input {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 12.5px;
    color: var(--text-3);
    background: var(--bg);
    outline: none;
    pointer-events: none
}

.pv-textarea {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 12.5px;
    color: var(--text-3);
    background: var(--bg);
    resize: none;
    height: 68px;
    outline: none;
    pointer-events: none
}

.pv-select {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 12.5px;
    color: var(--text-3);
    background: var(--bg);
    outline: none;
    pointer-events: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239BA1B0' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center
}

.pv-check-list,
.pv-radio-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    pointer-events: none
}

.pv-check-item,
.pv-radio-item {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    color: var(--text-3)
}

.pv-check-item input,
.pv-radio-item input {
    width: 13px;
    height: 13px;
    flex-shrink: 0
}

.pv-toggle-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: none
}

.pv-track {
    width: 34px;
    height: 19px;
    background: var(--border);
    border-radius: 9.5px;
    position: relative;
    flex-shrink: 0
}

.pv-track.on {
    background: var(--accent)
}

.pv-knob {
    width: 15px;
    height: 15px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
    transition: left .2s
}

.pv-track.on .pv-knob {
    left: 17px
}

.pv-rating {
    display: flex;
    gap: 3px;
    pointer-events: none
}

.pv-star svg {
    width: 16px;
    height: 16px;
    color: var(--amber)
}

.pv-star.empty svg {
    color: var(--border-2)
}

.pv-upload {
    border: 2px dashed var(--border-2);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    pointer-events: none;
    text-align: center
}

.pv-upload svg {
    width: 18px;
    height: 18px;
    color: var(--text-3)
}

.pv-upload-txt {
    font-size: 11.5px;
    color: var(--text-3);
    line-height: 1.5
}

.pv-sig {
    border: 2px dashed var(--red-border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    pointer-events: none;
    background: rgba(185, 28, 28, .02)
}

.pv-sig svg {
    width: 18px;
    height: 18px;
    color: var(--red)
}

.pv-sig-txt {
    font-size: 11.5px;
    color: var(--text-3)
}

.pv-heading-block {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 12px 14px;
    pointer-events: none
}

.pv-heading-text {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3
}

.pv-heading-sub {
    font-size: 12.5px;
    color: var(--text-2);
    margin-top: 3px;
    line-height: 1.5
}

.pv-divider-line {
    height: 1px;
    background: var(--border);
    width: 100%;
    pointer-events: none
}

.pv-paragraph {
    font-size: 12.5px;
    color: var(--text-2);
    line-height: 1.65;
    pointer-events: none
}

/* Status bar */
.status-bar {
    height: 28px;
    flex-shrink: 0;
    background: var(--white);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 14px;
    gap: 12px
}

.sb-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10.5px;
    color: var(--text-3);
    white-space: nowrap
}

.sb-item svg {
    width: 10px;
    height: 10px
}

.sb-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    flex-shrink: 0;
    animation: pulse 2s ease infinite
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: .5
    }
}

.sb-sep {
    width: 1px;
    height: 12px;
    background: var(--border);
    flex-shrink: 0
}

.sb-fill {
    flex: 1
}

/* ── PROPERTIES PANEL ── */
.props {
    width: 268px;
    flex-shrink: 0;
    background: var(--white);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden
}

.props-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0
}

.p-tab {
    flex: 1;
    padding: 10px 4px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-3);
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all .14s
}

.p-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 600
}

.p-tab:hover:not(.active) {
    color: var(--text-2)
}

.props-content {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent
}

.props-content::-webkit-scrollbar {
    width: 3px
}

.props-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px
}

.p-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 36px 20px;
    text-align: center;
    height: 100%
}

.p-empty-icon {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background: var(--surface-2);
    border: 1px dashed var(--border-2);
    display: grid;
    place-items: center;
    margin-bottom: 10px
}

.p-empty-icon svg {
    width: 15px;
    height: 15px;
    color: var(--text-3)
}

.p-empty-title {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 3px
}

.p-empty-sub {
    font-size: 11.5px;
    color: var(--text-3);
    line-height: 1.5
}

.p-section {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border)
}

.p-sec-title {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.3px;
    color: var(--text-3);
    margin-bottom: 10px
}

.p-row {
    margin-bottom: 10px
}

.p-row:last-child {
    margin-bottom: 0
}

.p-lbl {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 4px;
    display: block
}

.p-input {
    width: 100%;
    padding: 6px 9px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 12px;
    color: var(--text);
    background: var(--white);
    outline: none;
    transition: border-color .14s
}

.p-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light)
}

.p-input.mono {
    font-family: 'DM Mono', monospace;
    font-size: 11.5px
}

.p-textarea {
    width: 100%;
    padding: 6px 9px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 12px;
    color: var(--text);
    background: var(--white);
    outline: none;
    resize: none;
    height: 58px;
    transition: border-color .14s
}

.p-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light)
}

.p-select {
    width: 100%;
    padding: 6px 9px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 12px;
    color: var(--text);
    background: var(--white);
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239BA1B0' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 9px center;
    transition: border-color .14s
}

.p-select:focus {
    border-color: var(--accent)
}

.p-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between
}

.p-toggle {
    width: 30px;
    height: 17px;
    background: var(--border);
    border-radius: 8.5px;
    position: relative;
    cursor: pointer;
    transition: background .2s;
    flex-shrink: 0
}

.p-toggle.on {
    background: var(--accent)
}

.p-toggle-k {
    width: 13px;
    height: 13px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: left .2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .2)
}

.p-toggle.on .p-toggle-k {
    left: 15px
}

.p-opts-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 7px
}

.p-opt-row {
    display: flex;
    align-items: center;
    gap: 5px
}

.p-opt-in {
    flex: 1;
    padding: 5px 7px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 11.5px;
    color: var(--text);
    background: var(--white);
    outline: none
}

.p-opt-in:focus {
    border-color: var(--accent)
}

.p-opt-del {
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    border-radius: 4px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    color: var(--text-3)
}

.p-opt-del:hover {
    background: var(--red-bg);
    color: var(--red);
    border-color: var(--red-border)
}

.p-opt-del svg {
    width: 10px;
    height: 10px
}

.p-add-opt {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--accent);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    font-family: inherit
}

.p-add-opt:hover {
    opacity: .7
}

.p-add-opt svg {
    width: 10px;
    height: 10px
}

.vtags {
    display: flex;
    flex-wrap: wrap;
    gap: 3px
}

.vtag {
    font-size: 10.5px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 100px;
    border: 1px solid var(--border);
    color: var(--text-3);
    background: var(--surface-2);
    cursor: pointer;
    user-select: none
}

.vtag:hover {
    border-color: var(--accent-border);
    color: var(--accent);
    background: var(--accent-light)
}

.vtag.on {
    border-color: var(--accent-border);
    color: var(--accent);
    background: var(--accent-light)
}

.cond-block {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px;
    margin-top: 7px
}

.cond-row {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    margin-bottom: 5px
}

.cond-lbl {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--text-3);
    white-space: nowrap;
    flex-shrink: 0
}

.cond-sel {
    padding: 4px 6px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-family: inherit;
    font-size: 10.5px;
    color: var(--text-2);
    background: var(--white);
    outline: none;
    flex: 1;
    min-width: 50px
}

.p-add-cond {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 500;
    color: var(--accent);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px 0 0;
    font-family: inherit
}

.p-add-cond svg {
    width: 9px;
    height: 9px
}

/* ── FIELD ID ROW ── */
.id-row {
    display: flex;
    align-items: center;
    gap: 5px
}

.id-row .p-input {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    flex: 1
}

.id-clean-btn {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 500;
    color: var(--accent);
    background: var(--accent-light);
    border: 1px solid var(--accent-border);
    border-radius: var(--radius);
    padding: 5px 8px;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    flex-shrink: 0
}

.id-clean-btn:hover {
    background: var(--accent);
    color: #fff
}

.id-clean-btn svg {
    width: 10px;
    height: 10px
}

.id-clean-all {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-light);
    border: 1px solid var(--accent-border);
    border-radius: var(--radius);
    padding: 5px 10px;
    cursor: pointer;
    font-family: inherit;
    width: 100%
}

.id-clean-all:hover {
    background: var(--accent);
    color: #fff
}

.id-clean-all svg {
    width: 11px;
    height: 11px
}

/* ── STYLE PANEL ── */
.color-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    margin-bottom: 8px
}

.color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 5px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform .12s
}

.color-swatch:hover {
    transform: scale(1.15)
}

.color-swatch.active {
    border-color: var(--text)
}

.font-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px
}

.font-opt {
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 11px;
    cursor: pointer;
    text-align: center;
    transition: all .12s
}

.font-opt:hover {
    border-color: var(--accent-border);
    color: var(--accent);
    background: var(--accent-light)
}

.font-opt.active {
    border-color: var(--accent);
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 600
}

.bg-upload-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-2);
    background: var(--bg);
    border: 1.5px dashed var(--border-2);
    border-radius: var(--radius);
    padding: 9px 12px;
    cursor: pointer;
    width: 100%;
    font-family: inherit;
    transition: border-color .14s
}

.bg-upload-btn:hover {
    border-color: var(--accent);
    color: var(--accent)
}

.bg-upload-btn svg {
    width: 14px;
    height: 14px
}

.bg-preview {
    width: 100%;
    height: 64px;
    border-radius: var(--radius);
    object-fit: cover;
    border: 1px solid var(--border);
    margin-bottom: 6px;
    display: none
}

.btn-remove-bg {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--red);
    background: var(--red-bg);
    border: 1px solid var(--red-border);
    border-radius: var(--radius);
    padding: 5px 10px;
    cursor: pointer;
    font-family: inherit;
    width: 100%;
    justify-content: center;
    margin-top: 5px
}

/* ── ANIMATIONS ── */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(8px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

@keyframes fieldIn {
    from {
        opacity: 0;
        transform: translateY(-4px) scale(.985)
    }

    to {
        opacity: 1;
        transform: none
    }
}

.fr {
    animation: fieldIn .18s cubic-bezier(.34, 1.4, .64, 1) both
}

.form-header-card {
    animation: fadeUp .3s ease both
}

.drop-zone {
    animation: fadeUp .3s .06s ease both
}

/* Drag ghost */
.drag-ghost {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    background: var(--white);
    border: 1.5px solid var(--accent-border);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    box-shadow: var(--shadow-lg);
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 7px;
    opacity: .92;
    transform: rotate(1.5deg);
    max-width: 200px
}

.drag-ghost-icon {
    width: 22px;
    height: 22px;
    border-radius: 5px;
    background: var(--accent-light);
    color: var(--accent);
    display: grid;
    place-items: center;
    flex-shrink: 0
}

.drag-ghost-icon svg {
    width: 11px;
    height: 11px
}

/* ── TEMPLATE MODAL ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 17, 23, .5);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center
}

.modal-overlay.show {
    display: flex
}

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    width: min(780px, 95vw);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: fadeUp .2s ease
}

.modal-head {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between
}

.modal-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text)
}

.modal-close {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: transparent;
    cursor: pointer;
    color: var(--text-3)
}

.modal-close:hover {
    background: var(--bg)
}

.modal-close svg {
    width: 13px;
    height: 13px
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px 22px
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 12px
}

.template-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px;
    cursor: pointer;
    transition: all .15s;
    background: var(--white)
}

.template-card:hover {
    border-color: var(--accent-border);
    box-shadow: 0 4px 16px rgba(26, 86, 219, .12)
}

.template-card.active {
    border-color: var(--accent);
    border-width: 2px;
    background: var(--accent-light)
}

.tc-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    margin-bottom: 10px
}

.tc-icon svg {
    width: 16px;
    height: 16px
}

.tc-name {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px
}

.tc-desc {
    font-size: 11px;
    color: var(--text-3);
    line-height: 1.5
}

.tc-count {
    font-size: 10.5px;
    color: var(--text-3);
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 4px
}

.modal-foot {
    padding: 14px 22px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px
}

/* ── URL VIEW MODAL ── */
.url-box {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    font-family: 'DM Mono', monospace;
    font-size: 12.5px;
    color: var(--accent);
    word-break: break-all;
    margin-bottom: 12px
}

.url-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 500;
    padding: 7px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    cursor: pointer;
    background: var(--white);
    color: var(--text-2)
}

.url-btn:hover {
    background: var(--bg);
    border-color: var(--accent-border);
    color: var(--accent)
}

.url-btn svg {
    width: 13px;
    height: 13px
}

/* ── PREVIEW MODAL ── */
.preview-frame-wrap {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 20px;
    min-height: 300px;
    max-height: 60vh;
    overflow-y: auto
}

.preview-form {
    max-width: 560px;
    margin: 0 auto;
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow)
}

.preview-form-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px
}

.preview-form-desc {
    font-size: 13px;
    color: var(--text-2);
    margin-bottom: 20px;
    line-height: 1.6
}

.preview-field {
    margin-bottom: 16px
}

.preview-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 5px;
    display: block
}

.preview-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 13px;
    color: var(--text);
    background: var(--white);
    outline: none
}

.preview-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light)
}

.preview-submit {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    padding: 10px 22px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px
}

.preview-submit:hover {
    background: var(--accent-hover)
}

/* Tag input */
.tag-add-form {
    display: flex;
    gap: 5px;
    margin-top: 6px
}

.tag-add-input {
    flex: 1;
    padding: 4px 9px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 11.5px;
    color: var(--text);
    background: var(--white);
    outline: none
}

.tag-add-input:focus {
    border-color: var(--accent)
}

.tag-add-btn {
    padding: 4px 10px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer
}

@media(max-width:767px) {
    body {
        overflow: auto
    }

    .shell {
        overflow: visible;
        height: auto;
        min-height: 100vh
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 260px !important;
        transform: translateX(-100%);
        z-index: 50
    }

    .sidebar.mobile-open {
        transform: translateX(0)
    }

    .sidebar-toggle {
        display: none
    }

    .main {
        height: 100vh;
        overflow: auto
    }

    .mobile-menu-btn {
        display: grid
    }

    .builder-wrap {
        flex-direction: column;
        overflow: visible
    }

    .canvas-wrap {
        min-height: 500px
    }

    .palette {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
        max-height: 160px
    }

    .palette-body {
        display: flex;
        flex-wrap: nowrap;
        gap: 4px;
        padding: 6px 8px;
        overflow-x: auto
    }

    .palette-group-label {
        display: none
    }

    .fi {
        flex: 0 0 auto;
        width: 140px;
        margin-bottom: 0
    }

    .fi-desc {
        display: none
    }

    .props {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--border);
        max-height: 300px
    }

    .tb-btn-ghost {
        display: none
    }

    .user-name {
        display: none
    }
}

@media(prefers-reduced-motion:reduce) {

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important
    }
}