/* ============================================================
   PlayStore Screenshot Gen
   A simple, dark studio UI with an orange accent.
   ============================================================ */

:root {
    --bg: #0c0e12;
    --bg-soft: #11141a;
    --panel: #ffffff;
    --panel-2: #f7f7f9;
    --panel-3: #eeeeef;
    --border: rgba(0, 0, 0, 0.12);
    --border-strong: rgba(0, 0, 0, 0.20);
    --text: #0c0e12;
    --muted: #4a5568;
    --muted-2: #718096;
    --accent: #ffb020;
    --accent-2: #ff7a00;
    --accent-soft: rgba(255, 176, 32, 0.10);
    --accent-ink: #1b1204;
    --danger: #ff6b6b;
    --danger-soft: rgba(255, 107, 107, 0.1);
    --success: #47d18c;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 7px;
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    --font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    --header-h: 74px;
}

* {
    box-sizing: border-box;
}

html {
    color-scheme: dark;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    color: var(--text);
    background:
        radial-gradient(1100px 620px at 8% -12%, rgba(255, 176, 32, 0.1), transparent 60%),
        radial-gradient(900px 620px at 100% 0%, rgba(255, 122, 0, 0.07), transparent 55%),
        var(--bg);
    overflow-x: hidden;
}

img,
canvas {
    max-width: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
}

::selection {
    background: rgba(255, 176, 32, 0.32);
    color: #fff;
}

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

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================================
   Header
   ============================================================ */

.app-header {
    position: sticky;
    top: 0;
    z-index: 40;
    border-bottom: 1px solid var(--border);
    background: rgba(12, 14, 18, 0.82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.app-header__inner {
    max-width: 1640px;
    min-height: var(--header-h);
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    text-decoration: none;
}

.brand__logo {
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

.brand__text {
    display: grid;
    min-width: 0;
    line-height: 1.2;
}

.brand__text strong {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand__text small {
    color: var(--muted);
    font-size: 11.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.app-nav a {
    padding: 8px 11px;
    border-radius: 999px;
    color: var(--muted);
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 600;
    transition: color 0.18s ease, background 0.18s ease;
}

.app-nav a:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

.app-nav a.is-active {
    color: var(--accent);
    background: var(--accent-soft);
}

/* ============================================================
   Layout
   ============================================================ */

.studio {
    width: min(1640px, 100%);
    margin: 0 auto;
    padding: 22px 24px 40px;
    display: grid;
    grid-template-columns: 356px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.sidebar {
    position: sticky;
    top: calc(var(--header-h) + 18px);
    display: grid;
    gap: 16px;
    max-height: calc(100vh - var(--header-h) - 36px);
    overflow-y: auto;
    padding-right: 2px;
    scrollbar-width: thin;
    scrollbar-color: var(--panel-3) transparent;
}

.sidebar::-webkit-scrollbar {
    width: 7px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--panel-3);
    border-radius: 999px;
}

.workspace {
    display: grid;
    gap: 16px;
    min-width: 0;
}

/* ============================================================
   Panels
   ============================================================ */

.panel {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 36%),
        var(--panel);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}

.panel__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.panel__header h2 {
    margin: 0;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text);
}

.panel__header p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.4;
}

.count-badge {
    display: inline-grid;
    place-items: center;
    min-width: 26px;
    height: 24px;
    padding: 0 8px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

/* ============================================================
   Translation list
   ============================================================ */

.translation-list {
    display: grid;
    gap: 8px;
    max-height: 330px;
    overflow-y: auto;
    padding: 1px 3px 1px 1px;
    margin: 0 -3px 10px -1px;
    scrollbar-width: thin;
    scrollbar-color: var(--panel-3) transparent;
}

.translation-list::-webkit-scrollbar {
    width: 6px;
}

.translation-list::-webkit-scrollbar-thumb {
    background: var(--panel-3);
    border-radius: 999px;
}

.translation-item {
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr) 26px;
    gap: 7px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--panel-2);
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.translation-item.is-active {
    border-color: rgba(255, 176, 32, 0.5);
    background:
        linear-gradient(180deg, rgba(255, 176, 32, 0.07), transparent 65%),
        var(--panel-2);
    box-shadow: 0 0 0 1px rgba(255, 176, 32, 0.08) inset;
}

.translation-item__lang,
.translation-item__text {
    width: 100%;
    border: 1px solid transparent;
    border-radius: 7px;
    background: #ffffff;
    color: var(--text);
    padding: 7px 8px;
    font-size: 12px;
    transition: border-color 0.18s ease, background 0.18s ease;
}

.translation-item__lang {
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.02em;
}

.translation-item__lang::placeholder,
.translation-item__text::placeholder {
    color: var(--muted-2);
}

.translation-item__lang:focus,
.translation-item__text:focus {
    outline: none;
    border-color: rgba(255, 176, 32, 0.55);
    background: #f9fafb;
}

.translation-item__text {
    min-height: 34px;
    max-height: 132px;
    resize: vertical;
    line-height: 1.4;
    font-family: inherit;
}

.translation-item__actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: stretch;
}

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    line-height: 1;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.icon-btn:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--border);
}

.icon-btn--danger:hover {
    color: var(--danger);
    background: var(--danger-soft);
    border-color: rgba(255, 107, 107, 0.3);
}

/* ============================================================
   Bulk import
   ============================================================ */

.bulk-import {
    margin-top: 12px;
    border-top: 1px solid var(--border);
    padding-top: 10px;
}

.bulk-import summary {
    cursor: pointer;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    list-style: none;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 7px;
}

.bulk-import summary::-webkit-details-marker {
    display: none;
}

.bulk-import summary::before {
    content: "+";
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border: 1px solid var(--border-strong);
    border-radius: 5px;
    font-size: 12px;
    line-height: 1;
    transition: transform 0.2s ease;
}

.bulk-import[open] summary::before {
    transform: rotate(45deg);
}

.bulk-import summary:hover {
    color: var(--text);
}

.bulk-import__body {
    display: grid;
    gap: 9px;
    padding-top: 10px;
}

.bulk-import textarea {
    width: 100%;
    min-height: 108px;
    resize: vertical;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #ffffff;
    color: var(--text);
    font-family: var(--mono);
    font-size: 11.5px;
    line-height: 1.5;
}

.bulk-import textarea:focus {
    outline: none;
    border-color: rgba(255, 176, 32, 0.55);
}

.bulk-import__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.file-btn {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.file-btn input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    font-size: 0;
}

.hint {
    margin: 0;
    color: var(--muted-2);
    font-size: 10.5px;
    line-height: 1.5;
}

.hint code {
    padding: 1px 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.07);
    color: var(--muted);
    font-family: var(--mono);
    font-size: 10px;
}

/* ============================================================
   Image list
   ============================================================ */

.image-list {
    display: grid;
    gap: 7px;
    max-height: 250px;
    overflow-y: auto;
    margin-bottom: 10px;
    scrollbar-width: thin;
    scrollbar-color: var(--panel-3) transparent;
}

.image-list::-webkit-scrollbar {
    width: 6px;
}

.image-list::-webkit-scrollbar-thumb {
    background: var(--panel-3);
    border-radius: 999px;
}

.image-item {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) 26px;
    align-items: center;
    gap: 9px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel-2);
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease;
}

.image-item:hover {
    border-color: var(--border-strong);
    background: var(--panel-3);
}

.image-item.is-active {
    border-color: rgba(255, 176, 32, 0.5);
    background:
        linear-gradient(180deg, rgba(255, 176, 32, 0.07), transparent 65%),
        var(--panel-2);
}

.image-item__thumb {
    width: 46px;
    height: 46px;
    border-radius: 7px;
    object-fit: cover;
    background: #0a0c10;
    border: 1px solid var(--border);
}

.image-item__info {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.image-item__name {
    color: var(--text);
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-item__meta {
    color: var(--muted-2);
    font-size: 10.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-item__badge {
    display: inline-block;
    margin-left: 5px;
    padding: 1px 5px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 8.5px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    vertical-align: 1px;
}

.image-dropzone {
    padding: 12px;
    border: 1px dashed var(--border-strong);
    border-radius: 11px;
    text-align: center;
    transition: border-color 0.18s ease, background 0.18s ease;
}

.image-dropzone p {
    margin: 7px 0 0;
    color: var(--muted-2);
    font-size: 10.5px;
}

.image-dropzone.is-dragover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

kbd {
    display: inline-block;
    padding: 1px 5px;
    border: 1px solid var(--border-strong);
    border-bottom-width: 2px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--muted);
    font-family: var(--mono);
    font-size: 9.5px;
    line-height: 1.4;
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    padding: 8px 14px;
    border: 1px solid var(--border-strong);
    border-radius: 9px;
    background: transparent;
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.24);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

.btn--primary {
    border-color: transparent;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: var(--accent-ink);
    box-shadow: 0 8px 20px rgba(255, 122, 0, 0.22);
}

.btn--primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #ffc14d, #ff8a1a);
    border-color: transparent;
    box-shadow: 0 10px 26px rgba(255, 122, 0, 0.3);
}

.btn--ghost {
    background: rgba(255, 255, 255, 0.035);
}

.btn--sm {
    min-height: 30px;
    padding: 6px 10px;
    font-size: 11px;
    border-radius: 8px;
}

.btn--block {
    width: 100%;
}

.link-btn {
    margin-top: 10px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted-2);
    font-size: 10.5px;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.15s ease;
}

.link-btn:hover {
    color: var(--text);
}

.link-btn--danger:hover {
    color: var(--danger);
}

/* ============================================================
   Toolbar
   ============================================================ */

.toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 40%),
        var(--panel);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.2);
}

.toolbar__group {
    display: flex;
    align-items: flex-end;
    gap: 9px;
    flex-wrap: wrap;
}

.toolbar__group--end {
    margin-left: auto;
}

.field {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.field > span {
    color: var(--muted-2);
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    padding-left: 2px;
}

.field select,
.field input[type="color"],
.control select {
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text);
    font-size: 11.5px;
    font-weight: 600;
    padding: 0 9px;
}

.field select {
    min-width: 108px;
    padding-right: 26px;
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--muted) 50%),
        linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position:
        calc(100% - 13px) 14px,
        calc(100% - 9px) 14px;
    background-size: 4px 4px, 4px 4px;
    background-repeat: no-repeat;
}

.field select:focus,
.control select:focus {
    outline: none;
    border-color: rgba(255, 176, 32, 0.6);
}

.field--color input[type="color"],
.control input[type="color"] {
    width: 52px;
    padding: 3px;
    cursor: pointer;
}

.field--color input[type="color"]::-webkit-color-swatch-wrapper,
.control input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.field--color input[type="color"]::-webkit-color-swatch,
.control input[type="color"]::-webkit-color-swatch {
    border: 0;
    border-radius: 5px;
}

.field--color input[type="color"]::-moz-color-swatch,
.control input[type="color"]::-moz-color-swatch {
    border: 0;
    border-radius: 5px;
}

/* ============================================================
   Advanced panel
   ============================================================ */

.advanced-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 18px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 30%),
        var(--panel);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.2);
    animation: panelIn 0.2s ease-out;
}

.advanced-panel[hidden] {
    display: none;
}

@keyframes panelIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.advanced-section {
    min-width: 0;
}

.advanced-section + .advanced-section {
    border-left: 1px solid var(--border);
    padding-left: 18px;
}

.advanced-section h3 {
    margin: 0 0 11px;
    color: var(--text);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.control-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px 14px;
}

.control {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.control > span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 600;
}

.control output {
    color: var(--text);
    font-size: 10px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.control input[type="range"] {
    width: 100%;
    height: 18px;
    margin: 0;
    accent-color: var(--accent);
    cursor: pointer;
}

.control--switch {
    grid-template-columns: 1fr auto;
    align-items: center;
    align-self: end;
    padding-bottom: 2px;
}

.control--switch > span {
    justify-content: flex-start;
}

.control--switch input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: var(--accent);
    cursor: pointer;
}

.image-edit-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

/* ============================================================
   Preview
   ============================================================ */

.preview-shell {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 22%),
        var(--panel);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.26);
    overflow: hidden;
}

.preview-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}

.preview-meta {
    display: grid;
    gap: 2px;
    min-width: 0;
}

#previewMeta {
    color: var(--text);
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-meta__batch {
    color: var(--muted-2);
    font-size: 10.5px;
}

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

.preview-stage {
    position: relative;
    min-height: 480px;
    display: grid;
    place-items: center;
    padding: 18px;
    overflow: hidden;
    background-color: #0a0c10;
    background-image:
        linear-gradient(45deg, rgba(255, 255, 255, 0.028) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255, 255, 255, 0.028) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.028) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.028) 75%);
    background-size: 22px 22px;
    background-position: 0 0, 0 11px, 11px -11px, -11px 0;
}

#previewCanvas {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: min(64vh, 760px);
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
}

#previewCanvas[hidden] {
    display: none;
}

.empty-state {
    max-width: 460px;
    text-align: center;
    padding: 22px;
    animation: fadeIn 0.35s ease-out;
}

.empty-state img {
    width: min(270px, 68%);
    height: auto;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
    margin-bottom: 16px;
}

.empty-state h2 {
    margin: 0 0 7px;
    font-size: 19px;
    letter-spacing: -0.02em;
}

.empty-state p {
    margin: 0 auto 16px;
    max-width: 390px;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.6;
}

.empty-state__actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.drop-overlay {
    position: absolute;
    inset: 10px;
    display: grid;
    place-content: center;
    gap: 4px;
    border: 2px dashed var(--accent);
    border-radius: 12px;
    background: rgba(255, 176, 32, 0.1);
    color: var(--accent);
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.99);
    transition: opacity 0.16s ease, transform 0.16s ease;
    z-index: 5;
}

.drop-overlay strong {
    font-size: 16px;
}

.drop-overlay span {
    color: var(--muted);
    font-size: 11.5px;
}

.preview-stage.is-dragover .drop-overlay {
    opacity: 1;
    transform: scale(1);
}

.preview-hint {
    min-height: 18px;
    margin: 0;
    padding: 0 14px 12px;
    color: var(--muted-2);
    font-size: 10.5px;
    line-height: 1.5;
}

/* ============================================================
   Results
   ============================================================ */

.results-section {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 24%),
        var(--panel);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
    padding: 16px;
    animation: panelIn 0.24s ease-out;
}

.results-section[hidden] {
    display: none;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 13px;
}

.results-header h2 {
    margin: 0;
    font-size: 15px;
    letter-spacing: -0.01em;
}

.results-header p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 11px;
}

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

.progress {
    display: grid;
    gap: 7px;
    margin-bottom: 13px;
}

.progress[hidden] {
    display: none;
}

.progress__track {
    height: 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    overflow: hidden;
}

.progress__bar {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transition: width 0.18s ease;
}

.progress__text {
    color: var(--muted);
    font-size: 10.5px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 10px;
}

.result-card {
    display: grid;
    gap: 7px;
    min-width: 0;
    padding: 7px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--panel-2);
    animation: fadeIn 0.25s ease-out;
}

.result-card__media {
    display: grid;
    place-items: center;
    height: 148px;
    border-radius: 7px;
    overflow: hidden;
    background-color: #0a0c10;
    background-image:
        linear-gradient(45deg, rgba(255, 255, 255, 0.03) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255, 255, 255, 0.03) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.03) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.03) 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

.result-card__media img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.result-card__name {
    color: var(--text);
    font-size: 10.5px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-card__meta {
    color: var(--muted-2);
    font-size: 9.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-card .btn {
    width: 100%;
}

/* ============================================================
   Footer
   ============================================================ */

.app-footer {
    border-top: 1px solid var(--border);
    background: rgba(10, 12, 16, 0.6);
}

.app-footer__inner {
    width: min(1640px, 100%);
    margin: 0 auto;
    padding: 22px 24px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    color: var(--muted-2);
    font-size: 10.5px;
    line-height: 1.6;
}

.app-footer__inner p {
    margin: 0;
}

.app-footer__inner strong {
    color: var(--muted);
}

.app-footer__inner a {
    color: var(--muted);
    text-decoration: none;
    margin-left: 12px;
}

.app-footer__inner a:hover {
    color: var(--accent);
}

/* ============================================================
   Toast
   ============================================================ */

.toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 100;
    max-width: min(360px, calc(100vw - 40px));
    padding: 11px 15px;
    border: 1px solid var(--border-strong);
    border-radius: 11px;
    background: rgba(27, 32, 42, 0.96);
    color: var(--text);
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.45;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    opacity: 0;
    transform: translateY(14px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.toast.is-success {
    border-color: rgba(71, 209, 140, 0.42);
}

.toast.is-danger {
    border-color: rgba(255, 107, 107, 0.48);
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1240px) {
    .studio {
        grid-template-columns: 320px minmax(0, 1fr);
        padding-inline: 18px;
    }

    .app-header__inner {
        padding-inline: 18px;
    }

    .field select {
        min-width: 96px;
    }
}

@media (max-width: 1000px) {
    .studio {
        grid-template-columns: minmax(0, 1fr);
    }

    .sidebar {
        position: static;
        max-height: none;
        overflow: visible;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }

    .translation-list {
        max-height: 280px;
    }
}

@media (max-width: 780px) {
    :root {
        --header-h: 66px;
    }

    .app-header__inner {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 10px 14px;
    }

    .app-nav {
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: none;
    }

    .app-nav::-webkit-scrollbar {
        display: none;
    }

    .app-nav a {
        flex: 0 0 auto;
    }

    .brand__logo {
        width: 40px;
        height: 40px;
    }

    .studio {
        padding: 14px 12px 30px;
        gap: 14px;
    }

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

    .toolbar {
        align-items: stretch;
    }

    .toolbar__group,
    .toolbar__group--end {
        margin-left: 0;
        width: 100%;
    }

    .field {
        flex: 1 1 120px;
    }

    .field select {
        width: 100%;
    }

    .advanced-panel {
        grid-template-columns: minmax(0, 1fr);
    }

    .advanced-section + .advanced-section {
        border-left: 0;
        border-top: 1px solid var(--border);
        padding-left: 0;
        padding-top: 16px;
    }

    .preview-stage {
        min-height: 340px;
        padding: 12px;
    }

    #previewCanvas {
        max-height: 54vh;
    }

    .preview-toolbar {
        align-items: stretch;
    }

    .preview-actions {
        width: 100%;
    }

    .preview-actions .btn {
        flex: 1 1 auto;
    }

    .app-footer__inner {
        flex-direction: column;
        align-items: flex-start;
        padding-inline: 16px;
    }

    .app-footer__inner a {
        margin-left: 0;
        margin-right: 12px;
    }
}

@media (max-width: 540px) {
    .control-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .translation-item {
        grid-template-columns: 62px minmax(0, 1fr) 26px;
    }

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

    .result-card__media {
        height: 128px;
    }

    .empty-state {
        padding: 8px;
    }

    .empty-state img {
        width: min(220px, 78%);
    }

    .empty-state__actions .btn {
        width: 100%;
    }

    .preview-actions {
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}
