:root {
    --accent: #6c63ff;
    --sidebar-bg: #111;
    --sidebar-text: #eee;
    --muted: #8a8a8a;
    --input-bg: #1c1c1c;
    --input-border: #2c2c2c;
    --radius: 8px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #555;
}

* {
    scrollbar-width: thin;
    scrollbar-color: #333 transparent;
}

/* LOADER */
.loader {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: #111111;
    transition:
        opacity 0.6s ease,
        visibility 0s linear 0.6s;
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-mark {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader-c {
    width: 46px;
    height: 46px;
    object-fit: contain;
}

.loader-bar {
    width: 80px;
    height: 3px;
    border-radius: 999px;
    background: #d0d0d8;
    overflow: hidden;
}

.loader-bar-fill {
    display: block;
    width: 40%;
    height: 100%;
    border-radius: 999px;
    background: var(--accent);
    animation: bar-slide 1.2s ease-in-out infinite;
}

/* mobile/tablet notice — hidden on fine-pointer (desktop) devices */
.loader-mobile-notice {
    display: none;
}

.loader-mobile-head {
    display: block;
    font-weight: 700;
    font-size: 16px;
    color: #fff;
    margin-bottom: 6px;
}

@media (hover: none), (pointer: coarse), (max-width: 768px) {
    /* mobile is desktop-only — hide the app and the spinner, keep the notice */
    html body .layout {
        display: none !important;
    }
    .loader-bar {
        display: none;
    }
    .loader-mobile-notice {
        display: block;
        margin: 0;
        font-size: 14px;
        color: #9a9aa5;
        letter-spacing: 0.3px;
        text-align: center;
        max-width: 280px;
        line-height: 1.5;
    }
    body.desktop-only .layout {
        display: none !important;
    }
}

@keyframes bar-slide {
    0% {
        transform: translateX(-110%);
    }
    100% {
        transform: translateX(350%);
    }
}

body {
    font-family: "Inter", sans-serif;
    background: #161616;
    color: #eee;
    min-height: 100vh;
}

.layout {
    display: flex;
    height: 100vh;
}

/* LEFT SIDEBAR — compact inspector */
.sidebar {
    width: 360px;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    padding: 18px 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px 16px;
    border-bottom: 1px solid var(--input-border);
}

.brand-badge {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.brand-badge img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-text h1 {
    font-family: "Nunito", sans-serif;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.brand-text p {
    font-size: 11px;
    color: var(--muted);
}

/* HOW TO USE — pill + popup */
.howto {
    position: relative;
    margin-top: 2px;
}

.brand .howto {
    margin-left: auto;
}

.howto-pill {
    display: inline-flex;
    align-items: center;
    background: transparent;
    border: 1px solid #6c63ff;
    color: #6c63ff;
    font-size: 11px;
    border-radius: 999px;
    padding: 3px 10px;
    cursor: pointer;
    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.howto-pill:hover,
.howto-pill[aria-expanded="true"] {
    background: #6c63ff;
    color: #fff;
}

.howto-popup {
    position: absolute;
    top: 0;
    left: calc(100% + 12px);
    z-index: 200;
    width: 260px;
    background: #1a1a1a;
    color: #eee;
    border-radius: 8px;
    padding: 14px 16px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-4px);
    transition:
        opacity 0.2s ease,
        transform 0.2s ease,
        visibility 0s linear 0.2s;
}

.howto-popup.open {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
}

.howto-caret {
    position: absolute;
    left: -6px;
    top: 12px;
    width: 12px;
    height: 12px;
    background: #1a1a1a;
    transform: rotate(45deg);
    border-radius: 2px;
}

.howto-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 8px;
}

.howto-steps {
    margin: 0;
    padding: 0;
    list-style: none;
}

.howto-steps li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
    line-height: 1.5;
    padding: 4px 0;
}

.howto-steps li span {
    flex-shrink: 0;
    font-weight: 700;
    color: #6c63ff;
}

.howto-note {
    margin: 10px 0 0;
    padding-top: 8px;
    border-top: 1px solid #333;
    font-size: 12px;
    color: #8a8a95;
}

/* scrollable control stack (brand stays pinned) */
.controls {
    flex: 1;
    overflow-y: auto;
    /* reserve the scrollbar gutter on BOTH sides so opening/closing Advanced
     never adds/removes a scrollbar and shifts the layout. content stays at
     the padded 20px edge; the gutter only ever reserves (or, on overlay-
     scrollbar platforms, reserves nothing) so all columns line up. */
    scrollbar-gutter: stable both-edges;
    padding: 0 10px;
    display: flex;
    flex-direction: column;
}

/* CONTROL SECTIONS */
.section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 15px 0;
    border-bottom: 1px solid #1d1d1f;
}

.section:last-child {
    border-bottom: none;
}

.section-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--muted);
    font-weight: 600;
}

/* ADVANCED: collapsible Typography + Composition */
.advanced {
    gap: 0;
}

.advanced-toggle {
    width: 100%;
    background: none;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    color: var(--muted);
    text-align: left;
}

.advanced-caret {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--muted);
    transition: transform 0.2s ease;
}

.advanced.open .advanced-caret {
    transform: rotate(180deg);
}

.advanced-panel {
    display: none;
    margin-top: 10px;
}

.advanced.open .advanced-panel {
    display: flex;
    flex-direction: column;
}

.section.sub {
    gap: 10px;
    padding: 12px 0 14px;
    border-bottom: 1px solid #1d1d1f;
}

.section.sub:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.field {
    width: 100%;
    height: 40px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: #eee;
    padding: 0 12px;
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease;
}

.field:focus {
    border-color: var(--accent);
}

/* inline number sizing row */
.control-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.num-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.range-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
}

.num-col label {
    font-size: 11px;
    color: #aaa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.range-val {
    font-size: 11px;
    color: var(--accent);
    font-weight: 600;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

/* select dropdowns */
.select-wrap {
    position: relative;
    width: 100%;
}

.select-wrap select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 34px;
    cursor: pointer;
}

.select-wrap select option {
    background: #1a1a1a;
    color: #eee;
}

.select-wrap::after {
    content: "";
    position: absolute;
    right: 14px;
    top: 50%;
    width: 9px;
    height: 9px;
    margin-top: -7px;
    border-right: 2px solid #888;
    border-bottom: 2px solid #888;
    transform: rotate(45deg);
    pointer-events: none;
}

/* SWATCH GRID — 2 colors per line */
.color-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.swatch-item {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    min-width: 0;
}

.swatch-name {
    font-size: 11px;
    font-weight: 500;
    color: #aaa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.swatch-item .clr-field {
    width: 100%;
    max-width: none;
}

/* CUSTOM CHECKBOX TICK */
.check-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
    color: #ccc;
    cursor: pointer;
    user-select: none;
}

.check-label input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkmark {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: 2px solid #555;
    border-radius: 5px;
    background: var(--input-bg);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.check-label:hover .checkmark {
    border-color: var(--accent);
}

.check-label input:checked + .checkmark {
    background: var(--accent);
    border-color: var(--accent);
}

.checkmark::after {
    content: "";
    position: absolute;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform 0.15s ease;
}

.check-label input:checked + .checkmark::after {
    transform: rotate(45deg) scale(1);
}

/* SEGMENTED CONTROLS (size / layout) */
.comp-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
}

.seg-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.seg-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #8a8a95;
}

.seg-group {
    display: flex;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    overflow: hidden;
    height: 34px;
}

.seg-group .pill {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    border-right: 1px solid var(--input-border);
    border-radius: 0;
    color: var(--muted);
    padding: 0 6px;
    font-size: 11px;
    font-family: inherit;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition:
        background 0.15s ease,
        color 0.15s ease;
}

.seg-group .pill:last-child {
    border-right: none;
}

.seg-group .pill:hover {
    color: #fff;
    background: #232323;
}

.seg-group .pill.active {
    background: var(--accent);
    color: #fff;
}

/* RANGES */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 4px;
    background: #333;
    outline: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: none;
}

input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: none;
}

.range-row {
    display: flex;
    justify-content: space-between;
}

.range-val {
    font-size: 12px;
    color: var(--muted);
}

/* FONT PICKER DROPDOWN */
.font-drop {
    position: relative;
    width: 100%;
}

.font-trigger {
    width: 100%;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius);
    padding: 0 14px;
    color: #eee;
    font-size: 15px;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.font-trigger span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.font-trigger:hover {
    border-color: var(--accent);
}

.font-trigger.open {
    border-color: var(--accent);
}

.font-caret {
    width: 10px;
    height: 10px;
    border-right: 2px solid #888;
    border-bottom: 2px solid #888;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    flex-shrink: 0;
    margin-top: -4px;
}

.font-trigger.open .font-caret {
    transform: rotate(-135deg);
    margin-top: 4px;
}

.font-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 30;
    background: #1a1a1a;
    border: 1px solid #2c2c2c;
    border-radius: var(--radius);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: none;
}

.font-panel.open {
    display: block;
}

.font-search {
    width: 100%;
    padding: 10px 14px;
    background: #141414;
    border: none;
    border-bottom: 1px solid #2c2c2c;
    color: #eee;
    font-size: 13px;
    font-family: inherit;
    outline: none;
}

.font-list {
    max-height: 240px;
    overflow-y: auto;
}

.font-opt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 0 14px;
    height: 42px;
    color: #ddd;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease;
    font-family: inherit;
    background: transparent;
    border: none;
    text-align: left;
}

.font-opt span {
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.font-opt:hover {
    background: #26203f;
    color: #fff;
}

.font-opt.selected {
    color: #fff;
    background: #1f1a3a;
}

.font-opt small {
    font-size: 10px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

/* CUSTOM TICK */
.tick {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    position: relative;
    flex-shrink: 0;
}

.tick::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 3px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* ICON PICKER */
.icon-search {
    margin-bottom: 0;
    padding-right: 32px;
}

.search-wrap {
    position: relative;
    margin-bottom: 0;
}

.search-clear {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    color: #9a9aa5;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.search-clear:hover {
    color: #fff;
    background: #2c2c38;
}

.search-clear svg {
    width: 10px;
    height: 10px;
    display: block;
}

.icon-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-auto-rows: 41px;
    gap: 6px;
    height: 135px; /* reserved space for 3 rows × 18 icons */
}

.icon-cell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    cursor: pointer;
    color: #ddd;
    transition:
        border-color 0.15s ease,
        background 0.15s ease,
        color 0.15s ease;
}

.icon-cell:hover {
    border-color: var(--accent);
    background: #1d1d20;
    color: #fff;
}

.icon-cell svg {
    width: 18px;
    height: 18px;
    display: block;
    transition: none;
}

.icon-cell.active {
    border: 2px solid var(--accent);
    background: #1a1834;
}

.icon-cell.active::after {
    content: "";
    position: absolute;
    top: 2px;
    right: 2px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--accent)
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E")
        center / 8px 8px no-repeat;
    z-index: 2;
}

.icon-cell.active::before {
    content: none;
}

/* icon-name tooltip on hover */
.icon-cell:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.icon-empty {
    font-size: 12px;
    color: var(--muted);
    text-align: center;
    grid-column: 1 / -1;
    padding: 16px 0;
}

/* DOWNLOAD */
.download-buttons {
    display: flex;
    gap: 12px;
    margin-top: 4px;
}

.btn {
    flex: 1;
    padding: 13px 16px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn svg {
    width: 16px;
    height: 16px;
}

/* ring loader shown while exporting */
.btn-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.35);
    border-bottom-color: var(--accent);
    border-radius: 50%;
    box-sizing: border-box;
    flex-shrink: 0;
    animation: btn-spin 0.8s linear infinite;
}

.btn.spinning .btn-spinner {
    display: inline-block;
}
.btn.spinning svg {
    display: none;
}
.btn.spinning {
    cursor: wait;
    opacity: 0.85;
}

@keyframes btn-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.btn-primary {
    background: #111111;
    color: #fff;
}
.btn-primary:hover {
    background: #000000;
}

.btn-outline {
    background: transparent;
    color: #333333;
    border: 1px solid #333;
}
.btn-outline:hover {
    border-color: var(--accent);
    color: #000;
}

.btn:active {
    transform: scale(0.97);
}

/* RIGHT PREVIEW */
.preview-area {
    flex: 1;
    min-width: 0;
    background: #eaeaf0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.preview-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding-bottom: 8px;
}

.preview-downloads {
    width: 100%;
    max-width: 500px;
    margin-top: 18px;
}

.credits {
    width: 100%;
    margin-top: auto;
    padding: 22px 24px 26px;
    color: #6a6a72;
    font-size: 11px;
    line-height: 1.7;
    text-align: center;
    border-top: 1px solid #d9d9e2;
}

.credit-block {
    flex-shrink: 0;
    padding: 10px 20px 0;
    border-top: 1px solid var(--input-border);
    color: #8a8a95;
    font-size: 11px;
    line-height: 1.5;
    text-align: left;
}

.credit-block .credits-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.1px;
    color: var(--muted);
    margin-right: 4px;
}

.credit-block p {
    margin: 0;
}

.credit-block .credits-legal {
    margin-top: 2px;
    font-size: 10px;
    color: var(--muted);
}

.credit-block a {
    color: var(--accent);
    text-decoration: none;
}

.credit-block a:hover {
    text-decoration: underline;
}

.credits-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #9a9aa5;
    margin-bottom: 8px;
}

.credits p {
    margin: 0 0 6px;
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
}

.credits a {
    color: #6c63ff;
    text-decoration: none;
}

.credits a:hover {
    text-decoration: underline;
}

.preview-notes {
    flex: 0 0 auto;
    margin-top: auto;
    width: 100%;
    padding: 14px 24px 18px;
    border-top: 1px solid #d9d9e2;
    text-align: center;
    font-size: 11px;
    line-height: 1.6;
    color: #8a8a95;
}

.preview-notes p {
    margin: 0 0 2px;
}
.preview-notes .warn {
    color: #8a8a95;
}

/* legal links inside preview-notes */
.legal-links {
    margin-top: 6px;
    font-size: 12px;
}
.credit-block .legal-links {
    display: block;
    margin: 0;
    font-size: 11px;
}
.credit-block .legal-link {
    margin: 0 2px 0 0;
}
.credit-block .legal-sep {
    margin: 0 2px;
}
.legal-link {
    background: none;
    border: none;
    padding: 0;
    margin: 0 4px 0 0;
    font: inherit;
    color: #6c63ff;
    cursor: pointer;
    text-decoration: none;
}
.legal-link:hover {
    color: #4b44c9;
    text-decoration: underline;
}
.credit-block .legal-link.legal-about {
    text-decoration: none;
}
.legal-sep {
    color: #c5c5d0;
}

/* LEGAL MODAL */
.legal-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    visibility: hidden;
    opacity: 0;
    transition:
        opacity 0.2s ease,
        visibility 0.2s ease;
}
.legal-modal.open {
    visibility: visible;
    opacity: 1;
}
.legal-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}
.legal-modal-panel {
    position: relative;
    width: 100%;
    max-width: 520px;
    max-height: 60vh;
    background: #15151c;
    border: 1px solid #2c2c38;
    border-radius: 14px;
    padding: 28px 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.legal-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid #2c2c38;
    flex: 0 0 auto;
}

.legal-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
}

.legal-modal-body {
    font-size: 13px;
    line-height: 1.7;
    color: #c6c6d0;
    overflow-y: auto;
    padding-right: 6px;
}
.legal-modal-body h3 {
    font-size: 14px;
    color: #fff;
    margin: 16px 0 6px;
}
.legal-modal-body p {
    margin: 0 0 8px;
}
.legal-modal-body a {
    color: #6c63ffff;
    text-decoration: underline;
}
.legal-modal-body a:hover {
    color: #6c63ffff;
}
.legal-modal-body ul {
    margin: 0 0 8px;
    padding-left: 18px;
}
.legal-modal-body ol {
    margin: 0 0 8px;
    padding-left: 22px;
}
.legal-modal-body li {
    margin-bottom: 4px;
}
.legal-modal-close {
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    border: none;
    background: none;
    color: #9a9aa5;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.legal-modal-close svg {
    width: 10px;
    height: 10px;
    display: block;
}
.legal-modal-close:hover {
    color: #fff;
    background: #2c2c38;
}

.preview-wrap {
    padding: 24px;
    width: 100%;
    max-width: 620px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-holder {
    width: 500px;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.preview-holder.checker {
    background-image:
        linear-gradient(45deg, #e0e0e0 25%, transparent 25%),
        linear-gradient(-45deg, #e0e0e0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e0e0e0 75%),
        linear-gradient(-45deg, transparent 75%, #e0e0e0 75%);
    background-size: 20px 20px;
    background-position:
        0 0,
        0 10px,
        10px -10px,
        -10px 0;
    background-color: #f4f4f4;
}

/* LOGO */
#logo-render {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

#logo {
    display: flex;
    align-items: center;
    max-width: 100%;
    min-width: 0;
}

#logo.layout-left {
    flex-direction: row;
}
#logo.layout-right {
    flex-direction: row-reverse;
}
#logo.layout-top {
    flex-direction: column;
}
#logo.layout-bottom {
    flex-direction: column-reverse;
}
#logo.layout-text {
    flex-direction: column;
}

.logo-icon {
    display: flex;
}

.logo-texts {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    max-width: 100%;
}

.layout-top .logo-texts,
.layout-bottom .logo-texts,
.layout-text .logo-texts {
    align-items: center;
    text-align: center;
}

.brand-name {
    font-weight: 800;
    line-height: 1.1;
    max-width: 100%;
    overflow-wrap: break-word;
}

.layout-left .brand-name,
.layout-right .brand-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-tagline {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 1px;
    margin-top: 4px;
    opacity: 0.8;
    max-width: 100%;
    overflow-wrap: break-word;
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .sidebar {
        width: 320px;
    }
}

@media (max-width: 768px) {
    .layout {
        flex-direction: column;
        height: auto;
    }
    .sidebar {
        width: 100%;
        min-height: auto;
    }
    .controls {
        max-height: 60vh;
    }
    .preview-area {
        width: 100%;
        min-height: auto;
        padding: 24px 12px;
    }
    .preview-holder {
        width: 100%;
        max-width: 500px;
    }
    .icon-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 480px) {
    .icon-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
