/* ---- tokens.css ---- */
/* Design tokens. Every colour, radius, shadow and font in the site comes from here.
   Dark is the default; [data-theme="light"] overrides the same names. */

:root {
  color-scheme: dark;

  /* Ground */
  --bg: #04120d;
  --bg-2: #071c15;
  --bg-elevated: #0a231b;

  /* Text — all pairs below meet WCAG AA on --bg and on --glass surfaces */
  --ink: #eef4f0;
  --ink-2: #bccbc4;
  --ink-3: #8aa197;

  /* Brand */
  --gold: #e6bd66;
  --gold-text: #e6bd66;
  --gold-soft: rgba(230, 189, 102, 0.14);
  --gold-line: rgba(230, 189, 102, 0.38);
  --gold-grad: linear-gradient(135deg, #f6d98f 0%, #e2b257 45%, #c48d36 100%);
  --on-gold: #1c1305;
  --emerald: #34d6a5;
  --emerald-text: #5fe2ba;
  --emerald-soft: rgba(52, 214, 165, 0.14);

  /* Feedback */
  --danger: #ff8a80;
  --danger-soft: rgba(255, 138, 128, 0.12);
  --success: #4fe0a5;
  --success-soft: rgba(79, 224, 165, 0.12);
  --warning: #f5c862;
  --warning-soft: rgba(245, 200, 98, 0.12);

  /* Glass */
  --glass: rgba(255, 255, 255, 0.045);
  --glass-2: rgba(255, 255, 255, 0.08);
  --glass-strong: rgba(7, 26, 20, 0.82);
  --glass-blur: 18px;
  --hairline: rgba(255, 255, 255, 0.09);
  --hairline-2: rgba(255, 255, 255, 0.17);
  --edge-light: rgba(255, 255, 255, 0.14);

  /* Depth */
  --shadow-1: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 18px 40px -24px rgba(0, 0, 0, 0.7);
  --shadow-2: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 40px 80px -40px rgba(0, 0, 0, 0.85);
  --glow-gold: 0 0 0 1px var(--gold-line), 0 12px 40px -12px rgba(230, 189, 102, 0.45);

  /* Backdrop */
  --aurora-1: #0f7a59;
  --aurora-2: #0b4f63;
  --aurora-3: #8a6420;
  --aurora-4: #155c43;
  --aurora-opacity: 0.55;
  --pattern-color: #e6bd66;
  --pattern-opacity: 0.055;
  --grain-opacity: 0.06;

  /* Shape */
  --radius-xs: 8px;
  --radius-s: 12px;
  --radius: 18px;
  --radius-l: 26px;
  --radius-xl: 34px;
  --radius-pill: 999px;

  /* Type */
  --font-ui: 'Outfit', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Cinzel', 'Trajan Pro', Georgia, serif;
  --font-arabic: 'Amiri', 'Noto Naskh Arabic', 'Traditional Arabic', serif;
  --font-quran: 'Amiri Quran', 'Amiri', 'Noto Naskh Arabic', serif;
  --font-mono: ui-monospace, 'Cascadia Code', Consolas, monospace;

  /* Layout & motion */
  --container: 1220px;
  --gutter: clamp(16px, 4vw, 32px);
  --header-h: 72px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-1: 160ms;
  --dur-2: 320ms;
  --dur-3: 700ms;
}

[data-theme="light"] {
  color-scheme: light;

  --bg: #f6f2e8;
  --bg-2: #efe8d8;
  --bg-elevated: #fffdf8;

  --ink: #0f241b;
  --ink-2: #344b41;
  --ink-3: #5a6f66;

  --gold: #b3802a;
  --gold-text: #845a10;
  --gold-soft: rgba(179, 128, 42, 0.12);
  --gold-line: rgba(179, 128, 42, 0.4);
  --emerald: #0f8a68;
  --emerald-text: #0a6b50;
  --emerald-soft: rgba(15, 138, 104, 0.1);

  --danger: #b4231b;
  --danger-soft: rgba(180, 35, 27, 0.08);
  --success: #0b7a51;
  --success-soft: rgba(11, 122, 81, 0.09);
  --warning: #8a5b00;
  --warning-soft: rgba(138, 91, 0, 0.09);

  --glass: rgba(255, 255, 255, 0.58);
  --glass-2: rgba(255, 255, 255, 0.8);
  --glass-strong: rgba(255, 253, 247, 0.92);
  --hairline: rgba(15, 36, 27, 0.1);
  --hairline-2: rgba(15, 36, 27, 0.18);
  --edge-light: rgba(255, 255, 255, 0.9);

  --shadow-1: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 18px 40px -26px rgba(15, 36, 27, 0.35);
  --shadow-2: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 40px 80px -40px rgba(15, 36, 27, 0.4);
  --glow-gold: 0 0 0 1px var(--gold-line), 0 12px 36px -14px rgba(179, 128, 42, 0.45);

  --aurora-1: #a9dcc6;
  --aurora-2: #bcd9ea;
  --aurora-3: #f0d39a;
  --aurora-4: #cfe8d3;
  --aurora-opacity: 0.7;
  --pattern-color: #0f8a68;
  --pattern-opacity: 0.07;
  --grain-opacity: 0.035;
}

/* ---- base.css ---- */
/* Reset, typography and global primitives. */

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color var(--dur-2) ease, color var(--dur-2) ease;
}

img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

p,
li,
h1,
h2,
h3,
h4 {
  overflow-wrap: break-word;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
}

h1,
h2,
h3,
h4 {
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.01em;
}

h1,
.display {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.01em;
}

h1 {
  font-size: clamp(2.2rem, 5.2vw, 4.1rem);
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

h3 {
  font-size: 1.2rem;
}

::selection {
  background: var(--gold);
  color: var(--on-gold);
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--hairline-2) transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--hairline-2);
  border-radius: 10px;
  border: 3px solid transparent;
  background-clip: padding-box;
}

/* Utilities */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  padding: 10px 16px;
  border-radius: var(--radius-s);
  background: var(--gold);
  color: var(--on-gold);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform var(--dur-1) ease;
}

.skip-link:focus {
  transform: translateY(0);
}

[hidden] {
  display: none !important;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-text);
}

.eyebrow::before {
  content: '';
  width: 28px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}

.lead {
  font-size: clamp(1.02rem, 1.6vw, 1.18rem);
  color: var(--ink-2);
  max-width: 62ch;
}

.muted {
  color: var(--ink-3);
}

.text-gold {
  color: var(--gold-text);
}

.text-gradient {
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

[data-theme="light"] .text-gradient {
  background: linear-gradient(135deg, #a46f17, #6f4a0c);
  -webkit-background-clip: text;
  background-clip: text;
}

.arabic {
  font-family: var(--font-arabic);
  direction: rtl;
  unicode-bidi: isolate;
  line-height: 2;
}

.quran-text {
  font-family: var(--font-quran);
  direction: rtl;
  unicode-bidi: isolate;
  line-height: 2.25;
  font-feature-settings: 'calt' 1, 'liga' 1;
}

.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-lg {
  width: 1.6em;
  height: 1.6em;
}

.nowrap {
  white-space: nowrap;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---- layout.css ---- */
/* Page frame: header, mobile navigation, sections, footer. */

main {
  position: relative;
  z-index: 1;
  padding-top: var(--header-h);
  min-height: 70vh;
}

main:focus {
  outline: none;
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--header-h);
  transition: background-color var(--dur-2) ease, border-color var(--dur-2) ease, backdrop-filter var(--dur-2) ease;
  border-bottom: 1px solid transparent;
}

.site-header.is-scrolled,
.page-quran .site-header,
.page-dashboard .site-header {
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border-bottom-color: var(--hairline);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex: none;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  filter: drop-shadow(0 6px 18px rgba(230, 189, 102, 0.25));
  transition: transform var(--dur-3) var(--ease-spring);
}

.brand:hover .brand-mark {
  transform: rotate(-8deg) scale(1.06);
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.22rem;
  letter-spacing: 0.04em;
}

.brand-name span {
  color: var(--gold-text);
}

.primary-nav {
  margin-inline: auto;
}

.primary-nav ul {
  display: flex;
  gap: 2px;
  list-style: none;
  padding: 5px;
  border-radius: var(--radius-pill);
  background: var(--glass);
  border: 1px solid var(--hairline);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.primary-nav a {
  position: relative;
  display: block;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--dur-1) ease, background-color var(--dur-1) ease;
}

.primary-nav a:hover {
  color: var(--ink);
  background: var(--glass-2);
}

.primary-nav a[aria-current="page"] {
  color: var(--on-gold);
  background: var(--gold-grad);
  box-shadow: 0 6px 20px -8px rgba(230, 189, 102, 0.7);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.primary-nav + .header-actions {
  margin-left: 0;
}

.icon-btn.menu-btn {
  display: none;
}

[data-theme="dark"] .icon-theme-light,
[data-theme="light"] .icon-theme-dark {
  display: none;
}

.scroll-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  overflow: hidden;
  pointer-events: none;
}

.scroll-progress span {
  display: block;
  height: 100%;
  background: var(--gold-grad);
  transform-origin: 0 50%;
  transform: scaleX(var(--progress, 0));
  box-shadow: 0 0 12px var(--gold);
}

@media (max-width: 1180px) {
  .primary-nav {
    display: none;
  }

  .icon-btn.menu-btn {
    display: inline-grid;
  }
}

@media (max-width: 520px) {
  .header-inner {
    gap: 12px;
  }

  .header-actions {
    gap: 4px;
  }

  .header-actions .icon-btn {
    width: 38px;
    height: 38px;
  }

  /* "My account" is in the mobile menu, so the header keeps theme, cart and menu only */
  .header-actions .icon-btn[data-nav="dashboard"] {
    display: none;
  }

  .site-header .brand-mark {
    width: 38px;
    height: 38px;
  }

  .site-header .brand-name {
    font-size: 1.05rem;
  }
}

/* ---------- Mobile navigation ---------- */
.mobile-nav {
  position: fixed;
  inset: var(--header-h) 0 0;
  z-index: 49;
  padding: 16px var(--gutter) 32px;
  overflow-y: auto;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  animation: sheet-in var(--dur-2) var(--ease-out);
}

.mobile-nav ul {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 8px;
  max-width: 640px;
  margin-inline: auto;
}

.mobile-nav a {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  background: var(--glass);
  text-decoration: none;
}

.mobile-nav a .icon {
  width: 26px;
  height: 26px;
  color: var(--gold-text);
}

.mobile-nav a strong {
  display: block;
  font-weight: 600;
}

.mobile-nav a small {
  display: block;
  color: var(--ink-3);
  font-size: 0.85rem;
}

.mobile-nav a[aria-current="page"] {
  border-color: var(--gold-line);
  background: var(--gold-soft);
}

body.nav-open {
  overflow: hidden;
}

@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}

/* ---------- Sections ---------- */
.section {
  position: relative;
  padding-block: clamp(56px, 8vw, 110px);
}

.section-tight {
  padding-block: clamp(32px, 5vw, 64px);
}

.section-head {
  display: grid;
  gap: 14px;
  margin-bottom: clamp(28px, 4vw, 48px);
  max-width: 760px;
}

.section-head.center {
  margin-inline: auto;
  text-align: center;
  justify-items: center;
}

.page-hero {
  position: relative;
  padding-block: clamp(40px, 6vw, 80px) clamp(24px, 4vw, 48px);
}

.page-hero h1 {
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  margin-block: 12px 14px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

@media (max-width: 860px) {
  .grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  z-index: 1;
  margin-top: clamp(40px, 8vw, 96px);
  padding-top: 56px;
  border-top: 1px solid var(--hairline);
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--bg-2) 80%, transparent));
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 40px;
}

.footer-brand p {
  margin-top: 16px;
  color: var(--ink-3);
  max-width: 38ch;
  font-size: 0.95rem;
}

.footer-col h2 {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-text);
  margin-bottom: 16px;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 10px;
}

.footer-col a {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.95rem;
}

.footer-col a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.footer-plain li {
  color: var(--ink-3);
  font-size: 0.92rem;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 48px;
  padding-block: 24px 32px;
  border-top: 1px solid var(--hairline);
  color: var(--ink-3);
  font-size: 0.88rem;
}

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media print {
  .site-header,
  .site-footer,
  .backdrop,
  .aura,
  .cursor,
  .toast-region,
  .no-print {
    display: none !important;
  }

  main {
    padding-top: 0;
  }

  body {
    background: #fff;
    color: #000;
  }
}

/* ---- components.css ---- */
/* Reusable components. Each exists once; pages compose them. */

/* ---------- Surfaces ---------- */
.glass {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-l);
  backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  box-shadow: var(--shadow-1);
}

/* Light catching the top edge of every glass panel */
.glass::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(160deg, var(--edge-light), transparent 38%, transparent 70%, var(--gold-soft));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.card {
  padding: clamp(20px, 2.6vw, 30px);
}

.card-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.card-sub {
  color: var(--ink-3);
  font-size: 0.92rem;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.hover-lift {
  transition: transform var(--dur-2) var(--ease-out), border-color var(--dur-2) ease, box-shadow var(--dur-2) ease;
}

.hover-lift:hover {
  transform: translateY(-4px);
  border-color: var(--gold-line);
  box-shadow: var(--shadow-2), 0 0 0 1px var(--gold-soft);
}

.divider {
  height: 1px;
  border: 0;
  background: var(--hairline);
  margin-block: 20px;
}

/* ---------- Buttons ---------- */
.btn {
  --btn-h: 46px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: var(--btn-h);
  padding: 0 22px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  isolation: isolate;
  transition: transform var(--dur-1) ease, box-shadow var(--dur-2) ease, background-color var(--dur-2) ease, border-color var(--dur-2) ease, color var(--dur-1) ease, opacity var(--dur-1) ease;
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
}

.btn-gold {
  background: var(--gold-grad);
  color: var(--on-gold);
  box-shadow: 0 10px 30px -12px rgba(230, 189, 102, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.btn-gold:hover:not(:disabled) {
  box-shadow: 0 16px 40px -12px rgba(230, 189, 102, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* Moving sheen on gold buttons */
.btn-gold::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%);
  background-size: 250% 100%;
  background-position: 120% 0;
  z-index: -1;
  transition: background-position 900ms var(--ease-out);
}

.btn-gold:hover::after {
  background-position: -60% 0;
}

.btn-glass {
  background: var(--glass-2);
  border-color: var(--hairline-2);
  color: var(--ink);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.btn-glass:hover:not(:disabled) {
  border-color: var(--gold-line);
  background: var(--gold-soft);
}

.btn-ghost {
  color: var(--ink-2);
  padding-inline: 14px;
}

.btn-ghost:hover:not(:disabled) {
  color: var(--ink);
  background: var(--glass-2);
}

.btn-danger {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
  background: var(--danger-soft);
}

.btn-danger:hover:not(:disabled) {
  border-color: var(--danger);
}

.btn-sm {
  --btn-h: 36px;
  padding-inline: 14px;
  font-size: 0.86rem;
  gap: 8px;
}

.btn-lg {
  --btn-h: 54px;
  padding-inline: 28px;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

.btn .icon {
  width: 1.15em;
  height: 1.15em;
}

.btn.is-busy {
  color: transparent !important;
  pointer-events: none;
}

.btn.is-busy::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-color: var(--ink) var(--ink) var(--ink) transparent;
  animation: spin 0.8s linear infinite;
}

.btn-gold.is-busy::before {
  border-color: var(--on-gold) var(--on-gold) var(--on-gold) transparent;
}

.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  background: var(--glass);
  color: var(--ink-2);
  text-decoration: none;
  transition: color var(--dur-1) ease, border-color var(--dur-1) ease, background-color var(--dur-1) ease, transform var(--dur-1) ease;
}

.icon-btn:hover {
  color: var(--ink);
  border-color: var(--gold-line);
}

.icon-btn:active {
  transform: scale(0.94);
}

.icon-btn[aria-current="page"],
.icon-btn[aria-pressed="true"] {
  color: var(--gold-text);
  border-color: var(--gold-line);
  background: var(--gold-soft);
}

.icon-btn-sm {
  width: 34px;
  height: 34px;
}

.count-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 19px;
  height: 19px;
  padding-inline: 5px;
  border-radius: var(--radius-pill);
  background: var(--gold-grad);
  color: var(--on-gold);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 19px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--bg);
}

.count-badge.bump {
  animation: bump 420ms var(--ease-spring);
}

/* ---------- Chips, badges ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--hairline-2);
  background: var(--glass);
  color: var(--ink-2);
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  transition: all var(--dur-1) ease;
}

button.chip:hover,
a.chip:hover {
  color: var(--ink);
  border-color: var(--gold-line);
}

.chip[aria-pressed="true"],
.chip[aria-selected="true"],
.chip.is-active {
  color: var(--on-gold);
  background: var(--gold-grad);
  border-color: transparent;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}

.chip-scroll::-webkit-scrollbar {
  display: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--hairline-2);
  color: var(--ink-2);
  white-space: nowrap;
}

.badge-gold {
  color: var(--gold-text);
  border-color: var(--gold-line);
  background: var(--gold-soft);
}

.badge-emerald,
.badge-success {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 35%, transparent);
  background: var(--success-soft);
}

.badge-warning {
  color: var(--warning);
  border-color: color-mix(in srgb, var(--warning) 35%, transparent);
  background: var(--warning-soft);
}

.badge-danger {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 35%, transparent);
  background: var(--danger-soft);
}

/* ---------- Forms ---------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 18px;
}

.form-grid .span-2 {
  grid-column: 1 / -1;
}

@media (max-width: 620px) {
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.field {
  display: grid;
  gap: 7px;
  align-content: start;
}

.field > label,
.field-label {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-2);
}

.field .optional {
  font-weight: 400;
  color: var(--ink-3);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: var(--radius-s);
  border: 1px solid var(--hairline-2);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  color: var(--ink);
  font-size: 0.98rem;
  transition: border-color var(--dur-1) ease, box-shadow var(--dur-1) ease, background-color var(--dur-1) ease;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--ink-3);
  opacity: 1;
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--gold-line);
}

.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 4px var(--gold-soft);
}

.input[aria-invalid="true"],
.select[aria-invalid="true"],
.textarea[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px var(--danger-soft);
}

.select {
  appearance: none;
  padding-right: 42px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 22px) 52%, calc(100% - 16px) 52%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}

.select option {
  background: var(--bg-elevated);
  color: var(--ink);
}

.textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.5;
}

.hint {
  font-size: 0.82rem;
  color: var(--ink-3);
}

.field-error {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  color: var(--danger);
}

.input-icon {
  position: relative;
}

.input-icon > .icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  pointer-events: none;
}

.input-icon > .input {
  padding-left: 46px;
}

.input-affix {
  position: relative;
}

.input-affix > .input {
  padding-right: 52px;
}

.input-affix > .icon-btn {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border: 0;
  background: transparent;
}

.check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 0.92rem;
  color: var(--ink-2);
  cursor: pointer;
}

.check input {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--gold);
}

/* Toggle switch: <label class="switch"><input type="checkbox" role="switch"><span></span>Label</label> */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 0.92rem;
  color: var(--ink-2);
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.switch > span {
  position: relative;
  flex: none;
  width: 46px;
  height: 26px;
  border-radius: var(--radius-pill);
  background: var(--glass-2);
  border: 1px solid var(--hairline-2);
  transition: background-color var(--dur-2) ease, border-color var(--dur-2) ease;
}

.switch > span::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ink-2);
  transition: transform var(--dur-2) var(--ease-spring), background-color var(--dur-2) ease;
}

.switch input:checked + span {
  background: var(--gold-grad);
  border-color: transparent;
}

.switch input:checked + span::after {
  transform: translateX(20px);
  background: var(--on-gold);
}

.switch input:focus-visible + span {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* Segmented control built from radio inputs */
.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-pill);
  background: var(--glass);
  border: 1px solid var(--hairline);
}

.segmented label {
  position: relative;
  cursor: pointer;
}

.segmented input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}

.segmented span {
  display: block;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-2);
  transition: all var(--dur-1) ease;
}

.segmented input:checked + span {
  background: var(--gold-grad);
  color: var(--on-gold);
  box-shadow: 0 6px 18px -8px rgba(230, 189, 102, 0.7);
}

.segmented input:focus-visible + span {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-pill);
  background: var(--glass);
  border: 1px solid var(--hairline);
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs [role="tab"] {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-2);
  transition: all var(--dur-1) ease;
}

.tabs [role="tab"]:hover {
  color: var(--ink);
}

.tabs [role="tab"][aria-selected="true"] {
  background: var(--gold-grad);
  color: var(--on-gold);
}

/* ---------- Stepper ---------- */
.stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--hairline-2);
  border-radius: var(--radius-pill);
  background: var(--glass);
}

.stepper button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--ink-2);
}

.stepper button:hover:not(:disabled) {
  color: var(--gold-text);
}

.stepper output {
  min-width: 30px;
  text-align: center;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---------- Dialogs ---------- */
dialog {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  max-width: none;
  max-height: none;
}

dialog::backdrop {
  background: rgba(2, 10, 7, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

[data-theme="light"] dialog::backdrop {
  background: rgba(15, 36, 27, 0.32);
}

.modal {
  width: min(560px, calc(100vw - 24px));
  margin: auto;
}

.modal-panel {
  position: relative;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  border-radius: var(--radius-l);
  background: var(--glass-strong);
  border: 1px solid var(--hairline-2);
  box-shadow: var(--shadow-2);
  backdrop-filter: blur(28px) saturate(150%);
  -webkit-backdrop-filter: blur(28px) saturate(150%);
}

.modal[open] .modal-panel {
  animation: pop-in var(--dur-2) var(--ease-out);
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 14px;
  background: inherit;
}

.modal-head h2 {
  font-family: var(--font-ui);
  font-size: 1.2rem;
  font-weight: 600;
}

.modal-body {
  padding: 4px 24px 24px;
}

.drawer {
  width: min(440px, 100vw);
  height: 100dvh;
  margin: 0 0 0 auto;
}

.drawer-panel {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--glass-strong);
  border-left: 1px solid var(--hairline-2);
  backdrop-filter: blur(28px) saturate(150%);
  -webkit-backdrop-filter: blur(28px) saturate(150%);
}

.drawer[open] .drawer-panel {
  animation: slide-in var(--dur-2) var(--ease-out);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px;
  border-bottom: 1px solid var(--hairline);
}

.drawer-head h2 {
  font-family: var(--font-ui);
  font-size: 1.15rem;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 22px;
}

.drawer-foot {
  display: grid;
  gap: 14px;
  padding: 18px 22px 22px;
  border-top: 1px solid var(--hairline);
}

.drawer-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 1.05rem;
}

.drawer-total strong {
  font-size: 1.35rem;
  color: var(--gold-text);
}

.fine-print {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 0.8rem;
  color: var(--ink-3);
}

.fine-print .icon {
  width: 15px;
  height: 15px;
  margin-top: 2px;
}

/* ---------- Toasts ---------- */
.toast-region {
  position: fixed;
  z-index: 200;
  right: 16px;
  bottom: 16px;
  display: grid;
  gap: 10px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--glass-strong);
  border: 1px solid var(--hairline-2);
  box-shadow: var(--shadow-2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  font-size: 0.92rem;
  pointer-events: auto;
  animation: toast-in var(--dur-2) var(--ease-out);
}

.toast .icon {
  margin-top: 1px;
}

.toast-success .icon {
  color: var(--success);
}

.toast-error .icon {
  color: var(--danger);
}

.toast-info .icon {
  color: var(--gold-text);
}

.toast.is-leaving {
  animation: toast-out var(--dur-2) ease forwards;
}

/* ---------- Async states ---------- */
.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xs);
  background: var(--glass-2);
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  animation: shimmer 1.4s infinite;
}

[data-theme="light"] .skeleton::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
}

.skel-line {
  height: 14px;
  margin-block: 10px;
}

.skel-line.w-40 { width: 40%; }
.skel-line.w-60 { width: 60%; }
.skel-line.w-80 { width: 80%; }
.skel-line.lg { height: 26px; }

.state {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: clamp(28px, 5vw, 48px) 20px;
  text-align: center;
  color: var(--ink-2);
}

.state-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--gold-soft);
  color: var(--gold-text);
  border: 1px solid var(--gold-line);
}

.state-icon .icon {
  width: 26px;
  height: 26px;
}

.state-error .state-icon {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 35%, transparent);
}

.state h3 {
  color: var(--ink);
  font-size: 1.08rem;
}

.state p {
  max-width: 46ch;
  font-size: 0.94rem;
}

.spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2.5px solid var(--hairline-2);
  border-top-color: var(--gold);
  animation: spin 0.8s linear infinite;
}

/* ---------- Notices ---------- */
.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--gold-line);
  background: var(--gold-soft);
  color: var(--ink-2);
  font-size: 0.9rem;
}

.notice .icon {
  color: var(--gold-text);
  margin-top: 2px;
}

.notice-danger {
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
  background: var(--danger-soft);
}

.notice-danger .icon {
  color: var(--danger);
}

.notice strong {
  color: var(--ink);
}

/* ---------- Table ---------- */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-text);
  background: var(--glass);
  border-bottom: 1px solid var(--hairline);
  white-space: nowrap;
}

.table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--hairline);
  color: var(--ink-2);
  vertical-align: middle;
}

.table tr:last-child td {
  border-bottom: 0;
}

.table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- Sample-data marker (development preview only) ---------- */
.preview-ribbon {
  position: fixed;
  z-index: 300;
  left: 16px;
  bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: repeating-linear-gradient(-45deg, #5b3d00, #5b3d00 10px, #6d4a00 10px, #6d4a00 20px);
  color: #ffe2a3;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid #c79a3a;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
}

.sample-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  background: #5b3d00;
  color: #ffe2a3;
  border: 1px dashed #c79a3a;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: middle;
}

/* ---------- Avatars ---------- */
.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--emerald), #0b5a45 60%, var(--gold));
  color: #fff;
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 4px var(--gold-line);
}

.avatar-lg {
  width: 92px;
  height: 92px;
  font-size: 1.8rem;
}

/* ---------- Feature blocks shared across pages: cart, checkout, confirm ---------- */
.cart-lines {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cart-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--hairline);
}

.cart-line-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--gold-soft);
  color: var(--gold-text);
}

.cart-line-main {
  display: grid;
  min-width: 0;
}

.cart-line-main strong {
  font-weight: 600;
  font-size: 0.95rem;
}

.cart-line-main span {
  font-size: 0.8rem;
}

.cart-line-side {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.cart-remove {
  border-color: transparent;
  background: transparent;
}

.cart-remove:hover {
  color: var(--danger);
}

.order-summary {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  background: var(--glass);
}

.order-summary ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.order-summary li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.92rem;
}

.order-summary li > span:first-child {
  display: grid;
}

.order-summary small {
  font-size: 0.8rem;
}

.order-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--hairline-2);
}

.order-total strong {
  font-size: 1.3rem;
  color: var(--gold-text);
}

.checkout {
  display: grid;
  gap: 4px;
}

.checkout > .notice {
  margin-bottom: 14px;
}

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

.confirm {
  display: grid;
  gap: 20px;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.is-flash {
  animation: flash 2.2s var(--ease-out);
}

@keyframes flash {
  0%,
  30% {
    border-color: var(--gold);
    box-shadow: 0 0 0 4px var(--gold-soft);
  }
}

/* Payment result + 404 */
.checkout-result {
  display: grid;
  justify-items: center;
  gap: 14px;
  max-width: 640px;
  margin-inline: auto;
  padding: clamp(24px, 5vw, 48px);
  border-radius: var(--radius-xl);
  text-align: center;
}

.checkout-result .order-summary {
  width: 100%;
  text-align: left;
}

.result-icon {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  animation: pop-in 500ms var(--ease-spring);
}

.result-icon.is-success {
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid color-mix(in srgb, var(--success) 40%, transparent);
  box-shadow: 0 0 40px -6px var(--success);
}

.result-icon .icon {
  width: 36px;
  height: 36px;
}

.result-actions {
  justify-content: center;
}

.not-found {
  display: grid;
  justify-items: center;
  gap: 16px;
  padding-block: clamp(48px, 10vw, 120px);
  text-align: center;
}

.not-found-code {
  font-size: clamp(5rem, 16vw, 10rem);
  line-height: 1;
}

.not-found .chip-row {
  justify-content: center;
}

/* ---------- Keyframes ---------- */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
}

@keyframes slide-in {
  from {
    transform: translateX(100%);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateX(24px);
  }
}

@keyframes bump {
  40% {
    transform: scale(1.35);
  }
}

/* ---- effects.css ---- */
/* Atmosphere and motion. Everything here is decorative: it is aria-hidden in markup,
   gated on (pointer: fine) where it follows the cursor, and switched off under reduced motion. */

/* ---------- Fixed backdrop: aurora + girih pattern + grain ---------- */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.aurora {
  position: absolute;
  inset: -20%;
  opacity: var(--aurora-opacity);
  transform: translate3d(calc(var(--px, 0) * -24px), calc(var(--py, 0) * -24px), 0);
  transition: transform 1.2s var(--ease-out);
}

.aurora i {
  position: absolute;
  width: 62vmax;
  height: 62vmax;
  border-radius: 50%;
  will-change: transform;
}

.aurora i:nth-child(1) {
  top: -10%;
  left: -8%;
  background: radial-gradient(circle at center, var(--aurora-1), transparent 62%);
  animation: drift-a 26s ease-in-out infinite alternate;
}

.aurora i:nth-child(2) {
  top: 10%;
  right: -16%;
  background: radial-gradient(circle at center, var(--aurora-2), transparent 62%);
  animation: drift-b 32s ease-in-out infinite alternate;
}

.aurora i:nth-child(3) {
  bottom: -26%;
  left: 18%;
  background: radial-gradient(circle at center, var(--aurora-3), transparent 60%);
  opacity: 0.55;
  animation: drift-c 38s ease-in-out infinite alternate;
}

.aurora i:nth-child(4) {
  bottom: -10%;
  right: 10%;
  width: 40vmax;
  height: 40vmax;
  background: radial-gradient(circle at center, var(--aurora-4), transparent 62%);
  animation: drift-a 30s ease-in-out infinite alternate-reverse;
}

.pattern {
  position: absolute;
  inset: 0;
  background: var(--pattern-color);
  opacity: var(--pattern-opacity);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23000' stroke-width='1'%3E%3Crect x='38' y='38' width='44' height='44'/%3E%3Crect x='38' y='38' width='44' height='44' transform='rotate(45 60 60)'/%3E%3Crect x='-22' y='-22' width='44' height='44'/%3E%3Crect x='-22' y='-22' width='44' height='44' transform='rotate(45 0 0)'/%3E%3Crect x='98' y='-22' width='44' height='44'/%3E%3Crect x='98' y='-22' width='44' height='44' transform='rotate(45 120 0)'/%3E%3Crect x='-22' y='98' width='44' height='44'/%3E%3Crect x='-22' y='98' width='44' height='44' transform='rotate(45 0 120)'/%3E%3Crect x='98' y='98' width='44' height='44'/%3E%3Crect x='98' y='98' width='44' height='44' transform='rotate(45 120 120)'/%3E%3Cpath d='M60 28.9V8M60 91.1V112M28.9 60H8M91.1 60H112M31.1 0H52M68 0H88.9M31.1 120H52M68 120H88.9M0 31.1V52M0 68V88.9M120 31.1V52M120 68V88.9M60-8l8 8-8 8-8-8zM60 112l8 8-8 8-8-8zM-8 60l8-8 8 8-8 8zM112 60l8-8 8 8-8 8z'/%3E%3C/g%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23000' stroke-width='1'%3E%3Crect x='38' y='38' width='44' height='44'/%3E%3Crect x='38' y='38' width='44' height='44' transform='rotate(45 60 60)'/%3E%3Crect x='-22' y='-22' width='44' height='44'/%3E%3Crect x='-22' y='-22' width='44' height='44' transform='rotate(45 0 0)'/%3E%3Crect x='98' y='-22' width='44' height='44'/%3E%3Crect x='98' y='-22' width='44' height='44' transform='rotate(45 120 0)'/%3E%3Crect x='-22' y='98' width='44' height='44'/%3E%3Crect x='-22' y='98' width='44' height='44' transform='rotate(45 0 120)'/%3E%3Crect x='98' y='98' width='44' height='44'/%3E%3Crect x='98' y='98' width='44' height='44' transform='rotate(45 120 120)'/%3E%3Cpath d='M60 28.9V8M60 91.1V112M28.9 60H8M91.1 60H112M31.1 0H52M68 0H88.9M31.1 120H52M68 120H88.9M0 31.1V52M0 68V88.9M120 31.1V52M120 68V88.9M60-8l8 8-8 8-8-8zM60 112l8 8-8 8-8-8zM-8 60l8-8 8 8-8 8zM112 60l8-8 8 8-8 8z'/%3E%3C/g%3E%3C/svg%3E");
  -webkit-mask-size: 120px 120px;
  mask-size: 120px 120px;
}

.grain {
  position: absolute;
  inset: -50%;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 8s steps(8) infinite;
}

[data-theme="light"] .grain {
  filter: invert(1);
}

/* ---------- Cursor aura + follower ring (fine pointers only) ---------- */
.aura,
.cursor {
  display: none;
}

.has-pointer .aura {
  display: block;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 0;
  width: 720px;
  height: 720px;
  margin: -360px 0 0 -360px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(230, 189, 102, 0.13), rgba(52, 214, 165, 0.05) 35%, transparent 62%);
  transform: translate3d(var(--ax, -999px), var(--ay, -999px), 0);
  will-change: transform;
}

[data-theme="light"].has-pointer .aura {
  background: radial-gradient(circle, rgba(15, 138, 104, 0.12), rgba(179, 128, 42, 0.06) 35%, transparent 62%);
}

.has-pointer .cursor {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 400;
  pointer-events: none;
}

.cursor-ring {
  position: absolute;
  left: 0;
  top: 0;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border-radius: 50%;
  border: 1px solid var(--gold-line);
  transform: translate3d(var(--cx, -100px), var(--cy, -100px), 0) scale(var(--cs, 1));
  transition: width var(--dur-2) var(--ease-out), height var(--dur-2) var(--ease-out), margin var(--dur-2) var(--ease-out), background-color var(--dur-2) ease, border-color var(--dur-2) ease, opacity var(--dur-2) ease;
  will-change: transform;
}

.cursor.is-hover .cursor-ring {
  width: 60px;
  height: 60px;
  margin: -30px 0 0 -30px;
  background: var(--gold-soft);
  border-color: var(--gold);
}

.cursor.is-down .cursor-ring {
  --cs: 0.8;
}

.cursor.is-text .cursor-ring,
.cursor.is-hidden .cursor-ring {
  opacity: 0;
}

/* ---------- Spotlight that follows the pointer inside a card ---------- */
[data-spotlight] {
  --mx: 50%;
  --my: 50%;
}

[data-spotlight]::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(480px circle at var(--mx) var(--my), rgba(230, 189, 102, 0.12), transparent 42%);
  opacity: 0;
  transition: opacity var(--dur-2) ease;
}

[data-theme="light"] [data-spotlight]::after {
  background: radial-gradient(480px circle at var(--mx) var(--my), rgba(15, 138, 104, 0.1), transparent 42%);
}

[data-spotlight]:hover::after {
  opacity: 1;
}

/* ---------- Tilt + magnetic ---------- */
[data-tilt] {
  transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 600ms var(--ease-out);
  transform-style: preserve-3d;
}

[data-magnetic] {
  translate: var(--tx, 0) var(--ty, 0);
  transition: translate 400ms var(--ease-out), transform var(--dur-1) ease, box-shadow var(--dur-2) ease, background-color var(--dur-2) ease;
}

/* ---------- Scroll reveal ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 900ms var(--ease-out), transform 900ms var(--ease-out);
  transition-delay: calc(var(--i, 0) * 70ms);
  /* Safety net: if the observer never runs, show content anyway */
  animation: reveal-fallback 0s 2.5s forwards;
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
  animation: none;
}

@keyframes reveal-fallback {
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Marquee ---------- */
.marquee {
  position: relative;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 60s linear infinite;
}

.marquee:hover .marquee-track {
  animation-play-state: paused;
}

/* ---------- Animated gradient border for featured cards ---------- */
@property --angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

.glow-border {
  position: relative;
}

.glow-border::before {
  background: conic-gradient(from var(--angle), transparent 0 60%, var(--gold) 75%, var(--emerald) 85%, transparent 100%) !important;
  animation: rotate-angle 6s linear infinite;
}

/* ---------- Misc ---------- */
.starfield {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.float {
  animation: float 7s ease-in-out infinite;
}

.pulse-dot {
  position: relative;
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}

.pulse-dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: inherit;
  animation: ping 1.8s var(--ease-out) infinite;
}

@keyframes drift-a {
  to {
    transform: translate3d(12vw, 8vh, 0) scale(1.15);
  }
}

@keyframes drift-b {
  to {
    transform: translate3d(-14vw, 10vh, 0) scale(0.9);
  }
}

@keyframes drift-c {
  to {
    transform: translate3d(8vw, -12vh, 0) scale(1.2);
  }
}

@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-3%, 2%); }
  50% { transform: translate(2%, -3%); }
  75% { transform: translate(-2%, -1%); }
}

@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}

@keyframes rotate-angle {
  to {
    --angle: 360deg;
  }
}

@keyframes float {
  50% {
    transform: translateY(-12px);
  }
}

@keyframes ping {
  75%,
  100% {
    transform: scale(2.6);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .aurora,
  .aurora i,
  .grain,
  .marquee-track,
  .float {
    animation: none !important;
    transform: none !important;
  }

  .js [data-reveal] {
    opacity: 1;
    transform: none;
    animation: none;
  }

  [data-tilt] {
    transform: none !important;
  }

  [data-magnetic] {
    translate: none !important;
  }

  .has-pointer .aura,
  .has-pointer .cursor {
    display: none;
  }
}

/* ---- pages/account.css ---- */
/* ---------- Sign in / register ---------- */
.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 480px);
  gap: clamp(24px, 5vw, 72px);
  align-items: center;
  min-height: calc(100dvh - var(--header-h) - 80px);
  padding-block: 32px;
}

.auth-art {
  display: grid;
  gap: 14px;
  text-align: center;
}

.auth-verse {
  font-size: clamp(2.6rem, 6vw, 4.8rem);
  line-height: 1.5;
  color: var(--gold-text);
  text-shadow: 0 0 40px rgba(230, 189, 102, 0.35);
}

.auth-verse-en {
  color: var(--ink-2);
  font-size: 1.05rem;
}

.auth-card {
  display: grid;
  gap: 20px;
  padding: clamp(22px, 4vw, 36px);
  border-radius: var(--radius-xl);
}

.auth-card .tabs {
  justify-self: stretch;
}

.auth-card .tabs [role="tab"] {
  flex: 1;
  justify-content: center;
}

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

.auth-row {
  display: flex;
  justify-content: flex-end;
  margin-top: -8px;
}

@media (max-width: 860px) {
  .auth-shell {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }

  .auth-art {
    order: 2;
  }

  .auth-verse {
    font-size: 2.2rem;
  }
}

/* ---- pages/ask.css ---- */
/* ---------- AI Mufti chat ---------- */
.ask-shell {
  padding-block: 24px 40px;
}

.chat {
  display: flex;
  flex-direction: column;
  max-width: 900px;
  height: calc(100dvh - var(--header-h) - 64px);
  min-height: 560px;
  margin-inline: auto;
  padding: 18px;
  border-radius: var(--radius-xl);
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 6px 14px;
  border-bottom: 1px solid var(--hairline);
}

.chat-avatar,
.msg-avatar {
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  background: var(--gold-grad);
  color: var(--on-gold);
}

.chat-avatar {
  width: 50px;
  height: 50px;
  box-shadow: var(--glow-gold);
}

.chat-avatar .icon {
  width: 24px;
  height: 24px;
}

.chat-title {
  flex: 1;
  min-width: 0;
}

.chat-title h1 {
  font-size: 1.5rem;
  margin: 0;
}

.chat-title p {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
}

.chat-disclaimer {
  margin: 14px 0 6px;
  font-size: 0.85rem;
}

.chat-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 6px;
}

.chat-welcome {
  display: grid;
  justify-items: center;
  gap: 14px;
  margin: auto;
  max-width: 560px;
  text-align: center;
  color: var(--ink-2);
}

.chat-salam {
  font-size: 2.2rem;
  color: var(--gold-text);
  line-height: 1.5;
}

.chat-welcome .chip-row {
  justify-content: center;
}

.msg {
  display: flex;
  gap: 10px;
  max-width: 88%;
  animation: pop-in var(--dur-2) var(--ease-out);
}

.msg-user {
  align-self: flex-end;
}

.msg-avatar {
  width: 32px;
  height: 32px;
  margin-top: 2px;
}

.msg-avatar .icon {
  width: 16px;
  height: 16px;
}

.msg-body {
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 0.98rem;
  line-height: 1.65;
}

.msg-user .msg-body {
  background: var(--gold-grad);
  color: var(--on-gold);
  border-bottom-right-radius: 6px;
}

.msg-assistant .msg-body,
.msg-error .msg-body {
  background: var(--glass-2);
  border: 1px solid var(--hairline);
  border-top-left-radius: 6px;
}

.error-box {
  display: grid;
  gap: 10px;
  justify-items: start;
  color: var(--danger);
}

.answer {
  display: grid;
  gap: 10px;
}

.answer > .sample-tag {
  justify-self: start;
}

.citations {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px dashed var(--hairline-2);
}

.citations h4 {
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-text);
  margin-bottom: 10px;
}

.citations ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cite {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: var(--radius-s);
  background: color-mix(in srgb, var(--bg) 35%, transparent);
  border: 1px solid var(--hairline);
}

.cite-kind {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.cite-kind .icon {
  width: 14px;
  height: 14px;
}

.cite-ref {
  font-weight: 600;
  color: var(--gold-text);
  font-size: 0.92rem;
}

.cite q {
  color: var(--ink-2);
  font-style: italic;
  font-size: 0.92rem;
}

.typing {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  height: 22px;
}

.typing i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-3);
  animation: typing 1.2s infinite ease-in-out;
}

.typing i:nth-of-type(2) {
  animation-delay: 0.15s;
}

.typing i:nth-of-type(3) {
  animation-delay: 0.3s;
}

@keyframes typing {
  0%,
  80%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-4px);
  }
}

.chat-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 8px 8px 8px 16px;
  border-radius: 24px;
  border: 1px solid var(--hairline-2);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  transition: border-color var(--dur-1) ease, box-shadow var(--dur-1) ease;
}

.chat-form:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px var(--gold-soft);
}

.chat-input {
  flex: 1;
  min-height: 44px;
  max-height: 180px;
  padding: 11px 0;
  border: 0;
  background: transparent;
  resize: none;
  line-height: 1.45;
}

.chat-input:focus-visible {
  outline: none;
}

.chat-send {
  width: 46px;
  padding: 0;
}

.chat-hint {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px 0;
  font-size: 0.78rem;
}

@media (max-width: 600px) {
  .chat {
    height: calc(100dvh - var(--header-h) - 24px);
    padding: 12px;
    border-radius: var(--radius-l);
  }

  .ask-shell {
    padding-block: 12px 24px;
  }

  .msg {
    max-width: 96%;
  }

  .chat-hint span:first-child {
    display: none;
  }
}

/* ---- pages/classes.css ---- */
/* ---------- Classes ---------- */
.classes-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 40px;
  align-items: center;
}

.hero-points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 20px;
  margin: 22px 0 26px;
  padding: 0;
  list-style: none;
  color: var(--ink-2);
}

.hero-points li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-points .icon {
  color: var(--gold-text);
}

.classes-art {
  position: relative;
  aspect-ratio: 1;
  max-width: 380px;
  width: 100%;
  justify-self: center;
}

.letter-orbit {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px dashed var(--gold-line);
  animation: orbit 60s linear infinite;
}

.letter-orbit span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 54px;
  height: 54px;
  margin: -27px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--glass-2);
  border: 1px solid var(--hairline-2);
  color: var(--gold-text);
  font-size: 1.6rem;
  line-height: 1;
}

.letter-orbit span:nth-child(1) { transform: rotate(0deg) translateY(-190px) rotate(0deg); }
.letter-orbit span:nth-child(2) { transform: rotate(45deg) translateY(-190px) rotate(-45deg); }
.letter-orbit span:nth-child(3) { transform: rotate(90deg) translateY(-190px) rotate(-90deg); }
.letter-orbit span:nth-child(4) { transform: rotate(135deg) translateY(-190px) rotate(-135deg); }
.letter-orbit span:nth-child(5) { transform: rotate(180deg) translateY(-190px) rotate(-180deg); }
.letter-orbit span:nth-child(6) { transform: rotate(225deg) translateY(-190px) rotate(-225deg); }
.letter-orbit span:nth-child(7) { transform: rotate(270deg) translateY(-190px) rotate(-270deg); }
.letter-orbit span:nth-child(8) { transform: rotate(315deg) translateY(-190px) rotate(-315deg); }

.art-core {
  position: absolute;
  inset: 22%;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  border-radius: 50%;
  color: var(--gold-text);
}

.art-core .icon {
  width: 42px;
  height: 42px;
}

.art-core .quran-text {
  font-size: 2.6rem;
  line-height: 1.4;
}

@keyframes orbit {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 900px) {
  .classes-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .classes-art {
    max-width: 300px;
  }

  .letter-orbit span:nth-child(n) {
    width: 44px;
    height: 44px;
    margin: -22px;
    font-size: 1.3rem;
  }

  .letter-orbit span:nth-child(1) { transform: rotate(0deg) translateY(-150px) rotate(0deg); }
  .letter-orbit span:nth-child(2) { transform: rotate(45deg) translateY(-150px) rotate(-45deg); }
  .letter-orbit span:nth-child(3) { transform: rotate(90deg) translateY(-150px) rotate(-90deg); }
  .letter-orbit span:nth-child(4) { transform: rotate(135deg) translateY(-150px) rotate(-135deg); }
  .letter-orbit span:nth-child(5) { transform: rotate(180deg) translateY(-150px) rotate(-180deg); }
  .letter-orbit span:nth-child(6) { transform: rotate(225deg) translateY(-150px) rotate(-225deg); }
  .letter-orbit span:nth-child(7) { transform: rotate(270deg) translateY(-150px) rotate(-270deg); }
  .letter-orbit span:nth-child(8) { transform: rotate(315deg) translateY(-150px) rotate(-315deg); }
}

@media (max-width: 520px) {
  .hero-points {
    grid-template-columns: minmax(0, 1fr);
  }
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
}

.course-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px;
  border-radius: var(--radius-l);
}

.course-card p {
  color: var(--ink-2);
  font-size: 0.93rem;
}

.teacher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
}

.teacher-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 22px;
  border-radius: var(--radius-l);
}

.teacher-card .avatar {
  margin-bottom: 6px;
}

.teacher-card h3 {
  font-size: 1.12rem;
}

.teacher-spec {
  color: var(--gold-text);
  font-weight: 600;
  font-size: 0.92rem;
}

.teacher-meta {
  color: var(--ink-3);
  font-size: 0.86rem;
  flex: 1;
}

.teacher-langs .chip {
  min-height: 28px;
  font-size: 0.76rem;
  padding: 0 10px;
}

.teacher-card .btn {
  margin-top: 8px;
}

.booking {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(24px, 4vw, 52px);
  padding: clamp(22px, 4vw, 48px);
  border-radius: var(--radius-xl);
  scroll-margin-top: calc(var(--header-h) + 16px);
}

.booking-info h2 {
  margin-block: 10px 22px;
}

.steps {
  display: grid;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps li {
  display: flex;
  gap: 14px;
}

.steps li > span {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gold-grad);
  color: var(--on-gold);
  font-weight: 700;
}

.steps p {
  color: var(--ink-3);
  font-size: 0.92rem;
}

.plain-fieldset {
  border: 0;
  padding: 0;
}

.plain-fieldset legend {
  margin-bottom: 8px;
}

.booking-success {
  display: grid;
  justify-items: start;
  gap: 12px;
  padding: 10px 0;
}

.booking-success:focus {
  outline: none;
}

.booking-success .state-icon {
  background: var(--success-soft);
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 35%, transparent);
}

@media (max-width: 900px) {
  .booking {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---- pages/dashboard.css ---- */
/* ---------- Dashboard ---------- */
.dash {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  padding-block: 28px 40px;
}

.dash-side {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  display: grid;
  gap: 18px;
  padding: 22px 16px 16px;
  border-radius: var(--radius-xl);
}

.dash-profile {
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--hairline);
}

.dash-profile .avatar {
  margin-bottom: 8px;
}

.dash-name {
  font-family: var(--font-ui);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0;
}

.dash-email {
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.dash-nav {
  display: grid;
  gap: 4px;
}

.dash-nav [role="tab"] {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-s);
  border: 1px solid transparent;
  color: var(--ink-2);
  font-weight: 500;
  text-align: left;
  transition: all var(--dur-1) ease;
}

.dash-nav [role="tab"]:hover {
  background: var(--glass-2);
  color: var(--ink);
}

.dash-nav [role="tab"][aria-selected="true"] {
  background: var(--gold-soft);
  border-color: var(--gold-line);
  color: var(--gold-text);
}

.dash-signout {
  justify-self: start;
}

.dash-main {
  min-width: 0;
}

.dash-panel {
  display: grid;
  gap: 20px;
  animation: pop-in var(--dur-2) var(--ease-out);
}

.dash-head h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
}

.dash-head p {
  margin-top: 4px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.stat-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat {
  display: grid;
  gap: 4px;
  align-content: start;
  padding: 20px;
  border-radius: var(--radius-l);
  text-decoration: none;
}

.stat-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 6px;
  border-radius: 12px;
  background: var(--gold-soft);
  border: 1px solid var(--gold-line);
  color: var(--gold-text);
}

.stat-label {
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.stat strong {
  font-size: 1.2rem;
  font-weight: 600;
}

.stat-big {
  font-family: var(--font-display);
  font-size: 2.2rem !important;
  color: var(--gold-text);
}

.class-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.class-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-radius: var(--radius-l);
}

.class-date {
  display: grid;
  justify-items: center;
  width: 56px;
  padding: 6px 0;
  border-radius: var(--radius-s);
  background: var(--gold-soft);
  border: 1px solid var(--gold-line);
  color: var(--gold-text);
  line-height: 1.1;
}

.class-date strong {
  font-size: 1.4rem;
}

.class-date span {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.class-main {
  display: grid;
  min-width: 0;
}

.class-main span {
  font-size: 0.86rem;
}

.class-actions {
  display: flex;
  gap: 6px;
}

.current-plan {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  border-radius: var(--radius-l);
}

.current-plan h3 {
  margin-block: 6px 2px;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.plan {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px 20px 20px;
  border-radius: var(--radius-l);
}

.plan.is-current {
  border-color: var(--gold-line);
}

.plan-flag {
  align-self: flex-start;
}

.plan-price strong {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--gold-text);
}

.plan-features {
  display: grid;
  gap: 8px;
  margin: 0 0 6px;
  padding: 0;
  list-style: none;
  flex: 1;
  font-size: 0.9rem;
  color: var(--ink-2);
}

.plan-features li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.plan-features .icon {
  color: var(--success);
  margin-top: 3px;
  width: 16px;
  height: 16px;
}

.refer-quote {
  margin: 0;
  padding: 20px 22px;
  border-radius: var(--radius-l);
  border-left: 3px solid var(--gold);
}

.refer-quote p {
  font-size: 1.05rem;
  color: var(--ink);
}

.refer-quote cite {
  display: block;
  margin-top: 8px;
  font-style: normal;
  font-size: 0.85rem;
  color: var(--gold-text);
}

.refer-box {
  display: grid;
  gap: 12px;
  padding: 20px 22px;
  border-radius: var(--radius-l);
}

.refer-box .input {
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.settings-form {
  padding: 22px;
  border-radius: var(--radius-l);
}

@media (max-width: 960px) {
  .dash {
    grid-template-columns: minmax(0, 1fr);
  }

  .dash-side {
    position: static;
  }

  .dash-nav {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .dash-nav [role="tab"] {
    width: auto;
    flex: none;
    white-space: nowrap;
  }
}

@media (max-width: 640px) {
  .stat-grid,
  .stat-grid.three {
    grid-template-columns: minmax(0, 1fr);
  }

  .class-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .class-item > .badge,
  .class-actions {
    grid-column: 2;
    justify-self: start;
  }
}

/* ---- pages/fatiha.css ---- */
/* ---------- Quran Fatiha ---------- */
.fatiha-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
}

.how-steps {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.how-steps li {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius);
}

.how-num {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gold-grad);
  color: var(--on-gold);
  font-weight: 700;
}

.how-steps p {
  color: var(--ink-3);
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .fatiha-hero {
    grid-template-columns: minmax(0, 1fr);
  }
}

.package-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 22px;
}

@media (max-width: 380px) {
  .package-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.package-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  border-radius: var(--radius-l);
}

.pkg-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pkg-head .tile-icon {
  margin: 0;
}

.pkg-head h3 {
  font-size: 1.2rem;
}

.pkg-desc {
  color: var(--ink-2);
  font-size: 0.94rem;
  min-height: 4.5em;
}

.pkg-options {
  border: 0;
  padding: 0;
  margin: 0;
}

.pkg-options legend {
  margin-bottom: 8px;
}

.pkg-option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.pkg-option {
  position: relative;
}

.pkg-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.pkg-option span {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: var(--radius-s);
  border: 1px solid var(--hairline-2);
  background: var(--glass);
  transition: all var(--dur-1) ease;
}

.pkg-option strong {
  font-size: 0.88rem;
  font-weight: 600;
}

.pkg-option small {
  color: var(--ink-3);
  font-size: 0.82rem;
}

.pkg-option input:hover + span {
  border-color: var(--gold-line);
}

.pkg-option input:checked + span {
  border-color: var(--gold);
  background: var(--gold-soft);
  box-shadow: 0 0 0 1px var(--gold) inset;
}

.pkg-option input:checked + span small {
  color: var(--gold-text);
  font-weight: 600;
}

.pkg-option input:focus-visible + span {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.pkg-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--hairline);
}

.pkg-price {
  font-family: var(--font-display);
  font-size: 1.9rem;
  color: var(--gold-text);
}

.pkg-price.bump {
  animation: bump 420ms var(--ease-spring);
}

.pkg-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pkg-actions .btn {
  padding-inline: 12px;
}

.fatiha-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  padding: 24px;
  border-radius: var(--radius-l);
}

.fatiha-note > div {
  flex: 1;
  min-width: 220px;
}

/* ---- pages/hadith.css ---- */
/* ---------- Hadith library ---------- */
.hadith-shell {
  padding-bottom: 32px;
}

.collection-strip {
  margin-bottom: 20px;
}

.chip-count {
  font-size: 0.72rem;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}

.hadith-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.book-panel {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100dvh - var(--header-h) - 32px);
  padding: 16px;
  border-radius: var(--radius-l);
}

.book-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.book-panel-head .card-title {
  margin: 0;
}

.book-panel-head .muted {
  font-size: 0.8rem;
}

.book-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin: 0 -6px;
  padding: 0 6px;
  list-style: none;
}

.book-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border-radius: var(--radius-s);
  border: 1px solid transparent;
  text-align: left;
}

.book-item:hover {
  background: var(--glass-2);
}

.book-item[aria-current="true"] {
  background: var(--gold-soft);
  border-color: var(--gold-line);
}

.book-num {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--gold-line);
  color: var(--gold-text);
  font-size: 0.78rem;
  font-weight: 600;
}

.book-name {
  display: grid;
  min-width: 0;
}

.book-name strong {
  font-weight: 500;
  font-size: 0.92rem;
  line-height: 1.3;
}

.book-name small {
  color: var(--ink-3);
  font-size: 0.76rem;
}

.hadith-main {
  min-width: 0;
}

.hadith-head {
  display: grid;
  gap: 16px;
  padding: 20px 22px;
  border-radius: var(--radius-l);
  margin-bottom: 12px;
}

.hadith-head h2 {
  font-size: clamp(1.3rem, 2.4vw, 1.75rem);
  margin-block: 6px 4px;
}

.hadith-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.hadith-search {
  flex: 1 1 240px;
}

.search-status:not(:empty) {
  margin: 4px 4px 12px;
  font-size: 0.9rem;
}

.hadith-list {
  display: grid;
  gap: 14px;
}

.hadith-card {
  padding: 20px 22px;
  border-radius: var(--radius);
  scroll-margin-top: calc(var(--header-h) + 20px);
}

.hadith-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.hadith-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.hadith-actions .icon-btn {
  border-color: transparent;
  background: transparent;
}

.hadith-actions .icon-btn[aria-pressed="true"] {
  color: var(--danger);
}

.hadith-ar {
  font-size: 1.35rem;
  line-height: 2.1;
  text-align: right;
  color: var(--ink);
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--hairline);
}

.hadith-en {
  color: var(--ink-2);
  font-size: 1.02rem;
  line-height: 1.75;
  white-space: pre-line;
}

.hadith-en mark {
  background: var(--gold-soft);
  color: var(--gold-text);
  border-radius: 3px;
  padding: 0 2px;
}

.hadith-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--ink-3);
}

.hadith-foot a {
  color: var(--gold-text);
}

.load-more {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.explain-quote {
  margin: 0 0 16px;
  padding: 14px 16px;
  border-left: 2px solid var(--gold);
  background: var(--glass);
  border-radius: 0 var(--radius-s) var(--radius-s) 0;
  color: var(--ink-2);
  font-size: 0.94rem;
}

.explain-quote cite {
  display: block;
  margin-top: 8px;
  font-style: normal;
  font-size: 0.82rem;
  color: var(--gold-text);
  font-weight: 600;
}

.explain-result {
  min-height: 120px;
  margin-bottom: 14px;
}

@media (max-width: 960px) {
  .hadith-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .book-panel {
    position: static;
    max-height: 360px;
  }
}

/* ---- pages/home.css ---- */
/* ---------- Home: hero ---------- */
.hero {
  position: relative;
  min-height: min(920px, calc(100svh - var(--header-h)));
  display: grid;
  align-items: center;
  padding-block: clamp(32px, 6vw, 72px);
  overflow: hidden;
}

.hero-moon {
  position: absolute;
  top: 4%;
  right: 6%;
  width: clamp(120px, 16vw, 220px);
  opacity: 0.9;
  pointer-events: none;
}

[data-theme="light"] .hero-moon {
  opacity: 0.55;
}

@media (max-width: 600px) {
  .hero-moon {
    top: 6px;
    right: 2%;
    width: 84px;
    opacity: 0.45;
  }
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.hero-basmala {
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  color: var(--gold-text);
  margin-bottom: 8px;
  text-align: start;
  direction: rtl;
  width: fit-content;
}

.hero-copy h1 {
  margin-bottom: 18px;
  line-height: 1.08;
}

.ask-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 560px;
  margin-top: 28px;
  padding: 6px 6px 6px 18px;
  border-radius: var(--radius-pill);
}

.ask-bar > .icon {
  color: var(--gold-text);
}

.ask-input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 1rem;
}

.ask-input::placeholder {
  color: var(--ink-3);
}

.ask-input:focus-visible {
  outline: none;
}

.ask-bar:focus-within {
  border-color: var(--gold-line);
  box-shadow: var(--shadow-1), 0 0 0 4px var(--gold-soft);
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

/* Next-prayer card */
.prayer-card {
  padding: 26px;
  border-radius: var(--radius-xl);
}

.pc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.pc-head .eyebrow {
  font-family: var(--font-ui);
}

.pc-loc {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 60%;
  font-size: 0.85rem;
  color: var(--ink-2);
  text-decoration: none;
}

.pc-loc span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pc-loc:hover {
  color: var(--gold-text);
}

.pc-loc .icon {
  width: 16px;
  height: 16px;
  color: var(--gold-text);
}

.pc-ring {
  position: relative;
  width: min(220px, 70%);
  margin: 18px auto 6px;
  aspect-ratio: 1;
}

.pc-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-track {
  fill: none;
  stroke: var(--hairline-2);
  stroke-width: 4;
}

.ring-fill {
  fill: none;
  stroke: url(#ring-grad);
  stroke-width: 5;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
  filter: drop-shadow(0 0 6px rgba(230, 189, 102, 0.6));
}

.pc-ring-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}

.pc-ring-center strong {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  font-weight: 600;
  line-height: 1.1;
}

.pc-ring-center span {
  color: var(--ink-2);
  font-size: 1.05rem;
}

.pc-countdown {
  text-align: center;
  color: var(--gold-text);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.pc-times {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: 18px;
  padding: 0;
  list-style: none;
}

.pc-times li {
  display: grid;
  gap: 2px;
  justify-items: center;
  padding: 10px 4px;
  border-radius: var(--radius-s);
  background: var(--glass);
  border: 1px solid var(--hairline);
  font-size: 0.78rem;
}

.pc-times li span:first-child {
  color: var(--ink-3);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.68rem;
}

.pc-times li.is-next {
  border-color: var(--gold-line);
  background: var(--gold-soft);
  color: var(--gold-text);
}

.pc-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
  font-size: 0.9rem;
  color: var(--ink-2);
}

.pc-foot .arabic {
  color: var(--gold-text);
  font-size: 1rem;
  line-height: 1.4;
}

@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero {
    min-height: 0;
  }

  .prayer-card {
    max-width: 520px;
    width: 100%;
    justify-self: center;
  }
}

/* ---------- Marquee band ---------- */
.marquee-band {
  position: relative;
  padding-block: 22px;
  border-block: 1px solid var(--hairline);
  background: linear-gradient(90deg, transparent, var(--glass), transparent);
}

.dhikr {
  display: flex;
  gap: 56px;
  padding-right: 56px;
  margin: 0;
  list-style: none;
}

.dhikr li {
  display: flex;
  align-items: baseline;
  gap: 14px;
  white-space: nowrap;
}

.dhikr .arabic {
  font-size: 1.6rem;
  line-height: 1.6;
  color: var(--gold-text);
}

.dhikr small {
  color: var(--ink-3);
  font-size: 0.9rem;
}

.dhikr li::after {
  content: '✦';
  margin-left: 42px;
  color: var(--gold-line);
}

/* ---------- Today ---------- */
.today-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

@media (max-width: 860px) {
  .today-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.daily-card {
  display: flex;
  flex-direction: column;
  min-height: 320px;
}

.daily-card > div {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.daily-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.daily-head h3 {
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-text);
  font-weight: 600;
}

.daily-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--gold-soft);
  color: var(--gold-text);
  border: 1px solid var(--gold-line);
}

.daily-arabic {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  text-align: right;
  color: var(--ink);
  margin-bottom: 12px;
}

.daily-arabic.arabic {
  font-size: clamp(1.25rem, 2.2vw, 1.55rem);
}

.daily-translation {
  color: var(--ink-2);
  font-size: 1.02rem;
}

.clamp-3,
.clamp-6 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.clamp-3 {
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.clamp-6 {
  -webkit-line-clamp: 6;
  line-clamp: 6;
}

.daily-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
  padding-top: 18px;
}

.daily-ref {
  color: var(--gold-text);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
}

.daily-ref:hover {
  text-decoration: underline;
}

/* ---------- Bento ---------- */
.bento {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(210px, auto);
  gap: 20px;
}

.bento-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 26px;
  overflow: hidden;
  text-decoration: none;
  transition: border-color var(--dur-2) ease, box-shadow var(--dur-2) ease, transform 600ms var(--ease-out);
}

.bento-tile:hover {
  border-color: var(--gold-line);
  box-shadow: var(--shadow-2), 0 0 0 1px var(--gold-soft);
}

.bento-tile h3 {
  font-size: 1.25rem;
}

.bento-tile p {
  color: var(--ink-2);
  font-size: 0.95rem;
}

.tile-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--gold-soft);
  border: 1px solid var(--gold-line);
  color: var(--gold-text);
  margin-bottom: 6px;
  transition: transform var(--dur-3) var(--ease-spring);
}

.tile-icon .icon {
  width: 24px;
  height: 24px;
}

.bento-tile:hover .tile-icon {
  transform: rotate(-8deg) scale(1.08);
}

.tile-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  color: var(--gold-text);
  font-weight: 600;
  font-size: 0.92rem;
}

.tile-link .icon {
  transition: transform var(--dur-2) var(--ease-out);
}

.bento-tile:hover .tile-link .icon {
  transform: translateX(5px);
}

.tile-quran {
  grid-column: span 2;
  grid-row: span 2;
  background:
    radial-gradient(circle at 85% 20%, var(--gold-soft), transparent 50%),
    var(--glass);
}

.tile-quran h3 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
}

.tile-quran p {
  max-width: 40ch;
  font-size: 1.02rem;
}

.tile-arabic {
  position: absolute;
  right: -10px;
  bottom: 30px;
  font-size: clamp(4rem, 9vw, 7.5rem);
  line-height: 1;
  color: var(--gold);
  opacity: 0.16;
  pointer-events: none;
}

.tile-ask,
.tile-posts {
  grid-column: span 2;
}

@media (max-width: 1020px) {
  .bento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tile-quran {
    grid-row: span 1;
  }
}

@media (max-width: 600px) {
  .bento {
    grid-template-columns: minmax(0, 1fr);
  }

  .tile-quran,
  .tile-ask,
  .tile-posts {
    grid-column: auto;
  }
}

/* ---------- Donate ---------- */
.donate {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(28px, 4vw, 56px);
  padding: clamp(24px, 4vw, 52px);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 0% 0%, var(--gold-soft), transparent 45%),
    var(--glass);
}

.donate-copy h2 {
  margin-block: 12px 14px;
}

.donate-hadith {
  display: grid;
  gap: 6px;
  margin-top: 24px;
  padding: 16px 18px;
  border-left: 2px solid var(--gold);
  background: var(--glass);
  border-radius: 0 var(--radius-s) var(--radius-s) 0;
  color: var(--ink-2);
  font-size: 0.92rem;
}

.donate-hadith .arabic {
  color: var(--gold-text);
  font-size: 1.35rem;
  line-height: 1.6;
}

.donate-panel {
  display: grid;
  gap: 20px;
  align-content: start;
}

.donate-tabpanel {
  display: grid;
  gap: 18px;
}

.amounts {
  border: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.amounts legend {
  margin-bottom: 10px;
}

.amount-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.amount {
  position: relative;
}

.amount input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.amount span {
  display: grid;
  place-items: center;
  min-height: 58px;
  border-radius: var(--radius);
  border: 1px solid var(--hairline-2);
  background: var(--glass);
  font-size: 1.2rem;
  font-weight: 600;
  transition: all var(--dur-1) ease;
}

.amount input:hover + span {
  border-color: var(--gold-line);
}

.amount input:checked + span {
  background: var(--gold-grad);
  color: var(--on-gold);
  border-color: transparent;
  box-shadow: var(--glow-gold);
}

.amount input:focus-visible + span {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.custom-amount .currency {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  font-weight: 600;
}

.custom-amount .input {
  padding-left: 36px;
}

.masjid-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.masjid-item {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 16px 10px 12px;
  border-radius: var(--radius);
  text-align: center;
  transition: border-color var(--dur-1) ease, background-color var(--dur-1) ease;
}

.masjid-item strong {
  font-size: 0.88rem;
  font-weight: 600;
}

.masjid-icon {
  color: var(--gold-text);
}

.masjid-icon .icon {
  width: 26px;
  height: 26px;
}

.masjid-price {
  font-weight: 700;
  color: var(--gold-text);
  font-size: 0.95rem;
}

.masjid-item.is-selected {
  border-color: var(--gold-line);
  background: var(--gold-soft);
}

@media (max-width: 960px) {
  .donate {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 520px) {
  .amount-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

/* ---- pages/posts.css ---- */
/* ---------- Post creator ---------- */
.creator {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 24px;
  align-items: start;
  padding-bottom: 32px;
}

.creator-preview {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius-xl);
}

.size-picker {
  border: 0;
  padding: 0;
  margin: 0;
}

/* The stage has a fixed height and ONE definite grid track. With an auto-sized track the
   canvas's percentage max-height resolves against its own 1920px bitmap and a 9:16 story
   spills out over the buttons; a definite track makes it scale down to fit, keeping its ratio. */
.canvas-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  place-items: center;
  width: 100%;
  height: min(62vh, 620px);
  padding: 10px;
  overflow: hidden;
  border-radius: var(--radius-l);
  background:
    repeating-conic-gradient(var(--glass) 0 25%, transparent 0 50%) 50% / 22px 22px,
    color-mix(in srgb, var(--bg) 50%, transparent);
}

.canvas-stage canvas {
  max-width: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  width: auto;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.6);
}

.hint.center {
  text-align: center;
}

.creator-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.creator-controls {
  display: grid;
  gap: 18px;
  padding: 22px;
  border-radius: var(--radius-xl);
}

.control-group {
  border: 0;
  padding: 0;
  margin: 0;
}

.control-group legend {
  margin-bottom: 10px;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}

.template-option {
  position: relative;
}

.template-option input,
.swatch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.template-option span {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-s);
  border: 1px solid var(--hairline-2);
  background: var(--glass);
  font-size: 0.88rem;
  font-weight: 500;
  text-align: center;
  transition: all var(--dur-1) ease;
}

.template-option input:hover + span {
  border-color: var(--gold-line);
}

.template-option input:checked + span {
  background: var(--gold-grad);
  color: var(--on-gold);
  border-color: transparent;
}

.template-option input:focus-visible + span,
.swatch input:focus-visible + span {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.swatch {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 6px;
  cursor: pointer;
}

.swatch span {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--a), var(--b));
  box-shadow: inset 0 0 0 3px var(--c), 0 0 0 2px var(--hairline-2);
  transition: transform var(--dur-1) ease, box-shadow var(--dur-1) ease;
}

.swatch input:checked + span {
  transform: scale(1.08);
  box-shadow: inset 0 0 0 3px var(--c), 0 0 0 3px var(--gold);
}

.swatch small {
  font-size: 0.74rem;
  color: var(--ink-3);
}

.inline-input {
  display: flex;
  gap: 8px;
}

.inline-input .input {
  flex: 1;
}

.arabic-input {
  font-family: var(--font-arabic);
  font-size: 1.3rem;
  line-height: 1.8;
}

.caption-box {
  display: grid;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
}

.caption-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.caption-box .textarea {
  font-size: 0.88rem;
}

@media (max-width: 960px) {
  .creator {
    grid-template-columns: minmax(0, 1fr);
  }

  .creator-preview {
    position: static;
  }

  .canvas-stage {
    height: min(70vh, 560px);
  }
}

/* ---- pages/prayer.css ---- */
/* ---------- Prayer & Qibla ---------- */
.prayer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 24px;
  padding-bottom: 32px;
}

.location-card,
.mosques-card,
.timetable-card {
  grid-column: 1 / -1;
}

.loc-current {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.loc-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--gold-soft);
  border: 1px solid var(--gold-line);
  color: var(--gold-text);
}

.loc-icon .icon {
  width: 26px;
  height: 26px;
}

.loc-text {
  flex: 1;
  min-width: 200px;
}

.loc-text h2 {
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  font-family: var(--font-display);
}

.loc-text p {
  font-size: 0.88rem;
}

.loc-date {
  display: grid;
  text-align: right;
  gap: 2px;
}

.loc-date span {
  color: var(--gold-text);
  font-weight: 500;
}

.loc-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.place-search {
  position: relative;
  flex: 1 1 280px;
  max-width: 460px;
}

.place-results {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 320px;
  overflow-y: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  border-radius: var(--radius);
  background: var(--glass-strong);
}

.place-results li {
  display: grid;
  padding: 10px 12px;
  border-radius: var(--radius-s);
  cursor: pointer;
}

.place-results li span {
  font-size: 0.84rem;
}

.place-results li[aria-selected="true"],
.place-results li:hover {
  background: var(--gold-soft);
}

.place-results .place-empty {
  cursor: default;
  color: var(--ink-3);
}

.place-results .place-empty:hover {
  background: transparent;
}

[data-loc-status]:not(:empty) {
  margin-top: 10px;
}

.calc-settings {
  margin-top: 18px;
  border-top: 1px solid var(--hairline);
  padding-top: 14px;
}

.calc-settings summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 600;
  color: var(--ink-2);
  list-style: none;
}

.calc-settings summary::-webkit-details-marker {
  display: none;
}

.calc-settings summary:hover {
  color: var(--gold-text);
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-block: 16px 10px;
}

.calc-grid fieldset {
  border: 0;
  padding: 0;
}

/* Today */
.next-chip {
  display: grid;
  justify-items: end;
  text-align: right;
  font-size: 0.85rem;
}

.next-chip strong {
  font-family: var(--font-display);
  font-size: 1.4rem;
  line-height: 1.2;
}

.times-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.time-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  background: var(--glass);
  transition: border-color var(--dur-2) ease, background-color var(--dur-2) ease;
}

.time-name {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.time-name strong {
  font-size: 1.08rem;
  font-weight: 600;
}

.time-name .arabic {
  color: var(--ink-3);
  font-size: 1.05rem;
  line-height: 1.2;
}

.time-val {
  font-size: 1.25rem;
  font-weight: 600;
  min-width: 92px;
  text-align: right;
}

.time-row.is-sunrise {
  opacity: 0.75;
}

.time-row.is-sunrise .time-name strong {
  font-weight: 500;
}

.time-row.is-next {
  border-color: var(--gold-line);
  background: var(--gold-soft);
  box-shadow: var(--glow-gold);
}

.time-row.is-next .time-val {
  color: var(--gold-text);
}

.time-row.is-now {
  border-color: color-mix(in srgb, var(--success) 40%, transparent);
}

.night-times {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0 0;
}

.night-times div {
  padding: 12px 16px;
  border-radius: var(--radius-s);
  border: 1px dashed var(--hairline-2);
}

.night-times dt {
  font-size: 0.78rem;
  color: var(--ink-3);
}

.night-times dd {
  margin: 0;
  font-weight: 600;
}

.notify-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
}

/* Qibla */
.qibla-card {
  display: flex;
  flex-direction: column;
}

.compass {
  position: relative;
  width: min(320px, 100%);
  margin: 4px auto 10px;
  color: var(--ink);
}

.compass svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.dial-outer {
  fill: none;
  stroke: var(--gold-line);
  stroke-width: 1.5;
}

.tick {
  stroke: var(--ink-3);
  stroke-width: 1;
}

.tick-major {
  stroke: var(--ink-2);
  stroke-width: 2;
}

.dial-degree {
  fill: var(--ink-3);
  font-size: 11px;
  font-family: var(--font-ui);
}

.dial-cardinal {
  fill: var(--ink);
  font-size: 17px;
  font-weight: 700;
  font-family: var(--font-display);
}

.dial-cardinal.is-north {
  fill: var(--danger);
}

.qibla-line {
  stroke: var(--gold);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 2 6;
}

.kaaba-body {
  fill: #121212;
  stroke: var(--gold);
  stroke-width: 1.5;
}

.kaaba-band {
  fill: var(--gold);
}

.heading-marker {
  fill: var(--gold);
}

.dial-hub {
  fill: var(--gold);
  stroke: var(--bg);
  stroke-width: 3;
}

.compass.is-aligned .dial-outer {
  stroke: var(--success);
  stroke-width: 3;
  filter: drop-shadow(0 0 10px var(--success));
}

.compass.is-aligned .heading-marker {
  fill: var(--success);
}

.qibla-readout {
  text-align: center;
  font-size: 1.05rem;
  color: var(--ink-2);
}

.qibla-readout strong {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--gold-text);
}

.qibla-live {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-top: 12px;
  text-align: center;
}

/* Mosques */
.mosques-card {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
}

.mosques-card > div:nth-child(2) {
  flex: 1;
  min-width: 200px;
}

.mosque-art {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: var(--gold-soft);
  border: 1px solid var(--gold-line);
  color: var(--gold-text);
}

.mosque-art .icon {
  width: 32px;
  height: 32px;
}

.mosque-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Timetable */
.tt-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tt-month {
  min-width: 150px;
  text-align: center;
  font-weight: 600;
}

.timetable th[scope="row"] {
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.92rem;
  background: transparent;
  border-bottom: 1px solid var(--hairline);
}

.tt-day {
  display: inline-block;
  min-width: 22px;
  font-weight: 700;
}

.timetable tr.is-today td,
.timetable tr.is-today th {
  background: var(--gold-soft);
  color: var(--ink);
}

.timetable tr.is-today th {
  box-shadow: inset 3px 0 0 var(--gold);
}

@media (max-width: 960px) {
  .prayer-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .loc-date {
    text-align: left;
  }
}

@media (max-width: 520px) {
  .time-row {
    padding: 12px 14px;
  }

  .time-name {
    flex-direction: column;
    gap: 0;
  }

  .night-times {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media print {
  .prayer-layout {
    display: block;
  }

  .times-card {
    display: none;
  }

  .timetable-card {
    border: 0;
    box-shadow: none;
    background: #fff;
    color: #000;
    backdrop-filter: none;
  }

  .timetable-card .card-title,
  .timetable-card .card-sub,
  .timetable td,
  .timetable th {
    color: #000 !important;
  }

  .table-wrap {
    overflow: visible;
    border: 0;
  }

  .timetable {
    font-size: 10pt;
  }

  .timetable td,
  .timetable th {
    padding: 4px 6px;
  }
}

/* ---- pages/quran.css ---- */
/* ---------- Quran reader ---------- */
.quran-shell {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  padding-block: 24px 40px;
}

.surah-panel {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - var(--header-h) - 32px);
  padding: 14px;
  border-radius: var(--radius-l);
}

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

.surah-panel-head .tabs {
  flex: 1;
}

.surah-panel-close {
  display: none;
}

.surah-tabpanel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.surah-search {
  margin-bottom: 10px;
}

.surah-list,
.bookmark-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin: 0 -6px;
  padding: 0 6px;
  list-style: none;
}

.surah-item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px;
  border-radius: var(--radius-s);
  text-align: left;
  border: 1px solid transparent;
  transition: background-color var(--dur-1) ease, border-color var(--dur-1) ease;
}

.surah-item:hover {
  background: var(--glass-2);
}

.surah-item[aria-current="true"] {
  background: var(--gold-soft);
  border-color: var(--gold-line);
}

.surah-num {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-inline: auto;
  transform: rotate(45deg);
  border: 1px solid var(--gold-line);
  border-radius: 8px;
  color: var(--gold-text);
  font-size: 0.8rem;
  font-weight: 600;
}

.surah-num span {
  transform: rotate(-45deg);
}

.surah-names {
  display: grid;
  min-width: 0;
}

.surah-names strong {
  font-weight: 600;
  font-size: 0.95rem;
}

.surah-names small {
  color: var(--ink-3);
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.surah-ar {
  font-size: 1.15rem;
  line-height: 1.4;
  color: var(--gold-text);
}

.bookmark-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.bookmark-open {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-s);
  text-align: left;
}

.bookmark-open:hover {
  background: var(--glass-2);
}

.bookmark-open .icon {
  color: var(--gold-text);
}

.bookmark-open span {
  display: grid;
}

.bookmark-open small {
  color: var(--ink-3);
}

/* Reader header */
.reader {
  min-width: 0;
}

.reader-head {
  position: sticky;
  top: calc(var(--header-h) + 10px);
  z-index: 5;
  display: grid;
  gap: 14px;
  padding: 18px 20px;
  border-radius: var(--radius-l);
  background: var(--glass-strong);
  margin-bottom: 18px;
}

.reader-title {
  display: flex;
  align-items: center;
  gap: 16px;
}

.reader-heading {
  min-width: 0;
  flex: 1;
}

.reader-heading h1 {
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  margin: 0;
}

.reader-heading p {
  font-size: 0.9rem;
}

.reader-arabic {
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
  line-height: 1.3;
  color: var(--gold-text);
}

.surah-toggle {
  display: none;
}

.reader-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.field.compact {
  gap: 4px;
}

.field.compact > label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.field.compact .select {
  min-height: 40px;
  padding-block: 8px;
  font-size: 0.9rem;
  max-width: 280px;
}

.reader-settings {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  padding-top: 14px;
  border-top: 1px solid var(--hairline);
}

.font-size {
  display: flex;
  align-items: center;
  gap: 8px;
}

.font-size .field-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.font-size output {
  min-width: 18px;
  text-align: center;
  font-weight: 600;
}

/* Verses */
.ayahs {
  --ayah-size: 2.1rem;
  display: grid;
  gap: 14px;
}

.basmala {
  text-align: center;
  font-size: calc(var(--ayah-size) * 1.05);
  color: var(--gold-text);
  padding: 18px 0 8px;
}

.ayah {
  position: relative;
  padding: 18px 22px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  background: var(--glass);
  scroll-margin-top: calc(var(--header-h) + 200px);
  transition: border-color var(--dur-2) ease, background-color var(--dur-2) ease, box-shadow var(--dur-2) ease;
}

.ayah:hover {
  border-color: var(--hairline-2);
}

.ayah.is-playing {
  border-color: var(--gold-line);
  background: var(--gold-soft);
  box-shadow: var(--glow-gold);
}

.ayah-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.ayah-num {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gold-text);
  letter-spacing: 0.06em;
}

.ayah-actions {
  display: flex;
  gap: 4px;
  opacity: 0.75;
  transition: opacity var(--dur-1) ease;
}

.ayah:hover .ayah-actions,
.ayah:focus-within .ayah-actions,
.ayah.is-playing .ayah-actions {
  opacity: 1;
}

.ayah-actions .icon-btn {
  border-color: transparent;
  background: transparent;
}

.ayah-actions .icon-btn:hover {
  border-color: var(--gold-line);
}

.ayah-arabic {
  font-size: var(--ayah-size);
  text-align: right;
  color: var(--ink);
  margin-block: 6px 12px;
}

.ayah-end {
  color: var(--gold-text);
  font-size: 0.9em;
  white-space: nowrap;
}

.ayah-translit {
  color: var(--emerald-text);
  font-style: italic;
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.ayah-trans {
  color: var(--ink-2);
  font-size: 1.04rem;
  line-height: 1.7;
}

.ayah-trans[dir="rtl"] {
  font-family: var(--font-arabic);
  font-size: 1.3rem;
  line-height: 2;
}

.ayah-tafsir {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: var(--radius-s);
  border: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--bg) 40%, transparent);
  max-height: 460px;
  overflow-y: auto;
}

.tafsir-source {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gold-text);
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.tafsir-body {
  color: var(--ink-2);
  font-size: 0.96rem;
  line-height: 1.75;
}

.tafsir-body > * + * {
  margin-top: 0.8em;
}

.tafsir-body h4,
.tafsir-body h5 {
  color: var(--ink);
  font-size: 1rem;
}

.tafsir-body[dir="rtl"] {
  font-family: var(--font-arabic);
  font-size: 1.2rem;
  line-height: 2;
}

.tafsir-body [dir="auto"] {
  font-family: var(--font-arabic);
}

.surah-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
}

.surah-nav [data-next-surah] {
  margin-left: auto;
}

/* Bottom player */
.player {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: min(980px, calc(100vw - 24px));
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) auto minmax(0, 1.4fr) auto auto;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-l);
  background: var(--glass-strong);
  box-shadow: var(--shadow-2);
  animation: pop-in var(--dur-2) var(--ease-out);
}

.player-info {
  display: grid;
  min-width: 0;
}

.player-info strong,
.player-info span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-info span {
  font-size: 0.82rem;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.player-main {
  width: 48px;
  height: 48px;
  background: var(--gold-grad);
  color: var(--on-gold);
  border: 0;
}

.player-main:hover {
  color: var(--on-gold);
}

.player-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--ink-3);
}

.player-progress input {
  flex: 1;
  accent-color: var(--gold);
}

.player-auto {
  font-size: 0.82rem;
}

body.has-player .site-footer {
  padding-bottom: 96px;
}

@media (max-width: 960px) {
  .quran-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .surah-toggle {
    display: inline-flex;
  }

  .surah-panel {
    position: fixed;
    z-index: 60;
    inset: calc(var(--header-h) + 8px) 8px 8px;
    max-height: none;
    background: var(--glass-strong);
    visibility: hidden;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity var(--dur-2) ease, transform var(--dur-2) var(--ease-out), visibility 0s linear var(--dur-2);
  }

  .surah-panel.is-open {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: opacity var(--dur-2) ease, transform var(--dur-2) var(--ease-out);
  }

  .surah-panel-close {
    display: inline-grid;
  }

  body.sheet-open {
    overflow: hidden;
  }

  .reader-head {
    position: static;
  }

  .reader-arabic {
    display: none;
  }

  .player {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 10px;
  }

  .player-progress {
    grid-column: 1 / -1;
    order: 4;
  }

  .player-auto {
    display: none;
  }
}

@media (max-width: 560px) {
  .ayah {
    padding: 14px 14px 16px;
  }

  .reader-controls .field.compact {
    flex: 1 1 140px;
  }

  .reader-controls .field.compact .select {
    max-width: none;
  }
}
