/* Marifatul Quran - Ruku Player - Islamic-themed teal design */

:root {
  --teal-dark: #0d4f4f;
  --teal-header: #0d5c5c;
  --teal-accent: #0f7a7a;
  --teal-light: #e8f5f5;
  --row-white: #ffffff;
  --row-gray: #f4f8f8;
  --text-primary: #1a1a1a;
  --text-muted: #666;
  --verse-link: #0a6b6b;
  --arabic-gold: #8b6914;
  --playing-bg: #ddf0f0;
  --border: #d0d8d8;
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: #eef4f4;
  color: var(--text-primary);
  min-height: 100vh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.header {
  background: linear-gradient(135deg, #0a3d3d 0%, var(--teal-dark) 40%, #0f6060 100%);
  color: white;
  padding: 1.25rem 1.5rem 1.1rem;
  text-align: center;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.22);
  position: relative;
  overflow: hidden;
}

.header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--arabic-gold), transparent);
}

.header h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.header .subtitle {
  margin: 0.3rem 0 0;
  font-size: 0.95rem;
  opacity: 0.8;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.main {
  width: 100%;
  max-width: 1200px;
  padding: 1.25rem 1.5rem 2rem;
  overflow-x: auto;
  box-sizing: border-box;
  margin: 0 auto;
}

.controls {
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.controls label {
  font-weight: 500;
  color: var(--text-primary);
}

.controls select {
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--row-white);
  color: var(--text-primary);
  cursor: pointer;
  touch-action: manipulation;
}

.controls select:focus {
  outline: none;
  border-color: var(--teal-accent);
  box-shadow: 0 0 0 2px rgba(15, 122, 122, 0.2);
}

.toolbar {
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--row-white);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.controls-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.controls-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn {
  padding: 0.5rem 0.85rem;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  line-height: 1.4;
}

.btn-primary {
  background: var(--teal-accent);
  color: white;
  box-shadow: 0 1px 4px rgba(15,122,122,0.25);
}

.btn-primary:hover {
  background: var(--teal-header);
  box-shadow: 0 2px 8px rgba(15,122,122,0.35);
}

.btn-secondary {
  background: var(--teal-header);
  color: white;
  box-shadow: 0 1px 4px rgba(13,79,79,0.2);
}

.btn-secondary:hover {
  background: var(--teal-dark);
}

.btn-danger {
  background: #c62828;
  color: white;
  box-shadow: 0 1px 4px rgba(198,40,40,0.2);
}

.btn-danger:hover {
  background: #b71c1c;
}

.btn-offline-para {
  background: var(--teal-accent);
  color: white;
  box-shadow: 0 1px 4px rgba(15,122,122,0.25);
}

.btn-offline-para:hover {
  background: var(--teal-dark);
  box-shadow: 0 2px 8px rgba(15,122,122,0.35);
}

.btn-offline-para:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-install {
  background: linear-gradient(135deg, #9a7520, #8b6914);
  color: white;
  box-shadow: 0 1px 4px rgba(139,105,20,0.3);
}

.btn-install:hover {
  background: linear-gradient(135deg, #a67c18, #9a7520);
  box-shadow: 0 2px 8px rgba(139,105,20,0.4);
}

.btn-outline {
  background: transparent;
  color: var(--teal-accent);
  border-color: var(--teal-accent);
}

.btn-outline:hover {
  background: rgba(15, 122, 122, 0.1);
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.82rem;
}


/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0.2s, opacity 0.2s;
}

.modal.is-open {
  visibility: visible;
  opacity: 1;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.modal-content {
  position: relative;
  background: white;
  border-radius: 12px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25);
  max-width: 440px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 0;
}

.modal-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: white;
  background: linear-gradient(135deg, var(--teal-dark), var(--teal-header));
  padding: 1rem 1.25rem;
  border-radius: 12px 12px 0 0;
}

.row-form .form-row {
  margin-bottom: 0.75rem;
}

.row-form label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
}

.row-form input[type="text"],
.row-form input[type="number"] {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 1rem;
}

.row-form input[type="file"] {
  width: 100%;
  font-size: 0.85rem;
}

/* Audio drop zone (click or drag & drop) */
.audio-drop-zone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 1.25rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}

.audio-drop-zone:hover,
.audio-drop-zone.dragover {
  border-color: var(--teal-accent);
  background: rgba(15, 122, 122, 0.06);
}

.audio-drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.audio-drop-zone-icon {
  display: block;
  font-size: 1.75rem;
  margin-bottom: 0.35rem;
}

.audio-drop-zone-text {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.audio-file-info {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: var(--row-gray);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.audio-file-name {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-all;
}

.audio-file-meta {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.form-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.btn-link {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  color: var(--teal-accent);
  text-decoration: underline;
  cursor: pointer;
}

.btn-link:hover {
  color: var(--teal-header);
}

.modal-actions {
  margin-top: 1.25rem;
  display: flex;
  gap: 0.5rem;
}

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  background: var(--row-white);
  min-width: 0;
  border: 1px solid var(--border);
  margin-top: 1rem;
}

.ruku-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 0.95rem;
  table-layout: auto;
}

.ruku-table thead {
  background: linear-gradient(135deg, var(--teal-dark) 0%, var(--teal-header) 100%);
  color: white;
}

.ruku-table th {
  padding: 0.8rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}


.ruku-table tbody tr {
  border-bottom: 1px solid var(--border);
}

.ruku-table tbody tr:nth-child(even) {
  background: var(--row-gray);
}

.ruku-table tbody tr:nth-child(odd) {
  background: var(--row-white);
}

.ruku-table tbody tr:hover {
  background: #e3eded !important;
}

.ruku-table tbody tr.playing {
  background: var(--playing-bg) !important;
  box-shadow: inset 3px 0 0 var(--teal-accent);
}

.ruku-table td {
  padding: 0.65rem 1rem;
  vertical-align: middle;
  text-align: left;
  white-space: nowrap;
}

/* Ruku # column: one line, left-aligned */
.ruku-table td:first-child {
  min-width: 8rem;
}

/* Surah name: one line */
.ruku-table td:nth-child(2) {
  min-width: 7rem;
}

/* Verses: one line */
.ruku-table td:nth-child(3) {
  min-width: 4rem;
}

/* Surah # & Arabic: one line */
.ruku-table td:nth-child(4) {
  min-width: 6rem;
}

.ruku-table .col-verses {
  color: var(--verse-link);
  font-weight: 500;
}

.ruku-table .col-surah-arabic {
  text-align: right;
  direction: rtl;
  font-family: "Traditional Arabic", "Scheherazade New", serif;
  color: var(--arabic-gold);
  font-size: 1.1rem;
}

.ruku-table .col-audio {
  text-align: left;
  min-width: 280px;
}

.audio-cell audio {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.audio-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
  width: 100%;
  min-width: 240px;
  max-width: 360px;
}

.audio-play-btn {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--teal-accent), var(--teal-dark));
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  touch-action: manipulation;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  box-shadow: 0 2px 10px rgba(13, 79, 79, 0.35);
}

.audio-play-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 16px rgba(13, 79, 79, 0.45);
  background: linear-gradient(145deg, #10888a, var(--teal-dark));
}

.audio-play-btn:active {
  transform: scale(0.93);
}

.audio-play-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(15, 122, 122, 0.35), 0 2px 8px rgba(13, 79, 79, 0.3);
}

tr.playing .audio-play-btn {
  background: linear-gradient(145deg, #0d8a8a, #0a3f3f);
  box-shadow: 0 0 0 3px rgba(15,122,122,0.2), 0 3px 12px rgba(13,79,79,0.4);
  animation: playing-pulse 2s ease-in-out infinite;
}

@keyframes playing-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(15,122,122,0.2), 0 3px 12px rgba(13,79,79,0.4); }
  50%       { box-shadow: 0 0 0 5px rgba(15,122,122,0.15), 0 3px 14px rgba(13,79,79,0.35); }
}

.audio-time {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  font-size: 0.8rem;
  color: var(--text-muted);
  min-width: 2.5rem;
  letter-spacing: 0.02em;
}

.audio-progress-wrap {
  flex: 1;
  min-width: 100px;
  min-height: 28px;
  display: flex;
  align-items: center;
  position: relative;
}

.audio-progress-overlay {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  cursor: pointer;
  z-index: 1;
}

.audio-hover-time {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  background: var(--teal-dark);
  color: white;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.1s ease;
  z-index: 3;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.audio-hover-time::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--teal-dark);
}

.audio-hover-time.is-visible {
  opacity: 1;
}

.audio-progress {
  --progress: 0%;
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: #dde4e4;
  border-radius: 3px;
  cursor: pointer;
  transition: height 0.15s ease;
}

.audio-progress-wrap:hover .audio-progress {
  height: 8px;
}

.audio-progress::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  border: 3px solid var(--teal-accent);
  box-shadow: 0 1px 6px rgba(13, 79, 79, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.audio-progress-wrap:hover .audio-progress::-webkit-slider-thumb {
  transform: scale(1.25);
  box-shadow: 0 0 0 4px rgba(15, 122, 122, 0.15), 0 2px 8px rgba(13, 79, 79, 0.3);
  border-color: var(--teal-dark);
}

.audio-progress::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  border: 3px solid var(--teal-accent);
  box-shadow: 0 1px 6px rgba(13, 79, 79, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.audio-progress-wrap:hover .audio-progress::-moz-range-thumb {
  transform: scale(1.25);
  box-shadow: 0 0 0 4px rgba(15, 122, 122, 0.15), 0 2px 8px rgba(13, 79, 79, 0.3);
  border-color: var(--teal-dark);
}

.audio-progress::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--teal-accent) 0%, var(--teal-accent) var(--progress), #dde4e4 var(--progress), #dde4e4 100%);
  transition: height 0.15s ease;
}

.audio-progress-wrap:hover .audio-progress::-webkit-slider-runnable-track {
  height: 8px;
}

.audio-progress::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--teal-accent) 0%, var(--teal-accent) var(--progress), #dde4e4 var(--progress), #dde4e4 100%);
  transition: height 0.15s ease;
}

.audio-progress-wrap:hover .audio-progress::-moz-range-track {
  height: 8px;
}

/* Playing state glow on thumb */
tr.playing .audio-progress::-webkit-slider-thumb {
  border-color: var(--teal-dark);
  box-shadow: 0 0 0 4px rgba(15, 122, 122, 0.2), 0 2px 8px rgba(13, 79, 79, 0.35);
}

tr.playing .audio-progress::-moz-range-thumb {
  border-color: var(--teal-dark);
  box-shadow: 0 0 0 4px rgba(15, 122, 122, 0.2), 0 2px 8px rgba(13, 79, 79, 0.35);
}

tr.playing .audio-play-btn {
  box-shadow: 0 0 0 3px rgba(15, 122, 122, 0.2), 0 2px 8px rgba(13, 79, 79, 0.3);
}

.audio-speed-btn {
  flex-shrink: 0;
  padding: 0.2rem 0.45rem;
  font-size: 0.68rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: var(--row-white);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  min-width: 2.2rem;
  text-align: center;
  line-height: 1.4;
  letter-spacing: 0.01em;
}

.audio-speed-btn:hover {
  border-color: var(--teal-accent);
  color: var(--teal-accent);
  background: rgba(15,122,122,0.05);
}

.audio-offline-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  background: var(--row-white);
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.audio-offline-btn:hover {
  border-color: var(--teal-accent);
  color: var(--teal-accent);
  background: #e8f5f5;
}

.audio-offline-btn.is-saving {
  pointer-events: none;
  opacity: 0.7;
  animation: pulse-save 1s infinite;
}

.audio-offline-btn.is-saved {
  border-color: #2e7d32;
  color: #2e7d32;
  background: #e8f5e9;
  font-weight: 700;
  cursor: default;
}

.audio-share-wa-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  background: var(--row-white);
  color: #128c7e;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.audio-share-wa-btn:hover {
  border-color: #25d366;
  color: #25d366;
  background: #e7fce8;
}

.audio-share-wa-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.25);
}

.audio-share-wa-btn svg {
  display: block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  pointer-events: none;
}

.audio-share-wa-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

@keyframes pulse-save {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 0.4; }
}

.audio-seek-btn {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  touch-action: manipulation;
}

.audio-seek-btn:hover {
  border-color: var(--teal-accent);
  color: var(--teal-accent);
  background: rgba(15,122,122,0.06);
}

.audio-seek-btn:active {
  background: var(--teal-light);
  transform: scale(0.9);
}

.audio-loop-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  background: var(--row-white);
  cursor: pointer;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  opacity: 0.5;
}

.audio-loop-btn:hover {
  border-color: var(--teal-accent);
  opacity: 0.8;
}

.audio-loop-btn.active {
  border-color: var(--teal-accent);
  background: rgba(15, 122, 122, 0.1);
  opacity: 1;
}

.action-cell {
  text-align: center;
  min-width: 110px;
}

@media (min-width: 768px) {
  .action-cell {
    min-width: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }
  .validate-label {
    margin-top: 0;
  }
}

.validate-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 6px;
  cursor: pointer;
  user-select: none;
}
.validate-label .validate-check {
  display: none;
}
.validate-label span {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 12px;
  border: 1.5px solid #ccc;
  background: #f5f5f5;
  color: #888;
  font-size: 0.75rem;
  font-weight: 500;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.validate-label.validated span {
  border-color: #2e7d32;
  background: #e8f5e9;
  color: #2e7d32;
}

.audio-cell .no-recording {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: #e8e8e8;
  border-radius: 4px;
}

.audio-cell .path-not-found {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  color: #8b4513;
  background: #fef3e0;
  border-radius: 4px;
}

/* Hover tooltip: audio path */
.ruku-path-tooltip {
  position: fixed;
  z-index: 999;
  max-width: 420px;
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  font-family: ui-monospace, monospace;
  color: var(--text-primary);
  background: var(--row-white);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  word-break: break-all;
}

.ruku-path-tooltip.is-visible {
  opacity: 1;
}

/* Hide row path tooltip on touch/mobile devices */
@media (hover: none), (pointer: coarse) {
  .ruku-path-tooltip {
    display: none !important;
  }
}

/* Mobile and small screens */
@media (max-width: 768px) {

  .table-wrapper{
    box-shadow: none;
    background: transparent;
  }

  tr.playing {
    background: var(--playing-bg) !important;
    border: 2px solid var(--teal-accent) !important;
  }
  
.ruku-table tbody tr {
  background: var(--row-white) !important;
}


  .header {
    padding: 1rem 1rem;
  }

  .header h1 {
    font-size: 1.4rem;
  }

  .header .subtitle {
    font-size: 0.9rem;
  }

  .main {
    padding: 0.75rem 1rem;
  }

  .controls {
    margin-bottom: 1rem;
    flex-wrap: wrap;
  }

  .controls label {
    font-size: 0.9rem;
  }

  .controls select {
    padding: 0.6rem 2rem 0.6rem 0.75rem;
    font-size: 1rem;
    min-height: 44px;
  }
}

/* Mobile: transpose table into stacked cards */
@media (max-width: 640px) {
  .main {
    padding: 0.5rem 0.75rem;
  }

  .table-wrapper {
    overflow-x: visible;
  }

  .ruku-table {
    font-size: 0.9rem;
    min-width: 0;
    display: block;
  }

  .ruku-table thead {
    display: none;
  }

  .ruku-table tbody {
    display: block;
  }

  .ruku-table tbody tr {
    display: block;
    margin-bottom: 0.75rem;
    padding: 0.9rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--row-white) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
  }

  .ruku-table tbody tr:nth-child(even) {
    background: var(--row-gray);
  }

  .ruku-table tbody tr:nth-child(odd) {
    background: var(--row-white);
  }

  .ruku-table tbody tr.playing {
    background: var(--playing-bg) !important;
    border-color: var(--teal-accent);
    box-shadow: 0 2px 12px rgba(15,122,122,0.15);
  }

  .ruku-table tbody td {
    display: block;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    white-space: normal;
    min-width: 0;
  }

  .ruku-table tbody td:last-child {
    border-bottom: none;
    padding-top: 0.75rem;
  }

  .ruku-table tbody td::before {
    content: attr(data-label);
    display: block;
    font-weight: 600;
    color: var(--teal-header);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 0.25rem;
  }

  .ruku-table .col-surah-arabic {
    text-align: right;
    direction: rtl;
  }

  .ruku-table .col-audio::before {
    margin-bottom: 0.5rem;
  }

  .ruku-table .col-audio .audio-controls {
    min-width: 0;
    max-width: none;
    width: 100%;
  }

  .audio-controls {
    min-width: 0;
    gap: 0.4rem;
    flex-wrap: wrap;
    align-items: center;
  }

  .audio-play-btn {
    width: 46px;
    height: 46px;
    min-width: 46px;
    min-height: 46px;
    order: 1;
  }

  .audio-seek-btn {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
  }

  .audio-seek-back-btn {
    order: 0;
  }

  .audio-seek-fwd-btn {
    order: 2;
  }

  .audio-speed-btn {
    order: 3;
  }

  .audio-time-current {
    order: 10;
    font-size: 0.85rem;
    min-width: 2.25rem;
  }

  .audio-progress-wrap {
    order: 11;
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    min-height: 44px;
  }

  .audio-time-duration {
    order: 12;
    font-size: 0.85rem;
    min-width: 2.25rem;
  }

  .audio-progress {
    height: 16px;
  }

  .audio-progress-wrap:hover .audio-progress {
    height: 16px;
  }

  .audio-progress::-webkit-slider-runnable-track {
    height: 16px;
    border-radius: 8px;
  }

  .audio-progress::-moz-range-track {
    height: 16px;
    border-radius: 8px;
  }

  .audio-progress::-webkit-slider-thumb {
    width: 28px;
    height: 28px;
  }

  .audio-progress::-moz-range-thumb {
    width: 28px;
    height: 28px;
  }

  .ruku-table .col-surah-arabic {
    font-size: 1rem;
  }

  .modal-content {
    margin: 0.5rem;
    max-height: 88vh;
    border-radius: 12px;
  }
}

/* Very small phones */
@media (max-width: 380px) {
  .header h1 {
    font-size: 1.2rem;
  }

  .ruku-table tbody tr {
    padding: 0.75rem;
  }

  .ruku-table tbody td {
    padding: 0.4rem 0;
  }

  .ruku-table {
    font-size: 0.85rem;
  }
}

/* Settings modal */
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0.75rem 1.25rem;
}

.settings-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
}

.settings-row:last-child {
  border-bottom: none;
}

.settings-row label {
  font-weight: 500;
  font-size: 0.9rem;
}

.settings-role-group {
  display: flex;
  gap: 0.5rem;
}

.settings-role-btn {
  flex: 1;
  padding: 0.5rem 1rem;
  border: 2px solid var(--border);
  background: var(--row-white);
  color: var(--text-primary);
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s;
}

.settings-role-btn:hover {
  border-color: var(--teal-accent);
}

.settings-role-btn.active {
  background: var(--teal-accent);
  color: white;
  border-color: var(--teal-accent);
}

.settings-role-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--row-gray);
  color: var(--text-muted);
  align-self: flex-start;
}

.settings-role-badge.admin {
  background: #e8f5f5;
  color: var(--teal-accent);
}

.settings-admin-section input[type="password"] {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 1rem;
}

.settings-admin-section input[type="password"]:focus {
  outline: none;
  border-color: var(--teal-accent);
  box-shadow: 0 0 0 2px rgba(15, 122, 122, 0.2);
}

.settings-section-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.settings-toggle-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  user-select: none;
}

.settings-toggle-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.settings-toggle-switch {
  flex-shrink: 0;
  width: 40px;
  height: 22px;
  background: #ccc;
  border-radius: 11px;
  position: relative;
  transition: background 0.2s;
}

.settings-toggle-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.2s;
}

.settings-toggle-label input:checked + .settings-toggle-switch {
  background: var(--teal-accent);
}

.settings-toggle-label input:checked + .settings-toggle-switch::after {
  transform: translateX(18px);
}

.settings-playback-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}

.settings-speed-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.settings-speed-select {
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 0.85rem;
  cursor: pointer;
}

.toolbar-volume-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.toolbar-volume-icon {
  font-size: 1rem;
  line-height: 1;
  opacity: 0.85;
  user-select: none;
}

.toolbar-volume-range {
  width: 5.5rem;
  max-width: 28vw;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: #dde4e4;
  border-radius: 3px;
  cursor: pointer;
}

.toolbar-volume-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: white;
  border: 2px solid var(--teal-accent);
  box-shadow: 0 1px 4px rgba(13, 79, 79, 0.3);
  cursor: pointer;
}

.toolbar-volume-range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: white;
  border: 2px solid var(--teal-accent);
  box-shadow: 0 1px 4px rgba(13, 79, 79, 0.3);
  cursor: pointer;
}

.toolbar-volume-range::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 3px;
  background: #dde4e4;
}

.toolbar-volume-range::-moz-range-track {
  height: 4px;
  border-radius: 3px;
  background: #dde4e4;
}

.settings-volume-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.settings-volume-range {
  flex: 1;
  min-width: 140px;
  max-width: 260px;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: #dde4e4;
  border-radius: 3px;
  cursor: pointer;
}

.settings-volume-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  border: 2px solid var(--teal-accent);
  box-shadow: 0 1px 6px rgba(13, 79, 79, 0.35);
}

.settings-volume-range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  border: 2px solid var(--teal-accent);
  box-shadow: 0 1px 6px rgba(13, 79, 79, 0.35);
}

.settings-volume-range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: #dde4e4;
}

.settings-volume-range::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: #dde4e4;
}

.settings-volume-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--teal-accent);
  min-width: 2.75rem;
}

.settings-download-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.download-all-status {
  font-size: 0.85rem;
  color: var(--teal-accent);
  font-weight: 600;
}

.settings-actions {
  margin-top: 0;
  padding: 0.85rem 1.25rem;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  border-top: 1px solid var(--border);
  background: var(--row-gray);
  border-radius: 0 0 12px 12px;
}

.settings-actions .btn {
  min-height: 44px;
  min-width: 80px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
