/* ============================================
   Mii Maker — Modern UI
   Inspired by the clean aesthetic of
   morsecodetranslator.com
   ============================================ */

@font-face {
    font-family: 'CTMKF';
    font-style: normal;
    font-weight: 400;
    src: url(font/ctmkf.ttf);
    unicode-range: U+2460-246E, U+E000-E01C, U+E028, U+E068-E06B, U+F000-F12F;
}

/* ---------- Design Tokens ---------- */
:root {
    --clr-bg: #0b0e17;
    --clr-surface: #111520;
    --clr-card: #181d2d;
    --clr-card-hover: #1e2440;
    --clr-border: #262d48;
    --clr-border-light: #323a5a;

    --clr-text: #eef0f7;
    --clr-text-secondary: #9498b0;
    --clr-text-muted: #6b7094;

    --clr-primary: #ff6b6b;
    --clr-primary-hover: #ff5252;
    --clr-primary-dim: rgba(255, 107, 107, .12);

    --clr-accent: #48dbfb;
    --clr-accent-hover: #2dd4fa;
    --clr-accent-dim: rgba(72, 219, 251, .12);

    --clr-success: #51cf66;
    --clr-success-hover: #40c057;

    --clr-gold: #ffd93d;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, .35);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, .45);
    --shadow-glow: 0 0 20px rgba(255, 107, 107, .15);

    --font-sans: 'DM Sans', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', monospace;
}

/* ---------- Reset ---------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    min-height: 100%;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--clr-bg);
    color: var(--clr-text);
    line-height: 1.6;
    min-height: 100vh;
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(255, 107, 107, .04) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(72, 219, 251, .04) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(162, 155, 254, .03) 0%, transparent 50%);
}

/* ---------- File Input (hidden) ---------- */
input[type="file"] {
    display: none;
}

/* ---------- App Container ---------- */
.app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 24px 48px;
}

/* ============================================
   HEADER
   ============================================ */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 28px;
    margin-bottom: 28px;
    background: var(--clr-card);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.header-logo svg {
    display: block;
    filter: drop-shadow(0 0 8px rgba(255, 107, 107, .3));
}

.header-title {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.header-subtitle {
    font-size: 0.75rem;
    color: var(--clr-text-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 500;
}

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

.header-divider {
    width: 1px;
    height: 28px;
    background: var(--clr-border);
    margin: 0 4px;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all .2s ease;
    outline: none;
    white-space: nowrap;
    line-height: 1;
}
.btn svg {
    flex-shrink: 0;
}

.btn-primary {
    background: var(--clr-primary);
    color: #fff;
    border-color: var(--clr-primary);
}
.btn-primary:hover {
    background: var(--clr-primary-hover);
    border-color: var(--clr-primary-hover);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}
.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--clr-surface);
    color: var(--clr-text);
    border-color: var(--clr-border);
}
.btn-secondary:hover {
    background: var(--clr-border);
    border-color: var(--clr-border-light);
    color: #fff;
    transform: translateY(-1px);
}
.btn-secondary:active {
    transform: translateY(0);
}

.btn-success {
    background: var(--clr-success);
    color: #0b0e17;
    border-color: var(--clr-success);
}
.btn-success:hover {
    background: var(--clr-success-hover);
    border-color: var(--clr-success-hover);
    transform: translateY(-1px);
}
.btn-success:active {
    transform: translateY(0);
}

.btn-accent {
    background: var(--clr-accent);
    color: #0b0e17;
    border-color: var(--clr-accent);
}
.btn-accent:hover {
    background: var(--clr-accent-hover);
    border-color: var(--clr-accent-hover);
    transform: translateY(-1px);
}
.btn-accent:active {
    transform: translateY(0);
}

.btn-outline {
    background: transparent;
    color: var(--clr-text-secondary);
    border-color: var(--clr-border);
}
.btn-outline:hover {
    background: var(--clr-card-hover);
    border-color: var(--clr-border-light);
    color: var(--clr-text);
}

.btn-ghost {
    background: transparent;
    color: var(--clr-text-secondary);
    border-color: transparent;
}
.btn-ghost:hover {
    background: var(--clr-surface);
    color: var(--clr-text);
}

.btn-full {
    width: 100%;
    justify-content: center;
    padding: 10px 16px;
}

/* ---------- Language Toggle ---------- */
.lang-toggle {
    display: flex;
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}

.lang-btn {
    padding: 8px 10px;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--clr-text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all .2s ease;
    line-height: 1;
    min-width: 32px;
    text-align: center;
}

.lang-btn:not(.lang-btn-active):hover {
    color: var(--clr-text-secondary);
    background: var(--clr-card-hover);
}

.lang-btn-active {
    color: #fff;
    background: var(--clr-primary);
    box-shadow: 0 1px 4px rgba(255, 107, 107, .3);
}

.lang-btn:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.lang-btn:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ---------- Toggle Buttons ---------- */
.btn-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    padding: 5px 14px;
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 600;
    background: var(--clr-surface);
    color: var(--clr-text);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all .2s ease;
}
.btn-toggle:hover {
    background: var(--clr-border);
    border-color: var(--clr-border-light);
}
.btn-icon-toggle {
    min-width: 40px;
    padding: 5px 10px;
}
.btn-icon-toggle img {
    display: block;
    width: 18px;
    height: 18px;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--clr-card);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: border-color .25s ease, box-shadow .25s ease;
}
.card:hover {
    border-color: var(--clr-border-light);
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 20px 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--clr-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.card-header svg {
    opacity: .7;
}

.card-body {
    padding: 12px 20px 20px;
}

/* ============================================
   EDITOR GRID
   ============================================ */
.editor-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    align-items: start;
}

.editor-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.editor-sidebar {
    position: sticky;
    top: 24px;
}

/* ---------- Name Form ---------- */
.nameForm {
    display: grid;
    grid-template:
        "mn mnt"
        "cn cnt"
        / auto 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

#mn { grid-area: mn; }
#mnt { grid-area: mnt; }
#cn { grid-area: cn; }
#cnt { grid-area: cnt; }

/* ---------- Form Elements ---------- */
.field-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--clr-text-secondary);
    display: flex;
    align-items: center;
}

.input {
    width: 100%;
    padding: 8px 12px;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--clr-text);
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.input:focus {
    border-color: var(--clr-primary);
    box-shadow: 0 0 0 3px var(--clr-primary-dim);
}
.input::placeholder {
    color: var(--clr-text-muted);
}

.select {
    padding: 8px 32px 8px 12px;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--clr-text);
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-sm);
    outline: none;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239498b0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}
.select:focus {
    border-color: var(--clr-primary);
    box-shadow: 0 0 0 3px var(--clr-primary-dim);
}

.form-row {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    flex-wrap: wrap;
}

.versionForm {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.checkboxForm {
    display: flex;
    gap: 16px;
    align-items: center;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    user-select: none;
}
.checkbox-wrapper input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--clr-surface);
    border: 2px solid var(--clr-border);
    border-radius: 4px;
    cursor: pointer;
    transition: all .2s;
    flex-shrink: 0;
}
.checkbox-wrapper input[type="checkbox"]:checked {
    background: var(--clr-primary);
    border-color: var(--clr-primary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-position: center;
    background-repeat: no-repeat;
}
.checkbox-wrapper input[type="checkbox"]:focus-visible {
    box-shadow: 0 0 0 3px var(--clr-primary-dim);
}
.checkbox-label {
    font-size: 0.82rem;
    color: var(--clr-text-secondary);
}

/* ---------- ID Form ---------- */
.idForm {
    display: grid;
    grid-template:
        "mi mit"
        "ci cit0"
        ".  cit1"
        "maci macit0"
        ".... macit1"
        / auto 1fr;
    gap: 10px;
}
#mi { grid-area: mi; }
#mit { grid-area: mit; }
#ci { grid-area: ci; }
#cit0 { grid-area: cit0; }
#cit1 { grid-area: cit1; }
#maci { grid-area: maci; }
#macit0 { grid-area: macit0; }
#macit1 { grid-area: macit1; }

.id-group {
    display: flex;
    align-items: center;
    gap: 2px;
}
.id-group-cont {
    padding-left: 0;
}

.id-input {
    width: 36px;
    padding: 6px 4px;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.id-sep {
    color: var(--clr-text-muted);
    font-size: 0.8rem;
    font-weight: 300;
    user-select: none;
}

.num-input {
    width: 56px;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.82rem;
}

/* ---------- Slider Form ---------- */
.sliderForm {
    display: grid;
    grid-template:
        "h hs ht"
        "w ws wt"
        / auto 1fr auto;
    gap: 12px 14px;
    align-items: center;
}

#h { grid-area: h; }
#hs { grid-area: hs; }
#ht { grid-area: ht; }
#w { grid-area: w; }
#ws { grid-area: ws; }
#wt { grid-area: wt; }

/* Custom Range Slider */
.range-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: var(--clr-surface);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    transition: background .2s;
}
.range-slider::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 3px;
    background: var(--clr-surface);
}
.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--clr-primary);
    border: 3px solid var(--clr-card);
    cursor: pointer;
    margin-top: -6px;
    box-shadow: 0 0 0 2px var(--clr-border), 0 2px 6px rgba(0,0,0,.3);
    transition: all .2s;
}
.range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 12px rgba(255, 107, 107, .4), 0 0 0 2px var(--clr-primary);
}
.range-slider::-moz-range-track {
    height: 6px;
    border-radius: 3px;
    background: var(--clr-surface);
    border: none;
}
.range-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--clr-primary);
    border: 3px solid var(--clr-card);
    cursor: pointer;
    box-shadow: 0 0 0 2px var(--clr-border);
}
.range-slider:focus-visible {
    outline: none;
}
.range-slider:focus-visible::-webkit-slider-thumb {
    box-shadow: 0 0 0 4px var(--clr-primary-dim), 0 0 0 2px var(--clr-border);
}

/* ---------- Settings Grid ---------- */
.settings-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.birthForm {
    display: flex;
    gap: 12px;
    margin-top: 6px;
}
.birthForm div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.birth-label {
    font-size: 0.72rem;
    color: var(--clr-text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.birth-input {
    width: 68px;
    padding: 6px 10px;
    text-align: center;
}

.toggle-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}
.toggle-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.toggle-row .field-label {
    min-width: 84px;
}

.select-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}
.select-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.select-row .field-label {
    min-width: 84px;
}

/* ---------- Color Grid ---------- */
.color-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.colorForm {
    display: flex;
    gap: 12px;
}

/* Color swatches — uses classNames set by script.js (selectColor/notSelectColor) */
.selectColor, .notSelectColor {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--swatch);
    cursor: pointer;
    transition: all .25s ease;
    box-shadow: 0 0 0 2px var(--clr-surface), 0 2px 8px rgba(0,0,0,.4);
}
.selectColor {
    box-shadow: 0 0 0 3px var(--clr-primary), 0 0 14px rgba(255, 107, 107, .4);
    transform: scale(1.1);
}
.notSelectColor {
    opacity: .85;
}
.notSelectColor:hover {
    opacity: 1;
    transform: scale(1.15);
    z-index: 2;
}

/* ---------- MKWii Symbols Table ---------- */
#table {
    font-family: 'CTMKF', serif;
    font-size: 26px;
    line-height: 1.8;
    color: var(--clr-text);
    letter-spacing: 0.45em;
}
#table span {
    display: inline;
}

/* Also apply symbol font to name inputs */
#miiName, #creatorName {
    font-family: 'CTMKF', var(--font-sans);
}

/* ---------- Preview Card ---------- */
.preview-card {
    position: sticky;
    top: 24px;
}

.preview-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.preview-frame {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    background: var(--clr-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--clr-border);
    position: relative;
}
.preview-frame::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-md);
    box-shadow: inset 0 0 30px rgba(0,0,0,.3);
    pointer-events: none;
}
#miiPreview {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: auto;
}

/* ============================================
   OVERLAYS (QR, Camera, Loading)
   ============================================ */
#qrForm, #qrReadWait, #qrCamera {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, .7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
}
#qrForm[style*="display: block"],
#qrReadWait[style*="display: block"],
#qrCamera[style*="display: block"] {
    display: flex !important;
}

.overlay-content {
    background: var(--clr-card);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    max-width: 520px;
    width: 90%;
    animation: overlayIn .3s ease;
}
.overlay-content-sm {
    max-width: 440px;
}

.overlay-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--clr-border);
}
.overlay-header h2 {
    font-size: 1rem;
    font-weight: 600;
}
.overlay-actions {
    display: flex;
    gap: 8px;
}
.overlay-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.qr-image {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    image-rendering: pixelated;
}

/* ---------- Loading ---------- */
.loading-body {
    padding: 40px 24px;
    text-align: center;
    gap: 12px;
}
.loading-body p {
    color: var(--clr-text-secondary);
    font-size: 0.9rem;
}
.loading-sub {
    font-size: 0.78rem !important;
    color: var(--clr-text-muted) !important;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--clr-border);
    border-top-color: var(--clr-primary);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

/* ---------- Camera ---------- */
.camera-feed {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: var(--radius-md);
    background: #000;
}
#camera {
    display: block;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes overlayIn {
    from {
        opacity: 0;
        transform: scale(.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   SEO CONTENT
   ============================================ */
.seo-content {
    max-width: 1200px;
    margin: 32px auto 0;
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.seo-card {
    padding: 28px;
}

.seo-heading {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--clr-text);
    margin-bottom: 12px;
    letter-spacing: -0.01em;
    line-height: 1.4;
}

.seo-text {
    font-size: 0.88rem;
    color: var(--clr-text-secondary);
    line-height: 1.7;
    margin-bottom: 10px;
}
.seo-text:last-child {
    margin-bottom: 0;
}

.seo-list {
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.seo-list li {
    font-size: 0.88rem;
    color: var(--clr-text-secondary);
    line-height: 1.65;
}
.seo-list li::marker {
    color: var(--clr-primary);
}

.seo-subheading {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--clr-text);
    margin-top: 16px;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
    line-height: 1.4;
}
.seo-subheading:first-of-type {
    margin-top: 0;
}

/* FAQ */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.faq-item {
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: border-color .2s ease;
    background: var(--clr-surface);
}
.faq-item[open] {
    border-color: var(--clr-border-light);
}

.faq-question {
    padding: 12px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--clr-text);
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background .2s ease;
    list-style: none;
}
.faq-question h3 {
    font-size: inherit;
    font-weight: inherit;
    margin: 0;
    color: inherit;
    line-height: inherit;
}
.faq-question::-webkit-details-marker,
.faq-question::marker {
    display: none;
}
.faq-question::before {
    content: '+';
    font-size: 1rem;
    font-weight: 700;
    color: var(--clr-primary);
    flex-shrink: 0;
    width: 20px;
    text-align: center;
    line-height: 1;
}
.faq-item[open] .faq-question::before {
    content: '−';
}
.faq-question:hover {
    background: rgba(255, 255, 255, .03);
}

.faq-answer {
    padding: 0 16px 14px;
    font-size: 0.85rem;
    color: var(--clr-text-secondary);
    line-height: 1.65;
    margin: 0;
}

/* ============================================
   FOOTER
   ============================================ */
.app-footer {
    margin-top: 48px;
    padding: 0 24px 32px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.footer-inner {
    border-top: 1px solid var(--clr-border);
    padding-top: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--clr-text);
}

.footer-copyright {
    font-size: 0.78rem;
    color: var(--clr-text-muted);
    line-height: 1.5;
}

.footer-attribution {
    font-size: 0.75rem;
    color: var(--clr-text-muted);
}
.footer-attribution a {
    color: var(--clr-text-secondary);
    text-decoration: none;
    transition: color .2s ease;
}
.footer-attribution a:hover {
    color: var(--clr-primary);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
    .editor-grid {
        grid-template-columns: 1fr;
    }
    .editor-sidebar {
        position: static;
    }
    .app-header {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }
    .header-actions {
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .app {
        padding: 12px;
    }
    .app-header {
        padding: 16px;
        border-radius: var(--radius-lg);
    }
    .header-actions {
        gap: 6px;
    }
    .header-actions .btn span {
        display: none;
    }
    .header-actions .btn {
        padding: 8px 10px;
    }
    .header-divider {
        display: none;
    }
    .lang-btn {
        padding: 6px 8px;
        font-size: 0.7rem;
        min-width: 28px;
    }
    .card {
        border-radius: var(--radius-md);
    }
    .card-body {
        padding: 12px 16px 16px;
    }
    .nameForm {
        grid-template:
            "mn"
            "mnt"
            "cn"
            "cnt"
            / 1fr;
    }
    .sliderForm {
        grid-template:
            "h ht"
            "hs hs"
            "w wt"
            "ws ws"
            / 1fr auto;
    }
    .idForm {
        grid-template:
            "mi"
            "mit"
            "ci"
            "cit0"
            "cit1"
            "maci"
            "macit0"
            "macit1"
            / 1fr;
    }
    .id-group {
        flex-wrap: wrap;
    }
    .id-input {
        width: 32px;
    }
    .form-row {
        flex-direction: column;
        gap: 12px;
    }
    .settings-grid {
        gap: 12px;
    }
    .toggle-grid, .select-grid {
        flex-direction: column;
        align-items: stretch;
    }
    .toggle-row, .select-row {
        justify-content: space-between;
    }
    .selectColor, .notSelectColor {
        width: 28px;
        height: 28px;
    }
    .seo-content {
        margin-top: 24px;
        padding: 0 12px;
        gap: 16px;
    }
    .seo-card {
        padding: 20px;
    }
    .seo-heading {
        font-size: 1rem;
    }
    .app-footer {
        padding: 0 12px 24px;
        margin-top: 32px;
    }
    .overlay-content {
        border-radius: var(--radius-lg);
    }
}
