/* =========================================================
   StudyMe — Calm, elegant study space for Laiyana
   ========================================================= */

/* ---------- Theme tokens ---------- */
:root {
  /* Rose Milk (default) */
  --bg: #fbf7f6;
  --ink: #2e2528;
  --ink-2: #6e5f64;
  --ink-3: #a5969b;
  --line: rgba(80, 45, 55, 0.08);
  --line-strong: rgba(80, 45, 55, 0.14);

  --surface: rgba(255, 255, 255, 0.58);
  --surface-strong: rgba(255, 255, 255, 0.82);
  --surface-soft: rgba(255, 255, 255, 0.42);
  --glass-edge: rgba(255, 255, 255, 0.75);

  --accent: #d4778f;
  --accent-2: #ecb4c2;
  --accent-soft: #fbecef;
  --accent-ink: #a3485f;
  --grad-a: #e48aa1;
  --grad-b: #c99ae0;

  --orb-1: #f8cdd7;
  --orb-2: #e6d6f6;
  --orb-3: #fde3d1;

  --shadow-sm: 0 1px 2px rgba(60, 30, 40, 0.04), 0 2px 10px rgba(60, 30, 40, 0.04);
  --shadow-md: 0 18px 40px -22px rgba(70, 35, 50, 0.22);
  --shadow-lg: 0 40px 80px -30px rgba(70, 35, 50, 0.3);

  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 28px;
  --r-pill: 999px;

  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --hand: 'Caveat', cursive;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t: 0.45s var(--ease);
}

[data-theme="lavender"] {
  --bg: #f8f6fc;
  --ink: #2a2635;
  --ink-2: #645d77;
  --ink-3: #9d96b0;
  --line: rgba(60, 45, 100, 0.08);
  --line-strong: rgba(60, 45, 100, 0.14);
  --accent: #9a7fd6;
  --accent-2: #c9b8f0;
  --accent-soft: #f0ebfb;
  --accent-ink: #6a4fb0;
  --grad-a: #a88be3;
  --grad-b: #e5a4cf;
  --orb-1: #ddd0f7;
  --orb-2: #f5d6ea;
  --orb-3: #d4e0fa;
}

[data-theme="matcha"] {
  --bg: #f6f8f3;
  --ink: #26302a;
  --ink-2: #5b6b60;
  --ink-3: #95a399;
  --line: rgba(40, 70, 50, 0.08);
  --line-strong: rgba(40, 70, 50, 0.14);
  --accent: #6f9e7b;
  --accent-2: #b5d0ba;
  --accent-soft: #eaf3ec;
  --accent-ink: #46755a;
  --grad-a: #7fb08b;
  --grad-b: #c9d98f;
  --orb-1: #d3e8d6;
  --orb-2: #eef0cf;
  --orb-3: #f6e6d6;
}

[data-theme="peach"] {
  --bg: #fcf7f3;
  --ink: #33271f;
  --ink-2: #765f51;
  --ink-3: #ad988a;
  --line: rgba(100, 60, 35, 0.08);
  --line-strong: rgba(100, 60, 35, 0.14);
  --accent: #e08a68;
  --accent-2: #f3c3ab;
  --accent-soft: #fcede5;
  --accent-ink: #b05d3c;
  --grad-a: #f09a78;
  --grad-b: #f2b8a6;
  --orb-1: #fdd8c4;
  --orb-2: #fbe7c7;
  --orb-3: #f8d3dc;
}

[data-theme="celestial"] {
  --bg: #f4f7fb;
  --ink: #232b36;
  --ink-2: #5a6779;
  --ink-3: #95a1b2;
  --line: rgba(35, 60, 100, 0.08);
  --line-strong: rgba(35, 60, 100, 0.14);
  --accent: #6d97d6;
  --accent-2: #b5cdf0;
  --accent-soft: #eaf1fb;
  --accent-ink: #3f69a8;
  --grad-a: #7ea6e4;
  --grad-b: #b7a6ea;
  --orb-1: #d1e2f8;
  --orb-2: #e3dcf8;
  --orb-3: #d7f0f0;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.8s var(--ease), color 0.6s var(--ease);
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
::selection { background: var(--accent-2); color: var(--ink); }

.ico {
  width: 20px; height: 20px;
  fill: none; stroke: currentColor;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0;
}
.ico.sm { width: 16px; height: 16px; }
.muted { color: var(--ink-3); }
.small { font-size: 0.78rem; }

/* ---------- Ambient aurora background ---------- */
.ambient-bg {
  position: fixed; inset: 0;
  z-index: 0; pointer-events: none; overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.75;
  transition: background 1.2s var(--ease);
  will-change: transform;
}
.orb-1 { width: 620px; height: 620px; background: var(--orb-1); top: -180px; left: -140px; animation: drift1 38s ease-in-out infinite; }
.orb-2 { width: 540px; height: 540px; background: var(--orb-2); top: 18%; right: -160px; animation: drift2 44s ease-in-out infinite; }
.orb-3 { width: 600px; height: 600px; background: var(--orb-3); bottom: -240px; left: 28%; animation: drift3 50s ease-in-out infinite; }

@keyframes drift1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(120px, 80px) scale(1.12); } }
@keyframes drift2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-100px, 120px) scale(0.92); } }
@keyframes drift3 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-80px, -100px) scale(1.08); } }

.grain {
  position: absolute; inset: -50%;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Layout shell ---------- */
.shell {
  position: relative; z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px 32px 48px;
}

/* Entrance animation */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  animation: reveal 0.9s var(--ease) forwards;
  animation-delay: calc(var(--d, 0) * 80ms + 60ms);
}
@keyframes reveal { to { opacity: 1; transform: none; } }

/* ---------- Nav ---------- */
.topnav {
  position: sticky; top: 14px;
  z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 10px 12px 10px 20px;
  background: var(--surface);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--glass-edge);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-sm);
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--grad-a), var(--grad-b));
  box-shadow: 0 6px 16px -6px var(--accent);
}
.brand-mark svg { width: 16px; height: 16px; fill: #fff; }
.brand-name {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: -0.02em;
}
.brand-name em { font-style: italic; color: var(--accent-ink); }

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

.nav-chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  font-size: 0.86rem; font-weight: 500;
  color: var(--ink-2);
  transition: background var(--t), color var(--t);
}
button.nav-chip:hover, .nav-chip.open { background: var(--surface-strong); color: var(--ink); }
.nav-chip .ico { color: var(--ink-3); }
button.nav-chip:hover .ico { color: var(--accent); }

.clock-chip #current-time { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }
.ampm { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.06em; color: var(--ink-3); }
.streak-chip .ico { color: var(--accent); }
#ambient-toggle-btn.active { background: var(--accent-soft); color: var(--accent-ink); }
#ambient-toggle-btn.active .ico { color: var(--accent); }

/* Dropdowns */
.dropdown-wrap { position: relative; }
.dropdown {
  position: absolute;
  top: calc(100% + 12px); right: 0;
  width: 260px;
  padding: 16px;
  background: var(--surface-strong);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid var(--glass-edge);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  z-index: 60;
  opacity: 0; visibility: hidden;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top right;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s;
}
.dropdown.show { opacity: 1; visibility: visible; transform: none; }

.dropdown-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
  font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3);
}

.sound-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 14px; }
.sound-chip {
  padding: 10px 8px;
  border-radius: var(--r-sm);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  font-size: 0.82rem; font-weight: 500;
  color: var(--ink-2);
  transition: all var(--t);
}
.sound-chip:hover { background: #fff; color: var(--ink); }
.sound-chip.active { background: var(--accent-soft); border-color: var(--accent-2); color: var(--accent-ink); }

.volume-row { display: flex; align-items: center; gap: 10px; font-size: 0.8rem; color: var(--ink-2); }
.volume-row input { flex: 1; accent-color: var(--accent); }

.theme-list { display: flex; flex-direction: column; gap: 2px; }
.theme-card-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 10px;
  border-radius: var(--r-sm);
  font-size: 0.88rem; font-weight: 500;
  color: var(--ink-2);
  text-align: left;
  transition: background var(--t), color var(--t);
}
.theme-card-btn:hover { background: var(--surface-soft); color: var(--ink); }
.theme-card-btn.active { background: var(--accent-soft); color: var(--accent-ink); }
.swatch { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255,255,255,0.8), 0 2px 6px rgba(0,0,0,0.08); }
.sw-strawberry { background: linear-gradient(140deg, #e48aa1, #c99ae0); }
.sw-lavender   { background: linear-gradient(140deg, #a88be3, #e5a4cf); }
.sw-matcha     { background: linear-gradient(140deg, #7fb08b, #c9d98f); }
.sw-peach      { background: linear-gradient(140deg, #f09a78, #f2b8a6); }
.sw-celestial  { background: linear-gradient(140deg, #7ea6e4, #b7a6ea); }

/* ---------- Shared bits ---------- */
.eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.text-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.82rem; font-weight: 600;
  color: var(--accent-ink);
  padding: 6px 10px;
  border-radius: var(--r-pill);
  transition: background var(--t);
}
.text-btn:hover { background: var(--accent-soft); }

.icon-btn {
  width: 40px; height: 40px;
  display: inline-grid; place-items: center;
  border-radius: 50%;
  color: var(--ink-2);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  transition: all var(--t);
}
.icon-btn:hover { background: #fff; color: var(--accent-ink); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.icon-btn.sm { width: 34px; height: 34px; }
.icon-btn.lg { width: 52px; height: 52px; }

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 56px;
  padding: 0 30px;
  min-width: 190px;
  border-radius: var(--r-pill);
  font-weight: 600; font-size: 0.98rem;
  color: #fff;
  background: linear-gradient(135deg, var(--grad-a), var(--grad-b));
  background-size: 160% 160%;
  box-shadow: 0 14px 30px -12px var(--accent), inset 0 1px 0 rgba(255,255,255,0.35);
  transition: transform var(--t), box-shadow var(--t), background-position 0.8s var(--ease);
}
.btn-primary:hover { transform: translateY(-2px); background-position: 100% 100%; box-shadow: 0 20px 40px -14px var(--accent), inset 0 1px 0 rgba(255,255,255,0.35); }
.btn-primary:active { transform: translateY(0) scale(0.98); }
.btn-primary.sm { height: 44px; min-width: 0; padding: 0 22px; font-size: 0.9rem; }

.play-icon { display: inline-grid; place-items: center; width: 18px; height: 18px; }
.play-icon svg { width: 18px; height: 18px; fill: currentColor; }

.select {
  appearance: none; -webkit-appearance: none;
  padding: 8px 30px 8px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface-strong) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23998' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  font-size: 0.84rem; font-weight: 500;
  color: var(--ink);
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
}
.select:focus { border-color: var(--accent-2); box-shadow: 0 0 0 4px var(--accent-soft); }

.dot-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-3); display: inline-block; }

/* Switches (static + generated by JS) */
.switch, .switch-label {
  display: inline-flex; align-items: center; gap: 10px;
  cursor: pointer; user-select: none;
}
.switch input, .switch-label input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track, .custom-slider {
  position: relative;
  width: 38px; height: 22px;
  border-radius: 22px;
  background: var(--line-strong);
  transition: background var(--t);
  flex-shrink: 0;
}
.switch-track::after, .custom-slider::after {
  content: "";
  position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
  transition: transform var(--t);
}
input:checked + .switch-track, input:checked + .custom-slider { background: var(--accent); }
input:checked + .switch-track::after, input:checked + .custom-slider::after { transform: translateX(16px); }
input:focus-visible + .switch-track, input:focus-visible + .custom-slider { box-shadow: 0 0 0 4px var(--accent-soft); }
.switch-text { font-size: 0.84rem; font-weight: 500; color: var(--ink-2); }

/* ---------- Cards ---------- */
.card {
  position: relative;
  background: var(--surface);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  border: 1px solid var(--glass-edge);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: 28px;
  transition: box-shadow var(--t), transform var(--t);
}
.card:hover { box-shadow: var(--shadow-lg); }

.card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.card-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-top: 4px;
}

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 28px;
  align-items: end;
  padding: 56px 4px 36px;
}

.hero-title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.6rem, 5.4vw, 4.4rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
  margin: 12px 0 28px;
}
.hero-title em {
  font-style: italic;
  background: linear-gradient(120deg, var(--grad-a), var(--grad-b));
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  padding-right: 0.06em;
}

/* Multilingual Greetings (Chinese & Korean) */
.multilingual-greetings {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: -14px 0 24px 0;
}

.lang-greeting-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  font-size: 0.86rem;
  color: var(--ink-2);
  transition: all var(--t);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.lang-greeting-chip:hover {
  background: #fff;
  color: var(--ink);
  transform: translateY(-1px);
  border-color: var(--accent-2);
  box-shadow: var(--shadow-sm);
}

.lang-greeting-chip.active-lang {
  background: var(--accent-soft);
  border-color: var(--accent-2);
  color: var(--accent-ink);
  box-shadow: 0 0 0 3px rgba(228, 138, 161, 0.2);
}

.lang-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--accent-ink);
  letter-spacing: 0.03em;
}

.lang-phrase {
  font-weight: 600;
  color: var(--ink);
}

.lang-phonetic {
  font-size: 0.74rem;
  color: var(--ink-3);
  font-style: italic;
}

.daily-note {
  max-width: 560px;
  padding-left: 20px;
  border-left: 2px solid var(--accent-2);
}
.daily-note-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.daily-note-head .text-btn { margin-left: -4px; }
.quote {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 1.22rem;
  line-height: 1.5;
  color: var(--ink-2);
  transition: opacity 0.4s var(--ease);
}
.quote.fading { opacity: 0; }

/* Word of the day */
.word-card { padding: 26px 28px; }
.word-card .card-head { margin-bottom: 8px; }

.word-lang-switcher {
  display: inline-flex;
  padding: 2px;
  gap: 2px;
  border-radius: var(--r-pill);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  margin-top: 4px;
}

.word-tab {
  padding: 3px 9px;
  border-radius: var(--r-pill);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-3);
  transition: all var(--t);
  cursor: pointer;
}

.word-tab:hover {
  color: var(--ink);
}

.word-tab.active {
  background: #fff;
  color: var(--accent-ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.word {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 2.4rem;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--accent-ink);
}
.word-meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 6px 0 14px;
  font-size: 0.82rem; color: var(--ink-3);
}
#wotd-phonetic { font-style: italic; }
.word-def { font-size: 0.95rem; color: var(--ink); margin-bottom: 12px; }
.word-example {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ink-2);
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.word-card .swap { animation: swapIn 0.6s var(--ease); }
@keyframes swapIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Dashboard ---------- */
.dashboard {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

/* Timer */
.timer-card { display: flex; flex-direction: column; padding: 24px 28px 22px; }

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

.mode-switch {
  display: inline-flex;
  padding: 4px;
  gap: 2px;
  border-radius: var(--r-pill);
  background: var(--surface-soft);
  border: 1px solid var(--line);
}
.mode-pill {
  padding: 8px 16px;
  border-radius: var(--r-pill);
  font-size: 0.84rem; font-weight: 500;
  color: var(--ink-2);
  transition: all var(--t);
}
.mode-pill:hover { color: var(--ink); }
.mode-pill.active { background: #fff; color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm); }

.timer-stage { display: flex; flex-direction: column; align-items: center; padding: 18px 0 8px; }

.ring-wrap {
  position: relative;
  width: min(310px, 72vw);
  aspect-ratio: 1;
}
.ring-halo {
  position: absolute; inset: 14%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-2) 0%, transparent 70%);
  opacity: 0.35;
  filter: blur(24px);
  transition: opacity 0.8s var(--ease);
}
body.timer-running .ring-halo { animation: breathe 6s ease-in-out infinite; }
@keyframes breathe {
  0%, 100% { transform: scale(0.92); opacity: 0.35; }
  50% { transform: scale(1.12); opacity: 0.7; }
}

.progress-ring { position: relative; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.stop-a { stop-color: var(--grad-a); }
.stop-b { stop-color: var(--grad-b); }
.ring-track { fill: none; stroke: var(--line-strong); stroke-width: 3; }
.ring-progress {
  fill: none;
  stroke: url(#timer-gradient);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 753.98;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear;
  filter: drop-shadow(0 4px 10px var(--accent-2));
}

.ring-inner {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
}
.session-status {
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent-ink);
}
.timer-digits {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(3.4rem, 9vw, 4.8rem);
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.cycle-dots { display: flex; gap: 8px; margin-top: 10px; }
.cycle-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--line-strong);
  transition: all var(--t);
}
.cycle-dot.completed {
  background: linear-gradient(135deg, var(--grad-a), var(--grad-b));
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.timer-tip {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--ink-2);
  margin: 6px 0 18px;
  text-align: center;
}

.focus-field {
  display: flex; align-items: center; gap: 10px;
  width: 100%; max-width: 400px;
  padding: 10px 16px;
  border-radius: var(--r-pill);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  transition: border-color var(--t), background var(--t), box-shadow var(--t);
  margin-bottom: 22px;
}
.focus-field:focus-within { background: #fff; border-color: var(--accent-2); box-shadow: 0 0 0 4px var(--accent-soft); }
.focus-label { font-size: 0.78rem; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.focus-field input { flex: 1; min-width: 0; border: none; background: none; outline: none; font-weight: 500; font-size: 0.92rem; }
.focus-field input::placeholder { color: var(--ink-3); font-weight: 400; }

.timer-controls { display: flex; align-items: center; gap: 16px; }

.timer-footer {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  margin-top: 22px; padding-top: 18px;
  border-top: 1px solid var(--line);
}
.field-inline { display: flex; align-items: center; gap: 8px; }

/* Tasks */
.todo-card { display: flex; flex-direction: column; }

.progress-badge {
  display: inline-flex; align-items: baseline; gap: 3px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  font-weight: 600; font-size: 0.92rem;
  color: var(--accent-ink);
  font-variant-numeric: tabular-nums;
}
.progress-badge .small { margin-left: 4px; font-weight: 500; }

.bar {
  height: 4px; border-radius: 4px;
  background: var(--line);
  overflow: hidden;
  margin-bottom: 20px;
}
.bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--grad-a), var(--grad-b));
  transition: width 0.8s var(--ease);
}

.task-form {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 6px 6px 16px;
  border-radius: var(--r-pill);
  background: var(--surface-strong);
  border: 1px solid var(--line);
  margin-bottom: 14px;
  transition: border-color var(--t), box-shadow var(--t);
}
.task-form:focus-within { border-color: var(--accent-2); box-shadow: 0 0 0 4px var(--accent-soft); }
.task-form input { flex: 1; min-width: 0; border: none; background: none; outline: none; font-size: 0.92rem; }
.task-form input::placeholder { color: var(--ink-3); }
.tag-select { border: none; background-color: transparent; padding: 8px 26px 8px 10px; color: var(--ink-2); }
.tag-select:focus { box-shadow: none; }
.add-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--grad-a), var(--grad-b));
  box-shadow: 0 6px 14px -6px var(--accent);
  transition: transform var(--t);
  flex-shrink: 0;
}
.add-btn:hover { transform: rotate(90deg) scale(1.05); }

.tabs { display: flex; align-items: center; gap: 4px; margin-bottom: 10px; }
.filter-tab {
  padding: 6px 12px;
  border-radius: var(--r-pill);
  font-size: 0.82rem; font-weight: 500;
  color: var(--ink-3);
  transition: all var(--t);
}
.filter-tab:hover { color: var(--ink); }
.filter-tab.active { color: var(--ink); background: var(--surface-strong); box-shadow: var(--shadow-sm); }
.push-right { margin-left: auto; color: var(--ink-3); }

.task-list {
  list-style: none;
  display: flex; flex-direction: column;
  gap: 2px;
  max-height: 340px;
  overflow-y: auto;
  margin: 0 -8px;
  padding: 0 4px;
}

.task-item {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  padding: 11px 10px;
  border-radius: var(--r-sm);
  transition: background var(--t);
  animation: itemIn 0.5s var(--ease);
}
@keyframes itemIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.task-item:hover { background: var(--surface-strong); }
.task-item-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.task-item-right { display: flex; align-items: center; gap: 6px; }

.cute-checkbox {
  appearance: none; -webkit-appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--ink-3);
  display: grid; place-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.35s var(--ease);
}
.cute-checkbox:hover { border-color: var(--accent); }
.cute-checkbox::after {
  content: "";
  width: 9px; height: 5px;
  border: 2px solid #fff; border-top: 0; border-right: 0;
  transform: rotate(-45deg) translate(1px, -1px) scale(0);
  transition: transform 0.35s var(--ease);
}
.cute-checkbox:checked {
  border-color: transparent;
  background: linear-gradient(135deg, var(--grad-a), var(--grad-b));
  animation: pop 0.4s var(--ease);
}
.cute-checkbox:checked::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
@keyframes pop { 50% { transform: scale(1.2); } }

.task-title-text { font-size: 0.92rem; color: var(--ink); word-break: break-word; transition: color var(--t); }
.task-item.completed .task-title-text { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--accent-2); }

.task-tag-badge {
  font-size: 0.7rem; font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.tag-study    { background: var(--accent-soft); color: var(--accent-ink); }
.tag-reading  { background: #efeafb; color: #6a55a8; }
.tag-selfcare { background: #e9f4ec; color: #46755a; }
.tag-chores   { background: #fbf1e3; color: #9a6a2c; }

.task-delete-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 1.1rem; line-height: 1;
  color: var(--ink-3);
  opacity: 0;
  transition: all var(--t);
}
.task-item:hover .task-delete-btn, .alarm-item-card:hover .task-delete-btn { opacity: 1; }
.task-delete-btn:hover { background: #fdecec; color: #c0474b; }

.empty-task-state {
  list-style: none;
  text-align: center;
  padding: 28px 12px;
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-3);
}

/* =========================================================
   CLASS SCHEDULE & ATTENDANCE TRACKER
   ========================================================= */
.schedule-card {
  margin-bottom: 24px;
  padding: 28px;
}

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

.schedule-title-group .card-title {
  margin-top: 4px;
}

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

.attendance-summary-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  background: var(--surface-strong);
  border: 1px solid var(--line-strong);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--accent-ink);
  box-shadow: var(--shadow-sm);
  transition: all var(--t);
}

.attendance-summary-badge .sparkle-ico {
  font-size: 0.95rem;
}

.view-toggle-pills {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: var(--r-pill);
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.view-pill {
  padding: 6px 14px;
  border-radius: var(--r-pill);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-2);
  transition: all var(--t);
}

.view-pill:hover {
  color: var(--ink);
}

.view-pill.active {
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* Day Selector Tabs */
.schedule-day-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.day-tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 16px;
  border-radius: var(--r-md);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  min-width: 120px;
  text-align: left;
  transition: all var(--t);
}

.day-tab:hover {
  background: var(--surface-strong);
  transform: translateY(-1px);
}

.day-tab.active {
  background: #fff;
  border-color: var(--accent-2);
  box-shadow: var(--shadow-sm);
}

.day-tab-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 6px;
}

.day-tab.is-today .day-tab-name::after {
  content: "Today";
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--accent-ink);
  letter-spacing: 0.02em;
}

.day-tab-badge {
  font-size: 0.74rem;
  color: var(--ink-3);
  font-weight: 500;
}

/* Day View Cards */
.schedule-day-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 16px;
}

.class-item-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-radius: var(--r-md);
  background: var(--surface-strong);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: all var(--t);
  overflow: hidden;
}

.class-item-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.class-item-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--line-strong);
  transition: width 0.3s var(--ease);
}

.class-item-card.type-required::before {
  background: #e04f7c;
  box-shadow: 0 0 10px rgba(224, 79, 124, 0.4);
}

.class-item-card.type-live::before {
  background: linear-gradient(to bottom, var(--grad-a), var(--grad-b));
}

.class-item-card.type-optional::before {
  background: var(--accent-2);
}

.class-item-card.type-club::before {
  background: #d48bb5;
}

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

.class-time-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--surface-soft);
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-variant-numeric: tabular-nums;
}

.class-type-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.badge-required {
  background: #ffe3ec;
  color: #c9184a;
  border: 1px solid #ffccd5;
}

.badge-live {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.badge-optional {
  background: var(--surface-soft);
  color: var(--ink-2);
  border: 1px solid var(--line);
}

.badge-club {
  background: #f8e8f2;
  color: #9d4edd;
}

.class-title-text {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.class-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

/* Attendance Interactive Button */
.attend-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t);
  background: var(--surface-soft);
  color: var(--ink-2);
  border: 1px solid var(--line-strong);
}

.attend-action-btn:hover {
  background: var(--accent-soft);
  color: var(--accent-ink);
  border-color: var(--accent-2);
  transform: translateY(-1px);
}

.attend-action-btn.attended {
  background: linear-gradient(135deg, #7fb08b, #a9cf8f);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(127, 176, 139, 0.35);
}

.attend-action-btn.attended .attend-check-icon {
  transform: scale(1.1);
}

.focus-quick-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--surface-soft);
  border: 1px solid var(--line-strong);
  transition: all var(--t);
  cursor: pointer;
}

.focus-quick-link-btn:hover {
  color: #fff;
  background: linear-gradient(135deg, var(--grad-a), var(--grad-b));
  border-color: transparent;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(212, 119, 143, 0.25);
}

/* Class Delete Button */
.class-delete-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  line-height: 1;
  color: var(--ink-3);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--t);
  flex-shrink: 0;
  opacity: 0.55;
}

.class-item-card:hover .class-delete-btn {
  opacity: 1;
}

.class-delete-btn:hover {
  background: #fdecec;
  color: #c0474b;
  border-color: #fbd3d3;
  transform: scale(1.1);
}

/* Optional Classes: No check-in needed */
.optional-no-check-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: var(--r-pill);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-3);
  background: var(--surface-soft);
  border: 1px dashed var(--line-strong);
  user-select: none;
}

.optional-no-check-pill .opt-leaf {
  font-size: 0.82rem;
}

.week-opt-tag {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--ink-3);
  background: var(--surface-soft);
  padding: 2px 7px;
  border-radius: var(--r-pill);
  border: 1px dashed var(--line);
}

.week-class-del-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  line-height: 1;
  color: var(--ink-3);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--t);
  flex-shrink: 0;
  opacity: 0.45;
}

.week-class-card:hover .week-class-del-btn {
  opacity: 1;
}

.week-class-del-btn:hover {
  background: #fdecec;
  color: #c0474b;
}

/* Week Grid View (Matching Screenshot Timetable) */
.schedule-week-grid-view {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.week-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 10px;
  min-width: 175px;
}

.week-column-header {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 500;
  text-align: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.week-column-sub {
  font-family: var(--sans);
  font-size: 0.72rem;
  color: var(--ink-3);
  font-weight: 500;
}

.week-class-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 10px;
  border-radius: var(--r-sm);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  transition: all var(--t);
  font-size: 0.8rem;
}

.week-class-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.week-class-card.type-required {
  border-left: 3px solid #e04f7c;
  background: #fff9fb;
}

.week-class-card.type-live {
  border-left: 3px solid var(--accent);
}

.week-class-card.type-optional {
  border-left: 3px solid var(--line-strong);
}

.week-class-card.type-club {
  border-left: 3px solid #d48bb5;
  background: #fff8fc;
}

.week-class-title {
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
}

.week-class-time {
  font-size: 0.72rem;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.week-class-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px dashed var(--line);
}

.week-attend-mini-btn {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  cursor: pointer;
  background: var(--surface-soft);
  color: var(--ink-2);
  border: 1px solid var(--line);
  transition: all var(--t);
}

.week-attend-mini-btn:hover {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.week-attend-mini-btn.attended {
  background: #7fb08b;
  color: #fff;
  border-color: #7fb08b;
}

.week-focus-btn {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  cursor: pointer;
  background: var(--surface-soft);
  color: var(--accent-ink);
  border: 1px solid var(--line);
  transition: all var(--t);
  white-space: nowrap;
}

.week-focus-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent-2);
  transform: translateY(-1px);
}

/* Responsive adjustments for schedule */
@media (max-width: 900px) {
  .schedule-week-grid-view {
    grid-template-columns: repeat(5, 200px);
    overflow-x: scroll;
  }
}

@media (max-width: 680px) {
  .schedule-card {
    padding: 22px 18px;
  }
  .schedule-day-view {
    grid-template-columns: 1fr;
  }
}

/* ---------- Lower row ---------- */
.lower {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.stack { display: flex; flex-direction: column; gap: 10px; max-height: 300px; overflow-y: auto; }

/* Goals (JS-generated) */
.goal-item-card {
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  transition: background var(--t);
}
.goal-item-card:hover { background: var(--surface-strong); }
.goal-top-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.goal-title-wrap { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; font-weight: 500; min-width: 0; }
.goal-stepper { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.stepper-btn {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 0.95rem; line-height: 1;
  color: var(--ink-2);
  border: 1px solid var(--line-strong);
  background: #fff;
  transition: all var(--t);
}
.stepper-btn:hover { color: #fff; background: var(--accent); border-color: var(--accent); }
.goal-counter-text { font-size: 0.78rem; font-weight: 600; color: var(--ink-2); min-width: 64px; text-align: center; font-variant-numeric: tabular-nums; }
.goal-progress-bar { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.goal-progress-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--grad-a), var(--grad-b)); transition: width 0.7s var(--ease); }
.goal-progress-fill.completed { background: linear-gradient(90deg, #7fb08b, #a9cf8f); }

/* Alarms (JS-generated) */
.alarm-item-card {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  transition: background var(--t);
}
.alarm-item-card:hover { background: var(--surface-strong); }
.alarm-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.alarm-time-tag {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--ink);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.alarm-label-text { font-size: 0.86rem; font-weight: 500; color: var(--ink); }
.alarm-sound-badge { font-size: 0.74rem; color: var(--ink-3); text-transform: capitalize; }
.alarm-right { display: flex; align-items: center; gap: 4px; }

/* Cultural Traditions Card */
.traditions-card {
  display: flex;
  flex-direction: column;
  grid-column: 1 / -1;
}

.tradition-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 14px;
}

.trad-filter-pill {
  padding: 4px 11px;
  border-radius: var(--r-pill);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-3);
  transition: all var(--t);
  background: transparent;
  cursor: pointer;
}

.trad-filter-pill:hover {
  color: var(--ink);
}

.trad-filter-pill.active {
  background: var(--surface-strong);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.tradition-content-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px;
  border-radius: var(--r-md);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  transition: all var(--t);
  flex: 1;
}

.tradition-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.tradition-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--accent-ink);
  letter-spacing: 0.02em;
}

.tradition-theme {
  font-size: 0.76rem;
  color: var(--ink-3);
  font-weight: 500;
}

.tradition-title {
  font-family: var(--serif);
  font-size: 1.22rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-top: 2px;
}

.tradition-desc {
  font-size: 0.88rem;
  color: var(--ink-2);
  line-height: 1.5;
  margin-bottom: 6px;
}

.tradition-insight {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  font-size: 0.8rem;
  font-style: italic;
  color: var(--ink-2);
  line-height: 1.45;
  margin-top: auto;
}

/* =========================================================
   MINI LANGUAGE LOUNGE (DUOLINGO x GUDETAMA - LONG RECTANGLE)
   ========================================================= */

.language-lesson-card.duo-rect-card {
  width: 100%;
  margin: 32px 0 28px;
  padding: 26px 30px;
  border-radius: var(--r-lg);
  background: var(--surface);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  overflow: hidden;
}

/* Duolingo Card Head */
.duo-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.duo-title-cluster {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.duo-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.duo-badge-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.duo-badge-pill.duo-green {
  background: rgba(88, 204, 2, 0.14);
  color: #2b7a02;
  border: 1px solid rgba(88, 204, 2, 0.3);
}

.duo-badge-pill.gudetama-yellow {
  background: rgba(245, 171, 20, 0.16);
  color: #9c6500;
  border: 1px solid rgba(245, 171, 20, 0.35);
}

.duo-heading {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

/* Duolingo Stats Cluster */
.duo-stats-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.duo-stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: 0 2px 0 var(--line-strong);
  transition: all var(--t);
}

.duo-stat-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 0 var(--line-strong);
}

.duo-stat-pill.stat-streak { color: #d9531e; border-color: rgba(217, 83, 30, 0.25); box-shadow: 0 2px 0 rgba(217, 83, 30, 0.25); }
.duo-stat-pill.stat-xp { color: #d48b00; border-color: rgba(212, 139, 0, 0.25); box-shadow: 0 2px 0 rgba(212, 139, 0, 0.25); }
.duo-stat-pill.stat-eggs { color: #b87800; border-color: rgba(184, 120, 0, 0.25); box-shadow: 0 2px 0 rgba(184, 120, 0, 0.25); }

.stat-unit {
  font-size: 0.7rem;
  color: var(--ink-3);
  font-weight: 500;
  text-transform: uppercase;
}

/* Long Rectangle 2-Column Horizontal Layout */
.duo-horizontal-layout {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 28px;
  align-items: stretch;
}

/* Left Mascot Column (Gudetama) */
.gudetama-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-radius: var(--r-md);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.85) 0%, rgba(255, 248, 230, 0.85) 100%);
  border: 1px solid rgba(245, 171, 20, 0.25);
  box-shadow: inset 0 1px 0 #fff;
  gap: 14px;
}

/* Gudetama Speech Bubble */
.gudetama-speech-bubble {
  position: relative;
  background: #ffffff;
  border: 2px solid rgba(245, 171, 20, 0.35);
  border-radius: 16px;
  padding: 10px 14px;
  box-shadow: 0 3px 8px rgba(180, 130, 70, 0.08);
  width: 100%;
  text-align: center;
}

.gudetama-speech-bubble p {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.88rem;
  color: var(--ink);
  line-height: 1.4;
}

.speech-arrow {
  position: absolute;
  bottom: -9px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 9px solid #ffffff;
}

/* Gudetama Vector Stage */
.gudetama-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  padding: 8px 0;
  outline: none;
  transition: transform 0.15s ease;
}

.gudetama-svg {
  width: 175px;
  height: auto;
  overflow: visible;
  animation: eggBreathe 4.5s ease-in-out infinite;
  transform-origin: center bottom;
  filter: drop-shadow(0 6px 12px rgba(180, 130, 80, 0.12));
}

@keyframes eggBreathe {
  0%, 100% { transform: scale(1) translateY(0); }
  50% { transform: scale(1.02, 0.98) translateY(2px); }
}

.gudetama-stage:hover .gudetama-svg {
  animation: eggWiggle 0.6s ease-in-out infinite alternate;
}

@keyframes eggWiggle {
  0% { transform: rotate(-3deg) scale(1.02); }
  100% { transform: rotate(3deg) scale(1.02); }
}

.gudetama-stage.poked .gudetama-svg {
  animation: eggSquish 0.4s ease-out;
}

@keyframes eggSquish {
  0% { transform: scale(1, 1); }
  35% { transform: scale(1.15, 0.85); }
  70% { transform: scale(0.95, 1.05); }
  100% { transform: scale(1, 1); }
}

.gudetama-tagline {
  margin-top: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #a86c00;
  background: rgba(245, 171, 20, 0.18);
  padding: 2px 10px;
  border-radius: var(--r-pill);
}

/* Gudetama Left Controls */
.gude-controls-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.gude-ctrl-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  box-shadow: 0 2px 0 var(--line-strong);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ink-2);
  transition: all 0.12s ease;
  cursor: pointer;
}

.gude-ctrl-btn:hover {
  background: #fff;
  border-color: var(--accent);
  color: var(--ink);
  box-shadow: 0 3px 0 var(--accent);
  transform: translateY(-1px);
}

.gude-ctrl-btn:active {
  transform: translateY(2px);
  box-shadow: 0 0 0 transparent;
}

/* Right Interactive Column (Duolingo Style) */
.duo-interactive-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* Nav Bar (Languages, Topics, Mode Switch) */
.duo-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.duo-pills-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* Duolingo 3D Pill Buttons */
.duo-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 13px;
  border-radius: var(--r-pill);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-2);
  background: #ffffff;
  border: 2px solid var(--line-strong);
  box-shadow: 0 3px 0 var(--line-strong);
  transition: all 0.12s ease;
  cursor: pointer;
}

.duo-pill-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 0 var(--line-strong);
  color: var(--ink);
}

.duo-pill-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--line-strong);
}

.duo-pill-btn.active {
  background: var(--surface-strong);
  color: var(--accent-ink);
  border-color: var(--accent);
  box-shadow: 0 3px 0 var(--accent);
}

/* Mode Switch (Quiz vs Study Card) */
.duo-mode-switch {
  display: flex;
  align-items: center;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  padding: 3px;
  border-radius: var(--r-pill);
}

.duo-mode-toggle {
  padding: 4px 12px;
  border-radius: var(--r-pill);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ink-3);
  transition: all var(--t);
  cursor: pointer;
}

.duo-mode-toggle.active {
  background: #ffffff;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

/* Dynamic Viewport Container */
.duo-viewport {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 230px;
}

/* ---------- Quiz Mode UI ---------- */
.duo-quiz-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.quiz-prompt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.quiz-sub-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--accent-ink);
  letter-spacing: 0.02em;
}

.quiz-question-title {
  font-family: var(--sans);
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
}

/* Prompt Banner with Speaker */
.quiz-phrase-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.quiz-sound-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #ffffff;
  border: 2px solid var(--line-strong);
  box-shadow: 0 3px 0 var(--line-strong);
  color: var(--accent-ink);
  transition: all 0.12s ease;
  cursor: pointer;
  flex-shrink: 0;
}

.quiz-sound-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 0 var(--line-strong);
  background: var(--accent-soft);
}

.quiz-sound-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--line-strong);
}

.quiz-phrase-content {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.quiz-phrase-foreign {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
}

.quiz-phrase-phonetic {
  font-family: var(--sans);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--accent-ink);
  background: rgba(255, 255, 255, 0.85);
  padding: 2px 8px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
}

/* 2x2 Duolingo Options Grid */
.quiz-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.duo-quiz-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 16px;
  background: #ffffff;
  border: 2px solid var(--line-strong);
  box-shadow: 0 4px 0 var(--line-strong);
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 600;
  transition: all 0.12s ease;
  cursor: pointer;
  text-align: left;
}

.duo-quiz-option:hover:not(:disabled) {
  border-color: var(--accent);
  box-shadow: 0 5px 0 var(--accent);
  transform: translateY(-2px);
}

.duo-quiz-option:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--line-strong);
}

.option-badge {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--ink-3);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.duo-quiz-option.selected {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 4px 0 var(--accent);
}

.duo-quiz-option.selected .option-badge {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.duo-quiz-option.correct {
  background: #eafaf1 !important;
  border-color: #52b788 !important;
  color: #1b4332 !important;
  box-shadow: 0 4px 0 #2d6a4f !important;
}

.duo-quiz-option.correct .option-badge {
  background: #52b788 !important;
  color: #fff !important;
}

.duo-quiz-option.incorrect {
  background: #ffebeb !important;
  border-color: #e63946 !important;
  color: #721c24 !important;
  box-shadow: 0 4px 0 #a8222d !important;
}

.duo-quiz-option.incorrect .option-badge {
  background: #e63946 !important;
  color: #fff !important;
}

/* Quiz Footer & Feedback Tray */
.quiz-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: auto;
  padding-top: 6px;
}

.quiz-feedback-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 14px;
  animation: slideFeedback 0.25s var(--ease);
}

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

.quiz-feedback-box.correct {
  background: #eafaf1;
  border: 2px solid #52b788;
  color: #1b4332;
}

.quiz-feedback-box.incorrect {
  background: #ffebeb;
  border: 2px solid #e63946;
  color: #721c24;
}

.feedback-ico {
  font-size: 1.4rem;
  line-height: 1;
}

.feedback-text-wrap {
  display: flex;
  flex-direction: column;
}

.feedback-title {
  font-weight: 800;
  font-size: 0.92rem;
}

.feedback-desc {
  font-size: 0.8rem;
  opacity: 0.9;
}

/* Duolingo Check / Continue Action Button */
.btn-duo-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 24px;
  border-radius: 16px;
  font-family: var(--sans);
  font-size: 0.94rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #ffffff;
  background: linear-gradient(135deg, #58cc02, #46a302);
  border: 2px solid #3b8a02;
  box-shadow: 0 4px 0 #3b8a02;
  transition: all 0.12s ease;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: auto;
}

.btn-duo-check:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #3b8a02;
  filter: brightness(1.05);
}

.btn-duo-check:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #3b8a02;
}

.btn-duo-check:disabled {
  background: #e4e6eb;
  border-color: #cbd0d8;
  box-shadow: 0 4px 0 #cbd0d8;
  color: #9aa1ad;
  cursor: not-allowed;
}

.btn-duo-check.next-mode {
  background: linear-gradient(135deg, var(--grad-a), var(--grad-b));
  border-color: var(--accent-ink);
  box-shadow: 0 4px 0 var(--accent-ink);
}

/* ---------- Study Card UI ---------- */
.duo-study-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  padding: 18px 20px;
  border-radius: var(--r-md);
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.study-hero-phrase-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.study-phrase {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.25;
}

.study-phonetic {
  font-size: 0.84rem;
  color: var(--accent-ink);
  font-weight: 600;
  margin-left: 8px;
}

.study-meaning {
  font-size: 0.96rem;
  color: var(--ink);
  font-weight: 500;
  font-style: italic;
}

.study-breakdown-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0;
}

.vocab-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: #fff;
  border: 1px solid var(--line);
  font-size: 0.74rem;
}

.vocab-word { font-weight: 700; color: var(--ink); }
.vocab-sep { color: var(--ink-3); font-size: 0.7rem; }
.vocab-def { color: var(--ink-2); }

.study-tip-box {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: #ffffff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  font-size: 0.82rem;
  color: var(--ink-2);
  line-height: 1.45;
}

.study-footer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: auto;
  padding-top: 8px;
}

.btn-duo-next {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border-radius: var(--r-pill);
  font-size: 0.82rem;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, var(--grad-a), var(--grad-b));
  border: 1px solid var(--accent);
  box-shadow: 0 3px 0 var(--accent-ink);
  cursor: pointer;
  transition: all 0.12s ease;
}

.btn-duo-next:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 0 var(--accent-ink);
}

.btn-duo-next:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--accent-ink);
}

/* Responsive Layout */
@media (max-width: 860px) {
  .duo-horizontal-layout {
    grid-template-columns: 1fr;
  }
  .gudetama-column {
    padding: 16px;
  }
  .quiz-options-grid {
    grid-template-columns: 1fr;
  }
  .duo-card-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---------- Footer ---------- */
.footer {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 40px 0 8px;
  font-size: 0.8rem;
  color: var(--ink-3);
}
.footer span:first-child { font-family: var(--serif); font-style: italic; font-size: 0.95rem; color: var(--ink-2); }

/* ---------- Modals ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  z-index: 1000;
  display: grid; place-items: center;
  padding: 20px;
  background: rgba(40, 28, 34, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.35s var(--ease);
}
.modal-overlay.show { opacity: 1; pointer-events: auto; }
.modal {
  width: 100%; max-width: 420px;
  padding: 26px;
  border-radius: var(--r-lg);
  background: var(--surface-strong);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow-lg);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.45s var(--ease);
}
.modal-overlay.show .modal { transform: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-head h3 { font-family: var(--serif); font-weight: 400; font-size: 1.5rem; letter-spacing: -0.02em; }
.modal-body { display: flex; flex-direction: column; gap: 12px; margin-bottom: 22px; }
.field { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.field > span { font-size: 0.86rem; font-weight: 500; color: var(--ink-2); }
.field input[type="number"], .field input[type="text"], .field input[type="time"], .field .select {
  width: 170px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: #fff;
  font-size: 0.88rem;
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
}
.field .select { padding-right: 30px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23998' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; }
.field input:focus { border-color: var(--accent-2); box-shadow: 0 0 0 4px var(--accent-soft); }
.field-switch { justify-content: space-between; width: 100%; padding-top: 4px; }
.modal-foot { display: flex; justify-content: flex-end; }

/* ---------- Confetti + Toast ---------- */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 2000; }

.toast {
  position: fixed;
  left: 50%; bottom: 28px;
  z-index: 2100;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 14px 14px 16px;
  min-width: 320px; max-width: calc(100vw - 32px);
  border-radius: var(--r-md);
  background: var(--surface-strong);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translate(-50%, 24px);
  pointer-events: none;
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--grad-a), var(--grad-b));
  flex-shrink: 0;
}
.toast.show .toast-icon { animation: ring 1.4s var(--ease) infinite; }
@keyframes ring { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(-12deg); } 20%, 40% { transform: rotate(12deg); } }
.toast-body { flex: 1; min-width: 0; }
.toast-title { font-weight: 600; font-size: 0.92rem; }
.toast-msg { font-size: 0.82rem; color: var(--ink-2); }

/* ---------- Scrollbars ---------- */
.task-list::-webkit-scrollbar, .stack::-webkit-scrollbar { width: 6px; }
.task-list::-webkit-scrollbar-thumb, .stack::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 6px; }

/* ---------- Topnav Intro & Profile Chips ---------- */
.tour-chip {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--accent-ink);
  font-weight: 600;
  cursor: pointer;
}
.tour-chip:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  transform: translateY(-1px);
}
.tour-chip .chip-ico {
  font-size: 0.95rem;
  animation: sparkleTwinkle 2.5s infinite ease-in-out;
}
@keyframes sparkleTwinkle {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.9; }
  50% { transform: scale(1.2) rotate(15deg); opacity: 1; }
}

.profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--surface-soft);
  border: 1.5px solid var(--line-strong);
  cursor: pointer;
  padding: 0 12px 0 6px;
  transition: all 0.18s ease;
}
.profile-chip:hover {
  background: var(--surface-strong);
  border-color: var(--accent);
  box-shadow: 0 3px 12px -3px var(--accent-soft);
  transform: translateY(-1px);
}
.profile-avatar-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  display: grid;
  place-items: center;
  font-size: 1rem;
  box-shadow: 0 2px 5px rgba(0,0,0,0.06);
}
.profile-name-text {
  font-weight: 700;
  color: var(--ink);
  font-size: 0.84rem;
}

/* ---------- Welcome Intro Modal ---------- */
.intro-modal-card {
  max-width: 580px;
  padding: 30px;
  background: var(--surface-strong);
  border-radius: var(--r-xl);
}
.intro-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.intro-sparkle-pill {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--accent-ink);
  letter-spacing: 0.02em;
}
.intro-headline {
  font-family: var(--serif);
  font-size: 1.65rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.25;
  margin-bottom: 6px;
}
.intro-subhead {
  font-size: 0.9rem;
  color: var(--ink-2);
  margin-bottom: 20px;
  line-height: 1.45;
}
.intro-features-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}
.intro-feat-card {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: var(--r-md);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  transition: transform 0.2s ease;
}
.intro-feat-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
}
.intro-feat-card .feat-ico {
  font-size: 1.6rem;
  flex-shrink: 0;
  line-height: 1;
  padding-top: 2px;
}
.intro-feat-card h4 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}
.intro-feat-card p {
  font-size: 0.76rem;
  color: var(--ink-2);
  line-height: 1.4;
}
.intro-modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.intro-skip-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--ink-3);
  cursor: pointer;
}
.intro-skip-toggle input {
  accent-color: var(--accent);
  cursor: pointer;
}
.intro-foot-btns {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ---------- Account Modal ---------- */
.account-modal-card {
  max-width: 480px;
  padding: 26px;
  background: var(--surface-strong);
  border-radius: var(--r-xl);
}
.account-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.account-badge-pill {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-ink);
}
.account-modal-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.active-profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--surface-soft), var(--surface-strong));
  border: 1.5px solid var(--accent);
  box-shadow: 0 4px 16px -4px var(--accent-soft);
}
.profile-avatar-large {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent-soft);
  display: grid;
  place-items: center;
  font-size: 1.9rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
  flex-shrink: 0;
}
.profile-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.profile-name-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.profile-badge-label {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: var(--accent-soft);
  padding: 2px 7px;
  border-radius: var(--r-pill);
}
.profile-main-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
}
.profile-stats-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  color: var(--ink-2);
}
.pstat-sep {
  color: var(--line-strong);
}
.pstat-tag {
  font-weight: 600;
  color: #2d6a4f;
  background: #eafaf1;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
}

/* Saved Profiles Section */
.saved-profiles-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.section-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.profile-count-pill {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: var(--r-pill);
  background: var(--surface-soft);
}
.saved-profiles-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 120px;
  overflow-y: auto;
  padding: 4px 0;
}
.saved-profile-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.15s ease;
}
.saved-profile-chip-btn:hover {
  background: var(--surface-strong);
  border-color: var(--accent);
  color: var(--ink);
  transform: translateY(-1px);
}
.saved-profile-chip-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}
.saved-profile-chip-btn .delete-sub-btn {
  margin-left: 4px;
  font-size: 0.7rem;
  opacity: 0.5;
  transition: opacity 0.15s;
}
.saved-profile-chip-btn .delete-sub-btn:hover {
  opacity: 1;
  color: #e63946;
}

/* Account Form & Avatar Picker */
.account-form-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.form-divider {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.account-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.account-field input {
  flex: 1;
  padding: 9px 13px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: var(--ink);
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.account-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.avatar-picker-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.picker-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-2);
}
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.avatar-choice-btn {
  height: 38px;
  border-radius: 10px;
  background: var(--surface-soft);
  border: 1.5px solid var(--line);
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.12s ease;
  display: grid;
  place-items: center;
}
.avatar-choice-btn:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  background: #ffffff;
}
.avatar-choice-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: 0 3px 0 var(--accent);
  transform: translateY(-1px);
}
.account-foot-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}

/* Duo Multi-Language Pills Polish */
.duo-pills-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.duo-pill-btn.lang {
  white-space: nowrap;
}

/* ========================================================
   THE 625 COMMON WORDS STYLES
   ======================================================== */
.duo-mode-toggle.duo-bank-btn {
  background: linear-gradient(135deg, rgba(254, 214, 70, 0.22), rgba(245, 171, 20, 0.28));
  color: #8c5800;
  border: 1px solid rgba(245, 171, 20, 0.45);
  font-weight: 800;
}
.duo-mode-toggle.duo-bank-btn:hover {
  background: linear-gradient(135deg, rgba(254, 214, 70, 0.35), rgba(245, 171, 20, 0.42));
  color: #6d4400;
  transform: translateY(-1px);
}

.duo-625-strip {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  padding: 10px 14px;
  border-radius: var(--r-md);
  margin-top: 2px;
}

.duo-categories-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.duo-categories-bar::-webkit-scrollbar {
  height: 4px;
}
.duo-categories-bar::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 4px;
}

.duo-cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: var(--r-pill);
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
  background: #ffffff;
  color: var(--ink-2);
  border: 1.5px solid var(--line-strong);
  box-shadow: 0 2px 0 var(--line-strong);
  cursor: pointer;
  transition: all 0.12s ease;
}
.duo-cat-pill:hover {
  color: var(--ink);
  transform: translateY(-1px);
  box-shadow: 0 3px 0 var(--line-strong);
}
.duo-cat-pill.active {
  background: var(--surface-strong);
  color: var(--accent-ink);
  border-color: var(--accent);
  box-shadow: 0 2px 0 var(--accent);
}

/* Word Tracker & Progress Row */
.duo-word-tracker-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.76rem;
}
.tracker-left {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.tracker-badge {
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 0.7rem;
}
.tracker-num {
  font-weight: 700;
  color: var(--ink-2);
}
.tracker-progress-track {
  flex: 1;
  height: 8px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: var(--r-pill);
  overflow: hidden;
  position: relative;
}
.tracker-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #ff9eb5);
  border-radius: var(--r-pill);
  transition: width 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.tracker-nav-arrows {
  display: flex;
  align-items: center;
  gap: 4px;
}
.tracker-arrow-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--r-pill);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.12s ease;
  box-shadow: 0 2px 0 var(--line);
}
.tracker-arrow-btn:hover {
  background: var(--surface-soft);
  color: var(--ink);
  border-color: var(--accent);
  transform: translateY(-1px);
}
.tracker-arrow-btn:active {
  transform: translateY(1px);
  box-shadow: none;
}

/* 625 Words Explorer Modal */
.words-explorer-card {
  max-width: 920px;
  width: 95vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}
.words-explorer-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.words-search-wrap {
  flex: 1;
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: var(--r-pill);
}
.words-search-wrap input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-family: inherit;
  font-size: 0.84rem;
  color: var(--ink);
}
.words-count-badge {
  font-size: 0.74rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--accent-ink);
  white-space: nowrap;
}
.words-explorer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  overflow-y: auto;
  max-height: 60vh;
  padding: 14px 2px 6px;
  scrollbar-width: thin;
}

.word-item-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  background: #ffffff;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: 0 2px 5px rgba(0,0,0,0.03);
  transition: all 0.15s ease;
}
.word-item-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
}
.word-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.word-card-id {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--ink-3);
  background: var(--surface-soft);
  padding: 2px 6px;
  border-radius: 4px;
}
.word-card-cat {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent-ink);
  text-transform: capitalize;
}
.word-card-en {
  font-size: 0.78rem;
  color: var(--ink-3);
  font-weight: 600;
}
.word-card-target {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ink);
}
.word-card-phonetic {
  font-size: 0.74rem;
  color: var(--ink-3);
  font-style: italic;
}
.word-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}
.word-card-listen-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-2);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 4px;
  transition: all var(--t);
}
.word-card-listen-btn:hover {
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.word-card-practice-btn {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--surface-soft);
  color: var(--ink-2);
  border: 1px solid var(--line-strong);
  cursor: pointer;
  transition: all var(--t);
}
.word-card-practice-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ---------- Responsive ---------- */
@media (max-width: 1040px) {
  .hero { grid-template-columns: 1fr; align-items: start; padding-top: 40px; }
  .dashboard { grid-template-columns: 1fr; }
  .lower { grid-template-columns: 1fr 1fr; }
  .notes-card { grid-column: span 2; }
}

@media (max-width: 680px) {
  .intro-features-grid { grid-template-columns: 1fr; }
  .intro-modal-foot { flex-direction: column; align-items: stretch; }
  .intro-foot-btns { width: 100%; justify-content: stretch; }
  .intro-foot-btns button { flex: 1; }
  .avatar-grid { grid-template-columns: repeat(5, 1fr); }
  .profile-name-text { display: none; }
  .shell { padding: 12px 16px 40px; }
  .topnav { border-radius: var(--r-lg); flex-wrap: wrap; padding: 10px 12px; top: 8px; }
  .chip-label, .streak-chip #streak-counter { display: none; }
  .nav-chip { padding: 0 11px; }
  .card { padding: 22px; }
  .lower { grid-template-columns: 1fr; }
  .notes-card { grid-column: span 1; }
  .mode-pill { padding: 7px 11px; font-size: 0.8rem; }
  .btn-primary { min-width: 150px; padding: 0 22px; }
  .dropdown { right: -40px; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .reveal { opacity: 1; transform: none; }
}
