﻿:root {
    --bg-a: #0d0818;
    --bg-b: #18132a;
    --panel: rgba(24, 17, 41, 0.76);
    --panel-elevated: rgba(31, 23, 52, 0.9);
    --text: #efe9ff;
    --muted: #b2a9d2;
    --line: rgba(179, 153, 255, 0.22);
    --brand: #9d4edd;
    --brand-strong: #7c3aed;
    --accent: #22d3ee;
    --accent-soft: rgba(34, 211, 238, 0.22);
    --shadow: 0 24px 80px rgba(3, 3, 8, 0.56);
    --berry: #2d1b4d;
    --berry-active: #5a34a8;
    --surface: rgba(255, 255, 255, 0.96);
    --surface-soft: rgba(255, 255, 255, 0.08);
    --surface-border: rgba(255, 255, 255, 0.12);
    --surface-shadow: 0 16px 32px rgba(9, 8, 20, 0.32);
    --dot: rgba(196, 172, 255, 0.18);
    --grid-line: rgba(168, 140, 255, 0.08);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --speed: 180ms ease;
}

body[data-theme='light'] {
    --bg-a: #f4f8fc;
    --bg-b: #edf5fb;
    --panel: rgba(255, 255, 255, 0.8);
    --panel-elevated: rgba(255, 255, 255, 0.92);
    --text: #162033;
    --muted: #5f6d82;
    --line: rgba(71, 96, 140, 0.14);
    --brand: #4f8df7;
    --brand-strong: #2563eb;
    --accent: #06b6d4;
    --accent-soft: rgba(6, 182, 212, 0.16);
    --shadow: 0 24px 80px rgba(25, 38, 70, 0.12);
    --berry: #edf4fb;
    --berry-active: #dceaf7;
    --surface: rgba(255, 255, 255, 0.96);
    --surface-soft: rgba(255, 255, 255, 0.72);
    --surface-border: rgba(91, 126, 170, 0.14);
    --surface-shadow: 0 18px 36px rgba(38, 60, 94, 0.1);
    --dot: rgba(56, 189, 248, 0.12);
    --grid-line: rgba(71, 96, 140, 0.05);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    color: var(--text);
    background:
        radial-gradient(
            circle at top left,
            rgba(150, 104, 255, 0.24),
            transparent 34%
        ),
        radial-gradient(
            circle at bottom right,
            rgba(94, 58, 187, 0.3),
            transparent 28%
        ),
        linear-gradient(140deg, var(--bg-a), var(--bg-b));
    padding: 96px 14px 24px;
    overflow-x: hidden;
}

body::before,
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

body::before {
    background-image: radial-gradient(
        circle,
        var(--dot) 1px,
        transparent 1.7px
    );
    background-size: 16px 16px;
    opacity: 0.38;
}

body::after {
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 78px 78px;
    opacity: 0.46;
}

.app {
    width: min(1280px, 100%);
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.shell {
    position: relative;
    isolation: isolate;
    background: var(--panel);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.shell::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(
            circle at top right,
            rgba(173, 126, 255, 0.18),
            transparent 26%
        ),
        radial-gradient(
            circle at bottom left,
            rgba(34, 211, 238, 0.08),
            transparent 24%
        );
}

.shell > * {
    position: relative;
    z-index: 1;
}

.hero {
    padding: 22px 28px 10px;
    display: grid;
    gap: 14px;
}

.site-header {
    position: fixed;
    top: 14px;
    left: 0;
    right: 0;
    z-index: 120;
    background: transparent;
}

.site-header-inner {
    width: min(1280px, calc(100% - 28px));
    margin: 0 auto;
    min-height: 68px;
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    border-radius: 20px;
    background: rgba(35, 24, 50, 0.72);
    backdrop-filter: blur(18px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    line-height: 0;
}

.brand-logo {
    height: clamp(26px, 2.1vw, 34px);
    width: auto;
    display: block;
}

body[data-theme='dark'] .brand-logo {
    filter: brightness(0) invert(1);
}

body[data-theme='light'] .brand-logo {
    filter: none;
}

.nav-links {
    display: flex;
    gap: 24px;
    align-items: center;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-action-form {
    margin: 0;
}

.hypetools-embedded .app {
    width: 100%;
}

.hypetools-embedded .site-header {
    display: none;
}

body.hypetools-embedded-page {
    padding: 0;
    background: transparent;
}

body.hypetools-embedded-page::before,
body.hypetools-embedded-page::after {
    opacity: 0;
}

body.hypetools-embedded-page .app {
    width: 100%;
    margin: 0;
}

body.hypetools-embedded-page .shell {
    box-shadow: 0 10px 20px rgba(4, 8, 20, 0.12);
}

.nav-links a {
    display: inline-flex;
    align-items: center;
    line-height: 1;
    text-decoration: none;
    font-family: 'Space Grotesk', sans-serif;
    color: #aea0c3;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    transition: color var(--speed);
}

.nav-links a.active,
.nav-links a:hover {
    color: #fff;
}

.header-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: #efe9ff;
    text-decoration: none;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.84rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    transition:
        background-color var(--speed),
        border-color var(--speed),
        color var(--speed);
    cursor: pointer;
    appearance: none;
}

.header-action:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.08);
}

.header-action-primary {
    border-color: rgba(166, 136, 255, 0.3);
    background: linear-gradient(
        135deg,
        rgba(224, 182, 255, 0.98),
        rgba(157, 78, 221, 0.96)
    );
    color: #231132;
}

.header-action-primary:hover {
    color: #1f0f2c;
    border-color: rgba(166, 136, 255, 0.45);
    background: linear-gradient(
        135deg,
        rgba(236, 206, 255, 1),
        rgba(181, 100, 240, 0.98)
    );
}

.nav-item-tools {
    display: inline-flex;
    align-items: center;
    position: relative;
}

.nav-item-tools::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 14px;
}

.tool-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 230px;
    padding: 9px;
    border-radius: 13px;
    border: 1px solid rgba(166, 136, 255, 0.28);
    background: rgba(31, 23, 52, 0.96);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
    display: none;
    z-index: 40;
}

.tool-dropdown a {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    border: 1px solid rgba(166, 136, 255, 0.25);
    border-radius: 10px;
    background: rgba(86, 62, 145, 0.2);
    color: #efe9ff;
    min-height: 42px;
    padding: 0 12px;
    text-decoration: none;
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.92rem;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 600;
    line-height: 1;
}

.tool-dropdown a + a {
    margin-top: 8px;
}

.tool-dropdown a:hover {
    background: rgba(109, 79, 182, 0.35);
    color: #fff;
}

.nav-item-tools:hover .tool-dropdown,
.nav-item-tools:focus-within .tool-dropdown {
    display: block;
}

.hero-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.mode-toggle {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--surface-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    transition:
        background-color var(--speed),
        border-color var(--speed),
        color var(--speed);
}

.mode-toggle:hover {
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.08);
}

.theme-switch-icon {
    width: 14px;
    height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: rgba(239, 233, 255, 0.76);
    font-size: 0.88rem;
    line-height: 1;
    opacity: 1;
}

.theme-switch-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.theme-switch-track {
    position: relative;
    display: inline-flex;
    width: 38px;
    height: 22px;
    align-items: center;
    border-radius: 999px;
    border: 1px solid rgba(166, 136, 255, 0.2);
    background: rgba(166, 136, 255, 0.14);
    transition:
        background-color var(--speed),
        border-color var(--speed);
}

.theme-switch-thumb {
    position: absolute;
    left: 2px;
    display: block;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: #c79bff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.28);
    transition:
        transform var(--speed),
        background-color var(--speed);
}

.mode-toggle.is-light .theme-switch-track {
    border-color: rgba(124, 58, 237, 0.3);
    background: rgba(124, 58, 237, 0.18);
}

.mode-toggle.is-light .theme-switch-thumb {
    transform: translateX(16px);
    background: #9d4edd;
    box-shadow: 0 3px 10px rgba(157, 78, 221, 0.22);
}

body[data-theme='light'] .mode-toggle {
    border-color: rgba(15, 23, 42, 0.1);
    background: rgba(255, 255, 255, 0.72);
    color: #0f172a;
}

body[data-theme='light'] .theme-switch-icon {
    color: rgba(15, 23, 42, 0.72);
}

body[data-theme='light'] .mode-toggle:hover {
    border-color: rgba(15, 23, 42, 0.18);
    background: rgba(255, 255, 255, 0.92);
}

.hero-copy h1 {
    margin: 4px 0 0;
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: clamp(2.8rem, 6vw, 4.9rem);
    font-weight: 700;
    line-height: 0.92;
    letter-spacing: -0.06em;
}

.hero-copy p {
    margin: 12px 0 0;
    max-width: 62ch;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.6;
}

.controlbar {
    margin: 0 28px 18px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.74);
    position: relative;
    z-index: 6;
    overflow: visible;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.control-group {
    display: grid;
    gap: 8px;
}

.control-group-wide {
    min-width: 0;
}

.group-title {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.control-row {
    position: relative;
    z-index: 7;
}

.menu-trigger {
    width: 100%;
    min-height: 48px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 10px;
    align-items: center;
    box-shadow: var(--surface-shadow);
    backdrop-filter: blur(14px);
    transition:
        border-color var(--speed),
        transform var(--speed),
        box-shadow var(--speed),
        opacity var(--speed),
        background var(--speed);
}

.control-group.is-invalid .menu-trigger {
    border-color: rgba(255, 82, 120, 0.82);
    box-shadow:
        0 0 0 3px rgba(255, 82, 120, 0.16),
        0 14px 28px rgba(255, 82, 120, 0.12);
}

.control-group.is-shaking .menu-trigger {
    animation: outputSelectionShake 0.42s ease;
}

.menu-trigger:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: rgba(157, 78, 221, 0.3);
    box-shadow: 0 14px 28px rgba(53, 39, 105, 0.16);
}

.menu-trigger:disabled {
    opacity: 0.46;
    cursor: not-allowed;
}

.trigger-label {
    font-size: 0.78rem;
    color: var(--muted);
    text-align: left;
}

.menu-trigger strong {
    min-width: 0;
    font-size: 0.95rem;
    overflow: hidden;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.trigger-arrow {
    color: var(--muted);
    font-size: 0.8rem;
}

.dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    z-index: 40;
    width: max-content;
    min-width: 280px;
    max-width: min(92vw, 540px);
    padding: 12px;
    border-radius: 20px;
    box-shadow: 0 24px 40px rgba(0, 0, 0, 0.16);
    display: none;
}

.dropdown-right {
    left: auto;
    right: 0;
}

#bgMenu {
    left: 0;
    right: 0;
    width: auto;
    min-width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.dropdown.open {
    display: grid;
    gap: 12px;
}

.dropdown-dark {
    background: rgba(24, 21, 30, 0.97);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

@keyframes outputSelectionShake {
    0%,
    100% {
        transform: translateX(0);
    }
    20% {
        transform: translateX(-5px);
    }
    40% {
        transform: translateX(5px);
    }
    60% {
        transform: translateX(-4px);
    }
    80% {
        transform: translateX(4px);
    }
}

.dropdown-light {
    background: rgba(255, 255, 255, 0.98);
    color: var(--text);
    border: 1px solid rgba(29, 40, 68, 0.08);
}

.ratio-menu-top {
    position: relative;
    margin-bottom: 6px;
}

.ratio-fit-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.fit-switch {
    display: inline-grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
    border-radius: 999px;
    background: rgba(24, 21, 30, 0.08);
    border: 1px solid rgba(29, 40, 68, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.36);
}

.fit-switch-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 14px;
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition:
        background var(--speed),
        color var(--speed),
        box-shadow var(--speed),
        transform var(--speed);
}

.option-wrap input:checked + .fit-switch-option {
    background: linear-gradient(
        135deg,
        rgba(186, 230, 253, 0.68),
        rgba(226, 232, 240, 0.92)
    );
    color: #164e63;
    box-shadow:
        inset 0 0 0 1px rgba(56, 189, 248, 0.22),
        0 8px 16px rgba(77, 102, 136, 0.12);
}

.mini-help {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 6;
}

.mini-help summary {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.08);
    color: inherit;
    display: grid;
    place-items: center;
    cursor: pointer;
    list-style: none;
    font-size: 0.9rem;
    font-weight: 700;
}

.mini-help summary::-webkit-details-marker {
    display: none;
}

.mini-help-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 14;
    width: min(280px, 72vw);
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(19, 15, 31, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 18px 30px rgba(0, 0, 0, 0.22);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.78rem;
    line-height: 1.5;
}

.ratio-grid {
    display: grid;
    grid-template-columns: repeat(4, 92px);
    gap: 10px;
    justify-content: center;
}

.ratio-wrap,
.bg-wrap,
.option-wrap {
    position: relative;
}

.ratio-wrap input,
.bg-wrap input,
.option-wrap input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ratio-pill {
    display: grid;
    justify-items: center;
    align-content: stretch;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 4px;
    width: 84px;
    height: 84px;
    box-sizing: border-box;
    padding: 8px 6px 9px;
    border-radius: 18px;
    background: var(--berry);
    border: 1px solid var(--line);
    box-shadow: var(--surface-shadow);
    cursor: pointer;
    transition:
        transform var(--speed),
        border-color var(--speed),
        box-shadow var(--speed),
        background var(--speed),
        color var(--speed);
    justify-self: center;
}

.ratio-pill-light {
    background: var(--surface-soft);
}

.ratio-wrap input:checked + label {
    background: linear-gradient(
        135deg,
        rgba(157, 78, 221, 0.34),
        rgba(34, 211, 238, 0.2)
    );
    border-color: rgba(157, 78, 221, 0.38);
    box-shadow: 0 16px 28px rgba(73, 48, 150, 0.22);
    transform: translateY(-1px);
}

.ratio-pill span {
    color: var(--text);
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1;
    align-self: end;
}

.ratio-shape {
    border: 1.5px solid rgba(255, 255, 255, 0.84);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.04);
    align-self: center;
}

.original-shape {
    width: 30px;
    height: 21px;
}
.square {
    width: 25px;
    height: 25px;
}
.wide {
    width: 31px;
    height: 17px;
}
.tall {
    width: 17px;
    height: 31px;
}
.classic {
    width: 29px;
    height: 21px;
}
.portrait {
    width: 21px;
    height: 29px;
}
.ultra {
    width: 36px;
    height: 15px;
}

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

.color-pill,
.option-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    cursor: pointer;
    color: var(--text);
    box-shadow: var(--surface-shadow);
    backdrop-filter: blur(14px);
    transition:
        transform var(--speed),
        border-color var(--speed),
        box-shadow var(--speed),
        background var(--speed),
        color var(--speed);
}

.bg-wrap input:checked + label,
.option-wrap input:checked + label {
    background: linear-gradient(
        135deg,
        rgba(157, 78, 221, 0.18),
        rgba(34, 211, 238, 0.12) 120%
    );
    border-color: rgba(157, 78, 221, 0.34);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.35),
        0 12px 22px rgba(56, 37, 116, 0.12);
    transform: translateY(-1px);
}

.swatch {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 1px solid rgba(29, 40, 68, 0.12);
}

.custom-color {
    display: none;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.custom-color.visible {
    display: flex;
}

.custom-image-wrap {
    display: none;
    gap: 10px;
    padding-top: 4px;
}

.custom-image-wrap.visible {
    display: grid;
}

.bg-image-meta {
    display: grid;
    gap: 4px;
}

.bg-image-meta strong {
    font-size: 0.85rem;
}

.bg-image-meta span {
    color: var(--muted);
    font-size: 0.78rem;
}

.bg-image-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.swatch-image {
    display: grid;
    place-items: center;
    font-size: 0.72rem;
    color: #42516b;
    background: linear-gradient(135deg, #f9fafc, #e1e8f5);
}

.custom-color input[type='color'] {
    width: 42px;
    height: 42px;
    border: 0;
    padding: 0;
    background: transparent;
    border-radius: 999px;
    cursor: pointer;
}

.hue-wheel {
    width: 42px;
    height: 42px;
    padding: 2px;
    border-radius: 999px;
    background: conic-gradient(
        #ff0040,
        #ff8000,
        #ffd400,
        #6fff00,
        #00d5ff,
        #2c6bff,
        #a600ff,
        #ff006a,
        #ff0040
    );
    box-shadow: 0 4px 12px rgba(29, 40, 68, 0.16);
    display: grid;
    place-items: center;
}

.hue-wheel input[type='color'] {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.9);
    background: transparent;
}

.custom-hex {
    width: 110px;
    min-height: 42px;
    font-size: 0.84rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.custom-note,
.micro-note {
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.5;
}

.output-section {
    display: grid;
    gap: 8px;
}

.slider-block {
    display: grid;
    gap: 8px;
    padding: 10px 12px 6px;
    border-radius: 14px;
    background: linear-gradient(
        180deg,
        rgba(247, 248, 251, 0.95),
        rgba(255, 255, 255, 0.98)
    );
    border: 1px solid rgba(29, 40, 68, 0.06);
}

.slider-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.slider-head strong {
    font-size: 0.92rem;
}

.slider-head span {
    color: var(--muted);
    font-size: 0.78rem;
}

.section-label {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.inline-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filesize-row {
    display: grid;
    grid-template-columns: auto;
    gap: 8px;
}

.slim-input,
.slim-select {
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface);
    font: inherit;
    color: var(--text);
    box-shadow: var(--surface-shadow);
    backdrop-filter: blur(14px);
}

input[type='range'] {
    width: 100%;
    accent-color: var(--brand);
    -webkit-appearance: none;
    appearance: none;
    height: 20px;
    background: transparent;
    cursor: pointer;
}

input[type='range']::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(
        90deg,
        rgba(157, 78, 221, 0.28),
        rgba(34, 211, 238, 0.16)
    );
    border: 1px solid rgba(29, 40, 68, 0.08);
}

input[type='range']::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    margin-top: -6px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--accent), var(--brand));
    border: 2px solid white;
    box-shadow: 0 6px 14px rgba(114, 75, 199, 0.24);
}

input[type='range']::-moz-range-track {
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(
        90deg,
        rgba(157, 78, 221, 0.28),
        rgba(34, 211, 238, 0.16)
    );
    border: 1px solid rgba(29, 40, 68, 0.08);
}

input[type='range']::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--accent), var(--brand));
    border: 2px solid white;
    box-shadow: 0 6px 14px rgba(114, 75, 199, 0.24);
}

#outputMenu {
    left: 0;
    right: 0;
    width: auto;
    min-width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

#bgMenu .color-grid {
    grid-template-columns: repeat(auto-fit, minmax(102px, 1fr));
}

#bgMenu .color-pill {
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
    padding-inline: 10px;
}

#bgMenu .color-pill strong {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.8rem;
}

#bgMenu .custom-color {
    padding: 2px 2px 0;
}

.workspace {
    padding: 0 28px 28px;
    position: relative;
    z-index: 1;
}

.drop-panel {
    min-height: 520px;
    padding: 20px;
    border-radius: 24px;
    border: 1.5px dashed rgba(91, 126, 170, 0.22);
    background:
        radial-gradient(
            circle at top,
            rgba(186, 230, 253, 0.16),
            rgba(255, 255, 255, 0) 40%
        ),
        linear-gradient(
            160deg,
            rgba(255, 255, 255, 0.88),
            rgba(243, 248, 252, 0.95)
        );
    position: relative;
    z-index: 1;
    display: grid;
    gap: 14px;
    align-content: start;
    transition:
        border-color var(--speed),
        box-shadow var(--speed),
        transform var(--speed);
}

.drop-panel.hover {
    border-color: rgba(59, 130, 246, 0.38);
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.08);
    transform: translateY(-1px);
}

.empty-state {
    min-height: 440px;
    display: grid;
    place-items: center;
    text-align: center;
    gap: 14px;
    padding: 20px;
}

.hidden {
    display: none !important;
}

.drop-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto;
    display: grid;
    place-items: center;
    font-size: 1.9rem;
    border-radius: 22px;
    color: var(--brand-strong);
    background: linear-gradient(
        135deg,
        rgba(219, 234, 254, 0.92),
        rgba(255, 255, 255, 0.96)
    );
}

.empty-state h2 {
    margin: 0;
    font-size: 2rem;
    letter-spacing: -0.04em;
}

.empty-state p {
    margin: 0;
    max-width: 54ch;
    color: var(--muted);
    line-height: 1.6;
}

.sub-badge {
    display: inline-flex;
    padding: 10px 14px;
    border-radius: 999px;
    background: linear-gradient(
        135deg,
        rgba(219, 234, 254, 0.72),
        rgba(226, 232, 240, 0.34)
    );
    color: var(--brand-strong);
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.files-shell {
    display: none;
    gap: 16px;
}

.files-shell.visible {
    display: grid;
}

.compact-drop {
    width: 100%;
    border: 1px dashed rgba(91, 126, 170, 0.26);
    border-radius: 14px;
    background: linear-gradient(
        135deg,
        rgba(239, 246, 255, 0.92),
        rgba(226, 232, 240, 0.4)
    );
    color: var(--brand-strong);
    min-height: 52px;
    padding: 10px 12px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font: inherit;
    cursor: pointer;
    transition:
        background var(--speed),
        border-color var(--speed),
        transform var(--speed);
}

.compact-drop:hover {
    background: linear-gradient(
        135deg,
        rgba(224, 242, 254, 0.94),
        rgba(226, 232, 240, 0.48)
    );
    border-color: rgba(59, 130, 246, 0.38);
    transform: translateY(-1px);
}

.compact-drop-plus {
    width: 26px;
    height: 26px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.82);
    color: var(--brand-strong);
}

.files-top {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(29, 40, 68, 0.08);
}

.files-top h3 {
    margin: 0;
    font-size: 1.2rem;
}

.files-top p {
    margin: 6px 0 0;
    color: var(--muted);
}

.status-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.files-top-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.inline-view-toggle {
    min-height: 36px;
    padding: 8px 12px;
}

.tiny-pill {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(29, 40, 68, 0.06);
    color: var(--muted);
    font-size: 0.8rem;
}

.preview-strip {
    display: none;
    grid-template-columns: 220px 1fr;
    gap: 14px;
    padding: 14px;
    border: 1px solid rgba(29, 40, 68, 0.08);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.72);
}

.preview-stage {
    min-height: 170px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    padding: 12px;
    background: linear-gradient(160deg, #201c29, #26212d 50%, #1d2430);
}

.preview-canvas {
    position: relative;
    width: min(100%, 160px);
    aspect-ratio: 1 / 1;
    border-radius: 20px;
    display: grid;
    place-items: center;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.2);
    transition:
        aspect-ratio var(--speed),
        background var(--speed);
}

.preview-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(19, 24, 34, 0.74);
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.68rem;
    text-transform: uppercase;
}

.preview-image {
    width: 72%;
    height: 72%;
    border-radius: 18px;
    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.86),
            rgba(255, 255, 255, 0.44)
        ),
        linear-gradient(
            145deg,
            rgba(13, 140, 100, 0.42),
            rgba(106, 118, 144, 0.42)
        );
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
    overflow: hidden;
}

.preview-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.preview-stat {
    padding: 14px;
    border-radius: 16px;
    background: #f7f8fb;
    border: 1px solid rgba(29, 40, 68, 0.08);
}

.preview-stat strong {
    display: block;
    margin-bottom: 6px;
    font-size: 0.95rem;
}

.preview-stat span {
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

.file-list {
    display: block;
    max-height: 42vh;
    overflow: auto;
    padding-right: 2px;
    border-radius: 14px;
    border: 1px solid rgba(29, 40, 68, 0.08);
    background: rgba(255, 255, 255, 0.72);
}

.file-list.expanded {
    max-height: 70vh;
}

.file-table {
    min-width: 100%;
}

.file-table-head,
.file-row {
    display: grid;
    grid-template-columns: 54px minmax(220px, 1fr) 96px 110px 110px 96px 98px;
    gap: 8px;
    align-items: center;
    padding: 10px 12px;
}

.file-table-head {
    position: sticky;
    top: 0;
    z-index: 1;
    background: rgba(240, 244, 248, 0.98);
    border-bottom: 1px solid rgba(29, 40, 68, 0.12);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.file-table-body {
    display: grid;
}

.file-row {
    border-bottom: 1px solid rgba(29, 40, 68, 0.08);
    background: rgba(255, 255, 255, 0.88);
    position: relative;
    overflow: visible;
}

.file-row:last-child {
    border-bottom: 0;
}

.file-row:hover,
.file-row:focus-within {
    z-index: 3;
}

.file-cell {
    font-size: 0.85rem;
    color: var(--text);
    min-width: 0;
}

.export-size-cell[data-state='pending'],
.export-size-cell[data-state='estimated'],
.export-size-cell[data-state='failed'] {
    color: var(--muted);
}

.index-cell {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

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

.edited-star {
    color: #f7c95d;
    margin-right: 6px;
}

.action-star {
    margin: 0;
    align-self: center;
    font-size: 1rem;
    line-height: 1;
    filter: drop-shadow(0 0 6px rgba(255, 207, 103, 0.35));
}

.action-star-wrap {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    align-self: center;
    z-index: 8;
}

.mini-tooltip {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%) translateY(4px);
    opacity: 0;
    pointer-events: none;
    background: rgba(14, 12, 24, 0.95);
    color: #efe9ff;
    border: 1px solid rgba(166, 136, 255, 0.4);
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 0.7rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
    transition:
        opacity 120ms ease,
        transform 120ms ease;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.28);
    z-index: 30;
}

.action-star-wrap:hover .mini-tooltip,
.action-star-wrap:focus-within .mini-tooltip,
.action-star-wrap:focus .mini-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.item-actions {
    display: inline-flex;
    gap: 6px;
    justify-self: end;
    position: relative;
    z-index: 5;
    overflow: visible;
}

.icon-button {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(160, 45, 72, 0.28);
    border-radius: 12px;
    background: rgba(160, 45, 72, 0.1);
    color: #a02d48;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition:
        transform var(--speed),
        background var(--speed),
        border-color var(--speed),
        color var(--speed);
}

.icon-button:hover {
    transform: translateY(-1px);
    background: rgba(160, 45, 72, 0.18);
    border-color: rgba(160, 45, 72, 0.4);
}

.icon-button-danger {
    color: #9d2340;
}

.icon-button-edit {
    border-color: rgba(88, 140, 255, 0.35);
    background: rgba(88, 140, 255, 0.12);
    color: #2d63d4;
}

.icon-button-edit:hover {
    background: rgba(88, 140, 255, 0.2);
    border-color: rgba(88, 140, 255, 0.5);
}

.action-icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.footer-actions {
    display: flex;
    justify-content: flex-start;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.list-controls {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.file-list.thumbnail-view {
    padding: 12px;
}

.thumb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    align-items: start;
}

.thumb-item {
    border: 1px solid rgba(29, 40, 68, 0.1);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.92);
    overflow: hidden;
    display: grid;
    grid-template-rows: 156px auto auto;
    align-self: start;
    min-width: 0;
}

.thumb-media {
    height: 156px;
    width: 100%;
    background: linear-gradient(
        150deg,
        rgba(233, 238, 246, 0.9),
        rgba(248, 250, 252, 0.9)
    );
    border-bottom: 1px solid rgba(29, 40, 68, 0.08);
    display: grid;
    place-items: center;
    overflow: hidden;
}

.thumb-media img {
    width: auto;
    height: auto;
    max-width: min(150px, calc(100% - 10px));
    max-height: 148px;
    object-fit: contain;
    object-position: center;
    display: block;
}

.thumb-meta {
    padding: 10px;
    display: grid;
    gap: 4px;
}

.thumb-meta strong {
    font-size: 0.82rem;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.thumb-meta span {
    color: var(--muted);
    font-size: 0.76rem;
}

.thumb-item .icon-button {
    margin: 0;
}

.thumb-item .item-actions {
    margin: 0 10px 10px auto;
}

.editor-modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: none;
    place-items: center;
    padding: 24px;
    background: rgba(7, 7, 12, 0.62);
    pointer-events: auto;
}

.editor-modal.visible {
    display: grid;
}

.editor-dialog {
    position: relative;
    width: min(960px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    isolation: isolate;
    opacity: 1;
    visibility: visible;
    filter: none !important;
    backdrop-filter: none !important;
    border: 1px solid rgba(166, 136, 255, 0.26);
    border-radius: 22px;
    background: rgba(24, 18, 40, 0.96);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
    padding: 16px;
    display: grid;
    gap: 12px;
}

.editor-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: start;
}

.editor-head-actions {
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

.editor-head h3 {
    margin: 0;
}

.editor-head p {
    margin: 4px 0 0;
    color: var(--muted);
}

.editor-stage {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(20, 16, 34, 0.9);
    min-height: 320px;
    display: grid;
    place-items: center;
    padding: 10px;
}

#editorCanvas,
#bgEditorCanvas {
    max-width: 100%;
    max-height: 68vh;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    touch-action: none;
    cursor: grab;
}

#editorCanvas:active,
#bgEditorCanvas:active {
    cursor: grabbing;
}

.editor-controls {
    display: grid;
    gap: 10px;
}

.editor-zoom-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: center;
}

.editor-bg-panel,
.editor-layer-panel {
    grid-column: 1 / -1;
}

.editor-bg-panel {
    display: grid;
    gap: 8px;
    padding: 10px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
}

.editor-bg-modes,
.editor-bg-tools,
.editor-layer-panel {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.editor-bg-tools input[type='color'] {
    width: 42px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: transparent;
    padding: 0;
}

.mode-chip {
    min-height: 34px;
    padding: 6px 10px;
}

.mode-chip.active-chip {
    border-color: #9bb8ff;
    background: linear-gradient(
        180deg,
        rgba(109, 147, 255, 0.5),
        rgba(64, 102, 210, 0.7)
    );
    color: #f4f8ff;
    box-shadow:
        inset 0 0 0 1px rgba(224, 236, 255, 0.35),
        0 8px 16px rgba(23, 34, 72, 0.35);
}

.editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.button-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.loader {
    display: none;
    color: var(--muted);
    font-size: 0.9rem;
    gap: 10px;
    min-width: min(100%, 460px);
}

.loader.visible {
    display: grid;
}

.loader-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.loader-head strong {
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 700;
}

.loader-track {
    position: relative;
    overflow: hidden;
    width: min(100%, 440px);
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(166, 136, 255, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.loader-bar {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--brand), var(--accent));
    box-shadow: 0 10px 24px rgba(88, 72, 200, 0.28);
    transition: width 180ms ease;
}

.button {
    border: 0;
    min-height: 44px;
    padding: 12px 16px;
    border-radius: 14px;
    font: inherit;
    cursor: pointer;
    transition:
        transform var(--speed),
        opacity var(--speed),
        box-shadow var(--speed);
}

.button.primary {
    background: linear-gradient(135deg, var(--brand), var(--accent));
    color: white;
    box-shadow: 0 16px 26px rgba(97, 66, 182, 0.24);
}

.button.secondary {
    background: var(--surface-soft);
    color: var(--text);
    border: 1px solid var(--line);
    box-shadow: var(--surface-shadow);
}

.button.ghost {
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--surface-shadow);
    backdrop-filter: blur(14px);
}

.button:hover:not(:disabled) {
    transform: translateY(-1px);
}
.button:disabled {
    opacity: 0.56;
    cursor: not-allowed;
    box-shadow: none;
}

.global-drop-overlay {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: none;
    place-items: center;
    background: rgba(9, 7, 16, 0.46);
    backdrop-filter: blur(2px);
    pointer-events: none;
}

.global-drop-overlay.visible {
    display: grid;
}

.global-drop-box {
    width: min(680px, calc(100vw - 64px));
    min-height: 240px;
    border-radius: 24px;
    border: 3px dashed rgba(183, 157, 255, 0.88);
    background: rgba(26, 19, 43, 0.48);
    display: grid;
    place-items: center;
    text-align: center;
    gap: 8px;
    padding: 24px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.global-drop-box strong {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: clamp(1.4rem, 2.8vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.03em;
}

.global-drop-box span {
    color: #d7c8ff;
}

body[data-theme='light'] .global-drop-overlay {
    background: rgba(25, 38, 70, 0.2);
}

body[data-theme='light'] .global-drop-box {
    border-color: rgba(59, 130, 246, 0.28);
    background: rgba(255, 255, 255, 0.8);
}

body[data-theme='light'] .global-drop-box span {
    color: #4f5f7e;
}

body[data-theme='light'] {
    background:
        radial-gradient(
            circle at top left,
            rgba(255, 255, 255, 0.9),
            transparent 30%
        ),
        radial-gradient(
            circle at bottom right,
            rgba(59, 130, 246, 0.07),
            transparent 24%
        ),
        linear-gradient(140deg, var(--bg-a), var(--bg-b));
}

body[data-theme='light'] .shell {
    border-color: rgba(91, 126, 170, 0.14);
    box-shadow:
        0 10px 24px rgba(38, 60, 94, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

body.hypetools-embedded-page[data-theme='light'] .shell {
    box-shadow:
        0 6px 16px rgba(15, 23, 42, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

body[data-theme='light'] .shell::before {
    background:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
        radial-gradient(
            circle at top right,
            rgba(186, 230, 253, 0.18),
            transparent 26%
        ),
        radial-gradient(
            circle at bottom left,
            rgba(226, 232, 240, 0.16),
            transparent 24%
        );
    background-size:
        72px 72px,
        72px 72px,
        auto,
        auto;
    opacity: 0.76;
}

body[data-theme='light'] .controlbar,
body[data-theme='light'] .dropdown-light,
body[data-theme='light'] .slider-block,
body[data-theme='light'] .preview-strip,
body[data-theme='light'] .file-list,
body[data-theme='light'] .thumb-item,
body[data-theme='light'] .drop-panel,
body[data-theme='light'] .preview-stat,
body[data-theme='light'] .button.ghost,
body[data-theme='light'] .button.secondary,
body[data-theme='light'] .slim-input,
body[data-theme='light'] .slim-select,
body[data-theme='light'] .menu-trigger,
body[data-theme='light'] .color-pill,
body[data-theme='light'] .option-pill,
body[data-theme='light'] .tiny-pill {
    border-color: rgba(91, 126, 170, 0.14);
    box-shadow:
        0 14px 30px rgba(38, 60, 94, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

body[data-theme='light'] .controlbar,
body[data-theme='light'] .preview-strip,
body[data-theme='light'] .file-list,
body[data-theme='light'] .drop-panel {
    background:
        radial-gradient(
            circle at top right,
            rgba(186, 230, 253, 0.14),
            transparent 28%
        ),
        linear-gradient(
            160deg,
            rgba(255, 255, 255, 0.92),
            rgba(242, 248, 252, 0.96)
        );
}

body[data-theme='light'] .menu-trigger:hover:not(:disabled),
body[data-theme='light'] .button.ghost:hover:not(:disabled),
body[data-theme='light'] .button.secondary:hover:not(:disabled),
body[data-theme='light'] .compact-drop:hover {
    border-color: rgba(59, 130, 246, 0.26);
    box-shadow: 0 18px 32px rgba(38, 60, 94, 0.12);
}

body[data-theme='light'] .ratio-pill {
    background: linear-gradient(
        160deg,
        rgba(255, 255, 255, 0.92),
        rgba(238, 244, 250, 0.96)
    );
}

body[data-theme='light'] #ratioMenu {
    background: rgba(255, 255, 255, 0.98);
    color: var(--text);
    border: 1px solid rgba(29, 40, 68, 0.08);
    box-shadow: 0 24px 40px rgba(77, 102, 136, 0.16);
}

body[data-theme='light'] .mini-help summary {
    background: rgba(255, 255, 255, 0.88);
    border-color: rgba(29, 40, 68, 0.1);
    color: var(--text);
}

body[data-theme='light'] .fit-switch {
    background: rgba(240, 244, 248, 0.9);
    border-color: rgba(29, 40, 68, 0.08);
}

body[data-theme='light'] .mini-help-panel {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(29, 40, 68, 0.08);
    color: var(--text);
    box-shadow: 0 18px 30px rgba(77, 102, 136, 0.16);
}

body[data-theme='light'] .ratio-shape {
    border-color: rgba(76, 29, 149, 0.72);
    background: rgba(157, 78, 221, 0.05);
}

body[data-theme='light'] .ratio-wrap input:checked + label,
body[data-theme='light'] .bg-wrap input:checked + label,
body[data-theme='light'] .option-wrap input:checked + label {
    background: linear-gradient(
        135deg,
        rgba(186, 230, 253, 0.58),
        rgba(226, 232, 240, 0.76)
    );
    border-color: rgba(56, 189, 248, 0.26);
    color: #164e63;
}

body[data-theme='dark'] .shell {
    border: 1px solid rgba(157, 125, 255, 0.26);
    box-shadow: 0 14px 28px rgba(4, 8, 20, 0.18);
}

body[data-theme='dark'] .controlbar,
body[data-theme='dark'] .menu-trigger,
body[data-theme='dark'] .drop-panel,
body[data-theme='dark'] .file-list,
body[data-theme='dark'] .compact-drop,
body[data-theme='dark'] .button.ghost,
body[data-theme='dark'] .button.secondary,
body[data-theme='dark'] .tiny-pill,
body[data-theme='dark'] .dropdown-light,
body[data-theme='dark'] .slider-block,
body[data-theme='dark'] .slim-input,
body[data-theme='dark'] .slim-select,
body[data-theme='dark'] .color-pill,
body[data-theme='dark'] .option-pill,
body[data-theme='dark'] .thumb-item,
body[data-theme='dark'] .file-row {
    background: var(--panel-elevated);
    border-color: rgba(166, 136, 255, 0.22);
    color: var(--text);
}

body[data-theme='dark'] .controlbar {
    background: rgba(24, 18, 40, 0.78);
}

body[data-theme='dark'] .ratio-wrap input:checked + label,
body[data-theme='dark'] .bg-wrap input:checked + label,
body[data-theme='dark'] .option-wrap input:checked + label {
    background: linear-gradient(
        135deg,
        rgba(157, 78, 221, 0.46),
        rgba(34, 211, 238, 0.2)
    );
    border-color: rgba(190, 169, 255, 0.48);
    color: #ffffff;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.14),
        0 18px 28px rgba(16, 11, 31, 0.42);
}

body[data-theme='dark'] .ratio-pill span,
body[data-theme='dark'] .color-pill,
body[data-theme='dark'] .option-pill,
body[data-theme='dark'] .button.ghost,
body[data-theme='dark'] .button.secondary {
    color: #efe9ff;
}

body[data-theme='dark'] .fit-switch {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(166, 136, 255, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

body[data-theme='dark'] .fit-switch-option {
    color: #d6cbff;
}

body[data-theme='dark'] .option-wrap input:checked + .fit-switch-option {
    background: linear-gradient(
        135deg,
        rgba(157, 78, 221, 0.46),
        rgba(34, 211, 238, 0.2)
    );
    color: #ffffff;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.14),
        0 10px 18px rgba(16, 11, 31, 0.28);
}

body[data-theme='dark'] .menu-trigger:hover:not(:disabled),
body[data-theme='dark'] .compact-drop:hover {
    border-color: rgba(164, 135, 255, 0.45);
    box-shadow: 0 12px 24px rgba(8, 6, 18, 0.42);
}

body[data-theme='dark'] .dropdown-dark {
    background: rgba(17, 13, 30, 0.97);
    border-color: rgba(166, 136, 255, 0.2);
}

body[data-theme='dark'] .drop-panel {
    background:
        radial-gradient(
            circle at top,
            rgba(91, 62, 160, 0.18),
            rgba(255, 255, 255, 0) 42%
        ),
        linear-gradient(160deg, rgba(21, 16, 36, 0.86), rgba(27, 21, 44, 0.92));
    border-color: rgba(164, 135, 255, 0.35);
}

body[data-theme='dark'] .compact-drop {
    color: #d4c7ff;
}

body[data-theme='dark'] .sub-badge {
    background: linear-gradient(
        135deg,
        rgba(243, 247, 255, 0.96),
        rgba(208, 218, 242, 0.84)
    );
    border: 1px solid rgba(236, 242, 255, 0.42);
    color: #4c1d95;
    text-shadow: none;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.62),
        0 12px 24px rgba(8, 6, 18, 0.28);
}

body[data-theme='dark'] .compact-drop-plus {
    background: rgba(127, 95, 219, 0.35);
    color: #f3ecff;
}

body[data-theme='dark'] .files-top,
body[data-theme='dark'] .file-table-head,
body[data-theme='dark'] .thumb-media {
    border-color: rgba(166, 136, 255, 0.2);
}

body[data-theme='dark'] .file-table-head {
    background: rgba(38, 28, 63, 0.95);
    color: #c8b8f5;
}

body[data-theme='dark'] .thumb-media {
    background: linear-gradient(
        150deg,
        rgba(63, 49, 102, 0.75),
        rgba(35, 28, 57, 0.9)
    );
}

body[data-theme='dark'] .button.primary {
    background: linear-gradient(135deg, #9d4edd, #22d3ee);
    box-shadow: 0 16px 26px rgba(58, 41, 115, 0.42);
}

body[data-theme='dark'] .icon-button {
    border-color: rgba(255, 120, 170, 0.42);
    background: rgba(131, 36, 70, 0.35);
    color: #ff9bc2;
}

body[data-theme='dark'] .icon-button:hover {
    background: rgba(161, 41, 87, 0.48);
    border-color: rgba(255, 150, 191, 0.55);
}

body[data-theme='dark'] .icon-button-edit {
    border-color: rgba(142, 172, 255, 0.45);
    background: rgba(72, 108, 201, 0.35);
    color: #d5e2ff;
}

body[data-theme='dark'] .icon-button-edit:hover {
    background: rgba(90, 128, 226, 0.5);
}

body[data-theme='light'] .editor-dialog {
    background: rgba(255, 255, 255, 0.98);
}

body[data-theme='light'] .editor-stage {
    background: rgba(247, 250, 255, 0.95);
}

body[data-theme='light'] .mode-chip.active-chip {
    border-color: rgba(56, 189, 248, 0.24);
    background: linear-gradient(
        180deg,
        rgba(224, 242, 254, 0.82),
        rgba(226, 232, 240, 0.52)
    );
    color: #155e75;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.62),
        0 6px 12px rgba(56, 83, 120, 0.12);
}

body[data-theme='light'] .site-header {
    background: rgba(255, 255, 255, 0.92);
    border-bottom-color: rgba(29, 40, 68, 0.12);
}

body[data-theme='light'] .brand-corner {
    background: transparent;
    border: 0;
    box-shadow: none;
}

body[data-theme='light'] .tool-dropdown {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(91, 126, 170, 0.16);
}

body[data-theme='light'] .nav-button {
    background: rgba(29, 40, 68, 0.04);
    border-color: rgba(29, 40, 68, 0.12);
    color: #1d2844;
}

body[data-theme='light'] .nav-button:hover {
    background: rgba(29, 40, 68, 0.1);
}

body[data-theme='light'] .tools-item {
    background: linear-gradient(
        135deg,
        rgba(226, 232, 240, 0.74),
        rgba(224, 242, 254, 0.62)
    );
    border-color: rgba(91, 126, 170, 0.16);
    color: #1d2844;
}

body[data-theme='dark'] .hero-copy h1,
body[data-theme='dark'] .files-top h3 {
    color: #f4eeff;
}

body[data-theme='dark'] .hero-copy p,
body[data-theme='dark'] .files-top p,
body[data-theme='dark'] .thumb-meta span,
body[data-theme='dark'] .custom-note,
body[data-theme='dark'] .micro-note {
    color: #b8addb;
}

@media (max-width: 1100px) {
    .controlbar {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .site-header-inner {
        min-height: 62px;
        padding: 12px 14px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .nav-links {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 8px;
    }

    .header-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .header-action-form {
        display: contents;
    }

    .nav-links a {
        font-size: 0.82rem;
    }

    .header-action {
        min-height: 38px;
        padding: 0 14px;
        font-size: 0.78rem;
    }

    .tool-dropdown {
        left: 0;
        transform: none;
        min-width: 220px;
    }

    .hero {
        padding: 18px 18px 12px;
    }

    .hero-copy h1 {
        font-size: clamp(2rem, 9vw, 2.8rem);
    }

    .hero-copy p {
        font-size: 0.98rem;
        line-height: 1.55;
    }

    .controlbar {
        padding: 14px;
    }

    .workspace {
        padding: 14px;
    }

    .shell {
        border-radius: 22px;
    }

    .preview-meta,
    .ratio-grid,
    .color-grid {
        grid-template-columns: 1fr;
    }

    .filesize-row {
        grid-template-columns: 1fr;
    }

    .dropdown,
    .output-menu {
        min-width: 100%;
        width: 100%;
    }

    .ratio-fit-row {
        align-items: stretch;
    }

    .mini-help-panel {
        right: 0;
    }

    .file-table-head {
        display: none;
    }

    .file-row {
        grid-template-columns: 1fr auto;
        gap: 10px;
        padding: 12px;
    }

    .file-row .file-cell {
        display: none;
    }

    .file-row .name-cell {
        display: block;
    }

    .file-row .icon-button {
        justify-self: end;
    }

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

    .files-top-right {
        width: 100%;
        justify-content: flex-start;
    }

    .editor-zoom-row {
        grid-template-columns: 1fr;
    }

    .footer-actions,
    .button-row {
        gap: 10px;
    }

    .list-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .button-row {
        flex-direction: column;
    }

    .list-controls #toggleListBtn {
        width: 100%;
    }

    .button-row .button {
        width: 100%;
    }
}

.tool-panel.hidden-tool {
    display: none;
}

.tools-item.active-tool {
    background: rgba(122, 90, 210, 0.42);
    border-color: rgba(170, 140, 255, 0.5);
}

.relight-workspace {
    padding-top: 6px;
}

.relight-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 14px;
    align-items: start;
}

.relight-stage-wrap {
    position: relative;
    height: 560px;
    border-radius: 22px;
    border: 1.5px dashed rgba(166, 136, 255, 0.35);
    background: linear-gradient(
        155deg,
        rgba(22, 17, 39, 0.78),
        rgba(31, 24, 52, 0.84)
    );
    overflow: hidden;
    display: grid;
    place-items: center;
    cursor: crosshair;
}

.relight-stage-wrap.has-image {
    border-style: solid;
}

#relightCanvas {
    width: 100%;
    position: absolute;
    inset: 0;
    height: 100%;
    min-height: 0;
    display: block;
    touch-action: none;
}

.relight-empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    text-align: center;
    gap: 8px;
    color: #d8cdf8;
    pointer-events: none;
}

.relight-empty strong {
    font-size: 1.5rem;
    letter-spacing: -0.02em;
}

.relight-sidebar {
    border: 1px solid rgba(166, 136, 255, 0.24);
    border-radius: 18px;
    background: rgba(27, 21, 45, 0.88);
    padding: 12px;
    display: grid;
    gap: 12px;
}

.relight-group {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid rgba(166, 136, 255, 0.18);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
}

.relight-field {
    font-size: 0.82rem;
    color: #bfb2e8;
}

.relight-value {
    font-size: 0.8rem;
    color: #d8cdf8;
}

.relight-light-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.relight-light-list {
    display: grid;
    gap: 6px;
    max-height: 170px;
    overflow: auto;
    padding-right: 2px;
}

.relight-light-chip {
    width: 100%;
    min-height: 36px;
    border: 1px solid rgba(166, 136, 255, 0.24);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font: inherit;
    text-align: left;
    padding: 6px 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.relight-light-chip.active {
    background: rgba(134, 101, 231, 0.34);
    border-color: rgba(183, 157, 255, 0.56);
}

.relight-light-dot {
    width: 11px;
    height: 11px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.75);
    flex: 0 0 auto;
}

body[data-theme='light'] .relight-stage-wrap {
    background:
        radial-gradient(
            circle at top right,
            rgba(173, 126, 255, 0.18),
            transparent 24%
        ),
        linear-gradient(
            155deg,
            rgba(241, 236, 255, 0.92),
            rgba(244, 248, 255, 0.92)
        );
    border-color: rgba(126, 91, 208, 0.18);
}

body[data-theme='light'] .relight-empty {
    color: #4f5f7e;
}

body[data-theme='light'] .relight-sidebar {
    background: linear-gradient(
        160deg,
        rgba(255, 255, 255, 0.94),
        rgba(247, 243, 255, 0.98)
    );
    border-color: rgba(126, 91, 208, 0.14);
}

body[data-theme='light'] .relight-group {
    background: rgba(255, 255, 255, 0.76);
    border-color: rgba(126, 91, 208, 0.12);
}

body[data-theme='light'] .relight-field,
body[data-theme='light'] .relight-value {
    color: #4f5f7e;
}

@media (max-width: 980px) {
    .relight-layout {
        grid-template-columns: 1fr;
    }

    .relight-sidebar {
        order: -1;
    }

    #relightCanvas,
    .relight-stage-wrap {
        height: 420px;
    }
}

@media (max-width: 760px) {
    .faq-section {
        padding: 18px;
    }

    .faq-item {
        padding: 14px 16px;
    }

    #relightCanvas,
    .relight-stage-wrap {
        height: 340px;
    }

    .relight-layout {
        grid-template-columns: 1fr;
    }

    .relight-stage-wrap {
        order: 0;
    }

    .relight-sidebar {
        order: 1;
    }
}

#relightImageHueRange::-webkit-slider-runnable-track {
    height: 22px;
    border-radius: 999px;
    background: linear-gradient(
        90deg,
        #ff5c8a 0%,
        #ff9f43 16%,
        #f7d154 32%,
        #5de27a 48%,
        #4cc9f0 64%,
        #5b7cff 80%,
        #d26bff 100%
    );
    border: 0;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

#relightImageHueRange::-moz-range-track {
    background: linear-gradient(
        90deg,
        #ff5c8a 0%,
        #ff9f43 16%,
        #f7d154 32%,
        #5de27a 48%,
        #4cc9f0 64%,
        #5b7cff 80%,
        #d26bff 100%
    );
    height: 22px;
    border-radius: 999px;
    border: 0;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

#relightImageHueRange::-webkit-slider-thumb {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--accent), var(--brand));
    border: 2px solid white;
    box-shadow:
        0 0 0 3px rgba(114, 75, 199, 0.22),
        0 6px 16px rgba(114, 75, 199, 0.32);
}

#relightImageHueRange::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--accent), var(--brand));
    border: 2px solid white;
    box-shadow:
        0 0 0 3px rgba(114, 75, 199, 0.22),
        0 6px 16px rgba(114, 75, 199, 0.32);
}

#relightImageHueRange:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#relightImageSaturationRange::-webkit-slider-runnable-track {
    height: 22px;
    border-radius: 999px;
    background: linear-gradient(
        90deg,
        #8c8898 0%,
        #8b8aa0 18%,
        #8891aa 36%,
        #7b99b8 54%,
        #6aa0c3 72%,
        #5b7cff 100%
    );
    border: 0;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

#relightImageSaturationRange::-moz-range-track {
    height: 22px;
    border-radius: 999px;
    background: linear-gradient(
        90deg,
        #8c8898 0%,
        #8b8aa0 18%,
        #8891aa 36%,
        #7b99b8 54%,
        #6aa0c3 72%,
        #5b7cff 100%
    );
    border: 0;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

#relightImageSaturationRange::-webkit-slider-thumb {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--accent), var(--brand));
    border: 2px solid white;
    box-shadow:
        0 0 0 3px rgba(114, 75, 199, 0.22),
        0 6px 16px rgba(114, 75, 199, 0.32);
}

#relightImageSaturationRange::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--accent), var(--brand));
    border: 2px solid white;
    box-shadow:
        0 0 0 3px rgba(114, 75, 199, 0.22),
        0 6px 16px rgba(114, 75, 199, 0.32);
}

#relightImageSaturationRange:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#relightLightColor {
    width: 100%;
    min-height: 46px;
    border: 1px solid rgba(183, 157, 255, 0.45);
    border-radius: 14px;
    padding: 6px;
    background: linear-gradient(
        145deg,
        rgba(50, 36, 84, 0.92),
        rgba(35, 26, 59, 0.96)
    );
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.08),
        0 10px 20px rgba(10, 8, 20, 0.35);
    cursor: pointer;
}

#relightLightColor:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#relightLightColor::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 10px;
}

#relightLightColor::-webkit-color-swatch {
    border: 0;
    border-radius: 10px;
}

#relightLightColor::-moz-color-swatch {
    border: 0;
    border-radius: 10px;
}

body[data-theme='light'] #relightLightColor {
    background: linear-gradient(
        145deg,
        rgba(249, 246, 255, 0.95),
        rgba(238, 243, 255, 0.95)
    );
    border-color: rgba(126, 91, 208, 0.2);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.75),
        0 8px 16px rgba(74, 56, 136, 0.14);
}

.relight-light-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 38px;
    gap: 6px;
    align-items: center;
}

.relight-light-trash {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 120, 170, 0.45);
    border-radius: 10px;
    background: rgba(131, 36, 70, 0.35);
    color: #ff9bc2;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition:
        transform var(--speed),
        background var(--speed),
        border-color var(--speed);
}

.relight-light-trash:hover {
    transform: translateY(-1px);
    background: rgba(161, 41, 87, 0.5);
    border-color: rgba(255, 150, 191, 0.62);
}

.relight-light-trash svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

#relightCompareBtn.active-chip {
    border-color: rgba(142, 172, 255, 0.6);
    background: linear-gradient(
        180deg,
        rgba(109, 147, 255, 0.5),
        rgba(64, 102, 210, 0.7)
    );
    color: #f4f8ff;
    box-shadow:
        inset 0 0 0 1px rgba(224, 236, 255, 0.35),
        0 8px 16px rgba(23, 34, 72, 0.35);
}

body[data-theme='light'] .relight-light-trash {
    border-color: rgba(165, 42, 81, 0.35);
    background: rgba(218, 89, 130, 0.14);
    color: #9d2340;
}

body[data-theme='light'] .relight-light-trash:hover {
    background: rgba(218, 89, 130, 0.22);
}

/* Branded scrollbars across tools */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(164, 135, 255, 0.55) rgba(255, 255, 255, 0.04);
}

*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
    background: linear-gradient(
        180deg,
        rgba(164, 135, 255, 0.72),
        rgba(98, 71, 187, 0.75)
    );
    border-radius: 999px;
    border: 2px solid rgba(13, 9, 24, 0.35);
}

*::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(
        180deg,
        rgba(184, 159, 255, 0.85),
        rgba(113, 84, 206, 0.85)
    );
}

.file-list,
.relight-light-list,
.editor-dialog {
    scrollbar-width: thin;
    scrollbar-color: rgba(176, 149, 255, 0.72) rgba(255, 255, 255, 0.06);
}

.file-list::-webkit-scrollbar,
.relight-light-list::-webkit-scrollbar,
.editor-dialog::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.file-list::-webkit-scrollbar-track,
.relight-light-list::-webkit-scrollbar-track,
.editor-dialog::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
}

.file-list::-webkit-scrollbar-thumb,
.relight-light-list::-webkit-scrollbar-thumb,
.editor-dialog::-webkit-scrollbar-thumb {
    background: linear-gradient(
        180deg,
        rgba(178, 153, 255, 0.84),
        rgba(116, 83, 214, 0.84)
    );
    border-radius: 999px;
    border: 2px solid rgba(21, 16, 35, 0.42);
}

body[data-theme='light'] * {
    scrollbar-color: rgba(157, 78, 221, 0.52) rgba(126, 91, 208, 0.08);
}

body[data-theme='light'] *::-webkit-scrollbar-track {
    background: rgba(29, 40, 68, 0.08);
}

body[data-theme='light'] *::-webkit-scrollbar-thumb {
    background: linear-gradient(
        180deg,
        rgba(157, 78, 221, 0.74),
        rgba(34, 211, 238, 0.62)
    );
    border-color: rgba(255, 255, 255, 0.72);
}

body[data-theme='light'] .file-list::-webkit-scrollbar-track,
body[data-theme='light'] .relight-light-list::-webkit-scrollbar-track,
body[data-theme='light'] .editor-dialog::-webkit-scrollbar-track {
    background: rgba(29, 40, 68, 0.1);
}

body[data-theme='light'] .file-list::-webkit-scrollbar-thumb,
body[data-theme='light'] .relight-light-list::-webkit-scrollbar-thumb,
body[data-theme='light'] .editor-dialog::-webkit-scrollbar-thumb {
    background: linear-gradient(
        180deg,
        rgba(157, 78, 221, 0.82),
        rgba(34, 211, 238, 0.68)
    );
    border-color: rgba(255, 255, 255, 0.78);
}

.faq-section {
    margin-top: 18px;
    padding: 28px;
    border-radius: 28px;
    background: linear-gradient(
        145deg,
        rgba(51, 39, 71, 0.9),
        rgba(27, 19, 39, 0.96)
    );
    box-shadow: 0 12px 22px rgba(4, 8, 20, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.faq-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: end;
    margin-bottom: 18px;
}

.faq-header h2 {
    margin: 6px 0 10px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.7rem, 2.6vw, 2.6rem);
    letter-spacing: -0.03em;
}

.faq-header p {
    margin: 0;
    color: var(--muted);
    max-width: 60ch;
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 14px;
}

.faq-item {
    align-self: start;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    padding: 16px 18px;
}

.faq-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    cursor: pointer;
    list-style: none;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    color: var(--text);
    font-size: 1.02rem;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-question {
    flex: 1;
}

.faq-chevron {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(237, 233, 254, 0.94);
    transition:
        transform 180ms ease,
        border-color 180ms ease,
        background 180ms ease;
}

.faq-chevron svg {
    width: 16px;
    height: 16px;
}

.faq-item p {
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.6;
}

.faq-item[open] .faq-chevron {
    transform: rotate(180deg);
    border-color: rgba(168, 133, 255, 0.34);
    background: rgba(168, 133, 255, 0.12);
}

.faq-item[open] {
    border-color: rgba(168, 133, 255, 0.32);
    background: rgba(100, 79, 164, 0.12);
}

body[data-theme='light'] .faq-section {
    border-color: rgba(91, 126, 170, 0.14);
    background:
        radial-gradient(
            circle at top right,
            rgba(186, 230, 253, 0.18),
            transparent 30%
        ),
        radial-gradient(
            circle at bottom left,
            rgba(226, 232, 240, 0.24),
            transparent 34%
        ),
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.94),
            rgba(243, 248, 252, 0.98)
        );
    box-shadow:
        0 8px 18px rgba(38, 60, 94, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

body[data-theme='dark'] .faq-section {
    box-shadow: none;
}

body[data-theme='light'] .faq-item {
    border-color: rgba(91, 126, 170, 0.12);
    background: rgba(255, 255, 255, 0.62);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

body[data-theme='light'] .faq-item summary {
    color: #1a1530;
}

body[data-theme='light'] .faq-chevron {
    border-color: rgba(91, 126, 170, 0.14);
    background: rgba(255, 255, 255, 0.74);
    color: #3b5b7c;
}

body[data-theme='light'] .faq-item p,
body[data-theme='light'] .faq-header p {
    color: #665f82;
}

body[data-theme='light'] .faq-item[open] .faq-chevron {
    border-color: rgba(56, 189, 248, 0.22);
    background: linear-gradient(
        135deg,
        rgba(224, 242, 254, 0.86),
        rgba(226, 232, 240, 0.6)
    );
}

body[data-theme='light'] .faq-item[open] {
    border-color: rgba(56, 189, 248, 0.22);
    background: linear-gradient(
        135deg,
        rgba(240, 249, 255, 0.94),
        rgba(241, 245, 249, 0.82)
    );
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

@media (max-width: 920px) {
    .faq-grid {
        grid-template-columns: 1fr;
    }

    .faq-header {
        align-items: flex-start;
        flex-direction: column;
    }
}
