/* ═══════════════════════════════════════════════════════════════════════════
   AudioGarden OS — Review Player v9.3.43
   v9.3.43: Admin reset for onboarding/welcome modals (global + per-user).
            localStorage keys versioned with reset counter.
   v9.3.42: Full-page modal overlays (fixed, dark backdrop 65%, blur 8px,
            body scroll lock). Removed old ag-wlc card styles. Welcome modals
            now reuse agos-onboard component. CTA-only close.
   v9.3.38: Premium step progress stepper (5-step, pill bar, animations).
   v9.3.36: Clean completed mode, premium invoice, studio note.
   v9.3.34: Completed delivery experience, hero animation.
   v9.3.32: DAW-like scrub, onboarding modal, tooltip hints, time badge.
   v9.3.31: Single-column full-width layout, hints, unified buttons.
   Loaded AFTER portal.css — overrides old .agos-rp styles.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Design tokens (inherits from portal.css --ag-*) ── */
:root {
    --rp-radius: 14px;
    --rp-demo: #EF4444;
    --rp-demo-bg: #FEE2E2;
    --rp-demo-border: #F87171;
    --rp-final: #22C55E;
    --rp-final-bg: #DCFCE7;
    --rp-final-border: #4ADE80;
    --rp-wave-h: 180px;
}

/* ── Remove card wrapper padding if parent was .agos-card ── */
.agos-review-wrap {
    padding: 0;
    border: none;
    box-shadow: none;
    background: transparent;
    margin-bottom: 16px;
}
.agos-review-wrap > .agos-review-section {
    width: 100%;
}

/* ══════ MAIN CONTAINER ══════ */
.agos-review {
    border-radius: var(--rp-radius);
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.05), 0 4px 20px rgba(0,0,0,.04);
    overflow: hidden;
    position: relative; /* v9.3.32: anchor for onboarding overlay */
}

/* ══════ HEADER ══════ */
.agos-review__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--ag-border-subtle, #f0f1f4);
    gap: 12px;
    flex-wrap: wrap;
}
.agos-review__head-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.agos-review__title {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -.01em;
    color: var(--ag-text, #1e293b);
}
.agos-review__status {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    background: var(--ag-bg, #f7f8fa);
    color: var(--ag-text-secondary, #6b7280);
    white-space: nowrap;
}
.agos-review__status--review {
    background: var(--rp-final-bg);
    color: #15803D;
}
.agos-review__head-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* ══════ DEMO / FINAL PILLS (A/B switch in header) ══════ */
.agos-review__switch {
    display: inline-flex;
    gap: 0;
    background: #f1f5f9;
    border-radius: 10px;
    padding: 3px;
}
.agos-review__pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    font-size: clamp(11px, 1.4vw, 13px);
    font-weight: 800;
    letter-spacing: .03em;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    background: transparent;
    color: #94a3b8;
    transition: all .15s ease;
    white-space: nowrap;
}
.agos-review__pill:hover:not(:disabled):not(.agos-ab-active) {
    color: #64748b;
    background: #fff;
}
.agos-review__pill-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.agos-review__pill--demo .agos-review__pill-dot { background: var(--rp-demo); }
.agos-review__pill--final .agos-review__pill-dot { background: var(--rp-final); }
.agos-review__pill--demo.agos-ab-active {
    background: var(--rp-demo-bg);
    color: #DC2626;
    border-color: var(--rp-demo-border);
    box-shadow: 0 0 0 2px rgba(239,68,68,.1);
}
.agos-review__pill--final.agos-ab-active {
    background: var(--rp-final-bg);
    color: #16A34A;
    border-color: var(--rp-final-border);
    box-shadow: 0 0 0 2px rgba(34,197,94,.1);
}
.agos-review__pill:disabled {
    opacity: .4;
    cursor: not-allowed;
}

/* ══════ HINT COMPONENT ══════ */
.agos-hint {
    font-size: 12px;
    color: var(--ag-text-secondary, #6b7280);
    line-height: 1.5;
}
.agos-hint--inline {
    font-size: 11px;
    color: var(--ag-text-tertiary, #94a3b8);
    white-space: nowrap;
}
.agos-hint--block {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 8px 14px;
    margin: 0;
    background: rgba(37, 99, 235, .04);
    border: 1px solid rgba(37, 99, 235, .1);
    border-radius: 8px;
    font-size: 12px;
    color: var(--ag-text-secondary, #6b7280);
    line-height: 1.5;
}
/* Hint above waveform */
.agos-review__wave-hint {
    margin: 0 20px;
    margin-top: 0;
    transition: opacity .3s ease, max-height .3s ease;
    overflow: hidden;
}
.agos-hint--dismissed {
    opacity: 0;
    max-height: 0 !important;
    padding: 0 14px !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    border-color: transparent !important;
}

/* ══════ WAVEFORM ══════ */
.agos-review__wave {
    padding: 12px 20px 0;
    position: relative;
}
.agos-review__wave .agos-wave-wrap {
    min-height: var(--rp-wave-h);
    border-radius: 12px;
    overflow: hidden;
    background: var(--ag-bg, #f7f8fa);
    cursor: crosshair;
    position: relative;
    margin-bottom: 0;
    /* v9.3.32: Prevent iPad Safari page scroll during scrub */
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}
/* v9.3.32: Active scrub state */
.agos-review__wave .agos-wave-wrap--scrubbing {
    cursor: ew-resize;
    box-shadow: inset 0 0 0 2px rgba(37, 99, 235, .25);
}
.agos-review__wave .agos-player-overlay {
    border-radius: 12px;
}

/* ══════ TRANSPORT — single row ══════ */
.agos-review .agos-transport {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px 12px;
    gap: 12px;
    flex-wrap: nowrap;
}
/* Override old .agos-transport-row (no longer used in v9.3.31) */
.agos-review .agos-transport-row { display: contents; }
.agos-review .agos-transport-left,
.agos-review .agos-transport-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}
.agos-review .agos-transport-right {
    margin-left: auto;
}
.agos-review .agos-timecode {
    font-size: 13px;
    font-family: var(--ag-mono, 'SF Mono', 'Menlo', monospace);
    font-variant-numeric: tabular-nums;
    color: var(--ag-text-secondary, #6b7280);
    white-space: nowrap;
}
.agos-tc-sep { color: var(--ag-text-tertiary, #94a3b8); margin: 0 1px; }

/* ══════ TIMELINE BAR ══════ */
.agos-review .agos-timeline-bar {
    margin: 0 20px 4px;
}

/* ══════ DEBUG ══════ */
.agos-review__debug {
    margin: 0 20px 8px;
    font-size: 10px;
    color: var(--ag-text-tertiary, #9ca3af);
}
.agos-review__debug summary {
    cursor: pointer;
    user-select: none;
}
.agos-review__debug-body {
    margin-top: 4px;
    font-family: monospace;
    line-height: 1.7;
    background: var(--ag-bg, #f7f8fa);
    padding: 8px;
    border-radius: 6px;
}

/* ══════ COMMENTS SECTION ══════ */
.agos-review__comments {
    border-top: 1px solid var(--ag-border-subtle, #f0f1f4);
}

/* List header */
.agos-review__list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px 10px;
    border-bottom: 1px solid var(--ag-border-subtle, #f0f1f4);
}
.agos-review__list-title {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--ag-text-secondary, #6b7280);
}
.agos-rv-count {
    font-size: 11px;
    font-weight: 700;
    background: var(--ag-bg, #f1f5f9);
    color: var(--ag-text-secondary, #6b7280);
    padding: 1px 7px;
    border-radius: 10px;
    margin-left: 4px;
}
.agos-review__list-nav {
    display: flex;
    gap: 4px;
    align-items: center;
}

/* Comment list */
.agos-review .agos-rv-list {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    border: none;
    border-radius: 0;
    background: transparent;
}

/* Comment items — override old portal.css .agos-rv-item */
.agos-review .agos-rv-item {
    padding: 10px 20px;
    border-bottom: 1px solid var(--ag-border-subtle, #f5f5f5);
    cursor: pointer;
    transition: background .12s ease, opacity .15s ease;
    font-size: 13px;
    line-height: 1.4;
}
.agos-review .agos-rv-item:hover { background: #fafbfc; }
.agos-review .agos-rv-item:last-child { border-bottom: none; }

/* Actions — show on hover */
.agos-review .agos-rv-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity .12s;
    flex-shrink: 0;
}
.agos-review .agos-rv-item:hover .agos-rv-actions { opacity: 1; }
.agos-review .agos-rv-actions button {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 13px;
    padding: 2px 4px;
    border-radius: 4px;
    line-height: 1;
}
.agos-review .agos-rv-actions .agos-rv-res { color: #16A34A; }
.agos-review .agos-rv-actions .agos-rv-res:hover { background: #DCFCE7; }
.agos-review .agos-rv-actions .agos-rv-del { color: #DC2626; }
.agos-review .agos-rv-actions .agos-rv-del:hover { background: #FEE2E2; }

/* Timestamp pill — monospace */
.agos-review .agos-rv-ts-pill {
    font-family: var(--ag-mono, 'SF Mono', 'Menlo', monospace);
}

/* ══════ EMPTY STATE ══════ */
.agos-review__empty {
    padding: 40px 20px;
    text-align: center;
}
.agos-review__empty-ico {
    font-size: 32px;
    margin-bottom: 12px;
    opacity: .5;
}
.agos-review__empty-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--ag-text-secondary, #6b7280);
    margin: 0 0 6px;
}
.agos-review__empty-sub {
    font-size: 13px;
    color: var(--ag-text-tertiary, #94a3b8);
    margin: 0;
    max-width: 360px;
    margin-inline: auto;
    line-height: 1.5;
}

/* ══════ COMMENT FORM ══════ */
.agos-review .agos-rv-form {
    padding: 14px 20px;
    border-top: 1px solid var(--ag-border-subtle, #f0f1f4);
    background: #fafbfc;
}
.agos-review .agos-rv-form-top {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.agos-review .agos-rv-form-body {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}
.agos-review .agos-rv-form-body .agos-textarea {
    flex: 1;
    min-width: 0;
    border-radius: 10px;
    font-size: 13px;
    padding: 8px 12px;
    resize: vertical;
    min-height: 38px;
    border: 1px solid var(--ag-border, #e2e8f0);
}
.agos-review .agos-rv-form-body .agos-textarea:focus {
    border-color: var(--ag-accent, #2563EB);
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
    outline: none;
}

/* v9.3.31: Send button = brand blue (ag-c-btn-primary), not dark gray */
.agos-review .agos-rv-send-btn {
    flex-shrink: 0;
    white-space: nowrap;
    /* Uses ag-c-btn ag-c-btn-primary from portal.css — no override needed */
}

/* Visibility selector */
.agos-review__vis-sel {
    width: auto;
    font-size: 12px;
    padding: 6px 8px;
    border-radius: 6px;
}

/* ══════ REVISION BAR ══════ */
.agos-review .agos-rv-revision-bar {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--ag-border-subtle, #f0f1f4);
}

/* ══════ HINT inside form ══════ */
.agos-review .agos-rv-form .agos-hint--block {
    margin-bottom: 10px;
    font-size: 11px;
}

/* ══════ RESOLVED TOGGLE — inside .agos-review ══════ */
.agos-review .agos-rv-resolved-toggle {
    padding: 8px 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ag-text-tertiary, #94a3b8);
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ══════ v9.3.40: PREMIUM CHAT REDESIGN — client portal ══════ */
/* Message bubbles: softer, lighter, professional SaaS feel */
.ag-d-chat .agos-chat-msg {
    padding: 8px 14px;
    margin-bottom: 6px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    max-width: 70%;
}
.ag-d-chat .agos-chat-msg-me {
    background: #4B7BE5;
    color: #fff;
    margin-left: auto;
    text-align: right;
    border-bottom-right-radius: 4px;
    box-shadow: 0 1px 3px rgba(75,123,229,.18);
}
.ag-d-chat .agos-chat-msg-me .agos-chat-time {
    color: rgba(255,255,255,.55);
    font-size: 10px;
    font-weight: 400;
}
.ag-d-chat .agos-chat-msg-other {
    background: #F1F5F9;
    border: 1px solid #E2E8F0;
    color: var(--ag-text, #1E293B);
    margin-right: auto;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.ag-d-chat .agos-chat-sender {
    font-size: 11px;
    font-weight: 500;
    color: var(--ag-text-tertiary, #94A3B8);
    margin-bottom: 2px;
}
.ag-d-chat .agos-chat-time {
    font-size: 10px;
    font-weight: 400;
    color: var(--ag-text-tertiary, #94A3B8);
    margin-top: 2px;
}
/* Odeslat button: ALWAYS filled primary blue — explicit override */
.ag-d-chat-compose .ag-c-btn,
.ag-d-chat-compose .agos-chat-send {
    flex-shrink: 0;
    background: var(--ag-accent, #2563EB) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 10px;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(37,99,235,.3), 0 1px 2px rgba(0,0,0,.06);
    transition: all .2s cubic-bezier(.4,0,.2,1);
}
.ag-d-chat-compose .ag-c-btn:hover,
.ag-d-chat-compose .agos-chat-send:hover {
    background: var(--ag-accent-hover, #1D4ED8) !important;
    box-shadow: 0 4px 12px rgba(37,99,235,.3), 0 1px 3px rgba(0,0,0,.08);
    transform: translateY(-1px);
}

/* ══════ v9.3.32: TIME BADGE ══════ */
.agos-rv-time-badge {
    display: inline-flex;
    align-items: center;
    font-family: var(--ag-mono, 'SF Mono', 'Menlo', monospace);
    font-variant-numeric: tabular-nums;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 8px;
    white-space: nowrap;
    transition: all .15s ease;
    /* Default: DEMO red */
    background: var(--rp-demo-bg);
    color: var(--rp-demo);
    border: 1px solid var(--rp-demo-border);
    opacity: .6;
}
.agos-rv-time-badge[data-target="final"] {
    background: var(--rp-final-bg);
    color: #16A34A;
    border-color: var(--rp-final-border);
}
.agos-rv-time-badge--active {
    opacity: 1;
    transform: scale(1.08);
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
}

/* ══════ v9.3.42: MODAL OVERLAY — shared by onboarding + welcome screens ══════ */
.agos-onboard {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: agosOnboardIn .2s ease-out;
}
.agos-onboard--out {
    animation: agosOnboardOut .2s ease-in forwards;
}
.agos-onboard__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.agos-onboard__card {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,.18), 0 1px 4px rgba(0,0,0,.08);
    padding: 36px 32px 32px;
    max-width: 520px;
    width: 90%;
    text-align: center;
}
.agos-onboard__title {
    font-size: 17px;
    font-weight: 800;
    margin: 0 0 24px;
    color: var(--ag-text, #1e293b);
    letter-spacing: -.01em;
}
.agos-onboard__steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
    text-align: left;
}
.agos-onboard__step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}
.agos-onboard__step-ico {
    font-size: 24px;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ag-bg, #f7f8fa);
    border-radius: 10px;
}
.agos-onboard__step-txt {
    font-size: 13px;
    line-height: 1.5;
    color: var(--ag-text-secondary, #4b5563);
}
.agos-onboard__step-txt strong {
    color: var(--ag-text, #1e293b);
    font-weight: 700;
}
/* agos-onboard__close: see unified definition above */
/* v9.3.45: Modal CTA button — ensure unified even if agos-btn class missing */
.agos-onboard__close {
    min-width: 180px !important;
    padding: 12px 28px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    border-radius: 10px !important;
    border: none !important;
    cursor: pointer !important;
    background: var(--ag-accent, #2563EB) !important;
    color: #fff !important;
    box-shadow: 0 1px 3px rgba(37,99,235,.3), 0 1px 2px rgba(0,0,0,.06) !important;
    transition: all .2s cubic-bezier(.4,0,.2,1) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.agos-onboard__close:hover {
    background: var(--ag-accent-hover, #1D4ED8) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(37,99,235,.3), 0 1px 3px rgba(0,0,0,.08) !important;
}
.agos-onboard__desc {
    font-size: 14px;
    color: var(--ag-text-secondary, #6b7280);
    margin: 0 0 28px;
    line-height: 1.65;
    max-width: 380px;
    margin-left: auto;
    margin-right: auto;
}
/* v9.3.42: Welcome modal icon */
.agos-onboard__icon {
    font-size: 36px;
    margin-bottom: 16px;
    line-height: 1;
}
/* v9.3.42: Body scroll lock when modal open */
body.agos-modal-open {
    overflow: hidden !important;
}

@keyframes agosOnboardIn {
    from { opacity: 0; transform: scale(.98); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes agosOnboardOut {
    from { opacity: 1; transform: scale(1); }
    to   { opacity: 0; transform: scale(.98); }
}

/* ══════ v9.3.32: TOOLTIP SYSTEM ══════ */
.agos-tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    font-size: 11px;
    font-weight: 700;
    color: var(--ag-text-tertiary, #94a3b8);
    cursor: help;
    position: relative;
    vertical-align: middle;
    margin-left: 4px;
    border-radius: 50%;
    transition: color .12s ease;
    flex-shrink: 0;
    line-height: 1;
    z-index: 10;
}
.agos-tip:hover,
.agos-tip:focus {
    color: var(--ag-accent, #2563EB);
}
.agos-tip__bubble {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
    padding: 6px 12px;
    border-radius: 8px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
    z-index: 20;
}
.agos-tip__bubble::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1e293b;
}
.agos-tip__bubble--show {
    opacity: 1;
    pointer-events: auto;
}

/* ══════ v9.3.40: TRANSPORT BUTTONS — filled style ══════ */
.agos-review .agos-tbtn {
    background: #1E293B;
    color: #fff;
    border: none;
    box-shadow: 0 1px 2px rgba(0,0,0,.1);
}
.agos-review .agos-tbtn:hover:not(:disabled) {
    background: #334155;
    border: none;
}
.agos-review .agos-tbtn--sm {
    background: #374151;
    color: #fff;
    border: none;
}
.agos-review .agos-tbtn--sm:hover:not(:disabled) {
    background: #4B5563;
    border: none;
}
.agos-review .agos-tbtn--sm svg {
    display: block;
}

/* ══════ v9.3.40: HINT dismiss button inline ══════ */
.agos-review__wave-hint {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.agos-review__wave-hint .agos-hint-dismiss {
    flex-shrink: 0;
    margin-left: auto;
    padding: 5px 14px;
    font-size: 12px;
}

/* ══════ v9.3.38: STEP PROGRESS STEPPER — Premium SaaS ══════ */
.ag-stepper {
    margin-bottom: 20px;
    background: #fff;
    border-radius: 14px;
    padding: 20px 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    border: 1px solid var(--ag-border-subtle, #f0f1f4);
}
.ag-stepper__desktop {
    display: flex;
    align-items: center;
    gap: 20px;
}
.ag-stepper__mobile { display: none; }

/* ── Bar: track + fill ── */
.ag-stepper__bar {
    flex: 1;
    position: relative;
    min-height: 64px;
}
.ag-stepper__track {
    position: absolute;
    top: 13px;
    left: 24px;
    right: 24px;
    height: 10px;
    background: #E5E7EB;
    border-radius: 5px;
    z-index: 1;
}
.ag-stepper__fill {
    height: 100%;
    background: linear-gradient(90deg, #22C55E 0%, #16A34A 100%);
    border-radius: 5px;
    transition: width .5s cubic-bezier(.4,0,.2,1);
}

/* ── Steps row ── */
.ag-stepper__steps {
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 2;
}
.ag-stepper__step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

/* ── Circle: 3 states ── */
.ag-stepper__circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all .3s cubic-bezier(.4,0,.2,1);
    flex-shrink: 0;
}

/* DONE circle */
.ag-stepper__step--done .ag-stepper__circle {
    background: #22C55E;
    color: #fff;
    box-shadow: 0 0 0 3px rgba(34,197,94,.15);
}
.ag-stepper__step--done .ag-stepper__circle svg {
    animation: agosStepper-check .35s cubic-bezier(.34,1.56,.64,1) both;
}

/* ACTIVE circle */
.ag-stepper__step--active .ag-stepper__circle {
    background: var(--ag-primary, #2563EB);
    color: #fff;
    box-shadow: 0 0 0 3px rgba(37,99,235,.18), 0 2px 8px rgba(37,99,235,.15);
    animation: agosStepper-pop .4s cubic-bezier(.34,1.56,.64,1) both;
}
.ag-stepper__pulse {
    width: 10px;
    height: 10px;
    background: #fff;
    border-radius: 50%;
    animation: agosStepper-pulse 2s ease-in-out infinite;
}

/* UPCOMING circle */
.ag-stepper__step--upcoming .ag-stepper__circle {
    background: #fff;
    border: 2px solid #D1D5DB;
    color: #9CA3AF;
}

/* ── Labels ── */
.ag-stepper__label {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 95px; /* v9.3.40: 6 steps — narrower labels */
    transition: color .3s;
}
.ag-stepper__step--done .ag-stepper__label {
    color: var(--ag-text-secondary, #6B7280);
}
.ag-stepper__step--active .ag-stepper__label {
    color: var(--ag-text, #1E293B);
    font-weight: 700;
}
.ag-stepper__step--upcoming .ag-stepper__label {
    color: #9CA3AF;
}

/* ── Status chip ── */
.ag-stepper__chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: .01em;
}
.ag-stepper__chip-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
/* Chip color variants */
.ag-stepper__chip--neutral { background: #F1F5F9; color: #475569; }
.ag-stepper__chip--neutral .ag-stepper__chip-dot { background: #94A3B8; }
.ag-stepper__chip--active  { background: #EDE9FE; color: #5B21B6; }
.ag-stepper__chip--active .ag-stepper__chip-dot  { background: #8B5CF6; }
.ag-stepper__chip--review  { background: #DCFCE7; color: #166534; }
.ag-stepper__chip--review .ag-stepper__chip-dot  { background: #22C55E; }
.ag-stepper__chip--action  { background: #FEF3C7; color: #92400E; }
.ag-stepper__chip--action .ag-stepper__chip-dot  { background: #F59E0B; }
.ag-stepper__chip--done    { background: #DCFCE7; color: #166534; }
.ag-stepper__chip--done .ag-stepper__chip-dot    { background: #22C55E; }

/* ── Hover (desktop) ── */
@media (hover: hover) {
    .ag-stepper__step--done .ag-stepper__circle:hover {
        box-shadow: 0 0 0 4px rgba(34,197,94,.22);
    }
    .ag-stepper__step--active .ag-stepper__circle:hover {
        box-shadow: 0 0 0 4px rgba(37,99,235,.25), 0 2px 8px rgba(37,99,235,.15);
    }
}

/* ── Animations ── */
@keyframes agosStepper-pop {
    0%   { transform: scale(.92); }
    60%  { transform: scale(1.04); }
    100% { transform: scale(1); }
}
@keyframes agosStepper-check {
    from { opacity: 0; transform: scale(.5); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes agosStepper-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: .6; transform: scale(.85); }
}

/* ── Mobile stepper ── */
.ag-stepper__mobile-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.ag-stepper__mobile-step {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--ag-text-tertiary, #94A3B8);
}
.ag-stepper__mobile-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--ag-text, #1E293B);
}
.ag-stepper__mobile-bar {
    height: 10px;
    background: #E5E7EB;
    border-radius: 5px;
    overflow: hidden;
}
.ag-stepper__mobile-fill {
    height: 100%;
    background: linear-gradient(90deg, #22C55E, #16A34A);
    border-radius: 5px;
    transition: width .5s cubic-bezier(.4,0,.2,1);
}

/* ══════ v9.3.34: COMPLETED STATE ══════ */
.agos-review--completed .agos-review__head {
    border-bottom-color: var(--rp-final-border);
}
.agos-review--completed .agos-review__title {
    color: #16A34A;
}

/* ══════ v9.3.34: HERO SUCCESS ANIMATION ══════ */
.ag-d-hero--success {
    animation: agosHeroSuccess .5s cubic-bezier(.4,0,.2,1) both;
}
.ag-d-hero-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,.3);
    font-size: 18px;
    margin-right: 6px;
    vertical-align: middle;
    animation: agosCheckPop .4s .2s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes agosHeroSuccess {
    from { opacity: 0; transform: scale(.98); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes agosCheckPop {
    from { opacity: 0; transform: scale(.5); }
    to   { opacity: 1; transform: scale(1); }
}

/* Download button loading/done states */
.ag-d-hero-cta--loading {
    opacity: .8;
    pointer-events: none;
}
.ag-d-hero-cta--done {
    background: #16A34A !important;
    pointer-events: none;
}

/* ══════ v9.3.36: INVOICE BLOCK — PREMIUM ══════ */
.ag-d-invoice {
    margin-bottom: 16px;
}
.ag-d-invoice-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 4px 0;
}
.ag-d-invoice-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FEF2F2;
    border-radius: 12px;
}
.ag-d-invoice-info {
    flex: 1;
    min-width: 0;
}
.ag-d-invoice-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--ag-text-tertiary, #94a3b8);
    margin-bottom: 2px;
}
.ag-d-invoice-num {
    font-size: 15px;
    font-weight: 700;
    color: var(--ag-text, #1e293b);
    /* v9.3.36: system font, not monospace — premium feel */
    font-family: inherit;
    letter-spacing: -.01em;
}
.ag-d-invoice-amount {
    font-size: 13px;
    font-weight: 500;
    color: var(--ag-text-secondary, #6b7280);
    font-variant-numeric: tabular-nums;
    margin-top: 1px;
}
/* v9.3.36: Download button — primary filled, matches main CTA */
.ag-d-invoice-dl {
    flex-shrink: 0;
    white-space: nowrap;
}

/* ══════ v9.3.36: STUDIO QUALITY NOTE ══════ */
.ag-d-studio-note {
    font-size: 12px;
    line-height: 1.5;
    color: var(--ag-text-tertiary, #94a3b8);
    text-align: center;
    padding: 10px 16px 2px;
    letter-spacing: .01em;
}

/* ══════ RESPONSIVE ══════ */

/* Tablet ≤1024px */
@media (max-width: 1024px) {
    .agos-review__head { padding: 14px 16px 10px; }
    .agos-review__wave { padding: 10px 16px 0; }
    .agos-review .agos-transport { padding: 8px 16px 10px; }
    .agos-review .agos-timeline-bar { margin: 0 16px 4px; }
    .agos-review .agos-rv-item { padding: 9px 16px; }
    .agos-review .agos-rv-form { padding: 12px 16px; }
    .agos-review__list-head { padding: 12px 16px 8px; }

    .agos-hint--inline { font-size: 10px; }
    .agos-review__pill { padding: 6px 12px; font-size: 12px; }
    .agos-review .agos-rv-author { max-width: 100px; }

    /* v9.3.38: Stepper tablet */
    .ag-stepper { padding: 16px 18px; }
    .ag-stepper__circle { width: 30px; height: 30px; }
    .ag-stepper__circle svg { width: 12px; height: 12px; }
    .ag-stepper__pulse { width: 8px; height: 8px; }
    .ag-stepper__label { font-size: 11px; max-width: 75px; } /* v9.3.40: 6 steps */
    .ag-stepper__track { top: 10px; }
}

/* iPad ≤768px */
@media (max-width: 768px) {
    .agos-review__head {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .agos-review__head-right {
        width: 100%;
        flex-wrap: wrap;
        gap: 6px;
    }
    .agos-hint--inline {
        display: none; /* hide inline hint on small screens — info still in block hint */
    }
    .agos-review__wave { padding: 8px 12px 0; }
    .agos-review .agos-transport { padding: 8px 12px 10px; gap: 8px; }
    .agos-review .agos-timeline-bar { margin: 0 12px 4px; }
    .agos-review .agos-rv-item { padding: 8px 12px; }
    .agos-review .agos-rv-form { padding: 10px 12px; }
    .agos-review__list-head { padding: 10px 12px 8px; }
    .agos-review__wave-hint { margin: 0 12px; }

    .agos-review__wave .agos-wave-wrap {
        min-height: 140px;
    }

    /* v9.3.32: Onboarding card */
    .agos-onboard__card { padding: 24px 20px 20px; }
    .agos-onboard__title { font-size: 15px; }
    .agos-onboard__step-ico { width: 36px; height: 36px; font-size: 20px; }

    /* v9.3.32: Time badge */
    .agos-rv-time-badge { font-size: 11px; padding: 2px 8px; }

    /* v9.3.32: Tooltip bubble position fix for small screens */
    .agos-tip__bubble { white-space: normal; min-width: 160px; max-width: 220px; }

    /* v9.3.32: Touch — always show actions (no hover on touch) */
    .agos-review .agos-rv-actions { opacity: 1; }

    /* v9.3.36: Invoice block responsive */
    .ag-d-invoice-row { flex-wrap: wrap; gap: 12px; }

    /* v9.3.38: Stepper — switch to compact mobile version */
    .ag-stepper__desktop { display: none; }
    .ag-stepper__mobile  { display: block; }
    .ag-stepper { padding: 14px 16px; border-radius: 12px; }

    /* v9.3.40: Welcome screen responsive */
    .ag-wlc__card { padding: 24px 20px 20px; }
    .ag-wlc__title { font-size: 16px; }
    .ag-wlc__btn { min-width: 140px; font-size: 13px; }
}

/* Small mobile ≤480px */
@media (max-width: 480px) {
    .agos-review { border-radius: 12px; }
    .agos-review__pill { padding: 5px 10px; font-size: 11px; gap: 4px; }
    .agos-review__pill-dot { width: 6px; height: 6px; }
    .agos-review .agos-transport { flex-wrap: wrap; }
    .agos-review .agos-rv-form-body { flex-direction: column; }
    .agos-review .agos-rv-send-btn { width: 100%; text-align: center; }
    .agos-review__wave .agos-wave-wrap { min-height: 120px; }
    .agos-review .agos-rv-ts-pill { font-size: 11px; padding: 1px 6px; }
    .agos-review .agos-rv-tgt-badge { font-size: 8px; }

    /* v9.3.32: Onboarding */
    .agos-onboard__card { padding: 20px 16px 16px; }
    .agos-onboard__steps { gap: 12px; }
    .agos-onboard__step { gap: 10px; }
    .agos-onboard__step-txt { font-size: 12px; }
    .agos-onboard__close { min-width: 140px; font-size: 13px; }

    /* v9.3.32: Time badge — hide on very small screens, keep timecode */
    .agos-rv-time-badge { display: none; }

    /* v9.3.32: Touch — always show actions */
    .agos-review .agos-rv-actions { opacity: 1; }

    /* v9.3.36: Invoice — compact */
    .ag-d-invoice-icon { width: 40px; height: 40px; }
    .ag-d-invoice-icon svg { width: 24px; height: 24px; }
    .ag-d-invoice-row { gap: 10px; }
    .ag-d-studio-note { font-size: 11px; padding: 8px 12px 0; }

    /* v9.3.38: Stepper — tighter on small mobile */
    .ag-stepper { padding: 12px 14px; margin-bottom: 14px; }
    .ag-stepper__mobile-label { font-size: 12px; }
}

/* ══════ PRINT ══════ */
@media print {
    .agos-review__wave,
    .agos-review .agos-transport,
    .agos-review .agos-timeline-bar,
    .agos-review__debug,
    .agos-onboard { display: none; }
}

/* ══════ TOUCH DEVICES ══════ */
@media (pointer: coarse) {
    /* Always show delete/resolve actions on touch — no hover */
    .agos-review .agos-rv-actions { opacity: 1; }
    /* Larger touch targets */
    .agos-review .agos-rv-actions button { padding: 6px 8px; font-size: 16px; }
    .agos-tip { width: 24px; height: 24px; font-size: 13px; }
}
