@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700;800&display=swap");

/* ============================================================
   Design Tokens
   ============================================================ */

:root {
  /* Surfaces */
  --bg: #faf7f2;
  --bg-warm: #f5f0e8;
  --surface: #fffefb;
  --surface-soft: #f5f1ea;
  --surface-elevated: #ffffff;

  /* Ink */
  --ink: #2a2520;
  --ink-2: #4a4239;
  --ink-3: #6b6258;
  --muted: #8b8275;
  --muted-2: #b5ac9d;

  /* Lines */
  --line: #e8e0d4;
  --line-soft: #f0ebe2;
  --line-strong: #d4cab8;

  /* Brand: Deep Indigo */
  --indigo: #3d3b7c;
  --indigo-deep: #2a2859;
  --indigo-light: #5d5ba8;
  --indigo-soft: #eeedf8;
  --indigo-tint: #f5f4fb;

  /* Accent: Warm Amber */
  --amber: #c8923d;
  --amber-deep: #a6772e;
  --amber-light: #dbb06a;
  --amber-soft: #fbf3e4;
  --amber-glow: #f5e6c8;

  /* Semantic */
  --sage: #5b8c5a;
  --sage-deep: #436a43;
  --sage-soft: #eaf2e9;
  --terra: #c65d3c;
  --terra-soft: #fbede8;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(42, 37, 32, 0.04);
  --shadow-sm: 0 2px 8px rgba(42, 37, 32, 0.06);
  --shadow-md: 0 8px 24px rgba(42, 37, 32, 0.08);
  --shadow-lg: 0 20px 60px rgba(42, 37, 32, 0.10);
  --shadow-xl: 0 32px 80px rgba(42, 37, 32, 0.14);
  --shadow-indigo: 0 8px 24px rgba(61, 59, 124, 0.18);
  --shadow-amber: 0 8px 24px rgba(200, 146, 61, 0.20);

  /* Radii */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-2xl: 32px;
  --r-full: 9999px;

  /* Spacing */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;
  --s-20: 80px;
  --s-24: 96px;

  /* Transitions */
  --t-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-bounce: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Typography */
  --font-display: "Fraunces", "Noto Serif SC", "Songti SC", Georgia, "Times New Roman", serif;
  --font-body: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "SF Mono", "Fira Code", "JetBrains Mono", "Noto Sans Mono", monospace;

  color: var(--ink);
  background: var(--bg);
  font-family: var(--font-body);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   Reset
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse at 20% -5%, rgba(200, 146, 61, 0.06), transparent 45%),
    radial-gradient(ellipse at 80% 100%, rgba(61, 59, 124, 0.05), transparent 45%),
    var(--bg);
  background-attachment: fixed;
}

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

button,
select {
  cursor: pointer;
}

button {
  border: 0;
  background: none;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

textarea {
  resize: vertical;
}

/* Focus */

button:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2.5px solid var(--indigo-light);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* Scrollbar */

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

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: var(--r-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--muted-2);
}

/* ============================================================
   App Shell
   ============================================================ */

.app-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--s-6);
  min-height: 100vh;
  overflow-x: clip;
}

/* ============================================================
   Top Navigation
   ============================================================ */

.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-5) 0;
  gap: var(--s-6);
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 247, 242, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line-soft);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  cursor: pointer;
  transition: opacity var(--t-fast);
}

.brand:hover {
  opacity: 0.8;
}

.brand-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--indigo) 0%, var(--indigo-deep) 100%);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-text strong {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.brand-text small {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--s-6);
  min-width: 0;
}

.nav-links {
  display: flex;
  gap: var(--s-6);
}

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-3);
  transition: color var(--t-fast);
  position: relative;
}

.nav-links a:hover {
  color: var(--indigo);
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--amber);
  border-radius: var(--r-full);
  transition: width var(--t-normal);
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-accounts {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  min-width: 0;
}

.nav-account {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  transition: all var(--t-fast);
  cursor: pointer;
  white-space: nowrap;
}

.nav-account.local:hover:not(:disabled) {
  border-color: var(--indigo-light);
  color: var(--indigo);
  background: var(--indigo-soft);
}

.nav-account.cloud {
  opacity: 0.75;
  cursor: not-allowed;
  color: var(--muted);
  background: var(--surface-soft);
}

.account-soon {
  margin-inline-start: var(--s-1);
  padding: 1px 5px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--amber-deep);
  background: var(--amber-soft);
  border-radius: var(--r-full);
}

[dir="rtl"] .account-soon {
  text-transform: none;
}

.nav-lang {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--muted);
  min-width: 0;
}

.nav-lang select {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--s-2) var(--s-3);
  font-size: 13px;
  font-weight: 500;
  background: var(--surface);
  color: var(--ink-2);
  transition: all var(--t-fast);
  max-width: 100%;
}

.nav-lang select:hover {
  border-color: var(--line-strong);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-5);
  border-radius: var(--r-full);
  font-size: 14px;
  font-weight: 600;
  background: var(--ink);
  color: #fff;
  transition: all var(--t-fast);
}

.nav-cta:hover {
  background: var(--indigo-deep);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* ============================================================
   Buttons
   ============================================================ */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-6);
  border-radius: var(--r-full);
  font-size: 15px;
  font-weight: 600;
  background: var(--indigo);
  color: #fff;
  transition: all var(--t-fast);
  white-space: nowrap;
}

.btn-primary:hover:not(:disabled) {
  background: var(--indigo-deep);
  transform: translateY(-1px);
  box-shadow: var(--shadow-indigo);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary.large {
  padding: var(--s-4) var(--s-8);
  font-size: 16px;
}

.btn-primary.full {
  width: 100%;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-6);
  border-radius: var(--r-full);
  font-size: 15px;
  font-weight: 600;
  background: transparent;
  color: var(--ink-2);
  border: 1.5px solid var(--line);
  transition: all var(--t-fast);
  white-space: nowrap;
}

.btn-ghost:hover {
  background: var(--surface-soft);
  border-color: var(--line-strong);
}

.btn-amber {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-5);
  border-radius: var(--r-full);
  font-size: 14px;
  font-weight: 600;
  background: var(--amber-soft);
  color: var(--amber-deep);
  border: 1px solid var(--amber-glow);
  transition: all var(--t-fast);
}

.btn-amber:hover {
  background: var(--amber-glow);
}

.btn-amber.active {
  background: var(--amber);
  color: #fff;
  border-color: var(--amber);
}

.btn-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  color: var(--ink-3);
  transition: all var(--t-fast);
}

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

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-6);
  border-radius: var(--r-full);
  font-size: 15px;
  font-weight: 600;
  background: var(--terra);
  color: #fff;
  transition: all var(--t-fast);
  white-space: nowrap;
}

.btn-danger:hover:not(:disabled) {
  background: var(--terra-deep);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* ============================================================
   Home: Hero
   ============================================================ */

.home {
  padding-bottom: var(--s-20);
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: var(--s-12);
  align-items: center;
  padding: var(--s-16) 0 var(--s-12);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-1) var(--s-4);
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 600;
  background: var(--amber-soft);
  color: var(--amber-deep);
  border: 1px solid var(--amber-glow);
  margin-bottom: var(--s-5);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: var(--s-5);
}

.hero h1 em {
  font-style: italic;
  color: var(--indigo);
}

.hero-body {
  font-size: 18px;
  line-height: 1.65;
  color: var(--ink-3);
  max-width: 520px;
  margin-bottom: var(--s-8);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  flex-wrap: wrap;
}

.hero-local {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: 13px;
  color: var(--muted);
  margin-top: var(--s-5);
}

.community-stats {
  width: min(100%, 720px);
  margin: var(--s-8) auto 0;
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.46);
}

.community-stats-title {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  justify-content: center;
  margin-bottom: var(--s-2);
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 700;
}

.community-stats-title span {
  width: 8px;
  height: 8px;
  border-radius: var(--r-full);
  background: var(--sage);
  box-shadow: 0 0 0 4px rgba(96, 139, 98, 0.12);
}

.community-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s-1);
}

.community-stat {
  min-width: 0;
  padding: 0 var(--s-2);
  border-right: 1px solid var(--line-soft);
  text-align: center;
}

.community-stat:last-child {
  border-right: 0;
}

.community-stat strong {
  display: inline;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1;
  margin-right: 4px;
}

.community-stat small {
  display: inline;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

/* Hero Visual: Progressive accumulation demo */

.hero-visual {
  position: relative;
}

.accumulation-demo {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.accum-day {
  display: flex;
  align-items: stretch;
  gap: var(--s-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s-4) var(--s-5);
  box-shadow: var(--shadow-sm);
  animation: slideInUp var(--t-slow) both;
}

.accum-day:nth-child(1) { animation-delay: 0ms; }

.accum-day:nth-child(2) { animation-delay: 120ms; }

.accum-day:nth-child(3) { animation-delay: 240ms; }

.accum-day:nth-child(4) { animation-delay: 360ms; }

.accum-day-num {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  background: var(--indigo-soft);
  color: var(--indigo);
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.accum-day.active .accum-day-num {
  background: var(--indigo);
  color: #fff;
}

.accum-day-body {
  flex: 1;
  min-width: 0;
}

.accum-day-body strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: var(--s-1);
}

.accum-day-body p {
  font-family: var(--font-display);
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  font-weight: 400;
  font-style: italic;
}

.accum-day.active .accum-day-body p {
  color: var(--ink);
}

.accum-day-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1);
  margin-top: var(--s-2);
}

.accum-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--r-full);
  background: var(--surface-soft);
  color: var(--muted);
}

.accum-tag.new {
  background: var(--amber-soft);
  color: var(--amber-deep);
}

.accum-tag.review {
  background: var(--sage-soft);
  color: var(--sage-deep);
}

/* ============================================================
   Home: Method Section
   ============================================================ */

.method {
  padding: var(--s-12) 0;
}

.section-header {
  text-align: center;
  margin-bottom: var(--s-12);
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.2vw, 38px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: var(--s-4);
  white-space: nowrap;
}

.section-header p {
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-3);
}

.method-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-6);
}

.method-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: var(--s-8);
  box-shadow: var(--shadow-sm);
  transition: all var(--t-normal);
  position: relative;
  overflow: hidden;
}

.method-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
  border-color: var(--line-strong);
}

.method-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--indigo), var(--amber));
  opacity: 0;
  transition: opacity var(--t-normal);
}

.method-card:hover::before {
  opacity: 1;
}

.method-card-num {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  background: var(--indigo-soft);
  color: var(--indigo);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  margin-bottom: var(--s-5);
}

.method-card h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
  margin-bottom: var(--s-3);
}

.method-card p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-3);
  margin-bottom: var(--s-5);
}

/* Method visual: Verse stacking */

.verse-stack {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  margin-top: var(--s-4);
}

.verse-stack-row {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: 13px;
}

.verse-stack-row .vs-label {
  font-weight: 600;
  color: var(--muted);
  width: 56px;
  flex-shrink: 0;
}

.verse-stack-row .vs-bars {
  display: flex;
  gap: 3px;
  flex: 1;
}

.verse-stack-row .vs-bar {
  height: 24px;
  border-radius: var(--r-sm);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  flex: 1;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  transition: all var(--t-normal);
}

.verse-stack-row .vs-bar.active {
  background: var(--indigo-soft);
  border-color: var(--indigo-light);
  color: var(--indigo);
}

.verse-stack-row .vs-bar.new {
  background: var(--amber-soft);
  border-color: var(--amber-light);
  color: var(--amber-deep);
}

/* Method visual: Group grid */

.group-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--s-2);
  margin-top: var(--s-4);
}

.group-cell {
  aspect-ratio: 1;
  border-radius: var(--r-sm);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  transition: all var(--t-normal);
}

.group-cell.filled {
  background: var(--indigo);
  border-color: var(--indigo);
  color: #fff;
}

.group-cell.group-complete {
  background: var(--sage);
  border-color: var(--sage);
  color: #fff;
  box-shadow: 0 0 0 3px var(--sage-soft);
}

.group-label {
  margin-top: var(--s-3);
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.group-label strong {
  color: var(--sage-deep);
  font-weight: 600;
}

/* Method visual: Forgetting curve */

.curve-chart {
  margin-top: var(--s-4);
  position: relative;
  height: 120px;
}

.curve-svg {
  width: 100%;
  height: 100%;
}

.curve-dots {
  display: flex;
  justify-content: space-between;
  margin-top: var(--s-3);
  padding: 0 var(--s-2);
}

.curve-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-1);
}

.curve-dot span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--amber);
}

.curve-dot small {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

/* ============================================================
   Home: Plans Section
   ============================================================ */

.plans-section {
  padding: var(--s-12) 0;
}

.plans-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-6);
  margin-top: var(--s-8);
}

.plan-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: var(--s-6);
  box-shadow: var(--shadow-sm);
  transition: all var(--t-normal);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  height: 100%;
}

.plan-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: var(--indigo-light);
}

.plan-card.selected {
  border-color: var(--indigo);
  box-shadow: var(--shadow-indigo);
}

.plan-card-content {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  flex: 1;
}

.plan-card-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--r-full);
  background: var(--amber-soft);
  color: var(--amber-deep);
  align-self: flex-start;
}

.plan-card h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
}

.plan-card p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-3);
  flex: 1;
}

.plan-card-meta {
  display: flex;
  gap: var(--s-4);
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  align-items: baseline;
}

.plan-card-meta span {
  display: flex;
  align-items: baseline;
  gap: var(--s-1);
  font-variant-numeric: tabular-nums;
}

.plan-card-translation {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: var(--s-1);
  font-size: 11px;
  font-weight: 600;
  color: var(--indigo);
  background: var(--indigo-tint);
  border: 1px solid var(--indigo-light);
  padding: 2px 8px;
  border-radius: var(--r-full);
}

.plan-card-progress {
  height: 6px;
  border-radius: var(--r-full);
  background: var(--surface-soft);
  overflow: hidden;
  flex-shrink: 0;
}

.plan-card-progress span {
  display: block;
  height: 100%;
  border-radius: var(--r-full);
  background: linear-gradient(90deg, var(--indigo), var(--indigo-light));
  transition: width var(--t-slow);
}

.plan-card-actions {
  display: flex;
  gap: var(--s-3);
  margin-top: var(--s-5);
  flex-shrink: 0;
}

/* ============================================================
   Home: Global Section
   ============================================================ */

.global-section {
  padding: var(--s-12) 0;
}

.global-card {
  background: linear-gradient(135deg, var(--indigo-deep) 0%, var(--indigo) 100%);
  border-radius: var(--r-2xl);
  padding: var(--s-12);
  color: #fff;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.global-card::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -10%;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 146, 61, 0.15), transparent 70%);
}

.global-card::after {
  content: "";
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(91, 140, 90, 0.12), transparent 70%);
}

.global-card h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: var(--s-4);
  position: relative;
  z-index: 1;
}

.global-card p {
  font-size: clamp(14px, 1.6vw, 18px);
  line-height: 1.6;
  opacity: 0.85;
  max-width: none;
  margin: 0 auto var(--s-8);
  position: relative;
  z-index: 1;
  white-space: nowrap;
}

.global-stats {
  display: flex;
  justify-content: center;
  gap: var(--s-12);
  position: relative;
  z-index: 1;
}

.global-stat {
  text-align: center;
}

.global-stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: var(--s-2);
}

.global-stat small {
  font-size: 14px;
  opacity: 0.7;
  font-weight: 500;
}

.global-langs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-top: var(--s-8);
  position: relative;
  z-index: 1;
}

.global-lang-chip {
  padding: var(--s-1) var(--s-3);
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 13px;
  font-weight: 500;
}

.global-lang-more {
  border-style: dashed;
  opacity: 0.85;
  font-style: italic;
}

/* ============================================================
   Home: CTA Section
   ============================================================ */

.cta-section {
  padding: var(--s-12) 0 var(--s-16);
  text-align: center;
}

.cta-section h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: var(--s-4);
}

.cta-section p {
  font-size: 17px;
  color: var(--ink-3);
  margin-bottom: var(--s-8);
}

/* ============================================================
   Workspace Layout
   ============================================================ */

.workspace {
  display: grid;
  grid-template-columns: 260px 1fr 360px;
  gap: var(--s-4);
  padding: var(--s-3) 0 0;
  min-height: calc(100vh - 81px);
  overflow: visible;
}

.workspace *::-webkit-scrollbar {
  display: none;
}

.workspace *,
.workspace *::before,
.workspace *::after {
  scrollbar-width: none;
}

/* Workspace Sidebar */

.ws-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  max-height: calc(100vh - 105px);
  min-height: 0;
  overflow: hidden;
}

.ws-back {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-3);
  transition: color var(--t-fast);
  align-self: flex-start;
  padding: var(--s-2) 0;
  flex-shrink: 0;
}

.ws-back:hover {
  color: var(--indigo);
}

.ws-sidebar-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.ws-sidebar-title h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
}

.ws-plan-list {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.ws-plan-item {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
  transition: all var(--t-fast);
  cursor: pointer;
  position: relative;
  outline: none;
}

.ws-plan-item:hover {
  background: var(--surface);
  border-color: var(--line);
}

.ws-plan-item.selected {
  background: var(--indigo-tint);
  border-color: var(--indigo-light);
}

.ws-plan-item:focus-visible {
  box-shadow: 0 0 0 2px var(--indigo-light);
  border-color: var(--indigo-light);
}

.ws-plan-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-2);
}

.ws-plan-item strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
  flex: 1;
}

.ws-plan-item-badges {
  display: flex;
  align-items: center;
  gap: var(--s-1);
  flex-shrink: 0;
}

.ws-plan-status {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: var(--r-full);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.ws-plan-status.paused {
  background: var(--amber-soft);
  color: var(--amber-deep);
}

.ws-plan-menu-btn {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  color: var(--muted);
  transition: all var(--t-fast);
  flex-shrink: 0;
}

.ws-plan-menu-btn:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.ws-plan-item.selected .ws-plan-menu-btn:hover {
  background: var(--indigo-soft);
}

.ws-plan-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: var(--s-2);
  padding: var(--s-1);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  animation: fadeIn 120ms ease;
}

.ws-plan-menu button {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  text-align: left;
  transition: all var(--t-fast);
}

.ws-plan-menu button:hover {
  background: var(--surface-soft);
  color: var(--indigo);
}

.ws-plan-menu button.danger {
  color: var(--terra);
}

.ws-plan-menu button.danger:hover {
  background: var(--terra-soft);
  color: var(--terra-deep);
}

.ws-plan-item span {
  font-size: 12px;
  color: var(--muted);
}

.ws-plan-progress {
  height: 3px;
  border-radius: var(--r-full);
  background: var(--line-soft);
  margin-top: var(--s-1);
  overflow: hidden;
}

.ws-plan-progress span {
  display: block;
  height: 100%;
  border-radius: var(--r-full);
  background: var(--indigo);
}

.ws-create-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: var(--s-3);
  border-radius: var(--r-md);
  border: 1.5px dashed var(--line-strong);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-3);
  transition: all var(--t-fast);
}

.ws-create-btn:hover {
  border-color: var(--indigo-light);
  color: var(--indigo);
  background: var(--indigo-tint);
}

/* ============================================================
   Workspace Stage (Center)
   ============================================================ */

.ws-stage {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  min-height: 0;
  overflow: visible;
}

.stage-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-4);
  flex-shrink: 0;
  min-width: 0;
}

.stage-header > div:first-child {
  min-width: 0;
}

.stage-header .kicker {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: var(--s-1);
}

.stage-header h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.stage-header-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  flex-shrink: 0;
  min-width: 0;
}

.stage-share-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  padding: var(--s-1) var(--s-3);
  border: 1px solid var(--indigo-light);
  border-radius: var(--r-full);
  background: var(--indigo);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
  transition: transform var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}

.stage-share-btn:hover {
  background: var(--indigo-deep);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  padding: var(--s-1) var(--s-3);
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 600;
  background: var(--amber-soft);
  color: var(--amber-deep);
  white-space: nowrap;
}

.status-pill.done {
  background: var(--sage-soft);
  color: var(--sage-deep);
}

/* Scrollable practice content area */

.ws-stage-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

/* Completed today state */

.completed-today-panel {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.completed-today-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--s-3);
  padding: var(--s-6) var(--s-5);
  background: linear-gradient(135deg, var(--sage-soft) 0%, #f5f8f4 100%);
  border: 1px solid var(--sage-soft);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
}

.completed-today-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--sage);
  box-shadow: var(--shadow-xs);
}

.completed-today-card h3 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--sage-deep);
}

.completed-today-card p {
  font-size: 15px;
  color: var(--ink-2);
  max-width: 420px;
  line-height: 1.55;
}

.tomorrow-preview-card {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: var(--s-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.tomorrow-preview-header {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-1) var(--s-3);
  border-radius: var(--r-full);
  background: var(--indigo-soft);
  color: var(--indigo);
  font-size: 12px;
  font-weight: 600;
  width: fit-content;
  margin-bottom: var(--s-3);
}

.tomorrow-preview-card h4 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: var(--s-3);
}

.tomorrow-preview-verse {
  flex: 1 1 auto;
  overflow-y: auto;
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.75;
  color: var(--ink-2);
  padding-right: var(--s-2);
}

.tomorrow-preview-verse p {
  margin-bottom: var(--s-3);
}

.tomorrow-preview-verse p span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  margin-right: var(--s-2);
  border-radius: var(--r-md);
  background: var(--amber-soft);
  color: var(--amber-deep);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  vertical-align: middle;
}

.tomorrow-preview-note {
  margin-top: var(--s-3);
  padding-top: var(--s-3);
  border-top: 1px dashed var(--line);
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

[dir="rtl"] .tomorrow-preview-verse p span {
  margin-right: 0;
  margin-left: var(--s-2);
}

/* Accumulation progress bar */

.accum-track {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s-2) var(--s-3);
  box-shadow: var(--shadow-xs);
  flex-shrink: 0;
}

.accum-track-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s-2);
}

.accum-track-header h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}

.accum-track-header .accum-day-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.accum-track-header .accum-day-label strong {
  color: var(--indigo);
  font-weight: 700;
}

.accum-verses {
  display: flex;
  gap: var(--s-1);
  flex-wrap: wrap;
}

.accum-verse {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 28px;
}

.accum-verse-dot {
  width: 24px;
  height: 24px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  -webkit-font-feature-settings: "tnum";
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  transition: all var(--t-normal);
}

.accum-verse-dot.current {
  box-shadow: 0 0 0 2px var(--amber-glow);
}

.accum-verse-dot.reviewed {
  background: var(--sage-soft);
  border-color: var(--sage);
  color: var(--sage-deep);
}

.accum-verse-dot.current {
  background: var(--amber-soft);
  border-color: var(--amber);
  color: var(--amber-deep);
  box-shadow: 0 0 0 3px var(--amber-glow);
  animation: pulse 2s ease-in-out infinite;
}

.accum-verse-dot.new {
  background: var(--indigo);
  border-color: var(--indigo);
  color: #fff;
}

.accum-verse small {
  font-size: 10px;
  color: var(--muted-2);
  font-weight: 500;
}

.accum-group-marker {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-top: var(--s-2);
  padding-top: var(--s-2);
  border-top: 1px dashed var(--line);
  font-size: 11px;
  color: var(--muted);
}

.accum-group-marker strong {
  color: var(--sage-deep);
  font-weight: 600;
}

/* Verse display */

.verse-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: all var(--t-normal);
  flex: 0 0 auto;
  max-height: 360px;
  overflow-y: auto;
}

.verse-tools {
  display: flex;
  gap: var(--s-2);
  margin-bottom: var(--s-3);
}

.verse-text {
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.7;
  color: var(--ink);
  font-weight: 400;
}

.verse-text p {
  margin-bottom: var(--s-3);
  padding-left: var(--s-6);
  position: relative;
}

.verse-text p:last-child {
  margin-bottom: 0;
}

.verse-text p > span:first-child {
  position: absolute;
  left: 0;
  top: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--amber-deep);
  font-family: var(--font-body);
  background: var(--amber-soft);
  border-radius: var(--r-sm);
  padding: 1px 6px;
  line-height: 1.5;
}

.verse-hidden-msg {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  min-height: 90px;
  color: var(--muted);
  font-size: 15px;
  text-align: center;
}

.verse-prompt {
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.9;
  color: var(--ink);
}

.prompt-blank {
  display: inline-block;
  min-width: 1.5em;
  min-height: 1.4em;
  padding: 0.15em 0.45em;
  margin: 0.1em 0.2em;
  border-radius: var(--r-md);
  background: var(--surface-soft);
  border: 1px dashed var(--line-strong);
  color: transparent;
  transition: all var(--t-fast);
  cursor: pointer;
  vertical-align: baseline;
  text-align: center;
}

.prompt-blank:hover {
  background: var(--amber-soft);
  border-color: var(--amber);
}

.prompt-blank.revealed {
  background: var(--amber-soft);
  border-color: var(--amber-light);
  border-style: solid;
  color: var(--amber-deep);
  font-weight: 500;
}

/* Recitation */

.recitation-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s-4);
  box-shadow: var(--shadow-xs);
  flex-shrink: 0;
}

.recitation-input {
  width: 100%;
  min-height: 90px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--s-4);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg-warm);
  transition: all var(--t-fast);
  font-family: var(--font-body);
}

.recitation-input:focus {
  outline: none;
  border-color: var(--indigo-light);
  box-shadow: 0 0 0 3px var(--indigo-soft);
  background: var(--surface);
}

.recitation-input::placeholder {
  color: var(--muted-2);
}

.recitation-actions {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-top: var(--s-3);
}

.btn-recording {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 13px 22px;
  border: 1px solid rgba(197, 48, 48, 0.45);
  border-radius: 999px;
  background: #fff5f3;
  color: #9f1d1d;
  font-weight: 700;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.08), 0 12px 28px rgba(197, 48, 48, 0.18);
  cursor: pointer;
  transition: transform var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
  animation: recordingGlow 1.4s ease-in-out infinite;
  min-width: 210px;
}

.btn-recording:hover {
  background: #ffe8e3;
  transform: translateY(-1px);
}

.recording-dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #dc2626;
  box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.45);
  animation: recordingPulse 1s ease-out infinite;
}

.voice-wave {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 16px;
}

.voice-wave span {
  width: 3px;
  height: 7px;
  border-radius: 999px;
  background: #dc2626;
  animation: voiceWave 0.8s ease-in-out infinite;
}

.voice-wave span:nth-child(2) {
  animation-delay: 0.12s;
}

.voice-wave span:nth-child(3) {
  animation-delay: 0.24s;
}

@keyframes recordingGlow {
  0%, 100% {
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.08), 0 12px 28px rgba(197, 48, 48, 0.18);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(220, 38, 38, 0.13), 0 16px 34px rgba(197, 48, 48, 0.24);
  }
}

@keyframes recordingPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.45);
  }
  100% {
    box-shadow: 0 0 0 10px rgba(220, 38, 38, 0);
  }
}

@keyframes voiceWave {
  0%, 100% {
    height: 6px;
    opacity: 0.55;
  }
  50% {
    height: 16px;
    opacity: 1;
  }
}

/* Result panel */

.result-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s-4);
  box-shadow: var(--shadow-xs);
  animation: slideInUp var(--t-normal) both;
  flex-shrink: 0;
  overflow: visible;
}

.result-panel.passed {
  border-color: var(--sage);
  background: var(--sage-soft);
}

.result-panel.muted {
  background: var(--surface-soft);
  border-style: dashed;
  text-align: center;
}

.result-panel.muted strong {
  font-size: 15px;
  color: var(--ink-2);
}

.result-panel.muted span {
  font-size: 13px;
  color: var(--muted);
}

.result-header {
  display: flex;
  align-items: baseline;
  gap: var(--s-3);
  margin-bottom: var(--s-3);
}

.result-header strong {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1;
}

.result-header span {
  font-size: 14px;
  color: var(--ink-3);
}

.inline-comparison {
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.8;
  margin-bottom: var(--s-4);
  padding: var(--s-4);
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line-soft);
}

.compare-mark {
  border-radius: var(--r-sm);
  padding: 1px 4px;
  font-size: 14px;
}

.compare-mark.omission {
  background: var(--terra-soft);
  color: var(--terra);
  text-decoration: line-through;
}

.compare-mark.extra {
  background: var(--amber-soft);
  color: var(--amber-deep);
}

.compare-mark.mistake {
  background: var(--terra-soft);
  color: var(--terra);
}

.result-details p {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: var(--s-2);
  color: var(--ink-3);
}

.result-details b {
  color: var(--ink);
  font-weight: 600;
  margin-right: var(--s-2);
}

.result-actions {
  display: flex;
  gap: var(--s-3);
  flex-wrap: wrap;
}

/* ============================================================
   Workspace Progress Rail (Right)
   ============================================================ */

.ws-progress {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  max-height: calc(100vh - 105px);
  overflow-y: auto;
  overflow-x: hidden;
}

.progress-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s-2) var(--s-3);
  box-shadow: var(--shadow-xs);
  flex-shrink: 0;
}

.progress-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-1) var(--s-2);
  margin-bottom: var(--s-1);
}

.progress-card-title h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}

.stats-mini {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-2);
}

.stat-mini {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--s-2);
  border-radius: var(--r-md);
  background: var(--surface-soft);
}

.stat-mini-icon {
  color: var(--indigo);
  margin-bottom: 1px;
}

.stat-mini strong {
  font-family: var(--font-body);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  -webkit-font-feature-settings: "tnum";
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1;
}

.stat-mini small {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

/* Review queue */

.review-queue {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  overflow-y: auto;
  max-height: 180px;
}

.review-item {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-md);
  background: var(--surface-soft);
  font-size: 13px;
}

.review-item-due {
  background: var(--amber-soft);
}

.review-item-overdue {
  background: var(--terra-soft);
}

.review-item strong {
  font-weight: 600;
  color: var(--ink-2);
  flex: 1;
}

.review-item small {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.review-empty {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  padding: var(--s-2);
}

/* Heatmap */

.heatmap-card {
  flex-shrink: 0;
  padding: var(--s-2) var(--s-3);
  background: var(--surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
}

.heatmap-card .progress-card-title {
  margin-bottom: var(--s-2);
  align-items: center;
}

.heatmap-card .progress-card-title h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.heatmap-wrap {
  overflow-x: auto;
  padding: var(--s-1) 0;
  max-width: 100%;
}

.heatmap-grid {
  display: grid;
  gap: 2px;
  width: max-content;
  grid-template-columns: repeat(var(--heatmap-weeks, 14), 10px);
}

.heatmap-months {
  display: grid;
  gap: 2px;
  width: max-content;
  margin-bottom: var(--s-2);
  font-size: 9px;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.2;
  padding-left: 1px;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  -webkit-font-feature-settings: "tnum";
  font-family: var(--font-body);
  grid-template-columns: repeat(var(--heatmap-month-count, 14), 10px);
  min-height: 14px;
}

.heatmap-months span {
  text-align: left;
  white-space: nowrap;
}

.heatmap-cell {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: #f3f1ed;
  border: 1px solid transparent;
  transition: transform 150ms ease, border-color 150ms ease;
  cursor: default;
}

.heatmap-cell:hover {
  transform: scale(1.15);
  z-index: 1;
  border-color: var(--line-strong);
  box-shadow: 0 1px 3px rgba(42, 37, 32, 0.08);
}

.heatmap-cell.level-1 { background: var(--sage); border-color: var(--sage-deep); }

.heatmap-cell.padding {
  opacity: 0.25;
  background: #e8e6e2;
}

/* Yearly heatmap (workspace sidebar) */

.heatmap-yearly {
  padding: var(--s-2) var(--s-3);
}

.heatmap-yearly-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  margin-bottom: var(--s-2);
}

.heatmap-yearly-title {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.heatmap-yearly-title h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: -0.01em;
}

.heatmap-yearly-nav {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.heatmap-year-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  -webkit-font-feature-settings: "tnum";
  min-width: 44px;
  text-align: center;
}

.heatmap-yearly-body {
  display: flex;
  align-items: flex-start;
  margin-bottom: var(--s-2);
  min-width: 0;
}

.heatmap-yearly-wrap {
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: var(--s-1);
}

.heatmap-yearly-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  margin-top: var(--s-1);
}

.heatmap-yearly-footer .heatmap-legend {
  margin-top: 0;
}

/* Monthly heatmap (workspace sidebar) - deprecated, kept minimal to avoid stale rule conflicts */

.heatmap-monthly,
.heatmap-monthly-header,
.heatmap-monthly-title,
.heatmap-monthly-nav,
.heatmap-month-label,
.heatmap-weekdays,
.heatmap-calendar,
.heatmap-day,
.heatmap-monthly-footer {
  display: none;
}

.mini-heatmap {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 3px;
}

.mini-heatmap .heatmap-cell {
  aspect-ratio: 1;
  border-radius: 3px;
}

.heatmap-legend {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--s-1);
  margin-top: var(--s-3);
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

.heatmap-legend span {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.heatmap-legend .level-0 { background: #f3f1ed; }

.heatmap-legend .level-1 { background: var(--sage); border-color: var(--sage-deep); }

/* Monthly heatmap (workspace sidebar) */

.heatmap-monthly {
  padding: var(--s-2) var(--s-3);
}

.heatmap-monthly-header {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  margin-bottom: var(--s-2);
}

.heatmap-monthly-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
}

.heatmap-monthly-title h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: -0.01em;
}

.heatmap-monthly-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
}

.heatmap-month-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  -webkit-font-feature-settings: "tnum";
}

.heatmap-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink-3);
  cursor: pointer;
  transition: all var(--t-fast);
}

.heatmap-nav-btn:hover {
  background: var(--surface-hover);
  border-color: var(--line-strong);
  color: var(--ink);
}

.heatmap-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 1px;
}

.heatmap-weekdays span {
  text-align: center;
  font-size: 8px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1;
  padding: 2px 0;
}

.heatmap-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.heatmap-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  background: #f3f1ed;
  border: 1px solid transparent;
  font-size: 9px;
  font-weight: 600;
  color: var(--ink-3);
  line-height: 1;
  min-width: 0;
  min-height: 0;
  transition: transform 150ms ease, border-color 150ms ease;
  cursor: default;
}

.heatmap-day:hover {
  transform: scale(1.08);
  z-index: 1;
  border-color: var(--line-strong);
  box-shadow: 0 1px 3px rgba(42, 37, 32, 0.08);
}

.heatmap-day.out-of-month {
  color: var(--muted);
  background: transparent;
  opacity: 0.5;
}

.heatmap-day.today {
  border-color: var(--indigo);
  color: var(--indigo);
  box-shadow: inset 0 0 0 1px var(--indigo);
}

.heatmap-day.level-1 { background: #d1f4d9; border-color: #b8e9c4; color: var(--ink-3); }

.heatmap-day.level-2 { background: #86efac; border-color: #6fdc96; color: var(--ink-3); }

.heatmap-day.level-3 { background: #22c55e; border-color: #1aa94d; color: white; }

.heatmap-day.level-4 { background: #15803d; border-color: #116830; color: white; }

.heatmap-monthly-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  margin-top: var(--s-1);
}

.heatmap-monthly-footer .heatmap-legend {
  margin-top: 0;
}

.heatmap-today-btn {
  font-size: 9px;
  font-weight: 600;
  color: var(--indigo);
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: color var(--t-fast);
}

.heatmap-today-btn:hover {
  color: var(--indigo-dark);
  text-decoration: underline;
}

.plan-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-6);
  background: rgba(42, 37, 32, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 200ms ease;
}

.plan-modal {
  width: 100%;
  max-width: 760px;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  animation: slideInUp 300ms ease;
}

.plan-modal .plan-builder {
  margin: 0;
  max-height: none;
}

.confirm-modal {
  max-width: 420px;
}

.confirm-modal .plan-builder {
  padding: var(--s-5);
}

.confirm-body {
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-3);
  margin: var(--s-2) 0 var(--s-5);
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--s-3);
}

@media (max-width: 480px) {
  .plan-modal-overlay {
    padding: var(--s-4);
    align-items: flex-end;
  }
  .plan-modal {
    max-height: 85vh;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
  }
}

/* ============================================================
   Plan Builder Form
   ============================================================ */

.plan-builder {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: var(--s-6);
  box-shadow: var(--shadow-lg);
  animation: slideInUp var(--t-normal) both;
}

.builder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s-5);
}

.builder-header h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
}

.plan-form {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-4);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.form-field > span {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}

.form-field input,
.form-field select,
.form-field textarea {
  padding: var(--s-3);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: 14px;
  color: var(--ink);
  background: var(--surface);
  transition: all var(--t-fast);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--indigo-light);
  box-shadow: 0 0 0 3px var(--indigo-soft);
}

.form-field textarea {
  min-height: 60px;
  resize: vertical;
}

.range-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-3);
}

.schedule-field {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--s-4);
}

.schedule-field legend {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  padding: 0 var(--s-2);
}

.schedule-options {
  display: flex;
  gap: var(--s-2);
  margin-bottom: var(--s-3);
}

.schedule-options button {
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--line);
  color: var(--ink-3);
  transition: all var(--t-fast);
}

.schedule-options button.active {
  background: var(--indigo);
  color: #fff;
  border-color: var(--indigo);
}

.weekday-picker {
  display: flex;
  gap: var(--s-1);
  flex-wrap: wrap;
}

.weekday-picker button {
  width: 36px;
  height: 36px;
  border-radius: var(--r-md);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--line);
  color: var(--ink-3);
  transition: all var(--t-fast);
}

.weekday-picker button.active {
  background: var(--indigo-soft);
  border-color: var(--indigo);
  color: var(--indigo);
}

/* Searchable select */

.searchable-select {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  position: relative;
}

.searchable-select > span {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}

.ss-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  padding: var(--s-3);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  cursor: pointer;
  transition: all var(--t-fast);
  text-align: left;
  width: 100%;
  min-height: 42px;
}

.ss-trigger:hover {
  border-color: var(--indigo-light);
}

.ss-trigger.open {
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px var(--indigo-soft);
}

.ss-trigger-content {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex: 1;
  min-width: 0;
}

.ss-trigger-label {
  font-size: 14px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ss-trigger-desc {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.ss-trigger-placeholder {
  font-size: 13px;
  color: var(--muted);
  flex: 1;
}

.ss-chevron {
  color: var(--muted);
  flex-shrink: 0;
  transition: transform var(--t-fast);
}

.ss-trigger.open .ss-chevron {
  transform: rotate(180deg);
}

.ss-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: var(--r-sm);
  background: var(--indigo-soft);
  color: var(--indigo);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  flex-shrink: 0;
  line-height: 1.6;
}

.ss-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.12);
  z-index: 50;
  overflow: hidden;
}

.ss-search {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.ss-search input {
  border: 0;
  background: transparent;
  font-size: 13px;
  flex: 1;
  outline: none;
  color: var(--ink);
}

.ss-search svg {
  color: var(--muted);
  flex-shrink: 0;
}

.ss-clear {
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  padding: 2px;
  display: flex;
  align-items: center;
}

.ss-clear:hover {
  color: var(--ink);
}

.ss-list {
  max-height: 240px;
  overflow-y: auto;
  padding: var(--s-1);
}

.ss-empty {
  padding: var(--s-4);
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.ss-option {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  width: 100%;
  padding: var(--s-2) var(--s-3);
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background var(--t-fast);
}

.ss-option:hover {
  background: var(--surface-soft);
}

.ss-option.selected {
  background: var(--indigo-soft);
}

.ss-option-main {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex: 1;
  min-width: 0;
}

.ss-option-label {
  font-size: 13px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ss-option-desc {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.ss-check {
  color: var(--indigo);
  flex-shrink: 0;
}

/* ============================================================
   Animations
   ============================================================ */

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--amber-glow); }
  50% { box-shadow: 0 0 0 6px var(--amber-glow); }
}

@keyframes growBar {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: 1fr;
    padding: var(--s-3) 0 var(--s-8);
    gap: var(--s-6);
  }
  .ws-sidebar {
    order: 3;
    max-height: none;
    overflow: visible;
  }
  .ws-stage {
    order: 1;
    min-width: 0;
  }
  .ws-progress {
    order: 2;
    display: flex;
    flex-direction: column;
    grid-column: auto;
    max-height: none;
    overflow: visible;
  }
  .progress-card,
  .accum-track,
  .heatmap-card {
    padding: var(--s-3);
  }
  .stats-mini {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .stat-mini {
    min-height: 74px;
    justify-content: space-between;
  }
  .review-queue {
    max-height: none;
  }
  .review-empty {
    padding: var(--s-3);
    border-radius: var(--r-md);
    background: var(--surface-soft);
  }
  .accum-track-header {
    align-items: flex-start;
    gap: var(--s-2);
  }
  .accum-verses {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: var(--s-1);
  }
  .accum-verse {
    flex: 0 0 auto;
  }
  .accum-group-marker {
    margin-top: var(--s-1);
    padding-top: var(--s-2);
  }
  .heatmap-yearly-body {
    overflow: hidden;
  }
}

@media (max-width: 860px) {
  .app-shell {
    padding: 0 var(--s-4);
  }

  .top-nav {
    flex-wrap: wrap;
    gap: var(--s-3);
  }
  .brand {
    min-width: 0;
  }
  .nav-links {
    display: none;
  }
  .nav-actions {
    width: 100%;
    justify-content: space-between;
    gap: var(--s-3);
    flex-wrap: wrap;
  }
  .nav-accounts {
    flex: 1 1 auto;
    flex-wrap: wrap;
  }
  .nav-lang {
    flex: 0 1 220px;
    justify-content: flex-end;
  }
  .nav-lang select {
    width: 100%;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: var(--s-8);
    padding: var(--s-8) 0;
  }
  .community-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .community-stats {
    border-radius: var(--r-lg);
  }
  .community-stat:nth-child(2) {
    border-right: 0;
  }
  .community-stat:nth-child(-n + 2) {
    padding-bottom: var(--s-2);
    border-bottom: 1px solid var(--line-soft);
  }
  .community-stat:nth-child(n + 3) {
    padding-top: var(--s-2);
  }

  .method-steps {
    grid-template-columns: 1fr;
  }

  .plans-grid {
    grid-template-columns: 1fr;
  }

  .global-stats {
    flex-direction: column;
    gap: var(--s-6);
  }

  .workspace {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
    overflow: visible;
    padding: var(--s-3) 0 var(--s-8);
    gap: var(--s-8);
  }
  .ws-sidebar {
    order: 3;
    height: auto;
    overflow: visible;
  }
  .ws-stage {
    order: 1;
    height: auto;
    min-height: 0;
    overflow: visible;
  }
  .stage-header {
    align-items: flex-start;
    gap: var(--s-3);
  }
  .ws-stage-content {
    overflow: visible;
  }
  .completed-today-panel {
    gap: var(--s-3);
  }
  .completed-today-card {
    padding: var(--s-5) var(--s-4);
  }
  .completed-today-card h3 {
    font-size: 20px;
  }
  .completed-today-card p {
    font-size: 14px;
  }
  .ws-progress {
    order: 2;
    display: flex;
    flex-direction: column;
    height: auto;
    max-height: none;
    overflow: visible;
  }
  .stats-mini {
    grid-template-columns: 1fr 1fr;
  }
  .ws-plan-list {
    max-height: 480px;
  }

  .range-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .app-shell {
    padding: 0 var(--s-3);
  }
  .top-nav {
    padding: var(--s-4) 0;
  }
  .brand {
    width: 100%;
  }
  .brand-icon {
    width: 36px;
    height: 36px;
  }
  .brand-text strong {
    font-size: 17px;
  }
  .brand-text small {
    font-size: 10px;
  }
  .nav-actions {
    gap: var(--s-2);
  }
  .nav-account.cloud {
    display: none;
  }
  .nav-accounts {
    flex: 1 1 128px;
  }
  .nav-account {
    padding: var(--s-2) var(--s-3);
    font-size: 12px;
  }
  .nav-lang {
    flex: 1 1 150px;
  }
  .nav-lang svg {
    display: none;
  }
  .nav-lang select {
    min-height: 34px;
    font-size: 12px;
  }
  .hero {
    padding: var(--s-6) 0;
  }
  .hero-actions {
    align-items: stretch;
  }
  .hero-actions .btn-primary,
  .hero-actions .btn-ghost {
    width: 100%;
  }
  .hero h1 {
    font-size: 32px;
  }
  .stage-header {
    flex-direction: column;
    align-items: stretch;
  }
  .stage-header h2 {
    font-size: 26px;
  }
  .stage-header-actions {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }
  .stage-share-btn,
  .status-pill {
    min-height: 30px;
  }
  .verse-tools,
  .recitation-actions,
  .result-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .verse-tools button,
  .recitation-actions button,
  .result-actions button {
    width: 100%;
  }
  .verse-card {
    max-height: 240px;
    padding: var(--s-4);
  }
  .verse-text {
    font-size: 17px;
  }
  .completed-today-card {
    border-radius: var(--r-lg);
  }
  .completed-today-icon {
    width: 52px;
    height: 52px;
  }
  .tomorrow-preview-card {
    padding: var(--s-3);
    border-radius: var(--r-lg);
  }
  .tomorrow-preview-verse {
    font-size: 16px;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .range-row {
    grid-template-columns: 1fr;
  }
  .nav-cta {
    display: none;
  }
}

/* ============================================================
   Share Modal
   ============================================================ */

.share-modal {
  max-width: 560px;
  width: min(92vw, 560px);
}

.share-modal .plan-builder {
  max-height: calc(100vh - 56px);
  overflow-y: auto;
  background:
    radial-gradient(circle at 18% 0%, rgba(200, 146, 61, 0.12), transparent 34%),
    linear-gradient(180deg, #fffdf9, #f8f4ec);
}

.share-plan-info {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.78);
}

.share-plan-info strong {
  display: block;
  font-family: var(--font-display);
  font-size: 23px;
  color: var(--ink);
  line-height: 1.1;
}

.share-plan-info span {
  font-size: 13px;
  color: var(--muted);
}

.share-content {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-3) 0 0;
}

.share-card-panel {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  padding: var(--s-3);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-sm);
  align-items: center;
}

.share-section-heading {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  color: var(--indigo);
  font-size: 13px;
  font-weight: 700;
}

.share-card-preview-wrap {
  width: 100%;
  display: grid;
  place-items: center;
  padding: var(--s-2);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(245, 240, 232, 0.76), rgba(255, 255, 255, 0.9));
}

.share-card-preview {
  max-width: 100%;
  max-height: 260px;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  background: #fff;
}

.share-card-loading {
  width: 100%;
  height: 240px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  background: var(--surface-soft);
}

.share-proof-panel {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-2);
  border-radius: 14px;
  background: var(--surface-soft);
}

.share-plan-stats {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s-1);
}

.share-plan-stats div {
  text-align: center;
}

.share-plan-stats strong {
  display: block;
  font-size: 17px;
  color: var(--ink);
  line-height: 1.1;
}

.share-plan-stats span {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}

.share-mini-heatmap {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(28, 7px);
  justify-content: center;
  gap: 2px;
}

.share-mini-heatmap span {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: #e9e4da;
}

.share-mini-heatmap span.level-1 {
  background: var(--sage);
}

.share-primary-actions {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: var(--s-2);
}

.share-primary-actions button {
  justify-content: center;
  min-height: 44px;
}

.share-download-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.share-copy-btn {
  background: #fff;
}

.share-link-panel {
  padding: 0 var(--s-1);
}

.share-link-box {
  display: flex;
  align-items: center;
  min-height: 30px;
  padding: 0 var(--s-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.55);
}

.share-link-box input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
}

.share-link-box input:focus {
  outline: none;
}

/* Shared hint */

.share-hint {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

@media (max-width: 720px) {
  .share-modal {
    width: 94vw;
  }
  .share-modal .plan-builder {
    max-height: calc(100vh - 32px);
    padding: var(--s-4);
  }
  .share-primary-actions {
    grid-template-columns: 1fr;
  }
  .share-plan-stats {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .share-modal {
    width: calc(100vw - 24px);
  }
  .share-modal .plan-builder {
    max-height: calc(100vh - 24px);
    gap: var(--s-3);
    border-radius: 22px;
  }
  .share-plan-info {
    padding: var(--s-3);
    border-radius: var(--r-md);
  }
  .share-plan-info strong {
    font-size: 22px;
  }
  .share-content {
    gap: var(--s-2);
  }
  .share-card-panel {
    padding: var(--s-2);
    border-radius: var(--r-lg);
  }
  .share-card-preview-wrap {
    max-height: 286px;
    overflow: hidden;
    padding: var(--s-2);
  }
  .share-card-preview {
    max-height: 232px;
  }
  .share-proof-panel {
    gap: var(--s-1);
    padding: var(--s-2);
  }
  .share-plan-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .share-plan-stats strong {
    font-size: 16px;
  }
  .share-plan-stats span {
    font-size: 9px;
    white-space: normal;
    line-height: 1.15;
  }
  .share-mini-heatmap {
    grid-template-columns: repeat(28, 6px);
    gap: 2px;
  }
  .share-mini-heatmap span {
    width: 6px;
    height: 6px;
  }
  .share-primary-actions {
    grid-template-columns: 1fr 1fr;
    position: sticky;
    bottom: 0;
    z-index: 1;
    padding-top: var(--s-2);
    background: linear-gradient(180deg, rgba(255, 253, 249, 0), #fffdf9 30%);
  }
  .share-primary-actions button {
    min-height: 42px;
    padding-inline: var(--s-3);
    font-size: 13px;
  }
  .share-link-panel {
    padding: 0;
  }
}

/* Toast notification */

.share-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-5);
  background: var(--sage-deep);
  color: #fff;
  border-radius: var(--r-full);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  cursor: pointer;
  animation: toast-slide-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.share-toast span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.share-toast strong {
  font-size: 13px;
  line-height: 1.2;
}

.share-toast small {
  font-size: 12px;
  line-height: 1.25;
  opacity: 0.86;
}

@keyframes toast-slide-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* RTL support */

[dir="rtl"] .nav-actions {
  flex-direction: row-reverse;
}

[dir="rtl"] .ws-back svg {
  transform: scaleX(-1);
}

/* Reduced motion */

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