:root {
  --bg: #faf7f2;
  --bg-subtle: #f2ece1;
  --surface: #ffffff;
  --surface-hover: #fbf9f5;
  --ink: #182320;
  --ink-secondary: #4e5f5a;
  --ink-muted: #788883;
  --accent: #14453d;
  --accent-soft: rgba(20, 69, 61, 0.08);
  --accent-strong: #0e352f;
  --gold: #a98643;
  --gold-soft: rgba(169, 134, 67, 0.14);
  --border: rgba(20, 69, 61, 0.11);
  --border-gold: rgba(169, 134, 67, 0.25);
  --shadow-card: 0 14px 40px -18px rgba(17, 46, 40, 0.14), 0 2px 8px -2px rgba(17, 46, 40, 0.05);
  --shadow-sm: 0 2px 8px rgba(17, 46, 40, 0.06);
  --radius-xl: 26px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-pill: 999px;
  --font-scale: 1;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', sans-serif;
  --font-serif: 'Lora', 'Iowan Old Style', Georgia, serif;
  --font-arabic: 'Amiri', 'Geeza Pro', 'Arabic Typesetting', 'Traditional Arabic', serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
  --bg: #0b1412;
  --bg-subtle: #12201d;
  --surface: #111e1b;
  --surface-hover: #162622;
  --ink: #eef2ef;
  --ink-secondary: #b4c3be;
  --ink-muted: #7e928c;
  --accent: #4ec4a5;
  --accent-soft: rgba(78, 196, 165, 0.12);
  --accent-strong: #67d6b9;
  --gold: #dfc083;
  --gold-soft: rgba(223, 192, 131, 0.14);
  --border: rgba(223, 192, 131, 0.13);
  --border-gold: rgba(223, 192, 131, 0.24);
  --shadow-card: 0 20px 50px -20px rgba(0, 0, 0, 0.65), 0 2px 10px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
}

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

html {
  -webkit-text-size-adjust: 100%;
  color-scheme: light dark;
}

body {
  margin: 0;
  min-height: 100dvh;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

/* Ambient radial glow + subtle geometric lattice */
.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 75% 45% at 50% -10%, var(--gold-soft), transparent 70%),
    radial-gradient(ellipse 60% 45% at 85% 95%, var(--accent-soft), transparent 70%);
}

.app-shell {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: max-width 0.35s var(--ease-out);
}

/* Header */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 2px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--accent);
  color: #f6e7c7;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

[data-theme="dark"] .brand-mark {
  background: #17352f;
  color: var(--gold);
  border: 1px solid var(--border-gold);
}

.brand-mark svg {
  width: 24px;
  height: 24px;
}

.brand-text {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-arabic {
  font-family: var(--font-arabic);
  font-size: 1.2rem;
  color: var(--gold);
  font-weight: 700;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-secondary);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

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

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

.icon-btn svg {
  width: 19px;
  height: 19px;
}

.font-btn-label {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.layout-btn {
  display: none;
}

.badge-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--radius-pill);
  background: var(--gold);
  color: #111;
  font-size: 0.65rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  line-height: 1;
}

.badge-dot[hidden] {
  display: none;
}

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

/* Date & Navigation Strip */
.date-strip {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.date-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.84rem;
  color: var(--ink-secondary);
  padding: 0 2px;
}

.date-hijri {
  font-weight: 600;
  color: var(--gold);
}

.date-sep {
  opacity: 0.45;
}

.day-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-pill {
  height: 36px;
  min-width: 36px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-secondary);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.nav-pill:hover {
  border-color: var(--border-gold);
  color: var(--ink);
}

.nav-pill:active {
  transform: scale(0.96);
}

.nav-pill svg {
  width: 15px;
  height: 15px;
}

.nav-pill-today.is-current {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}

.nav-pill-shuffle {
  margin-left: auto;
  padding: 0 14px;
  color: var(--accent);
  background: var(--accent-soft);
  border-color: transparent;
}

.nav-pill-shuffle:hover {
  background: var(--accent);
  color: #ffffff;
}

[data-theme="dark"] .nav-pill-shuffle:hover {
  color: #0b1412;
}

/* Segmented Tab Switcher */
.tab-switcher {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border-radius: 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
}

.tab-indicator {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.32s var(--ease-out);
  z-index: 0;
}

.tab-switcher[data-active="hadith"] .tab-indicator {
  transform: translateX(100%);
}

.tab-btn {
  position: relative;
  z-index: 1;
  height: 42px;
  border: none;
  background: transparent;
  color: var(--ink-secondary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 12px;
  transition: color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.tab-btn.is-active {
  color: var(--ink);
}

/* Main Card Stage */
.cards-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.reflection-card {
  display: none;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-xl);
  padding: 22px 20px 16px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  animation: cardFadeIn 0.35s var(--ease-out);
}

.reflection-card.is-visible {
  display: flex;
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-ornament {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
  color: var(--gold);
}

.card-ornament svg {
  width: 120px;
  height: 14px;
}

.card-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 20px;
}

.type-pill {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
}

.theme-pill {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  background: var(--gold-soft);
  color: var(--gold);
}

.card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.arabic-text {
  margin: 0 0 22px;
  font-family: var(--font-arabic);
  font-size: calc(1.78rem * var(--font-scale));
  line-height: 2.15;
  text-align: right;
  color: var(--ink);
  word-spacing: 0.04em;
}

.arabic-hadith {
  font-size: calc(1.42rem * var(--font-scale));
  line-height: 2.05;
}

.english-text {
  margin: 0 0 22px;
  font-family: var(--font-serif);
  font-size: calc(1.08rem * var(--font-scale));
  line-height: 1.75;
  color: var(--ink-secondary);
  white-space: pre-line;
}

/* Audio Player Bar */
.audio-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: 18px;
  border-radius: var(--radius-lg);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
}

.audio-bar[hidden] {
  display: none;
}

.audio-play-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #ffffff;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s ease, background-color 0.2s ease;
}

[data-theme="dark"] .audio-play-btn {
  color: #0b1412;
}

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

.audio-play-btn svg {
  width: 16px;
  height: 16px;
}

.audio-play-btn .icon-pause { display: none; }
.audio-play-btn.is-playing .icon-play { display: none; }
.audio-play-btn.is-playing .icon-pause { display: block; }

.audio-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.audio-track {
  height: 5px;
  border-radius: var(--radius-pill);
  background: var(--border);
  overflow: hidden;
  cursor: pointer;
}

.audio-progress {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: var(--radius-pill);
  transition: width 0.12s linear;
}

.audio-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  color: var(--ink-muted);
  font-weight: 500;
}

/* Source Row */
.source-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0 18px;
  border-top: 1px solid var(--border);
}

.source-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.source-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
}

.source-sub {
  font-size: 0.76rem;
  color: var(--ink-muted);
}

.source-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  flex-shrink: 0;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.source-link:hover {
  background: var(--accent);
  color: #ffffff;
}

[data-theme="dark"] .source-link:hover {
  color: #0b1412;
}

.source-link svg {
  width: 13px;
  height: 13px;
}

/* Card Action Bar */
.card-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.action-btn {
  min-height: 46px;
  border-radius: 13px;
  border: 1px solid transparent;
  background: var(--bg-subtle);
  color: var(--ink-secondary);
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.action-btn svg {
  width: 17px;
  height: 17px;
}

.action-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.action-btn:active {
  transform: scale(0.96);
}

.action-btn[aria-pressed="true"] {
  background: var(--gold-soft);
  color: var(--gold);
  border-color: var(--border-gold);
}

.action-btn[aria-pressed="true"] svg {
  fill: currentColor;
}

/* Skeleton Loader */
.skeleton-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 0 28px;
}

.skeleton-block[hidden] {
  display: none;
}

.skel {
  height: 16px;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--bg-subtle) 25%, var(--border) 50%, var(--bg-subtle) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
}

.skel-ar {
  height: 26px;
  width: 100%;
  align-self: flex-end;
}

.skel-ar.short {
  width: 68%;
  margin-bottom: 14px;
}

.skel-en.short {
  width: 55%;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 8px 0 4px;
  font-size: 0.75rem;
  color: var(--ink-muted);
}

.site-footer p {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.site-footer a {
  color: var(--ink-secondary);
  text-decoration: none;
  font-weight: 600;
}

.site-footer a:hover {
  color: var(--accent);
}

/* Bookmarks Drawer / Bottom Sheet */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 16, 14, 0.48);
  backdrop-filter: blur(4px);
  z-index: 40;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.drawer-backdrop.is-open {
  opacity: 1;
}

.bookmarks-drawer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 82dvh;
  background: var(--surface);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  border-top: 1px solid var(--border-gold);
  box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.22);
  z-index: 50;
  display: flex;
  flex-direction: column;
  transform: translateY(105%);
  transition: transform 0.34s var(--ease-out);
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}

.bookmarks-drawer.is-open {
  transform: translateY(0);
}

.drawer-handle {
  width: 40px;
  height: 4px;
  border-radius: var(--radius-pill);
  background: var(--border-gold);
  margin: 10px auto 4px;
}

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

.drawer-header h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.drawer-list {
  overflow-y: auto;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bookmark-empty {
  text-align: center;
  padding: 36px 16px;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.bookmark-item {
  padding: 14px;
  border-radius: var(--radius-lg);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bookmark-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--accent);
}

.bookmark-item-text {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bookmark-item-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--ink-muted);
}

.bookmark-remove {
  border: none;
  background: transparent;
  color: var(--ink-muted);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
}

.bookmark-remove:hover {
  background: rgba(200, 60, 60, 0.12);
  color: #c94a4a;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  transform: translate(-50%, 24px);
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--bg);
  font-size: 0.84rem;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.24);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s var(--ease-out);
  z-index: 60;
  white-space: nowrap;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Tablet & Desktop Enhancements */
@media (min-width: 640px) {
  .app-shell {
    padding: 24px 24px 32px;
    gap: 20px;
  }

  .date-strip {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .reflection-card {
    padding: 30px 32px 22px;
  }

  .action-btn {
    flex-direction: row;
    gap: 8px;
    font-size: 0.82rem;
  }

  .bookmarks-drawer {
    top: 0;
    left: auto;
    right: 0;
    bottom: 0;
    width: 400px;
    max-width: 92vw;
    max-height: 100dvh;
    border-radius: 0;
    border-top: none;
    border-left: 1px solid var(--border-gold);
    transform: translateX(105%);
  }

  .bookmarks-drawer.is-open {
    transform: translateX(0);
  }

  .drawer-handle {
    display: none;
  }
}

@media (min-width: 960px) {
  .layout-btn {
    display: grid;
  }

  body.desktop-split .app-shell {
    max-width: 1120px;
  }

  body.desktop-split .tab-switcher {
    display: none;
  }

  body.desktop-split .cards-stage {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
  }

  body.desktop-split .reflection-card {
    display: flex;
    height: 100%;
  }
}

/* Instagram Share Card Studio Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 13, 11, 0.68);
  backdrop-filter: blur(6px);
  z-index: 70;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal-backdrop.is-open {
  opacity: 1;
}

.card-modal {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 104%);
  width: 100%;
  max-width: 520px;
  max-height: 94dvh;
  background: var(--surface);
  border-top-left-radius: 26px;
  border-top-right-radius: 26px;
  border: 1px solid var(--border-gold);
  border-bottom: none;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.35);
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 18px max(18px, env(safe-area-inset-bottom));
  overflow-y: auto;
  transition: transform 0.34s var(--ease-out), opacity 0.25s ease;
}

.card-modal[hidden] {
  display: none;
}

.card-modal.is-open {
  transform: translate(-50%, 0);
}

.card-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card-modal-header h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.card-modal-sub {
  margin: 2px 0 0;
  font-size: 0.76rem;
  color: var(--ink-muted);
}

.card-preview-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 12px;
  min-height: 240px;
}

.card-preview-wrap canvas {
  max-width: 100%;
  max-height: 44dvh;
  width: auto;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.24);
  display: block;
}

.card-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.control-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  min-width: 52px;
}

.pill-group {
  display: flex;
  gap: 6px;
  flex: 1;
}

.studio-pill {
  flex: 1;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--ink-secondary);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.studio-pill.is-active {
  background: var(--accent);
  color: #ffffff;
  border-color: transparent;
}

[data-theme="dark"] .studio-pill.is-active {
  color: #0b1412;
}

.swatch-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  padding: 0;
}

.theme-swatch[data-card-theme="emerald"] {
  background: linear-gradient(135deg, #164b42, #091c18);
  box-shadow: inset 0 0 0 2px rgba(223, 192, 131, 0.5);
}

.theme-swatch[data-card-theme="parchment"] {
  background: linear-gradient(135deg, #fdfaf3, #eadec8);
  box-shadow: inset 0 0 0 2px rgba(169, 134, 67, 0.45);
}

.theme-swatch[data-card-theme="noir"] {
  background: linear-gradient(135deg, #222326, #0b0c0e);
  box-shadow: inset 0 0 0 2px rgba(229, 198, 135, 0.55);
}

.theme-swatch[data-card-theme="dusk"] {
  background: linear-gradient(135deg, #1b2848, #4d2c3d);
  box-shadow: inset 0 0 0 2px rgba(242, 203, 146, 0.5);
}

.theme-swatch.is-active {
  transform: scale(1.12);
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent);
}

.arabic-toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-secondary);
  cursor: pointer;
  user-select: none;
}

.arabic-toggle input {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.card-modal-actions {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 10px;
  padding-top: 4px;
}

.studio-btn {
  height: 46px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.2s ease, background-color 0.2s ease;
}

.studio-btn:active {
  transform: scale(0.97);
}

.studio-btn svg {
  width: 18px;
  height: 18px;
}

.studio-btn-primary {
  background: var(--accent);
  color: #ffffff;
}

[data-theme="dark"] .studio-btn-primary {
  color: #0b1412;
}

.studio-btn-secondary {
  background: var(--bg-subtle);
  color: var(--ink);
  border-color: var(--border);
}

.studio-btn-secondary:hover {
  border-color: var(--border-gold);
}

@media (min-width: 640px) {
  .card-modal {
    top: 50%;
    bottom: auto;
    border-radius: 26px;
    border-bottom: 1px solid var(--border-gold);
    transform: translate(-50%, -46%) scale(0.97);
    opacity: 0;
    padding: 22px;
  }

  .card-modal.is-open {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}
