:root {
    /* Brand theme */
    --primary: #a3c43a;
    --primary-dark: #b6d94a;
    --hover: #8ab32e;
    --dark: #0d1117;

    /* Supporting neutrals derived from --dark */
    --surface: #151b23;
    --surface-2: #1b232d;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(163, 196, 58, 0.45);
    --text: #e6edf3;
    --muted: #8b949e;

    /* Bootstrap overrides */
    --bs-body-bg: var(--dark);
    --bs-body-color: var(--text);
    --bs-body-font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --bs-primary: var(--primary);
    --bs-primary-rgb: 163, 196, 58;
    --bs-border-color: var(--border);
    --bs-link-color: var(--primary);
    --bs-link-hover-color: var(--hover);
}

* {
    -webkit-tap-highlight-color: transparent;
}

main {
    flex: 1;
}

/* ---------- Hero ---------- */

.hero-sub {
    color: var(--muted);
    font-size: 1.1rem;
    max-width: 56ch;
    margin: 0;
}

/* ---------- Panels ---------- */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 1.4rem;
}

.panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.panel-title {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 1rem;
}

.panel-head .panel-title {
    margin-bottom: 0.15rem;
}

.panel-sub {
    color: var(--muted);
    font-size: 0.875rem;
}

.panel-rule {
    border-color: var(--border);
    opacity: 1;
    margin: 1.4rem 0;
}

.settings {
    top: 1rem;
}

/* ---------- Dropzone ---------- */
.dropzone {
    border: 2px dashed rgba(163, 196, 58, 0.4);
    background: linear-gradient(180deg, rgba(163, 196, 58, 0.06), rgba(163, 196, 58, 0.02));
    border-radius: 20px;
    padding: 3rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s, transform .2s, box-shadow .2s;
    outline: none;
}

.dropzone:hover,
.dropzone:focus-visible,
.dropzone.is-over {
    border-color: var(--primary);
    background: linear-gradient(180deg, rgba(163, 196, 58, 0.14), rgba(163, 196, 58, 0.04));
    box-shadow: 0 0 0 4px rgba(163, 196, 58, 0.12);
}

.dropzone.is-over {
    transform: scale(1.01);
}

.dz-icon {
    width: 68px;
    height: 68px;
    margin: 0 auto 1rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(163, 196, 58, 0.14);
    color: var(--primary);
    font-size: 2rem;
}

.dz-title {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
}

.dz-link {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.dz-hint {
    color: var(--muted);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* ---------- Buttons ---------- */
.btn-primary {
    --bs-btn-color: var(--dark);
    --bs-btn-bg: var(--primary);
    --bs-btn-border-color: var(--primary);
    --bs-btn-hover-color: var(--dark);
    --bs-btn-hover-bg: var(--hover);
    --bs-btn-hover-border-color: var(--hover);
    --bs-btn-focus-shadow-rgb: 163, 196, 58;
    --bs-btn-active-color: var(--dark);
    --bs-btn-active-bg: var(--hover);
    --bs-btn-active-border-color: var(--hover);
    --bs-btn-disabled-color: rgba(13, 17, 23, 0.6);
    --bs-btn-disabled-bg: rgba(163, 196, 58, 0.35);
    --bs-btn-disabled-border-color: transparent;
    font-weight: 700;
    border-radius: 12px;
}

#mergeBtn:not(:disabled) {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: 0;
    box-shadow: 0 8px 24px -8px rgba(163, 196, 58, 0.55);
    transition: transform .15s, box-shadow .2s, background .2s;
}

#mergeBtn:not(:disabled):hover {
    background: var(--hover);
    transform: translateY(-1px);
}

.btn-ghost {
    color: var(--text);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.btn-ghost:hover {
    color: var(--dark);
    background: var(--primary);
    border-color: var(--primary);
}

.btn-seg {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 0.65rem 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.btn-seg i {
    font-size: 1.25rem;
    margin-bottom: 0.15rem;
}

.btn-seg:hover {
    color: var(--text);
    background: var(--surface-2);
    border-color: var(--border-strong);
}

.btn-check:checked+.btn-seg {
    background: rgba(163, 196, 58, 0.16);
    color: var(--primary);
    border-color: var(--primary);
}

.btn-check:focus-visible+.btn-seg {
    box-shadow: 0 0 0 3px rgba(163, 196, 58, 0.35);
}

.layout-group .btn-seg:first-of-type {
    border-radius: 12px 0 0 12px;
}

.layout-group .btn-seg:last-of-type {
    border-radius: 0 12px 12px 0;
}

/* ---------- Forms ---------- */
.field {
    margin-top: 1.1rem;
}

.form-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.4rem;
}

.form-label output {
    color: var(--primary);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.form-select,
.form-control {
    background-color: var(--surface-2);
    border-color: var(--border);
    border-radius: 10px;
    color: var(--text);
}

.form-select:focus,
.form-control:focus {
    background-color: var(--surface-2);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(163, 196, 58, 0.22);
    color: var(--text);
}

.form-control-color {
    width: 48px;
    height: 38px;
    padding: 4px;
}

.bg-code {
    color: var(--muted);
    font-size: 0.85rem;
}

.form-range {
    accent-color: var(--primary);
}

.form-range::-webkit-slider-thumb {
    background: var(--primary);
}

.form-range::-webkit-slider-thumb:active {
    background: var(--hover);
}

.form-range::-moz-range-thumb {
    background: var(--primary);
}

.form-range::-webkit-slider-runnable-track {
    background: var(--text);
}

.form-range::-moz-range-track {
    background: var(--text);
}

.form-range:focus::-webkit-slider-thumb {
    box-shadow: 0 0 0 4px rgba(163, 196, 58, 0.25);
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-check-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(163, 196, 58, 0.25);
}

.form-switch .form-check-input:checked {
    --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%230d1117'/%3e%3c/svg%3e");
}

.merge-hint {
    color: var(--muted);
    font-size: 0.85rem;
    text-align: center;
    margin-top: 0.75rem;
    min-height: 1.2em;
}

/* ---------- Files ---------- */
.usage {
    height: 6px;
    background: var(--surface-2);
    border-radius: 99px;
    overflow: hidden;
}

.usage-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--hover), var(--primary-dark));
    border-radius: 99px;
    transition: width .3s ease;
}

.usage-bar.is-full {
    background: #f0883e;
}

.reorder-tip {
    color: var(--muted);
    font-size: 0.85rem;
    margin: 0.9rem 0 1rem;
}

.thumb {
    position: relative;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    cursor: grab;
    transition: border-color .15s, transform .15s, opacity .15s;
}

.thumb:hover {
    border-color: var(--border-strong);
}

.thumb.dragging {
    opacity: 0.35;
    transform: scale(0.97);
    cursor: grabbing;
}

.thumb.drop-target {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(163, 196, 58, 0.3);
}

.thumb-img {
    aspect-ratio: 1 / 1;
    width: 100%;
    object-fit: contain;
    display: block;
    background:
        repeating-conic-gradient(rgba(255, 255, 255, 0.04) 0% 25%, transparent 0% 50%) 50% / 16px 16px;
    pointer-events: none;
}

.thumb-order {
    position: absolute;
    top: 8px;
    left: 8px;
    min-width: 26px;
    height: 26px;
    padding: 0 7px;
    display: grid;
    place-items: center;
    border-radius: 99px;
    background: var(--primary);
    color: var(--dark);
    font-size: 0.78rem;
    font-weight: 700;
}

.thumb-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: rgba(13, 17, 23, 0.8);
    color: var(--text);
    transition: background .15s, color .15s;
}

.thumb-remove:hover {
    background: #da3633;
    color: #fff;
}

.thumb-body {
    padding: 0.6rem 0.7rem 0.7rem;
}

.thumb-name {
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.thumb-actions {
    display: flex;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.thumb-actions button {
    flex: 1;
    padding: 0.2rem 0;
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all .15s;
}

.thumb-actions button:hover:not(:disabled) {
    color: var(--dark);
    background: var(--primary);
    border-color: var(--primary);
}

.thumb-actions button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ---------- Result ---------- */
.result-stage {
    border-radius: 14px;
    border: 1px solid var(--border);
    padding: 0.75rem;
    max-height: 640px;
    overflow: auto;
    background:
        repeating-conic-gradient(rgba(255, 255, 255, 0.05) 0% 25%, transparent 0% 50%) 50% / 20px 20px;
}

.result-stage img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border-radius: 6px;
}

.alert-warning {
    --bs-alert-bg: rgba(240, 136, 62, 0.12);
    --bs-alert-border-color: rgba(240, 136, 62, 0.4);
    --bs-alert-color: #f0b27a;
}

/* ---------- Footer & toasts ---------- */
.app-footer {
    padding: 1.5rem 0 2rem;
    color: var(--muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
}

.toast {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
}

.toast.toast-error {
    border-color: rgba(218, 54, 51, 0.6);
}

.toast.toast-ok {
    border-color: var(--border-strong);
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}


/* ================================
   Section Heading
================================ */
.page-hero-title {
    font-weight: 800;
    display: block;
    font-size: clamp(2.2rem, 5.5vw, 3.75rem);
    background: linear-gradient(to right, #a3c43a, #a866ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    /* line-height: 1.02; */
    /* font-family: 'Bricolage Grotesque', 'DM Sans', sans-serif;
    font-size: clamp(2.2rem, 5.5vw, 3.75rem);
    letter-spacing: -0.035em;
    line-height: 1.02;
    margin-bottom: 1rem; */
}

.section-heading {
    max-width: 700px;

    margin: 100px auto 45px;
}

.section-tag {
    display: inline-block;

    margin-bottom: 12px;

    color: var(--primary);

    font-size: 12px;
    font-weight: 750;
    letter-spacing: 1px;
}

.section-heading h2 {
    margin-bottom: 12px;

    font-size: clamp(26px, 4vw, 34px);
    font-weight: 750;
    letter-spacing: -0.8px;
}

.section-heading p {
    margin: 0;

    color: var(--muted);
}



/* ================================
   Feature Cards
================================ */

.feature-card {
    height: 100%;

    padding: 26px;

    border: 1px solid var(--border);
    border-radius: 16px;

    background: var(--white);

    box-shadow: var(--shadow-sm);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    width: 48px;
    height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 20px;

    border-radius: 12px;

    background: rgba(108, 92, 231, 0.10);

    color: var(--primary);

    font-size: 22px;
}

.feature-card h4 {
    margin-bottom: 10px;
    font-size: 17px;
    font-weight: 700;
}

.feature-card p {
    margin: 0;

    color: var(--muted);

    font-size: 14px;
    line-height: 1.7;
}

/* ================================
   How To Section
================================ */

.how-section {
    padding-bottom: 20px;
}

.steps-container {
    display: flex;
    align-items: flex-start;

    gap: 15px;

    max-width: 1100px;

    margin: 0 auto;
    margin-bottom: 50px;
}

.step {
    flex: 1;

    text-align: center;
}

.step-number {
    width: 48px;
    height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin: 0 auto 18px;

    border-radius: 50%;

    background: var(--primary);

    color: var(--dark);

    font-weight: 750;
}

.step h4 {
    margin-bottom: 8px;

    font-size: 16px;
    font-weight: 700;
}

.step p {
    margin: 0;

    color: var(--muted);

    font-size: 13px;
    line-height: 1.6;
}

.step-line {
    width: 70px;
    height: 1px;

    margin-top: 24px;

    background: var(--primary);
}



.faq-search input {
    background: unset;
}

.faq-contact-card {
    background: var(--dark);
}


/* .faq-cat-btn {
    background: var(--ink-faint);
} */

.faq-cat-btn:hover {
    background: var(--ink);
    color: var(--line);
}