/* ===== Har button par INSTANT press feedback — pura app makkhan smooth ===== */
button, [role="button"], .link-button, .bottom-nav a, .top-learning-buttons a,
.bk-tool, .bk-btn, .dy-btn, .tool-btn, .rel-chip, .rel-mc-act, .rmr-chip,
input[type="submit"], .gd-word-compact, .gd-sound-mini, .sound-btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform .07s ease-out, filter .12s ease-out;
}
button:active, [role="button"]:active, .link-button:active, .bottom-nav a:active,
.top-learning-buttons a:active, .bk-tool:active, .bk-btn:active, .dy-btn:active,
.tool-btn:active, .rel-chip:active, .rel-mc-act:active,
.gd-sound-mini:active, .sound-btn:active, input[type="submit"]:active {
  transform: scale(.95);
  filter: brightness(1.18);
}
/* Word row = EK clickable box. Andar ka word button apna alag press ("putti") na dikhae —
   feedback poore row par. */
.gd-word-compact:active, .gd-word-compact:focus { transform: none !important; filter: none !important; }
.gd-row-compact:active { filter: brightness(1.07); background: color-mix(in srgb, var(--cyan) 9%, transparent); border-radius: 8px; }

:root {
  --bg: #0d102d;
  --panel: #171a46;
  --panel-2: #20245d;
  --text: #f7f7ff;
  --muted: #b9bee8;
  --line: rgba(255,255,255,.12);
  --gold: #ffd166;
  --pink: #ef5da8;
  --cyan: #4cc9f0;
  --green: #7bd88f;
  --danger: #ff6b6b;
  --soft: #fff5d6;
  --shadow: 0 18px 45px rgba(0,0,0,.28);
}

* { box-sizing: border-box; }
html { max-width: 100%; background: var(--bg); color: var(--text); font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; overflow-x: hidden; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; max-width: 100%; color: var(--text); background: radial-gradient(circle at top left, #33216f 0, transparent 34rem), linear-gradient(180deg, #0d102d, #111434 58%, #0d102d); padding-bottom: 5.8rem; }
body.word-dictionary-page { height: 100vh; height: 100dvh; overflow: hidden; padding-bottom: 0; }
body.theme-galaxy {
  --bg: #0c0a22; --panel: #181438; --panel-2: #221c4d; --text: #f3f0ff; --muted: #c4bce6; --line: rgba(196,188,230,.16);
  --gold: #ffd27a; --pink: #f48fd0; --cyan: #7ec8ff; --green: #8be0c0; --danger: #ff9aa9; --soft: #efe9ff;
  background: linear-gradient(180deg, #0c0a22, #1a1442 55%, #0c0a22);
}
body.theme-sunset {
  --bg: #1d1016; --panel: #2c1822; --panel-2: #3b2030; --text: #fff4ee; --muted: #e6c8c2; --line: rgba(255,224,214,.16);
  --gold: #ffc15e; --pink: #ff8fa3; --cyan: #ffb27a; --green: #ffd083; --danger: #ff9a9a; --soft: #ffe9d6;
  background: linear-gradient(180deg, #1d1016, #36192b 55%, #1d1016);
}
body.theme-cyber {
  --bg: #07120f; --panel: #0e201b; --panel-2: #143028; --text: #eafff6; --muted: #a9d8c8; --line: rgba(110,255,200,.16);
  --gold: #ffe06b; --pink: #ff79c6; --cyan: #50fa7b; --green: #50fa7b; --danger: #ff6e6e; --soft: #eafff6;
  background: linear-gradient(180deg, #07120f, #0e201b 55%, #07120f);
}
body.theme-soft-night {
  --bg: #111827;
  --panel: #1f2937;
  --panel-2: #273449;
  --text: #f4f7fb;
  --muted: #cbd5e1;
  --line: rgba(226,232,240,.16);
  --gold: #f6d58f;
  --pink: #d98bb7;
  --cyan: #8bd3dd;
  --green: #9ee6b7;
  --danger: #fca5a5;
  --soft: #fff2c7;
  background: linear-gradient(180deg, #101827, #162033 56%, #101827);
}
body.theme-warm-paper {
  --bg: #f3ead8;
  --panel: #fff8e8;
  --panel-2: #eadfca;
  --text: #2d261b;
  --muted: #665c4d;
  --line: rgba(69,55,35,.18);
  --gold: #8b5e12;
  --pink: #9b4668;
  --cyan: #1b6a73;
  --green: #2f6f4f;
  --danger: #9b2f2f;
  --soft: #3a2d14;
  --shadow: 0 14px 34px rgba(91,70,38,.16);
  background: linear-gradient(180deg, #f3ead8, #fbf4e6 45%, #efe2cb);
}
body.theme-green-comfort {
  --bg: #102018;
  --panel: #1b3027;
  --panel-2: #263c31;
  --text: #f2fbf5;
  --muted: #c3d8cb;
  --line: rgba(213,232,220,.16);
  --gold: #f2d58a;
  --pink: #d98d9f;
  --cyan: #8ed7c5;
  --green: #98e6a8;
  --danger: #f4a3a3;
  --soft: #fff2c0;
  background: linear-gradient(180deg, #102018, #173326 58%, #102018);
}
body.theme-ink-black {
  --bg: #000000; --panel: #0e0e0e; --panel-2: #1a1a1a; --text: #e8e8e8; --muted: #b0b0b0; --line: rgba(255,255,255,.13);
  --gold: #f8d66d; --pink: #d76ea8; --cyan: #7ed8ff; --green: #91e8a8; --danger: #ff8f8f; --soft: #fff1bf;
  background: #000000;   /* true AMOLED black — power-saving + text softened (halation kam) */
}

/* 📸 Instagram theme — clean white IG feed + iconic IG gradient (purple→magenta→orange) */
body.theme-instagram {
  --bg: #fafafa; --panel: #ffffff; --panel-2: #f4f4f4; --text: #1c1c1e; --muted: #8e8e8e; --line: #dbdbdb;
  --gold: #fcaf45; --pink: #e1306c; --cyan: #5b51d8; --green: #2fb344; --danger: #ed4956; --soft: #262626;
  --accentX: #dd2a7b; --accentX2: #f58529; --on-accent: #ffffff;   /* magenta→orange (2-stop uses) */
  --shadow: 0 12px 30px rgba(131,58,180,.14);
  background: #fafafa;
}
/* Iconic FULL IG gradient on prominent surfaces: primary CTAs, sound buttons, progress, active stage-tab */
body.theme-instagram button.primary, body.theme-instagram .primary, body.theme-instagram a.primary,
body.theme-instagram .save-btn, body.theme-instagram .save-btn-fixed, body.theme-instagram .apk-download,
body.theme-instagram .progress span, body.theme-instagram .ai-card .ai-progress-bar > div,
body.theme-instagram .gd-sound-mini, body.theme-instagram .gd-sound,
body.theme-instagram .top-filter-btn.active {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%) !important;
  color: #fff !important;
  border-color: transparent !important;
}
body.theme-instagram .top-filter-btn.active, body.theme-instagram .top-filter-btn.active * { color: #fff !important; }
/* active bottom-nav tab = IG magenta on the clean white bar */
body.theme-instagram .bottom-nav a.active { color: #dd2a7b !important; background: rgba(221,42,123,.08) !important; }
body.theme-ocean-calm {
  --bg: #071b25; --panel: #102c38; --panel-2: #173d4b; --text: #eefcff; --muted: #b7d5dc; --line: rgba(191,236,245,.16);
  --gold: #f5d77a; --pink: #d98bb0; --cyan: #72d7e8; --green: #8ce5bd; --danger: #ffa5a5; --soft: #e9fff8;
  background: linear-gradient(180deg, #071b25, #0e2d39 58%, #071b25);
}
body.theme-lavender-mist {
  --bg: #171426; --panel: #25203a; --panel-2: #312a4a; --text: #fbf7ff; --muted: #d5cce7; --line: rgba(232,220,255,.16);
  --gold: #f4d176; --pink: #df8cc4; --cyan: #a8d8ff; --green: #a6e6ba; --danger: #ffa5b8; --soft: #fff0d0;
  background: linear-gradient(180deg, #171426, #25203a 55%, #171426);
}
body.theme-rose-dim {
  --bg: #21131a; --panel: #321f29; --panel-2: #412936; --text: #fff8fb; --muted: #dec4cf; --line: rgba(255,224,235,.15);
  --gold: #f7cf7a; --pink: #f08ab7; --cyan: #93d7e7; --green: #9de2aa; --danger: #ff9a9a; --soft: #fff0c9;
  background: linear-gradient(180deg, #21131a, #33202a 55%, #21131a);
}
body.theme-sepia-book {
  --bg: #e7d7b9; --panel: #f8ecd3; --panel-2: #e5d3b1; --text: #352818; --muted: #6f614e; --line: rgba(80,55,25,.2);
  --gold: #8d5f18; --pink: #9d5f6c; --cyan: #3d7f87; --green: #517d42; --danger: #9b2f2f; --soft: #3b2a16;
  --shadow: 0 14px 34px rgba(91,70,38,.16);
  background: linear-gradient(180deg, #e7d7b9, #f3e5c9 58%, #e3d1ae);
}
body.theme-mint-paper {
  --bg: #e4f3e9; --panel: #f6fff8; --panel-2: #d4eadc; --text: #173125; --muted: #536b5d; --line: rgba(30,72,49,.18);
  --gold: #806016; --pink: #9b5c7c; --cyan: #247987; --green: #2e7c4d; --danger: #9b2f2f; --soft: #173125;
  --shadow: 0 14px 34px rgba(30,72,49,.14);
  background: linear-gradient(180deg, #e4f3e9, #f6fff8 58%, #dceee4);
}
body.theme-slate-focus {
  --bg: #111827; --panel: #202938; --panel-2: #2d3849; --text: #f8fafc; --muted: #c8d1dd; --line: rgba(226,232,240,.16);
  --gold: #e8c66d; --pink: #c989ad; --cyan: #8ecde5; --green: #9bddb4; --danger: #fca5a5; --soft: #fff2c2;
  background: linear-gradient(180deg, #111827, #1c2736 58%, #111827);
}
body.theme-high-contrast {
  --bg: #000814; --panel: #001d3d; --panel-2: #003566; --text: #ffffff; --muted: #dbeafe; --line: rgba(255,255,255,.28);
  --gold: #ffd60a; --pink: #ff70a6; --cyan: #7dd3fc; --green: #a7f3d0; --danger: #ff8c8c; --soft: #fff7b0;
  background: #000814;
}
/* ☀️ Bright, vibrant themes — padhne me interest bane rahe */
body.theme-sky {
  --bg: #e3f2ff; --panel: #ffffff; --panel-2: #d2e9fc; --text: #0c2b47; --muted: #4a6e8c; --line: rgba(12,43,71,.14);
  --gold: #e08a00; --pink: #e0467f; --cyan: #0c8ee0; --green: #1aa05a; --danger: #d63b3b; --soft: #0c2b47;
  --shadow: 0 14px 34px rgba(12,110,180,.16);
  background: linear-gradient(180deg, #bfe3ff, #eaf6ff 50%, #d4edff);
}
body.theme-sunny {
  --bg: #fff6df; --panel: #fffdf6; --panel-2: #ffeebf; --text: #4a2f08; --muted: #8a6a3a; --line: rgba(74,47,8,.14);
  --gold: #d98700; --pink: #e0588a; --cyan: #1899c4; --green: #4a9b2e; --danger: #cf3b2f; --soft: #4a2f08;
  --shadow: 0 14px 34px rgba(180,130,30,.16);
  background: linear-gradient(180deg, #ffeebc, #fff8e6 52%, #ffe9b8);
}
body.theme-candy {
  --bg: #ffe9f4; --panel: #ffffff; --panel-2: #ffd6ea; --text: #4a1133; --muted: #8a4d6d; --line: rgba(74,17,51,.14);
  --gold: #e0890d; --pink: #e23d86; --cyan: #2aa7c4; --green: #2ba35e; --danger: #d6354f; --soft: #4a1133;
  --shadow: 0 14px 34px rgba(200,60,130,.16);
  background: linear-gradient(180deg, #ffd5ea, #fff0f7 52%, #ffdcef);
}
body.theme-aqua {
  --bg: #def7f2; --panel: #ffffff; --panel-2: #c4eee5; --text: #0a3a33; --muted: #46756c; --line: rgba(10,58,51,.13);
  --gold: #c98a12; --pink: #d6557f; --cyan: #06a3b8; --green: #16a06a; --danger: #cf3b3b; --soft: #0a3a33;
  --shadow: 0 14px 34px rgba(20,150,130,.15);
  background: linear-gradient(180deg, #bdeee4, #ebfbf7 52%, #cdf2ea);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1rem; background: rgba(13,16,45,.86); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.brand span { display: grid; place-items: center; width: 2.35rem; height: 2.35rem; border-radius: .65rem; color: #10122e; background: linear-gradient(135deg, var(--gold), var(--cyan)); font-weight: 900; }
.brand strong { font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ghost { color: var(--muted); font-size: .9rem; }
.word-dictionary-page .topbar { width: 100vw; max-width: 100vw; padding: .55rem .7rem; background: linear-gradient(135deg, rgba(255,95,170,.92), rgba(85,224,255,.88)); border-bottom: 0; box-shadow: 0 14px 34px rgba(0,0,0,.28); }
.word-dictionary-page .brand { width: 100%; justify-content: center; min-height: 3.15rem; }
.word-dictionary-page .brand strong { width: 100%; text-align: center; color: #ffffff; font-size: clamp(1.35rem, 6vw, 2.35rem); font-weight: 1000; letter-spacing: .04em; text-shadow: 0 2px 16px rgba(0,0,0,.28); }
.floating-settings { position: fixed; left: calc(min(390px, 100vw) - 4rem); bottom: calc(4.55rem + env(safe-area-inset-bottom)); z-index: 14; display: inline-flex; align-items: center; justify-content: center; width: 3.1rem; height: 3.1rem; padding: 0; border-radius: 999px; background: linear-gradient(135deg, var(--cyan), var(--pink)); color: white; font-size: 1.15rem; font-weight: 900; box-shadow: 0 16px 36px rgba(0,0,0,.38); border: 1px solid rgba(255,255,255,.22); }
.prompt-modal { position: fixed; inset: 0; z-index: 30; display: none; align-items: end; justify-content: center; padding: 1rem; background: rgba(0,0,0,.64); }
.prompt-modal.is-open { display: flex; }
.prompt-modal-card { width: min(42rem, 100%); max-height: 86vh; overflow: auto; padding: 1rem; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); }
.prompt-modal-card textarea { min-height: 15rem; margin: .75rem 0; line-height: 1.45; }
.prompt-modal-card [data-prompt-close] { background: var(--panel-2); border: 1px solid var(--line); padding: .55rem .75rem; }
.prompt-modal-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .5rem; }
.prompt-modal-actions button { flex: 1 1 auto; min-width: 12rem; }
.prompt-modal-actions .secondary { background: linear-gradient(135deg, rgba(110,229,152,.16), rgba(85,224,255,.12)); border: 1px solid rgba(110,229,152,.4); color: var(--green); font-weight: 800; padding: .7rem 1rem; border-radius: 10px; cursor: pointer; }
.prompt-modal-actions .secondary:hover { background: linear-gradient(135deg, rgba(110,229,152,.24), rgba(85,224,255,.18)); }
.paste-image-box { display: grid; gap: .45rem; margin: .75rem 0; padding: .85rem; border: 1px dashed var(--line); border-radius: 8px; background: color-mix(in srgb, var(--panel-2) 60%, transparent); }
.paste-image-box:focus { outline: 3px solid rgba(85,224,255,.18); border-color: var(--cyan); }
.paste-image-box.has-image { border-color: var(--green); background: color-mix(in srgb, var(--green) 12%, var(--panel-2)); }
.paste-image-box b { color: var(--gold); }
.paste-image-box span, .paste-image-box small { color: var(--muted); }
/* Make the file picker clearly visible & tappable (global appearance:none on
   inputs otherwise strips the native "Choose file" button). */
.paste-image-box input[type="file"] {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}
.paste-image-box .pick-btn {
  display: block; width: 100%; margin-top: .15rem; padding: .8rem;
  border: none; border-radius: 10px; cursor: pointer; font-weight: 800; font-size: 1rem;
  color: #0a0c22; background: linear-gradient(135deg,#6ee598,#55e0ff);
}
.selected-hook-line { padding: .55rem .7rem; border-radius: 8px; border: 1px solid var(--line); background: color-mix(in srgb, var(--gold) 10%, var(--panel-2)); color: var(--gold); font-weight: 800; }

.page { width: min(1050px, 100%); margin: 0 auto; padding: 1rem; }
.hero { padding: 1.2rem 0 1rem; }
.hero p { margin: 0 0 .35rem; color: var(--cyan); font-weight: 700; letter-spacing: 0; }
.hero h1 { margin: 0; font-size: clamp(2rem, 9vw, 4.2rem); line-height: 1; }
.top-learning-buttons { display: flex; gap: .16rem; margin: 0 0 1rem; overflow: hidden; }
.top-filter-btn { flex: 1 1 0; min-width: 0; display: grid; place-items: center; align-content: center; min-height: 3.2rem; padding: .38rem .12rem; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 10px 22px rgba(0,0,0,.16); text-align: center; }
.bi { display: block; width: 1em; height: 1em; fill: currentColor; }
.top-filter-btn .bi { color: var(--cyan); font-size: 1.05rem; margin-bottom: .1rem; }
.top-filter-btn b { display: block; color: var(--gold); font-size: .72rem; line-height: 1.05; }
.word-dictionary-page .top-filter-btn { padding: .34rem .05rem; min-height: 3rem; }
.word-dictionary-page .top-filter-btn b { font-size: clamp(.5rem, 2.4vw, .72rem); }
.word-dictionary-page .top-filter-btn span { font-size: .55rem; }
.top-filter-btn span { display: block; margin-top: .16rem; color: var(--muted); font-size: .62rem; line-height: 1.15; }
.top-filter-btn.active { border-color: rgba(255,209,102,.62); background: color-mix(in srgb, var(--gold) 14%, var(--panel)); }
.word-dictionary-page .page {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  padding: .45rem .6rem 0;
  overflow: hidden;
  justify-content: flex-start;     /* CRITICAL: pack items to top, no gaps */
  align-items: stretch;
  gap: .35rem;                      /* uniform gap between sections */
}
@media (min-width: 720px) { .word-dictionary-page .page { padding: .6rem 1.2rem 0; } }
@media (min-width: 1100px) { .word-dictionary-page .page { padding: .75rem 2rem 0; } }
.word-dictionary-page .top-learning-buttons { flex: 0 0 auto; position: relative; top: auto; z-index: 9; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: .1rem; width: 100%; max-width: 100%; margin: 0 0 .75rem; padding: .38rem .18rem; border-radius: 0; background: rgba(7,8,31,.94); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); overflow: hidden; }
.word-dictionary-page .top-learning-buttons > * { min-width: 0; }
.word-dictionary-page .top-filter-btn { width: auto; min-width: 0; min-height: 3.38rem; padding: .24rem .06rem; box-shadow: none; border-radius: 8px; }
.word-dictionary-page .top-filter-btn .bi { font-size: .95rem; margin-bottom: .06rem; }
.word-dictionary-page .top-filter-btn b { display: block; width: 100%; color: var(--text); font-size: clamp(.58rem, 2.7vw, .82rem); line-height: 1.1; white-space: normal; overflow-wrap: anywhere; }
.word-dictionary-page .top-filter-btn span { display: block; margin-top: .13rem; color: var(--muted); font-size: clamp(.5rem, 2.35vw, .62rem); line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dic-search { flex: 0 0 auto; position: relative; top: auto; z-index: 8; display: grid; grid-template-columns: minmax(0, 1fr) 3.05rem 3.05rem; gap: .16rem; width: 100%; max-width: 100%; margin: -.35rem 0 .7rem; padding: .42rem .2rem; background: rgba(7,8,31,.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); overflow: hidden; }
.dic-search input { min-width: 0; min-height: 2.65rem; padding: .65rem .75rem; border-radius: 8px; }
.dic-search button, .dic-search a { display: inline-flex; align-items: center; justify-content: center; min-width: 0; min-height: 2.65rem; padding: .55rem .2rem; border-radius: 8px; font-size: .62rem; font-weight: 900; white-space: nowrap; }
.dic-search a { background: var(--panel-2); border: 1px solid var(--line); color: var(--text); }
.dic-total-line { flex: 0 0 auto; display: flex; align-items: center; gap: .35rem; margin: -.35rem 0 .55rem; padding: .42rem .65rem; border: 1px solid var(--line); border-radius: 8px; background: color-mix(in srgb, var(--panel-2) 72%, var(--bg)); color: var(--muted); font-size: .82rem; font-weight: 900; }
.dic-total-line strong { color: var(--gold); font-size: 1rem; }
.dic-total-line em { margin-left: auto; color: var(--cyan); font-style: normal; font-size: .74rem; }
.dic-filter-panel { flex: 0 0 auto; position: relative; top: auto; z-index: 7; width: 100%; max-width: 100%; max-height: 38vh; overflow: auto; margin: -.7rem 0 .75rem; border-radius: 0; border-left: 0; border-right: 0; background: rgba(18,20,59,.97); backdrop-filter: blur(14px); }
.dic-filter-panel[hidden] { display: none; }
.dic-filter-panel .link-button { min-height: 2.7rem; }
.mode-filter-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; padding: .65rem; }
.mode-filter-panel .mode-choice { display: grid; place-items: center; gap: .18rem; min-height: 3.2rem; padding: .6rem .45rem; border: 1px solid var(--line); border-radius: 8px; background: color-mix(in srgb, var(--panel-2) 82%, transparent); color: var(--text); text-align: center; }
.mode-filter-panel .mode-choice b { font-size: .92rem; color: var(--gold); }
.mode-filter-panel .mode-choice span { color: var(--muted); font-size: .74rem; font-weight: 900; }
.mode-filter-panel .mode-choice.active { border-color: rgba(255,209,102,.72); background: color-mix(in srgb, var(--gold) 16%, var(--panel)); box-shadow: 0 0 0 3px rgba(255,209,102,.1); }
.mode-filter-panel .muted-line { grid-column: 1 / -1; margin: .05rem 0 0; font-size: .74rem; line-height: 1.35; }

.panel, .word-card, .stat, .era-card, .flashcard { background: color-mix(in srgb, var(--panel) 92%, transparent); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.panel { padding: 1rem; margin-bottom: 1rem; }
.notice { margin: 0 0 1rem; padding: .85rem 1rem; border-radius: 8px; background: rgba(76,201,240,.14); border: 1px solid rgba(76,201,240,.35); color: #eaffff; }
.empty, .hint { color: var(--muted); }
.big { font-size: 1.5rem; font-weight: 800; color: var(--gold); }
.journey { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .2rem; }
.journey span { flex: 0 0 auto; padding: .7rem .8rem; border-radius: 999px; background: rgba(255,209,102,.13); border: 1px solid rgba(255,209,102,.3); color: var(--soft); font-weight: 900; }

.home-top { display: grid; gap: 1rem; align-items: start; margin-bottom: 1rem; }
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; margin-bottom: 1rem; }
.home-top .stats-grid { margin-bottom: 0; }
.dictionary-home { order: -1; margin-bottom: 0; }
.mini-dictionary-list { display: grid; gap: .45rem; max-height: 31rem; overflow: auto; padding-right: .15rem; }
.mini-dict-row { display: grid; gap: .18rem; padding: .7rem; border-radius: 8px; background: color-mix(in srgb, var(--panel-2) 72%, var(--bg)); border: 1px solid var(--line); }
.mini-dict-row b { color: var(--gold); font-size: 1.08rem; }
.mini-dict-row span { color: var(--muted); font-size: .88rem; line-height: 1.35; }
.stat { padding: 1rem; }
.stat span, .status-row span { display: block; color: var(--muted); font-size: .88rem; }
.stat strong { display: block; margin-top: .35rem; font-size: 1.75rem; color: var(--gold); }
.status-row { display: flex; justify-content: space-between; gap: 1rem; padding: .75rem 0; border-top: 1px solid var(--line); }
.status-row:first-of-type { border-top: 0; }
.section-title, .word-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.section-title h2, .panel h2 { margin: 0 0 .85rem; }
.section-title a, .link-button, .quick-links a { display: inline-flex; align-items: center; justify-content: center; min-height: 2.55rem; padding: .65rem .9rem; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); font-weight: 700; }
.quick-links a.active { border-color: rgba(255,209,102,.55); background: rgba(255,209,102,.14); color: var(--gold); }

.word-list, .root-grid, .timeline, .cards-stack, .dictionary-list { display: grid; gap: .85rem; }
.word-only-list { display: grid; gap: .35rem; }
/* Reset margins on all .page children so flex gap controls spacing */
.word-dictionary-page .page > * { margin-top: 0 !important; margin-bottom: 0 !important; }
/* CRITICAL: cancel any positioned offset on search bar (was top: 4.25rem creating overlap) */
.word-dictionary-page .dic-search,
.word-dictionary-page .dic-filter-panel { top: auto !important; position: relative !important; }
.word-dictionary-page .dic-filter-panel[hidden] { display: none !important; }

/* Single column word list — mobile-style word-by-word on every screen */
.word-dictionary-page .word-only-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: calc(5.7rem + env(safe-area-inset-bottom));
  scroll-padding-bottom: calc(5.7rem + env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
}
.word-dictionary-page .word-only-list .word-row-card {
  margin-bottom: 0;
  flex-shrink: 0;          /* never let cards squish */
  min-height: 3.5rem;
  /* ⚡ Perf: off-screen rows ka layout+paint skip karo (500-row DIC list me ~8 hi visible hote).
     contain-intrinsic-size = collapsed row height → scrollbar jump nahi hota. (audit quick-win) */
  content-visibility: auto;
  contain-intrinsic-size: auto 3.5rem;
}

/* Open card highlight */
.word-dictionary-page .word-only-list .word-row-card.is-open {
  background: linear-gradient(180deg, rgba(85,224,255,.06), transparent 60%);
}
.word-card { display: block; padding: 1rem; }
.word-card strong { color: var(--gold); font-size: 1.2rem; }
.word-card p { margin: .45rem 0; }
.word-card small, .word-card span { color: var(--muted); }
.dictionary-top { display: grid; gap: 1rem; align-items: center; }
.list-summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.dictionary-top h2 { margin: .1rem 0 .35rem; }
.eyebrow { margin: 0; color: var(--cyan); font-size: .84rem; font-weight: 900; text-transform: uppercase; }
.muted-line { color: var(--muted); }
.dictionary-totals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.dictionary-totals div { padding: .85rem; border-radius: 8px; background: color-mix(in srgb, var(--panel-2) 72%, var(--bg)); border: 1px solid var(--line); }
.dictionary-totals span { display: block; color: var(--muted); font-size: .78rem; }
.dictionary-totals strong { display: block; margin-top: .25rem; color: var(--gold); font-size: 1.45rem; }
.dictionary-card .word-head h2 { margin: 0; color: var(--gold); }
.count-badge { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; padding: .34rem .58rem; border-radius: 999px; border: 1px solid rgba(76,201,240,.38); background: rgba(76,201,240,.12); color: var(--cyan); font-weight: 900; font-size: .78rem; }
.related-title { margin-top: .85rem; color: var(--gold); font-weight: 900; }
.related-word-grid { display: flex; flex-wrap: wrap; gap: .45rem; max-height: 16rem; overflow: auto; padding: .65rem 0 .1rem; }
.word-pill { display: inline-flex; align-items: center; min-height: 2rem; padding: .38rem .58rem; border-radius: 999px; background: rgba(255,255,255,.07); border: 1px solid var(--line); color: var(--text); font-size: .86rem; font-weight: 800; }
.word-pill:hover { border-color: rgba(255,209,102,.55); color: var(--gold); }
.word-row-card { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); overflow: hidden; }
.word-row-toggle { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .82rem .9rem; border: 0; border-radius: 0; background: transparent; color: var(--text); text-align: left; }
.word-row-toggle strong { color: var(--gold); font-size: 1.08rem; }
.word-row-meta { flex: 0 0 auto; max-width: 46%; display: inline-flex; align-items: center; justify-content: flex-end; gap: .35rem; overflow: hidden; color: var(--muted); font-size: .82rem; }
.word-row-meta small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: .78rem; }
.word-row-meta em { flex: 0 0 auto; min-width: 2.2rem; padding: .2rem .34rem; border-radius: 999px; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.08); color: var(--muted); font-style: normal; font-size: .67rem; font-weight: 1000; text-align: center; }
.word-row-card.is-open .word-row-toggle { background: color-mix(in srgb, var(--gold) 10%, transparent); }
.word-row-card.is-transferred { border-color: rgba(76,201,240,.36); background: color-mix(in srgb, var(--panel) 74%, rgba(76,201,240,.18)); }
.word-row-card.is-transferred .word-row-toggle strong { color: var(--cyan); }
.word-row-card.stage-night,
.word-row-card.stage-summary-5-min,
.word-row-card.stage-one-hour,
.word-row-card.stage-day-1,
.word-row-card.stage-day-3,
.word-row-card.stage-day-7,
.word-row-card.stage-day-30 {
  border-color: rgba(91, 152, 255, .58);
  background: linear-gradient(135deg, color-mix(in srgb, var(--panel) 74%, rgba(67,111,255,.24)), color-mix(in srgb, var(--panel) 78%, rgba(154,95,255,.22)));
}
.word-row-card.stage-night .word-row-toggle strong,
.word-row-card.stage-summary-5-min .word-row-toggle strong,
.word-row-card.stage-one-hour .word-row-toggle strong,
.word-row-card.stage-day-1 .word-row-toggle strong,
.word-row-card.stage-day-3 .word-row-toggle strong,
.word-row-card.stage-day-7 .word-row-toggle strong,
.word-row-card.stage-day-30 .word-row-toggle strong { color: #bfe6ff; }
.word-row-card.stage-night .word-row-meta em,
.word-row-card.stage-summary-5-min .word-row-meta em,
.word-row-card.stage-one-hour .word-row-meta em,
.word-row-card.stage-day-1 .word-row-meta em,
.word-row-card.stage-day-3 .word-row-meta em,
.word-row-card.stage-day-7 .word-row-meta em,
.word-row-card.stage-day-30 .word-row-meta em { background: rgba(85,224,255,.18); border-color: rgba(85,224,255,.45); color: var(--cyan); }
.word-row-card.stage-king { border-color: rgba(255,209,102,.78); background: linear-gradient(135deg, color-mix(in srgb, var(--panel) 56%, rgba(255,209,102,.34)), color-mix(in srgb, var(--panel) 70%, rgba(255,164,64,.28))); }
.word-row-card.stage-king .word-row-toggle strong { color: var(--gold); }
.word-row-card.stage-king .word-row-meta em { background: rgba(255,209,102,.24); border-color: rgba(255,209,102,.62); color: var(--gold); }
.word-dictionary-page .word-row-toggle { gap: .45rem; padding: .78rem .75rem .78rem .85rem; }
.word-dictionary-page .word-row-toggle strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.1rem; }
.word-dictionary-page .word-row-meta { max-width: 3.1rem; gap: 0; }
.word-dictionary-page .word-row-meta small { display: none; }
.word-dictionary-page .word-row-card.stage-not-started .word-row-meta { display: none; }
.word-dictionary-page .word-hidden-detail { padding-left: .75rem; padding-right: .75rem; }
.word-row-tools { display: flex; align-items: center; justify-content: space-between; gap: .45rem; padding: 0 .75rem .72rem .85rem; }
.word-row-tools small { color: var(--muted); font-size: .7rem; font-weight: 800; }
.back-stage-btn { min-height: 2.25rem; padding: .48rem .72rem; border: 1px solid rgba(255,209,102,.48); border-radius: 8px; background: rgba(255,209,102,.16); color: var(--gold); font-size: .78rem; font-weight: 1000; }
.word-row-tools { display: flex; align-items: center; gap: .5rem; padding: 0 .75rem .75rem; }
.word-row-tools button { min-height: 2.25rem; padding: .45rem .7rem; border-radius: 999px; font-size: .78rem; background: linear-gradient(135deg, var(--cyan), var(--pink)); color: #fff; }
.word-row-tools small { color: var(--muted); font-size: .78rem; }
.success-text { color: var(--green) !important; }
.word-row-image { display: block; width: calc(100% - 1.5rem); max-height: 12rem; object-fit: cover; margin: 0 .75rem .65rem; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); }
/* In detail: show the FULL educational image (text + scene), scaled to fit, never cropped */
.word-row-image.in-detail {
  display: block;
  width: 100%;
  height: auto;
  max-width: 32rem;          /* keep it a sensible size on big screens */
  max-height: 70vh;          /* fit on screen, full image visible */
  object-fit: contain;
  margin: .75rem auto;
  border-radius: 10px;
  background: #0a0c22;
}
.word-hidden-detail { padding: 0 .9rem .95rem; border-top: 1px solid var(--line); }
.word-hidden-detail:not([hidden]) { animation: wdReveal .3s cubic-bezier(.22,.61,.36,1); }
@keyframes wdReveal { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.word-row-card { transition: background .25s ease, border-color .25s ease, box-shadow .25s ease; }
.word-row-card.is-open { box-shadow: 0 6px 20px rgba(85,224,255,.14); }
.gd-row-compact:active { background: color-mix(in srgb, var(--cyan) 8%, transparent); }
.word-hidden-detail p { margin: .55rem 0; }
.kid-detail { display: grid; gap: .8rem; padding-top: .8rem; }
.kid-hero { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .75rem; border-radius: 8px; background: linear-gradient(135deg, rgba(85,224,255,.15), rgba(255,95,170,.12)); border: 1px solid var(--line); }
.kid-hero h2 { margin: .12rem 0 0; color: var(--gold); font-size: clamp(1.8rem, 8vw, 3rem); line-height: 1; }
.kid-chunks { margin-top: .35rem; color: var(--cyan, #55e0ff); font-size: 1rem; font-weight: 700; letter-spacing: .04em; }
.kid-label { display: block; color: var(--cyan); font-size: .72rem; font-weight: 1000; text-transform: uppercase; letter-spacing: .03em; }
.kid-grid { display: grid; gap: .6rem; }
.kid-grid section, .kid-mini-row > div, .story-box { padding: .75rem; border-radius: 8px; background: color-mix(in srgb, var(--panel-2) 68%, transparent); border: 1px solid var(--line); }
.sound-trick-box { background: linear-gradient(135deg, rgba(195,157,255,.12), rgba(85,224,255,.08)); border-color: rgba(195,157,255,.32); margin-top: .65rem; }
.sound-trick-line { font-size: 1.05rem; line-height: 1.5; margin: .35rem 0 0; }
.sound-trick-line b { color: var(--pink); }
.sound-trick-box .baby-hindi b { color: var(--pink); }
.kid-big { color: var(--gold); font-size: 1.22rem; font-weight: 900; }
.pos-badge { display: inline-flex; align-items: center; justify-content: center; margin-right: .35rem; padding: .2rem .45rem; border-radius: 999px; background: rgba(255,211,110,.16); border: 1px solid rgba(255,211,110,.38); color: var(--gold); font-size: .72rem; text-transform: uppercase; }
.sound-btn { flex: 0 0 auto; min-width: 5rem; min-height: 2.7rem; padding: .55rem .75rem; border-radius: 999px; background: linear-gradient(135deg, var(--cyan), var(--pink)); color: #fff; box-shadow: 0 10px 22px rgba(0,0,0,.18); }
.memory-strip { padding: .75rem; border-radius: 8px; background: rgba(255,211,110,.13); border: 1px solid rgba(255,211,110,.34); color: var(--soft); }
.kid-mini-row { display: grid; gap: .6rem; }
.story-box p { line-height: 1.5; }
.remember-steps { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .1rem; }
.remember-steps span { flex: 0 0 auto; padding: .48rem .62rem; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid var(--line); color: var(--text); font-size: .78rem; font-weight: 900; }
.word-image { width: 100%; max-height: 15rem; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); margin: .75rem 0; background: #10143a; }
.word-image.thumb { max-height: 9rem; }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; margin: .65rem 0; }
.chip { border-radius: 999px; padding: .38rem .6rem; font-weight: 900; color: #10122e; font-size: .82rem; }
.chip.prefix { background: #75d7ff; }
.chip.root { background: #ffd166; }
.chip.suffix { background: #7bd88f; }
.progress { height: 1rem; background: #10143a; border-radius: 999px; overflow: hidden; border: 1px solid var(--line); margin: 1rem 0; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg,var(--cyan),var(--gold)); }
.error-text { color: var(--danger); }
.simple-line { padding: .7rem; border-radius: 8px; background: rgba(255,255,255,.06); }
.king-badge { display: inline-flex; width: fit-content; align-items: center; gap: .35rem; padding: .4rem .65rem; border-radius: 999px; background: rgba(255,209,102,.18); border: 1px solid rgba(255,209,102,.45); color: var(--gold); font-weight: 900; margin: .5rem 0; }
.king-card { border-color: rgba(255,209,102,.45); }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; align-items: center; }
/* 📝 Full Detail / Edit — color box */
.full-detail-btn { display: inline-flex; align-items: center; gap: .4rem; padding: .55rem .9rem; border-radius: 10px;
  background: color-mix(in srgb, var(--cyan) 16%, var(--panel)); border: 1px solid color-mix(in srgb, var(--cyan) 42%, var(--line));
  color: var(--cyan); font-weight: 800; font-size: .82rem; text-decoration: none; }
.full-detail-btn:active { filter: brightness(1.08); }
.actions form, .review-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.memory-process { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .75rem; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 8px; background: color-mix(in srgb, var(--panel-2) 70%, var(--bg)); color: var(--text); }
.memory-process small { color: var(--muted); font-weight: 800; text-align: right; }
.stage-btn { background: linear-gradient(135deg, var(--gold), var(--pink)) !important; color: #160e1c !important; border: 0 !important; box-shadow: 0 10px 20px rgba(255, 209, 102, .16); }
.moved-badge { display: inline-flex; align-items: center; min-height: 2.55rem; padding: .55rem .85rem; border-radius: 999px; border: 1px solid rgba(76,201,240,.38); background: rgba(76,201,240,.14); color: var(--cyan); font-weight: 1000; }
.icon-btn { width: 2.4rem; height: 2.4rem; padding: 0; display: inline-grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); }
.icon-btn.active { color: var(--gold); }
.form-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1rem; }
.secondary { background: var(--panel-2); border: 1px solid var(--line); }
.ajax-message { min-height: 1.25rem; margin-top: .75rem; color: var(--muted); }
.ajax-message.success { color: var(--green); }
.ajax-message.error { color: var(--danger); }

.memory-image-box { display: grid; gap: .75rem; margin: 0 0 1rem; padding: 1rem; background: rgba(16,20,58,.78); border: 1px solid var(--line); border-radius: 8px; }
.memory-image-box.compact { margin: .8rem 0; padding: .75rem; }
.memory-image-box img, .flash-image { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: #10143a; }
.memory-image-box.compact img { max-height: 15rem; }
.image-placeholder { display: grid; place-items: center; min-height: 10rem; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); background: color-mix(in srgb, var(--panel-2) 45%, transparent); text-align: center; padding: 1rem; }
.image-status { min-height: 1.2rem; color: var(--muted); font-size: .9rem; }
.image-status.success { color: var(--green); }
.image-status.error { color: var(--danger); }
.generate-image-btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; }
.generate-image-btn:disabled { opacity: .76; cursor: wait; }
.spinner { display: none; width: 1rem; height: 1rem; border: 2px solid rgba(255,255,255,.42); border-top-color: white; border-radius: 50%; animation: spin .8s linear infinite; }
.generate-image-btn.is-loading .spinner { display: inline-block; }
.flash-image { max-height: 9.5rem; margin-bottom: .4rem; }
@keyframes spin { to { transform: rotate(360deg); } }

label { display: grid; gap: .35rem; color: var(--muted); font-weight: 700; }
input, select, textarea { width: 100%; color: var(--text); background: color-mix(in srgb, var(--panel-2) 62%, var(--bg)); border: 1px solid var(--line); border-radius: 8px; padding: .8rem .85rem; outline: none; }
body.theme-soft-night input, body.theme-soft-night select, body.theme-soft-night textarea,
body.theme-green-comfort input, body.theme-green-comfort select, body.theme-green-comfort textarea,
body.theme-ink-black input, body.theme-ink-black select, body.theme-ink-black textarea,
body.theme-ocean-calm input, body.theme-ocean-calm select, body.theme-ocean-calm textarea,
body.theme-lavender-mist input, body.theme-lavender-mist select, body.theme-lavender-mist textarea,
body.theme-rose-dim input, body.theme-rose-dim select, body.theme-rose-dim textarea,
body.theme-slate-focus input, body.theme-slate-focus select, body.theme-slate-focus textarea,
body.theme-high-contrast input, body.theme-high-contrast select, body.theme-high-contrast textarea,
body.theme-galaxy input, body.theme-galaxy select, body.theme-galaxy textarea,
body.theme-sunset input, body.theme-sunset select, body.theme-sunset textarea,
body.theme-cyber input, body.theme-cyber select, body.theme-cyber textarea { background: rgba(8,14,24,.72); }
body.theme-warm-paper input, body.theme-warm-paper select, body.theme-warm-paper textarea,
body.theme-sepia-book input, body.theme-sepia-book select, body.theme-sepia-book textarea,
body.theme-mint-paper input, body.theme-mint-paper select, body.theme-mint-paper textarea,
body.theme-sky input, body.theme-sky select, body.theme-sky textarea,
body.theme-sunny input, body.theme-sunny select, body.theme-sunny textarea,
body.theme-candy input, body.theme-candy select, body.theme-candy textarea,
body.theme-aqua input, body.theme-aqua select, body.theme-aqua textarea { background: color-mix(in srgb, var(--panel) 88%, #88aacc); }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(76,201,240,.15); }
.form-grid, .filters, .quiz-form, .build-form { display: grid; gap: .85rem; }
.wide { grid-column: 1 / -1; }
.check { display: flex; grid-auto-flow: column; align-items: center; justify-content: start; }
.check input { width: auto; }

button, .primary { border: 0; border-radius: 8px; padding: .78rem 1rem; background: linear-gradient(135deg, var(--accentX), var(--accentX2)); color: var(--on-accent); font-weight: 900; cursor: pointer; }
.danger { background: var(--danger); margin-top: .75rem; }
.actions button, .review-actions button { background: var(--panel-2); border: 1px solid var(--line); padding: .55rem .7rem; }
.edit-image-panel { margin-bottom: 1rem; }
.edit-image-panel .section-title span { color: var(--gold); font-weight: 900; }
.image-tools { margin-top: .75rem; }
.image-tools .danger { margin-top: 0; }

.flashcard { position: relative; min-height: 23rem; padding: 1rem; transform-style: preserve-3d; transition: transform .35s ease; cursor: pointer; }
.flashcard.flipped { transform: rotateY(180deg); }
.flashcard .front, .flashcard .back { position: absolute; inset: 0; padding: 1rem; backface-visibility: hidden; display: grid; align-content: center; gap: .65rem; }
.flashcard .front strong { font-size: 2.4rem; color: var(--gold); }
.flashcard .front span { color: var(--muted); }
.flashcard .back { transform: rotateY(180deg); align-content: start; overflow: auto; }

.review-card h2 { font-size: 2.7rem; margin: .5rem 0; color: var(--gold); }
.review-card.summary-focus p:not(.hint):not(.big) { display: none; }
.review-card.summary-focus .big, .review-card.summary-focus .hint { display: block; }
.pill { display: inline-flex; width: fit-content; padding: .32rem .6rem; border-radius: 999px; background: rgba(255,209,102,.16); color: var(--gold); border: 1px solid rgba(255,209,102,.35); font-weight: 800; }
.era-card { position: relative; padding: 1rem 1rem 1rem 1.25rem; }
.era-card::before { content: ""; position: absolute; left: .35rem; top: 1rem; bottom: 1rem; width: 3px; background: var(--cyan); border-radius: 1rem; }
.era-card.locked { filter: grayscale(.7); opacity: .62; }
.tree { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: .6rem; }
.tree a { display: grid; gap: .2rem; padding: .75rem; background: color-mix(in srgb, var(--panel-2) 72%, var(--bg)); border: 1px solid var(--line); border-radius: 8px; }
.tree small { color: var(--muted); }
.quick-links { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; margin-bottom: 1rem; }
.theme-settings { display: grid; gap: 1rem; }
.theme-grid { display: grid; grid-template-columns: 1fr; gap: .75rem; }
.theme-choice { position: relative; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: .75rem; min-height: 5rem; padding: .85rem; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); cursor: pointer; }
.theme-choice input { width: 1.15rem; height: 1.15rem; accent-color: var(--cyan); }
.theme-choice b { display: block; font-size: 1rem; color: var(--text); }
.theme-choice small { display: block; margin-top: .2rem; color: var(--muted); line-height: 1.35; }
.theme-choice:has(input:checked) { border-color: rgba(255,209,102,.72); box-shadow: 0 0 0 3px rgba(255,209,102,.12); }
.theme-preview-time-dark { background: linear-gradient(135deg, #171a46, #20245d); }
.theme-preview-soft-night { background: linear-gradient(135deg, #1f2937, #273449); }
.theme-preview-warm-paper { background: linear-gradient(135deg, #fff8e8, #eadfca); color: #2d261b; }
.theme-preview-warm-paper b { color: #2d261b; }
.theme-preview-warm-paper small { color: #665c4d; }
.theme-preview-green-comfort { background: linear-gradient(135deg, #1b3027, #263c31); }
.theme-preview-ink-black { background: linear-gradient(135deg, #050505, #1c1c1c); }
.theme-preview-ocean-calm { background: linear-gradient(135deg, #102c38, #173d4b); }
.theme-preview-lavender-mist { background: linear-gradient(135deg, #25203a, #3b3156); }
.theme-preview-rose-dim { background: linear-gradient(135deg, #321f29, #4a2d3a); }
.theme-preview-sepia-book { background: linear-gradient(135deg, #f8ecd3, #d8c199); color: #352818; }
.theme-preview-mint-paper { background: linear-gradient(135deg, #f6fff8, #cbe6d6); color: #173125; }
.theme-preview-slate-focus { background: linear-gradient(135deg, #202938, #354157); }
.theme-preview-high-contrast { background: linear-gradient(135deg, #000814, #003566); }
.theme-preview-sepia-book b, .theme-preview-mint-paper b { color: inherit; }
.theme-preview-sepia-book small, .theme-preview-mint-paper small { color: color-mix(in srgb, currentColor 72%, transparent); }
.settings-grid { margin-top: .35rem; }

@media (max-width: 719px) {
  .page { width: min(390px, 100vw); max-width: min(390px, 100vw); margin: 0; padding: .75rem .55rem 5.3rem; }
  .word-dictionary-page .page { width: min(390px, 100vw); max-width: min(390px, 100vw); padding: .45rem .35rem .3rem; }
  .section-title { align-items: flex-start; }
  .section-title .pill { flex: 0 0 auto; font-size: .74rem; padding: .26rem .48rem; }
  .theme-choice { min-height: 4.85rem; padding: .78rem; }
  .theme-choice small { overflow-wrap: anywhere; }
}

@supports (-webkit-touch-callout: none) {
  .word-dictionary-page .page { width: 100vw; max-width: 100vw; }
}

.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: .08rem; width: 100vw; max-width: 100vw; padding: .38rem .18rem calc(.38rem + env(safe-area-inset-bottom)); background: rgba(10,12,34,.94); backdrop-filter: blur(18px); border-top: 1px solid var(--line); overflow: hidden; }
.bottom-nav a { display: grid; place-items: center; gap: .12rem; min-width: 0; min-height: 3.2rem; color: var(--muted); border-radius: 8px; font-size: clamp(.52rem, 2.25vw, .66rem); overflow: hidden; }
.bottom-nav b { display: grid; place-items: center; width: 1.42rem; height: 1.42rem; border-radius: 50%; background: var(--panel-2); color: var(--text); font-size: .78rem; line-height: 1; font-weight: 1000; }
.bottom-nav a.active { color: var(--gold); background: rgba(255,209,102,.1); }

@media (min-width: 720px) {
  .page { padding: 1.5rem; }
  .top-learning-buttons { gap: .75rem; }
  .top-filter-btn { min-height: 4.4rem; padding: .7rem .5rem; }
  .top-filter-btn b { font-size: .98rem; }
  .top-filter-btn span { font-size: .76rem; }
  .word-dictionary-page .top-learning-buttons { top: 0; gap: .65rem; margin-left: 0; margin-right: 0; padding: .55rem; }
  .word-dictionary-page .top-filter-btn { min-height: 3.45rem; }
  .word-dictionary-page .top-filter-btn b { font-size: .94rem; }
  .dic-search { top: 4.25rem; margin-left: 0; margin-right: 0; padding: .55rem; }
  .dic-filter-panel { top: 7.85rem; margin-left: 0; margin-right: 0; padding: 1rem; }
  .kid-grid, .kid-mini-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-top { grid-template-columns: minmax(18rem, 23rem) 1fr; }
  .stats-grid { grid-template-columns: repeat(6, 1fr); }
  .home-top .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .word-list, .timeline, .root-grid, .dictionary-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dictionary-top { grid-template-columns: 1fr minmax(16rem, 22rem); }
  .form-grid, .filters, .build-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .theme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards-stack.single-card { grid-template-columns: minmax(0, 32rem); justify-content: center; }
  .quick-links { grid-template-columns: repeat(4, 1fr); }
  .bottom-nav { right: 0; width: 100%; max-width: 100vw; }
}

/* === Additions: streak, SM-2, loading, shortcuts, heatmap, mistakes === */

/* Loading bar at top */
/* User request: top loading-line bilkul na dikhe — loading background me silent ho. display:none se
   bar kabhi nahi dikhti (fetches/poll waise hi background me chalte rehte, bas koi visible line nahi). */
.global-loading-bar { display: none !important; position: fixed; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, transparent, var(--gold, #ffd166), transparent); transform: translateX(-100%); transition: transform .3s; z-index: 9999; pointer-events: none; opacity: 0; }
.global-loading-bar.is-active { animation: loading-bar 1s ease-in-out infinite; opacity: 1; }
@keyframes loading-bar { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* Skeleton loader */
.skeleton { display: block; background: linear-gradient(90deg, rgba(255,255,255,.05) 0%, rgba(255,255,255,.12) 50%, rgba(255,255,255,.05) 100%); background-size: 200% 100%; animation: skeleton-shimmer 1.4s ease infinite; border-radius: 6px; min-height: 1rem; }
@keyframes skeleton-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Streak chip */
.streak-chip { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .65rem; border-radius: 999px; background: rgba(255,153,51,.18); color: #ffb454; font-weight: 700; font-size: .85rem; }
.streak-chip.is-active { background: rgba(255,103,31,.25); color: #ff8a3d; box-shadow: 0 0 12px rgba(255,103,31,.35); }
.streak-chip .streak-flame { font-size: 1.05rem; }
.streak-broken { opacity: .55; }

/* SM-2 grade buttons */
.sm2-grades { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: .5rem; margin-top: 1rem; }
.sm2-grades button { padding: .85rem .5rem; border-radius: 10px; border: 1px solid var(--line, #28284a); background: var(--panel-2, #16183a); color: var(--text, #fff); font-weight: 700; cursor: pointer; transition: transform .12s, background .15s; }
.sm2-grades button:hover { transform: translateY(-1px); }
.sm2-grade-again { background: rgba(220,53,69,.18) !important; color: #ff8a95 !important; }
.sm2-grade-hard  { background: rgba(255,143,28,.18) !important; color: #ffb454 !important; }
.sm2-grade-good  { background: rgba(48,209,88,.18) !important; color: #6ee598 !important; }
.sm2-grade-easy  { background: rgba(64,156,255,.18) !important; color: #6ab4ff !important; }
.sm2-grades small { display: block; font-weight: 400; font-size: .68rem; opacity: .75; margin-top: .2rem; }

/* Keyboard shortcut help overlay */
.shortcut-help { position: fixed; bottom: 5rem; right: 1rem; background: rgba(10,12,34,.96); color: var(--text, #fff); padding: 1rem 1.2rem; border-radius: 10px; border: 1px solid var(--line, #28284a); font-size: .8rem; line-height: 1.7; max-width: 22rem; box-shadow: 0 10px 40px rgba(0,0,0,.45); z-index: 100; }

/* Review heatmap */
.heatmap { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 12px); gap: 3px; padding: .75rem; overflow-x: auto; }
.heatmap-cell { width: 12px; height: 12px; border-radius: 2px; background: rgba(255,255,255,.06); }
.heatmap-cell.lvl-1 { background: rgba(110,229,152,.25); }
.heatmap-cell.lvl-2 { background: rgba(110,229,152,.45); }
.heatmap-cell.lvl-3 { background: rgba(110,229,152,.70); }
.heatmap-cell.lvl-4 { background: rgba(110,229,152,.95); }
.heatmap-legend { display: flex; gap: .35rem; align-items: center; font-size: .72rem; color: var(--muted); padding: 0 .75rem .5rem; }

/* Mistake review page */
.mistake-list { display: grid; gap: .65rem; }
.mistake-row { display: flex; justify-content: space-between; gap: 1rem; padding: .85rem 1rem; background: var(--panel, #14163b); border-radius: 10px; border-left: 4px solid #ff8a95; }
.mistake-row .accuracy { font-weight: 700; color: #ff8a95; }
.mistake-row .accuracy.warn { color: #ffb454; border-color: #ffb454; }

/* Notice variants */
.notice.error { background: rgba(220,53,69,.15); border-left: 3px solid #ff8a95; color: #ff8a95; }

/* Lazy image fade-in */
img[loading="lazy"] { transition: opacity .25s; }
img[loading="lazy"]:not([src]), img[loading="lazy"][src=""] { opacity: 0; }

/* === Pronunciation checker === */
.pron-status { margin-top: .5rem; padding: .55rem .8rem; border-radius: 8px; font-size: .82rem; background: rgba(255,255,255,.04); }
.pron-status.listening { background: rgba(255,103,31,.18); color: #ff8a3d; animation: pulse 1.5s ease infinite; }
.pron-status.checking { background: rgba(64,156,255,.18); color: #6ab4ff; }
.pron-status.grade-great { background: rgba(48,209,88,.22); color: var(--green); }
.pron-status.grade-good { background: rgba(255,193,7,.22); color: #ffd166; }
.pron-status.grade-retry { background: rgba(220,53,69,.18); color: #ff8a95; }
.pron-status.error { background: rgba(220,53,69,.18); color: #ff8a95; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }

/* === AI lab page === */
.ai-lab-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); margin-top: 1rem; }
.ai-card { padding: 1.2rem; border-radius: 12px; background: var(--panel, #14163b); border: 1px solid var(--line, #28284a); }
.ai-card h3 { margin: 0 0 .5rem; font-size: 1rem; }
.ai-card p { color: var(--muted); font-size: .85rem; margin: .25rem 0; }
.ai-card .ai-actions { margin-top: .8rem; display: flex; gap: .5rem; flex-wrap: wrap; }
.ai-card .ai-status { margin-top: .6rem; font-size: .78rem; color: var(--muted); }
.ai-card .ai-progress-bar { width: 100%; height: 6px; background: rgba(255,255,255,.06); border-radius: 3px; overflow: hidden; margin-top: .5rem; }
.ai-card .ai-progress-bar > div { height: 100%; background: linear-gradient(90deg, #6ee598, #6ab4ff); transition: width .3s; }

/* Bottom nav has 7 items (Home, Words, Stats, Rev, Img, Add, Set) — fill full width evenly */
.bottom-nav { grid-template-columns: repeat(8, minmax(0, 1fr)) !important; width: 100% !important; left: 0 !important; right: 0 !important; }
.bottom-nav a { padding: .3rem .1rem; }

/* === Daily challenges === */
.challenge-list { display: grid; gap: .75rem; }
.challenge-row { display: flex; gap: 1rem; padding: .8rem 1rem; background: rgba(255,255,255,.03); border-radius: 10px; border-left: 4px solid var(--gold, #ffd166); }
.challenge-row.is-done { border-left-color: var(--green); background: rgba(110,229,152,.08); }

/* === Confetti === */
.confetti-container { position: fixed; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; z-index: 10000; overflow: hidden; }
.confetti-piece { position: absolute; width: 10px; height: 14px; top: -20px; opacity: 0; animation: confetti-fall 2.2s ease-out forwards; }
.confetti-piece.c1 { background: #ffd166; }
.confetti-piece.c2 { background: var(--green); }
.confetti-piece.c3 { background: #6ab4ff; }
.confetti-piece.c4 { background: #ff8a95; }
.confetti-piece.c5 { background: #c39dff; }
@keyframes confetti-fall {
  0%   { opacity: 0; transform: translateY(0) rotate(0); }
  10%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(110vh) rotate(720deg); }
}

/* === Badge unlock toast === */
.badge-toast { position: fixed; top: 1.5rem; right: 1.5rem; max-width: 22rem; background: rgba(20,22,59,.97); color: var(--text); padding: 1rem 1.25rem; border-radius: 12px; border: 2px solid var(--gold, #ffd166); box-shadow: 0 20px 60px rgba(0,0,0,.45); z-index: 9999; display: flex; gap: .75rem; align-items: center; transform: translateX(120%); transition: transform .35s cubic-bezier(.5,1.7,.5,1); }
.badge-toast.is-show { transform: translateX(0); }
.badge-toast .badge-icon { font-size: 2.4rem; line-height: 1; }
.badge-toast h4 { margin: 0; font-size: .92rem; color: var(--gold, #ffd166); }
.badge-toast p { margin: .12rem 0 0; font-size: .78rem; color: var(--muted); }

/* === Badge cards on achievements page === */
.badge-earned { border-color: rgba(255,209,102,.4); background: linear-gradient(135deg, rgba(255,209,102,.05), rgba(20,22,59,.6)); }
.badge-locked { opacity: .65; }

/* ==========================================================================
   Responsive Utility System
   Breakpoints:
     - Mobile:     < 480px
     - Phablet:    480px – 719px
     - Tablet:     720px – 1023px
     - Laptop:     1024px – 1279px
     - Desktop:    1280px+
   ========================================================================== */

/* --- Base box-sizing & overflow guards --- */
*, *::before, *::after { box-sizing: border-box; }
/* overflow-x:hidden only on html — keeping it on body makes body the scroll
   container and breaks vertical scrolling in the WebView. */
html { max-width: 100vw; overflow-x: hidden; }
body { max-width: 100vw; }
img, video, svg, canvas { max-width: 100%; height: auto; }

/* --- Flex utilities --- */
.u-flex      { display: flex; }
.u-flex-col  { display: flex; flex-direction: column; }
.u-flex-wrap { flex-wrap: wrap; }
.u-flex-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.u-flex-center  { display: flex; justify-content: center; align-items: center; }
.u-flex-1 { flex: 1; min-width: 0; }
.u-items-center { align-items: center; }
.u-items-start  { align-items: flex-start; }

.u-gap-xs { gap: .25rem; }
.u-gap-sm { gap: .5rem; }
.u-gap    { gap: 1rem; }
.u-gap-lg { gap: 1.5rem; }

/* --- Spacing --- */
.u-m-0   { margin: 0; }
.u-mt-xs { margin-top: .25rem; }
.u-mt-sm { margin-top: .5rem; }
.u-mt    { margin-top: 1rem; }
.u-mt-lg { margin-top: 1.5rem; }
.u-mb    { margin-bottom: 1rem; }
.u-p-sm  { padding: .5rem; }
.u-p     { padding: 1rem; }
.u-p-lg  { padding: 1.5rem; }

/* --- Text --- */
.u-text-center { text-align: center; }
.u-text-left   { text-align: left; }
.u-text-right  { text-align: right; }
.u-text-xs  { font-size: .72rem; }
.u-text-sm  { font-size: .82rem; }
.u-text-md  { font-size: .95rem; }
.u-text-lg  { font-size: 1.1rem; }
.u-text-xl  { font-size: 1.4rem; }
.u-text-2xl { font-size: 1.8rem; }
.u-text-3xl { font-size: 2rem; }
.u-text-4xl { font-size: 2.4rem; }
.u-text-muted { color: var(--muted); }
.u-text-gold  { color: var(--gold, #ffd166); }
.u-text-good  { color: var(--green); }
.u-text-warn  { color: #ffb454; }
.u-text-bad   { color: #ff8a95; }

/* --- Width --- */
.u-w-full       { width: 100%; }
.u-max-w-sm     { max-width: 480px; margin-inline: auto; }
.u-max-w-md     { max-width: 640px; margin-inline: auto; }
.u-max-w-lg     { max-width: 800px; margin-inline: auto; }
.u-max-w-xl     { max-width: 1100px; margin-inline: auto; }
.u-min-w-200    { min-width: 200px; }

/* --- Grid --- */
.u-grid      { display: grid; gap: 1rem; }
.u-grid-1    { grid-template-columns: 1fr; }
.u-grid-auto-sm { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.u-grid-auto-md { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.u-grid-auto-lg { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* --- Filters / states --- */
.u-grayscale     { filter: grayscale(1); opacity: .35; }
.u-divider-gold  { border-left: 4px solid var(--gold, #ffd166); }
.u-divider-good  { border-left: 4px solid var(--green); }
.u-no-underline  { text-decoration: none; }

/* --- Touch-friendly buttons (mobile) --- */
@media (max-width: 719px) {
  button, .link-button, .top-filter-btn, .bottom-nav a,
  input[type="submit"], input[type="button"] {
    min-height: 44px;            /* WCAG touch target */
    font-size: 1rem;
  }
  input[type="text"], input[type="email"], input[type="password"],
  input[type="number"], textarea, select {
    font-size: 16px !important;  /* prevents iOS Safari zoom */
    min-height: 44px;
  }
  .u-text-4xl { font-size: 1.8rem; }
  .u-text-3xl { font-size: 1.6rem; }
  .u-text-2xl { font-size: 1.4rem; }
  .panel { padding: 1rem; margin-inline: 0; }
}

/* --- Phablet --- */
@media (min-width: 480px) and (max-width: 719px) {
  .u-grid-auto-sm { grid-template-columns: repeat(2, 1fr); }
}

/* --- Tablet --- */
@media (min-width: 720px) and (max-width: 1023px) {
  .u-max-w-xl { max-width: 95vw; }
  .ai-lab-grid { grid-template-columns: repeat(2, 1fr); }
  .home-top    { grid-template-columns: 1fr; }
  .stats-grid  { grid-template-columns: repeat(4, 1fr); }
  .heatmap     { grid-template-rows: repeat(7, 14px); gap: 4px; }
}

/* --- Laptop --- */
@media (min-width: 1024px) {
  .page { max-width: 1200px; margin: 0 auto; padding: 1.5rem 2rem 6rem; }
  .ai-lab-grid { grid-template-columns: repeat(3, 1fr); }
  .home-top    { grid-template-columns: minmax(20rem, 25rem) 1fr; }
  .stats-grid  { grid-template-columns: repeat(6, 1fr); }
  .home-top .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .word-list, .timeline, .root-grid, .dictionary-list { grid-template-columns: repeat(3, 1fr); }
  .cards-stack { grid-template-columns: repeat(3, 1fr); }
  .cards-stack.single-card { grid-template-columns: minmax(0, 36rem); justify-content: center; }
  .heatmap { grid-template-rows: repeat(7, 16px); gap: 5px; }
  .heatmap-cell { width: 16px; height: 16px; }
}

/* --- Desktop --- */
@media (min-width: 1280px) {
  .page { max-width: 1400px; padding: 2rem 3rem 6rem; }
  .ai-lab-grid { grid-template-columns: repeat(4, 1fr); }
  .word-list, .timeline, .root-grid, .dictionary-list { grid-template-columns: repeat(4, 1fr); }
  .cards-stack { grid-template-columns: repeat(4, 1fr); }
  .stats-grid { grid-template-columns: repeat(6, 1fr); }
  .home-top .stats-grid { grid-template-columns: repeat(3, 1fr); }
}

/* --- Mobile-specific overrides for new components --- */
@media (max-width: 479px) {
  /* Streak / XP / badge chips wrap below header */
  .streak-chip { font-size: .78rem; padding: .25rem .5rem; }

  /* Word-of-the-day card on mobile: stack vertically */
  .wotd-card { flex-direction: column; align-items: flex-start; }
  .wotd-card .wotd-actions { flex-direction: row; width: 100%; }
  .wotd-card .wotd-actions > * { flex: 1; }

  /* AI Lab cards: stack 1 column */
  .ai-lab-grid { grid-template-columns: 1fr; }

  /* Stats grid: 2 cols on phone */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: .5rem; }
  .stat { padding: .65rem; }
  .stat strong { font-size: 1.1rem; }

  /* SM-2 buttons: 2x2 grid */
  .sm2-grades { grid-template-columns: repeat(2, 1fr); }
  .sm2-grades button { padding: 1rem .5rem; min-height: 56px; }

  /* Bottom nav: smaller icons on 8-item grid */
  .bottom-nav b { width: 1.25rem; height: 1.25rem; font-size: .7rem; }
  .bottom-nav a { min-height: 3rem; padding: .25rem; }
  .bottom-nav span { font-size: .58rem; }

  /* Confetti / toast positioning */
  .badge-toast { right: .75rem; left: .75rem; max-width: calc(100vw - 1.5rem); top: 1rem; }

  /* Heatmap: more compact */
  .heatmap { grid-template-rows: repeat(7, 9px); gap: 2px; }
  .heatmap-cell { width: 9px; height: 9px; }

  /* Hide non-essential page hero */
  .hero { padding: .5rem 0; }
  .hero h1 { font-size: 1.4rem; }

  /* Flashcard front/back proper sizing */
  .flashcard { min-height: 22rem; }
  .flashcard .front strong { font-size: 1.8rem; }
  .flashcard .back h2 { font-size: 1.4rem; }

  /* Cloze/Reverse/Spelling: full width content */
  .quiz-panel { padding: 1rem !important; }
}

/* --- Print --- */
@media print {
  .bottom-nav, .topbar, .global-loading-bar, .shortcut-help, .badge-toast, .confetti-container { display: none !important; }
  body { background: white; color: black; }
}

/* --- Accessibility: reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .confetti-piece, .skeleton, .global-loading-bar.is-active, .pron-status.listening { animation: none !important; }
}

/* --- Focus visible for keyboard navigation --- */
:focus-visible {
  outline: 2px solid var(--gold, #ffd166);
  outline-offset: 2px;
  border-radius: 6px;
}
button:focus-visible, a:focus-visible { outline-offset: 3px; }

/* --- High contrast: better readability --- */
@media (prefers-contrast: more) {
  .muted-line, .u-text-muted { color: rgba(255,255,255,.9); }
  .panel { border: 2px solid var(--line, #28284a); }
}

/* ==========================================================================
   Component classes for refactored pages
   ========================================================================== */

/* Dashboard streak chips */
.xp-chip      { background: rgba(110,229,152,.18); color: var(--green); }
.badges-chip  { background: rgba(255,209,102,.18); color: #ffd166; }

/* Recent badges pill */
.badge-pill {
  text-align: center;
  padding: .5rem .75rem;
  background: rgba(255,209,102,.08);
  border-radius: 8px;
  min-width: 70px;
}

/* Large badge icon (achievements page) */
.badge-icon-lg {
  font-size: 3rem;
  line-height: 1;
  margin-bottom: .25rem;
}

/* Quiz options (cloze, reverse) */
.quiz-options {
  grid-template-columns: 1fr;
  gap: .65rem;
}
.quiz-option-btn {
  padding: 1rem;
  font-size: .95rem;
  border-radius: 10px;
  border: 1px solid var(--line, #28284a);
  background: var(--panel-2, #16183a);
  color: var(--text, #fff);
  cursor: pointer;
  transition: background .15s, transform .12s;
  text-align: left;
}
.quiz-option-btn:hover { transform: translateY(-1px); background: rgba(255,255,255,.06); }
.quiz-option-btn:disabled { cursor: default; transform: none; }
.quiz-option-btn.option-correct { background: rgba(110,229,152,.3) !important; border-color: var(--green); }
.quiz-option-btn.option-wrong   { background: rgba(220,53,69,.25) !important; border-color: #ff8a95; }

@media (min-width: 480px) {
  .quiz-options { grid-template-columns: repeat(2, 1fr); }
}

/* Quiz question text — large, readable */
.quiz-question-text {
  line-height: 1.5;
  font-weight: 500;
  margin: .5rem 0;
}

/* Spelling drill input */
.spell-input {
  width: 100%;
  font-size: 1.4rem;
  text-align: center;
  padding: 1rem;
  border-radius: 10px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line, #28284a);
  color: var(--text);
  font-family: 'SF Mono', Menlo, monospace;
  letter-spacing: .04em;
}
.spell-input:focus {
  outline: 2px solid var(--gold, #ffd166);
  outline-offset: 2px;
}

@media (max-width: 479px) {
  .spell-input { font-size: 1.15rem; padding: .85rem; }
  .quiz-question-text { font-size: 1.1rem; }
  .badge-icon-lg { font-size: 2.4rem; }
}

/* Section title — fix wrap on tiny screens */
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .75rem;
}
.section-title h2 { margin: 0; font-size: 1rem; flex: 1 1 auto; }
.section-title small,
.section-title a { font-size: .78rem; }

/* Panel default tightening on mobile */
@media (max-width: 479px) {
  .section-title h2 { font-size: .95rem; }
  .panel { padding: .85rem; border-radius: 10px; }
  .word-card { padding: .75rem; }
  .word-card strong { font-size: .95rem; }
}

/* Make heatmap horizontally scrollable on small screens */
.heatmap { overflow-x: auto; padding-bottom: .25rem; }

/* AI lab cards — fix code block overflow */
.ai-card code {
  display: block;
  background: rgba(0,0,0,.3);
  padding: .4rem .55rem;
  border-radius: 6px;
  font-size: .72rem;
  word-break: break-all;
  margin-top: .5rem;
}

/* Pronunciation row spacing */
.pron-row {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}
.pron-row .sound-btn { flex: 1; min-width: 0; }

/* ==========================================================================
   VISUAL POLISH PASS — Make it MAST
   ========================================================================== */

/* === Smooth global transitions === */
button, a, .word-card, .ai-card, .panel, .stat, input, select, textarea, .top-filter-btn, .badge-pill {
  transition: transform .18s ease, box-shadow .22s ease, background-color .22s ease, border-color .22s ease;
}

/* === Page-level polish: subtle gradient backdrop === */
body {
  background-attachment: fixed;
  background-image: radial-gradient(ellipse at top, rgba(67, 56, 202, .08) 0%, transparent 50%),
                    radial-gradient(ellipse at bottom right, rgba(255, 209, 102, .04) 0%, transparent 50%);
}

/* === Mobile hero — compact, less wasted space === */
@media (max-width: 719px) {
  .hero { padding: .4rem 0 .6rem; }
  .hero p { font-size: .65rem; margin-bottom: .15rem; opacity: .7; }
  .hero h1 { font-size: 1.5rem; }
}

@media (min-width: 720px) and (max-width: 1023px) {
  .hero h1 { font-size: 2rem; }
}

/* === Better panels: subtle inner glow + lift on hover === */
.panel {
  background: linear-gradient(180deg, rgba(255,255,255,.025), transparent 50%), var(--panel, #14163b);
  box-shadow: 0 2px 8px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.05);
}

/* === Better cards: lift on hover === */
.word-card, .ai-card {
  background: linear-gradient(180deg, rgba(255,255,255,.04), transparent 50%), var(--panel, #14163b);
  box-shadow: 0 4px 14px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.05);
}
.word-card:hover, .ai-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.08);
}

/* === Stat cards polished === */
.stat {
  background: linear-gradient(135deg, rgba(85,224,255,.04), rgba(255,209,102,.02));
  border: 1px solid rgba(255,255,255,.04);
  border-radius: 10px;
  padding: .85rem;
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.stat span { font-size: .68rem; color: var(--muted); letter-spacing: .03em; text-transform: uppercase; font-weight: 700; }
.stat strong { font-size: 1.4rem; color: var(--gold, #ffd166); font-weight: 800; letter-spacing: -.02em; }
.stat:hover { border-color: rgba(255,209,102,.2); transform: translateY(-2px); }

@media (max-width: 479px) {
  .stat { padding: .55rem; }
  .stat span { font-size: .58rem; }
  .stat strong { font-size: 1.05rem; }
}

/* === Streak chip glow when active === */
.streak-chip.is-active {
  animation: streak-glow 2.5s ease infinite;
}
@keyframes streak-glow {
  0%, 100% { box-shadow: 0 0 14px rgba(255,103,31,.4); }
  50%      { box-shadow: 0 0 22px rgba(255,103,31,.6); }
}

/* === Better buttons: subtle gradient + lift === */
button, .link-button {
  background: linear-gradient(180deg, var(--panel-2, #16183a), rgba(20,22,59,.8));
  border: 1px solid var(--line, #28284a);
  border-radius: 10px;
  padding: .65rem 1rem;
  color: var(--text, #fff);
  font-weight: 600;
  cursor: pointer;
}
button:hover, .link-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
  border-color: rgba(255,209,102,.3);
}
button:active, .link-button:active { transform: translateY(0); }
button:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }

button.primary, .primary {
  background: linear-gradient(135deg, var(--gold, #ffd166), #ff9a3d);
  color: #0a0c22 !important;
  border-color: transparent;
  font-weight: 800;
}
button.primary:hover, .primary:hover {
  box-shadow: 0 6px 22px rgba(255,209,102,.35);
  filter: brightness(1.06);
}

button.secondary, .secondary {
  background: linear-gradient(180deg, rgba(85,224,255,.12), rgba(85,224,255,.04));
  border-color: rgba(85,224,255,.3);
  color: var(--cyan, #55e0ff);
}

/* ============================================
   GOOGLE DICTIONARY STYLE WORD CARDS
   Compact row + tap to expand meaning panel
   ============================================ */
.word-row-card.google-dict {
  background: var(--panel, #14163b);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 12px;
  padding: 0;
  margin-bottom: .55rem;
  transition: border-color .2s, box-shadow .2s, background .2s;
  overflow: hidden;
}
.word-row-card.google-dict:hover {
  border-color: rgba(85,224,255,.25);
}
.word-row-card.google-dict.is-open {
  border-color: rgba(85,224,255,.4);
  background: linear-gradient(180deg, rgba(85,224,255,.04), transparent 40%);
}

/* ===== Compact row: word (left, expandable) + sound icon (right) ===== */
.gd-row-compact {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .85rem 1rem;
  cursor: pointer;
}
/* Word row = ek clickable box; click par text select/highlight na ho. */
.gd-row-compact, .gd-row-compact * { -webkit-user-select: none !important; user-select: none !important; }
/* Mouse/touch focus → no outline; KEYBOARD focus (:focus-visible) → visible ring (a11y, audit quick-win) */
.gd-word-compact:focus:not(:focus-visible) { outline: none !important; }
.gd-word-compact:focus-visible { outline: 2px solid var(--accentX, #dd2a7b) !important; outline-offset: 2px; border-radius: 8px; }
.gd-word-compact:hover, .gd-word-compact:active { transform: none !important; box-shadow: none !important; border-color: transparent !important; }
.gd-row-compact:hover { transform: none; box-shadow: none; }
.gd-word-compact {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  color: var(--text, #e8edff);
  text-align: left;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.gd-word-text {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.3;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gd-word-compact[aria-expanded="true"] .gd-word-text {
  color: var(--cyan, #55e0ff);
}
.gd-stage-mini {
  flex-shrink: 0;
  font-size: .62rem;
  font-weight: 700;
  color: var(--pink);
  background: rgba(195,157,255,.1);
  padding: .15rem .45rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* Small sound icon on right */
.gd-sound-mini {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #5b8def, #7c5cff);
  color: #fff;
  font-size: .9rem;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  box-shadow: 0 3px 8px rgba(91,141,239,.25);
  transition: transform .15s, box-shadow .2s, background .2s;
  padding: 0;
}
.gd-sound-mini:hover { transform: scale(1.08); box-shadow: 0 4px 12px rgba(91,141,239,.4); }
.gd-sound-mini:active { transform: scale(0.92); }
.gd-sound-mini.speaking {
  background: linear-gradient(135deg, #6ee598, #55e0ff);
  animation: soundPulse 1s ease-in-out infinite;
}

/* ===== Expandable inline meaning panel ===== */
.gd-meaning-panel {
  padding: .1rem 1rem .9rem;
  border-top: 1px dashed rgba(255,255,255,.06);
  background: rgba(0,0,0,.12);
}
.gd-meaning-panel[hidden] { display: none; }
.gd-pron-row {
  display: flex;
  align-items: baseline;
  gap: .65rem;
  flex-wrap: wrap;
  margin: .55rem 0 .35rem;
}
.gd-pronunciation {
  font-size: .82rem;
  color: var(--muted);
  font-family: 'Noto Sans Devanagari', 'Mangal', system-ui, sans-serif;
  letter-spacing: -.005em;
}
.gd-pos {
  font-size: .8rem;
  color: var(--muted, #8b95c7);
  font-style: italic;
  font-weight: 500;
}
.gd-en {
  color: var(--text, #e8edff);
  font-size: .98rem;
  line-height: 1.55;
  margin: .25rem 0 .35rem;
}
.gd-hi {
  color: var(--gold);
  font-size: 1.02rem;
  line-height: 1.55;
  margin: .25rem 0;
  font-family: 'Noto Sans Devanagari', 'Mangal', -apple-system, sans-serif;
}
.gd-hi-pending {
  color: var(--muted, #8b95c7);
  font-style: italic;
  font-size: .85rem;
}
.gd-root {
  margin: .5rem 0 .15rem;
  padding: .5rem .7rem;
  background: rgba(110,229,152,.08);
  border-left: 3px solid rgba(110,229,152,.5);
  border-radius: 6px;
  font-size: .92rem;
  line-height: 1.5;
  color: var(--text, #e8edff);
}
.gd-root-label {
  color: var(--green);
  font-weight: 800;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-right: .25rem;
}
.gd-root b { color: var(--green); }
.gd-root-hi {
  color: var(--gold);
  font-family: 'Noto Sans Devanagari', 'Mangal', -apple-system, sans-serif;
}
.gd-root-en {
  color: var(--muted, #8b95c7);
  font-size: .85rem;
  font-style: italic;
}
/* Root line inside detail panel Hindi-meaning section */
.kid-root-line {
  margin-top: .25rem;
  padding: .4rem .6rem;
  background: rgba(110,229,152,.1);
  border-left: 3px solid rgba(110,229,152,.5);
  border-radius: 6px;
  font-size: .95rem;
  line-height: 1.5;
}
.kid-root-line b { color: var(--green); }
.kid-root-hi { color: var(--gold); font-family: 'Noto Sans Devanagari','Mangal',sans-serif; }
.kid-root-line em { color: var(--muted, #8b95c7); font-size: .85rem; }
/* Full-width Hindi meaning block (above the detail grid) */
.kid-hindi-block {
  background: var(--panel-2, #1a1d44);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  margin-bottom: .85rem;
}
.kid-hindi-block .chips { margin-top: .6rem; }
.kid-pron-row { display: flex; align-items: baseline; gap: .65rem; flex-wrap: wrap; margin: .2rem 0 .4rem; }

/* ===== Synonyms / Antonyms (tap a chip → its meaning loads below) ===== */
.kid-relations { background: var(--panel-2, #1a1d44); border: 1px solid var(--line); border-radius: 10px; padding: .9rem 1rem; margin-bottom: .85rem; }
.kid-relations .kid-label em { font-style: normal; color: var(--muted, #8b95c7); font-weight: 600; font-size: .82em; }
.rel-ant-label { margin-top: .7rem; display: block; }
.rel-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .4rem; }
.rel-chip { cursor: pointer; border: 1.5px solid; border-radius: 999px; padding: .42rem .85rem; font-size: .9rem; font-weight: 700; background: transparent; transition: transform .1s, background .15s, box-shadow .15s; }
.rel-chip:active { transform: scale(.93); }
.rel-syn { color: #6ee598; border-color: rgba(110,229,152,.4); background: rgba(110,229,152,.08); }
.rel-ant { color: #ff8aa5; border-color: rgba(255,95,170,.4); background: rgba(255,95,170,.08); }
.rel-chip.rel-active { box-shadow: 0 0 0 3px rgba(85,224,255,.28); }
.rel-syn.rel-active { background: rgba(110,229,152,.22); }
.rel-ant.rel-active { background: rgba(255,95,170,.22); }
.rel-meaning-slot { margin-top: .75rem; }
.rel-meaning-card { background: rgba(85,224,255,.06); border: 1px solid rgba(85,224,255,.26); border-radius: 10px; padding: .75rem .9rem; animation: relfade .2s ease; }
@keyframes relfade { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.rel-mc-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.rel-mc-head b { font-size: 1.12rem; color: var(--text, #e8edff); }
.rel-mc-head .gd-sound-mini { margin-left: auto; }
.rel-mc-hi { font-family: 'Noto Sans Devanagari','Mangal',-apple-system,sans-serif; font-size: 1.05rem; line-height: 1.6; color: var(--text, #e8edff); margin: .5rem 0 .2rem; }
.rel-mc-en { color: var(--muted, #b8c0e8); font-size: .9rem; margin: .15rem 0; }
.rel-mc-open { display: inline-block; margin-top: .4rem; color: var(--cyan, #55e0ff); font-size: .82rem; font-weight: 700; text-decoration: none; }
.rel-mc-img { display: block; max-width: 14rem; max-height: 11rem; object-fit: contain; border-radius: 9px; margin-top: .5rem; border: 1px solid rgba(255,255,255,.1); }
.rel-mc-act { display: block; width: 100%; margin-top: .5rem; padding: .55rem .7rem; border-radius: 9px; border: 1.5px solid rgba(85,224,255,.4); background: rgba(85,224,255,.08); color: var(--cyan, #55e0ff); font-weight: 800; font-size: .8rem; cursor: pointer; }
.rel-mc-act.night { border-color: rgba(195,157,255,.45); background: rgba(195,157,255,.1); color: var(--pink, #c39dff); }
/* Root-breakdown block inside the meaning card (story + books): word kaise bana */
.rel-mc-root { margin-top: .55rem; padding: .55rem .6rem; border: 1px dashed rgba(110,231,183,.35); border-radius: 10px; background: rgba(16,185,129,.07); font-size: .82rem; display: grid; gap: .4rem; }
.rel-mc-root .rmr-line { line-height: 1.45; }
.rel-mc-root .rmr-trick { font-size: .76rem; opacity: .88; line-height: 1.45; }
/* Equation hamesha EK row me rehti hai — parts khud chhote/bade hote hain */
.rmr-eq { display: flex; align-items: stretch; gap: .3rem; flex-wrap: nowrap; width: 100%; }
.rmr-part { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .06rem; padding: .35rem .45rem; border-radius: 9px; border: 1px solid rgba(255,255,255,.18); flex: 1 1 auto; min-width: 0; text-align: center; }
.rmr-part b { font-size: .95rem; line-height: 1.1; max-width: 100%; overflow-wrap: anywhere; }
.rmr-part small { font-size: .64rem; opacity: .85; line-height: 1.2; max-width: 100%; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rmr-part small.hi { font-family: 'Noto Sans Devanagari','Mangal',-apple-system,sans-serif; }
.rmr-part.pre { border-color: rgba(251,191,36,.5); background: rgba(251,191,36,.1); }
.rmr-part.root { border-color: rgba(110,231,183,.55); background: rgba(16,185,129,.14); flex-grow: 1.4; }
.rmr-part.suf { border-color: rgba(125,211,252,.5); background: rgba(56,189,248,.1); }
.rmr-part.word { border-color: rgba(255,209,102,.55); background: rgba(255,209,102,.1); }
.rmr-plus { align-self: center; font-weight: 900; opacity: .65; font-size: .9rem; flex: 0 0 auto; }
/* Mobile: sab kuch usi row me, naap ke chhota — koi overflow nahi */
@media (max-width: 540px) {
  .rel-meaning-card { padding: .6rem .65rem; }
  .rel-meaning-card .rel-mc-head b { font-size: 1rem; }
  .rel-mc-hi { font-size: .95rem; line-height: 1.5; }
  .rel-mc-en { font-size: .8rem; }
  .rel-mc-act { padding: .5rem .6rem; font-size: .74rem; }
  .rel-mc-root { padding: .45rem .45rem; gap: .32rem; }
  .rmr-eq { gap: .18rem; }
  .rmr-part { padding: .26rem .25rem; border-radius: 7px; }
  .rmr-part b { font-size: .76rem; }
  .rmr-part small { font-size: .53rem; line-height: 1.15; }
  .rmr-plus { font-size: .7rem; }
  .rel-mc-root .rmr-trick { font-size: .7rem; }
}
@media (max-width: 380px) {
  .rmr-part b { font-size: .68rem; }
  .rmr-part small { font-size: .48rem; }
}
/* 2 retry ke baad bhi fail image: tooti icon ki jagah saaf hide */
.img-failed { display: none !important; }
/* 🎤 Bol ke check */
.hero-btns { display: flex; flex-direction: column; gap: .4rem; }
.mic-check { white-space: nowrap; }
.say-feedback { margin: .5rem 0 0; padding: .55rem .7rem; border-radius: 10px; font-size: .82rem; font-weight: 800; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.05); }
.say-feedback[hidden] { display: none; }
.say-feedback.ok { border-color: rgba(110,229,152,.5); background: rgba(110,229,152,.12); color: #6ee598; }
.say-feedback.near { border-color: rgba(255,180,77,.5); background: rgba(255,180,77,.1); color: #ffb44d; }
.say-feedback.no { border-color: rgba(255,138,165,.5); background: rgba(255,138,165,.1); color: #ff8aa5; }
/* Home quick-strip: 5-Minute / Games / Dashboard ek tap me */
.quick-strip { display: flex; gap: .5rem; margin: .55rem 0 .2rem; }
.quick-strip a { flex: 1; text-align: center; padding: .55rem .4rem; border-radius: 11px; font-size: .78rem; font-weight: 900; text-decoration: none; color: var(--text,#e8edff); border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.05); white-space: nowrap; }
.quick-strip a:nth-child(1) { border-color: rgba(255,209,102,.4); background: rgba(255,209,102,.09); color: #ffd166; }
.quick-strip a:nth-child(2) { border-color: rgba(85,224,255,.4); background: rgba(85,224,255,.09); color: var(--cyan, #55e0ff); }
.quick-strip a:nth-child(3) { border-color: rgba(195,157,255,.4); background: rgba(195,157,255,.09); color: var(--pink, #c39dff); }
@keyframes lppulse { 0% { box-shadow: 0 0 0 0 rgba(85,224,255,.55); } 100% { box-shadow: 0 0 0 9px rgba(85,224,255,0); } }
.lp-pulse { animation: lppulse .5s ease; border-radius: 6px; }

/* ===== Vocab Story: highlighted, tappable words inside the narrative ===== */
.story-word {
  display: inline; padding: 0 .12em; margin: 0; font: inherit; font-weight: 800;
  color: var(--gold, #ffd166); background: none; border: none;
  border-bottom: 1.5px dotted var(--gold, #ffd166); cursor: pointer; line-height: inherit;
}
.story-word:hover { color: var(--cyan, #55e0ff); border-bottom-color: var(--cyan, #55e0ff); }
.story-word.rel-active { color: #0a0c22; background: var(--gold, #ffd166); border-radius: 5px; border-bottom-color: transparent; }
.baby-hindi { font-family: 'Noto Sans Devanagari','Mangal',-apple-system,sans-serif; line-height: 1.7; }
.baby-hindi b { color: var(--green); }

@media (max-width: 479px) {
  .gd-row-compact { padding: .75rem .85rem; }
  .gd-word-text { font-size: 1.08rem; }
  .gd-sound-mini { width: 1.85rem; height: 1.85rem; font-size: .82rem; }
  .gd-meaning-panel { padding: .1rem .85rem .8rem; }
  .gd-en, .gd-hi { font-size: .94rem; }
}

/* === Sound / pronunciation buttons === */
.sound-btn {
  background: linear-gradient(135deg, rgba(195,157,255,.18), rgba(110,180,255,.12));
  border-color: rgba(195,157,255,.35);
  color: var(--pink);
  padding: .55rem .85rem;
  font-weight: 700;
  transition: transform .15s, box-shadow .2s, background .2s;
}
.sound-btn:active {
  transform: scale(0.96);
}
.sound-btn.speaking {
  background: linear-gradient(135deg, rgba(110,229,152,.5), rgba(85,224,255,.5));
  border-color: var(--green);
  color: #fff;
  animation: soundPulse 1s ease-in-out infinite;
}
@keyframes soundPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(110,229,152,.7); }
  50% { box-shadow: 0 0 0 8px rgba(110,229,152,0); }
}

/* === Top stats nav better === */
.top-filter-btn {
  background: linear-gradient(180deg, rgba(255,255,255,.04), transparent 50%), var(--panel, #14163b);
  position: relative;
  overflow: hidden;
}
.top-filter-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 60%, rgba(255,209,102,.04) 100%);
  pointer-events: none;
}
.top-filter-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,.28);
  border-color: rgba(85,224,255,.25);
}
.top-filter-btn.active::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gold, #ffd166);
  border-radius: 0 0 2px 2px;
}

/* === Bottom nav active state with indicator === */
.bottom-nav a.active {
  position: relative;
  background: rgba(255,209,102,.1);
}
.bottom-nav a.active::before {
  content: '';
  position: absolute;
  top: 4px; left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: var(--gold, #ffd166);
  border-radius: 0 0 3px 3px;
}
.bottom-nav b { transition: transform .15s; }
.bottom-nav a:hover b { transform: translateY(-2px); }
.bottom-nav a.active b {
  background: var(--gold, #ffd166);
  color: #0a0c22;
}

/* === Flashcard full-width on mobile === */
@media (max-width: 719px) {
  .cards-stack.single-card {
    grid-template-columns: 1fr !important;
    width: 100%;
  }
  .flashcard {
    width: 100%;
    margin: 0;
  }
}

/* === Flashcard: nicer surface === */
.flashcard {
  background: linear-gradient(135deg, var(--panel, #14163b), rgba(67,56,202,.08));
  box-shadow: 0 12px 40px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 14px;
}

/* === Word card details === */
.word-card { border-radius: 12px; }
.word-card strong { color: var(--gold, #ffd166); }

/* === Form inputs polish === */
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="search"], textarea, select {
  background: rgba(0,0,0,.18);
  border: 1px solid var(--line, #28284a);
  border-radius: 9px;
  padding: .65rem .85rem;
  color: var(--text, #fff);
  width: 100%;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--cyan, #55e0ff);
  box-shadow: 0 0 0 3px rgba(85,224,255,.18);
}

/* === Chip-style buttons (for filters, tags) === */
.chip {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .28rem .6rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
}
.chip.prefix { background: rgba(255,103,31,.12); color: #ff8a3d; border-color: rgba(255,103,31,.25); }
.chip.root   { background: rgba(110,229,152,.12); color: var(--green); border-color: rgba(110,229,152,.25); }
.chip.suffix { background: rgba(85,224,255,.12); color: var(--cyan, #55e0ff); border-color: rgba(85,224,255,.25); }

/* === Progress bars polish === */
.ai-progress-bar {
  height: 8px;
  border-radius: 4px;
  background: rgba(0,0,0,.3);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.3);
}
.ai-progress-bar > div {
  background: linear-gradient(90deg, #6ee598, #55e0ff, #c39dff);
  box-shadow: 0 0 8px rgba(110,229,152,.35);
}

/* === Empty state styling === */
.empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
  font-style: italic;
  border: 1px dashed var(--line, #28284a);
  border-radius: 12px;
  background: rgba(255,255,255,.02);
}
.empty::before {
  content: '🌱';
  display: block;
  font-size: 2.5rem;
  margin-bottom: .5rem;
}

/* === Section title polish === */
.section-title h2 {
  background: linear-gradient(135deg, var(--text, #fff) 0%, var(--gold, #ffd166) 70%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* === Notices polish === */
.notice {
  background: linear-gradient(135deg, rgba(85,224,255,.08), rgba(110,229,152,.05));
  border-left: 4px solid var(--cyan, #55e0ff);
  padding: .85rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}
.notice.error {
  background: linear-gradient(135deg, rgba(220,53,69,.12), rgba(220,53,69,.04));
  border-left-color: #ff8a95;
  color: #ffb5bd;
}

/* === Laptop sidebar for richer layouts === */
@media (min-width: 1280px) {
  .page-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 1.5rem;
    align-items: start;
  }
  .page-sidebar {
    position: sticky;
    top: 5.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }
}

/* === Ripple effect on buttons === */
button, .link-button { position: relative; overflow: hidden; }
button::after, .link-button::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255,255,255,.25) 0%, transparent 70%);
  opacity: 0;
  transform: scale(0.5);
  transition: opacity .4s, transform .4s;
  pointer-events: none;
}
button:active::after, .link-button:active::after {
  opacity: 1;
  transform: scale(2);
  transition: 0s;
}

/* === Page entry animation === */
/* 🍎 Har tab/page par halka content fade-in — sirf .page par (opacity-only → GPU-cheap, ek hi layer;
   bottom-nav .page ke bahar fixed hai isliye wo solid rehta, sirf content cross-fade hota = iOS tab-switch feel).
   Reliable har jagah (SWR instant-load ke upar), SW/View-Transition par depend nahi. Word-list bhi smooth
   kyunki rows individually animate nahi karti — poora .page ek saath fade hota. */
.page { animation: page-fade-in .22s ease both; }
@keyframes page-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* === ✨ SCROLL SMOOTHNESS (word list) === */
/* backdrop-filter:blur har frame backdrop ko re-blur karta hai jab list neeche scroll hoti — mid/low-end
   par scroll-FPS ka sabse bada killer. Bars ka bg pehle se ~94% opaque hai, to solid kar dete hain
   (dekhne me bilkul same, par buttery scroll). Sirf phone par + dictionary page ke bars par. */
@media (max-width: 719px) {
  .word-dictionary-page .top-learning-buttons,
  .word-dictionary-page .dic-search,
  .word-dictionary-page .dic-filter-panel {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: #07081f;
  }
}
/* Dense list ke har row par ripple ::after (extra paint layer) + broad transition mehnga padta hai;
   press-feel ke liye fast scale already hai. List rows ko halka rakho. */
.word-only-list .gd-sound-mini::after,
.word-only-list .gd-word-compact::after,
.word-only-list button::after { content: none !important; }
.word-only-list button { overflow: visible; }
.word-only-list a,
.word-only-list button { transition: filter .12s ease, transform .07s ease-out; }

/* iOS-jaisa smooth tab-switch ab upar wale `.page` opacity fade-in se aata hai (reliable, har page par,
   SW ke saath bhi). Cross-document View-Transitions API yahan jaan-bujhke nahi use kiya — Service Worker
   se served navigations par wo fire nahi hota, isliye dead pad jaata. */

/* === Better topbar === */
.topbar {
  backdrop-filter: blur(14px);
  background: linear-gradient(180deg, rgba(10,12,34,.92), rgba(10,12,34,.7));
  border-bottom: 1px solid rgba(255,255,255,.05);
  box-shadow: 0 2px 18px rgba(0,0,0,.18);
}
.topbar .brand span {
  background: linear-gradient(135deg, #6ee598, #55e0ff);
  color: #0a0c22 !important;
  font-weight: 900;
  border-radius: 8px;
  padding: .35rem .55rem;
  box-shadow: 0 4px 12px rgba(85,224,255,.25);
}

/* === Mistake rows lift === */
.mistake-row:hover { transform: translateX(4px); border-left-width: 6px; }

/* === Challenge row hover === */
.challenge-row:hover { background: rgba(255,255,255,.05); border-left-width: 6px; }

/* === Badge pill hover === */
.badge-pill:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 18px rgba(255,209,102,.18);
}

/* === Better word-of-the-day card === */
.wotd-card {
  background:
    radial-gradient(circle at top right, rgba(255,209,102,.08), transparent 60%),
    var(--panel, #14163b);
  position: relative;
  overflow: hidden;
}
.wotd-card::before {
  content: '📅';
  position: absolute;
  top: -10px; right: -10px;
  font-size: 8rem;
  opacity: .03;
  pointer-events: none;
}

/* === Scrollbar polish === */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,.2); }
::-webkit-scrollbar-thumb { background: rgba(85,224,255,.18); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: rgba(85,224,255,.3); }

/* === Selection color === */
::selection { background: rgba(255,209,102,.4); color: #fff; }

/* === Better SM-2 grade buttons === */
.sm2-grades button {
  position: relative;
  overflow: hidden;
}
.sm2-grades button::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.sm2-grades button:hover::before { transform: scaleX(1); }


/* ==========================================================================
   ANALYTICS / CHARTS
   ========================================================================== */

/* Metric cards (top of analytics) */
.metric-grid {
  display: grid;
  gap: .85rem;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 720px) { .metric-grid { grid-template-columns: repeat(4, 1fr); } }

.metric-card {
  background: linear-gradient(135deg, rgba(85,224,255,.06), rgba(255,209,102,.03));
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.metric-card small { color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.metric-card strong { font-size: 2rem; color: var(--gold, #ffd166); line-height: 1; margin: .15rem 0; font-weight: 800; letter-spacing: -.02em; }
.metric-card span { font-size: .72rem; color: var(--muted); display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }

/* SVG chart base */
.chart-svg { width: 100%; height: auto; display: block; max-height: 220px; }
.chart-line { fill: none; stroke: var(--cyan, #55e0ff); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 0 4px rgba(85,224,255,.4)); }
.chart-dot { fill: var(--gold, #ffd166); stroke: var(--cyan, #55e0ff); stroke-width: 1; }
.chart-dot:hover { r: 4; cursor: pointer; }
.chart-gridline { stroke: rgba(255,255,255,.06); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-tick { fill: var(--muted); font-size: 11px; }

/* Sparkline */
.chart-sparkline { width: 80px; height: 24px; display: inline-block; vertical-align: middle; }
.chart-sparkline polyline { fill: none; stroke: var(--cyan, #55e0ff); stroke-width: 1.5; }

/* Horizontal bars */
.chart-bars-h { display: grid; gap: .75rem; }
.chart-bar-row { display: grid; grid-template-columns: minmax(120px, 30%) 1fr; gap: 1rem; align-items: center; }
.chart-bar-label { display: flex; flex-direction: column; }
.chart-bar-label strong { font-size: .9rem; color: var(--gold, #ffd166); }
.chart-bar-label small { color: var(--muted); font-size: .72rem; }
.chart-bar-track { height: 18px; background: rgba(0,0,0,.25); border-radius: 9px; overflow: hidden; }
.chart-bar-fill { height: 100%; background: linear-gradient(90deg, #ff8a3d, #ff8a95); border-radius: 9px; transition: width .8s ease; }

@media (max-width: 479px) {
  .chart-bar-row { grid-template-columns: 1fr; gap: .35rem; }
  .chart-bar-track { height: 14px; }
}

/* Vertical bars (24-hour) */
.chart-bars-v {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 3px;
  align-items: end;
  height: 140px;
  padding: 0 .5rem;
}
.chart-bar-col { display: flex; flex-direction: column; align-items: center; height: 100%; min-width: 0; gap: 2px; justify-content: flex-end; }
.chart-bar-vfill {
  width: 100%;
  background: linear-gradient(180deg, #6ee598, #55e0ff);
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  transition: height 1s cubic-bezier(.5,1.5,.5,1);
}
.chart-bar-col small { font-size: 9px; color: var(--muted); transform: rotate(-45deg); transform-origin: top right; white-space: nowrap; }
.chart-bar-col:hover .chart-bar-vfill { background: linear-gradient(180deg, #ffd166, #ff8a3d); }

/* Funnel chart */
.chart-funnel { display: grid; gap: .55rem; }
.funnel-row { display: grid; grid-template-columns: 70px 1fr; gap: .75rem; align-items: center; }
.funnel-label { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.funnel-label b { color: var(--gold, #ffd166); font-size: .82rem; }
.funnel-label small { color: var(--muted); font-size: .7rem; }
.funnel-bar { height: 22px; background: rgba(0,0,0,.25); border-radius: 6px; overflow: hidden; }
.funnel-fill {
  height: 100%;
  background: linear-gradient(90deg, rgba(110,229,152,.85), rgba(85,224,255,.85), rgba(195,157,255,.85), rgba(255,209,102,.85));
  border-radius: 6px;
  transition: width 1s ease;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.15);
}

/* Insight box */
.insight {
  margin-top: 1rem;
  padding: .75rem 1rem;
  background: linear-gradient(135deg, rgba(110,229,152,.08), rgba(85,224,255,.04));
  border-left: 3px solid var(--cyan, #55e0ff);
  border-radius: 8px;
  font-size: .85rem;
  line-height: 1.5;
}
.insight a { color: var(--cyan, #55e0ff); }

.insights-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .65rem; }
.insights-list li {
  padding: .75rem 1rem;
  background: rgba(255,255,255,.025);
  border-radius: 8px;
  border-left: 3px solid var(--gold, #ffd166);
  font-size: .88rem;
  line-height: 1.5;
}

/* Delta badges */
.chart-delta { font-weight: 800; font-size: .78rem; padding: .12rem .4rem; border-radius: 4px; }
.delta-up   { background: rgba(110,229,152,.15); color: var(--green); }
.delta-down { background: rgba(220,53,69,.15); color: #ff8a95; }
.delta-flat { background: rgba(255,255,255,.06); color: var(--muted); }

/* Retention risk cards */
.risk-grid {
  display: grid;
  gap: .65rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.risk-card {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  padding: .75rem 1rem;
  background: rgba(255,209,102,.04);
  border-left: 3px solid var(--gold, #ffd166);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
}
.risk-card:hover { background: rgba(255,209,102,.08); transform: translateX(3px); }
.risk-card strong { color: var(--gold, #ffd166); font-size: .95rem; }
.risk-card small { color: var(--muted); font-size: .75rem; }
.risk-badge {
  display: inline-block;
  margin-top: .25rem;
  padding: .2rem .55rem;
  border-radius: 4px;
  font-size: .68rem;
  font-weight: 700;
  width: max-content;
}
.risk-high { background: rgba(220,53,69,.2); color: #ff8a95; }
.risk-medium { background: rgba(255,143,28,.18); color: #ffb454; }

/* ==========================================================================
   ONBOARDING + INSTALL PROMPT + HELP
   ========================================================================== */

/* Onboarding card */
.onboard-card {
  text-align: center;
  background: linear-gradient(180deg, rgba(85,224,255,.04), var(--panel, #14163b));
  padding: 2rem 1.5rem;
}
.onboard-illustration {
  font-size: 5rem;
  line-height: 1;
  margin: 1rem 0;
  animation: float-bob 3s ease-in-out infinite;
}
@keyframes float-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
.onboard-body {
  color: var(--muted);
  line-height: 1.65;
  font-size: 1rem;
  margin: 1rem auto;
  max-width: 480px;
}
.onboard-body b { color: var(--gold, #ffd166); }
.onboard-progress {
  height: 6px;
  background: rgba(0,0,0,.25);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 1rem;
}
.onboard-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6ee598, #55e0ff, #c39dff);
  transition: width .55s cubic-bezier(.5,1.7,.5,1);
}
.onboard-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  margin: 0 2px;
  transition: background .3s;
}
.onboard-dot.is-done { background: var(--gold, #ffd166); }

@media (max-width: 479px) {
  .onboard-illustration { font-size: 4rem; }
  .onboard-card { padding: 1.5rem 1rem; }
}

/* Install Banner */
.install-banner {
  position: fixed;
  bottom: 5rem;
  left: 1rem;
  right: 1rem;
  background: linear-gradient(135deg, var(--panel, #14163b), rgba(67,56,202,.15));
  border: 2px solid var(--cyan, #55e0ff);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  z-index: 9999;
  padding: 1rem 1.25rem;
  transform: translateY(150%);
  transition: transform .4s cubic-bezier(.5,1.5,.5,1);
  max-width: 480px;
  margin-inline: auto;
}
.install-banner.is-show { transform: translateY(0); }
.install-banner-content { display: flex; gap: 1rem; align-items: center; }
.install-icon { font-size: 2.5rem; line-height: 1; flex-shrink: 0; }
.install-text { flex: 1; min-width: 0; }
.install-text strong { display: block; font-size: .95rem; color: var(--cyan, #55e0ff); }
.install-text small { color: var(--muted); font-size: .78rem; }
.install-actions { display: flex; gap: .5rem; flex-shrink: 0; }
.install-banner.ios button[data-install-no] {
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 1.2rem;
  border-radius: 50%;
}

@media (min-width: 1024px) {
  .install-banner {
    left: auto;
    right: 1.5rem;
    bottom: 1.5rem;
    max-width: 380px;
  }
}

@media (max-width: 479px) {
  .install-banner { padding: .85rem; }
  .install-banner-content { flex-wrap: wrap; }
  .install-actions { width: 100%; justify-content: flex-end; }
}

/* Help page <kbd> styling */
kbd {
  display: inline-block;
  padding: .15rem .45rem;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  border-bottom-width: 2px;
  border-radius: 4px;
  font-family: 'SF Mono', Menlo, monospace;
  font-size: .82rem;
  font-weight: 700;
  color: var(--gold, #ffd166);
  min-width: 1.5rem;
  text-align: center;
}

/* Help link blocks */
.insights-list a {
  color: var(--cyan, #55e0ff);
  text-decoration: none;
  font-weight: 600;
}
.insights-list a:hover { text-decoration: underline; }

/* Hindi-pending fallback (when meaning is missing) */
.hindi-pending {
  color: var(--cyan, #55e0ff);
  font-style: italic;
  opacity: .9;
}
.muted-line + .hindi-pending,
.hindi-pending + .muted-line {
  color: var(--muted);
  font-size: .72rem;
  margin-left: .25rem;
}

/* Backup page */
.backup-list { display: grid; gap: .65rem; }
.backup-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .85rem 1rem;
  background: rgba(255,255,255,.025);
  border-radius: 10px;
  border-left: 3px solid var(--cyan, #55e0ff);
  flex-wrap: wrap;
}
.backup-row code { font-size: .78rem; }
.backup-row pre { margin: 0; font-size: .8rem; }

/* === Multi-user UI === */
.topbar-user { display: flex; gap: .35rem; align-items: center; }
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .75rem;
  background: linear-gradient(135deg, rgba(110,229,152,.15), rgba(85,224,255,.1));
  border: 1px solid rgba(110,229,152,.25);
  border-radius: 999px;
  color: #6ee598 !important;
  font-weight: 700;
  font-size: .85rem;
  text-decoration: none !important;
}
.user-chip:hover { background: linear-gradient(135deg, rgba(110,229,152,.25), rgba(85,224,255,.18)); }
.logout-link {
  display: inline-grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  background: rgba(220,53,69,.12);
  border: 1px solid rgba(220,53,69,.25);
  border-radius: 50%;
  color: #ff8a95 !important;
  font-size: 1.05rem;
  text-decoration: none !important;
  font-weight: 800;
}
.logout-link:hover { background: rgba(220,53,69,.22); }

@media (max-width: 479px) {
  .user-chip { font-size: .75rem; padding: .25rem .55rem; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .logout-link { width: 1.9rem; height: 1.9rem; font-size: .9rem; }
}

/* ==========================================================================
   FIXED VIEWPORT — Prevent zoom on tap/click/pinch
   ========================================================================== */

html {
  /* Prevent iOS Safari from auto-adjusting text size on orientation change */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Disable touch-callout (long-press menu) on iOS */
  -webkit-touch-callout: none;
  /* Instant scroll (NOT smooth): in the Android WebView, scroll-behavior:smooth
     interrupts/sticks programmatic scrolls and can make touch scroll feel janky.
     Native momentum already feels smooth, so instant is the right choice here. */
  scroll-behavior: auto;
  /* Lock font size */
  -webkit-text-size-adjust: none;
}

body {
  /* Allow vertical scroll (zoom is already locked via viewport meta) */
  touch-action: pan-y;
  /* Prevent user from selecting text via long-press (still allow on inputs) */
  -webkit-user-select: none;
  user-select: none;
  /* Soften pull-to-refresh but keep scrolling working */
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}

/* Re-enable text selection in places where it's needed */
input, textarea, [contenteditable="true"],
.word-row-card strong, .word-row-card p,
.kid-big, .kid-grid section p,
.flashcard h2, .flashcard p,
p, span, h1, h2, h3, h4, code, pre {
  -webkit-user-select: text;
  user-select: text;
}

/* All clickable elements: lock touch behavior */
button, a, input, select, textarea, label,
.flashcard, .word-card, .ai-card, .badge-pill,
.top-filter-btn, .bottom-nav a, .stat,
.auth-tab, .auth-submit, .pin-input,
[data-review-action], [data-sm2-grade], [data-cloze-answer],
[data-reverse-answer], [data-spell-check], [data-spell-hint],
[data-word-toggle], [data-speak-word], [data-check-pronunciation],
[data-copy-image-prompt], [data-delete-word], [data-favorite],
[data-image-action], [data-image-run], [data-quiz-form] button {
  touch-action: manipulation !important;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  cursor: pointer;
}

/* Prevent zoom via wheel + ctrl */
html, body {
  zoom: 1;
}

/* iOS Safari: disable zoom when focusing inputs */
input, select, textarea {
  font-size: 16px !important;
  -webkit-appearance: none;
  appearance: none;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation !important;
}

/* Special: PIN input keeps larger but still no-zoom */
.pin-input {
  font-size: 1.5rem !important;
}

/* Spelling drill input */
.spell-input {
  font-size: 16px !important;
}

@media (min-width: 480px) {
  .spell-input { font-size: 1.4rem !important; }
}

/* NOTE: no blanket "* { touch-action: manipulation }" — it blocked scrolling in
   the WebView. Zoom is already locked by the viewport meta + per-button rules.
   Scroll containers keep normal vertical pan. */
.heatmap, .chart-bars-v, pre, [data-scrollable],
.mini-dictionary-list, .word-list, .word-only-list,
.ai-lab-grid, .insights-list, .backup-list,
.risk-grid, .funnel-row, .auth-features,
.metric-grid, .stats-grid, .home-top {
  touch-action: pan-x pan-y;
  -webkit-overflow-scrolling: touch;
}

/* Disable iOS rubber-band scrolling at body level */
@supports (-webkit-touch-callout: none) {
  body { position: relative; overscroll-behavior: none; }
}

/* Tap highlight removal */
* {
  -webkit-tap-highlight-color: rgba(0,0,0,0);
}

/* Prevent select on doubletap */
.bottom-nav a, .topbar a, .auth-tab,
.streak-chip, .stat, .badge-pill,
.top-filter-btn, .chip {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Stop accidental drag on images */
img {
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: auto;
}

/* Focus rings: stay subtle (no growth that looks like zoom) */
button:focus, a:focus, input:focus, select:focus, textarea:focus {
  outline-offset: 1px;
}

/* Buttons: prevent layout shift on tap */
button, a.link-button, .auth-submit, .primary, .secondary, .sound-btn,
.top-filter-btn, .sm2-grades button, .quiz-option-btn,
input[type="submit"], input[type="button"] {
  -webkit-tap-highlight-color: transparent;
  transform-origin: center;
}

/* iOS Safari: 100vh fix using safe areas */
.auth-wrap, .install-wrap, .page {
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: env(safe-area-inset-bottom);
}

/* === My Angel brand icon === */
.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 3px 12px rgba(255,209,102,.4), 0 0 0 2px rgba(255,209,102,.25);
  vertical-align: middle;
}
.brand-fallback {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #6ee598, #55e0ff);
  color: #0a0c22; font-weight: 900;
  border-radius: 8px;
  box-shadow: 0 3px 12px rgba(85,224,255,.3);
}
.topbar .brand { display: flex; align-items: center; gap: .6rem; }
.topbar .brand strong {
  background: linear-gradient(135deg, #ffd166 0%, #ff9a3d 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 900;
  letter-spacing: -.01em;
}

@media (max-width: 479px) {
  .brand-icon, .brand-fallback { width: 30px; height: 30px; }
  .topbar .brand strong { font-size: .95rem; }
}

/* ============================================
   APPEARANCE CUSTOMIZATION (settings page options)
   ============================================ */

/* ---- Text size (whole app scale) ---- */
body.ts-sm  { font-size: 14px; }
body.ts-md  { font-size: 16px; }
body.ts-lg  { font-size: 18px; }
body.ts-xl  { font-size: 20px; }

/* ---- Hindi (Devanagari) text size ---- */
body.hs-md .gd-hi, body.hs-md .kid-big { font-size: 1.05rem; }
body.hs-lg .gd-hi, body.hs-lg .kid-big { font-size: 1.3rem; }
body.hs-xl .gd-hi, body.hs-xl .kid-big { font-size: 1.6rem; line-height: 1.6; }

/* ---- Accent color (theme accent → POORE app me wire) ---- */
/* default = brand green→cyan; har accent ek gradient-pair (--accentX → --accentX2) + dark on-accent text */
:root { --accentX: #6ee598; --accentX2: #55e0ff; --on-accent: #08111a; }
body.ac-green  { --accentX: var(--green); --accentX2: #55e0ff; }
body.ac-cyan   { --accentX: #55e0ff;     --accentX2: #6ab4ff; }
body.ac-gold   { --accentX: #ffd166;     --accentX2: #ff9a3d; }
body.ac-pink   { --accentX: #ff5faa;     --accentX2: #c39dff; }
body.ac-purple { --accentX: #c39dff;     --accentX2: #7aa8ff; }
body.ac-orange { --accentX: #ff9a3d;     --accentX2: #ffd166; }
/* CTAs / active nav / active tab / progress / focus ring sab accent se derive */
button.primary, .primary, .link-button.primary, a.primary { background: linear-gradient(135deg, var(--accentX), var(--accentX2)) !important; color: var(--on-accent) !important; border: 0 !important; }
.progress span, .ai-card .ai-progress-bar > div { background: linear-gradient(90deg, var(--accentX), var(--accentX2)) !important; }
.bottom-nav a.active { color: var(--accentX) !important; background: color-mix(in srgb, var(--accentX) 14%, transparent) !important; }
.top-filter-btn.active { border-color: color-mix(in srgb, var(--accentX) 60%, transparent) !important; background: color-mix(in srgb, var(--accentX) 13%, var(--panel)) !important; }
.top-filter-btn.active, .top-filter-btn.active * { color: var(--accentX) !important; }
:focus-visible { outline: 2px solid var(--accentX); outline-offset: 2px; }
/* apply accent to common highlight spots */
body[class*="ac-"] .gd-word-compact[aria-expanded="true"] .gd-word-text,
body[class*="ac-"] .gd-word-text:hover,
body[class*="ac-"] .section-title .pill,
body[class*="ac-"] .save-btn,
body[class*="ac-"] .save-btn-fixed,
body[class*="ac-"] .btn { }
body[class*="ac-"] .gd-sound-mini,
body[class*="ac-"] .gd-sound {
  background: linear-gradient(135deg, var(--accentX, #5b8def), #7c5cff) !important;
}
body[class*="ac-"] .save-btn,
body[class*="ac-"] .save-btn-fixed {
  background: linear-gradient(135deg, var(--accentX, #6ee598), #55e0ff) !important;
}
body[class*="ac-"] .kid-label,
body[class*="ac-"] .settings-card h2 { color: var(--accentX, #55e0ff) !important; }
body[class*="ac-"] .gd-stage-mini,
body[class*="ac-"] .gd-stage { color: var(--accentX, #c39dff) !important; }

/* ---- Font family ---- */
body.ff-default { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
body.ff-round   { font-family: 'Comic Sans MS', 'Baloo 2', 'Segoe UI Rounded', system-ui, sans-serif; }
body.ff-serif   { font-family: Georgia, 'Times New Roman', 'Noto Serif', serif; }
body.ff-mono    { font-family: 'SF Mono', Menlo, Consolas, monospace; }

/* ♿ prefers-reduced-motion: animations near-zero + 3D flip/confetti off (a11y + cheap-phone battery/jank) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .confetti-container, .confetti-piece, .streak-glow { display: none !important; }
  .flashcard { transition: none !important; transform: none !important; }
}

/* ---- Density / spacing ---- */
body.dn-compact .word-row-card.google-dict { margin-bottom: .3rem; }
body.dn-compact .gd-row-compact { padding: .55rem .8rem; min-height: 2.7rem; }
body.dn-compact .kid-grid section, body.dn-compact .story-box { padding: .55rem; }
body.dn-compact .gd-word-text { font-size: 1.05rem; }
body.dn-comfy  .word-row-card.google-dict { margin-bottom: .6rem; }
body.dn-comfy  .gd-row-compact { padding: .95rem 1rem; }
/* 📌 Sentence mining button */
.rel-mc-act.mine { border-color: rgba(255,180,77,.45); background: rgba(255,180,77,.09); color: #ffb44d; }
/* ⌨️ keyboard-focus row */
.word-only-list .kb-focus { outline: 2px solid rgba(255,209,102,.6); outline-offset: 2px; border-radius: 10px; }

/* 🎙 record & compare */
.rec-live { animation: recpulse 1s infinite; border-color: #ff8aa5 !important; color: #ff8aa5 !important; }
@keyframes recpulse { 50% { opacity: .55; } }
.rec-zone .sound-btn { margin-right: .3rem; }

/* 🔔 Due-review notification banner */
.due-banner { display: flex; align-items: center; gap: .5rem; margin: .5rem .8rem 0; padding: .7rem 1rem; border-radius: 12px;
  background: linear-gradient(135deg, var(--gold), var(--pink)); color: #2b1500; font-weight: 800; font-size: .9rem;
  text-decoration: none; box-shadow: 0 8px 22px rgba(0,0,0,.18); animation: dueIn .35s ease; }
.due-banner b { font-weight: 900; }
.due-banner .due-go { margin-left: auto; font-size: 1.1rem; font-weight: 900; }
.due-banner .due-x { border: 0; background: rgba(0,0,0,.15); color: #2b1500; width: 1.5rem; height: 1.5rem; border-radius: 50%;
  font-size: 1rem; line-height: 1; cursor: pointer; font-weight: 900; flex: 0 0 auto; }
@keyframes dueIn { from { opacity: 0; transform: translateY(-8px); } }

/* ⏳ Stage time-gate wait indicator */
.stage-wait { display: inline-flex; align-items: center; gap: .3rem; padding: .5rem .85rem; border-radius: 10px;
  background: color-mix(in srgb, var(--gold) 14%, var(--panel)); border: 1px solid color-mix(in srgb, var(--gold) 40%, var(--line));
  color: var(--gold); font-weight: 800; font-size: .8rem; font-family: 'Noto Sans Devanagari','Mangal',sans-serif; }

/* 🔒 Image protection — long-press save menu + drag block */
img { -webkit-touch-callout: none; -webkit-user-drag: none; user-select: none; pointer-events: auto; }

/* 📖 Easy story — choti relatable story + Hindi matlab anchor */
.easy-story-p { line-height: 1.65; }
.es-story { display: block; }
.es-mean { display: inline-block; margin-top: .4rem; padding: .25rem .6rem; border-radius: 999px;
  background: color-mix(in srgb, var(--gold, #ffd166) 16%, var(--panel, #14163b));
  border: 1px solid color-mix(in srgb, var(--gold, #ffd166) 38%, transparent);
  font-size: .82rem; font-family: 'Noto Sans Devanagari','Mangal',sans-serif; }

/* ✍️ Apna sentence box — halka colored theme, paste-able line; add hone par easy-sentence jaisा */
.my-sentence-box { margin: .55rem 0 0; padding: .7rem .8rem; border-radius: 13px;
  background: linear-gradient(135deg, rgba(108,92,231,.13), rgba(85,224,255,.1));
  border: 1.5px solid rgba(108,92,231,.38); }
.my-sentence-box.added { background: linear-gradient(135deg, rgba(110,229,152,.14), rgba(85,224,255,.08));
  border-color: rgba(110,229,152,.42); }
.my-sentence-box.added p { margin: .3rem 0 0; }
.my-sentence-input { width: 100%; margin: .45rem 0 .5rem; padding: .6rem .7rem; border-radius: 10px;
  border: 1.5px solid rgba(255,255,255,.2); background: rgba(255,255,255,.06); color: var(--text, #e8edff);
  font: inherit; font-size: .92rem; resize: vertical; min-height: 46px; box-sizing: border-box; }
.my-sentence-input:focus { outline: none; border-color: #6c5ce7; }
.my-sentence-add { border: 0; border-radius: 10px; padding: .5rem 1.15rem; font-weight: 900; cursor: pointer;
  background: linear-gradient(135deg, #6c5ce7, #55e0ff); color: #fff; font-family: inherit; }
.my-sentence-add:disabled { opacity: .6; }

/* ===== 📸 Instagram theme — accent + iconic gradient FORCE (file ke END me, taaki ac-* accent rules ko beat kare) ===== */
body.theme-instagram { --accentX: #dd2a7b; --accentX2: #f58529; --on-accent: #ffffff; }
body.theme-instagram .gd-sound-mini, body.theme-instagram .gd-sound,
body.theme-instagram .save-btn, body.theme-instagram .save-btn-fixed,
body.theme-instagram button.primary, body.theme-instagram .primary, body.theme-instagram a.primary, body.theme-instagram .apk-download,
body.theme-instagram .progress span, body.theme-instagram .ai-card .ai-progress-bar > div,
body.theme-instagram .top-filter-btn.active {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%) !important;
  color: #fff !important; border-color: transparent !important;
}
body.theme-instagram .top-filter-btn.active * { color: #fff !important; }
body.theme-instagram .bottom-nav a.active { color: #dd2a7b !important; background: rgba(221,42,123,.08) !important; }
/* hardcoded-dark sticky bars/chrome ko light theme ke panel rang do (warna white bg pe dark bars clash karte) */
body.theme-instagram .top-learning-buttons, body.theme-instagram .word-dictionary-page .top-learning-buttons,
body.theme-instagram .dic-search, body.theme-instagram .word-dictionary-page .dic-search,
body.theme-instagram .dic-filter-panel, body.theme-instagram .word-dictionary-page .dic-filter-panel,
body.theme-instagram .topbar, body.theme-instagram .bottom-nav, body.theme-instagram .bk-tools, body.theme-instagram .bk-nav {
  background: var(--panel) !important; border-color: var(--line) !important;
}
body.theme-instagram .topbar { backdrop-filter: none !important; }

/* ============================================================================
   INSTAGRAM THEME — comprehensive override block
   All rules scoped to body.theme-instagram. Append at the END of style.css.
   This REPLACES/EXTENDS the smaller IG block above it (merge by hand).
   Palette: white #fff / #fafafa surfaces · hairline #dbdbdb · text #262626 ·
   gray #8e8e8e · IG-blue #0095f6 · heart #ed4956 · IG-green #2fb344 ·
   accent magenta #dd2a7b · gradient = 45deg #f09433→#e6683c→#dc2743→#cc2366→#bc1888
   ========================================================================== */

/* ---------------------------------------------------------------------------
   1) CHROME / SURFACES — hardcoded-dark sticky bars & panels (biggest breakers)
   Repaint to literal white, kill heavy blur, add hairline borders.
   --------------------------------------------------------------------------- */
body.theme-instagram .topbar,
body.theme-instagram .word-dictionary-page .top-learning-buttons,
body.theme-instagram .top-learning-buttons,
body.theme-instagram .dic-search,
body.theme-instagram .word-dictionary-page .dic-search,
body.theme-instagram .dic-filter-panel,
body.theme-instagram .word-dictionary-page .dic-filter-panel,
body.theme-instagram .bottom-nav {
  background: #ffffff !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
body.theme-instagram .topbar {
  border-bottom: 1px solid #dbdbdb !important;
  box-shadow: 0 1px 0 #dbdbdb !important;
}
body.theme-instagram .word-dictionary-page .top-learning-buttons,
body.theme-instagram .top-learning-buttons {
  border-top: 1px solid #dbdbdb !important;
  border-bottom: 1px solid #dbdbdb !important;
}
body.theme-instagram .dic-search { border-bottom: 1px solid #dbdbdb !important; }
body.theme-instagram .dic-filter-panel {
  border-color: #dbdbdb !important;
  box-shadow: 0 8px 24px rgba(0,0,0,.08) !important;
}
body.theme-instagram .bottom-nav {
  border-top: 1px solid #dbdbdb !important;
  box-shadow: none !important;
}
/* CRITICAL phone media-query re-darkens these to solid #07081f; force white at same MQ */
@media (max-width:719px){
  body.theme-instagram .word-dictionary-page .top-learning-buttons,
  body.theme-instagram .word-dictionary-page .dic-search,
  body.theme-instagram .word-dictionary-page .dic-filter-panel { background: #ffffff !important; }
}
/* DIC home header: pink/cyan gradient banner -> clean white so the wordmark reads as the logo */
body.theme-instagram.word-dictionary-page .topbar,
body.theme-instagram .word-dictionary-page .topbar {
  background: #ffffff !important;
  border-bottom: 1px solid #dbdbdb !important;
  box-shadow: none !important;
}

/* Topbar text / ghost links / logout */
body.theme-instagram .topbar .brand strong { color: #262626 !important; }
body.theme-instagram .ghost { color: #262626 !important; }
body.theme-instagram .logout-link {
  background: #ffffff !important; border: 1px solid #dbdbdb !important; color: #262626 !important;
}
body.theme-instagram .logout-link:hover { color: #ed4956 !important; border-color: #ed4956 !important; }

/* Floating settings FAB -> IG gradient */
body.theme-instagram .floating-settings {
  background: linear-gradient(45deg,#f09433,#dc2743,#bc1888) !important;
  box-shadow: 0 12px 28px rgba(188,24,136,.3) !important;
}

/* Panels / word-cards / flashcards / era-cards -> flat white IG cards */
body.theme-instagram .panel,
body.theme-instagram .word-card,
body.theme-instagram .ai-card,
body.theme-instagram .flashcard,
body.theme-instagram .era-card {
  background: #ffffff !important; border: 1px solid #dbdbdb !important;
  box-shadow: 0 1px 3px rgba(0,0,0,.06) !important;
}
body.theme-instagram .word-card strong { color: #262626 !important; }
body.theme-instagram .word-card:hover,
body.theme-instagram .ai-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.1) !important; }

/* Image placeholders / zoom backings / progress tracks (dark navy on white) */
body.theme-instagram .word-image,
body.theme-instagram .memory-image-box img,
body.theme-instagram .flash-image { background: #fafafa !important; border-color: #dbdbdb !important; }
body.theme-instagram .word-image-zoom,
body.theme-instagram .word-image-full { background: #fafafa !important; }

/* Hub: dark-first cards/stats/rows + inner translucent tiles + .go chips */
body.theme-instagram .hb-stat,
body.theme-instagram .hb-row,
body.theme-instagram .hb-g,
body.theme-instagram .panel.hb-stat {
  background: #ffffff !important; border: 1px solid #dbdbdb !important;
  color: #262626 !important; box-shadow: none !important;
}
body.theme-instagram .hb-stat small,
body.theme-instagram .hb-row .tx small,
body.theme-instagram .muted-line { color: #8e8e8e !important; }
body.theme-instagram .panel [style*='rgba(255,255,255,.06)'],
body.theme-instagram [style*='rgba(255,255,255,.04)'] { background: #fafafa !important; }
body.theme-instagram .hb-row .go { background: #fafafa !important; color: #0095f6 !important; }

/* Section-title gradient heading -> solid dark (gold half was barely legible) */
body.theme-instagram .section-title h2 {
  background: none !important; -webkit-text-fill-color: #262626 !important; color: #262626 !important;
}

/* ---------------------------------------------------------------------------
   2) INPUTS — IG #fafafa fields, #dbdbdb hairline, dark text, gray placeholder
   --------------------------------------------------------------------------- */
body.theme-instagram input,
body.theme-instagram input[type="text"],
body.theme-instagram input[type="email"],
body.theme-instagram input[type="password"],
body.theme-instagram input[type="number"],
body.theme-instagram input[type="search"],
body.theme-instagram select,
body.theme-instagram textarea {
  background: #fafafa !important; border: 1px solid #dbdbdb !important; color: #262626 !important;
}
body.theme-instagram input::placeholder,
body.theme-instagram textarea::placeholder { color: #8e8e8e !important; }
body.theme-instagram input:focus,
body.theme-instagram select:focus,
body.theme-instagram textarea:focus {
  border-color: #dd2a7b !important; box-shadow: 0 0 0 3px rgba(221,42,123,.15) !important; outline: none !important;
}
/* Dic-search field + clear/filter pills (rounded IG search look) */
body.theme-instagram .dic-search input {
  background: #efefef !important; border: 1px solid transparent !important; border-radius: 999px !important;
  color: #262626 !important; padding: .6rem 1rem !important;
}
body.theme-instagram .dic-search input:focus { background: #fff !important; border-color: #dbdbdb !important; }
body.theme-instagram .dic-search button,
body.theme-instagram .dic-search a {
  background: #ffffff !important; border: 1px solid #dbdbdb !important; color: #262626 !important;
}
body.theme-instagram .dic-search a { color: #0095f6 !important; }
body.theme-instagram .dic-search button:hover { color: #262626 !important; border-color: #0095f6 !important; }
/* Settings text inputs / my-sentence -> rounded IG pill (textareas keep soft radius) */
body.theme-instagram .settings-wrap input[type=text],
body.theme-instagram .my-sentence-input {
  background: #efefef !important; border: 1px solid transparent !important; border-radius: 999px !important;
  color: #262626 !important; padding: .6rem 1rem !important;
}
body.theme-instagram .settings-wrap textarea { border-radius: 16px !important; }

/* ---------------------------------------------------------------------------
   3) CHIPS / PILLS — quiet light pills; semantic tints readable on white
   --------------------------------------------------------------------------- */
/* Morpheme chips (two upstream defs merged) */
body.theme-instagram .chip { background: #fafafa !important; border: 1px solid #dbdbdb !important; color: #262626 !important; }
body.theme-instagram .chip.prefix { background: rgba(240,148,51,.12) !important; color: #c2410c !important; border-color: rgba(240,148,51,.3) !important; }
body.theme-instagram .chip.root   { background: rgba(221,42,123,.10) !important; color: #c2185b !important; border-color: rgba(221,42,123,.28) !important; }
body.theme-instagram .chip.suffix { background: rgba(91,81,216,.10)  !important; color: #4b46c4 !important; border-color: rgba(91,81,216,.28) !important; }
/* Generic pills / streak / xp / badges */
body.theme-instagram .pill { background: rgba(221,42,123,.10) !important; color: #c2185b !important; border: 1px solid rgba(221,42,123,.25) !important; }
body.theme-instagram .streak-chip,
body.theme-instagram .badges-chip,
body.theme-instagram .badge-pill { background: #fafafa !important; color: #262626 !important; border: 1px solid #dbdbdb !important; }
body.theme-instagram .streak-chip.is-active { background: rgba(221,42,123,.12) !important; color: #c2185b !important; box-shadow: none !important; }
body.theme-instagram .xp-chip { background: rgba(47,179,68,.14) !important; color: #1e7a30 !important; }
/* SRS stage mini-pill + inline-meaning panel/dividers */
body.theme-instagram .gd-stage-mini { color: #c2185b !important; background: rgba(221,42,123,.08) !important; border: 1px solid rgba(221,42,123,.22) !important; }
body.theme-instagram .gd-meaning-panel { background: #fafafa !important; border-top: 1px dashed #dbdbdb !important; }
body.theme-instagram .gd-hi,
body.theme-instagram .gd-en { color: #262626 !important; }
/* Word-relation morpheme chips + action button */
body.theme-instagram .rel-mc-act { background: #ffffff !important; border: 1.5px solid #dbdbdb !important; color: #0095f6 !important; }
body.theme-instagram .rel-mc-act.night { color: #dd2a7b !important; border-color: rgba(221,42,123,.4) !important; background: rgba(221,42,123,.06) !important; }
body.theme-instagram .rel-mc-act.mine  { color: #c2410c !important; border-color: rgba(240,148,51,.4) !important; background: rgba(240,148,51,.08) !important; }
body.theme-instagram .rel-mc-open { color: #0095f6 !important; }
body.theme-instagram .rel-mc-en   { color: #8e8e8e !important; }
body.theme-instagram .rel-mc-root { background: rgba(47,179,68,.07) !important; border-color: rgba(47,179,68,.35) !important; color: #262626 !important; }
body.theme-instagram .rel-mc-img  { border-color: #dbdbdb !important; }
body.theme-instagram .rmr-part.pre  { background: #fff4d6 !important; }
body.theme-instagram .rmr-part.root { background: #dcfce7 !important; }
body.theme-instagram .rmr-part.suf  { background: #dbeafe !important; }
body.theme-instagram .rmr-part.word { background: #fff7d6 !important; }
/* Relation chips selected-ring -> magenta */
body.theme-instagram .rel-chip.rel-active { box-shadow: 0 0 0 3px rgba(221,42,123,.28) !important; }

/* ---------------------------------------------------------------------------
   4) BOOK READER — white paper + light tools (bk-night/bk-gray/sepia excluded)
   --------------------------------------------------------------------------- */
body.theme-instagram .bk-card { background: #ffffff !important; border: 1px solid #dbdbdb !important; box-shadow: 0 1px 2px rgba(0,0,0,.04) !important; }
body.theme-instagram .bk-card h3,
body.theme-instagram .bk-file-label { color: #c2185b !important; }
body.theme-instagram .bk-open { background: rgba(0,149,246,.10) !important; color: #0095f6 !important; }
body.theme-instagram .bk-input,
body.theme-instagram .bk-paste { background: #fafafa !important; border: 1.5px solid #dbdbdb !important; color: #262626 !important; }
body.theme-instagram .bk-btn.ghost { border: 1.5px solid #dbdbdb !important; color: #8e8e8e !important; }
body.theme-instagram .bk-tool { background: #fafafa !important; border: 1.5px solid #dbdbdb !important; color: #262626 !important; }
body.theme-instagram .bk-tool.active { background: rgba(221,42,123,.08) !important; border-color: #dd2a7b !important; color: #dd2a7b !important; }
body.theme-instagram .bk-tools,
body.theme-instagram .bk-nav { background: #ffffff !important; border-color: #dbdbdb !important; }
body.theme-instagram .bk-tools .bk-tool-more { background: #ffffff !important; border-color: #dd2a7b !important; box-shadow: 0 4px 16px rgba(0,0,0,.12) !important; }
body.theme-instagram .bk-nav button { background: #fafafa !important; border: 1px solid #dbdbdb !important; color: #262626 !important; }
body.theme-instagram .bk-toolmenu { background: #ffffff !important; border: 1px solid #dbdbdb !important; box-shadow: 0 8px 28px rgba(0,0,0,.12) !important; }
body.theme-instagram .bk-report,
body.theme-instagram .bk-pos-legend,
body.theme-instagram .bk-penbar,
body.theme-instagram .rel-meaning-slot { background: #ffffff !important; border: 1px solid #dbdbdb !important; }
body.theme-instagram .bk-chips button { background: #fafafa !important; border: 1px solid #dbdbdb !important; color: #262626 !important; }
body.theme-instagram .bk-mine-toast { background: #262626 !important; color: #ffffff !important; box-shadow: 0 8px 24px rgba(0,0,0,.18) !important; }
/* The reader "paper" page — only in the light/default reading mode */
body.theme-instagram .bk-wrap:not(.bk-night):not(.bk-gray):not(.sepia) .bk-page {
  background: #ffffff !important; color: #262626 !important; border: 1px solid #dbdbdb !important;
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.06) !important;
}
body.theme-instagram .bk-wrap:not(.bk-night):not(.bk-gray):not(.sepia) .bk-page .bk-h1 { color: #c2185b !important; }
body.theme-instagram .bk-wrap:not(.bk-night):not(.bk-gray):not(.sepia) .bk-page .bk-h2 { color: #bc1888 !important; }
/* Reading-progress bar: light track, IG-gradient fill */
body.theme-instagram .bk-pbar { background: #efefef !important; }
body.theme-instagram .bk-pbar i { background: linear-gradient(90deg,#f09433,#dc2743,#bc1888) !important; }

/* ---------------------------------------------------------------------------
   5) SIGNATURE / AVATAR / NAV — IG logo gradient, wordmark, story-ring, tab bar
   --------------------------------------------------------------------------- */
/* Logo chip + DIC banner -> iconic IG gradient */
body.theme-instagram .brand span {
  background: linear-gradient(45deg,#f09433 0%,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%) !important;
  color: #ffffff !important;
}
/* VOCAB wordmark = gradient-clipped letters on white */
body.theme-instagram .topbar .brand strong,
body.theme-instagram .word-dictionary-page .brand strong {
  background: linear-gradient(45deg,#f09433 0%,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%) !important;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent !important;
  font-weight: 700; letter-spacing: -.02em; text-shadow: none !important;
}

/* User avatar chip -> faked story-ring pill (pure-CSS fallback; see PHP note [2b]) */
body.theme-instagram .topbar-user .user-chip {
  background: #fff !important; color: #262626 !important; font-weight: 600;
  border: 2px solid transparent !important; border-radius: 999px;
  gap: .5rem; position: relative; padding: .25rem .7rem .25rem .3rem !important;
  background-image: linear-gradient(#fff,#fff), linear-gradient(45deg,#f09433,#dc2743,#cc2366,#bc1888) !important;
  background-origin: border-box; background-clip: padding-box, border-box;
}
body.theme-instagram .topbar-user .user-chip:hover { filter: brightness(.98); }
/* If you apply the optional PHP wrapper edit [2b], these style the real ring + name: */
body.theme-instagram .user-chip .ig-ava {
  width: 1.8rem; height: 1.8rem; border-radius: 50%; display: grid; place-items: center;
  padding: 2px; border: 2px solid transparent; font-size: 1rem;
  background-image: linear-gradient(#fff,#fff), linear-gradient(45deg,#f09433,#dc2743,#cc2366,#bc1888);
  background-origin: border-box; background-clip: content-box, border-box;
}
body.theme-instagram .user-chip .ig-name { font-weight: 700; color: #262626 !important; }
/* Topbar search = neutral IG icon button, not a green pill */
body.theme-instagram .topbar-user .user-chip:has(.bi-search),
body.theme-instagram .topbar a.user-chip[title='Search'] {
  background: #fff !important; border: 0 !important; color: #262626 !important; background-image: none !important;
}

/* Bottom-nav: white IG bar, gray inactive, black active, gradient indicator dot */
body.theme-instagram .bottom-nav a { color: #8e8e8e !important; background: transparent !important; }
body.theme-instagram .bottom-nav b { background: #efefef !important; color: #262626 !important; }
body.theme-instagram .bottom-nav a.active { color: #262626 !important; background: transparent !important; }
body.theme-instagram .bottom-nav a.active b { color: #262626 !important; background: #efefef !important; transform: none !important; }
body.theme-instagram .bottom-nav a.active::before {
  background: linear-gradient(45deg,#f09433,#dc2743,#cc2366,#bc1888) !important; opacity: 1 !important;
}

/* IG typography: system font stack + tight tracking; keep Devanagari font for Hindi */
body.theme-instagram {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, 'Noto Sans Devanagari', sans-serif;
  letter-spacing: -.01em;
}
body.theme-instagram .word-head strong,
body.theme-instagram .reel-word,
body.theme-instagram .hb-sechead { letter-spacing: -.02em; }
body.theme-instagram .reel-hi,
body.theme-instagram .reel-trick,
body.theme-instagram [style*='Devanagari'] { font-family: 'Noto Sans Devanagari','Mangal',sans-serif; }

/* Favorite/heart -> IG heart-red with pop animation; idle neutral gray */
body.theme-instagram .favorite-toggle,
body.theme-instagram .icon-btn.favorite-toggle { background: transparent !important; border: 0 !important; color: #8e8e8e !important; }
body.theme-instagram .favorite-toggle.active,
body.theme-instagram .icon-btn.active { color: #ed4956 !important; }
body.theme-instagram .favorite-toggle.active { transform: none; animation: ig-pop .28s ease; }
body.theme-instagram .hb-row .bi-star-fill { color: #ed4956 !important; }
@keyframes ig-pop { 0%{transform:scale(.8)} 50%{transform:scale(1.25)} 100%{transform:scale(1)} }

/* ---------------------------------------------------------------------------
   6) STATES & LEGIBILITY — buttons, links, focus, progress, toasts, games, etc.
   --------------------------------------------------------------------------- */
/* Generic buttons -> flat white, IG-blue hover (exclude gradient/primary CTAs) */
body.theme-instagram button:not(.primary):not(.save-btn):not(.save-btn-fixed):not(.apk-download):not(.gd-sound-mini):not(.gd-sound):not(.sound-btn):not(.gd-word-compact),
body.theme-instagram .link-button:not(.primary) {
  background: #ffffff !important; border: 1px solid #dbdbdb !important; color: #262626 !important; box-shadow: none !important;
}
body.theme-instagram button:not(.primary):not(.gd-word-compact):hover,
body.theme-instagram .link-button:not(.primary):hover {
  border-color: #0095f6 !important; box-shadow: none !important; background: #f7fbff !important;
}
/* Secondary buttons -> white pill, IG-blue text */
body.theme-instagram .secondary,
body.theme-instagram button.secondary {
  background: #ffffff !important; border: 1px solid #dbdbdb !important; color: #0095f6 !important; font-weight: 700 !important;
}
body.theme-instagram .secondary:hover { background: #f7fbff !important; border-color: #0095f6 !important; }
body.theme-instagram .prompt-modal-actions .secondary { background: #ffffff !important; border: 1px solid #dbdbdb !important; color: #0095f6 !important; }
body.theme-instagram .prompt-modal-actions .secondary:hover { background: #f7fbff !important; }

/* Links / actions -> IG-blue (exclude themed CTAs already on gradient) */
body.theme-instagram a:not(.primary):not(.bottom-nav a):not(.bk-btn):not(.reel-act):not(.dy-btn):not(.save-btn),
body.theme-instagram .insight a,
body.theme-instagram .insights-list a,
body.theme-instagram .rel-mc-open,
body.theme-instagram .link-button,
body.theme-instagram .quick-links a,
body.theme-instagram .section-title a,
body.theme-instagram .hb-quick a,
body.theme-instagram .gd-word-compact[aria-expanded="true"] .gd-word-text { color: #0095f6 !important; }
body.theme-instagram .quick-links a,
body.theme-instagram .section-title a,
body.theme-instagram .hb-quick a { background: #fff !important; border: 1px solid #dbdbdb !important; }
body.theme-instagram .full-detail-btn { background: #ffffff !important; border-color: #dbdbdb !important; color: #0095f6 !important; }

/* Focus rings (single magenta ring for a11y) */
body.theme-instagram :focus-visible { outline: 2px solid #dd2a7b !important; outline-offset: 2px; }
body.theme-instagram button:focus-visible,
body.theme-instagram a:focus-visible { outline-offset: 3px; }

/* Disabled buttons -> unambiguous IG states */
body.theme-instagram button:disabled,
body.theme-instagram .primary:disabled,
body.theme-instagram button.primary:disabled {
  opacity: 1 !important; background: #b2dffc !important; color: #ffffff !important;
  border-color: transparent !important; cursor: not-allowed; box-shadow: none !important;
}
body.theme-instagram .secondary:disabled,
body.theme-instagram button:not(.primary):disabled {
  background: #fafafa !important; color: #c7c7c7 !important; border-color: #efefef !important;
}

/* Top filter / stat-nav buttons (active fill handled by gradient block above) */
body.theme-instagram .top-filter-btn { background: #ffffff !important; border: 1px solid #dbdbdb !important; color: #262626 !important; }
body.theme-instagram .top-filter-btn:hover { border-color: #0095f6 !important; box-shadow: none !important; }
body.theme-instagram .top-filter-btn.active::before { background: #dd2a7b !important; }
body.theme-instagram .top-filter-btn::after { display: none !important; }

/* Bottom-nav active indicator + count badge -> magenta */
body.theme-instagram .bottom-nav a.active b { background: #dd2a7b !important; color: #ffffff !important; }

/* Progress / track bars -> light track, IG-gradient fill */
body.theme-instagram .progress,
body.theme-instagram .ai-card .ai-progress-bar,
body.theme-instagram .ai-progress-bar,
body.theme-instagram .chart-bar-track,
body.theme-instagram .funnel-bar,
body.theme-instagram .onboard-progress,
body.theme-instagram .gm-timer {
  background: #efefef !important; border-color: #dbdbdb !important; box-shadow: none !important;
}
body.theme-instagram .chart-bar-fill,
body.theme-instagram .funnel-fill,
body.theme-instagram .chart-bar-vfill,
body.theme-instagram .ai-progress-bar > div {
  background: linear-gradient(90deg,#f09433,#dc2743,#bc1888) !important;
}

/* SRS stage rows (word-row-card) — fix near-white titles + cyan/gold tints */
body.theme-instagram .word-row-card.stage-night .word-row-toggle strong,
body.theme-instagram .word-row-card.stage-summary-5-min .word-row-toggle strong,
body.theme-instagram .word-row-card.stage-one-hour .word-row-toggle strong,
body.theme-instagram .word-row-card.stage-day-1 .word-row-toggle strong,
body.theme-instagram .word-row-card.stage-day-3 .word-row-toggle strong,
body.theme-instagram .word-row-card.stage-day-7 .word-row-toggle strong,
body.theme-instagram .word-row-card.stage-day-30 .word-row-toggle strong { color: #262626 !important; }
body.theme-instagram .word-row-card[class*="stage-"] .word-row-meta em {
  background: rgba(0,149,246,.12) !important; border-color: rgba(0,149,246,.3) !important; color: #0095f6 !important;
}
body.theme-instagram .word-row-card.stage-king { background: rgba(221,42,123,.06) !important; border-color: rgba(221,42,123,.4) !important; }
body.theme-instagram .word-row-card.stage-king .word-row-toggle strong,
body.theme-instagram .word-row-card.stage-king .word-row-meta em {
  color: #c2185b !important; background: rgba(221,42,123,.12) !important; border-color: rgba(221,42,123,.4) !important;
}
body.theme-instagram .back-stage-btn { background: rgba(0,149,246,.1) !important; border-color: rgba(0,149,246,.35) !important; color: #0095f6 !important; }

/* Quiz options */
body.theme-instagram .quiz-option-btn { background: #ffffff !important; border: 1px solid #dbdbdb !important; color: #262626 !important; }
body.theme-instagram .quiz-option-btn:hover { background: #f7fbff !important; border-color: #0095f6 !important; }
body.theme-instagram .quiz-option-btn.option-correct { background: #2fb344 !important; border-color: #2fb344 !important; color: #ffffff !important; }
body.theme-instagram .quiz-option-btn.option-wrong { background: #ed4956 !important; border-color: #ed4956 !important; color: #ffffff !important; }
body.theme-instagram .spell-input { background: #fafafa !important; border: 1px solid #dbdbdb !important; color: #262626 !important; }
body.theme-instagram .spell-input:focus { outline: 2px solid #dd2a7b !important; outline-offset: 2px; }

/* Empty / placeholder states */
body.theme-instagram .empty,
body.theme-instagram .image-placeholder { background: #fafafa !important; border: 1px dashed #dbdbdb !important; color: #8e8e8e !important; }

/* Notices / insights / metrics */
body.theme-instagram .notice { background: #fafafa !important; border: 1px solid #dbdbdb !important; border-left: 4px solid #0095f6 !important; color: #262626 !important; }
body.theme-instagram .notice.error { background: #fff5f6 !important; border-left-color: #ed4956 !important; color: #c0283a !important; }
body.theme-instagram .insight,
body.theme-instagram .insights-list li,
body.theme-instagram .risk-card { background: #fafafa !important; border-left: 3px solid #0095f6 !important; color: #262626 !important; }
body.theme-instagram .metric-card,
body.theme-instagram .stat { background: #ffffff !important; border: 1px solid #dbdbdb !important; }
body.theme-instagram .metric-card strong,
body.theme-instagram .stat strong,
body.theme-instagram .chart-bar-label strong,
body.theme-instagram .funnel-label b,
body.theme-instagram .risk-card strong { color: #262626 !important; }

/* Toasts / badge cards / due banner */
body.theme-instagram .badge-toast { background: #ffffff !important; color: #262626 !important; border: 1px solid #dbdbdb !important; box-shadow: 0 8px 30px rgba(0,0,0,.15) !important; }
body.theme-instagram .badge-toast h4 { color: #dd2a7b !important; }
body.theme-instagram .badge-toast p { color: #8e8e8e !important; }
body.theme-instagram .badge-earned { background: linear-gradient(135deg,#fff7e6,#ffffff) !important; border-color: #f0d6a0 !important; }
body.theme-instagram .due-banner { background: linear-gradient(45deg,#f09433,#dc2743,#bc1888) !important; color: #ffffff !important; }
body.theme-instagram .due-banner .due-x { background: rgba(255,255,255,.25) !important; color: #ffffff !important; }

/* Modal / sheet */
body.theme-instagram .prompt-modal { background: rgba(0,0,0,.5) !important; }
body.theme-instagram .prompt-modal-card { background: #ffffff !important; border: 1px solid #dbdbdb !important; box-shadow: 0 12px 40px rgba(0,0,0,.18) !important; }

/* Review reels — light card so dark text is legible; light controls */
body.theme-instagram .reel { background: radial-gradient(120% 90% at 50% 0%, #ffffff 0%, #fafafa 60%) !important; }
body.theme-instagram .reel + .reel { border-top-color: #dbdbdb !important; }
body.theme-instagram .reel-tab { background: #ffffff !important; border: 1.5px solid #dbdbdb !important; color: #262626 !important; }
body.theme-instagram .reel-tab.on,
body.theme-instagram .reel-tab.active,
body.theme-instagram .reel-tab[aria-selected="true"] { border-color: #dd2a7b !important; color: #dd2a7b !important; background: rgba(221,42,123,.08) !important; }
body.theme-instagram .reel-say { background: #efefef !important; color: #262626 !important; }
body.theme-instagram .reel-reveal-btn { background: #ffffff !important; border: 1.5px dashed #dbdbdb !important; color: #262626 !important; }
body.theme-instagram .reel-trick { background: #fafafa !important; border: 1px solid #dbdbdb !important; }
body.theme-instagram .reel-pill { background: rgba(221,42,123,.1) !important; color: #c2185b !important; }

/* Games surfaces */
body.theme-instagram .hm-k,
body.theme-instagram .gm-opt,
body.theme-instagram .gm-mc,
body.theme-instagram .cw-cell,
body.theme-instagram .sh-sent,
body.theme-instagram .gm-built span,
body.theme-instagram .gm-actions button { background: #ffffff !important; border: 1.5px solid #dbdbdb !important; color: #262626 !important; }
body.theme-instagram .gm-input { background: #fafafa !important; border: 1.5px solid #dbdbdb !important; color: #262626 !important; }
body.theme-instagram .gm-input:focus,
body.theme-instagram .cw-cell:focus { outline: none; border-color: #dd2a7b !important; box-shadow: 0 0 0 3px rgba(221,42,123,.15) !important; }
body.theme-instagram .gm-opt:hover,
body.theme-instagram .hm-k:hover { border-color: #0095f6 !important; }
body.theme-instagram .cw-clue { background: #fafafa !important; color: #262626 !important; }

/* Daily challenge surfaces */
body.theme-instagram .dy-opt { background: #ffffff !important; border: 1.5px solid #dbdbdb !important; color: #262626 !important; }
body.theme-instagram .dy-opt:hover { border-color: #0095f6 !important; }
body.theme-instagram .dy-btn.skip { background: #fafafa !important; border: 1px solid #dbdbdb !important; color: #8e8e8e !important; }
body.theme-instagram .dy-dots i { background: #dbdbdb !important; }
body.theme-instagram .dy-dots i.on { background: #dd2a7b !important; }
body.theme-instagram .dy-dots i.done { background: #2fb344 !important; }
body.theme-instagram [data-w-in] { background: #fafafa !important; border: 1.5px solid #dbdbdb !important; color: #262626 !important; }

/* Heatmap contribution grid */
body.theme-instagram .heatmap-cell { background: #ebedf0 !important; }
body.theme-instagram .heatmap-cell.lvl-1 { background: rgba(47,179,68,.3) !important; }
body.theme-instagram .heatmap-cell.lvl-2 { background: rgba(47,179,68,.5) !important; }
body.theme-instagram .heatmap-cell.lvl-3 { background: rgba(47,179,68,.75) !important; }
body.theme-instagram .heatmap-cell.lvl-4 { background: #2fb344 !important; }

/* Chart strokes / gridlines */
body.theme-instagram .chart-line { stroke: #dd2a7b !important; filter: none !important; }
body.theme-instagram .chart-dot { fill: #dd2a7b !important; stroke: #ffffff !important; }
body.theme-instagram .chart-sparkline polyline { stroke: #dd2a7b !important; }
body.theme-instagram .chart-gridline { stroke: #efefef !important; }

/* Settings: cards / swatches / pills / account rows */
body.theme-instagram .settings-card { background: #ffffff !important; border: 1px solid #dbdbdb !important; }
body.theme-instagram .settings-card h2 { color: #262626 !important; }
body.theme-instagram .settings-card .desc { color: #8e8e8e !important; }
body.theme-instagram .pill-opt span { background: #ffffff !important; border: 1.5px solid #dbdbdb !important; color: #262626 !important; }
body.theme-instagram .pill-opt:has(input:checked) span { border-color: #dd2a7b !important; background: rgba(221,42,123,.10) !important; color: #c2185b !important; }
body.theme-instagram .swatch { background: #ffffff !important; border: 2px solid #dbdbdb !important; }
body.theme-instagram .swatch:has(input:checked) { border-color: #dd2a7b !important; box-shadow: 0 0 0 3px rgba(221,42,123,.22) !important; }
body.theme-instagram .account-row { border-bottom: 1px solid #efefef !important; }
body.theme-instagram .account-row a[href='logout.php'] { color: #ed4956 !important; }
body.theme-instagram .account-row a[href*='users.php'] { color: #0095f6 !important; }
body.theme-instagram .live-hint { color: #2fb344 !important; }

/* Scrollbar + text selection */
body.theme-instagram ::-webkit-scrollbar-track { background: transparent !important; }
body.theme-instagram ::-webkit-scrollbar-thumb { background: #c7c7c7 !important; }
body.theme-instagram ::-webkit-scrollbar-thumb:hover { background: #a8a8a8 !important; }
body.theme-instagram ::selection { background: rgba(0,149,246,.22) !important; color: #262626 !important; }

/* ===== 🟢👑 Home-page word-list: pipeline words GREEN, King GOLD (book-reader jaisा indicator) ===== */
/* is-transferred = non-not_started (5min→king); :not(.stage-king) = sirf 5min→30day pipeline */
.word-row-card.is-transferred:not(.stage-king) .gd-word-text { color: #2ea84a; }
.word-row-card.stage-king .gd-word-text { color: #e0a000; }
/* Instagram theme — rows match the ACTIVE top-tab: white text on IG gradient (user choice) */
body.theme-instagram .word-row-card.is-transferred .gd-word-text { color: #ffffff !important; text-shadow: 0 1px 2px rgba(0,0,0,.30); }

/* ===== 🟢👑 Word-row BOX bhi stage ke according color (font-color ke saath match) — insta-clean ===== */
/* General (all themes): green/gold LEFT-accent (inset shadow → koi layout shift nahi) */
.word-row-card.is-transferred:not(.stage-king) { box-shadow: inset 4px 0 0 #2ea84a; }
.word-row-card.stage-king { box-shadow: inset 4px 0 0 #e0a000; }
/* Instagram theme — stage rows = ACTIVE top-tab look: FULL IG gradient + white text (user choice).
   Pipeline + King dono gradient; King ko gold ring se "mastered" distinct rakha.
   (is-transferred = 5min→king; not_started/DIC words white rehte hain.) */
body.theme-instagram .word-row-card.is-transferred {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%) !important;
  border-color: transparent !important;
  box-shadow: 0 1px 3px rgba(0,0,0,.10) !important;
}
body.theme-instagram .word-row-card.stage-king {
  box-shadow: 0 0 0 2px #ffd166, 0 2px 7px rgba(0,0,0,.14) !important;   /* gold ring = King/mastered */
}
/* On the gradient: stage badge = white translucent pill; sound = white circle w/ magenta icon; no-image icon white */
body.theme-instagram .word-row-card.is-transferred .gd-stage-mini {
  color: #ffffff !important; background: rgba(255,255,255,.26) !important; border: 1px solid rgba(255,255,255,.55) !important;
}
body.theme-instagram .word-row-card.is-transferred .gd-sound-mini {
  background: #ffffff !important; color: #dd2a7b !important; border: none !important;
}
body.theme-instagram .word-row-card.is-transferred .gd-noimg { color: #ffffff !important; opacity: .9 !important; }

/* ===== 📱 Instagram bottom-nav: active tab = floating IG-gradient BUBBLE (user request) ===== */
/* bar/anchors ko overflow:visible do taaki bubble upar pop ho ke float kar sake (warna clip ho jata) */
body.theme-instagram .bottom-nav,
body.theme-instagram .bottom-nav a { overflow: visible !important; }
body.theme-instagram .bottom-nav b {
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), box-shadow .2s ease, background .2s ease !important;
}
/* Active icon = raised gradient bubble (lift + scale + soft magenta glow) */
body.theme-instagram .bottom-nav a.active b {
  background: linear-gradient(45deg,#f09433 0%,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%) !important;
  color: #ffffff !important;
  transform: translateY(-7px) scale(1.2) !important;
  box-shadow: 0 7px 16px rgba(221,42,123,.45), 0 2px 5px rgba(0,0,0,.14) !important;
}
/* Bubble top-bar indicator ki jagah le leta hai → purana ::before bar hide */
body.theme-instagram .bottom-nav a.active::before { display: none !important; }
/* Active label: magenta + bold */
body.theme-instagram .bottom-nav a.active { color: #dd2a7b !important; font-weight: 700 !important; }
