/* ==========================================================================
   layout.css — the app shell and every page layout.

   The shell is imposed by the FROZEN core/Controller::view(), which prints
   (in this order): head.php, script.php, the i18n bridge, rtl.css, an inline
   <style> forcing `.page-container{height:93.5vh!important;width:100%!important}`,
   then <body class="fixed-header horizontal-menu horizontal-app-menu">,
   navbar.php, and finally four nested wrappers around the view:

       .page-container > .page-content-wrapper > .content > .container-fixed-lg

   We cannot change any of that, so:
     · the four wrappers become `display:contents`, which makes each view's own
       `.np-page` root a direct grid item of <body>;
     · the inline height is overridden with a higher-specificity `body …` rule
       (both are !important, so specificity decides);
     · everything that floats (sheets, drawer, toasts, keyboard, overlay) is
       `position:fixed` inside the viewport, offset by --np-shell-top.
   ========================================================================== */

/* ==========================================================================
   1 · The frame
   ========================================================================== */

:root {
  --np-offline-h: 0px;
  --np-shell-top: calc(var(--np-topbar-h) + var(--np-offline-h));
  --np-sheet-inset-end: 0px;
}

html { height: 100%; }

body {
  /* NO `min-height: 100vh` here. `min-height` always beats `height`, so the
     squeeze below would compute and then be thrown away: the frame stayed a
     full viewport tall and the keyboard COVERED it — sheet footers and the
     cart landed underneath it and could not be tapped (F001/F074/F185). */
  min-height: 0;
  /* The virtual keyboard squeezes the app instead of covering it (G8): it
     publishes its height as --np-kb-h and the frame shrinks by exactly that. */
  height: calc(100vh - var(--np-kb-h, 0px));
  height: calc(100svh - var(--np-kb-h, 0px));
  margin: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr);
  grid-template-areas:
    "topbar  topbar"
    "offline offline"
    "rail    view";
}

/* Pre-session screens (login, PIN, 404/500) have no shell at all. */
body.np-bare {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "view";
}

/* Neutralise the legacy wrappers. Higher specificity than the inline <style>. */
body .page-container,
body .page-content-wrapper,
body .content,
body .container,
body .container-fixed-lg {
  display: contents !important;
  height: auto !important;
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  background: none !important;
  border: 0 !important;
}

/* Every view's root. */
.np-page {
  grid-area: view;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--np-cream);
}

/* ==========================================================================
   2 · Top bar
   ========================================================================== */

.np-topbar {
  grid-area: topbar;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  height: var(--np-topbar-h);
  background: var(--np-ink);
  color: var(--np-cream);
  z-index: 50;
}
.np-topbar__burger {
  width: var(--np-touch); height: var(--np-touch);
  flex: none;
  min-height: 0;
  border-radius: var(--np-r-input);
  background: var(--np-onink-fill);
  color: var(--np-cream);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
}
/* The brand is an <a>: it must take the top bar's cream, not the link colour. */
.np-topbar__brand {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
  flex: none;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.np-topbar__brand:hover { color: inherit; }
.np-topbar__name { font-family: var(--np-font-title); font-size: 16px; letter-spacing: 0.01em; }
.np-topbar__tag {
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--np-onink-2);
  white-space: nowrap;
}
.np-topbar__logo { height: 30px; width: auto; max-width: 96px; object-fit: contain; flex: none; }

.np-tablechip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1px;
  margin-inline-start: var(--np-s2);
  min-height: 42px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: var(--np-r-btn);
  border: 1px solid var(--np-onink-border);
  background: var(--np-onink-fill-soft);
  color: var(--np-cream);
  text-align: start;
}
.np-tablechip__label { font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.75; }
.np-tablechip__value { font-size: var(--np-fs-body); font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

.np-topbar__status {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: var(--np-fs-secondary);
  color: var(--np-onink-1);
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
}
.np-clock { font-variant-numeric: tabular-nums; letter-spacing: 0.04em; white-space: nowrap; }
.np-orders { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.np-orders__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--np-net-off-dot); flex: none; }

.np-net {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: var(--np-r-pill);
  background: var(--np-net-ok-bg);
  color: var(--np-net-ok-ink);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.np-net.is-lan { background: var(--np-net-off-bg); color: var(--np-net-off-ink); }
.np-net__dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--np-net-ok-dot); box-shadow: 0 0 0 3px rgba(143, 211, 180, 0.2); display: none; }
.np-net.is-lan .np-net__dot { background: var(--np-net-off-dot); box-shadow: 0 0 0 3px rgba(224, 163, 60, 0.22); }

.np-userchip {
  display: flex;
  align-items: center;
  gap: var(--np-s2);
  flex: none;
  padding-inline-start: var(--np-s3);
  border-inline-start: 1px solid var(--np-onink-sep);
}
.np-userchip__badge {
  width: 30px; height: 30px;
  border-radius: var(--np-r-sm);
  background: var(--np-lav-strong);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 700;
  overflow: hidden;
}
.np-userchip__badge img { width: 100%; height: 100%; object-fit: cover; }
/* White on colour at 11.5 px bold needs 4.5:1, so the badges use the darker
   variants of the same hues (DECISIONS.md D-24). */
.np-userchip__badge--waiter { background: var(--np-waiter-badge-text); }
.np-userchip__badge--vendor,
.np-userchip__badge--user { background: var(--np-amber-badge-text); }
.np-userchip__names { display: flex; flex-direction: column; line-height: 1.15; }
.np-userchip__name { font-size: var(--np-fs-secondary); font-weight: 600; white-space: nowrap; }
.np-userchip__role { font-size: 10.5px; color: var(--np-onink-2); white-space: nowrap; }

/* ==========================================================================
   3 · Offline banner
   ========================================================================== */

.np-offline {
  grid-area: offline;
  display: flex;
  align-items: center;
  gap: var(--np-s3);
  padding: 9px 14px;
  background: var(--np-amber-soft);
  border-bottom: 1px solid var(--np-amber-line);
  color: var(--np-amber-banner-ink);
  font-size: 13px;
  z-index: 49;
}
.np-offline__title { font-weight: 700; flex: none; }
.np-offline__body { flex: 1; min-width: 0; }

/* ==========================================================================
   4 · Navigation rail (PC) and drawer (tablet / phone)
   ========================================================================== */

.np-rail {
  grid-area: rail;
  width: var(--np-rail-w);
  background: var(--np-surface);
  border-inline-end: 1px solid var(--np-line);
  display: flex;
  flex-direction: column;
  padding: var(--np-s2) 6px;
  gap: 2px;
  z-index: 20;
}
.np-rail__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 56px;
  padding: 9px 4px;
  border-radius: var(--np-r-btn);
  background: transparent;
  color: var(--np-dim);
  text-align: center;
}
.np-rail__item .np-ico { opacity: 0.75; }
.np-rail__item.is-active { background: var(--np-soft); color: var(--np-ink); }
.np-rail__item.is-active .np-ico { opacity: 1; }
.np-rail__label { font-size: 10px; font-weight: 600; letter-spacing: 0.01em; line-height: 1.15; }
.np-rail__quit { margin-block-start: auto; color: var(--np-dim); }
.np-rail__quit-mark { width: 16px; height: 16px; border-radius: 5px; border: 2px solid currentColor; }

@media (max-width: 1279px) {
  .np-rail { display: none; }
  .np-topbar__burger { display: flex; }
}

/* ==========================================================================
   5 · Floating layer: sheets, drawer, toasts, overlay, keyboard
   ========================================================================== */

.np-sheet,
.np-backdrop,
.np-drawer,
.np-drawer__backdrop,
.np-toasts,
.np-loading,
.np-paid {
  position: fixed;
}
/* `position: fixed` is relative to the VIEWPORT, not to the squeezed <body>,
   so the floating layer has to subtract the keyboard itself — otherwise a
   sheet still runs to the bottom of the screen and its footer buttons sit
   under the keys (F001/F074/F185). */
.np-sheet,
.np-backdrop,
.np-drawer,
.np-drawer__backdrop,
.np-loading,
.np-paid {
  inset-block-start: var(--np-shell-top);
  inset-block-end: var(--np-kb-h, 0px);
}
.np-backdrop,
.np-drawer__backdrop,
.np-loading,
.np-paid { inset-inline: 0; }

.np-sheet { inset-inline-start: 0; inset-inline-end: var(--np-sheet-inset-end); }
.np-sheet--end { inset-inline-start: auto; inset-inline-end: 0; }

.np-toasts { inset-block-start: calc(var(--np-shell-top) + 12px); }

@media (max-width: 899px) {
  .np-sheet,
  .np-sheet--end {
    inset-block-start: calc(var(--np-shell-top) + var(--np-sheet-gap, 14px));
    inset-inline: 0;
  }
  .np-sheet--end { --np-sheet-gap: 12%; }
}

/* ==========================================================================
   6 · POS (Caisse)
   ========================================================================== */

.np-page--pos {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "catrail grid cart";
  overflow: hidden;
}

.np-catrail {
  grid-area: catrail;
  width: var(--np-catrail-w);
  background: var(--np-surface);
  border-inline-end: 1px solid var(--np-line);
  overflow-y: auto;
  padding: 10px var(--np-s2) var(--np-s4);
}
.np-catrail__all {
  width: 100%;
  min-height: 44px;
  padding: 11px 10px;
  border-radius: var(--np-r-sm);
  text-align: start;
  justify-content: flex-start;
  font-size: 13.5px;
  background: transparent;
  color: var(--np-ink);
}
.np-catrail__all.is-on { background: var(--np-ink); color: var(--np-cream); }
.np-catgroup { margin-top: 10px; }
.np-catgroup__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 42px;
  padding: 10px;
  border-radius: var(--np-r-sm);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--np-ink);
}
.np-catgroup__head.is-open { background: var(--np-soft); }
.np-catgroup__count { font-size: var(--np-fs-label); color: var(--np-dim); font-weight: 600; }
.np-catgroup__list { display: flex; flex-direction: column; gap: 3px; padding-top: var(--np-s1); }
.np-cat {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 44px;
  padding: 11px 10px;
  border-radius: var(--np-r-sm);
  background: transparent;
  color: var(--np-ink);
  font-size: 13.5px;
  font-weight: 500;
  text-align: start;
}
.np-cat.is-on { background: var(--np-lav-soft); color: var(--np-lav-ink); font-weight: 700; }
.np-cat__dot { width: 8px; height: 8px; border-radius: 3px; background: var(--np-cat, var(--np-line)); flex: none; }
.np-cat__name { flex: 1; min-width: 0; text-align: start; }

.np-posmain {
  grid-area: grid;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--np-cream);
}
.np-searchrow {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 10px;
}
.np-searchrow__count { flex: none; font-size: var(--np-fs-secondary); color: var(--np-dim); }
.np-chiprow {
  flex: none;
  display: none;
  gap: 7px;
  padding: 0 12px 10px;
  overflow-x: auto;
}
.np-gridwrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 14px var(--np-s4);
  display: flex;
  flex-direction: column;
}
.np-grid {
  display: grid;
  grid-template-columns: repeat(var(--np-grid-cols), minmax(0, 1fr));
  gap: 10px;
  align-content: start;
}

/* Collapsed cart bar: hidden by default, revealed by the stacked media query
   below. Declared BEFORE that query so source order cannot override it. */
.np-cart__bar { display: none; }

.np-cart {
  grid-area: cart;
  width: var(--np-cart-w);
  display: flex;
  flex-direction: column;
  background: var(--np-surface-alt);
  border-inline-start: 1px solid var(--np-line);
  min-height: 0;
}
.np-cart__head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--np-s2);
  padding: 12px 14px var(--np-s2);
}
.np-cart__list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 10px var(--np-s2);
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.np-cart__foot {
  flex: none;
  border-top: 1px solid var(--np-line);
  background: var(--np-surface);
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.np-cart__discount { display: flex; align-items: center; justify-content: space-between; font-size: var(--np-fs-secondary); color: var(--np-mid); gap: var(--np-s2); }
.np-cart__totalrow { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.np-cart__totallabel { font-size: var(--np-fs-label); letter-spacing: 0.12em; text-transform: uppercase; color: var(--np-dim); padding-bottom: 6px; }
.np-cart__total { display: flex; align-items: baseline; gap: 5px; }
.np-cart__totalnum { font-size: var(--np-fs-display); font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.np-cart__totalcur { font-size: var(--np-fs-body); font-weight: 600; color: var(--np-mid); }
.np-cart__shortcuts { display: flex; gap: 6px; }

/* Send button: outline for a cashier, big solid ink for a waiter. */
.np-send {
  width: 100%;
  padding: 16px 18px;
  border-radius: var(--np-r-line);
  font-size: 15.5px;
  font-weight: 700;
  background: var(--np-surface);
  color: var(--np-ink);
  border: 1px solid var(--np-ink);
}
.np-send--waiter { padding: 22px 18px; font-size: var(--np-fs-sheet-title); background: var(--np-ink); color: var(--np-cream); border: 0; }
.np-pay { width: 100%; padding: 17px 18px; border-radius: var(--np-r-line); font-size: 16px; font-weight: 700; background: var(--np-ink); color: var(--np-cream); }
.np-cancel { width: 100%; min-height: var(--np-touch); padding: 11px; font-size: 13px; }

/* ---- tablet landscape ---------------------------------------------------- */
@media (max-width: 1279px) {
  .np-page--pos { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "grid cart"; }
  .np-catrail { display: none; }
  .np-chiprow { display: flex; }
}

/* ---- tablet portrait + phone: cart becomes a docked bottom panel --------- */
/* It used to be `position: fixed`, floating over the grid, and .np-gridwrap
   carried a 120 px bottom padding to compensate. The collapsed cart is 318 px
   tall on a phone (bar 63 + four stacked buttons 255), so ~200 px of products
   sat permanently underneath it: scrolled to the end of the list, tapping the
   last row hit "Encaisser" instead of the product (F002 — measured at
   390x844). No padding constant can be right, because the cart's height
   depends on the role, the discount and whether the order was sent.
   So the cart is laid out INSTEAD of overlaid: the POS column is a flex
   column, the products take what is left, and the page still never scrolls. */
@media (max-width: 899px) {
  .np-page--pos {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
    grid-template-areas: none;
  }
  /* The cart is `flex: 0 0 auto`, so .np-posmain is the item that gives way and
     it must be able to give way to ZERO — `min-height: 0`, never `auto`. With
     `auto` the automatic minimum size is content-based, and .np-gridwrap's
     content is the whole product list, so posmain's minimum came out at ~11 000
     px and the cart was squeezed to 1 px on every stacked viewport.
     `overflow: hidden` is the other half: once posmain is smaller than the
     search row + chip row + the grid's own padding (139 px together) those
     children used to paint OUTSIDE it — straight under the cart, which is F002
     again (measured: 22 px lost at 360x640, 16 px at 899x600). Clipped to its
     own box, nothing is ever drawn under the cart, at any height. */
  .np-posmain { flex: 1 1 auto; min-height: 0; overflow: hidden; }
  .np-searchrow { padding: 10px 12px; }
  .np-gridwrap { padding: 0 12px var(--np-s4); }
  .np-cart {
    position: relative;
    /* never grows, never shrinks below its content: it is exactly as tall as
       what it has to show, capped so it can never swallow the whole screen. */
    flex: 0 0 auto;
    width: auto;
    z-index: 24;
    border-inline-start: 0;
    border-top: 1px solid var(--np-line);
    border-start-start-radius: var(--np-r-sheet);
    border-start-end-radius: var(--np-r-sheet);
    box-shadow: var(--np-sh-cart-sheet);
    /* 58 % was below the panel's own content on a short screen — bar + foot is
       318 px and 58 % of a 480 px-tall tablet is 246 — and .np-page--pos is
       `overflow: hidden`, so the bottom of the footer was simply CUT OFF the
       screen: measured at 800x480 the footer ended at y=552 on a 480 px display
       and the cashier could not reach "Encaisser" at all. 72 % clears the
       tallest collapsed cart on every column at least ~440 px high (so it
       changes nothing at any supported viewport) and still leaves the products
       better than a quarter of the column on the short ones. */
    max-height: 72%;
    /* And whatever the cap ends up being, the panel scrolls rather than hides
       an action: a button the till needs must never be unreachable. */
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  /* Open, the cart may take four fifths of the column: with 58 % the list got
     171 px against a 255 px footer — under two order lines (F167). */
  .np-cart.is-open { max-height: 80%; }
  /* Collapsed, the bar is the summary and the footer the actions; the order
     state, the "not saved" badge and the customer badge come back with the
     list the moment the cart is opened (F009). */
  .np-cart__head { display: none; }
  .np-cart.is-open .np-cart__head { display: flex; padding: 8px 14px 4px; }
  .np-cart__bar {
    display: flex;
    align-items: center;
    gap: var(--np-s3);
    width: 100%;
    border-bottom: 1px solid var(--np-line);
    background: var(--np-surface);
    padding: 12px 14px;
    text-align: start;
    flex: none;
    /* The bar is how the cart is closed again: it stays at the top of the
       panel even on a screen short enough to make the panel scroll. */
    position: sticky;
    inset-block-start: 0;
    z-index: 1;
  }
  .np-cart__list { display: none; }
  .np-cart.is-open .np-cart__list { display: flex; }
  .np-cart__foot { padding: 10px; gap: var(--np-s2); }
  .np-cart__totalrow,
  .np-cart__discount { display: none; }
  .np-cart.is-open .np-cart__discount { display: flex; }
}
.np-cart__barcount {
  width: 34px; height: 34px; flex: none;
  border-radius: var(--np-r-btn);
  background: var(--np-ink);
  color: var(--np-cream);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--np-fs-body);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.np-cart__barmid { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.np-cart__bartotal { display: flex; align-items: baseline; gap: var(--np-s1); }
.np-cart__bartotalnum { font-size: var(--np-fs-cart-total); font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* ---- phone --------------------------------------------------------------- */
@media (max-width: 599px) {
  .np-topbar { padding: 0 10px; gap: var(--np-s2); }
  .np-topbar__tag { display: none; }
  .np-userchip { padding-inline-start: 0; border-inline-start: 0; }
  .np-userchip__names { display: none; }
  .np-topbar__status { gap: 9px; }
  .np-net { padding: 0; background: none !important; }
  .np-net__label { display: none; }
  .np-net__dot { display: block; }
  .np-tablechip { max-width: 92px; margin-inline-start: var(--np-s1); padding: 6px 10px; }
  .np-searchrow__count { display: none; }
  .np-grid { gap: var(--np-s2); }
}
@media (max-width: 1279px) { .np-tablechip { min-height: 48px; } }

/* ==========================================================================
   7 · Administration pages
   ========================================================================== */

.np-pagehead {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 18px var(--np-s4) 12px;
}
.np-pagehead__titles { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.np-pagehead .np-search { flex: 0 1 240px; min-height: calc(var(--np-touch) + 4px); }

.np-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 var(--np-s4) 22px;
}

/* Two panes that scroll independently on PC and tablet-landscape: with thirty
   categories, letting the whole page scroll would push the products pane out of
   sight the moment you pick a category near the bottom. Below 900 px the panes
   stack and the page scrolls as one, which is what a phone wants. */
.np-content--panes { overflow: hidden; display: flex; }
.np-content--panes > .np-twopane { flex: 1; min-height: 0; }
@media (min-width: 900px) {
  .np-content--panes .np-twopane__list,
  .np-content--panes .np-twopane__detail {
    max-height: 100%;
    overflow-y: auto;
    padding-bottom: var(--np-s4);
  }
}
@media (max-width: 899px) {
  .np-content--panes { overflow-y: auto; display: block; }
}

.np-twopane { display: flex; gap: 14px; align-items: flex-start; }
.np-twopane__list { flex: 0 0 var(--np-menu-pane-w); width: 100%; max-width: var(--np-menu-pane-w); }
.np-twopane__detail { flex: 1; min-width: 0; width: 100%; }

.np-cardsgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 1800px) { .np-cardsgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.np-kpigrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }

.np-split { display: flex; gap: 12px; align-items: flex-start; }
.np-split__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.np-split__side { flex: 0 0 var(--np-donut-pane-w); width: 100%; max-width: var(--np-donut-pane-w); }

/* The stacked replacement for a data table. Declared BEFORE the media query
   that reveals it, or source order would keep it hidden for ever — the same
   trap the collapsed cart bar fell into. */
.np-stacklist { display: none; flex-direction: column; gap: var(--np-s2); }

.np-settings { display: flex; gap: 14px; align-items: flex-start; }
.np-settings__nav { flex: 0 0 var(--np-settings-nav-w); width: 100%; max-width: var(--np-settings-nav-w); }
.np-settings__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }

@media (max-width: 899px) {
  .np-pagehead { padding: 14px var(--np-s4) 10px; }
  .np-twopane,
  .np-split,
  .np-settings { flex-direction: column; }
  .np-twopane__list,
  .np-split__side,
  .np-settings__nav { flex: none; max-width: none; }
  .np-settings__nav { flex-direction: row; flex-wrap: wrap; }
  .np-set-nav { flex-direction: row; flex-wrap: wrap; }
  .np-set-nav__item { width: auto; border-radius: var(--np-r-pill); border-color: var(--np-line-input); background: var(--np-surface); }
  .np-set-nav__hint { display: none; }
  .np-table { display: none; }
  .np-stacklist { display: flex; }
}

@media (max-width: 599px) {
  .np-pagehead .np-search { flex: 1 1 100%; }
  .np-cardsgrid { grid-template-columns: minmax(0, 1fr); }
  .np-kpigrid { grid-template-columns: minmax(0, 1fr); }
}

/* ==========================================================================
   8 · Pre-session screens (login, PIN, wizard, activation, 404)
   ========================================================================== */

.np-center {
  grid-area: view;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 26px;
  background: var(--np-cream);
  overflow-y: auto;
}
.np-wordmark { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.np-wordmark__name { font-family: var(--np-font-title); font-size: 30px; letter-spacing: -0.01em; }
.np-wordmark__tag { font-size: var(--np-fs-label); letter-spacing: 0.2em; text-transform: uppercase; color: var(--np-dim); }

.np-accounts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  max-width: 660px;
}
@media (max-width: 899px) { .np-accounts { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 520px; } }
@media (max-width: 599px) { .np-accounts { grid-template-columns: minmax(0, 1fr); max-width: 300px; } }

.np-wizard { width: 100%; max-width: 640px; display: flex; flex-direction: column; gap: var(--np-s4); margin: 0 auto; padding: 24px 0; }
.np-activate { width: 100%; max-width: 700px; display: flex; flex-wrap: wrap; gap: var(--np-s4); margin: 0 auto; padding: 24px 0; }
.np-404__num { font-family: var(--np-font-title); font-size: 58px; letter-spacing: -0.03em; }
