/* General English A1 — dashboard, units, unit and words pages */

/* ---------- hero band */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: center; background: var(--band); padding: 26px 32px 26px 0; padding-inline-start: 32px; padding-inline-end: 0; overflow: hidden; border-radius: 28px; }
.hero__text { padding-block: 4px; }
.hero__hi { font-size: 17px; font-weight: 500; }
.hero h1 { font-size: clamp(28px, 3vw, 42px); line-height: 1.45; font-weight: 500; letter-spacing: 0; margin-block: 10px 20px; max-width: 15ch; }
.hero__sub { color: var(--ink-2); margin-block: -8px 18px; max-width: 42ch; }
.hero__cards { display: flex; gap: 14px; padding-inline-end: 0; margin-inline-end: -24px; }
/* home: smaller squares than the units page, so the path shows below them */
.hero .ucard { width: 180px; height: 236px; padding: 18px 18px 0; border-radius: 20px; }
.hero .ucard__en { font-size: 23px; margin-block-start: 18px; }
.hero .ucard__ar { font-size: 13px; margin-block-start: 6px; }
.hero .ucard .art { width: 210px; height: 228px; inset-block-end: -70px; inset-inline-start: -24px; }
/* unit squares: soft rounded corners, title at the top, a big drawing that runs off the bottom edge.
   On hover the card gets a soft shadow and the drawing rises and tilts (the card and its text stay still). */
.ucard { position: relative; isolation: isolate; display: flex; flex-direction: column; width: 230px; height: 340px; padding: 22px 22px 0; border-radius: 24px; overflow: hidden; box-shadow: 0 0 0 rgba(38, 33, 28, 0); transition: box-shadow .3s var(--ease); }
.ucard:hover { box-shadow: 0 14px 30px -12px rgba(38, 33, 28, .35); }
.ucard__n { font-size: 15px; font-weight: 600; align-self: flex-start; letter-spacing: .02em; }
.ucard__en { position: relative; z-index: 1; font-size: 28px; line-height: 1.08; font-weight: 500; letter-spacing: -.03em; margin-block-start: 30px; direction: ltr; text-align: right; }
.ucard__ar { position: relative; z-index: 1; font-size: 14px; opacity: .78; margin-block-start: 8px; }
.ucard .art { position: absolute; z-index: 0; inset-block-end: -62px; inset-inline-start: -34px; width: 290px; height: 316px; transform-origin: 50% 80%; transition: transform .5s cubic-bezier(.34, 1.56, .64, 1); }
@media (prefers-reduced-motion: no-preference) { .ucard:hover .art { transform: translateY(-14px) rotate(-4deg) scale(1.04); } }
.ucard[style*="var(--card)"] { box-shadow: inset 0 0 0 1px var(--line); }
.ucard[style*="var(--card)"]:hover { box-shadow: inset 0 0 0 1px var(--line), 0 14px 30px -12px rgba(38, 33, 28, .3); }
.ucard__lock { position: absolute; z-index: 1; inset-block-start: 20px; inset-inline-end: 20px; opacity: .55; }
.ucard__ring { position: absolute; z-index: 1; inset-block-start: 18px; inset-inline-end: 18px; }

@media (max-width: 1240px) { .hero { grid-template-columns: 1fr; padding-inline-end: 40px; } .hero__cards { margin-inline-end: 0; overflow-x: auto; scroll-snap-type: x mandatory; padding-block-end: 4px; } .ucard { flex: none; scroll-snap-align: start; } }
@media (max-width: 600px) { .hero { padding: 26px 18px; border-radius: 22px; } .ucard { width: 190px; height: 290px; border-radius: 20px; padding: 18px 18px 0; } .ucard__en { font-size: 23px; } .ucard .art { width: 240px; height: 262px; inset-block-end: -40px; inset-inline-start: -28px; } }

/* ---------- home: greeting, the current unit's stages with today's panel beside it */
.greet { font-size: 17px; color: var(--ink-2); margin-block-end: 16px; }
.greet b { color: var(--ink); font-weight: 600; }
.dash { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 0 40px; align-items: start; margin-block-start: 22px; }
.dash > aside { position: sticky; top: 12px; padding-inline-start: 40px; border-inline-start: 1px solid var(--line); }
@media (max-width: 1240px) {
  .dash { grid-template-columns: 1fr; }
  .dash > aside { position: static; border: 0; padding-inline: 0; margin-block-start: 24px; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 24px; align-items: start; }
  .dash > aside > h2, .dash > aside > .today__head, .dash > aside > .today__label, .dash > aside > div.tcard { grid-column: 1 / -1; }   /* the heading row and the goal card take the full width */
}

/* ---------- today panel */
.today h2 { font-size: 26px; font-weight: 500; letter-spacing: -.02em; margin-block-end: 18px; }
.today__label { font-size: 15px; color: var(--ink-2); margin-block: 22px 10px; }
.tcard { display: block; background: var(--band); padding: 20px; border-radius: var(--r); }
.tcard + .tcard { margin-block-start: 12px; }
a.tcard:hover { background: #EAE2CC; }
.tcard h3 { font-size: 18px; font-weight: 600; }
.tcard p { color: var(--ink-2); font-size: 15px; }
.tcard__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-block-start: 12px; }
.tag { display: inline-flex; align-items: center; gap: 6px; background: var(--card); padding: 4px 10px; border-radius: var(--r); font-size: 13px; font-weight: 500; }
.tag::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--purple)); }
.goal { display: flex; align-items: center; gap: 18px; }
.goal svg { width: 88px; height: 88px; }
.goal b { font-size: 26px; font-weight: 600; display: block; line-height: 1.1; }
.goal span { color: var(--ink-2); font-size: 14px; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-block-start: 16px; }
.week div { display: grid; gap: 6px; justify-items: center; font-size: 12px; color: var(--ink-2); }
.week i { width: 100%; height: 44px; border-radius: var(--r); background: var(--card); position: relative; overflow: hidden; }
.week i b { position: absolute; inset-inline: 0; inset-block-end: 0; background: var(--purple); }
.week .is-today { color: var(--ink); font-weight: 600; }
.letters { display: flex; gap: -6px; }
.letters span { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--band); margin-inline-start: -8px; display: grid; place-items: center; font-size: 13px; font-weight: 600; color: var(--ink); }
.letters span:first-child { margin-inline-start: 0; }

/* ---------- all units page */
.units-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.units-grid .ucard { width: auto; }
.units-intro { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-block-end: 26px; flex-wrap: wrap; }
.units-intro h1 { font-size: clamp(30px, 3.6vw, 46px); font-weight: 500; letter-spacing: -.03em; line-height: 1.15; }

/* ---------- a unit as a list (assets/ulist.js): the head, then one row per stage on a thin line, like a syllabus.
   On the unit page it keeps to one readable column; the next stage opens into a card with a Start pill. */
.munit:not(.munit--home) { max-width: 780px; margin-inline: auto; }
.mhead { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 28px; align-items: end; padding-block-end: 18px; margin-block-end: 6px; border-block-end: 1px solid var(--line); }
.mhead--unit { grid-template-columns: 132px minmax(0, 1fr); align-items: center; gap: 0 24px; padding-block-end: 24px; }
.mhead--unit .mhead__art { grid-row: span 2; }
.mhead__art { position: relative; width: 132px; height: 132px; border-radius: 28px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.mhead__art .art { position: absolute; width: 170px; height: 186px; inset-block-end: -46px; inset-inline-start: -19px; }
.mhead__k { font-size: 14px; color: var(--ink-2); }
.mhead__k a:hover { color: var(--ink); }
.mhead h1 { font-size: clamp(30px, 3.6vw, 42px); font-weight: 600; letter-spacing: -.02em; line-height: 1.2; margin-block: 4px 6px; }
.mhead h2 { font-size: 26px; font-weight: 500; letter-spacing: -.01em; line-height: 1.3; margin-block-start: 4px; }
.mhead__can { color: var(--ink-2); font-size: 16px; max-width: 46ch; }
.mhead__side { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px 16px; }
.mhead--unit .mhead__side { justify-content: flex-start; align-self: start; margin-block-start: 14px; }
.mhead__prog { display: flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 600; }
.mhead__prog .bar { width: 160px; height: 6px; background: var(--line); }
.mhead__done { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding-inline: 14px; border-radius: var(--r); background: var(--ok-soft); color: var(--ok); font-size: 14px; font-weight: 600; }
.mhead .btn .num { font-size: 13px; }

.mlist { list-style: none; margin: 0; padding: 0; }
.mrow { position: relative; }
/* the line between the boxes: grey ahead, ink where walked; it sits over the rows' hover and "next" colour, under the boxes */
.mrow:not(:last-child)::after { content: ''; position: absolute; z-index: 1; inset-inline-start: 31px; inset-block: 50px -18px; width: 2px; background: var(--line-2); }
.mrow.is-done:not(:last-child)::after { background: var(--ink); }
.mrow__in { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 14px 10px; border-radius: var(--r-lg); transition: background .15s; }
a.mrow__in:hover { background: var(--band); }
.mrow__ico { position: relative; z-index: 2; width: 44px; height: 44px; display: grid; place-items: center; background: var(--paper); border: 1.5px solid var(--ink); border-radius: var(--r); color: var(--ink); }
.mrow__tick { position: absolute; inset-block-end: -8px; inset-inline-start: 50%; translate: 50% 0; width: 20px; height: 20px; border-radius: 50%; background: var(--yellow); border: 1.5px solid var(--ink); display: grid; place-items: center; }
[dir=ltr] .mrow__tick { translate: -50% 0; }
.mrow.is-done .mrow__ico { background: var(--band); }
/* hover: the box pops, its icon wiggles like a button's, the Start arrow nudges the reading way */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .mrow__ico, .mrow__go .arrow-ne, .mnext__go .arrow-ne { transition: transform .35s cubic-bezier(.34, 1.56, .64, 1); }
  a.mrow__in:hover .mrow__ico, .mnext:hover .mrow__ico { transform: scale(1.1); }
  a.mrow__in:hover .mrow__ico > svg, .mnext:hover .mrow__ico > svg { animation: btnWig .5s ease-in-out; }
  a.mrow__in:hover .arrow-ne, .mnext:hover .arrow-ne { transform: scaleX(-1) translate(4px, -3px); }
}
.mrow__t { display: grid; gap: 2px; min-width: 0; }
.mrow__t b { font-size: 17px; font-weight: 600; line-height: 1.4; }
.mrow__t small { font-size: 13px; color: var(--ink-2); }
/* the best score: a short bar and the number, coloured by how good it is */
.mstars { display: inline-flex; gap: 2px; color: var(--line-2); }
.mstars i { display: grid; }
.mstars i.on { color: var(--ink); }
/* the next stage: a card on the line, its title big, a Start pill */
.mnext { position: relative; z-index: 2; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 16px; margin-block: 8px; padding: 18px 16px; background: var(--card); border: 1.5px solid var(--ink); border-radius: 22px; box-shadow: 0 10px 28px -16px rgba(38, 33, 28, .45); transition: box-shadow .2s; }
.mnext:hover { box-shadow: 0 14px 32px -14px rgba(38, 33, 28, .5); }
.mrow.is-next .mrow__ico { background: var(--ink); color: var(--yellow); }
.mnext__body { display: grid; gap: 2px; min-width: 0; }
.mnext__body small { font-size: 13px; font-weight: 600; color: var(--purple-ink); }
.mnext__body b { font-size: 21px; font-weight: 700; line-height: 1.35; }
.mnext__body .en { display: block; direction: ltr; text-align: right; font-size: 14px; color: var(--ink-2); }
.mnext__go { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding-inline: 22px; border-radius: 999px; background: var(--ink); color: var(--paper); font-weight: 600; box-shadow: 0 3px 0 #000; }
.mnext:active .mnext__go { transform: translateY(2px); box-shadow: 0 1px 0 #000; }
.mlist.is-locked .mrow__ico { border-style: dashed; border-color: var(--line-2); color: var(--ink-3); }
.mlist.is-locked .mrow__t b { color: var(--ink-2); }
@media (max-width: 700px) {
  .mhead { grid-template-columns: 1fr; }
  .mhead--unit { grid-template-columns: 84px minmax(0, 1fr); gap: 0 16px; align-items: start; }
  .mhead--unit .mhead__art { grid-row: auto; }
  .mhead__art { width: 84px; height: 84px; border-radius: 20px; }
  .mhead__art .art { width: 112px; height: 122px; inset-block-end: -30px; inset-inline-start: -14px; }
  .mhead--unit .mhead__side { grid-column: 1 / -1; justify-content: flex-start; }
  .mhead__side .btn--ink { flex: 1 1 100%; }
  .mhead__side { justify-content: space-between; }
  .mhead__prog .bar { width: 110px; }
  .mrow__in { gap: 12px; padding-inline: 4px; }
  .mnext { grid-template-columns: 44px minmax(0, 1fr); gap: 12px; padding: 16px 14px; }
  .mnext__go { grid-column: 1 / -1; width: 100%; }
}

/* «جمل مفيدة»: the same rows under the unit, locked (dashed) until the unit is done */
.mphr { margin-block-start: 30px; padding-block-start: 18px; border-block-start: 1px solid var(--line); }
.mphr__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-block-end: 6px; }
.mphr__head h2 { display: inline-flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 600; }
.mphr__head h2 svg { color: var(--purple); }
.mphr__lock { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); background: var(--band); padding: 4px 12px; border-radius: var(--r); }

.unext { display: flex; align-items: center; gap: 16px; max-width: 560px; margin: 26px auto 0; padding: 16px 18px; border: 2px dashed var(--line-2); border-radius: var(--r-lg); color: var(--ink-2); }
.unext:hover { border-style: solid; color: var(--ink); }
.unext__n { width: 46px; height: 46px; border-radius: var(--r); background: var(--band); display: grid; place-items: center; font-weight: 700; color: var(--ink); }
.unext small { display: block; font-size: 13px; }
.unext b { font-size: 18px; color: var(--ink); }
.unext__go { margin-inline-start: auto; font-size: 14px; }

/* side panels (no slide: Safari breaks Arabic letters under transforms) */
.panel-scrim { position: fixed; inset: 0; z-index: 40; background: rgba(38, 33, 28, .4); }
.panel { position: fixed; z-index: 41; inset-block: 0; inset-inline-end: 0; width: min(520px, 100%); background: var(--paper); border-inline-start: 1px solid var(--line); display: flex; flex-direction: column; }
.panel[hidden], .panel-scrim[hidden] { display: none; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-block-end: 1px solid var(--line); }
.panel__head h2 { font-size: 22px; font-weight: 600; }
.panel__x { width: 42px; height: 42px; display: grid; place-items: center; border-radius: var(--r); color: var(--ink-2); }
.panel__x:hover { background: var(--band); color: var(--ink); }
.panel__body { flex: 1; overflow: auto; padding: 20px 22px 40px; }
.gb-intro { margin: 0 0 22px; padding: 16px 16px 16px 16px; padding-inline-start: 34px; background: var(--band); border-radius: var(--r-lg); color: var(--ink); display: grid; gap: 6px; }
.gb-sec { padding-block: 18px; border-block-start: 1px solid var(--line); }
.gb-sec h3 { font-size: 18px; font-weight: 600; margin-block-end: 6px; }
.gb-sec p { white-space: pre-line; }
.exlist { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; }
.exlist li { display: flex; align-items: center; gap: 10px; }
.exlist .en-block { flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 12px; font-size: 16px; }
.exlist .sound { width: 38px; height: 38px; }
.watch { background: var(--bad-soft); border-radius: var(--r-lg); padding: 14px 16px; margin-block-start: 16px; }
.watch h3 { font-size: 15px; color: var(--bad); margin-block-end: 6px; }
.watch ul { margin: 0; padding-inline-start: 18px; font-size: 15px; }
.wl-list--panel .wl-row { grid-template-columns: 46px minmax(0, 1fr) auto; grid-template-areas: "say en side" "say ar side" "ex ex ex"; gap: 0 14px; }

/* ---------- words: a practice card, then rows grouped by unit */
.wl-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: end; background: var(--band); padding: 32px; border-radius: var(--r); }
.wl-hero h1 { font-size: clamp(30px, 3.6vw, 44px); font-weight: 500; letter-spacing: -.03em; line-height: 1.15; margin-block: 4px 8px; }
.wl-hero .muted { margin-block-end: 22px; max-width: 40ch; }
.wl-stats { display: grid; grid-template-columns: repeat(3, 120px); gap: 10px; }
.wl-stat { display: flex; flex-direction: column; justify-content: space-between; min-height: 112px; padding: 14px; border-radius: var(--r); background: var(--card); }
.wl-stat b { font-size: 36px; font-weight: 600; line-height: 1; letter-spacing: -.02em; text-align: right; }
.wl-stat span { font-size: 14px; font-weight: 500; }
@media (max-width: 900px) { .wl-hero { grid-template-columns: 1fr; padding: 24px 20px; } .wl-stats { grid-template-columns: repeat(3, 1fr); } }
/* the tiles fade in one by one (fade only: they hold words) while their numbers count up (words.js);
   each word's strength bars grow from the floor, shortest first */
@media (prefers-reduced-motion: no-preference) {
  .wl-stat { animation: wlFade .5s var(--ease) both; }
  .wl-stat:nth-child(2) { animation-delay: .12s; }
  .wl-stat:nth-child(3) { animation-delay: .24s; }
  #wl.is-in .wl-meter i { transform-origin: bottom; animation: meterUp .45s cubic-bezier(.3, 1.5, .5, 1) .2s both; }
  #wl.is-in .wl-meter i:nth-child(2) { animation-delay: .27s; }
  #wl.is-in .wl-meter i:nth-child(3) { animation-delay: .34s; }
  #wl.is-in .wl-meter i:nth-child(4) { animation-delay: .41s; }
  @keyframes wlFade { from { opacity: 0; } }
  @keyframes meterUp { from { transform: scaleY(0); } }
}
/* on hover: a light sweeps across a tile (its number counts up again, words.js); a row's strength bars
   ripple and its speaker wiggles */
.wl-stat { position: relative; isolation: isolate; overflow: hidden; }
.wl-stat::before { content: ''; position: absolute; z-index: -1; inset-block: 0; inset-inline-start: 0; width: 60%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent); --dir: -1; transform: translateX(calc(var(--dir) * -110%)); pointer-events: none; }
[dir=ltr] .wl-stat::before { --dir: 1; }
.wl-stat:nth-child(3)::before { background: linear-gradient(100deg, transparent, rgba(245, 184, 32, .3), transparent); }
.wl-meter i { transform-origin: bottom; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .wl-stat:hover::before { animation: tileSweep .75s ease-out; }
  @keyframes tileSweep { to { transform: translateX(calc(var(--dir) * 280%)); } }
  .wl-row:hover .wl-meter i { animation: meterWave .55s ease-in-out; }
  .wl-row:hover .wl-meter i:nth-child(2) { animation-delay: .06s; }
  .wl-row:hover .wl-meter i:nth-child(3) { animation-delay: .12s; }
  .wl-row:hover .wl-meter i:nth-child(4) { animation-delay: .18s; }
  @keyframes meterWave { 40% { transform: scaleY(1.3); } 70% { transform: scaleY(.85); } }
  .wl-row:hover .wl-say svg { animation: btnWig .5s ease-in-out; }
}

.wl-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-block: 28px 22px; }
.seg { display: inline-flex; padding: 4px; gap: 4px; background: var(--band); border-radius: var(--r-lg); }
.seg button { height: 40px; padding: 0 16px; border-radius: var(--r); font-size: 15px; font-weight: 500; color: var(--ink-2); transition: background .15s, color .15s; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed=true] { background: var(--card); color: var(--ink); box-shadow: 0 2px 0 var(--line-2); }
.wl-search { display: flex; align-items: center; gap: 8px; height: 48px; padding-inline: 14px; border: 1.5px solid var(--line); border-radius: var(--r-lg); background: var(--card); color: var(--ink-3); width: min(340px, 100%); }
.wl-search:focus-within { border-color: var(--purple); color: var(--purple); }
.wl-search input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; font-size: 15px; color: var(--ink); outline: none; }

.wl-group { margin-block-end: 30px; }
.wl-group h2 { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 600; margin-block-end: 12px; }
.wl-group h2 .muted { font-size: 14px; font-weight: 400; }
.wl-unit { width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--r); background: var(--ink); color: var(--yellow); font-size: 13px; font-weight: 600; }
.wl-list { list-style: none; margin: 0; padding: 0; border: 1.5px solid var(--line); border-radius: var(--r-lg); background: var(--card); overflow: hidden; }
.wl-row { display: grid; grid-template-columns: 48px minmax(0, 1.1fr) minmax(0, 1fr) auto; grid-template-areas: "say en ar side" "ex ex ex ex"; align-items: center; gap: 0 18px; padding: 12px 18px; cursor: pointer; transition: background .15s; }
.wl-row + .wl-row { border-block-start: 1.5px solid var(--line); }
.wl-row:hover { background: var(--sunk); }
.wl-row.is-open { background: var(--yellow-soft); }
.wl-say { grid-area: say; width: 46px; height: 46px; display: grid; place-items: center; border-radius: var(--r-lg); background: var(--purple-soft); color: var(--purple-ink); box-shadow: 0 3px 0 #D3C6F2; transition: transform .08s, box-shadow .08s; }
.wl-say:active { transform: translateY(2px); box-shadow: 0 1px 0 #D3C6F2; }
.wl-say.is-playing svg { animation: pulse .8s ease-in-out infinite; }
.wl-en { grid-area: en; direction: ltr; text-align: right; font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.wl-ar { grid-area: ar; color: var(--ink-2); font-size: 16px; }
.wl-meta { grid-area: side; color: var(--ink-3); font-size: 13px; }
.wl-meter { grid-area: side; display: flex; align-items: flex-end; gap: 3px; height: 22px; }
.wl-meter i { width: 6px; border-radius: 2px; background: var(--line); }
.wl-meter i:nth-child(1) { height: 8px; } .wl-meter i:nth-child(2) { height: 12px; } .wl-meter i:nth-child(3) { height: 17px; } .wl-meter i:nth-child(4) { height: 22px; }
.wl-meter i.on { background: var(--purple); }
.wl-meter.is-due i.on { background: var(--flame); }
.wl-ex { grid-area: ex; display: none; align-items: center; gap: 8px; direction: ltr; justify-content: flex-end; margin-block-start: 10px; padding-block-start: 10px; border-block-start: 1px dashed #EBD893; font-size: 16px; }
.wl-row.is-open .wl-ex { display: flex; }
.wl-ex__say { width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--r); background: var(--card); color: var(--purple-ink); }
.wl-none { color: var(--ink-2); padding: 28px 0; text-align: center; }
@media (max-width: 600px) {
  .wl-row { grid-template-columns: 46px minmax(0, 1fr) auto; grid-template-areas: "say en side" "say ar side" "ex ex ex"; gap: 0 14px; padding: 12px 14px; }
  .wl-ar { font-size: 15px; }
  .wl-tools { flex-direction: column; align-items: stretch; }
  .seg { display: flex; } .seg button { flex: 1; }
  .wl-search { width: 100%; }
}
.empty { text-align: center; padding: 64px 16px; border: 1px dashed var(--line-2); border-radius: var(--r); }
.empty h2 { font-size: 22px; font-weight: 600; margin-block-end: 6px; }
.empty p { color: var(--ink-2); margin-block-end: 18px; }

/* big boxes share the unit squares' rounding */
.tcard, .wl-hero, .wl-list, .unext, .empty, .wl-stat { border-radius: var(--r-xl); }
.panel { border-start-start-radius: var(--r-xl); border-end-start-radius: var(--r-xl); }
.week i { border-radius: 8px; }

/* ---------- Today cards on hover: the card warms up and lifts its shadow, a soft shape grows in its corner,
   an arrow slides in, the letters fan out and the tag's dot pulses. Text stays put. */
.tcard { position: relative; isolation: isolate; overflow: hidden; transition: background .25s, box-shadow .25s; }
.tcard::after { content: ''; position: absolute; z-index: -1; inset-block-start: -50px; inset-inline-end: -50px; width: 140px; height: 140px; border-radius: 50%; background: var(--yellow); opacity: 0; transform: scale(.3); transition: opacity .3s, transform .45s cubic-bezier(.34, 1.56, .64, 1); }
a.tcard:nth-of-type(odd)::after { background: var(--purple-soft); }
.tcard__go { position: absolute; inset-block-start: 18px; inset-inline-end: 18px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: var(--paper); opacity: 0; transition: opacity .2s; }
.tcard__go svg { transition: transform .35s cubic-bezier(.34, 1.56, .64, 1); transform: scaleX(-1) translate(-8px, 8px); }
.letters span { transition: transform .35s cubic-bezier(.34, 1.56, .64, 1); }
.week i b, .goal svg { transition: transform .4s cubic-bezier(.34, 1.56, .64, 1); }
.week i b { transform-origin: bottom; }
@media (hover: hover) {
  a.tcard:hover { background: #EAE2CC; box-shadow: 0 14px 28px -18px rgba(38, 33, 28, .45); }
  .tcard:hover::after { opacity: .55; transform: scale(1); }
  a.tcard:hover .tcard__go { opacity: 1; }
  a.tcard:hover .tcard__go svg { transform: scaleX(-1) translate(0, 0); }
  .tcard:hover .letters span:nth-child(2) { transform: translateX(-8px); }
  .tcard:hover .letters span:nth-child(3) { transform: translateX(-16px); }
  .tcard:hover .goal svg { transform: rotate(-12deg) scale(1.05); }
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .tcard:hover .tag::before { animation: dot .9s ease-in-out infinite; }
  @keyframes dot { 50% { transform: scale(1.6); } }
  .tcard:hover .letters span { animation: hop .5s ease-out; }
  .tcard:hover .letters span:nth-child(2) { animation-delay: .06s; }
  .tcard:hover .letters span:nth-child(3) { animation-delay: .12s; }
  @keyframes hop { 40% { translate: 0 -6px; } }
  .tcard:hover .week i b { animation: grow .5s cubic-bezier(.34, 1.56, .64, 1); }
  @keyframes grow { from { transform: scaleY(.2); } }
}

/* ---------- trophies: the rank bar, unit stickers, medals */
.tr-rank { display: flex; align-items: center; gap: 12px; max-width: 440px; }
.tr-rank .bar { flex: 1; height: 12px; background: var(--card); }
.tr-rank__n { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--purple); color: #FFFDF6; font-weight: 700; font-size: 15px; }
.tr-rank__n.is-next { background: var(--card); color: var(--ink-2); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.tr-group { margin-block-start: 36px; }
.tr-group h2 { display: flex; align-items: baseline; gap: 10px; font-size: 22px; font-weight: 500; letter-spacing: -.01em; margin-block-end: 14px; }
.tr-group h2 .muted { font-size: 15px; }

.tr-stickers { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tr-sticker { position: relative; isolation: isolate; display: flex; flex-direction: column; height: 200px; padding: 14px; border-radius: var(--r-xl); overflow: hidden; background: var(--sunk); color: var(--ink-3); transition: box-shadow .3s var(--ease); }
.tr-sticker.is-got:hover { box-shadow: 0 14px 30px -12px rgba(38, 33, 28, .35); }
.tr-sticker[style*="var(--card)"] { box-shadow: inset 0 0 0 1px var(--line); }
.tr-sticker__n { font-size: 13px; font-weight: 600; align-self: flex-start; }
.tr-sticker__lock { position: absolute; inset-block-start: 14px; inset-inline-end: 14px; }
.tr-sticker .art { position: absolute; z-index: -1; inset-block-start: 20px; inset-inline-start: 50%; translate: -50% 0; width: 116px; height: 126px; }
[dir=rtl] .tr-sticker .art { translate: 50% 0; }
.tr-sticker:not(.is-got) .art { --a: var(--line) !important; opacity: .55; }
.tr-sticker__name { margin-block-start: auto; font-size: 14px; font-weight: 600; line-height: 1.3; }
.tr-sticker:not(.is-got) .tr-sticker__name { color: var(--ink-2); }
.tr-sticker__bar { height: 5px; margin-block-start: 8px; background: var(--line); }
@media (prefers-reduced-motion: no-preference) {
  .tr-sticker .art { transition: transform .5s cubic-bezier(.34, 1.56, .64, 1); }
  .tr-sticker.is-got:hover .art { transform: translateY(-8px) rotate(-4deg) scale(1.04); }
}

.tr-medals { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; }
.tr-medal { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 18px 14px 16px; border-radius: var(--r-xl); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.tr-medal__ico { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; background: var(--sunk); color: var(--ink-3); }
.tr-medal.is-got .tr-medal__ico { background: var(--purple); color: #FFFDF6; box-shadow: 0 0 0 4px var(--purple-soft); }
.tr-medal b { font-size: 15px; font-weight: 600; line-height: 1.3; }
.tr-medal:not(.is-got) b { color: var(--ink-2); }
.tr-medal__ok { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--purple-ink); }
.tr-medal .bar { width: 100%; height: 6px; margin-block-start: auto; }
.tr-medal__left { font-size: 13px; color: var(--ink-2); }
@media (max-width: 600px) { .tr-stickers { grid-template-columns: repeat(2, 1fr); } }
.tr-hero__main { display: flex; align-items: center; gap: 24px; }
.tr-hero__badge { flex: none; }
@media (prefers-reduced-motion: no-preference) {
  .tr-hero__badge { animation: badgeIn .9s cubic-bezier(.34, 1.56, .64, 1) both; }
  @keyframes badgeIn { from { transform: scale(.6) rotate(-12deg); opacity: 0; } }
}
.tr-looks { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.tr-look { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 18px 10px 16px; border-radius: var(--r-xl); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.tr-look:not(.is-got) .badge { filter: grayscale(1); opacity: .4; }
.tr-look.is-now { background: var(--purple-soft); box-shadow: inset 0 0 0 2px var(--purple); }
.tr-look b { font-size: 16px; font-weight: 600; }
.tr-look span { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--ink-2); }
.tr-look.is-now span { color: var(--purple-ink); font-weight: 600; }
@media (max-width: 700px) {
  .tr-hero__main { flex-direction: column; align-items: flex-start; gap: 14px; }
  .tr-hero__badge { width: 96px; height: 96px; }
  .tr-looks { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
  .tr-look .badge { width: 64px; height: 64px; }
}

/* ---------- the dashboard's sizes after the Toko reference (colours stay ours): a compact hero whose cards are
   smaller and run off its edge, a small pill to continue; under it one rule, then two columns split by a line:
   the unit as a tight list with a description column, and «اليوم» as small grey cards with a "see all" link */
/* the reference's proportions: the cards stand nearly the band's full height (about 80%, a tenth above and below),
   each about 2:3, three of them taking just over half its width with a small gap, the last running off the edge;
   their number and title are small, the drawing large and cut by the bottom edge */
.hero { gap: 28px; padding-block: 34px; border-radius: 20px; }
.hero__hi { font-size: 15px; }
.hero h1 { font-size: clamp(28px, 2.9vw, 42px); font-weight: 600; line-height: 1.3; max-width: 12ch; margin-block: 8px 22px; }
.hero__sub { font-size: 15px; }
.hero__cards { gap: 28px; margin-inline-end: -64px; }
.hero .ucard { width: 188px; height: 288px; padding: 18px 18px 0; border-radius: 12px; }
.hero .ucard__n { font-size: 15px; }
.hero .ucard__en { font-size: 22px; line-height: 1.15; margin-block-start: 22px; }
.hero .ucard__ar { font-size: 13px; margin-block-start: 6px; }
.hero .ucard .art { width: 238px; height: 258px; inset-block-end: -58px; inset-inline-start: -25px; }
.dash { grid-template-columns: minmax(0, 1fr) 320px; gap: 0; margin-block-start: 28px; border-block-start: 1px solid var(--line); }
.dash__unit { padding-block: 26px; padding-inline-end: 32px; }
.dash > aside { top: 0; padding-block: 26px; padding-inline-start: 28px; }
.today__head { display: flex; align-items: baseline; justify-content: space-between; margin-block-end: 14px; }
.today__head h2 { font-size: 21px; font-weight: 500; margin: 0; }
.today__head a { font-size: 14px; color: var(--ink-2); }
.today__head a:hover { color: var(--ink); }
.today__label { font-size: 13px; margin-block: 18px 8px; }
.tcard { padding: 16px; border-radius: 14px; }
.tcard + .tcard { margin-block-start: 10px; }
.tcard h3 { font-size: 15px; }
.tcard p { font-size: 13px; }
.tcard__row { margin-block-start: 10px; }
.goal { gap: 14px; }
.goal svg { width: 64px; height: 64px; }
.goal b { font-size: 22px; }
.goal span { font-size: 13px; }
.week { margin-block-start: 12px; gap: 5px; }
.week i { height: 30px; border-radius: 8px; }
.week div { font-size: 11px; }
.dash .mhead { padding-block-end: 14px; }
.dash .mhead__k { font-size: 13px; }
.dash .mhead h2 { font-size: 21px; }
.dash .mhead .btn--sm { min-height: 36px; font-size: 13px; }
/* the stages: round icons, a title, a description column, then the score or a small Start pill */
.mrow__in { grid-template-columns: 52px minmax(0, 1fr) auto; gap: 18px; padding: 14px 10px; }
.mrow__ico { width: 52px; height: 52px; border-radius: 50%; }
.mrow__ico svg { width: 24px; height: 24px; }
.mrow__tick { width: 24px; height: 24px; inset-block-end: -9px; }
.mrow__tick svg { width: 14px; height: 14px; }
.mrow:not(:last-child)::after { inset-inline-start: 35px; inset-block: 62px -18px; }
.mrow__t b { font-size: 18px; }
.mstars svg { width: 20px; height: 20px; }
.mrow__go { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding-inline: 20px; border-radius: 999px; background: var(--ink); color: var(--paper); font-size: 15px; font-weight: 600; }
.mrow.is-next .mrow__in { background: var(--yellow-soft); }
.mrow.is-next .mrow__ico { background: var(--ink); color: var(--yellow); border-color: var(--ink); }
.mnext { grid-template-columns: 52px minmax(0, 1fr) auto; padding: 18px 16px; }
.mnext .mrow__ico { width: 52px; height: 52px; }
.mnext__body b { font-size: 20px; }
@media (max-width: 700px) {
  .mrow__in { grid-template-columns: 46px minmax(0, 1fr) auto; gap: 14px; padding-inline: 6px; }
  .mrow__ico { width: 46px; height: 46px; }
  .mrow:not(:last-child)::after { inset-inline-start: 28px; inset-block: 56px -18px; }
  .mrow__t b { font-size: 17px; }
}
@media (max-width: 1240px) { .dash { grid-template-columns: 1fr; } .dash__unit { padding-inline-end: 0; } .dash > aside { padding-inline-start: 0; border-block-start: 1px solid var(--line); } }
@media (max-width: 700px) {
  /* phones: the home page's cards and the units page (two a row) share one size; 280 tall with the drawing at 190
     leaves every unit's drawing (the tallest are 14–16) at least 16px under its name */
  .hero .ucard, .units-grid .ucard { width: 160px; height: 280px; padding: 14px 14px 0; }
  .units-grid .ucard { width: auto; }
  .hero .ucard__en, .units-grid .ucard__en { font-size: 19px; margin-block-start: 16px; }
  .hero .ucard .art, .units-grid .ucard .art { width: 190px; height: 207px; inset-block-end: -46px; inset-inline-start: -22px; }
  .hero__cards { gap: 16px; }
  .units-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
}
