/* 🆕 (Update 31 — مسیر C) ماژولِ موسیقیِ تایمرِ مطالعه — پیشوندِ sm- */
.sm-page { --sm-bg: #f6f7fb; --sm-surface: #fff; --sm-border: #e5e7eb; --sm-text: #111827; --sm-text-2: #4b5563; --sm-text-3: #9ca3af;
    --sm-accent: #7c3aed; --sm-accent-2: #6d28d9; --sm-accent-bg: #f5f3ff; --sm-danger: #dc2626; --sm-radius: 14px;
    max-width: 1100px; margin: 0 auto; padding: 16px; font-family: 'Vazirmatn', system-ui, sans-serif; color: var(--sm-text); }
.sm-card { background: var(--sm-surface); border: 1px solid var(--sm-border); border-radius: var(--sm-radius); padding: 18px; margin-bottom: 16px; }
.sm-denied { text-align: center; color: var(--sm-text-2); padding: 40px; }
.sm-hdr { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.sm-title { font-size: 20px; font-weight: 800; margin: 0 0 4px; display: flex; gap: 8px; align-items: center; }
.sm-title i { color: var(--sm-accent); }
.sm-desc { margin: 0; font-size: 12.5px; color: var(--sm-text-2); }
.sm-tabs { display: inline-flex; background: var(--sm-bg); border: 1px solid var(--sm-border); border-radius: 12px; padding: 4px; gap: 4px; }
.sm-tab { border: none; background: transparent; padding: 8px 14px; border-radius: 9px; font: inherit; font-size: 13px; color: var(--sm-text-2); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.sm-tab.on { background: var(--sm-surface); color: var(--sm-accent); font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.sm-h2 { font-size: 15px; font-weight: 800; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.sm-h3 { font-size: 13px; font-weight: 700; margin: 18px 0 8px; color: var(--sm-text-2); }
.sm-count { background: var(--sm-accent-bg); color: var(--sm-accent); border-radius: 999px; padding: 1px 10px; font-size: 12px; }
.sm-upload { display: grid; gap: 12px; }
.sm-drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 150px;
    border: 2px dashed #c4b5fd; border-radius: var(--sm-radius); background: var(--sm-accent-bg); cursor: pointer; text-align: center; padding: 18px; transition: border-color .15s, background .15s, transform .15s; }
.sm-drop:hover, .sm-drop.over { border-color: var(--sm-accent); background: #ede9fe; }
.sm-drop.over { transform: scale(1.01); }
.sm-drop.has-file { border-style: solid; }
.sm-drop-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.sm-drop:focus-within { outline: 3px solid rgba(124,58,237,.35); outline-offset: 2px; }
.sm-drop-icon { font-size: 36px; color: var(--sm-accent); }
.sm-drop-main { font-weight: 700; font-size: 13.5px; word-break: break-all; }
.sm-drop-sub { font-size: 12px; color: var(--sm-text-2); }
.sm-field { display: grid; gap: 6px; }
.sm-field label { font-size: 12.5px; font-weight: 700; }
.sm-req { color: var(--sm-danger); }
.sm-input { border: 1px solid var(--sm-border); border-radius: 10px; padding: 9px 12px; font: inherit; font-size: 13px; width: 100%; box-sizing: border-box; background: #fff; }
.sm-input:focus { outline: none; border-color: var(--sm-accent); box-shadow: 0 0 0 3px rgba(124,58,237,.15); }
.sm-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sm-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--sm-border);
    background: #fff; color: var(--sm-text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; }
.sm-btn:hover:not(:disabled) { background: #f9fafb; }
.sm-btn.primary { background: var(--sm-accent); border-color: var(--sm-accent); color: #fff; }
.sm-btn.primary:hover:not(:disabled) { background: var(--sm-accent-2); }
.sm-btn.danger { background: var(--sm-danger); border-color: var(--sm-danger); color: #fff; }
.sm-btn:disabled { opacity: .55; cursor: not-allowed; }
.sm-btn:focus-visible, .sm-icon-btn:focus-visible, .sm-switch:focus-visible, .sm-tab:focus-visible, .sm-chip:focus-visible { outline: 3px solid rgba(124,58,237,.35); outline-offset: 2px; }
.sm-progress { position: relative; height: 22px; border-radius: 999px; background: #ede9fe; overflow: hidden; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.sm-progress-bar { position: absolute; inset-block: 0; inset-inline-start: 0; background: linear-gradient(90deg, #8b5cf6, #7c3aed); transition: width .2s; }
.sm-progress span { position: relative; color: #fff; mix-blend-mode: difference; }
.sm-alert { padding: 9px 12px; border-radius: 10px; font-size: 12.5px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.sm-alert.error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.sm-list-hdr { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.sm-list-hdr .sm-h2 { margin: 0; }
.sm-search { position: relative; min-width: 220px; }
.sm-search i { position: absolute; inset-inline-start: 10px; top: 50%; transform: translateY(-50%); color: var(--sm-text-3); }
.sm-search .sm-input { padding-inline-start: 32px; }
.sm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sm-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, 280px) auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--sm-border); border-radius: 12px; }
.sm-row.inactive { background: #fafafa; }
.sm-row.inactive .sm-row-title { color: var(--sm-text-3); }
.sm-row-main { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sm-row-title { font-weight: 700; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.sm-row-meta { width: 100%; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; color: var(--sm-text-2); }
.sm-rename { max-width: 280px; }
.sm-audio { width: 100%; height: 36px; }
.sm-row-actions { display: flex; align-items: center; gap: 6px; }
.sm-icon-btn { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--sm-border); background: #fff; color: var(--sm-text-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.sm-icon-btn:hover { background: #f9fafb; color: var(--sm-text); }
.sm-icon-btn.danger:hover { color: var(--sm-danger); border-color: #fecaca; background: #fef2f2; }
.sm-switch { width: 42px; height: 24px; border-radius: 999px; border: none; background: #d1d5db; position: relative; cursor: pointer; transition: background .15s; padding: 0; }
.sm-switch span { position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: inset-inline-start .15s; }
.sm-switch.on { background: #16a34a; }
.sm-switch.on span { inset-inline-start: 21px; }
.sm-badge { font-size: 10.5px; padding: 1px 8px; border-radius: 999px; }
.sm-badge.muted { background: #f3f4f6; color: var(--sm-text-2); }
.sm-empty { padding: 30px; text-align: center; color: var(--sm-text-3); }
.sm-skel { height: 56px; border-radius: 12px; margin-bottom: 8px; background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 37%, #f3f4f6 63%); background-size: 400% 100%; animation: sm-skel 1.3s ease infinite; }
.sm-skel.tall { height: 260px; }
@keyframes sm-skel { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.sm-spin { animation: sm-spin 1s linear infinite; display: inline-block; }
@keyframes sm-spin { to { transform: rotate(360deg); } }
.sm-range { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.sm-chip { border: 1px solid var(--sm-border); background: #fff; border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 12.5px; cursor: pointer; }
.sm-chip.on { background: var(--sm-accent); border-color: var(--sm-accent); color: #fff; font-weight: 700; }
.sm-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.sm-kpi { background: var(--sm-bg); border-radius: 12px; padding: 14px; display: grid; gap: 4px; }
.sm-kpi .v { font-size: 20px; font-weight: 800; color: var(--sm-accent); }
.sm-kpi .l { font-size: 12px; color: var(--sm-text-2); }
.sm-bars { display: flex; align-items: flex-end; gap: 4px; height: 170px; overflow-x: auto; padding-bottom: 22px; }
.sm-bar { position: relative; flex: 1 0 18px; height: 100%; display: flex; align-items: flex-end; }
.sm-bar-fill { width: 100%; background: linear-gradient(180deg, #a78bfa, #7c3aed); border-radius: 6px 6px 2px 2px; min-height: 3px; }
.sm-bar-lbl { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); font-size: 9.5px; color: var(--sm-text-3); white-space: nowrap; }
.sm-hours { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 3px; }
.sm-hour { aspect-ratio: 1; border-radius: 6px; background: rgba(124, 58, 237, calc(.08 + var(--a, 0) * .85)); display: flex; align-items: center; justify-content: center; font-size: 9.5px; color: #fff; }
.sm-hour span { mix-blend-mode: difference; }
.sm-table-wrap { overflow-x: auto; }
.sm-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.sm-table th { text-align: right; color: var(--sm-text-2); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--sm-border); white-space: nowrap; }
.sm-table td { padding: 8px 10px; border-bottom: 1px solid #f3f4f6; }
.sm-modal-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.sm-modal { background: #fff; border-radius: 18px; padding: 22px; max-width: 420px; width: 100%; text-align: center; box-shadow: 0 24px 60px rgba(0,0,0,.25); }
.sm-modal h3 { margin: 0 0 8px; font-size: 16px; }
.sm-modal p { margin: 0 0 16px; font-size: 13px; color: var(--sm-text-2); line-height: 1.9; }
.sm-modal .sm-actions { justify-content: center; }
.sm-modal-icon { width: 52px; height: 52px; margin: 0 auto 10px; border-radius: 50%; background: #fef2f2; color: var(--sm-danger); display: flex; align-items: center; justify-content: center; font-size: 24px; }
.sm-toast { position: fixed; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); background: #065f46; color: #fff; padding: 10px 18px; border-radius: 12px; font-size: 13px; z-index: 10001; box-shadow: 0 10px 24px rgba(0,0,0,.2); }
.sm-toast.error { background: #b91c1c; }
@media (max-width: 760px) {
    .sm-row { grid-template-columns: 1fr; }
    .sm-row-actions { justify-content: flex-end; }
    .sm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sm-hours { grid-template-columns: repeat(12, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { .sm-skel, .sm-spin { animation: none; } .sm-drop.over { transform: none; } }

/* دکمه‌ی «لمس برایِ پخش» در صفحه‌ی تایمر (Autoplay مسدود) */
.music-resume { display: inline-flex; align-items: center; gap: 6px; margin: 10px auto 0; animation: sm-pulse 1.6s ease-in-out infinite; }
@keyframes sm-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(124,58,237,.45); } 50% { box-shadow: 0 0 0 10px rgba(124,58,237,0); } }
@media (prefers-reduced-motion: reduce) { .music-resume { animation: none; } }
