@import url("https://fonts.googleapis.com/css2?family=Amiri+Quran&family=Noto+Naskh+Arabic:wght@400;500;600;700&display=swap");

/* ========== VARIABLES & THEME ========== */
:root {
  --primary: #1A3A6B;
  --primary-2: #283f78;
  --primary-3: #42559a;
  --accent: #FFCA1A;
  --accent-2: #F7D64A;
  --bg: #0d1422;
  --bg-soft: #111a2b;
  --surface: #151f31;
  --surface-2: #1b2740;
  --surface-3: #24365e;
  --line: #2d3a51;
  --text: #f4f7ff;
  --text-soft: #dce6ff;
  --muted: #b5c2df;
  --danger: #ffcc66;
  --shadow: 0 18px 45px rgba(0,0,0,.28);
  --radius: 28px;
  --arabic-size: 42px;
  --pct: 0%;
  --font-arabic: "Amiri Quran","Noto Naskh Arabic","Traditional Arabic","Scheherazade New",serif;
}

[data-theme="light"] {
  --primary: #1e3a6e;
  --primary-2: #2952a3;
  --primary-3: #3b6fd4;
  --accent: #9a6f00;
  --accent-2: #b8870c;
  --bg: #e8e2d6;
  --bg-soft: #f0ece3;
  --surface: #f7f4ee;
  --surface-2: #ede9e0;
  --surface-3: #e2ddd3;
  --line: #cdc8be;
  --text: #18181b;
  --text-soft: #44475a;
  --muted: #6b7280;
  --danger: #92400e;
  --shadow: 0 4px 24px rgba(30,58,110,.10);
}

/* ========== GLOBAL & RESET ========== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: linear-gradient(180deg, #0b1220 0%, #101a2d 100%);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
}
button, input, select { font: inherit; }
input, select { font-weight: 400; }
input::placeholder { font-weight: 400; }
select option { font-weight: 400; }
[data-theme="light"] body { background: #e8e2d6; }

/* ========== MOBILE-FIRST BASE STYLES ========== */
.app-shell { width: 100%; margin: 0 auto; padding: 0 12px 120px; }

.app-header {
  background: linear-gradient(135deg, var(--primary), #263b72);
  border-radius: 0 0 28px 28px;
  padding: 22px 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: stretch;
  position: relative;
}

.brand-block {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex-direction: column;
}

.brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 22px;
  background: rgba(255,255,255,.08) url("../assets/logo.png") center/cover no-repeat;
  color: transparent;
  display: grid;
  place-items: center;
  font-size: 0;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(5, 11, 26, .22);
  overflow: hidden;
}

.brand-kicker, .eyebrow {
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--accent);
  font-weight: 900;
  margin: 0 0 6px;
}

.brand-block h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.1;
}

.prayer-strip {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 20px;
  background: rgba(255,255,255,.08);
}

.prayer-strip > div {
  background: rgba(255,255,255,.08);
  border-radius: 16px;
  padding: 12px 14px;
}

.muted-light { display: block; color: var(--text-soft); opacity: .86; font-size: .90rem; }
.prayer-strip strong { display: block; font-size: 1.15rem; line-height: 1.3; }
.accent, .countdown { color: var(--accent) !important; }

.icon-button {
  border: 0;
  background: rgba(255,255,255,.11);
  color: var(--text);
  width: 28px;
  height: 28px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
}
.icon-button:hover { background: rgba(255,255,255,.2); }
.location-cell strong { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.tab-nav { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 16px 0 24px; }

.nav-pill {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #1b2538, #151d2c);
  color: var(--text-soft);
  font-weight: 900;
  border-radius: 999px;
  padding: 12px 18px;
  min-height: 48px;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.03);
  transition: .2s;
}
.nav-pill:hover, .nav-pill.active {
  background: linear-gradient(180deg, var(--primary-3), var(--primary-2));
  color: #fff;
  border-color: #6878b6;
}
.nav-pill.emphasis { background: var(--accent); color: #0b1732; border-color: var(--accent); }

[hidden] { display: none !important; }
.view { display: none; }
.view.active { display: block; }

.hero-card, .reader-card, .info-card, .stat-card, .auth-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  border-radius: 24px;
}

.stat-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
}

.stat-card span {
  display: block;
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  line-height: 1;
  font-weight: 1000;
  letter-spacing: -.03em;
}

.stat-card small {
  display: block;
  margin: 0;
  color: var(--text-soft);
  font-size: 1rem;
  line-height: 1.5;
}

.hero-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.hero-copy h2, .section-heading h2, .auth-card h2 { font-size: 32px; line-height: 1.08; margin: 0 0 16px; }
.hero-copy p { color: var(--text-soft); font-size: 1rem; }
.hero-actions, .action-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }

.sticky-actions {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 14px 12px;
  background: rgba(13, 20, 34, .96);
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 20px rgba(0,0,0,.3);
  backdrop-filter: blur(12px);
  z-index: 100;
  gap: 10px;
  flex-wrap: wrap;
}

.hafalan-sticky-actions {
  justify-content: center;
  align-items: center;
  gap: 16px;
}

.reader-action-btn {
  width: 72px;
  height: 72px;
  min-width: 72px;
  min-height: 72px;
  flex: 0 0 72px;
  aspect-ratio: 1 / 1;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1.45rem;
  line-height: 1;
  box-shadow: 0 12px 24px rgba(5, 11, 26, .16);
}

.reader-action-btn span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

#stopSequence:not(:disabled) {
  background: linear-gradient(135deg, #f07a58, #b84e29);
  color: #fff8f1;
}

#stopSequence:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(184, 78, 41, .22);
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 15px 24px;
  font-weight: 900;
  cursor: pointer;
  min-height: 52px;
  transition: .2s;
}
.btn.primary, .btn.secondary:hover { background: var(--accent); color: #0b1732; }
.btn.secondary { background: var(--primary-3); color: #fff; }
.btn.ghost { background: #1c2942; color: var(--text-soft); border: 1px solid var(--line); }
.btn.warning { background: #744a26; color: #ffe7bc; }
.btn:disabled { opacity: .58; cursor: not-allowed; }

.hero-progress {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 18px;
  background: var(--surface-2);
  border-radius: 24px;
}

.progress-ring {
  width: 140px;
  height: 140px;
  border-radius: 999px;
  background: conic-gradient(var(--accent) var(--pct), #2c3a56 0);
  display: grid;
  place-items: center;
}

.progress-ring span {
  width: 110px;
  height: 110px;
  background: var(--surface);
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 1000;
}

.section-heading {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
  margin: 16px 0 24px;
}
.section-heading h2 { font-size: 32px; }

.control-panel { display: grid; grid-template-columns: 1fr; gap: 16px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; }
.control-panel.compact { padding: 18px; }
.cards-4 { display: grid; grid-template-columns: 1fr; gap: 14px; }

.hafalan-controls {
  gap: 14px;
  padding: 18px;
}

.hafalan-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  color: var(--text);
  font-size: .98rem;
  font-weight: 800;
  min-width: 0;
}

.hafalan-field select {
  margin-top: 0;
  min-height: 56px;
  border-radius: 18px;
  width: 100%;
}

.hafalan-field-small select {
  min-width: 0;
}

.reader-card, .info-card, .auth-card { padding: 22px; border-radius: 24px; }

.auth-view {
  max-width: 860px;
  margin: 0 auto;
}

.auth-card {
  padding: 26px;
}

.auth-card h2 {
  max-width: 14ch;
  font-size: clamp(2rem, 8vw, 2.8rem);
  letter-spacing: -.03em;
}

.stack-form.auth-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 22px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.auth-form label {
  margin: 0;
  color: var(--text);
  font-size: .96rem;
  font-weight: 800;
  letter-spacing: .01em;
}

.auth-form input {
  width: 100%;
  margin-top: 0;
  min-height: 54px;
  border-radius: 18px;
}

.audio-reciter-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  color: var(--text);
  font-size: .96rem;
  font-weight: 800;
}

.audio-reciter-field select {
  width: 100%;
  min-height: 56px;
  margin-top: 0;
  padding: 0 56px 0 18px;
  border-radius: 18px;
  border: 1px solid rgba(108, 126, 178, .42);
  background: linear-gradient(180deg, rgba(33, 46, 74, .96), rgba(19, 28, 45, .98));
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image:
    linear-gradient(180deg, rgba(33, 46, 74, .96), rgba(19, 28, 45, .98)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23f4f7ff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat;
  background-position: 0 0, right 18px center;
  background-size: auto, 18px;
}

.audio-reciter-field select:hover,
.audio-reciter-field select:focus-visible {
  border-color: rgba(122, 143, 204, .78);
  box-shadow: 0 0 0 4px rgba(83, 113, 214, .18);
  outline: none;
}

.audio-reciter-field select option {
  color: #111827;
}

.field-help {
  color: var(--text-soft);
  font-size: .88rem;
  line-height: 1.6;
  font-weight: 500;
}

.captcha-box {
  display: grid;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(39, 53, 86, .95), rgba(23, 34, 56, .95));
  border: 1px solid rgba(108, 126, 178, .28);
}

.captcha-copy {
  margin: 0;
  color: var(--text-soft);
  font-size: .95rem;
  line-height: 1.55;
}

.captcha-question-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.captcha-question-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.07);
  color: var(--text-soft);
  font-size: .82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.captcha-question {
  color: var(--accent);
  font-weight: 1000;
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.4;
}

.auth-actions {
  margin-top: 8px;
  gap: 12px;
}

.auth-actions .btn {
  width: 100%;
}

.auth-actions .btn.ghost {
  min-height: 50px;
}

.form-help {
  margin: 18px 0 0;
  color: var(--text-soft);
  line-height: 1.7;
}

.link-button {
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent);
  font-weight: 900;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.link-button:hover,
.link-button:focus-visible {
  color: #ffe9a0;
}

.link-button:focus-visible {
  outline: 2px solid rgba(255,214,77,.45);
  outline-offset: 4px;
  border-radius: 6px;
}

.app-shell[data-current-view="login"] .app-header,
.app-shell[data-current-view="register"] .app-header {
  padding: 18px 18px 20px;
  gap: 12px;
  border-radius: 0 0 24px 24px;
}

.app-shell[data-current-view="login"] .brand-block,
.app-shell[data-current-view="register"] .brand-block {
  gap: 10px;
}

.app-shell[data-current-view="login"] .brand-mark,
.app-shell[data-current-view="register"] .brand-mark {
  width: 50px;
  height: 50px;
  border-radius: 18px;
  font-size: 0;
}

.app-shell[data-current-view="login"] .brand-block h1,
.app-shell[data-current-view="register"] .brand-block h1 {
  font-size: 22px;
}

.app-shell[data-current-view="login"] .prayer-strip,
.app-shell[data-current-view="register"] .prayer-strip {
  gap: 10px;
  padding: 10px;
  border-radius: 18px;
}

.app-shell[data-current-view="login"] .prayer-strip > div,
.app-shell[data-current-view="register"] .prayer-strip > div {
  padding: 10px 12px;
  border-radius: 14px;
}

.app-shell[data-current-view="login"] .tab-nav,
.app-shell[data-current-view="register"] .tab-nav {
  padding: 14px 0 18px;
}

.app-shell[data-current-view="login"] .nav-pill,
.app-shell[data-current-view="register"] .nav-pill {
  min-height: 46px;
  padding: 10px 18px;
}

.ayah-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
  scroll-margin-top: 120px;
  transition: border-color .22s ease, box-shadow .22s ease, transform .22s ease, background .22s ease;
}

.ayah-card.is-audio-active {
  border-color: rgba(255, 214, 77, .62);
  background: linear-gradient(180deg, rgba(43, 54, 80, .98), rgba(29, 38, 58, .98));
  box-shadow: 0 18px 42px rgba(255, 214, 77, .12);
  transform: translateY(-1px);
}

.ayah-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.ayah-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ayah-index-badge,
.ayah-juz-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  background: rgba(255, 214, 77, .1);
  border: 1px solid rgba(255, 214, 77, .14);
  color: #f6d66d;
  font-weight: 900;
}

.ayah-card.is-audio-active .ayah-index-badge,
.ayah-card.is-audio-active .ayah-juz-badge {
  box-shadow: 0 0 0 3px rgba(255, 214, 77, .14);
}

.ayah-index-badge {
  min-width: 46px;
  padding-inline: 0;
  font-size: 1.15rem;
}

.ayah-copy-meta {
  color: var(--text-soft);
  font-size: .98rem;
  line-height: 1.6;
  margin-bottom: 10px;
}

.arabic-block {
  padding: 6px 0 18px;
  border-bottom: 1px dashed rgba(255,255,255,.14);
  margin-bottom: 18px;
  display: grid;
  justify-items: center;
  text-align: center;
}
.first-word-prompt {
  display: inline-flex;
  flex-direction: row;
  align-items: baseline;
  gap: .18em;
  direction: rtl;
}
.first-word-text {
  font-weight: 950;
  letter-spacing: 0;
}
.first-word-dots {
  opacity: .5;
  font-weight: 700;
  letter-spacing: .04em;
  font-size: .62em;
}

.translation {
  margin: 0 auto;
  max-width: 72ch;
  text-align: center;
  color: var(--text);
  font-size: clamp(1rem, 1.8vw, 1.08rem);
  line-height: 1.8;
}

.review-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: flex-start;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 14px;
  margin-bottom: 12px;
}

.review-toolbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  width: 100%;
}

.review-toolbar .btn {
  width: 100%;
}

.review-summary-card {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.review-summary-card h3,
.review-compact-copy strong {
  margin: 0;
}

.review-summary-card p,
.review-compact-copy p {
  margin: 0;
  color: var(--text-soft);
}

.review-summary-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.review-summary-actions,
.review-compact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.review-compact-card {
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
}

.review-compact-copy {
  display: grid;
  gap: 6px;
}

.review-compact-actions .btn {
  min-height: 46px;
  padding: 12px 18px;
}

.review-delete-button {
  width: 40px;
  height: 40px;
  font-size: 1.35rem;
  line-height: 1;
}

.submission-history-card {
  gap: 16px;
  padding: 18px;
  border-radius: 26px;
}

.submission-history-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.submission-history-copy strong {
  display: block;
  font-size: clamp(1.25rem, 2.6vw, 1.55rem);
  line-height: 1.2;
  letter-spacing: -.02em;
}

.submission-history-copy p {
  margin: 0;
  color: var(--text-soft);
  font-size: clamp(.96rem, 2vw, 1.05rem);
  line-height: 1.65;
}

.submission-grade-panel {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
}

.submission-grade-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.submission-grade-top strong {
  font-size: .98rem;
  letter-spacing: -.01em;
}

.submission-grade-note,
.submission-grade-time {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.6;
}

.submission-grade-time {
  font-size: .88rem;
  opacity: .82;
}

.submission-history-media {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: center;
}

.submission-history-audio {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.submission-history-empty {
  margin: 0;
  color: var(--text-soft);
  font-size: .95rem;
  line-height: 1.6;
}

.submission-history-delete {
  width: 48px;
  height: 48px;
  justify-self: end;
  flex-shrink: 0;
  font-size: 1.1rem;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
}

.submission-history-delete:hover {
  background: rgba(255,255,255,.16);
}

.toast { width: calc(100% - 28px); text-align: center; }

.surah-title {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 14px;
  background: linear-gradient(135deg, var(--primary), #263b72);
  border-radius: 16px;
  color: #fff;
}
.surah-title-side {
  display: grid;
  gap: 8px;
  justify-items: end;
}
.surah-page-range {
  margin: 0;
  color: rgba(255,255,255,.82);
  font-size: .95rem;
  text-align: right;
}
.mushaf-pojok-stack {
  display: grid;
  gap: 18px;
  margin-top: 16px;
}
.mushaf-page-shell {
  padding: 16px;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.015));
  border: 1px solid rgba(255,255,255,.08);
}
.mushaf-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.mushaf-page-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.mushaf-page-count {
  color: var(--text-soft);
  font-size: .92rem;
}
.mushaf-page-sheet {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 24px;
  background: #f6f0db;
  color: #22411d;
  border: 1px solid rgba(183, 156, 76, .26);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72);
}
.mushaf-ayah-card {
  margin-bottom: 0;
  border-radius: 20px;
  padding: 16px 18px;
  background: rgba(255,255,255,.58);
  border-color: rgba(161, 142, 86, .18);
  box-shadow: none;
}
.mushaf-ayah-card.is-audio-active {
  background: #fff7d8;
  border-color: rgba(188, 148, 32, .55);
  box-shadow: 0 14px 30px rgba(140, 108, 18, .14);
}
.mushaf-ayah-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.mushaf-arabic-block {
  border-bottom-color: rgba(34,65,29,.14);
  margin-bottom: 14px;
  color: #22411d;
}
.mushaf-translation {
  max-width: 80ch;
  color: #314129;
}
.mushaf-footnote {
  background: rgba(255,255,255,.56);
  border-color: rgba(161, 142, 86, .2);
}

.journey-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 18px;
}

.journey-card article {
  background: #121c30;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
}

.journey-card h3 { margin: 14px 0 10px; font-size: 1.2rem; }
.journey-card p { margin: 0; color: var(--text-soft); font-size: 1rem; }

.journey-step {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--accent);
  color: #0b1732;
  font-weight: 1000;
}

.arabic, .surah-name {
  font-family: var(--font-arabic) !important;
  font-weight: 400;
  letter-spacing: 0;
  word-spacing: 0;
  line-height: 2.2;
  text-rendering: optimizeLegibility;
}

.arabic { font-size: calc(var(--arabic-size) - 6px); }

.status-badges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.status-badge { font-weight: 700; padding: 8px 14px; border-radius: 999px; }
.status-belum { background: rgba(186, 73, 99, .12); color: #ff97ab; border: 1px solid rgba(186, 73, 99, .3); }
.status-hafal { background: rgba(46, 122, 75, .16); color: #99f0b8; border: 1px solid rgba(46, 122, 75, .34); }
.status-sulit { background: rgba(141, 100, 48, .16); color: #ffd27a; border: 1px solid rgba(141, 100, 48, .34); }

.theme-toggle {
  position: absolute;
  top: 14px;
  right: 14px;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.13);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: background .2s, transform .2s, box-shadow .2s;
  z-index: 2;
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
  padding: 0;
}

.theme-toggle:hover { background: rgba(255,255,255,.24); transform: rotate(18deg) scale(1.08); box-shadow: 0 6px 24px rgba(0,0,0,.28); }
.theme-toggle:active { transform: rotate(360deg) scale(.95); transition: transform .35s cubic-bezier(.4,2,.6,1); }

#themeToggleIcon { display: flex; align-items: center; justify-content: center; line-height: 1; }

.record-preview-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 14px;
  background: var(--surface-2);
  border-radius: 20px;
  border: 1px solid var(--line);
}

.record-preview-row audio { flex: 1; min-width: 0; max-width: 100%; }
.record-discard-btn { color: #ff8f9d !important; border-color: #7f3244 !important; white-space: nowrap; flex-shrink: 0; }
.record-discard-btn:hover { background: #3a1d28 !important; }

.recording-indicator {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(186, 73, 99, .12);
  border: 1px solid rgba(186, 73, 99, .28);
  color: #ffb3c0;
}

.recording-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #ff5f7c;
  box-shadow: 0 0 0 0 rgba(255, 95, 124, .55);
  animation: recording-pulse 1.4s ease-out infinite;
}

.recording-timer {
  color: #fff;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  letter-spacing: .04em;
}

@keyframes recording-pulse {
  0% { transform: scale(.95); box-shadow: 0 0 0 0 rgba(255, 95, 124, .52); }
  70% { transform: scale(1); box-shadow: 0 0 0 12px rgba(255, 95, 124, 0); }
  100% { transform: scale(.95); box-shadow: 0 0 0 0 rgba(255, 95, 124, 0); }
}

.setoran-card {
  display: grid;
  gap: 18px;
}

.setoran-copy {
  display: grid;
  gap: 10px;
}

.setoran-lead {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.75;
}

.setoran-note {
  margin: 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 214, 77, .08);
  border: 1px solid rgba(255, 214, 77, .16);
  color: var(--text-soft);
  line-height: 1.65;
}

.setoran-fields {
  gap: 14px;
  padding: 16px;
  border-radius: 22px;
}

.setoran-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  color: var(--text);
  font-size: .96rem;
  font-weight: 800;
}

.setoran-field input,
.setoran-field select {
  margin-top: 0;
  min-height: 56px;
  border-radius: 18px;
}

.setoran-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.setoran-actions .btn {
  width: 100%;
  min-height: 62px;
  justify-content: center;
  padding: 16px 22px;
  font-size: clamp(1rem, 2.4vw, 1.1rem);
  letter-spacing: -.01em;
  box-shadow: 0 14px 30px rgba(5, 11, 26, .18);
}

#startRecord,
#stopRecord,
#discardRecord {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

#startRecord {
  background: linear-gradient(135deg, #ffd84f, #ffbf1f);
  color: #0b1732;
}

#startRecord:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(255, 191, 31, .22);
}

#stopRecord {
  background: linear-gradient(135deg, #6d5238, #5a4331);
  color: #f3dfc5;
}

#stopRecord:not(:disabled) {
  background: linear-gradient(135deg, #c96b38, #9f4d1f);
  color: #fff4e8;
}

#stopRecord:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(201, 107, 56, .18);
}

.recording-indicator {
  width: 100%;
  min-height: 54px;
  justify-content: center;
  padding: 12px 16px;
  gap: 12px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(186, 73, 99, .16), rgba(132, 35, 62, .22));
}

.record-preview-row {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 14px;
  padding: 16px;
  border-radius: 22px;
}

.record-preview-row audio,
#recordPreview {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

#discardRecord {
  width: 100%;
  min-height: 56px;
  border-radius: 18px;
  box-shadow: none;
}

sup.fn-ref { font-size: .65em; vertical-align: super; line-height: 0; color: var(--accent); font-weight: 600; letter-spacing: 0; margin-left: 1px; }

/* ===== PANEL GURU (MOBILE) ===== */
.guru-nav-pill {
  background: linear-gradient(135deg, #1a4a2e, #1f6038) !important;
  color: #7fffa8 !important;
  border-color: #2d7a4a !important;
}

.guru-nav-pill:hover, .guru-nav-pill.active {
  background: linear-gradient(135deg, #236636, #2a8048) !important;
  color: #fff !important;
  border-color: #3a9a5c !important;
}

.guru-stats { grid-template-columns: 1fr; margin-bottom: 20px; }
.filter-tabs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.filter-tab {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-soft);
  border-radius: 999px;
  padding: 10px 22px;
  font-weight: 700;
  cursor: pointer;
  transition: .18s;
  font-size: .97rem;
}
.filter-tab:hover { background: var(--surface-3); }
.filter-tab.active { background: linear-gradient(135deg, #1a4a2e, #236636); color: #7fffa8; border-color: #2d7a4a; }

.guru-submission-list { display: grid; gap: 18px; }
.submission-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 24px;
  display: grid;
  gap: 14px;
}

.submission-card-header { display: flex; flex-direction: column; gap: 12px; }
.submission-card-meta { display: flex; flex-direction: column; gap: 5px; }
.submission-card-meta strong { font-size: 1.08rem; }
.submission-card-meta span { color: var(--text-soft); font-size: .93rem; }
.submission-card-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; width: 100%; }

.admin-user-list {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.admin-user-search {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  color: var(--text);
  font-size: .95rem;
  font-weight: 800;
}

.admin-tools {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.admin-tools .btn {
  width: 100%;
  justify-content: center;
}

.admin-user-search input {
  margin-top: 0;
  min-height: 52px;
  border-radius: 18px;
}

.admin-user-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.admin-user-head {
  display: grid;
  gap: 8px;
}

.admin-user-head strong { font-size: 1rem; }
.admin-user-meta { color: var(--text-soft); font-size: .93rem; }

.admin-user-role-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-user-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-user-actions .btn {
  min-height: 46px;
  padding-inline: 18px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: .88rem;
  font-weight: 600;
  border: 1px solid transparent;
}
.status-chip.pending { background: #2b2a1a; color: #ffd27a; border-color: #6b5a1a; }
.status-chip.disetujui { background: #183828; color: #8df0b2; border-color: #2f7a4b; }
.status-chip.perlu-ulang { background: #1a2b4a; color: #7ab8ff; border-color: #2a4a8a; }
.status-chip.ditolak { background: #3a1d28; color: #ff8f9d; border-color: #7f3244; }

.grade-panel { background: var(--surface-2); border-radius: 16px; padding: 16px; font-size: .97rem; color: var(--text-soft); }
.grade-panel strong { color: var(--text); display: block; margin-bottom: 4px; }
.grade-summary { display: flex; align-items: flex-start; gap: 16px; }
.grade-summary-copy { min-width: 0; display: grid; gap: 6px; }
.grade-summary-note {
  margin: 0;
  color: var(--text);
  line-height: 1.55;
}
.grade-summary-time {
  font-size: .85rem;
  opacity: .72;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 20px 14px;
  background: rgba(6, 10, 18, .72);
  backdrop-filter: blur(8px);
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal-card {
  width: min(100%, 760px);
  max-height: min(88vh, 920px);
  overflow: auto;
  padding: 22px;
  border-radius: 28px;
  background: linear-gradient(180deg, #1f2740, #171f33);
  border: 1px solid rgba(113, 129, 174, .24);
  box-shadow: 0 28px 80px rgba(0,0,0,.38);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.modal-head h3 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 1.9rem);
}

.grade-modal-card {
  display: grid;
  gap: 16px;
}

.location-modal-card {
  display: grid;
  gap: 16px;
}

.location-modal-copy .form-help {
  margin: 0;
}

.location-modal-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.location-modal-actions .btn {
  width: 100%;
  min-height: 56px;
  justify-content: center;
}

.grade-info {
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.03));
  border-radius: 20px;
  padding: 16px 18px;
  color: var(--text-soft);
  font-size: .97rem;
  margin-bottom: 0;
  border: 1px solid rgba(113, 129, 174, .18);
}

.grade-info strong {
  display: block;
  color: var(--text);
  margin-bottom: 6px;
  font-size: 1.08rem;
}

.grade-form-grid {
  display: grid;
  gap: 16px;
}

.grade-form-grid > label,
.grade-field {
  display: grid;
  gap: 10px;
  color: var(--text);
  font-size: .97rem;
  font-weight: 800;
}

.grade-form-grid input,
.grade-form-grid select,
.grade-form-grid textarea {
  width: 100%;
  margin-top: 0;
  min-height: 56px;
  border-radius: 18px;
}

.grade-form-grid input,
.grade-form-grid select {
  padding-inline: 16px;
}

.grade-form-grid textarea {
  min-height: 150px;
  resize: vertical;
  padding: 16px 18px;
  line-height: 1.7;
}

.grade-modal-actions {
  margin-top: 4px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.grade-modal-actions .btn {
  width: 100%;
  min-height: 56px;
  justify-content: center;
}

#gpsStatus {
  margin: 0;
  min-height: 56px;
  display: grid;
  align-items: center;
  border-radius: 18px;
  line-height: 1.6;
}

.grade-score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: var(--accent);
  color: #0b1732;
  font-size: 1.3rem;
  font-weight: 1000;
  flex-shrink: 0;
}
.grade-score-badge.low { background: #744a26; color: #ffe7bc; }
.grade-score-badge.mid { background: #2a5a8a; color: #cce4ff; }

.grade-row { display: flex; align-items: center; gap: 14px; }
textarea {
  width: 100%;
  margin-top: 8px;
  border: 1px solid #455068;
  background: #0f1726;
  color: #fff;
  border-radius: 18px;
  padding: 14px 16px;
  outline: none;
  resize: vertical;
  font: inherit;
  line-height: 1.6;
}

textarea:focus { border-color: #6679c0; box-shadow: 0 0 0 4px rgba(102,121,192,.18); }

/* ========== LIGHT THEME - MOBILE ========== */
[data-theme="light"] .app-header {
  background: linear-gradient(135deg, #162d56 0%, #1e3a6e 50%, #243f7a 100%) !important;
  box-shadow: 0 6px 28px rgba(20,40,90,.28) !important;
}
[data-theme="light"] .brand-kicker, [data-theme="light"] .eyebrow { color: #f4c842 !important; }
[data-theme="light"] .brand-block h1 { color: #fff !important; }
[data-theme="light"] .brand-mark {
  background: rgba(255,255,255,.72) url("../assets/logo.png") center/cover no-repeat !important;
  color: transparent !important;
}
[data-theme="light"] .muted-light { color: rgba(255,255,255,.72) !important; }
[data-theme="light"] .prayer-strip { border-color: rgba(255,255,255,.18) !important; background: rgba(255,255,255,.09) !important; }
[data-theme="light"] .prayer-strip > div { background: rgba(255,255,255,.11) !important; }
[data-theme="light"] .prayer-strip strong { color: #fff !important; }
[data-theme="light"] .countdown { color: #f4c842 !important; }
[data-theme="light"] .icon-button { background: rgba(255,255,255,.18) !important; color: #fff !important; }
[data-theme="light"] .icon-button:hover { background: rgba(255,255,255,.28) !important; }

[data-theme="light"] .tab-nav { border-bottom: 1px solid var(--line); padding-bottom: 18px; }
[data-theme="light"] .nav-pill { background: #f0ece3; color: #44475a; border-color: #cdc8be; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
[data-theme="light"] .nav-pill:hover { background: #e6e1d8; color: #18181b; border-color: #b0a898; }
[data-theme="light"] .nav-pill.active { background: #1e3a6e !important; color: #fff !important; border-color: #1e3a6e !important; box-shadow: 0 4px 14px rgba(30,58,110,.28) !important; }

[data-theme="light"] .btn.primary { background: #9a6f00; color: #fff; }
[data-theme="light"] .btn.primary:hover { background: #7d5a00; color: #fff; }
[data-theme="light"] .btn.secondary { background: #1e3a6e; color: #fff; }
[data-theme="light"] .btn.secondary:hover { background: #9a6f00; color: #fff; }
[data-theme="light"] .btn.ghost { background: #f0ece3; color: #18181b; border: 1px solid #cdc8be; }
[data-theme="light"] .btn.ghost:hover { background: #e6e1d8; }
[data-theme="light"] .btn.warning { background: #b45309; color: #fff; }
[data-theme="light"] #stopSequence:not(:disabled) { background: linear-gradient(135deg, #d85b35, #b6441d); color: #fff8f1; }

[data-theme="light"] input, [data-theme="light"] select, [data-theme="light"] textarea {
  background: #f7f4ee;
  color: #18181b;
  border-color: #c0bab0;
}
[data-theme="light"] input:focus, [data-theme="light"] select:focus, [data-theme="light"] textarea:focus {
  border-color: #3b6fd4;
  box-shadow: 0 0 0 3px rgba(59,111,212,.15);
}
[data-theme="light"] select option { background: #f7f4ee; color: #18181b; }
[data-theme="light"] label { color: #44475a; }
[data-theme="light"] .captcha-box {
  background: linear-gradient(180deg, #eef2ff, #e3e9f8);
  border-color: #cdd7ef;
}
[data-theme="light"] .captcha-copy,
[data-theme="light"] .captcha-question-label { color: #4a5a7c; }
[data-theme="light"] .captcha-question-label { background: rgba(59,111,212,.08); }

[data-theme="light"] .hero-card, [data-theme="light"] .reader-card, [data-theme="light"] .info-card,
[data-theme="light"] .stat-card, [data-theme="light"] .auth-card {
  background: #f7f4ee;
  border-color: #cdc8be;
  box-shadow: 0 2px 12px rgba(30,58,110,.08);
}
[data-theme="light"] .hero-progress { background: #ede9e0; }
[data-theme="light"] .progress-ring { background: conic-gradient(var(--accent) var(--pct), #cdc8be 0); }
[data-theme="light"] .ayah-card { background: #fffdf9; border-color: #d8d2c4; box-shadow: 0 6px 18px rgba(82, 70, 39, .06); }
[data-theme="light"] .ayah-index-badge,
[data-theme="light"] .ayah-juz-badge { background: #f6edcf; border-color: #ead9a7; color: #365126; }
[data-theme="light"] .ayah-copy-meta { color: #5f654f; }
[data-theme="light"] .arabic-block { border-bottom-color: #d8d6c8; }
[data-theme="light"] .surah-title { background: linear-gradient(135deg, #162d56, #1e3a6e); }
[data-theme="light"] .badge { background: #ddd9f0; color: #1e3a6e; }
[data-theme="light"] .arabic { color: #18181b; }
[data-theme="light"] .hidden-placeholder, [data-theme="light"] .footnote { background: #ede9e0; border-color: #cdc8be; }
[data-theme="light"] .journey-card article { background: #f7f4ee; border-color: #cdc8be; box-shadow: 0 1px 4px rgba(30,58,110,.07); }
[data-theme="light"] .journey-step { background: #9a6f00; color: #fff; }
[data-theme="light"] .journey-card article h3 { color: #18181b; }
[data-theme="light"] .journey-card article p { color: #44475a; }

[data-theme="light"] .sticky-actions { background: rgba(232,226,214,.96); border-top-color: #cdc8be; box-shadow: 0 -4px 20px rgba(30,58,110,.15); }
[data-theme="light"] .modal-card { background: #f7f4ee; box-shadow: 0 8px 40px rgba(30,58,110,.18); border-color: #d7d1c4; }
[data-theme="light"] .modal-backdrop { background: rgba(57, 49, 34, .26); }
[data-theme="light"] .mini-log { background: #ede9e0; color: #44475a; }
[data-theme="light"] .review-item { background: #f7f4ee; border-color: #cdc8be; box-shadow: 0 1px 4px rgba(30,58,110,.06); }
[data-theme="light"] .control-panel { background: #f7f4ee; border-color: #cdc8be; box-shadow: 0 1px 6px rgba(30,58,110,.06); }
[data-theme="light"] .audio-reciter-field select {
  border-color: #cdc8be;
  background: linear-gradient(180deg, #ffffff, #f4efe7);
  background-image:
    linear-gradient(180deg, #ffffff, #f4efe7),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2318181b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  color: var(--text);
}
[data-theme="light"] .audio-reciter-field select option { color: #18181b; }
[data-theme="light"] .stat-card { background: #f7f4ee; border-color: #cdc8be; }
[data-theme="light"] .record-preview-row { background: var(--surface-2); border-color: var(--line); }
[data-theme="light"] .record-discard-btn { color: #92400e !important; border-color: #c8a070 !important; }
[data-theme="light"] .record-discard-btn:hover { background: #fef3e2 !important; }
[data-theme="light"] .theme-toggle { border-color: rgba(22,35,59,.18); background: rgba(255,255,255,.72); color: var(--text); box-shadow: 0 4px 14px rgba(42,72,120,.14); }
[data-theme="light"] .theme-toggle:hover { background: rgba(255,255,255,.95); }
[data-theme="light"] .ayah-card.is-audio-active {
  border-color: #dfc982;
  background: linear-gradient(180deg, #fffaf0, #f7f0df);
  box-shadow: 0 16px 34px rgba(188, 154, 60, .14);
}
[data-theme="light"] .submission-grade-panel {
  background: rgba(255,255,255,.86);
  border-color: #d9d1c3;
}
[data-theme="light"] .filter-tab { background: var(--surface-2); color: var(--text-soft); }
[data-theme="light"] .filter-tab.active { background: linear-gradient(135deg, #1a4a2e, #236636); color: #7fffa8; }
[data-theme="light"] .submission-card { background: var(--surface); }
[data-theme="light"] .admin-user-search input { background: #fff; }
[data-theme="light"] .admin-user-card { background: var(--surface-2); }
[data-theme="light"] .grade-panel, [data-theme="light"] .grade-info { background: var(--surface-2); }
[data-theme="light"] .setoran-note { background: #fdf3d8; border-color: #ecd6a0; color: #5f4b1d; }
[data-theme="light"] .recording-indicator { background: #ffe5ea; border-color: #f3b7c3; color: #a6324d; }
[data-theme="light"] .recording-timer { color: #6e1830; }
[data-theme="light"] textarea { background: #fff; color: var(--text); border-color: #c8d6ed; }

/* ========== TABLET BREAKPOINT (min-width: 641px) ========== */
@media (min-width: 641px) {
  .app-shell { padding: 20px 24px 140px; }

  .app-header {
    border-radius: 0 0 34px 34px;
    padding: 28px 34px;
    flex-direction: row;
    gap: 26px;
    align-items: center;
  }

  .brand-block {
    flex-direction: row;
    justify-content: flex-start;
    text-align: left;
    gap: 20px;
  }

  .brand-mark {
    width: 76px;
    height: 76px;
    border-radius: 28px;
    font-size: 0;
  }

  .brand-block h1 { font-size: clamp(28px, 4vw, 42px); }

  .prayer-strip {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    padding: 14px;
    border-radius: 28px;
  }

  .prayer-strip > div {
    border-radius: 20px;
    padding: 14px 16px;
  }

  .muted-light { font-size: .95rem; }
  .prayer-strip strong { font-size: 1.35rem; line-height: 1.35; }

  .icon-button { width: 32px; height: 32px; }
  .reader-action-btn { width: 78px; height: 78px; min-width: 78px; min-height: 78px; flex-basis: 78px; font-size: 1.6rem; }
  
  .tab-nav { gap: 14px; padding: 24px 0 34px; }

  .nav-pill { padding: 14px 26px; min-height: 56px; }

  .hero-card {
    grid-template-columns: minmax(0, 1.35fr) 300px;
    gap: 28px;
    padding: 34px;
  }

  .hero-copy h2, .section-heading h2, .auth-card h2 { font-size: clamp(34px, 5vw, 58px); }
  .hero-copy h2 { font-size: clamp(48px, 6.5vw, 78px); }
  .hero-copy p { font-size: 1.15rem; }

  .auth-card {
    padding: 34px;
  }

  .stack-form.auth-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-top: 28px;
  }

  .auth-field-full,
  .auth-actions {
    grid-column: 1 / -1;
  }

  .auth-actions .btn {
    width: auto;
    min-width: 168px;
  }

  .section-heading {
    flex-direction: row;
    align-items: center;
    gap: 18px;
    justify-content: space-between;
  }

  .review-toolbar {
    width: auto;
    grid-template-columns: repeat(2, auto);
    align-items: center;
  }

  .grade-form-grid {
    grid-template-columns: minmax(180px, .8fr) minmax(220px, 1fr);
    align-items: start;
  }

  .grade-field-notes {
    grid-column: 1 / -1;
  }

  .grade-modal-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .location-modal-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .review-compact-card {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .control-panel { grid-template-columns: repeat(2, 1fr); padding: 24px; gap: 18px; }
  .control-panel.compact { padding: 24px; }
  .hafalan-controls {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    align-items: end;
  }
  .hafalan-field-wide {
    grid-column: span 3;
  }
  .hafalan-field-small {
    grid-column: span 1;
  }
  .setoran-fields { grid-template-columns: minmax(240px, .95fr) minmax(0, 1.25fr); }
  .setoran-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .recording-indicator {
    width: fit-content;
    min-width: 280px;
  }

  .record-preview-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
  }

  #discardRecord {
    width: auto;
    min-width: 220px;
    padding-inline: 22px;
  }

  .cards-4 { grid-template-columns: repeat(2, 1fr); }

  .journey-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .progress-ring { width: 170px; height: 170px; }
  .progress-ring span { width: 132px; height: 132px; font-size: 32px; }

  .arabic { font-size: var(--arabic-size); }

  .surah-title { flex-direction: row; align-items: center; padding: 20px; }
  .ayah-card { padding: 24px 26px; }
  .ayah-top { margin-bottom: 16px; }

  .review-item {
    grid-template-columns: auto 1fr auto;
    gap: 18px;
    align-items: center;
    flex-direction: row;
  }

  .submission-history-card {
    grid-template-columns: minmax(0, .92fr) minmax(320px, 1.08fr);
    align-items: center;
    gap: 22px;
    padding: 22px 24px;
  }

  .submission-history-media {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
  }

  .submission-history-delete {
    align-self: center;
  }

  .theme-toggle { top: 18px; right: 20px; width: 48px; height: 48px; }

  .submission-card-header { flex-direction: row; align-items: flex-start; justify-content: space-between; gap: 12px; }
  .submission-card-actions { width: auto; }

  .guru-stats { grid-template-columns: repeat(3, 1fr); }

  [data-theme="light"] .tab-nav { padding-bottom: 18px; }
}

@media (max-width: 640px) {
  .grade-summary {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ========== DESKTOP BREAKPOINT (min-width: 981px) ========== */
@media (min-width: 981px) {
  .app-shell { width: min(1400px, 100%); }

  .app-header {
    grid-template-columns: 1fr minmax(360px, 640px);
    display: grid;
  }

  .prayer-strip { grid-template-columns: repeat(3, 1fr); }

  .control-panel { grid-template-columns: repeat(4, 1fr); }
  .hafalan-controls {
    grid-template-columns: minmax(0, 2.1fr) repeat(3, minmax(108px, .65fr)) minmax(0, 1.6fr);
    gap: 16px;
  }
  .hafalan-field-wide,
  .hafalan-field-small {
    grid-column: auto;
  }
  .cards-4 { grid-template-columns: repeat(4, 1fr); }

  .journey-card { grid-template-columns: repeat(4, minmax(0, 1fr)); }

  .section-heading { gap: 18px; }
}

@media (max-width: 760px) {
  .auth-card h2 {
    max-width: none;
  }

  .auth-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .captcha-box {
    padding: 14px 16px;
  }
}
