/* The website on a computer (from 840px wide; never inside Telegram, body.web): a top bar like YouTube's or Netflix's
   with the library's name, the three tabs and sign-in; the screens in a centred page; a section as a dialog; the
   player with its section's lessons beside the picture; the mini player as a bar along the bottom (Spotify). Phones,
   tablets in portrait and Telegram keep the app's own layout. */
.dk-bar { display: none; }

@media (min-width: 840px) {
  .web { --dk-bar-h: 68px; --dk-page: 1200px; --dk-gutter: max(40px, calc((100% - var(--dk-page)) / 2)); --dk-logo-w: 250px; }
  body.web { padding-top: var(--dk-bar-h); }

  /* ---- the top bar ---- */
  .web .dk-bar { position: fixed; z-index: 20; inset: 0 0 auto; height: var(--dk-bar-h); display: flex; align-items: center; gap: 24px;
    padding-inline: var(--dk-gutter); background: var(--bar-bg); border-bottom: 1px solid rgb(var(--fg) / .08); color: var(--text-strong);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
  .dk-logo { width: var(--dk-logo-w); flex: none; display: flex; align-items: center; gap: 12px; font-size: 16px; font-weight: 700; line-height: 1.4; }
  .dk-logo img { width: 40px; height: auto; }
  .dk-logo small { display: block; font-size: 12px; font-weight: 400; color: var(--accent-ink-soft); }
  .dk-cta { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 99px;
    background: var(--cta-bg); color: var(--cta-ink); font-size: 14px; font-weight: 700; }
  .dk-cta .ic { width: 18px; height: 18px; color: #2aa1da; }
  .dk-user { margin-inline-start: auto; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px;
    color: rgb(var(--fg) / .78); }

  /* The tabs are the app's own bar, moved into the top bar: same links, no glass pill or lens. */
  .web .tabs, body.web:not(.has-tabs) .tabs, body.web.sheet-open .tabs { display: block; position: fixed; z-index: 21; top: 0; bottom: auto; left: auto;
    right: calc(var(--dk-gutter) + var(--dk-logo-w) + 24px); width: auto; height: var(--dk-bar-h); transform: none; }
  .web .tabs-pill { height: var(--dk-bar-h); gap: 4px; overflow: visible; background: none; border: 0; border-radius: 0; box-shadow: none;
    -webkit-backdrop-filter: none; backdrop-filter: none; }
  .web .tabs-lens { display: none; }
  .web .tabs a { flex: none; display: flex; align-items: center; gap: 8px; padding: 0 16px; font-size: 15px; font-weight: 600;
    color: rgb(var(--fg) / .75); text-shadow: none; transform: none; }
  .web .tabs a .ic { width: 19px; height: 19px; }
  .web .tabs a:hover { color: var(--text-strong); }
  .web .tabs a.on { color: var(--text-strong); font-weight: 700; transform: none; box-shadow: inset 0 -3px 0 var(--gold); }
  .web .tabs a:focus-visible { outline-offset: -10px; border-radius: 10px; }

  /* ---- the page ---- */
  .web #view { max-width: calc(var(--dk-page) + 80px); margin-inline: auto; padding-inline: 40px; }
  body.web.has-tabs #view, body.web.has-mini #view { padding-bottom: 110px; }
  .web .nf-top .brand, .web .hero-main .hero-logo { display: none; }
  /* «قناة التحديات», Facebook and Instagram: the phone's tiles under the hero (icon above the name), sized for a computer */
  .web .so-tiles { gap: 16px; margin: 2px 0 24px; }
  .web .so-tile { min-height: 84px; gap: 8px; border-radius: 16px; font-size: 16px; }
  .web .so-tile .ic { width: 24px; height: 24px; }
  .web .so-tile:hover { background: rgb(var(--fg) / .09); }
  .web .nf-top { padding: 28px 0 8px; }
  .web .nf-top h1 { font-size: 30px; }
  .web .nf-search { max-width: 320px; height: 42px; }
  .web .chips { padding: 8px 0 18px; }
  .web .nf-h { margin: 36px 0 14px; font-size: 21px; }
  .web .empty { padding-block: 48px; }

  /* الرئيسية: the date, the «الجديد» bell and «التحدي الجاري» at the start side and the progress ring beside them, then «عن المنصة».
     The greeting and the library's name are already in the top bar: kept for screen readers only. */
  .web .hero { margin-top: 24px; border-radius: 24px; padding: 34px 40px; display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 40px; }
  .web .hero > * { grid-column: 1; }
  .web .hero .stat { grid-column: 2; grid-row: 1 / span 5; margin: 0; }
  .web .hero-cols { grid-template-columns: minmax(0, 1fr); }
  .web .hero-main { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .web .hero-side { grid-column: 1; justify-items: start; gap: 14px; }
  .web .hero .date { font-size: 15px; text-align: start; }
  .web .ring { width: 140px; height: 140px; }
  .web .ring .orb { inset: 38px; }
  .web .big { font-size: 64px; }
  .web .wrap { padding: 0; }
  .web .hero-login, .web .hero .scheme-btn { display: none; } /* the top bar has them */
  .dk-bar .scheme-btn { width: 40px; height: 40px; margin-inline-start: -12px; color: var(--text-strong); background: none;
    border-color: rgb(var(--fg) / .2); }
  .dk-user + .scheme-btn { margin-inline-start: -8px; }
  .web .ab { margin-top: 24px; }
  .web .ab h2 { font-size: 30px; }
  .web .ab-lead { max-width: 70ch; }
  .web .ab-stats { max-width: 720px; }
  .web .ab-more-group { grid-template-columns: 1fr 1fr; align-items: start; gap: 16px; } /* side by side, each opening under itself */
  .web .ab-more summary { min-height: 64px; padding-inline: 18px; }
  .web .ab-more-body { padding: 2px 22px 22px; }
  .web .ab-book:hover { border-color: rgba(229, 185, 92, .35); } /* a phone keeps :hover after a tap */
  .web .ab-features { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .web .ab-features li { padding: 20px; }
  .web .ab-steps { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .web .ab-start .nf-play.wide { width: auto; padding: 0 40px; }

  /* السلاسل: a cinema billboard with its words on the start side, and more cards per row */
  .web .nf-bill { margin: 0; border-radius: 18px; }
  /* Half the height it had (the owner's wish): a band, not a poster; the copy centred in it */
  .web .nf-bill-art { aspect-ratio: auto; height: clamp(240px, 29vh, 260px); }
  .web .nf-bill-art.nf-cover { padding-block: 0; padding-inline: 52% 6%; } /* the words on the half the copy leaves free */
  .web .nf-bill-art .nf-cover-mark { inset-inline-start: auto; inset-inline-end: 8%; }
  .web .nf-bill .shade { inset: 0; aspect-ratio: auto; background: linear-gradient(to left, var(--bill) 8%, rgb(var(--bill-rgb) / .75) 38%, transparent 70%); }
  .web .nf-bill-copy { position: absolute; inset-block: 0; inset-inline-start: 48px; width: min(520px, 46%); margin: 0; padding: 0;
    justify-items: start; align-content: center; text-align: start; }
  .web .nf-bill-copy .tags { justify-content: flex-start; }
  .web .nf-bill h2 { font-size: 28px; }
  .web .nf-bill p { font-size: 15px; }
  .web .nf-grid { padding: 0; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 28px 20px; }
  .web .nf-card > b { font-size: 15px; }
  .web .nf-card > small { font-size: 13px; }
  .web .nf-card-pic { border-radius: 10px; transition: transform .2s ease, box-shadow .2s ease; }
  .web .nf-card:hover .nf-card-pic, .web .nf-card:focus-visible .nf-card-pic { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(0, 0, 0, .45), 0 0 0 2px var(--gold); }
  .web .nf-row { padding: 0 0 4px; }
  .web .sr-list { margin: 0; grid-template-columns: 1fr 1fr; gap: 14px 24px; }

  /* التحديات */
  .web .bc-lead { margin: 4px 0 20px; font-size: 16px; }
  .web .bc-list { padding: 0; grid-template-columns: 1fr 1fr; gap: 24px; }
  .web .soon-grid { padding: 0; grid-template-columns: repeat(4, 1fr); gap: 16px; }

  /* «الجديد»: a centred window instead of a sheet from the bottom */
  .news-dlg { width: min(720px, calc(100% - 48px)); margin: auto; }
  .news-sheet { border-radius: 22px; padding: 22px 22px 26px; }
  .news-sheet li { grid-template-columns: 200px 1fr; }

  /* a section or a challenge: a centred dialog instead of a sheet from the bottom */
  .web .sheet-panel { inset: calc(var(--dk-bar-h) + 28px) max(24px, calc(50% - 460px)) 28px; border-radius: 18px; padding-bottom: 24px; }
  body.web.has-mini .sheet-panel { inset-block-end: 96px; padding-bottom: 24px; }
  .web .sheet-panel.rise { animation: fade .25s ease; }
  .web .sh-hero { aspect-ratio: 21 / 9; }
  .web .sh-body { padding: 4px 32px 0; }
  .web .sh-body h1 { font-size: 30px; }
  .web .sh-play { justify-self: start; padding: 0 36px; }
  .web .sh-eps { grid-template-columns: 1fr 1fr; column-gap: 24px; }
  .web .sh-ep { grid-template-columns: 150px 1fr; }

  /* the player (YouTube): the picture and its controls, the section's lessons beside them */
  .web .page-head { padding-inline: 0; }
  .web .pl { grid-template-columns: minmax(0, 1fr) 380px; column-gap: 28px; align-items: start; justify-items: start; padding: 4px 0 32px; text-align: start; }
  .web .pl > * { grid-column: 1; }
  .web .pl > .pl-queue { grid-column: 2; grid-row: 1 / span 40; margin-top: 0; position: sticky; top: calc(var(--dk-bar-h) + 24px); }
  .web .pl-queue .q-list { max-height: calc(100vh - 260px); }
  .web .pl-stage { justify-items: stretch; }
  .web .pl-video { max-height: 72vh; }
  .web .pl h1 { font-size: 26px; }
  .web .pl-listen { justify-items: stretch; }
  .web .pl-actions { justify-content: flex-start; }
  .web .day-pic, .web .pl-art.wide { width: min(560px, 100%); }
  .web .day-acts { max-width: 560px; }

  /* the mini player: a bar along the bottom of the window */
  .web .mini, body.web:not(.has-tabs) .mini { inset: auto 0 0; min-height: 72px; padding: 12px var(--dk-gutter); border-radius: 0; }
  .web .mini-art { width: 48px; height: 48px; }
  .web .mini-text b { font-size: 15px; }
  .web .notice { inset: auto 0 96px; max-width: 520px; margin-inline: auto; }
  body.web .update-bar { bottom: 24px; }
  body.web.has-mini .update-bar { bottom: 96px; }
}

/* Below 1024px the library's name leaves the top bar to its logo, so the tabs never run under sign-in. */
@media (min-width: 840px) and (max-width: 1023px) {
  .web { --dk-logo-w: 40px; }
  .dk-logo > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
