/* ==========================================================================
   MyCDBag — Ringtones & Skiza (studio editor, admin review, store, library)
   Namespace: .tn-*  · builds on the studio .sp-* components and design tokens
   ========================================================================== */

:root {
    --tn-accent: var(--color-studio, #7c3aed);
    --tn-accent-2: var(--color-studio-mid, #2563eb);
    --tn-grad: var(--color-studio-grad, linear-gradient(135deg, #7c3aed 0%, #2563eb 60%, #0ea5e9 100%));
    --tn-skiza: #0f9d58;
    --tn-skiza-soft: #e7f6ee;
    --tn-ink: var(--color-text, #111827);
    --tn-muted: var(--color-text-muted, #687386);
    --tn-line: var(--color-border, #e3e8f1);
    --tn-surface: var(--color-surface, #fff);
    --tn-surface-alt: var(--color-surface-alt, #f7f9fd);
    --tn-radius: var(--radius-md, 12px);
    --tn-radius-lg: var(--radius-lg, 16px);
    --tn-focus: 0 0 0 3px rgba(124, 58, 237, .35);
}

.tn-visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
/* Component display rules must not defeat the hidden attribute used by the scripts. */
.sp-alert[hidden], .tn-wave__status[hidden], .tn-pricing[hidden], .tn-pricing__amount[hidden],
.tn-skiza-note[hidden], .tn-preview-audio[hidden], .tn-picker li[hidden], .tn-picker__empty[hidden] {
    display: none !important;
}
.tn-muted { color: var(--tn-muted); font-weight: 500; }
.tn-block { width: 100%; justify-content: center; }
.tn-eyebrow-sub { opacity: .65; }

/* ── Status & kind chips ──────────────────────────────────────────────── */
.tn-status, .tn-kind {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 11.5px; font-weight: 700; letter-spacing: .02em;
    padding: 3px 10px; border-radius: 999px; white-space: nowrap; line-height: 1.6;
}
.tn-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tn-status--draft { background: #f1f3f8; color: #4b5563; }
.tn-status--in_review { background: #fff4e0; color: #a35a00; }
.tn-status--changes_requested { background: #fdecec; color: #b42318; }
.tn-status--awaiting_skiza_code { background: #e9f0ff; color: #1d4ed8; }
.tn-status--live { background: #e6f7ee; color: #067647; }
.tn-status--archived { background: #f2f2f2; color: #6b7280; }
.tn-kind--ringtone { background: #f1eaff; color: #6d28d9; }
.tn-kind--skiza { background: var(--tn-skiza-soft); color: #0b7a44; }
.tn-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 700; letter-spacing: .06em;
}

/* ── Studio list ──────────────────────────────────────────────────────── */
.tn-stats {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px;
}
.tn-stat {
    background: var(--tn-surface); border: 1px solid var(--tn-line); border-radius: var(--tn-radius);
    padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow-xs);
}
.tn-stat__value { font-size: 24px; font-weight: 800; color: var(--tn-ink); font-variant-numeric: tabular-nums; }
.tn-stat__label { font-size: 12.5px; color: var(--tn-muted); font-weight: 600; }

.tn-steps {
    background: linear-gradient(135deg, rgba(124, 58, 237, .07), rgba(37, 99, 235, .06));
    border: 1px solid rgba(124, 58, 237, .14); border-radius: var(--tn-radius-lg);
    padding: 16px 18px; margin-bottom: 18px;
}
.tn-steps__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tn-steps__list li { display: flex; gap: 12px; align-items: flex-start; }
.tn-steps__list strong { display: block; font-size: 14px; color: var(--tn-ink); }
.tn-steps__list p { margin: 2px 0 0; font-size: 13px; color: var(--tn-muted); line-height: 1.5; }
.tn-steps__num {
    flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--tn-grad); color: #fff;
    display: grid; place-items: center; font-weight: 800; font-size: 13px;
}
.tn-steps__limits { margin: 14px 0 0; font-size: 12.5px; color: var(--tn-muted); }

.tn-empty { padding: 40px 20px; text-align: center; }
.tn-list { list-style: none; margin: 0; padding: 0; }
.tn-row {
    display: grid; grid-template-columns: 56px minmax(0, 1fr) auto auto auto;
    gap: 16px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--tn-line);
}
.tn-row:first-child { border-top: none; }
.tn-row__art {
    width: 56px; height: 56px; border-radius: 10px; overflow: hidden; background: var(--tn-grad);
    display: grid; place-items: center; color: #fff; flex: none;
}
.tn-row__art img { width: 100%; height: 100%; object-fit: cover; }
.tn-row__art-fallback { display: grid; place-items: center; font-size: 20px; }
.tn-row__title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 700; color: var(--tn-ink); font-size: 14.5px; }
.tn-row__meta { margin-top: 3px; font-size: 12.5px; color: var(--tn-muted); }
.tn-row__note {
    margin: 8px 0 0; font-size: 12.5px; background: #fff7ed; color: #8a3d00; border: 1px solid #fed7aa;
    border-radius: 8px; padding: 8px 10px; line-height: 1.5;
}
.tn-row__audio { margin-top: 8px; height: 34px; width: min(100%, 320px); }
.tn-row__commerce { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 13px; }
.tn-price { font-weight: 800; color: var(--tn-ink); }
.tn-row__downloads { color: var(--tn-muted); font-size: 12px; }
.tn-row__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.tn-row__actions form { margin: 0; }

/* ── Dialogs (track picker, confirm) ──────────────────────────────────── */
.tn-dialog {
    border: none; border-radius: var(--tn-radius-lg); padding: 0; width: min(560px, calc(100vw - 32px));
    margin: auto; max-height: calc(100vh - 48px);
    box-shadow: 0 30px 80px rgba(15, 23, 42, .35); color: var(--tn-ink);
}
.tn-dialog::backdrop { background: rgba(15, 23, 42, .55); backdrop-filter: blur(2px); }
.tn-dialog__inner { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.tn-dialog__header { display: flex; align-items: center; justify-content: space-between; }
.tn-dialog__header h2, .tn-dialog__title { margin: 0; font-size: 18px; font-weight: 800; }
.tn-dialog__close {
    border: none; background: var(--tn-surface-alt); width: 34px; height: 34px; border-radius: 50%;
    cursor: pointer; font-size: 14px; color: var(--tn-muted);
}
.tn-dialog__message { margin: 0; color: var(--tn-muted); line-height: 1.6; }
.tn-dialog__actions { display: flex; justify-content: flex-end; gap: 8px; }
.tn-dialog--confirm { width: min(440px, calc(100vw - 32px)); }
.tn-dialog__search input {
    width: 100%; padding: 11px 14px; border: 1px solid var(--tn-line); border-radius: 10px;
    font: inherit; background: var(--tn-surface-alt);
}
.tn-dialog__search input:focus { outline: none; box-shadow: var(--tn-focus); border-color: var(--tn-accent); }
.tn-picker { list-style: none; margin: 0; padding: 0; max-height: 52vh; overflow: auto; }
.tn-picker__item {
    display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 10px;
    text-decoration: none; color: inherit;
}
.tn-picker__item:hover, .tn-picker__item:focus-visible { background: var(--tn-surface-alt); outline: none; }
.tn-picker__art { width: 44px; height: 44px; border-radius: 8px; overflow: hidden; background: var(--tn-grad); flex: none; }
.tn-picker__art img { width: 100%; height: 100%; object-fit: cover; }
.tn-picker__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tn-picker__title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tn-picker__meta { font-size: 12.5px; color: var(--tn-muted); }
.tn-picker__draft { margin-left: 6px; font-size: 11px; background: #f1f3f8; padding: 1px 6px; border-radius: 6px; }
.tn-picker__go { font-size: 22px; color: var(--tn-muted); }
.tn-picker__empty { margin: 0; text-align: center; color: var(--tn-muted); }

/* ── Editor ───────────────────────────────────────────────────────────── */
.tn-crumb { color: inherit; text-decoration: none; }
.tn-crumb:hover { text-decoration: underline; }
.tn-editor { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.tn-editor__main { padding: 20px; }
.tn-editor__side { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 16px; }

.tn-track { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.tn-track__art {
    width: 52px; height: 52px; border-radius: 10px; overflow: hidden; background: var(--tn-grad);
    display: grid; place-items: center; color: #fff; flex: none;
}
.tn-track__art img { width: 100%; height: 100%; object-fit: cover; }
.tn-track__text { flex: 1; min-width: 0; }
.tn-track__title { margin: 0; font-size: 17px; font-weight: 800; color: var(--tn-ink); }
.tn-track__meta { margin: 2px 0 0; font-size: 13px; color: var(--tn-muted); }
.tn-track__readout { text-align: right; }
.tn-track__readout-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--tn-muted); font-weight: 700; }
.tn-track__readout-value { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--tn-ink); }

.tn-wave {
    --tn-wave-idle: #c9cee3;
    --tn-wave-active: #ffffff;
    --tn-envelope: rgba(255, 255, 255, .85);
    position: relative; height: 150px; border-radius: 14px; overflow: hidden;
    background: linear-gradient(180deg, #f6f7fc, #eef0f8);
    border: 1px solid var(--tn-line); touch-action: none; user-select: none; cursor: crosshair;
}
.tn-wave__canvas { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.tn-wave__region {
    position: absolute; top: 0; bottom: 0; z-index: 1; cursor: grab;
    background: var(--tn-grad); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35);
}
.tn-wave.is-dragging .tn-wave__region { cursor: grabbing; }
.tn-wave__region-label {
    position: absolute; top: 8px; left: 50%; transform: translateX(-50%); z-index: 4;
    background: rgba(17, 24, 39, .72); color: #fff; font-size: 11.5px; font-weight: 700;
    padding: 2px 8px; border-radius: 999px; font-variant-numeric: tabular-nums; pointer-events: none;
}
.tn-wave__dim { position: absolute; top: 0; bottom: 0; z-index: 3; background: rgba(246, 247, 252, .35); pointer-events: none; }
.tn-wave__dim--left { left: 0; }
.tn-wave__dim--right { right: 0; }
.tn-wave__handle {
    position: absolute; top: 0; bottom: 0; width: 22px; margin-left: -11px; z-index: 5;
    cursor: ew-resize; display: grid; place-items: center; outline: none;
}
.tn-wave__handle::before {
    content: ''; position: absolute; top: 0; bottom: 0; left: 10px; width: 2px; background: #fff;
    box-shadow: 0 0 0 1px rgba(76, 29, 149, .5);
}
.tn-wave__grip {
    position: relative; width: 14px; height: 38px; border-radius: 7px; background: #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .35); border: 2px solid var(--tn-accent);
}
.tn-wave__handle:focus-visible .tn-wave__grip { box-shadow: var(--tn-focus), 0 2px 8px rgba(15, 23, 42, .35); }
.tn-wave__playhead {
    position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; z-index: 6;
    background: #f43f5e; box-shadow: 0 0 6px rgba(244, 63, 94, .6); pointer-events: none;
}
.tn-wave__status {
    position: absolute; inset: 0; z-index: 7; display: flex; align-items: center; justify-content: center; gap: 10px;
    background: rgba(246, 247, 252, .92); color: var(--tn-muted); font-weight: 600; font-size: 13.5px; text-align: center; padding: 0 16px;
}
.tn-wave__status.is-warning { background: rgba(255, 247, 237, .9); color: #8a3d00; }
.tn-wave:not(.is-ready) .tn-wave__handle, .tn-wave:not(.is-ready) .tn-wave__region { visibility: hidden; }
.tn-spinner {
    width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(124, 58, 237, .25);
    border-top-color: var(--tn-accent); animation: tn-spin .8s linear infinite;
}
@keyframes tn-spin { to { transform: rotate(360deg); } }

.tn-ruler { position: relative; height: 20px; margin: 4px 0 12px; }
.tn-ruler__tick {
    position: absolute; top: 0; transform: translateX(-50%); font-size: 11px; color: var(--tn-muted);
    font-variant-numeric: tabular-nums;
}
.tn-ruler__tick::before { content: ''; position: absolute; top: -4px; left: 50%; width: 1px; height: 4px; background: var(--tn-line); }
.tn-ruler__tick:first-child { transform: none; }

.tn-transport { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.tn-transport__sep { width: 1px; height: 26px; background: var(--tn-line); margin: 0 4px; }
.tn-play {
    width: 52px; height: 52px; border-radius: 50%; border: none; cursor: pointer; color: #fff;
    background: var(--tn-grad); display: grid; place-items: center; box-shadow: 0 8px 20px rgba(124, 58, 237, .35);
    transition: transform var(--transition-fast, .15s ease);
}
.tn-play:hover { transform: scale(1.05); }
.tn-play:focus-visible { outline: none; box-shadow: var(--tn-focus), 0 8px 20px rgba(124, 58, 237, .35); }
.tn-play .tn-icon-pause, .tn-play.is-playing .tn-icon-play { display: none; }
.tn-play.is-playing .tn-icon-pause { display: block; }
.tn-tool {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px;
    border: 1px solid var(--tn-line); background: var(--tn-surface); color: var(--tn-ink);
    font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.tn-tool:hover { border-color: var(--tn-accent); color: var(--tn-accent); }
.tn-tool:focus-visible { outline: none; box-shadow: var(--tn-focus); }
.tn-tool[aria-pressed="true"] { background: #f1eaff; border-color: #c4b5fd; color: #5b21b6; }
.tn-key {
    display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 5px;
    background: var(--tn-surface-alt); border: 1px solid var(--tn-line); font-size: 11px; font-weight: 800;
}

.tn-times { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: end; margin-bottom: 14px; }
.tn-time label { display: block; font-size: 12px; font-weight: 700; color: var(--tn-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .06em; }
.tn-time__control { display: flex; align-items: center; gap: 4px; }
.tn-time__input {
    width: 100%; min-width: 0; text-align: center; padding: 9px 6px; border: 1px solid var(--tn-line); border-radius: 10px;
    font: inherit; font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; color: var(--tn-ink);
}
.tn-time__input:focus { outline: none; border-color: var(--tn-accent); box-shadow: var(--tn-focus); }
.tn-nudge {
    flex: none; border: 1px solid var(--tn-line); background: var(--tn-surface-alt); border-radius: 8px;
    padding: 8px 6px; font: inherit; font-size: 11.5px; font-weight: 700; color: var(--tn-muted); cursor: pointer; min-width: 36px;
}
.tn-nudge:hover { color: var(--tn-accent); border-color: #c4b5fd; }
.tn-nudge:focus-visible { outline: none; box-shadow: var(--tn-focus); }
.tn-length {
    text-align: center; padding: 8px 16px; border-radius: 12px; background: #f1eaff; color: #5b21b6;
    display: flex; flex-direction: column; min-width: 120px;
}
.tn-length__label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; opacity: .8; }
.tn-length__value { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tn-length__hint { font-size: 11.5px; font-weight: 600; }
.tn-length.is-invalid { background: #fdecec; color: #b42318; }

.tn-presets { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.tn-presets__label { font-size: 12px; font-weight: 700; color: var(--tn-muted); text-transform: uppercase; letter-spacing: .06em; }
.tn-presets__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tn-preset {
    border: 1px solid var(--tn-line); background: var(--tn-surface); border-radius: 999px; padding: 5px 12px;
    font: inherit; font-size: 12.5px; font-weight: 700; color: var(--tn-ink); cursor: pointer;
}
.tn-preset:hover { border-color: var(--tn-accent); }
.tn-preset.is-active { background: var(--tn-accent); border-color: var(--tn-accent); color: #fff; }
.tn-preset:focus-visible { outline: none; box-shadow: var(--tn-focus); }

.tn-shortcuts { display: flex; flex-wrap: wrap; gap: 14px; margin: 4px 0 0; font-size: 12px; color: var(--tn-muted); }
.tn-shortcuts kbd {
    font: inherit; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 5px;
    border: 1px solid var(--tn-line); border-bottom-width: 2px; background: var(--tn-surface);
}

.tn-panel { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.tn-panel__title { margin: 0; font-size: 15px; font-weight: 800; color: var(--tn-ink); }
.tn-panel__sub { margin: -8px 0 0; font-size: 12.5px; }
.tn-field { margin: 0; }
.tn-types { display: grid; gap: 8px; }
.tn-type { position: relative; display: block; cursor: pointer; }
.tn-type input { position: absolute; opacity: 0; pointer-events: none; }
.tn-type__body {
    display: flex; flex-direction: column; gap: 2px; padding: 11px 14px; border: 1.5px solid var(--tn-line);
    border-radius: 12px; transition: border-color var(--transition-fast, .15s ease), background var(--transition-fast, .15s ease);
}
.tn-type__name { font-weight: 800; color: var(--tn-ink); font-size: 14px; }
.tn-type__desc { font-size: 12.5px; color: var(--tn-muted); line-height: 1.45; }
.tn-type input:checked + .tn-type__body { border-color: var(--tn-accent); background: #f8f5ff; box-shadow: 0 0 0 3px rgba(124, 58, 237, .12); }
.tn-type input:focus-visible + .tn-type__body { box-shadow: var(--tn-focus); }

.tn-slider__row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.tn-slider__row label { font-size: 13px; font-weight: 700; color: var(--tn-ink); }
.tn-slider__row output { font-size: 12.5px; font-weight: 700; color: var(--tn-accent); font-variant-numeric: tabular-nums; }
.tn-slider input[type=range] { width: 100%; accent-color: var(--tn-accent); }

.tn-pricing { border: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tn-pricing legend { font-size: 13px; font-weight: 700; color: var(--tn-ink); padding: 0; margin-bottom: 6px; }
.tn-pricing__options { display: flex; gap: 8px; }
.tn-chip-radio {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px; border-radius: 10px;
    border: 1.5px solid var(--tn-line); font-weight: 700; font-size: 13px; cursor: pointer;
}
.tn-chip-radio:has(input:checked) { border-color: var(--tn-accent); background: #f8f5ff; color: #5b21b6; }
.tn-chip-radio input { accent-color: var(--tn-accent); }
.tn-pricing__amount {
    display: flex; align-items: center; border: 1px solid var(--tn-line); border-radius: 10px; overflow: hidden;
}
.tn-pricing__amount:focus-within { border-color: var(--tn-accent); box-shadow: var(--tn-focus); }
.tn-pricing__currency { padding: 9px 12px; background: var(--tn-surface-alt); font-weight: 800; font-size: 13px; color: var(--tn-muted); }
.tn-pricing__amount input { flex: 1; border: none; padding: 9px 12px; font: inherit; font-weight: 700; outline: none; min-width: 0; }
.tn-skiza-note {
    margin: 0; font-size: 12.5px; line-height: 1.55; color: #0b5d36; background: var(--tn-skiza-soft);
    border: 1px solid #b7e4cb; border-radius: 10px; padding: 10px 12px;
}

.tn-phone {
    align-self: center; width: 190px; height: 250px; border-radius: 30px; padding: 10px;
    background: #0b1020; box-shadow: 0 18px 40px rgba(15, 23, 42, .35), inset 0 0 0 2px #1f2937;
}
.tn-phone__screen {
    height: 100%; border-radius: 22px; background: linear-gradient(160deg, #312e81, #1e3a8a 55%, #0c4a6e);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: #fff; text-align: center; padding: 12px;
}
.tn-phone__caption { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; opacity: .75; }
.tn-phone__avatar {
    width: 64px; height: 64px; border-radius: 50%; overflow: hidden; background: var(--tn-grad);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, .12); margin: 6px 0;
}
.tn-phone__avatar img { width: 100%; height: 100%; object-fit: cover; }
.tn-phone__name { font-weight: 800; font-size: 15px; }
.tn-phone__tone { font-size: 12px; opacity: .8; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tn-phone__rings { display: flex; gap: 5px; margin-top: 8px; height: 18px; align-items: flex-end; }
.tn-phone__rings i { width: 4px; height: 6px; border-radius: 2px; background: rgba(255, 255, 255, .5); }
.tn-phone.is-ringing .tn-phone__avatar { animation: tn-ring 1.1s ease-in-out infinite; }
.tn-phone.is-ringing .tn-phone__rings i { animation: tn-bars .9s ease-in-out infinite; background: #fff; }
.tn-phone.is-ringing .tn-phone__rings i:nth-child(2) { animation-delay: .15s; }
.tn-phone.is-ringing .tn-phone__rings i:nth-child(3) { animation-delay: .3s; }
@keyframes tn-ring { 0%, 100% { box-shadow: 0 0 0 4px rgba(255, 255, 255, .12); } 50% { box-shadow: 0 0 0 14px rgba(255, 255, 255, .04); } }
@keyframes tn-bars { 0%, 100% { height: 6px; } 50% { height: 18px; } }
.tn-preview-audio { width: 100%; height: 38px; }
.tn-render-state { margin: 0; font-size: 12.5px; color: var(--tn-muted); }
.tn-render-state.is-stale { color: #a35a00; }
[data-tn-render].is-busy { opacity: .7; pointer-events: none; }

.tn-savebar {
    position: sticky; bottom: 0; z-index: 20; margin-top: 20px; display: flex; align-items: center;
    justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: 14px;
    background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border: 1px solid var(--tn-line);
    box-shadow: 0 -6px 24px rgba(15, 23, 42, .08);
}
.tn-savebar__state { font-size: 13px; font-weight: 600; color: var(--tn-muted); }
.tn-savebar__state.is-dirty { color: #a35a00; }
.tn-savebar__actions { display: flex; gap: 8px; }

/* ── Admin review ─────────────────────────────────────────────────────── */
.tn-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tn-filter__item {
    display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
    border: 1px solid var(--tn-line); background: var(--tn-surface); color: var(--tn-ink);
    text-decoration: none; font-size: 13px; font-weight: 700;
}
.tn-filter__item:hover { border-color: var(--tn-accent); }
.tn-filter__item.is-active { background: var(--tn-ink); border-color: var(--tn-ink); color: #fff; }
.tn-filter__count {
    min-width: 22px; padding: 0 6px; border-radius: 999px; background: rgba(124, 58, 237, .12); color: #5b21b6;
    font-size: 11.5px; text-align: center; line-height: 20px;
}
.tn-filter__item.is-active .tn-filter__count { background: rgba(255, 255, 255, .2); color: #fff; }
.tn-guide { margin-bottom: 16px; }
.tn-review { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.tn-review__item { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.tn-review__head { display: flex; gap: 16px; align-items: flex-start; }
.tn-review__info { flex: 1; min-width: 0; }
.tn-facts { margin: 10px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px 18px; }
.tn-facts div { min-width: 0; }
.tn-facts dt { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--tn-muted); font-weight: 700; }
.tn-facts dd { margin: 2px 0 0; font-size: 13.5px; color: var(--tn-ink); font-weight: 600; overflow-wrap: anywhere; }
.tn-review__audio { width: 100%; max-width: 520px; height: 38px; }
.tn-review__actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; }
.tn-review__actions form { margin: 0; }
.tn-inline-form { display: flex; gap: 6px; align-items: center; }
.tn-input {
    padding: 8px 12px; border: 1px solid var(--tn-line); border-radius: 10px; font: inherit; font-size: 13.5px;
    font-variant-numeric: tabular-nums; min-width: 190px;
}
.tn-input:focus { outline: none; border-color: var(--tn-accent); box-shadow: var(--tn-focus); }
.tn-details > summary { list-style: none; cursor: pointer; }
.tn-details > summary::-webkit-details-marker { display: none; }
.tn-details__form {
    margin-top: 8px; display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--tn-line);
    border-radius: 12px; background: var(--tn-surface-alt); width: min(440px, 80vw);
}
.tn-details__form label { font-size: 13px; font-weight: 700; }
.tn-details__form textarea { font: inherit; padding: 10px; border-radius: 10px; border: 1px solid var(--tn-line); resize: vertical; }
.tn-details__form button { align-self: flex-start; }

/* ── Store ────────────────────────────────────────────────────────────── */
.tn-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px;
    border-radius: 999px; border: 1px solid transparent; font: inherit; font-size: 13px; font-weight: 800;
    cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform var(--transition-fast, .15s ease), box-shadow var(--transition-fast, .15s ease);
}
.tn-btn:focus-visible { outline: none; box-shadow: var(--tn-focus); }
.tn-btn--primary { background: var(--tn-grad); color: #fff; box-shadow: 0 6px 16px rgba(124, 58, 237, .28); }
.tn-btn--primary:hover { transform: translateY(-1px); }
.tn-btn--primary:disabled { background: #d7dae6; color: #6b7280; box-shadow: none; cursor: not-allowed; transform: none; }
.tn-btn--ghost { background: var(--tn-surface); color: var(--tn-ink); border-color: var(--tn-line); }
.tn-btn--ghost:hover { border-color: var(--tn-accent); color: var(--tn-accent); }
.tn-btn.is-copied { background: #e6f7ee; color: #067647; border-color: #b7e4cb; }

.tn-hero {
    position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 24px;
    align-items: center; padding: 34px 36px; border-radius: 24px; color: #fff; margin: 4px 0 20px;
    background: radial-gradient(120% 140% at 0% 0%, #4c1d95 0%, #1e3a8a 45%, #0b1d3d 100%);
    box-shadow: 0 24px 60px rgba(30, 27, 75, .35);
}
.tn-hero__glow {
    position: absolute; right: -80px; top: -120px; width: 420px; height: 420px; border-radius: 50%;
    background: radial-gradient(circle, rgba(14, 165, 233, .45), transparent 65%); pointer-events: none;
}
.tn-hero__copy { position: relative; z-index: 1; }
.tn-hero__badge {
    display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
    background: rgba(255, 255, 255, .14); font-size: 12px; font-weight: 700; letter-spacing: .02em;
}
.tn-hero__title { margin: 14px 0 8px; font-size: clamp(28px, 4vw, 42px); line-height: 1.08; font-weight: 800; letter-spacing: -.02em; }
.tn-hero__sub { margin: 0 0 20px; font-size: 15.5px; opacity: .85; max-width: 560px; line-height: 1.55; }
.tn-search {
    display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 999px; padding: 6px 6px 6px 18px;
    max-width: 560px; color: var(--tn-muted); box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
.tn-search input { flex: 1; min-width: 0; border: none; outline: none; font: inherit; font-size: 15px; color: var(--tn-ink); background: transparent; }
.tn-search__btn {
    border: none; border-radius: 999px; padding: 10px 18px; background: var(--tn-grad); color: #fff; font: inherit; font-weight: 800; cursor: pointer;
}
.tn-search:focus-within { box-shadow: 0 10px 30px rgba(0, 0, 0, .25), 0 0 0 3px rgba(255, 255, 255, .4); }
.tn-hero__art { position: relative; z-index: 1; display: flex; justify-content: center; }
.tn-hero__phone {
    width: 170px; height: 300px; border-radius: 32px; background: rgba(255, 255, 255, .08); border: 2px solid rgba(255, 255, 255, .25);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; backdrop-filter: blur(6px);
    transform: rotate(6deg);
}
.tn-hero__caller { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; opacity: .8; }
.tn-hero__disc {
    width: 92px; height: 92px; border-radius: 50%;
    background: conic-gradient(from 0deg, #a78bfa, #60a5fa, #22d3ee, #a78bfa);
    box-shadow: 0 0 0 10px rgba(255, 255, 255, .08), 0 0 0 22px rgba(255, 255, 255, .04);
    animation: tn-pulse 2.4s ease-in-out infinite;
}
.tn-hero__rings { display: flex; gap: 6px; align-items: flex-end; height: 22px; }
.tn-hero__rings i { width: 5px; height: 8px; border-radius: 3px; background: #fff; animation: tn-bars 1s ease-in-out infinite; }
.tn-hero__rings i:nth-child(2) { animation-delay: .15s; }
.tn-hero__rings i:nth-child(3) { animation-delay: .3s; }
@keyframes tn-pulse {
    0%, 100% { box-shadow: 0 0 0 10px rgba(255, 255, 255, .08), 0 0 0 22px rgba(255, 255, 255, .04); }
    50% { box-shadow: 0 0 0 16px rgba(255, 255, 255, .1), 0 0 0 32px rgba(255, 255, 255, .03); }
}

.tn-store-bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.tn-segment { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--tn-surface); border: 1px solid var(--tn-line); }
.tn-segment__item {
    padding: 8px 18px; border-radius: 999px; font-weight: 800; font-size: 13.5px; color: var(--tn-muted); text-decoration: none;
}
.tn-segment__item:hover { color: var(--tn-ink); }
.tn-segment__item.is-active { background: var(--tn-ink); color: #fff; }
.tn-segment__item:focus-visible { outline: none; box-shadow: var(--tn-focus); }
.tn-store-bar__count { margin: 0; color: var(--tn-muted); font-size: 13.5px; font-weight: 600; }
.tn-store-bar__library {
    margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 13.5px;
    color: var(--tn-accent); text-decoration: none;
}
.tn-store-bar__library:hover { text-decoration: underline; }

.tn-info {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin-bottom: 20px;
    border-radius: 14px; overflow: hidden; background: var(--tn-line); border: 1px solid var(--tn-line);
}
.tn-info__item { background: var(--tn-surface); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.tn-info__item strong { font-size: 13px; color: var(--tn-ink); }
.tn-info__item span { font-size: 12.5px; color: var(--tn-muted); }
.tn-info--skiza .tn-info__item strong { color: #0b7a44; }
.tn-info code { font-weight: 800; color: var(--tn-ink); }

.tn-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.tn-card {
    background: var(--tn-surface); border: 1px solid var(--tn-line); border-radius: 18px; overflow: hidden;
    display: flex; flex-direction: column; box-shadow: var(--shadow-xs); transition: transform .2s ease, box-shadow .2s ease;
}
.tn-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.tn-card__media { position: relative; aspect-ratio: 1 / 1; background: var(--tn-grad); overflow: hidden; }
.tn-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.tn-card:hover .tn-card__media img { transform: scale(1.04); }
.tn-card__fallback { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 54px; }
.tn-card__badge {
    position: absolute; top: 10px; left: 10px; padding: 3px 10px; border-radius: 999px;
    background: rgba(17, 24, 39, .72); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .03em; backdrop-filter: blur(4px);
}
.tn-card__play {
    --tn-progress: 0;
    position: absolute; right: 12px; bottom: 12px; width: 52px; height: 52px; border-radius: 50%; border: none;
    background: #fff; color: #4c1d95; cursor: pointer; display: grid; place-items: center;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .35); transition: transform var(--transition-fast, .15s ease);
}
.tn-card__play:hover { transform: scale(1.07); }
.tn-card__play:focus-visible { outline: none; box-shadow: var(--tn-focus), 0 8px 22px rgba(15, 23, 42, .35); }
.tn-card__play .tn-icon-pause, .tn-card__play.is-playing .tn-icon-play { display: none; }
.tn-card__play.is-playing .tn-icon-pause { display: block; }
.tn-card__ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); pointer-events: none; }
.tn-card__ring circle {
    fill: none; stroke: var(--tn-accent); stroke-width: 3; stroke-linecap: round;
    stroke-dasharray: 138.2; stroke-dashoffset: calc(138.2 * (1 - var(--tn-progress)));
    opacity: 0; transition: opacity .2s ease;
}
.tn-card__play.is-playing .tn-card__ring circle { opacity: 1; }
.tn-card__body { padding: 14px 16px 6px; flex: 1; }
.tn-card__title { margin: 0; font-size: 15px; font-weight: 800; color: var(--tn-ink); line-height: 1.3; overflow-wrap: anywhere; }
.tn-card__artist { margin: 3px 0 0; font-size: 13px; font-weight: 700; color: var(--tn-accent); }
.tn-card__meta { margin: 6px 0 0; font-size: 12.5px; color: var(--tn-muted); }
.tn-card__meta a { color: inherit; text-decoration: underline; text-decoration-color: rgba(100, 116, 139, .4); }
.tn-card__footer { padding: 12px 16px 16px; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.tn-card__price { font-size: 16px; font-weight: 800; color: var(--tn-ink); font-variant-numeric: tabular-nums; }
.tn-card__price.is-free { color: #067647; }
.tn-card__footer--skiza { align-items: center; }
.tn-skiza { display: flex; flex-direction: column; margin-right: auto; }
.tn-skiza__label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--tn-muted); font-weight: 800; }
.tn-skiza__code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 17px; font-weight: 800; letter-spacing: .08em; color: #0b7a44; }

.tn-download { position: relative; }
.tn-download > summary { list-style: none; }
.tn-download > summary::-webkit-details-marker { display: none; }
.tn-download__menu {
    position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 30; min-width: 220px; padding: 6px;
    background: var(--tn-surface); border: 1px solid var(--tn-line); border-radius: 14px; box-shadow: var(--shadow-lg);
    display: flex; flex-direction: column;
}
.tn-download__menu a { display: flex; flex-direction: column; padding: 9px 12px; border-radius: 10px; text-decoration: none; color: var(--tn-ink); }
.tn-download__menu a:hover, .tn-download__menu a:focus-visible { background: var(--tn-surface-alt); outline: none; }
.tn-download__menu strong { font-size: 13.5px; }
.tn-download__menu span { font-size: 12px; color: var(--tn-muted); }

.tn-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 24px 0 8px; }
.tn-pager__info { font-size: 13px; color: var(--tn-muted); font-weight: 600; }
.tn-store-empty { text-align: center; padding: 56px 20px; background: var(--tn-surface); border: 1px dashed var(--tn-line); border-radius: 18px; }
.tn-store-empty__icon { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; font-size: 28px; color: #fff; background: var(--tn-grad); }
.tn-store-empty h2 { margin: 0 0 6px; font-size: 18px; }
.tn-store-empty p { margin: 0 auto 16px; max-width: 420px; color: var(--tn-muted); }
.tn-store-foot { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 18px 0 10px; font-size: 12.5px; color: var(--tn-muted); }
.tn-store-foot a { color: var(--tn-accent); font-weight: 700; }

/* ── Library ──────────────────────────────────────────────────────────── */
.tn-library { max-width: 920px; margin: 0 auto; padding: 8px 0 24px; display: flex; flex-direction: column; gap: 18px; }
.tn-library__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.tn-library__eyebrow { margin: 0; font-size: 12.5px; color: var(--tn-muted); font-weight: 700; }
.tn-library__eyebrow a { color: inherit; }
.tn-library__title { margin: 4px 0; font-size: 28px; font-weight: 800; color: var(--tn-ink); }
.tn-library__sub { margin: 0; color: var(--tn-muted); }
.tn-library__list { list-style: none; margin: 0; padding: 0; background: var(--tn-surface); border: 1px solid var(--tn-line); border-radius: 18px; overflow: hidden; }
.tn-library__item { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-top: 1px solid var(--tn-line); }
.tn-library__item:first-child { border-top: none; }
.tn-library__info { flex: 1; min-width: 0; }
.tn-library__name { margin: 0; font-size: 15px; font-weight: 800; color: var(--tn-ink); }
.tn-library__meta { margin: 3px 0 0; font-size: 12.5px; color: var(--tn-muted); }
.tn-library__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tn-help { background: var(--tn-surface); border: 1px solid var(--tn-line); border-radius: 18px; padding: 18px 20px; }
.tn-help h2 { margin: 0 0 12px; font-size: 16px; }
.tn-help h3 { margin: 0 0 6px; font-size: 14px; color: var(--tn-accent); }
.tn-help__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.tn-help ol { margin: 0; padding-left: 18px; color: var(--tn-muted); font-size: 13.5px; line-height: 1.6; }

/* ── Home page promo ──────────────────────────────────────────────────── */
.tn-home-promo {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 20px 24px;
    border-radius: 20px; color: #fff; text-decoration: none; margin: 0 0 22px;
    background: linear-gradient(120deg, #4c1d95 0%, #1d4ed8 55%, #0e7490 100%); box-shadow: 0 16px 40px rgba(30, 27, 75, .25);
    transition: transform .2s ease, box-shadow .2s ease;
}
.tn-home-promo:hover { transform: translateY(-2px); box-shadow: 0 22px 50px rgba(30, 27, 75, .3); }
.tn-home-promo:focus-visible { outline: none; box-shadow: var(--tn-focus), 0 16px 40px rgba(30, 27, 75, .25); }
.tn-home-promo__eyebrow { font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; font-weight: 800; opacity: .8; }
.tn-home-promo__title { margin: 4px 0; font-size: 21px; font-weight: 800; }
.tn-home-promo__sub { margin: 0; font-size: 14px; opacity: .85; }
.tn-home-promo__cta { background: #fff; color: #4c1d95; font-weight: 800; padding: 10px 18px; border-radius: 999px; font-size: 14px; white-space: nowrap; }

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .tn-editor { grid-template-columns: 1fr; }
    .tn-editor__side { position: static; display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
    .tn-row { grid-template-columns: 56px minmax(0, 1fr); }
    .tn-row__commerce, .tn-row__status, .tn-row__actions { grid-column: 2; justify-content: flex-start; align-items: flex-start; }
    .tn-hero { grid-template-columns: 1fr; padding: 26px 22px; }
    .tn-hero__art { display: none; }
    .tn-info { grid-template-columns: 1fr 1fr; }
    .tn-stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
    .tn-steps__list, .tn-help__grid { grid-template-columns: 1fr; }
    .tn-editor__side { grid-template-columns: 1fr; }
    .tn-times { grid-template-columns: 1fr; }
    .tn-length { order: -1; }
    .tn-wave { height: 120px; }
    .tn-savebar { flex-direction: column; align-items: stretch; }
    .tn-savebar__actions { justify-content: stretch; }
    .tn-savebar__actions .sp-btn { flex: 1; justify-content: center; }
    .tn-library__item { flex-wrap: wrap; }
    .tn-library__actions { width: 100%; }
    .tn-home-promo { grid-template-columns: 1fr; }
    .tn-inline-form { flex-wrap: wrap; }
    .tn-download__menu { right: auto; left: 0; }
}
@media (max-width: 480px) {
    .tn-info { grid-template-columns: 1fr; }
    .tn-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .tn-card__footer { flex-direction: column; align-items: stretch; }
    .tn-card__footer .tn-btn, .tn-card__footer .tn-download { width: 100%; }
    .tn-card__footer .tn-download > summary { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .tn-hero__disc, .tn-hero__rings i, .tn-phone.is-ringing .tn-phone__avatar, .tn-phone.is-ringing .tn-phone__rings i, .tn-spinner { animation: none; }
    .tn-card, .tn-card__media img, .tn-btn, .tn-home-promo { transition: none; }
}
