/* CORE: reusable — nz-shell v1 (contract 24 Oct 2026) */
/* ════════════════════════════════════════════════════════════════════════════════════════════════
   The chrome of the NAZORAT product: ONE header, a bottom bar on a phone, a light sidebar on a
   desktop, a Menyu sheet, section tabs, and the card/chip/list components the two apps share. The
   class names and the tokens below are the contract: Asl-Charm and Lux Gofra carry the same file,
   and each app maps --nz-* onto its OWN palette in one CONFIG block (templates/base.html). Not one
   literal colour, not one client word, not one client section lives here.

   Breakpoints (behaviour 1):
     below 1024px — nz-top + nz-bar. No sidebar, no top tab strip, no floating button.
     1024px and up — nz-side + nz-top, no bar.
   ════════════════════════════════════════════════════════════════════════════════════════════════ */

/* ── nz-top: one header row, 56–64px. Logo · short name over the page title · search · bell. ── */
.nz-logo {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 9px;
  background: var(--nz-logo); border: 1px solid var(--nz-line);
  display: grid; place-items: center; color: var(--nz-ink); font-weight: 700; font-size: 15px;
}
.nz-logo svg { width: 22px; height: 22px; display: block; }
.nz-icon {
  width: 44px; height: 44px; flex: none; padding: 0; border: 0; border-radius: 10px;
  background: transparent; color: var(--nz-ink); display: grid; place-items: center;
  cursor: pointer; position: relative; text-decoration: none;
}
.nz-icon .ico { width: 21px; height: 21px; }
.nz-icon:focus-visible { outline: 2px solid var(--nz-accent); outline-offset: 2px; }

/* ── nz-greet: the date line, the kurs beside it, and the freshness stamp on the right ── */
.nz-greet {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 0 2px; flex-wrap: wrap;
}
.nz-greet .nz-date {
  margin: 0; font-size: 12px; color: var(--nz-muted); font-variant-numeric: tabular-nums;
}
.nz-greet .nz-date b { color: var(--nz-ink-2); font-weight: 600; }
.nz-greet h2 { margin: 2px 0 0; font-size: 21px; font-weight: 600; letter-spacing: -.2px; color: var(--nz-ink); flex: 1 0 100%; }
/* the stamp. A button, because it reloads: a figure nobody can refresh is a lie (Step 69's live-dot
   rule). Fresh is the ok ink with a dot; stale or offline is the warn chip. */
.nz-stamp {
  min-height: 44px; margin: -11px -8px -11px 0; padding: 0 8px; border: 0; border-radius: 8px;
  background: transparent; font: 500 11.5px var(--nz-font); color: var(--nz-ok);
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap;
}
.nz-stamp .nz-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--nz-ok); }
.nz-stamp .ico { width: 14px; height: 14px; }
.nz-stamp:focus-visible { outline: 2px solid var(--nz-accent); outline-offset: 2px; }
.nz-stamp[data-nz-stale="1"] {
  color: var(--nz-warn); background: var(--nz-warn-bg); font-weight: 600;
  margin-right: 0; padding: 3px 9px; border-radius: 20px; min-height: 44px;
}
.nz-stamp[data-nz-stale="1"] .nz-dot { background: var(--nz-warn); }

/* ── nz-chip: a pill. The TEXT states the fact; colour is never the only signal. ── */
.nz-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font: 600 11.5px var(--nz-font); padding: 3px 9px; border-radius: 20px;
  background: var(--nz-neutral-bg); color: var(--nz-neutral); white-space: nowrap;
}
.nz-chip--ok { background: var(--nz-ok-bg); color: var(--nz-ok); }
.nz-chip--info { background: var(--nz-info-bg); color: var(--nz-info); }
.nz-chip--warn { background: var(--nz-warn-bg); color: var(--nz-warn); }
.nz-chip--bad { background: var(--nz-bad-bg); color: var(--nz-bad); }
.nz-chip--neutral { background: var(--nz-neutral-bg); color: var(--nz-neutral); }
/* a chip that is a LINK is also a tap target, so it gets its 44px (accessibility, behaviour 11).
   The negative margins keep the row the height the pill drew it, the way .nz-stamp does. */
a.nz-chip { min-height: 44px; margin-top: -11px; margin-bottom: -11px; border-radius: 12px; text-decoration: none; }
a.nz-chip:hover { text-decoration: none; }

/* ── nz-kpi: a KPI card. One nz-act at the foot, at most. ── */
.nz-kpi {
  background: var(--nz-card); border: 1px solid var(--nz-line); border-radius: 14px;
  padding: 13px 16px 0; margin: 0 0 10px;
}
.nz-kpi > :last-child:not(.nz-act) { margin-bottom: 13px; }
.nz-kpi .nz-l { margin: 0; font-size: 12.5px; color: var(--nz-muted); }
.nz-kpi .nz-v {
  margin: 3px 0 0; display: flex; align-items: baseline; gap: 5px;
  font-variant-numeric: tabular-nums;
}
.nz-kpi .nz-v b { font-size: 27px; font-weight: 700; letter-spacing: -.5px; color: var(--nz-ink); }
.nz-kpi .nz-u { font-size: 13px; color: var(--nz-ink-2); }
.nz-kpi .nz-d { margin: 4px 0 0; font-size: 12px; color: var(--nz-muted); }
.nz-kpi figure { margin: 2px 0 0; text-align: right; flex: none; }
.nz-kpi figcaption { font-size: 10.5px; color: var(--nz-muted); }
.nz-kpi--hero {
  background: var(--nz-accent); border-color: var(--nz-accent); color: var(--nz-on-accent);
  border-radius: 16px; padding: 15px 16px 14px;
}
.nz-kpi--hero .nz-l, .nz-kpi--hero .nz-u, .nz-kpi--hero .nz-d { color: var(--nz-on-accent); }
.nz-kpi--hero .nz-v b { font-size: 40px; letter-spacing: -1px; color: var(--nz-on-accent); }

/* ── nz-act: ONE full-width link at the foot of a card — a chip on the left, a verb and a chevron
      on the right. 44px, with a hairline above it. ── */
.nz-act {
  margin-top: 10px; min-height: 44px; border-top: 1px solid var(--nz-line);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  text-decoration: none; color: var(--nz-ink); font: 600 13px var(--nz-font);
}
.nz-act:hover { text-decoration: none; color: var(--nz-ink); }
.nz-act .nz-go { display: inline-flex; align-items: center; gap: 2px; }
.nz-act .ico { width: 16px; height: 16px; }

/* ── nz-lcard: a list card, three lines. The WHOLE card is the link; no destructive button on it. ── */
.nz-lcard {
  display: block; background: var(--nz-card); border: 1px solid var(--nz-line);
  border-radius: 12px; padding: 11px 14px; margin: 0 0 8px;
  text-decoration: none; color: var(--nz-ink);
}
.nz-lcard:hover { text-decoration: none; color: var(--nz-ink); }
.nz-lcard .nz-l1 { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.nz-lcard .nz-subj { font-size: 15px; font-weight: 600; min-width: 0; }
.nz-lcard .nz-amt { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nz-lcard .nz-l2 { display: flex; align-items: center; gap: 7px; margin-top: 4px; font-size: 12.5px; color: var(--nz-ink-2); }
.nz-lcard .nz-l3 { display: flex; justify-content: space-between; gap: 10px; margin-top: 4px; font-size: 11.5px; color: var(--nz-muted); }
.nz-dayhead {
  margin: 10px 0 6px; font: 600 11px var(--nz-font); letter-spacing: 1px;
  text-transform: uppercase; color: var(--nz-muted);
}

/* ── nz-filters: period chips, a Filtr button, then the totals and the honesty line ── */
.nz-filters { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.nz-filters .nz-pchip {
  font: 600 12.5px var(--nz-font); padding: 7px 12px; border-radius: 20px;
  background: var(--nz-card); border: 1px solid var(--nz-line); color: var(--nz-ink-2);
  text-decoration: none; white-space: nowrap; min-height: 44px;
  display: inline-flex; align-items: center; box-sizing: border-box;
}
/* an active chip is INK, not accent: one filled accent element per screen (behaviour 4) */
.nz-filters .nz-pchip[aria-current="true"] { background: var(--nz-ink); border-color: var(--nz-ink); color: var(--nz-card); }
.nz-totals { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.nz-totals p { margin: 0; font-size: 13px; color: var(--nz-ink-2); font-variant-numeric: tabular-nums; }
.nz-totals .nz-honest { margin: 1px 0 0; font-size: 11px; color: var(--nz-muted); }

/* ── nz-tabs: a section's sub-pages. The active tab is ink with an accent rule under it. ── */
.nz-tabs {
  display: flex; gap: 2px; padding: 0 2px; margin: 0 0 2px;
  overflow-x: auto; overflow-y: hidden; white-space: nowrap;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.nz-tabs::-webkit-scrollbar { height: 0; }
/* ON A PHONE THE ROW WRAPS INSTEAD OF SCROLLING. The contract says the tabs scroll sideways, and
   above 620px they do. Below it, this client has already settled the question the other way: Step 99
   (Abdumalik, 20 Oct — "Yonga surib ko'rish noqulay ekan-da") took every sideways-scrolling box off
   the phone, because a box that scrolls inside a page that does not is the one gesture nobody finds.
   A wrapped row shows all seven pages at once; nothing is hidden and nothing is swiped. */
@media (max-width: 620px) {
  .nz-tabs { flex-wrap: wrap; overflow: visible; white-space: normal; }
  .nz-tabs a { padding: 9px 8px 8px; }
}
.nz-tabs a {
  padding: 11px 10px 10px; font: 500 13.5px var(--nz-font); color: var(--nz-muted);
  text-decoration: none; border-bottom: 2px solid transparent;
  min-height: 44px; box-sizing: border-box; display: inline-flex; align-items: center;
}
.nz-tabs a:hover { color: var(--nz-ink); text-decoration: none; }
.nz-tabs a[aria-current="page"] { font-weight: 600; color: var(--nz-ink); border-bottom-color: var(--nz-accent); }
.nz-tabs a:focus-visible { outline: 2px solid var(--nz-accent); outline-offset: -2px; }

/* ── nz-bar: the bottom bar, below 1024px. Five columns; the fifth is Menyu. ── */
.nz-bar { display: none; }
.nz-count {
  position: absolute; min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box;
  border-radius: 9px; border: 2px solid var(--nz-card); background: var(--nz-bad);
  color: var(--nz-card); font: 700 10px/1 var(--nz-font); display: grid; place-items: center;
}
.nz-bar .nz-count { top: 3px; left: calc(50% + 3px); }
.nz-bar .nz-pip {
  position: absolute; top: 7px; left: calc(50% + 7px); width: 9px; height: 9px;
  box-sizing: border-box; border-radius: 50%; border: 2px solid var(--nz-card);
  background: var(--nz-bad);
}
@media (max-width: 1023.9px) {
  .nz-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    background: var(--nz-card); border-top: 1px solid var(--nz-line);
    /* Step 168 (a client's owner, on his iPhone: "the lower five are too low to press"): the bar stands ABOVE the
       phone's home line — the safe area where the phone reports one, never less than 14px — and each item is a
       full thumb tall. */
    padding: 6px 4px max(env(safe-area-inset-bottom, 0px), 14px);
  }
  .nz-bar a, .nz-bar button {
    min-height: 58px; border: 0; background: none; font-family: var(--nz-font);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    text-decoration: none; color: var(--nz-muted); position: relative; cursor: pointer;
    padding: 2px 0 6px;
  }
  .nz-bar a:hover { text-decoration: none; color: var(--nz-ink); }
  .nz-bar .ico { width: 24px; height: 24px; }
  .nz-bar span.nz-w { font: 600 11px/1.2 var(--nz-font); max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .nz-bar [aria-current="page"], .nz-bar [aria-expanded="true"] { color: var(--nz-accent); }
  .nz-bar a:focus-visible, .nz-bar button:focus-visible { outline: 2px solid var(--nz-accent); outline-offset: -3px; }
}

/* ── nz-sheet: the Menyu sheet, sitting above the bar ── */
.nz-sheet, .nz-scrim { display: none; }
.nz-sheet[data-nz-open="1"], .nz-scrim[data-nz-open="1"] { display: block; }
.nz-scrim { position: fixed; inset: 0; z-index: 41; background: var(--nz-scrim); border: 0; width: 100%; }
.nz-sheet {
  position: fixed; left: 0; right: 0; z-index: 42;
  bottom: calc(70px + env(safe-area-inset-bottom, 0px));
  max-height: 78vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: var(--nz-card); border-radius: 20px 20px 0 0;
  padding: 8px 16px 14px; box-shadow: var(--nz-pop);
}
.nz-sheet .nz-handle { width: 38px; height: 4px; border-radius: 2px; background: var(--nz-line); margin: 0 auto 12px; }
.nz-sheet .nz-q { position: relative; }
.nz-sheet .nz-q .ico { position: absolute; left: 14px; top: 14px; width: 18px; height: 18px; color: var(--nz-muted); }
.nz-sheet input[type="search"] {
  width: 100%; box-sizing: border-box; height: 46px; border: 1px solid var(--nz-line);
  border-radius: 12px; background: var(--nz-ground); padding: 0 14px 0 42px;
  font: 400 14px var(--nz-font); color: var(--nz-ink);
}
.nz-sheet h3 {
  margin: 16px 0 8px; font: 600 11px var(--nz-font); letter-spacing: 1px;
  text-transform: uppercase; color: var(--nz-muted);
}
.nz-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.nz-tile {
  min-height: 76px; border: 1px solid var(--nz-line); border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  text-decoration: none; color: var(--nz-ink); position: relative; padding: 6px 4px; text-align: center;
}
.nz-tile:hover { text-decoration: none; color: var(--nz-ink); background: var(--nz-ground); }
.nz-tile .ico { width: 22px; height: 22px; }
.nz-tile span.nz-w { font: 600 12.5px/1.25 var(--nz-font); }
.nz-tile .nz-count { top: 7px; right: 8px; left: auto; border-color: var(--nz-card); }
.nz-tile:focus-visible { outline: 2px solid var(--nz-accent); outline-offset: 2px; }
.nz-rows { display: flex; flex-direction: column; }
.nz-rows a, .nz-pages a {
  min-height: 48px; display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--nz-ink); border-bottom: 1px solid var(--nz-line);
  font: 500 14px var(--nz-font);
}
.nz-rows a:hover, .nz-pages a:hover { text-decoration: none; color: var(--nz-ink); }
.nz-rows a .ico, .nz-pages a .ico { width: 20px; height: 20px; flex: none; }
.nz-rows a span.nz-w, .nz-pages a span.nz-w { flex: 1; min-width: 0; }
.nz-who { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.nz-who .nz-av {
  width: 36px; height: 36px; flex: none; border-radius: 50%;
  background: var(--nz-neutral-bg); color: var(--nz-neutral);
  display: grid; place-items: center; font: 700 14px var(--nz-font);
}
.nz-who b { display: block; font: 600 13.5px var(--nz-font); color: var(--nz-ink); }
.nz-who small { font-size: 11.5px; color: var(--nz-muted); }
.nz-who .nz-out {
  min-height: 44px; display: flex; align-items: center; padding: 0 4px;
  font: 600 13px var(--nz-font); color: var(--nz-ink-2); text-decoration: none;
  background: none; border: 0; cursor: pointer; font-family: var(--nz-font);
}
/* the sheet's search filters the pages it already carries — nothing is fetched */
.nz-sheet [data-nz-hit="0"] { display: none; }
.nz-pages { display: none; }
.nz-pages a small { font-size: 11px; color: var(--nz-muted); flex: none; }
.nz-sheet[data-nz-q="1"] .nz-tiles, .nz-sheet[data-nz-q="1"] .nz-rows, .nz-sheet[data-nz-q="1"] .nz-who { display: none; }
.nz-sheet[data-nz-q="1"] .nz-pages { display: flex; flex-direction: column; }
.nz-sheet .nz-none { margin: 10px 0 0; font-size: 13px; color: var(--nz-muted); }

/* ── 1024px and up: no bar, no sheet; the sidebar is SECTIONS only and the tabs carry the pages ── */
@media (min-width: 1024px) {
  .nz-bar, .nz-sheet, .nz-scrim { display: none !important; }
  /* the fold-out stays in the DOM — behaviour 12, nothing is ever deleted — it is simply not drawn
     here, because its pages are the nz-tabs row on the section's own page. The selector has to beat
     the shell's own `.ngrp.open > .ngb { display: block }`, which is three classes deep. */
  .nz-side-sections .ngrp .ngb,
  .nz-side-sections .ngrp.open > .ngb,
  .nz-side-sections .ngrp.fixed > .ngb { display: none; }
  .nz-side-sections .ngrp > .chev { display: none; }
  .nz-side-sections .ngrp > .navi { padding-right: 12px; }
  /* the rail's lockup already carries the mark, so the header does not draw a second one */
  .nz-logo { display: none; }
}

/* a label a screen reader reads and the eye does not need */
.nz-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
