:root {
    --bg:         #131009;
    --bg2:        #1c1610;
    --sidebar-bg: #160f08;
    --divider:    rgba(232,160,48,0.12);
    --accent:     #e8a030;
    --accent-dim: #a06c1a;
    --btn-text:   #131009;
    --text:       #f0dfc0;
    --text-dim:   #8a7560;
    --text-muted: #5a4a38;
    --sidebar-w:  230px;
    --divider-w:  1px;
    --drop-bg:    rgba(28,22,16,0.6);
    --drop-border:rgba(232,160,48,0.18);
    --input-bg:   #1c1610;
    --card-bg:    #1c1610;
    --surface:    #1c1610;
    --surface2:   #241c10;
    --border:     rgba(232,160,48,0.15);
}

/* ── LIGHT THEME ── */
.light {
    /* Основний фон — чистий теплий білий */
    --bg:         #fafaf8;
    --bg2:        #f2f0eb;
    --sidebar-bg: #ffffff;
    /* Акценти — темно-помаранчевий замість яскравого золотого */
    --accent:     #c47a20;
    --accent-dim: #8a5510;
    --btn-text:   #ffffff;
    /* Текст — майже чорний */
    --text:       #1a1510;
    --text-dim:   #5a4830;
    --text-muted: #8a7560;
    /* Поверхні */
    --surface:    #ffffff;
    --surface2:   #f2f0eb;
    --border:     rgba(180,140,80,0.2);
    --divider:    rgba(180,140,80,0.15);
    /* Компоненти */
    --drop-bg:    #ffffff;
    --drop-border:rgba(180,130,60,0.3);
    --input-bg:   #f7f5f0;
    --card-bg:    #ffffff;
    --transition: .2s;
}

/* Тіні для підняття елементів */
.light .section-card,
.light .file-info-bar {
    box-shadow: 0 1px 8px rgba(0,0,0,.06);
}
.light nav {
    border-right: 1px solid rgba(180,140,80,.15);
    box-shadow: 2px 0 12px rgba(0,0,0,.04);
}
/* Активний nav item */
.light .nav-item.active {
    background: rgba(196,122,32,.1);
}
.light .nav-item:hover {
    background: rgba(196,122,32,.07);
}
/* Drop zone */
.light .drop-zone {
    background: var(--drop-bg);
    border: 2px dashed rgba(196,122,32,.4);
}
.light .drop-zone:hover {
    border-color: var(--accent);
    border-style: solid;
    background: rgba(196,122,32,.04);
    box-shadow: 0 0 0 3px rgba(196,122,32,.08);
}
/* Topbar */
.light #topbar {
    background: rgba(255,255,255,.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(180,140,80,.12);
}
/* Кнопки Convert — темний текст не підходить на кольоровій кнопці */
.light .btn-convert {
    background: var(--accent);
    color: #fff;
}
.light .btn-download {
    background: #2a9d5c;
    color: #fff;
}
/* Sidebar footer */
.light .sidebar-footer {
    border-top: 1px solid rgba(180,140,80,.15);
}
/* Range input */
.light input[type=range] {
    accent-color: var(--accent);
}
/* Select */
.light select {
    background: var(--input-bg);
    color: var(--text);
    border: 1px solid var(--drop-border);
}
/* Progress bar */
.light .progress-bar {
    background: rgba(180,140,80,.15);
}
.light .progress-fill {
    background: var(--accent);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
    font-family: 'DM Sans', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── SIDEBAR ── */
#sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    padding: 28px 0 20px;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    border-right: var(--divider-w) solid var(--border);
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px 28px;
    border-bottom: 1px solid var(--border);
}

.logo-mark {
    width: 36px;
    height: 36px;
    background: var(--accent);
    color: #131009;
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.logo-text {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: var(--text);
    letter-spacing: -0.3px;
}

/* Nav section label */
.nav-section-label {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 20px 20px 8px;
}

/* Nav list */
.nav-list {
    list-style: none;
    flex: 1;
    padding: 0 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    position: relative;
    color: var(--text-dim);
    font-size: 14px;
    font-weight: 400;
    user-select: none;
}

.nav-item:hover:not(.soon) {
    background: var(--surface);
    color: var(--text);
}

.nav-item.active {
    background: var(--surface2);
    color: var(--accent);
    font-weight: 500;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
}

.nav-item.soon {
    cursor: default;
    opacity: 0.45;
}

.nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-icon svg {
    width: 18px;
    height: 18px;
}

.nav-label {
    flex: 1;
}

.badge {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    background: var(--surface2);
    color: var(--text-muted);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

/* Sidebar footer */
.sidebar-footer {
    padding: 16px 20px 0;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.version {
    font-size: 11px;
    color: var(--text-muted);
    font-family: 'Syne', sans-serif;
    font-weight: 600;
}

.footer-hint {
    font-size: 10px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ── DIVIDER ── */
#sidebar-divider {
    width: var(--divider-w);
    min-height: 100vh;
    background: var(--border);
    margin-left: var(--sidebar-w);
    flex-shrink: 0;
}

/* ── MAIN ── */
#main {
    margin-left: calc(var(--sidebar-w) + var(--divider-w));
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
    padding-top: 52px;
    background: var(--bg);
    max-width: calc(820px + 104px);
    width: 100%;
    /* Правий край плавно зникає — годинник "виходить" з темряви */
    -webkit-mask-image: linear-gradient(to right, black 78%, transparent 100%);
    mask-image: linear-gradient(to right, black 78%, transparent 100%);
}

/* ── SECTIONS ── */
.section {
    display: none;
    flex-direction: column;
    padding: 48px 52px;
    max-width: 820px;
    width: 100%;
    animation: fadeIn 0.3s ease;
}

.section.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Section header */
.section-header {
    margin-bottom: 32px;
}

.section-header h1 {
    font-family: 'Syne', sans-serif;
    font-size: 32px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.1;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}

.accent { color: var(--accent); }

.section-desc {
    color: var(--text-dim);
    font-size: 14px;
    font-weight: 300;
}

/* ── DROP ZONE ── */
.drop-zone {
    border: 2px dashed rgba(232,160,48,.35);
    border-radius: 14px;
    background: var(--surface);
    padding: 40px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
    text-align: center;
    margin-bottom: 20px;
}

.drop-zone:hover, .drop-zone.drag-over {
    border-color: var(--accent);
    border-style: solid;
    background: rgba(232,160,48,.04);
    box-shadow: 0 0 0 3px rgba(232,160,48,.08);
}

.drop-zone.drag-over {
    border-color: var(--accent);
    border-style: solid;
}

/* Файл завантажено — зелена рамка */
.drop-zone.has-file {
    border-color: var(--green);
    border-style: solid;
    background: rgba(39,174,96,0.06);
    padding: 16px 24px;
}
.drop-zone.has-file .drop-animation { display: none; }
.drop-zone.has-file .drop-or        { display: none; }
.drop-zone.has-file .drop-hint      { display: none; }
.drop-zone.has-file .drop-hint-img  { display: none; }
.drop-zone.has-file .drop-main {
    font-size: 13px;
    color: var(--green);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.drop-zone.has-file .btn-choose {
    font-size: 12px;
    padding: 4px 12px;
    opacity: 0.7;
}

.drop-animation {
    margin-bottom: 8px;
    color: var(--text-muted);
    transition: color var(--transition), transform var(--transition);
}

.drop-zone:hover .drop-animation {
    color: var(--accent-dim);
    transform: translateY(-3px);
}

.drop-icon-svg {
    width: 52px;
    height: 52px;
}

.drop-main {
    font-size: 16px;
    font-weight: 500;
    color: var(--text);
}

.drop-or {
    font-size: 12px;
    color: var(--text-muted);
}

.drop-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    letter-spacing: 0.3px;
}

.btn-choose {
    display: inline-block;
    padding: 8px 20px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition);
    font-family: 'DM Sans', sans-serif;
}

.btn-choose:hover {
    background: var(--border);
    border-color: var(--accent-dim);
    color: var(--accent);
}

/* ── FILE INFO BAR ── */
.file-info-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 10px 14px;
    margin-bottom: 20px;
    animation: fadeIn 0.2s ease;
}

.file-info-bar svg {
    width: 16px;
    height: 16px;
    color: var(--accent);
    flex-shrink: 0;
}

.file-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    font-size: 11px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.clear-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background var(--transition), color var(--transition);
    flex-shrink: 0;
}

.clear-btn:hover {
    background: var(--surface2);
    color: var(--text);
}

/* ── CONTROLS GRID ── */
.controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 20px;
}

.control-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color var(--transition);
}

.control-card:hover {
    border-color: var(--accent-dim);
}

.control-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-dim);
    letter-spacing: 0.2px;
}

.slider-val {
    color: var(--accent);
    font-weight: 600;
}

/* Styled select */
.styled-select {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 12px;
    cursor: pointer;
    outline: none;
    transition: border-color var(--transition);
    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='%238a7560' stroke-width='2'%3E%3Cpolyline points='6,9 12,15 18,9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

.styled-select:hover, .styled-select:focus {
    border-color: var(--accent-dim);
}

.styled-select option {
    background: var(--bg2);
    color: var(--text);
}

/* Styled range */
.styled-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 5px;
    border-radius: 4px;
    background: linear-gradient(to right, var(--accent) var(--val, 50%), rgba(232,160,48,.15) var(--val, 50%));
    outline: none;
    cursor: pointer;
    border: none;
    box-shadow: inset 0 0 0 1px rgba(232,160,48,.2);
}

.styled-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 0 0 3px rgba(232,160,48,0.15);
    transition: box-shadow var(--transition), transform var(--transition);
}

.styled-range::-webkit-slider-thumb:hover {
    box-shadow: 0 0 0 5px rgba(232,160,48,0.25);
    transform: scale(1.1);
}

/* ── ACTION ROW ── */
.action-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent);
    color: #131009;
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    font-family: 'Syne', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition), opacity var(--transition);
    letter-spacing: 0.2px;
}

.btn-primary svg {
    width: 16px;
    height: 16px;
}

.btn-primary:hover:not(:disabled) {
    background: #f0b040;
    transform: translateY(-1px);
}

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

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

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--surface2);
    color: var(--text-dim);
    border: 1px solid var(--border);
    padding: 11px 20px;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

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

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--green);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    font-family: 'Syne', sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
    animation: popIn 0.3s cubic-bezier(.34,1.56,.64,1);
}

.btn-download svg {
    width: 16px;
    height: 16px;
}

.btn-download:hover {
    background: #2ecc71;
    transform: translateY(-1px);
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.85); }
    to   { opacity: 1; transform: scale(1); }
}

/* ── PROGRESS ── */
.progress-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    animation: fadeIn 0.2s ease;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: var(--surface2);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    border-radius: 4px;
    transition: width 0.4s ease;
}

.progress-label {
    font-size: 12px;
    color: var(--text-dim);
    white-space: nowrap;
}

/* ── ENHANCE WORKSPACE ── */
.enhance-workspace {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    margin-bottom: 16px;
    animation: fadeIn 0.3s ease;
}

.preview-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.preview-label {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    font-weight: 500;
}

#previewImg {
    width: 100%;
    height: 320px;
    object-fit: contain;
    padding: 12px;
    background: repeating-conic-gradient(#1c1610 0% 25%, #221a10 0% 50%) 0 0 / 20px 20px;
    transition: filter 0.12s ease;
}

.enhance-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.enhance-panel .control-card {
    margin: 0;
}

.enhance-panel .action-row {
    flex-direction: column;
    margin-top: 4px;
}

.enhance-panel .action-row > * {
    width: 100%;
    justify-content: center;
}

/* ── COMING SOON ── */
.coming-soon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 60vh;
    gap: 12px;
    color: var(--text-muted);
}

.cs-icon {
    font-size: 52px;
    margin-bottom: 8px;
    filter: grayscale(0.5);
}

.coming-soon h2 {
    font-family: 'Syne', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dim);
}

.coming-soon p {
    font-size: 14px;
    line-height: 1.6;
    max-width: 280px;
}

/* ── TOPBAR ── */
#topbar {
    position: fixed;
    top: 0;
    left: calc(var(--sidebar-w) + var(--divider-w));
    right: 0;
    height: 52px;
    background: linear-gradient(to bottom, rgba(19,16,9,0.85) 0%, transparent 100%);
    border-bottom: none;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 28px;
    z-index: 100;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ── BUY ME A COFFEE ── */
.bmac-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 16px;
    background: #FFDD00;
    color: #1a1200;
    border-radius: 20px;
    text-decoration: none;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    line-height: 1;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 2px 10px rgba(255,221,0,0.3);
    flex-shrink: 0;
}
.bmac-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 18px rgba(255,221,0,0.5);
    background: #ffe633;
}
.bmac-btn svg {
    flex-shrink: 0;
    color: #1a1200;
}
@media (max-width: 600px) {
    .bmac-btn span { display: none; }
    .bmac-btn { padding: 7px 9px; border-radius: 50%; }
}



/* Language Switcher */
.lang-switcher {
    position: relative;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-dim);
    padding: 6px 12px;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.lang-btn svg {
    width: 16px;
    height: 16px;
}

.lang-btn:hover {
    background: var(--surface2);
    border-color: var(--accent-dim);
    color: var(--accent);
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 160px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    z-index: 200;
    animation: fadeIn 0.15s ease;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    background: none;
    border: none;
    color: var(--text-dim);
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    text-align: left;
}

.lang-option:hover {
    background: var(--border);
    color: var(--text);
}

.lang-option.active-lang {
    color: var(--accent);
    font-weight: 500;
}

.lang-flag {
    font-size: 16px;
    line-height: 1;
}

.lang-check {
    margin-left: auto;
    font-size: 12px;
    color: var(--accent);
}

/* Push main content down for topbar — вже задано в #main вище */

/* ── UPSCALE SECTION ── */
.method-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.method-tab {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    padding: 14px 16px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    transition: border-color var(--transition), background var(--transition);
    color: var(--text-dim);
    font-family: 'DM Sans', sans-serif;
}

.method-tab svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--text-muted);
    transition: color var(--transition);
}

.method-tab:hover {
    border-color: var(--accent-dim);
    background: var(--surface2);
}

.method-tab.active {
    border-color: var(--accent);
    background: var(--surface2);
    color: var(--text);
}

.method-tab.active svg {
    color: var(--accent);
}

.method-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: inherit;
    line-height: 1.2;
}

.method-desc {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.method-tab.active .method-name {
    color: var(--text);
}

.ai-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: rgba(232, 160, 48, 0.07);
    border: 1px solid rgba(232, 160, 48, 0.2);
    border-radius: 9px;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.5;
    animation: fadeIn 0.2s ease;
}

.ai-notice svg {
    width: 15px;
    height: 15px;
    color: var(--accent);
    flex-shrink: 0;
    margin-top: 1px;
}

.size-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.size-val {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

.size-val.accent {
    color: var(--accent);
    font-weight: 600;
}

/* ══════════════════════════════
   BA MODAL OVERLAY
   ══════════════════════════════ */
.ba-modal {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(10,8,4,0.92);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    animation: fadeIn 0.2s ease;
}
.ba-modal[hidden] { display: none !important; }

.ba-modal-inner {
    width: 100%;
    max-width: 900px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 94vh;
}

.ba-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.ba-modal-title {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
}
.ba-modal-close {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    transition: color 0.15s, background 0.15s;
    /* великий тач-таргет для мобільного */
    min-width: 36px;
    min-height: 36px;
    justify-content: center;
}
.ba-modal-close:hover { color: var(--text); background: var(--surface2); }

/* BA slider всередині модалу */
.ba-modal .ba-slider {
    flex: 1;
    border-radius: 0;
    cursor: col-resize;
    min-height: 0;
}
.ba-modal .ba-img {
    max-height: calc(94vh - 56px);
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@media (max-width: 600px) {
    .ba-modal { padding: 0; }
    .ba-modal-inner { border-radius: 0; max-height: 100dvh; }
    .ba-modal .ba-img { max-height: calc(100dvh - 52px); }
}


.ba-wrap {
    margin-top: 24px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    animation: fadeIn 0.3s ease;
}

.ba-slider {
    position: relative;
    width: 100%;
    user-select: none;
    touch-action: none;
    cursor: col-resize;
    line-height: 0;
    background: repeating-conic-gradient(#1c1610 0% 25%, #221a10 0% 50%) 0 0 / 20px 20px;
    overflow: hidden;
}

.ba-img {
    display: block;
    width: 100%;
    max-height: 480px;
    object-fit: contain;
}

/* Before — абсолютно, обрізається clip-path */
.ba-before-wrap {
    position: absolute;
    inset: 0;
    clip-path: inset(0 50% 0 0); /* керується JS через style */
    overflow: visible;
}
.ba-before-wrap .ba-img {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-height: none;
}

/* Вертикальна лінія + кружок */
.ba-handle {
    position: absolute;
    top: 0; bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    z-index: 10;
    width: 2px;
}
.ba-line {
    width: 2px;
    flex: 1;
    background: rgba(255,255,255,0.9);
    box-shadow: 0 0 6px rgba(0,0,0,0.6);
}
.ba-circle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    flex-shrink: 0;
    left: 50%;
    transform: translate(-50%, -50%);
}
.ba-circle svg { flex-shrink: 0; }

/* Підписи */
.ba-label {
    position: absolute;
    top: 12px;
    padding: 3px 10px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 20px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    line-height: 1.4;
    pointer-events: none;
    z-index: 5;
}
.ba-label-before { left: 12px; }
.ba-label-after  { right: 12px; }


/* ── PRIVACY BADGE ── */
.privacy-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 6px 10px;
    background: rgba(39, 174, 96, 0.08);
    border: 1px solid rgba(39, 174, 96, 0.2);
    border-radius: 7px;
    cursor: default;
    position: relative;
    transition: background var(--transition), border-color var(--transition);
}

.privacy-badge:hover {
    background: rgba(39, 174, 96, 0.15);
    border-color: rgba(39, 174, 96, 0.4);
}

.privacy-badge svg {
    width: 13px;
    height: 13px;
    color: var(--green);
    flex-shrink: 0;
}

.privacy-badge > span {
    font-size: 11px;
    font-weight: 600;
    color: var(--green);
    letter-spacing: 0.3px;
}

/* Tooltip */
.privacy-tooltip {
    display: none;
    position: fixed;
    width: 240px;
    background: var(--bg2);
    border: 1px solid rgba(39, 174, 96, 0.3);
    border-radius: 12px;
    padding: 14px;
    z-index: 9990;
    box-shadow: 0 8px 40px rgba(0,0,0,0.6);
    pointer-events: none;
}

.privacy-badge:hover .privacy-tooltip {
    display: block;
    animation: fadeIn 0.18s ease;
}

.tooltip-title {
    font-family: 'Syne', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.privacy-tooltip p {
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.6;
    margin-bottom: 10px;
}

.privacy-tooltip strong {
    color: var(--green);
}

.tooltip-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tooltip-tags span {
    font-size: 10px;
    font-weight: 500;
    padding: 2px 7px;
    border-radius: 4px;
    background: rgba(39, 174, 96, 0.12);
    border: 1px solid rgba(39, 174, 96, 0.2);
    color: var(--green);
    letter-spacing: 0.2px;
}

/* ── CLOCK DECORATION ── */
/* ══════════════════════════════════════
   CLOCK DECORATION — STEAMPUNK REBUILD
   ══════════════════════════════════════ */
#deco-panel {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    /* Починається від sidebar — заходить під #main (z-index:1 > z-index:0) */
    left: calc(var(--sidebar-w) + 1px);
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
    border: none;
    outline: none;
    background: transparent;
}

.clock-scene {
    position: absolute;
    top: 50%;
    right: -15%;
    transform: translateY(-50%);
    height: 92vh;
    aspect-ratio: 1;
    width: auto;
}

/* ── Фонове світіння ── */
.clock-glow-bg {
    position: absolute;
    inset: 5%;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 50%,
        rgba(232,160,48,0.07) 0%,
        rgba(232,160,48,0.03) 40%,
        transparent 70%);
    animation: pulsate 4s ease-in-out infinite;
}
@keyframes pulsate {
    0%, 100% { opacity: 0.6; transform: scale(0.97); }
    50%       { opacity: 1;   transform: scale(1.03); }
}

/* ── SVG оверлей ── */
.clock-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* ── Фото годинника ── */
.clock-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 2;
}

/* ── Анімації кілець ── */
.ring-cw-slow  { animation: rotateCW  40s linear infinite; transform-origin: 50% 50%; }
.ring-ccw-mid  { animation: rotateCCW 25s linear infinite; transform-origin: 50% 50%; }
.ring-cw-fast  { animation: rotateCW  14s linear infinite; transform-origin: 50% 50%; }
.ring-ccw-slow { animation: rotateCCW 55s linear infinite; transform-origin: 50% 50%; }
.orbit-fast    { animation: rotateCW  10s linear infinite; transform-origin: 50% 50%; }
.orbit-rev     { animation: rotateCCW 18s linear infinite; transform-origin: 50% 50%; }

@keyframes rotateCW  { to { transform: rotate( 360deg); } }
@keyframes rotateCCW { to { transform: rotate(-360deg); } }

/* ── MOBILE ── */
#deco-mobile-bg {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}
#deco-mobile-bg img {
    position: absolute;
    right: -20%;
    bottom: 5%;
    width: 80vw;
    max-width: 380px;
    aspect-ratio: 1;
    object-fit: contain;
    opacity: 0.06;
    filter: blur(1px);
}

/* ── HAMBURGER ── */
#hamburger {
    display: none;
    position: fixed;
    top: 12px;
    left: 14px;
    z-index: 200;
    width: 38px;
    height: 38px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    padding: 0;
}

#hamburger span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text-dim);
    border-radius: 2px;
    transition: all 0.25s ease;
}

#hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
#hamburger.open span:nth-child(2) { opacity: 0; }
#hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

#sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 98;
    backdrop-filter: blur(2px);
}

/* ── PDF section ── */
.pdf-modes {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.pdf-file-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
    animation: fadeIn 0.2s ease;
}

.pdf-file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-dim);
}

.pdf-file-item svg {
    width: 14px;
    height: 14px;
    color: var(--accent);
    flex-shrink: 0;
}

.pdf-file-item .pdf-file-size {
    margin-left: auto;
    font-size: 11px;
    color: var(--text-muted);
}

/* ── RESPONSIVE / MOBILE ── */
@media (max-width: 1200px) {
    #deco-panel { display: none; }
    #deco-mobile-bg { display: none !important; }
}

@media (max-width: 768px) {
    :root { --sidebar-w: 230px; }

    #hamburger { display: flex; }

    #sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(.4,0,.2,1);
        z-index: 150;
    }
    #sidebar.open { transform: translateX(0); }
    #sidebar-overlay.open { display: block; }
    #sidebar-divider { display: none; }

    #topbar {
        left: 0;
        padding-left: 60px;
        padding-right: 16px;
    }

    #main {
        margin-left: 0;
        padding-top: 52px;
        -webkit-mask-image: none;
        mask-image: none;
    }

    .section { padding: 24px 16px; }
    .section-header h1 { font-size: 24px; }

    .controls-grid { grid-template-columns: 1fr; }
    .enhance-workspace { grid-template-columns: 1fr; }
    .method-tabs { flex-direction: column; }
    .pdf-modes { flex-direction: column; }

    .action-row { flex-direction: column; }
    .btn-primary, .btn-download, .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    /* Enhance preview менший на мобілці */
    #previewImg { height: 200px; }

    /* BA slider на мобілці */
    .ba-img { max-height: 320px; }
}

@media (max-width: 480px) {
    .section { padding: 20px 12px; }
    .drop-zone { padding: 28px 16px; }
    .logo-text { font-size: 16px; }
    .ba-img { max-height: 260px; }
    .ba-circle { width: 34px; height: 34px; }
}

/* ── BG REMOVAL SLIDER ── */
.bgremove-slider-wrap {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    margin-bottom: 20px;
    background: var(--surface);
}

.bgremove-slider {
    position: relative;
    width: 100%;
    max-height: 480px;
    overflow: hidden;
    cursor: col-resize;
    user-select: none;
    /* Шахова клітинка — видно прозорість результату */
    background-image:
        linear-gradient(45deg, #2c2015 25%, transparent 25%),
        linear-gradient(-45deg, #2c2015 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #2c2015 75%),
        linear-gradient(-45deg, transparent 75%, #2c2015 75%);
    background-size: 18px 18px;
    background-position: 0 0, 0 9px, 9px -9px, -9px 0;
    background-color: var(--surface);
}

.bgremove-img {
    display: block;
    width: 100%;
    max-height: 480px;
    object-fit: contain;
}

.bgremove-after {
    position: relative;
    z-index: 1;
}

.bgremove-before-wrap {
    position: absolute;
    inset: 0;
    clip-path: inset(0 50% 0 0);
    z-index: 2;
    background: var(--bg2);
}

.bgremove-before {
    width: 100%;
    max-height: 480px;
    object-fit: contain;
    display: block;
}

.bgremove-handle {
    position: absolute;
    top: 0; bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}

/* Secondary button */
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-dim);
    font-size: 14px;
    font-weight: 500;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.btn-secondary svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-secondary:hover { background: var(--surface); border-color: var(--accent-dim); color: var(--text); }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
    .controls-grid { grid-template-columns: 1fr; }
    .enhance-workspace { grid-template-columns: 1fr; }
    .section { padding: 32px 24px; }
}

@media (max-width: 640px) {
    #sidebar { width: 60px; }
    .logo-text, .nav-label, .nav-section-label, .sidebar-footer, .badge { display: none; }
    .logo { justify-content: center; padding: 0 0 20px; }
    .nav-item { justify-content: center; padding: 12px; }
    .nav-item::before { display: none; }
    #sidebar-divider { margin-left: 60px; }
    #main { margin-left: 61px; }
}


#closeBAModal {
    z-index: 9999;
    pointer-events: auto;
    cursor: pointer;
}

#closeBAModal {
    z-index: 9999 !important;
    cursor: pointer !important;
    pointer-events: all !important;
    padding: 10px; /* збільшуємо зону кліку для пальця */
}
.ba-modal {
    z-index: 9998;
}
/* ── THEME TOGGLE ── */
#themeToggle {
    background: none;
    border: 1px solid var(--divider);
    border-radius: 20px;
    cursor: pointer;
    width: 38px;
    height: 22px;
    position: relative;
    padding: 0;
    flex-shrink: 0;
    transition: border-color .3s;
}
#themeToggle::after {
    content: '';
    position: absolute;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--accent);
    top: 2px; left: 2px;
    transition: transform .3s, background .3s;
}
.light #themeToggle::after {
    transform: translateX(16px);
}
#themeToggle .icon-sun,
#themeToggle .icon-moon { display:none; }

/* ── BUTTON TEXT FIX FOR LIGHT THEME ── */
.light .btn-convert,
.light .btn-download,
.light .btn-choose,
.light .bmac-btn {
    color: var(--btn-text) !important;
}

/* ── DROP ZONE LIGHT ── */
.light .drop-zone {
    background: var(--drop-bg);
    border-color: var(--drop-border);
}
.light .section-card,
.light .file-info-bar,
.light .convert-controls,
.light .convert-actions {
    background: var(--card-bg);
}
.light input[type=range] {
    accent-color: var(--accent);
}

/* ── PROGRESS always hidden until active ── */
.progress-wrap[hidden] { display: none !important; }

/* ── MOBILE SIDEBAR PRIVACY BTN ── */
#mobilePPBtn {
    display: none;
}
@media (max-width: 768px) {
    #mobilePPBtn {
        display: block;
        background: none;
        border: none;
        color: var(--text-muted);
        font-size: .72rem;
        cursor: pointer;
        padding: 8px 16px;
        text-decoration: underline dotted;
        text-underline-offset: 3px;
        width: 100%;
        text-align: left;
    }
}

/* ── CLOCK HIDDEN IN LIGHT THEME ── */
.light #deco-panel { display: none; }

/* ── AUDIO SECTION ── */
#section-audio .select-input {
    background: var(--input-bg);
    color: var(--text);
    border: 1px solid var(--drop-border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: .9rem;
    width: 100%;
    cursor: pointer;
}
#audioMp3QualityGroup { margin-top: 12px; }

/* ── CUSTOM CURSOR ── */
/* Базовий курсор на все */
html, body, *, *::before, *::after {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cpath d='M4 2 L4 16 L8 12 L11 18 L13 17 L10 11 L16 11 Z' fill='%23e8a030' stroke='%23000' stroke-width='1'/%3E%3C/svg%3E") 4 2, auto !important;
}
/* Клікабельні — коло з точкою */
a, a *, button, button *, [role=button],
input, input[type=range], input[type=range]::-webkit-slider-thumb,
input[type=range]::-moz-range-thumb,
select, select *,
label, label *,
.nav-item, .nav-item *,
.drop-zone, .drop-zone *,
.lang-btn, .lang-option, .lang-switcher button,
.btn-convert, .btn-download, .btn-choose, .btn-reset,
.btn-primary, .btn-secondary, .btn-primary *, .btn-secondary *,
.bmac-btn, .bmac-btn *,
.method-tab, .pdf-mode-btn,
.privacy-badge, .privacy-badge *,
[id$="Btn"], [id$="btn"],
#ppBtn, #mobilePPBtn, #themeToggle, #hamburger,
.section-card button, .controls-grid button,
.lang-dropdown *, #clockPopup {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='7' fill='none' stroke='%23e8a030' stroke-width='2'/%3E%3Ccircle cx='10' cy='10' r='3' fill='%23e8a030'/%3E%3C/svg%3E") 10 10, pointer !important;
}
/* Годинник — системний pointer */
#clockScene, #clockScene * {
    cursor: pointer !important;
}
#deco-mobile-bg {
    cursor: pointer !important;
    pointer-events: auto !important;
}
#deco-mobile-bg * {
    cursor: pointer !important;
}
/* Тач-девайси — прибрати кастомний */
@media (hover: none) and (pointer: coarse) {
    html, body, *, *::before, *::after { cursor: auto !important; }
    a, button, input, select, label, .nav-item,
    .drop-zone, .btn-convert, .btn-download, .btn-choose,
    .btn-primary, .btn-secondary { cursor: pointer !important; }
}

/* ── CLOCK POPUP ANIMATION already in JS inline ── */

/* ── AUDIO SECTION BUTTONS ── */
#section-audio .btn-convert,
#section-audio .btn-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 10px;
    font-weight: 600;
    font-size: .9rem;
    border: none;
    cursor: pointer;
    transition: opacity .2s;
}
#section-audio .btn-convert {
    background: var(--accent);
    color: var(--btn-text);
}
#section-audio .btn-download {
    background: #2a9d5c;
    color: #fff;
}
#section-audio .select-input {
    background: var(--input-bg);
    color: var(--text);
    border: 1px solid var(--drop-border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: .9rem;
    width: 100%;
}
#section-audio .control-label {
    font-size: .82rem;
    color: var(--text-dim);
    margin-bottom: 6px;
    display: block;
}
#section-audio .convert-controls {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 16px;
}
#section-audio .convert-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

/* ══════════════════════════════════════════
   MOBILE FIXES v0.3.2
   ══════════════════════════════════════════ */

/* Прибрати кастомний курсор на тач-девайсах */
@media (hover: none) and (pointer: coarse) {
    *, *::before, *::after { cursor: auto !important; }
    a, button, [role=button], label, select,
    .nav-item, .drop-zone, .btn-convert,
    .btn-download, .btn-choose { cursor: pointer !important; }
}

/* ── Кнопки на мобілці — повна ширина ── */
@media (max-width: 600px) {
    .btn-convert,
    .btn-download {
        width: 100%;
        justify-content: center;
    }
    #section-audio .convert-actions {
        flex-direction: column;
    }
    #section-audio .btn-convert,
    #section-audio .btn-download {
        width: 100%;
        justify-content: center;
    }

    /* Topbar на маленьких екранах */
    .bmac-btn span { display: none; }
    .bmac-btn { padding: 6px 10px; min-width: unset; }

    /* Drop zone менший паддінг */
    .drop-zone { padding: 24px 12px; }

    /* Section title менший */
    .section-title { font-size: 1.4rem; }

    /* Privacy policy modal — повна ширина */
    #ppModal > div { padding: 24px 20px; }

    /* Toggle теми — тримати видимим */
    #themeToggle { flex-shrink: 0; }

    /* Audio controls */
    #section-audio .convert-controls { flex-direction: column; }
}

/* ── Годинник на мобілці — через deco-mobile-bg ── */
/* clockScene завжди клікабельний */

/* ── BUTTON BORDERS ── */
.btn-convert {
    border: 2px solid transparent !important;
    outline: none;
}
.btn-download {
    border: 2px solid rgba(42,157,92,.5) !important;
}
.btn-choose {
    border: 1px solid var(--accent) !important;
}
.btn-primary {
    border: 2px solid transparent !important;
}
.btn-secondary {
    border: 1px solid var(--border) !important;
}
.btn-reset {
    border: 1px solid rgba(255,100,100,.2) !important;
}
.btn-convert:hover { border-color: rgba(255,255,255,.2) !important; }
.light .btn-secondary { border-color: rgba(180,130,60,.3) !important; }
.light .btn-choose { border-color: var(--accent) !important; }

/* ── PRIVACY POLICY MODAL ── */
#ppModalInner {
    background: var(--bg2);
    border: 1px solid var(--divider);
    border-radius: 16px;
    max-width: 620px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 36px 40px;
    position: relative;
    box-shadow: 0 0 60px rgba(0,0,0,.4);
}
#ppCloseBtn {
    position: absolute;
    top: 16px; right: 20px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    line-height: 1;
    padding: 4px 8px;
}
#ppCloseBtn:hover { color: var(--text); }
#ppModal h3 { font-size:.95rem; color: var(--accent); margin:20px 0 6px; font-weight:600; }
#ppModal p, #ppModal li { font-size:.85rem; color: var(--text-dim); line-height:1.65; margin:0 0 8px; }
#ppModal ul { padding-left:18px; margin:0 0 8px; }
#ppModal a { color: var(--accent); text-decoration:none; }
#ppModal a:hover { text-decoration:underline; }
#ppModal h2 { color: var(--accent); }
#ppModal .badge {
    display:inline-flex; align-items:center; gap:6px;
    background:rgba(79,255,176,.08);
    border:1px solid rgba(79,255,176,.2);
    border-radius:8px; padding:8px 14px;
    font-size:.82rem; color:#4fffb0; margin:10px 0 16px;
}
.light #ppModal .badge { background: rgba(42,157,92,.08); border-color: rgba(42,157,92,.3); color: #2a7a4a; }

/* ── DIGITAL SIDEBAR CLOCK ── */
.sidebar-digiclock {
    font-family: 'Courier New', 'Lucida Console', monospace;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: .18em;
    color: var(--accent);
    text-shadow: 0 0 8px rgba(232,160,48,.5), 0 0 20px rgba(232,160,48,.2);
    background: rgba(232,160,48,.06);
    border: 1px solid rgba(232,160,48,.15);
    border-radius: 6px;
    padding: 4px 10px;
    margin-top: 6px;
    display: inline-block;
    font-variant-numeric: tabular-nums;
    min-width: 84px;
    text-align: center;
}
.light .sidebar-digiclock {
    color: #c47a20;
    text-shadow: 0 0 8px rgba(196,122,32,.3);
    background: rgba(196,122,32,.07);
    border-color: rgba(196,122,32,.2);
}

/* ── GLOBAL RANGE SLIDER STYLE ── */
input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    height: 5px;
    border-radius: 4px;
    background: linear-gradient(to right, var(--accent) var(--val, 50%), rgba(232,160,48,.15) var(--val, 50%));
    outline: none;
    border: none;
    box-shadow: inset 0 0 0 1px rgba(232,160,48,.2);
}
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 3px rgba(232,160,48,.2), 0 2px 6px rgba(0,0,0,.3);
    transition: box-shadow .2s, transform .2s;
}
input[type=range]::-webkit-slider-thumb:hover {
    box-shadow: 0 0 0 6px rgba(232,160,48,.25), 0 2px 6px rgba(0,0,0,.3);
    transform: scale(1.15);
}
input[type=range]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    box-shadow: 0 0 0 3px rgba(232,160,48,.2);
}
input[type=range]::-moz-range-track {
    height: 5px;
    background: linear-gradient(to right, var(--accent) var(--val, 50%), rgba(232,160,48,.15) var(--val, 50%));
    border-radius: 4px;
}
.light input[type=range] {
    background: linear-gradient(to right, var(--accent) var(--val, 50%), rgba(196,122,32,.15) var(--val, 50%));
    box-shadow: inset 0 0 0 1px rgba(196,122,32,.25);
}

/* ── MOBILE DROP ZONE ── */
@media (max-width: 600px) {
    .drop-zone {
        padding: 28px 14px;
        border-width: 2px;
    }
    .drop-icon { width: 36px; height: 36px; }
    .sidebar-digiclock {
        font-size: .85rem;
        padding: 3px 8px;
        min-width: 70px;
    }
}

/* ══ CLOCK — завжди системний pointer, завжди клікабельний ══ */
#clockScene,
#clockScene *,
#deco-mobile-bg,
#deco-mobile-bg * {
    cursor: pointer !important;
    pointer-events: auto !important;
}

@media (max-width: 600px) {
    /* Audio секція */
    #section-audio .convert-controls { gap: 8px; }
    #section-audio .convert-actions { flex-direction: column; }
    #section-audio .btn-convert,
    #section-audio .btn-download { width: 100%; justify-content: center; }
    /* Всі секції */
    .section-card { padding: 16px 12px; }
    .action-row { flex-direction: column; align-items: stretch; }
    .action-row .btn-primary,
    .action-row .btn-secondary { width: 100%; justify-content: center; }
    /* Повзунки — більший thumb на тачскріні */
    input[type=range]::-webkit-slider-thumb { width: 22px; height: 22px; }
}

/* ── BATCH LIST ── */
.batch-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
    max-height: 180px;
    overflow-y: auto;
}
.batch-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: .82rem;
    color: var(--text-dim);
}
.batch-item svg { flex-shrink: 0; color: var(--accent); width:16px;height:16px; }
.batch-item .batch-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.batch-item .batch-size { color: var(--text-muted); flex-shrink: 0; }
.batch-item .batch-status { flex-shrink:0; font-size:.75rem; }
.batch-item .batch-status.done { color: #4fffb0; }
.batch-item .batch-status.err  { color: #ff6b6b; }
.batch-count {
    font-size:.82rem;
    color: var(--accent);
    margin-bottom: 8px;
    font-weight: 600;
}

/* ── FORMAT INFO BADGE ── */
.format-badge {
    display: none;
    font-size: .75rem;
    color: var(--text-muted);
    margin-top: 4px;
    padding: 4px 8px;
    background: rgba(232,160,48,.06);
    border-radius: 6px;
    border: 1px solid rgba(232,160,48,.1);
}
