  /* Layout: browser-only top bar (menu + Hichamovic logo | social, language, login), full-bleed hero,
     install CTA, swipeable article rail, fixed bottom nav. In the installed app the top bar disappears. */
  :root {
    --bg: #060a12;
    --surface: #0e1624;
    --surface-2: #142034;
    --line: #1c2a42;
    --fg: #f2f6fc;
    --muted: #8b9bb4;
    --accent: #4aa8ff;
    --accent-ink: #04111f;
    --font: "IBM Plex Sans Arabic", system-ui, sans-serif;
    --top-h: 64px;
    --nav-h: 68px;
    --gutter-l: max(16px, env(safe-area-inset-left, 0px));
    --gutter-r: max(16px, env(safe-area-inset-right, 0px));
    color-scheme: dark;
  }
  * { box-sizing: border-box; }
  html, body { margin: 0; }
  body {
    background: var(--bg); color: var(--fg);
    font-family: var(--font); font-size: 16px; line-height: 1.6;
    -webkit-tap-highlight-color: transparent; overflow-x: hidden;
  }
  [hidden] { display: none !important; }
  h1, h2, h3 { margin: 0; text-wrap: balance; }
  a { color: inherit; text-decoration: none; }
  button { font: inherit; color: inherit; }
  .wrap { padding-left: var(--gutter-l); padding-right: var(--gutter-r); }

  /* ---------- Hichamovic logo: "hm" in one handwritten line + paper plane (#4aa8ff / #2563d6) ---------- */
  .logo {
    direction: ltr; display: inline-flex; align-items: center;
    color: #f2f6fc; line-height: 1;
  }
  .logo .mark { display: block; width: 1.6em; height: 1.34em; overflow: visible; }
  /* Small sizes: a thicker line so it stays readable */
  .notif .app .logo .mark .ink, .owner .avatar .logo .mark .ink { stroke-width: 6.5; }

  /* ---------- Splash ---------- */
  #splash {
    position: fixed; inset: 0; z-index: 100;
    display: grid; place-items: center; align-content: center; gap: 22px;
    background: var(--bg); transition: opacity .6s ease, visibility .6s;
  }
  #splash.out { opacity: 0; visibility: hidden; }
  /* The paper plane writes "hm" (0.9s), then rises and lands in place (0.3s). */
  #splash .hm-logo { position: relative; width: 180px; height: 150.5px; direction: ltr; }
  #splash .hm-logo > svg { display: block; }
  #splash .hm-ink { stroke-dasharray: 1 2; stroke-dashoffset: 1; }
  #splash.ready .hm-ink { animation: hm-ink .9s linear forwards; }
  #splash .hm-plane { position: absolute; left: 0; top: 0; width: 62.2px; height: 49.1px; offset-path: path('M6.55 142.36 C 19.64 106.36, 42.55 50.73, 36 21.27 C 31.09 1.64, 14.73 9.82, 19.64 34.36 L 26.18 142.36 C 29.45 109.64, 42.55 90, 55.64 90 C 68.73 90, 68.73 112.91, 68.73 142.36 C 70.36 109.64, 78.55 90, 90 90 C 101.45 90, 101.45 112.91, 101.45 142.36 C 103.09 109.64, 111.27 90, 122.73 90 C 134.18 90, 135.82 109.64, 137.45 122.73 C 139.09 99.82, 140.73 85.09, 144 75.27 C 147.27 63.82, 158.73 51.22, 176.73 37.64'); offset-rotate: auto; offset-anchor: 58.9px 24.5px; offset-distance: 0%; }
  #splash.ready .hm-plane { animation: hm-fly 1.2s linear forwards; }
  #splash .hm-plane svg { display: block; width: 62.2px; height: 49.1px; transform-origin: 58.9px 24.5px; transform: scale(.6); }
  #splash.ready .hm-plane svg { animation: hm-grow 1.2s linear forwards; }
  @keyframes hm-ink { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
  @keyframes hm-fly { 0% { offset-distance: 0%; } 75% { offset-distance: 92.92%; animation-timing-function: cubic-bezier(.2,.7,.3,1); } 100% { offset-distance: 100%; } }
  @keyframes hm-grow { 0%, 75% { transform: scale(.6); animation-timing-function: cubic-bezier(.2,.7,.3,1.4); } 100% { transform: scale(1); } }
  

  /* ---------- Top bar (browser only) ---------- */
  .topbar {
    direction: ltr;
    position: fixed; top: 0; inset-inline: 0; z-index: 40;
    height: calc(var(--top-h) + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
    padding-left: var(--gutter-l); padding-right: var(--gutter-r);
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    transition: background .3s ease, border-color .3s ease;
    border-bottom: 1px solid transparent;
  }
  .topbar.solid {
    background: rgba(6,10,18,.86);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border-bottom-color: var(--line);
  }
  .tb-side { display: flex; align-items: center; gap: 8px; }
  .tb-side .logo { font-size: 26px; }
  .menu-btn { width: 40px; height: 40px; display: grid; place-items: center; background: none; border: 0; cursor: pointer; padding: 0; }
  .menu-btn svg { width: 26px; height: 26px; }
  .icon-btn {
    width: 40px; height: 40px; border-radius: 12px;
    display: grid; place-items: center;
    background: rgba(20,32,52,.6);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,.1); cursor: pointer; padding: 0;
  }
  .icon-btn svg { width: 20px; height: 20px; }
  .login-btn {
    display: inline-flex; align-items: center; gap: 8px; height: 40px;
    background: #fff; color: #060a12; border: 0; border-radius: 12px;
    padding: 0 14px; font-weight: 700; font-size: 14px; cursor: pointer;
  }
  .login-btn svg { width: 18px; height: 18px; }
  .menu-btn:focus-visible, .icon-btn:focus-visible, .login-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

  .pop {
    position: absolute; top: calc(100% + 10px); left: 0;
    min-width: 200px; padding: 6px;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: 16px; box-shadow: 0 18px 40px rgba(0,0,0,.45);
    animation: pop .18s ease; z-index: 45;
  }
  @keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
  .pop a, .pop button {
    width: 100%; display: flex; align-items: center; gap: 12px;
    background: transparent; border: 0; border-radius: 10px;
    padding: 10px 12px; cursor: pointer; text-align: left; font-size: 15px;
  }
  .pop a:hover, .pop button:hover, .pop a:focus-visible, .pop button:focus-visible { background: var(--surface-2); outline: none; }
  .pop button[aria-selected="true"] { color: var(--accent); font-weight: 600; }
  .pop .flag { font-size: 20px; line-height: 1; width: 22px; text-align: center; }
  .pop svg { width: 20px; height: 20px; flex: none; }
  .anchor { position: relative; }

  /* ---------- Account tab ---------- */
  .page[data-view="account"] { padding-bottom: 24px; }
  .ac-hero { display: grid; justify-items: center; gap: 8px; text-align: center; margin: 18px 0 22px; }
  .ac-hero .logo { font-size: 40px; }
  .ac-hero h1 { font-size: 26px; font-weight: 700; }
  .ac-hero p { margin: 0; max-width: 32ch; color: var(--muted); font-size: 15px; }
  .ac-auth { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 54px; border-radius: 16px; border: 1px solid var(--line);
             background: var(--surface-2); color: var(--fg); font: inherit; font-weight: 600; font-size: 16px; cursor: pointer; }
  .ac-auth svg { width: 22px; height: 22px; }
  .ac-auth.e { background: #fff; color: #060a12; border-color: #fff; margin-top: 10px; }
  .ac-or { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--muted); font-size: 13px; }
  .ac-or::before, .ac-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
  .ac-input { width: 100%; height: 54px; padding: 0 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font: inherit; font-size: 16px; direction: ltr; text-align: left; }
  .ac-input:focus { outline: none; border-color: var(--accent); }
  .ac-small { margin: 10px 0 0; color: var(--muted); font-size: 13px; text-align: center; }
  .ac-small a { color: var(--accent); }
  .ac-head { display: flex; align-items: center; gap: 14px; margin: 10px 0 18px; }
  .ac-av { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--accent); color: var(--accent-ink); font-size: 26px; font-weight: 700; box-shadow: 0 0 0 4px rgba(74,168,255,.18); }
  .ac-head b { display: block; font-size: 20px; }
  .ac-head small { display: block; color: var(--muted); font-size: 13px; direction: ltr; text-align: right; }
  .ac-pass { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 18px; border-radius: 16px; background: rgba(74,168,255,.1); border: 1px solid rgba(74,168,255,.3); font-size: 14px; }
  .ac-pass button { margin-inline-start: auto; flex: none; padding: 8px 14px; border-radius: 999px; border: 0; background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; }
  .ac-pass svg { width: 22px; height: 22px; flex: none; color: var(--accent); }
  .ac-sec { margin: 22px 0 8px; font-size: 14px; font-weight: 700; color: var(--muted); }
  .ac-card { border-radius: 20px; border: 1px solid var(--line); background: var(--surface); overflow: hidden; }
  .ac-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; border: 0; background: none; color: var(--fg); font: inherit; text-align: start; cursor: pointer; }
  .ac-row + .ac-row { border-top: 1px solid var(--line); }
  .ac-row:active { background: var(--surface-2); }
  .ac-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: rgba(74,168,255,.12); color: var(--accent); }
  .ac-ic svg { width: 21px; height: 21px; }
  .ac-tx { flex: 1; min-width: 0; display: grid; line-height: 1.45; }
  .ac-tx b { font-size: 15px; }
  .ac-tx span { color: var(--muted); font-size: 13px; }
  .ac-tx span.on { color: #3ccf8e; }
  .ac-chev { width: 18px; height: 18px; flex: none; color: var(--muted); transform: scaleX(-1); }
  .ac-row.danger { color: #ff6b6b; }
  .ac-row.danger .ac-ic { background: rgba(255,107,107,.12); color: #ff6b6b; }

  .ac-pad { padding: 16px; }
  .ac-gap { margin-top: 12px; }
  .ac-streak { display: flex; align-items: center; gap: 12px; }
  .ac-fl { font-size: 36px; line-height: 1; }
  .ac-streak b { font-size: 28px; line-height: 1; color: #ff8a3d; }
  .ac-streak small { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; }
  .ac-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 14px; text-align: center; }
  .ac-week span { font-size: 12px; color: var(--muted); }
  .ac-week i { display: block; width: 28px; height: 28px; margin: 4px auto 0; border-radius: 50%; background: var(--bg); border: 2px solid var(--line); }
  .ac-week i.on { background: #ff8a3d; border-color: #ff8a3d; }
  .ac-week i.today { border-color: var(--accent); }
  .ac-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
  .ac-stats div { padding: 12px 6px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); text-align: center; }
  .ac-stats b { display: block; font-size: 22px; }
  .ac-stats span { color: var(--muted); font-size: 12px; }
  .ac-lvl { display: flex; justify-content: space-between; align-items: baseline; direction: ltr; }
  .ac-lvl small { color: var(--muted); unicode-bidi: plaintext; }
  .ac-lvlbar { height: 10px; margin-top: 10px; border-radius: 10px; background: var(--bg); overflow: hidden; direction: ltr; }
  .ac-lvlbar i { display: block; height: 100%; border-radius: 10px; background: linear-gradient(90deg, var(--accent-2, #2f7fe0), var(--accent)); }
  .ac-meds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .ac-med { padding: 12px 6px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); text-align: center; }
  .ac-med span { font-size: 28px; line-height: 1.2; }
  .ac-med b { display: block; margin-top: 4px; font-size: 12.5px; line-height: 1.35; }
  .ac-med.locked { opacity: .35; filter: grayscale(1); }
  .ac-reg { margin: 0 0 10px; color: #3ccf8e; font-size: 14px; font-weight: 600; }
  .ac-reg-cta { width: 100%; margin-bottom: 10px; padding: 12px 14px; border-radius: 14px; border: 1px dashed var(--accent); background: rgba(74,168,255,.08); color: var(--accent); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; }
  .ac-demo { margin: 0 0 8px; color: #f5b942; font-size: 12.5px; }
  .ac-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; margin-bottom: 10px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
  .ac-seg button { padding: 9px 4px; border-radius: 10px; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; }
  .ac-seg button.on { background: var(--surface-2); color: var(--fg); }
  .ac-seg i { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-style: normal; font-size: 11px; }
  .ac-pav { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--fg); font-weight: 700; font-size: 18px; }
  .ac-req { display: flex; gap: 12px; padding: 14px; }
  .ac-req + .ac-req { border-top: 1px solid var(--line); }
  .ac-req-b { flex: 1; min-width: 0; }
  .ac-req-b b { font-size: 15px; } .ac-req-b small { display: block; color: var(--muted); font-size: 12.5px; }
  .ac-req-b p { margin: 6px 0 10px; padding: 8px 12px; border-radius: 12px; background: var(--bg); font-size: 14px; }
  .ac-req-btns { display: flex; gap: 8px; }
  .ac-req-btns button { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; }
  .ac-req-btns .ac-ok { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
  .ac-req-btns .ac-rep { margin-inline-start: auto; border: 0; background: none; color: var(--muted); font-size: 13px; padding: 8px 4px; }
  .ac-badge { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; }
  .ac-row.static { cursor: default; }
  .ac-grp-t { margin: 0; padding: 12px 14px 4px; color: var(--muted); font-size: 13px; }
  .ac-empty { margin: 0; padding: 18px 14px; color: var(--muted); font-size: 14px; text-align: center; }
  .ac-bar { display: flex; align-items: center; gap: 12px; margin: 6px 0 14px; }
  .ac-bar b { font-size: 18px; }
  .ac-backbtn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--surface); border: 1px solid var(--line); color: var(--fg); cursor: pointer; }
  .ac-backbtn svg { width: 20px; height: 20px; }
  .ac-safe { margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: rgba(255,196,77,.08); border: 1px solid rgba(255,196,77,.3); color: #f3dfb0; font-size: 13px; }
  .ac-msgs { display: flex; flex-direction: column; gap: 8px; min-height: 40vh; max-height: 55vh; overflow-y: auto; padding: 4px 0 12px; }
  .ac-msg { max-width: 78%; padding: 9px 13px; border-radius: 16px; font-size: 15px; line-height: 1.5; }
  .ac-msg.in { align-self: flex-start; background: var(--surface-2); border-end-start-radius: 4px; }
  .ac-msg.out { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-end-end-radius: 4px; }
  .ac-send { display: flex; gap: 8px; position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 10px); padding-top: 8px; background: var(--bg); }
  .ac-send input { flex: 1; min-width: 0; height: 48px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font: inherit; font-size: 15px; }
  .ac-send input:focus { outline: none; border-color: var(--accent); }
  .ac-send button { width: 48px; height: 48px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); cursor: pointer; }
  .ac-send button svg { width: 20px; height: 20px; transform: scaleX(-1); }
  .ac-chat-more { margin-top: 12px; text-align: center; }
  .ac-chat-more button { border: 0; background: none; color: #ff6b6b; font: inherit; font-size: 14px; cursor: pointer; }
  .ac-sw { display: flex; align-items: center; gap: 12px; padding: 14px; cursor: pointer; }
  .ac-sw + .ac-sw { border-top: 1px solid var(--line); }
  .ac-sw input { position: absolute; opacity: 0; pointer-events: none; }
  .ac-sw input:checked + .nt-track { background: var(--accent); }
  .ac-sw input:checked + .nt-track i { inset-inline-start: 21px; }
  .ac-legal { margin: 22px 0 6px; text-align: center; color: var(--muted); font-size: 13px; }
  .ac-legal a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }

  /* Alerts bell: rings now and then; the blue dot stays until the person subscribes */
  .bell-btn { position: relative; }
  .bell-btn .bell { display: grid; transform-origin: 50% 8%; animation: bell-ring 5s ease-in-out infinite; }
  .bell-btn .bell svg { width: 20px; height: 20px; }
  .bell-dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--bg); }
  .bell-btn.on .bell { animation: none; color: var(--accent); }
  .bell-btn.on .bell-dot { display: none; }
  @keyframes bell-ring { 0%, 78%, 100% { transform: rotate(0); } 82% { transform: rotate(16deg); } 86% { transform: rotate(-13deg); } 90% { transform: rotate(9deg); } 94% { transform: rotate(-5deg); } }
  .app-bell { position: absolute; z-index: 40; top: calc(env(safe-area-inset-top, 0px) + 12px); right: calc(env(safe-area-inset-right, 0px) + 14px); }
  html:not(.is-app) .app-bell { display: none; }
  .nt-scrim { position: fixed; inset: 0; z-index: 80; background: rgba(2,5,10,.6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: fade .2s ease; }
  .nt-sheet { position: fixed; inset-inline: 0; bottom: 0; z-index: 81; max-width: 520px; margin-inline: auto; max-height: 92vh; overflow-y: auto;
              padding: 12px 20px calc(20px + env(safe-area-inset-bottom, 0px)); border-radius: 26px 26px 0 0; background: var(--surface);
              border: 1px solid var(--line); border-bottom: 0; text-align: center; animation: nt-up .3s cubic-bezier(.2,.8,.2,1); }
  @keyframes nt-up { from { transform: translateY(100%); } }
  .nt-grab { width: 44px; height: 5px; margin: 0 auto 16px; border-radius: 5px; background: var(--line); }
  .nt-ic { width: 60px; height: 60px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center; background: rgba(74,168,255,.12); color: var(--accent); }
  .nt-ic svg { width: 30px; height: 30px; transform-origin: 50% 8%; animation: bell-ring 2.5s ease-in-out infinite; }
  .nt-sheet h2 { font-size: 21px; font-weight: 700; }
  .nt-lead { margin: 6px auto 0; max-width: 34ch; color: var(--muted); font-size: 15px; }
  .nt-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; text-align: start; }
  .nt-list li { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); font-size: 15px; }
  .nt-list svg { width: 20px; height: 20px; flex: none; color: var(--accent); }
  .nt-switch { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); text-align: start; font-weight: 600; cursor: pointer; }
  .nt-switch input { position: absolute; opacity: 0; pointer-events: none; }
  .nt-track { position: relative; width: 46px; height: 28px; flex: none; border-radius: 999px; background: var(--surface-2); transition: background .2s ease; }
  .nt-track i { position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: inset-inline-start .2s ease; }
  .nt-switch input:checked + .nt-track { background: var(--accent); }
  .nt-switch input:checked + .nt-track i { inset-inline-start: 21px; }
  .nt-switch input:focus-visible + .nt-track { outline: 2px solid var(--accent); outline-offset: 2px; }
  .nt-switch:has(input:checked) { border-color: var(--accent); }
  .nt-note { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
  .nt-ios { margin: 12px 0 0; padding: 12px 14px; border-radius: 14px; background: rgba(74,168,255,.08); border: 1px solid rgba(74,168,255,.3); color: #cfe6ff; font-size: 14px; text-align: start; }
  .nt-ios button { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 10px; padding: 11px; border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; }
  .nt-ios button svg { width: 18px; height: 18px; }
  .nt-btns { display: flex; gap: 10px; margin-top: 16px; }
  .nt-btns button { flex: 1; min-height: 52px; border-radius: 999px; border: 0; font: inherit; font-weight: 700; font-size: 16px; cursor: pointer; }
  .nt-later { background: var(--bg); color: var(--fg); border: 1px solid var(--line) !important; }
  .nt-ok { background: var(--accent); color: var(--accent-ink); }
  .nt-ok:disabled { opacity: .45; cursor: default; }
  @media (prefers-reduced-motion: reduce) { .bell-btn .bell, .nt-ic svg { animation: none; } }

  /* App floating language button (installed app only, replaces the top bar) */
  .app-lang {
    position: absolute; z-index: 40;
    top: calc(env(safe-area-inset-top, 0px) + 12px);
    left: calc(env(safe-area-inset-left, 0px) + 14px);
    direction: ltr;
  }

  /* ---------- Drawer menu ---------- */
  .scrim { position: fixed; inset: 0; z-index: 60; background: rgba(2,5,10,.6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: fade .2s ease; }
  .drawer {
    position: fixed; top: 0; bottom: 0; right: 0; z-index: 61;
    width: min(86vw, 340px);
    background: var(--surface); border-left: 1px solid var(--line);
    padding: calc(env(safe-area-inset-top, 0px) + 18px) max(18px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 18px) 18px;
    display: flex; flex-direction: column; gap: 6px;
    animation: slide .26s cubic-bezier(.2,.8,.2,1);
  }
  @keyframes slide { from { transform: translateX(100%); } to { transform: none; } }
  .drawer-head { direction: ltr; display: flex; flex-direction: row-reverse; align-items: center; justify-content: space-between; margin-bottom: 14px; }
  .drawer-head .logo { font-size: 28px; }
  .drawer a, .drawer .d-item {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 13px 12px; border-radius: 12px; font-weight: 500; font-size: 16px;
    background: none; border: 0; cursor: pointer; text-align: start; width: 100%;
  }
  .drawer a:hover, .drawer .d-item:hover { background: var(--surface-2); }
  .drawer .sep { height: 1px; background: var(--line); margin: 8px 4px; }
  .drawer .small-links { margin-top: auto; display: flex; gap: 16px; color: var(--muted); font-size: 13px; direction: ltr; padding: 0 12px; }

  /* ---------- Hero ---------- */
  .hero {
    position: relative;
    display: grid; align-content: center; justify-items: center;
    padding-top: calc(var(--top-h) + env(safe-area-inset-top, 0px) + 72px);
    padding-bottom: 64px;
    overflow: hidden; isolation: isolate;
  }
  html.is-app .hero { padding-top: calc(env(safe-area-inset-top, 0px) + 120px); }
  .hero-bg { position: absolute; inset: 0; z-index: -2; background: #08111f; }
  .hero-bg::before, .hero-bg::after {
    content: ""; position: absolute; inset: -30%;
    background:
      radial-gradient(40% 35% at 30% 30%, rgba(74,168,255,.55), transparent 70%),
      radial-gradient(35% 30% at 75% 40%, rgba(40,90,200,.55), transparent 70%),
      radial-gradient(45% 40% at 50% 80%, rgba(20,60,140,.6), transparent 70%);
    filter: blur(30px); animation: drift 18s ease-in-out infinite alternate;
  }
  .hero-bg::after {
    background:
      radial-gradient(30% 25% at 65% 25%, rgba(160,210,255,.35), transparent 70%),
      radial-gradient(30% 30% at 20% 70%, rgba(74,168,255,.3), transparent 70%);
    animation-duration: 24s; animation-direction: alternate-reverse;
  }
  @keyframes drift { 0% { transform: translate3d(-4%,-3%,0) rotate(0deg); } 100% { transform: translate3d(5%,4%,0) rotate(8deg); } }
  .hero video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
  #snow { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; }
  .hero-fade {
    position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background:
      linear-gradient(to bottom, rgba(6,10,18,.55) 0%, rgba(6,10,18,0) 22%),
      linear-gradient(to top, var(--bg) 0%, rgba(6,10,18,.75) 26%, rgba(6,10,18,0) 60%);
  }
  .headline {
    font-weight: 700; text-align: center; line-height: 1.2; letter-spacing: -0.2px;
    white-space: nowrap; font-size: clamp(28px, 8.4vw, 52px);
    text-shadow: 0 6px 30px rgba(0,0,0,.35);
  }
  html:not([lang="ar"]) .headline { font-size: clamp(22px, 6.6vw, 46px); letter-spacing: -0.6px; }
  .headline .l1 { color: #fff; }
  .headline .l2 { color: var(--accent); }
  .headline .dots { display: inline-flex; align-items: flex-end; gap: .09em; margin-inline: .2em .24em; vertical-align: baseline; height: .5em; }
  .headline .dots i { display: block; width: var(--dot-w, .135em); height: var(--dot-h, .13em); border-radius: 50%; background: #fff; }

  .install-cta {
    margin-top: 22px; display: inline-flex; align-items: center; gap: 10px;
    font-weight: 700; font-size: 16px;
    background: var(--accent); color: var(--accent-ink);
    border: 0; border-radius: 999px; padding: 13px 22px 13px 20px; cursor: pointer;
    box-shadow: 0 10px 30px rgba(74,168,255,.35);
    transition: transform .15s ease, box-shadow .2s ease;
  }
  .install-cta:hover { transform: translateY(-1px); box-shadow: 0 14px 36px rgba(74,168,255,.45); }
  .install-cta:active { transform: scale(.97); }
  .install-cta:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
  .install-cta svg { width: 20px; height: 20px; flex: none; }
  .install-sub { margin-top: 10px; color: var(--muted); font-size: 13px; text-align: center; }

  /* ---------- Articles rail ---------- */
  .rail-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 14px 0; }
  .rail-head h2 { font-weight: 700; font-size: 22px; }
  .rail-head a { color: var(--accent); font-weight: 600; font-size: 14px; white-space: nowrap; }
  .rail {
    display: flex; gap: 14px; overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter-r) var(--gutter-l);
    padding-inline: var(--gutter-r) var(--gutter-l);
    padding-block: 4px 6px; scrollbar-width: none;
  }
  html[dir="ltr"] .rail { scroll-padding-inline: var(--gutter-l) var(--gutter-r); padding-inline: var(--gutter-l) var(--gutter-r); }
  .rail::-webkit-scrollbar { display: none; }
  .card {
    position: relative; flex: 0 0 min(84%, 420px); aspect-ratio: 4 / 5; max-width: 100%;
    scroll-snap-align: start; border-radius: 26px; overflow: hidden;
    background: linear-gradient(160deg, var(--surface-2), var(--surface));
    border: 1px solid var(--line); isolation: isolate; direction: rtl;
  }
  .card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform .6s ease; }
  .card:hover img { transform: scale(1.04); }
  .card::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(4,8,16,.96) 0%, rgba(4,8,16,.7) 38%, rgba(4,8,16,0) 70%); }
  .card .tag { position: absolute; top: 16px; right: 16px; font-weight: 700; font-size: 13px; background: var(--accent); color: var(--accent-ink); padding: 4px 12px; border-radius: 8px; transform: skewX(-8deg); }
  .card .body { position: absolute; inset-inline: 0; bottom: 0; padding: 20px 20px 22px; display: grid; gap: 8px; }
  .card h3 { font-weight: 700; font-size: 22px; line-height: 1.3; }
  .card p { margin: 0; color: #c3cfe0; font-size: 15px; line-height: 1.55; }
  .card .go { color: var(--accent); font-weight: 700; font-size: 15px; margin-top: 4px; }
  .card:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
  html[dir="ltr"] .card { direction: ltr; }
  html[dir="ltr"] .card .tag { right: auto; left: 16px; }

  /* ---------- مسارك إلى ألمانيا (built into the app, same tokens as the rest) ---------- */
  .mg { text-align: start; }
  .mg-q-page { flex: 1; display: flex; flex-direction: column; padding-bottom: 16px; }
  .mg-page { padding-top: 6px; padding-bottom: 16px; animation: fade .3s ease; }
  .mg-intro { text-align: center; display: grid; justify-items: center; align-content: center; gap: 14px; padding: 0 0 10px; min-height: calc(100dvh - var(--top-h) - var(--nav-h) - 48px); }
  html.is-app .mg-intro { min-height: calc(100dvh - var(--nav-h) - 48px); }
  .mg-ico { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; background: rgba(74,168,255,.12); color: var(--accent); border: 1px solid rgba(74,168,255,.3); flex: none; }
  .mg-ico svg { width: 28px; height: 28px; }
  .mg-plane { display: grid; place-items: center; color: var(--accent); }
  .mg-plane svg { width: 84px; height: 84px; }
  .mg-ico-lg { width: 84px; height: 84px; margin: 0 auto 6px; }
  .mg-ico-lg svg { width: 38px; height: 38px; }
  .mg-h { font-weight: 700; font-size: clamp(28px, 9vw, 40px); line-height: 1.3; }
  .mg-h b { color: var(--accent); font-weight: 700; }
  .mg-p { margin: 0; color: var(--muted); font-size: 16px; max-width: 360px; }
  .mg-center { text-align: center; }
  .mg-rt { font-weight: 700; font-size: 26px; line-height: 1.35; margin: 4px 0 12px; }
  .mg-lesson { font-size: 17px; line-height: 1.9; color: #c3cfe0; margin: 0 0 12px; }
  .mg-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 56px; padding: 10px 18px; border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 700; font-size: 17px; text-decoration: none; cursor: pointer; box-shadow: 0 10px 28px rgba(74,168,255,.28); transition: opacity .2s; }
  .mg-btn[disabled] { opacity: .35; box-shadow: none; cursor: default; }
  .mg-btn.ghost { background: var(--surface); color: var(--fg); border: 1px solid var(--line); box-shadow: none; }
  .mg-mt { margin-top: 10px; }
  
  .mg-meta { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 14px; margin: 6px 0 8px; }
  .mg-step-no { color: var(--accent); font-weight: 700; }
  .mg-bar { height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; margin-bottom: 18px; }
  .mg-bar i { display: block; height: 100%; background: var(--accent); border-radius: 6px; transition: width .35s; }
  .mg-q { font-weight: 700; font-size: 25px; line-height: 1.4; text-align: center; margin: 8px 0 6px; }
  .mg-sub { text-align: center; color: var(--muted); font-size: 15px; margin: 0 0 18px; }
  .mg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .mg-card { position: relative; display: grid; justify-items: center; gap: 12px; padding: 22px 10px 18px; border-radius: 22px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font: inherit; font-weight: 700; font-size: 17px; cursor: pointer; transition: border-color .2s, background .2s; }
  .mg-card.wide { grid-column: 1 / -1; }
  .mg-card .mg-ico { width: 64px; height: 64px; }
  .mg-card .mg-ico svg { width: 30px; height: 30px; }
  .mg-card.sel { border-color: var(--accent); background: var(--surface-2); box-shadow: 0 0 0 3px rgba(74,168,255,.18); }
  .mg-opt { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; margin: 0 0 8px; padding: 10px 16px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font: inherit; font-size: 16px; font-weight: 600; text-align: start; cursor: pointer; }
  .mg-opt.sel { border-color: var(--accent); background: var(--surface-2); }
  .mg-dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #3a4c6b; flex: none; }
  .mg-opt.sel .mg-dot { background: var(--accent); border-color: var(--accent); box-shadow: inset 0 0 0 4px var(--surface-2); }
  .mg-select { width: 100%; min-height: 56px; margin: 0 0 10px; padding: 12px 16px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font: inherit; font-size: 16px; font-weight: 600; color-scheme: dark; }
  .mg-sub-q { margin-top: 16px; }
  .mg-bqt { font-size: 18px; font-weight: 700; margin: 0 0 10px; }
  /* Prev/next always sit at the same spot, just above the tab bar: margin-top:auto puts them at the bottom when a step
     is short, and sticky keeps them there when a step is taller than the screen (content scrolls under them). */
  .mg-nav { position: sticky; z-index: 5; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 16px);
            display: flex; gap: 10px; margin-top: auto; padding-top: 24px;
            background: linear-gradient(to top, var(--bg) 72%, rgba(6,10,18,0)); }
  .mg-spacer { flex: 1; }
  .mg-lesson-page { padding-bottom: 0; min-height: calc(100dvh - var(--top-h) - var(--nav-h) - 60px); display: flex; flex-direction: column; justify-content: center; }
  html.is-app .mg-lesson-page { min-height: calc(100dvh - var(--nav-h) - 170px); }
  .mg-lesson-page .mg-lesson { text-align: center; font-size: 21px; line-height: 2; color: var(--fg); margin: 0; padding: 0 4px; }
  .mg-nav .mg-btn { flex: 1; }
  .mg-box { border-radius: 22px; border: 1px solid var(--line); background: var(--surface); padding: 18px; margin: 0 0 12px; }
  .mg-box.best { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(74,168,255,.14); }
  .mg-tag { display: inline-block; padding: 2px 12px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 13px; font-weight: 700; }
  .mg-rh { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
  .mg-rh h3 { font-size: 19px; font-weight: 700; line-height: 1.4; }
  .mg-ic { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: rgba(74,168,255,.12); color: var(--accent); flex: none; }
  .mg-ic svg { width: 24px; height: 24px; }
  .mg-box ul { margin: 10px 0 14px; padding-inline-start: 18px; color: var(--muted); font-size: 15px; }
  .mg-box li.w { color: #f5b942; }
  .mg-note { border-inline-start: 3px solid var(--accent); background: var(--surface-2); padding: 12px 14px; border-radius: 12px; font-size: 15px; margin: 10px 0; }
  .mg-sec { font-size: 19px; font-weight: 700; margin: 18px 0 8px; }
  .mg-small { font-size: 13px; color: var(--muted); margin: 16px 0 8px; }
  .mg-back { display: block; width: 100%; margin-top: 8px; padding: 10px; background: none; border: 0; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }

  .md-demo { position: relative; height: 220px; overflow: hidden; display: grid; place-items: center; background: none; border: 0; box-shadow: none; padding: 0; text-decoration: none; color: inherit; -webkit-tap-highlight-color: transparent; }
  
  
  
  
  
  
  
  @keyframes dd-out { 0% { opacity: 0; transform: translate(0,0) scale(.5) rotate(0); } 18% { opacity: 1; } 75% { opacity: .9; } 100% { opacity: 0; transform: translate(var(--x), var(--y)) scale(1.05) rotate(var(--r)); } }
  @keyframes scrib-draw { 0% { stroke-dashoffset: 260; } 60%, 100% { stroke-dashoffset: 0; } }
  @keyframes scrib { 0%, 80%, 100% { opacity: .6; } 90% { opacity: 0; } }
  
  /* Quiz deck: three question cards get answered and fly off, the visa card comes forward and gets stamped.
     No text inside, so it reads the same in every language. 8s loop. */
  .qz { position: relative; width: min(240px, 80%); height: 206px; direction: ltr; }
  .qz-card {
    position: absolute; inset-inline: 0; top: 6px; height: 160px; padding: 16px;
    border-radius: 20px; background: var(--surface); border: 1px solid var(--line);
    box-shadow: 0 18px 40px rgba(0,0,0,.4); transform-origin: 50% 100%; opacity: 0;
    animation-duration: 8s; animation-iteration-count: infinite; animation-timing-function: cubic-bezier(.4,0,.2,1);
  }
  .qz-c1 { z-index: 4; animation-name: qz-1; }
  .qz-c2 { z-index: 3; animation-name: qz-2; }
  .qz-c3 { z-index: 2; animation-name: qz-3; }
  .qz-c4 { z-index: 1; animation-name: qz-4; }
  @keyframes qz-1 { 0% { opacity: 0; transform: none; } 3%, 20% { opacity: 1; transform: none; } 26%, 100% { opacity: 0; transform: translateY(-46px) scale(1.04); } }
  @keyframes qz-2 { 0% { opacity: 0; transform: translateY(14px) scale(.93); } 3%, 20% { opacity: .75; transform: translateY(14px) scale(.93); } 26%, 45% { opacity: 1; transform: none; } 51%, 100% { opacity: 0; transform: translateY(-46px) scale(1.04); } }
  @keyframes qz-3 { 0% { opacity: 0; transform: translateY(28px) scale(.86); } 3%, 20% { opacity: .45; transform: translateY(28px) scale(.86); } 26%, 45% { opacity: .75; transform: translateY(14px) scale(.93); } 51%, 70% { opacity: 1; transform: none; } 76%, 100% { opacity: 0; transform: translateY(-46px) scale(1.04); } }
  @keyframes qz-4 { 0%, 20% { opacity: 0; transform: translateY(42px) scale(.79); } 26%, 45% { opacity: .45; transform: translateY(28px) scale(.86); } 51%, 70% { opacity: .75; transform: translateY(14px) scale(.93); } 76%, 94% { opacity: 1; transform: none; } 100% { opacity: 0; transform: none; } }
  .qz-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
  .qz-ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; background: rgba(74,168,255,.12); color: var(--accent); }
  .qz-ic svg { width: 18px; height: 18px; }
  .qz-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
  .qz-bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
  .qz-opt { position: relative; display: block; height: 18px; margin-top: 9px; border-radius: 9px; background: var(--surface-2); }
  .qz-opt + .qz-opt + .qz-opt { width: 78%; }
  .qz-opt::before { content: ""; position: absolute; left: 6px; top: 5px; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--muted); box-sizing: border-box; }
  .qz-opt.pick { animation: qz-pick 8s infinite; }
  .qz-tap { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; background: #fff; opacity: 0; animation: qz-tap 8s infinite; }
  .qz-c2 .pick, .qz-c2 .qz-tap { animation-delay: 2s; }
  .qz-c3 .pick, .qz-c3 .qz-tap { animation-delay: 4s; }
  @keyframes qz-pick { 0%, 8% { background: var(--surface-2); } 11%, 22% { background: var(--accent); } 24%, 100% { background: var(--surface-2); } }
  @keyframes qz-tap { 0%, 8% { opacity: 0; transform: scale(.4); } 10% { opacity: .55; transform: scale(1); } 16%, 100% { opacity: 0; transform: scale(2.4); } }
  .qz-visa { background: linear-gradient(135deg, #4aa8ff 0%, #2563d6 100%); border-color: transparent; color: #fff; overflow: hidden; }
  .qz-visa::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.35) 50%, transparent 65%); transform: translateX(-120%); animation: qz-shine 8s infinite; }
  @keyframes qz-shine { 0%, 76% { transform: translateX(-120%); } 86%, 100% { transform: translateX(120%); } }
  .qz-chip { display: block; width: 30px; height: 22px; border-radius: 5px; background: rgba(255,255,255,.35); }
  .qz-id { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
  .qz-ph { width: 56px; height: 66px; border-radius: 10px; display: grid; place-items: center; flex: none; background: rgba(255,255,255,.18); }
  .qz-ph svg { width: 34px; height: 34px; }
  .qz-lines { flex: 1; display: grid; gap: 9px; }
  .qz-lines i { display: block; height: 8px; border-radius: 4px; background: rgba(255,255,255,.55); }
  .qz-lines i:nth-child(2) { width: 70%; }
  .qz-lines i:nth-child(3) { width: 45%; }
  .qz-stamp { position: absolute; right: 14px; bottom: 12px; width: 50px; height: 50px; border-radius: 50%; border: 3px solid #fff; display: grid; place-items: center; background: rgba(4,17,31,.18); opacity: 0; animation: qz-stamp 8s infinite; }
  .qz-stamp svg { width: 26px; height: 26px; }
  @keyframes qz-stamp { 0%, 79% { opacity: 0; transform: scale(2.2) rotate(-35deg); } 83% { opacity: 1; transform: scale(.9) rotate(-14deg); } 86%, 94% { opacity: 1; transform: scale(1) rotate(-14deg); } 100% { opacity: 0; transform: scale(1) rotate(-14deg); } }
  @media (prefers-reduced-motion: reduce) {
    .qz-card, .qz-opt.pick, .qz-tap, .qz-stamp, .qz-visa::after { animation: none; }
    .qz-c1, .qz-c2, .qz-c3 { display: none; }
    .qz-c4 { opacity: 1; }
    .qz-stamp { opacity: 1; transform: rotate(-14deg); }
  }
  /* ---------- In-app article reader ---------- */
  .art-back { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 8px 18px; font-weight: 600; font-size: 14px; color: var(--fg); cursor: pointer; margin-bottom: 16px; }
  .art-title { font-size: 26px; line-height: 1.35; font-weight: 700; margin-bottom: 16px; }
  .art-img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 20px; margin-bottom: 20px; }
  .art-content { font-size: 17px; line-height: 1.85; color: #d6e0ee; overflow-wrap: anywhere; }
  .art-content h2, .art-content h3 { color: var(--fg); margin: 1.5em 0 .5em; font-size: 21px; line-height: 1.4; }
  .art-content p { margin: 0 0 1em; }
  .art-content a { color: var(--accent); text-decoration: underline; }
  .art-content img { max-width: 100%; height: auto; border-radius: 14px; }
  .art-content ul, .art-content ol { padding-inline-start: 1.3em; }
  .art-msg { color: var(--muted); }
  .art-foot { margin-top: 24px; padding-bottom: 12px; }
  .rail-dots { display: flex; justify-content: center; gap: 7px; margin-top: 18px; }
  .rail-dots i { width: 7px; height: 7px; border-radius: 4px; background: var(--line); transition: width .3s cubic-bezier(.16,1,.3,1), background-color .3s ease; }
  .rail-dots i.on { width: 22px; background: var(--fg); }

  /* ---------- Project feature sections ---------- */
  .feature { padding-block: 64px 8px; text-align: center; }
  .feature + .feature { margin-top: 48px; }
  .pill { display: inline-flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 8px 6px 16px; font-size: 14px; color: #c3cfe0; }
  html[dir="ltr"] .pill { padding: 6px 16px 6px 8px; }
  .pill b { background: var(--surface-2); color: var(--accent); font-weight: 600; font-size: 12px; border-radius: 999px; padding: 3px 10px; }
  .f-title { margin-top: 18px; font-weight: 700; font-size: clamp(30px, 9vw, 52px); line-height: 1.2; }
  .f-title .w { display: block; color: #fff; }
  .f-title .b { display: block; color: var(--accent); }
  .f-desc { margin: 14px auto 0; max-width: 34ch; color: var(--muted); font-size: 16px; line-height: 1.7; }
  .chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 26px auto 0; max-width: 460px; }
  .chip { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 6px 12px; display: grid; justify-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; }
  .chip svg { width: 22px; height: 22px; color: var(--accent); }
  .mock { position: relative; margin: 30px auto 0; max-width: 400px; text-align: start; direction: rtl;
          background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line);
          border-radius: 26px; padding: 18px; box-shadow: 0 30px 60px rgba(0,0,0,.35); }
  .mock::before { content: ""; position: absolute; inset: -40px -20px auto; height: 160px; z-index: -1;
          background: radial-gradient(50% 60% at 50% 50%, rgba(74,168,255,.25), transparent 70%); filter: blur(20px); }
  .f-cta { margin-top: 26px; display: inline-flex; align-items: center; gap: 10px; background: var(--surface); color: var(--fg);
           border: 1px solid var(--line); border-radius: 16px; padding: 14px 26px; font-weight: 700; font-size: 16px; cursor: pointer; }
  .f-cta:hover { border-color: var(--accent); }

  /* ---------- German course in Germany (same flow as the site page: level, costs, sign-up on WhatsApp) ---------- */
  .page[data-view="p-kurs"] { display: flex; flex-direction: column; }
  #kc-root { flex: 1; display: flex; flex-direction: column; }
  main:has(.page[data-view="p-kurs"]:not([hidden]) #kc-root:not([data-step="0"])) .site-foot { display: none; }
  #kc-root .mg-btn:disabled { opacity: .45; cursor: default; box-shadow: none; }
  #kc-root .mg-btn svg { width: 20px; height: 20px; flex: none; }
  .kc-hero { display: grid; justify-items: center; gap: 8px; text-align: center; margin: 8px 0 14px; }
  .kc-hero .mg-ic { width: 56px; height: 56px; border-radius: 50%; }
  .kc-hero .mg-ic svg { width: 30px; height: 30px; }
  .kc-hero .mg-ic.warn { background: rgba(245,185,66,.14); color: #f5b942; }
  .kc-hero .mg-ic.ok { background: rgba(60,207,142,.14); color: #3ccf8e; }
  .kc-hero h2 { font-size: 24px; font-weight: 700; line-height: 1.35; }
  .kc-hero p { margin: 0; max-width: 34ch; color: var(--muted); font-size: 15px; }
  .kc-intro { margin-top: 20px; }
  .kc-intro h2 { font-size: clamp(26px, 8vw, 34px); }
  .kc-intro h2 b { color: var(--accent); }
  .kc-guide { display: block; margin: 4px 0 12px; text-align: center; color: var(--accent); font-weight: 600; font-size: 15px; }
  .kc-steps { list-style: none; margin: 4px 0 14px; padding: 0; display: grid; gap: 10px; }
  .kc-steps li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); font-size: 16px; font-weight: 600; }
  .kc-steps b { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--accent); color: var(--accent-ink); font-size: 15px; }
  .kc-chk { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 10px; padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); font-size: 15px; line-height: 1.65; cursor: pointer; }
  .kc-chk input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
  .kc-chk:has(input:checked) { border-color: var(--accent); }
  .kc-wa.off { background: var(--surface-2); color: var(--muted); pointer-events: none; }
  .kc-cost { margin: 4px 0 12px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); overflow: hidden; }
  .kc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; font-size: 15px; }
  .kc-row + .kc-row { border-top: 1px solid var(--line); }
  .kc-row small { display: block; color: var(--muted); font-size: 13px; unicode-bidi: plaintext; }
  .kc-row b { direction: ltr; white-space: nowrap; font-variant-numeric: tabular-nums; }
  .kc-row.total { background: var(--surface-2); font-weight: 700; }
  .kc-row.total b { color: var(--accent); font-size: 20px; }
  .kc-list { display: grid; gap: 10px; margin: 0 0 12px; }
  .kc-li { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); font-size: 15px; line-height: 1.65; }
  .kc-li .mg-ic { width: 38px; height: 38px; border-radius: 12px; }
  .kc-li .mg-ic svg { width: 20px; height: 20px; }
  .kc-wa { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; margin-top: 4px; border-radius: 999px; background: #25d366; color: #04150d; font-weight: 700; font-size: 17px; }
  .kc-wa svg { width: 22px; height: 22px; }

  /* ---------- Learn with people from home: radar (4s turn; a person lights up as the sweep passes) ---------- */
  .rd { margin: 22px auto 0; width: min(300px, 86%); }
  .rd svg { display: block; width: 100%; height: auto; overflow: visible; }
  .rd-sweep { transform-origin: 130px 110px; animation: rd-spin 4s linear infinite; }
  @keyframes rd-spin { to { transform: rotate(360deg); } }
  .rd-blip { opacity: .15; animation: rd-blip 4s linear infinite; }
  @keyframes rd-blip { 0%, 75% { opacity: 1; } 100% { opacity: .15; } }
  .rd-ripple { transform-box: fill-box; transform-origin: center; animation: rd-rip 3s ease-out infinite; }
  @keyframes rd-rip { from { opacity: .5; transform: scale(1); } to { opacity: 0; transform: scale(5); } }
  @media (prefers-reduced-motion: reduce) { .rd-sweep, .rd-blip, .rd-ripple { animation: none; } .rd-blip { opacity: 1; } .rd-ripple { opacity: 0; } }

  /* ---------- Beginner explainers: path list on home ---------- */
  /* Compact 4x2 grid of paths (icon + name), same tile language as .chips */
  .sh-list { margin: 26px auto 0; max-width: 460px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .sh-row { display: grid; justify-items: center; align-content: start; gap: 8px; padding: 14px 4px 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); text-align: center; transition: border-color .2s ease, transform .15s ease; }
  .sh-row:hover { border-color: var(--accent); }
  .sh-row:active { transform: scale(.96); }
  .sh-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .sh-ic { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: rgba(74,168,255,.12); color: var(--accent); }
  .sh-ic svg { width: 21px; height: 21px; }
  .sh-tx { min-width: 0; max-width: 100%; }
  .sh-tx b { display: block; font-weight: 600; font-size: 12.5px; line-height: 1.35; hyphens: manual; }
  .sh-tx span, .sh-chev { display: none; }

  /* ---------- Beginner explainers: story view (tap or next/prev through slides) ---------- */
  .page[data-view="sharh"] { display: flex; flex-direction: column; }
  #sh-root { flex: 1; display: flex; flex-direction: column; padding-bottom: 16px; }
  .sh-top { display: flex; align-items: center; gap: 10px; }
  .sh-pi { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; background: rgba(74,168,255,.12); color: var(--accent); }
  .sh-pi svg { width: 18px; height: 18px; }
  .sh-name { flex: 1; font-weight: 700; font-size: 16px; }
  .sh-x { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; padding: 0; background: var(--surface); border: 1px solid var(--line); color: var(--fg); cursor: pointer; }
  .sh-x svg { width: 20px; height: 20px; }
  .sh-seg { display: flex; gap: 6px; margin-top: 14px; }
  .sh-seg i { position: relative; flex: 1; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
  .sh-seg i::after { content: ""; position: absolute; inset: 0; background: var(--accent); transform: scaleX(0); transform-origin: right; }
  .sh-seg i.done::after { transform: none; }
  .sh-seg i.on::after { animation: sh-fill .6s cubic-bezier(.16,1,.3,1) forwards; }
  @keyframes sh-fill { to { transform: none; } }
  .sh-stage { flex: 1; display: grid; align-content: center; justify-items: center; text-align: center; padding: 36px 0 12px; cursor: pointer; -webkit-user-select: none; user-select: none; }
  .sh-slide { display: grid; justify-items: center; gap: 16px; animation: sh-in .6s cubic-bezier(.16,1,.3,1) both; }
  @keyframes sh-in { from { opacity: 0; transform: translateY(20px); filter: blur(8px); } }
  .sh-big { width: 96px; height: 96px; margin-bottom: 6px; border-radius: 50%; display: grid; place-items: center; color: var(--accent);
            background: radial-gradient(circle at 50% 35%, rgba(74,168,255,.24), rgba(74,168,255,.06) 70%);
            border: 1px solid rgba(74,168,255,.3); box-shadow: 0 18px 40px rgba(20,90,200,.25); }
  .sh-big svg { width: 42px; height: 42px; }
  .sh-t { font-weight: 700; font-size: clamp(26px, 7.5vw, 34px); line-height: 1.3; }
  .sh-p { margin: 0; max-width: 32ch; color: #c3cfe0; font-size: 17px; line-height: 1.85; }
  .sh-soc { display: flex; gap: 12px; justify-content: center; margin-top: 4px; }
  .sh-soc a { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--fg); transition: border-color .2s ease, transform .15s ease; }
  .sh-soc a:hover { border-color: var(--accent); }
  .sh-soc a:active { transform: scale(.95); }
  .sh-soc svg { width: 24px; height: 24px; }
  .sh-slide .mg-btn { margin-top: 8px; max-width: 320px; }
  .sh-slide .mg-small { max-width: 34ch; }
  .sh-x:focus-visible, .sh-soc a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .mg-box .mg-btn + .mg-btn { margin-top: 10px; }
  #sh-root .mg-btn svg { width: 20px; height: 20px; flex: none; }
  @media (prefers-reduced-motion: reduce) { .sh-slide, .sh-seg i.on::after { animation: none; } .sh-seg i.on::after { transform: none; } }
  .f-cta svg { width: 18px; height: 18px; }
  html[dir="rtl"] .f-cta svg { transform: scaleX(-1); }

  /* Lamma mock */
  
  .city { background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 13px; color: #c3cfe0; }
  .city.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
  .match { margin-top: 14px; display: flex; align-items: center; gap: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 18px; padding: 12px; }
  
  
  
  .match .txt { flex: 1; min-width: 0; font-size: 14px; line-height: 1.45; }
  .match .txt small { display: block; color: var(--muted); font-size: 12.5px; }
  .match .ok { background: var(--accent); color: var(--accent-ink); border-radius: 10px; padding: 6px 12px; font-weight: 700; font-size: 13px; flex: none; }

  /* Hedra mock */
  .chat-head { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
  .chat-head .av { width: 38px; height: 38px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; }
  .chat-head small { display: block; color: var(--muted); font-size: 12px; }
  .bubbles { display: grid; gap: 8px; }
  .bub { max-width: 80%; padding: 9px 13px; border-radius: 16px; font-size: 14.5px; line-height: 1.45; }
  .bub.in { background: var(--bg); border: 1px solid var(--line); justify-self: start; border-top-right-radius: 6px; }
  .bub.out { background: var(--accent); color: var(--accent-ink); justify-self: end; border-top-left-radius: 6px; font-weight: 500; }
  .bub[lang="de"] { direction: ltr; text-align: left; }

  /* Deutsch mock */
  .notif { display: flex; gap: 12px; background: rgba(242,246,252,.08); border: 1px solid rgba(255,255,255,.08); border-radius: 20px; padding: 12px 14px; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
  .notif .app { width: 40px; height: 40px; border-radius: 11px; background: var(--bg); display: grid; place-items: center; flex: none; }
  .notif .app .logo { font-size: 15px; }
  .notif .top { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
  .notif .de { direction: ltr; text-align: left; font-weight: 700; font-size: 17px; margin-top: 2px; }
  .notif .ar { color: #c3cfe0; font-size: 14.5px; }
  .words { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; direction: ltr; }
  .word { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px; display: grid; justify-items: center; }
  .word b { font-size: 15px; }
  .word span { font-size: 12.5px; color: var(--accent); direction: rtl; }

  /* Masarak mock */
  
  
  
  
  .opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .opt { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 11px 12px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
  .opt::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); flex: none; }
  .opt.on { border-color: var(--accent); }
  .opt.on::before { border-color: var(--accent); background: radial-gradient(circle, var(--accent) 45%, transparent 50%); }
  .result { margin-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: rgba(74,168,255,.12); border: 1px solid rgba(74,168,255,.35); border-radius: 14px; padding: 10px 12px; font-size: 14px; }
  .result b { color: var(--accent); }

  /* About the owner */
  .owner { padding-block: 72px 0; text-align: center; }
  .owner-card { margin: 26px auto 0; max-width: 440px; background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); border-radius: 28px; padding: 28px 20px 22px; }
  .owner .avatar { width: 92px; height: 92px; border-radius: 50%; margin: 0 auto; display: grid; place-items: center;
                   background: radial-gradient(circle at 30% 25%, #1b2c48, #070c16); border: 3px solid var(--bg); box-shadow: 0 0 0 2px var(--accent), 0 12px 40px rgba(74,168,255,.35); }
  .owner .avatar .logo { font-size: 30px; }
  .owner h3 { margin-top: 14px; font-size: 22px; font-weight: 700; direction: ltr; }
  .owner .role { color: var(--accent); font-weight: 600; font-size: 14px; margin-top: 2px; }
  .owner p { color: #c3cfe0; font-size: 15.5px; line-height: 1.75; margin: 14px 0 0; }
  .owner .stat { display: inline-flex; align-items: baseline; gap: 6px; margin-top: 16px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 6px 16px; }
  .owner .stat b { font-size: 18px; color: #fff; direction: ltr; }
  .owner .stat span { color: var(--muted); font-size: 13px; }
  .socials { margin-top: 18px; display: flex; justify-content: center; gap: 10px; direction: ltr; flex-wrap: wrap; }
  .socials a { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--bg); border: 1px solid var(--line); }
  .socials a:hover { border-color: var(--accent); color: var(--accent); }
  .socials svg { width: 22px; height: 22px; }
  .foot { margin-top: 36px; display: flex; justify-content: center; gap: 18px; color: #5e6e88; font-size: 13px; direction: ltr; flex-wrap: wrap; }

  /* ---------- هدرة Deutsch hub ---------- */
  
  
   
  
  .seg { position: sticky; top: calc(var(--top-h) + env(safe-area-inset-top, 0px)); z-index: 20; margin: 18px 0 20px; padding-block: 8px; background: var(--bg); }
  html.is-app .seg { top: env(safe-area-inset-top, 0px); }
  
  .seg button { display: grid; justify-items: center; gap: 2px; padding: 9px 4px; border: 0; border-radius: 12px; background: none; color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer; }
  .seg button svg { width: 20px; height: 20px; }
  .seg button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
  .seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  
  .box { background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); border-radius: 22px; padding: 18px; }
  .box h3 { font-size: 17px; font-weight: 700; }
  .box .muted { color: var(--muted); font-size: 14px; margin: 4px 0 0; }
  .today .label { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 13px; }
  .today .de { direction: ltr; text-align: left; font-size: 26px; font-weight: 700; margin-top: 10px; }
  .today .ar { font-size: 18px; color: #c3cfe0; margin-top: 4px; }
  .listen { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 12px; padding: 10px 16px; font-weight: 700; cursor: pointer; }
  .listen svg { width: 18px; height: 18px; }
  
  
  
  .archive { display: grid; gap: 8px; margin-top: 12px; }
  .arc { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 11px 14px; }
  .arc .de { direction: ltr; font-weight: 600; }
  .arc .ar { color: var(--muted); font-size: 14px; text-align: end; }
  
  .game { position: relative; display: grid; gap: 8px; align-content: start; text-align: start; background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); border-radius: 20px; padding: 16px 14px; cursor: pointer; min-height: 132px; }
  .game:hover { border-color: var(--accent); }
  .game .gi { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--bg); color: var(--accent); }
  .game .gi svg { width: 22px; height: 22px; }
  .game b { font-size: 15px; }
  .game small { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
  .game .soon { position: absolute; top: 12px; left: 12px; font-size: 11px; font-weight: 700; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
  .game.wide { grid-column: 1 / -1; min-height: 0; }
  .quiz .q { direction: ltr; text-align: center; font-size: 22px; font-weight: 700; margin: 14px 0 16px; }
  
  
  
  
  
  .quiz .next { margin-top: 14px; }
  
  
  
  
  

  /* ---------- Footer under every page ---------- */
  .site-foot { margin-top: 48px; padding-block: 16px; border-top: 1px solid var(--line); display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; color: #5e6e88; font-size: 12px; direction: ltr; }
  .site-foot a { color: var(--muted); }
  .site-foot a:hover { color: var(--fg); text-decoration: underline; }

  /* ---------- هدرة Deutsch frame ---------- */
  #hd-frame { position: fixed; left: 0; right: 0; z-index: 25; width: 100%; border: 0; background: var(--bg); display: block;
              top: calc(var(--top-h) + env(safe-area-inset-top, 0px));
              height: calc(100vh - var(--top-h) - env(safe-area-inset-top, 0px) - var(--nav-h) - env(safe-area-inset-bottom, 0px));
              height: calc(100dvh - var(--top-h) - env(safe-area-inset-top, 0px) - var(--nav-h) - env(safe-area-inset-bottom, 0px)); }
  /* Installed app: هدرة Deutsch starts under the language button and the bell, like the other pages */
  html.is-app #hd-frame { top: calc(env(safe-area-inset-top, 0px) + 66px); height: calc(100vh - 66px - env(safe-area-inset-top, 0px) - var(--nav-h) - env(safe-area-inset-bottom, 0px)); height: calc(100dvh - 66px - env(safe-area-inset-top, 0px) - var(--nav-h) - env(safe-area-inset-bottom, 0px)); }

  /* ---------- Pages ---------- */
  main { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); }
  .view { animation: fade .3s ease; }
  @keyframes fade { from { opacity: 0; } to { opacity: 1; } }
  .page { padding-top: calc(var(--top-h) + env(safe-area-inset-top, 0px) + 8px); }
  /* Every page fills the screen above the bottom nav, so the footer only shows after scrolling */
  .page { min-height: calc(100dvh - var(--nav-h) - env(safe-area-inset-bottom, 0px)); }
  .page[data-view="p-masarak"] { display: flex; flex-direction: column; }
  #mg-root { flex: 1; display: flex; flex-direction: column; }
  /* Footer shows on the masarak intro only, not once the questions start */
  main:has(.page[data-view="p-masarak"]:not([hidden]) .mg-page) .site-foot { display: none; }
  html.is-app .page { padding-top: calc(env(safe-area-inset-top, 0px) + 20px); }
  
  
  
  .open-link { display: inline-block; margin-top: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; font-weight: 600; }

  /* ---------- Login ---------- */
  .login-wrap {
    position: fixed; inset: 0; z-index: 70;
    display: grid; place-items: center;
    padding: max(16px, env(safe-area-inset-top, 0px)) var(--gutter-r) max(16px, env(safe-area-inset-bottom, 0px)) var(--gutter-l);
    background:
      radial-gradient(60% 40% at 15% 10%, rgba(74,168,255,.22), transparent 70%),
      rgba(4,7,13,.82);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    animation: fade .2s ease; overflow-y: auto;
  }
  .login-card {
    position: relative; width: 100%; max-width: 420px;
    background: rgba(14,22,36,.92); border: 1px solid var(--line);
    border-radius: 26px; padding: 56px 22px 22px;
    box-shadow: 0 30px 80px rgba(0,0,0,.5);
    animation: rise .28s cubic-bezier(.2,.8,.2,1);
  }
  @keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
  .login-close { position: absolute; top: 16px; left: 16px; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); cursor: pointer; }
  .login-close svg { width: 16px; height: 16px; }
  .login-card h2 { text-align: center; font-size: 22px; font-weight: 700; }
  .login-card h2 .logo { font-size: 1em; vertical-align: middle; }
  .login-card .sub { text-align: center; color: var(--muted); margin: 6px 0 22px; font-size: 14px; }
  .auth { display: grid; gap: 10px; }
  .auth button {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    width: 100%; height: 54px; border-radius: 16px;
    background: var(--surface-2); border: 1px solid transparent;
    font-size: 16px; font-weight: 600; cursor: pointer;
    transition: border-color .2s ease, background .2s ease;
  }
  .auth button:hover { border-color: var(--line); background: #182641; }
  .auth button svg { width: 22px; height: 22px; flex: none; }
  .auth .passkey { color: var(--muted); font-weight: 500; }
  .or { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 13px; margin: 16px 0; }
  .or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
  .auth .email { background: #fff; color: #060a12; }
  .auth .email:hover { background: #e9eef6; }
  .consent { display: flex; align-items: center; gap: 10px; margin-top: 16px; color: var(--muted); font-size: 14px; cursor: pointer; }
  .consent input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; margin: 0; }
  .legal { text-align: center; color: #5e6e88; font-size: 12px; margin-top: 22px; line-height: 1.7; }
  .legal a { text-decoration: underline; }
  .toast {
    position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 90px); z-index: 90;
    transform: translateX(-50%);
    background: #fff; color: #060a12; font-weight: 600; font-size: 14px;
    padding: 10px 16px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.4);
    animation: rise .2s ease; white-space: nowrap;
  }

  /* ---------- Install sheet ---------- */
  .sheet-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(2,5,10,.6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: fade .2s ease; }
  .sheet {
    position: fixed; inset-inline: 0; bottom: 0; z-index: 91; margin-inline: auto; max-width: 520px;
    background: var(--surface); border: 1px solid var(--line); border-bottom: 0;
    border-radius: 26px 26px 0 0; padding: 12px 22px calc(24px + env(safe-area-inset-bottom, 0px));
    animation: up .28s cubic-bezier(.2,.8,.2,1);
  }
  @keyframes up { from { transform: translateY(100%); } to { transform: none; } }
  .sheet .grab { width: 44px; height: 5px; border-radius: 5px; background: var(--line); margin: 0 auto 16px; }
  .sheet h3 { font-weight: 700; font-size: 21px; text-align: center; }
  .sheet .sub { color: var(--muted); text-align: center; margin: 6px 0 18px; font-size: 14px; }
  .steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
  .steps li { display: flex; align-items: center; gap: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; }
  .steps .num { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 13px; }
  .steps .ic { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--bg); color: var(--accent); }
  .steps .ic svg { width: 22px; height: 22px; }
  .steps span.t { font-size: 15px; line-height: 1.45; }
  .sheet .close { margin-top: 18px; width: 100%; background: var(--fg); color: var(--bg); border: 0; border-radius: 14px; padding: 13px; font-weight: 700; cursor: pointer; }

  /* ---------- Bottom nav ---------- */
  nav.tabs {
    direction: ltr; position: fixed; bottom: 0; inset-inline: 0; z-index: 30;
    display: grid; grid-template-columns: repeat(5, 1fr);
    height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px);
    background: rgba(6,10,18,.9); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
    /* Keep the bar on its own layer so Safari's collapsing bottom bar can't leave it floating above the edge */
    transform: translateZ(0); -webkit-transform: translateZ(0); will-change: transform; bottom: 0;
  }
  nav.tabs button { font-size: 11px; color: var(--muted); background: none; border: 0; cursor: pointer; display: grid; place-items: center; align-content: center; gap: 4px; padding: 6px 2px; min-width: 0; }
  nav.tabs svg { width: 24px; height: 24px; display: block; }
  nav.tabs span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  nav.tabs button[aria-current="page"] { color: var(--accent); font-weight: 600; }
  nav.tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; }
  /* Curved bump in the bar's top edge above the active tab; slides to the new tab (covers the border line under it) */
  nav.tabs .tab-bump { position: absolute; top: -14px; left: 0; width: 150px; height: 15px; pointer-events: none; opacity: 0; }
  nav.tabs .tab-bump.ready { transition: transform .5s cubic-bezier(.16,1,.3,1), opacity .25s ease; }
  nav.tabs .tab-bump .f { fill: var(--bg); }
  nav.tabs .tab-bump .s { fill: none; stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
  @media (prefers-reduced-motion: reduce) { nav.tabs .tab-bump.ready { transition: none; } }

  /* ---------- Installed app: no top bar, no install button ---------- */
  html.is-app .topbar, html.is-app #install-cta, html.is-app #install-sub { display: none !important; }
  html:not(.is-app) .app-lang { display: none; }

  @media (prefers-reduced-motion: reduce) {
    .hero-bg::before, .hero-bg::after { animation: none; }
    #splash .hm-ink { animation: none !important; stroke-dashoffset: 0; }
    #splash .hm-plane { animation: none !important; offset-distance: 100%; }
    #splash .hm-plane svg { animation: none !important; transform: none; }
    .card img { transition: none; }
  }

  /* ---------- Legal pages (Impressum / Datenschutz) inside the app ---------- */
  .page.legal { padding-bottom: 40px; color: var(--fg); line-height: 1.8; }
  .legal h1 { font-size: 24px; font-weight: 700; margin: 8px 0 18px; }
  .legal h2 { font-size: 16px; font-weight: 700; margin: 22px 0 6px; }
  .legal p { color: var(--muted); font-size: 14.5px; margin: 0 0 8px; }
  .legal a { color: #4aa8ff; }
  .legal-back { display: inline-block; margin-bottom: 12px; color: #4aa8ff; text-decoration: none; font-weight: 700; }

  /* iPhone web app (iOS 26): the page area is short by the status-bar height, which leaves a gap under the bottom menu.
     Making the page at least that much taller puts the menu back on the real bottom edge. */
  html.is-app { min-height: calc(100% + env(safe-area-inset-top, 0px)); }
  /* Sign-in screen: logo inside the title, everything centred on the page */
  .ac-hero h1 { display: inline-flex; align-items: baseline; gap: 0; }
  .ac-hero h1 .logo { margin-inline-start: -8px; }
  .ac-hero h1 .logo { font-size: 1.75em; display: inline-block; line-height: 0; position: relative; top: 8.5px; }
  .ac-hero h1 .logo .mark { vertical-align: baseline; }
  .page[data-view="account"]:has(#ac-form) { display: flex; flex-direction: column; justify-content: center; }
  /* No zoom: no double-tap zoom, and text fields at 16px so the iPhone never zooms in when typing */
  html { touch-action: manipulation; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  input, select, textarea { font-size: 16px !important; }
