:root {
    /* Further darkened light theme for better depth */
    --bg-color: #dcd4c6; 
    --bg-gradient-start: #eae4d9;
    --bg-gradient-mid: #dcd4c6;
    --bg-gradient-end: #c4b9a3;
    
    --text-main: #252321;
    --text-muted: #665f54;
    --primary-color: #3e4d44;
    --accent-color: #bfa36c;
    --card-bg: rgba(235, 230, 222, 0.65);
    --glass-border: rgba(255, 255, 255, 0.7);
    --btn-icon-bg: #f5f2ed;
    --modal-overlay: rgba(30, 28, 26, 0.6);

    font-family: 'Outfit', sans-serif;
    --bead-size: 54px;
}

[data-theme="dark"] {
    --bg-color: #1a1918;
    --bg-gradient-start: #2a2826;
    --bg-gradient-mid: #1a1918;
    --bg-gradient-end: #0f0e0d;
    
    --text-main: #e2e1df;
    --text-muted: #a19a91;
    --primary-color: #8fb1a0;
    --accent-color: #d8c090;
    --card-bg: rgba(40, 38, 36, 0.65);
    --glass-border: rgba(255, 255, 255, 0.1);
    --btn-icon-bg: #2d2b28;
    --modal-overlay: rgba(0, 0, 0, 0.8);
}

html[data-theme="dark"], body[data-theme="dark"] {
    background-color: var(--bg-color) !important;
}

.tasbeeh-desktop-mode * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

.tasbeeh-desktop-mode {
    background-color: var(--bg-color);
    color: var(--text-main);
    height: 100dvh; /* Fixed height to prevent any scroll */
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden; /* Ensure no scrollbars */
    position: relative;
    background: radial-gradient(circle at top right, var(--bg-gradient-start), var(--bg-gradient-mid), var(--bg-gradient-end));
}

.app-header {
    text-align: center;
    margin-bottom: 10px;
    z-index: 40;
    position: relative;
}

.app-title {
    font-size: clamp(24px, 8vw, 42px); /* Dynamically shrinks on small screens to fit */
    font-weight: 800;
    letter-spacing: 4px;
    white-space: nowrap; /* Forces one line */
    color: var(--primary-color);
    text-transform: uppercase;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .app-title {
    color: var(--accent-color);
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

/* --- Background Geometric Design --- */
.bg-low-poly {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
    opacity: 1;
}

.poly-lines {
    stroke: var(--glass-border);
    stroke-width: 1.5;
    stroke-linejoin: round;
}

.poly-shard {
    transition: all 0.5s ease;
}

.poly-1  { fill: rgba(255, 255, 255, 0.04); }
.poly-2  { fill: rgba(0, 0, 0, 0.02); }
.poly-3  { fill: rgba(255, 255, 255, 0.02); }
.poly-4  { fill: rgba(0, 0, 0, 0.03); }
.poly-5  { fill: rgba(255, 255, 255, 0.05); }
.poly-6  { fill: rgba(0, 0, 0, 0.01); }

.poly-7  { fill: rgba(255, 255, 255, 0.03); }
.poly-8  { fill: rgba(0, 0, 0, 0.04); }
.poly-9  { fill: rgba(255, 255, 255, 0.01); }
.poly-10 { fill: rgba(0, 0, 0, 0.02); }
.poly-11 { fill: rgba(255, 255, 255, 0.04); }
.poly-12 { fill: rgba(0, 0, 0, 0.03); }

.poly-13 { fill: rgba(255, 255, 255, 0.02); }
.poly-14 { fill: rgba(0, 0, 0, 0.03); }
.poly-15 { fill: rgba(255, 255, 255, 0.05); }
.poly-16 { fill: rgba(0, 0, 0, 0.01); }
.poly-17 { fill: rgba(255, 255, 255, 0.03); }
.poly-18 { fill: rgba(0, 0, 0, 0.04); }

[data-theme="dark"] .bg-low-poly {
    opacity: 0.6;
}
[data-theme="dark"] .poly-lines {
    stroke: rgba(255, 255, 255, 0.04);
}

/* --- Top Buttons --- */
.top-options-bar {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    z-index: 50;
    justify-content: flex-end;
}

[dir="rtl"] .top-options-bar {
    right: auto;
    left: 25px;
}

.btn-top-right,
.btn-top-action {
    height: 48px;
    border-radius: 24px;
    background: var(--btn-icon-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 14px;
    font-family: var(--font-family);
    box-shadow:
        0 8px 16px rgba(0, 0, 0, 0.1),
        inset 0 1px 2px var(--glass-border);
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    padding: 0 15px;
    gap: 8px;
}

.btn-top-right {
    width: 48px;
    padding: 0;
    border-radius: 50%;
}

.btn-top-action {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 50;
}

[dir="rtl"] .btn-top-action {
    left: auto;
    right: 25px;
}

.btn-top-right:hover,
.btn-top-action:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.15), inset 0 1px 2px var(--glass-border);
}

.btn-top-right:active,
.btn-top-action:active {
    transform: translateY(0);
}

.btn-top-right.active,
.btn-top-action.active {
    color: var(--primary-color);
    background: rgba(85, 107, 96, 0.1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05), inset 0 1px 2px var(--glass-border);
}

[data-theme="dark"] .btn-top-right.active,
[data-theme="dark"] .btn-top-action.active {
    background: rgba(255, 255, 255, 0.08); 
}

.lang-select-inline {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    text-align: center;
    text-align-last: center;
    font-weight: 800;
    outline: none;
    padding: 0;
}
.lang-select-inline option {
    background: var(--bg-color);
    color: var(--text-main);
    font-weight: 600;
}
.lang-select-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.lang-select-inline {
    padding-right: 14px; /* Space for the arrow */
    background: transparent;
}
.lang-select-wrapper::after {
    content: "";
    position: absolute;
    right: 4px;
    width: 12px;
    height: 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23665f54' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
}

/* --- Center UI Container --- */
.app-container {
    position: relative;
    z-index: 30; /* Increased to be above mala-container which is 20 */
    width: 100%;
    max-width: 460px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px; /* Greatly reduced to avoid vertical stretching/scrolling */
    margin-top: 15px; /* Reduced buffer */
}

header h1 {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 15px;
    text-shadow: 0 2px 10px rgba(85, 107, 96, 0.15);
}

/* --- Advanced Counter Card --- */
.advanced-counter-card {
    background: var(--card-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--glass-border);
    border-radius: 40px;
    padding: 20px 20px;
    box-shadow:
        0 25px 45px rgba(0, 0, 0, 0.15),
        inset 0 2px 5px var(--glass-border),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.target-indicator {
    background: var(--card-bg);
    padding: 6px 16px;
    border-radius: 20px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--glass-border);
}

#target-display {
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 2px;
}

.count-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

#count-display {
    font-size: 80px;
    font-weight: 800;
    line-height: 1;
    color: var(--primary-color);
    letter-spacing: -3px;
    text-shadow: 0 10px 30px rgba(85, 107, 96, 0.15);
}

/* Custom Target Input */
.custom-target-input {
    width: 100%;
    padding: 10px 15px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: var(--card-bg);
    font-family: var(--font-family);
    font-size: 14px;
    color: var(--text-main);
    outline: none;
    text-align: center;
    font-weight: 700;
    transition: all 0.2s;
}
.custom-target-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(85, 107, 96, 0.2);
}

/* --- Stats Dashboard --- */
.stats-dashboard {
    display: flex;
    justify-content: center;
    gap: 15px;
    width: 100%;
    margin-top: -10px;
}

.stat-box {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
}

.stat-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 800;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary-color);
}

/* --- Controls Modern --- */
.controls-modern {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    width: 100%;
}

button {
    border: none;
    outline: none;
    cursor: pointer;
    font-family: var(--font-family);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.btn-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--btn-icon-bg);
    color: var(--text-muted);
    box-shadow:
        0 10px 20px rgba(0, 0, 0, 0.1),
        inset 0 1px 2px var(--glass-border);
    border: 1px solid var(--glass-border);
}

.btn-icon:hover {
    color: var(--text-main);
    transform: translateY(-3px);
    box-shadow: 0 15px 25px rgba(140, 130, 115, 0.2), inset 0 1px 2px #fff;
}

.btn-icon:active {
    transform: translateY(0) scale(0.95);
}

.btn-main-action {
    position: relative;
	padding: 0 35px;
	height: 65px;
	border-radius: 35px;
	background: linear-gradient(135deg, #5f8a77, #2f4f40); /* Brighter, more prominent */
    color: #ffffff;
	font-size: 18px;
    font-weight: 800;
    letter-spacing: 2px;
    box-shadow:
		0 18px 36px rgba(85, 107, 96, 0.45),
		inset 0 -3px 10px rgba(0, 0, 0, 0.25),
		inset 0 3px 6px rgba(255, 255, 255, 0.45);
	border: 1px solid rgba(255, 255, 255, 0.2);
	text-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.btn-main-action .btn-text {
    position: relative;
    z-index: 2;
}

.btn-main-action:hover {
	transform: translateY(-3px) scale(1.02);
	box-shadow:
		0 24px 46px rgba(85, 107, 96, 0.5),
		inset 0 -3px 10px rgba(0, 0, 0, 0.25),
		inset 0 4px 8px rgba(255, 255, 255, 0.5);
}

.btn-main-action:focus-visible {
	outline: none;
	box-shadow:
		0 0 0 4px rgba(95, 138, 119, 0.25),
		0 20px 36px rgba(85, 107, 96, 0.4),
		inset 0 -3px 10px rgba(0, 0, 0, 0.25);
}

.btn-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 120%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.3) 0%, transparent 60%);
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.btn-main-action:hover .btn-glow {
	opacity: 0.5;
}

.btn-main-action:active .btn-glow {
    opacity: 1;
}

.btn-main-action:active {
    transform: scale(0.95);
    box-shadow: 0 8px 15px rgba(85, 107, 96, 0.2);
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

/* --- Settings Toggle --- */
.settings-link {
    width: 100%;
    display: flex;
    justify-content: center;
}

.toggle-group {
    display: flex;
    gap: 8px;
    background: var(--card-bg);
    padding: 6px;
    border-radius: 16px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--glass-border);
}

.toggle-group input[type="radio"] {
    display: none;
}

.toggle-group label {
    padding: 8px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.toggle-group input[type="radio"]:checked+label {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 10px rgba(85, 107, 96, 0.2);
}

/* --- Save Progress Section --- */
.save-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    margin-top: -5px;
    border-top: 1px solid rgba(200, 190, 180, 0.3);
    padding-top: 15px;
}

#dhikr-name {
    width: 100%;
    padding: 14px 20px;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    background: var(--card-bg);
    font-family: var(--font-family);
    font-size: 15px;
    color: var(--text-main);
    outline: none;
    transition: all 0.2s;
}

#dhikr-name:focus {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(85, 107, 96, 0.1);
}

.btn-secondary {
    padding: 14px;
    border-radius: 16px;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: #ffffff;
    font-weight: 800;
    font-size: 16px;
    letter-spacing: 1px;
    box-shadow: 0 8px 15px rgba(46, 204, 113, 0.3);
    border: none;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #27ae60, #219653);
    transform: translateY(-2px);
    box-shadow: 0 12px 20px rgba(46, 204, 113, 0.4);
}

/* ========================================================
   HISTORY MODAL
   ======================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--modal-overlay);
    backdrop-filter: blur(5px);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: var(--bg-color);
    width: 90%;
    max-width: 450px;
    max-height: 80vh;
    border-radius: 30px;
    padding: 30px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
	z-index: 110;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 20px;
    color: var(--primary-color);
}

.btn-close {
    background: transparent;
    color: var(--text-muted);
    box-shadow: none;
    width: 40px;
    height: 40px;
}

.btn-close:hover {
    color: #d9534f;
    background: rgba(217, 83, 79, 0.1);
    border-radius: 50%;
}

.history-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-right: 5px;
}

.hist-name, .hist-date {
	white-space: normal;
}

[dir="rtl"] .history-item {
	text-align: right;
}

.history-list::-webkit-scrollbar {
    width: 6px;
}

.history-list::-webkit-scrollbar-thumb {
    background: #dcd6cc;
    border-radius: 4px;
}

.history-item {
    background: var(--card-bg);
    padding: 16px;
    border-radius: 16px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--glass-border);
}

.hist-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hist-name {
    font-weight: 700;
    color: var(--text-main);
    font-size: 16px;
}

.hist-date {
    font-size: 12px;
    color: var(--text-muted);
}

.hist-count {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary-color);
    background: rgba(85, 107, 96, 0.1);
    padding: 6px 14px;
    border-radius: 12px;
}

.btn-delete-hist {
    background: transparent;
    border: none;
    color: #eab308;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px;
    margin-left: 10px;
    border-radius: 8px;
    transition: all 0.2s;
}

.btn-delete-hist:hover {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
}

/* ========================================================
   FULL WIDTH DROOPING MALA (TASBEEH)
   ======================================================== */
.hanging-mala-container {
    position: absolute;
    bottom: 0px;
    left: 0;
    width: 100%;
    height: 480px;
    /* Taller area for thicker curve */
    z-index: 20;
    pointer-events: none;
}

.mala-curve-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.mala-beads-track {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Prominent, vibrant colored bead clearly visible with threading hole */
.mala-bead {
    width: var(--bead-size);
    height: calc(var(--bead-size) - 2px);
    /* slightly oblate */
    border-radius: 50%;
    position: absolute;
    top: 0;
    left: 0;

    /* Changed from pale ivory to a more prominent deep amber/gold to be very clear against beige */
    background: radial-gradient(circle at 35% 25%, #fde047 0%, #ca8a04 35%, #713f12 70%, #451a03 100%);

    box-shadow:
        /* External falling shadow */
        4px 10px 15px rgba(69, 26, 3, 0.4),
        /* Deep internal shadow core */
        inset -8px -8px 14px rgba(0, 0, 0, 0.45),
        /* Bright rim light */
        inset 4px 6px 12px rgba(255, 255, 255, 0.85);

    transform: translate(-50%, -50%);
    /* Centers over the exact math line */
    transition: top 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), left 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.4s ease;
}

/* Dark threaded hole directly in the middle ensuring it overlays exactly on the wire */
.mala-bead::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    background: #27272a;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: inset 2px 2px 5px #000, 0 1px 3px rgba(255, 255, 255, 0.4);
    z-index: 2;
}

/* Sharp Glass reflection */
.mala-bead::after {
    content: '';
    position: absolute;
    top: 10%;
    left: 15%;
    width: 35%;
    height: 30%;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    transform: rotate(-30deg);
    pointer-events: none;
}

/* Marker Bead - distinctive color (Vibrant Teal/Cyan to contrast the amber) */
.mala-bead.marker {
    width: calc(var(--bead-size) + 6px);
    height: calc(var(--bead-size) + 4px);
    border-radius: 50%;
    background: radial-gradient(circle at 35% 25%, #67e8f9 0%, #06b6d4 30%, #083344 70%, #020617 100%);
    box-shadow:
        5px 12px 20px rgba(8, 51, 68, 0.4),
        inset -8px -8px 14px rgba(0, 0, 0, 0.5),
        inset 4px 6px 14px rgba(255, 255, 255, 0.7);
}

/* ========================================================
   ADDITIONAL GLOBAL MODIFICATIONS
   ======================================================== */

/* Eye Protection Overlay (Fixes z-index/fixed positioning bugs) */
.eye-protection-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    background: rgba(255, 140, 0, 0.08); /* Warm tint */
    mix-blend-mode: multiply;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s;
}
body.eye-protection .eye-protection-overlay {
    opacity: 1;
}



/* Responsive Overrides */
@media (max-width: 480px) {
    :root {
        --bead-size: 36px; /* Dynamically shrink beads for mobile */
    }
    
    .top-options-bar {
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        right: auto;
        width: 90%;
        max-width: 340px;
        padding: 5px 12px;
        background: var(--card-bg);
        backdrop-filter: blur(14px);
        border-radius: 30px;
        border: 1px solid var(--glass-border);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
        justify-content: space-between;
        gap: 0;
    }
    
    .btn-top-right {
        width: 38px;
        height: 38px;
        background: transparent;
        border: none;
        box-shadow: none;
    }
    
    .btn-top-right:hover {
        background: var(--btn-icon-bg);
    }
    
    .btn-top-action {
        top: 68px; /* Centered perfectly in the gap */
        bottom: auto;
        left: 50%;
        transform: translateX(-50%);
        height: 40px;
        font-size: 13px;
        padding: 0 14px;
        z-index: 60;
    }
    .app-container {
        padding: 10px;
        margin-bottom: 100px; /* Reduced significantly to prevent screen cutoff */
        margin-top: 130px; /* Ensure 20px gap between History Button and Card */
    }
    .advanced-counter-card {
        padding: 20px 15px; /* Tighter padding */
        border-radius: 20px;
        gap: 12px; /* Smaller gaps between rows */
    }
    #count-display {
        font-size: 75px; /* Slightly smaller for mobile */
    }
    .btn-main-action {
        padding: 0 30px;
        height: 55px; /* Less tall button */
    }
    .btn-icon {
        width: 50px;
        height: 50px;
    }
    .settings-link {
        transform: scale(0.9); /* shrink the radio target settings slightly */
    }
    
    /* Perfect compression for smaller phone screens */
    .hanging-mala-container {
        height: 320px; 
    }
}

/* RTL Support for Arabic */
[dir="rtl"] {
    font-family: 'Amiri', 'Tajawal', sans-serif;
}
[dir="rtl"] .btn-top-action {
    left: auto;
    right: 25px;
}
@media (max-width: 480px) {
    [dir="rtl"] .btn-top-action {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }
}