.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.glass {
    border: 1px solid var(--line);
    background: var(--glass-bg);
    box-shadow: var(--shadow), var(--inner-glow);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    isolation: isolate;
}

.app-shell {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 100dvh;
    padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 68px;
    padding: 8px 16px;
    border-radius: 22px;
}

.topbar-start,
.topbar-actions,
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-start {
    min-width: 0;
}

.topbar-actions {
    flex: 0 0 auto;
    gap: 14px;
}

.brand {
    gap: 12px;
    min-width: 0;
}

.brand-mark {
    width: 40px;
    height: 40px;
    object-fit: contain;
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.brand strong {
    display: block;
    font-size: 15px;
    letter-spacing: -0.02em;
}

.brand small {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.button {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--glass-bg);
    color: var(--text);
    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, calc(0.55 * var(--glass-reflex-light))),
        inset 0 -1px 2px rgba(0, 0, 0, calc(0.12 * var(--glass-reflex-dark))),
        0 4px 18px var(--glass-shadow);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    transition: background-color 0.35s ease, transform 0.35s cubic-bezier(0.34, 1.45, 0.64, 1),
        border-color 0.35s ease;
    cursor: pointer;
    padding: 9px 14px;
}

.button:hover {
    border-color: var(--accent-mid);
    transform: translateY(-1px);
    background: var(--glass-bg-hover);
}

.button:disabled {
    opacity: 0.5;
    cursor: wait;
    transform: none;
}

.button.primary {
    background: linear-gradient(105deg, var(--accent-from), var(--accent-mid) 50%, var(--accent-to));
    color: #1d1d1f;
    border-color: var(--glass-accent-border);
    font-weight: 700;
    box-shadow: 0 8px 26px var(--glass-accent-shadow), var(--inner-glow);
}

.icon-button {
    width: 42px;
    height: 42px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    flex: 0 0 auto;
    text-decoration: none;
    color: inherit;
}

.icon-button svg {
    width: 20px;
    height: 20px;
    display: block;
}

.icon-button--brand {
    width: auto;
    min-width: 42px;
    padding: 0 12px 0 10px;
    gap: 6px;
    line-height: 1;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.icon-button--brand span {
    display: block;
    line-height: 1;
}

.theme-switcher {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    margin: 0;
    padding: 0.3rem;
    border: none;
    border-radius: 9999px;
    background: var(--switcher-track);
    backdrop-filter: blur(22px) saturate(var(--glass-saturation));
    -webkit-backdrop-filter: blur(22px) saturate(var(--glass-saturation));
    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, calc(0.55 * var(--glass-reflex-light))),
        inset 0 -1px 2px rgba(0, 0, 0, calc(0.12 * var(--glass-reflex-dark))),
        0 4px 18px var(--glass-shadow);
}

.theme-switcher::after {
    content: "";
    position: absolute;
    top: 0.3rem;
    left: 0.3rem;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 50%;
    background: var(--switcher-thumb);
    backdrop-filter: blur(14px) saturate(var(--glass-saturation));
    -webkit-backdrop-filter: blur(14px) saturate(var(--glass-saturation));
    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, calc(0.65 * var(--glass-reflex-light))),
        inset 0 -1px 2px rgba(0, 0, 0, calc(0.1 * var(--glass-reflex-dark))),
        0 2px 10px rgba(0, 0, 0, calc(0.12 * var(--glass-reflex-dark)));
    transition: transform 0.5s cubic-bezier(0.34, 1.45, 0.64, 1);
    pointer-events: none;
    z-index: 0;
}

.theme-switcher:has(.theme-switcher__input[data-option="2"]:checked)::after {
    transform: translateX(2.35rem);
}

.theme-switcher__option {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    cursor: pointer;
    border-radius: 50%;
}

.theme-switcher__input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

.theme-switcher__icon {
    width: 18px;
    height: 18px;
    color: var(--switcher-icon);
    transition: color 0.35s ease, transform 0.35s cubic-bezier(0.34, 1.45, 0.64, 1);
}

.theme-switcher:has(.theme-switcher__input[data-option="1"]:checked) .theme-switcher__option:first-of-type .theme-switcher__icon,
.theme-switcher:has(.theme-switcher__input[data-option="2"]:checked) .theme-switcher__option:last-of-type .theme-switcher__icon {
    color: var(--switcher-icon-active);
    transform: scale(1.08);
}

.page {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    flex: 1;
    width: min(860px, 100%);
    margin: 0 auto;
    padding: 0 8px 12px;
}

.hero,
.result {
    position: relative;
    overflow: hidden;
    padding: 36px 32px 28px;
    border-radius: var(--radius);
}

.hero {
    text-align: center;
}

.hero-logo {
    display: block;
    width: 92px;
    height: 92px;
    margin: 0 auto 14px;
    object-fit: contain;
    background: none;
    border: 0;
    box-shadow: none;
}

h1 {
    margin: 8px 0 0;
    font-size: clamp(34px, 6vw, 56px);
    letter-spacing: -0.055em;
    line-height: 1.02;
}

.lead {
    max-width: 34rem;
    margin: 12px auto 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.5;
}

.composer {
    display: flex;
    gap: 8px;
    max-width: 680px;
    margin: 32px auto 0;
    padding: 7px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: var(--glass-bg);
    box-shadow: var(--inner-glow);
}

input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    padding: 14px 16px;
}

input::placeholder {
    color: var(--muted);
}

.status {
    min-height: 1.3em;
    margin-top: 14px;
    color: var(--muted);
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.status.visible {
    opacity: 1;
}

.error {
    min-height: 1.3em;
    margin-top: 10px;
    color: var(--danger);
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.error.visible {
    opacity: 1;
}

.result {
    margin-top: 12px;
    padding: 22px;
}

.result-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
}

.thumb-wrap {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border-radius: 18px;
    background: #111;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.duration {
    position: absolute;
    right: 10px;
    bottom: 10px;
    padding: 4px 8px;
    border-radius: 8px;
    background: var(--glass-bg);
    border: 1px solid var(--line);
    backdrop-filter: var(--blur);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.meta {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.meta h2 {
    margin: 0;
    font-size: 22px;
    letter-spacing: -0.03em;
    line-height: 1.25;
}

.meta p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.controls {
    display: grid;
    gap: 16px;
    margin-top: 20px;
}

.field {
    display: grid;
    gap: 8px;
}

.label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.segmented,
.pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.segmented {
    width: fit-content;
    padding: 4px;
    border-radius: 999px;
    background: var(--switcher-track);
    border: 1px solid var(--line);
}

.segmented .button,
.pills .button {
    min-height: 38px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 650;
}

.segmented .button[aria-checked="true"],
.pills .button[aria-checked="true"] {
    background: linear-gradient(105deg, var(--accent-from), var(--accent-mid) 50%, var(--accent-to));
    color: #1d1d1f;
    border-color: var(--glass-accent-border);
    box-shadow: 0 8px 26px var(--glass-accent-shadow), var(--inner-glow);
}

.pills .button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.actions .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
}

.progress {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.progress-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 650;
}

#progress-percent {
    font-variant-numeric: tabular-nums;
    color: var(--accent-mid);
}

.track {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--switcher-track);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
}

.bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent-from), var(--accent-mid), var(--accent-to));
    box-shadow: 0 0 18px var(--glass-accent-shadow);
    transition: width 0.25s ease, background 2.8s ease;
}

.progress-detail {
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

footer {
    margin-top: 22px;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 720px) {
    .brand small {
        display: none;
    }

    .icon-button--brand span {
        display: none;
    }

    .icon-button--brand {
        padding: 0;
        width: 42px;
    }

    .hero {
        padding: 28px 18px 22px;
    }

    .composer {
        flex-direction: column;
        background: transparent;
        border: 0;
        padding: 0;
        box-shadow: none;
    }

    .composer input {
        border-radius: 16px;
        background: var(--glass-bg);
        border: 1px solid var(--line);
        box-shadow: var(--inner-glow);
    }

    .result-grid {
        grid-template-columns: 1fr;
    }

    .actions .button,
    #analyze {
        width: 100%;
    }
}
