@charset "UTF-8";
/* ============================================================
   HELALIA LANGUAGE SCHOOL — mobile design system
   navy #112c5a · navy-soft #1a3d7a · gold #eed484
   coral #f1595d · cream #f9f1e2 · sky #eef6fa
   Pure CSS. No framework. RTL is a real layout (logical props).
   ============================================================ */

@layer reset, tokens, base, shell, chrome, components, utils;

/* ---------------------------------------------------------- reset */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; padding: 0; }
  html { -webkit-text-size-adjust: 100%; }
  body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
  img, svg, video { display: block; max-width: 100%; }
  button, input, textarea, select { font: inherit; color: inherit; }
  a { color: inherit; text-decoration: none; }
  ul, ol { list-style: none; }
  :focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
}

/* --------------------------------------------------------- tokens */
@layer tokens {
  :root {
    /* brand — locked hex */
    --navy: #112c5a;
    --navy-soft: #1a3d7a;
    --gold: #eed484;
    --coral: #f1595d;
    --cream: #f9f1e2;
    --sky: #eef6fa;
    --white: #ffffff;

    /* OKLCH companions of the brand hex (perceptual mixing base) */
    --navy-ok: oklch(30.5% 0.093 265);
    --navy-soft-ok: oklch(38% 0.107 265);
    --gold-ok: oklch(88% 0.083 88);
    --coral-ok: oklch(65.6% 0.181 24);
    --cream-ok: oklch(95.8% 0.021 85);
    --sky-ok: oklch(96.8% 0.011 230);

    /* derived tints (perceptual, via oklab) */
    --navy-96: color-mix(in oklab, var(--navy) 4%, white);
    --navy-88: color-mix(in oklab, var(--navy) 12%, white);
    --navy-70: color-mix(in oklab, var(--navy) 30%, white);
    --navy-deep: color-mix(in oklab, var(--navy) 88%, black);
    --gold-soft: color-mix(in oklab, var(--gold) 40%, white);
    --gold-deep: color-mix(in oklab, var(--gold) 72%, #6b4b00);
    --coral-soft: color-mix(in oklab, var(--coral) 18%, white);
    --green: #2e7d5a;
    --green-soft: color-mix(in oklab, #2e7d5a 16%, white);

    /* text */
    --ink: #16233a;
    --ink-2: #4a5a72;
    --ink-3: #8695a9;
    --on-navy: #ffffff;
    --on-navy-2: color-mix(in oklab, var(--gold) 55%, #ffffff);

    /* type — fluid, container-relative */
    --font-en: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
    --font-ar: "Cairo", "Segoe UI", Tahoma, system-ui, sans-serif;
    --font: var(--font-en);
    --fs-xs: clamp(0.68rem, 0.62rem + 0.25cqi, 0.76rem);
    --fs-sm: clamp(0.78rem, 0.72rem + 0.28cqi, 0.86rem);
    --fs-md: clamp(0.9rem, 0.84rem + 0.3cqi, 0.98rem);
    --fs-lg: clamp(1.05rem, 0.96rem + 0.45cqi, 1.18rem);
    --fs-xl: clamp(1.3rem, 1.1rem + 0.9cqi, 1.55rem);
    --fs-2xl: clamp(1.6rem, 1.3rem + 1.4cqi, 2rem);

    /* shape */
    --r-sm: 12px;
    --r-md: 20px;
    --r-lg: 26px;
    --r-xl: 32px;
    --r-pill: 999px;

    /* elevation — navy-tinted */
    --sh-1: 0 2px 8px -2px rgb(17 44 90 / .10), 0 6px 18px -8px rgb(17 44 90 / .12);
    --sh-2: 0 6px 20px -6px rgb(17 44 90 / .16), 0 16px 40px -20px rgb(17 44 90 / .22);
    --sh-3: 0 12px 34px -10px rgb(17 44 90 / .28), 0 30px 60px -30px rgb(17 44 90 / .34);
    --sh-nav: 0 -6px 26px -10px rgb(17 44 90 / .20);

    /* metrics */
    --gutter: 18px;
    --nav-h: 74px;
    --tap: 46px;

    /* per-tone accent, set by .t-* */
    --accent: var(--navy);
    --accent-soft: var(--navy-88);
  }

  [dir="rtl"] { --font: var(--font-ar); }
  [dir="ltr"] { --font: var(--font-en); }

  .t-navy  { --accent: var(--navy);  --accent-soft: var(--navy-88); }
  .t-gold  { --accent: var(--gold-deep); --accent-soft: var(--gold-soft); }
  .t-coral { --accent: var(--coral); --accent-soft: var(--coral-soft); }
  .t-green { --accent: var(--green); --accent-soft: var(--green-soft); }
  .t-blue  { --accent: var(--navy-soft); --accent-soft: var(--navy-88); }
}

/* ----------------------------------------------------------- base */
@layer base {
  html, body { height: 100%; }
  body {
    font-family: var(--font);
    color: var(--ink);
    background:
      radial-gradient(1200px 700px at 50% -280px, color-mix(in oklab, var(--navy) 22%, transparent), transparent 70%),
      var(--sky);
    display: grid;
    place-items: center;
    min-height: 100dvh;
  }
  @media (max-width: 460px) { body { background: var(--cream); display: block; } }
}

/* ------------------------------------------- shell (device frame) */
@layer shell {
  /* 390x844 phone. On a desktop it renders as a framed device;
     on a real phone it fills the viewport edge-to-edge. */
  .app {
    container-type: inline-size;
    container-name: app;
    position: relative;
    inline-size: 390px;
    block-size: 844px;
    max-block-size: 100dvh;
    background: var(--cream);
    border-radius: 44px;
    box-shadow: var(--sh-3), 0 0 0 11px #0d1526, 0 0 0 13px #26324a;
    overflow: hidden;
    /* flex, not grid: a screen may have no header at all, and a fixed
       3-row grid would let the nav stretch into the empty row. */
    display: flex;
    flex-direction: column;
    isolation: isolate;
  }
  @media (max-width: 460px) {
    .app {
      inline-size: 100%;
      block-size: 100dvh;
      border-radius: 0;
      box-shadow: none;
    }
  }

  /* scrolling page body */
  .page {
    flex: 1 1 auto;
    min-block-size: 0;          /* lets the flex child actually scroll */
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    padding-inline: var(--gutter);
    padding-block-start: 16px;
    padding-block-end: calc(20px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: helalia-page-in 180ms ease-out both;
  }
  @keyframes helalia-page-in {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  .page::-webkit-scrollbar { width: 0; }
  /* clear the floating FAB so the last card is never covered */
  .page--fab { padding-block-end: calc(82px + env(safe-area-inset-bottom)); }
  .page--flush { padding-inline: 0; }
  .page--flush > * { margin-inline: var(--gutter); }
  .page--flush > .bleed { margin-inline: 0; }

  /* auth: school photo is the page, navy colour layer over it */
  .app--auth {
    grid-template-rows: 1fr;
    position: relative;
    isolation: isolate;
    background: var(--navy);
    overflow: hidden;
  }
  .app--auth::before { display: none; }
}

/* ------------------------------------- chrome (header / nav / fab) */
@layer chrome {
  /* ---- navy header, sticky, rounded underside ---- */
  .hero {
    position: relative;
    z-index: 3;
    padding-inline: var(--gutter);
    padding-block: calc(12px + env(safe-area-inset-top)) 20px;
    color: var(--on-navy);
    background:
      radial-gradient(120% 140% at 88% -30%, color-mix(in oklab, var(--gold) 26%, transparent), transparent 58%),
      linear-gradient(168deg, var(--navy-soft), var(--navy) 62%, var(--navy-deep));
    border-end-start-radius: var(--r-xl);
    border-end-end-radius: var(--r-xl);
    box-shadow: var(--sh-2);

    overflow: hidden;

    /* gold hairline along the bottom edge */
    &::after {
      content: "";
      position: absolute;
      inset-inline: 22px;
      inset-block-end: 0;
      z-index: 2;
      block-size: 1px;
      background: linear-gradient(90deg, transparent, color-mix(in oklab, var(--gold) 70%, transparent), transparent);
    }
  }
  .hero { flex: none; min-block-size: 0; }
  .hero > * { position: relative; z-index: 1; }
  .hero--tall { padding-block-end: 26px; }
  .hero--tall:has(.featured) {
    overflow: visible;
    padding-block-end: 0;
  }
  .hero--tall:has(.featured)::after { display: none; }
  .app:has(> .hero--tall .featured) > .page {
    padding-block-start: 40px;
  }

  /* 1024px Helalia seal — clipped to the navy header so it cannot cover the page */
  .hero--tall::before {
    content: "";
    position: absolute;
    z-index: 0;
    pointer-events: none;
    inset: 0;
    background: url("../img/logo-icon.png") 108% 18% / min(62%, 220px) no-repeat;
    opacity: 0.2;
    -webkit-mask-image: radial-gradient(circle at 78% 28%, #000 36%, transparent 72%);
            mask-image: radial-gradient(circle at 78% 28%, #000 36%, transparent 72%);
  }
  [dir="rtl"] .hero--tall::before {
    background-position: -8% 18%;
    -webkit-mask-image: radial-gradient(circle at 22% 28%, #000 36%, transparent 72%);
            mask-image: radial-gradient(circle at 22% 28%, #000 36%, transparent 72%);
  }

  .hero__row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-block-size: var(--tap);
  }
  .hero__title {
    flex: 1;
    font-size: var(--fs-lg);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.2;
  }
  .hero__eyebrow {
    font-size: var(--fs-xs);
    color: var(--on-navy-2);
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
  }
  .hero__lede { font-size: var(--fs-sm); color: color-mix(in oklab, white 76%, transparent); margin-block-start: 4px; }

  /* back chevron — flips with direction */
  .back {
    inline-size: 38px; block-size: 38px;
    display: grid; place-items: center;
    border-radius: var(--r-pill);
    background: rgb(255 255 255 / .12);
    border: 1px solid rgb(255 255 255 / .16);
    font-size: 1.3rem; line-height: 1;
    flex: none;
    & svg { inline-size: 18px; block-size: 18px; }
  }
  [dir="rtl"] .back svg { transform: scaleX(-1); }

  /* ---- dual notification bells with badges ---- */
  .bells { display: flex; gap: 8px; flex: none; }
  .bell {
    position: relative;
    inline-size: 38px; block-size: 38px;
    display: grid; place-items: center;
    border-radius: var(--r-pill);
    background: rgb(255 255 255 / .12);
    border: 1px solid rgb(255 255 255 / .16);
    & svg { inline-size: 19px; block-size: 19px; }
  }
  .bell__badge {
    position: absolute;
    inset-block-start: -3px;
    inset-inline-end: -3px;
    min-inline-size: 18px;
    block-size: 18px;
    padding-inline: 4px;
    border-radius: var(--r-pill);
    display: grid; place-items: center;
    font-size: .66rem; font-weight: 800;
    color: var(--navy);
    background: var(--gold);
    border: 2px solid var(--navy);
  }
  .bell--alert .bell__badge { background: var(--coral); color: #fff; }

  /* ---- featured child card, sits on the navy ---- */
  .featured {
    margin-block-start: 16px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    column-gap: 13px;
    align-items: start;
    padding: 13px;
    border-radius: var(--r-lg);
    background: rgb(255 255 255 / .14);
    border: 1px solid rgb(255 255 255 / .22);
    backdrop-filter: blur(14px) saturate(1.2);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
  }
  .hero--tall .featured {
    margin-block-end: -24px;
    box-shadow:
      0 16px 34px -12px rgb(17 44 90 / .50),
      0 4px 12px -4px rgb(17 44 90 / .28),
      inset 0 1px 0 rgb(255 255 255 / .24);
  }
  .featured > .av {
    grid-column: 1;
    grid-row: 1 / 3;
  }
  .featured__body { display: contents; }
  .featured__name { grid-column: 2; grid-row: 1; font-size: var(--fs-lg); font-weight: 700; line-height: 1.2; min-inline-size: 0; }
  .featured__meta { grid-column: 2; grid-row: 2; font-size: var(--fs-sm); color: var(--on-navy-2); margin-block-start: 2px; min-inline-size: 0; }
  .featured__tags {
    grid-column: 1 / -1;
    grid-row: 3;
    display: flex;
    gap: 6px;
    margin-block-start: 10px;
    flex-wrap: wrap;
  }
  .featured__go { grid-column: 3; grid-row: 1 / 3; align-self: center; font-size: 1.4rem; opacity: .7; }
  [dir="rtl"] .featured__go { transform: scaleX(-1); }

  .tag {
    font-size: var(--fs-xs); font-weight: 700;
    padding: 3px 10px; border-radius: var(--r-pill);
    background: var(--gold); color: var(--navy);
  }
  .tag--soft { background: rgb(255 255 255 / .18); color: #fff; }

  /* ---- bottom nav: 5 tabs + raised navy FAB ---- */
  .nav {
    position: relative;
    z-index: 4;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: end;
    padding-block: 8px calc(8px + env(safe-area-inset-bottom));
    padding-inline: 6px;
    background: color-mix(in oklab, var(--white) 92%, var(--cream));
    border-block-start: 1px solid color-mix(in oklab, var(--navy) 8%, transparent);
    box-shadow: var(--sh-nav);
    min-block-size: var(--nav-h);
    flex: none;
  }
  .nav__item {
    display: grid;
    justify-items: center;
    gap: 3px;
    padding-block: 6px;
    font-size: .64rem;
    font-weight: 600;
    color: var(--ink-3);
    border-radius: var(--r-sm);
    & svg { inline-size: 22px; block-size: 22px; }
    &.is-active { color: var(--navy); }
    &.is-active .nav__dot { opacity: 1; }
  }
  .nav__dot {
    inline-size: 5px; block-size: 5px; border-radius: 50%;
    background: var(--gold); opacity: 0;
  }
  .nav__fab {
    justify-self: center;
    inline-size: 56px; block-size: 56px;
    margin-block-end: 8px;
    display: grid; place-items: center;
    border-radius: var(--r-pill);
    color: var(--gold);
    background: linear-gradient(160deg, var(--navy-soft), var(--navy));
    box-shadow: 0 10px 22px -6px rgb(17 44 90 / .55), 0 0 0 5px color-mix(in oklab, var(--cream) 92%, white);
    & svg { inline-size: 26px; block-size: 26px; }
    transition: transform 160ms ease, box-shadow 160ms ease;
  }
  .nav__fab:hover { transform: translateY(-3px); }
  .nav__fab:active { transform: translateY(-1px) scale(0.96); }

  /* floating round FAB (video: bottom-end above nav) */
  .fab {
    position: absolute;
    inset-block-end: calc(var(--nav-h) + 14px);
    inset-inline-end: var(--gutter);
    z-index: 5;
    inline-size: 50px; block-size: 50px;
    display: grid; place-items: center;
    border-radius: var(--r-pill);
    color: var(--gold);
    background: linear-gradient(160deg, var(--navy-soft), var(--navy));
    box-shadow: var(--sh-2);
    transition: transform 160ms ease, box-shadow 160ms ease;
    & svg { inline-size: 23px; block-size: 23px; }
  }
  .fab:hover { transform: translateY(-3px); }
  .fab:active { transform: translateY(-1px) scale(0.96); }
}

/* ----------------------------------------------------- components */
@layer components {
  /* ---- light header (video: "Subjects" / "Alerts" screens) ---- */
  .topline {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
  }
  .bells--light .bell {
    color: var(--navy);
    background: color-mix(in oklab, var(--navy) 6%, var(--white));
    border-color: color-mix(in oklab, var(--navy) 10%, transparent);
  }
  .bells--light .bell__badge { border-color: var(--cream); }
  .page--top { padding-block-start: calc(14px + env(safe-area-inset-top)); }

  /* ---- section heading ---- */
  .sec {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 12px; margin-block-start: 2px;
  }
  .sec__title { font-size: var(--fs-md); font-weight: 800; letter-spacing: -0.01em; }
  .sec__link { font-size: var(--fs-sm); font-weight: 700; color: var(--navy-soft); }
  .lede { font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.55; }

  /* ---- page title block (light screens) ---- */
  .title { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }

  /* ---- avatar monogram ---- */
  .av {
    inline-size: 46px; block-size: 46px; flex: none;
    border-radius: 15px;
    display: grid; place-items: center;
    font-weight: 800; font-size: var(--fs-md);
    color: var(--navy);
    background: linear-gradient(155deg, var(--gold), color-mix(in oklab, var(--gold) 55%, white));
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / .5);
  }
  .av--lg { inline-size: 62px; block-size: 62px; border-radius: 20px; font-size: var(--fs-lg); }
  .av--sm { inline-size: 38px; block-size: 38px; border-radius: 12px; font-size: var(--fs-sm); }
  .av.t-coral { background: linear-gradient(155deg, var(--coral), color-mix(in oklab, var(--coral) 50%, white)); color: #fff; }
  .av.t-green { background: linear-gradient(155deg, var(--green), color-mix(in oklab, var(--green) 50%, white)); color: #fff; }
  .av.t-blue,
  .av.t-navy  { background: linear-gradient(155deg, var(--navy-soft), var(--navy)); color: var(--gold); }

  /* ---- quick row: 4 icon shortcuts ---- */
  .quickrow {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }
  .quick {
    position: relative;
    display: grid; justify-items: center; gap: 6px;
    padding: 12px 4px;
    border-radius: var(--r-md);
    background: var(--white);
    box-shadow: var(--sh-1);
    font-size: .66rem; font-weight: 700; color: var(--ink-2);
    text-align: center;
  }
  .quick__ico {
    inline-size: 38px; block-size: 38px;
    display: grid; place-items: center;
    border-radius: 13px;
    color: var(--accent);
    background: var(--accent-soft);
    & svg { inline-size: 20px; block-size: 20px; }
  }
  .quick__badge {
    position: absolute; inset-block-start: 8px; inset-inline-end: 8px;
    min-inline-size: 17px; block-size: 17px; padding-inline: 4px;
    border-radius: var(--r-pill);
    display: grid; place-items: center;
    font-size: .62rem; font-weight: 800;
    background: var(--coral); color: #fff;
  }

  /* ---- feature tiles (2-col) ---- */
  .tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
  @container app (min-width: 380px) { .tiles { gap: 13px; } }
  .tile {
    position: relative;
    display: grid; gap: 10px;
    padding: 16px;
    border-radius: var(--r-md);
    background: var(--white);
    box-shadow: var(--sh-1);
    overflow: hidden;
    &::after {
      content: "";
      position: absolute;
      inset-block-start: 0; inset-inline-end: 0;
      inline-size: 74px; block-size: 74px;
      background: radial-gradient(circle at 100% 0, var(--accent-soft), transparent 68%);
      opacity: .85;
      pointer-events: none;
    }
  }
  .tile__ico {
    inline-size: 42px; block-size: 42px;
    display: grid; place-items: center;
    border-radius: 14px;
    color: var(--accent);
    background: var(--accent-soft);
    position: relative; z-index: 1;
    & svg { inline-size: 22px; block-size: 22px; }
  }
  .tile__label { font-size: var(--fs-md); font-weight: 700; line-height: 1.25; position: relative; z-index: 1; }
  .tile__meta { font-size: var(--fs-xs); color: var(--ink-3); position: relative; z-index: 1; }

  /* ---- list rows: left colour bar + round count ---- */
  .rows { display: grid; gap: 9px; }
  .row {
    position: relative;
    display: flex; align-items: center; gap: 12px;
    padding: 13px 14px;
    padding-inline-start: 20px;
    border-radius: var(--r-md);
    background: var(--white);
    box-shadow: var(--sh-1);
    overflow: hidden;

    /* the colour bar — inline-start, so it flips in RTL */
    &::before {
      content: "";
      position: absolute;
      inset-inline-start: 0;
      inset-block: 10px;
      inline-size: 5px;
      border-start-end-radius: 4px;
      border-end-end-radius: 4px;
      background: var(--accent);
    }
  }
  .row--plain { padding-inline-start: 14px; &::before { display: none; } }
  .row__ico {
    inline-size: 38px; block-size: 38px; flex: none;
    display: grid; place-items: center;
    border-radius: 12px;
    color: var(--accent);
    background: var(--accent-soft);
    & svg { inline-size: 20px; block-size: 20px; }
  }
  .row__body { flex: 1; min-inline-size: 0; }
  .row__title { font-size: var(--fs-md); font-weight: 700; line-height: 1.3; }
  .row__meta {
    font-size: var(--fs-sm); color: var(--ink-2); margin-block-start: 2px;
    line-height: 1.45;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .row__time { font-size: var(--fs-xs); color: var(--ink-3); margin-block-start: 4px; }
  /* round count badge */
  .row__count {
    flex: none;
    min-inline-size: 28px; block-size: 28px; padding-inline: 8px;
    border-radius: var(--r-pill);
    display: grid; place-items: center;
    font-size: var(--fs-sm); font-weight: 800;
    color: var(--white);
    background: var(--accent);
  }
  .row__count--gold { background: var(--gold); color: var(--navy); }
  .row__go { flex: none; font-size: 1.25rem; color: var(--ink-3); line-height: 1; }
  [dir="rtl"] .row__go { transform: scaleX(-1); }
  .row.is-unread .row__title::after {
    content: ""; display: inline-block;
    inline-size: 7px; block-size: 7px; border-radius: 50%;
    background: var(--coral); margin-inline-start: 7px; vertical-align: middle;
  }

  /* ---- segmented tabs ---- */
  .tabs {
    display: flex; gap: 4px; padding: 4px;
    border-radius: var(--r-pill);
    background: color-mix(in oklab, var(--navy) 7%, var(--white));
  }
  .tab {
    flex: 1; text-align: center;
    padding-block: 8px;
    border-radius: var(--r-pill);
    font-size: var(--fs-sm); font-weight: 700; color: var(--ink-2);
    &.is-active { background: var(--white); color: var(--navy); box-shadow: var(--sh-1); }
  }

  /* ---- generic card ---- */
  .card {
    padding: 16px;
    border-radius: var(--r-md);
    background: var(--white);
    box-shadow: var(--sh-1);
  }
  .card--navy {
    color: var(--on-navy);
    background: linear-gradient(160deg, var(--navy-soft), var(--navy));
    box-shadow: var(--sh-2);
  }
  .card--outline { background: transparent; box-shadow: none; border: 1px dashed color-mix(in oklab, var(--navy) 22%, transparent); }

  /* ---- stat tiles ---- */
  .stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .stat {
    padding: 14px;
    border-radius: var(--r-md);
    background: var(--white);
    box-shadow: var(--sh-1);
  }
  .stat__label { font-size: var(--fs-xs); color: var(--ink-3); font-weight: 600; line-height: 1.35; }
  .stat__value { font-size: var(--fs-xl); font-weight: 800; color: var(--accent); margin-block-start: 6px; letter-spacing: -0.02em; }
  .meter {
    block-size: 6px; border-radius: var(--r-pill);
    background: color-mix(in oklab, var(--navy) 9%, white);
    margin-block-start: 10px; overflow: hidden;
  }
  .meter__fill { block-size: 100%; border-radius: var(--r-pill); background: var(--accent); }

  /* ---- calendar rows ---- */
  .cal {
    display: flex; align-items: center; gap: 13px;
    padding: 12px 14px;
    border-radius: var(--r-md);
    background: var(--white);
    box-shadow: var(--sh-1);
  }
  .cal__date {
    inline-size: 50px; flex: none;
    padding-block: 7px;
    border-radius: 14px;
    text-align: center;
    color: var(--accent);
    background: var(--accent-soft);
  }
  .cal__day { display: block; font-size: var(--fs-lg); font-weight: 800; line-height: 1; }
  .cal__mon { display: block; font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-block-start: 3px; }

  /* ---- weekly plan ---- */
  .plan { display: grid; gap: 9px; }
  .plan__row {
    display: grid;
    grid-template-columns: 62px 1fr;
    align-items: center; gap: 12px;
    padding: 13px 14px;
    border-radius: var(--r-md);
    background: var(--white);
    box-shadow: var(--sh-1);
  }
  .plan__day {
    font-size: var(--fs-sm); font-weight: 800; color: var(--accent);
    padding: 6px 4px; border-radius: 10px;
    background: var(--accent-soft); text-align: center;
  }

  /* ---- gallery ---- */
  .photos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .photo {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--r-md);
    overflow: hidden;
    background: var(--navy-88);
    box-shadow: var(--sh-1);
    & img { inline-size: 100%; block-size: 100%; object-fit: cover; }
  }
  .photo__cap {
    position: absolute; inset-inline: 0; inset-block-end: 0;
    padding: 16px 10px 8px;
    font-size: var(--fs-xs); font-weight: 700; color: #fff;
    background: linear-gradient(transparent, rgb(9 18 36 / .78));
  }
  .photo--wide { grid-column: span 2; aspect-ratio: 16 / 9; }

  /* ---- forms ---- */
  .field { display: grid; gap: 6px; }
  .field__label { font-size: var(--fs-sm); font-weight: 700; color: var(--ink-2); }
  .input {
    inline-size: 100%;
    min-block-size: var(--tap);
    padding: 12px 15px;
    border-radius: var(--r-md);
    border: 1px solid color-mix(in oklab, var(--navy) 13%, transparent);
    background: var(--white);
    font-size: var(--fs-md);
    color: var(--ink);
    &::placeholder { color: var(--ink-3); }
    &:focus { border-color: var(--navy-soft); outline: none; box-shadow: 0 0 0 3px color-mix(in oklab, var(--navy) 14%, transparent); }
  }
  textarea.input { min-block-size: 116px; resize: vertical; line-height: 1.55; }

  .btn {
    inline-size: 100%;
    min-block-size: var(--tap);
    display: inline-grid; place-items: center;
    padding: 13px 20px;
    border-radius: var(--r-md);
    border: 0;
    font-size: var(--fs-md); font-weight: 700;
    cursor: pointer;
  }
  .btn--primary {
    color: var(--gold);
    background: linear-gradient(160deg, var(--navy-soft), var(--navy));
    box-shadow: var(--sh-2);
  }
  .btn--gold { color: var(--navy); background: var(--gold); box-shadow: var(--sh-1); }
  .btn--ghost {
    color: var(--white);
    background: rgb(255 255 255 / .12);
    border: 1px solid rgb(255 255 255 / .28);
  }
  .btn--quiet { color: var(--navy); background: var(--white); box-shadow: var(--sh-1); }

  .checkline { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: var(--fs-sm); }
  .checkline__box { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-weight: 600; }
  .checkline input { inline-size: 18px; block-size: 18px; accent-color: var(--navy); }

  /* ---- settings list ---- */
  .settings { border-radius: var(--r-md); background: var(--white); box-shadow: var(--sh-1); overflow: hidden; }
  .settings__item {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px;
    min-block-size: var(--tap);
    font-size: var(--fs-md); font-weight: 600;
    & + .settings__item { border-block-start: 1px solid color-mix(in oklab, var(--navy) 7%, transparent); }
  }
  .settings__item span:first-of-type { flex: 1; }
  .settings__go { color: var(--ink-3); font-size: 1.2rem; line-height: 1; }
  [dir="rtl"] .settings__go { transform: scaleX(-1); }
  .settings__item--danger { color: var(--coral); font-weight: 700; }

  /* ---- chips ---- */
  .chip {
    display: inline-grid; place-items: center;
    padding: 4px 11px;
    border-radius: var(--r-pill);
    font-size: var(--fs-xs); font-weight: 700;
    color: var(--accent);
    background: var(--accent-soft);
  }
  .chip--solid { color: #fff; background: var(--accent); }
  .chip--gold { color: var(--navy); background: var(--gold); }
  .chiprow { display: flex; gap: 6px; flex-wrap: wrap; }

  /* ---- auth screens — full-bleed photo + navy veil + glass form ---- */
  .auth {
    position: relative;
    z-index: 1;
    min-block-size: 100%;
    display: flex;
    flex-direction: column;
    padding: 0;
    color: var(--on-navy);
    background: transparent;
    overflow-y: auto;
    scrollbar-width: none;
  }
  .auth::-webkit-scrollbar { width: 0; }
  .auth__hero,
  .auth__cover {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: block;
    width: 100%;
    max-width: none;
    height: 100%;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    background: var(--navy);
    pointer-events: none;
    isolation: isolate;
  }
  .auth__hero-img,
  img.auth__cover {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center 38%;
    transform: scale(1.08);
    filter: saturate(0.92) contrast(1.05);
  }
  /* navy colour layer — blends into the photo instead of sitting on top as a tab */
  .auth__hero::after,
  .auth__cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: #112c5a;
    mix-blend-mode: multiply;
    opacity: 0.72;
  }
  /* readability + gold brand wash */
  .auth__hero::before,
  .auth__cover::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
      radial-gradient(90% 55% at 50% -8%, rgb(238 212 132 / .26), transparent 58%),
      linear-gradient(180deg, rgb(17 44 90 / .22) 0%, rgb(17 44 90 / .28) 36%, rgb(10 22 48 / .78) 100%);
  }
  .auth .between {
    position: relative;
    z-index: 3;
    padding: calc(14px + env(safe-area-inset-top)) 18px 0;
    width: 100%;
  }
  .auth__err {
    display: none;
    margin: 0;
    padding: 10px 12px;
    border-radius: var(--r-md);
    background: color-mix(in oklab, var(--coral) 22%, white);
    color: #7a1216;
    font-size: var(--fs-sm);
    font-weight: 700;
    text-align: center;
  }
  .auth__err.is-on { display: block; }
  .auth__brand {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 22px 26px 18px;
    margin: 0;
    position: relative;
    z-index: 2;
  }
  .auth__logo {
    inline-size: 92px;
    block-size: 92px;
    border-radius: 28px;
    padding: 10px;
    background: rgb(255 255 255 / .16);
    border: 1px solid rgb(238 212 132 / .55);
    box-shadow: 0 16px 40px -16px rgb(0 0 0 / .45);
    object-fit: contain;
    backdrop-filter: blur(12px);
  }
  .auth__name {
    font-size: var(--fs-lg);
    font-weight: 800;
    text-align: center;
    letter-spacing: -0.02em;
    color: #fff;
  }
  .auth__tag { font-size: var(--fs-sm); color: var(--on-navy-2); text-align: center; }
  .auth__form {
    position: relative;
    z-index: 2;
    display: grid;
    gap: 13px;
    margin-inline: 18px;
    padding: 18px 16px 16px;
    border-radius: 28px;
    background: rgb(255 255 255 / .12);
    border: 1px solid rgb(255 255 255 / .22);
    box-shadow: 0 22px 50px -24px rgb(0 0 0 / .55);
    backdrop-filter: blur(18px) saturate(1.25);
    -webkit-backdrop-filter: blur(18px) saturate(1.25);
  }
  .auth .input {
    background: rgb(255 255 255 / .94);
    border-color: transparent;
  }
  .auth .field__label,
  .auth .checkline__box { color: color-mix(in oklab, white 86%, transparent); }
  .auth .checkline input { accent-color: var(--gold); }
  .auth .checkline { padding-inline: 0; }
  .auth__foot {
    position: relative;
    z-index: 2;
    margin-block-start: auto;
    padding: 16px 22px calc(18px + env(safe-area-inset-bottom));
    display: grid;
    gap: 10px;
    justify-items: center;
  }
  .auth__link { font-size: var(--fs-sm); font-weight: 700; color: var(--gold); }
  .auth__fine { font-size: var(--fs-xs); color: color-mix(in oklab, white 62%, transparent); text-align: center; line-height: 1.6; }
  .auth__demo {
    display: grid; gap: 3px;
    padding: 11px 14px;
    border-radius: var(--r-md);
    background: rgb(255 255 255 / .08);
    border: 1px dashed rgb(238 212 132 / .38);
    font-size: var(--fs-xs);
    color: color-mix(in oklab, white 78%, transparent);
    text-align: center;
  }
  .auth__demo b { color: var(--gold); font-weight: 800; }
  .auth .btn--ghost {
    color: #fff;
    background: rgb(255 255 255 / .10);
    border: 1px solid rgb(255 255 255 / .28);
  }
  .auth .back {
    color: #fff;
    background: rgb(17 44 90 / .45);
    border-color: rgb(255 255 255 / .28);
    backdrop-filter: blur(10px);
  }

  /* language switch pill */
  .lang {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 13px;
    border-radius: var(--r-pill);
    font-size: var(--fs-xs); font-weight: 700;
    color: var(--navy);
    background: var(--gold);
  }
  .lang--onnavy { color: #fff; background: rgb(255 255 255 / .14); border: 1px solid rgb(255 255 255 / .24); }
  .lang--quiet {
    color: var(--navy);
    background: transparent;
    border: 1px solid color-mix(in oklab, var(--navy) 18%, transparent);
  }

  /* empty state */
  .empty {
    display: grid; justify-items: center; gap: 8px;
    padding: 34px 20px;
    border-radius: var(--r-md);
    background: var(--white);
    box-shadow: var(--sh-1);
    text-align: center;
    color: var(--ink-2);
    font-size: var(--fs-sm);
  }

  /* note / callout */
  .note {
    padding: 13px 15px;
    border-radius: var(--r-md);
    background: color-mix(in oklab, var(--gold) 26%, white);
    border: 1px solid color-mix(in oklab, var(--gold) 55%, white);
    font-size: var(--fs-sm);
    color: color-mix(in oklab, var(--navy) 82%, black);
    line-height: 1.55;
  }
  .note--navy { background: var(--navy-88); border-color: var(--navy-70); color: var(--navy); }

  /* index / launcher page */
  .launch {
    inline-size: min(560px, 92vw);
    padding: 34px 30px;
    border-radius: var(--r-xl);
    background: var(--white);
    box-shadow: var(--sh-3);
    display: grid; gap: 20px; justify-items: center;
    text-align: center;
  }
  .launch__logo { inline-size: 92px; block-size: 92px; object-fit: contain; }
  .launch__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; inline-size: 100%; }
  .launch__meta { font-size: var(--fs-xs); color: var(--ink-3); line-height: 1.7; }

  /* splash — logo in the middle, modern language choice */
  .app.app--splash {
    background:
      radial-gradient(120% 70% at 50% 18%, rgb(238 212 132 / .28), transparent 58%),
      linear-gradient(180deg, rgb(17 44 90 / .35) 0%, rgb(17 44 90 / .78) 42%, #0d1b38 100%),
      #112c5a url("../img/login.jpg") center / cover no-repeat;
  }
  .splash {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: calc(28px + env(safe-area-inset-top)) 22px calc(22px + env(safe-area-inset-bottom));
    color: #fff;
  }
  .splash__brand {
    display: grid;
    justify-items: center;
    gap: 14px;
    margin-block-end: auto;
    margin-block-start: auto;
    text-align: center;
  }
  .splash__logo {
    width: min(58%, 196px);
    height: auto;
    filter: drop-shadow(0 18px 36px rgb(0 0 0 / .28));
  }
  .splash__name {
    font-size: var(--fs-lg);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #fff;
  }
  .splash__hint {
    font-size: var(--fs-sm);
    color: color-mix(in oklab, var(--gold) 55%, white);
    font-weight: 600;
  }
  .splash__langs {
    display: grid;
    gap: 12px;
    width: 100%;
    margin-block-start: 28px;
  }
  .splash__lang {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    align-items: center;
    gap: 14px;
    min-block-size: 64px;
    padding: 12px 16px;
    border-radius: 20px;
    background: rgb(255 255 255 / .12);
    border: 1px solid rgb(255 255 255 / .18);
    color: #fff;
    box-shadow: 0 10px 28px -16px rgb(0 0 0 / .45);
    backdrop-filter: blur(10px);
  }
  .splash__lang:active { transform: scale(0.98); }
  .splash__lang--gold {
    background: var(--gold);
    border-color: transparent;
    color: var(--navy);
  }
  .splash__lang-code {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.04em;
    background: rgb(17 44 90 / .16);
    color: inherit;
  }
  .splash__lang--gold .splash__lang-code { background: rgb(17 44 90 / .10); }
  .splash__lang b { display: block; font-size: 16px; font-weight: 800; line-height: 1.2; }
  .splash__lang small { display: block; margin-top: 2px; font-size: 12px; opacity: .72; font-weight: 600; }
  .splash__lang-go { font-size: 22px; opacity: .55; font-weight: 400; }
  .splash__copy {
    margin: 16px 0 0;
    text-align: center;
    font-size: 11px;
    color: rgb(255 255 255 / .48);
    line-height: 1.5;
  }
  .splash__copy span { color: var(--gold); }
}

/* ---------------------------------------------------------- utils */
@layer utils {
  .stack { display: grid; gap: 12px; }
  .stack--sm { gap: 8px; }
  .row-flex { display: flex; align-items: center; gap: 10px; }
  .between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .grow { flex: 1; min-inline-size: 0; }
  .center { text-align: center; }
  .muted { color: var(--ink-2); }
  .tiny { font-size: var(--fs-xs); color: var(--ink-3); }
  .mt-a { margin-block-start: auto; }
  .nowrap { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hide { display: none; }
}

/* ------------------------------------------------- interactions */
.tile, .row, .quick, .cal, .card, .featured, .btn {
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}
.tile:active, .row:active, .quick:active, .cal:active, .card:active, .featured:active, .btn:active {
  transform: scale(0.98);
}

@media (hover: hover) {
  .tile:hover, .row:hover, .quick:hover, .cal:hover, .card:hover { transform: translateY(-1px); }
  .btn:hover { filter: brightness(1.06); }
  .photo:hover img { transform: scale(1.04); }
  .photo img { transition: transform .35s ease; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .tile:active, .row:active, .quick:active, .cal:active, .card:active, .featured:active, .btn:active,
  .nav__fab:hover, .nav__fab:active, .fab:hover, .fab:active { transform: none; }
}

@media print {
  body { background: #fff; display: block; }
  .app { inline-size: 100%; block-size: auto; box-shadow: none; border-radius: 0; }
  .nav, .fab { display: none; }
}
