:root {
    --g29-ui-ink: #17243a;
    --g29-ui-muted: #6d7889;
    --g29-ui-line: rgba(23, 36, 58, 0.11);
    --g29-ui-panel: rgba(250, 251, 252, 0.97);
    --g29-ui-soft: #f1f4f7;
    --g29-ui-accent: #a9485c;
    --g29-ui-accent-soft: rgba(169, 72, 92, 0.11);
    --g29-ui-danger: #a33d4e;
    --g29-ui-shadow: 0 32px 90px rgba(27, 42, 65, 0.2), 0 4px 14px rgba(27, 42, 65, 0.08);
}

.g29-module-dialog {
    font-family: "Avenir Next", Avenir, "Segoe UI Variable", "Segoe UI", sans-serif;
    color: var(--g29-ui-ink);
}

.g29-module-dialog-panel {
    width: min(940px, calc(100vw - 40px)) !important;
    max-height: min(860px, calc(100dvh - 40px)) !important;
    overflow: hidden !important;
    border: 1px solid rgba(255, 255, 255, 0.82) !important;
    border-radius: 28px !important;
    background:
        radial-gradient(circle at 12% -20%, rgba(169, 72, 92, 0.08), transparent 36%),
        var(--g29-ui-panel) !important;
    box-shadow: var(--g29-ui-shadow) !important;
    backdrop-filter: blur(28px) saturate(1.08) !important;
}

.g29-module-dialog-header,
.g29-module-dialog-footer {
    min-height: 72px !important;
    padding: 14px 18px !important;
    border-color: var(--g29-ui-line) !important;
    background: rgba(255, 255, 255, 0.66) !important;
}

.g29-module-dialog-heading {
    gap: 12px !important;
}

.g29-module-dialog-icon,
.g29-component-settings-mark {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 13px;
    color: var(--g29-ui-accent);
    background: var(--g29-ui-accent-soft);
}

.g29-module-dialog-icon svg,
.g29-component-settings-mark svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.g29-module-dialog-heading strong {
    font-size: 16px !important;
    font-weight: 650 !important;
    letter-spacing: -0.025em !important;
}

.g29-module-dialog-heading > div > span,
.g29-component-settings header small,
.g29-module-repeater-card header span {
    color: var(--g29-ui-muted) !important;
    font-size: 11px !important;
    font-weight: 520 !important;
    letter-spacing: 0.01em !important;
}

.g29-module-dialog-body {
    overflow: auto !important;
    padding: 18px !important;
    scrollbar-width: thin;
    scrollbar-color: rgba(23, 36, 58, 0.18) transparent;
}

.g29-module-editor {
    display: grid !important;
    gap: 14px !important;
}

.g29-component-settings,
.g29-module-repeater-card,
.g29-slider-builder {
    overflow: hidden;
    border: 1px solid var(--g29-ui-line) !important;
    border-radius: 20px !important;
    background: rgba(255, 255, 255, 0.72) !important;
    box-shadow: 0 8px 24px rgba(27, 42, 65, 0.045) !important;
}

.g29-component-settings > header,
.g29-module-repeater-card > header,
.g29-slider-builder > header {
    min-height: 60px;
    padding: 12px 14px !important;
    border-bottom: 1px solid var(--g29-ui-line) !important;
    background: rgba(247, 249, 251, 0.72) !important;
}

.g29-component-settings > header > div,
.g29-component-settings > header span {
    display: flex;
    align-items: center;
}

.g29-component-settings > header > div {
    gap: 10px;
}

.g29-component-settings > header span:last-child {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
}

.g29-component-settings > header strong,
.g29-module-repeater-card h3,
.g29-slider-builder h3 {
    margin: 0 !important;
    color: var(--g29-ui-ink) !important;
    font-size: 13px !important;
    font-weight: 650 !important;
    letter-spacing: -0.01em !important;
}

.g29-component-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    background: var(--g29-ui-line);
}

.g29-component-setting {
    position: relative;
    display: grid;
    min-height: 72px;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    margin: 0 !important;
    padding: 12px 14px;
    color: var(--g29-ui-ink) !important;
    background: rgba(255, 255, 255, 0.92);
    cursor: default;
    transition: background 180ms ease, box-shadow 180ms ease;
}

.g29-component-setting:focus-within,
.g29-component-setting:hover {
    z-index: 1;
    background: #fff;
    box-shadow: inset 0 0 0 1px rgba(169, 72, 92, 0.16);
}

.g29-component-setting-icon {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 10px;
    color: var(--g29-ui-accent);
    background: var(--g29-ui-accent-soft);
}

.g29-component-setting-icon svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.g29-component-setting > span:nth-child(2) {
    display: grid;
    min-width: 0;
    gap: 5px;
}

.g29-component-setting strong {
    color: var(--g29-ui-ink) !important;
    font-size: 11px !important;
    font-weight: 620 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
}

.g29-component-setting select,
.g29-component-setting input:not([type="checkbox"]) {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    height: 32px;
    margin: 0 !important;
    padding: 0 9px;
    border: 1px solid var(--g29-ui-line) !important;
    border-radius: 9px !important;
    outline: none;
    color: var(--g29-ui-ink) !important;
    background: var(--g29-ui-soft) !important;
    box-shadow: none !important;
    font: 550 11px/1 "Avenir Next", Avenir, "Segoe UI", sans-serif !important;
    transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.g29-component-setting select:focus,
.g29-component-setting input:not([type="checkbox"]):focus {
    border-color: rgba(169, 72, 92, 0.45) !important;
    background: #fff !important;
    box-shadow: 0 0 0 3px rgba(169, 72, 92, 0.1) !important;
}

.g29-component-input {
    position: relative;
    display: block;
}

.g29-component-input > small {
    position: absolute;
    top: 50%;
    right: 9px;
    color: var(--g29-ui-muted);
    font-size: 9px;
    transform: translateY(-50%);
    pointer-events: none;
}

.g29-component-toggle {
    grid-template-columns: 34px minmax(0, 1fr) 36px;
    cursor: pointer;
}

.g29-component-toggle > span:nth-child(2) small {
    color: var(--g29-ui-muted);
    font-size: 10px;
}

.g29-component-toggle input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.g29-component-toggle i {
    position: relative;
    width: 34px;
    height: 20px;
    border-radius: 7px;
    background: #dce1e7;
    transition: background 180ms ease;
}

.g29-component-toggle i::after {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    border-radius: 5px;
    background: #fff;
    box-shadow: 0 2px 6px rgba(23, 36, 58, 0.2);
    content: "";
    transition: transform 180ms cubic-bezier(.2, .8, .2, 1);
}

.g29-component-toggle input:checked + i {
    background: var(--g29-ui-accent);
}

.g29-component-toggle input:checked + i::after {
    transform: translateX(14px);
}

.g29-component-toggle input:focus-visible + i {
    box-shadow: 0 0 0 3px rgba(169, 72, 92, 0.18);
}

.g29-module-action-grid {
    gap: 8px !important;
    padding: 12px !important;
}

.g29-module-action,
.g29-slider-card-actions button,
.g29-slider-edit,
.g29-slider-add {
    min-height: 46px !important;
    border: 1px solid transparent !important;
    border-radius: 12px !important;
    color: var(--g29-ui-ink) !important;
    background: var(--g29-ui-soft) !important;
    box-shadow: none !important;
    font-size: 10px !important;
    font-weight: 620 !important;
    transition: transform 160ms ease, background 160ms ease, border-color 160ms ease !important;
}

.g29-module-action:hover,
.g29-slider-card-actions button:hover,
.g29-slider-edit:hover,
.g29-slider-add:hover {
    border-color: rgba(169, 72, 92, 0.18) !important;
    background: #fff !important;
    transform: translateY(-1px);
}

.g29-module-action:active,
.g29-slider-card-actions button:active,
.g29-slider-edit:active,
.g29-slider-add:active {
    transform: translateY(0) scale(0.98);
}

.g29-module-action[data-tone="danger"] {
    color: var(--g29-ui-danger) !important;
    background: rgba(163, 61, 78, 0.08) !important;
}

.g29-module-action-icon svg,
.g29-module-action > svg,
.g29-slider-card-actions svg,
.g29-slider-edit svg,
.g29-slider-add svg {
    width: 17px !important;
    height: 17px !important;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.g29-module-item-strip {
    padding: 12px !important;
    gap: 8px !important;
    background: rgba(247, 249, 251, 0.6) !important;
}

.g29-module-item {
    border: 1px solid transparent !important;
    border-radius: 13px !important;
    background: transparent !important;
    transition: background 160ms ease, border-color 160ms ease, transform 160ms ease !important;
}

.g29-module-item:hover,
.g29-module-item[aria-pressed="true"] {
    border-color: rgba(169, 72, 92, 0.18) !important;
    background: #fff !important;
    transform: translateY(-1px);
}

.g29-module-item-preview {
    overflow: hidden;
    border-radius: 10px !important;
    background: var(--g29-ui-soft) !important;
}

.g29-module-dialog-close,
.g29-module-dialog-done {
    border-radius: 11px !important;
    font-weight: 620 !important;
}

[data-g29-component][data-g29-columns="2"],
[data-g29-component][data-g29-columns="3"],
[data-g29-component][data-g29-columns="4"],
[data-g29-component][data-g29-columns="5"],
[data-g29-component][data-g29-columns="6"] {
    grid-template-columns: repeat(var(--g29-component-columns), minmax(0, 1fr)) !important;
}

[data-g29-component="navigation"][data-g29-sticky="true"] {
    position: sticky !important;
    top: var(--wp-admin--admin-bar--height, 0px);
    z-index: 40;
}

[data-g29-component][data-g29-transition="fade"] [aria-hidden="true"] {
    opacity: 0;
}

[data-g29-component][data-g29-transition="fade"] [aria-hidden="false"] {
    opacity: 1;
    transition: opacity 360ms ease;
}

[data-g29-component][data-g29-transition="none"] [aria-hidden] {
    transition: none !important;
}

[data-g29-component="gallery"][data-g29-captions="always"] figcaption {
    opacity: 1 !important;
    visibility: visible !important;
}

[data-g29-component="gallery"][data-g29-captions="hidden"] figcaption {
    display: none !important;
}

html.g29-lightbox-open {
    overflow: hidden;
}

@media (max-width: 720px) {
    .g29-module-dialog-panel {
        width: calc(100vw - 20px) !important;
        max-height: calc(100dvh - 20px) !important;
        border-radius: 22px !important;
    }

    .g29-component-settings-grid {
        grid-template-columns: 1fr;
    }

    [data-g29-component][data-g29-columns] {
        grid-template-columns: 1fr !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .g29-module-dialog *,
    [data-g29-component] * {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
