/* ============================================
   Аудио студия — MyQuran.ru
   Мобильный-first интерфейс записи и таймлайна
   ============================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}
input,
textarea {
    -webkit-user-select: text;
    user-select: text;
}
[hidden] {
    display: none !important;
}

:root {
    --as-bg: #0b0d12;
    --as-bg-2: #11141b;
    --as-bg-3: #171b24;
    --as-line: rgba(255, 255, 255, .08);
    --as-text: #f3f4f6;
    --as-muted: #94a3b8;
    --as-accent: #10b981;
    --as-accent-soft: rgba(16, 185, 129, .16);
    --as-accent-2: #34d399;
    --as-danger: #f87171;
    --as-warn: #fbbf24;
    --as-radius: 16px;
    --as-header-h: 56px;
    --as-safe-b: env(safe-area-inset-bottom, 0px);
    --as-safe-t: env(safe-area-inset-top, 0px);
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    overflow: hidden;
    background: var(--as-bg);
    color: var(--as-text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.45;
}

@supports (height: 100svh) {
    html,
    body {
        height: 100svh;
    }
}

button,
input {
    font: inherit;
    color: inherit;
}

.as-root {
    display: flex;
    flex-direction: column;
    height: 100%;
    background:
        radial-gradient(1100px 520px at 50% -10%, rgba(16, 185, 129, .10), transparent 60%),
        var(--as-bg);
}

/* ---------- Шапка ---------- */
.as-header {
    position: relative;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: calc(var(--as-header-h) + var(--as-safe-t));
    padding: calc(8px + var(--as-safe-t)) 10px 8px;
    border-bottom: 1px solid var(--as-line);
    background: rgba(11, 13, 18, .88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.as-back-btn,
.as-icon-btn {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--as-line);
    border-radius: 12px;
    background: var(--as-bg-3);
    color: var(--as-text);
    font-size: 18px;
    cursor: pointer;
    transition: background .15s ease, transform .1s ease;
}
.as-back-btn:active,
.as-icon-btn:active {
    transform: scale(.94);
}

.as-header-center {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.as-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--as-text);
    font-weight: 700;
    font-size: 15px;
}
.as-brand-logo {
    border-radius: 8px;
}
.as-brand-accent {
    color: var(--as-accent);
}

.as-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.as-steps {
    display: flex;
    gap: 6px;
}
.as-step-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border: 1px solid var(--as-line);
    border-radius: 999px;
    background: var(--as-bg-3);
    color: var(--as-muted);
    font-size: 12px;
}
.as-step-pill span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .10);
    font-size: 11px;
    font-weight: 700;
}
.as-step-pill em {
    font-style: normal;
}
.as-step-pill.is-active {
    color: var(--as-text);
    border-color: rgba(16, 185, 129, .5);
    background: var(--as-accent-soft);
}
.as-step-pill.is-active span,
.as-step-pill.is-done span {
    background: var(--as-accent);
    color: #04120c;
}
.as-step-pill.is-done {
    color: var(--as-accent-2);
}

.as-header-actions {
    flex: 0 0 auto;
    display: flex;
    gap: 6px;
}

/* ---------- Тело ---------- */
.as-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 14px 14px calc(24px + var(--as-safe-b));
}

.as-view {
    display: none;
    max-width: 760px;
    margin: 0 auto;
    animation: as-fade .18s ease;
}
.as-view.is-active {
    display: block;
}
@keyframes as-fade {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

.as-view-head {
    text-align: center;
    margin-bottom: 14px;
}
.as-view-head h2 {
    margin: 4px 0 2px;
    font-size: 20px;
}
.as-view-head p {
    margin: 0;
    color: var(--as-muted);
    font-size: 13px;
}
.as-kicker {
    display: inline-block;
    font-size: 11px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--as-accent);
    font-weight: 700;
}

/* ---------- Приветствие ---------- */
.as-hero {
    text-align: center;
    padding: 12px 0 18px;
}
.as-hero-logo {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(16, 185, 129, .25);
}
.as-hero-lead {
    margin: 12px auto 0;
    max-width: 420px;
    color: var(--as-muted);
    font-size: 14px;
}

.as-source-card,
.as-lib-card {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--as-line);
    border-radius: var(--as-radius);
    background: linear-gradient(180deg, var(--as-bg-3), var(--as-bg-2));
    color: var(--as-text);
    text-align: left;
    cursor: pointer;
    transition: transform .12s ease, border-color .15s ease;
}
.as-source-card:active,
.as-lib-card:active {
    transform: scale(.985);
}
.as-source-card--record {
    border-color: rgba(16, 185, 129, .35);
}
.as-source-icon {
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: var(--as-accent-soft);
    color: var(--as-accent);
    font-size: 22px;
}
.as-source-icon--lib {
    background: rgba(96, 165, 250, .16);
    color: #60a5fa;
}
.as-source-card--open .as-source-icon {
    background: rgba(251, 191, 36, .14);
    color: var(--as-warn);
}
.as-source-text {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.as-source-text strong {
    font-size: 16px;
}
.as-source-text small {
    color: var(--as-muted);
    font-size: 12.5px;
}
.as-source-chev {
    color: var(--as-muted);
}

/* ---------- Поиск и список сур ---------- */
.as-search-wrap {
    position: relative;
    margin-bottom: 10px;
}
.as-search-wrap i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--as-muted);
}
.as-search {
    width: 100%;
    height: 44px;
    padding: 0 14px 0 38px;
    border: 1px solid var(--as-line);
    border-radius: 12px;
    background: var(--as-bg-2);
    color: var(--as-text);
    font-size: 15px;
}
.as-search:focus {
    border-color: rgba(16, 185, 129, .5);
}

.as-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: none;
}
.as-list--short {
    max-height: 220px;
    overflow-y: auto;
    padding-right: 2px;
}
.as-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--as-line);
    border-radius: 12px;
    background: var(--as-bg-2);
    color: var(--as-text);
    text-align: left;
    cursor: pointer;
}
.as-row.is-active {
    border-color: rgba(16, 185, 129, .55);
    background: var(--as-accent-soft);
}
.as-row-num {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, .06);
    color: var(--as-accent-2);
    font-weight: 700;
    font-size: 13px;
}
.as-row-text {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.as-row-text strong {
    font-size: 14.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.as-row-text small {
    color: var(--as-muted);
    font-size: 12px;
}
.as-row-ar {
    flex: 0 0 auto;
    font-family: "Amiri Quran", "Noto Naskh Arabic", serif;
    font-size: 19px;
    color: var(--as-text);
}

/* ---------- Выбор аятов ---------- */
.as-range-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}
.as-chip {
    padding: 8px 14px;
    border: 1px solid var(--as-line);
    border-radius: 999px;
    background: var(--as-bg-3);
    color: var(--as-text);
    font-size: 13px;
    cursor: pointer;
}
.as-chip.is-on {
    border-color: rgba(16, 185, 129, .55);
    background: var(--as-accent-soft);
    color: var(--as-accent-2);
}
.as-range-mini {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}
.as-range-mini--ctx {
    margin: 10px auto 0;
    justify-content: center;
}
.as-num {
    width: 62px;
    height: 38px;
    text-align: center;
    border: 1px solid var(--as-line);
    border-radius: 10px;
    background: var(--as-bg-2);
    color: var(--as-text);
}

.as-ayah-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}
.as-ayah-cell {
    position: relative;
    aspect-ratio: 1 / 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--as-line);
    border-radius: 10px;
    background: var(--as-bg-2);
    color: var(--as-muted);
    font-size: 13px;
    cursor: pointer;
}
.as-ayah-cell.is-in {
    border-color: rgba(16, 185, 129, .5);
    background: var(--as-accent-soft);
    color: var(--as-text);
}
.as-ayah-cell.is-edge::after {
    content: "";
    position: absolute;
    inset: auto 6px 4px 6px;
    height: 2px;
    border-radius: 2px;
    background: var(--as-accent);
}
.as-hint {
    margin: 10px 0 0;
    text-align: center;
    color: var(--as-muted);
    font-size: 13px;
}

/* ---------- Запись ---------- */
.as-rec-progress {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-bottom: 12px;
}
.as-rec-dot {
    min-width: 30px;
    padding: 5px 8px;
    border-radius: 999px;
    border: 1px solid var(--as-line);
    background: var(--as-bg-3);
    color: var(--as-muted);
    font-size: 12px;
    text-align: center;
}
.as-rec-dot.is-current {
    border-color: rgba(16, 185, 129, .6);
    background: var(--as-accent-soft);
    color: var(--as-text);
}
.as-rec-dot.is-done {
    background: rgba(16, 185, 129, .22);
    border-color: transparent;
    color: #d1fae5;
}

.as-ayah-card {
    padding: 16px;
    border: 1px solid var(--as-line);
    border-radius: var(--as-radius);
    background: linear-gradient(180deg, var(--as-bg-3), var(--as-bg-2));
    text-align: center;
}
.as-ayah-num {
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--as-accent);
    font-weight: 700;
}
.as-ayah-ar {
    margin: 10px 0 0;
    font-family: "Amiri Quran", "Noto Naskh Arabic", serif;
    font-size: 26px;
    line-height: 1.9;
    word-break: break-word;
}
.as-ayah-tr {
    margin: 10px 0 0;
    color: var(--as-muted);
    font-size: 13.5px;
    line-height: 1.5;
}

.as-rec-status {
    margin: 14px 0 4px;
    text-align: center;
}
.as-rec-hint {
    margin: 0;
    color: var(--as-muted);
    font-size: 13.5px;
    min-height: 20px;
}
.as-rec-timer {
    margin: 4px 0 0;
    font-variant-numeric: tabular-nums;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: .04em;
}
.as-rec-status.is-listening .as-rec-timer {
    color: var(--as-accent-2);
}

.as-rec-result {
    margin-top: 12px;
    padding: 14px;
    border: 1px solid var(--as-line);
    border-radius: var(--as-radius);
    background: var(--as-bg-2);
}
.as-rec-result.is-pass {
    border-color: rgba(16, 185, 129, .5);
    background: rgba(16, 185, 129, .10);
}
.as-rec-result.is-fail {
    border-color: rgba(251, 191, 36, .45);
    background: rgba(251, 191, 36, .08);
}
.as-rec-result.is-live {
    border-color: rgba(248, 113, 113, .55);
    background: rgba(248, 113, 113, .08);
}
.as-rec-result.is-live .as-rec-score {
    color: var(--as-accent-2);
}
.as-rec-result.is-busy {
    opacity: .85;
}
.as-rec-count {
    margin: 6px 0 0;
    color: var(--as-muted);
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
}
.as-rec-result.is-live .as-rec-count {
    color: var(--as-accent-2);
}
.as-rec-result-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 8px;
}
.as-rec-score {
    font-size: 26px;
    font-weight: 800;
}
.as-rec-result.is-pass .as-rec-score {
    color: var(--as-accent-2);
}
.as-rec-result.is-fail .as-rec-score {
    color: var(--as-warn);
}
.as-rec-result-label {
    color: var(--as-muted);
    font-size: 13px;
}
.as-rec-words {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    direction: rtl;
}
.as-rec-word {
    padding: 4px 8px;
    border-radius: 8px;
    font-family: "Amiri Quran", "Noto Naskh Arabic", serif;
    font-size: 19px;
    background: rgba(255, 255, 255, .06);
    color: var(--as-text);
}
.as-rec-word.ok { background: rgba(16, 185, 129, .22); }
.as-rec-word.bad { background: rgba(248, 113, 113, .22); }
.as-rec-word.miss { background: rgba(251, 191, 36, .20); color: #fde68a; }
.as-rec-word.skip { opacity: .55; }
.as-rec-word.wait {
    opacity: .6;
    outline: 1px solid rgba(255, 255, 255, .07);
}
.as-rec-words {
    max-height: 34vh;
    overflow-y: auto;
    padding-left: 2px;
    padding-right: 2px;
}

.as-rec-actions {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.as-rec-actions-row {
    display: flex;
    gap: 10px;
}
.as-rec-actions-row .as-btn {
    flex: 1 1 0;
}

.as-big-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 60px;
    padding: 14px 18px;
    border: none;
    border-radius: 18px;
    font-size: 17px;
    font-weight: 700;
    color: #04120c;
    background: linear-gradient(180deg, var(--as-accent-2), var(--as-accent));
    box-shadow: 0 12px 26px rgba(16, 185, 129, .28);
    cursor: pointer;
    transition: transform .12s ease, filter .15s ease;
}
.as-big-btn i {
    font-size: 22px;
}
.as-big-btn:active {
    transform: scale(.98);
}
.as-big-btn[disabled] {
    opacity: .45;
    box-shadow: none;
    pointer-events: none;
}
.as-big-btn--record.is-recording {
    background: linear-gradient(180deg, #fca5a5, #f87171);
    box-shadow: 0 12px 26px rgba(248, 113, 113, .3);
}
.as-big-btn--go {
    background: linear-gradient(180deg, #93c5fd, #3b82f6);
    box-shadow: 0 12px 26px rgba(59, 130, 246, .28);
}

.as-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 12px 18px;
    border-radius: 14px;
    border: 1px solid var(--as-line);
    background: var(--as-bg-3);
    color: var(--as-text);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .1s ease, background .15s ease;
}
.as-btn:active {
    transform: scale(.97);
}
.as-btn--primary {
    border: none;
    background: linear-gradient(180deg, var(--as-accent-2), var(--as-accent));
    color: #04120c;
}
.as-btn--ghost {
    background: var(--as-bg-2);
}
.as-btn--wide {
    width: 100%;
}
.as-btn[disabled] {
    opacity: .45;
    pointer-events: none;
}

/* ---------- Открыть аудио ---------- */
.as-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 30px 18px;
    border: 2px dashed rgba(255, 255, 255, .16);
    border-radius: var(--as-radius);
    background: var(--as-bg-2);
    color: var(--as-text);
    cursor: pointer;
    text-align: center;
}
.as-drop i {
    font-size: 34px;
    color: var(--as-warn);
}
.as-drop small {
    color: var(--as-muted);
}
.as-drop.is-over {
    border-color: var(--as-accent);
    background: var(--as-accent-soft);
}

.as-file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 12px;
    border: 1px solid var(--as-line);
    border-radius: 14px;
    background: var(--as-bg-2);
}
.as-file-info > i {
    font-size: 22px;
    color: var(--as-accent-2);
}
.as-file-meta {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.as-file-meta strong {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
}
.as-file-meta small {
    color: var(--as-muted);
    font-size: 12px;
}

.as-ctx {
    margin-top: 14px;
}
.as-chip--toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.as-ctx-body {
    margin-top: 10px;
    padding: 12px;
    border: 1px solid var(--as-line);
    border-radius: 14px;
    background: var(--as-bg-2);
}

/* ---------- Обработка ---------- */
.as-process {
    text-align: center;
    padding: 30px 6px;
}
.as-process-orb {
    width: 84px;
    height: 84px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--as-accent-soft);
    color: var(--as-accent);
    font-size: 34px;
    animation: as-pulse 1.6s ease-in-out infinite;
}
@keyframes as-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, .35); }
    50% { transform: scale(1.06); box-shadow: 0 0 0 18px rgba(16, 185, 129, 0); }
}
.as-process h2 {
    margin: 0 0 4px;
    font-size: 19px;
}
.as-process p {
    margin: 0 0 14px;
    color: var(--as-muted);
    font-size: 13.5px;
    min-height: 20px;
}
.as-progress {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    overflow: hidden;
    margin-bottom: 18px;
}
.as-progress-bar {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--as-accent), var(--as-accent-2));
    transition: width .3s ease;
}

/* ---------- Студия ---------- */
.as-view--studio {
    max-width: 980px;
}
.as-project-meta {
    margin-bottom: 10px;
}
.as-project-title {
    font-size: 18px;
    font-weight: 700;
}
.as-project-sub {
    color: var(--as-muted);
    font-size: 12.5px;
}

.as-player {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.as-play-btn {
    flex: 0 0 auto;
    width: 54px;
    height: 54px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(180deg, var(--as-accent-2), var(--as-accent));
    color: #04120c;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(16, 185, 129, .3);
    transition: transform .1s ease;
}
.as-play-btn:active {
    transform: scale(.94);
}
.as-time {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 6px;
    font-variant-numeric: tabular-nums;
    color: var(--as-muted);
    font-size: 14px;
}
.as-time #as-time-cur {
    color: var(--as-text);
    font-weight: 700;
}
.as-zoom {
    display: flex;
    gap: 6px;
}

.as-timeline {
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--as-line);
    border-radius: var(--as-radius);
    background: linear-gradient(180deg, #0e1118, #0b0d12);
    touch-action: pan-x;
}
.as-timeline-inner {
    position: relative;
    height: 128px;
    min-width: 100%;
}
.as-wave {
    position: absolute;
    left: 0;
    top: 6px;
    width: 100%;
    height: 72px;
    opacity: .55;
}
.as-words {
    position: absolute;
    left: 0;
    right: 0;
    top: 84px;
    height: 40px;
}
.as-word {
    position: absolute;
    top: 0;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 1px solid rgba(255, 255, 255, .10);
    border-radius: 8px;
    background: rgba(255, 255, 255, .05);
    color: var(--as-muted);
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    cursor: pointer;
    transition: background .12s ease, color .12s ease;
}
.as-word.is-active {
    background: var(--as-accent);
    border-color: var(--as-accent-2);
    color: #04120c;
    font-weight: 700;
}
.as-word.is-seek {
    background: rgba(16, 185, 129, .25);
    color: var(--as-text);
}
.as-word-edge {
    position: absolute;
    top: 0;
    width: 16px;
    height: 36px;
    margin-left: -8px;
    cursor: ew-resize;
    touch-action: none;
    z-index: 3;
}
.as-word-edge::after {
    content: "";
    position: absolute;
    left: 7px;
    top: 2px;
    width: 2px;
    height: 32px;
    border-radius: 2px;
    background: rgba(255, 255, 255, .35);
}
.as-word-edge.is-drag::after,
.as-word-edge:active::after {
    background: var(--as-warn);
}
.as-seg-mark {
    position: absolute;
    top: 0;
    width: 1px;
    height: 78px;
    background: rgba(255, 255, 255, .28);
}
.as-seg-label {
    position: absolute;
    top: 4px;
    padding: 1px 6px;
    border-radius: 6px;
    background: rgba(11, 13, 18, .8);
    color: var(--as-muted);
    font-size: 10px;
    white-space: nowrap;
}
.as-playhead {
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 128px;
    background: var(--as-accent-2);
    box-shadow: 0 0 10px rgba(52, 211, 153, .8);
    pointer-events: none;
    z-index: 4;
}

.as-studio-hint {
    margin: 8px 0 12px;
    text-align: center;
    color: var(--as-muted);
    font-size: 12px;
}

.as-read-panel {
    border: 1px solid var(--as-line);
    border-radius: var(--as-radius);
    background: var(--as-bg-2);
    overflow: hidden;
}
.as-read-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--as-line);
    font-size: 12.5px;
    color: var(--as-muted);
}
.as-read-score {
    font-weight: 700;
    color: var(--as-accent-2);
}
.as-read-body {
    padding: 14px;
    font-family: "Amiri Quran", "Noto Naskh Arabic", serif;
    font-size: 23px;
    line-height: 2;
    word-break: break-word;
}
.as-read-rw {
    display: inline-block;
    padding: 0 2px;
    border-radius: 6px;
    transition: background .12s ease;
}
.as-read-rw.is-active {
    background: var(--as-accent);
    color: #04120c;
}
.as-read-tr {
    padding: 0 14px 14px;
    color: var(--as-muted);
    font-size: 13px;
}

.as-studio-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}
.as-studio-actions .as-btn {
    flex: 1 1 0;
    min-width: 0;
    white-space: nowrap;
}

/* ---------- Мои записи ---------- */
.as-lib-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.as-lib-item {
    padding: 12px;
    border: 1px solid var(--as-line);
    border-radius: var(--as-radius);
    background: var(--as-bg-2);
}
.as-lib-item-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.as-lib-item-title {
    flex: 1 1 auto;
    min-width: 0;
}
.as-lib-item-title strong {
    display: block;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.as-lib-item-title small {
    color: var(--as-muted);
    font-size: 12px;
}
.as-lib-item-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.as-lib-item-actions .as-btn {
    min-height: 40px;
    padding: 8px 14px;
    font-size: 13.5px;
}
.as-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--as-accent-soft);
    color: var(--as-accent-2);
    font-size: 11.5px;
    font-weight: 700;
}
.as-badge--warn {
    background: rgba(251, 191, 36, .16);
    color: var(--as-warn);
}
.as-empty {
    padding: 34px 14px;
    text-align: center;
    color: var(--as-muted);
    border: 1px dashed var(--as-line);
    border-radius: var(--as-radius);
}
.as-empty i {
    display: block;
    font-size: 30px;
    margin-bottom: 8px;
}

/* ---------- Модалки ---------- */
.as-modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: none;
    align-items: flex-end;
    justify-content: center;
}
.as-modal.is-open {
    display: flex;
}
.as-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 5, 9, .66);
    backdrop-filter: blur(2px);
}
.as-sheet {
    position: relative;
    width: 100%;
    max-width: 520px;
    padding: 10px 16px calc(16px + var(--as-safe-b));
    border: 1px solid var(--as-line);
    border-bottom: none;
    border-radius: 20px 20px 0 0;
    background: #12151d;
    animation: as-slide .22s ease;
}
@keyframes as-slide {
    from { transform: translateY(24px); opacity: .6; }
    to { transform: none; opacity: 1; }
}
.as-sheet-handle {
    width: 44px;
    height: 4px;
    margin: 2px auto 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .18);
}
.as-sheet h3 {
    margin: 0 0 4px;
    font-size: 18px;
}
.as-sheet-sub {
    margin: 0 0 12px;
    color: var(--as-muted);
    font-size: 12.5px;
}
.as-export-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.as-export-opt {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px;
    border: 1px solid var(--as-line);
    border-radius: 14px;
    background: var(--as-bg-2);
    color: var(--as-text);
    text-align: left;
    cursor: pointer;
}
.as-export-opt:active {
    transform: scale(.99);
}
.as-export-opt i {
    font-size: 24px;
    color: var(--as-accent-2);
}
.as-export-opt span {
    display: flex;
    flex-direction: column;
}
.as-export-opt small {
    color: var(--as-muted);
    font-size: 12px;
}
.as-export-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}
.as-export-actions .as-btn {
    flex: 1 1 0;
}
.as-input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid var(--as-line);
    border-radius: 12px;
    background: var(--as-bg-2);
    color: var(--as-text);
}

/* ---------- Тост ---------- */
.as-toast {
    position: fixed;
    left: 50%;
    bottom: calc(24px + var(--as-safe-b));
    transform: translateX(-50%) translateY(12px);
    max-width: min(92vw, 420px);
    padding: 10px 16px;
    border-radius: 12px;
    background: rgba(20, 24, 32, .96);
    border: 1px solid var(--as-line);
    color: var(--as-text);
    font-size: 13.5px;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
    z-index: 120;
}
.as-toast.is-on {
    opacity: 1;
    transform: translateX(-50%);
}

/* ---------- Панель обработки студии ---------- */
.as-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    margin: 10px 0 12px;
    padding: 10px 12px;
    border: 1px solid var(--as-line);
    border-radius: var(--as-radius);
    background: var(--as-bg-2);
}
.as-tool {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.as-tool--grow {
    flex: 1 1 180px;
}
.as-tool--actions {
    margin-left: auto;
}
.as-tool-label {
    color: var(--as-muted);
    font-size: 12px;
    white-space: nowrap;
}
.as-tool-hint {
    color: var(--as-muted);
    font-size: 11.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.as-seg {
    display: inline-flex;
    padding: 3px;
    border: 1px solid var(--as-line);
    border-radius: 10px;
    background: var(--as-bg-3);
}
.as-seg-btn {
    border: 0;
    border-radius: 8px;
    padding: 5px 10px;
    background: transparent;
    color: var(--as-muted);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.as-seg-btn.is-on {
    background: var(--as-accent-soft);
    color: var(--as-accent-2);
}
.as-slider {
    flex: 1 1 auto;
    min-width: 90px;
    accent-color: var(--as-accent);
    cursor: pointer;
}
.as-word.is-audition {
    background: var(--as-warn);
    border-color: var(--as-warn);
    color: #1a1206;
    font-weight: 700;
}

/* ---------- Опции экспорта ---------- */
.as-export-opts {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 12px 0 4px;
    padding-top: 12px;
    border-top: 1px solid var(--as-line);
}
.as-check {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13px;
    color: var(--as-text);
    cursor: pointer;
}
.as-check input {
    width: 16px;
    height: 16px;
    accent-color: var(--as-accent);
    cursor: pointer;
}
.as-check input:disabled + span {
    opacity: .45;
}
.as-export-note {
    color: var(--as-muted);
    font-size: 12px;
}

/* ---------- Планшет и десктоп ---------- */
@media (min-width: 700px) {
    .as-body {
        padding: 22px 22px 34px;
    }
    .as-view-head h2 {
        font-size: 24px;
    }
    .as-ayah-grid {
        grid-template-columns: repeat(12, 1fr);
    }
    .as-ayah-ar {
        font-size: 32px;
    }
    .as-modal {
        align-items: center;
    }
    .as-sheet {
        border-bottom: 1px solid var(--as-line);
        border-radius: 20px;
        padding-bottom: 18px;
    }
    .as-source-card,
    .as-lib-card {
        max-width: 560px;
        margin-left: auto;
        margin-right: auto;
    }
}

@media (min-width: 1024px) {
    .as-timeline-inner {
        height: 150px;
    }
    .as-words,
    .as-word,
    .as-word-edge {
        height: 44px;
    }
    .as-words {
        top: 92px;
    }
    .as-playhead {
        height: 150px;
    }
    .as-studio-hint {
        display: none;
    }
}
