/* MeAndArabic: Red Sea turquoise, Vimto pink, Jeddah sunshine.
   Sticker-style bubbles: thick ink outlines, solid offset shadows, round everything. */

:root {
  --foam: #eef9f8;
  --paper: #ffffff;
  --ink: #1f2459;
  --ink-2: #4a4f86;
  --ink-3: #8a8fbd;
  --sea: #10b3a3;
  --sea-deep: #0a7e86;
  --sun: #ffc23d;
  --vimto: #e8336d;
  --lilac: #8b6cf6;
  --mint: #2fbf71;
  --good: #1fae64;
  --bad: #e8336d;

  --c: var(--sea);
  --c-deep: var(--sea-deep);
  --c-soft: #d7f5f1;

  --r-xl: 44px;
  --r-lg: 32px;
  --pop: 0 5px 0 var(--ink);
  --pop-sm: 0 3px 0 var(--ink);
  --border: 3px solid var(--ink);

  --ease: cubic-bezier(.22, 1, .36, 1);
  --f-display: 'Baloo Bhaijaan 2', 'Segoe UI', sans-serif;
  --f-body: 'Nunito', 'Segoe UI', sans-serif;

  --s-1: 0.8125rem;
  --s0: 1rem;
  --s1: 1.25rem;
  --s2: 1.5625rem;
  --s3: 1.953rem;
  --s4: 2.441rem;
  --s5: 3.052rem;
}

[data-color='sea'] { --c: #10b3a3; --c-deep: #0a7e86; --c-soft: #d7f5f1; }
[data-color='sun'] { --c: #ffb627; --c-deep: #b36b00; --c-soft: #fff0cc; }
[data-color='vimto'] { --c: #e8336d; --c-deep: #b0154b; --c-soft: #ffdce7; }
[data-color='lilac'] { --c: #8b6cf6; --c-deep: #5b3fcb; --c-soft: #ece6ff; }
[data-color='mint'] { --c: #2fbf71; --c-deep: #14874b; --c-soft: #d9f7e6; }
[data-color='sky'] { --c: #2e9bf0; --c-deep: #1565b0; --c-soft: #dceeff; }
[data-color='coral'] { --c: #ff7a45; --c-deep: #c2481a; --c-soft: #ffe6da; }
[data-color='olive'] { --c: #8db33a; --c-deep: #56751a; --c-soft: #eef6da; }
[data-color='plum'] { --c: #b0408a; --c-deep: #7a1f5c; --c-soft: #f6ddeb; }
[data-color='ink'] { --c: #3a3fa8; --c-deep: #1f2459; --c-soft: #e1e3fa; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 110px; }
body {
  margin: 0;
  background: var(--foam);
  color: var(--ink);
  font-family: var(--f-body);
  font-weight: 600;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, canvas { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; text-underline-offset: 0.2em; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--f-display); line-height: 1.08; margin: 0; font-weight: 800; letter-spacing: -0.01em; }
p { margin: 0; }
[hidden] { display: none !important; }

.ar { font-family: var(--f-display); direction: rtl; unicode-bidi: isolate; font-weight: 700; line-height: 1.35; }
.tr { color: var(--c-deep); font-weight: 800; }
.muted { color: var(--ink-2); }
.accent { color: var(--c-deep); }

:focus-visible { outline: 3px solid var(--vimto); outline-offset: 3px; border-radius: 12px; }

.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.center { justify-content: center; text-align: center; }

.skip-link { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 0.6rem 1rem; border-radius: 999px; }
.skip-link:focus { top: 12px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  border: var(--border); border-radius: 999px; padding: 0.7em 1.35em;
  background: var(--paper); box-shadow: var(--pop); cursor: pointer;
  font-family: var(--f-body); font-weight: 900; font-size: var(--s0); line-height: 1.2; text-align: center;
  text-decoration: none; transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease); white-space: nowrap;
}
@media (hover: hover) { .btn:hover { transform: translateY(-1px); box-shadow: 0 6px 0 var(--ink); } }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--c); color: #fff; }
.btn-sun { background: var(--sun); color: var(--ink); }
.btn-lg { font-size: var(--s1); padding: 0.75em 1.5em; }
.btn-sm { font-size: var(--s-1); padding: 0.5em 0.95em; box-shadow: var(--pop-sm); }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; border: var(--border); background: var(--paper);
  box-shadow: var(--pop-sm); display: inline-grid; place-items: center; cursor: pointer; flex: none;
  font-size: 18px; transition: transform 0.12s var(--ease); padding: 0;
}
.icon-btn:active { transform: translateY(3px); box-shadow: none; }
.icon-btn.big { width: 64px; height: 64px; font-size: 26px; }
.icon-btn.play { background: var(--c); color: #fff; }
.icon-btn svg { width: 52%; height: 52%; }
.ico { width: 1.2em; height: 1.2em; flex: none; display: block; }
.speed { font-family: var(--f-body); font-weight: 900; font-size: 13px; letter-spacing: -0.02em; line-height: 1; }
.icon-btn.big .speed { font-size: 17px; }
.line-play { display: inline-grid; place-items: center; padding: 0; }
.line-play .ico { width: 17px; height: 17px; }
.pulse { animation: pulse 0.5s; }
@keyframes pulse { 40% { transform: scale(1.18); } }

/* ---------- Header / nav ---------- */
.site-header { position: sticky; top: 0; z-index: 40; padding: 14px 16px 0; }
.nav-shell {
  position: relative; max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 0.75rem;
  background: var(--paper); border: var(--border); border-radius: 999px; box-shadow: var(--pop);
  padding: 8px 10px 8px 14px; transition: box-shadow 0.2s, transform 0.2s;
}
.site-header.scrolled .nav-shell { box-shadow: 0 7px 0 var(--ink), 0 14px 30px rgba(31, 36, 89, 0.12); }
.logo { display: flex; align-items: center; gap: 0.55rem; text-decoration: none; flex: none; }
.logo-mark { width: 44px; height: 44px; transition: transform 0.3s cubic-bezier(.2, 1.6, .4, 1); }
@media (hover: hover) { .logo:hover .logo-mark { transform: rotate(-12deg) scale(1.08); } }
.logo-word { font-family: var(--f-display); font-weight: 800; font-size: 1.4rem; line-height: 1; }
.logo-word small { display: block; font-size: 0.85rem; color: var(--sea-deep); font-weight: 700; margin-top: 2px; }
.logo-and { color: var(--sea-deep); }
.logo-light .logo-and { color: var(--sun); }

.nav { display: flex; gap: 0.2rem; margin: 0 auto; }
.nav a {
  display: inline-flex; align-items: center; gap: 0.4rem; text-decoration: none; font-family: var(--f-body);
  font-weight: 800; padding: 0.5rem 0.75rem; border-radius: 999px; white-space: nowrap; transition: background 0.15s;
}
.nav-emo { font-size: 1.1rem; transition: transform 0.25s cubic-bezier(.2, 1.6, .4, 1); }
@media (hover: hover) { .nav a:hover { background: var(--c-soft); } }
@media (hover: hover) { .nav a:hover .nav-emo { transform: rotate(-14deg) scale(1.2); } }
.nav a[aria-current='page'] { background: var(--ink); color: #fff; }

.nav-right { display: flex; align-items: center; gap: 0.55rem; flex: none; }
.nav-stat {
  display: inline-flex; align-items: center; gap: 0.3rem; text-decoration: none; background: var(--sun);
  border: 2px solid var(--ink); border-radius: 999px; padding: 0.25rem 0.75rem; font-weight: 900;
}
.nav-stat.bump { animation: pulse 0.5s; }
.sfx-btn { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--ink); background: #fff; cursor: pointer; display: grid; place-items: center; font-size: 1.05rem; padding: 0; transition: transform 0.25s var(--ease); }
@media (hover: hover) { .sfx-btn:hover { transform: rotate(-12deg); } }
.sfx-btn .sfx-off, .sfx-btn[aria-pressed='false'] .sfx-on { display: none; }
.sfx-btn[aria-pressed='false'] .sfx-off { display: inline; }
.menu-btn { display: none; width: 46px; height: 46px; border-radius: 50%; border: var(--border); background: var(--sun); cursor: pointer; padding: 0; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.menu-btn span { display: block; width: 18px; height: 3px; border-radius: 3px; background: var(--ink); transition: transform 0.2s, opacity 0.2s; }
.menu-open .menu-btn span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-open .menu-btn span:nth-child(2) { opacity: 0; }
.menu-open .menu-btn span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 1180px) {
  .menu-btn { display: inline-flex; }
  .nav {
    display: none; position: absolute; top: calc(100% + 12px); left: 0; right: 0; flex-direction: column; gap: 0.5rem;
    background: var(--paper); border: var(--border); border-radius: 32px; box-shadow: var(--pop); padding: 0.8rem;
  }
  .menu-open .nav { display: flex; animation: pop 0.25s cubic-bezier(.2, 1.4, .4, 1); }
  .nav a { font-size: 1.2rem; padding: 0.8rem 1rem; background: var(--foam); }
  .nav-right { margin-left: auto; }
}
@media (max-width: 520px) {
  .site-header { padding: 10px 10px 0; }
  .nav-cta { display: none; }
  .logo-word { font-size: 1.2rem; }
}

/* ---------- Footer ---------- */
.site-footer { margin-top: 7rem; color: #dfe2ff; }
.footer-wave { width: 100%; height: 90px; display: block; margin-bottom: -1px; }
.footer-body { background: var(--ink); padding: 2.5rem 0 1.5rem; }
.footer-grid { width: min(1160px, 100% - 32px); margin: 0 auto; display: grid; grid-template-columns: 1.3fr 1.2fr 0.9fr 1.1fr 1.2fr; gap: 2rem; }
.site-footer h4 { color: #fff; font-size: var(--s1); margin-bottom: 0.9rem; }
.logo-light .logo-word { color: #fff; }
.logo-light .logo-word small { color: var(--sun); }
.footer-brand p { margin-top: 1rem; max-width: 34ch; }
.socials { display: flex; gap: 0.6rem; margin-top: 1.2rem; }
.socials a { width: 44px; height: 44px; border-radius: 50%; background: #fff; color: var(--ink); display: grid; place-items: center; border: 2px solid var(--sun); transition: transform 0.25s var(--ease); }
@media (hover: hover) { .socials a:hover { transform: translateY(-3px) rotate(-8deg); } }
.socials svg { width: 22px; height: 22px; }
.footer-col { display: flex; flex-direction: column; gap: 0.15rem; }
.footer-levels { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1rem; align-content: start; }
.footer-levels h4 { grid-column: 1 / -1; }
.footer-col a { display: flex; align-items: center; gap: 0.55rem; color: #dfe2ff; text-decoration: none; padding: 0.3rem 0; transition: color 0.15s, transform 0.15s; }
@media (hover: hover) { .footer-col a:hover { color: #fff; transform: translateX(4px); } }
.footer-col .ar { color: var(--ink-3); font-size: 0.95rem; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); border: 2px solid #fff; flex: none; }
.wotd-card {
  width: 100%; display: flex; align-items: center; gap: 0.9rem; background: #fff; color: var(--ink); border: 3px solid var(--sun);
  border-radius: 28px 28px 28px 8px; padding: 0.9rem 1rem; cursor: pointer; text-align: left; box-shadow: 0 5px 0 var(--sun); transition: transform 0.25s var(--ease);
}
@media (hover: hover) { .wotd-card:hover { transform: translateY(-2px) rotate(-1deg); } }
.wotd-card .emo { font-size: 2.6rem; }
.wotd-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.wotd-text .ar { font-size: var(--s2); line-height: 1.2; text-align: left; }
.wotd-text .en { font-size: var(--s-1); color: var(--ink-2); }
.wotd-link { display: inline-block; margin-top: 0.9rem; color: var(--sun); font-weight: 800; }
.footer-bottom { width: min(1160px, 100% - 32px); margin: 2.5rem auto 0; padding-top: 1.2rem; border-top: 2px dashed rgba(223, 226, 255, 0.25); display: flex; align-items: center; justify-content: space-between; gap: 1rem; font-size: 0.92rem; }
.to-top { width: 48px; height: 48px; border-radius: 50%; border: 3px solid #fff; background: var(--sun); color: var(--ink); font-size: 1.3rem; font-weight: 900; cursor: pointer; transition: transform 0.25s var(--ease); }
@media (hover: hover) { .to-top:hover { transform: translateY(-4px); } }
@media (max-width: 1100px) { .footer-grid { grid-template-columns: 1fr 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand, .wotd { grid-column: 1 / -1; } }

@media (max-width: 560px) { .footer-wave { height: 50px; } }

/* ---------- Page heading ---------- */
.page-head { padding: 3rem 0 2rem; }
.page-head h1 { font-size: clamp(2.2rem, 5vw, var(--s5)); }
.page-head > p { margin-top: 0.6rem; max-width: 60ch; color: var(--ink-2); font-size: var(--s1); }
.title-with-ar { margin-top: 0.6rem; }
.crumbs { display: flex; flex-wrap: wrap; gap: 0.4rem; font-size: var(--s-1); font-weight: 800; margin-bottom: 1rem; }
.crumbs a { text-decoration: none; color: var(--ink-2); }
@media (hover: hover) { .crumbs a:hover { color: var(--c-deep, var(--ink)); } }
.crumbs span { color: var(--ink-3); }

/* ---------- Hero ---------- */
.hero { padding: 3rem 0 3rem; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 3rem; align-items: center; }
.hero-hello { display: inline-flex; gap: 0.5rem; align-items: center; background: #fff; border: 2px solid var(--ink); border-radius: 999px; padding: 0.2rem 0.9rem 0.2rem 0.6rem; font-weight: 800; margin-bottom: 1.2rem; }
.hero-hello .ar { background: var(--sun); border-radius: 999px; padding: 0 0.6rem; }
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); }
.hero-lede { font-size: var(--s1); color: var(--ink-2); margin: 1.2rem 0 2rem; max-width: 36ch; }
.cities { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; margin: -0.8rem 0 1.8rem; }
.cities-label { font-weight: 800; color: var(--ink-2); margin-right: 0.2rem; }
.city { display: inline-flex; align-items: center; gap: 0.35rem; background: #fff; border: 2px solid var(--ink); border-radius: 999px; padding: 0.1rem 0.7rem; font-weight: 800; font-size: 0.9rem; }
.city .ar { color: var(--sea-deep); font-size: 0.95rem; }
.hero-proof { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; list-style: none; padding: 0; margin: 2rem 0 0; color: var(--ink-2); }
.hero-proof b { color: var(--ink); font-family: var(--f-display); font-size: var(--s1); }

.hero-stage { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3rem; padding-top: 1rem; }
.hero-bubble {
  position: relative; width: min(420px, 100%); min-height: 400px; background: var(--paper); border: 4px solid var(--ink);
  border-radius: 56px; box-shadow: 0 10px 0 var(--ink); padding: 2rem 1.8rem 1.6rem; text-align: center;
  cursor: pointer; transition: transform 0.25s var(--ease); display: flex; flex-direction: column; justify-content: center;
}
@media (hover: hover) { .hero-bubble:hover { transform: rotate(-1.5deg) scale(1.01); } }
.hero-bubble.boing { animation: boing 0.5s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes boing { 30% { transform: scale(0.95, 1.05); } 60% { transform: scale(1.04, 0.97); } }
.hero-bubble::after {
  content: ''; position: absolute; bottom: -24px; right: 72px; width: 44px; height: 44px;
  background: var(--paper); border-right: 4px solid var(--ink); border-bottom: 4px solid var(--ink);
  border-bottom-right-radius: 12px; transform: rotate(45deg);
}
.hero-word > span { display: flex; flex-direction: column; align-items: center; }
.hero-emoji { font-size: 5rem; line-height: 1.1; }
.hero-ar { font-size: clamp(3.6rem, 8vw, 5.8rem); line-height: 1.2; margin-top: 0.3rem; }
.hero-tr { display: inline-block; background: var(--sun); border: var(--border); border-radius: 999px; padding: 0.15em 0.9em; font-weight: 900; font-size: var(--s1); }
.hero-en { margin-top: 0.5rem; font-family: var(--f-display); font-size: var(--s2); font-weight: 700; }
.hero-hint { margin-top: 0.8rem; font-size: var(--s-1); color: var(--ink-3); }
.swap-in { animation: swapIn 0.4s ease-out; }
.swap-in .pic { animation: emojiDrop 0.55s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes swapIn { from { opacity: 0; transform: translateY(10px); } }
@keyframes emojiDrop { from { transform: translateY(-14px) scale(0.8); } }

.hero-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; max-width: 460px; }
.hero-chip {
  display: inline-flex; align-items: center; gap: 0.35rem; border: var(--border); border-radius: 999px; background: #fff;
  padding: 0.25rem 0.85rem; cursor: pointer; box-shadow: var(--pop-sm); font-size: 1.05rem; transition: transform 0.25s var(--ease), background 0.2s;
}
@media (hover: hover) { .hero-chip:hover { transform: translateY(-3px); } }
.hero-chip[aria-pressed='true'] { background: var(--sun); }
.hero-chip .ar { font-size: 1.15rem; }

.blob { position: absolute; border-radius: 50%; border: 3px solid var(--ink); z-index: -1; }
.blob.a { width: 130px; height: 130px; background: var(--vimto); top: 0; left: 4%; }
.blob.b { width: 80px; height: 80px; background: var(--sun); top: 260px; left: 0; }
.blob.c { width: 170px; height: 170px; background: var(--lilac); top: 30px; right: -20px; }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .blob.c { right: -60px; }
}

/* ---------- Sections ---------- */
.section { padding: 4.5rem 0 1rem; }
.section-head { display: flex; flex-wrap: wrap; gap: 1.2rem; align-items: end; justify-content: space-between; margin-bottom: 2rem; }
.section-head h2 { font-size: clamp(1.9rem, 4vw, var(--s4)); max-width: 22ch; }
.section-head p { color: var(--ink-2); max-width: 54ch; margin-top: 0.5rem; }
.panel { background: var(--paper); border: var(--border); border-radius: var(--r-lg); box-shadow: var(--pop); padding: 1.6rem; }
.next-panel { margin-top: 3rem; display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; }
.next-panel h3 { font-size: var(--s2); }

/* dialect switch */
.dialect-switch { position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; background: #fff; border: var(--border); border-radius: 999px; padding: 5px; box-shadow: var(--pop); }
.dialect-switch button { position: relative; z-index: 1; border: 0; background: none; padding: 0.6rem 1.4rem; font-family: var(--f-body); font-weight: 900; font-size: var(--s1); line-height: 1.2; cursor: pointer; border-radius: 999px; transition: color 0.25s; }
.dialect-switch button[aria-checked='true'] { color: #fff; }
.switch-knob { position: absolute; top: 5px; bottom: 5px; left: 5px; width: calc(50% - 5px); border-radius: 999px; background: var(--vimto); transition: transform 0.35s cubic-bezier(.2, 1.4, .4, 1), background 0.3s; }
.dialect-switch .switch-knob { background: var(--najdi, #14874b); }
.dialect-switch[data-mode='hijazi'] .switch-knob { transform: translateX(100%); background: var(--hijazi, #1565b0); }

/* flip cards */
.flip-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1rem; }
@media (max-width: 1000px) { .flip-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .flip-grid { grid-template-columns: repeat(2, 1fr); } }
.flip { border: 0; background: none; padding: 0; cursor: pointer; perspective: 900px; height: 175px; }
.flip-inner { position: relative; display: block; width: 100%; height: 100%; transition: transform 0.5s var(--ease) var(--d, 0ms); transform-style: preserve-3d; }
.flip-grid[data-mode='hijazi'] .flip-inner { transform: rotateY(180deg); }
.flip-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border: var(--border); border-radius: 30px;
  box-shadow: var(--pop); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.1rem; padding: 0.8rem;
}
/* front: Riyadh (Najdi), back: Jeddah (Hijazi) */
.face-najdi { background: var(--najdi-soft, #d9f7e6); }
.face-hijazi { background: var(--hijazi-soft, #dceeff); transform: rotateY(180deg); }
.flip-en { font-weight: 800; color: var(--ink-2); font-size: var(--s-1); }
.flip-face .ar { font-size: 2.3rem; line-height: 1.3; }
.flip-face .tr { color: var(--ink); }
.flip-tag { margin-top: 0.3rem; font-size: 0.72rem; font-weight: 900; border: 2px solid var(--ink); border-radius: 999px; padding: 0 0.55rem; background: #fff; }
.face-najdi .flip-tag { color: var(--najdi, #14874b); }
.face-hijazi .flip-tag { color: var(--hijazi, #1565b0); }
@media (hover: hover) { .flip:hover .flip-face { filter: brightness(1.03); } }

/* mini lesson */
.try-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 3rem; align-items: center; }
.try-copy h2 { font-size: clamp(1.9rem, 4vw, var(--s4)); }
.try-copy p { color: var(--ink-2); margin-top: 0.8rem; font-size: var(--s1); }
.ticks { list-style: none; padding: 0; margin: 1.6rem 0 0; display: grid; gap: 0.6rem; }
.ticks li { display: flex; gap: 0.6rem; align-items: center; font-weight: 800; }
.ticks li::before { content: '✓'; width: 28px; height: 28px; border-radius: 50%; background: var(--mint); color: #fff; border: 2px solid var(--ink); display: grid; place-items: center; font-size: 0.85rem; flex: none; }
.try-box .q-card { padding: 1.6rem 1.4rem; }
.try-box .q-emoji { font-size: 5rem; }
.try-result h3 { font-size: var(--s3); margin-top: 0.4rem; }
.try-result p { margin: 0.5rem 0 1.4rem; }
@media (max-width: 860px) { .try-grid { grid-template-columns: 1fr; } }

/* tiktok demo */
.tiktok-section .section-head { margin-bottom: 1.2rem; }
.word-chips { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 2rem; }
.word-chip { border: var(--border); border-radius: 999px; background: #fff; padding: 0.4rem 1rem; cursor: pointer; font-weight: 800; box-shadow: var(--pop-sm); transition: transform 0.25s var(--ease); }
@media (hover: hover) { .word-chip:hover { transform: translateY(-2px); } }
.word-chip[aria-pressed='true'] { background: var(--ink); color: #fff; }

.cta-bubble {
  position: relative; text-align: center; background: var(--sea); color: #fff; border: 4px solid var(--ink); border-radius: 60px;
  box-shadow: 0 10px 0 var(--ink); padding: 3.5rem 1.5rem; overflow: hidden;
}
.cta-bubble::before, .cta-bubble::after { content: ''; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, 0.14); }
.cta-bubble::before { width: 260px; height: 260px; left: -60px; top: -90px; }
.cta-bubble::after { width: 180px; height: 180px; right: -40px; bottom: -70px; }
.cta-bubble .ar { font-size: clamp(2.6rem, 7vw, 4rem); color: var(--sun); line-height: 1.2; }
.cta-bubble h2 { font-size: clamp(1.7rem, 4vw, var(--s4)); margin: 0.4rem auto 1.8rem; max-width: 20ch; }

/* ---------- Level path ---------- */
.path { position: relative; display: grid; gap: 1.2rem; padding: 1rem 0; list-style: none; margin: 0; }
.path::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; border-left: 5px dashed var(--ink-3); transform: translateX(-50%); }
.stop { position: relative; display: grid; grid-template-columns: 1fr 96px 1fr; align-items: center; gap: 1.2rem; }
.stop-num {
  grid-column: 2; width: 96px; height: 96px; border-radius: 50%; background: var(--c); border: 4px solid var(--ink);
  box-shadow: var(--pop); display: grid; place-items: center; color: #fff; font-family: var(--f-display); font-weight: 800; font-size: 2.6rem; z-index: 1;
}
.stop-card { min-width: 0; overflow-wrap: anywhere; display: block; text-decoration: none; background: var(--paper); border: var(--border); border-radius: var(--r-lg); box-shadow: var(--pop); padding: 1.3rem 1.5rem; transition: transform 0.25s var(--ease); }
@media (hover: hover) { .stop-card:hover { transform: translateY(-3px) rotate(-0.5deg); } }
.stop:nth-child(odd) .stop-card { grid-column: 1; grid-row: 1; border-bottom-right-radius: 8px; }
.stop:nth-child(even) .stop-card { grid-column: 3; grid-row: 1; border-bottom-left-radius: 8px; }
.stop-top { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.stop-card h3 { font-size: var(--s3); }
.stop-card .ar { font-size: var(--s3); color: var(--c-deep); }
.chip { display: inline-block; font-size: var(--s-1); font-weight: 900; padding: 0.15em 0.75em; border-radius: 999px; background: var(--c-soft); color: var(--c-deep); border: 2px solid currentColor; }
.stop-card p { color: var(--ink-2); margin-top: 0.3rem; }
@media (max-width: 760px) {
  .path::before { left: 34px; }
  .stop { grid-template-columns: 68px minmax(0, 1fr); }
  .stop-num { grid-column: 1; width: 68px; height: 68px; font-size: 1.9rem; }
  .stop:nth-child(odd) .stop-card, .stop:nth-child(even) .stop-card { grid-column: 2; }
}

/* progress */
.bar { height: 14px; background: #fff; border: 3px solid var(--ink); border-radius: 999px; overflow: hidden; margin-top: 0.8rem; }
.bar > i { display: block; height: 100%; background: var(--c); border-radius: 999px; transition: width 0.4s; }
.bar-label { display: flex; justify-content: space-between; font-size: var(--s-1); font-weight: 800; color: var(--ink-2); margin-top: 0.35rem; }
.lesson-progress { max-width: 420px; margin-top: 1.2rem; }

/* ---------- Lessons ---------- */
.lesson-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.4rem; }
.lesson-card { display: flex; flex-direction: column; gap: 0.5rem; text-decoration: none; background: var(--paper); border: var(--border); border-radius: var(--r-lg); box-shadow: var(--pop); padding: 1.4rem; transition: transform 0.25s var(--ease); }
@media (hover: hover) { .lesson-card:hover { transform: translateY(-3px); } }
.lesson-card .emo { font-size: 2.6rem; width: 72px; height: 72px; display: grid; place-items: center; background: var(--c-soft); border-radius: 50%; border: 3px solid var(--ink); }
.lesson-card h3 { font-size: var(--s2); }
.lesson-card .ar { color: var(--c-deep); font-size: var(--s1); }
.level-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.4rem; align-items: center; }

/* ---------- Word bubbles ---------- */
.word-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1.4rem; }
.word {
  position: relative; text-align: center; background: var(--paper); border: var(--border); border-radius: 36px 36px 36px 10px;
  box-shadow: var(--pop); padding: 1.3rem 1rem 1.1rem; cursor: pointer; transition: transform 0.25s var(--ease); display: flex; flex-direction: column; align-items: center; gap: 0.25rem;
}
.word:nth-child(even) { border-radius: 36px 36px 10px 36px; }
@media (hover: hover) { .word:hover { transform: translateY(-3px); } }
.word.speaking { background: var(--c-soft); box-shadow: 0 5px 0 var(--ink), 0 0 0 5px var(--c); }
.word .emo { font-size: 3.2rem; line-height: 1.15; }
.word .ar { font-size: 2rem; line-height: 1.3; }
.word .en { font-size: var(--s-1); color: var(--ink-2); font-weight: 700; }
.word .icon-btn { position: absolute; top: 10px; right: 10px; width: 38px; height: 38px; }
.learned-badge { position: absolute; top: 10px; left: 10px; background: var(--good); color: #fff; border: 2px solid var(--ink); border-radius: 999px; font-size: 0.72rem; font-weight: 900; padding: 0.1em 0.6em; }

.toolbar { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-bottom: 1.6rem; }
.intro-bubble { background: var(--c-soft); border: var(--border); border-radius: 28px 28px 28px 6px; padding: 1rem 1.3rem; max-width: 70ch; margin-top: 1rem; font-weight: 700; color: var(--ink) !important; font-size: var(--s0) !important; }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(31, 36, 89, 0.55); display: grid; place-items: center; padding: 16px; overflow-y: auto; animation: fade 0.15s; }
@keyframes fade { from { opacity: 0; } }
.modal-backdrop.closing { animation: fadeOut 0.18s forwards; }
.modal-backdrop.closing .modal { animation: popOut 0.18s forwards; }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes popOut { to { transform: scale(0.94); opacity: 0; } }
.modal {
  position: relative; width: min(880px, 100%); background: var(--foam); border: 4px solid var(--ink); border-radius: var(--r-xl);
  box-shadow: 0 10px 0 var(--ink); padding: 1.6rem; animation: pop 0.25s cubic-bezier(.2, 1.4, .4, 1); max-height: calc(100vh - 32px); overflow-y: auto;
}
.modal:focus { outline: none; }
@keyframes pop { from { transform: scale(0.92); opacity: 0; } }
.modal-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.tabs { display: inline-flex; background: #fff; border: var(--border); border-radius: 999px; padding: 4px; gap: 4px; }
.tabs button { border: 0; background: transparent; border-radius: 999px; padding: 0.5rem 1rem; font-family: var(--f-body); font-weight: 900; line-height: 1.2; cursor: pointer; }
.tabs button[aria-selected='true'] { background: var(--ink); color: #fff; }

.learn-view { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
.word-hero { background: var(--paper); border: var(--border); border-radius: 40px; box-shadow: var(--pop); padding: 1.6rem; text-align: center; }
.word-hero .emo { font-size: 6rem; line-height: 1.1; }
.word-hero > .ar { display: block; font-size: clamp(2.6rem, 7vw, 4.2rem); }
.word-hero .tr { display: inline-block; background: var(--sun); color: var(--ink); border: var(--border); border-radius: 999px; padding: 0.15em 0.9em; font-size: var(--s1); }
.word-hero .en { font-family: var(--f-display); font-size: var(--s2); margin-top: 0.4rem; font-weight: 700; }
.play-row { display: flex; justify-content: center; gap: 0.8rem; margin-top: 1rem; }
.info-col > * + * { margin-top: 1rem; }
.info-block { background: #fff; border: var(--border); border-radius: 24px; padding: 1rem 1.2rem; }
.info-block h4 { font-size: var(--s0); color: var(--ink-2); margin-bottom: 0.4rem; }
.tips { display: grid; gap: 0.45rem; padding: 0; margin: 0; list-style: none; }
.tips li { display: flex; gap: 0.7rem; align-items: center; font-size: 0.95rem; }
.tips .letter { flex: none; width: 46px; height: 46px; border-radius: 14px; background: var(--c-soft); border: 2px solid var(--ink); display: grid; place-items: center; font-size: 1.5rem; }
.ex-row { display: flex; gap: 0.8rem; align-items: center; justify-content: space-between; }
.example .ar { font-size: var(--s2); }
.voice-note { font-size: var(--s-1); color: var(--ink-2); }
.check { display: flex; align-items: center; gap: 0.6rem; font-weight: 800; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--ink); }
.modal-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 1.4rem; gap: 1rem; }
@media (max-width: 760px) { .learn-view { grid-template-columns: 1fr; } .modal { padding: 1.1rem; } }

/* share studio */
.studio { display: grid; grid-template-columns: 300px 1fr; gap: 1.6rem; align-items: start; }
.studio-preview { position: relative; background: var(--ink); border: var(--border); border-radius: 36px; padding: 12px; box-shadow: 0 6px 0 var(--vimto); }
.phone-notch { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: 70px; height: 10px; border-radius: 999px; background: rgba(0, 0, 0, 0.35); z-index: 1; }
.studio-canvas canvas { width: 100%; height: auto; border-radius: 26px; }
.studio-canvas:empty { aspect-ratio: 9 / 16; border-radius: 26px; background: #2b3170; }
.studio-controls > * + * { margin-top: 1.2rem; }
.studio-controls h4 { font-size: var(--s0); margin-bottom: 0.5rem; }
.seg { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.seg button { border: var(--border); background: #fff; border-radius: 999px; padding: 0.45rem 0.95rem; font-weight: 800; line-height: 1.2; cursor: pointer; }
.seg button[aria-pressed='true'] { background: var(--ink); color: #fff; }
.seg .swatch { width: 52px; height: 52px; border-radius: 50%; padding: 0; }
.seg .swatch[aria-pressed='true'] { outline: 4px solid var(--vimto); outline-offset: 3px; }
.tiktok-studio .studio { grid-template-columns: 320px 1fr; background: #fff; border: var(--border); border-radius: 40px; box-shadow: var(--pop); padding: 1.6rem; }
@media (max-width: 760px) {
  .studio, .tiktok-studio .studio { grid-template-columns: 1fr; }
  .studio-preview { max-width: 280px; margin-inline: auto; width: 100%; }
}

/* ---------- Quiz ---------- */
.quiz { max-width: 760px; margin-inline: auto; }
.quiz-page { padding-top: 2.5rem; }
.quiz-top { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.4rem; }
.quiz-bar { flex: 1; }
.quiz-bar .bar { margin: 0; }
.quiz-dots { display: flex; justify-content: center; gap: 0.5rem; margin-bottom: 1rem; }
.quiz-dots span { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink); background: #fff; }
.quiz-dots .done { background: var(--c); }
.quiz-dots .now { background: var(--sun); transform: scale(1.25); }
.q-card { background: var(--paper); border: 4px solid var(--ink); border-radius: var(--r-xl); box-shadow: 0 8px 0 var(--ink); padding: 2rem 1.6rem; text-align: center; }
.q-kind { font-weight: 900; color: var(--c-deep); font-size: var(--s-1); }
.q-prompt { font-family: var(--f-display); font-size: var(--s3); font-weight: 800; margin: 0.4rem 0 0.2rem; }
.q-prompt .big { font-size: var(--s5); }
.q-emoji { font-size: 6rem; line-height: 1.1; }
.q-listen { margin: 1rem auto; }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; margin-top: 1.6rem; }
.option { border: var(--border); border-radius: 26px; background: #fff; box-shadow: var(--pop-sm); padding: 0.9rem; cursor: pointer; font-weight: 800; font-size: var(--s0); min-height: 72px; transition: transform 0.12s var(--ease); }
.option .ar { font-size: var(--s2); }
@media (hover: hover) { .option:hover:not([disabled]) { background: var(--c-soft); transform: translateY(-2px); } }
.option:active:not([disabled]) { transform: translateY(2px); box-shadow: none; }
.option.correct { animation: rightPop 0.4s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes rightPop { 40% { transform: scale(1.06); } }
.option.correct { background: var(--good); color: #fff; }
.option.wrong { background: var(--bad); color: #fff; animation: shake 0.3s; }
.option[disabled] { cursor: default; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@media (max-width: 560px) { .options { grid-template-columns: 1fr; } }

.tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; direction: rtl; }
.answer-row { min-height: 78px; border: 3px dashed var(--ink-3); border-radius: 26px; padding: 0.7rem; margin: 1.4rem 0 1rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; direction: rtl; align-items: center; }
.answer-row .hint { direction: ltr; }
.tile { border: var(--border); border-radius: 18px; background: var(--sun); box-shadow: var(--pop-sm); padding: 0.3rem 0.9rem; cursor: pointer; font-family: var(--f-display); font-size: var(--s2); font-weight: 700; }
.tile.used { visibility: hidden; }
.check-row { margin-top: 1.4rem; }
.feedback { margin-top: 1.2rem; font-weight: 800; border-radius: 22px; padding: 0.9rem 1.1rem; border: var(--border); text-align: left; display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.feedback.good { background: #d9f7e6; }
.feedback.bad { background: #ffdce7; }

.intro-card { max-width: 680px; margin: 0 auto; }
.intro-card h1 { font-size: var(--s4); margin-top: 0.5rem; }
.intro-card > p { margin: 0.8rem auto 0; max-width: 46ch; }
.intro-card .best { font-weight: 900; }
.intro-card .btn-row { margin-top: 1.6rem; }
.intro-card .voice-note { margin-top: 1.2rem; }
.result h1 { font-size: var(--s4); }
.result .btn-row { margin-top: 1.4rem; }
.ring { width: 190px; height: 190px; margin: 0 auto 1rem; }
.ring text { font-family: var(--f-display); font-weight: 800; }
.mistakes { text-align: left; margin-top: 1.6rem; display: grid; gap: 0.6rem; }
.mistake { display: flex; align-items: center; gap: 0.8rem; background: #fff; border: 2px solid var(--ink); border-radius: 18px; padding: 0.55rem 0.9rem; }
.mistake .emo { font-size: 1.6rem; }
.mistake .ar { font-size: var(--s1); margin-left: auto; }

.cert-panel { margin-top: 2rem; text-align: center; }
.cert-panel h2 { font-size: var(--s3); }
.cert-panel .input { margin-top: 1rem; }
.cert-preview { border: var(--border); border-radius: 20px; overflow: hidden; margin: 1.2rem auto; max-width: 560px; box-shadow: var(--pop); }
.cert-preview canvas { width: 100%; height: auto; }
.input { width: 100%; max-width: 360px; border: var(--border); border-radius: 999px; padding: 0.7rem 1.1rem; font: inherit; font-weight: 800; background: #fff; }

/* ---------- Exams ---------- */
.exam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.4rem; }
.exam-card { background: #fff; border: var(--border); border-radius: var(--r-lg); box-shadow: var(--pop); padding: 1.4rem; display: flex; flex-direction: column; gap: 0.6rem; align-items: flex-start; }
.exam-card h3 { font-size: var(--s2); }
.exam-card .btn { margin-top: auto; }
.score-pill { font-weight: 900; font-size: var(--s-1); padding: 0.15em 0.7em; border-radius: 999px; border: 2px solid var(--ink); }
.score-pill.pass { background: #d9f7e6; }
.score-pill.fail { background: #ffdce7; }
.exam-card.final { background: var(--ink); color: #fff; grid-column: 1 / -1; }
.exam-card.final p { color: #dfe2ff; }
.exam-card.final .ar { color: var(--sun); }

/* ---------- Dictionary ---------- */
.search { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; margin-bottom: 1rem; padding-bottom: 6px; }
.search .input { max-width: 420px; }
.result-count { margin-bottom: 1.2rem; font-weight: 800; }
.empty { text-align: center; padding: 3rem 1rem; grid-column: 1 / -1; }
.empty .big { font-size: 4rem; }
.not-found { padding-top: 5rem; }
.not-found h1 { font-size: var(--s4); }
.not-found p { margin: 0.8rem 0 1.6rem; }

/* ---------- Sounds ---------- */
.key-section { margin-bottom: 3rem; }
.key-section h2 { font-size: var(--s3); margin-bottom: 1rem; }
.letters { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.2rem; }
.letter-card { background: #fff; border: var(--border); border-radius: 30px; box-shadow: var(--pop-sm); padding: 1.1rem 1.2rem; display: grid; grid-template-columns: auto 1fr; gap: 0.2rem 1rem; align-items: center; cursor: pointer; text-align: left; transition: transform 0.25s var(--ease); }
@media (hover: hover) { .letter-card:hover { transform: translateY(-3px); } }
.letter-card.hijazi { background: #fff6dc; }
.letter-card .glyph { grid-row: span 2; width: 74px; height: 74px; border-radius: 22px; background: var(--c-soft); border: 3px solid var(--ink); display: grid; place-items: center; font-family: var(--f-display); font-size: 2.6rem; font-weight: 700; line-height: 1; padding-top: 8px; }
.letter-card .name { font-family: var(--f-display); font-weight: 800; font-size: var(--s1); }
.letter-card .snd { font-weight: 900; color: var(--c-deep); }
.letter-card .tip { grid-column: 1 / -1; font-size: 0.92rem; color: var(--ink-2); margin-top: 0.5rem; }
.letter-card .eg { grid-column: 1 / -1; display: flex; align-items: center; gap: 0.6rem; margin-top: 0.4rem; font-weight: 800; }
.letter-card .eg .ar { margin-left: auto; font-size: var(--s1); }
.key-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.8rem; }
.key { display: flex; gap: 0.8rem; align-items: center; background: #fff; border: var(--border); border-radius: 22px; padding: 0.7rem 1rem; }
.key b { font-size: var(--s2); font-family: var(--f-display); min-width: 2.4ch; }
.key .ar { display: block; font-size: var(--s2); color: var(--c-deep); text-align: left; }
.key span { font-size: 0.9rem; color: var(--ink-2); }

/* ---------- Feedback bits ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%); background: var(--ink); color: #fff; padding: 0.8rem 1.3rem; border-radius: 999px; font-weight: 800; z-index: 80; box-shadow: 0 5px 0 var(--vimto); transition: transform 0.3s cubic-bezier(.2, 1.4, .4, 1); max-width: calc(100% - 32px); text-align: center; }
.toast.show { transform: translate(-50%, 0); }
.burst { position: fixed; z-index: 90; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink); pointer-events: none; animation: burst 0.75s cubic-bezier(.2, .8, .4, 1) forwards; }
@keyframes burst { to { transform: translate(var(--dx), var(--dy)) scale(0.4); opacity: 0; } }
.confetti-layer { position: fixed; inset: 0; z-index: 95; pointer-events: none; overflow: hidden; }
.confetti-layer i { position: absolute; top: -24px; display: block; will-change: transform, opacity; animation-name: fall; animation-timing-function: cubic-bezier(.25, .6, .45, 1); animation-fill-mode: forwards; }
@keyframes fall {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translate(var(--drift), 105vh) rotate(var(--spin)); opacity: 0; }
}

.page-loading { display: flex; justify-content: center; gap: 0.6rem; padding: 8rem 0; }
.page-loading span { width: 18px; height: 18px; border-radius: 50%; background: var(--sea); border: 3px solid var(--ink); animation: bounce 0.9s infinite; }
.page-loading span:nth-child(2) { background: var(--sun); animation-delay: 0.15s; }
.page-loading span:nth-child(3) { background: var(--vimto); animation-delay: 0.3s; }
@keyframes bounce { 50% { transform: translateY(-14px); } }

.file-warning { max-width: 640px; margin: 5rem auto; background: #fff; border: var(--border); border-radius: 32px; box-shadow: var(--pop); padding: 2rem; }
.file-warning h1 { font-size: var(--s3); margin-bottom: 0.8rem; }
.file-warning code { background: var(--sun); padding: 0.1em 0.4em; border-radius: 6px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Conversations (home preview + dialogues) ---------- */
.talk-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 3rem; align-items: center; }
.talk-copy h2 { font-size: clamp(1.9rem, 4vw, var(--s4)); }
.talk-copy p { color: var(--ink-2); margin-top: 0.8rem; font-size: var(--s1); }
.talk-copy .btn-row { margin-top: 1.6rem; }
.talk-preview { background: var(--c-soft); border: 4px solid var(--ink); border-radius: 44px; box-shadow: 0 8px 0 var(--ink); padding: 1.2rem; }
.talk-head { display: flex; align-items: center; gap: 0.6rem; font-family: var(--f-display); font-weight: 800; font-size: var(--s1); padding: 0.2rem 0.4rem 0.8rem; }
.talk-head .btn { margin-left: auto; }
@media (max-width: 860px) { .talk-grid { grid-template-columns: 1fr; } }

.chat { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.9rem; }
.line { display: flex; align-items: flex-end; gap: 0.6rem; max-width: 86%; }
.line.side-b { margin-left: auto; flex-direction: row-reverse; }
.line .avatar { flex: none; width: 48px; height: 48px; border-radius: 50%; background: #fff; border: 3px solid var(--ink); display: grid; place-items: center; font-size: 1.6rem; }
.line-bubble { position: relative; background: #fff; border: 3px solid var(--ink); border-radius: 26px 26px 26px 6px; padding: 0.7rem 1rem; box-shadow: var(--pop-sm); cursor: pointer; transition: transform 0.25s var(--ease), background 0.2s; min-width: 0; }
.side-b .line-bubble { background: var(--sun); border-radius: 26px 26px 6px 26px; }
@media (hover: hover) { .line-bubble:hover { transform: translateY(-2px); } }
.line.speaking .line-bubble { background: var(--c); color: #fff; }
.line.speaking .line-tr, .line.speaking .line-en, .line.speaking .line-name { color: #fff; }
.line-name { display: block; font-size: var(--s-1); font-weight: 900; color: var(--ink-2); }
.line-ar { display: block; font-size: var(--s2); line-height: 1.35; }
.line-tr { color: var(--c-deep); font-weight: 800; font-size: 0.95rem; }
.line-en { color: var(--ink-2); font-size: 0.95rem; }
.chat.hide-tr .line-tr { display: none; }
.chat.hide-en .line-bubble > .line-en { display: none; }
.line-tools { display: flex; gap: 0.3rem; margin-top: 0.4rem; }
.line-play { border: 2px solid var(--ink); background: #fff; color: var(--ink); border-radius: 999px; width: 34px; height: 34px; cursor: pointer; font-size: 0.95rem; }
.chat-mini .line-bubble { cursor: default; }
.chat-mini .line-ar { font-size: var(--s1); }
.line.mine .line-bubble { background: #fff; border-style: dashed; }
.your-turn .line-en { color: var(--ink); font-weight: 800; margin-bottom: 0.5rem; }
.hidden-line { margin-top: 0.6rem; }
@media (max-width: 560px) { .line { max-width: 100%; } .line .avatar { width: 38px; height: 38px; font-size: 1.2rem; } }

.dialogue-level > h2 { font-size: var(--s3); }
.dialogue-level + .dialogue-level { margin-top: 2.6rem; }
.dialogue-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.4rem; }
.dialogue-card { display: flex; flex-direction: column; align-items: flex-start; gap: 0.45rem; text-decoration: none; background: #fff; border: var(--border); border-radius: 36px 36px 36px 10px; box-shadow: var(--pop); padding: 1.4rem; transition: transform 0.25s var(--ease); }
@media (hover: hover) { .dialogue-card:hover { transform: translateY(-3px); } }
.dialogue-emoji { font-size: 2.4rem; width: 70px; height: 70px; border-radius: 50%; background: var(--c-soft); border: 3px solid var(--ink); display: grid; place-items: center; }
.dialogue-card h3 { font-size: var(--s2); }
.dialogue-card .ar { font-size: var(--s1); }
.dialogue-people { display: flex; align-items: center; gap: 0.3rem; font-weight: 800; font-size: 0.9rem; margin-top: auto; padding-top: 0.4rem; }
.dialogue-people .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--foam); border: 2px solid var(--ink); display: grid; place-items: center; }
.dialogue-head .chip { margin-top: 0.8rem; text-decoration: none; }
.dialogue-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.6rem; margin-bottom: 2rem; position: sticky; top: 96px; z-index: 5; }
.control-group { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; }
.control-label { font-weight: 900; color: var(--ink-2); }
@media (max-width: 760px) { .dialogue-controls { position: static; } }

/* ---------- Sentences ---------- */
.sticky-filters { position: sticky; top: 96px; z-index: 5; display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; justify-content: space-between; background: var(--foam); padding: 0.7rem 0; margin-bottom: 1rem; }
.chip-link { display: inline-flex; align-items: center; gap: 0.3rem; text-decoration: none; border: 2px solid var(--ink); background: #fff; border-radius: 999px; padding: 0.3rem 0.8rem; font-weight: 800; font-size: 0.9rem; white-space: nowrap; transition: background 0.2s, color 0.2s; }
.chip-link.active { background: var(--ink); color: #fff; }
@media (hover: hover) { .chip-link:hover { background: var(--ink); color: #fff; } }
.sentence-group { padding-top: 2.4rem; scroll-margin-top: 170px; }
.group-head { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-bottom: 1.4rem; }
.group-head h2 { font-size: var(--s3); margin-bottom: 0.3rem; }
.group-head .btn { margin-left: auto; }
.group-emoji { font-size: 2.2rem; width: 68px; height: 68px; border-radius: 50%; background: var(--c-soft); border: 3px solid var(--ink); display: grid; place-items: center; }
.group-head .chip { text-decoration: none; }
.sentence-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 1.2rem; }
.sentence { min-width: 0; overflow-wrap: anywhere; background: #fff; border: var(--border); border-radius: 30px; box-shadow: var(--pop); padding: 1.1rem 1.2rem; }
.sentence-top { display: flex; align-items: center; gap: 0.7rem; }
.sentence-top .emo { font-size: 1.8rem; }
.sentence-en { min-width: 0; font-family: var(--f-display); font-weight: 800; font-size: var(--s1); flex: 1; cursor: pointer; line-height: 1.2; }
.sentence-actions { display: flex; gap: 0.4rem; }
.sentence-actions .icon-btn { width: 40px; height: 40px; }
.sentence-words { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.9rem; }
.word-chip-ar { display: flex; flex-direction: column; align-items: center; border: 2px solid var(--ink); background: var(--c-soft); border-radius: 18px; padding: 0.3rem 0.7rem 0.4rem; cursor: pointer; transition: transform 0.25s var(--ease); direction: rtl; }
@media (hover: hover) { .word-chip-ar:hover { transform: translateY(-2px); } }
.word-chip-ar .ar { font-size: var(--s2); line-height: 1.25; }
.word-chip-ar .w-tr { direction: ltr; font-size: 0.8rem; font-weight: 900; color: var(--c-deep); }
.word-chip-ar .w-en { direction: ltr; font-size: 0.75rem; color: var(--ink-2); font-weight: 700; }
.hide-words .word-chip-ar { background: none; border-color: transparent; padding: 0 0.1rem; }
.hide-words .word-chip-ar .w-tr, .hide-words .word-chip-ar .w-en { display: none; }
.sentence-tr { margin-top: 0.6rem; color: var(--c-deep); font-weight: 800; }
@media (max-width: 760px) { .sticky-filters { position: static; } .sentence-grid { grid-template-columns: 1fr; } }

/* ---------- Level extras ---------- */
.level-extras { margin-top: 3rem; }
.level-extras h2 { font-size: var(--s3); margin-bottom: 1.2rem; }
.extras-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.extra-card { display: flex; align-items: center; gap: 0.9rem; text-decoration: none; background: #fff; border: var(--border); border-radius: 24px; box-shadow: var(--pop-sm); padding: 0.8rem 1rem; transition: transform 0.25s var(--ease); }
@media (hover: hover) { .extra-card:hover { transform: translateY(-2px); } }
.extra-card .emo { font-size: 1.8rem; width: 54px; height: 54px; border-radius: 50%; background: var(--c-soft); border: 2px solid var(--ink); display: grid; place-items: center; flex: none; }
.extra-card b { display: block; font-family: var(--f-display); font-size: var(--s1); line-height: 1.15; }
.extra-card small { color: var(--ink-2); font-weight: 700; }

/* ---------- Performance and smooth motion ---------- */
.word-grid .word { content-visibility: auto; contain-intrinsic-size: auto 230px; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  /* Smooth cross-fade between pages (Chrome, Edge, Safari 18.2+). Other browsers simply load the page. */
  @view-transition { navigation: auto; }
  .site-header { view-transition-name: site-header; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.28s; animation-timing-function: var(--ease); }

  /* Gentle reveal for content below the fold. Content already on screen never animates. */
  .reveal.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.55s var(--ease), transform 0.55s var(--ease); transition-delay: var(--rd, 0ms); }
  .reveal.reveal.in { opacity: 1; transform: none; }
}

/* Sentences: one swipeable row of situations so the sticky bar stays slim */
.sticky-filters { flex-wrap: nowrap; box-shadow: 0 -24px 0 var(--foam); }
.sticky-filters .seg { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 4px 2px 6px; mask-image: linear-gradient(90deg, #000 92%, transparent); }
.sticky-filters .seg::-webkit-scrollbar { display: none; }
.sticky-filters .check { flex: none; }

/* ---------- Picture frame: one look for emoji today and illustrations tomorrow ---------- */
.pic {
  --s: 92px;
  width: var(--s); height: var(--s); flex: none; display: inline-grid; place-items: center;
  border-radius: 30%; overflow: hidden;
  background: radial-gradient(circle at 50% 38%, #fff 0%, #fff 30%, var(--c-soft) 100%);
  box-shadow: inset 0 0 0 2px rgba(31, 36, 89, 0.08), inset 0 -5px 0 rgba(31, 36, 89, 0.06);
}
.pic img { width: 84%; height: 84%; object-fit: contain; -webkit-user-drag: none; user-select: none; }
.pic-emoji { font-size: calc(var(--s) * 0.56); line-height: 1; }
.pic-xxs { --s: 26px; border-radius: 9px; box-shadow: none; background: transparent; }
.pic-xs { --s: 44px; }
.pic-sm { --s: 60px; }
.pic-md { --s: 92px; }
.pic-lg { --s: 124px; }
.pic-xl { --s: 170px; }
.word .pic { margin: 0.2rem 0 0.4rem; }
.word-hero .pic { margin: 0 auto 0.6rem; }
.hero-word .pic { margin-bottom: 0.2rem; }
.hero-word .pic { --s: 112px; }
.hero-ar { font-size: clamp(3.2rem, 7vw, 5rem); }
.q-pic { display: grid; place-items: center; margin: 0.6rem 0; }
.try-box .q-pic .pic { --s: 140px; }
.sentence-top .pic { --s: 52px; }
.wotd-card .pic { --s: 58px; }
.mistake .pic { --s: 40px; }
.hero-chip .pic, .word-chip .pic { vertical-align: middle; }

/* ---------- Dictionary topics ---------- */
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.4rem; }
.topic-card {
  display: grid; grid-template-columns: auto 1fr; gap: 0.4rem 1rem; align-items: center; text-decoration: none;
  background: #fff; border: var(--border); border-radius: 34px 34px 34px 10px; box-shadow: var(--pop); padding: 1.3rem;
  transition: transform 0.25s var(--ease);
}
.topic-card:nth-child(even) { border-radius: 34px 34px 10px 34px; }
@media (hover: hover) { .topic-card:hover { transform: translateY(-3px); } }
.topic-icon { width: 68px; height: 68px; border-radius: 30%; background: var(--c-soft); border: 3px solid var(--ink); display: grid; place-items: center; font-size: 2.2rem; }
.topic-text h2 { font-size: var(--s1); line-height: 1.15; }
.topic-text .ar { display: block; color: var(--c-deep); font-size: 1.05rem; text-align: left; }
.topic-preview { grid-column: 1 / -1; display: flex; gap: 0.4rem; margin-top: 0.6rem; }
.topic-meta { grid-column: 1 / -1; font-weight: 800; color: var(--ink-2); font-size: var(--s-1); }
.topic-card .bar-wrap { grid-column: 1 / -1; }
.topic-card .bar { margin-top: 0.2rem; }
.topic-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-bottom: 1rem; }
.topic-progress { max-width: 420px; margin-bottom: 1rem; }
.word-group { margin-top: 2.2rem; }
.word-group-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; margin-bottom: 1.1rem; }
.word-group-head h2 { font-size: var(--s3); }
.word-group-head .chip { text-decoration: none; }

/* ---------- Favourites ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fav-btn {
  width: 40px; height: 40px; border-radius: 50%; border: var(--border); background: #fff; color: var(--vimto);
  display: inline-grid; place-items: center; padding: 0; cursor: pointer; flex: none; box-shadow: var(--pop-sm);
  transition: transform 0.2s var(--ease), background 0.2s;
}
.fav-btn .ico { width: 20px; height: 20px; }
.fav-btn .heart-fill { fill: transparent; transition: fill 0.2s; }
.fav-btn[aria-pressed='true'] { background: #ffe1ea; }
.fav-btn[aria-pressed='true'] .heart-fill { fill: currentColor; }
@media (hover: hover) { .fav-btn:hover { transform: scale(1.08); } }
.fav-btn:active { transform: scale(0.92); }
.fav-btn.pop { animation: heartPop 0.45s var(--ease); }
@keyframes heartPop { 30% { transform: scale(1.3); } 60% { transform: scale(0.95); } }
.fav-lg { width: 44px; height: 44px; }
.modal-top-actions { display: flex; gap: 0.6rem; align-items: center; }

/* word bubble: heart top-left, play top-right, learned tick on the picture */
.word .fav-corner { position: absolute; top: 10px; left: 10px; width: 38px; height: 38px; }
.pic-wrap { position: relative; display: inline-block; }
.word .learned-badge {
  position: absolute; top: auto; left: auto; right: -6px; bottom: 2px; width: 28px; height: 28px; padding: 0;
  display: grid; place-items: center; border-radius: 50%; font-size: 0.9rem; background: var(--good); color: #fff; border: 2px solid var(--ink);
}

.sentence-actions { gap: 0.35rem; }
.sentence-actions .icon-btn, .sentence-actions .fav-btn { width: 36px; height: 36px; }
.sentence-actions .fav-btn .ico { width: 18px; height: 18px; }

/* nav counter */
.nav-fav { background: #ffe1ea; color: var(--vimto); }
.nav-fav b { color: var(--ink); }
.nav-fav .ico { width: 18px; height: 18px; }
.nav-fav .heart-fill { fill: currentColor; }
.nav-stat.current { outline: 3px solid var(--vimto); outline-offset: 2px; }

/* page */
.fav-tabs { margin-bottom: 1.4rem; }
.fav-tabs button { padding: 0.55rem 1.2rem; }
.fav-empty .ico { display: inline; width: 1.1em; height: 1.1em; vertical-align: -0.15em; color: var(--vimto); }
.fav-empty .btn { margin-top: 1.2rem; }

/* Nav fits at every width now that it has a favourites counter */
@media (min-width: 1181px) {
  .nav-emo { display: none; }
  .nav a { padding: 0.5rem 0.65rem; }
}
@media (max-width: 520px) {
  .nav-shell { gap: 0.4rem; padding: 6px 8px 6px 10px; }
  .logo-mark { width: 38px; height: 38px; }
  .nav-right { gap: 0.35rem; }
  .nav-stat { padding: 0.2rem 0.55rem; }
  .sfx-btn { width: 36px; height: 36px; }
  .menu-btn { width: 42px; height: 42px; }
}
@media (max-width: 420px) {
  .nav-stat:not(.nav-fav) { display: none; } /* words-known count still shows on every level page */
  .logo-word { font-size: 1.1rem; }
}

/* ---------- Letter tile: words without a picture yet ---------- */
.pic-letter {
  font-family: var(--f-display); font-weight: 800; color: var(--c-deep);
  font-size: calc(var(--s) * 0.5); line-height: 1; padding-top: calc(var(--s) * 0.1);
}
.pic:has(.pic-letter) { background: linear-gradient(160deg, #fff 0%, var(--c-soft) 90%); }

/* ---------- Word sets (24 at a time) ---------- */
.set-bar { position: sticky; top: 96px; z-index: 5; background: var(--foam); box-shadow: 0 -10px 0 var(--foam); padding: 0.5rem 0; margin-bottom: 0.8rem; }
.set-chips { display: flex; gap: 0.45rem; overflow-x: auto; scrollbar-width: none; padding: 4px 2px 6px; }
.set-chips::-webkit-scrollbar { display: none; }
.set-chip { flex: none; border: 2px solid var(--ink); background: #fff; border-radius: 999px; padding: 0.35rem 0.9rem; font-weight: 800; cursor: pointer; transition: background 0.2s, color 0.2s; }
.set-chip.done { background: #d9f7e6; }
.set-chip[aria-selected='true'] { background: var(--ink); color: #fff; }
.set-progress { font-weight: 800; color: var(--ink-2); }
.set-nav { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 2rem; }
@media (max-width: 760px) { .set-bar { position: static; } }

/* ---------- Readable page content for search engines (replaced by the app once it loads) ---------- */
.static-page { padding: 2rem 0 1rem; }
.static-page h1 { font-size: clamp(2rem, 5vw, var(--s5)); margin-bottom: 0.8rem; }
.static-page h2 { font-size: var(--s2); margin: 2rem 0 0.8rem; }
.static-page p { max-width: 70ch; margin: 0.6rem 0; color: var(--ink-2); }
.static-page ul, .static-page ol { padding-left: 1.2rem; display: grid; gap: 0.35rem; }
.static-words { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; border: var(--border); border-radius: 20px; overflow: hidden; margin: 1rem 0; }
.static-words th, .static-words td { text-align: left; padding: 0.55rem 0.8rem; border-bottom: 1px solid #e3e6f5; vertical-align: top; }
.static-words th { background: var(--c-soft); font-family: var(--f-display); }
.static-words .ar { font-size: 1.25rem; }
.static-pager { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 2rem 0; font-weight: 800; }
.static-site-links { margin-top: 2.5rem; }
.flip-grid .static-words, .level-path .static-levels { grid-column: 1 / -1; }

/* ---------- Sitemap page ---------- */
.sitemap-page { padding: 2rem 0 3rem; }
.sitemap-head { display: flex; align-items: center; gap: 1.2rem; margin-top: 0.6rem; }
.sitemap-head h1 { font-size: clamp(2rem, 5vw, var(--s5)); display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.8rem; }
.sitemap-head p { margin-top: 0.4rem; max-width: 62ch; }
.sitemap-jump { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.4rem 0 0.5rem; }
.sitemap-jump a { border: 2px solid var(--ink); border-radius: 999px; padding: 0.35rem 0.95rem; font-weight: 800; font-size: 0.92rem; color: var(--ink); background: #fff; box-shadow: 0 3px 0 var(--ink); }
@media (hover: hover) { .sitemap-jump a:hover { background: var(--sun-soft, #fff0cc); } }
.sitemap-section { background: #fff; border: var(--border); border-radius: var(--r-lg); box-shadow: var(--pop); padding: 1.6rem 1.8rem; margin-top: 1.6rem; scroll-margin-top: 110px; }
.sitemap-section h2 { font-size: var(--s2); margin-bottom: 1rem; }
.sitemap-section h3 { font-size: 1.1rem; margin: 1.3rem 0 0.5rem; }
.sitemap-section a { color: var(--ink); font-weight: 700; }
@media (hover: hover) { .sitemap-section a:hover { color: var(--sea-deep, #0a7e86); } }
.sitemap-cols { list-style: none; margin: 0; padding: 0; columns: 15rem auto; column-gap: 2rem; }
.sitemap-cols li { break-inside: avoid; padding: 0.22rem 0; line-height: 1.4; }
.sitemap-cols li.sub { padding-left: 1rem; font-size: 0.95rem; }
.sitemap-cols .muted { font-size: 0.85rem; }
.sitemap-levels { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 1rem; }
.sitemap-card { border: 2px solid var(--ink); border-radius: 20px; padding: 1rem 1.1rem; background: var(--c-soft, #f3f6ff); }
.sitemap-card h3 { margin: 0; font-size: 1.1rem; }
.sitemap-card h3 a { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.sitemap-card .num { display: inline-grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--c, #10b3a3); color: #fff; border: 2px solid var(--ink); font-size: 0.9rem; flex: none; }
.sitemap-card p { margin: 0.2rem 0 0.5rem; font-size: 0.88rem; }
.sitemap-card ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.2rem; }
.sitemap-words > p { margin: -0.4rem 0 1rem; }
.sitemap-topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 0.7rem; }
.sitemap-topic { display: flex; align-items: center; gap: 0.75rem; border: 2px solid var(--ink); border-radius: 16px; padding: 0.6rem 0.8rem; background: #fff; transition: transform 0.12s, box-shadow 0.12s; }
@media (hover: hover) { .sitemap-topic:hover { transform: translateY(-2px); box-shadow: 0 4px 0 var(--ink); } }
.sitemap-topic .emo { font-size: 1.7rem; width: 2.4rem; text-align: center; flex: none; }
.sitemap-topic strong { display: block; line-height: 1.25; }
.sitemap-topic .muted { display: block; font-size: 0.82rem; font-weight: 600; line-height: 1.35; }
@media (max-width: 640px) {
  .sitemap-head { align-items: flex-start; }
  .sitemap-head .mascot { display: none; }
  .sitemap-section { padding: 1.2rem 1.1rem; }
}

/* ---------- About page ---------- */
.about-page { max-width: 820px; }
/* Legal pages: privacy, terms, data protection, data deletion */
.legal-tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.legal-tabs a { border: 2px solid var(--ink); border-radius: 999px; padding: 0.35rem 0.9rem; font-weight: 800; font-size: 0.92rem; color: var(--ink); background: #fff; }
.legal-tabs a[aria-current="page"] { background: var(--ink); color: #fff; }
.legal-body { background: #fff; border: var(--border); border-radius: var(--r-lg); box-shadow: var(--pop); padding: 2rem 2.2rem; margin-top: 1.4rem; overflow-wrap: anywhere; }
.legal-body > * + * { margin-top: 0.9rem; }
.legal-body h2 { font-size: var(--s2); margin-top: 2rem; }
.legal-body p, .legal-body li { font-size: 1.04rem; line-height: 1.7; }
.legal-body ul { padding-left: 1.3rem; display: grid; gap: 0.45rem; }
.legal-body a { color: var(--c-deep, #0A7E86); font-weight: 800; }
.legal-summary { background: #FFFBEF; border: 2px solid var(--ink); border-radius: 16px; padding: 0.9rem 1.1rem; }
.legal-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.legal-table th, .legal-table td { border: 2px solid var(--ink); padding: 0.55rem 0.7rem; text-align: left; vertical-align: top; }
.legal-table th { background: #F3F6FF; }
.legal-table code { font-size: 0.85rem; word-break: break-all; }
.legal-delete { display: grid; gap: 0.8rem; justify-items: start; padding: 1.2rem; }
.legal-delete-status { font-weight: 800; }
.settings-privacy { margin-top: 0.9rem; font-size: 0.92rem; }
@media (max-width: 600px) { .legal-body { padding: 1.3rem 1.1rem; } .legal-table th, .legal-table td { padding: 0.45rem; } }
.about-lede { font-size: var(--s1); color: var(--ink) !important; }
.about-block { margin-top: 2.4rem; }
.about-block h2 { font-size: var(--s3); margin-bottom: 0.7rem; }
.about-block p { margin-top: 0.7rem; color: var(--ink-2); max-width: 68ch; }
.about-block .ar { font-size: 1.1em; }
.about-list { display: grid; gap: 0.6rem; padding-left: 1.2rem; color: var(--ink-2); }
.faq details { background: #fff; border: var(--border); border-radius: 22px; padding: 0.9rem 1.2rem; margin-top: 0.8rem; box-shadow: var(--pop-sm); }
.faq summary { font-family: var(--f-display); font-weight: 800; font-size: var(--s1); cursor: pointer; }
.faq details p { margin-top: 0.6rem; }

/* ---------- Smooth page changes ---------- */
/* The nav bar and footer are part of every page; these wrappers add no box, so the sticky nav still works. */
#site-top, #site-bottom { display: contents; }
/* While the app draws the page, keep the copy written for search engines out of sight (it stays in the HTML). */
.booting .static-page, .booting .static-words, .booting .static-levels { visibility: hidden; }
/* On a slow connection, a small spinner appears while the page is drawn (not on fast loads). */
.booting #main:has(> .static-page)::before {
  content: ''; position: fixed; left: 50%; top: 45%; width: 44px; height: 44px; margin: -22px 0 0 -22px; z-index: 5;
  border-radius: 50%; border: 5px solid var(--c-soft, #E0F5F2); border-top-color: var(--teal, #10B3A3);
  opacity: 0; animation: bootFade 0.2s 0.4s forwards, bootSpin 0.8s linear infinite;
}
@keyframes bootSpin { to { transform: rotate(360deg); } }
@keyframes bootFade { to { opacity: 1; } }
@media (prefers-reduced-motion: no-preference) {
  .site-footer { view-transition-name: site-footer; }
  ::view-transition-group(site-header), ::view-transition-group(site-footer) { animation-duration: 0s; }
}

/* ---------- Languages ---------- */
html[data-lang='hi'], html[data-lang='bn'], html[data-lang='ml'], html[data-lang='ur'] {
  --f-body: 'Nunito', 'Baloo 2', 'Baloo Da 2', 'Baloo Chettan 2', 'Noto Naskh Arabic', sans-serif;
}
.tr, .en-small, .lang-code { unicode-bidi: isolate; }
[dir='rtl'] .tr { direction: ltr; }
.en-small { color: var(--ink-3); font-size: var(--s-1); font-weight: 700; }
.lang-picker { position: relative; }
.lang-btn { display: inline-flex; align-items: center; gap: 0.25rem; height: 40px; padding: 0 0.6rem; border-radius: 999px; border: 2px solid var(--ink); background: #fff; cursor: pointer; font-weight: 900; font-size: 0.8rem; }
.lang-btn svg { width: 18px; height: 18px; }
.lang-menu { position: absolute; top: calc(100% + 10px); inset-inline-end: 0; z-index: 60; background: #fff; border: var(--border); border-radius: 22px; box-shadow: var(--pop); padding: 0.4rem; display: grid; min-width: 210px; }
.lang-menu button { display: flex; justify-content: space-between; gap: 1rem; border: 0; background: none; padding: 0.55rem 0.8rem; border-radius: 14px; cursor: pointer; text-align: start; }
.lang-menu [aria-checked='true'] { background: var(--c-soft); }
@media (hover: hover) { .lang-menu button:hover { background: var(--c-soft); } }
.lang-menu small { color: var(--ink-2); font-weight: 700; }
.lang-offer { position: fixed; inset-inline: 16px; bottom: 16px; z-index: 70; margin: 0 auto; max-width: 560px; display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; background: #fff; border: var(--border); border-radius: 24px; box-shadow: var(--pop); padding: 0.8rem 1rem; font-weight: 800; }
.lang-offer span { flex: 1 1 200px; }
@media (max-width: 520px) { .lang-btn .lang-code { display: none; } .lang-btn { padding: 0 0.5rem; } }

/* ---------- Saqr the mascot ---------- */
.mascot { display: block; flex: none; overflow: visible; }
.mascot .mascot-head { transform-origin: 100px 150px; }
@media (prefers-reduced-motion: no-preference) {
  .mascot-cheer .mascot-head { animation: mascotBob 0.6s var(--ease) 2; }
  .mascot-sad .mascot-head { animation: mascotDroop 0.6s var(--ease); }
}
@keyframes mascotBob { 50% { transform: rotate(-6deg) translateY(-4px); } }
@keyframes mascotDroop { 50% { transform: rotate(4deg) translateY(3px); } }

/* ---------- Saqr animations (js/ui/mascot.js, MASCOT_ANIMS) ----------
   Every Saqr breathes and blinks. Add class saqr-anim-<name> to the svg (or call playMascot)
   for one of 20 animations; add saqr-loop to keep it going. */
.mascot .saqr, .mascot .saqr-move { transform-origin: 100px 206px; }
.mascot .saqr-eye, .mascot .saqr-pupil, .mascot .saqr-eye-shut, .mascot .saqr-cheeks, .mascot .fx-item, .mascot .fx-stars > g, .mascot .fx { transform-box: fill-box; transform-origin: center; }
.mascot .saqr-wing-l { transform-box: fill-box; transform-origin: 80% 12%; }
.mascot .saqr-wing-r { transform-box: fill-box; transform-origin: 20% 12%; }
.mascot .saqr-foot { transform-box: fill-box; transform-origin: 50% 0; }
.mascot .saqr-tuft { transform-box: fill-box; transform-origin: 50% 100%; }
.mascot .saqr-scarf-tail { transform-box: fill-box; transform-origin: 10% 10%; }
.mascot .fx > g > .fx-item, .mascot .fx-stars > g { opacity: 0; }

@media (prefers-reduced-motion: no-preference) {
  /* always on: breathing and blinking */
  .mascot .saqr { animation: saqrBreathe 3.6s ease-in-out infinite; }
  .mascot .saqr-eye { animation: saqrBlink 5s infinite; }
  .mascot .saqr-eye-r { animation-delay: 0.04s; }

  .saqr-anim-blink .saqr-eye { animation: saqrShut 0.35s ease-in-out 2; }
  .saqr-anim-wink .saqr-eye-r .saqr-eye-open { animation: saqrHide 0.9s ease-in-out; }
  .saqr-anim-wink .saqr-eye-r .saqr-eye-shut { animation: saqrShowEye 0.9s ease-in-out; }
  .saqr-anim-wink .mascot-head { animation: saqrTiltSmall 0.9s ease-in-out; }

  .saqr-anim-look .saqr-pupil { animation: saqrLook 2.4s ease-in-out; }
  .saqr-anim-look .mascot-head { animation: saqrLookHead 2.4s ease-in-out; }

  .saqr-anim-hop .saqr-move { animation: saqrHop 0.45s ease-in-out 2; }
  .saqr-anim-hop .saqr-wing-l { animation: saqrFlapL 0.45s ease-in-out 2; }
  .saqr-anim-hop .saqr-wing-r { animation: saqrFlapR 0.45s ease-in-out 2; }

  .saqr-anim-wave .saqr-wing-r { animation: saqrWave 1.6s ease-in-out; }
  .saqr-anim-wave .mascot-head { animation: saqrTiltSmall 1.6s ease-in-out; }

  .saqr-anim-flap .saqr-wing-l { animation: saqrFlapL 0.3s ease-in-out 4; }
  .saqr-anim-flap .saqr-wing-r { animation: saqrFlapR 0.3s ease-in-out 4; }
  .saqr-anim-flap .saqr-move { animation: saqrLift 1.2s ease-in-out; }

  .saqr-anim-fly .saqr-move { animation: saqrFly 2.6s ease-in-out; }
  .saqr-anim-fly .saqr-wing-l { animation: saqrFlapL 0.26s ease-in-out 10; }
  .saqr-anim-fly .saqr-wing-r { animation: saqrFlapR 0.26s ease-in-out 10; }
  .saqr-anim-fly .saqr-foot { animation: saqrTuck 2.6s ease-in-out; }
  .saqr-anim-fly .saqr-scarf-tail { animation: saqrFlutter 0.3s ease-in-out 8; }
  .saqr-anim-fly .fx-wind { animation: saqrShow 2.6s ease-in-out; }

  .saqr-anim-dance .saqr-move { animation: saqrDance 1.2s ease-in-out 2; }
  .saqr-anim-dance .mascot-head { animation: saqrBob 0.3s ease-in-out 8; }
  .saqr-anim-dance .saqr-wing-l { animation: saqrFlapL 0.6s ease-in-out 4; }
  .saqr-anim-dance .saqr-wing-r { animation: saqrFlapR 0.6s ease-in-out 0.3s 4 both; }
  .saqr-anim-dance .saqr-foot-l { animation: saqrStep 0.6s ease-in-out 4; }
  .saqr-anim-dance .saqr-foot-r { animation: saqrStep 0.6s ease-in-out 0.3s 4 both; }

  .saqr-anim-nod .mascot-head { animation: saqrNod 0.4s ease-in-out 3; }

  .saqr-anim-shake .mascot-head { animation: saqrShake 1.1s ease-in-out; }

  .saqr-anim-tilt .mascot-head { animation: saqrTilt 1.6s ease-in-out; }
  .saqr-anim-tilt .saqr-pupil { animation: saqrPeekUp 1.6s ease-in-out; }
  .saqr-anim-tilt .saqr-tuft { animation: saqrTuft 0.4s ease-in-out 0.3s 2 both; }

  .saqr-anim-spin .saqr-move { animation: saqrSpin 1.1s ease-in-out; }

  .saqr-anim-cheer .saqr-move { animation: saqrHop 0.5s ease-in-out 3; }
  .saqr-anim-cheer .saqr-wing-l { animation: saqrArmsUpL 1.6s ease-in-out; }
  .saqr-anim-cheer .saqr-wing-r { animation: saqrArmsUpR 1.6s ease-in-out; }
  .saqr-anim-cheer .saqr-mouth { animation: saqrShow 1.6s ease-in-out; }
  .saqr-anim-cheer .fx-stars { opacity: 1; }
  .saqr-anim-cheer .fx-stars > g { animation: saqrPop 1.4s ease-out both; }
  .saqr-anim-cheer .fx-stars > g:nth-child(2) { animation-delay: 0.15s; }
  .saqr-anim-cheer .fx-stars > g:nth-child(3) { animation-delay: 0.3s; }

  .saqr-anim-shiver .saqr-move { animation: saqrShiver 0.1s linear 15; }
  .saqr-anim-shiver .saqr-wing-l { animation: saqrHugL 1.5s ease-in-out; }
  .saqr-anim-shiver .saqr-wing-r { animation: saqrHugR 1.5s ease-in-out; }
  .saqr-anim-shiver .fx-sweat { animation: saqrDrip 1.5s ease-in; }

  .saqr-anim-peck .mascot-head { animation: saqrPeck 0.45s ease-in-out 3; }
  .saqr-anim-peck .saqr-tuft { animation: saqrTuft 0.45s ease-in-out 3; }

  .saqr-anim-sleep .saqr-eye { animation: none; }
  .saqr-anim-sleep .saqr-eye-open { animation: saqrHide 4s ease-in-out; }
  .saqr-anim-sleep .saqr-eye-shut { animation: saqrShowEyeDown 4s ease-in-out; }
  .saqr-anim-sleep .mascot-head { animation: saqrDoze 4s ease-in-out; }
  .saqr-anim-sleep .saqr { animation: saqrBreathe 2s ease-in-out 2; }
  .saqr-anim-sleep .fx-zzz { opacity: 1; }
  .saqr-anim-sleep .fx-zzz .fx-item { animation: saqrFloat 1.6s ease-out 0.4s 2 both; }
  .saqr-anim-sleep .fx-zzz > g:nth-child(2) .fx-item { animation-delay: 0.9s; }
  .saqr-anim-sleep .fx-zzz > g:nth-child(3) .fx-item { animation-delay: 1.4s; }

  .saqr-anim-love .saqr-move { animation: saqrSway 1.2s ease-in-out 2; }
  .saqr-anim-love .saqr-cheeks { animation: saqrBlush 2.4s ease-in-out; }
  .saqr-anim-love .saqr-pupil { animation: saqrHeartEyes 2.4s ease-in-out; }
  .saqr-anim-love .saqr-wing-l { animation: saqrHugL 2.4s ease-in-out; }
  .saqr-anim-love .saqr-wing-r { animation: saqrHugR 2.4s ease-in-out; }
  .saqr-anim-love .fx-hearts { opacity: 1; }
  .saqr-anim-love .fx-hearts .fx-item { animation: saqrFloat 1.6s ease-out both; }
  .saqr-anim-love .fx-hearts > g:nth-child(2) .fx-item { animation-delay: 0.35s; }
  .saqr-anim-love .fx-hearts > g:nth-child(3) .fx-item { animation-delay: 0.7s; }

  .saqr-anim-surprise .saqr-move { animation: saqrStartle 1.3s ease-out; }
  .saqr-anim-surprise .saqr-eye { animation: saqrBigEyes 1.3s ease-out; }
  .saqr-anim-surprise .saqr-mouth { animation: saqrShow 1.3s ease-out; }
  .saqr-anim-surprise .saqr-tuft { animation: saqrTuftUp 1.3s ease-out; }
  .saqr-anim-surprise .saqr-wing-l { animation: saqrArmsUpL 1.3s ease-out; }
  .saqr-anim-surprise .saqr-wing-r { animation: saqrArmsUpR 1.3s ease-out; }
  .saqr-anim-surprise .fx-bang { animation: saqrShow 1.3s ease-out; }

  .saqr-anim-sing .saqr-mouth { animation: saqrSing 0.35s ease-in-out 8; }
  .saqr-anim-sing .mascot-head { animation: saqrSingHead 1.4s ease-in-out 2; }
  .saqr-anim-sing .saqr-eye { animation: none; }
  .saqr-anim-sing .saqr-eye-open { animation: saqrHide 2.8s ease-in-out; }
  .saqr-anim-sing .saqr-eye-shut { animation: saqrShowEye 2.8s ease-in-out; }
  .saqr-anim-sing .saqr-wing-r { animation: saqrConduct 0.7s ease-in-out 4; }
  .saqr-anim-sing .fx-notes { opacity: 1; }
  .saqr-anim-sing .fx-notes .fx-item { animation: saqrFloat 1.4s ease-out both 2; }
  .saqr-anim-sing .fx-notes > g:nth-child(2) .fx-item { animation-delay: 0.45s; }
  .saqr-anim-sing .fx-notes > g:nth-child(3) .fx-item { animation-delay: 0.9s; }

  .saqr-anim-walk .saqr-move { animation: saqrWalk 2.4s ease-in-out; }
  .saqr-anim-walk .saqr-foot-l { animation: saqrStep 0.4s ease-in-out 6; }
  .saqr-anim-walk .saqr-foot-r { animation: saqrStep 0.4s ease-in-out 0.2s 6 both; }
  .saqr-anim-walk .saqr-wing-l { animation: saqrSwingL 0.4s ease-in-out 6; }
  .saqr-anim-walk .saqr-wing-r { animation: saqrSwingR 0.4s ease-in-out 0.2s 6 both; }
  .saqr-anim-walk .saqr-scarf-tail { animation: saqrFlutter 0.4s ease-in-out 6; }

  /* keep any animation going */
  .saqr-loop, .saqr-loop * { animation-iteration-count: infinite !important; }
}

@keyframes saqrBreathe { 50% { transform: scale(1.025, 0.975); } }
@keyframes saqrBlink { 0%, 93%, 100% { transform: none; } 96% { transform: scaleY(0.08); } }
@keyframes saqrShut { 50% { transform: scaleY(0.08); } }
@keyframes saqrHide { 0%, 100% { opacity: 1; } 12%, 85% { opacity: 0; } }
@keyframes saqrShowEye { 0%, 100% { opacity: 0; } 12%, 85% { opacity: 1; } }
@keyframes saqrShowEyeDown { 0%, 100% { opacity: 0; transform: scaleY(-1); } 12%, 85% { opacity: 1; transform: scaleY(-1); } }
@keyframes saqrTiltSmall { 50% { transform: rotate(-7deg); } }
@keyframes saqrLook { 0%, 100% { transform: none; } 15%, 35% { transform: translateX(-8px); } 50%, 70% { transform: translate(8px, -2px); } 85% { transform: translateY(-7px); } }
@keyframes saqrLookHead { 0%, 100% { transform: none; } 15%, 35% { transform: rotate(-5deg); } 50%, 70% { transform: rotate(5deg); } }
@keyframes saqrHop { 0%, 100% { transform: none; } 25% { transform: scale(1.08, 0.9); } 60% { transform: translateY(-26px) scale(0.95, 1.06); } 85% { transform: scale(1.05, 0.95); } }
@keyframes saqrFlapL { 50% { transform: rotate(65deg); } }
@keyframes saqrFlapR { 50% { transform: rotate(-65deg); } }
@keyframes saqrWave { 0%, 100% { transform: none; } 20%, 80% { transform: translate(30px, -2px) rotate(-120deg); } 35%, 65% { transform: translate(30px, -2px) rotate(-95deg); } 50% { transform: translate(30px, -2px) rotate(-135deg); } }
@keyframes saqrLift { 50% { transform: translateY(-10px); } }
@keyframes saqrFly { 0%, 100% { transform: none; } 20% { transform: translateY(-30px); } 40% { transform: translate(-8px, -42px) rotate(-5deg); } 60% { transform: translate(8px, -38px) rotate(5deg); } 80% { transform: translateY(-30px); } }
@keyframes saqrTuck { 15%, 85% { transform: scaleY(0.5); } }
@keyframes saqrFlutter { 50% { transform: rotate(-18deg); } }
@keyframes saqrShow { 0%, 100% { opacity: 0; } 15%, 80% { opacity: 1; } }
@keyframes saqrDance { 0%, 100% { transform: none; } 25% { transform: translateX(-10px) rotate(-8deg); } 50% { transform: translateY(-6px); } 75% { transform: translateX(10px) rotate(8deg); } }
@keyframes saqrBob { 50% { transform: translateY(5px); } }
@keyframes saqrStep { 50% { transform: translateY(-7px) rotate(-8deg); } }
@keyframes saqrNod { 50% { transform: translateY(8px) scaleY(0.96); } }
@keyframes saqrShake { 0%, 100% { transform: none; } 15%, 45%, 75% { transform: rotate(-11deg); } 30%, 60%, 90% { transform: rotate(11deg); } }
@keyframes saqrTilt { 0%, 100% { transform: none; } 25%, 75% { transform: rotate(-16deg); } }
@keyframes saqrPeekUp { 0%, 100% { transform: none; } 25%, 75% { transform: translate(5px, -7px); } }
@keyframes saqrTuft { 50% { transform: rotate(-16deg); } }
@keyframes saqrTuftUp { 0%, 100% { transform: none; } 15%, 70% { transform: scaleY(1.5) rotate(4deg); } }
@keyframes saqrSpin { 0% { transform: none; } 25% { transform: translateY(-12px) scaleX(0.05); } 50% { transform: translateY(-16px) scaleX(-1); } 75% { transform: translateY(-12px) scaleX(0.05); } 100% { transform: none; } }
@keyframes saqrArmsUpL { 0%, 100% { transform: none; } 15%, 85% { transform: translate(-30px, -2px) rotate(115deg); } 50% { transform: translate(-30px, -2px) rotate(135deg); } }
@keyframes saqrArmsUpR { 0%, 100% { transform: none; } 15%, 85% { transform: translate(30px, -2px) rotate(-115deg); } 50% { transform: translate(30px, -2px) rotate(-135deg); } }
@keyframes saqrPop { 0% { opacity: 0; transform: scale(0); } 35% { opacity: 1; transform: scale(1.35) rotate(25deg); } 75% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(0.8) rotate(-10deg); } }
@keyframes saqrShiver { 0%, 100% { transform: translateX(-2px); } 50% { transform: translateX(2px); } }
@keyframes saqrHugL { 0%, 100% { transform: none; } 20%, 80% { transform: rotate(-28deg); } }
@keyframes saqrHugR { 0%, 100% { transform: none; } 20%, 80% { transform: rotate(28deg); } }
@keyframes saqrDrip { 0% { opacity: 0; transform: none; } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(18px); } }
@keyframes saqrPeck { 0%, 100% { transform: none; } 45% { transform: translateY(16px) rotate(7deg); } }
@keyframes saqrDoze { 0%, 100% { transform: none; } 15%, 85% { transform: rotate(9deg) translateY(5px); } }
@keyframes saqrFloat { 0% { opacity: 0; transform: translateY(10px) scale(0.4); } 25% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: translate(6px, -34px) scale(1.1); } }
@keyframes saqrSway { 0%, 100% { transform: none; } 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
@keyframes saqrBlush { 0%, 100% { transform: none; } 20%, 80% { transform: scale(1.5, 1.35); } }
@keyframes saqrHeartEyes { 0%, 100% { transform: none; } 20%, 80% { transform: scale(1.18); } }
@keyframes saqrStartle { 0% { transform: none; } 12% { transform: translateY(-18px) scale(1.06); } 30% { transform: translateY(0) scale(1.04, 0.96); } 45%, 80% { transform: translateX(-6px) rotate(-3deg); } 100% { transform: none; } }
@keyframes saqrBigEyes { 0%, 100% { transform: none; } 12%, 75% { transform: scale(1.18); } }
@keyframes saqrSing { 0%, 100% { opacity: 0; transform: scaleY(0.6); } 50% { opacity: 1; transform: none; } }
@keyframes saqrSingHead { 0%, 100% { transform: none; } 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }
@keyframes saqrConduct { 0%, 100% { transform: translate(24px, -2px) rotate(-60deg); } 50% { transform: translate(30px, -2px) rotate(-110deg); } }
@keyframes saqrWalk { 0%, 100% { transform: none; } 25% { transform: translateX(-18px) rotate(-4deg); } 50% { transform: translateX(0) rotate(4deg); } 75% { transform: translateX(18px) rotate(-4deg); } }
@keyframes saqrSwingL { 50% { transform: rotate(18deg); } }
@keyframes saqrSwingR { 50% { transform: rotate(-18deg); } }
.feedback-mascot { width: 56px; height: auto; }
.feedback { align-items: center; }
.mascot-says { display: flex; align-items: center; gap: 0.8rem; justify-content: center; }
.mascot-bubble { position: relative; background: #fff; border: var(--border); border-radius: 22px 22px 22px 6px; padding: 0.6rem 0.9rem; font-weight: 800; max-width: 30ch; text-align: start; box-shadow: var(--pop-sm); }
.result-hero { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 1rem; }
.empty .mascot { margin: 0 auto 0.6rem; }

/* ---------- Saqr on the home page ---------- */
.hero-mascot { display: flex; align-items: center; gap: 0.7rem; cursor: pointer; margin-bottom: -1.6rem; align-self: stretch; justify-content: center; }
.hero-mascot .mascot-bubble { font-size: 0.95rem; max-width: 24ch; }
@media (prefers-reduced-motion: no-preference) {
  .hero-mascot-art { animation: saqrSway 3.2s ease-in-out infinite; transform-origin: 50% 100%; }
}
@keyframes saqrSway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg) translateY(-3px); } }
@media (max-width: 760px) { .hero-mascot .mascot { width: 92px; height: 97px; } }

/* ---------- Word page (/word/<slug>.html) ---------- */
.word-page { max-width: 820px; padding-top: 2rem; padding-bottom: 3.5rem; }
.word-page > * + * { margin-top: 1.6rem; }
.word-page h2 { font-size: var(--s2); margin: 0; }
.word-hero-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.35rem; padding: 2rem 1.4rem 1.6rem; }
.word-hero-card h1 { font-size: inherit; margin: 0.4rem 0 0; }
.word-big { font-size: clamp(3rem, 9vw, 4.4rem); line-height: 1.25; color: var(--ink); }
.word-say .tr { display: inline-block; background: var(--sun); border: var(--border); border-radius: 999px; padding: 0.1em 0.9em; font-weight: 900; font-size: var(--s1); }
.word-means { font-family: var(--f-display); font-size: var(--s3); font-weight: 800; margin-top: 0.3rem; }
.word-hero-card .play-row { justify-content: center; margin: 0.8rem 0 0.4rem; }
.word-tools { display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap; }
.usage-card { padding: 1.4rem 1.5rem; }
.usage-head { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 0.8rem; }
.usage-head .mascot { width: 64px; height: auto; }
.usage-text { font-size: 1.05rem; line-height: 1.65; font-weight: 600; color: var(--ink); }
.usage-tip { margin-top: 1rem; background: #FFF6DD; border-radius: 16px; padding: 0.75rem 1rem; line-height: 1.55; }
.section-row { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 1rem; }
.example-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.9rem; }
.example { background: #fff; border: var(--border); border-radius: 24px; box-shadow: var(--pop-sm); padding: 0.9rem 1.2rem 1.1rem; transition: background 0.2s, transform 0.2s; min-width: 0; overflow-wrap: anywhere; }
.example.speaking { background: #FFF6DD; transform: translateY(-2px); }
.example-top { display: flex; align-items: center; justify-content: space-between; }
.example-num { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--c-soft, #e6f6f4); border: 2px solid var(--ink); font-weight: 900; font-size: 0.85rem; }
.example .icon-btn.play { width: 42px; height: 42px; }
.example-ar { font-size: clamp(1.45rem, 4.5vw, 1.8rem); line-height: 1.7; text-align: right; margin: 0.3rem 0 0.4rem; color: var(--ink); }
.example-ar mark { background: linear-gradient(transparent 45%, var(--sun) 45%); color: inherit; padding: 0 0.1em; border-radius: 4px; }
.example-tr { color: var(--c-deep, var(--ink)); font-weight: 800; border-top: 2px dashed var(--line, #dbe7e7); padding-top: 0.5rem; }
.example-en { color: var(--ink-2); font-weight: 600; margin-top: 0.15rem; }
.word-cta { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.word-cta .btn { justify-content: center; }
.related-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.7rem; }
.related-grid a { height: 100%; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.15rem; text-decoration: none; color: inherit; background: #fff; border: 2px solid var(--ink); border-radius: 20px; padding: 0.8rem 0.5rem; transition: transform 0.2s, background 0.2s; }
@media (hover: hover) { .related-grid a:hover { transform: translateY(-3px); background: #FFF6DD; } }
.related-grid .ar { font-size: 1.35rem; line-height: 1.4; margin-top: 0.2rem; }
.related-grid .tr { font-weight: 900; font-size: 0.85rem; color: var(--c-deep, var(--ink)); }
.related-grid .rel-en { font-size: 0.8rem; color: var(--ink-2); font-weight: 700; }
.word-page-link { margin: 0.4rem 0 0.8rem; }
.word-page .btn { white-space: normal; max-width: 100%; text-align: center; }
@media (max-width: 760px) {
  .related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .usage-card { padding: 1.1rem; }
}
@media (max-width: 400px) { .word-cta { grid-template-columns: 1fr; } }

/* ---------- Notifications (the bell) ---------- */
.notif { position: relative; }
.notif-btn { position: relative; width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--ink); background: #fff; cursor: pointer; display: grid; place-items: center; padding: 0; color: var(--ink); transition: transform 0.25s var(--ease); }
.notif-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
@media (hover: hover) { .notif-btn:hover { transform: rotate(-12deg); } }
.notif-dot { position: absolute; top: 3px; inset-inline-end: 3px; width: 11px; height: 11px; border-radius: 50%; background: var(--coral, #E8336D); border: 2px solid #fff; }
.notif-dot[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .notif-dot:not([hidden]) { animation: notifPulse 1.8s ease-in-out infinite; }
}
@keyframes notifPulse { 50% { transform: scale(1.25); } }
.notif-panel { position: absolute; top: calc(100% + 10px); inset-inline-end: -60px; z-index: 60; width: min(360px, calc(100vw - 32px)); background: #fff; border: var(--border); border-radius: 22px; box-shadow: var(--pop); padding: 0.8rem; }
.notif-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.2rem 0.4rem 0.6rem; }
.link-btn { border: 0; background: none; color: var(--c-deep, var(--ink)); font: inherit; font-weight: 800; font-size: 0.85rem; cursor: pointer; text-decoration: none; padding: 0; }
.notif-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; max-height: min(55vh, 380px); overflow-y: auto; }
.notif-list a { display: flex; gap: 0.6rem; align-items: flex-start; text-decoration: none; color: inherit; padding: 0.55rem 0.6rem; border-radius: 14px; }
@media (hover: hover) { .notif-list a:hover { background: var(--c-soft, #f2f7f7); } }
.notif-list .unread a { background: #FFF6DD; }
.notif-list b { display: block; line-height: 1.25; }
.notif-list small { display: block; color: var(--ink-2); font-weight: 700; margin-top: 0.15rem; }
.notif-list em { display: block; font-style: normal; font-size: 0.75rem; color: var(--ink-3); margin-top: 0.2rem; font-weight: 800; }
.notif-kind { font-size: 1.3rem; line-height: 1.2; }
.notif-note { color: var(--ink-2); font-weight: 700; padding: 0.4rem; font-size: 0.9rem; }
.notif-foot { border-top: 2px dashed var(--line, #d6e2e2); margin-top: 0.6rem; padding: 0.6rem 0.4rem 0.1rem; display: grid; gap: 0.4rem; }
@media (max-width: 800px) { .notif-btn { width: 36px; height: 36px; } }
@media (max-width: 520px) {
  .sfx-btn { display: none; }
  .notif { position: static; }
  .notif-panel { position: fixed; top: 84px; inset-inline: 16px; width: auto; }
}

/* ---------- TikTok video maker ---------- */
.video-box { display: grid; gap: 0.8rem; justify-items: start; margin-top: 1.4rem; padding: 1.1rem 1.2rem 1.2rem; background: #F3F6FF; border: 2px solid var(--ink); border-radius: 24px; }
.video-box .voice-note { margin: 0.2rem 0 0; line-height: 1.55; font-size: 0.92rem; max-width: 52ch; }
.studio-controls > .voice-note { margin-top: 1.2rem; line-height: 1.55; font-size: 0.92rem; max-width: 60ch; }
.video-result { width: 100%; }
.btn-video { background: #111; color: #fff; border-color: #111; }
@media (hover: hover) { .btn-video:hover { background: #25F4EE; color: #111; } }
.btn-video.recording { background: var(--coral, #E8336D); border-color: var(--ink); color: #fff; }
.btn-video[disabled] { opacity: 0.85; cursor: progress; }
.video-result { margin-top: 0.4rem; }
.video-result h4 { margin-bottom: 0.5rem; }
.video-result video { width: min(260px, 100%); display: block; border-radius: 22px; border: var(--border); background: #000; margin-bottom: 0.8rem; }

/* ---------- Guides and blog (/blog/) ---------- */
.article-page { padding-top: 2rem; padding-bottom: 3rem; }
.article-head { max-width: 760px; margin-bottom: 2rem; }
.article-head .chip { text-decoration: none; margin-bottom: 0.8rem; }
.article-head h1 { font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.12; margin: 0.6rem 0 0.8rem; }
.article-lede { font-size: var(--s1); color: var(--ink-2); line-height: 1.55; }
.article-meta { margin-top: 0.8rem; font-size: 0.88rem; font-weight: 800; color: var(--ink-3); }
.hub-head { display: flex; align-items: center; gap: 1.2rem; max-width: 900px; }
.hub-head .mascot { flex: none; }
.hub-cats { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.6rem; }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 2.4rem; align-items: start; }
.article-body { background: #fff; border: var(--border); border-radius: var(--r-lg); box-shadow: var(--pop); padding: 2rem 2.2rem; min-width: 0; overflow-wrap: anywhere; }
.article-body > * + * { margin-top: 1rem; }
.article-body h2 { font-size: var(--s3); margin-top: 2.2rem; }
.article-body h2:first-child { margin-top: 0; }
.article-body h3 { font-size: var(--s2); margin-top: 1.6rem; }
.article-body p, .article-body li { font-size: 1.06rem; line-height: 1.7; color: var(--ink); }
.article-body ul { padding-left: 1.3rem; display: grid; gap: 0.4rem; }
.article-body a { color: var(--c-deep, #0A7E86); font-weight: 800; border-radius: 6px; padding: 0 0.15em; margin: 0 -0.15em; background: color-mix(in srgb, var(--c, #10B3A3) 12%, transparent); transition: background 0.15s, color 0.15s; }
@media (hover: hover) { .article-body a:hover { background: color-mix(in srgb, var(--c, #10B3A3) 26%, transparent); } }
.article-examples { list-style: none; padding: 0; display: grid; gap: 0.6rem; }
.article-ex { display: flex; gap: 0.9rem; align-items: center; background: #F3F6FF; border: 2px solid var(--ink); border-radius: 18px; padding: 0.7rem 0.9rem; }
.article-ex > div { display: grid; min-width: 0; flex: 1; }
.article-ex .ar { font-size: 1.45rem; line-height: 1.5; text-align: right; }
.article-ex .tr { color: var(--c-deep, #0A7E86); font-weight: 800; font-size: 0.95rem; }
.article-ex .en { color: var(--ink-2); font-size: 0.95rem; }
.article-ex .icon-btn { flex: none; width: 40px; height: 40px; }
.article-faq h2 { margin-bottom: 1rem; }
.article-faq summary { line-height: 1.4; }
.article-faq details { border: 2px solid var(--ink); border-radius: 16px; padding: 0.7rem 1rem; background: #FFFBEF; }
.article-faq details + details { margin-top: 0.6rem; }
.article-faq summary { font-weight: 900; cursor: pointer; }
.article-faq details p { margin-top: 0.5rem; }
.article-side { display: grid; gap: 1.2rem; position: sticky; top: 110px; }
.side-box { background: #fff; border: var(--border); border-radius: 22px; padding: 1.1rem 1.2rem; box-shadow: var(--pop-sm); }
.side-box h2 { font-size: var(--s1); margin-bottom: 0.6rem; }
.side-box ul { list-style: none; padding: 0; display: grid; gap: 0.35rem; }
.side-box a { text-decoration: none; font-weight: 800; color: var(--ink); }
@media (hover: hover) { .side-box a:hover { color: var(--c-deep, #0A7E86); } }
.side-words .ar { font-size: 1.15rem; }
.side-words .tr { color: var(--c-deep, #0A7E86); font-size: 0.85rem; }
.side-words .muted { font-size: 0.8rem; }
.side-cta { text-align: center; display: grid; justify-items: center; gap: 0.5rem; background: #FFF6DD; }
.side-cta p { font-size: 0.92rem; color: var(--ink-2); }
.article-related, .hub-section { margin-top: 2.6rem; }
.article-related h2, .hub-section h2 { font-size: var(--s3); margin-bottom: 0.4rem; }
.hub-section h2 a { color: inherit; text-decoration: none; }
.hub-section > .muted { margin-bottom: 1rem; }
.article-grid { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 1rem; }
.article-card { height: 100%; display: grid; align-content: start; gap: 0.5rem; text-decoration: none; color: inherit; background: #fff; border: var(--border); border-radius: 22px; box-shadow: var(--pop-sm); padding: 1.1rem 1.2rem; transition: transform 0.2s var(--ease); }
@media (hover: hover) { .article-card:hover { transform: translateY(-3px); } }
.article-card .chip { justify-self: start; }
.article-card strong { font-family: var(--f-display); font-size: 1.15rem; line-height: 1.25; }
.article-card span:last-child { color: var(--ink-2); font-size: 0.92rem; line-height: 1.5; }
.guide-links { margin-top: 1.6rem; }
@media (max-width: 900px) {
  .article-layout { grid-template-columns: 1fr; }
  .article-side { position: static; }
  .article-body { padding: 1.3rem 1.1rem; }
  .hub-head { flex-direction: column; align-items: flex-start; }
}

/* Seven nav links: tighten a little on laptop widths so everything fits on one line */
@media (min-width: 1181px) and (max-width: 1400px) {
  .nav { gap: 0; }
  .nav a { padding: 0.45rem 0.5rem; font-size: 0.95rem; }
  .nav-shell { gap: 0.5rem; }
  .nav-right { gap: 0.4rem; }
}

/* ---------- Settings button in the nav + the Settings page ---------- */
.nav-settings { display: inline-flex; align-items: center; gap: 0.3rem; height: 40px; padding: 0 0.7rem; border-radius: 999px; border: 2px solid var(--ink); background: #fff; color: var(--ink); text-decoration: none; font-weight: 900; font-size: 0.8rem; transition: transform 0.25s var(--ease); }
.nav-settings svg { width: 19px; height: 19px; transition: transform 0.4s var(--ease); }
@media (hover: hover) { .nav-settings:hover svg { transform: rotate(60deg); } }
.nav-settings.current { background: var(--ink); color: #fff; }
@media (max-width: 520px) { .nav-settings { padding: 0 0.55rem; } .nav-settings .lang-code { display: none; } .nav-settings { width: 36px; height: 36px; justify-content: center; padding: 0; } }
.settings-page { max-width: 820px; padding-bottom: 3rem; }
.settings-head { display: flex; align-items: center; gap: 1rem; }
.settings-head .mascot { flex: none; }
.settings-card { margin-top: 1.2rem; }
.settings-card h2 { font-size: var(--s2); margin-bottom: 0.3rem; }
.settings-card > .muted { margin-bottom: 1rem; }
.lang-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(170px, 100%), 1fr)); gap: 0.6rem; }
.lang-choice { display: grid; gap: 0.15rem; text-align: start; border: 2px solid var(--ink); border-radius: 18px; background: #fff; padding: 0.7rem 0.9rem; cursor: pointer; font: inherit; transition: transform 0.2s var(--ease), background 0.2s; }
@media (hover: hover) { .lang-choice:hover { transform: translateY(-2px); } }
.lang-choice[aria-pressed='true'] { background: var(--sun); box-shadow: var(--pop-sm); }
.lang-choice b { font-size: 1.1rem; }
.lang-choice small { color: var(--ink-2); font-weight: 700; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; font-weight: 800; padding: 0.6rem 0; }
.switch-row input { appearance: none; width: 54px; height: 30px; border-radius: 999px; background: #cfd5e6; border: 2px solid var(--ink); position: relative; cursor: pointer; flex: none; transition: background 0.2s; }
.switch-row input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); transition: transform 0.2s var(--ease); }
.switch-row input:checked { background: var(--sea, #10B3A3); }
.switch-row input:checked::after { transform: translateX(24px); }
[dir='rtl'] .switch-row input:checked::after { transform: translateX(-24px); }
[dir='rtl'] .switch-row input::after { left: auto; right: 2px; }
.name-row { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.name-row .input { flex: 1 1 220px; max-width: none; }
.stat-grid { list-style: none; padding: 0; margin: 0.4rem 0 1.2rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 0.6rem; }
.stat-grid li { display: grid; justify-items: center; gap: 0.1rem; background: #F3F6FF; border: 2px solid var(--ink); border-radius: 18px; padding: 0.8rem 0.5rem; text-align: center; }
.stat-grid b { font-family: var(--f-display); font-size: var(--s3); line-height: 1; }
.stat-grid span:last-child { font-size: 0.85rem; font-weight: 800; color: var(--ink-2); }
.stat-emo { font-size: 1.4rem; }
.btn-danger { background: #fff; color: #B0154B; border-color: #B0154B; }
@media (hover: hover) { .btn-danger:hover { background: #FFE4EC; } }
@media (max-width: 520px) { .lang-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .lang-choice { padding: 0.6rem 0.7rem; } .lang-choice b { font-size: 1rem; } }
.settings-page, .settings-page * { overflow-wrap: anywhere; } .switch-row > span, .lang-choice, .stat-grid li { min-width: 0; } .settings-head > div { min-width: 0; }

/* ---------- Nav v3: five links + "More", one progress chip ---------- */
.nav { align-items: center; }
.nav-more { position: relative; }
.nav-more-btn {
  display: inline-flex; align-items: center; gap: 0.3rem; font: inherit; font-family: var(--f-body); font-weight: 800; color: var(--ink);
  padding: 0.5rem 0.75rem; border-radius: 999px; border: 0; background: none; cursor: pointer; white-space: nowrap;
}
.nav-more.open .nav-more-btn { background: var(--c-soft, var(--foam)); }
@media (hover: hover) { .nav-more-btn:hover { background: var(--c-soft, var(--foam)); } }
.nav-more-btn.current { background: var(--ink); color: #fff; }
.nav-more-btn .caret { font-size: 0.75em; transition: transform 0.2s; }
.nav-more.open .caret { transform: rotate(180deg); }
.nav-more-menu {
  display: none; position: absolute; top: calc(100% + 10px); inset-inline-end: 0; min-width: 210px; z-index: 60;
  background: var(--paper); border: var(--border); border-radius: 22px; box-shadow: var(--pop); padding: 0.45rem; flex-direction: column; gap: 0.15rem;
}
.nav-more.open .nav-more-menu { display: flex; animation: pop 0.2s cubic-bezier(.2, 1.4, .4, 1); }
.nav .nav-more-menu a { padding: 0.6rem 0.85rem; border-radius: 14px; width: 100%; }
.nav .nav-more-menu .nav-emo { display: inline; }
.nav-known { text-decoration: none; }
@media (min-width: 1181px) {
  .nav a, .nav-more-btn { padding: 0.5rem 0.8rem; font-size: 1rem; }
  .nav { gap: 0.15rem; }
}
/* phone/tablet menu: show the "More" links as normal rows */
@media (max-width: 1180px) {
  .nav-more-btn { display: none; }
  .nav-more { display: contents; }
  .nav-more-menu { display: contents; }
  .nav .nav-more-menu a { width: auto; border-radius: 999px; padding: 0.8rem 1rem; }
}
@media (max-width: 420px) { .nav-known { display: none; } }

/* ---------- Footer link hub ---------- */
.footer-col h4 { white-space: nowrap; }
.footer-col a { font-size: 0.95rem; line-height: 1.3; }
.footer-col a span[aria-hidden] { width: 1.3em; text-align: center; flex: none; }
.footer-col .more-link { color: var(--sun); font-weight: 800; margin-top: 0.3rem; }
.footer-bottom { flex-wrap: wrap; }
.footer-mini { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; }
.footer-mini a { color: #dfe2ff; text-decoration: none; font-size: 0.88rem; }
@media (hover: hover) { .footer-mini a:hover { color: #fff; } }
/* footer layout: brand + word of the day share the first column; levels as one tidy list */
.footer-grid { grid-template-columns: 1.25fr 1fr 0.9fr 1.15fr 1.15fr; grid-template-areas: "brand levels practice topics guides" "wotd levels practice topics guides"; align-items: start; }
.footer-brand { grid-area: brand; }
.footer-grid .wotd { grid-area: wotd; }
.footer-levels { grid-area: levels; display: flex; flex-direction: column; }
.footer-levels a { flex-wrap: wrap; column-gap: 0.4rem; }
@media (max-width: 1100px) {
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; grid-template-areas: "brand brand wotd" "levels practice topics" "guides guides guides"; }
  .footer-grid > nav[aria-label="Guides"] { grid-area: guides; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); column-gap: 1.5rem; }
  .footer-grid > nav[aria-label="Guides"] h4 { grid-column: 1 / -1; }
  .footer-grid > nav[aria-label="Practice"] { grid-area: practice; }
  .footer-grid > nav[aria-label="Word topics"] { grid-area: topics; }
}
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr 1fr; grid-template-areas: "brand brand" "wotd wotd" "levels practice" "topics topics" "guides guides"; }
  .footer-grid > nav[aria-label="Word topics"] { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1rem; }
  .footer-grid > nav[aria-label="Word topics"] h4 { grid-column: 1 / -1; }
}
@media (max-width: 420px) {
  .footer-grid { gap: 1.6rem 1rem; }
  .footer-grid > nav[aria-label="Word topics"] { grid-template-columns: 1fr; }
}
@media (min-width: 1101px) { .footer-grid { grid-template-rows: auto 1fr; } .footer-grid .wotd { margin-top: 0.4rem; } }
@media (min-width: 1181px) and (max-width: 1300px) { html[data-lang='ml'] .nav a, html[data-lang='ml'] .nav-more-btn { padding: 0.45rem 0.45rem; font-size: 0.88rem; } html[data-lang='ml'] .logo-word { font-size: 1.1rem; } }

/* article tables and numbered steps */
.article-table-wrap { overflow-x: auto; margin: 1.2rem 0; border: var(--border); border-radius: 18px; background: #fff; }
.article-table { width: 100%; border-collapse: collapse; font-size: 0.98rem; }
.article-table th, .article-table td { padding: 0.65rem 0.9rem; text-align: start; border-bottom: 2px solid var(--foam); }
.article-table th { background: var(--foam); font-weight: 900; }
.article-table tr:last-child td { border-bottom: 0; }
.article-table [lang='ar'] { font-size: 1.15rem; }
.article-steps { padding-inline-start: 1.4rem; margin: 1rem 0; }
.article-steps li { margin: 0.4rem 0; padding-inline-start: 0.3rem; }
.article-steps li::marker { font-weight: 900; color: var(--sea); }

/* Links inside running text: no underline, colour + soft highlight on hover */
:where(p, li, dd, td) > a:not([class]) { color: var(--c-deep, #0A7E86); font-weight: 800; border-radius: 6px; transition: background 0.15s, color 0.15s; }
@media (hover: hover) { :where(p, li, dd, td) > a:not([class]):hover { background: color-mix(in srgb, var(--c, #10B3A3) 16%, transparent); } }
.footer-col :where(p, li) > a:not([class]), .footer-mini a { color: #dfe2ff; }

/* ---------- Dialect labels: Riyadh (Najdi), Jeddah (Hijazi), All Saudi ---------- */
:root { --najdi: #14874b; --najdi-soft: #d9f7e6; --hijazi: #1565b0; --hijazi-soft: #dceeff; --saudi: #8a6400; --saudi-soft: #fff0cc; }
.dl-badge {
  display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.12rem 0.55rem 0.12rem 0.45rem;
  border-radius: 999px; border: 2px solid currentColor; background: #fff;
  font: 800 0.72rem/1.3 var(--f-body); letter-spacing: 0.01em; white-space: nowrap; text-decoration: none;
}
.dl-badge .dl-dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: currentColor; flex: none; }
.dl-najdi { color: var(--najdi); }
.dl-hijazi { color: var(--hijazi); }
.dl-saudi { color: var(--saudi); }
.dl-badge.dl-najdi { background: var(--najdi-soft); }
.dl-badge.dl-hijazi { background: var(--hijazi-soft); }
.dl-badge.dl-saudi { background: var(--saudi-soft); }
.dl-big { font-size: 0.85rem; padding: 0.2rem 0.7rem 0.2rem 0.55rem; }
@media (hover: hover) { a.dl-badge:hover { filter: brightness(0.96); } }
.word .dl-badge { margin-top: 0.25rem; align-self: center; }
.word-hero-card .dl-badge { margin-top: 0.2rem; }

.dl-info { border: var(--border); border-radius: 24px; padding: 1.1rem 1.3rem; background: #fff; box-shadow: var(--pop-sm); color: var(--ink); }
.dl-info.dl-najdi { background: var(--najdi-soft); }
.dl-info.dl-hijazi { background: var(--hijazi-soft); }
.dl-info.dl-saudi { background: var(--saudi-soft); }
.dl-info-head { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.45rem; }
.dl-info-head b { font-family: var(--f-display); font-size: 1.1rem; }
.dl-info p { margin: 0.25rem 0; }
.dl-info .ar { font-size: 1.15em; font-weight: 700; }
.dl-twin { font-weight: 800; color: var(--ink); background: #fff; border: 2px solid var(--ink); border-radius: 12px; padding: 0 0.45rem; text-decoration: none; white-space: nowrap; }
@media (hover: hover) { .dl-twin:hover { background: var(--sun); } }
.dl-twin .tr { font-size: 0.9em; color: var(--ink-2, #4a4f7a); }
.dl-sound { font-size: 0.92rem; }
.dl-more { display: inline-block; margin-top: 0.4rem; font-weight: 800; color: var(--c-deep, var(--sea-deep)); text-decoration: none; }
@media (hover: hover) { .dl-more:hover { text-decoration: none; background: var(--c-soft, #d7f5f1); border-radius: 8px; } }

/* dictionary filter */
.dl-filter { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; justify-content: center; margin: 0.6rem 0 0.2rem; }
.dl-filter button { font: 800 0.9rem var(--f-body); border: var(--border); border-radius: 999px; padding: 0.35rem 0.9rem; background: #fff; color: var(--ink); cursor: pointer; display: inline-flex; gap: 0.35rem; align-items: center; }
.dl-filter button .dl-dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: currentColor; }
.dl-filter button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.dl-filter button.dl-najdi[aria-pressed="true"] { background: var(--najdi); border-color: var(--ink); }
.dl-filter button.dl-hijazi[aria-pressed="true"] { background: var(--hijazi); }
.dl-filter button.dl-saudi[aria-pressed="true"] { background: var(--saudi); }
.dl-filter small { opacity: 0.75; font-weight: 700; }
/* ---------- /dialects.html: Najdi and Hijazi explained ---------- */
.dialects-page { max-width: 1100px; padding-top: 1.2rem; padding-bottom: 3rem; }
.dialects-hero { display: flex; gap: 1.4rem; align-items: center; margin: 1rem 0 1.6rem; }
.dialects-hero h1 { margin: 0 0 0.5rem; }
.dialects-hero .lede { font-size: 1.12rem; max-width: 62ch; }
.dl-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.dl-card { display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-start; padding: 1.2rem 1.3rem; border: var(--border); border-radius: 26px; box-shadow: var(--pop); text-decoration: none; color: var(--ink); transition: transform 0.2s var(--ease); }
@media (hover: hover) { .dl-card:hover { transform: translateY(-3px); } }
.dl-card.dl-najdi { background: var(--najdi-soft); }
.dl-card.dl-hijazi { background: var(--hijazi-soft); }
.dl-card.dl-saudi { background: var(--saudi-soft); }
.dl-card h2 { margin: 0.2rem 0 0; font-size: 1.35rem; }
.dl-card h2 .ar { font-size: 0.9em; margin-inline-start: 0.3rem; }
.dl-card p { margin: 0; color: var(--ink); }
.dl-card .dl-count { margin-top: auto; padding-top: 0.4rem; font-weight: 800; }
.dl-card .dl-count b { font-size: 1.3rem; }
.dialects-section { margin: 2.2rem 0; }
.dialects-section > h2 { margin-bottom: 0.4rem; }
.dialects-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem 2rem; }
.dialects-two h2 { margin: 0 0 0.5rem; }
.dialects-two ul { padding-inline-start: 1.1rem; display: grid; gap: 0.45rem; }
.dialects-choose { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 0.8rem 0; }
.dialect-compare td a { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 0 0.45rem; text-decoration: none; color: var(--ink); font-weight: 700; }
@media (hover: hover) { .dialect-compare td a:hover { color: var(--c-deep, var(--sea-deep)); } }
.dialect-compare .ar { font-size: 1.2rem; font-weight: 700; }
.dialect-compare .tr { font-size: 0.9rem; color: var(--ink-2, #4a4f7a); }
.dialect-compare th:nth-child(2) { background: var(--najdi-soft); }
.dialect-compare th:nth-child(3) { background: var(--hijazi-soft); }
.dl-word-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.45rem; }
.dl-word-list a { display: inline-flex; gap: 0.35rem; align-items: baseline; padding: 0.3rem 0.7rem; border: 2px solid var(--ink); border-radius: 14px; background: #fff; text-decoration: none; color: var(--ink); font-weight: 700; }
@media (hover: hover) { .dl-word-list a:hover { background: var(--sun); } }
.dl-word-list .muted { font-size: 0.85rem; font-weight: 600; }
.sayable { cursor: pointer; border-radius: 6px; }
.sayable:focus-visible { background: var(--sun); outline: none; }
@media (hover: hover) { .sayable:hover { background: var(--sun); outline: none; } }
@media (max-width: 860px) {
  .dl-cards, .dialects-two, .dialects-choose { grid-template-columns: 1fr; }
  .dialects-hero { flex-direction: column; align-items: flex-start; }
}

.harakat-demo { display: flex; flex-direction: column; gap: 0.2rem; margin-top: 0.6rem; }
.harakat-demo .ar { font-size: 1.8rem; font-weight: 700; }

/* hero cities, coloured by dialect */
a.city { text-decoration: none; color: var(--ink); display: inline-flex; align-items: center; gap: 0.3rem; }
@media (hover: hover) { a.city:hover { background: var(--sun); } }
.city .dl-dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; display: inline-block; }
.city-najdi .dl-dot { background: var(--najdi); }
.city-hijazi .dl-dot { background: var(--hijazi); }
.hero-word .dl-badge { margin-top: 0.3rem; }

/* Hero never wider than the screen: columns may shrink, long buttons wrap, the circles stay inside. */
.hero-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.hero-copy, .hero-stage { min-width: 0; }
.hero .btn-row .btn { white-space: normal; text-align: center; max-width: 100%; }
.hero h1 { overflow-wrap: break-word; }
.blob.c { right: 0; }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .blob.c { width: 130px; height: 130px; }
}
@media (max-width: 420px) {
  .hero h1 { font-size: 2.2rem; }
  .hero .btn-row .btn { width: 100%; }
  .blob.a { width: 100px; height: 100px; }
  .blob.c { width: 100px; height: 100px; }
}

.dl-filter button.dl-najdi .dl-dot { background: var(--najdi); }
.dl-filter button.dl-hijazi .dl-dot { background: var(--hijazi); }
.dl-filter button.dl-saudi .dl-dot { background: var(--saudi); }
.dl-filter button[aria-pressed="true"] .dl-dot { background: #fff; }

/* ---------- Accounts: header button, sign-in window, page lock, account page ---------- */
.acct-slot { display: flex; align-items: center; }
.avatar { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--ink); background: var(--sun); color: var(--ink); display: inline-grid; place-items: center; font-weight: 900; font-size: 1.05rem; object-fit: cover; flex: none; }
.avatar.ghost { background: #e8ecf5; border-color: #c9cfe0; }
.avatar.lg { width: 48px; height: 48px; }
.avatar.xl { width: 96px; height: 96px; font-size: 2.4rem; border-width: 3px; }
.acct { position: relative; }
.acct-btn { border: 0; background: none; padding: 0; cursor: pointer; border-radius: 50%; display: block; }
.acct-btn:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.acct-menu { position: absolute; right: 0; top: calc(100% + 10px); z-index: 70; min-width: 240px; background: #fff; border: var(--border); border-radius: 22px; box-shadow: 4px 6px 0 var(--ink); padding: 0.6rem; display: grid; gap: 0.15rem; }
.acct-menu[hidden] { display: none; }
.acct-who { display: flex; gap: 0.7rem; align-items: center; padding: 0.4rem 0.4rem 0.7rem; border-bottom: 2px dashed #d6e2e2; margin-bottom: 0.3rem; min-width: 0; }
.acct-who div { min-width: 0; }
.acct-who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-who small { display: block; color: #5a5f8f; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-menu a, .acct-menu button { display: block; text-align: left; padding: 0.55rem 0.7rem; border-radius: 12px; font-weight: 800; color: var(--ink); background: none; border: 0; font: inherit; font-weight: 800; cursor: pointer; }
@media (hover: hover) { .acct-menu a:hover, .acct-menu button:hover { background: #eef9f7; } }
@media (max-width: 800px) { .avatar { width: 36px; height: 36px; } .acct-signin { padding-inline: 0.7rem; } }

.login-modal { max-width: 440px; width: 100%; }
.login-reason { background: #fff6dd; border: 2px solid var(--ink); border-radius: 16px; padding: 0.7rem 0.9rem; font-weight: 800; margin-bottom: 1rem; }
.btn-google { width: 100%; justify-content: center; gap: 0.7rem; background: #fff; }
.login-or { display: flex; align-items: center; gap: 0.8rem; margin: 1rem 0; color: #5a5f8f; font-weight: 800; font-size: 0.85rem; }
.login-or::before, .login-or::after { content: ''; flex: 1; border-top: 2px dashed #d6e2e2; }
.login-form { display: grid; gap: 0.8rem; }
.login-form label { display: grid; gap: 0.3rem; font-weight: 800; }
.login-form .btn { justify-content: center; }
.login-msg { font-weight: 800; color: var(--sea-deep); }
.login-msg.bad { color: #c2185b; }
.login-switch { margin-top: 1rem; text-align: center; font-weight: 700; }
.login-switch .link-btn { font-size: inherit; text-decoration: none; }
.login-small { margin-top: 0.8rem; text-align: center; font-size: 0.85rem; }

main.is-locked { position: relative; }
main.is-locked > :not(.lock-card) { filter: blur(7px); pointer-events: none; user-select: none; max-height: 80vh; overflow: hidden; opacity: 0.7; }
.lock-card { position: sticky; top: 96px; z-index: 20; display: grid; place-items: center; padding: 1.5rem 16px 0; margin-bottom: -2rem; }
.lock-inner { max-width: 520px; width: 100%; text-align: center; background: #fff; border: var(--border); border-radius: 30px; box-shadow: 6px 8px 0 var(--ink); padding: 1.8rem 1.4rem; }
.lock-emo { font-size: 3rem; line-height: 1; }
.lock-inner h2 { margin: 0.4rem 0; }
.lock-inner p { margin-bottom: 1rem; }
.chip-lock { background: #fff6dd; }

.account-page { max-width: 760px; }
.account-hero { text-align: center; display: grid; justify-items: center; gap: 0.8rem; margin-top: 2rem; }
.account-who { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.account-who > div { min-width: 0; flex: 1 1 220px; }
.account-who h2 { overflow-wrap: anywhere; }
.avatar-edit { position: relative; cursor: pointer; display: inline-block; border-radius: 50%; }
.avatar-edit-label { position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 0.7rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.avatar-edit:focus-within { outline: 3px solid var(--sun); outline-offset: 3px; }
.verify-note { margin-top: 0.4rem; background: #fff6dd; border-radius: 12px; padding: 0.4rem 0.7rem; font-weight: 700; }
.danger-zone { border-color: #c2185b; }
.confirm-box { margin-top: 1rem; display: grid; gap: 0.7rem; }

/* ---------- Phones: instant, clean taps ---------- */
/* No grey/blue box flashing on Android when something is tapped, and no 300 ms double-tap wait. */
html { -webkit-tap-highlight-color: transparent; }
a, button, input, select, textarea, label, summary, [role='button'], [role='switch'], [data-act] { touch-action: manipulation; }
/* A tap shows the focus ring only for keyboard users, never as a leftover outline after a tap. */
:focus:not(:focus-visible) { outline: none; }
/* Press-down feedback on everything tappable (buttons already sink; these get a quick squeeze). */
.icon-btn, .fav-btn, .play, .chip-btn, .seg button, .hero-chip, .word-chip, .notif-btn, .acct-btn, .menu-btn, .stop-card, .card-link, .word-bubble, .flip {
  transition: transform 0.12s var(--ease, ease), box-shadow 0.12s var(--ease, ease);
}
.icon-btn:active, .fav-btn:active, .play:active, .chip-btn:active, .seg button:active, .hero-chip:active, .word-chip:active,
.notif-btn:active, .acct-btn:active, .menu-btn:active { transform: scale(0.92); }
.stop-card:active, .card-link:active, .word-bubble:active { transform: scale(0.98); }
@media (hover: none) {
  /* Bigger tap targets on touch screens. */
  .icon-btn, .fav-btn, .notif-btn { min-width: 44px; min-height: 44px; }
  .btn-sm { min-height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .btn:active, .icon-btn:active, .fav-btn:active, .play:active, .stop-card:active, .word-bubble:active { transform: none; }
}

/* ---------- Page change: a loading bar the moment a link is tapped ---------- */
.nav-progress { position: fixed; left: 0; top: 0; height: 4px; width: 100%; z-index: 9999; pointer-events: none; transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--sea, #10b3a3), var(--sun, #ffc23d)); transform: scaleX(0); opacity: 0; }
.nav-progress.go { opacity: 1; animation: navGo 8s cubic-bezier(0.1, 0.7, 0.1, 1) forwards; }
@keyframes navGo { 0% { transform: scaleX(0); } 10% { transform: scaleX(0.35); } 40% { transform: scaleX(0.7); } 100% { transform: scaleX(0.95); } }
@media (prefers-reduced-motion: reduce) { .nav-progress.go { animation: none; transform: scaleX(0.6); } }
