.moad-wave-group {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.moad-group-top {
    order: 2;
    /* بیاد پایین */
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-top: 1px solid #eef2f7;
    padding-top: 6px;
    margin-top: 6px;
    /* دیگه border-bottom لازم نیست */
}

.moad-group-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 10px;
    background: #111827;
    color: #fff;
    cursor: pointer;
}

.moad-group-btn[disabled] {
    opacity: .5;
    cursor: not-allowed;
}

.moad-group-time {
    font: 500 .84rem ui-monospace, monospace;
    color: #374151;
}

.moad-wave-row {
    display: grid;
    direction: ltr;
    /* مهم: در RTL ترتیب برعکس نشود */
    grid-template-columns: 32px 1fr 28px;
    /* mute | canvas | volume */
    grid-template-areas: "mute canvas vol";
    gap: 8px;
    align-items: center;
}
.moad-mute {
    grid-area: mute;
}

.moad-wave-canvas {
    grid-area: canvas;
}

.moad-vol-vert {
    grid-area: vol;
}
.moad-mute {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #111827;
    border-radius: 8px;
    cursor: pointer;
}

.moad-mute[aria-pressed="true"] {
    background: #fee2e2;
    border-color: #fecaca;
}

.moad-vol-vert {
    writing-mode: bt-lr;
    /* firefox */
    -webkit-appearance: slider-vertical;
    /* webkit */
    width: 28px;
    /* باریک */
}
.moad-mute {
    grid-area: mute;
}

.moad-wave-canvas {
    grid-area: canvas;
}

.moad-vol-vert {
    grid-area: vol;
}
.moad-group-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* باکس کوچک تمپو */
.moad-tempo {
    width: 60px;
    height: 38px;
    padding: 0 .5rem;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    color: #111827;
    font: 600 .8rem ui-monospace, monospace;
    text-align: center;
}

.moad-tempo::-webkit-outer-spin-button,
.moad-tempo::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.moad-tempo[type=number] {
    -moz-appearance: textfield;
}
.moad-tempo-hint {
    font-size: .78rem;
    color: #6b7280;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .moad-tempo-hint {
        display: none;
    }

    /* روی موبایل خیلی کوچک، متن مخفی شود */
}

/* دکمه انتخاب ریتم (از همان استایل mute استفاده می‌کند) */
/* دکمه انتخاب ریتم با آیکن قرمز/سبز */
.moad-wave-row [data-action="select-rhythm"] {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #111827;
    border-radius: 8px;
    cursor: pointer;

    /* آیکن پیش‌فرض: خاموش (قرمز) */
    background-image: url("../img/rt-off.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px 18px;

    /* اگر داخل HTML ایموجی داشته باشیم، پنهان می‌شود */
    font-size: 0;
    line-height: 0;
}

.moad-wave-row [data-action="select-rhythm"][aria-pressed="true"] {
    /* روشن (سبز) */
    background-image: url("../img/rt-on.png");
    background-color: #f0fdf4;
    border-color: #bbf7d0;
}
.moad-wave-row [data-action="select-rhythm"][aria-pressed="true"]{
  background:#dbeafe; border-color:#bfdbfe;
}
/* آیکن موزیک اصلی (هم‌اندازه‌ی دکمه میوت) */
.moad-main-icon {
    grid-area: mute;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #111827;
    border-radius: 8px;
}

.moad-main-icon svg {
    width: 16px;
    height: 16px;
    display: block;
}
/* آیکن موزیک اصلی (در ستون کنترلِ چپ) */
.moad-main-icon {
    grid-area: mute;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #111827;
    border-radius: 8px;
}

.moad-main-icon-img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    display: block;
}
/* دکمه انتخاب ریتم: خاموش = قرمز | روشن = سبز */
.moad-wave-row button.moad-mute[data-action="select-rhythm"] {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #111827;
    border-radius: 8px;
    cursor: pointer;

    /* آیکن پیش‌فرض: خاموش (قرمز) */
    background-image: url("../img/rt-off.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px 18px;

    /* اگر دکمه ایموجی داشت، پنهان شود */
    font-size: 0;
    line-height: 0;
}

/* وقتی فعال است (روشن = سبز) */
.moad-wave-row button.moad-mute[data-action="select-rhythm"][aria-pressed="true"] {
    background-image: url("../img/rt-on.png");
    background-color: #f0fdf4;
    border-color: #bbf7d0;
}

/* (اختیاری) اگر کلاس is-on هم ست شد، همین رفتار را داشته باشد */
.moad-wave-row button.moad-mute[data-action="select-rhythm"].is-on {
    background-image: url("../img/rt-on.png");
    background-color: #f0fdf4;
    border-color: #bbf7d0;
}
/* رنگ پیش‌فرض فیدر (آبی) و حالت خطر (قرمز) با accent-color */
.moad-vol-vert{ accent-color:#2563eb !important; }
.moad-vol-vert.danger{ accent-color:#ef4444 !important; }

/* Fallback: اگر accent-color پشتیبانی نشود، حداقل رنگِ Thumb قرمز شود */
.moad-vol-vert.danger::-webkit-slider-thumb{ background:#ef4444; }
.moad-vol-vert.danger::-moz-range-thumb{ background:#ef4444; }
