/* استوديو كارتك جو — ثيم Signal Ping (متناسق مع kartek-go.net) */
:root {
    --bg: #f5f1e6;
    --bg-soft: #efe9d8;
    --card: #ffffff;
    --ink: #182420;
    --muted: #5f6f68;
    --line: #e6dfcd;
    --teal: #0f6b62;
    --teal-deep: #0a4a45;
    --teal-bright: #1fae9d;
    --teal-light: #e8f7f4;
    --teal-glow: rgba(31, 174, 157, 0.18);
    --amber: #dda12b;
    --amber-soft: #f7e7c2;
    --accent: var(--teal);
    --accent-dark: var(--teal-deep);
    --accent-soft: var(--teal-light);
    --text: var(--ink);
    --border: var(--line);
    --shadow: 0 14px 40px rgba(10, 50, 45, 0.08);
    --shadow-lg: 0 20px 48px rgba(5, 35, 32, 0.14);
    --radius: 20px;
    --grad-cta: linear-gradient(135deg, var(--teal-deep) 0%, var(--teal) 55%, var(--teal-bright) 100%);
    --grad-hero-soft: radial-gradient(120% 80% at 50% -20%, rgba(31, 174, 157, 0.12), transparent 55%);
    --font-body: 'Cairo', Tahoma, 'Segoe UI', 'Noto Sans Arabic', Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    background-image: var(--grad-hero-soft);
    color: var(--text);
    font: 600 14px/1.7 var(--font-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.45; }
i { font-size: 1.05em; }

/* Bootstrap Icons — لا ترث Cairo/وزن عريض وإلا تظهر مربعات فارغة */
.shell .bi,
.shell .bi::before {
    font-family: "bootstrap-icons" !important;
    font-style: normal;
    font-weight: 400 !important;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    vertical-align: -0.125em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.shell { max-width: 1480px; margin: 0 auto; padding: 16px 20px 40px; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 15px;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 19px;
    background: var(--card);
    box-shadow: var(--shadow);
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}
.brand-logo {
    height: 40px;
    width: auto;
    max-width: min(168px, 42vw);
    object-fit: contain;
    flex-shrink: 0;
}
.brand-divider {
    width: 1px;
    height: 36px;
    background: var(--line);
    flex-shrink: 0;
}
.brand-copy strong {
    display: block;
    font-size: 16px;
    font-weight: 900;
    line-height: 1.45;
    color: var(--teal-deep);
}
.brand-copy small {
    display: block;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
}
.brand-copy .accent-dot { color: var(--amber); }
.topbar-side { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.header-note {
    color: var(--teal-deep);
    background: var(--teal-light);
    border: 1px solid rgba(15, 107, 98, 0.15);
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 800;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s, border-color 0.15s;
}
a.header-note:hover {
    background: #dff5f0;
    border-color: rgba(31, 174, 157, 0.35);
}
.header-note--amber {
    background: var(--amber-soft);
    border-color: rgba(221, 161, 43, 0.25);
    color: #7a5a12;
}
.header-note-text--short { display: none; }

.studio-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 6px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
}
.studio-step {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 100px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.studio-step__num {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--bg-soft);
    border: 1.5px solid var(--line);
    font-size: 12px;
    font-weight: 900;
    color: var(--teal-deep);
}
.studio-step.is-active {
    color: var(--teal-deep);
    background: var(--teal-light);
    box-shadow: inset 0 0 0 1px rgba(31, 174, 157, 0.2);
}
.studio-step.is-active .studio-step__num {
    background: var(--grad-cta);
    border-color: transparent;
    color: #fff;
}
.studio-step.is-done .studio-step__num {
    background: var(--teal-light);
    border-color: var(--teal-bright);
    color: var(--teal);
}
.studio-step__arrow {
    color: var(--line);
    font-size: 14px;
    opacity: 0.85;
}

.studio {
    display: grid;
    grid-template-columns: minmax(240px, 290px) minmax(360px, 1fr) minmax(268px, 310px);
    grid-template-areas: 'library stage controls';
    gap: 16px;
    align-items: start;
}
.panel {
    min-width: 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}
.panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--teal-deep), var(--teal-bright), var(--amber));
    opacity: 0.85;
}
.controls { grid-area: controls; padding: 18px 18px 20px; }
.stage { grid-area: stage; padding: 16px; }
.library { grid-area: library; padding: 16px; }
.panel--stage::before { opacity: 1; height: 4px; }
.panel-lead {
    margin: -4px 0 14px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.75;
    color: var(--muted);
}
.control-block {
    padding: 14px;
    border-radius: 14px;
    background: linear-gradient(180deg, #fdfcf9 0%, #fff 100%);
    border: 1px solid var(--line);
    margin-bottom: 12px;
}
.field--highlight input {
    border-color: rgba(15, 107, 98, 0.25);
    background: #fff;
}
.field--focus select {
    border-color: var(--teal-bright);
    background: var(--teal-light);
}
.inline-val {
    font-weight: 900;
    color: var(--teal);
    font-size: 11px;
}
.color-row-label {
    margin: 4px 0 0;
    font-size: 11px;
    font-weight: 800;
    color: var(--muted);
}
.color-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.color-swatch {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    cursor: pointer;
    margin: 0;
}
.color-swatch__box {
    display: block;
    width: 100%;
    height: 52px;
    border-radius: 12px;
    background: var(--swatch, #ccc);
    border: 2px solid rgba(15, 107, 98, 0.22);
    box-shadow:
        inset 0 2px 6px rgba(0, 0, 0, 0.08),
        0 2px 8px rgba(15, 107, 98, 0.1);
    transition: transform 0.12s, box-shadow 0.12s;
}
.color-swatch:hover .color-swatch__box {
    transform: translateY(-1px);
    box-shadow:
        inset 0 2px 6px rgba(0, 0, 0, 0.08),
        0 4px 14px rgba(15, 107, 98, 0.16);
}
.color-swatch__name {
    font-size: 10px;
    font-weight: 800;
    color: var(--muted);
    text-align: center;
    line-height: 1.35;
}
.color-swatch {
    position: relative;
}
.color-swatch__input {
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 52px;
    margin: 0;
    padding: 0;
    border: none;
    opacity: 0;
    cursor: pointer;
}
.field-grid--coords {
    grid-template-columns: repeat(3, 1fr);
}
.advanced-intro {
    margin: 0;
    font-size: 10px;
    font-weight: 700;
    color: var(--muted);
    line-height: 1.7;
    padding: 8px 10px;
    border-radius: 10px;
    background: var(--bg-soft);
}
.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 13px;
}
.panel-heading h2 {
    font-size: 15px;
    font-weight: 900;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--teal-deep);
}
.panel-heading h2 i { color: var(--teal-bright); }
.panel-heading .hint { font-size: 10px; color: var(--muted); }

.fields { display: grid; gap: 11px; }
.field label {
    display: block;
    margin-bottom: 5px;
    font-size: 11px;
    font-weight: 800;
    color: var(--muted);
}
.field input,
.field select {
    width: 100%;
    height: 44px;
    min-width: 0;
    padding: 9px 11px;
    border-radius: 11px;
    outline: none;
    border: 1.5px solid var(--line);
    background: #fdfcf9;
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
}
.field input:focus,
.field select:focus {
    border-color: var(--teal-bright);
    background: #fff;
    box-shadow: 0 0 0 3px var(--teal-glow);
}
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.field input[type="color"] { padding: 4px; height: 38px; cursor: pointer; }

.intro { color: var(--muted); font-size: 11px; line-height: 1.8; margin: 10px 0 0; }
.advanced {
    margin-top: 13px;
    border: 1px solid var(--border);
    border-radius: 13px;
    overflow: hidden;
}
.advanced summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--bg-soft);
    cursor: pointer;
    list-style: none;
    color: var(--teal-deep);
    user-select: none;
    min-height: 52px;
}
.advanced summary::-webkit-details-marker { display: none; }
.advanced-summary__chev {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #fff;
    border: 2px solid rgba(15, 107, 98, 0.35);
    color: var(--teal-deep);
    font-size: 16px;
    line-height: 1;
    transition: transform 0.2s ease, background 0.15s, border-color 0.15s;
}
.advanced-summary__chev .bi,
.advanced-summary__svg {
    display: block;
    color: var(--teal-deep);
}
.advanced[open] .advanced-summary__chev {
    transform: rotate(180deg);
    background: var(--teal-light);
    border-color: var(--teal-bright);
}
.advanced-summary__icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--grad-cta);
    color: #fff;
    font-size: 17px;
    line-height: 1;
    box-shadow: 0 4px 14px rgba(15, 107, 98, 0.28);
}
.advanced-summary__icon .bi,
.advanced-summary__icon .advanced-summary__svg {
    display: block;
    color: #fff;
}
.advanced-summary__title {
    font-size: 12px;
    font-weight: 900;
    line-height: 1.35;
    flex: 1;
    min-width: 0;
}
.advanced-summary__sub {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 700;
    color: var(--muted);
    padding: 4px 8px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid var(--line);
    white-space: nowrap;
}
.advanced-content { padding: 12px 14px 14px; display: grid; gap: 10px; border-top: 1px solid var(--line); background: #fff; }
.edit-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.range-input { accent-color: var(--teal); width: 100%; }
.edit-tip { font-size: 10px; color: var(--muted); line-height: 1.8; }
.checkbox-line {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 11px;
    color: var(--muted);
}
.checkbox-line input { accent-color: var(--teal); }

.stage-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}
.stage-title-wrap { min-width: 0; }
.stage-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    margin-bottom: 6px;
    border-radius: 100px;
    font-size: 10px;
    font-weight: 900;
    color: var(--teal-deep);
    background: var(--teal-light);
    border: 1px solid rgba(31, 174, 157, 0.25);
}
.stage-title { font-size: 15px; font-weight: 900; color: var(--teal-deep); line-height: 1.45; }
.stage-title small {
    font-size: 11px;
    color: var(--muted);
    font-weight: 700;
    display: block;
    margin-top: 4px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}
.stage-tools { display: flex; gap: 6px; }
.icon-btn {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #fff;
    color: var(--teal-deep);
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.icon-btn:hover {
    background: var(--teal-light);
    border-color: rgba(31, 174, 157, 0.35);
}
.icon-btn:active { transform: scale(0.96); }

.panel--stage {
    position: sticky;
    top: 12px;
}
.stage-viewport {
    min-height: 520px;
    border-radius: 18px;
    background:
        radial-gradient(ellipse 80% 50% at 50% 0%, rgba(31, 174, 157, 0.08), transparent 55%),
        linear-gradient(180deg, #fff 0%, var(--bg-soft) 100%);
    border: 1px solid var(--line);
    display: grid;
    place-items: center;
    padding: 18px;
    position: relative;
    overflow: hidden;
}
.canvas-holder {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    min-width: 0;
    max-height: 690px;
}
canvas {
    display: block;
    max-width: 100%;
    max-height: 685px;
    width: auto;
    height: auto;
    background: #fff;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    touch-action: none;
    cursor: grab;
}
canvas.dragging { cursor: grabbing; }
.canvas-alert {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    padding: 22px;
    background: var(--teal-light);
    border: 1px dashed rgba(15, 107, 98, 0.35);
    border-radius: 12px;
    color: var(--teal-deep);
}
.canvas-alert.show { display: flex; }
.canvas-alert i { font-size: 38px; color: var(--teal-bright); }
.canvas-alert strong { font-size: 14px; }
.canvas-alert small {
    font-size: 11px;
    max-width: 310px;
    line-height: 1.8;
    margin-top: 5px;
    overflow-wrap: anywhere;
}

.stage-bottom {
    display: flex;
    gap: 8px;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}
.stage-bottom .status { color: var(--muted); font-size: 11px; }
.download-actions { display: flex; gap: 7px; }
.primary-btn,
.secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 41px;
    padding: 8px 16px;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 900;
    border: 1px solid transparent;
}
.primary-btn {
    background: var(--grad-cta);
    color: #fff;
    box-shadow: 0 10px 26px rgba(13, 148, 136, 0.22);
}
.primary-btn--lg {
    height: 44px;
    padding-inline: 20px;
    font-size: 13px;
}
.secondary-btn {
    background: var(--teal-light);
    color: var(--teal-deep);
    border-color: rgba(15, 107, 98, 0.2);
}
.primary-btn:hover,
.secondary-btn:hover { filter: brightness(0.98); }

.library-heading { margin: 0 0 10px; }
.library-heading h2 { margin: 0; font-size: 15px; font-weight: 900; color: var(--teal-deep); }
.library-heading p { margin: 1px 0 0; color: var(--muted); font-size: 10px; }
.library-heading h2 i { color: var(--teal-bright); }

.wallet-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.wallet-tab {
    border: 1px solid var(--line);
    background: #fdfcf9;
    color: var(--muted);
    border-radius: 100px;
    padding: 8px 12px;
    font-weight: 900;
    font-size: 11px;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.wallet-tab:hover:not(.active) {
    border-color: rgba(31, 174, 157, 0.35);
    color: var(--teal-deep);
}
.wallet-tab.active {
    background: var(--grad-cta);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 6px 16px rgba(15, 107, 98, 0.2);
}

.gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    max-height: 710px;
    overflow-y: auto;
    scrollbar-width: thin;
}
.design-tile {
    position: relative;
    text-align: right;
    border: 2px solid transparent;
    border-radius: 13px;
    padding: 5px;
    background: var(--bg-soft);
    min-width: 0;
}
.design-tile.active {
    border-color: var(--teal-bright);
    background: var(--teal-light);
    box-shadow: 0 0 0 1px rgba(31, 174, 157, 0.15);
}
.thumb {
    aspect-ratio: 4/5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(120deg, var(--line), #fff);
    border-radius: 10px;
    position: relative;
}
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.thumb i { color: var(--teal); font-size: 22px; opacity: 0.7; }
.thumb-title {
    font-size: 10px;
    font-weight: 900;
    display: block;
    margin: 5px 3px 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--ink);
}
.thumb-error { display: block; font-size: 9px; color: #b44747; margin: 0 3px 3px; }
.empty {
    padding: 30px 12px;
    text-align: center;
    border: 1px dashed var(--line);
    border-radius: 14px;
    color: var(--muted);
    grid-column: 1 / -1;
}
.empty i { font-size: 26px; display: block; margin-bottom: 8px; color: var(--teal); }
.empty strong { display: block; font-size: 13px; color: var(--teal-deep); }
.empty span { display: block; font-size: 10px; margin: 6px 0 13px; line-height: 1.7; }

.importer { margin-top: 12px; }
.importer button { width: 100%; }
.footer-note { margin-top: 11px; font-size: 10px; line-height: 1.8; color: var(--muted); }
.mobile-actionbar { display: none; }
.toast {
    position: fixed;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    opacity: 0;
    pointer-events: none;
    z-index: 9999;
    max-width: min(450px, 90vw);
    background: var(--teal-deep);
    color: #fff;
    border-radius: 12px;
    padding: 10px 14px;
    box-shadow: var(--shadow-lg);
    font-size: 12px;
    text-align: center;
    transition: 0.2s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 1120px) {
    .panel--stage { position: static; }
    .studio {
        grid-template-columns: minmax(280px, 1fr) minmax(300px, 1.15fr);
        grid-template-areas: 'stage stage' 'library controls';
    }
    .library .gallery {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        max-height: none;
    }
    .wallet-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 5px; }
    .importer { max-width: 500px; }
    .stage-viewport { min-height: 510px; }
}

@media (max-width: 700px) {
    body { background: var(--bg); }
    .shell { padding: 10px 12px calc(78px + env(safe-area-inset-bottom)); max-width: 560px; }
    .topbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px 12px 11px;
        margin-bottom: 10px;
        border-radius: 16px;
    }
    .brand {
        width: 100%;
        gap: 10px;
        min-width: 0;
    }
    .brand-logo {
        height: 34px;
        max-width: 120px;
    }
    .brand-divider { display: none; }
    .brand-copy {
        min-width: 0;
        flex: 1;
    }
    .brand-copy strong {
        font-size: 15px;
        line-height: 1.35;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .brand-copy small { display: none; }
    .topbar-side {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .header-note {
        justify-content: center;
        font-size: 11px;
        padding: 9px 10px;
        min-height: 40px;
    }
    .header-note--home .header-note-text { display: none; }
    .header-note--home i { font-size: 1.15em; }
    .header-note-text--long { display: none; }
    .header-note-text--short { display: inline; }
    .studio-steps {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
        padding: 10px 8px;
        margin-bottom: 10px;
    }
    .studio-step {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: 4px;
        padding: 8px 4px;
        border-radius: 12px;
    }
    .studio-step__text {
        font-size: 9px;
        line-height: 1.35;
        max-width: 100%;
    }
    .studio-step__arrow { display: none; }
    .studio-step__num {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }
    .panel-lead { display: none; }
    .color-row { grid-template-columns: repeat(3, 1fr); }
    .field-grid--coords { grid-template-columns: 1fr 1fr; }
    .field-grid--coords .field:last-child { grid-column: 1 / -1; }
    .studio { display: flex; flex-direction: column; gap: 8px; }
    .stage, .controls, .library { width: 100%; padding: 10px; border-radius: 15px; }
    .stage { order: 1; }
    .controls { order: 2; }
    .library { order: 3; }
    .stage-top {
        margin-bottom: 8px;
        flex-wrap: wrap;
        gap: 8px;
    }
    .stage-title-wrap { flex: 1; min-width: min(100%, 200px); }
    .stage-badge { font-size: 9px; padding: 3px 8px; margin-bottom: 4px; }
    .stage-title { font-size: 13px; }
    .stage-title small { font-size: 10px; line-height: 1.45; }
    .stage-tools { margin-inline-start: auto; }
    .stage-viewport {
        min-height: 0;
        height: auto;
        padding: 8px;
        border-radius: 11px;
        overflow: visible;
    }
    .canvas-holder { height: auto; max-height: none; min-height: 0; }
    canvas {
        max-height: none;
        max-width: 100%;
        box-shadow: 0 5px 20px rgba(5, 35, 32, 0.12);
        border-radius: 5px;
    }
    .thumb img { object-fit: contain; }
    .canvas-alert { border-radius: 8px; }
    .stage-bottom { margin-top: 7px; }
    .stage-bottom .status { font-size: 9px; }
    .stage-bottom .download-actions { display: none; }
    .panel-heading { margin-bottom: 7px; }
    .panel-heading h2 { font-size: 12px; }
    .fields { gap: 7px; }
    .field label { margin-bottom: 2px; font-size: 10px; }
    .field input, .field select {
        height: 36px;
        padding: 5px 10px;
        font-size: 12px;
        border-radius: 9px;
    }
    .field-grid { gap: 7px; }
    .intro { display: none; }
    .advanced { margin-top: 9px; }
    .advanced summary { padding: 10px 12px; gap: 8px; min-height: 48px; }
    .advanced-summary__sub { display: none; }
    .advanced-summary__title { font-size: 11px; }
    .advanced-content { gap: 7px; }
    .library-heading { margin-bottom: 8px; }
    .library-heading h2 { font-size: 12px; }
    .library-heading p { font-size: 9px; }
    .wallet-tabs {
        margin-bottom: 8px;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 5px;
        scrollbar-width: none;
    }
    .wallet-tabs::-webkit-scrollbar { display: none; }
    .wallet-tab { padding: 7px 11px; font-size: 10px; border-radius: 20px; flex-shrink: 0; }
    .library .gallery {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 8px;
        max-height: none;
        padding-bottom: 5px;
        scroll-snap-type: x mandatory;
    }
    .design-tile { flex: 0 0 90px; scroll-snap-align: start; padding: 4px; border-radius: 10px; }
    .thumb { border-radius: 7px; }
    .thumb-title { font-size: 9px; margin: 4px 1px 0; }
    .empty { flex: 1; min-width: 100%; padding: 15px; }
    .importer { margin-top: 8px; }
    .importer button { padding: 7px 10px; height: 36px; font-size: 10px; flex: 0 0 auto; }
    .footer-note { font-size: 9px; margin-top: 6px; }
    .mobile-actionbar {
        position: fixed;
        z-index: 120;
        bottom: 0;
        left: 0;
        right: 0;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        padding: 9px 10px calc(9px + env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, 0.96);
        border-top: 1px solid var(--border);
        box-shadow: 0 -4px 22px rgba(5, 35, 32, 0.08);
        backdrop-filter: blur(14px);
    }
    .mobile-actionbar .primary-btn,
    .mobile-actionbar .secondary-btn { width: 100%; height: 42px; font-size: 12px; }
}

@media (max-width: 380px) {
    .shell { padding-inline: 8px; }
    .stage, .controls, .library { padding: 8px; }
    .brand-copy strong { font-size: 14px; }
    .brand-logo { max-width: 100px; height: 30px; }
}
